You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

2 lines
7.5 KiB

(window.webpackJsonp=window.webpackJsonp||[]).push([[15],{1540:function(e,t,n){var o={"./":[247,9],"./ICanvasEffect":[923,7,11],"./ICanvasEffect.ts":[923,7,11],"./confetti":[480,9,1],"./confetti/":[480,9,1],"./confetti/index":[480,9,1],"./confetti/index.ts":[480,9,1],"./effect":[924,9,12],"./effect.ts":[924,9,12],"./fireworks":[481,9,2],"./fireworks/":[481,9,2],"./fireworks/index":[481,9,2],"./fireworks/index.ts":[481,9,2],"./hearts":[482,9,3],"./hearts/":[482,9,3],"./hearts/index":[482,9,3],"./hearts/index.ts":[482,9,3],"./index":[247,9],"./index.ts":[247,9],"./rainfall":[483,9,4],"./rainfall/":[483,9,4],"./rainfall/index":[483,9,4],"./rainfall/index.ts":[483,9,4],"./snowfall":[484,9,5],"./snowfall/":[484,9,5],"./snowfall/index":[484,9,5],"./snowfall/index.ts":[484,9,5],"./spaceinvaders":[485,9,6],"./spaceinvaders/":[485,9,6],"./spaceinvaders/index":[485,9,6],"./spaceinvaders/index.ts":[485,9,6],"./utils":[309,9],"./utils.ts":[309,9]};function r(e){if(!n.o(o,e))return Promise.resolve().then((function(){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}));var t=o[e],r=t[0];return Promise.all(t.slice(2).map(n.e)).then((function(){return n.t(r,t[1])}))}r.keys=function(){return Object.keys(o)},r.id=1540,e.exports=r},1551:function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var o=n(120),r=n(131);class a extends o.PureComponent{render(){var e;const t=r.b.getObject("branding"),n=null!==(e=null==t?void 0:t.get("auth_header_logo_url"))&&void 0!==e?e:"themes/element/img/logos/element-logo.svg";return o.createElement("aside",{className:"mx_AuthHeaderLogo"},o.createElement("img",{src:n,alt:"Element"}))}}},1596:function(e,t,n){"use strict";n.r(t),n.d(t,"loadApp",(function(){return k}));n(1451);var o=n(120),r=n.n(o),a=n(157),i=n(121),l=n(345),s=n(321),c=n(467),d=n(131),u=n(1),g=n(136),f=n(26),w=n(1462),m=n(40);let h=null;function v(e){const t=Object(m.b)(e);return{screen:t.location.substring(1),params:t.params}}function p(){decodeURIComponent(window.location.hash)!==h&&function(e){if(!window.matrixChat)return;u.a.log("Routing URL ",e.href);const t=v(e);window.matrixChat.showScreen(t.screen,t.params)}(window.location)}function _(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];u.a.log("newscreen "+e);const n="#/"+e;h=n,e.startsWith("room/")&&window.location.hash.includes("/$")===n.includes("/$")&&window.location.hash.startsWith(n)&&(t=!0),t?window.location.replace(n):window.location.assign(n)}function b(e){let t;t="vector:"===window.location.protocol?"https://app.element.io/#/register":window.location.protocol+"//"+window.location.host+window.location.pathname+"#/register";const n=Object.keys(e);for(let o=0;o<n.length;++o){t+=0===o?"?":"&";const r=n[o];t+=r+"="+encodeURIComponent(e[r])}return t}function x(){const e=new URL(window.location.href);e.searchParams.delete("loginToken"),u.a.log(`Redirecting to ${e.href} to drop loginToken from queryparams`),window.history.replaceState(null,"",e.href)}async function k(e){var t;window.addEventListener("hashchange",p);const n=a.a.get(),o=Object(m.a)(window.location),h=window.location.protocol+"//"+window.location.host+window.location.pathname;u.a.log("Vector starting at "+h),n.startUpdater();const k=await async function(){let e;try{u.a.log("Verifying homeserver configuration");const t=d.b.get();let n=t.default_server_config;const o=t.default_server_name,r=t.default_hs_url,a=t.default_is_url,c=[n,o,r].filter((e=>!!e));if(c.length>1)throw Object(i.i)(Object(i.c)("Invalid configuration: can only specify one of default_server_config, default_server_name, or default_hs_url."));if(c.length<1)throw Object(i.i)(Object(i.c)("Invalid configuration: no default server specified."));r&&(u.a.log("Config uses a default_hs_url - constructing a default_server_config using this information"),u.a.warn("DEPRECATED CONFIG OPTION: In the future, default_hs_url will not be accepted. Please use default_server_config instead."),n={"m.homeserver":{base_url:r}},a&&(n["m.identity_server"]={base_url:a}));let g=null;n&&(u.a.log("Config uses a default_server_config - validating object"),g=await s.a.fromDiscoveryConfig(n)),o&&(u.a.log("Config uses a default_server_name - doing .well-known lookup"),u.a.warn("DEPRECATED CONFIG OPTION: In the future, default_server_name will not be accepted. Please use default_server_config instead."),g=await s.a.findClientConfig(o)),e=l.a.buildValidatedConfigFromDiscovery(o,g,!0)}catch(t){const{hsUrl:n,isUrl:o,userId:r}=await c.c();if(!n||!r)throw t;u.a.error(t),u.a.warn("A session was found - suppressing config error and using the session's homeserver"),u.a.log("Using pre-existing hsUrl and isUrl: ",{hsUrl:n,isUrl:o}),e=await l.a.validateServerConfigWithStaticUrls(n,o,!0)}return e.isDefault=!0,u.a.log("Using homeserver config:",e),u.a.log("Updating SdkConfig with validated discovery information"),d.b.add({validated_server_config:e}),d.b.get()}(),U=new f.a(k),[y]=await c.b(),C=!!y,O=!!o.loginToken,E=Object(d.c)(k);let P=!0===E.immediate;const j="#/welcome"===window.location.hash||"#"===window.location.hash;if(!P&&E.on_welcome_page&&j&&(P=!0),!C&&!O&&P){u.a.log("Bypassing app load to redirect to SSO");const e=Object(g.createClient)({baseUrl:k.validated_server_config.hsUrl,idBaseUrl:k.validated_server_config.isUrl});return void a.a.get().startSingleSignOn(e,"sso",`/${v(window.location).screen}`)}const N=null!==(t=U.get("default_device_display_name"))&&void 0!==t?t:n.getDefaultDeviceDisplayName();return r.a.createElement(w.a,{onNewScreen:_,makeRegistrationUrl:b,config:k,realQueryParams:o,startingFragmentQueryParams:e,enableGuest:!k.disable_guests,onTokenLoginCompleted:x,initialScreenAfterLogin:v(window.location),defaultDeviceDisplayName:N})}window.React=r.a,u.a.log("Application is running in production mode"),window.matrixLogger=u.a},319:function(e,t,n){"use strict";n.d(t,"a",(function(){return d}));var o=n(13),r=n.n(o),a=n(120),i=n.n(a),l=n(131),s=n(121);var c=()=>{var e;const t=l.b.getObject("branding"),n=null!==(e=null==t?void 0:t.get("auth_footer_links"))&&void 0!==e?e:[{text:"Blog",url:"https://element.io/blog"},{text:"Twitter",url:"https://twitter.com/element_hq"},{text:"GitHub",url:"https://github.com/vector-im/element-web"}],o=[];for(const e of n)o.push(i.a.createElement("a",{href:e.url,key:e.text,target:"_blank",rel:"noreferrer noopener"},e.text));return i.a.createElement("footer",{className:"mx_AuthFooter",role:"contentinfo"},o,i.a.createElement("a",{href:"https://matrix.org",target:"_blank",rel:"noreferrer noopener"},Object(s.a)("Powered by Matrix")))};class d extends a.PureComponent{static getWelcomeBackgroundUrl(){if(d.welcomeBackgroundUrl)return d.welcomeBackgroundUrl;const e=l.b.getObject("branding");d.welcomeBackgroundUrl="themes/element/img/backgrounds/lake.jpg";const t=null==e?void 0:e.get("welcome_background_url");if(t)if(Array.isArray(t)){const e=Math.floor(Math.random()*t.length);d.welcomeBackgroundUrl=t[e]}else d.welcomeBackgroundUrl=t;return d.welcomeBackgroundUrl}render(){const e={background:`center/cover fixed url(${d.getWelcomeBackgroundUrl()})`},t={position:"absolute",top:0,right:0,bottom:0,left:0,filter:"blur(40px)",background:e.background};return a.createElement("div",{className:"mx_AuthPage",style:e},a.createElement("div",{className:"mx_AuthPage_modal",style:{position:"relative",background:"initial"}},a.createElement("div",{className:"mx_AuthPage_modalBlur",style:t}),a.createElement("div",{className:"mx_AuthPage_modalContent",style:{display:"flex",zIndex:1,background:"rgba(255, 255, 255, 0.59)",borderRadius:"8px"}},this.props.children)),a.createElement(c,null))}}r()(d,"welcomeBackgroundUrl",void 0)}}]);
//# sourceMappingURL=element-web-app.js.map