!function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=79)}({19:function(e,t,r){var n,o,i;o=[],void 0===(i="function"==typeof(n=function(){var e=XMLHttpRequest;if(!e)throw new Error("missing XMLHttpRequest");function t(i,a){if("function"!=typeof a)throw new Error("Bad callback given: "+a);if(!i)throw new Error("No options given");var s=i.onResponse;if((i="string"==typeof i?{uri:i}:JSON.parse(JSON.stringify(i))).onResponse=s,i.verbose&&(t.log=function(){var e,t,r={},i=["trace","debug","info","warn","error"];for(t=0;t>18&63,i=u>>12&63,a=u>>6&63,s=63&u,p[l++]=d.charAt(o)+d.charAt(i)+d.charAt(a)+d.charAt(s)}while(c299)&&n.error){for(var o in e=new Error("CouchDB error: "+(n.error.reason||n.error.error)),n)e[o]=n[o];return r(e,t,n)}return r(e,t,n)}))},t})?n.apply(t,o):n)||(e.exports=i)},32:function(e,t,r){"use strict";r.d(t,"a",(function(){return i}));var n=r(19),o=r.n(n);async function i(e=""){""===e||e.endsWith("/")||(e+="/");const t=a(`${e}config.${document.domain}.json`),r=a(e+"config.json");try{const e=await t;if(0===Object.keys(e).length)throw new Error;return e}catch(e){return await r}}function a(e){return new Promise((function(t,r){o()({method:"GET",url:e,qs:{cachebuster:Date.now()}},(e,n,o)=>{try{if(e||n.status<200||n.status>=300)return n&&(404==n.status||0==n.status&&""==o)&&t({}),void r({err:e,response:n});t(JSON.parse(o))}catch(e){r({err:e})}})}))}},79:function(e,t,r){"use strict";r.r(t);var n=r(32);function o(){document.cookie="element_mobile_redirect_to_guide=false;path=/;max-age=14400",window.location.href="../"}function i(e){e=`

Error loading Element

${e}

If this is unexpected, please contact your system administrator or technical support representative.

`;const t=document.getElementsByClassName("mx_HomePage_container"),r=document.getElementsByClassName("mx_HomePage_errorContainer");for(const e of t)e.innerHTML="";for(const t of r)t.style.display="block",t.innerHTML=e}!async function(){document.getElementById("back_to_element_button").onclick=o;const e=await Object(n.a)(".."),t=e.default_server_config,r=e.default_server_name,a=e.default_hs_url,s=e.default_is_url,u=[t,r,a].filter(e=>!!e);if(u.length>1)return i("Invalid configuration: can only specify one of default_server_config, default_server_name, or default_hs_url.");if(u.length<1)return i("Invalid configuration: no default server specified.");let d="",c="";if(t&&t["m.homeserver"]&&(d=t["m.homeserver"].base_url,t["m.identity_server"]&&(c=t["m.identity_server"].base_url)),r)try{const e=await fetch(`https://${r}/.well-known/matrix/client`),t=await e.json();t&&t["m.homeserver"]&&(d=t["m.homeserver"].base_url,t["m.identity_server"]&&(c=t["m.identity_server"].base_url))}catch(e){return console.error(e),i("Unable to fetch homeserver configuration")}if(a&&(d=a,c=s),!d)return i("Unable to locate homeserver");d&&!d.endsWith("/")&&(d+="/"),c&&!c.endsWith("/")&&(c+="/"),"https://matrix.org/"!==d&&(document.getElementById("configure_element_button").href="https://mobile.element.io?hs_url="+encodeURIComponent(d)+"&is_url="+encodeURIComponent(c),document.getElementById("step1_heading").innerHTML="1: Install the app",document.getElementById("step2_container").style.display="block",document.getElementById("hs_url").innerText=d,c&&(document.getElementById("custom_is").style.display="block",document.getElementById("is_url").style.display="block",document.getElementById("is_url").innerText=c))}()}}); //# sourceMappingURL=mobileguide.js.map