diff --git a/next/mgt.storybook.js b/next/mgt.storybook.js index 157a99eed5..74419f0365 100644 --- a/next/mgt.storybook.js +++ b/next/mgt.storybook.js @@ -5949,4 +5949,4 @@ var Bm,Hm,Um={code:"redirect_uri_empty",desc:"A redirect URI is required for all /*! @azure/msal-browser v2.38.3 2023-10-27 */ var bv,wv=function(e){function SilentHandler(t,a,l,c,p,g){var m=e.call(this,t,a,l,c,g)||this;return m.navigateFrameWait=p.navigateFrameWait,m.pollIntervalMilliseconds=p.pollIntervalMilliseconds,m}return __extends$1(SilentHandler,e),SilentHandler.prototype.initiateAuthRequest=function(e){return __awaiter$2(this,void 0,void 0,(function(){return __generator$1(this,(function(t){switch(t.label){case 0:if(this.performanceClient.addQueueMeasurement(Rg.SilentHandlerInitiateAuthRequest,this.authCodeRequest.correlationId),Fp.isEmpty(e))throw this.logger.info("Navigate url is empty"),_m.createEmptyNavigationUriError();return this.navigateFrameWait?(this.performanceClient.setPreQueueTime(Rg.SilentHandlerLoadFrame,this.authCodeRequest.correlationId),[4,this.loadFrame(e)]):[3,2];case 1:return[2,t.sent()];case 2:return[2,this.loadFrameSync(e)]}}))}))},SilentHandler.prototype.monitorIframeForHash=function(e,t){var a=this;return this.performanceClient.addQueueMeasurement(Rg.SilentHandlerMonitorIframeForHash,this.authCodeRequest.correlationId),new Promise((function(l,c){tp)return a.removeHiddenIframe(e),clearInterval(g),void c(_m.createMonitorIframeTimeoutError());var t=cu.EMPTY_STRING,m=e.contentWindow;try{t=m?m.location.href:cu.EMPTY_STRING}catch(e){}if(!Fp.isEmpty(t)){var y=m?m.location.hash:cu.EMPTY_STRING;return Wg.hashContainsKnownProperties(y)?(a.removeHiddenIframe(e),clearInterval(g),void l(y)):void 0}}),a.pollIntervalMilliseconds)}))},SilentHandler.prototype.loadFrame=function(e){var t=this;return this.performanceClient.addQueueMeasurement(Rg.SilentHandlerLoadFrame,this.authCodeRequest.correlationId),new Promise((function(a,l){var c=t.createHiddenIframe();setTimeout((function(){c?(c.src=e,a(c)):l("Unable to load iframe")}),t.navigateFrameWait)}))},SilentHandler.prototype.loadFrameSync=function(e){var t=this.createHiddenIframe();return t.src=e,t},SilentHandler.prototype.createHiddenIframe=function(){var e=document.createElement("iframe");return e.style.visibility="hidden",e.style.position="absolute",e.style.width=e.style.height="0",e.style.border="0",e.setAttribute("sandbox","allow-scripts allow-same-origin allow-forms"),document.getElementsByTagName("body")[0].appendChild(e),e},SilentHandler.prototype.removeHiddenIframe=function(e){document.body===e.parentNode&&document.body.removeChild(e)},SilentHandler}(sv),Cv=function(e){function SilentIframeClient(t,a,l,c,p,g,m,y,w,_,x){var T=e.call(this,t,a,l,c,p,g,y,_,x)||this;return T.apiId=m,T.nativeStorage=w,T}return __extends$1(SilentIframeClient,e),SilentIframeClient.prototype.acquireToken=function(e){return __awaiter$2(this,void 0,void 0,(function(){var t,a,l,c,p;return __generator$1(this,(function(g){switch(g.label){case 0:if(this.performanceClient.addQueueMeasurement(Rg.SilentIframeClientAcquireToken,e.correlationId),this.logger.verbose("acquireTokenByIframe called"),t=this.performanceClient.startMeasurement(Rg.SilentIframeClientAcquireToken,e.correlationId),Fp.isEmpty(e.loginHint)&&Fp.isEmpty(e.sid)&&(!e.account||Fp.isEmpty(e.account.username))&&this.logger.warning("No user hint provided. The authorization server may need more information to complete this request."),e.prompt&&e.prompt!==pu.NONE&&e.prompt!==pu.NO_SESSION)throw t.endMeasurement({success:!1}),_m.createSilentPromptValueError(e.prompt);return this.performanceClient.setPreQueueTime(Rg.StandardInteractionClientInitializeAuthorizationRequest,e.correlationId),[4,this.initializeAuthorizationRequest(__assign$1(__assign$1({},e),{prompt:e.prompt||pu.NONE}),mf.Silent)];case 1:a=g.sent(),this.browserStorage.updateCacheEntries(a.state,a.nonce,a.authority,a.loginHint||cu.EMPTY_STRING,a.account||null),l=this.initializeServerTelemetryManager(this.apiId),g.label=2;case 2:return g.trys.push([2,5,,6]),this.performanceClient.setPreQueueTime(Rg.StandardInteractionClientCreateAuthCodeClient,e.correlationId),[4,this.createAuthCodeClient(l,a.authority,a.azureCloudOptions)];case 3:return c=g.sent(),this.logger.verbose("Auth code client created"),this.performanceClient.setPreQueueTime(Rg.SilentIframeClientTokenHelper,e.correlationId),[4,this.silentTokenHelper(c,a).then((function(e){return t.endMeasurement({success:!0,fromCache:!1,requestId:e.requestId}),e}))];case 4:return[2,g.sent()];case 5:throw(p=g.sent())instanceof zu&&p.setCorrelationId(this.correlationId),l.cacheFailedRequest(p),this.browserStorage.cleanRequestByState(a.state),t.endMeasurement({errorCode:p instanceof zu&&p.errorCode||void 0,subErrorCode:p instanceof zu&&p.subError||void 0,success:!1}),p;case 6:return[2]}}))}))},SilentIframeClient.prototype.logout=function(){return Promise.reject(_m.createSilentLogoutUnsupportedError())},SilentIframeClient.prototype.silentTokenHelper=function(e,t){return __awaiter$2(this,void 0,void 0,(function(){var a,l,c,p,g,m,y,w,_,x=this;return __generator$1(this,(function(T){switch(T.label){case 0:return this.performanceClient.addQueueMeasurement(Rg.SilentIframeClientTokenHelper,t.correlationId),this.performanceClient.setPreQueueTime(Rg.StandardInteractionClientInitializeAuthorizationCodeRequest,t.correlationId),[4,this.initializeAuthorizationCodeRequest(t)];case 1:return a=T.sent(),this.performanceClient.setPreQueueTime(Rg.GetAuthCodeUrl,t.correlationId),[4,e.getAuthCodeUrl(__assign$1(__assign$1({},t),{nativeBroker:gv.isNativeAvailable(this.config,this.logger,this.nativeMessageHandler,t.authenticationScheme)}))];case 2:return l=T.sent(),c=new wv(e,this.browserStorage,a,this.logger,this.config.system,this.performanceClient),this.performanceClient.setPreQueueTime(Rg.SilentHandlerInitiateAuthRequest,t.correlationId),[4,c.initiateAuthRequest(l)];case 3:return p=T.sent(),this.performanceClient.setPreQueueTime(Rg.SilentHandlerMonitorIframeForHash,t.correlationId),[4,c.monitorIframeForHash(p,this.config.system.iframeHashTimeout)];case 4:if(g=T.sent(),m=Wg.getDeserializedHash(g),y=this.validateAndExtractStateFromHash(m,mf.Silent,a.correlationId),m.accountId){if(this.logger.verbose("Account id found in hash, calling WAM for token"),!this.nativeMessageHandler)throw _m.createNativeConnectionNotEstablishedError();return w=new pv(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,this.apiId,this.performanceClient,this.nativeMessageHandler,m.accountId,this.browserStorage,this.correlationId),_=Kg.parseRequestState(this.browserCrypto,y).userRequestState,[2,w.acquireToken(__assign$1(__assign$1({},t),{state:_,prompt:t.prompt||pu.NONE})).finally((function(){x.browserStorage.cleanRequestByState(y)}))]}return this.performanceClient.setPreQueueTime(Rg.HandleCodeResponseFromHash,t.correlationId),[2,c.handleCodeResponseFromHash(g,y,e.authority,this.networkClient)]}}))}))},SilentIframeClient}(nv),kv=function(e){function SilentRefreshClient(){return null!==e&&e.apply(this,arguments)||this}return __extends$1(SilentRefreshClient,e),SilentRefreshClient.prototype.acquireToken=function(e){return __awaiter$2(this,void 0,void 0,(function(){var t,a,l,c,p,g=this;return __generator$1(this,(function(m){switch(m.label){case 0:return this.performanceClient.addQueueMeasurement(Rg.SilentRefreshClientAcquireToken,e.correlationId),this.performanceClient.setPreQueueTime(Rg.InitializeBaseRequest,e.correlationId),a=[__assign$1({},e)],[4,this.initializeBaseRequest(e,e.account)];case 1:return t=__assign$1.apply(void 0,a.concat([m.sent()])),l=this.performanceClient.startMeasurement(Rg.SilentRefreshClientAcquireToken,t.correlationId),c=this.initializeServerTelemetryManager(ff.acquireTokenSilent_silentFlow),[4,this.createRefreshTokenClient(c,t.authority,t.azureCloudOptions)];case 2:return p=m.sent(),this.logger.verbose("Refresh token client created"),this.performanceClient.setPreQueueTime(Rg.RefreshTokenClientAcquireTokenByRefreshToken,e.correlationId),[2,p.acquireTokenByRefreshToken(t).then((function(e){return l.endMeasurement({success:!0,fromCache:e.fromCache,requestId:e.requestId}),e})).catch((function(e){throw e instanceof zu&&e.setCorrelationId(g.correlationId),c.cacheFailedRequest(e),l.endMeasurement({errorCode:e.errorCode,subErrorCode:e.subError,success:!1}),e}))]}}))}))},SilentRefreshClient.prototype.logout=function(){return Promise.reject(_m.createSilentLogoutUnsupportedError())},SilentRefreshClient.prototype.createRefreshTokenClient=function(e,t,a){return __awaiter$2(this,void 0,void 0,(function(){var l;return __generator$1(this,(function(c){switch(c.label){case 0:return this.performanceClient.setPreQueueTime(Rg.StandardInteractionClientGetClientConfiguration,this.correlationId),[4,this.getClientConfiguration(e,t,a)];case 1:return l=c.sent(),[2,new rf(l,this.performanceClient)]}}))}))},SilentRefreshClient}(nv),_v=function(){function EventHandler(e,t){this.eventCallbacks=new Map,this.logger=e,this.browserCrypto=t,this.listeningToStorageEvents=!1,this.handleAccountCacheChange=this.handleAccountCacheChange.bind(this)}return EventHandler.prototype.addEventCallback=function(e){if("undefined"!=typeof window){var t=this.browserCrypto.createNewGuid();return this.eventCallbacks.set(t,e),this.logger.verbose("Event callback registered with id: "+t),t}return null},EventHandler.prototype.removeEventCallback=function(e){this.eventCallbacks.delete(e),this.logger.verbose("Event callback "+e+" removed.")},EventHandler.prototype.enableAccountStorageEvents=function(){"undefined"!=typeof window&&(this.listeningToStorageEvents?this.logger.verbose("Account storage listener already registered."):(this.logger.verbose("Adding account storage listener."),this.listeningToStorageEvents=!0,window.addEventListener("storage",this.handleAccountCacheChange)))},EventHandler.prototype.disableAccountStorageEvents=function(){"undefined"!=typeof window&&(this.listeningToStorageEvents?(this.logger.verbose("Removing account storage listener."),window.removeEventListener("storage",this.handleAccountCacheChange),this.listeningToStorageEvents=!1):this.logger.verbose("No account storage listener registered."))},EventHandler.prototype.emitEvent=function(e,t,a,l){var c=this;if("undefined"!=typeof window){var p={eventType:e,interactionType:t||null,payload:a||null,error:l||null,timestamp:Date.now()};this.logger.info("Emitting event: "+e),this.eventCallbacks.forEach((function(t,a){c.logger.verbose("Emitting event to callback "+a+": "+e),t.apply(null,[p])}))}},EventHandler.prototype.handleAccountCacheChange=function(e){try{var t=e.newValue||e.oldValue;if(!t)return;var a=JSON.parse(t);if("object"!=typeof a||!fg.isAccountEntity(a))return;var l=vg.toObject(new fg,a).getAccountInfo();!e.oldValue&&e.newValue?(this.logger.info("Account was added to cache in a different window"),this.emitEvent(Bm.ACCOUNT_ADDED,void 0,l)):!e.newValue&&e.oldValue&&(this.logger.info("Account was removed from cache in a different window"),this.emitEvent(Bm.ACCOUNT_REMOVED,void 0,l))}catch(e){return}},EventHandler}(),Sv=function(){function MathUtils(){}return MathUtils.decimalToHex=function(e){for(var t=e.toString(16);t.length<2;)t="0"+t;return t},MathUtils}(),xv=function(){function GuidGenerator(e){this.cryptoObj=e}return GuidGenerator.prototype.generateGuid=function(){try{var e=new Uint8Array(16);return this.cryptoObj.getRandomValues(e),e[6]|=64,e[6]&=79,e[8]|=128,e[8]&=191,Sv.decimalToHex(e[0])+Sv.decimalToHex(e[1])+Sv.decimalToHex(e[2])+Sv.decimalToHex(e[3])+"-"+Sv.decimalToHex(e[4])+Sv.decimalToHex(e[5])+"-"+Sv.decimalToHex(e[6])+Sv.decimalToHex(e[7])+"-"+Sv.decimalToHex(e[8])+Sv.decimalToHex(e[9])+"-"+Sv.decimalToHex(e[10])+Sv.decimalToHex(e[11])+Sv.decimalToHex(e[12])+Sv.decimalToHex(e[13])+Sv.decimalToHex(e[14])+Sv.decimalToHex(e[15])}catch(e){for(var t="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx",a="0123456789abcdef",l=0,c=cu.EMPTY_STRING,p=0;p<36;p++)"-"!==t[p]&&"4"!==t[p]&&(l=16*Math.random()|0),"x"===t[p]?c+=a[l]:"y"===t[p]?(l&=3,c+=a[l|=8]):c+=t[p];return c}},GuidGenerator.prototype.isGuid=function(e){return/^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(e)},GuidGenerator}(),Tv=function(){function BrowserStringUtils(){}return BrowserStringUtils.stringToUtf8Arr=function(e){for(var t,a=0,l=e.length,c=0;c>>6),p[g++]=128+(63&t)):t<65536?(p[g++]=224+(t>>>12),p[g++]=128+(t>>>6&63),p[g++]=128+(63&t)):t<2097152?(p[g++]=240+(t>>>18),p[g++]=128+(t>>>12&63),p[g++]=128+(t>>>6&63),p[g++]=128+(63&t)):t<67108864?(p[g++]=248+(t>>>24),p[g++]=128+(t>>>18&63),p[g++]=128+(t>>>12&63),p[g++]=128+(t>>>6&63),p[g++]=128+(63&t)):(p[g++]=252+(t>>>30),p[g++]=128+(t>>>24&63),p[g++]=128+(t>>>18&63),p[g++]=128+(t>>>12&63),p[g++]=128+(t>>>6&63),p[g++]=128+(63&t));return p},BrowserStringUtils.stringToArrayBuffer=function(e){for(var t=new ArrayBuffer(e.length),a=new Uint8Array(t),l=0;l251&&a<254&&c+5247&&a<252&&c+4239&&a<248&&c+3223&&a<240&&c+2191&&a<224&&c+1>>l&24),2!==l&&e.length-g!=1||(a+=String.fromCharCode(this.uint6ToB64(p>>>18&63),this.uint6ToB64(p>>>12&63),this.uint6ToB64(p>>>6&63),this.uint6ToB64(63&p)),p=0);return 0===t?a:a.substring(0,a.length-t)+(1===t?"=":"==")},Base64Encode.prototype.uint6ToB64=function(e){return e<26?e+65:e<52?e+71:e<62?e-4:62===e?43:63===e?47:65},Base64Encode}(),Ev=function(){function Base64Decode(){}return Base64Decode.prototype.decode=function(e){var t=e.replace(/-/g,"+").replace(/_/g,"/");switch(t.length%4){case 0:break;case 2:t+="==";break;case 3:t+="=";break;default:throw new Error("Invalid base64 string")}var a=this.base64DecToArr(t);return Tv.utf8ArrToString(a)},Base64Decode.prototype.base64DecToArr=function(e,t){for(var a=e.replace(/[^A-Za-z0-9\+\/]/g,cu.EMPTY_STRING),l=a.length,c=t?Math.ceil((3*l+1>>>2)/t)*t:3*l+1>>>2,p=new Uint8Array(c),g=void 0,m=void 0,y=0,w=0,_=0;_>>(16>>>g&24)&255;y=0}return p},Base64Decode.prototype.b64ToUint6=function(e){return e>64&&e<91?e-65:e>96&&e<123?e-71:e>47&&e<58?e+4:43===e?62:47===e?63:0},Base64Decode}(),Iv=function(){function PkceGenerator(e){this.base64Encode=new Av,this.cryptoObj=e}return PkceGenerator.prototype.generateCodes=function(){return __awaiter$2(this,void 0,void 0,(function(){var e,t;return __generator$1(this,(function(a){switch(a.label){case 0:return e=this.generateCodeVerifier(),[4,this.generateCodeChallengeFromVerifier(e)];case 1:return t=a.sent(),[2,{verifier:e,challenge:t}]}}))}))},PkceGenerator.prototype.generateCodeVerifier=function(){try{var e=new Uint8Array(32);return this.cryptoObj.getRandomValues(e),this.base64Encode.urlEncodeArr(e)}catch(e){throw _m.createPkceNotGeneratedError(e)}},PkceGenerator.prototype.generateCodeChallengeFromVerifier=function(e){return __awaiter$2(this,void 0,void 0,(function(){var t,a;return __generator$1(this,(function(l){switch(l.label){case 0:return l.trys.push([0,2,,3]),[4,this.cryptoObj.sha256Digest(e)];case 1:return t=l.sent(),[2,this.base64Encode.urlEncodeArr(new Uint8Array(t))];case 2:throw a=l.sent(),_m.createPkceNotGeneratedError(a);case 3:return[2]}}))}))},PkceGenerator}(),$v=function(){function ModernBrowserCrypto(){}return ModernBrowserCrypto.prototype.getRandomValues=function(e){return window.crypto.getRandomValues(e)},ModernBrowserCrypto.prototype.generateKey=function(e,t,a){return __awaiter$2(this,void 0,void 0,(function(){return __generator$1(this,(function(l){return[2,window.crypto.subtle.generateKey(e,t,a)]}))}))},ModernBrowserCrypto.prototype.exportKey=function(e){return __awaiter$2(this,void 0,void 0,(function(){return __generator$1(this,(function(t){return[2,window.crypto.subtle.exportKey(Dm,e)]}))}))},ModernBrowserCrypto.prototype.importKey=function(e,t,a,l){return __awaiter$2(this,void 0,void 0,(function(){return __generator$1(this,(function(c){return[2,window.crypto.subtle.importKey(Dm,e,t,a,l)]}))}))},ModernBrowserCrypto.prototype.sign=function(e,t,a){return __awaiter$2(this,void 0,void 0,(function(){return __generator$1(this,(function(l){return[2,window.crypto.subtle.sign(e,t,a)]}))}))},ModernBrowserCrypto.prototype.digest=function(e,t){return __awaiter$2(this,void 0,void 0,(function(){return __generator$1(this,(function(a){return[2,window.crypto.subtle.digest(e,t)]}))}))},ModernBrowserCrypto}(),Rv=function(){function MsrBrowserCrypto(){}return MsrBrowserCrypto.prototype.initPrng=function(e){return window.msrCrypto.initPrng(__spread(e))},MsrBrowserCrypto.prototype.getRandomValues=function(e){return window.msrCrypto.getRandomValues(e)},MsrBrowserCrypto.prototype.generateKey=function(e,t,a){return __awaiter$2(this,void 0,void 0,(function(){return __generator$1(this,(function(l){return[2,window.msrCrypto.subtle.generateKey(e,t,a)]}))}))},MsrBrowserCrypto.prototype.exportKey=function(e){return __awaiter$2(this,void 0,void 0,(function(){return __generator$1(this,(function(t){return[2,window.msrCrypto.subtle.exportKey(Dm,e)]}))}))},MsrBrowserCrypto.prototype.importKey=function(e,t,a,l){return __awaiter$2(this,void 0,void 0,(function(){return __generator$1(this,(function(c){return[2,window.msrCrypto.subtle.importKey(Dm,e,t,a,l)]}))}))},MsrBrowserCrypto.prototype.sign=function(e,t,a){return __awaiter$2(this,void 0,void 0,(function(){return __generator$1(this,(function(l){return[2,window.msrCrypto.subtle.sign(e,t,a)]}))}))},MsrBrowserCrypto.prototype.digest=function(e,t){return __awaiter$2(this,void 0,void 0,(function(){return __generator$1(this,(function(a){return[2,window.msrCrypto.subtle.digest(e,t)]}))}))},MsrBrowserCrypto}(),Pv=function(){function MsBrowserCrypto(){}return MsBrowserCrypto.prototype.getRandomValues=function(e){return window.msCrypto.getRandomValues(e)},MsBrowserCrypto.prototype.generateKey=function(e,t,a){return __awaiter$2(this,void 0,void 0,(function(){return __generator$1(this,(function(l){return[2,new Promise((function(l,c){var p=window.msCrypto.subtle.generateKey(e,t,a);p.addEventListener("complete",(function(e){l(e.target.result)})),p.addEventListener("error",(function(e){c(e)}))}))]}))}))},MsBrowserCrypto.prototype.exportKey=function(e){return __awaiter$2(this,void 0,void 0,(function(){return __generator$1(this,(function(t){return[2,new Promise((function(t,a){var l=window.msCrypto.subtle.exportKey(Dm,e);l.addEventListener("complete",(function(e){var l=e.target.result,c=Tv.utf8ArrToString(new Uint8Array(l)).replace(/\r/g,cu.EMPTY_STRING).replace(/\n/g,cu.EMPTY_STRING).replace(/\t/g,cu.EMPTY_STRING).split(" ").join(cu.EMPTY_STRING).replace("\0",cu.EMPTY_STRING);try{t(JSON.parse(c))}catch(e){a(e)}})),l.addEventListener("error",(function(e){a(e)}))}))]}))}))},MsBrowserCrypto.prototype.importKey=function(e,t,a,l){return __awaiter$2(this,void 0,void 0,(function(){var c,p;return __generator$1(this,(function(g){return c=Tv.getSortedObjectString(e),p=Tv.stringToArrayBuffer(c),[2,new Promise((function(e,c){var g=window.msCrypto.subtle.importKey(Dm,p,t,a,l);g.addEventListener("complete",(function(t){e(t.target.result)})),g.addEventListener("error",(function(e){c(e)}))}))]}))}))},MsBrowserCrypto.prototype.sign=function(e,t,a){return __awaiter$2(this,void 0,void 0,(function(){return __generator$1(this,(function(l){return[2,new Promise((function(l,c){var p=window.msCrypto.subtle.sign(e,t,a);p.addEventListener("complete",(function(e){l(e.target.result)})),p.addEventListener("error",(function(e){c(e)}))}))]}))}))},MsBrowserCrypto.prototype.digest=function(e,t){return __awaiter$2(this,void 0,void 0,(function(){return __generator$1(this,(function(a){return[2,new Promise((function(a,l){var c=window.msCrypto.subtle.digest(e,t.buffer);c.addEventListener("complete",(function(e){a(e.target.result)})),c.addEventListener("error",(function(e){l(e)}))}))]}))}))},MsBrowserCrypto}(),Mv="SHA-256",Ov=new Uint8Array([1,0,1]),Dv=function(){function BrowserCrypto(e,t){var a,l;if(this.logger=e,this.cryptoOptions=t,this.hasBrowserCrypto())this.logger.verbose("BrowserCrypto: modern crypto interface available"),this.subtleCrypto=new $v;else if(this.hasIECrypto())this.logger.verbose("BrowserCrypto: MS crypto interface available"),this.subtleCrypto=new Pv;else{if(!this.hasMsrCrypto()||!(null===(a=this.cryptoOptions)||void 0===a?void 0:a.useMsrCrypto))throw this.hasMsrCrypto()&&this.logger.info("BrowserCrypto: MSR Crypto interface available but system.cryptoOptions.useMsrCrypto not enabled"),this.logger.error("BrowserCrypto: No crypto interfaces available."),_m.createCryptoNotAvailableError("Browser crypto, msCrypto, or msrCrypto interfaces not available.");this.logger.verbose("BrowserCrypto: MSR crypto interface available"),this.subtleCrypto=new Rv}if(this.subtleCrypto.initPrng){if(this.logger.verbose("BrowserCrypto: Interface requires entropy"),!(null===(l=this.cryptoOptions)||void 0===l?void 0:l.entropy))throw this.logger.error("BrowserCrypto: Interface requires entropy but none provided."),Wm.createEntropyNotProvided();this.logger.verbose("BrowserCrypto: Entropy provided"),this.subtleCrypto.initPrng(this.cryptoOptions.entropy)}this.keygenAlgorithmOptions={name:"RSASSA-PKCS1-v1_5",hash:Mv,modulusLength:2048,publicExponent:Ov}}return BrowserCrypto.prototype.hasIECrypto=function(){return"msCrypto"in window},BrowserCrypto.prototype.hasBrowserCrypto=function(){return"crypto"in window},BrowserCrypto.prototype.hasMsrCrypto=function(){return"msrCrypto"in window},BrowserCrypto.prototype.sha256Digest=function(e){return __awaiter$2(this,void 0,void 0,(function(){var t;return __generator$1(this,(function(a){return t=Tv.stringToUtf8Arr(e),[2,this.subtleCrypto.digest({name:Mv},t)]}))}))},BrowserCrypto.prototype.getRandomValues=function(e){return this.subtleCrypto.getRandomValues(e)},BrowserCrypto.prototype.generateKeyPair=function(e,t){return __awaiter$2(this,void 0,void 0,(function(){return __generator$1(this,(function(a){return[2,this.subtleCrypto.generateKey(this.keygenAlgorithmOptions,e,t)]}))}))},BrowserCrypto.prototype.exportJwk=function(e){return __awaiter$2(this,void 0,void 0,(function(){return __generator$1(this,(function(t){return[2,this.subtleCrypto.exportKey(e)]}))}))},BrowserCrypto.prototype.importJwk=function(e,t,a){return __awaiter$2(this,void 0,void 0,(function(){return __generator$1(this,(function(l){return[2,this.subtleCrypto.importKey(e,this.keygenAlgorithmOptions,t,a)]}))}))},BrowserCrypto.prototype.sign=function(e,t){return __awaiter$2(this,void 0,void 0,(function(){return __generator$1(this,(function(a){return[2,this.subtleCrypto.sign(this.keygenAlgorithmOptions,e,t)]}))}))},BrowserCrypto}(),Lv=function(){function DatabaseStorage(){this.dbName=Nm,this.version=1,this.tableName=Fm,this.dbOpen=!1}return DatabaseStorage.prototype.open=function(){return __awaiter$2(this,void 0,void 0,(function(){var e=this;return __generator$1(this,(function(t){return[2,new Promise((function(t,a){var l=window.indexedDB.open(e.dbName,e.version);l.addEventListener("upgradeneeded",(function(t){t.target.result.createObjectStore(e.tableName)})),l.addEventListener("success",(function(a){var l=a;e.db=l.target.result,e.dbOpen=!0,t()})),l.addEventListener("error",(function(){return a(_m.createDatabaseUnavailableError())}))}))]}))}))},DatabaseStorage.prototype.closeConnection=function(){var e=this.db;e&&this.dbOpen&&(e.close(),this.dbOpen=!1)},DatabaseStorage.prototype.validateDbIsOpen=function(){return __awaiter$2(this,void 0,void 0,(function(){return __generator$1(this,(function(e){switch(e.label){case 0:return this.dbOpen?[3,2]:[4,this.open()];case 1:return[2,e.sent()];case 2:return[2]}}))}))},DatabaseStorage.prototype.getItem=function(e){return __awaiter$2(this,void 0,void 0,(function(){var t=this;return __generator$1(this,(function(a){switch(a.label){case 0:return[4,this.validateDbIsOpen()];case 1:return a.sent(),[2,new Promise((function(a,l){if(!t.db)return l(_m.createDatabaseNotOpenError());var c=t.db.transaction([t.tableName],"readonly").objectStore(t.tableName).get(e);c.addEventListener("success",(function(e){var l=e;t.closeConnection(),a(l.target.result)})),c.addEventListener("error",(function(e){t.closeConnection(),l(e)}))}))]}}))}))},DatabaseStorage.prototype.setItem=function(e,t){return __awaiter$2(this,void 0,void 0,(function(){var a=this;return __generator$1(this,(function(l){switch(l.label){case 0:return[4,this.validateDbIsOpen()];case 1:return l.sent(),[2,new Promise((function(l,c){if(!a.db)return c(_m.createDatabaseNotOpenError());var p=a.db.transaction([a.tableName],"readwrite").objectStore(a.tableName).put(t,e);p.addEventListener("success",(function(){a.closeConnection(),l()})),p.addEventListener("error",(function(e){a.closeConnection(),c(e)}))}))]}}))}))},DatabaseStorage.prototype.removeItem=function(e){return __awaiter$2(this,void 0,void 0,(function(){var t=this;return __generator$1(this,(function(a){switch(a.label){case 0:return[4,this.validateDbIsOpen()];case 1:return a.sent(),[2,new Promise((function(a,l){if(!t.db)return l(_m.createDatabaseNotOpenError());var c=t.db.transaction([t.tableName],"readwrite").objectStore(t.tableName).delete(e);c.addEventListener("success",(function(){t.closeConnection(),a()})),c.addEventListener("error",(function(e){t.closeConnection(),l(e)}))}))]}}))}))},DatabaseStorage.prototype.getKeys=function(){return __awaiter$2(this,void 0,void 0,(function(){var e=this;return __generator$1(this,(function(t){switch(t.label){case 0:return[4,this.validateDbIsOpen()];case 1:return t.sent(),[2,new Promise((function(t,a){if(!e.db)return a(_m.createDatabaseNotOpenError());var l=e.db.transaction([e.tableName],"readonly").objectStore(e.tableName).getAllKeys();l.addEventListener("success",(function(a){var l=a;e.closeConnection(),t(l.target.result)})),l.addEventListener("error",(function(t){e.closeConnection(),a(t)}))}))]}}))}))},DatabaseStorage.prototype.containsKey=function(e){return __awaiter$2(this,void 0,void 0,(function(){var t=this;return __generator$1(this,(function(a){switch(a.label){case 0:return[4,this.validateDbIsOpen()];case 1:return a.sent(),[2,new Promise((function(a,l){if(!t.db)return l(_m.createDatabaseNotOpenError());var c=t.db.transaction([t.tableName],"readonly").objectStore(t.tableName).count(e);c.addEventListener("success",(function(e){var l=e;t.closeConnection(),a(1===l.target.result)})),c.addEventListener("error",(function(e){t.closeConnection(),l(e)}))}))]}}))}))},DatabaseStorage.prototype.deleteDatabase=function(){return __awaiter$2(this,void 0,void 0,(function(){return __generator$1(this,(function(e){return this.db&&this.dbOpen&&this.closeConnection(),[2,new Promise((function(e,t){var a=window.indexedDB.deleteDatabase(Nm);a.addEventListener("success",(function(){return e(!0)})),a.addEventListener("blocked",(function(){return e(!0)})),a.addEventListener("error",(function(){return t(!1)}))}))]}))}))},DatabaseStorage}(),Nv=function(){function AsyncMemoryStorage(e,t){this.inMemoryCache=new Ym,this.indexedDBCache=new Lv,this.logger=e,this.storeName=t}return AsyncMemoryStorage.prototype.handleDatabaseAccessError=function(e){if(!(e instanceof _m&&e.errorCode===mm.code))throw e;this.logger.error("Could not access persistent storage. This may be caused by browser privacy features which block persistent storage in third-party contexts.")},AsyncMemoryStorage.prototype.getItem=function(e){return __awaiter$2(this,void 0,void 0,(function(){var t,a;return __generator$1(this,(function(l){switch(l.label){case 0:if(t=this.inMemoryCache.getItem(e))return[3,4];l.label=1;case 1:return l.trys.push([1,3,,4]),this.logger.verbose("Queried item not found in in-memory cache, now querying persistent storage."),[4,this.indexedDBCache.getItem(e)];case 2:return[2,l.sent()];case 3:return a=l.sent(),this.handleDatabaseAccessError(a),[3,4];case 4:return[2,t]}}))}))},AsyncMemoryStorage.prototype.setItem=function(e,t){return __awaiter$2(this,void 0,void 0,(function(){var a;return __generator$1(this,(function(l){switch(l.label){case 0:this.inMemoryCache.setItem(e,t),l.label=1;case 1:return l.trys.push([1,3,,4]),[4,this.indexedDBCache.setItem(e,t)];case 2:return l.sent(),[3,4];case 3:return a=l.sent(),this.handleDatabaseAccessError(a),[3,4];case 4:return[2]}}))}))},AsyncMemoryStorage.prototype.removeItem=function(e){return __awaiter$2(this,void 0,void 0,(function(){var t;return __generator$1(this,(function(a){switch(a.label){case 0:this.inMemoryCache.removeItem(e),a.label=1;case 1:return a.trys.push([1,3,,4]),[4,this.indexedDBCache.removeItem(e)];case 2:return a.sent(),[3,4];case 3:return t=a.sent(),this.handleDatabaseAccessError(t),[3,4];case 4:return[2]}}))}))},AsyncMemoryStorage.prototype.getKeys=function(){return __awaiter$2(this,void 0,void 0,(function(){var e,t;return __generator$1(this,(function(a){switch(a.label){case 0:if(0!==(e=this.inMemoryCache.getKeys()).length)return[3,4];a.label=1;case 1:return a.trys.push([1,3,,4]),this.logger.verbose("In-memory cache is empty, now querying persistent storage."),[4,this.indexedDBCache.getKeys()];case 2:return[2,a.sent()];case 3:return t=a.sent(),this.handleDatabaseAccessError(t),[3,4];case 4:return[2,e]}}))}))},AsyncMemoryStorage.prototype.containsKey=function(e){return __awaiter$2(this,void 0,void 0,(function(){var t,a;return __generator$1(this,(function(l){switch(l.label){case 0:if(t=this.inMemoryCache.containsKey(e))return[3,4];l.label=1;case 1:return l.trys.push([1,3,,4]),this.logger.verbose("Key not found in in-memory cache, now querying persistent storage."),[4,this.indexedDBCache.containsKey(e)];case 2:return[2,l.sent()];case 3:return a=l.sent(),this.handleDatabaseAccessError(a),[3,4];case 4:return[2,t]}}))}))},AsyncMemoryStorage.prototype.clearInMemory=function(){this.logger.verbose("Deleting in-memory keystore "+this.storeName),this.inMemoryCache.clear(),this.logger.verbose("In-memory keystore "+this.storeName+" deleted")},AsyncMemoryStorage.prototype.clearPersistent=function(){return __awaiter$2(this,void 0,void 0,(function(){var e,t;return __generator$1(this,(function(a){switch(a.label){case 0:return a.trys.push([0,2,,3]),this.logger.verbose("Deleting persistent keystore"),[4,this.indexedDBCache.deleteDatabase()];case 1:return(e=a.sent())&&this.logger.verbose("Persistent keystore deleted"),[2,e];case 2:return t=a.sent(),this.handleDatabaseAccessError(t),[2,!1];case 3:return[2]}}))}))},AsyncMemoryStorage}(); /*! @azure/msal-browser v2.38.3 2023-10-27 */!function(e){e.asymmetricKeys="asymmetricKeys",e.symmetricKeys="symmetricKeys"}(bv||(bv={}));var Fv,Bv=function(){function CryptoKeyStore(e){this.logger=e,this.asymmetricKeys=new Nv(this.logger,bv.asymmetricKeys),this.symmetricKeys=new Nv(this.logger,bv.symmetricKeys)}return CryptoKeyStore.prototype.clear=function(){return __awaiter$2(this,void 0,void 0,(function(){var e;return __generator$1(this,(function(t){switch(t.label){case 0:this.asymmetricKeys.clearInMemory(),this.symmetricKeys.clearInMemory(),t.label=1;case 1:return t.trys.push([1,3,,4]),[4,this.asymmetricKeys.clearPersistent()];case 2:return t.sent(),[2,!0];case 3:return(e=t.sent())instanceof Error?this.logger.error("Clearing keystore failed with error: "+e.message):this.logger.error("Clearing keystore failed with unknown error"),[2,!1];case 4:return[2]}}))}))},CryptoKeyStore}(),Hv=function(){function CryptoOps(e,t,a){this.logger=e,this.browserCrypto=new Dv(this.logger,a),this.b64Encode=new Av,this.b64Decode=new Ev,this.guidGenerator=new xv(this.browserCrypto),this.pkceGenerator=new Iv(this.browserCrypto),this.cache=new Bv(this.logger),this.performanceClient=t}return CryptoOps.prototype.createNewGuid=function(){return this.guidGenerator.generateGuid()},CryptoOps.prototype.base64Encode=function(e){return this.b64Encode.encode(e)},CryptoOps.prototype.base64Decode=function(e){return this.b64Decode.decode(e)},CryptoOps.prototype.generatePkceCodes=function(){return __awaiter$2(this,void 0,void 0,(function(){return __generator$1(this,(function(e){return[2,this.pkceGenerator.generateCodes()]}))}))},CryptoOps.prototype.getPublicKeyThumbprint=function(e){var t;return __awaiter$2(this,void 0,void 0,(function(){var a,l,c,p,g,m,y,w;return __generator$1(this,(function(_){switch(_.label){case 0:return a=null===(t=this.performanceClient)||void 0===t?void 0:t.startMeasurement(Rg.CryptoOptsGetPublicKeyThumbprint,e.correlationId),[4,this.browserCrypto.generateKeyPair(CryptoOps.EXTRACTABLE,CryptoOps.POP_KEY_USAGES)];case 1:return l=_.sent(),[4,this.browserCrypto.exportJwk(l.publicKey)];case 2:return c=_.sent(),p={e:c.e,kty:c.kty,n:c.n},g=Tv.getSortedObjectString(p),[4,this.hashString(g)];case 3:return m=_.sent(),[4,this.browserCrypto.exportJwk(l.privateKey)];case 4:return y=_.sent(),[4,this.browserCrypto.importJwk(y,!1,["sign"])];case 5:return w=_.sent(),[4,this.cache.asymmetricKeys.setItem(m,{privateKey:w,publicKey:l.publicKey,requestMethod:e.resourceRequestMethod,requestUri:e.resourceRequestUri})];case 6:return _.sent(),a&&a.endMeasurement({success:!0}),[2,m]}}))}))},CryptoOps.prototype.removeTokenBindingKey=function(e){return __awaiter$2(this,void 0,void 0,(function(){return __generator$1(this,(function(t){switch(t.label){case 0:return[4,this.cache.asymmetricKeys.removeItem(e)];case 1:return t.sent(),[4,this.cache.asymmetricKeys.containsKey(e)];case 2:return[2,!t.sent()]}}))}))},CryptoOps.prototype.clearKeystore=function(){return __awaiter$2(this,void 0,void 0,(function(){return __generator$1(this,(function(e){switch(e.label){case 0:return[4,this.cache.clear()];case 1:return[2,e.sent()]}}))}))},CryptoOps.prototype.signJwt=function(e,t,a){var l;return __awaiter$2(this,void 0,void 0,(function(){var c,p,g,m,y,w,_,x,T,A,E,$,P;return __generator$1(this,(function(O){switch(O.label){case 0:return c=null===(l=this.performanceClient)||void 0===l?void 0:l.startMeasurement(Rg.CryptoOptsSignJwt,a),[4,this.cache.asymmetricKeys.getItem(t)];case 1:if(!(p=O.sent()))throw _m.createSigningKeyNotFoundInStorageError(t);return[4,this.browserCrypto.exportJwk(p.publicKey)];case 2:return g=O.sent(),m=Tv.getSortedObjectString(g),y=this.b64Encode.urlEncode(JSON.stringify({kid:t})),w=Af.getShrHeaderString({kid:y,alg:g.alg}),_=this.b64Encode.urlEncode(w),e.cnf={jwk:JSON.parse(m)},x=this.b64Encode.urlEncode(JSON.stringify(e)),T=_+"."+x,A=Tv.stringToArrayBuffer(T),[4,this.browserCrypto.sign(p.privateKey,A)];case 3:return E=O.sent(),$=this.b64Encode.urlEncodeArr(new Uint8Array(E)),P=T+"."+$,c&&c.endMeasurement({success:!0}),[2,P]}}))}))},CryptoOps.prototype.hashString=function(e){return __awaiter$2(this,void 0,void 0,(function(){var t,a;return __generator$1(this,(function(l){switch(l.label){case 0:return[4,this.browserCrypto.sha256Digest(e)];case 1:return t=l.sent(),a=new Uint8Array(t),[2,this.b64Encode.urlEncodeArr(a)]}}))}))},CryptoOps.POP_KEY_USAGES=["sign","verify"],CryptoOps.EXTRACTABLE=!0,CryptoOps}(),Uv=function(){function BrowserPerformanceMeasurement(e,t){this.correlationId=t,this.measureName=BrowserPerformanceMeasurement.makeMeasureName(e,t),this.startMark=BrowserPerformanceMeasurement.makeStartMark(e,t),this.endMark=BrowserPerformanceMeasurement.makeEndMark(e,t)}return BrowserPerformanceMeasurement.makeMeasureName=function(e,t){return"msal.measure."+e+"."+t},BrowserPerformanceMeasurement.makeStartMark=function(e,t){return"msal.start."+e+"."+t},BrowserPerformanceMeasurement.makeEndMark=function(e,t){return"msal.end."+e+"."+t},BrowserPerformanceMeasurement.supportsBrowserPerformance=function(){return"undefined"!=typeof window&&void 0!==window.performance&&"function"==typeof window.performance.mark&&"function"==typeof window.performance.measure&&"function"==typeof window.performance.clearMarks&&"function"==typeof window.performance.clearMeasures&&"function"==typeof window.performance.getEntriesByName},BrowserPerformanceMeasurement.flushMeasurements=function(e,t){if(BrowserPerformanceMeasurement.supportsBrowserPerformance())try{t.forEach((function(t){var a=BrowserPerformanceMeasurement.makeMeasureName(t.name,e);window.performance.getEntriesByName(a,"measure").length>0&&(window.performance.clearMeasures(a),window.performance.clearMarks(BrowserPerformanceMeasurement.makeStartMark(a,e)),window.performance.clearMarks(BrowserPerformanceMeasurement.makeEndMark(a,e)))}))}catch(e){}},BrowserPerformanceMeasurement.prototype.startMeasurement=function(){if(BrowserPerformanceMeasurement.supportsBrowserPerformance())try{window.performance.mark(this.startMark)}catch(e){}},BrowserPerformanceMeasurement.prototype.endMeasurement=function(){if(BrowserPerformanceMeasurement.supportsBrowserPerformance())try{window.performance.mark(this.endMark),window.performance.measure(this.measureName,this.startMark,this.endMark)}catch(e){}},BrowserPerformanceMeasurement.prototype.flushMeasurement=function(){if(BrowserPerformanceMeasurement.supportsBrowserPerformance())try{var e=window.performance.getEntriesByName(this.measureName,"measure");if(e.length>0){var t=e[0].duration;return window.performance.clearMeasures(this.measureName),window.performance.clearMarks(this.startMark),window.performance.clearMarks(this.endMark),t}}catch(e){}return null},BrowserPerformanceMeasurement}(),qv=function(e){function BrowserPerformanceClient(t,a,l,c,p,g,m){var y=e.call(this,t,a,l,c,p,g)||this;return y.browserCrypto=new Dv(y.logger,m),y.guidGenerator=new xv(y.browserCrypto),y}return __extends$1(BrowserPerformanceClient,e),BrowserPerformanceClient.prototype.startPerformanceMeasuremeant=function(e,t){return new Uv(e,t)},BrowserPerformanceClient.prototype.generateId=function(){return this.guidGenerator.generateGuid()},BrowserPerformanceClient.prototype.getPageVisibility=function(){var e;return(null===(e=document.visibilityState)||void 0===e?void 0:e.toString())||null},BrowserPerformanceClient.prototype.deleteIncompleteSubMeasurements=function(e){var t=this.eventsByCorrelationId.get(e.event.correlationId),a=t&&t.eventId===e.event.eventId,l=[];a&&(null==t?void 0:t.incompleteSubMeasurements)&&t.incompleteSubMeasurements.forEach((function(e){l.push(__assign$1({},e))})),l.length>0&&Uv.flushMeasurements(e.event.correlationId,l)},BrowserPerformanceClient.prototype.supportsBrowserPerformanceNow=function(){return"undefined"!=typeof window&&void 0!==window.performance&&"function"==typeof window.performance.now},BrowserPerformanceClient.prototype.startMeasurement=function(t,a){var l=this,c=this.getPageVisibility(),p=e.prototype.startMeasurement.call(this,t,a);return __assign$1(__assign$1({},p),{endMeasurement:function(e){var t=p.endMeasurement(__assign$1({startPageVisibility:c,endPageVisibility:l.getPageVisibility()},e));return l.deleteIncompleteSubMeasurements(p),t},discardMeasurement:function(){p.discardMeasurement(),l.deleteIncompleteSubMeasurements(p),p.measurement.flushMeasurement()}})},BrowserPerformanceClient.prototype.setPreQueueTime=function(e,t){if(this.supportsBrowserPerformanceNow())if(t){var a=this.preQueueTimeByCorrelationId.get(t);a&&(this.logger.trace("BrowserPerformanceClient: Incomplete pre-queue "+a.name+" found",t),this.addQueueMeasurement(a.name,t,void 0,!0)),this.preQueueTimeByCorrelationId.set(t,{name:e,time:window.performance.now()})}else this.logger.trace("BrowserPerformanceClient: correlationId for "+e+" not provided, unable to set telemetry queue time");else this.logger.trace("BrowserPerformanceClient: window performance API not available, unable to set telemetry queue time for "+e)},BrowserPerformanceClient.prototype.addQueueMeasurement=function(t,a,l,c){if(this.supportsBrowserPerformanceNow())if(a){var p=e.prototype.getPreQueueTime.call(this,t,a);if(p){var g=window.performance.now(),m=l||e.prototype.calculateQueuedTime.call(this,p,g);return e.prototype.addQueueMeasurement.call(this,t,a,m,c)}}else this.logger.trace("BrowserPerformanceClient: correlationId for "+t+" not provided, unable to add queue measurement");else this.logger.trace("BrowserPerformanceClient: window performance API not available, unable to add queue measurement for "+t)},BrowserPerformanceClient}(If),zv=function(){function TokenCache(e,t,a,l){this.isBrowserEnvironment="undefined"!=typeof window,this.config=e,this.storage=t,this.logger=a,this.cryptoObj=l}return TokenCache.prototype.loadExternalTokens=function(e,t,a){if(this.logger.info("TokenCache - loadExternalTokens called"),!t.id_token)throw _m.createUnableToLoadTokenError("Please ensure server response includes id token.");var l,c,p=new mg(t.id_token,this.cryptoObj);if(e.account){var g=this.loadAccount(p,e.account.environment,void 0,void 0,e.account.homeAccountId);l=new Gg(g,this.loadIdToken(p,g.homeAccountId,e.account.environment,e.account.tenantId),this.loadAccessToken(e,t,g.homeAccountId,e.account.environment,e.account.tenantId,a),this.loadRefreshToken(e,t,g.homeAccountId,e.account.environment))}else{if(!e.authority)throw _m.createUnableToLoadTokenError("Please provide a request with an account or a request with authority.");var m=bf.generateAuthority(e.authority,e.azureCloudOptions),y={protocolMode:this.config.auth.protocolMode,knownAuthorities:this.config.auth.knownAuthorities,cloudDiscoveryMetadata:this.config.auth.cloudDiscoveryMetadata,authorityMetadata:this.config.auth.authorityMetadata,skipAuthorityMetadataCache:this.config.auth.skipAuthorityMetadataCache};if(c=new bf(m,this.config.system.networkClient,this.storage,y,this.logger),a.clientInfo){this.logger.trace("TokenCache - homeAccountId from options");g=this.loadAccount(p,c.hostnameAndPort,a.clientInfo,c.authorityType);l=new Gg(g,this.loadIdToken(p,g.homeAccountId,c.hostnameAndPort,c.tenant),this.loadAccessToken(e,t,g.homeAccountId,c.hostnameAndPort,c.tenant,a),this.loadRefreshToken(e,t,g.homeAccountId,c.hostnameAndPort))}else{if(!t.client_info)throw _m.createUnableToLoadTokenError("Please provide clientInfo in the response or options.");this.logger.trace("TokenCache - homeAccountId from response");g=this.loadAccount(p,c.hostnameAndPort,t.client_info,c.authorityType);l=new Gg(g,this.loadIdToken(p,g.homeAccountId,c.hostnameAndPort,c.tenant),this.loadAccessToken(e,t,g.homeAccountId,c.hostnameAndPort,c.tenant,a),this.loadRefreshToken(e,t,g.homeAccountId,c.hostnameAndPort))}}return this.generateAuthenticationResult(e,p,l,c)},TokenCache.prototype.loadAccount=function(e,t,a,l,c){var p;if(c?p=c:void 0!==l&&a&&(p=fg.generateHomeAccountId(a,l,this.logger,this.cryptoObj,e)),!p)throw _m.createUnableToLoadTokenError("Unexpected missing homeAccountId");var g=a?fg.createAccount(a,p,e,void 0,void 0,void 0,t):fg.createGenericAccount(p,e,void 0,void 0,void 0,t);if(this.isBrowserEnvironment)return this.logger.verbose("TokenCache - loading account"),this.storage.setAccount(g),g;throw _m.createUnableToLoadTokenError("loadExternalTokens is designed to work in browser environments only.")},TokenCache.prototype.loadIdToken=function(e,t,a,l){var c=Ng.createIdTokenEntity(t,a,e.rawToken,this.config.auth.clientId,l);if(this.isBrowserEnvironment)return this.logger.verbose("TokenCache - loading id token"),this.storage.setIdTokenCredential(c),c;throw _m.createUnableToLoadTokenError("loadExternalTokens is designed to work in browser environments only.")},TokenCache.prototype.loadAccessToken=function(e,t,a,l,c,p){if(!t.access_token)return this.logger.verbose("TokenCache - No access token provided for caching"),null;if(!t.expires_in)throw _m.createUnableToLoadTokenError("Please ensure server response includes expires_in value.");if(!p.extendedExpiresOn)throw _m.createUnableToLoadTokenError("Please provide an extendedExpiresOn value in the options.");var g=new gg(e.scopes).printScopes(),m=p.expiresOn||t.expires_in+(new Date).getTime()/1e3,y=p.extendedExpiresOn,w=Bg.createAccessTokenEntity(a,l,t.access_token,this.config.auth.clientId,c,g,m,y,this.cryptoObj);if(this.isBrowserEnvironment)return this.logger.verbose("TokenCache - loading access token"),this.storage.setAccessTokenCredential(w),w;throw _m.createUnableToLoadTokenError("loadExternalTokens is designed to work in browser environments only.")},TokenCache.prototype.loadRefreshToken=function(e,t,a,l){if(!t.refresh_token)return this.logger.verbose("TokenCache - No refresh token provided for caching"),null;var c=Hg.createRefreshTokenEntity(a,l,t.refresh_token,this.config.auth.clientId);if(this.isBrowserEnvironment)return this.logger.verbose("TokenCache - loading refresh token"),this.storage.setRefreshTokenCredential(c),c;throw _m.createUnableToLoadTokenError("loadExternalTokens is designed to work in browser environments only.")},TokenCache.prototype.generateAuthenticationResult=function(e,t,a,l){var c,p,g,m,y=cu.EMPTY_STRING,w=[],_=null;(null==a?void 0:a.accessToken)&&(y=a.accessToken.secret,w=gg.fromString(a.accessToken.target).asArray(),_=new Date(1e3*Number(a.accessToken.expiresOn)),m=new Date(1e3*Number(a.accessToken.extendedExpiresOn)));var x=(null==t?void 0:t.claims.oid)||(null==t?void 0:t.claims.sub)||cu.EMPTY_STRING,T=(null==t?void 0:t.claims.tid)||cu.EMPTY_STRING;return{authority:l?l.canonicalAuthority:cu.EMPTY_STRING,uniqueId:x,tenantId:T,scopes:w,account:(null==a?void 0:a.account)?a.account.getAccountInfo():null,idToken:t?t.rawToken:cu.EMPTY_STRING,idTokenClaims:t?t.claims:{},accessToken:y,fromCache:!0,expiresOn:_,correlationId:e.correlationId||cu.EMPTY_STRING,requestId:cu.EMPTY_STRING,extExpiresOn:m,familyId:cu.EMPTY_STRING,tokenType:(null===(c=null==a?void 0:a.accessToken)||void 0===c?void 0:c.tokenType)||cu.EMPTY_STRING,state:cu.EMPTY_STRING,cloudGraphHostName:(null===(p=null==a?void 0:a.account)||void 0===p?void 0:p.cloudGraphHostName)||cu.EMPTY_STRING,msGraphHost:(null===(g=null==a?void 0:a.account)||void 0===g?void 0:g.msGraphHost)||cu.EMPTY_STRING,code:void 0,fromNativeBroker:!1}},TokenCache}(),Vv=function(e){function HybridSpaAuthorizationCodeClient(t){var a=e.call(this,t)||this;return a.includeRedirectUri=!1,a}return __extends$1(HybridSpaAuthorizationCodeClient,e),HybridSpaAuthorizationCodeClient}(tf),jv=function(e){function SilentAuthCodeClient(t,a,l,c,p,g,m,y,w,_){var x=e.call(this,t,a,l,c,p,g,y,w,_)||this;return x.apiId=m,x}return __extends$1(SilentAuthCodeClient,e),SilentAuthCodeClient.prototype.acquireToken=function(e){return __awaiter$2(this,void 0,void 0,(function(){var t,a,l,c,p,g;return __generator$1(this,(function(m){switch(m.label){case 0:if(this.logger.trace("SilentAuthCodeClient.acquireToken called"),!e.code)throw _m.createAuthCodeRequiredError();return this.performanceClient.setPreQueueTime(Rg.StandardInteractionClientInitializeAuthorizationRequest,e.correlationId),[4,this.initializeAuthorizationRequest(e,mf.Silent)];case 1:t=m.sent(),this.browserStorage.updateCacheEntries(t.state,t.nonce,t.authority,t.loginHint||cu.EMPTY_STRING,t.account||null),a=this.initializeServerTelemetryManager(this.apiId),m.label=2;case 2:return m.trys.push([2,4,,5]),l=__assign$1(__assign$1({},t),{code:e.code}),this.performanceClient.setPreQueueTime(Rg.StandardInteractionClientGetClientConfiguration,e.correlationId),[4,this.getClientConfiguration(a,t.authority)];case 3:return c=m.sent(),p=new Vv(c),this.logger.verbose("Auth code client created"),[2,new wv(p,this.browserStorage,l,this.logger,this.config.system,this.performanceClient).handleCodeResponseFromServer({code:e.code,msgraph_host:e.msGraphHost,cloud_graph_host_name:e.cloudGraphHostName,cloud_instance_host_name:e.cloudInstanceHostName},t.state,p.authority,this.networkClient,!1)];case 4:throw(g=m.sent())instanceof zu&&g.setCorrelationId(this.correlationId),a.cacheFailedRequest(g),this.browserStorage.cleanRequestByState(t.state),g;case 5:return[2]}}))}))},SilentAuthCodeClient.prototype.logout=function(){return Promise.reject(_m.createSilentLogoutUnsupportedError())},SilentAuthCodeClient}(nv),Gv=function(){function ClientApplication(e){var t,a,l;this.isBrowserEnvironment="undefined"!=typeof window,this.config=function buildConfiguration(e,t){var a=e.auth,l=e.cache,c=e.system,p=e.telemetry,g={clientId:cu.EMPTY_STRING,authority:""+cu.DEFAULT_AUTHORITY,knownAuthorities:[],cloudDiscoveryMetadata:cu.EMPTY_STRING,authorityMetadata:cu.EMPTY_STRING,redirectUri:cu.EMPTY_STRING,postLogoutRedirectUri:cu.EMPTY_STRING,navigateToLoginRequestUrl:!0,clientCapabilities:[],protocolMode:nf.AAD,azureCloudOptions:{azureCloudInstance:Bp.None,tenant:cu.EMPTY_STRING},skipAuthorityMetadataCache:!1},m={cacheLocation:df.SessionStorage,temporaryCacheLocation:df.SessionStorage,storeAuthStateInCookie:!1,secureCookies:!1,cacheMigrationEnabled:!(!l||l.cacheLocation!==df.LocalStorage),claimsBasedCachingEnabled:!0},y={loggerCallback:function(){},logLevel:Hu.Info,piiLoggingEnabled:!1},w=__assign$1(__assign$1({},bg),{loggerOptions:y,networkClient:t?ov.getBrowserNetworkClient():_f,navigationClient:new vv,loadFrameTimeout:0,windowHashTimeout:(null==c?void 0:c.loadFrameTimeout)||6e4,iframeHashTimeout:(null==c?void 0:c.loadFrameTimeout)||yv,navigateFrameWait:t&&ov.detectIEOrEdge()?500:0,redirectNavigationTimeout:3e4,asyncPopups:!1,allowRedirectInIframe:!1,allowNativeBroker:!1,nativeBrokerHandshakeTimeout:(null==c?void 0:c.nativeBrokerHandshakeTimeout)||2e3,pollIntervalMilliseconds:Em,cryptoOptions:{useMsrCrypto:!1,entropy:void 0}}),_=__assign$1(__assign$1({},c),{loggerOptions:(null==c?void 0:c.loggerOptions)||y}),x={application:{appName:cu.EMPTY_STRING,appVersion:cu.EMPTY_STRING}};return{auth:__assign$1(__assign$1({},g),a),cache:__assign$1(__assign$1({},m),l),system:__assign$1(__assign$1({},w),_),telemetry:__assign$1(__assign$1({},x),p)}}(e,this.isBrowserEnvironment),this.initialized=!1,this.logger=new Hp(this.config.system.loggerOptions,Xm,ev),this.networkClient=this.config.system.networkClient,this.navigationClient=this.config.system.navigationClient,this.redirectResponse=new Map,this.hybridAuthCodeResponses=new Map,this.performanceClient=this.isBrowserEnvironment?new qv(this.config.auth.clientId,this.config.auth.authority,this.logger,Xm,ev,this.config.telemetry.application,this.config.system.cryptoOptions):new Rf(this.config.auth.clientId,this.config.auth.authority,this.logger,Xm,ev,this.config.telemetry.application),this.browserCrypto=this.isBrowserEnvironment?new Hv(this.logger,this.performanceClient,this.config.system.cryptoOptions):Vu,this.eventHandler=new _v(this.logger,this.browserCrypto),this.browserStorage=this.isBrowserEnvironment?new Jm(this.config.auth.clientId,this.config.cache,this.browserCrypto,this.logger):(t=this.config.auth.clientId,a=this.logger,l={cacheLocation:df.MemoryStorage,temporaryCacheLocation:df.MemoryStorage,storeAuthStateInCookie:!1,secureCookies:!1,cacheMigrationEnabled:!1,claimsBasedCachingEnabled:!0},new Jm(t,l,Vu,a));var c={cacheLocation:df.MemoryStorage,temporaryCacheLocation:df.MemoryStorage,storeAuthStateInCookie:!1,secureCookies:!1,cacheMigrationEnabled:!1,claimsBasedCachingEnabled:!0};this.nativeInternalStorage=new Jm(this.config.auth.clientId,c,this.browserCrypto,this.logger),this.tokenCache=new zv(this.config,this.browserStorage,this.logger,this.browserCrypto),this.trackPageVisibilityWithMeasurement=this.trackPageVisibilityWithMeasurement.bind(this)}return ClientApplication.prototype.initialize=function(){return __awaiter$2(this,void 0,void 0,(function(){var e,t,a,l,c;return __generator$1(this,(function(p){switch(p.label){case 0:if(this.logger.trace("initialize called"),this.initialized)return this.logger.info("initialize has already been called, exiting early."),[2];if(e=this.config.system.allowNativeBroker,t=this.performanceClient.startMeasurement(Rg.InitializeClientApplication),this.eventHandler.emitEvent(Bm.INITIALIZE_START),!e)return[3,4];p.label=1;case 1:return p.trys.push([1,3,,4]),a=this,[4,gv.createProvider(this.logger,this.config.system.nativeBrokerHandshakeTimeout,this.performanceClient)];case 2:return a.nativeExtensionProvider=p.sent(),[3,4];case 3:return l=p.sent(),this.logger.verbose(l),[3,4];case 4:return this.config.cache.claimsBasedCachingEnabled?[3,6]:(this.logger.verbose("Claims-based caching is disabled. Clearing the previous cache with claims"),c=this.performanceClient.startMeasurement(Rg.ClearTokensAndKeysWithClaims),[4,this.browserStorage.clearTokensAndKeysWithClaims()]);case 5:p.sent(),c.endMeasurement({success:!0}),p.label=6;case 6:return this.initialized=!0,this.eventHandler.emitEvent(Bm.INITIALIZE_END),t.endMeasurement({allowNativeBroker:e,success:!0}),[2]}}))}))},ClientApplication.prototype.handleRedirectPromise=function(e){return __awaiter$2(this,void 0,void 0,(function(){var t,a,l,c,p,g,m,y,w=this;return __generator$1(this,(function(_){return this.logger.verbose("handleRedirectPromise called"),ov.blockNativeBrokerCalledBeforeInitialized(this.config.system.allowNativeBroker,this.initialized),t=this.getAllAccounts(),this.isBrowserEnvironment?(a=e||cu.EMPTY_STRING,void 0===(l=this.redirectResponse.get(a))?(this.eventHandler.emitEvent(Bm.HANDLE_REDIRECT_START,mf.Redirect),this.logger.verbose("handleRedirectPromise has been called for the first time, storing the promise"),c=this.browserStorage.getCachedNativeRequest(),p=void 0,c&&gv.isNativeAvailable(this.config,this.logger,this.nativeExtensionProvider)&&this.nativeExtensionProvider&&!e?(this.logger.trace("handleRedirectPromise - acquiring token from native platform"),g=new pv(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,ff.handleRedirectPromise,this.performanceClient,this.nativeExtensionProvider,c.accountId,this.nativeInternalStorage,c.correlationId),p=g.handleRedirectPromise()):(this.logger.trace("handleRedirectPromise - acquiring token from web flow"),m=this.browserStorage.getTemporaryCache(uf.CORRELATION_ID,!0)||cu.EMPTY_STRING,y=this.createRedirectClient(m),p=y.handleRedirectPromise(e)),l=p.then((function(e){e&&(t.length0?w.eventHandler.emitEvent(Bm.ACQUIRE_TOKEN_FAILURE,mf.Redirect,null,e):w.eventHandler.emitEvent(Bm.LOGIN_FAILURE,mf.Redirect,null,e),w.eventHandler.emitEvent(Bm.HANDLE_REDIRECT_END,mf.Redirect),e})),this.redirectResponse.set(a,l)):this.logger.verbose("handleRedirectPromise has been called previously, returning the result from the first call"),[2,l]):(this.logger.verbose("handleRedirectPromise returns null, not browser environment"),[2,null])}))}))},ClientApplication.prototype.acquireTokenRedirect=function(e){return __awaiter$2(this,void 0,void 0,(function(){var t,a,l,c,p,g=this;return __generator$1(this,(function(m){return t=this.getRequestCorrelationId(e),this.logger.verbose("acquireTokenRedirect called",t),this.preflightBrowserEnvironmentCheck(mf.Redirect),(a=this.getAllAccounts().length>0)?this.eventHandler.emitEvent(Bm.ACQUIRE_TOKEN_START,mf.Redirect,e):this.eventHandler.emitEvent(Bm.LOGIN_START,mf.Redirect,e),this.nativeExtensionProvider&&this.canUseNative(e)?(c=new pv(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,ff.acquireTokenRedirect,this.performanceClient,this.nativeExtensionProvider,this.getNativeAccountId(e),this.nativeInternalStorage,e.correlationId),l=c.acquireTokenRedirect(e).catch((function(t){if(t instanceof hv&&t.isFatal())return g.nativeExtensionProvider=void 0,g.createRedirectClient(e.correlationId).acquireToken(e);if(t instanceof jg)return g.logger.verbose("acquireTokenRedirect - Resolving interaction required error thrown by native broker by falling back to web flow"),g.createRedirectClient(e.correlationId).acquireToken(e);throw g.browserStorage.setInteractionInProgress(!1),t}))):(p=this.createRedirectClient(e.correlationId),l=p.acquireToken(e)),[2,l.catch((function(e){throw a?g.eventHandler.emitEvent(Bm.ACQUIRE_TOKEN_FAILURE,mf.Redirect,null,e):g.eventHandler.emitEvent(Bm.LOGIN_FAILURE,mf.Redirect,null,e),e}))]}))}))},ClientApplication.prototype.acquireTokenPopup=function(e){var t=this,a=this.getRequestCorrelationId(e),l=this.performanceClient.startMeasurement(Rg.AcquireTokenPopup,a);try{this.logger.verbose("acquireTokenPopup called",a),this.preflightBrowserEnvironmentCheck(mf.Popup)}catch(e){return Promise.reject(e)}var c,p=this.getAllAccounts();(p.length>0?this.eventHandler.emitEvent(Bm.ACQUIRE_TOKEN_START,mf.Popup,e):this.eventHandler.emitEvent(Bm.LOGIN_START,mf.Popup,e),this.canUseNative(e))?c=this.acquireTokenNative(e,ff.acquireTokenPopup).then((function(e){return t.browserStorage.setInteractionInProgress(!1),l.endMeasurement({success:!0,isNativeBroker:!0,requestId:e.requestId}),e})).catch((function(a){if(a instanceof hv&&a.isFatal())return t.nativeExtensionProvider=void 0,t.createPopupClient(e.correlationId).acquireToken(e);if(a instanceof jg)return t.logger.verbose("acquireTokenPopup - Resolving interaction required error thrown by native broker by falling back to web flow"),t.createPopupClient(e.correlationId).acquireToken(e);throw t.browserStorage.setInteractionInProgress(!1),a})):c=this.createPopupClient(e.correlationId).acquireToken(e);return c.then((function(e){return p.length0?t.eventHandler.emitEvent(Bm.ACQUIRE_TOKEN_FAILURE,mf.Popup,null,e):t.eventHandler.emitEvent(Bm.LOGIN_FAILURE,mf.Popup,null,e),l.endMeasurement({errorCode:e.errorCode,subErrorCode:e.subError,success:!1}),Promise.reject(e)}))},ClientApplication.prototype.trackPageVisibilityWithMeasurement=function(){var e=this.ssoSilentMeasurement||this.acquireTokenByCodeAsyncMeasurement;e&&(this.logger.info("Perf: Visibility change detected in ",e.event.name),e.increment({visibilityChangeCount:1}))},ClientApplication.prototype.ssoSilent=function(e){var t;return __awaiter$2(this,void 0,void 0,(function(){var a,l,c,p,g=this;return __generator$1(this,(function(m){return a=this.getRequestCorrelationId(e),l=__assign$1(__assign$1({},e),{prompt:e.prompt,correlationId:a}),this.preflightBrowserEnvironmentCheck(mf.Silent),this.ssoSilentMeasurement=this.performanceClient.startMeasurement(Rg.SsoSilent,a),null===(t=this.ssoSilentMeasurement)||void 0===t||t.increment({visibilityChangeCount:0}),document.addEventListener("visibilitychange",this.trackPageVisibilityWithMeasurement),this.logger.verbose("ssoSilent called",a),this.eventHandler.emitEvent(Bm.SSO_SILENT_START,mf.Silent,l),this.canUseNative(l)?c=this.acquireTokenNative(l,ff.ssoSilent).catch((function(e){if(e instanceof hv&&e.isFatal())return g.nativeExtensionProvider=void 0,g.createSilentIframeClient(l.correlationId).acquireToken(l);throw e})):(p=this.createSilentIframeClient(l.correlationId),c=p.acquireToken(l)),[2,c.then((function(e){var t,a;return g.eventHandler.emitEvent(Bm.SSO_SILENT_SUCCESS,mf.Silent,e),null===(t=g.ssoSilentMeasurement)||void 0===t||t.addStaticFields({accessTokenSize:e.accessToken.length,idTokenSize:e.idToken.length}),null===(a=g.ssoSilentMeasurement)||void 0===a||a.endMeasurement({success:!0,isNativeBroker:e.fromNativeBroker,requestId:e.requestId}),e})).catch((function(e){var t;throw g.eventHandler.emitEvent(Bm.SSO_SILENT_FAILURE,mf.Silent,null,e),null===(t=g.ssoSilentMeasurement)||void 0===t||t.endMeasurement({errorCode:e.errorCode,subErrorCode:e.subError,success:!1}),e})).finally((function(){document.removeEventListener("visibilitychange",g.trackPageVisibilityWithMeasurement)}))]}))}))},ClientApplication.prototype.acquireTokenByCode=function(e){return __awaiter$2(this,void 0,void 0,(function(){var t,a,l,c,p=this;return __generator$1(this,(function(g){t=this.getRequestCorrelationId(e),this.preflightBrowserEnvironmentCheck(mf.Silent),this.logger.trace("acquireTokenByCode called",t),this.eventHandler.emitEvent(Bm.ACQUIRE_TOKEN_BY_CODE_START,mf.Silent,e),a=this.performanceClient.startMeasurement(Rg.AcquireTokenByCode,e.correlationId);try{if(e.code&&e.nativeAccountId)throw _m.createSpaCodeAndNativeAccountIdPresentError();if(e.code)return l=e.code,(c=this.hybridAuthCodeResponses.get(l))?(this.logger.verbose("Existing acquireTokenByCode request found",e.correlationId),a.discardMeasurement()):(this.logger.verbose("Initiating new acquireTokenByCode request",t),c=this.acquireTokenByCodeAsync(__assign$1(__assign$1({},e),{correlationId:t})).then((function(e){return p.eventHandler.emitEvent(Bm.ACQUIRE_TOKEN_BY_CODE_SUCCESS,mf.Silent,e),p.hybridAuthCodeResponses.delete(l),a.addStaticFields({accessTokenSize:e.accessToken.length,idTokenSize:e.idToken.length}),a.endMeasurement({success:!0,isNativeBroker:e.fromNativeBroker,requestId:e.requestId}),e})).catch((function(e){throw p.hybridAuthCodeResponses.delete(l),p.eventHandler.emitEvent(Bm.ACQUIRE_TOKEN_BY_CODE_FAILURE,mf.Silent,null,e),a.endMeasurement({errorCode:e.errorCode,subErrorCode:e.subError,success:!1}),e})),this.hybridAuthCodeResponses.set(l,c)),[2,c];if(e.nativeAccountId){if(this.canUseNative(e,e.nativeAccountId))return[2,this.acquireTokenNative(e,ff.acquireTokenByCode,e.nativeAccountId).catch((function(e){throw e instanceof hv&&e.isFatal()&&(p.nativeExtensionProvider=void 0),e}))];throw _m.createUnableToAcquireTokenFromNativePlatformError()}throw _m.createAuthCodeOrNativeAccountIdRequiredError()}catch(e){throw this.eventHandler.emitEvent(Bm.ACQUIRE_TOKEN_BY_CODE_FAILURE,mf.Silent,null,e),a.endMeasurement({errorCode:e instanceof zu&&e.errorCode||void 0,subErrorCode:e instanceof zu&&e.subError||void 0,success:!1}),e}return[2]}))}))},ClientApplication.prototype.acquireTokenByCodeAsync=function(e){var t;return __awaiter$2(this,void 0,void 0,(function(){var a=this;return __generator$1(this,(function(l){switch(l.label){case 0:return this.logger.trace("acquireTokenByCodeAsync called",e.correlationId),this.acquireTokenByCodeAsyncMeasurement=this.performanceClient.startMeasurement(Rg.AcquireTokenByCodeAsync,e.correlationId),null===(t=this.acquireTokenByCodeAsyncMeasurement)||void 0===t||t.increment({visibilityChangeCount:0}),document.addEventListener("visibilitychange",this.trackPageVisibilityWithMeasurement),[4,this.createSilentAuthCodeClient(e.correlationId).acquireToken(e).then((function(e){var t;return null===(t=a.acquireTokenByCodeAsyncMeasurement)||void 0===t||t.endMeasurement({success:!0,fromCache:e.fromCache,isNativeBroker:e.fromNativeBroker,requestId:e.requestId}),e})).catch((function(e){var t;throw null===(t=a.acquireTokenByCodeAsyncMeasurement)||void 0===t||t.endMeasurement({errorCode:e.errorCode,subErrorCode:e.subError,success:!1}),e})).finally((function(){document.removeEventListener("visibilitychange",a.trackPageVisibilityWithMeasurement)}))];case 1:return[2,l.sent()]}}))}))},ClientApplication.prototype.acquireTokenFromCache=function(e,t,a){return __awaiter$2(this,void 0,void 0,(function(){return __generator$1(this,(function(l){switch(this.performanceClient.addQueueMeasurement(Rg.AcquireTokenFromCache,t.correlationId),a.cacheLookupPolicy){case Lm.Default:case Lm.AccessToken:case Lm.AccessTokenAndRefreshToken:return[2,e.acquireToken(t)];default:throw Np.createRefreshRequiredError()}return[2]}))}))},ClientApplication.prototype.acquireTokenByRefreshToken=function(e,t){return __awaiter$2(this,void 0,void 0,(function(){var a;return __generator$1(this,(function(l){switch(this.performanceClient.addQueueMeasurement(Rg.AcquireTokenByRefreshToken,e.correlationId),t.cacheLookupPolicy){case Lm.Default:case Lm.AccessTokenAndRefreshToken:case Lm.RefreshToken:case Lm.RefreshTokenAndNetwork:return a=this.createSilentRefreshClient(e.correlationId),this.performanceClient.setPreQueueTime(Rg.SilentRefreshClientAcquireToken,e.correlationId),[2,a.acquireToken(e)];default:throw Np.createRefreshRequiredError()}return[2]}))}))},ClientApplication.prototype.acquireTokenBySilentIframe=function(e){return __awaiter$2(this,void 0,void 0,(function(){var t;return __generator$1(this,(function(a){return this.performanceClient.addQueueMeasurement(Rg.AcquireTokenBySilentIframe,e.correlationId),t=this.createSilentIframeClient(e.correlationId),this.performanceClient.setPreQueueTime(Rg.SilentIframeClientAcquireToken,e.correlationId),[2,t.acquireToken(e)]}))}))},ClientApplication.prototype.logout=function(e){return __awaiter$2(this,void 0,void 0,(function(){var t;return __generator$1(this,(function(a){return t=this.getRequestCorrelationId(e),this.logger.warning("logout API is deprecated and will be removed in msal-browser v3.0.0. Use logoutRedirect instead.",t),[2,this.logoutRedirect(__assign$1({correlationId:t},e))]}))}))},ClientApplication.prototype.logoutRedirect=function(e){return __awaiter$2(this,void 0,void 0,(function(){var t;return __generator$1(this,(function(a){return t=this.getRequestCorrelationId(e),this.preflightBrowserEnvironmentCheck(mf.Redirect),[2,this.createRedirectClient(t).logout(e)]}))}))},ClientApplication.prototype.logoutPopup=function(e){try{var t=this.getRequestCorrelationId(e);return this.preflightBrowserEnvironmentCheck(mf.Popup),this.createPopupClient(t).logout(e)}catch(e){return Promise.reject(e)}},ClientApplication.prototype.getAllAccounts=function(){return this.logger.verbose("getAllAccounts called"),this.isBrowserEnvironment?this.browserStorage.getAllAccounts():[]},ClientApplication.prototype.getAccountByUsername=function(e){if(this.logger.trace("getAccountByUsername called"),!e)return this.logger.warning("getAccountByUsername: No username provided"),null;var t=this.browserStorage.getAccountInfoFilteredBy({username:e});return t?(this.logger.verbose("getAccountByUsername: Account matching username found, returning"),this.logger.verbosePii("getAccountByUsername: Returning signed-in accounts matching username: "+e),t):(this.logger.verbose("getAccountByUsername: No matching account found, returning null"),null)},ClientApplication.prototype.getAccountByHomeId=function(e){if(this.logger.trace("getAccountByHomeId called"),!e)return this.logger.warning("getAccountByHomeId: No homeAccountId provided"),null;var t=this.browserStorage.getAccountInfoFilteredBy({homeAccountId:e});return t?(this.logger.verbose("getAccountByHomeId: Account matching homeAccountId found, returning"),this.logger.verbosePii("getAccountByHomeId: Returning signed-in accounts matching homeAccountId: "+e),t):(this.logger.verbose("getAccountByHomeId: No matching account found, returning null"),null)},ClientApplication.prototype.getAccountByLocalId=function(e){if(this.logger.trace("getAccountByLocalId called"),!e)return this.logger.warning("getAccountByLocalId: No localAccountId provided"),null;var t=this.browserStorage.getAccountInfoFilteredBy({localAccountId:e});return t?(this.logger.verbose("getAccountByLocalId: Account matching localAccountId found, returning"),this.logger.verbosePii("getAccountByLocalId: Returning signed-in accounts matching localAccountId: "+e),t):(this.logger.verbose("getAccountByLocalId: No matching account found, returning null"),null)},ClientApplication.prototype.setActiveAccount=function(e){this.browserStorage.setActiveAccount(e)},ClientApplication.prototype.getActiveAccount=function(){return this.browserStorage.getActiveAccount()},ClientApplication.prototype.preflightBrowserEnvironmentCheck=function(e,t){if(void 0===t&&(t=!0),this.logger.verbose("preflightBrowserEnvironmentCheck started"),ov.blockNonBrowserEnvironment(this.isBrowserEnvironment),ov.blockRedirectInIframe(e,this.config.system.allowRedirectInIframe),ov.blockReloadInHiddenIframes(),ov.blockAcquireTokenInPopups(),ov.blockNativeBrokerCalledBeforeInitialized(this.config.system.allowNativeBroker,this.initialized),e===mf.Redirect&&this.config.cache.cacheLocation===df.MemoryStorage&&!this.config.cache.storeAuthStateInCookie)throw Wm.createInMemoryRedirectUnavailableError();e!==mf.Redirect&&e!==mf.Popup||this.preflightInteractiveRequest(t)},ClientApplication.prototype.preflightInteractiveRequest=function(e){this.logger.verbose("preflightInteractiveRequest called, validating app environment"),ov.blockReloadInHiddenIframes(),e&&this.browserStorage.setInteractionInProgress(!0)},ClientApplication.prototype.acquireTokenNative=function(e,t,a){return __awaiter$2(this,void 0,void 0,(function(){return __generator$1(this,(function(l){if(this.logger.trace("acquireTokenNative called"),!this.nativeExtensionProvider)throw _m.createNativeConnectionNotEstablishedError();return[2,new pv(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,t,this.performanceClient,this.nativeExtensionProvider,a||this.getNativeAccountId(e),this.nativeInternalStorage,e.correlationId).acquireToken(e)]}))}))},ClientApplication.prototype.canUseNative=function(e,t){if(this.logger.trace("canUseNative called"),!gv.isNativeAvailable(this.config,this.logger,this.nativeExtensionProvider,e.authenticationScheme))return this.logger.trace("canUseNative: isNativeAvailable returned false, returning false"),!1;if(e.prompt)switch(e.prompt){case pu.NONE:case pu.CONSENT:case pu.LOGIN:this.logger.trace("canUseNative: prompt is compatible with native flow");break;default:return this.logger.trace("canUseNative: prompt = "+e.prompt+" is not compatible with native flow, returning false"),!1}return!(!t&&!this.getNativeAccountId(e))||(this.logger.trace("canUseNative: nativeAccountId is not available, returning false"),!1)},ClientApplication.prototype.getNativeAccountId=function(e){var t=e.account||this.browserStorage.getAccountInfoByHints(e.loginHint,e.sid)||this.getActiveAccount();return t&&t.nativeAccountId||""},ClientApplication.prototype.createPopupClient=function(e){return new mv(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,this.performanceClient,this.nativeInternalStorage,this.nativeExtensionProvider,e)},ClientApplication.prototype.createRedirectClient=function(e){return new fv(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,this.performanceClient,this.nativeInternalStorage,this.nativeExtensionProvider,e)},ClientApplication.prototype.createSilentIframeClient=function(e){return new Cv(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,ff.ssoSilent,this.performanceClient,this.nativeInternalStorage,this.nativeExtensionProvider,e)},ClientApplication.prototype.createSilentCacheClient=function(e){return new uv(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,this.performanceClient,this.nativeExtensionProvider,e)},ClientApplication.prototype.createSilentRefreshClient=function(e){return new kv(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,this.performanceClient,this.nativeExtensionProvider,e)},ClientApplication.prototype.createSilentAuthCodeClient=function(e){return new jv(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,ff.acquireTokenByCode,this.performanceClient,this.nativeExtensionProvider,e)},ClientApplication.prototype.addEventCallback=function(e){return this.eventHandler.addEventCallback(e)},ClientApplication.prototype.removeEventCallback=function(e){this.eventHandler.removeEventCallback(e)},ClientApplication.prototype.addPerformanceCallback=function(e){return this.performanceClient.addPerformanceCallback(e)},ClientApplication.prototype.removePerformanceCallback=function(e){return this.performanceClient.removePerformanceCallback(e)},ClientApplication.prototype.enableAccountStorageEvents=function(){this.eventHandler.enableAccountStorageEvents()},ClientApplication.prototype.disableAccountStorageEvents=function(){this.eventHandler.disableAccountStorageEvents()},ClientApplication.prototype.getTokenCache=function(){return this.tokenCache},ClientApplication.prototype.getLogger=function(){return this.logger},ClientApplication.prototype.setLogger=function(e){this.logger=e},ClientApplication.prototype.initializeWrapperLibrary=function(e,t){this.browserStorage.setWrapperMetadata(e,t)},ClientApplication.prototype.setNavigationClient=function(e){this.navigationClient=e},ClientApplication.prototype.getConfiguration=function(){return this.config},ClientApplication.prototype.getRequestCorrelationId=function(e){return(null==e?void 0:e.correlationId)?e.correlationId:this.isBrowserEnvironment?this.browserCrypto.createNewGuid():cu.EMPTY_STRING},ClientApplication}(),Kv=function(e){function PublicClientApplication(t){var a=e.call(this,t)||this;return a.astsAsyncMeasurement=void 0,a.activeSilentTokenRequests=new Map,a.trackPageVisibility=a.trackPageVisibility.bind(a),a}return __extends$1(PublicClientApplication,e),PublicClientApplication.prototype.loginRedirect=function(e){return __awaiter$2(this,void 0,void 0,(function(){var t;return __generator$1(this,(function(a){return t=this.getRequestCorrelationId(e),this.logger.verbose("loginRedirect called",t),[2,this.acquireTokenRedirect(__assign$1({correlationId:t},e||Om))]}))}))},PublicClientApplication.prototype.loginPopup=function(e){var t=this.getRequestCorrelationId(e);return this.logger.verbose("loginPopup called",t),this.acquireTokenPopup(__assign$1({correlationId:t},e||Om))},PublicClientApplication.prototype.acquireTokenSilent=function(e){return __awaiter$2(this,void 0,void 0,(function(){var t,a,l,c,p,g,m,y=this;return __generator$1(this,(function(w){if(t=this.getRequestCorrelationId(e),(a=this.performanceClient.startMeasurement(Rg.AcquireTokenSilent,t)).addStaticFields({cacheLookupPolicy:e.cacheLookupPolicy}),this.preflightBrowserEnvironmentCheck(mf.Silent),this.logger.verbose("acquireTokenSilent called",t),!(l=e.account||this.getActiveAccount()))throw _m.createNoAccountError();return c={clientId:this.config.auth.clientId,authority:e.authority||cu.EMPTY_STRING,scopes:e.scopes,homeAccountIdentifier:l.homeAccountId,claims:e.claims,authenticationScheme:e.authenticationScheme,resourceRequestMethod:e.resourceRequestMethod,resourceRequestUri:e.resourceRequestUri,shrClaims:e.shrClaims,sshKid:e.sshKid},p=JSON.stringify(c),void 0===(g=this.activeSilentTokenRequests.get(p))?(this.logger.verbose("acquireTokenSilent called for the first time, storing active request",t),this.performanceClient.setPreQueueTime(Rg.AcquireTokenSilentAsync,t),m=this.acquireTokenSilentAsync(__assign$1(__assign$1({},e),{correlationId:t}),l).then((function(t){return y.activeSilentTokenRequests.delete(p),a.addStaticFields({accessTokenSize:t.accessToken.length,idTokenSize:t.idToken.length}),a.endMeasurement({success:!0,fromCache:t.fromCache,isNativeBroker:t.fromNativeBroker,cacheLookupPolicy:e.cacheLookupPolicy,requestId:t.requestId}),t})).catch((function(e){throw y.activeSilentTokenRequests.delete(p),a.endMeasurement({errorCode:e.errorCode,subErrorCode:e.subError,success:!1}),e})),this.activeSilentTokenRequests.set(p,m),[2,m]):(this.logger.verbose("acquireTokenSilent has been called previously, returning the result from the first call",t),a.discardMeasurement(),[2,g])}))}))},PublicClientApplication.prototype.trackPageVisibility=function(){this.astsAsyncMeasurement&&(this.logger.info("Perf: Visibility change detected"),this.astsAsyncMeasurement.increment({visibilityChangeCount:1}))},PublicClientApplication.prototype.acquireTokenSilentAsync=function(e,t){var a;return __awaiter$2(this,void 0,void 0,(function(){var l,c,p,g,m,y=this;return __generator$1(this,(function(w){switch(w.label){case 0:return this.performanceClient.addQueueMeasurement(Rg.AcquireTokenSilentAsync,e.correlationId),this.eventHandler.emitEvent(Bm.ACQUIRE_TOKEN_START,mf.Silent,e),this.astsAsyncMeasurement=this.performanceClient.startMeasurement(Rg.AcquireTokenSilentAsync,e.correlationId),null===(a=this.astsAsyncMeasurement)||void 0===a||a.increment({visibilityChangeCount:0}),document.addEventListener("visibilitychange",this.trackPageVisibility),gv.isNativeAvailable(this.config,this.logger,this.nativeExtensionProvider,e.authenticationScheme)&&t.nativeAccountId?(this.logger.verbose("acquireTokenSilent - attempting to acquire token from native platform"),c=__assign$1(__assign$1({},e),{account:t}),l=this.acquireTokenNative(c,ff.acquireTokenSilent_silentFlow).catch((function(t){return __awaiter$2(y,void 0,void 0,(function(){return __generator$1(this,(function(a){if(t instanceof hv&&t.isFatal())return this.logger.verbose("acquireTokenSilent - native platform unavailable, falling back to web flow"),this.nativeExtensionProvider=void 0,[2,this.createSilentIframeClient(e.correlationId).acquireToken(e)];throw t}))}))})),[3,3]):[3,1];case 1:return this.logger.verbose("acquireTokenSilent - attempting to acquire token from web flow"),p=this.createSilentCacheClient(e.correlationId),this.performanceClient.setPreQueueTime(Rg.InitializeSilentRequest,e.correlationId),[4,p.initializeSilentRequest(e,t)];case 2:g=w.sent(),m=__assign$1(__assign$1({},e),{cacheLookupPolicy:e.cacheLookupPolicy||Lm.Default}),this.performanceClient.setPreQueueTime(Rg.AcquireTokenFromCache,g.correlationId),l=this.acquireTokenFromCache(p,g,m).catch((function(t){if(m.cacheLookupPolicy===Lm.AccessToken)throw t;return ov.blockReloadInHiddenIframes(),y.eventHandler.emitEvent(Bm.ACQUIRE_TOKEN_NETWORK_START,mf.Silent,g),y.performanceClient.setPreQueueTime(Rg.AcquireTokenByRefreshToken,g.correlationId),y.acquireTokenByRefreshToken(g,m).catch((function(t){var a=t instanceof Eg,l=t instanceof jg,c=t.errorCode===zg.code,p=t.errorCode===Sm;if((!a||!p||l||m.cacheLookupPolicy===Lm.AccessTokenAndRefreshToken||m.cacheLookupPolicy===Lm.RefreshToken)&&m.cacheLookupPolicy!==Lm.Skip&&!c)throw t;return y.logger.verbose("Refresh token expired/invalid or CacheLookupPolicy is set to Skip, attempting acquire token by iframe.",e.correlationId),y.performanceClient.setPreQueueTime(Rg.AcquireTokenBySilentIframe,g.correlationId),y.acquireTokenBySilentIframe(g)}))})),w.label=3;case 3:return[2,l.then((function(e){var t;return y.eventHandler.emitEvent(Bm.ACQUIRE_TOKEN_SUCCESS,mf.Silent,e),null===(t=y.astsAsyncMeasurement)||void 0===t||t.endMeasurement({success:!0,fromCache:e.fromCache,isNativeBroker:e.fromNativeBroker,requestId:e.requestId}),e})).catch((function(e){var t;throw y.eventHandler.emitEvent(Bm.ACQUIRE_TOKEN_FAILURE,mf.Silent,null,e),null===(t=y.astsAsyncMeasurement)||void 0===t||t.endMeasurement({errorCode:e.errorCode,subErrorCode:e.subError,success:!1}),e})).finally((function(){document.removeEventListener("visibilitychange",y.trackPageVisibility)}))]}}))}))},PublicClientApplication}(Gv),__awaiter=function(e,t,a,l){return new(a||(a=Promise))((function(c,p){function fulfilled(e){try{step(l.next(e))}catch(e){p(e)}}function rejected(e){try{step(l.throw(e))}catch(e){p(e)}}function step(e){e.done?c(e.value):function adopt(e){return e instanceof a?e:new a((function(t){t(e)}))}(e.value).then(fulfilled,rejected)}step((l=l.apply(e,t||[])).next())}))}; -/*! @azure/msal-browser v2.38.3 2023-10-27 */!function(e){e.SELECT_ACCOUNT="select_account",e.LOGIN="login",e.CONSENT="consent"}(Fv||(Fv={}));class Msal2Provider extends IProvider{get publicClientApplication(){return this._publicClientApplication}get name(){return"MgtMsal2Provider"}get isMultiAccountDisabled(){return!this.isMultipleAccountEnabled}set isMultiAccountDisabled(e){this.isMultipleAccountEnabled=!e}get isMultiAccountSupportedAndEnabled(){return this.isMultipleAccountEnabled}get sessionStorageRequestedScopesKey(){return"mgt-requested-scopes"}get sessionStorageDeniedScopesKey(){return"mgt-denied-scopes"}get homeAccountKey(){return"275f3731-e4a4-468a-bf9c-baca24b31e26"}constructor(e){super(),this.isMultipleAccountEnabled=!0,this.handleMsalEvent=e=>{"msal:acquireTokenSuccess"===e.eventType&&"scopes"in e.payload&&(this.approvedScopes=e.payload.scopes)},this.initProvider(e)}initProvider(e){return __awaiter(this,void 0,void 0,(function*(){const t=e.options||{auth:{clientId:""}};if(this.ms_config=t,this.ms_config.cache=t.cache||{},this.ms_config.cache.cacheLocation=t.cache.cacheLocation||"localStorage",void 0!==this.ms_config.cache.storeAuthStateInCookie&&null!==this.ms_config.cache.storeAuthStateInCookie||(this.ms_config.cache.storeAuthStateInCookie=!0),this.ms_config.system=t.system||{},this.ms_config.system.iframeHashTimeout=t.system.iframeHashTimeout||1e4,e.authority&&(this.ms_config.auth.authority=e.authority),e.redirectUri&&(this.ms_config.auth.redirectUri=e.redirectUri),"clientId"in e){if(!e.clientId)throw new Error("clientId must be provided");this.ms_config.auth.clientId=e.clientId,this._publicClientApplication=new Kv(this.ms_config)}else{if(!("publicClientApplication"in e))throw new Error("either clientId or publicClientApplication must be provided");if(!e.publicClientApplication)throw new Error("publicClientApplication must be provided");this._publicClientApplication=e.publicClientApplication}this._publicClientApplication.addEventCallback(this.handleMsalEvent),yield this._publicClientApplication.initialize(),this.ms_config.system=t.system||{},this.ms_config.system.iframeHashTimeout=t.system.iframeHashTimeout||1e4,this._loginType=void 0!==e.loginType?e.loginType:T.Redirect,this._loginHint=void 0!==e.loginHint?e.loginHint:null,this._sid=void 0!==e.sid?e.sid:null,this.isIncrementalConsentDisabled=void 0!==e.isIncrementalConsentDisabled&&e.isIncrementalConsentDisabled,this._domainHint=void 0!==e.domainHint?e.domainHint:null,this.scopes=void 0!==e.scopes?e.scopes:["user.read"],this._prompt=void 0!==e.prompt?e.prompt:Fv.SELECT_ACCOUNT;const a=e;this.isMultipleAccountEnabled=void 0===a.isMultiAccountEnabled||a.isMultiAccountEnabled,this.baseURL=void 0!==a.baseURL?a.baseURL:this.baseURL,this.customHosts=a.customHosts,this.graph=createFromProvider(this);try{const e=yield this._publicClientApplication.handleRedirectPromise();null!==e?this.handleResponse(null==e?void 0:e.account):yield this.trySilentSignIn()}catch(e){throw console.error("🦒: Problem attempting to sign in",e),e}}))}trySilentSignIn(){return __awaiter(this,void 0,void 0,(function*(){const e={scopes:this.scopes,domainHint:this._domainHint};if(this._sid||this._loginHint){e.sid=this._sid,e.loginHint=this._loginHint;try{this.setState(A.Loading);const t=yield this._publicClientApplication.ssoSilent(e);t&&this.handleResponse(null==t?void 0:t.account)}catch(e){this.setState(A.SignedOut)}}else{const e=this.getAccount();if(e&&(yield this.getAccessToken(null)))return void this.handleResponse(e);this.setState(A.SignedOut)}}))}login(){return __awaiter(this,void 0,void 0,(function*(){const e={scopes:this.scopes,loginHint:this._loginHint,prompt:this._prompt,domainHint:this._domainHint};if(this._loginType===T.Popup){const t=yield this._publicClientApplication.loginPopup(e);this.handleResponse(null==t?void 0:t.account)}else{const t=Object.assign({},e);yield this._publicClientApplication.loginRedirect(t)}}))}getAllAccounts(){const e=[];return this._publicClientApplication.getAllAccounts().forEach((t=>{e.push({name:t.name,mail:t.username,id:t.homeAccountId})})),e}setActiveAccount(e){const t=this._publicClientApplication.getAccountByHomeId(e.id),a=this._publicClientApplication.getActiveAccount(),l=this.getStoredAccount();l&&t&&a&&l.homeAccountId===t.homeAccountId&&a.homeAccountId===t.homeAccountId||(this._publicClientApplication.setActiveAccount(t),this.setStoredAccount(),super.setActiveAccount(e))}getActiveAccount(){const e=this._publicClientApplication.getActiveAccount();if(e)return{name:e.name,mail:e.username,id:e.homeAccountId,tenantId:e.tenantId}}handleResponse(e){null!==e?(this.setActiveAccount({name:e.name,id:e.homeAccountId,mail:e.username}),this.setState(A.SignedIn)):this.setState(A.SignedOut),this.clearRequestedScopes()}storage(){return"localStorage"===this.ms_config.cache.cacheLocation?window.localStorage:window.sessionStorage}setStoredAccount(){this.clearStoredAccount(),this.storage().setItem(this.homeAccountKey,this._publicClientApplication.getActiveAccount().homeAccountId)}getStoredAccount(){const e=this.storage().getItem(this.homeAccountKey);return this._publicClientApplication.getAccountByHomeId(e)}clearStoredAccount(){this.storage().removeItem(this.homeAccountKey)}setRequestedScopes(e){e&&sessionStorage.setItem(this.sessionStorageRequestedScopesKey,JSON.stringify(e))}addDeniedScopes(e){if(e){let t=this.getDeniedScopes()||[];t=t.concat(e);let a=t.indexOf("openid");-1!==a&&t.splice(a,1),a=t.indexOf("profile"),-1!==a&&t.splice(a,1),sessionStorage.setItem(this.sessionStorageDeniedScopesKey,JSON.stringify(t))}}getDeniedScopes(){const e=sessionStorage.getItem(this.sessionStorageDeniedScopesKey);return e?JSON.parse(e):null}areScopesDenied(e){if(e){const t=this.getDeniedScopes();if(t&&t.filter((t=>-1!==e.indexOf(t))).length>0)return!0}return!1}clearRequestedScopes(){sessionStorage.removeItem(this.sessionStorageRequestedScopesKey)}getAccount(){const e=this.getStoredAccount();return e||(this._publicClientApplication.getAllAccounts().length>0?this._publicClientApplication.getAllAccounts()[0]:null)}logout(){return __awaiter(this,void 0,void 0,(function*(){const e={account:this._publicClientApplication.getActiveAccount()};this.clearStoredAccount(),this._loginType===T.Redirect?(this.setState(A.SignedOut),yield this._publicClientApplication.logoutRedirect(e)):(yield this._publicClientApplication.logoutPopup(Object.assign({},e)),1!==this._publicClientApplication.getAllAccounts.length&&this.isMultipleAccountEnabled?yield this.trySilentSignIn():this.setState(A.SignedOut))}))}getAccessToken(e){var t;return __awaiter(this,void 0,void 0,(function*(){const a=(null===(t=null==e?void 0:e.scopes)||void 0===t?void 0:t.length)?e.scopes:this.scopes,l={scopes:a,account:this.getAccount()};try{const e=l;return(yield this._publicClientApplication.acquireTokenSilent(e)).accessToken}catch(e){if(e instanceof jg){if(this.isIncrementalConsentDisabled)return null;if(this._loginType===T.Redirect){if(this.areScopesDenied(a))throw e;this.setRequestedScopes(a),yield this._publicClientApplication.acquireTokenRedirect(l)}else try{return(yield this._publicClientApplication.acquireTokenPopup(l)).accessToken}catch(e){throw console.error("🦒: problem with pop-up sign in",e),e}}else this.setState(A.SignedOut)}throw null}))}}var __decorate$1=function(e,t,a,l){var c,p=arguments.length,g=p<3?t:null===l?l=Object.getOwnPropertyDescriptor(t,a):l;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)g=Reflect.decorate(e,t,a,l);else for(var m=e.length-1;m>=0;m--)(c=e[m])&&(g=(p<3?c(g):p>3?c(t,a,g):c(t,a))||g);return p>3&&g&&Object.defineProperty(t,a,g),g},__metadata$1=function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};const registerMgtMsal2Provider=()=>{registerComponent("msal2-provider",MgtMsal2Provider)};class MgtMsal2Provider extends MgtBaseProvider{constructor(){super(...arguments),this.clientId=""}get isAvailable(){return!0}initializeProvider(){if(this.clientId){const e={clientId:this.clientId};if(this.loginType&&this.loginType.length>1){let t=this.loginType.toLowerCase();t=t[0].toUpperCase()+t.slice(1);const a=T[t];e.loginType=a}if(this.authority&&(e.authority=this.authority),this.scopes){const t=this.scopes.split(",");t&&t.length>0&&(e.scopes=t)}if(this.redirectUri&&(e.redirectUri=this.redirectUri),this.loginHint&&(e.loginHint=this.loginHint),this.domainHint&&(e.domainHint=this.domainHint),this.prompt){const t=this.prompt.toUpperCase(),a=Fv[t];e.prompt=a}this.isIncrementalConsentDisabled&&(e.isIncrementalConsentDisabled=!0),this.isMultiAccountDisabled&&(e.isMultiAccountEnabled=!1),this.baseUrl&&(e.baseURL=this.baseUrl),this.customHosts&&(e.customHosts=this.customHosts),this.provider=new Msal2Provider(e),Providers.globalProvider=this.provider}}}__decorate$1([n$2({attribute:"client-id",type:String}),__metadata$1("design:type",Object)],MgtMsal2Provider.prototype,"clientId",void 0),__decorate$1([n$2({attribute:"login-hint",type:String}),__metadata$1("design:type",String)],MgtMsal2Provider.prototype,"loginHint",void 0),__decorate$1([n$2({attribute:"domain-hint",type:String}),__metadata$1("design:type",String)],MgtMsal2Provider.prototype,"domainHint",void 0),__decorate$1([n$2({attribute:"login-type",type:String}),__metadata$1("design:type",String)],MgtMsal2Provider.prototype,"loginType",void 0),__decorate$1([n$2(),__metadata$1("design:type",String)],MgtMsal2Provider.prototype,"authority",void 0),__decorate$1([n$2({attribute:"scopes",type:String}),__metadata$1("design:type",String)],MgtMsal2Provider.prototype,"scopes",void 0),__decorate$1([n$2({attribute:"redirect-uri",type:String}),__metadata$1("design:type",String)],MgtMsal2Provider.prototype,"redirectUri",void 0),__decorate$1([n$2({attribute:"prompt",type:String}),__metadata$1("design:type",String)],MgtMsal2Provider.prototype,"prompt",void 0),__decorate$1([n$2({attribute:"incremental-consent-disabled",type:Boolean}),__metadata$1("design:type",Boolean)],MgtMsal2Provider.prototype,"isIncrementalConsentDisabled",void 0),__decorate$1([n$2({attribute:"multi-account-disabled",type:Boolean}),__metadata$1("design:type",Object)],MgtMsal2Provider.prototype,"isMultiAccountDisabled",void 0);var __decorate=function(e,t,a,l){var c,p=arguments.length,g=p<3?t:null===l?l=Object.getOwnPropertyDescriptor(t,a):l;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)g=Reflect.decorate(e,t,a,l);else for(var m=e.length-1;m>=0;m--)(c=e[m])&&(g=(p<3?c(g):p>3?c(t,a,g):c(t,a))||g);return p>3&&g&&Object.defineProperty(t,a,g),g},__metadata=function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};const registerMgtMockProvider=()=>{registerComponent("mock-provider",MgtMockProvider)};class MgtMockProvider extends MgtBaseProvider{initializeProvider(){Providers.globalProvider=new MockProvider(!this.signedOut)}}__decorate([n$2({attribute:"signed-out",type:Boolean}),__metadata("design:type",Object)],MgtMockProvider.prototype,"signedOut",void 0);export{BatchResponse,BetaGraph,CacheService,CacheStore,At as ComponentMediaQuery,EventDispatcher,Graph,GraphPageIterator,IProvider,LocalizationHelper,T as LoginType,e as MICROSOFT_GRAPH_DEFAULT_ENDPOINT,t as MICROSOFT_GRAPH_ENDPOINTS,MgtAgenda,MgtBaseComponent,MgtBaseProvider,MgtBaseTaskComponent,MgtContact,MgtFile,MgtFileList,MgtGet,MgtLogin,MgtMessages,MgtMockProvider,MgtOrganization,MgtPeople,MgtPeoplePicker,MgtPerson,MgtPersonCard,MgtPersonCardConfig,MgtPicker,MgtPlanner,MgtProfile,MgtSearchBox,MgtSearchResults,MgtSpinner,MgtTaxonomyPicker,MgtTeamsChannelPicker,MgtTemplatedComponent,MgtTemplatedTaskComponent,MgtThemeToggle,MgtTodo,MockProvider,Msal2Provider,$ as PACKAGE_VERSION,Fv as PromptType,A as ProviderState,Providers,E as ProvidersChangedState,ProxyProvider,SharePointProvider,SimpleProvider,TeamsHelper,TemplateHelper,applyTheme,arraysAreEqual,avatarTypeConverter,buildComponentName,chainMiddleware,createFromProvider,customElement,P as customElementHelper,cr as dbListKey,Wd as defaultPersonProperties,equals,getMgtPersonCardScopes,isAvatarType,isCollectionResponse,isContact,isGroup,isSignedIn,isUser,isViewType,mgtHtml,prepScopes,registerComponent,registerMgtAgendaComponent,registerMgtComponents,registerMgtContactComponent,registerMgtFileComponent,registerMgtFileListComponent,registerMgtGetComponent,registerMgtLoginComponent,registerMgtMessagesComponent,registerMgtMockProvider,registerMgtMsal2Provider,registerMgtOrganizationComponent,registerMgtPeopleComponent,registerMgtPeoplePickerComponent,registerMgtPersonCardComponent,registerMgtPersonComponent,registerMgtPickerComponent,registerMgtPlannerComponent,registerMgtProfileComponent,registerMgtProxyProvider,registerMgtSearchBoxComponent,registerMgtSearchResultsComponent,registerMgtSpinnerComponent,registerMgtTaxonomyPickerComponent,registerMgtTeamsChannelPickerComponent,registerMgtThemeToggleComponent,registerMgtTodoComponent,validateBaseURL,viewTypeConverter}; +/*! @azure/msal-browser v2.38.3 2023-10-27 */!function(e){e.SELECT_ACCOUNT="select_account",e.LOGIN="login",e.CONSENT="consent"}(Fv||(Fv={}));class Msal2Provider extends IProvider{get publicClientApplication(){return this._publicClientApplication}get name(){return"MgtMsal2Provider"}get isMultiAccountDisabled(){return!this.isMultipleAccountEnabled}set isMultiAccountDisabled(e){this.isMultipleAccountEnabled=!e}get isMultiAccountSupportedAndEnabled(){return this.isMultipleAccountEnabled}get sessionStorageRequestedScopesKey(){return"mgt-requested-scopes"}get sessionStorageDeniedScopesKey(){return"mgt-denied-scopes"}get homeAccountKey(){return"275f3731-e4a4-468a-bf9c-baca24b31e26"}constructor(e){super(),this.isMultipleAccountEnabled=!0,this.handleMsalEvent=e=>{"msal:acquireTokenSuccess"===e.eventType&&"scopes"in e.payload&&(this.approvedScopes=e.payload.scopes)},this.initProvider(e)}initProvider(e){return __awaiter(this,void 0,void 0,(function*(){const t=e.options||{auth:{clientId:""}};if(this.ms_config=t,this.ms_config.cache=t.cache||{},this.ms_config.cache.cacheLocation=t.cache.cacheLocation||"localStorage",void 0!==this.ms_config.cache.storeAuthStateInCookie&&null!==this.ms_config.cache.storeAuthStateInCookie||(this.ms_config.cache.storeAuthStateInCookie=!0),this.ms_config.system=t.system||{},this.ms_config.system.iframeHashTimeout=t.system.iframeHashTimeout||1e4,e.authority&&(this.ms_config.auth.authority=e.authority),e.redirectUri&&(this.ms_config.auth.redirectUri=e.redirectUri),"clientId"in e){if(!e.clientId)throw new Error("clientId must be provided");this.ms_config.auth.clientId=e.clientId,this._publicClientApplication=new Kv(this.ms_config)}else{if(!("publicClientApplication"in e))throw new Error("either clientId or publicClientApplication must be provided");if(!e.publicClientApplication)throw new Error("publicClientApplication must be provided");this._publicClientApplication=e.publicClientApplication}this._publicClientApplication.addEventCallback(this.handleMsalEvent),yield this._publicClientApplication.initialize(),this.ms_config.system=t.system||{},this.ms_config.system.iframeHashTimeout=t.system.iframeHashTimeout||1e4,this._loginType=void 0!==e.loginType?e.loginType:T.Redirect,this._loginHint=void 0!==e.loginHint?e.loginHint:null,this._sid=void 0!==e.sid?e.sid:null,this.isIncrementalConsentDisabled=void 0!==e.isIncrementalConsentDisabled&&e.isIncrementalConsentDisabled,this._domainHint=void 0!==e.domainHint?e.domainHint:null,this.scopes=void 0!==e.scopes?e.scopes:["user.read"],this._prompt=void 0!==e.prompt?e.prompt:Fv.SELECT_ACCOUNT;const a=e;this.isMultipleAccountEnabled=void 0===a.isMultiAccountEnabled||a.isMultiAccountEnabled,this.baseURL=void 0!==a.baseURL?a.baseURL:this.baseURL,this.customHosts=a.customHosts,this.graph=createFromProvider(this);try{const e=yield this._publicClientApplication.handleRedirectPromise();null!==e?this.handleResponse(null==e?void 0:e.account):yield this.trySilentSignIn()}catch(e){throw console.error("🦒: Problem attempting to sign in",e),e}}))}trySilentSignIn(){return __awaiter(this,void 0,void 0,(function*(){const e={scopes:this.scopes,domainHint:this._domainHint};if(this._sid||this._loginHint){e.sid=this._sid,e.loginHint=this._loginHint;try{this.setState(A.Loading);const t=yield this._publicClientApplication.ssoSilent(e);t&&this.handleResponse(null==t?void 0:t.account)}catch(e){this.setState(A.SignedOut)}}else{const e=this.getAccount();if(e&&(yield this.getAccessToken(null)))return void this.handleResponse(e);this.setState(A.SignedOut)}}))}login(){return __awaiter(this,void 0,void 0,(function*(){const e={scopes:this.scopes,loginHint:this._loginHint,prompt:this._prompt,domainHint:this._domainHint};if(this._loginType===T.Popup)try{const t=yield this._publicClientApplication.loginPopup(e);this.handleResponse(null==t?void 0:t.account)}catch(e){switch(!0){case e instanceof _m&&"user_cancelled"===e.errorCode:console.warn("🦒: User cancelled the login flow."),this.setState(A.SignedOut);break;case e instanceof _m&&"interaction_in_progress"===e.errorCode:console.warn("🦒: Login already in progess. Close the popup to login again."),this.setState(A.SignedOut);break;default:throw console.error("🦒: Error occurred during login:",e),e}}else{const t=Object.assign({},e);yield this._publicClientApplication.loginRedirect(t)}}))}getAllAccounts(){const e=[];return this._publicClientApplication.getAllAccounts().forEach((t=>{e.push({name:t.name,mail:t.username,id:t.homeAccountId})})),e}setActiveAccount(e){const t=this._publicClientApplication.getAccountByHomeId(e.id),a=this._publicClientApplication.getActiveAccount(),l=this.getStoredAccount();l&&t&&a&&l.homeAccountId===t.homeAccountId&&a.homeAccountId===t.homeAccountId||(this._publicClientApplication.setActiveAccount(t),this.setStoredAccount(),super.setActiveAccount(e))}getActiveAccount(){const e=this._publicClientApplication.getActiveAccount();if(e)return{name:e.name,mail:e.username,id:e.homeAccountId,tenantId:e.tenantId}}handleResponse(e){null!==e?(this.setActiveAccount({name:e.name,id:e.homeAccountId,mail:e.username}),this.setState(A.SignedIn)):this.setState(A.SignedOut),this.clearRequestedScopes()}storage(){return"localStorage"===this.ms_config.cache.cacheLocation?window.localStorage:window.sessionStorage}setStoredAccount(){this.clearStoredAccount(),this.storage().setItem(this.homeAccountKey,this._publicClientApplication.getActiveAccount().homeAccountId)}getStoredAccount(){const e=this.storage().getItem(this.homeAccountKey);return this._publicClientApplication.getAccountByHomeId(e)}clearStoredAccount(){this.storage().removeItem(this.homeAccountKey)}setRequestedScopes(e){e&&sessionStorage.setItem(this.sessionStorageRequestedScopesKey,JSON.stringify(e))}addDeniedScopes(e){if(e){let t=this.getDeniedScopes()||[];t=t.concat(e);let a=t.indexOf("openid");-1!==a&&t.splice(a,1),a=t.indexOf("profile"),-1!==a&&t.splice(a,1),sessionStorage.setItem(this.sessionStorageDeniedScopesKey,JSON.stringify(t))}}getDeniedScopes(){const e=sessionStorage.getItem(this.sessionStorageDeniedScopesKey);return e?JSON.parse(e):null}areScopesDenied(e){if(e){const t=this.getDeniedScopes();if(t&&t.filter((t=>-1!==e.indexOf(t))).length>0)return!0}return!1}clearRequestedScopes(){sessionStorage.removeItem(this.sessionStorageRequestedScopesKey)}getAccount(){const e=this.getStoredAccount();return e||(this._publicClientApplication.getAllAccounts().length>0?this._publicClientApplication.getAllAccounts()[0]:null)}logout(){return __awaiter(this,void 0,void 0,(function*(){const e={account:this._publicClientApplication.getActiveAccount()};this.clearStoredAccount(),this._loginType===T.Redirect?(this.setState(A.SignedOut),yield this._publicClientApplication.logoutRedirect(e)):(yield this._publicClientApplication.logoutPopup(Object.assign({},e)),1!==this._publicClientApplication.getAllAccounts.length&&this.isMultipleAccountEnabled?yield this.trySilentSignIn():this.setState(A.SignedOut))}))}getAccessToken(e){var t;return __awaiter(this,void 0,void 0,(function*(){const a=(null===(t=null==e?void 0:e.scopes)||void 0===t?void 0:t.length)?e.scopes:this.scopes,l={scopes:a,account:this.getAccount()};try{const e=l;return(yield this._publicClientApplication.acquireTokenSilent(e)).accessToken}catch(e){if(e instanceof jg){if(this.isIncrementalConsentDisabled)return null;if(this._loginType===T.Redirect){if(this.areScopesDenied(a))throw e;this.setRequestedScopes(a),yield this._publicClientApplication.acquireTokenRedirect(l)}else try{return(yield this._publicClientApplication.acquireTokenPopup(l)).accessToken}catch(e){throw console.error("🦒: problem with pop-up sign in",e),e}}else this.setState(A.SignedOut)}throw null}))}}var __decorate$1=function(e,t,a,l){var c,p=arguments.length,g=p<3?t:null===l?l=Object.getOwnPropertyDescriptor(t,a):l;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)g=Reflect.decorate(e,t,a,l);else for(var m=e.length-1;m>=0;m--)(c=e[m])&&(g=(p<3?c(g):p>3?c(t,a,g):c(t,a))||g);return p>3&&g&&Object.defineProperty(t,a,g),g},__metadata$1=function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};const registerMgtMsal2Provider=()=>{registerComponent("msal2-provider",MgtMsal2Provider)};class MgtMsal2Provider extends MgtBaseProvider{constructor(){super(...arguments),this.clientId=""}get isAvailable(){return!0}initializeProvider(){if(this.clientId){const e={clientId:this.clientId};if(this.loginType&&this.loginType.length>1){let t=this.loginType.toLowerCase();t=t[0].toUpperCase()+t.slice(1);const a=T[t];e.loginType=a}if(this.authority&&(e.authority=this.authority),this.scopes){const t=this.scopes.split(",");t&&t.length>0&&(e.scopes=t)}if(this.redirectUri&&(e.redirectUri=this.redirectUri),this.loginHint&&(e.loginHint=this.loginHint),this.domainHint&&(e.domainHint=this.domainHint),this.prompt){const t=this.prompt.toUpperCase(),a=Fv[t];e.prompt=a}this.isIncrementalConsentDisabled&&(e.isIncrementalConsentDisabled=!0),this.isMultiAccountDisabled&&(e.isMultiAccountEnabled=!1),this.baseUrl&&(e.baseURL=this.baseUrl),this.customHosts&&(e.customHosts=this.customHosts),this.provider=new Msal2Provider(e),Providers.globalProvider=this.provider}}}__decorate$1([n$2({attribute:"client-id",type:String}),__metadata$1("design:type",Object)],MgtMsal2Provider.prototype,"clientId",void 0),__decorate$1([n$2({attribute:"login-hint",type:String}),__metadata$1("design:type",String)],MgtMsal2Provider.prototype,"loginHint",void 0),__decorate$1([n$2({attribute:"domain-hint",type:String}),__metadata$1("design:type",String)],MgtMsal2Provider.prototype,"domainHint",void 0),__decorate$1([n$2({attribute:"login-type",type:String}),__metadata$1("design:type",String)],MgtMsal2Provider.prototype,"loginType",void 0),__decorate$1([n$2(),__metadata$1("design:type",String)],MgtMsal2Provider.prototype,"authority",void 0),__decorate$1([n$2({attribute:"scopes",type:String}),__metadata$1("design:type",String)],MgtMsal2Provider.prototype,"scopes",void 0),__decorate$1([n$2({attribute:"redirect-uri",type:String}),__metadata$1("design:type",String)],MgtMsal2Provider.prototype,"redirectUri",void 0),__decorate$1([n$2({attribute:"prompt",type:String}),__metadata$1("design:type",String)],MgtMsal2Provider.prototype,"prompt",void 0),__decorate$1([n$2({attribute:"incremental-consent-disabled",type:Boolean}),__metadata$1("design:type",Boolean)],MgtMsal2Provider.prototype,"isIncrementalConsentDisabled",void 0),__decorate$1([n$2({attribute:"multi-account-disabled",type:Boolean}),__metadata$1("design:type",Object)],MgtMsal2Provider.prototype,"isMultiAccountDisabled",void 0);var __decorate=function(e,t,a,l){var c,p=arguments.length,g=p<3?t:null===l?l=Object.getOwnPropertyDescriptor(t,a):l;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)g=Reflect.decorate(e,t,a,l);else for(var m=e.length-1;m>=0;m--)(c=e[m])&&(g=(p<3?c(g):p>3?c(t,a,g):c(t,a))||g);return p>3&&g&&Object.defineProperty(t,a,g),g},__metadata=function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};const registerMgtMockProvider=()=>{registerComponent("mock-provider",MgtMockProvider)};class MgtMockProvider extends MgtBaseProvider{initializeProvider(){Providers.globalProvider=new MockProvider(!this.signedOut)}}__decorate([n$2({attribute:"signed-out",type:Boolean}),__metadata("design:type",Object)],MgtMockProvider.prototype,"signedOut",void 0);export{BatchResponse,BetaGraph,CacheService,CacheStore,At as ComponentMediaQuery,EventDispatcher,Graph,GraphPageIterator,IProvider,LocalizationHelper,T as LoginType,e as MICROSOFT_GRAPH_DEFAULT_ENDPOINT,t as MICROSOFT_GRAPH_ENDPOINTS,MgtAgenda,MgtBaseComponent,MgtBaseProvider,MgtBaseTaskComponent,MgtContact,MgtFile,MgtFileList,MgtGet,MgtLogin,MgtMessages,MgtMockProvider,MgtOrganization,MgtPeople,MgtPeoplePicker,MgtPerson,MgtPersonCard,MgtPersonCardConfig,MgtPicker,MgtPlanner,MgtProfile,MgtSearchBox,MgtSearchResults,MgtSpinner,MgtTaxonomyPicker,MgtTeamsChannelPicker,MgtTemplatedComponent,MgtTemplatedTaskComponent,MgtThemeToggle,MgtTodo,MockProvider,Msal2Provider,$ as PACKAGE_VERSION,Fv as PromptType,A as ProviderState,Providers,E as ProvidersChangedState,ProxyProvider,SharePointProvider,SimpleProvider,TeamsHelper,TemplateHelper,applyTheme,arraysAreEqual,avatarTypeConverter,buildComponentName,chainMiddleware,createFromProvider,customElement,P as customElementHelper,cr as dbListKey,Wd as defaultPersonProperties,equals,getMgtPersonCardScopes,isAvatarType,isCollectionResponse,isContact,isGroup,isSignedIn,isUser,isViewType,mgtHtml,prepScopes,registerComponent,registerMgtAgendaComponent,registerMgtComponents,registerMgtContactComponent,registerMgtFileComponent,registerMgtFileListComponent,registerMgtGetComponent,registerMgtLoginComponent,registerMgtMessagesComponent,registerMgtMockProvider,registerMgtMsal2Provider,registerMgtOrganizationComponent,registerMgtPeopleComponent,registerMgtPeoplePickerComponent,registerMgtPersonCardComponent,registerMgtPersonComponent,registerMgtPickerComponent,registerMgtPlannerComponent,registerMgtProfileComponent,registerMgtProxyProvider,registerMgtSearchBoxComponent,registerMgtSearchResultsComponent,registerMgtSpinnerComponent,registerMgtTaxonomyPickerComponent,registerMgtTeamsChannelPickerComponent,registerMgtThemeToggleComponent,registerMgtTodoComponent,validateBaseURL,viewTypeConverter}; diff --git a/next/project.json b/next/project.json index e3d2364bc0..a3c46f415a 100644 --- a/next/project.json +++ b/next/project.json @@ -1 +1 @@ -{"generatedAt":1726066541756,"hasCustomBabel":false,"hasCustomWebpack":true,"hasStaticDirs":true,"hasStorybookEslint":true,"refCount":0,"monorepo":"Lerna","packageManager":{"type":"yarn","version":"4.1.0"},"preview":{"usesGlobals":false},"framework":{"name":"@storybook/web-components-webpack5","options":{}},"builder":"@storybook/builder-webpack5","renderer":"@storybook/web-components","storybookVersion":"7.6.17","storybookVersionSpecifier":"^7.6.17","language":"typescript","storybookPackages":{"@storybook/addon-a11y":{"version":"7.6.17"},"@storybook/addon-actions":{"version":"7.6.17"},"@storybook/addon-docs":{"version":"7.6.17"},"@storybook/addon-knobs":{"version":"7.0.2"},"@storybook/addon-links":{"version":"7.6.17"},"@storybook/addon-mdx-gfm":{"version":"7.6.17"},"@storybook/addon-storysource":{"version":"7.6.17"},"@storybook/cli":{"version":"7.6.17"},"@storybook/web-components":{"version":"7.6.17"},"@storybook/web-components-webpack5":{"version":"7.6.17"},"eslint-plugin-storybook":{"version":"0.6.15"},"storybook":{"version":"7.6.17"},"storybook-addon-web-components-knobs":{"version":"0.3.20"},"storybook-version":{"version":"0.1.1"}},"addons":{"$SNIP/node_modules/storybook-version":{"version":null},"$SNIP/node_modules/@storybook/addon-docs":{"version":null},"$SNIP/node_modules/@storybook/addon-mdx-gfm":{"version":null}}} +{"generatedAt":1726127746092,"hasCustomBabel":false,"hasCustomWebpack":true,"hasStaticDirs":true,"hasStorybookEslint":true,"refCount":0,"monorepo":"Lerna","packageManager":{"type":"yarn","version":"4.1.0"},"preview":{"usesGlobals":false},"framework":{"name":"@storybook/web-components-webpack5","options":{}},"builder":"@storybook/builder-webpack5","renderer":"@storybook/web-components","storybookVersion":"7.6.17","storybookVersionSpecifier":"^7.6.17","language":"typescript","storybookPackages":{"@storybook/addon-a11y":{"version":"7.6.17"},"@storybook/addon-actions":{"version":"7.6.17"},"@storybook/addon-docs":{"version":"7.6.17"},"@storybook/addon-knobs":{"version":"7.0.2"},"@storybook/addon-links":{"version":"7.6.17"},"@storybook/addon-mdx-gfm":{"version":"7.6.17"},"@storybook/addon-storysource":{"version":"7.6.17"},"@storybook/cli":{"version":"7.6.17"},"@storybook/web-components":{"version":"7.6.17"},"@storybook/web-components-webpack5":{"version":"7.6.17"},"eslint-plugin-storybook":{"version":"0.6.15"},"storybook":{"version":"7.6.17"},"storybook-addon-web-components-knobs":{"version":"0.3.20"},"storybook-version":{"version":"0.1.1"}},"addons":{"$SNIP/node_modules/storybook-version":{"version":null},"$SNIP/node_modules/@storybook/addon-docs":{"version":null},"$SNIP/node_modules/@storybook/addon-mdx-gfm":{"version":null}}} diff --git a/next/sb-addons/storybook-1/manager-bundle.js b/next/sb-addons/storybook-1/manager-bundle.js index d1235b10c3..62e9aad235 100644 --- a/next/sb-addons/storybook-1/manager-bundle.js +++ b/next/sb-addons/storybook-1/manager-bundle.js @@ -1,12 +1,12 @@ try{ -(()=>{var g7=Object.defineProperty;var qv=(r=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(r,{get:(e,t)=>(typeof require<"u"?require:e)[t]}):r)(function(r){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+r+'" is not supported')});var y=(r,e)=>()=>(r&&(e=r(r=0)),e);var v7=(r,e)=>{for(var t in e)g7(r,t,{get:e[t],enumerable:!0})};var l=y(()=>{});var c=y(()=>{});var d=y(()=>{});var Gi,qd=y(()=>{l();c();d();Gi=class{constructor(){this.eventHandlers=[]}fire(e){for(let t of this.eventHandlers)t(e)}add(e){this.eventHandlers.push(e)}remove(e){for(let t=0;t{l();c();d();Gd="https://graph.microsoft.com",Xx=new Set([Gd,"https://graph.microsoft.us","https://dod-graph.microsoft.us","https://graph.microsoft.de","https://microsoftgraph.chinacloudapi.cn","https://canary.graph.microsoft.com"])});var gp,vp=y(()=>{l();c();d();jd();gp=r=>{try{let t=new URL(r).origin;if(Xx.has(t))return t}catch{return}}});var ja,Xn,ie,bn=y(()=>{l();c();d();vp();jd();qd();ja=class{get isMultiAccountSupportedAndEnabled(){return!1}get approvedScopes(){return this._approvedScopes}set approvedScopes(e){this._approvedScopes=e.map(t=>t.toLowerCase())}hasAtLeastOneApprovedScope(e){return e.some(t=>this.approvedScopes.includes(t.toLowerCase().trim()))}hasAllOneApprovedScope(e){return e.some(t=>!this.approvedScopes.includes(t.toLowerCase().trim()))}needsAdditionalScopes(e){let t=[];return e.length&&!this.hasAtLeastOneApprovedScope(e)&&t.push(e[0].trim()),t}set baseURL(e){if(gp(e)){this._baseURL=e;return}else throw new Error(`${e} is not a valid Graph URL endpoint.`)}get baseURL(){return this._baseURL}set customHosts(e){this._customHosts=e}get customHosts(){return this._customHosts}get isMultiAccountSupported(){return this.isMultipleAccountSupported}get state(){return this._state}get isIncrementalConsentDisabled(){return this._isIncrementalConsentDisabled}set isIncrementalConsentDisabled(e){this._isIncrementalConsentDisabled=e}get name(){return"MgtIProvider"}constructor(){this.isMultipleAccountDisabled=!0,this._loginChangedDispatcher=new Gi,this._activeAccountChangedDispatcher=new Gi,this._baseURL=Gd,this._approvedScopes=[],this._customHosts=void 0,this._isIncrementalConsentDisabled=!1,this.isMultipleAccountSupported=!1,this._state=ie.Loading}setState(e){e!==this._state&&(this._state=e,this._loginChangedDispatcher.fire({}))}onStateChanged(e){this._loginChangedDispatcher.add(e)}removeStateChangedHandler(e){this._loginChangedDispatcher.remove(e)}setActiveAccount(e){this.fireActiveAccountChanged()}onActiveAccountChanged(e){this._activeAccountChangedDispatcher.add(e)}removeActiveAccountChangedHandler(e){this._activeAccountChangedDispatcher.remove(e)}fireActiveAccountChanged(){this._activeAccountChangedDispatcher.fire({})}getAccessTokenForScopes(...e){return this.getAccessToken({scopes:e})}};(function(r){r[r.Popup=0]="Popup",r[r.Redirect=1]="Redirect"})(Xn||(Xn={}));(function(r){r[r.Loading=0]="Loading",r[r.SignedOut=1]="SignedOut",r[r.SignedIn=2]="SignedIn"})(ie||(ie={}))});var yp,V,bp,es=y(()=>{l();c();d();qd();bn();yp=function(r,e,t,o){function i(n){return n instanceof t?n:new t(function(s){s(n)})}return new(t||(t=Promise))(function(n,s){function a(p){try{h(o.next(p))}catch(f){s(f)}}function u(p){try{h(o.throw(p))}catch(f){s(f)}}function h(p){p.done?n(p.value):i(p.value).then(a,u)}h((o=o.apply(r,e||[])).next())})},V=class r{static get globalProvider(){return this._globalProvider}static set globalProvider(e){e!==this._globalProvider&&(this._globalProvider&&(this._globalProvider.removeStateChangedHandler(this.handleProviderStateChanged),this._globalProvider.isMultiAccountSupportedAndEnabled&&this._globalProvider.removeActiveAccountChangedHandler(this.handleActiveAccountChanged)),e&&(e.onStateChanged(this.handleProviderStateChanged),e.isMultiAccountSupportedAndEnabled&&e.onActiveAccountChanged(this.handleActiveAccountChanged)),this._globalProvider=e,this._eventDispatcher.fire(bp.ProviderChanged))}static onProviderUpdated(e){this._eventDispatcher.add(e)}static removeProviderUpdatedListener(e){this._eventDispatcher.remove(e)}static onActiveAccountChanged(e){this._activeAccountChangedDispatcher.add(e)}static removeActiveAccountChangedListener(e){this._activeAccountChangedDispatcher.remove(e)}static me(){return this.client?(this._mePromise||(this._mePromise=this.getMe()),this._mePromise):(this._mePromise=null,null)}static getMe(){return yp(this,void 0,void 0,function*(){try{let e=yield this.client.api("me").get();if(e?.id)return e}catch{}return null})}static getCacheId(){var e;return yp(this,void 0,void 0,function*(){if(this._cacheId)return this._cacheId;if(((e=r.globalProvider)===null||e===void 0?void 0:e.state)===ie.SignedIn&&!this._cacheId&&this.client)try{this._cacheId=yield this.createCacheId()}catch{}return this._cacheId})}static unsetCacheId(){this._cacheId=null,this._mePromise=null}static createCacheId(){return yp(this,void 0,void 0,function*(){if(r.globalProvider.isMultiAccountSupportedAndEnabled){let e=this.createCacheIdWithAccountDetails();if(e)return e}return yield this.createCacheIdWithUserDetails()})}static createCacheIdWithUserDetails(){return yp(this,void 0,void 0,function*(){let e=yield this.me();return e?.id?e.id+"-"+e.userPrincipalName:null})}static createCacheIdWithAccountDetails(){let e=r.globalProvider.getActiveAccount();return e.tenantId&&e.id?e.tenantId+e.id:null}static get client(){return r.globalProvider&&r.globalProvider.state===ie.SignedIn?r.globalProvider.graph.client:null}};V._eventDispatcher=new Gi;V._activeAccountChangedDispatcher=new Gi;V.handleProviderStateChanged=()=>{(!V.globalProvider||V.globalProvider.state!==ie.SignedIn)&&(V._mePromise=null),V._eventDispatcher.fire(bp.ProviderStateChanged)};V.handleActiveAccountChanged=()=>{V.unsetCacheId(),V._activeAccountChangedDispatcher.fire(null)};(function(r){r[r.ProviderChanged=0]="ProviderChanged",r[r.ProviderStateChanged=1]="ProviderStateChanged"})(bp||(bp={}))});var wp,t0=y(()=>{l();c();d();wp=class{}});function J(r,e,t,o){var i=arguments.length,n=i<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,t):o,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(r,e,t,o);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(n=(i<3?s(n):i>3?s(e,t,n):s(e,t))||n);return i>3&&n&&Object.defineProperty(e,t,n),n}function _e(r,e,t,o){function i(n){return n instanceof t?n:new t(function(s){s(n)})}return new(t||(t=Promise))(function(n,s){function a(p){try{h(o.next(p))}catch(f){s(f)}}function u(p){try{h(o.throw(p))}catch(f){s(f)}}function h(p){p.done?n(p.value):i(p.value).then(a,u)}h((o=o.apply(r,e||[])).next())})}var kt=y(()=>{l();c();d()});var mr,Kd=y(()=>{l();c();d();(function(r){r.GET="GET",r.PATCH="PATCH",r.POST="POST",r.PUT="PUT",r.DELETE="DELETE"})(mr||(mr={}))});var hc,ek=y(()=>{l();c();d();kt();Kd();hc=class r{constructor(e){if(this.requests=new Map,typeof e<"u"){let t=r.requestLimit;if(e.length>t){let o=new Error(`Maximum requests limit exceeded, Max allowed number of requests are ${t}`);throw o.name="Limit Exceeded Error",o}for(let o of e)this.addRequest(o)}}static validateDependencies(e){let t=n=>{let s=n.entries(),a=s.next();for(;!a.done;){let u=a.value[1];if(u.dependsOn!==void 0&&u.dependsOn.length>0)return!1;a=s.next()}return!0},o=n=>{let s=n.entries(),a=s.next(),u=a.value[1];if(u.dependsOn!==void 0&&u.dependsOn.length>0)return!1;let h=a;for(a=s.next();!a.done;){let p=a.value[1];if(p.dependsOn===void 0||p.dependsOn.length!==1||p.dependsOn[0]!==h.value[1].id)return!1;h=a,a=s.next()}return!0},i=n=>{let s=n.entries(),a=s.next(),u=a.value[1],h;if(u.dependsOn===void 0||u.dependsOn.length===0)h=u.id;else if(u.dependsOn.length===1){let p=u.dependsOn[0];if(p!==u.id&&n.has(p))h=p;else return!1}else return!1;for(a=s.next();!a.done;){let p=a.value[1];if((p.dependsOn===void 0||p.dependsOn.length===0)&&h!==p.id||p.dependsOn!==void 0&&p.dependsOn.length!==0&&(p.dependsOn.length===1&&(p.id===h||p.dependsOn[0]!==h)||p.dependsOn.length>1))return!1;a=s.next()}return!0};if(e.size===0){let n=new Error("Empty requests map, Please provide at least one request.");throw n.name="Empty Requests Error",n}return t(e)||o(e)||i(e)}static getRequestData(e){return _e(this,void 0,void 0,function*(){let t={url:""},o=new RegExp("^https?://");t.url=o.test(e.url)?"/"+e.url.split(/.*?\/\/.*?\//)[1]:e.url,t.method=e.method;let i={};return e.headers.forEach((n,s)=>{i[s]=n}),Object.keys(i).length&&(t.headers=i),(e.method===mr.PATCH||e.method===mr.POST||e.method===mr.PUT)&&(t.body=yield r.getRequestBody(e)),t})}static getRequestBody(e){return _e(this,void 0,void 0,function*(){let t=!1,o;try{o=yield e.clone().json(),t=!0}catch{}if(!t)try{if(typeof Blob<"u"){let i=yield e.blob(),n=new FileReader;o=yield new Promise(s=>{n.addEventListener("load",()=>{let a=n.result,h=new RegExp("^s*data:(.+?/.+?(;.+?=.+?)*)?(;base64)?,(.*)s*$").exec(a);s(h[4])},!1),n.readAsDataURL(i)})}else typeof Buffer<"u"&&(o=(yield e.buffer()).toString("base64"));t=!0}catch{}return o})}addRequest(e){let t=r.requestLimit;if(e.id===""){let o=new Error("Id for a request is empty, Please provide an unique id");throw o.name="Empty Id For Request",o}if(this.requests.size===t){let o=new Error(`Maximum requests limit exceeded, Max allowed number of requests are ${t}`);throw o.name="Limit Exceeded Error",o}if(this.requests.has(e.id)){let o=new Error(`Adding request with duplicate id ${e.id}, Make the id of the requests unique`);throw o.name="Duplicate RequestId Error",o}return this.requests.set(e.id,e),e.id}removeRequest(e){let t=this.requests.delete(e),o=this.requests.entries(),i=o.next();for(;!i.done;){let n=i.value[1].dependsOn;if(typeof n<"u"){let s=n.indexOf(e);s!==-1&&n.splice(s,1),n.length===0&&delete i.value[1].dependsOn}i=o.next()}return t}getContent(){return _e(this,void 0,void 0,function*(){let e=[],t={requests:e},o=this.requests.entries(),i=o.next();if(i.done){let n=new Error("No requests added yet, Please add at least one request.");throw n.name="Empty Payload",n}if(!r.validateDependencies(this.requests)){let n=new Error(`Invalid dependency found, Dependency should be: +(()=>{var g7=Object.defineProperty;var qv=(r=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(r,{get:(e,t)=>(typeof require<"u"?require:e)[t]}):r)(function(r){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+r+'" is not supported')});var y=(r,e)=>()=>(r&&(e=r(r=0)),e);var v7=(r,e)=>{for(var t in e)g7(r,t,{get:e[t],enumerable:!0})};var l=y(()=>{});var c=y(()=>{});var d=y(()=>{});var Gi,qd=y(()=>{l();c();d();Gi=class{constructor(){this.eventHandlers=[]}fire(e){for(let t of this.eventHandlers)t(e)}add(e){this.eventHandlers.push(e)}remove(e){for(let t=0;t{l();c();d();Gd="https://graph.microsoft.com",Xx=new Set([Gd,"https://graph.microsoft.us","https://dod-graph.microsoft.us","https://graph.microsoft.de","https://microsoftgraph.chinacloudapi.cn","https://canary.graph.microsoft.com"])});var gp,vp=y(()=>{l();c();d();jd();gp=r=>{try{let t=new URL(r).origin;if(Xx.has(t))return t}catch{return}}});var ja,Xn,oe,bn=y(()=>{l();c();d();vp();jd();qd();ja=class{get isMultiAccountSupportedAndEnabled(){return!1}get approvedScopes(){return this._approvedScopes}set approvedScopes(e){this._approvedScopes=e.map(t=>t.toLowerCase())}hasAtLeastOneApprovedScope(e){return e.some(t=>this.approvedScopes.includes(t.toLowerCase().trim()))}hasAllOneApprovedScope(e){return e.some(t=>!this.approvedScopes.includes(t.toLowerCase().trim()))}needsAdditionalScopes(e){let t=[];return e.length&&!this.hasAtLeastOneApprovedScope(e)&&t.push(e[0].trim()),t}set baseURL(e){if(gp(e)){this._baseURL=e;return}else throw new Error(`${e} is not a valid Graph URL endpoint.`)}get baseURL(){return this._baseURL}set customHosts(e){this._customHosts=e}get customHosts(){return this._customHosts}get isMultiAccountSupported(){return this.isMultipleAccountSupported}get state(){return this._state}get isIncrementalConsentDisabled(){return this._isIncrementalConsentDisabled}set isIncrementalConsentDisabled(e){this._isIncrementalConsentDisabled=e}get name(){return"MgtIProvider"}constructor(){this.isMultipleAccountDisabled=!0,this._loginChangedDispatcher=new Gi,this._activeAccountChangedDispatcher=new Gi,this._baseURL=Gd,this._approvedScopes=[],this._customHosts=void 0,this._isIncrementalConsentDisabled=!1,this.isMultipleAccountSupported=!1,this._state=oe.Loading}setState(e){e!==this._state&&(this._state=e,this._loginChangedDispatcher.fire({}))}onStateChanged(e){this._loginChangedDispatcher.add(e)}removeStateChangedHandler(e){this._loginChangedDispatcher.remove(e)}setActiveAccount(e){this.fireActiveAccountChanged()}onActiveAccountChanged(e){this._activeAccountChangedDispatcher.add(e)}removeActiveAccountChangedHandler(e){this._activeAccountChangedDispatcher.remove(e)}fireActiveAccountChanged(){this._activeAccountChangedDispatcher.fire({})}getAccessTokenForScopes(...e){return this.getAccessToken({scopes:e})}};(function(r){r[r.Popup=0]="Popup",r[r.Redirect=1]="Redirect"})(Xn||(Xn={}));(function(r){r[r.Loading=0]="Loading",r[r.SignedOut=1]="SignedOut",r[r.SignedIn=2]="SignedIn"})(oe||(oe={}))});var yp,V,bp,es=y(()=>{l();c();d();qd();bn();yp=function(r,e,t,o){function i(n){return n instanceof t?n:new t(function(s){s(n)})}return new(t||(t=Promise))(function(n,s){function a(p){try{h(o.next(p))}catch(f){s(f)}}function u(p){try{h(o.throw(p))}catch(f){s(f)}}function h(p){p.done?n(p.value):i(p.value).then(a,u)}h((o=o.apply(r,e||[])).next())})},V=class r{static get globalProvider(){return this._globalProvider}static set globalProvider(e){e!==this._globalProvider&&(this._globalProvider&&(this._globalProvider.removeStateChangedHandler(this.handleProviderStateChanged),this._globalProvider.isMultiAccountSupportedAndEnabled&&this._globalProvider.removeActiveAccountChangedHandler(this.handleActiveAccountChanged)),e&&(e.onStateChanged(this.handleProviderStateChanged),e.isMultiAccountSupportedAndEnabled&&e.onActiveAccountChanged(this.handleActiveAccountChanged)),this._globalProvider=e,this._eventDispatcher.fire(bp.ProviderChanged))}static onProviderUpdated(e){this._eventDispatcher.add(e)}static removeProviderUpdatedListener(e){this._eventDispatcher.remove(e)}static onActiveAccountChanged(e){this._activeAccountChangedDispatcher.add(e)}static removeActiveAccountChangedListener(e){this._activeAccountChangedDispatcher.remove(e)}static me(){return this.client?(this._mePromise||(this._mePromise=this.getMe()),this._mePromise):(this._mePromise=null,null)}static getMe(){return yp(this,void 0,void 0,function*(){try{let e=yield this.client.api("me").get();if(e?.id)return e}catch{}return null})}static getCacheId(){var e;return yp(this,void 0,void 0,function*(){if(this._cacheId)return this._cacheId;if(((e=r.globalProvider)===null||e===void 0?void 0:e.state)===oe.SignedIn&&!this._cacheId&&this.client)try{this._cacheId=yield this.createCacheId()}catch{}return this._cacheId})}static unsetCacheId(){this._cacheId=null,this._mePromise=null}static createCacheId(){return yp(this,void 0,void 0,function*(){if(r.globalProvider.isMultiAccountSupportedAndEnabled){let e=this.createCacheIdWithAccountDetails();if(e)return e}return yield this.createCacheIdWithUserDetails()})}static createCacheIdWithUserDetails(){return yp(this,void 0,void 0,function*(){let e=yield this.me();return e?.id?e.id+"-"+e.userPrincipalName:null})}static createCacheIdWithAccountDetails(){let e=r.globalProvider.getActiveAccount();return e.tenantId&&e.id?e.tenantId+e.id:null}static get client(){return r.globalProvider&&r.globalProvider.state===oe.SignedIn?r.globalProvider.graph.client:null}};V._eventDispatcher=new Gi;V._activeAccountChangedDispatcher=new Gi;V.handleProviderStateChanged=()=>{(!V.globalProvider||V.globalProvider.state!==oe.SignedIn)&&(V._mePromise=null),V._eventDispatcher.fire(bp.ProviderStateChanged)};V.handleActiveAccountChanged=()=>{V.unsetCacheId(),V._activeAccountChangedDispatcher.fire(null)};(function(r){r[r.ProviderChanged=0]="ProviderChanged",r[r.ProviderStateChanged=1]="ProviderStateChanged"})(bp||(bp={}))});var wp,t0=y(()=>{l();c();d();wp=class{}});function J(r,e,t,o){var i=arguments.length,n=i<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,t):o,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(r,e,t,o);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(n=(i<3?s(n):i>3?s(e,t,n):s(e,t))||n);return i>3&&n&&Object.defineProperty(e,t,n),n}function _e(r,e,t,o){function i(n){return n instanceof t?n:new t(function(s){s(n)})}return new(t||(t=Promise))(function(n,s){function a(p){try{h(o.next(p))}catch(f){s(f)}}function u(p){try{h(o.throw(p))}catch(f){s(f)}}function h(p){p.done?n(p.value):i(p.value).then(a,u)}h((o=o.apply(r,e||[])).next())})}var kt=y(()=>{l();c();d()});var mr,Kd=y(()=>{l();c();d();(function(r){r.GET="GET",r.PATCH="PATCH",r.POST="POST",r.PUT="PUT",r.DELETE="DELETE"})(mr||(mr={}))});var hc,ek=y(()=>{l();c();d();kt();Kd();hc=class r{constructor(e){if(this.requests=new Map,typeof e<"u"){let t=r.requestLimit;if(e.length>t){let o=new Error(`Maximum requests limit exceeded, Max allowed number of requests are ${t}`);throw o.name="Limit Exceeded Error",o}for(let o of e)this.addRequest(o)}}static validateDependencies(e){let t=n=>{let s=n.entries(),a=s.next();for(;!a.done;){let u=a.value[1];if(u.dependsOn!==void 0&&u.dependsOn.length>0)return!1;a=s.next()}return!0},o=n=>{let s=n.entries(),a=s.next(),u=a.value[1];if(u.dependsOn!==void 0&&u.dependsOn.length>0)return!1;let h=a;for(a=s.next();!a.done;){let p=a.value[1];if(p.dependsOn===void 0||p.dependsOn.length!==1||p.dependsOn[0]!==h.value[1].id)return!1;h=a,a=s.next()}return!0},i=n=>{let s=n.entries(),a=s.next(),u=a.value[1],h;if(u.dependsOn===void 0||u.dependsOn.length===0)h=u.id;else if(u.dependsOn.length===1){let p=u.dependsOn[0];if(p!==u.id&&n.has(p))h=p;else return!1}else return!1;for(a=s.next();!a.done;){let p=a.value[1];if((p.dependsOn===void 0||p.dependsOn.length===0)&&h!==p.id||p.dependsOn!==void 0&&p.dependsOn.length!==0&&(p.dependsOn.length===1&&(p.id===h||p.dependsOn[0]!==h)||p.dependsOn.length>1))return!1;a=s.next()}return!0};if(e.size===0){let n=new Error("Empty requests map, Please provide at least one request.");throw n.name="Empty Requests Error",n}return t(e)||o(e)||i(e)}static getRequestData(e){return _e(this,void 0,void 0,function*(){let t={url:""},o=new RegExp("^https?://");t.url=o.test(e.url)?"/"+e.url.split(/.*?\/\/.*?\//)[1]:e.url,t.method=e.method;let i={};return e.headers.forEach((n,s)=>{i[s]=n}),Object.keys(i).length&&(t.headers=i),(e.method===mr.PATCH||e.method===mr.POST||e.method===mr.PUT)&&(t.body=yield r.getRequestBody(e)),t})}static getRequestBody(e){return _e(this,void 0,void 0,function*(){let t=!1,o;try{o=yield e.clone().json(),t=!0}catch{}if(!t)try{if(typeof Blob<"u"){let i=yield e.blob(),n=new FileReader;o=yield new Promise(s=>{n.addEventListener("load",()=>{let a=n.result,h=new RegExp("^s*data:(.+?/.+?(;.+?=.+?)*)?(;base64)?,(.*)s*$").exec(a);s(h[4])},!1),n.readAsDataURL(i)})}else typeof Buffer<"u"&&(o=(yield e.buffer()).toString("base64"));t=!0}catch{}return o})}addRequest(e){let t=r.requestLimit;if(e.id===""){let o=new Error("Id for a request is empty, Please provide an unique id");throw o.name="Empty Id For Request",o}if(this.requests.size===t){let o=new Error(`Maximum requests limit exceeded, Max allowed number of requests are ${t}`);throw o.name="Limit Exceeded Error",o}if(this.requests.has(e.id)){let o=new Error(`Adding request with duplicate id ${e.id}, Make the id of the requests unique`);throw o.name="Duplicate RequestId Error",o}return this.requests.set(e.id,e),e.id}removeRequest(e){let t=this.requests.delete(e),o=this.requests.entries(),i=o.next();for(;!i.done;){let n=i.value[1].dependsOn;if(typeof n<"u"){let s=n.indexOf(e);s!==-1&&n.splice(s,1),n.length===0&&delete i.value[1].dependsOn}i=o.next()}return t}getContent(){return _e(this,void 0,void 0,function*(){let e=[],t={requests:e},o=this.requests.entries(),i=o.next();if(i.done){let n=new Error("No requests added yet, Please add at least one request.");throw n.name="Empty Payload",n}if(!r.validateDependencies(this.requests)){let n=new Error(`Invalid dependency found, Dependency should be: 1. Parallel - no individual request states a dependency in the dependsOn property. 2. Serial - all individual requests depend on the previous individual request. 3. Same - all individual requests that state a dependency in the dependsOn property, state the same dependency.`);throw n.name="Invalid Dependency",n}for(;!i.done;){let n=i.value[1],s=yield r.getRequestData(n.request);if(s.body!==void 0&&(s.headers===void 0||s.headers["content-type"]===void 0)){let a=new Error(`Content-type header is not mentioned for request #${n.id}, For request having body, Content-type header should be mentioned`);throw a.name="Invalid Content-type header",a}s.id=n.id,n.dependsOn!==void 0&&n.dependsOn.length>0&&(s.dependsOn=n.dependsOn),e.push(s),i=o.next()}return t.requests=e,t})}addDependency(e,t){if(!this.requests.has(e)){let o=new Error(`Dependent ${e} does not exists, Please check the id`);throw o.name="Invalid Dependent",o}if(typeof t<"u"&&!this.requests.has(t)){let o=new Error(`Dependency ${t} does not exists, Please check the id`);throw o.name="Invalid Dependency",o}if(typeof t<"u"){let o=this.requests.get(e);if(o.dependsOn===void 0&&(o.dependsOn=[]),o.dependsOn.indexOf(t)!==-1){let i=new Error(`Dependency ${t} is already added for the request ${e}`);throw i.name="Duplicate Dependency",i}o.dependsOn.push(t)}else{let o=this.requests.entries(),i,n=o.next();for(;!n.done&&n.value[1].id!==e;)i=n,n=o.next();if(typeof i<"u"){let s=i.value[0];if(n.value[1].dependsOn===void 0&&(n.value[1].dependsOn=[]),n.value[1].dependsOn.indexOf(s)!==-1){let a=new Error(`Dependency ${s} is already added for the request ${e}`);throw a.name="Duplicate Dependency",a}n.value[1].dependsOn.push(s)}else{let s=new Error(`Can't add dependency ${t}, There is only a dependent request in the batch`);throw s.name="Invalid Dependency Addition",s}}}removeDependency(e,t){let o=this.requests.get(e);if(typeof o>"u"||o.dependsOn===void 0||o.dependsOn.length===0)return!1;if(typeof t<"u"){let i=o.dependsOn.indexOf(t);return i===-1?!1:(o.dependsOn.splice(i,1),!0)}else return delete o.dependsOn,!0}};hc.requestLimit=20});var tk=y(()=>{l();c();d()});var rk,ok,ik,r0=y(()=>{l();c();d();rk="v1.0",ok="https://graph.microsoft.com/",ik=new Set(["graph.microsoft.com","graph.microsoft.us","dod-graph.microsoft.us","graph.microsoft.de","microsoftgraph.chinacloudapi.cn","canary.graph.microsoft.com"])});var gr,ts=y(()=>{l();c();d();gr=class r extends Error{constructor(e){super(e),Object.setPrototypeOf(this,r.prototype)}static setGraphClientError(e){let t;return e instanceof Error?t=e:(t=new r,t.customError=e),t}}});var nk,sk,Cp,xp,kp,ak,nO,Sp=y(()=>{l();c();d();r0();ts();nk=["$select","$expand","$orderby","$filter","$top","$skip","$skipToken","$count"],sk=r=>{let e=n=>n.replace(/\/+$/,""),t=n=>n.replace(/^\/+/,""),o=(n,s)=>[e(n),t(s)].join("/");return Array.prototype.slice.call(r).reduce(o)},Cp=r=>{let e=r&&r.constructor&&r.constructor.name;if(e==="Buffer"||e==="Blob"||e==="File"||e==="FormData"||typeof r=="string")return r;if(e==="ArrayBuffer")r=Buffer.from(r);else if(e==="Int8Array"||e==="Int16Array"||e==="Int32Array"||e==="Uint8Array"||e==="Uint16Array"||e==="Uint32Array"||e==="Uint8ClampedArray"||e==="Float32Array"||e==="Float64Array"||e==="DataView")r=Buffer.from(r.buffer);else try{r=JSON.stringify(r)}catch{throw new Error("Unable to stringify the content")}return r},xp=r=>ak(r),kp=(r,e)=>(e.forEach(t=>nO(t)),ak(r,e)),ak=(r,e=ik)=>{if(r=r.toLowerCase(),r.indexOf("https://")!==-1){r=r.replace("https://","");let t=r.indexOf(":"),o=r.indexOf("/"),i="";if(o!==-1)return t!==-1&&t{if(r.indexOf("/")!==-1)throw new gr("Please add only hosts or hostnames to the CustomHosts config. If the url is `http://example.com:3000/`, host is `example:3000`")}});var go,Ws=y(()=>{l();c();d();go=class{constructor(e=[]){this.middlewareOptions=new Map;for(let t of e){let o=t.constructor;this.middlewareOptions.set(o,t)}}getMiddlewareOptions(e){return this.middlewareOptions.get(e)}setMiddlewareOptions(e,t){this.middlewareOptions.set(e,t)}}});var o0,pc,fc,_p,lk,Ka=y(()=>{l();c();d();kt();o0=()=>{let r="";for(let e=0;e<32;e++)(e===8||e===12||e===16||e===20)&&(r+="-"),r+=Math.floor(Math.random()*16).toString(16);return r},pc=(r,e,t)=>{let o=null;if(typeof Request<"u"&&r instanceof Request)o=r.headers.get(t);else if(typeof e<"u"&&e.headers!==void 0)if(typeof Headers<"u"&&e.headers instanceof Headers)o=e.headers.get(t);else if(e.headers instanceof Array){let i=e.headers;for(let n=0,s=i.length;n{if(typeof Request<"u"&&r instanceof Request)r.headers.set(t,o);else if(typeof e<"u")if(e.headers===void 0)e.headers=new Headers({[t]:o});else if(typeof Headers<"u"&&e.headers instanceof Headers)e.headers.set(t,o);else if(e.headers instanceof Array){let i=0,n=e.headers.length;for(;i{typeof Request<"u"&&r instanceof Request?r.headers.append(t,o):typeof e<"u"&&(e.headers===void 0?e.headers=new Headers({[t]:o}):typeof Headers<"u"&&e.headers instanceof Headers?e.headers.append(t,o):e.headers instanceof Array?e.headers.push([t,o]):e.headers===void 0?e.headers={[t]:o}:e.headers[t]===void 0?e.headers[t]=o:e.headers[t]+=`, ${o}`)},lk=(r,e)=>_e(void 0,void 0,void 0,function*(){let t=e.headers.get("Content-Type")?yield e.blob():yield Promise.resolve(void 0),{method:o,headers:i,referrer:n,referrerPolicy:s,mode:a,credentials:u,cache:h,redirect:p,integrity:f,keepalive:b,signal:C}=e;return new Request(r,{method:o,headers:i,body:t,referrer:n,referrerPolicy:s,mode:a,credentials:u,cache:h,redirect:p,integrity:f,keepalive:b,signal:C})})});var Wa,i0=y(()=>{l();c();d();Wa=class{constructor(e,t){this.authenticationProvider=e,this.authenticationProviderOptions=t}}});var wn,ji,mc=y(()=>{l();c();d();Ws();(function(r){r[r.NONE=0]="NONE",r[r.REDIRECT_HANDLER_ENABLED=1]="REDIRECT_HANDLER_ENABLED",r[r.RETRY_HANDLER_ENABLED=2]="RETRY_HANDLER_ENABLED",r[r.AUTHENTICATION_HANDLER_ENABLED=4]="AUTHENTICATION_HANDLER_ENABLED"})(wn||(wn={}));ji=class r{constructor(){this.featureUsage=wn.NONE}static updateFeatureUsageFlag(e,t){let o;e.middlewareControl instanceof go?o=e.middlewareControl.getMiddlewareOptions(r):e.middlewareControl=new go,typeof o>"u"&&(o=new r,e.middlewareControl.setMiddlewareOptions(r,o)),o.setFeatureUsage(t)}setFeatureUsage(e){this.featureUsage=this.featureUsage|e}getFeatureUsage(){return this.featureUsage.toString(16)}}});var Ki,Tp=y(()=>{l();c();d();kt();Sp();Ws();Ka();i0();mc();Ki=class r{constructor(e){this.authenticationProvider=e}execute(e){return _e(this,void 0,void 0,function*(){let t=typeof e.request=="string"?e.request:e.request.url;if(xp(t)||e.customHosts&&kp(t,e.customHosts)){let o;e.middlewareControl instanceof go&&(o=e.middlewareControl.getMiddlewareOptions(Wa));let i,n;o&&(i=o.authenticationProvider,n=o.authenticationProviderOptions),i||(i=this.authenticationProvider);let a=`Bearer ${yield i.getAccessToken(n)}`;_p(e.request,e.options,r.AUTHORIZATION_HEADER,a),ji.updateFeatureUsageFlag(e,wn.AUTHENTICATION_HANDLER_ENABLED)}else e.options.headers&&delete e.options.headers[r.AUTHORIZATION_HEADER];return yield this.nextMiddleware.execute(e)})}setNext(e){this.nextMiddleware=e}};Ki.AUTHORIZATION_HEADER="Authorization"});var Cn,Ep=y(()=>{l();c();d();kt();Cn=class{execute(e){return _e(this,void 0,void 0,function*(){e.response=yield fetch(e.request,e.options)})}}});var Dr,Wd=y(()=>{l();c();d();Dr=class r{constructor(e=r.DEFAULT_DELAY,t=r.DEFAULT_MAX_RETRIES,o=r.defaultShouldRetry){if(e>r.MAX_DELAY&&t>r.MAX_MAX_RETRIES){let i=new Error(`Delay and MaxRetries should not be more than ${r.MAX_DELAY} and ${r.MAX_MAX_RETRIES}`);throw i.name="MaxLimitExceeded",i}else if(e>r.MAX_DELAY){let i=new Error(`Delay should not be more than ${r.MAX_DELAY}`);throw i.name="MaxLimitExceeded",i}else if(t>r.MAX_MAX_RETRIES){let i=new Error(`MaxRetries should not be more than ${r.MAX_MAX_RETRIES}`);throw i.name="MaxLimitExceeded",i}else if(e<0&&t<0){let i=new Error("Delay and MaxRetries should not be negative");throw i.name="MinExpectationNotMet",i}else if(e<0){let i=new Error("Delay should not be negative");throw i.name="MinExpectationNotMet",i}else if(t<0){let i=new Error("MaxRetries should not be negative");throw i.name="MinExpectationNotMet",i}this.delay=Math.min(e,r.MAX_DELAY),this.maxRetries=Math.min(t,r.MAX_MAX_RETRIES),this.shouldRetry=o}getMaxDelay(){return r.MAX_DELAY}};Dr.DEFAULT_DELAY=3;Dr.DEFAULT_MAX_RETRIES=3;Dr.MAX_DELAY=180;Dr.MAX_MAX_RETRIES=10;Dr.defaultShouldRetry=()=>!0});var ii,Ip=y(()=>{l();c();d();kt();Kd();Ws();Ka();Wd();mc();ii=class r{constructor(e=new Dr){this.options=e}isRetry(e){return r.RETRY_STATUS_CODES.indexOf(e.status)!==-1}isBuffered(e,t){let o=typeof e=="string"?t.method:e.method;return!((o===mr.PUT||o===mr.PATCH||o===mr.POST)&&pc(e,t,"Content-Type")==="application/octet-stream")}getDelay(e,t,o){let i=()=>Number(Math.random().toFixed(3)),n=e.headers!==void 0?e.headers.get(r.RETRY_AFTER_HEADER):null,s;return n!==null?Number.isNaN(Number(n))?s=Math.round((new Date(n).getTime()-Date.now())/1e3):s=Number(n):s=t>=2?this.getExponentialBackOffTime(t)+o+i():o+i(),Math.min(s,this.options.getMaxDelay()+i())}getExponentialBackOffTime(e){return Math.round(1/2*(Math.pow(2,e)-1))}sleep(e){return _e(this,void 0,void 0,function*(){let t=e*1e3;return new Promise(o=>setTimeout(o,t))})}getOptions(e){let t;return e.middlewareControl instanceof go&&(t=e.middlewareControl.getMiddlewareOptions(this.options.constructor)),typeof t>"u"&&(t=Object.assign(new Dr,this.options)),t}executeWithRetry(e,t,o){return _e(this,void 0,void 0,function*(){if(yield this.nextMiddleware.execute(e),t{l();c();d();ni=class r{constructor(e=r.DEFAULT_MAX_REDIRECTS,t=r.defaultShouldRedirect){if(e>r.MAX_MAX_REDIRECTS){let o=new Error(`MaxRedirects should not be more than ${r.MAX_MAX_REDIRECTS}`);throw o.name="MaxLimitExceeded",o}if(e<0){let o=new Error("MaxRedirects should not be negative");throw o.name="MinExpectationNotMet",o}this.maxRedirects=e,this.shouldRedirect=t}};ni.DEFAULT_MAX_REDIRECTS=5;ni.MAX_MAX_REDIRECTS=20;ni.defaultShouldRedirect=()=>!0});var Wi,Ap=y(()=>{l();c();d();kt();Kd();Ws();Ka();Qd();mc();Wi=class r{constructor(e=new ni){this.options=e}isRedirect(e){return r.REDIRECT_STATUS_CODES.indexOf(e.status)!==-1}hasLocationHeader(e){return e.headers.has(r.LOCATION_HEADER)}getLocationHeader(e){return e.headers.get(r.LOCATION_HEADER)}isRelativeURL(e){return e.indexOf("://")===-1}shouldDropAuthorizationHeader(e,t){let o=/^[A-Za-z].+?:\/\/.+?(?=\/|$)/,i=o.exec(e),n,s;i!==null&&(n=i[0]);let a=o.exec(t);return a!==null&&(s=a[0]),typeof n<"u"&&typeof s<"u"&&n!==s}updateRequestUrl(e,t){return _e(this,void 0,void 0,function*(){t.request=typeof t.request=="string"?e:yield lk(e,t.request)})}getOptions(e){let t;return e.middlewareControl instanceof go&&(t=e.middlewareControl.getMiddlewareOptions(ni)),typeof t>"u"&&(t=Object.assign(new ni,this.options)),t}executeWithRedirect(e,t,o){return _e(this,void 0,void 0,function*(){yield this.nextMiddleware.execute(e);let i=e.response;if(t{l();c();d();ck="3.0.2"});var Ho,Rp=y(()=>{l();c();d();kt();Sp();dk();Ws();Ka();mc();Ho=class r{execute(e){return _e(this,void 0,void 0,function*(){let t=typeof e.request=="string"?e.request:e.request.url;if(xp(t)||e.customHosts&&kp(t,e.customHosts)){let o=pc(e.request,e.options,r.CLIENT_REQUEST_ID_HEADER);o||(o=o0(),fc(e.request,e.options,r.CLIENT_REQUEST_ID_HEADER,o));let i=`${r.PRODUCT_NAME}/${ck}`,n;if(e.middlewareControl instanceof go&&(n=e.middlewareControl.getMiddlewareOptions(ji)),n){let s=n.getFeatureUsage();i+=` (${r.FEATURE_USAGE_STRING}=${s})`}_p(e.request,e.options,r.SDK_VERSION_HEADER,i)}else delete e.options.headers[r.CLIENT_REQUEST_ID_HEADER],delete e.options.headers[r.SDK_VERSION_HEADER];return yield this.nextMiddleware.execute(e)})}setNext(e){this.nextMiddleware=e}};Ho.CLIENT_REQUEST_ID_HEADER="client-request-id";Ho.SDK_VERSION_HEADER="SdkVersion";Ho.PRODUCT_NAME="graph-js";Ho.FEATURE_USAGE_STRING="featureUsage"});var uk=y(()=>{l();c();d();Tp();Ep();Qd();Wd();Ap();Ip();Rp()});var Yd,Pp=y(()=>{l();c();d();(function(r){r[r.MANUAL=0]="MANUAL",r[r.RANDOM=1]="RANDOM"})(Yd||(Yd={}))});var n0=y(()=>{l();c();d();Pp()});var hk=y(()=>{l();c();d()});var pk=y(()=>{l();c();d();kt();Ws();Ka();hk();n0();Pp()});var vr,Zd=y(()=>{l();c();d();(function(r){r.ARRAYBUFFER="arraybuffer",r.BLOB="blob",r.DOCUMENT="document",r.JSON="json",r.RAW="raw",r.STREAM="stream",r.TEXT="text"})(vr||(vr={}))});var s0,$p,Op,gc,a0=y(()=>{l();c();d();kt();Zd();(function(r){r.TEXT_HTML="text/html",r.TEXT_XML="text/xml",r.APPLICATION_XML="application/xml",r.APPLICATION_XHTML="application/xhtml+xml"})(s0||(s0={}));(function(r){r.TEXT_PLAIN="text/plain",r.APPLICATION_JSON="application/json"})($p||($p={}));(function(r){r.DOCUMENT="^(text\\/(html|xml))|(application\\/(xml|xhtml\\+xml))$",r.IMAGE="^image\\/.+"})(Op||(Op={}));gc=class r{static parseDocumentResponse(e,t){return typeof DOMParser<"u"?new Promise((o,i)=>{e.text().then(n=>{try{let a=new DOMParser().parseFromString(n,t);o(a)}catch(s){i(s)}})}):Promise.resolve(e.body)}static convertResponse(e,t){return _e(this,void 0,void 0,function*(){if(e.status===204)return Promise.resolve();let o,i=e.headers.get("Content-type");switch(t){case vr.ARRAYBUFFER:o=yield e.arrayBuffer();break;case vr.BLOB:o=yield e.blob();break;case vr.DOCUMENT:o=yield r.parseDocumentResponse(e,s0.TEXT_XML);break;case vr.JSON:o=yield e.json();break;case vr.STREAM:o=yield Promise.resolve(e.body);break;case vr.TEXT:o=yield e.text();break;default:if(i!==null){let n=i.split(";")[0];new RegExp(Op.DOCUMENT).test(n)?o=yield r.parseDocumentResponse(e,n):new RegExp(Op.IMAGE).test(n)?o=e.blob():n===$p.TEXT_PLAIN?o=yield e.text():n===$p.APPLICATION_JSON?o=yield e.json():o=Promise.resolve(e.body)}else o=Promise.resolve(e.body);break}return o})}static getResponse(e,t,o){return _e(this,void 0,void 0,function*(){if(t===vr.RAW)return Promise.resolve(e);{let i=yield r.convertResponse(e,t);if(e.ok)if(typeof o=="function")o(null,i);else return i;else throw i}})}}});var Qs,l0=y(()=>{l();c();d();Qs=class{constructor(e=-1,t=-1){this.minValue=e,this.maxValue=t}}});var Jd,c0=y(()=>{l();c();d();Jd=class r{constructor(e,t){this._location=t,this._responseBody=e}get location(){return this._location}set location(e){this._location=e}get responseBody(){return this._responseBody}set responseBody(e){this._responseBody=e}static CreateUploadResult(e,t){return new r(e,t.get("location"))}}});var Xd,d0=y(()=>{l();c();d();kt();ts();a0();Zd();l0();c0();Xd=class{constructor(e,t,o,i={}){if(this.DEFAULT_FILE_SIZE=5*1024*1024,this.client=e,t.sliceFile)this.file=t;else throw new gr("Please pass the FileUpload object, StreamUpload object or any custom implementation of the FileObject interface");this.file=t,i.rangeSize||(i.rangeSize=this.DEFAULT_FILE_SIZE),this.options=i,this.uploadSession=o,this.nextRange=new Qs(0,this.options.rangeSize-1)}static createUploadSession(e,t,o,i={}){return _e(this,void 0,void 0,function*(){let n=yield e.api(t).headers(i).post(o);return{url:n.uploadUrl,expiry:new Date(n.expirationDateTime),isCancelled:!1}})}parseRange(e){let t=e[0];if(typeof t>"u"||t==="")return new Qs;let o=t.split("-"),i=parseInt(o[0],10),n=parseInt(o[1],10);return Number.isNaN(n)&&(n=this.file.size-1),new Qs(i,n)}updateTaskStatus(e){this.uploadSession.expiry=new Date(e.expirationDateTime),this.nextRange=this.parseRange(e.nextExpectedRanges)}getNextRange(){if(this.nextRange.minValue===-1)return this.nextRange;let e=this.nextRange.minValue,t=e+this.options.rangeSize-1;return t>=this.file.size&&(t=this.file.size-1),new Qs(e,t)}sliceFile(e){if(console.warn("The LargeFileUploadTask.sliceFile() function has been deprecated and moved into the FileObject interface."),this.file.content instanceof ArrayBuffer||this.file.content instanceof Blob||this.file.content instanceof Uint8Array)return this.file.content.slice(e.minValue,e.maxValue+1);throw new gr("The LargeFileUploadTask.sliceFile() function expects only Blob, ArrayBuffer or Uint8Array file content. Please note that the sliceFile() function is deprecated.")}upload(){return _e(this,void 0,void 0,function*(){let e=this.options&&this.options.uploadEventHandlers;for(;!this.uploadSession.isCancelled;){let t=this.getNextRange();if(t.maxValue===-1){let a=new Error("Task with which you are trying to upload is already completed, Please check for your uploaded file");throw a.name="Invalid Session",a}let o=yield this.file.sliceFile(t),i=yield this.uploadSliceGetRawResponse(o,t,this.file.size);if(!i)throw new gr("Something went wrong! Large file upload slice response is null.");let n=yield gc.getResponse(i);if(i.status===201||i.status===200&&n.id)return Jd.CreateUploadResult(n,i.headers);let s={expirationDateTime:n.expirationDateTime||n.ExpirationDateTime,nextExpectedRanges:n.NextExpectedRanges||n.nextExpectedRanges};this.updateTaskStatus(s),e&&e.progress&&e.progress(t,e.extraCallbackParam)}})}uploadSlice(e,t,o){return _e(this,void 0,void 0,function*(){return yield this.client.api(this.uploadSession.url).headers({"Content-Length":`${t.maxValue-t.minValue+1}`,"Content-Range":`bytes ${t.minValue}-${t.maxValue}/${o}`,"Content-Type":"application/octet-stream"}).put(e)})}uploadSliceGetRawResponse(e,t,o){return _e(this,void 0,void 0,function*(){return yield this.client.api(this.uploadSession.url).headers({"Content-Length":`${t.maxValue-t.minValue+1}`,"Content-Range":`bytes ${t.minValue}-${t.maxValue}/${o}`,"Content-Type":"application/octet-stream"}).responseType(vr.RAW).put(e)})}cancel(){return _e(this,void 0,void 0,function*(){let e=yield this.client.api(this.uploadSession.url).responseType(vr.RAW).delete();return e.status===204&&(this.uploadSession.isCancelled=!0),e})}getStatus(){return _e(this,void 0,void 0,function*(){let e=yield this.client.api(this.uploadSession.url).get();return this.updateTaskStatus(e),e})}resume(){return _e(this,void 0,void 0,function*(){return yield this.getStatus(),yield this.upload()})}getUploadSession(){return this.uploadSession}}});var eu,u0=y(()=>{l();c();d();ts();eu=class{constructor(e,t,o){if(this.content=e,this.name=t,this.size=o,!e||!t||!o)throw new gr("Please provide the upload content, name of the file and size of the file")}sliceFile(e){return this.content.slice(e.minValue,e.maxValue+1)}}});var aO,h0,p0=y(()=>{l();c();d();aO=r=>(r>327680&&(r=Math.floor(r/327680)*320*1024),r),h0=(r=5242880)=>(r>62914560&&(r=62914560),aO(r))});var Mp,fk=y(()=>{l();c();d();kt();ts();u0();d0();p0();Mp=class r extends Xd{constructor(e,t,o,i){super(e,t,o,i)}static constructCreateSessionUrl(e,t=r.DEFAULT_UPLOAD_PATH){return e=e.trim(),t=t.trim(),t===""&&(t="/"),t[0]!=="/"&&(t=`/${t}`),t[t.length-1]!=="/"&&(t=`${t}/`),`/me/drive/root:${t.split("/").map(o=>encodeURIComponent(o)).join("/")}${encodeURIComponent(e)}:/createUploadSession`}static getFileInfo(e,t){let o,i;if(typeof Blob<"u"&&e instanceof Blob)o=new File([e],t),i=o.size;else if(typeof File<"u"&&e instanceof File)o=e,i=o.size;else if(typeof Uint8Array<"u"&&e instanceof Uint8Array){let n=e;i=n.byteLength,o=n.buffer.slice(n.byteOffset,n.byteOffset+n.byteLength)}return{content:o,size:i}}static create(e,t,o){return _e(this,void 0,void 0,function*(){if(!e||!t||!o)throw new gr("Please provide the Graph client instance, file object and OneDriveLargeFileUploadOptions value");let i=o.fileName,n=r.getFileInfo(t,i),s=new eu(n.content,i,n.size);return this.createTaskWithFileObject(e,s,o)})}static createTaskWithFileObject(e,t,o){return _e(this,void 0,void 0,function*(){if(!e||!t||!o)throw new gr("Please provide the Graph client instance, FileObject interface implementation and OneDriveLargeFileUploadOptions value");let i=r.constructCreateSessionUrl(o.fileName,o.path),n={fileName:o.fileName,fileDescription:o.fileDescription,conflictBehavior:o.conflictBehavior},s=yield r.createUploadSession(e,i,n),a=h0(o.rangeSize);return new r(e,t,s,{rangeSize:a,uploadEventHandlers:o.uploadEventHandlers})})}static createUploadSession(e,t,o){let i=Object.create(null,{createUploadSession:{get:()=>super.createUploadSession}});return _e(this,void 0,void 0,function*(){let n={item:{"@microsoft.graph.conflictBehavior":o?.conflictBehavior||"rename",name:o?.fileName,description:o?.fileDescription}};return i.createUploadSession.call(this,e,t,n)})}commit(e,t="rename"){return _e(this,void 0,void 0,function*(){let o={name:this.file.name,"@microsoft.graph.conflictBehavior":t,"@microsoft.graph.sourceUrl":this.uploadSession.url};return yield this.client.api(e).put(o)})}};Mp.DEFAULT_UPLOAD_PATH="/"});var mk=y(()=>{l();c();d();kt();ts()});var gk=y(()=>{l();c();d();kt()});var tu,f0=y(()=>{l();c();d();kt();ts();tu=class{constructor(e){this.provider=e}getAccessToken(){return _e(this,void 0,void 0,function*(){return new Promise((e,t)=>{this.provider((o,i)=>_e(this,void 0,void 0,function*(){if(i)e(i);else{if(!o){let s="Access token is undefined or empty. Please provide a valid token. For more help - https://github.com/microsoftgraph/msgraph-sdk-javascript/blob/dev/docs/CustomAuthenticationProvider.md";o=new gr(s)}let n=yield gr.setGraphClientError(o);t(n)}}))})})}}});var Qa,m0=y(()=>{l();c();d();Qa=class r extends Error{constructor(e=-1,t,o){super(t||o&&o.message),Object.setPrototypeOf(this,r.prototype),this.statusCode=e,this.code=null,this.requestId=null,this.date=new Date,this.body=null,this.stack=o?o.stack:this.stack}}});var Dp,vk=y(()=>{l();c();d();kt();m0();Dp=class r{static constructError(e,t){let o=new Qa(t,"",e);return e.name!==void 0&&(o.code=e.name),o.body=e.toString(),o.date=new Date,o}static constructErrorFromResponse(e,t){let o=e.error,i=new Qa(t,o.message);return i.code=o.code,o.innerError!==void 0&&(i.requestId=o.innerError["request-id"],i.date=new Date(o.innerError.date)),i.body=JSON.stringify(o),i}static getError(e=null,t=-1,o){return _e(this,void 0,void 0,function*(){let i;if(e&&e.error?i=r.constructErrorFromResponse(e,t):e instanceof Error?i=r.constructError(e,t):(i=new Qa(t),i.body=e),typeof o=="function")o(i,null);else return i})}}});var ru,g0=y(()=>{l();c();d();kt();ts();vk();Sp();a0();Ws();Kd();Zd();ru=class{constructor(e,t,o){this.parsePath=i=>{if(i.indexOf("https://")!==-1){i=i.replace("https://","");let s=i.indexOf("/");s!==-1&&(this.urlComponents.host="https://"+i.substring(0,s),i=i.substring(s+1,i.length));let a=i.indexOf("/");a!==-1&&(this.urlComponents.version=i.substring(0,a),i=i.substring(a+1,i.length))}i.charAt(0)==="/"&&(i=i.substr(1));let n=i.indexOf("?");if(n===-1)this.urlComponents.path=i;else{this.urlComponents.path=i.substr(0,n);let s=i.substring(n+1,i.length).split("&");for(let a of s)this.parseQueryParameter(a)}},this.httpClient=e,this.config=t,this.urlComponents={host:this.config.baseUrl,version:this.config.defaultVersion,oDataQueryParams:{},otherURLQueryParams:{},otherURLQueryOptions:[]},this._headers={},this._options={},this._middlewareOptions=[],this.parsePath(o)}addCsvQueryParameter(e,t,o){this.urlComponents.oDataQueryParams[e]=this.urlComponents.oDataQueryParams[e]?this.urlComponents.oDataQueryParams[e]+",":"";let i=[];o.length>1&&typeof t=="string"?i=Array.prototype.slice.call(o):typeof t=="string"?i.push(t):i=i.concat(t),this.urlComponents.oDataQueryParams[e]+=i.join(",")}buildFullUrl(){let e=sk([this.urlComponents.host,this.urlComponents.version,this.urlComponents.path])+this.createQueryString();return this.config.debugLogging&&console.log(e),e}createQueryString(){let e=this.urlComponents,t=[];if(Object.keys(e.oDataQueryParams).length!==0)for(let o in e.oDataQueryParams)Object.prototype.hasOwnProperty.call(e.oDataQueryParams,o)&&t.push(o+"="+e.oDataQueryParams[o]);if(Object.keys(e.otherURLQueryParams).length!==0)for(let o in e.otherURLQueryParams)Object.prototype.hasOwnProperty.call(e.otherURLQueryParams,o)&&t.push(o+"="+e.otherURLQueryParams[o]);if(e.otherURLQueryOptions.length!==0)for(let o of e.otherURLQueryOptions)t.push(o);return t.length>0?"?"+t.join("&"):""}parseQueryParameter(e){if(typeof e=="string")if(e.charAt(0)==="?"&&(e=e.substring(1)),e.indexOf("&")!==-1){let t=e.split("&");for(let o of t)this.parseQueryParamenterString(o)}else this.parseQueryParamenterString(e);else if(e.constructor===Object)for(let t in e)Object.prototype.hasOwnProperty.call(e,t)&&this.setURLComponentsQueryParamater(t,e[t]);return this}parseQueryParamenterString(e){if(this.isValidQueryKeyValuePair(e)){let t=e.indexOf("="),o=e.substring(0,t),i=e.substring(t+1);this.setURLComponentsQueryParamater(o,i)}else this.urlComponents.otherURLQueryOptions.push(e)}setURLComponentsQueryParamater(e,t){if(nk.indexOf(e)!==-1){let o=this.urlComponents.oDataQueryParams[e],i=o&&(e==="$expand"||e==="$select"||e==="$orderby");this.urlComponents.oDataQueryParams[e]=i?o+","+t:t}else this.urlComponents.otherURLQueryParams[e]=t}isValidQueryKeyValuePair(e){let t=e.indexOf("=");return!(t===-1||e.indexOf("(")!==-1&&e.indexOf("("){l();c();d();kt();vc=class{constructor(...e){if(!e||!e.length){let t=new Error;throw t.name="InvalidMiddlewareChain",t.message="Please provide a default middleware chain or custom middleware chain",t}this.setMiddleware(...e)}setMiddleware(...e){e.length>1?this.parseMiddleWareArray(e):this.middleware=e[0]}parseMiddleWareArray(e){e.forEach((t,o)=>{o{l();c();d();v0();Tp();Ep();Qd();Wd();Ap();Ip();Rp();lO=()=>typeof process=="object"&&typeof qv=="function",Fp=class r{static createWithAuthenticationProvider(e){let t=new Ki(e),o=new ii(new Dr),i=new Ho,n=new Cn;if(t.setNext(o),lO()){let s=new Wi(new ni);o.setNext(s),s.setNext(i)}else o.setNext(i);return i.setNext(n),r.createWithMiddleware(t)}static createWithMiddleware(...e){return new vc(...e)}}});var bk,wk=y(()=>{l();c();d();bk=()=>{if(typeof Promise>"u"&&typeof fetch>"u"){let r=new Error("Library cannot function without Promise and fetch. So, please provide polyfill for them.");throw r.name="PolyFillNotAvailable",r}else if(typeof Promise>"u"){let r=new Error("Library cannot function without Promise. So, please provide polyfill for it.");throw r.name="PolyFillNotAvailable",r}else if(typeof fetch>"u"){let r=new Error("Library cannot function without fetch. So, please provide polyfill for it.");throw r.name="PolyFillNotAvailable",r}return!0}});var Ya,Ck=y(()=>{l();c();d();r0();f0();g0();v0();yk();wk();Ya=class r{constructor(e){this.config={baseUrl:ok,debugLogging:!1,defaultVersion:rk},bk();for(let o in e)Object.prototype.hasOwnProperty.call(e,o)&&(this.config[o]=e[o]);let t;if(e.authProvider!==void 0&&e.middleware!==void 0){let o=new Error;throw o.name="AmbiguityInInitialization",o.message="Unable to Create Client, Please provide either authentication provider for default middleware chain or custom middleware chain not both",o}else if(e.authProvider!==void 0)t=Fp.createWithAuthenticationProvider(e.authProvider);else if(e.middleware!==void 0)t=new vc(...[].concat(e.middleware));else{let o=new Error;throw o.name="InvalidMiddlewareChain",o.message="Unable to Create Client, Please provide either authentication provider for default middleware chain or custom middleware chain",o}this.httpClient=t}static init(e){let t={};for(let o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=o==="authProvider"?new tu(e[o]):e[o]);return r.initWithMiddleware(t)}static initWithMiddleware(e){return new r(e)}api(e){return new ru(this.httpClient,this.config,e)}}});var Za=y(()=>{l();c();d();ek();tk();Tp();Ep();Ip();Ap();Rp();uk();i0();Wd();Qd();mc();n0();Pp();pk();d0();fk();p0();mk();u0();c0();l0();gk();Ck();f0();m0();ts();g0();Zd()});var cO,xk,kk=y(()=>{l();c();d();cO=function(r,e,t,o){function i(n){return n instanceof t?n:new t(function(s){s(n)})}return new(t||(t=Promise))(function(n,s){function a(p){try{h(o.next(p))}catch(f){s(f)}}function u(p){try{h(o.throw(p))}catch(f){s(f)}}function h(p){p.done?n(p.value):i(p.value).then(a,u)}h((o=o.apply(r,e||[])).next())})},xk=r=>cO(void 0,void 0,void 0,function*(){return new Promise(e=>{setTimeout(e,r)})})});var be,y0=y(()=>{l();c();d();Za();es();be=(r,e=V.globalProvider)=>{let o={scopes:e.needsAdditionalScopes(r)};return e.isIncrementalConsentDisabled?[]:[new Wa(void 0,o)]}});var Lp,Sk=y(()=>{l();c();d();Lp=class{constructor(e,t,o,i){this.resource=o.startsWith("/")?o:`/${o}`,this.method=i,this.index=e,this.id=t}}});var _k,Np,Tk=y(()=>{l();c();d();t0();Za();kk();y0();Sk();_k=function(r,e,t,o){function i(n){return n instanceof t?n:new t(function(s){s(n)})}return new(t||(t=Promise))(function(n,s){function a(p){try{h(o.next(p))}catch(f){s(f)}}function u(p){try{h(o.throw(p))}catch(f){s(f)}}function h(p){p.done?n(p.value):i(p.value).then(a,u)}h((o=o.apply(r,e||[])).next())})},Np=class r{static get baseUrl(){return"https://graph.microsoft.com"}constructor(e){this.graph=e,this.allRequests=[],this.requestsQueue=[],this.scopes=[],this.nextIndex=0,this.retryAfter=0}get hasRequests(){return this.requestsQueue.length>0}get(e,t,o,i){let n=this.nextIndex++,s=new Lp(n,e,t,"GET");s.headers=i,this.allRequests.push(s),this.requestsQueue.push(n),o&&(this.scopes=this.scopes.concat(o))}executeNext(){return _k(this,void 0,void 0,function*(){let e=new Map;if(this.retryAfter&&(yield xk(this.retryAfter*1e3),this.retryAfter=0),!this.hasRequests)return e;let t=this.requestsQueue.splice(0,20),o=new hc;for(let u of t.map(h=>this.allRequests[h]))o.addRequest({id:u.index.toString(),request:new Request(r.baseUrl+u.resource,{method:u.method,headers:u.headers})});let i=this.scopes.length?be(this.scopes):[],n=this.graph.api("$batch").middlewareOptions(i),s=yield o.getContent(),a=yield n.post(s);for(let u of a.responses){let h=new wp,p=parseInt(u.id,10),f=this.allRequests[p];if(h.id=f.id,h.index=f.index,h.headers=u.headers,u.status!==200){if(u.status===429){this.requestsQueue.unshift(p);let b=u.headers["Retry-After"];this.retryAfter=Math.max(this.retryAfter,parseInt(b,10)||1)}continue}else typeof u.body=="string"?u.headers["Content-Type"].includes("image/jpeg")?h.content="data:image/jpeg;base64,"+u.body:u.headers["Content-Type"].includes("image/pjpeg")?h.content="data:image/pjpeg;base64,"+u.body:u.headers["Content-Type"].includes("image/png")&&(h.content="data:image/png;base64,"+u.body):h.content=u.body;e.set(f.id,h)}return e})}executeAll(){return _k(this,void 0,void 0,function*(){let e=new Map;for(;this.hasRequests;){let t=yield this.executeNext();for(let[o,i]of t)e.set(o,i)}return e})}}});var yc,b0=y(()=>{l();c();d();yc=class{constructor(e){typeof e=="string"?this.componentName=e:this.componentName=e.tagName.toLowerCase()}}});var Hp,Up=y(()=>{l();c();d();Hp=(...r)=>{let e=r[0],t=e;for(let o=1;o{l();c();d();Ka();b0();vp();dO=function(r,e,t,o){function i(n){return n instanceof t?n:new t(function(s){s(n)})}return new(t||(t=Promise))(function(n,s){function a(p){try{h(o.next(p))}catch(f){s(f)}}function u(p){try{h(o.throw(p))}catch(f){s(f)}}function h(p){p.done?n(p.value):i(p.value).then(a,u)}h((o=o.apply(r,e||[])).next())})},Bp=class{constructor(e,t){this._packageVersion=e,this._providerName=t}execute(e){var t;return dO(this,void 0,void 0,function*(){try{if(typeof e.request=="string")if(gp(e.request)){let o=[],i=e.middlewareControl.getMiddlewareOptions(yc);if(i){let a=`${i.componentName}/${this._packageVersion}`;o.push(a)}if(this._providerName){let a=`${this._providerName}/${this._packageVersion}`;o.push(a)}let n=`mgt/${this._packageVersion}`;o.push(n),o.push(pc(e.request,e.options,"SdkVersion"));let s=o.join(", ");fc(e.request,e.options,"SdkVersion",s)}else(t=e?.options)===null||t===void 0||delete t.headers.SdkVersion}catch{}return yield this._nextMiddleware.execute(e)})}setNext(e){this._nextMiddleware=e}}});var rs,ou=y(()=>{l();c();d();rs="4.2.5"});var w0,Jr,bc=y(()=>{l();c();d();w0=class{constructor(){this._disambiguation=""}get defaultPrefix(){return"mgt"}withDisambiguation(e){return e&&!this._disambiguation&&(this._disambiguation=e.toLowerCase(),e!==this._disambiguation&&console.warn(`\u{1F992}: Disambiguation value, ${e}, should be lowercase. Value has been converted to lowercase, ${this._disambiguation}.`)),this}get prefix(){return this._disambiguation?`${this.defaultPrefix}-${this._disambiguation}`:this.defaultPrefix}get disambiguation(){return this._disambiguation}get isDisambiguated(){return!!this._disambiguation}normalize(e){return this.isDisambiguated?e.toUpperCase().replace(this.prefix.toUpperCase(),this.defaultPrefix.toUpperCase()):e}},Jr=new w0});var uO,Ja,C0,iu=y(()=>{l();c();d();Za();jd();Tk();b0();Up();Ek();ou();bc();uO="v1.0",Ja=class r{get client(){return this._client}get componentName(){return this._componentName}get version(){return this._version}constructor(e,t=uO){this._client=e,this._version=t}forComponent(e){let t=new r(this._client,this._version);return t.setComponent(e),t}api(e){let t=this._client.api(e).version(this._version);return this._componentName&&(t.middlewareOptions=o=>(t._middlewareOptions=t._middlewareOptions.concat(o),t),t=t.middlewareOptions([new yc(this._componentName)])),t}createBatch(){return new Np(this)}setComponent(e){this._componentName=e instanceof Element?Jr.normalize(e.tagName):e}},C0=(r,e,t)=>{let o=[new Ki(r),new ii(new Dr),new Ho,new Bp(rs,r.name),new Cn],i=r.baseURL?r.baseURL:Gd,n=Ya.initWithMiddleware({middleware:Hp(...o),customHosts:r.customHosts?new Set(r.customHosts):null,baseUrl:i}),s=new Ja(n,e);return t?s.forComponent(t):s}});var hO,wc,Ik=y(()=>{l();c();d();iu();hO="beta",wc=class r extends Ja{static fromGraph(e){let t=new r(e.client);return t.setComponent(e.componentName),t}constructor(e,t=hO){super(e,t)}forComponent(e){let t=new r(this.client);return this.setComponent(e),t}}});var zp,qp,Rk,Ak,Vp,Pk,x0,Gp,k0=y(()=>{l();c();d();zp=globalThis,qp=zp.ShadowRoot&&(zp.ShadyCSS===void 0||zp.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,Rk=Symbol(),Ak=new WeakMap,Vp=class{constructor(e,t,o){if(this._$cssResult$=!0,o!==Rk)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=t}get styleSheet(){let e=this.o,t=this.t;if(qp&&e===void 0){let o=t!==void 0&&t.length===1;o&&(e=Ak.get(t)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),o&&Ak.set(t,e))}return e}toString(){return this.cssText}},Pk=r=>new Vp(typeof r=="string"?r:r+"",void 0,Rk),x0=(r,e)=>{if(qp)r.adoptedStyleSheets=e.map(t=>t instanceof CSSStyleSheet?t:t.styleSheet);else for(let t of e){let o=document.createElement("style"),i=zp.litNonce;i!==void 0&&o.setAttribute("nonce",i),o.textContent=t.cssText,r.appendChild(o)}},Gp=qp?r=>r:r=>r instanceof CSSStyleSheet?(e=>{let t="";for(let o of e.cssRules)t+=o.cssText;return Pk(t)})(r):r});var pO,fO,mO,gO,vO,yO,jp,$k,bO,wO,nu,su,Kp,Ok,Xa,S0=y(()=>{l();c();d();k0();k0();({is:pO,defineProperty:fO,getOwnPropertyDescriptor:mO,getOwnPropertyNames:gO,getOwnPropertySymbols:vO,getPrototypeOf:yO}=Object),jp=globalThis,$k=jp.trustedTypes,bO=$k?$k.emptyScript:"",wO=jp.reactiveElementPolyfillSupport,nu=(r,e)=>r,su={toAttribute(r,e){switch(e){case Boolean:r=r?bO:null;break;case Object:case Array:r=r==null?r:JSON.stringify(r)}return r},fromAttribute(r,e){let t=r;switch(e){case Boolean:t=r!==null;break;case Number:t=r===null?null:Number(r);break;case Object:case Array:try{t=JSON.parse(r)}catch{t=null}}return t}},Kp=(r,e)=>!pO(r,e),Ok={attribute:!0,type:String,converter:su,reflect:!1,hasChanged:Kp};Symbol.metadata??=Symbol("metadata"),jp.litPropertyMetadata??=new WeakMap;Xa=class extends HTMLElement{static addInitializer(e){this._$Ei(),(this.l??=[]).push(e)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(e,t=Ok){if(t.state&&(t.attribute=!1),this._$Ei(),this.elementProperties.set(e,t),!t.noAccessor){let o=Symbol(),i=this.getPropertyDescriptor(e,o,t);i!==void 0&&fO(this.prototype,e,i)}}static getPropertyDescriptor(e,t,o){let{get:i,set:n}=mO(this.prototype,e)??{get(){return this[t]},set(s){this[t]=s}};return{get(){return i?.call(this)},set(s){let a=i?.call(this);n.call(this,s),this.requestUpdate(e,a,o)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??Ok}static _$Ei(){if(this.hasOwnProperty(nu("elementProperties")))return;let e=yO(this);e.finalize(),e.l!==void 0&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(nu("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(nu("properties"))){let t=this.properties,o=[...gO(t),...vO(t)];for(let i of o)this.createProperty(i,t[i])}let e=this[Symbol.metadata];if(e!==null){let t=litPropertyMetadata.get(e);if(t!==void 0)for(let[o,i]of t)this.elementProperties.set(o,i)}this._$Eh=new Map;for(let[t,o]of this.elementProperties){let i=this._$Eu(t,o);i!==void 0&&this._$Eh.set(i,t)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){let t=[];if(Array.isArray(e)){let o=new Set(e.flat(1/0).reverse());for(let i of o)t.unshift(Gp(i))}else e!==void 0&&t.push(Gp(e));return t}static _$Eu(e,t){let o=t.attribute;return o===!1?void 0:typeof o=="string"?o:typeof e=="string"?e.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise(e=>this.enableUpdating=e),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(e=>e(this))}addController(e){(this._$EO??=new Set).add(e),this.renderRoot!==void 0&&this.isConnected&&e.hostConnected?.()}removeController(e){this._$EO?.delete(e)}_$E_(){let e=new Map,t=this.constructor.elementProperties;for(let o of t.keys())this.hasOwnProperty(o)&&(e.set(o,this[o]),delete this[o]);e.size>0&&(this._$Ep=e)}createRenderRoot(){let e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return x0(e,this.constructor.elementStyles),e}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(e=>e.hostConnected?.())}enableUpdating(e){}disconnectedCallback(){this._$EO?.forEach(e=>e.hostDisconnected?.())}attributeChangedCallback(e,t,o){this._$AK(e,o)}_$EC(e,t){let o=this.constructor.elementProperties.get(e),i=this.constructor._$Eu(e,o);if(i!==void 0&&o.reflect===!0){let n=(o.converter?.toAttribute!==void 0?o.converter:su).toAttribute(t,o.type);this._$Em=e,n==null?this.removeAttribute(i):this.setAttribute(i,n),this._$Em=null}}_$AK(e,t){let o=this.constructor,i=o._$Eh.get(e);if(i!==void 0&&this._$Em!==i){let n=o.getPropertyOptions(i),s=typeof n.converter=="function"?{fromAttribute:n.converter}:n.converter?.fromAttribute!==void 0?n.converter:su;this._$Em=i,this[i]=s.fromAttribute(t,n.type),this._$Em=null}}requestUpdate(e,t,o){if(e!==void 0){if(o??=this.constructor.getPropertyOptions(e),!(o.hasChanged??Kp)(this[e],t))return;this.P(e,t,o)}this.isUpdatePending===!1&&(this._$ES=this._$ET())}P(e,t,o){this._$AL.has(e)||this._$AL.set(e,t),o.reflect===!0&&this._$Em!==e&&(this._$Ej??=new Set).add(e)}async _$ET(){this.isUpdatePending=!0;try{await this._$ES}catch(t){Promise.reject(t)}let e=this.scheduleUpdate();return e!=null&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(let[i,n]of this._$Ep)this[i]=n;this._$Ep=void 0}let o=this.constructor.elementProperties;if(o.size>0)for(let[i,n]of o)n.wrapped!==!0||this._$AL.has(i)||this[i]===void 0||this.P(i,this[i],n)}let e=!1,t=this._$AL;try{e=this.shouldUpdate(t),e?(this.willUpdate(t),this._$EO?.forEach(o=>o.hostUpdate?.()),this.update(t)):this._$EU()}catch(o){throw e=!1,this._$EU(),o}e&&this._$AE(t)}willUpdate(e){}_$AE(e){this._$EO?.forEach(t=>t.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$EU(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(e){return!0}update(e){this._$Ej&&=this._$Ej.forEach(t=>this._$EC(t,this[t])),this._$EU()}updated(e){}firstUpdated(e){}};Xa.elementStyles=[],Xa.shadowRootOptions={mode:"open"},Xa[nu("elementProperties")]=new Map,Xa[nu("finalized")]=new Map,wO?.({ReactiveElement:Xa}),(jp.reactiveElementVersions??=[]).push("2.0.4")});function qk(r,e){if(!Array.isArray(r)||!r.hasOwnProperty("raw"))throw Error("invalid template strings array");return Mk!==void 0?Mk.createHTML(e):e}function ol(r,e,t=r,o){if(e===is)return e;let i=o!==void 0?t._$Co?.[o]:t._$Cl,n=lu(e)?void 0:e._$litDirective$;return i?.constructor!==n&&(i?._$AO?.(!1),n===void 0?i=void 0:(i=new n(r),i._$AT(r,t,o)),o!==void 0?(t._$Co??=[])[o]=i:t._$Cl=i),i!==void 0&&(e=ol(r,i._$AS(r,e.values),i,o)),e}var T0,Wp,Mk,E0,os,I0,CO,rl,Qp,lu,Uk,Bk,_0,au,Dk,Fk,el,Lk,Nk,zk,Vk,Oj,Mj,is,yr,Hk,tl,Gk,cu,Yp,du,il,Zp,Jp,Xp,ef,jk,xO,Cc=y(()=>{l();c();d();T0=globalThis,Wp=T0.trustedTypes,Mk=Wp?Wp.createPolicy("lit-html",{createHTML:r=>r}):void 0,E0="$lit$",os=`lit$${(Math.random()+"").slice(9)}$`,I0="?"+os,CO=`<${I0}>`,rl=document,Qp=()=>rl.createComment(""),lu=r=>r===null||typeof r!="object"&&typeof r!="function",Uk=Array.isArray,Bk=r=>Uk(r)||typeof r?.[Symbol.iterator]=="function",_0=`[ \f\r]`,au=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,Dk=/-->/g,Fk=/>/g,el=RegExp(`>|${_0}(?:([^\\s"'>=/]+)(${_0}*=${_0}*(?:[^ \f\r"'\`<>=]|("|')|))|$)`,"g"),Lk=/'/g,Nk=/"/g,zk=/^(?:script|style|textarea|title)$/i,Vk=r=>(e,...t)=>({_$litType$:r,strings:e,values:t}),Oj=Vk(1),Mj=Vk(2),is=Symbol.for("lit-noChange"),yr=Symbol.for("lit-nothing"),Hk=new WeakMap,tl=rl.createTreeWalker(rl,129);Gk=(r,e)=>{let t=r.length-1,o=[],i,n=e===2?"":"",s=au;for(let a=0;a"?(s=i??au,f=-1):p[1]===void 0?f=-2:(f=s.lastIndex-p[2].length,h=p[1],s=p[3]===void 0?el:p[3]==='"'?Nk:Lk):s===Nk||s===Lk?s=el:s===Dk||s===Fk?s=au:(s=el,i=void 0);let C=s===el&&r[a+1].startsWith("/>")?" ":"";n+=s===au?u+CO:f>=0?(o.push(h),u.slice(0,f)+E0+u.slice(f)+os+C):u+os+(f===-2?a:C)}return[qk(r,n+(r[t]||"")+(e===2?"":"")),o]},cu=class r{constructor({strings:e,_$litType$:t},o){let i;this.parts=[];let n=0,s=0,a=e.length-1,u=this.parts,[h,p]=Gk(e,t);if(this.el=r.createElement(h,o),tl.currentNode=this.el.content,t===2){let f=this.el.content.firstChild;f.replaceWith(...f.childNodes)}for(;(i=tl.nextNode())!==null&&u.length0){i.textContent=Wp?Wp.emptyScript:"";for(let C=0;C2||o[0]!==""||o[1]!==""?(this._$AH=Array(o.length-1).fill(new String),this.strings=o):this._$AH=yr}_$AI(e,t=this,o,i){let n=this.strings,s=!1;if(n===void 0)e=ol(this,e,t,0),s=!lu(e)||e!==this._$AH&&e!==is,s&&(this._$AH=e);else{let a=e,u,h;for(e=n[0],u=0;u{l();c();d();tf=globalThis,rf=tf.ShadowRoot&&(tf.ShadyCSS===void 0||tf.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,A0=Symbol(),Kk=new WeakMap,uu=class{constructor(e,t,o){if(this._$cssResult$=!0,o!==A0)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=t}get styleSheet(){let e=this.o,t=this.t;if(rf&&e===void 0){let o=t!==void 0&&t.length===1;o&&(e=Kk.get(t)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),o&&Kk.set(t,e))}return e}toString(){return this.cssText}},Wk=r=>new uu(typeof r=="string"?r:r+"",void 0,A0),Oe=(r,...e)=>{let t=r.length===1?r[0]:e.reduce((o,i,n)=>o+(s=>{if(s._$cssResult$===!0)return s.cssText;if(typeof s=="number")return s;throw Error("Value passed to 'css' function must be a 'css' function result: "+s+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(i)+r[n+1],r[0]);return new uu(t,r,A0)},R0=(r,e)=>{if(rf)r.adoptedStyleSheets=e.map(t=>t instanceof CSSStyleSheet?t:t.styleSheet);else for(let t of e){let o=document.createElement("style"),i=tf.litNonce;i!==void 0&&o.setAttribute("nonce",i),o.textContent=t.cssText,r.appendChild(o)}},of=rf?r=>r:r=>r instanceof CSSStyleSheet?(e=>{let t="";for(let o of e.cssRules)t+=o.cssText;return Wk(t)})(r):r});var kO,SO,_O,TO,EO,IO,nf,Qk,AO,RO,hu,$0,Zk,Yk,ns,O0=y(()=>{l();c();d();P0();P0();({is:kO,defineProperty:SO,getOwnPropertyDescriptor:_O,getOwnPropertyNames:TO,getOwnPropertySymbols:EO,getPrototypeOf:IO}=Object),nf=globalThis,Qk=nf.trustedTypes,AO=Qk?Qk.emptyScript:"",RO=nf.reactiveElementPolyfillSupport,hu=(r,e)=>r,$0={toAttribute(r,e){switch(e){case Boolean:r=r?AO:null;break;case Object:case Array:r=r==null?r:JSON.stringify(r)}return r},fromAttribute(r,e){let t=r;switch(e){case Boolean:t=r!==null;break;case Number:t=r===null?null:Number(r);break;case Object:case Array:try{t=JSON.parse(r)}catch{t=null}}return t}},Zk=(r,e)=>!kO(r,e),Yk={attribute:!0,type:String,converter:$0,reflect:!1,hasChanged:Zk};Symbol.metadata??=Symbol("metadata"),nf.litPropertyMetadata??=new WeakMap;ns=class extends HTMLElement{static addInitializer(e){this._$Ei(),(this.l??=[]).push(e)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(e,t=Yk){if(t.state&&(t.attribute=!1),this._$Ei(),this.elementProperties.set(e,t),!t.noAccessor){let o=Symbol(),i=this.getPropertyDescriptor(e,o,t);i!==void 0&&SO(this.prototype,e,i)}}static getPropertyDescriptor(e,t,o){let{get:i,set:n}=_O(this.prototype,e)??{get(){return this[t]},set(s){this[t]=s}};return{get(){return i?.call(this)},set(s){let a=i?.call(this);n.call(this,s),this.requestUpdate(e,a,o)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??Yk}static _$Ei(){if(this.hasOwnProperty(hu("elementProperties")))return;let e=IO(this);e.finalize(),e.l!==void 0&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(hu("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(hu("properties"))){let t=this.properties,o=[...TO(t),...EO(t)];for(let i of o)this.createProperty(i,t[i])}let e=this[Symbol.metadata];if(e!==null){let t=litPropertyMetadata.get(e);if(t!==void 0)for(let[o,i]of t)this.elementProperties.set(o,i)}this._$Eh=new Map;for(let[t,o]of this.elementProperties){let i=this._$Eu(t,o);i!==void 0&&this._$Eh.set(i,t)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){let t=[];if(Array.isArray(e)){let o=new Set(e.flat(1/0).reverse());for(let i of o)t.unshift(of(i))}else e!==void 0&&t.push(of(e));return t}static _$Eu(e,t){let o=t.attribute;return o===!1?void 0:typeof o=="string"?o:typeof e=="string"?e.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise(e=>this.enableUpdating=e),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(e=>e(this))}addController(e){(this._$EO??=new Set).add(e),this.renderRoot!==void 0&&this.isConnected&&e.hostConnected?.()}removeController(e){this._$EO?.delete(e)}_$E_(){let e=new Map,t=this.constructor.elementProperties;for(let o of t.keys())this.hasOwnProperty(o)&&(e.set(o,this[o]),delete this[o]);e.size>0&&(this._$Ep=e)}createRenderRoot(){let e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return R0(e,this.constructor.elementStyles),e}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(e=>e.hostConnected?.())}enableUpdating(e){}disconnectedCallback(){this._$EO?.forEach(e=>e.hostDisconnected?.())}attributeChangedCallback(e,t,o){this._$AK(e,o)}_$EC(e,t){let o=this.constructor.elementProperties.get(e),i=this.constructor._$Eu(e,o);if(i!==void 0&&o.reflect===!0){let n=(o.converter?.toAttribute!==void 0?o.converter:$0).toAttribute(t,o.type);this._$Em=e,n==null?this.removeAttribute(i):this.setAttribute(i,n),this._$Em=null}}_$AK(e,t){let o=this.constructor,i=o._$Eh.get(e);if(i!==void 0&&this._$Em!==i){let n=o.getPropertyOptions(i),s=typeof n.converter=="function"?{fromAttribute:n.converter}:n.converter?.fromAttribute!==void 0?n.converter:$0;this._$Em=i,this[i]=s.fromAttribute(t,n.type),this._$Em=null}}requestUpdate(e,t,o){if(e!==void 0){if(o??=this.constructor.getPropertyOptions(e),!(o.hasChanged??Zk)(this[e],t))return;this.P(e,t,o)}this.isUpdatePending===!1&&(this._$ES=this._$ET())}P(e,t,o){this._$AL.has(e)||this._$AL.set(e,t),o.reflect===!0&&this._$Em!==e&&(this._$Ej??=new Set).add(e)}async _$ET(){this.isUpdatePending=!0;try{await this._$ES}catch(t){Promise.reject(t)}let e=this.scheduleUpdate();return e!=null&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(let[i,n]of this._$Ep)this[i]=n;this._$Ep=void 0}let o=this.constructor.elementProperties;if(o.size>0)for(let[i,n]of o)n.wrapped!==!0||this._$AL.has(i)||this[i]===void 0||this.P(i,this[i],n)}let e=!1,t=this._$AL;try{e=this.shouldUpdate(t),e?(this.willUpdate(t),this._$EO?.forEach(o=>o.hostUpdate?.()),this.update(t)):this._$EU()}catch(o){throw e=!1,this._$EU(),o}e&&this._$AE(t)}willUpdate(e){}_$AE(e){this._$EO?.forEach(t=>t.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$EU(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(e){return!0}update(e){this._$Ej&&=this._$Ej.forEach(t=>this._$EC(t,this[t])),this._$EU()}updated(e){}firstUpdated(e){}};ns.elementStyles=[],ns.shadowRootOptions={mode:"open"},ns[hu("elementProperties")]=new Map,ns[hu("finalized")]=new Map,RO?.({ReactiveElement:ns}),(nf.reactiveElementVersions??=[]).push("2.0.4")});function cS(r,e){if(!Array.isArray(r)||!r.hasOwnProperty("raw"))throw Error("invalid template strings array");return Jk!==void 0?Jk.createHTML(e):e}function xc(r,e,t=r,o){if(e===ll)return e;let i=o!==void 0?t._$Co?.[o]:t._$Cl,n=mu(e)?void 0:e._$litDirective$;return i?.constructor!==n&&(i?._$AO?.(!1),n===void 0?i=void 0:(i=new n(r),i._$AT(r,t,o)),o!==void 0?(t._$Co??=[])[o]=i:t._$Cl=i),i!==void 0&&(e=xc(r,i._$AS(r,e.values),i,o)),e}var U0,sf,Jk,iS,Ys,nS,PO,al,fu,mu,sS,$O,M0,pu,Xk,eS,nl,tS,rS,aS,lS,x,Qj,ll,ot,oS,sl,OO,gu,D0,vu,kc,F0,L0,N0,H0,MO,dS,B0=y(()=>{l();c();d();U0=globalThis,sf=U0.trustedTypes,Jk=sf?sf.createPolicy("lit-html",{createHTML:r=>r}):void 0,iS="$lit$",Ys=`lit$${(Math.random()+"").slice(9)}$`,nS="?"+Ys,PO=`<${nS}>`,al=document,fu=()=>al.createComment(""),mu=r=>r===null||typeof r!="object"&&typeof r!="function",sS=Array.isArray,$O=r=>sS(r)||typeof r?.[Symbol.iterator]=="function",M0=`[ \f\r]`,pu=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,Xk=/-->/g,eS=/>/g,nl=RegExp(`>|${M0}(?:([^\\s"'>=/]+)(${M0}*=${M0}*(?:[^ -\f\r"'\`<>=]|("|')|))|$)`,"g"),tS=/'/g,rS=/"/g,aS=/^(?:script|style|textarea|title)$/i,lS=r=>(e,...t)=>({_$litType$:r,strings:e,values:t}),x=lS(1),Qj=lS(2),ll=Symbol.for("lit-noChange"),ot=Symbol.for("lit-nothing"),oS=new WeakMap,sl=al.createTreeWalker(al,129);OO=(r,e)=>{let t=r.length-1,o=[],i,n=e===2?"":"",s=pu;for(let a=0;a"?(s=i??pu,f=-1):p[1]===void 0?f=-2:(f=s.lastIndex-p[2].length,h=p[1],s=p[3]===void 0?nl:p[3]==='"'?rS:tS):s===rS||s===tS?s=nl:s===Xk||s===eS?s=pu:(s=nl,i=void 0);let C=s===nl&&r[a+1].startsWith("/>")?" ":"";n+=s===pu?u+PO:f>=0?(o.push(h),u.slice(0,f)+iS+u.slice(f)+Ys+C):u+Ys+(f===-2?a:C)}return[cS(r,n+(r[t]||"")+(e===2?"":"")),o]},gu=class r{constructor({strings:e,_$litType$:t},o){let i;this.parts=[];let n=0,s=0,a=e.length-1,u=this.parts,[h,p]=OO(e,t);if(this.el=r.createElement(h,o),sl.currentNode=this.el.content,t===2){let f=this.el.content.firstChild;f.replaceWith(...f.childNodes)}for(;(i=sl.nextNode())!==null&&u.length0){i.textContent=sf?sf.emptyScript:"";for(let C=0;C2||o[0]!==""||o[1]!==""?(this._$AH=Array(o.length-1).fill(new String),this.strings=o):this._$AH=ot}_$AI(e,t=this,o,i){let n=this.strings,s=!1;if(n===void 0)e=xc(this,e,t,0),s=!mu(e)||e!==this._$AH&&e!==ll,s&&(this._$AH=e);else{let a=e,u,h;for(e=n[0],u=0;u{let o=t?.renderBefore??e,i=o._$litPart$;if(i===void 0){let n=t?.renderBefore??null;o._$litPart$=i=new vu(e.insertBefore(fu(),n),n,void 0,t??{})}return i._$AI(r),i}});var xn,DO,uS=y(()=>{l();c();d();O0();O0();B0();B0();xn=class extends ns{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){let e=super.createRenderRoot();return this.renderOptions.renderBefore??=e.firstChild,e}update(e){let t=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=dS(t,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return ll}};xn._$litElement$=!0,xn["finalized"]=!0,globalThis.litElementHydrateSupport?.({LitElement:xn});DO=globalThis.litElementPolyfillSupport;DO?.({LitElement:xn});(globalThis.litElementVersions??=[]).push("4.0.4")});var hS=y(()=>{l();c();d();});var xe=y(()=>{l();c();d();S0();Cc();uS();hS()});var pS=y(()=>{l();c();d();});function E(r){return(e,t)=>typeof t=="object"?LO(r,e,t):((o,i,n)=>{let s=i.hasOwnProperty(n);return i.constructor.createProperty(n,s?{...o,wrapped:!0}:o),s?Object.getOwnPropertyDescriptor(i,n):void 0})(r,e,t)}var FO,LO,z0=y(()=>{l();c();d();S0();FO={attribute:!0,type:String,converter:su,reflect:!1,hasChanged:Kp},LO=(r=FO,e,t)=>{let{kind:o,metadata:i}=t,n=globalThis.litPropertyMetadata.get(i);if(n===void 0&&globalThis.litPropertyMetadata.set(i,n=new Map),n.set(t.name,r),o==="accessor"){let{name:s}=t;return{set(a){let u=e.get.call(this);e.set.call(this,a),this.requestUpdate(s,u,r)},init(a){return a!==void 0&&this.P(s,void 0,r),a}}}if(o==="setter"){let{name:s}=t;return function(a){let u=this[s];e.call(this,a),this.requestUpdate(s,u,r)}}throw Error("Unsupported decorator location: "+o)}});function X(r){return E({...r,state:!0,attribute:!1})}var fS=y(()=>{l();c();d();z0();});var mS=y(()=>{l();c();d();});var Sc=y(()=>{l();c();d();});var gS=y(()=>{l();c();d();Sc();});var vS=y(()=>{l();c();d();Sc();});var yS=y(()=>{l();c();d();Sc();});var bS=y(()=>{l();c();d();Sc();});var wS=y(()=>{l();c();d();Sc();});var gt=y(()=>{l();c();d();pS();z0();fS();mS();gS();vS();yS();bS();wS()});var Er,lf=y(()=>{l();c();d();qd();Er=class{static get strings(){return this._strings}static set strings(e){this._strings=e,this._stringsEventDispatcher.fire(null)}static getDocumentDirection(){var e,t;switch(((e=document.body)===null||e===void 0?void 0:e.getAttribute("dir"))||((t=document.documentElement)===null||t===void 0?void 0:t.getAttribute("dir"))){case"rtl":return"rtl";case"auto":return"auto";case"ltr":default:return"ltr"}}static onStringsUpdated(e){this._stringsEventDispatcher.add(e)}static removeOnStringsUpdated(e){this._stringsEventDispatcher.remove(e)}static onDirectionUpdated(e){this._directionEventDispatcher.add(e),this.initDirection()}static removeOnDirectionUpdated(e){this._directionEventDispatcher.remove(e)}static initDirection(){if(this._isDirectionInit)return;this._isDirectionInit=!0,this.mutationObserver=new MutationObserver(t=>{t.forEach(o=>{o.attributeName==="dir"&&this._directionEventDispatcher.fire(null)})});let e={attributes:!0,attributeFilter:["dir"]};this.mutationObserver.observe(document.body,e),this.mutationObserver.observe(document.documentElement,e)}static updateStringsForTag(e,t){var o;if(e=e.toLowerCase(),e.startsWith("mgt-")&&(e=e.substring(4)),this._strings&&t){for(let i of Object.entries(t)){let n=this._strings[i[0]];typeof n=="string"&&(t[i[0]]=n)}if(!((o=this._strings._components)===null||o===void 0)&&o[e]){let i=this._strings._components[e];for(let n of Object.keys(i))t[n]&&(t[n]=i[n])}}return t}};Er._stringsEventDispatcher=new Gi;Er._directionEventDispatcher=new Gi;Er._isDirectionInit=!1});var xS,kS,CS,ss,kn,yu=y(()=>{l();c();d();xe();gt();bn();es();lf();ou();xS=function(r,e,t,o){var i=arguments.length,n=i<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,t):o,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(r,e,t,o);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(n=(i<3?s(n):i>3?s(e,t,n):s(e,t))||n);return i>3&&n&&Object.defineProperty(e,t,n),n},kS=function(r,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(r,e)},CS=function(r,e,t,o){function i(n){return n instanceof t?n:new t(function(s){s(n)})}return new(t||(t=Promise))(function(n,s){function a(p){try{h(o.next(p))}catch(f){s(f)}}function u(p){try{h(o.throw(p))}catch(f){s(f)}}function h(p){p.done?n(p.value):i(p.value).then(a,u)}h((o=o.apply(r,e||[])).next())})};(function(r){r.mobile="",r.tablet="tablet",r.desktop="desktop"})(ss||(ss={}));kn=class extends xn{static get packageVersion(){return rs}get mediaQuery(){return this.offsetWidth<768?ss.mobile:this.offsetWidth<1200?ss.tablet:ss.desktop}get isLoadingState(){return this._isLoadingState}get isFirstUpdated(){return this._isFirstUpdated}get strings(){return{}}constructor(){super(),this.providerState=ie.Loading,this.direction="ltr",this._isLoadingState=!1,this._isFirstUpdated=!1,this.setLoadingState=e=>{this._isLoadingState!==e&&(this._isLoadingState=e,this.requestUpdate("isLoadingState"))},this.handleProviderUpdates=()=>{var e,t;this.providerState=(t=(e=V.globalProvider)===null||e===void 0?void 0:e.state)!==null&&t!==void 0?t:ie.Loading,this.requestStateUpdate()},this.handleActiveAccountUpdates=()=>{this.clearState(),this.requestStateUpdate()},this.handleLocalizationChanged=()=>{Er.updateStringsForTag(this.tagName,this.strings),this.requestUpdate()},this.handleDirectionChanged=()=>{this.direction=Er.getDocumentDirection()},this.handleDirectionChanged(),this.handleLocalizationChanged()}connectedCallback(){super.connectedCallback(),Er.onStringsUpdated(this.handleLocalizationChanged),Er.onDirectionUpdated(this.handleDirectionChanged)}disconnectedCallback(){super.disconnectedCallback(),Er.removeOnStringsUpdated(this.handleLocalizationChanged),Er.removeOnDirectionUpdated(this.handleDirectionChanged),V.removeProviderUpdatedListener(this.handleProviderUpdates),V.removeActiveAccountChangedListener(this.handleActiveAccountUpdates)}firstUpdated(e){super.firstUpdated(e),this._isFirstUpdated=!0,V.onProviderUpdated(this.handleProviderUpdates),V.onActiveAccountChanged(this.handleActiveAccountUpdates),this.requestStateUpdate()}loadState(){return Promise.resolve()}clearState(){}fireCustomEvent(e,t,o=!1,i=!1,n=!1){let s=new CustomEvent(e,{bubbles:o,cancelable:i,composed:n,detail:t});return this.dispatchEvent(s)}updated(e){super.updated(e);let t=new CustomEvent("updated",{bubbles:!0,cancelable:!0});this.dispatchEvent(t)}requestStateUpdate(e=!1){return CS(this,void 0,void 0,function*(){if(!this._isFirstUpdated)return;this.isLoadingState&&!e&&(yield this._currentLoadStatePromise);let t=V.globalProvider;if(!t)return Promise.resolve();if(t.state===ie.SignedOut){this.clearState();return}else{if(t.state===ie.Loading)return Promise.resolve();{let o=new Promise((i,n)=>CS(this,void 0,void 0,function*(){try{this.setLoadingState(!0),this.fireCustomEvent("loadingInitiated"),yield this.loadState(),this.setLoadingState(!1),this.fireCustomEvent("loadingCompleted"),i()}catch(s){this.clearState(),this.setLoadingState(!1),this.fireCustomEvent("loadingFailed"),n(s)}return this._currentLoadStatePromise=this.isLoadingState&&this._currentLoadStatePromise&&e?this._currentLoadStatePromise.then(()=>o):o}))}}})}};xS([X(),kS("design:type",Number)],kn.prototype,"providerState",void 0);xS([X(),kS("design:type",String)],kn.prototype,"direction",void 0)});var V0,q0,_c,SS=y(()=>{l();c();d();gt();yu();V0=function(r,e,t,o){var i=arguments.length,n=i<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,t):o,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(r,e,t,o);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(n=(i<3?s(n):i>3?s(e,t,n):s(e,t))||n);return i>3&&n&&Object.defineProperty(e,t,n),n},q0=function(r,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(r,e)},_c=class extends kn{constructor(){super(...arguments),this.stateChangedHandler=()=>{this.fireCustomEvent("onStateChanged",this.provider.state)}}get provider(){return this._provider}set provider(e){this._provider&&this.provider.removeStateChangedHandler(()=>this.stateChangedHandler),this._provider=e,this._provider&&this.provider.onStateChanged(()=>this.stateChangedHandler)}get isAvailable(){return!0}firstUpdated(e){super.firstUpdated(e);let t=!1;if(this.dependsOn){let o=this.dependsOn;for(;o;){if(o.isAvailable){t=!0;break}o=o.dependsOn}}!t&&this.isAvailable&&this.initializeProvider()}initializeProvider(){}};V0([E({attribute:"depends-on",converter:r=>document.querySelector(r),type:String}),q0("design:type",_c)],_c.prototype,"dependsOn",void 0);V0([E({attribute:"base-url",type:String}),q0("design:type",String)],_c.prototype,"baseUrl",void 0);V0([E({attribute:"custom-hosts",type:String,converter:r=>r.split(",").map(e=>e.trim())}),q0("design:type",Array)],_c.prototype,"customHosts",void 0)});var cf,uf,TS,_S,df,ES,G0,hf,j0=y(()=>{l();c();d();cf=globalThis,uf=cf.ShadowRoot&&(cf.ShadyCSS===void 0||cf.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,TS=Symbol(),_S=new WeakMap,df=class{constructor(e,t,o){if(this._$cssResult$=!0,o!==TS)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=t}get styleSheet(){let e=this.o,t=this.t;if(uf&&e===void 0){let o=t!==void 0&&t.length===1;o&&(e=_S.get(t)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),o&&_S.set(t,e))}return e}toString(){return this.cssText}},ES=r=>new df(typeof r=="string"?r:r+"",void 0,TS),G0=(r,e)=>{if(uf)r.adoptedStyleSheets=e.map(t=>t instanceof CSSStyleSheet?t:t.styleSheet);else for(let t of e){let o=document.createElement("style"),i=cf.litNonce;i!==void 0&&o.setAttribute("nonce",i),o.textContent=t.cssText,r.appendChild(o)}},hf=uf?r=>r:r=>r instanceof CSSStyleSheet?(e=>{let t="";for(let o of e.cssRules)t+=o.cssText;return ES(t)})(r):r});var NO,HO,UO,BO,zO,VO,pf,IS,qO,GO,bu,K0,ff,AS,cl,RS=y(()=>{l();c();d();j0();j0();({is:NO,defineProperty:HO,getOwnPropertyDescriptor:UO,getOwnPropertyNames:BO,getOwnPropertySymbols:zO,getPrototypeOf:VO}=Object),pf=globalThis,IS=pf.trustedTypes,qO=IS?IS.emptyScript:"",GO=pf.reactiveElementPolyfillSupport,bu=(r,e)=>r,K0={toAttribute(r,e){switch(e){case Boolean:r=r?qO:null;break;case Object:case Array:r=r==null?r:JSON.stringify(r)}return r},fromAttribute(r,e){let t=r;switch(e){case Boolean:t=r!==null;break;case Number:t=r===null?null:Number(r);break;case Object:case Array:try{t=JSON.parse(r)}catch{t=null}}return t}},ff=(r,e)=>!NO(r,e),AS={attribute:!0,type:String,converter:K0,reflect:!1,hasChanged:ff};Symbol.metadata??=Symbol("metadata"),pf.litPropertyMetadata??=new WeakMap;cl=class extends HTMLElement{static addInitializer(e){this._$Ei(),(this.l??=[]).push(e)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(e,t=AS){if(t.state&&(t.attribute=!1),this._$Ei(),this.elementProperties.set(e,t),!t.noAccessor){let o=Symbol(),i=this.getPropertyDescriptor(e,o,t);i!==void 0&&HO(this.prototype,e,i)}}static getPropertyDescriptor(e,t,o){let{get:i,set:n}=UO(this.prototype,e)??{get(){return this[t]},set(s){this[t]=s}};return{get(){return i?.call(this)},set(s){let a=i?.call(this);n.call(this,s),this.requestUpdate(e,a,o)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??AS}static _$Ei(){if(this.hasOwnProperty(bu("elementProperties")))return;let e=VO(this);e.finalize(),e.l!==void 0&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(bu("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(bu("properties"))){let t=this.properties,o=[...BO(t),...zO(t)];for(let i of o)this.createProperty(i,t[i])}let e=this[Symbol.metadata];if(e!==null){let t=litPropertyMetadata.get(e);if(t!==void 0)for(let[o,i]of t)this.elementProperties.set(o,i)}this._$Eh=new Map;for(let[t,o]of this.elementProperties){let i=this._$Eu(t,o);i!==void 0&&this._$Eh.set(i,t)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){let t=[];if(Array.isArray(e)){let o=new Set(e.flat(1/0).reverse());for(let i of o)t.unshift(hf(i))}else e!==void 0&&t.push(hf(e));return t}static _$Eu(e,t){let o=t.attribute;return o===!1?void 0:typeof o=="string"?o:typeof e=="string"?e.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$Eg=new Promise(e=>this.enableUpdating=e),this._$AL=new Map,this._$ES(),this.requestUpdate(),this.constructor.l?.forEach(e=>e(this))}addController(e){(this._$E_??=new Set).add(e),this.renderRoot!==void 0&&this.isConnected&&e.hostConnected?.()}removeController(e){this._$E_?.delete(e)}_$ES(){let e=new Map,t=this.constructor.elementProperties;for(let o of t.keys())this.hasOwnProperty(o)&&(e.set(o,this[o]),delete this[o]);e.size>0&&(this._$Ep=e)}createRenderRoot(){let e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return G0(e,this.constructor.elementStyles),e}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$E_?.forEach(e=>e.hostConnected?.())}enableUpdating(e){}disconnectedCallback(){this._$E_?.forEach(e=>e.hostDisconnected?.())}attributeChangedCallback(e,t,o){this._$AK(e,o)}_$EO(e,t){let o=this.constructor.elementProperties.get(e),i=this.constructor._$Eu(e,o);if(i!==void 0&&o.reflect===!0){let n=(o.converter?.toAttribute!==void 0?o.converter:K0).toAttribute(t,o.type);this._$Em=e,n==null?this.removeAttribute(i):this.setAttribute(i,n),this._$Em=null}}_$AK(e,t){let o=this.constructor,i=o._$Eh.get(e);if(i!==void 0&&this._$Em!==i){let n=o.getPropertyOptions(i),s=typeof n.converter=="function"?{fromAttribute:n.converter}:n.converter?.fromAttribute!==void 0?n.converter:K0;this._$Em=i,this[i]=s.fromAttribute(t,n.type),this._$Em=null}}requestUpdate(e,t,o){if(e!==void 0){if(o??=this.constructor.getPropertyOptions(e),!(o.hasChanged??ff)(this[e],t))return;this.C(e,t,o)}this.isUpdatePending===!1&&(this._$Eg=this._$EP())}C(e,t,o){this._$AL.has(e)||this._$AL.set(e,t),o.reflect===!0&&this._$Em!==e&&(this._$ET??=new Set).add(e)}async _$EP(){this.isUpdatePending=!0;try{await this._$Eg}catch(t){Promise.reject(t)}let e=this.scheduleUpdate();return e!=null&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(let[i,n]of this._$Ep)this[i]=n;this._$Ep=void 0}let o=this.constructor.elementProperties;if(o.size>0)for(let[i,n]of o)n.wrapped!==!0||this._$AL.has(i)||this[i]===void 0||this.C(i,this[i],n)}let e=!1,t=this._$AL;try{e=this.shouldUpdate(t),e?(this.willUpdate(t),this._$E_?.forEach(o=>o.hostUpdate?.()),this.update(t)):this._$Ej()}catch(o){throw e=!1,this._$Ej(),o}e&&this._$AE(t)}willUpdate(e){}_$AE(e){this._$E_?.forEach(t=>t.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$Ej(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$Eg}shouldUpdate(e){return!0}update(e){this._$ET&&=this._$ET.forEach(t=>this._$EO(t,this[t])),this._$Ej()}updated(e){}firstUpdated(e){}};cl.elementStyles=[],cl.shadowRootOptions={mode:"open"},cl[bu("elementProperties")]=new Map,cl[bu("finalized")]=new Map,GO?.({ReactiveElement:cl}),(pf.reactiveElementVersions??=[]).push("2.0.3")});var Zs,PS,wu,$S,OS=y(()=>{l();c();d();RS();Zs={INITIAL:0,PENDING:1,COMPLETE:2,ERROR:3},PS=Symbol(),wu=class{get taskComplete(){return this.t||(this.status===1?this.t=new Promise((e,t)=>{this.i=e,this.o=t}):this.status===3?this.t=Promise.reject(this.h):this.t=Promise.resolve(this.l)),this.t}constructor(e,t,o){this.u=0,this.status=0,(this.p=e).addController(this);let i=typeof t=="object"?t:{task:t,args:o};this._=i.task,this.v=i.args,this.j=i.argsEqual??$S,this.m=i.onComplete,this.g=i.onError,this.autoRun=i.autoRun??!0,"initialValue"in i&&(this.l=i.initialValue,this.status=2,this.k=this.A?.())}hostUpdate(){this.autoRun===!0&&this.O()}hostUpdated(){this.autoRun==="afterUpdate"&&this.O()}A(){if(this.v===void 0)return;let e=this.v();if(!Array.isArray(e))throw Error("The args function must return an array");return e}async O(){let e=this.A(),t=this.k;this.k=e,e===t||e===void 0||t!==void 0&&this.j(t,e)||await this.run(e)}async run(e){let t,o;e??=this.A(),this.k=e,this.status===1?this.T?.abort():(this.t=void 0,this.i=void 0,this.o=void 0),this.status=1,this.autoRun==="afterUpdate"?queueMicrotask(()=>this.p.requestUpdate()):this.p.requestUpdate();let i=++this.u;this.T=new AbortController;let n=!1;try{t=await this._(e,{signal:this.T.signal})}catch(s){n=!0,o=s}if(this.u===i){if(t===PS)this.status=0;else{if(n===!1){try{this.m?.(t)}catch{}this.status=2,this.i?.(t)}else{try{this.g?.(o)}catch{}this.status=3,this.o?.(o)}this.l=t,this.h=o}this.p.requestUpdate()}}abort(e){this.status===1&&this.T?.abort(e)}get value(){return this.l}get error(){return this.h}render(e){switch(this.status){case 0:return e.initial?.();case 1:return e.pending?.();case 2:return e.complete?.(this.value);case 3:return e.error?.(this.error);default:throw Error("Unexpected status: "+this.status)}}},$S=(r,e)=>r===e||r.length===e.length&&r.every((t,o)=>!ff(t,e[o]))});var Cu=y(()=>{l();c();d();OS()});var MS,DS,jO,Fr,W0=y(()=>{l();c();d();Cu();xe();gt();bn();es();lf();ou();yu();MS=function(r,e,t,o){var i=arguments.length,n=i<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,t):o,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(r,e,t,o);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(n=(i<3?s(n):i>3?s(e,t,n):s(e,t))||n);return i>3&&n&&Object.defineProperty(e,t,n),n},DS=function(r,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(r,e)},jO=function(r,e,t,o){function i(n){return n instanceof t?n:new t(function(s){s(n)})}return new(t||(t=Promise))(function(n,s){function a(p){try{h(o.next(p))}catch(f){s(f)}}function u(p){try{h(o.throw(p))}catch(f){s(f)}}function h(p){p.done?n(p.value):i(p.value).then(a,u)}h((o=o.apply(r,e||[])).next())})},Fr=class extends xn{static get packageVersion(){return rs}get mediaQuery(){return this.offsetWidth<768?ss.mobile:this.offsetWidth<1200?ss.tablet:ss.desktop}get isFirstUpdated(){return this._isFirstUpdated}get strings(){return{}}constructor(){super(),this.providerState=ie.Loading,this.direction="ltr",this._isFirstUpdated=!1,this._task=new wu(this,{task:()=>this.loadState(),args:()=>this.args()}),this.renderLoading=()=>x`Loading...`,this.renderError=e=>x`

Error: ${e}

`,this.renderContent=()=>x``,this.handleProviderUpdates=()=>{var e,t;this.providerState=(t=(e=V.globalProvider)===null||e===void 0?void 0:e.state)!==null&&t!==void 0?t:ie.Loading},this.handleActiveAccountUpdates=()=>{this.clearState()},this.handleLocalizationChanged=()=>{Er.updateStringsForTag(this.tagName,this.strings),this.requestUpdate()},this.handleDirectionChanged=()=>{this.direction=Er.getDocumentDirection()},this.handleDirectionChanged(),this.handleLocalizationChanged()}connectedCallback(){super.connectedCallback(),Er.onStringsUpdated(this.handleLocalizationChanged),Er.onDirectionUpdated(this.handleDirectionChanged)}disconnectedCallback(){super.disconnectedCallback(),Er.removeOnStringsUpdated(this.handleLocalizationChanged),Er.removeOnDirectionUpdated(this.handleDirectionChanged),V.removeProviderUpdatedListener(this.handleProviderUpdates),V.removeActiveAccountChangedListener(this.handleActiveAccountUpdates)}firstUpdated(e){super.firstUpdated(e),this._isFirstUpdated=!0,V.onProviderUpdated(this.handleProviderUpdates),V.onActiveAccountChanged(this.handleActiveAccountUpdates)}clearState(){}fireCustomEvent(e,t,o=!1,i=!1,n=!1){let s=new CustomEvent(e,{bubbles:o,cancelable:i,composed:n,detail:t});return this.dispatchEvent(s)}updated(e){super.updated(e),this.fireCustomEvent("updated",void 0,!0,!1)}loadState(){return jO(this,void 0,void 0,function*(){return Promise.resolve()})}args(){return[this.providerState]}render(){return this._task.render({pending:this.renderLoading,complete:this.renderContent,error:this.renderError})}};MS([X(),DS("design:type",Number)],Fr.prototype,"providerState",void 0);MS([X(),DS("design:type",String)],Fr.prototype,"direction",void 0)});var as,Q0,FS,mf=y(()=>{l();c();d();as=(r,e)=>Q0(r,e,new Set),Q0=(r,e,t)=>{let o=Object.prototype.toString.call(r),i=Object.prototype.toString.call(e);if(typeof r=="object"&&typeof e=="object"&&o===i&&o==="[object Object]"&&!t.has(r)){t.add(r);for(let n in r)if(!Q0(r[n],e[n],t))return!1;for(let n in e)if(!Object.prototype.hasOwnProperty.call(r,n))return!1;return!0}if(Array.isArray(r)&&Array.isArray(e)&&!t.has(r)){if(t.add(r),r.length!==e.length)return!1;for(let n=0;n{if(r===e)return!0;if(!r||!e||r.length!==e.length)return!1;if(r.length===0)return!0;let t=new Set(r);for(let o of e)if(!t.has(o))return!1;return!0}});var dl,gf=y(()=>{l();c();d();dl=class{static renderTemplate(e,t,o){var i;t.$parentTemplateContext&&(o=Object.assign(Object.assign({},o),{$parent:t.$parentTemplateContext}));let n;if(!((i=t.content)===null||i===void 0)&&i.childNodes.length){let s=t.content.cloneNode(!0);n=this.renderNode(s,e,o)}else if(t.childNodes.length){let s=document.createElement("div");for(let a of t.childNodes)s.appendChild(this.simpleCloneNode(a));n=this.renderNode(s,e,o)}n&&e.appendChild(n)}static setBindingSyntax(e,t){this._startExpression=e,this._endExpression=t;let o=this.escapeRegex(this._startExpression),i=this.escapeRegex(this._endExpression);this._expression=new RegExp(`${o}\\s*([$\\w\\.,'"\\s()\\[\\]]+)\\s*${i}`,"g")}static get globalContext(){return this._globalContext}static get expression(){return this._expression||this.setBindingSyntax("{{","}}"),this._expression}static escapeRegex(e){return e.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&")}static simpleCloneNode(e){if(!e)return null;let t=e.cloneNode(!1);for(let o of e.childNodes){let i=this.simpleCloneNode(o);i&&t.appendChild(i)}return t}static expandExpressionsAsString(e,t){return e.replace(this.expression,(o,i)=>{let n=this.evalInContext(i||this.trimExpression(o),t);return n?typeof n=="object"?JSON.stringify(n):n.toString():""})}static renderNode(e,t,o){if(e.nodeName==="#text")return e.textContent=this.expandExpressionsAsString(e.textContent,o),e;if(e.nodeName==="TEMPLATE")return e.$parentTemplateContext=o,e;let i=e;if(i.attributes)for(let u of i.attributes)if(u.name==="data-props"){let h=this.trimExpression(u.value);for(let p of h.split(",")){let f=p.trim().split(":");if(f.length===2){let b=f[0].trim(),C=this.evalInContext(f[1].trim(),o);b.startsWith("@")?typeof C=="function"&&i.addEventListener(b.substring(1),S=>C(S,o,t)):i[b]=C}}}else i.setAttribute(u.name,this.expandExpressionsAsString(u.value,o));let n=[],s=[],a=!1;for(let u of e.childNodes){let h=u,p=!1;if(h.dataset){let f=!1;if(h.dataset.if){let b=h.dataset.if;this.evalBoolInContext(this.trimExpression(b),o)?(h.removeAttribute("data-if"),a=!0,p=!0):(s.push(h),f=!0)}else typeof h.dataset.else<"u"&&(a?(s.push(h),f=!0):h.removeAttribute("data-else"));h.dataset.for&&!f?n.push(h):f||this.renderNode(u,t,o)}else this.renderNode(u,t,o);!p&&u.nodeName!=="#text"&&(a=!1)}for(let u of s)i.removeChild(u);for(let u of n){let h=u.dataset.for,p=this.trimExpression(h).split(/\s(in|of)\s/i);if(p.length===3){let f=p[0].trim(),b=p[2].trim(),C=this.evalInContext(b,o);if(Array.isArray(C)){u.removeAttribute("data-for");for(let S=0;S{l();c();d();gt();xe();mf();yu();gf();LS=function(r,e,t,o){var i=arguments.length,n=i<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,t):o,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(r,e,t,o);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(n=(i<3?s(n):i>3?s(e,t,n):s(e,t))||n);return i>3&&n&&Object.defineProperty(e,t,n),n},NS=function(r,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(r,e)},vf=class extends kn{constructor(){super(),this.templates={},this._renderedSlots=!1,this._renderedTemplates={},this._slotNamesAddedDuringRender=[],this.templateContext=this.templateContext||{}}update(e){this.templates=this.getTemplates(),this._slotNamesAddedDuringRender=[],super.update(e)}updated(e){super.updated(e),this.removeUnusedSlottedElements()}renderTemplate(e,t,o){if(!this.hasTemplate(e))return null;o=o||e,this._slotNamesAddedDuringRender.push(o),this._renderedSlots=!0;let i=x` +\f\r"'\`<>=]|("|')|))|$)`,"g"),tS=/'/g,rS=/"/g,aS=/^(?:script|style|textarea|title)$/i,lS=r=>(e,...t)=>({_$litType$:r,strings:e,values:t}),x=lS(1),Qj=lS(2),ll=Symbol.for("lit-noChange"),ot=Symbol.for("lit-nothing"),oS=new WeakMap,sl=al.createTreeWalker(al,129);OO=(r,e)=>{let t=r.length-1,o=[],i,n=e===2?"":"",s=pu;for(let a=0;a"?(s=i??pu,f=-1):p[1]===void 0?f=-2:(f=s.lastIndex-p[2].length,h=p[1],s=p[3]===void 0?nl:p[3]==='"'?rS:tS):s===rS||s===tS?s=nl:s===Xk||s===eS?s=pu:(s=nl,i=void 0);let C=s===nl&&r[a+1].startsWith("/>")?" ":"";n+=s===pu?u+PO:f>=0?(o.push(h),u.slice(0,f)+iS+u.slice(f)+Ys+C):u+Ys+(f===-2?a:C)}return[cS(r,n+(r[t]||"")+(e===2?"":"")),o]},gu=class r{constructor({strings:e,_$litType$:t},o){let i;this.parts=[];let n=0,s=0,a=e.length-1,u=this.parts,[h,p]=OO(e,t);if(this.el=r.createElement(h,o),sl.currentNode=this.el.content,t===2){let f=this.el.content.firstChild;f.replaceWith(...f.childNodes)}for(;(i=sl.nextNode())!==null&&u.length0){i.textContent=sf?sf.emptyScript:"";for(let C=0;C2||o[0]!==""||o[1]!==""?(this._$AH=Array(o.length-1).fill(new String),this.strings=o):this._$AH=ot}_$AI(e,t=this,o,i){let n=this.strings,s=!1;if(n===void 0)e=xc(this,e,t,0),s=!mu(e)||e!==this._$AH&&e!==ll,s&&(this._$AH=e);else{let a=e,u,h;for(e=n[0],u=0;u{let o=t?.renderBefore??e,i=o._$litPart$;if(i===void 0){let n=t?.renderBefore??null;o._$litPart$=i=new vu(e.insertBefore(fu(),n),n,void 0,t??{})}return i._$AI(r),i}});var xn,DO,uS=y(()=>{l();c();d();O0();O0();B0();B0();xn=class extends ns{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){let e=super.createRenderRoot();return this.renderOptions.renderBefore??=e.firstChild,e}update(e){let t=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=dS(t,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return ll}};xn._$litElement$=!0,xn["finalized"]=!0,globalThis.litElementHydrateSupport?.({LitElement:xn});DO=globalThis.litElementPolyfillSupport;DO?.({LitElement:xn});(globalThis.litElementVersions??=[]).push("4.0.4")});var hS=y(()=>{l();c();d();});var xe=y(()=>{l();c();d();S0();Cc();uS();hS()});var pS=y(()=>{l();c();d();});function E(r){return(e,t)=>typeof t=="object"?LO(r,e,t):((o,i,n)=>{let s=i.hasOwnProperty(n);return i.constructor.createProperty(n,s?{...o,wrapped:!0}:o),s?Object.getOwnPropertyDescriptor(i,n):void 0})(r,e,t)}var FO,LO,z0=y(()=>{l();c();d();S0();FO={attribute:!0,type:String,converter:su,reflect:!1,hasChanged:Kp},LO=(r=FO,e,t)=>{let{kind:o,metadata:i}=t,n=globalThis.litPropertyMetadata.get(i);if(n===void 0&&globalThis.litPropertyMetadata.set(i,n=new Map),n.set(t.name,r),o==="accessor"){let{name:s}=t;return{set(a){let u=e.get.call(this);e.set.call(this,a),this.requestUpdate(s,u,r)},init(a){return a!==void 0&&this.P(s,void 0,r),a}}}if(o==="setter"){let{name:s}=t;return function(a){let u=this[s];e.call(this,a),this.requestUpdate(s,u,r)}}throw Error("Unsupported decorator location: "+o)}});function X(r){return E({...r,state:!0,attribute:!1})}var fS=y(()=>{l();c();d();z0();});var mS=y(()=>{l();c();d();});var Sc=y(()=>{l();c();d();});var gS=y(()=>{l();c();d();Sc();});var vS=y(()=>{l();c();d();Sc();});var yS=y(()=>{l();c();d();Sc();});var bS=y(()=>{l();c();d();Sc();});var wS=y(()=>{l();c();d();Sc();});var gt=y(()=>{l();c();d();pS();z0();fS();mS();gS();vS();yS();bS();wS()});var Er,lf=y(()=>{l();c();d();qd();Er=class{static get strings(){return this._strings}static set strings(e){this._strings=e,this._stringsEventDispatcher.fire(null)}static getDocumentDirection(){var e,t;switch(((e=document.body)===null||e===void 0?void 0:e.getAttribute("dir"))||((t=document.documentElement)===null||t===void 0?void 0:t.getAttribute("dir"))){case"rtl":return"rtl";case"auto":return"auto";case"ltr":default:return"ltr"}}static onStringsUpdated(e){this._stringsEventDispatcher.add(e)}static removeOnStringsUpdated(e){this._stringsEventDispatcher.remove(e)}static onDirectionUpdated(e){this._directionEventDispatcher.add(e),this.initDirection()}static removeOnDirectionUpdated(e){this._directionEventDispatcher.remove(e)}static initDirection(){if(this._isDirectionInit)return;this._isDirectionInit=!0,this.mutationObserver=new MutationObserver(t=>{t.forEach(o=>{o.attributeName==="dir"&&this._directionEventDispatcher.fire(null)})});let e={attributes:!0,attributeFilter:["dir"]};this.mutationObserver.observe(document.body,e),this.mutationObserver.observe(document.documentElement,e)}static updateStringsForTag(e,t){var o;if(e=e.toLowerCase(),e.startsWith("mgt-")&&(e=e.substring(4)),this._strings&&t){for(let i of Object.entries(t)){let n=this._strings[i[0]];typeof n=="string"&&(t[i[0]]=n)}if(!((o=this._strings._components)===null||o===void 0)&&o[e]){let i=this._strings._components[e];for(let n of Object.keys(i))t[n]&&(t[n]=i[n])}}return t}};Er._stringsEventDispatcher=new Gi;Er._directionEventDispatcher=new Gi;Er._isDirectionInit=!1});var xS,kS,CS,ss,kn,yu=y(()=>{l();c();d();xe();gt();bn();es();lf();ou();xS=function(r,e,t,o){var i=arguments.length,n=i<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,t):o,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(r,e,t,o);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(n=(i<3?s(n):i>3?s(e,t,n):s(e,t))||n);return i>3&&n&&Object.defineProperty(e,t,n),n},kS=function(r,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(r,e)},CS=function(r,e,t,o){function i(n){return n instanceof t?n:new t(function(s){s(n)})}return new(t||(t=Promise))(function(n,s){function a(p){try{h(o.next(p))}catch(f){s(f)}}function u(p){try{h(o.throw(p))}catch(f){s(f)}}function h(p){p.done?n(p.value):i(p.value).then(a,u)}h((o=o.apply(r,e||[])).next())})};(function(r){r.mobile="",r.tablet="tablet",r.desktop="desktop"})(ss||(ss={}));kn=class extends xn{static get packageVersion(){return rs}get mediaQuery(){return this.offsetWidth<768?ss.mobile:this.offsetWidth<1200?ss.tablet:ss.desktop}get isLoadingState(){return this._isLoadingState}get isFirstUpdated(){return this._isFirstUpdated}get strings(){return{}}constructor(){super(),this.providerState=oe.Loading,this.direction="ltr",this._isLoadingState=!1,this._isFirstUpdated=!1,this.setLoadingState=e=>{this._isLoadingState!==e&&(this._isLoadingState=e,this.requestUpdate("isLoadingState"))},this.handleProviderUpdates=()=>{var e,t;this.providerState=(t=(e=V.globalProvider)===null||e===void 0?void 0:e.state)!==null&&t!==void 0?t:oe.Loading,this.requestStateUpdate()},this.handleActiveAccountUpdates=()=>{this.clearState(),this.requestStateUpdate()},this.handleLocalizationChanged=()=>{Er.updateStringsForTag(this.tagName,this.strings),this.requestUpdate()},this.handleDirectionChanged=()=>{this.direction=Er.getDocumentDirection()},this.handleDirectionChanged(),this.handleLocalizationChanged()}connectedCallback(){super.connectedCallback(),Er.onStringsUpdated(this.handleLocalizationChanged),Er.onDirectionUpdated(this.handleDirectionChanged)}disconnectedCallback(){super.disconnectedCallback(),Er.removeOnStringsUpdated(this.handleLocalizationChanged),Er.removeOnDirectionUpdated(this.handleDirectionChanged),V.removeProviderUpdatedListener(this.handleProviderUpdates),V.removeActiveAccountChangedListener(this.handleActiveAccountUpdates)}firstUpdated(e){super.firstUpdated(e),this._isFirstUpdated=!0,V.onProviderUpdated(this.handleProviderUpdates),V.onActiveAccountChanged(this.handleActiveAccountUpdates),this.requestStateUpdate()}loadState(){return Promise.resolve()}clearState(){}fireCustomEvent(e,t,o=!1,i=!1,n=!1){let s=new CustomEvent(e,{bubbles:o,cancelable:i,composed:n,detail:t});return this.dispatchEvent(s)}updated(e){super.updated(e);let t=new CustomEvent("updated",{bubbles:!0,cancelable:!0});this.dispatchEvent(t)}requestStateUpdate(e=!1){return CS(this,void 0,void 0,function*(){if(!this._isFirstUpdated)return;this.isLoadingState&&!e&&(yield this._currentLoadStatePromise);let t=V.globalProvider;if(!t)return Promise.resolve();if(t.state===oe.SignedOut){this.clearState();return}else{if(t.state===oe.Loading)return Promise.resolve();{let o=new Promise((i,n)=>CS(this,void 0,void 0,function*(){try{this.setLoadingState(!0),this.fireCustomEvent("loadingInitiated"),yield this.loadState(),this.setLoadingState(!1),this.fireCustomEvent("loadingCompleted"),i()}catch(s){this.clearState(),this.setLoadingState(!1),this.fireCustomEvent("loadingFailed"),n(s)}return this._currentLoadStatePromise=this.isLoadingState&&this._currentLoadStatePromise&&e?this._currentLoadStatePromise.then(()=>o):o}))}}})}};xS([X(),kS("design:type",Number)],kn.prototype,"providerState",void 0);xS([X(),kS("design:type",String)],kn.prototype,"direction",void 0)});var V0,q0,_c,SS=y(()=>{l();c();d();gt();yu();V0=function(r,e,t,o){var i=arguments.length,n=i<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,t):o,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(r,e,t,o);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(n=(i<3?s(n):i>3?s(e,t,n):s(e,t))||n);return i>3&&n&&Object.defineProperty(e,t,n),n},q0=function(r,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(r,e)},_c=class extends kn{constructor(){super(...arguments),this.stateChangedHandler=()=>{this.fireCustomEvent("onStateChanged",this.provider.state)}}get provider(){return this._provider}set provider(e){this._provider&&this.provider.removeStateChangedHandler(()=>this.stateChangedHandler),this._provider=e,this._provider&&this.provider.onStateChanged(()=>this.stateChangedHandler)}get isAvailable(){return!0}firstUpdated(e){super.firstUpdated(e);let t=!1;if(this.dependsOn){let o=this.dependsOn;for(;o;){if(o.isAvailable){t=!0;break}o=o.dependsOn}}!t&&this.isAvailable&&this.initializeProvider()}initializeProvider(){}};V0([E({attribute:"depends-on",converter:r=>document.querySelector(r),type:String}),q0("design:type",_c)],_c.prototype,"dependsOn",void 0);V0([E({attribute:"base-url",type:String}),q0("design:type",String)],_c.prototype,"baseUrl",void 0);V0([E({attribute:"custom-hosts",type:String,converter:r=>r.split(",").map(e=>e.trim())}),q0("design:type",Array)],_c.prototype,"customHosts",void 0)});var cf,uf,TS,_S,df,ES,G0,hf,j0=y(()=>{l();c();d();cf=globalThis,uf=cf.ShadowRoot&&(cf.ShadyCSS===void 0||cf.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,TS=Symbol(),_S=new WeakMap,df=class{constructor(e,t,o){if(this._$cssResult$=!0,o!==TS)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=t}get styleSheet(){let e=this.o,t=this.t;if(uf&&e===void 0){let o=t!==void 0&&t.length===1;o&&(e=_S.get(t)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),o&&_S.set(t,e))}return e}toString(){return this.cssText}},ES=r=>new df(typeof r=="string"?r:r+"",void 0,TS),G0=(r,e)=>{if(uf)r.adoptedStyleSheets=e.map(t=>t instanceof CSSStyleSheet?t:t.styleSheet);else for(let t of e){let o=document.createElement("style"),i=cf.litNonce;i!==void 0&&o.setAttribute("nonce",i),o.textContent=t.cssText,r.appendChild(o)}},hf=uf?r=>r:r=>r instanceof CSSStyleSheet?(e=>{let t="";for(let o of e.cssRules)t+=o.cssText;return ES(t)})(r):r});var NO,HO,UO,BO,zO,VO,pf,IS,qO,GO,bu,K0,ff,AS,cl,RS=y(()=>{l();c();d();j0();j0();({is:NO,defineProperty:HO,getOwnPropertyDescriptor:UO,getOwnPropertyNames:BO,getOwnPropertySymbols:zO,getPrototypeOf:VO}=Object),pf=globalThis,IS=pf.trustedTypes,qO=IS?IS.emptyScript:"",GO=pf.reactiveElementPolyfillSupport,bu=(r,e)=>r,K0={toAttribute(r,e){switch(e){case Boolean:r=r?qO:null;break;case Object:case Array:r=r==null?r:JSON.stringify(r)}return r},fromAttribute(r,e){let t=r;switch(e){case Boolean:t=r!==null;break;case Number:t=r===null?null:Number(r);break;case Object:case Array:try{t=JSON.parse(r)}catch{t=null}}return t}},ff=(r,e)=>!NO(r,e),AS={attribute:!0,type:String,converter:K0,reflect:!1,hasChanged:ff};Symbol.metadata??=Symbol("metadata"),pf.litPropertyMetadata??=new WeakMap;cl=class extends HTMLElement{static addInitializer(e){this._$Ei(),(this.l??=[]).push(e)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(e,t=AS){if(t.state&&(t.attribute=!1),this._$Ei(),this.elementProperties.set(e,t),!t.noAccessor){let o=Symbol(),i=this.getPropertyDescriptor(e,o,t);i!==void 0&&HO(this.prototype,e,i)}}static getPropertyDescriptor(e,t,o){let{get:i,set:n}=UO(this.prototype,e)??{get(){return this[t]},set(s){this[t]=s}};return{get(){return i?.call(this)},set(s){let a=i?.call(this);n.call(this,s),this.requestUpdate(e,a,o)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??AS}static _$Ei(){if(this.hasOwnProperty(bu("elementProperties")))return;let e=VO(this);e.finalize(),e.l!==void 0&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(bu("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(bu("properties"))){let t=this.properties,o=[...BO(t),...zO(t)];for(let i of o)this.createProperty(i,t[i])}let e=this[Symbol.metadata];if(e!==null){let t=litPropertyMetadata.get(e);if(t!==void 0)for(let[o,i]of t)this.elementProperties.set(o,i)}this._$Eh=new Map;for(let[t,o]of this.elementProperties){let i=this._$Eu(t,o);i!==void 0&&this._$Eh.set(i,t)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){let t=[];if(Array.isArray(e)){let o=new Set(e.flat(1/0).reverse());for(let i of o)t.unshift(hf(i))}else e!==void 0&&t.push(hf(e));return t}static _$Eu(e,t){let o=t.attribute;return o===!1?void 0:typeof o=="string"?o:typeof e=="string"?e.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$Eg=new Promise(e=>this.enableUpdating=e),this._$AL=new Map,this._$ES(),this.requestUpdate(),this.constructor.l?.forEach(e=>e(this))}addController(e){(this._$E_??=new Set).add(e),this.renderRoot!==void 0&&this.isConnected&&e.hostConnected?.()}removeController(e){this._$E_?.delete(e)}_$ES(){let e=new Map,t=this.constructor.elementProperties;for(let o of t.keys())this.hasOwnProperty(o)&&(e.set(o,this[o]),delete this[o]);e.size>0&&(this._$Ep=e)}createRenderRoot(){let e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return G0(e,this.constructor.elementStyles),e}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$E_?.forEach(e=>e.hostConnected?.())}enableUpdating(e){}disconnectedCallback(){this._$E_?.forEach(e=>e.hostDisconnected?.())}attributeChangedCallback(e,t,o){this._$AK(e,o)}_$EO(e,t){let o=this.constructor.elementProperties.get(e),i=this.constructor._$Eu(e,o);if(i!==void 0&&o.reflect===!0){let n=(o.converter?.toAttribute!==void 0?o.converter:K0).toAttribute(t,o.type);this._$Em=e,n==null?this.removeAttribute(i):this.setAttribute(i,n),this._$Em=null}}_$AK(e,t){let o=this.constructor,i=o._$Eh.get(e);if(i!==void 0&&this._$Em!==i){let n=o.getPropertyOptions(i),s=typeof n.converter=="function"?{fromAttribute:n.converter}:n.converter?.fromAttribute!==void 0?n.converter:K0;this._$Em=i,this[i]=s.fromAttribute(t,n.type),this._$Em=null}}requestUpdate(e,t,o){if(e!==void 0){if(o??=this.constructor.getPropertyOptions(e),!(o.hasChanged??ff)(this[e],t))return;this.C(e,t,o)}this.isUpdatePending===!1&&(this._$Eg=this._$EP())}C(e,t,o){this._$AL.has(e)||this._$AL.set(e,t),o.reflect===!0&&this._$Em!==e&&(this._$ET??=new Set).add(e)}async _$EP(){this.isUpdatePending=!0;try{await this._$Eg}catch(t){Promise.reject(t)}let e=this.scheduleUpdate();return e!=null&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(let[i,n]of this._$Ep)this[i]=n;this._$Ep=void 0}let o=this.constructor.elementProperties;if(o.size>0)for(let[i,n]of o)n.wrapped!==!0||this._$AL.has(i)||this[i]===void 0||this.C(i,this[i],n)}let e=!1,t=this._$AL;try{e=this.shouldUpdate(t),e?(this.willUpdate(t),this._$E_?.forEach(o=>o.hostUpdate?.()),this.update(t)):this._$Ej()}catch(o){throw e=!1,this._$Ej(),o}e&&this._$AE(t)}willUpdate(e){}_$AE(e){this._$E_?.forEach(t=>t.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$Ej(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$Eg}shouldUpdate(e){return!0}update(e){this._$ET&&=this._$ET.forEach(t=>this._$EO(t,this[t])),this._$Ej()}updated(e){}firstUpdated(e){}};cl.elementStyles=[],cl.shadowRootOptions={mode:"open"},cl[bu("elementProperties")]=new Map,cl[bu("finalized")]=new Map,GO?.({ReactiveElement:cl}),(pf.reactiveElementVersions??=[]).push("2.0.3")});var Zs,PS,wu,$S,OS=y(()=>{l();c();d();RS();Zs={INITIAL:0,PENDING:1,COMPLETE:2,ERROR:3},PS=Symbol(),wu=class{get taskComplete(){return this.t||(this.status===1?this.t=new Promise((e,t)=>{this.i=e,this.o=t}):this.status===3?this.t=Promise.reject(this.h):this.t=Promise.resolve(this.l)),this.t}constructor(e,t,o){this.u=0,this.status=0,(this.p=e).addController(this);let i=typeof t=="object"?t:{task:t,args:o};this._=i.task,this.v=i.args,this.j=i.argsEqual??$S,this.m=i.onComplete,this.g=i.onError,this.autoRun=i.autoRun??!0,"initialValue"in i&&(this.l=i.initialValue,this.status=2,this.k=this.A?.())}hostUpdate(){this.autoRun===!0&&this.O()}hostUpdated(){this.autoRun==="afterUpdate"&&this.O()}A(){if(this.v===void 0)return;let e=this.v();if(!Array.isArray(e))throw Error("The args function must return an array");return e}async O(){let e=this.A(),t=this.k;this.k=e,e===t||e===void 0||t!==void 0&&this.j(t,e)||await this.run(e)}async run(e){let t,o;e??=this.A(),this.k=e,this.status===1?this.T?.abort():(this.t=void 0,this.i=void 0,this.o=void 0),this.status=1,this.autoRun==="afterUpdate"?queueMicrotask(()=>this.p.requestUpdate()):this.p.requestUpdate();let i=++this.u;this.T=new AbortController;let n=!1;try{t=await this._(e,{signal:this.T.signal})}catch(s){n=!0,o=s}if(this.u===i){if(t===PS)this.status=0;else{if(n===!1){try{this.m?.(t)}catch{}this.status=2,this.i?.(t)}else{try{this.g?.(o)}catch{}this.status=3,this.o?.(o)}this.l=t,this.h=o}this.p.requestUpdate()}}abort(e){this.status===1&&this.T?.abort(e)}get value(){return this.l}get error(){return this.h}render(e){switch(this.status){case 0:return e.initial?.();case 1:return e.pending?.();case 2:return e.complete?.(this.value);case 3:return e.error?.(this.error);default:throw Error("Unexpected status: "+this.status)}}},$S=(r,e)=>r===e||r.length===e.length&&r.every((t,o)=>!ff(t,e[o]))});var Cu=y(()=>{l();c();d();OS()});var MS,DS,jO,Fr,W0=y(()=>{l();c();d();Cu();xe();gt();bn();es();lf();ou();yu();MS=function(r,e,t,o){var i=arguments.length,n=i<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,t):o,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(r,e,t,o);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(n=(i<3?s(n):i>3?s(e,t,n):s(e,t))||n);return i>3&&n&&Object.defineProperty(e,t,n),n},DS=function(r,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(r,e)},jO=function(r,e,t,o){function i(n){return n instanceof t?n:new t(function(s){s(n)})}return new(t||(t=Promise))(function(n,s){function a(p){try{h(o.next(p))}catch(f){s(f)}}function u(p){try{h(o.throw(p))}catch(f){s(f)}}function h(p){p.done?n(p.value):i(p.value).then(a,u)}h((o=o.apply(r,e||[])).next())})},Fr=class extends xn{static get packageVersion(){return rs}get mediaQuery(){return this.offsetWidth<768?ss.mobile:this.offsetWidth<1200?ss.tablet:ss.desktop}get isFirstUpdated(){return this._isFirstUpdated}get strings(){return{}}constructor(){super(),this.providerState=oe.Loading,this.direction="ltr",this._isFirstUpdated=!1,this._task=new wu(this,{task:()=>this.loadState(),args:()=>this.args()}),this.renderLoading=()=>x`Loading...`,this.renderError=e=>x`

Error: ${e}

`,this.renderContent=()=>x``,this.handleProviderUpdates=()=>{var e,t;this.providerState=(t=(e=V.globalProvider)===null||e===void 0?void 0:e.state)!==null&&t!==void 0?t:oe.Loading},this.handleActiveAccountUpdates=()=>{this.clearState()},this.handleLocalizationChanged=()=>{Er.updateStringsForTag(this.tagName,this.strings),this.requestUpdate()},this.handleDirectionChanged=()=>{this.direction=Er.getDocumentDirection()},this.handleDirectionChanged(),this.handleLocalizationChanged()}connectedCallback(){super.connectedCallback(),Er.onStringsUpdated(this.handleLocalizationChanged),Er.onDirectionUpdated(this.handleDirectionChanged)}disconnectedCallback(){super.disconnectedCallback(),Er.removeOnStringsUpdated(this.handleLocalizationChanged),Er.removeOnDirectionUpdated(this.handleDirectionChanged),V.removeProviderUpdatedListener(this.handleProviderUpdates),V.removeActiveAccountChangedListener(this.handleActiveAccountUpdates)}firstUpdated(e){super.firstUpdated(e),this._isFirstUpdated=!0,V.onProviderUpdated(this.handleProviderUpdates),V.onActiveAccountChanged(this.handleActiveAccountUpdates)}clearState(){}fireCustomEvent(e,t,o=!1,i=!1,n=!1){let s=new CustomEvent(e,{bubbles:o,cancelable:i,composed:n,detail:t});return this.dispatchEvent(s)}updated(e){super.updated(e),this.fireCustomEvent("updated",void 0,!0,!1)}loadState(){return jO(this,void 0,void 0,function*(){return Promise.resolve()})}args(){return[this.providerState]}render(){return this._task.render({pending:this.renderLoading,complete:this.renderContent,error:this.renderError})}};MS([X(),DS("design:type",Number)],Fr.prototype,"providerState",void 0);MS([X(),DS("design:type",String)],Fr.prototype,"direction",void 0)});var as,Q0,FS,mf=y(()=>{l();c();d();as=(r,e)=>Q0(r,e,new Set),Q0=(r,e,t)=>{let o=Object.prototype.toString.call(r),i=Object.prototype.toString.call(e);if(typeof r=="object"&&typeof e=="object"&&o===i&&o==="[object Object]"&&!t.has(r)){t.add(r);for(let n in r)if(!Q0(r[n],e[n],t))return!1;for(let n in e)if(!Object.prototype.hasOwnProperty.call(r,n))return!1;return!0}if(Array.isArray(r)&&Array.isArray(e)&&!t.has(r)){if(t.add(r),r.length!==e.length)return!1;for(let n=0;n{if(r===e)return!0;if(!r||!e||r.length!==e.length)return!1;if(r.length===0)return!0;let t=new Set(r);for(let o of e)if(!t.has(o))return!1;return!0}});var dl,gf=y(()=>{l();c();d();dl=class{static renderTemplate(e,t,o){var i;t.$parentTemplateContext&&(o=Object.assign(Object.assign({},o),{$parent:t.$parentTemplateContext}));let n;if(!((i=t.content)===null||i===void 0)&&i.childNodes.length){let s=t.content.cloneNode(!0);n=this.renderNode(s,e,o)}else if(t.childNodes.length){let s=document.createElement("div");for(let a of t.childNodes)s.appendChild(this.simpleCloneNode(a));n=this.renderNode(s,e,o)}n&&e.appendChild(n)}static setBindingSyntax(e,t){this._startExpression=e,this._endExpression=t;let o=this.escapeRegex(this._startExpression),i=this.escapeRegex(this._endExpression);this._expression=new RegExp(`${o}\\s*([$\\w\\.,'"\\s()\\[\\]]+)\\s*${i}`,"g")}static get globalContext(){return this._globalContext}static get expression(){return this._expression||this.setBindingSyntax("{{","}}"),this._expression}static escapeRegex(e){return e.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&")}static simpleCloneNode(e){if(!e)return null;let t=e.cloneNode(!1);for(let o of e.childNodes){let i=this.simpleCloneNode(o);i&&t.appendChild(i)}return t}static expandExpressionsAsString(e,t){return e.replace(this.expression,(o,i)=>{let n=this.evalInContext(i||this.trimExpression(o),t);return n?typeof n=="object"?JSON.stringify(n):n.toString():""})}static renderNode(e,t,o){if(e.nodeName==="#text")return e.textContent=this.expandExpressionsAsString(e.textContent,o),e;if(e.nodeName==="TEMPLATE")return e.$parentTemplateContext=o,e;let i=e;if(i.attributes)for(let u of i.attributes)if(u.name==="data-props"){let h=this.trimExpression(u.value);for(let p of h.split(",")){let f=p.trim().split(":");if(f.length===2){let b=f[0].trim(),C=this.evalInContext(f[1].trim(),o);b.startsWith("@")?typeof C=="function"&&i.addEventListener(b.substring(1),S=>C(S,o,t)):i[b]=C}}}else i.setAttribute(u.name,this.expandExpressionsAsString(u.value,o));let n=[],s=[],a=!1;for(let u of e.childNodes){let h=u,p=!1;if(h.dataset){let f=!1;if(h.dataset.if){let b=h.dataset.if;this.evalBoolInContext(this.trimExpression(b),o)?(h.removeAttribute("data-if"),a=!0,p=!0):(s.push(h),f=!0)}else typeof h.dataset.else<"u"&&(a?(s.push(h),f=!0):h.removeAttribute("data-else"));h.dataset.for&&!f?n.push(h):f||this.renderNode(u,t,o)}else this.renderNode(u,t,o);!p&&u.nodeName!=="#text"&&(a=!1)}for(let u of s)i.removeChild(u);for(let u of n){let h=u.dataset.for,p=this.trimExpression(h).split(/\s(in|of)\s/i);if(p.length===3){let f=p[0].trim(),b=p[2].trim(),C=this.evalInContext(b,o);if(Array.isArray(C)){u.removeAttribute("data-for");for(let S=0;S{l();c();d();gt();xe();mf();yu();gf();LS=function(r,e,t,o){var i=arguments.length,n=i<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,t):o,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(r,e,t,o);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(n=(i<3?s(n):i>3?s(e,t,n):s(e,t))||n);return i>3&&n&&Object.defineProperty(e,t,n),n},NS=function(r,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(r,e)},vf=class extends kn{constructor(){super(),this.templates={},this._renderedSlots=!1,this._renderedTemplates={},this._slotNamesAddedDuringRender=[],this.templateContext=this.templateContext||{}}update(e){this.templates=this.getTemplates(),this._slotNamesAddedDuringRender=[],super.update(e)}updated(e){super.updated(e),this.removeUnusedSlottedElements()}renderTemplate(e,t,o){if(!this.hasTemplate(e))return null;o=o||e,this._slotNamesAddedDuringRender.push(o),this._renderedSlots=!0;let i=x` `,n=Object.assign(Object.assign({},t),this.templateContext);if(Object.prototype.hasOwnProperty.call(this._renderedTemplates,o)){let{context:u,slot:h}=this._renderedTemplates[o];if(as(u,n))return i;this.removeChild(h)}let s=document.createElement("div");s.slot=o,s.dataset.generated="template",dl.renderTemplate(s,this.templates[e],n),this.appendChild(s),this._renderedTemplates[o]={context:n,slot:s};let a={templateType:e,context:n,element:s};return this.fireCustomEvent("templateRendered",a),i}hasTemplate(e){var t;return!!(!((t=this.templates)===null||t===void 0)&&t[e])}getTemplates(){let e={};for(let t=0;t @@ -18,7 +18,7 @@ try{ `,this.templateContext=this.templateContext||{}}update(e){this.templates=this.getTemplates(),this._slotNamesAddedDuringRender=[],super.update(e)}updated(e){super.updated(e),this.removeUnusedSlottedElements()}renderTemplate(e,t,o){if(!this.hasTemplate(e))return null;o=o||e,this._slotNamesAddedDuringRender.push(o),this._renderedSlots=!0;let i=x` - `,n=Object.assign(Object.assign({},t),this.templateContext);if(Object.prototype.hasOwnProperty.call(this._renderedTemplates,o)){let{context:u,slot:h}=this._renderedTemplates[o];if(as(u,n))return i;this.removeChild(h)}let s=document.createElement("div");s.slot=o,s.dataset.generated="template",dl.renderTemplate(s,this.templates[e],n),this.appendChild(s),this._renderedTemplates[o]={context:n,slot:s};let a={templateType:e,context:n,element:s};return this.fireCustomEvent("templateRendered",a),i}hasTemplate(e){var t;return!!(!((t=this.templates)===null||t===void 0)&&t[e])}getTemplates(){let e={};for(let t=0;t{l();c();d();iu();bn()});var qS=y(()=>{l();c();d()});var GS=y(()=>{l();c();d()});function KO(){return jS||(jS=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])}function WO(){return KS||(KS=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])}function QO(r){let e=new Promise((t,o)=>{let i=()=>{r.removeEventListener("success",n),r.removeEventListener("error",s)},n=()=>{t(ul(r.result)),i()},s=()=>{o(r.error),i()};r.addEventListener("success",n),r.addEventListener("error",s)});return yf.set(e,r),e}function YO(r){if(X0.has(r))return;let e=new Promise((t,o)=>{let i=()=>{r.removeEventListener("complete",n),r.removeEventListener("error",s),r.removeEventListener("abort",s)},n=()=>{t(),i()},s=()=>{o(r.error||new DOMException("AbortError","AbortError")),i()};r.addEventListener("complete",n),r.addEventListener("error",s),r.addEventListener("abort",s)});X0.set(r,e)}function ZS(r){ey=r(ey)}function ZO(r){return WO().includes(r)?function(...e){return r.apply(ty(this),e),ul(this.request)}:function(...e){return ul(r.apply(ty(this),e))}}function JO(r){return typeof r=="function"?ZO(r):(r instanceof IDBTransaction&&YO(r),J0(r,KO())?new Proxy(r,ey):r)}function ul(r){if(r instanceof IDBRequest)return QO(r);if(Y0.has(r))return Y0.get(r);let e=JO(r);return e!==r&&(Y0.set(r,e),yf.set(e,r)),e}function JS(r,e,{blocked:t,upgrade:o,blocking:i,terminated:n}={}){let s=indexedDB.open(r,e),a=ul(s);return o&&s.addEventListener("upgradeneeded",u=>{o(ul(s.result),u.oldVersion,u.newVersion,ul(s.transaction),u)}),t&&s.addEventListener("blocked",u=>t(u.oldVersion,u.newVersion,u)),a.then(u=>{n&&u.addEventListener("close",()=>n()),i&&u.addEventListener("versionchange",h=>i(h.oldVersion,h.newVersion,h))}).catch(()=>{}),a}function WS(r,e){if(!(r instanceof IDBDatabase&&!(e in r)&&typeof e=="string"))return;if(Z0.get(e))return Z0.get(e);let t=e.replace(/FromIndex$/,""),o=e!==t,i=e9.includes(t);if(!(t in(o?IDBIndex:IDBObjectStore).prototype)||!(i||XO.includes(t)))return;let n=async function(s,...a){let u=this.transaction(s,i?"readwrite":"readonly"),h=u.store;return o&&(h=h.index(a.shift())),(await Promise.all([h[t](...a),i&&u.done]))[0]};return Z0.set(e,n),n}async function*o9(...r){let e=this;if(e instanceof IDBCursor||(e=await e.openCursor(...r)),!e)return;e=e;let t=new Proxy(e,r9);for(XS.set(t,e),yf.set(t,ty(e));e;)yield t,e=await(ry.get(t)||e.continue()),ry.delete(t)}function YS(r,e){return e===Symbol.asyncIterator&&J0(r,[IDBIndex,IDBObjectStore,IDBCursor])||e==="iterate"&&J0(r,[IDBIndex,IDBObjectStore])}var J0,jS,KS,X0,Y0,yf,ey,ty,XO,e9,Z0,t9,QS,ry,XS,r9,e_=y(()=>{l();c();d();J0=(r,e)=>e.some(t=>r instanceof t);X0=new WeakMap,Y0=new WeakMap,yf=new WeakMap;ey={get(r,e,t){if(r instanceof IDBTransaction){if(e==="done")return X0.get(r);if(e==="store")return t.objectStoreNames[1]?void 0:t.objectStore(t.objectStoreNames[0])}return ul(r[e])},set(r,e,t){return r[e]=t,!0},has(r,e){return r instanceof IDBTransaction&&(e==="done"||e==="store")?!0:e in r}};ty=r=>yf.get(r);XO=["get","getKey","getAll","getAllKeys","count"],e9=["put","add","delete","clear"],Z0=new Map;ZS(r=>({...r,get:(e,t,o)=>WS(e,t)||r.get(e,t,o),has:(e,t)=>!!WS(e,t)||r.has(e,t)}));t9=["continue","continuePrimaryKey","advance"],QS={},ry=new WeakMap,XS=new WeakMap,r9={get(r,e){if(!t9.includes(e))return r[e];let t=QS[e];return t||(t=QS[e]=function(...o){ry.set(this,XS.get(this)[e](...o))}),t}};ZS(r=>({...r,get(e,t,o){return YS(e,t)?o9:r.get(e,t,o)},has(e,t){return YS(e,t)||r.has(e,t)}}))});var hl,bf=y(()=>{l();c();d();hl="mgt-db-list"});var xu,wf,oy=y(()=>{l();c();d();e_();es();bf();xu=function(r,e,t,o){function i(n){return n instanceof t?n:new t(function(s){s(n)})}return new(t||(t=Promise))(function(n,s){function a(p){try{h(o.next(p))}catch(f){s(f)}}function u(p){try{h(o.throw(p))}catch(f){s(f)}}function h(p){p.done?n(p.value):i(p.value).then(a,u)}h((o=o.apply(r,e||[])).next())})},wf=class{constructor(e,t){if(!(t in e.stores))throw Error('"store" must be defined in the "schema"');this.schema=e,this.store=t}getValue(e){return xu(this,void 0,void 0,function*(){if(!window.indexedDB)return null;try{return(yield this.getDb()).get(this.store,e)}catch{return null}})}putValue(e,t){return xu(this,void 0,void 0,function*(){if(window.indexedDB)try{yield(yield this.getDb()).put(this.store,Object.assign(Object.assign({},t),{timeCached:Date.now()}),e)}catch{return}})}clearStore(){return xu(this,void 0,void 0,function*(){if(window.indexedDB)try{yield(yield this.getDb()).clear(this.store)}catch{return}})}getDBName(){return xu(this,void 0,void 0,function*(){let e=yield V.getCacheId();if(e)return`mgt-${this.schema.name}-${e}`})}getDb(){return xu(this,void 0,void 0,function*(){let e=yield this.getDBName();if(e)return JS(e,this.schema.version,{upgrade:(t,o,i,n)=>{let s=JSON.parse(localStorage.getItem(hl))||[];s.includes(e)||s.push(e),localStorage.setItem(hl,JSON.stringify(s));for(let a in this.schema.stores)Object.prototype.hasOwnProperty.call(this.schema.stores,a)&&!t.objectStoreNames.contains(a)&&t.createObjectStore(a)}})})}}});var i9,W,t_=y(()=>{l();c();d();es();bn();oy();bf();i9=function(r,e,t,o){function i(n){return n instanceof t?n:new t(function(s){s(n)})}return new(t||(t=Promise))(function(n,s){function a(p){try{h(o.next(p))}catch(f){s(f)}}function u(p){try{h(o.throw(p))}catch(f){s(f)}}function h(p){p.done?n(p.value):i(p.value).then(a,u)}h((o=o.apply(r,e||[])).next())})},W=class{static getCache(e,t){let o=`${e.name}/${t}`;return this.isInitialized||this.init(),this.cacheStore.has(t)||this.cacheStore.set(o,new wf(e,t)),this.cacheStore.get(o)}static clearCacheById(e){let t=[],o=JSON.parse(localStorage.getItem(hl));if(o){let i=[];o.forEach(n=>{n.includes(e)?t.push(new Promise((s,a)=>{let u=indexedDB.deleteDatabase(n);u.onsuccess=()=>s(),u.onerror=()=>{console.error(`\u{1F992}: ${u.error.name} occurred deleting cache: ${n}`,u.error.message),a()}})):i.push(n)}),i.length>0?localStorage.setItem(hl,JSON.stringify(i)):localStorage.removeItem(hl)}return Promise.all(t)}static get config(){return this.cacheConfig}static init(){let e;V.globalProvider&&(e=V.globalProvider.state),V.onProviderUpdated(()=>i9(this,void 0,void 0,function*(){if(e===ie.SignedIn&&V.globalProvider.state===ie.SignedOut){let t=yield V.getCacheId();t!==null&&(yield this.clearCacheById(t))}e=V.globalProvider.state})),this.isInitialized=!0}};W.cacheStore=new Map;W.isInitialized=!1;W.cacheConfig={defaultInvalidationPeriod:36e5,groups:{invalidationPeriod:null,isEnabled:!0},isEnabled:!0,people:{invalidationPeriod:null,isEnabled:!0},photos:{invalidationPeriod:null,isEnabled:!0},presence:{invalidationPeriod:3e5,isEnabled:!0},users:{invalidationPeriod:null,isEnabled:!0},response:{invalidationPeriod:null,isEnabled:!0},files:{invalidationPeriod:null,isEnabled:!0},fileLists:{invalidationPeriod:null,isEnabled:!0}}});var Sn,r_=y(()=>{l();c();d();Sn=class{static get microsoftTeamsLib(){return this._microsoftTeamsLib||window.microsoftTeams}static set microsoftTeamsLib(e){this._microsoftTeamsLib=e}static get isAvailable(){return this.microsoftTeamsLib?window.parent===window.self&&window.nativeInterface?!0:window.name==="embedded-page-container"||window.name==="extension-tab-frame":!1}static executeDeepLink(e,t){let o=this.microsoftTeamsLib;o.initialize(),o.executeDeepLink(e,t)}}});var o_=y(()=>{l();c();d()});var i_,pl,n_=y(()=>{l();c();d();i_=function(r,e,t,o){function i(n){return n instanceof t?n:new t(function(s){s(n)})}return new(t||(t=Promise))(function(n,s){function a(p){try{h(o.next(p))}catch(f){s(f)}}function u(p){try{h(o.throw(p))}catch(f){s(f)}}function h(p){p.done?n(p.value):i(p.value).then(a,u)}h((o=o.apply(r,e||[])).next())})},pl=class r{get value(){return this._value}get hasNext(){return!!this._nextLink}static create(e,t,o){return i_(this,void 0,void 0,function*(){let i=yield t.get();if(i?.value){let n=new r;return n._graph=e,n._value=i.value,n._nextLink=i["@odata.nextLink"],n._version=o||e.version,n}return null})}static createFromValue(e,t,o=null){let i=new r;return i._graph=e,i._value=t,i._nextLink=o,i._version=e.version,i}get nextLink(){return this._nextLink||""}next(){var e;return i_(this,void 0,void 0,function*(){if(this._nextLink){let t=this._nextLink.split(this._version)[1],o=yield this._graph.api(t).version(this._version).get();if(!((e=o?.value)===null||e===void 0)&&e.length)return this._value=this._value.concat(o.value),this._nextLink=o["@odata.nextLink"],o.value}return null})}}});var s_,a_,n9,Te,l_=y(()=>{l();c();d();xe();bc();s_=new WeakMap,a_=(r,e,t)=>{let o=[];for(let i of r)o.push(i.replace(e,t));return o},n9=(r,...e)=>{if(Jr.isDisambiguated){let t=s_.get(r);if(!t){let o=new RegExp("({l();c();d();gt();bc()});var ku,Re,d_=y(()=>{l();c();d();bc();ku=r=>`${Jr.prefix}-${r}`,Re=(r,e,t)=>{let o=ku(r);customElements.get(o)||customElements.define(o,e,t)}});var u_=y(()=>{l();c();d();bn();es()});var h_=y(()=>{l();c();d()});var Cf,p_,f_=y(()=>{l();c();d();Cf=class{constructor(){this.session=window.sessionStorage}setItem(e,t){this.session.setItem(e,t)}getItem(e){return this.session.getItem(e)}clear(){this.session.clear()}},p_=r=>{let e;try{r==="sessionStorage"?e=window.sessionStorage:e=window.localStorage;let t="__storage_test__";return e.setItem(t,t),e.removeItem(t),!0}catch(t){return t instanceof DOMException&&(t.code===22||t.code===1014||t.name==="QuotaExceededError"||t.name==="NS_ERROR_DOM_QUOTA_REACHED")&&e&&e.length!==0}}});var m_,Su,g_=y(()=>{l();c();d();f_();m_=function(r,e,t,o){function i(n){return n instanceof t?n:new t(function(s){s(n)})}return new(t||(t=Promise))(function(n,s){function a(p){try{h(o.next(p))}catch(f){s(f)}}function u(p){try{h(o.throw(p))}catch(f){s(f)}}function h(p){p.done?n(p.value):i(p.value).then(a,u)}h((o=o.apply(r,e||[])).next())})},Su=class r{static get _sessionCache(){return!this._cache&&p_("sessionStorage")&&(this._cache=new Cf),this._cache}execute(e){return m_(this,void 0,void 0,function*(){try{let t=yield r.getBaseUrl();e.request=t+encodeURIComponent(e.request)}catch{}return yield this._nextMiddleware.execute(e)})}setNext(e){this._nextMiddleware=e}static getBaseUrl(){var e,t;return m_(this,void 0,void 0,function*(){if(!this._baseUrl){let o=(e=this._sessionCache)===null||e===void 0?void 0:e.getItem("endpointURL");if(o)this._baseUrl=o;else{try{let n=yield(yield fetch("https://cdn.graph.office.net/en-us/graph/api/proxy/endpoint")).json();typeof n!="string"?r.setBaseFallbackUrl():this._baseUrl=n+"?url="}catch{r.setBaseFallbackUrl()}(t=this._sessionCache)===null||t===void 0||t.setItem("endpointURL",this._baseUrl)}}return this._baseUrl})}static setBaseFallbackUrl(){this._baseUrl="https://graph.office.net/en-us/graph/api/proxy?url="}}});var s9,xf,v_=y(()=>{l();c();d();Za();iu();Up();g_();s9=function(r,e,t,o){function i(n){return n instanceof t?n:new t(function(s){s(n)})}return new(t||(t=Promise))(function(n,s){function a(p){try{h(o.next(p))}catch(f){s(f)}}function u(p){try{h(o.throw(p))}catch(f){s(f)}}function h(p){p.done?n(p.value):i(p.value).then(a,u)}h((o=o.apply(r,e||[])).next())})},xf=class r extends Ja{static create(e){return s9(this,void 0,void 0,function*(){let t=[new Ki(e),new ii(new Dr),new Ho,new Su,new Cn];return new r(Ya.initWithMiddleware({middleware:Hp(...t),customHosts:new Set([new URL(yield Su.getBaseUrl()).hostname])}))})}forComponent(e){return this}}});var iy,kf,y_=y(()=>{l();c();d();bn();v_();iy=function(r,e,t,o){function i(n){return n instanceof t?n:new t(function(s){s(n)})}return new(t||(t=Promise))(function(n,s){function a(p){try{h(o.next(p))}catch(f){s(f)}}function u(p){try{h(o.throw(p))}catch(f){s(f)}}function h(p){p.done?n(p.value):i(p.value).then(a,u)}h((o=o.apply(r,e||[])).next())})},kf=class extends ja{constructor(e=!1,t=[]){super(),this._accounts=[],this._mockGraphPromise=xf.create(this);let o=!!t.length;this.isMultipleAccountSupported=o,this.isMultipleAccountDisabled=!o,this._accounts=t,this.initializeMockGraph(e)}get isMultiAccountSupportedAndEnabled(){return!this.isMultipleAccountDisabled&&this.isMultipleAccountSupported}getAllAccounts(){return this._accounts}getActiveAccount(){if(this._accounts.length)return this._accounts[0]}login(){return iy(this,void 0,void 0,function*(){this.setState(ie.Loading),yield this._mockGraphPromise,yield new Promise(e=>setTimeout(e,3e3)),this.setState(ie.SignedIn)})}logout(){return iy(this,void 0,void 0,function*(){this.setState(ie.Loading),yield this._mockGraphPromise,yield new Promise(e=>setTimeout(e,3e3)),this.setState(ie.SignedOut)})}getAccessToken(){return Promise.resolve("{token:https://graph.microsoft.com/}")}get name(){return"MgtMockProvider"}initializeMockGraph(e=!1){return iy(this,void 0,void 0,function*(){this.graph=yield this._mockGraphPromise,e?this.setState(ie.SignedIn):this.setState(ie.SignedOut)})}}});var ge=y(()=>{l();c();d();t0();jd();iu();Ik();yu();SS();W0();HS();zS();bc();bn();es();VS();qS();GS();t_();oy();bf();qd();mf();Up();y0();vp();r_();o_();gf();n_();lf();l_();c_();d_();u_();ou();h_();y_()});var Q_,Y_=y(()=>{l();c();d();xe();Q_=[Oe` + `,n=Object.assign(Object.assign({},t),this.templateContext);if(Object.prototype.hasOwnProperty.call(this._renderedTemplates,o)){let{context:u,slot:h}=this._renderedTemplates[o];if(as(u,n))return i;this.removeChild(h)}let s=document.createElement("div");s.slot=o,s.dataset.generated="template",dl.renderTemplate(s,this.templates[e],n),this.appendChild(s),this._renderedTemplates[o]={context:n,slot:s};let a={templateType:e,context:n,element:s};return this.fireCustomEvent("templateRendered",a),i}hasTemplate(e){var t;return!!(!((t=this.templates)===null||t===void 0)&&t[e])}getTemplates(){let e={};for(let t=0;t{l();c();d();iu();bn()});var qS=y(()=>{l();c();d()});var GS=y(()=>{l();c();d()});function KO(){return jS||(jS=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])}function WO(){return KS||(KS=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])}function QO(r){let e=new Promise((t,o)=>{let i=()=>{r.removeEventListener("success",n),r.removeEventListener("error",s)},n=()=>{t(ul(r.result)),i()},s=()=>{o(r.error),i()};r.addEventListener("success",n),r.addEventListener("error",s)});return yf.set(e,r),e}function YO(r){if(X0.has(r))return;let e=new Promise((t,o)=>{let i=()=>{r.removeEventListener("complete",n),r.removeEventListener("error",s),r.removeEventListener("abort",s)},n=()=>{t(),i()},s=()=>{o(r.error||new DOMException("AbortError","AbortError")),i()};r.addEventListener("complete",n),r.addEventListener("error",s),r.addEventListener("abort",s)});X0.set(r,e)}function ZS(r){ey=r(ey)}function ZO(r){return WO().includes(r)?function(...e){return r.apply(ty(this),e),ul(this.request)}:function(...e){return ul(r.apply(ty(this),e))}}function JO(r){return typeof r=="function"?ZO(r):(r instanceof IDBTransaction&&YO(r),J0(r,KO())?new Proxy(r,ey):r)}function ul(r){if(r instanceof IDBRequest)return QO(r);if(Y0.has(r))return Y0.get(r);let e=JO(r);return e!==r&&(Y0.set(r,e),yf.set(e,r)),e}function JS(r,e,{blocked:t,upgrade:o,blocking:i,terminated:n}={}){let s=indexedDB.open(r,e),a=ul(s);return o&&s.addEventListener("upgradeneeded",u=>{o(ul(s.result),u.oldVersion,u.newVersion,ul(s.transaction),u)}),t&&s.addEventListener("blocked",u=>t(u.oldVersion,u.newVersion,u)),a.then(u=>{n&&u.addEventListener("close",()=>n()),i&&u.addEventListener("versionchange",h=>i(h.oldVersion,h.newVersion,h))}).catch(()=>{}),a}function WS(r,e){if(!(r instanceof IDBDatabase&&!(e in r)&&typeof e=="string"))return;if(Z0.get(e))return Z0.get(e);let t=e.replace(/FromIndex$/,""),o=e!==t,i=e9.includes(t);if(!(t in(o?IDBIndex:IDBObjectStore).prototype)||!(i||XO.includes(t)))return;let n=async function(s,...a){let u=this.transaction(s,i?"readwrite":"readonly"),h=u.store;return o&&(h=h.index(a.shift())),(await Promise.all([h[t](...a),i&&u.done]))[0]};return Z0.set(e,n),n}async function*o9(...r){let e=this;if(e instanceof IDBCursor||(e=await e.openCursor(...r)),!e)return;e=e;let t=new Proxy(e,r9);for(XS.set(t,e),yf.set(t,ty(e));e;)yield t,e=await(ry.get(t)||e.continue()),ry.delete(t)}function YS(r,e){return e===Symbol.asyncIterator&&J0(r,[IDBIndex,IDBObjectStore,IDBCursor])||e==="iterate"&&J0(r,[IDBIndex,IDBObjectStore])}var J0,jS,KS,X0,Y0,yf,ey,ty,XO,e9,Z0,t9,QS,ry,XS,r9,e_=y(()=>{l();c();d();J0=(r,e)=>e.some(t=>r instanceof t);X0=new WeakMap,Y0=new WeakMap,yf=new WeakMap;ey={get(r,e,t){if(r instanceof IDBTransaction){if(e==="done")return X0.get(r);if(e==="store")return t.objectStoreNames[1]?void 0:t.objectStore(t.objectStoreNames[0])}return ul(r[e])},set(r,e,t){return r[e]=t,!0},has(r,e){return r instanceof IDBTransaction&&(e==="done"||e==="store")?!0:e in r}};ty=r=>yf.get(r);XO=["get","getKey","getAll","getAllKeys","count"],e9=["put","add","delete","clear"],Z0=new Map;ZS(r=>({...r,get:(e,t,o)=>WS(e,t)||r.get(e,t,o),has:(e,t)=>!!WS(e,t)||r.has(e,t)}));t9=["continue","continuePrimaryKey","advance"],QS={},ry=new WeakMap,XS=new WeakMap,r9={get(r,e){if(!t9.includes(e))return r[e];let t=QS[e];return t||(t=QS[e]=function(...o){ry.set(this,XS.get(this)[e](...o))}),t}};ZS(r=>({...r,get(e,t,o){return YS(e,t)?o9:r.get(e,t,o)},has(e,t){return YS(e,t)||r.has(e,t)}}))});var hl,bf=y(()=>{l();c();d();hl="mgt-db-list"});var xu,wf,oy=y(()=>{l();c();d();e_();es();bf();xu=function(r,e,t,o){function i(n){return n instanceof t?n:new t(function(s){s(n)})}return new(t||(t=Promise))(function(n,s){function a(p){try{h(o.next(p))}catch(f){s(f)}}function u(p){try{h(o.throw(p))}catch(f){s(f)}}function h(p){p.done?n(p.value):i(p.value).then(a,u)}h((o=o.apply(r,e||[])).next())})},wf=class{constructor(e,t){if(!(t in e.stores))throw Error('"store" must be defined in the "schema"');this.schema=e,this.store=t}getValue(e){return xu(this,void 0,void 0,function*(){if(!window.indexedDB)return null;try{return(yield this.getDb()).get(this.store,e)}catch{return null}})}putValue(e,t){return xu(this,void 0,void 0,function*(){if(window.indexedDB)try{yield(yield this.getDb()).put(this.store,Object.assign(Object.assign({},t),{timeCached:Date.now()}),e)}catch{return}})}clearStore(){return xu(this,void 0,void 0,function*(){if(window.indexedDB)try{yield(yield this.getDb()).clear(this.store)}catch{return}})}getDBName(){return xu(this,void 0,void 0,function*(){let e=yield V.getCacheId();if(e)return`mgt-${this.schema.name}-${e}`})}getDb(){return xu(this,void 0,void 0,function*(){let e=yield this.getDBName();if(e)return JS(e,this.schema.version,{upgrade:(t,o,i,n)=>{let s=JSON.parse(localStorage.getItem(hl))||[];s.includes(e)||s.push(e),localStorage.setItem(hl,JSON.stringify(s));for(let a in this.schema.stores)Object.prototype.hasOwnProperty.call(this.schema.stores,a)&&!t.objectStoreNames.contains(a)&&t.createObjectStore(a)}})})}}});var i9,W,t_=y(()=>{l();c();d();es();bn();oy();bf();i9=function(r,e,t,o){function i(n){return n instanceof t?n:new t(function(s){s(n)})}return new(t||(t=Promise))(function(n,s){function a(p){try{h(o.next(p))}catch(f){s(f)}}function u(p){try{h(o.throw(p))}catch(f){s(f)}}function h(p){p.done?n(p.value):i(p.value).then(a,u)}h((o=o.apply(r,e||[])).next())})},W=class{static getCache(e,t){let o=`${e.name}/${t}`;return this.isInitialized||this.init(),this.cacheStore.has(t)||this.cacheStore.set(o,new wf(e,t)),this.cacheStore.get(o)}static clearCacheById(e){let t=[],o=JSON.parse(localStorage.getItem(hl));if(o){let i=[];o.forEach(n=>{n.includes(e)?t.push(new Promise((s,a)=>{let u=indexedDB.deleteDatabase(n);u.onsuccess=()=>s(),u.onerror=()=>{console.error(`\u{1F992}: ${u.error.name} occurred deleting cache: ${n}`,u.error.message),a()}})):i.push(n)}),i.length>0?localStorage.setItem(hl,JSON.stringify(i)):localStorage.removeItem(hl)}return Promise.all(t)}static get config(){return this.cacheConfig}static init(){let e;V.globalProvider&&(e=V.globalProvider.state),V.onProviderUpdated(()=>i9(this,void 0,void 0,function*(){if(e===oe.SignedIn&&V.globalProvider.state===oe.SignedOut){let t=yield V.getCacheId();t!==null&&(yield this.clearCacheById(t))}e=V.globalProvider.state})),this.isInitialized=!0}};W.cacheStore=new Map;W.isInitialized=!1;W.cacheConfig={defaultInvalidationPeriod:36e5,groups:{invalidationPeriod:null,isEnabled:!0},isEnabled:!0,people:{invalidationPeriod:null,isEnabled:!0},photos:{invalidationPeriod:null,isEnabled:!0},presence:{invalidationPeriod:3e5,isEnabled:!0},users:{invalidationPeriod:null,isEnabled:!0},response:{invalidationPeriod:null,isEnabled:!0},files:{invalidationPeriod:null,isEnabled:!0},fileLists:{invalidationPeriod:null,isEnabled:!0}}});var Sn,r_=y(()=>{l();c();d();Sn=class{static get microsoftTeamsLib(){return this._microsoftTeamsLib||window.microsoftTeams}static set microsoftTeamsLib(e){this._microsoftTeamsLib=e}static get isAvailable(){return this.microsoftTeamsLib?window.parent===window.self&&window.nativeInterface?!0:window.name==="embedded-page-container"||window.name==="extension-tab-frame":!1}static executeDeepLink(e,t){let o=this.microsoftTeamsLib;o.initialize(),o.executeDeepLink(e,t)}}});var o_=y(()=>{l();c();d()});var i_,pl,n_=y(()=>{l();c();d();i_=function(r,e,t,o){function i(n){return n instanceof t?n:new t(function(s){s(n)})}return new(t||(t=Promise))(function(n,s){function a(p){try{h(o.next(p))}catch(f){s(f)}}function u(p){try{h(o.throw(p))}catch(f){s(f)}}function h(p){p.done?n(p.value):i(p.value).then(a,u)}h((o=o.apply(r,e||[])).next())})},pl=class r{get value(){return this._value}get hasNext(){return!!this._nextLink}static create(e,t,o){return i_(this,void 0,void 0,function*(){let i=yield t.get();if(i?.value){let n=new r;return n._graph=e,n._value=i.value,n._nextLink=i["@odata.nextLink"],n._version=o||e.version,n}return null})}static createFromValue(e,t,o=null){let i=new r;return i._graph=e,i._value=t,i._nextLink=o,i._version=e.version,i}get nextLink(){return this._nextLink||""}next(){var e;return i_(this,void 0,void 0,function*(){if(this._nextLink){let t=this._nextLink.split(this._version)[1],o=yield this._graph.api(t).version(this._version).get();if(!((e=o?.value)===null||e===void 0)&&e.length)return this._value=this._value.concat(o.value),this._nextLink=o["@odata.nextLink"],o.value}return null})}}});var s_,a_,n9,Te,l_=y(()=>{l();c();d();xe();bc();s_=new WeakMap,a_=(r,e,t)=>{let o=[];for(let i of r)o.push(i.replace(e,t));return o},n9=(r,...e)=>{if(Jr.isDisambiguated){let t=s_.get(r);if(!t){let o=new RegExp("({l();c();d();gt();bc()});var ku,Re,d_=y(()=>{l();c();d();bc();ku=r=>`${Jr.prefix}-${r}`,Re=(r,e,t)=>{let o=ku(r);customElements.get(o)||customElements.define(o,e,t)}});var u_=y(()=>{l();c();d();bn();es()});var h_=y(()=>{l();c();d()});var Cf,p_,f_=y(()=>{l();c();d();Cf=class{constructor(){this.session=window.sessionStorage}setItem(e,t){this.session.setItem(e,t)}getItem(e){return this.session.getItem(e)}clear(){this.session.clear()}},p_=r=>{let e;try{r==="sessionStorage"?e=window.sessionStorage:e=window.localStorage;let t="__storage_test__";return e.setItem(t,t),e.removeItem(t),!0}catch(t){return t instanceof DOMException&&(t.code===22||t.code===1014||t.name==="QuotaExceededError"||t.name==="NS_ERROR_DOM_QUOTA_REACHED")&&e&&e.length!==0}}});var m_,Su,g_=y(()=>{l();c();d();f_();m_=function(r,e,t,o){function i(n){return n instanceof t?n:new t(function(s){s(n)})}return new(t||(t=Promise))(function(n,s){function a(p){try{h(o.next(p))}catch(f){s(f)}}function u(p){try{h(o.throw(p))}catch(f){s(f)}}function h(p){p.done?n(p.value):i(p.value).then(a,u)}h((o=o.apply(r,e||[])).next())})},Su=class r{static get _sessionCache(){return!this._cache&&p_("sessionStorage")&&(this._cache=new Cf),this._cache}execute(e){return m_(this,void 0,void 0,function*(){try{let t=yield r.getBaseUrl();e.request=t+encodeURIComponent(e.request)}catch{}return yield this._nextMiddleware.execute(e)})}setNext(e){this._nextMiddleware=e}static getBaseUrl(){var e,t;return m_(this,void 0,void 0,function*(){if(!this._baseUrl){let o=(e=this._sessionCache)===null||e===void 0?void 0:e.getItem("endpointURL");if(o)this._baseUrl=o;else{try{let n=yield(yield fetch("https://cdn.graph.office.net/en-us/graph/api/proxy/endpoint")).json();typeof n!="string"?r.setBaseFallbackUrl():this._baseUrl=n+"?url="}catch{r.setBaseFallbackUrl()}(t=this._sessionCache)===null||t===void 0||t.setItem("endpointURL",this._baseUrl)}}return this._baseUrl})}static setBaseFallbackUrl(){this._baseUrl="https://graph.office.net/en-us/graph/api/proxy?url="}}});var s9,xf,v_=y(()=>{l();c();d();Za();iu();Up();g_();s9=function(r,e,t,o){function i(n){return n instanceof t?n:new t(function(s){s(n)})}return new(t||(t=Promise))(function(n,s){function a(p){try{h(o.next(p))}catch(f){s(f)}}function u(p){try{h(o.throw(p))}catch(f){s(f)}}function h(p){p.done?n(p.value):i(p.value).then(a,u)}h((o=o.apply(r,e||[])).next())})},xf=class r extends Ja{static create(e){return s9(this,void 0,void 0,function*(){let t=[new Ki(e),new ii(new Dr),new Ho,new Su,new Cn];return new r(Ya.initWithMiddleware({middleware:Hp(...t),customHosts:new Set([new URL(yield Su.getBaseUrl()).hostname])}))})}forComponent(e){return this}}});var iy,kf,y_=y(()=>{l();c();d();bn();v_();iy=function(r,e,t,o){function i(n){return n instanceof t?n:new t(function(s){s(n)})}return new(t||(t=Promise))(function(n,s){function a(p){try{h(o.next(p))}catch(f){s(f)}}function u(p){try{h(o.throw(p))}catch(f){s(f)}}function h(p){p.done?n(p.value):i(p.value).then(a,u)}h((o=o.apply(r,e||[])).next())})},kf=class extends ja{constructor(e=!1,t=[]){super(),this._accounts=[],this._mockGraphPromise=xf.create(this);let o=!!t.length;this.isMultipleAccountSupported=o,this.isMultipleAccountDisabled=!o,this._accounts=t,this.initializeMockGraph(e)}get isMultiAccountSupportedAndEnabled(){return!this.isMultipleAccountDisabled&&this.isMultipleAccountSupported}getAllAccounts(){return this._accounts}getActiveAccount(){if(this._accounts.length)return this._accounts[0]}login(){return iy(this,void 0,void 0,function*(){this.setState(oe.Loading),yield this._mockGraphPromise,yield new Promise(e=>setTimeout(e,3e3)),this.setState(oe.SignedIn)})}logout(){return iy(this,void 0,void 0,function*(){this.setState(oe.Loading),yield this._mockGraphPromise,yield new Promise(e=>setTimeout(e,3e3)),this.setState(oe.SignedOut)})}getAccessToken(){return Promise.resolve("{token:https://graph.microsoft.com/}")}get name(){return"MgtMockProvider"}initializeMockGraph(e=!1){return iy(this,void 0,void 0,function*(){this.graph=yield this._mockGraphPromise,e?this.setState(oe.SignedIn):this.setState(oe.SignedOut)})}}});var ge=y(()=>{l();c();d();t0();jd();iu();Ik();yu();SS();W0();HS();zS();bc();bn();es();VS();qS();GS();t_();oy();bf();qd();mf();Up();y0();vp();r_();o_();gf();n_();lf();l_();c_();d_();u_();ou();h_();y_()});var Q_,Y_=y(()=>{l();c();d();xe();Q_=[Oe` `]});var Z_,J_,vs=y(()=>{l();c();d();Y_();Z_=document.createElement("style");Z_.appendChild(document.createTextNode(` @font-face { @@ -27,7 +27,7 @@ try{ url(https://static2.sharepointonline.com/files/fabric/assets/icons/fabricmdl2icons-2.68.woff) format("woff"), url(https://static2.sharepointonline.com/files/fabric/assets/icons/fabricmdl2icons-2.68.ttf) format("truetype"); } -`));document.head.appendChild(Z_);J_=document.createElement("style");J_.innerHTML=Q_.toString();document.head.appendChild(J_)});function zf(){let r=new WeakMap;return function(e){let t=r.get(e);if(t===void 0){let o=Reflect.getPrototypeOf(e);for(;t===void 0&&o!==null;)t=r.get(o),o=Reflect.getPrototypeOf(o);t=t===void 0?[]:t.slice(0),r.set(e,t)}return t}}var tn,X_,kl,wi,ys=y(()=>{l();c();d();tn=function(){if(typeof globalThis<"u")return globalThis;if(typeof window<"u")return window;if(typeof self<"u")return self;if(typeof window<"u")return window;try{return new Function("return this")()}catch{return{}}}();tn.trustedTypes===void 0&&(tn.trustedTypes={createPolicy:(r,e)=>e});X_={configurable:!1,enumerable:!1,writable:!1};tn.FAST===void 0&&Reflect.defineProperty(tn,"FAST",Object.assign({value:Object.create(null)},X_));kl=tn.FAST;if(kl.getById===void 0){let r=Object.create(null);Reflect.defineProperty(kl,"getById",Object.assign({value(e,t){let o=r[e];return o===void 0&&(o=t?r[e]=t():null),o}},X_))}wi=Object.freeze([])});var Fy,eT,Ly,Fu,Ny,Vf,Y,Ci=y(()=>{l();c();d();ys();Fy=tn.FAST.getById(1,()=>{let r=[],e=[];function t(){if(e.length)throw e.shift()}function o(s){try{s.call()}catch(a){e.push(a),setTimeout(t,0)}}function i(){let a=0;for(;a1024){for(let u=0,h=r.length-a;ur}),Ly=eT,Fu=`fast-${Math.random().toString(36).substring(2,8)}`,Ny=`${Fu}{`,Vf=`}${Fu}`,Y=Object.freeze({supportsAdoptedStyleSheets:Array.isArray(document.adoptedStyleSheets)&&"replace"in CSSStyleSheet.prototype,setHTMLPolicy(r){if(Ly!==eT)throw new Error("The HTML policy can only be set once.");Ly=r},createHTML(r){return Ly.createHTML(r)},isMarker(r){return r&&r.nodeType===8&&r.data.startsWith(Fu)},extractDirectiveIndexFromMarker(r){return parseInt(r.data.replace(`${Fu}:`,""))},createInterpolationPlaceholder(r){return`${Ny}${r}${Vf}`},createCustomAttributePlaceholder(r,e){return`${r}="${this.createInterpolationPlaceholder(e)}"`},createBlockPlaceholder(r){return``},queueUpdate:Fy.enqueue,processUpdates:Fy.process,nextUpdate(){return new Promise(Fy.enqueue)},setAttribute(r,e,t){t==null?r.removeAttribute(e):r.setAttribute(e,t)},setBooleanAttribute(r,e,t){t?r.setAttribute(e,""):r.removeAttribute(e)},removeChildNodes(r){for(let e=r.firstChild;e!==null;e=r.firstChild)r.removeChild(e)},createTemplateWalker(r){return document.createTreeWalker(r,133,null,!1)}})});var Rn,Dc,Lu=y(()=>{l();c();d();Rn=class{constructor(e,t){this.sub1=void 0,this.sub2=void 0,this.spillover=void 0,this.source=e,this.sub1=t}has(e){return this.spillover===void 0?this.sub1===e||this.sub2===e:this.spillover.indexOf(e)!==-1}subscribe(e){let t=this.spillover;if(t===void 0){if(this.has(e))return;if(this.sub1===void 0){this.sub1=e;return}if(this.sub2===void 0){this.sub2=e;return}this.spillover=[this.sub1,this.sub2,e],this.sub1=void 0,this.sub2=void 0}else t.indexOf(e)===-1&&t.push(e)}unsubscribe(e){let t=this.spillover;if(t===void 0)this.sub1===e?this.sub1=void 0:this.sub2===e&&(this.sub2=void 0);else{let o=t.indexOf(e);o!==-1&&t.splice(o,1)}}notify(e){let t=this.spillover,o=this.source;if(t===void 0){let i=this.sub1,n=this.sub2;i!==void 0&&i.handleChange(o,e),n!==void 0&&n.handleChange(o,e)}else for(let i=0,n=t.length;i{l();c();d();Ci();ys();Lu();pe=kl.getById(2,()=>{let r=/(:|&&|\|\||if)/,e=new WeakMap,t=Y.queueUpdate,o,i=h=>{throw new Error("Must call enableArrayObservation before observing arrays.")};function n(h){let p=h.$fastController||e.get(h);return p===void 0&&(Array.isArray(h)?p=i(h):e.set(h,p=new Dc(h))),p}let s=zf();class a{constructor(p){this.name=p,this.field=`_${p}`,this.callback=`${p}Changed`}getValue(p){return o!==void 0&&o.watch(p,this.name),p[this.field]}setValue(p,f){let b=this.field,C=p[b];if(C!==f){p[b]=f;let S=p[this.callback];typeof S=="function"&&S.call(p,C,f),n(p).notify(this.name)}}}class u extends Rn{constructor(p,f,b=!1){super(p,f),this.binding=p,this.isVolatileBinding=b,this.needsRefresh=!0,this.needsQueue=!0,this.first=this,this.last=null,this.propertySource=void 0,this.propertyName=void 0,this.notifier=void 0,this.next=void 0}observe(p,f){this.needsRefresh&&this.last!==null&&this.disconnect();let b=o;o=this.needsRefresh?this:void 0,this.needsRefresh=this.isVolatileBinding;let C=this.binding(p,f);return o=b,C}disconnect(){if(this.last!==null){let p=this.first;for(;p!==void 0;)p.notifier.unsubscribe(this,p.propertyName),p=p.next;this.last=null,this.needsRefresh=this.needsQueue=!0}}watch(p,f){let b=this.last,C=n(p),S=b===null?this.first:{};if(S.propertySource=p,S.propertyName=f,S.notifier=C,C.subscribe(this,f),b!==null){if(!this.needsRefresh){let R;o=void 0,R=b.propertySource[b.propertyName],o=this,p===R&&(this.needsRefresh=!0)}b.next=S}this.last=S}handleChange(){this.needsQueue&&(this.needsQueue=!1,t(this))}call(){this.last!==null&&(this.needsQueue=!0,this.notify(this))}records(){let p=this.first;return{next:()=>{let f=p;return f===void 0?{value:void 0,done:!0}:(p=p.next,{value:f,done:!1})},[Symbol.iterator]:function(){return this}}}}return Object.freeze({setArrayObserverFactory(h){i=h},getNotifier:n,track(h,p){o!==void 0&&o.watch(h,p)},trackVolatile(){o!==void 0&&(o.needsRefresh=!0)},notify(h,p){n(h).notify(p)},defineProperty(h,p){typeof p=="string"&&(p=new a(p)),s(h).push(p),Reflect.defineProperty(h,p.name,{enumerable:!0,get:function(){return p.getValue(this)},set:function(f){p.setValue(this,f)}})},getAccessors:s,binding(h,p,f=this.isVolatileBinding(h)){return new u(h,p,f)},isVolatileBinding(h){return r.test(h.toString())}})});tT=kl.getById(3,()=>{let r=null;return{get(){return r},set(e){r=e}}}),sa=class{constructor(){this.index=0,this.length=0,this.parent=null,this.parentContext=null}get event(){return tT.get()}get isEven(){return this.index%2===0}get isOdd(){return this.index%2!==0}get isFirst(){return this.index===0}get isInMiddle(){return!this.isFirst&&!this.isLast}get isLast(){return this.index===this.length-1}static setEvent(e){tT.set(e)}};pe.defineProperty(sa.prototype,"index");pe.defineProperty(sa.prototype,"length");aa=Object.seal(new sa)});var la,Fc,bs,ca=y(()=>{l();c();d();Ci();la=class{constructor(){this.targetIndex=0}},Fc=class extends la{constructor(){super(...arguments),this.createPlaceholder=Y.createInterpolationPlaceholder}},bs=class extends la{constructor(e,t,o){super(),this.name=e,this.behavior=t,this.options=o}createPlaceholder(e){return Y.createCustomAttributePlaceholder(this.name,e)}createBehavior(e){return new this.behavior(e,this.options)}}});function $9(r,e){this.source=r,this.context=e,this.bindingObserver===null&&(this.bindingObserver=pe.binding(this.binding,this,this.isBindingVolatile)),this.updateTarget(this.bindingObserver.observe(r,e))}function O9(r,e){this.source=r,this.context=e,this.target.addEventListener(this.targetName,this)}function M9(){this.bindingObserver.disconnect(),this.source=null,this.context=null}function D9(){this.bindingObserver.disconnect(),this.source=null,this.context=null;let r=this.target.$fastView;r!==void 0&&r.isComposed&&(r.unbind(),r.needsBindOnly=!0)}function F9(){this.target.removeEventListener(this.targetName,this),this.source=null,this.context=null}function L9(r){Y.setAttribute(this.target,this.targetName,r)}function N9(r){Y.setBooleanAttribute(this.target,this.targetName,r)}function H9(r){if(r==null&&(r=""),r.create){this.target.textContent="";let e=this.target.$fastView;e===void 0?e=r.create():this.target.$fastTemplate!==r&&(e.isComposed&&(e.remove(),e.unbind()),e=r.create()),e.isComposed?e.needsBindOnly&&(e.needsBindOnly=!1,e.bind(this.source,this.context)):(e.isComposed=!0,e.bind(this.source,this.context),e.insertBefore(this.target),this.target.$fastView=e,this.target.$fastTemplate=r)}else{let e=this.target.$fastView;e!==void 0&&e.isComposed&&(e.isComposed=!1,e.remove(),e.needsBindOnly?e.needsBindOnly=!1:e.unbind()),this.target.textContent=r}}function U9(r){this.target[this.targetName]=r}function B9(r){let e=this.classVersions||Object.create(null),t=this.target,o=this.version||0;if(r!=null&&r.length){let i=r.split(/\s+/);for(let n=0,s=i.length;n{l();c();d();Ci();Pn();ca();Sl=class extends Fc{constructor(e){super(),this.binding=e,this.bind=$9,this.unbind=M9,this.updateTarget=L9,this.isBindingVolatile=pe.isVolatileBinding(this.binding)}get targetName(){return this.originalTargetName}set targetName(e){if(this.originalTargetName=e,e!==void 0)switch(e[0]){case":":if(this.cleanedTargetName=e.substr(1),this.updateTarget=U9,this.cleanedTargetName==="innerHTML"){let t=this.binding;this.binding=(o,i)=>Y.createHTML(t(o,i))}break;case"?":this.cleanedTargetName=e.substr(1),this.updateTarget=N9;break;case"@":this.cleanedTargetName=e.substr(1),this.bind=O9,this.unbind=F9;break;default:this.cleanedTargetName=e,e==="class"&&(this.updateTarget=B9);break}}targetAtContent(){this.updateTarget=H9,this.unbind=D9}createBehavior(e){return new Hy(e,this.binding,this.isBindingVolatile,this.bind,this.unbind,this.updateTarget,this.cleanedTargetName)}},Hy=class{constructor(e,t,o,i,n,s,a){this.source=null,this.context=null,this.bindingObserver=null,this.target=e,this.binding=t,this.isBindingVolatile=o,this.bind=i,this.unbind=n,this.updateTarget=s,this.targetName=a}handleChange(){this.updateTarget(this.bindingObserver.observe(this.source,this.context))}handleEvent(e){sa.setEvent(e);let t=this.binding(this.source,this.context);sa.setEvent(null),t!==!0&&e.preventDefault()}}});function z9(r){if(r.length===1)return r[0];let e,t=r.length,o=r.map(s=>typeof s=="string"?()=>s:(e=s.targetName||e,s.binding)),i=(s,a)=>{let u="";for(let h=0;ha),h.targetName=s.name):h=z9(u),h!==null&&(e.removeAttributeNode(s),i--,n--,r.addFactory(h))}}function q9(r,e,t){let o=iT(r,e.textContent);if(o!==null){let i=e;for(let n=0,s=o.length;n{l();c();d();Ci();qf();Uy=null,By=class r{addFactory(e){e.targetIndex=this.targetIndex,this.behaviorFactories.push(e)}captureContentBinding(e){e.targetAtContent(),this.addFactory(e)}reset(){this.behaviorFactories=[],this.targetIndex=-1}release(){Uy=this}static borrow(e){let t=Uy||new r;return t.directives=e,t.reset(),Uy=null,t}};V9=Vf.length});var Vy,Lc,Gf=y(()=>{l();c();d();Vy=document.createRange(),Lc=class{constructor(e,t){this.fragment=e,this.behaviors=t,this.source=null,this.context=null,this.firstChild=e.firstChild,this.lastChild=e.lastChild}appendTo(e){e.appendChild(this.fragment)}insertBefore(e){if(this.fragment.hasChildNodes())e.parentNode.insertBefore(this.fragment,e);else{let t=this.lastChild;if(e.previousSibling===t)return;let o=e.parentNode,i=this.firstChild,n;for(;i!==t;)n=i.nextSibling,o.insertBefore(i,e),i=n;o.insertBefore(t,e)}}remove(){let e=this.fragment,t=this.lastChild,o=this.firstChild,i;for(;o!==t;)i=o.nextSibling,e.appendChild(o),o=i;e.appendChild(t)}dispose(){let e=this.firstChild.parentNode,t=this.lastChild,o=this.firstChild,i;for(;o!==t;)i=o.nextSibling,e.removeChild(o),o=i;e.removeChild(t);let n=this.behaviors,s=this.source;for(let a=0,u=n.length;au}if(typeof a=="function"&&(a=new Sl(a)),a instanceof Fc){let u=G9.exec(s);u!==null&&(a.targetName=u[2])}a instanceof la?(o+=a.createPlaceholder(t.length),t.push(a)):o+=a}return o+=r[r.length-1],new jf(o,t)}var jf,G9,sT=y(()=>{l();c();d();Ci();Pn();zy();Gf();ca();qf();jf=class{constructor(e,t){this.behaviorCount=0,this.hasHostBehaviors=!1,this.fragment=null,this.targetOffset=0,this.viewBehaviorFactories=null,this.hostBehaviorFactories=null,this.html=e,this.directives=t}create(e){if(this.fragment===null){let h,p=this.html;if(typeof p=="string"){h=document.createElement("template"),h.innerHTML=Y.createHTML(p);let b=h.content.firstElementChild;b!==null&&b.tagName==="TEMPLATE"&&(h=b)}else h=p;let f=nT(h,this.directives);this.fragment=f.fragment,this.viewBehaviorFactories=f.viewBehaviorFactories,this.hostBehaviorFactories=f.hostBehaviorFactories,this.targetOffset=f.targetOffset,this.behaviorCount=this.viewBehaviorFactories.length+this.hostBehaviorFactories.length,this.hasHostBehaviors=this.hostBehaviorFactories.length>0}let t=this.fragment.cloneNode(!0),o=this.viewBehaviorFactories,i=new Array(this.behaviorCount),n=Y.createTemplateWalker(t),s=0,a=this.targetOffset,u=n.nextNode();for(let h=o.length;s=/]+)([ \x09\x0a\x0c\x0d]*=[ \x09\x0a\x0c\x0d]*(?:[^ \x09\x0a\x0c\x0d"'`<>=]*|"[^"]*|'[^']*))$/});function jy(r){return r.map(e=>e instanceof nr?jy(e.styles):[e]).reduce((e,t)=>e.concat(t),[])}function aT(r){return r.map(e=>e instanceof nr?e.behaviors:null).reduce((e,t)=>t===null?e:(e===null&&(e=[]),e.concat(t)),null)}function lT(r){let e=[],t=[];return r.forEach(o=>(o[Kf]?e:t).push(o)),{prepend:e,append:t}}function K9(){return`fast-style-class-${++j9}`}var nr,Kf,cT,dT,qy,j9,Gy,Wf=y(()=>{l();c();d();Ci();nr=class{constructor(){this.targets=new WeakSet}addStylesTo(e){this.targets.add(e)}removeStylesFrom(e){this.targets.delete(e)}isAttachedTo(e){return this.targets.has(e)}withBehaviors(...e){return this.behaviors=this.behaviors===null?e:this.behaviors.concat(e),this}};nr.create=(()=>{if(Y.supportsAdoptedStyleSheets){let r=new Map;return e=>new qy(e,r)}return r=>new Gy(r)})();Kf=Symbol("prependToAdoptedStyleSheets");cT=(r,e)=>{let{prepend:t,append:o}=lT(e);r.adoptedStyleSheets=[...t,...r.adoptedStyleSheets,...o]},dT=(r,e)=>{r.adoptedStyleSheets=r.adoptedStyleSheets.filter(t=>e.indexOf(t)===-1)};if(Y.supportsAdoptedStyleSheets)try{document.adoptedStyleSheets.push(),document.adoptedStyleSheets.splice(),cT=(r,e)=>{let{prepend:t,append:o}=lT(e);r.adoptedStyleSheets.splice(0,0,...t),r.adoptedStyleSheets.push(...o)},dT=(r,e)=>{for(let t of e){let o=r.adoptedStyleSheets.indexOf(t);o!==-1&&r.adoptedStyleSheets.splice(o,1)}}}catch{}qy=class extends nr{constructor(e,t){super(),this.styles=e,this.styleSheetCache=t,this._styleSheets=void 0,this.behaviors=aT(e)}get styleSheets(){if(this._styleSheets===void 0){let e=this.styles,t=this.styleSheetCache;this._styleSheets=jy(e).map(o=>{if(o instanceof CSSStyleSheet)return o;let i=t.get(o);return i===void 0&&(i=new CSSStyleSheet,i.replaceSync(o),t.set(o,i)),i})}return this._styleSheets}addStylesTo(e){cT(e,this.styleSheets),super.addStylesTo(e)}removeStylesFrom(e){dT(e,this.styleSheets),super.removeStylesFrom(e)}},j9=0;Gy=class extends nr{constructor(e){super(),this.styles=e,this.behaviors=null,this.behaviors=aT(e),this.styleSheets=jy(e),this.styleClass=K9()}addStylesTo(e){let t=this.styleSheets,o=this.styleClass;e=this.normalizeTarget(e);for(let i=0;i1&&(t.property=n),Nu.locate(i.constructor).push(t)}if(arguments.length>1){t={},o(r,e);return}return t=r===void 0?{}:r,o}var Nu,ws,se,Qf,Ky=y(()=>{l();c();d();Pn();Ci();ys();Nu=Object.freeze({locate:zf()}),ws={toView(r){return r?"true":"false"},fromView(r){return!(r==null||r==="false"||r===!1||r===0)}},se={toView(r){if(r==null)return null;let e=r*1;return isNaN(e)?null:e.toString()},fromView(r){if(r==null)return null;let e=r*1;return isNaN(e)?null:e}},Qf=class r{constructor(e,t,o=t.toLowerCase(),i="reflect",n){this.guards=new Set,this.Owner=e,this.name=t,this.attribute=o,this.mode=i,this.converter=n,this.fieldName=`_${t}`,this.callbackName=`${t}Changed`,this.hasCallback=this.callbackName in e.prototype,i==="boolean"&&n===void 0&&(this.converter=ws)}setValue(e,t){let o=e[this.fieldName],i=this.converter;i!==void 0&&(t=i.fromView(t)),o!==t&&(e[this.fieldName]=t,this.tryReflectToAttribute(e),this.hasCallback&&e[this.callbackName](o,t),e.$fastController.notify(this.name))}getValue(e){return pe.track(e,this.name),e[this.fieldName]}onAttributeChangedCallback(e,t){this.guards.has(e)||(this.guards.add(e),this.setValue(e,t),this.guards.delete(e))}tryReflectToAttribute(e){let t=this.mode,o=this.guards;o.has(e)||t==="fromView"||Y.queueUpdate(()=>{o.add(e);let i=e[this.fieldName];switch(t){case"reflect":let n=this.converter;Y.setAttribute(e,this.attribute,n!==void 0?n.toView(i):i);break;case"boolean":Y.setBooleanAttribute(e,this.attribute,i);break}o.delete(e)})}static collect(e,...t){let o=[];t.push(Nu.locate(e));for(let i=0,n=t.length;i{l();c();d();ys();Pn();Wf();Ky();uT={mode:"open"},hT={},Wy=kl.getById(4,()=>{let r=new Map;return Object.freeze({register(e){return r.has(e.type)?!1:(r.set(e.type,e),!0)},getByType(e){return r.get(e)}})}),$n=class{constructor(e,t=e.definition){typeof t=="string"&&(t={name:t}),this.type=e,this.name=t.name,this.template=t.template;let o=Qf.collect(e,t.attributes),i=new Array(o.length),n={},s={};for(let a=0,u=o.length;a{l();c();d();Ci();Lu();Pn();Yf();pT=new WeakMap,W9={bubbles:!0,composed:!0,cancelable:!0};Zf=class r extends Dc{constructor(e,t){super(e),this.boundObservables=null,this.behaviors=null,this.needsInitialization=!0,this._template=null,this._styles=null,this._isConnected=!1,this.$fastController=this,this.view=null,this.element=e,this.definition=t;let o=t.shadowOptions;if(o!==void 0){let n=e.attachShadow(o);o.mode==="closed"&&pT.set(e,n)}let i=pe.getAccessors(e);if(i.length>0){let n=this.boundObservables=Object.create(null);for(let s=0,a=i.length;s{l();c();d();Yy();Yf();da=Object.assign(fT(HTMLElement),{from(r){return fT(r)},define(r,e){return new $n(r,e).define().type}})});var ua,Zy=y(()=>{l();c();d();ua=class{createCSS(){return""}createBehavior(){}}});function gT(r,e){let t=[],o="",i=[];for(let n=0,s=r.length-1;n{l();c();d();Zy();Wf();Jy=class extends ua{constructor(e,t){super(),this.behaviors=t,this.css="";let o=e.reduce((i,n)=>(typeof n=="string"?this.css+=n:i.push(n),i),[]);o.length&&(this.styles=nr.create(o))}createBehavior(){return this}createCSS(){return this.css}bind(e){this.styles&&e.$fastController.addStyles(this.styles),this.behaviors.length&&e.$fastController.addBehaviors(this.behaviors)}unbind(e){this.styles&&e.$fastController.removeStyles(this.styles),this.behaviors.length&&e.$fastController.removeBehaviors(this.behaviors)}}});function xi(r,e,t){return{index:r,removed:e,addedCount:t}}function Q9(r,e,t,o,i,n){let s=n-i+1,a=t-e+1,u=new Array(s),h,p;for(let f=0;f0||t>0;){if(e===0){i.push(Xy),t--;continue}if(t===0){i.push(eb),e--;continue}let n=r[e-1][t-1],s=r[e-1][t],a=r[e][t-1],u;s=0){r.splice(a,1),a--,s-=u.addedCount-u.removed.length,i.addedCount+=u.addedCount-h;let p=i.removed.length+u.removed.length-h;if(!i.addedCount&&!p)n=!0;else{let f=u.removed;if(i.indexu.index+u.addedCount){let b=i.removed.slice(u.index+u.addedCount-i.index);yT.apply(f,b)}i.removed=f,u.index{l();c();d();ys();bT=0,wT=1,Xy=2,eb=3;yT=Array.prototype.push});function ob(r,e){let t=r.index,o=e.length;return t>o?t=o-r.addedCount:t<0&&(t=o+r.removed.length+t-r.addedCount),t<0&&(t=0),r.index=t,r}function nb(){if(xT)return;xT=!0,pe.setArrayObserverFactory(u=>new ib(u));let r=Array.prototype;if(r.$fastPatch)return;Reflect.defineProperty(r,"$fastPatch",{value:1,enumerable:!1});let e=r.pop,t=r.push,o=r.reverse,i=r.shift,n=r.sort,s=r.splice,a=r.unshift;r.pop=function(){let u=this.length>0,h=e.apply(this,arguments),p=this.$fastController;return p!==void 0&&u&&p.addSplice(xi(this.length,[h],0)),h},r.push=function(){let u=t.apply(this,arguments),h=this.$fastController;return h!==void 0&&h.addSplice(ob(xi(this.length-arguments.length,[],arguments.length),this)),u},r.reverse=function(){let u,h=this.$fastController;h!==void 0&&(h.flush(),u=this.slice());let p=o.apply(this,arguments);return h!==void 0&&h.reset(u),p},r.shift=function(){let u=this.length>0,h=i.apply(this,arguments),p=this.$fastController;return p!==void 0&&u&&p.addSplice(xi(0,[h],0)),h},r.sort=function(){let u,h=this.$fastController;h!==void 0&&(h.flush(),u=this.slice());let p=n.apply(this,arguments);return h!==void 0&&h.reset(u),p},r.splice=function(){let u=s.apply(this,arguments),h=this.$fastController;return h!==void 0&&h.addSplice(ob(xi(+arguments[0],u,arguments.length>2?arguments.length-2:0),this)),u},r.unshift=function(){let u=a.apply(this,arguments),h=this.$fastController;return h!==void 0&&h.addSplice(ob(xi(0,[],arguments.length),this)),u}}var xT,ib,sb=y(()=>{l();c();d();Ci();rb();Lu();Pn();xT=!1;ib=class extends Rn{constructor(e){super(e),this.oldCollection=void 0,this.splices=void 0,this.needsQueue=!0,this.call=this.flush,Reflect.defineProperty(e,"$fastController",{value:this,enumerable:!1})}subscribe(e){this.flush(),super.subscribe(e)}addSplice(e){this.splices===void 0?this.splices=[e]:this.splices.push(e),this.needsQueue&&(this.needsQueue=!1,Y.queueUpdate(this))}reset(e){this.oldCollection=e,this.needsQueue&&(this.needsQueue=!1,Y.queueUpdate(this))}flush(){let e=this.splices,t=this.oldCollection;if(e===void 0&&t===void 0)return;this.needsQueue=!0,this.splices=void 0,this.oldCollection=void 0;let o=t===void 0?CT(this.source,e):tb(this.source,0,this.source.length,t,0,t.length);this.notify(o)}}});function Ee(r){return new bs("fast-ref",ab,r)}var ab,kT=y(()=>{l();c();d();ca();ab=class{constructor(e,t){this.target=e,this.propertyName=t}bind(e){e[this.propertyName]=this.target}unbind(){}}});var lb,ST=y(()=>{l();c();d();lb=r=>typeof r=="function"});function _T(r){return r===void 0?rM:lb(r)?r:()=>r}function Ze(r,e,t){let o=lb(r)?r:()=>r,i=_T(e),n=_T(t);return(s,a)=>o(s,a)?i(s,a):n(s,a)}var rM,TT=y(()=>{l();c();d();ST();rM=()=>null});function oM(r,e,t,o){r.bind(e[t],o)}function iM(r,e,t,o){let i=Object.create(o);i.index=t,i.length=e.length,r.bind(e[t],i)}function _l(r,e,t=ET){let o=typeof e=="function"?e:()=>e;return new On(r,o,Object.assign(Object.assign({},ET),t))}var ET,cb,On,IT=y(()=>{l();c();d();Ci();Pn();sb();ys();ca();Gf();ET=Object.freeze({positioning:!1,recycle:!0});cb=class{constructor(e,t,o,i,n,s){this.location=e,this.itemsBinding=t,this.templateBinding=i,this.options=s,this.source=null,this.views=[],this.items=null,this.itemsObserver=null,this.originalContext=void 0,this.childContext=void 0,this.bindView=oM,this.itemsBindingObserver=pe.binding(t,this,o),this.templateBindingObserver=pe.binding(i,this,n),s.positioning&&(this.bindView=iM)}bind(e,t){this.source=e,this.originalContext=t,this.childContext=Object.create(t),this.childContext.parent=e,this.childContext.parentContext=this.originalContext,this.items=this.itemsBindingObserver.observe(e,this.originalContext),this.template=this.templateBindingObserver.observe(e,this.originalContext),this.observeItems(!0),this.refreshAllViews()}unbind(){this.source=null,this.items=null,this.itemsObserver!==null&&this.itemsObserver.unsubscribe(this),this.unbindAllViews(),this.itemsBindingObserver.disconnect(),this.templateBindingObserver.disconnect()}handleChange(e,t){e===this.itemsBinding?(this.items=this.itemsBindingObserver.observe(this.source,this.originalContext),this.observeItems(),this.refreshAllViews()):e===this.templateBinding?(this.template=this.templateBindingObserver.observe(this.source,this.originalContext),this.refreshAllViews(!0)):this.updateViews(t)}observeItems(e=!1){if(!this.items){this.items=wi;return}let t=this.itemsObserver,o=this.itemsObserver=pe.getNotifier(this.items),i=t!==o;i&&t!==null&&t.unsubscribe(this),(i||e)&&o.subscribe(this)}updateViews(e){let t=this.childContext,o=this.views,i=this.bindView,n=this.items,s=this.template,a=this.options.recycle,u=[],h=0,p=0;for(let f=0,b=e.length;f0?(R<=me&&oe.length>0?(tt=oe[R],R++):(tt=u[h],h++),p--):tt=s.create(),o.splice(H,0,tt),i(tt,n,H,t),tt.insertBefore(Ge)}oe[R]&&u.push(...oe.slice(R))}for(let f=h,b=u.length;f{l();c();d();Pn();ys();Nc=class{constructor(e,t){this.target=e,this.options=t,this.source=null}bind(e){let t=this.options.property;this.shouldUpdate=pe.getAccessors(e).some(o=>o.name===t),this.source=e,this.updateTarget(this.computeNodes()),this.shouldUpdate&&this.observe()}unbind(){this.updateTarget(wi),this.source=null,this.shouldUpdate&&this.disconnect()}handleEvent(){this.updateTarget(this.computeNodes())}computeNodes(){let e=this.getNodes();return this.options.filter!==void 0&&(e=e.filter(this.options.filter)),e}updateTarget(e){this.source[this.options.property]=e}}});function Fe(r){return typeof r=="string"&&(r={property:r}),new bs("fast-slotted",db,r)}var db,AT=y(()=>{l();c();d();ca();Jf();db=class extends Nc{constructor(e,t){super(e,t)}observe(){this.target.addEventListener("slotchange",this)}disconnect(){this.target.removeEventListener("slotchange",this)}getNodes(){return this.target.assignedNodes(this.options)}}});function ha(r){return typeof r=="string"&&(r={property:r}),new bs("fast-children",ub,r)}var ub,RT=y(()=>{l();c();d();ca();Jf();ub=class extends Nc{constructor(e,t){super(e,t),this.observer=null,t.childList=!0}observe(){this.observer===null&&(this.observer=new MutationObserver(this.handleEvent.bind(this))),this.observer.observe(this.target,this.options)}disconnect(){this.observer.disconnect()}getNodes(){return"subtree"in this.options?Array.from(this.target.querySelectorAll(this.options.selector)):Array.from(this.target.childNodes)}}});var A=y(()=>{l();c();d();ys();sT();mT();Yf();Ky();Yy();zy();Wf();vT();Zy();Gf();Pn();Lu();rb();sb();Ci();qf();ca();kT();TT();IT();AT();RT();Jf()});var _t,wt,Ct,PT,$T,$t=y(()=>{l();c();d();A();_t=class{handleStartContentChange(){this.startContainer.classList.toggle("start",this.start.assignedNodes().length>0)}handleEndContentChange(){this.endContainer.classList.toggle("end",this.end.assignedNodes().length>0)}},wt=(r,e)=>O` +`));document.head.appendChild(Z_);J_=document.createElement("style");J_.innerHTML=Q_.toString();document.head.appendChild(J_)});function zf(){let r=new WeakMap;return function(e){let t=r.get(e);if(t===void 0){let o=Reflect.getPrototypeOf(e);for(;t===void 0&&o!==null;)t=r.get(o),o=Reflect.getPrototypeOf(o);t=t===void 0?[]:t.slice(0),r.set(e,t)}return t}}var tn,X_,kl,wi,ys=y(()=>{l();c();d();tn=function(){if(typeof globalThis<"u")return globalThis;if(typeof window<"u")return window;if(typeof self<"u")return self;if(typeof window<"u")return window;try{return new Function("return this")()}catch{return{}}}();tn.trustedTypes===void 0&&(tn.trustedTypes={createPolicy:(r,e)=>e});X_={configurable:!1,enumerable:!1,writable:!1};tn.FAST===void 0&&Reflect.defineProperty(tn,"FAST",Object.assign({value:Object.create(null)},X_));kl=tn.FAST;if(kl.getById===void 0){let r=Object.create(null);Reflect.defineProperty(kl,"getById",Object.assign({value(e,t){let o=r[e];return o===void 0&&(o=t?r[e]=t():null),o}},X_))}wi=Object.freeze([])});var Fy,eT,Ly,Fu,Ny,Vf,Y,Ci=y(()=>{l();c();d();ys();Fy=tn.FAST.getById(1,()=>{let r=[],e=[];function t(){if(e.length)throw e.shift()}function o(s){try{s.call()}catch(a){e.push(a),setTimeout(t,0)}}function i(){let a=0;for(;a1024){for(let u=0,h=r.length-a;ur}),Ly=eT,Fu=`fast-${Math.random().toString(36).substring(2,8)}`,Ny=`${Fu}{`,Vf=`}${Fu}`,Y=Object.freeze({supportsAdoptedStyleSheets:Array.isArray(document.adoptedStyleSheets)&&"replace"in CSSStyleSheet.prototype,setHTMLPolicy(r){if(Ly!==eT)throw new Error("The HTML policy can only be set once.");Ly=r},createHTML(r){return Ly.createHTML(r)},isMarker(r){return r&&r.nodeType===8&&r.data.startsWith(Fu)},extractDirectiveIndexFromMarker(r){return parseInt(r.data.replace(`${Fu}:`,""))},createInterpolationPlaceholder(r){return`${Ny}${r}${Vf}`},createCustomAttributePlaceholder(r,e){return`${r}="${this.createInterpolationPlaceholder(e)}"`},createBlockPlaceholder(r){return``},queueUpdate:Fy.enqueue,processUpdates:Fy.process,nextUpdate(){return new Promise(Fy.enqueue)},setAttribute(r,e,t){t==null?r.removeAttribute(e):r.setAttribute(e,t)},setBooleanAttribute(r,e,t){t?r.setAttribute(e,""):r.removeAttribute(e)},removeChildNodes(r){for(let e=r.firstChild;e!==null;e=r.firstChild)r.removeChild(e)},createTemplateWalker(r){return document.createTreeWalker(r,133,null,!1)}})});var Rn,Dc,Lu=y(()=>{l();c();d();Rn=class{constructor(e,t){this.sub1=void 0,this.sub2=void 0,this.spillover=void 0,this.source=e,this.sub1=t}has(e){return this.spillover===void 0?this.sub1===e||this.sub2===e:this.spillover.indexOf(e)!==-1}subscribe(e){let t=this.spillover;if(t===void 0){if(this.has(e))return;if(this.sub1===void 0){this.sub1=e;return}if(this.sub2===void 0){this.sub2=e;return}this.spillover=[this.sub1,this.sub2,e],this.sub1=void 0,this.sub2=void 0}else t.indexOf(e)===-1&&t.push(e)}unsubscribe(e){let t=this.spillover;if(t===void 0)this.sub1===e?this.sub1=void 0:this.sub2===e&&(this.sub2=void 0);else{let o=t.indexOf(e);o!==-1&&t.splice(o,1)}}notify(e){let t=this.spillover,o=this.source;if(t===void 0){let i=this.sub1,n=this.sub2;i!==void 0&&i.handleChange(o,e),n!==void 0&&n.handleChange(o,e)}else for(let i=0,n=t.length;i{l();c();d();Ci();ys();Lu();pe=kl.getById(2,()=>{let r=/(:|&&|\|\||if)/,e=new WeakMap,t=Y.queueUpdate,o,i=h=>{throw new Error("Must call enableArrayObservation before observing arrays.")};function n(h){let p=h.$fastController||e.get(h);return p===void 0&&(Array.isArray(h)?p=i(h):e.set(h,p=new Dc(h))),p}let s=zf();class a{constructor(p){this.name=p,this.field=`_${p}`,this.callback=`${p}Changed`}getValue(p){return o!==void 0&&o.watch(p,this.name),p[this.field]}setValue(p,f){let b=this.field,C=p[b];if(C!==f){p[b]=f;let S=p[this.callback];typeof S=="function"&&S.call(p,C,f),n(p).notify(this.name)}}}class u extends Rn{constructor(p,f,b=!1){super(p,f),this.binding=p,this.isVolatileBinding=b,this.needsRefresh=!0,this.needsQueue=!0,this.first=this,this.last=null,this.propertySource=void 0,this.propertyName=void 0,this.notifier=void 0,this.next=void 0}observe(p,f){this.needsRefresh&&this.last!==null&&this.disconnect();let b=o;o=this.needsRefresh?this:void 0,this.needsRefresh=this.isVolatileBinding;let C=this.binding(p,f);return o=b,C}disconnect(){if(this.last!==null){let p=this.first;for(;p!==void 0;)p.notifier.unsubscribe(this,p.propertyName),p=p.next;this.last=null,this.needsRefresh=this.needsQueue=!0}}watch(p,f){let b=this.last,C=n(p),S=b===null?this.first:{};if(S.propertySource=p,S.propertyName=f,S.notifier=C,C.subscribe(this,f),b!==null){if(!this.needsRefresh){let R;o=void 0,R=b.propertySource[b.propertyName],o=this,p===R&&(this.needsRefresh=!0)}b.next=S}this.last=S}handleChange(){this.needsQueue&&(this.needsQueue=!1,t(this))}call(){this.last!==null&&(this.needsQueue=!0,this.notify(this))}records(){let p=this.first;return{next:()=>{let f=p;return f===void 0?{value:void 0,done:!0}:(p=p.next,{value:f,done:!1})},[Symbol.iterator]:function(){return this}}}}return Object.freeze({setArrayObserverFactory(h){i=h},getNotifier:n,track(h,p){o!==void 0&&o.watch(h,p)},trackVolatile(){o!==void 0&&(o.needsRefresh=!0)},notify(h,p){n(h).notify(p)},defineProperty(h,p){typeof p=="string"&&(p=new a(p)),s(h).push(p),Reflect.defineProperty(h,p.name,{enumerable:!0,get:function(){return p.getValue(this)},set:function(f){p.setValue(this,f)}})},getAccessors:s,binding(h,p,f=this.isVolatileBinding(h)){return new u(h,p,f)},isVolatileBinding(h){return r.test(h.toString())}})});tT=kl.getById(3,()=>{let r=null;return{get(){return r},set(e){r=e}}}),sa=class{constructor(){this.index=0,this.length=0,this.parent=null,this.parentContext=null}get event(){return tT.get()}get isEven(){return this.index%2===0}get isOdd(){return this.index%2!==0}get isFirst(){return this.index===0}get isInMiddle(){return!this.isFirst&&!this.isLast}get isLast(){return this.index===this.length-1}static setEvent(e){tT.set(e)}};pe.defineProperty(sa.prototype,"index");pe.defineProperty(sa.prototype,"length");aa=Object.seal(new sa)});var la,Fc,bs,ca=y(()=>{l();c();d();Ci();la=class{constructor(){this.targetIndex=0}},Fc=class extends la{constructor(){super(...arguments),this.createPlaceholder=Y.createInterpolationPlaceholder}},bs=class extends la{constructor(e,t,o){super(),this.name=e,this.behavior=t,this.options=o}createPlaceholder(e){return Y.createCustomAttributePlaceholder(this.name,e)}createBehavior(e){return new this.behavior(e,this.options)}}});function $9(r,e){this.source=r,this.context=e,this.bindingObserver===null&&(this.bindingObserver=pe.binding(this.binding,this,this.isBindingVolatile)),this.updateTarget(this.bindingObserver.observe(r,e))}function O9(r,e){this.source=r,this.context=e,this.target.addEventListener(this.targetName,this)}function M9(){this.bindingObserver.disconnect(),this.source=null,this.context=null}function D9(){this.bindingObserver.disconnect(),this.source=null,this.context=null;let r=this.target.$fastView;r!==void 0&&r.isComposed&&(r.unbind(),r.needsBindOnly=!0)}function F9(){this.target.removeEventListener(this.targetName,this),this.source=null,this.context=null}function L9(r){Y.setAttribute(this.target,this.targetName,r)}function N9(r){Y.setBooleanAttribute(this.target,this.targetName,r)}function H9(r){if(r==null&&(r=""),r.create){this.target.textContent="";let e=this.target.$fastView;e===void 0?e=r.create():this.target.$fastTemplate!==r&&(e.isComposed&&(e.remove(),e.unbind()),e=r.create()),e.isComposed?e.needsBindOnly&&(e.needsBindOnly=!1,e.bind(this.source,this.context)):(e.isComposed=!0,e.bind(this.source,this.context),e.insertBefore(this.target),this.target.$fastView=e,this.target.$fastTemplate=r)}else{let e=this.target.$fastView;e!==void 0&&e.isComposed&&(e.isComposed=!1,e.remove(),e.needsBindOnly?e.needsBindOnly=!1:e.unbind()),this.target.textContent=r}}function U9(r){this.target[this.targetName]=r}function B9(r){let e=this.classVersions||Object.create(null),t=this.target,o=this.version||0;if(r!=null&&r.length){let i=r.split(/\s+/);for(let n=0,s=i.length;n{l();c();d();Ci();Pn();ca();Sl=class extends Fc{constructor(e){super(),this.binding=e,this.bind=$9,this.unbind=M9,this.updateTarget=L9,this.isBindingVolatile=pe.isVolatileBinding(this.binding)}get targetName(){return this.originalTargetName}set targetName(e){if(this.originalTargetName=e,e!==void 0)switch(e[0]){case":":if(this.cleanedTargetName=e.substr(1),this.updateTarget=U9,this.cleanedTargetName==="innerHTML"){let t=this.binding;this.binding=(o,i)=>Y.createHTML(t(o,i))}break;case"?":this.cleanedTargetName=e.substr(1),this.updateTarget=N9;break;case"@":this.cleanedTargetName=e.substr(1),this.bind=O9,this.unbind=F9;break;default:this.cleanedTargetName=e,e==="class"&&(this.updateTarget=B9);break}}targetAtContent(){this.updateTarget=H9,this.unbind=D9}createBehavior(e){return new Hy(e,this.binding,this.isBindingVolatile,this.bind,this.unbind,this.updateTarget,this.cleanedTargetName)}},Hy=class{constructor(e,t,o,i,n,s,a){this.source=null,this.context=null,this.bindingObserver=null,this.target=e,this.binding=t,this.isBindingVolatile=o,this.bind=i,this.unbind=n,this.updateTarget=s,this.targetName=a}handleChange(){this.updateTarget(this.bindingObserver.observe(this.source,this.context))}handleEvent(e){sa.setEvent(e);let t=this.binding(this.source,this.context);sa.setEvent(null),t!==!0&&e.preventDefault()}}});function z9(r){if(r.length===1)return r[0];let e,t=r.length,o=r.map(s=>typeof s=="string"?()=>s:(e=s.targetName||e,s.binding)),i=(s,a)=>{let u="";for(let h=0;ha),h.targetName=s.name):h=z9(u),h!==null&&(e.removeAttributeNode(s),i--,n--,r.addFactory(h))}}function q9(r,e,t){let o=iT(r,e.textContent);if(o!==null){let i=e;for(let n=0,s=o.length;n{l();c();d();Ci();qf();Uy=null,By=class r{addFactory(e){e.targetIndex=this.targetIndex,this.behaviorFactories.push(e)}captureContentBinding(e){e.targetAtContent(),this.addFactory(e)}reset(){this.behaviorFactories=[],this.targetIndex=-1}release(){Uy=this}static borrow(e){let t=Uy||new r;return t.directives=e,t.reset(),Uy=null,t}};V9=Vf.length});var Vy,Lc,Gf=y(()=>{l();c();d();Vy=document.createRange(),Lc=class{constructor(e,t){this.fragment=e,this.behaviors=t,this.source=null,this.context=null,this.firstChild=e.firstChild,this.lastChild=e.lastChild}appendTo(e){e.appendChild(this.fragment)}insertBefore(e){if(this.fragment.hasChildNodes())e.parentNode.insertBefore(this.fragment,e);else{let t=this.lastChild;if(e.previousSibling===t)return;let o=e.parentNode,i=this.firstChild,n;for(;i!==t;)n=i.nextSibling,o.insertBefore(i,e),i=n;o.insertBefore(t,e)}}remove(){let e=this.fragment,t=this.lastChild,o=this.firstChild,i;for(;o!==t;)i=o.nextSibling,e.appendChild(o),o=i;e.appendChild(t)}dispose(){let e=this.firstChild.parentNode,t=this.lastChild,o=this.firstChild,i;for(;o!==t;)i=o.nextSibling,e.removeChild(o),o=i;e.removeChild(t);let n=this.behaviors,s=this.source;for(let a=0,u=n.length;au}if(typeof a=="function"&&(a=new Sl(a)),a instanceof Fc){let u=G9.exec(s);u!==null&&(a.targetName=u[2])}a instanceof la?(o+=a.createPlaceholder(t.length),t.push(a)):o+=a}return o+=r[r.length-1],new jf(o,t)}var jf,G9,sT=y(()=>{l();c();d();Ci();Pn();zy();Gf();ca();qf();jf=class{constructor(e,t){this.behaviorCount=0,this.hasHostBehaviors=!1,this.fragment=null,this.targetOffset=0,this.viewBehaviorFactories=null,this.hostBehaviorFactories=null,this.html=e,this.directives=t}create(e){if(this.fragment===null){let h,p=this.html;if(typeof p=="string"){h=document.createElement("template"),h.innerHTML=Y.createHTML(p);let b=h.content.firstElementChild;b!==null&&b.tagName==="TEMPLATE"&&(h=b)}else h=p;let f=nT(h,this.directives);this.fragment=f.fragment,this.viewBehaviorFactories=f.viewBehaviorFactories,this.hostBehaviorFactories=f.hostBehaviorFactories,this.targetOffset=f.targetOffset,this.behaviorCount=this.viewBehaviorFactories.length+this.hostBehaviorFactories.length,this.hasHostBehaviors=this.hostBehaviorFactories.length>0}let t=this.fragment.cloneNode(!0),o=this.viewBehaviorFactories,i=new Array(this.behaviorCount),n=Y.createTemplateWalker(t),s=0,a=this.targetOffset,u=n.nextNode();for(let h=o.length;s=/]+)([ \x09\x0a\x0c\x0d]*=[ \x09\x0a\x0c\x0d]*(?:[^ \x09\x0a\x0c\x0d"'`<>=]*|"[^"]*|'[^']*))$/});function jy(r){return r.map(e=>e instanceof nr?jy(e.styles):[e]).reduce((e,t)=>e.concat(t),[])}function aT(r){return r.map(e=>e instanceof nr?e.behaviors:null).reduce((e,t)=>t===null?e:(e===null&&(e=[]),e.concat(t)),null)}function lT(r){let e=[],t=[];return r.forEach(o=>(o[Kf]?e:t).push(o)),{prepend:e,append:t}}function K9(){return`fast-style-class-${++j9}`}var nr,Kf,cT,dT,qy,j9,Gy,Wf=y(()=>{l();c();d();Ci();nr=class{constructor(){this.targets=new WeakSet}addStylesTo(e){this.targets.add(e)}removeStylesFrom(e){this.targets.delete(e)}isAttachedTo(e){return this.targets.has(e)}withBehaviors(...e){return this.behaviors=this.behaviors===null?e:this.behaviors.concat(e),this}};nr.create=(()=>{if(Y.supportsAdoptedStyleSheets){let r=new Map;return e=>new qy(e,r)}return r=>new Gy(r)})();Kf=Symbol("prependToAdoptedStyleSheets");cT=(r,e)=>{let{prepend:t,append:o}=lT(e);r.adoptedStyleSheets=[...t,...r.adoptedStyleSheets,...o]},dT=(r,e)=>{r.adoptedStyleSheets=r.adoptedStyleSheets.filter(t=>e.indexOf(t)===-1)};if(Y.supportsAdoptedStyleSheets)try{document.adoptedStyleSheets.push(),document.adoptedStyleSheets.splice(),cT=(r,e)=>{let{prepend:t,append:o}=lT(e);r.adoptedStyleSheets.splice(0,0,...t),r.adoptedStyleSheets.push(...o)},dT=(r,e)=>{for(let t of e){let o=r.adoptedStyleSheets.indexOf(t);o!==-1&&r.adoptedStyleSheets.splice(o,1)}}}catch{}qy=class extends nr{constructor(e,t){super(),this.styles=e,this.styleSheetCache=t,this._styleSheets=void 0,this.behaviors=aT(e)}get styleSheets(){if(this._styleSheets===void 0){let e=this.styles,t=this.styleSheetCache;this._styleSheets=jy(e).map(o=>{if(o instanceof CSSStyleSheet)return o;let i=t.get(o);return i===void 0&&(i=new CSSStyleSheet,i.replaceSync(o),t.set(o,i)),i})}return this._styleSheets}addStylesTo(e){cT(e,this.styleSheets),super.addStylesTo(e)}removeStylesFrom(e){dT(e,this.styleSheets),super.removeStylesFrom(e)}},j9=0;Gy=class extends nr{constructor(e){super(),this.styles=e,this.behaviors=null,this.behaviors=aT(e),this.styleSheets=jy(e),this.styleClass=K9()}addStylesTo(e){let t=this.styleSheets,o=this.styleClass;e=this.normalizeTarget(e);for(let i=0;i1&&(t.property=n),Nu.locate(i.constructor).push(t)}if(arguments.length>1){t={},o(r,e);return}return t=r===void 0?{}:r,o}var Nu,ws,se,Qf,Ky=y(()=>{l();c();d();Pn();Ci();ys();Nu=Object.freeze({locate:zf()}),ws={toView(r){return r?"true":"false"},fromView(r){return!(r==null||r==="false"||r===!1||r===0)}},se={toView(r){if(r==null)return null;let e=r*1;return isNaN(e)?null:e.toString()},fromView(r){if(r==null)return null;let e=r*1;return isNaN(e)?null:e}},Qf=class r{constructor(e,t,o=t.toLowerCase(),i="reflect",n){this.guards=new Set,this.Owner=e,this.name=t,this.attribute=o,this.mode=i,this.converter=n,this.fieldName=`_${t}`,this.callbackName=`${t}Changed`,this.hasCallback=this.callbackName in e.prototype,i==="boolean"&&n===void 0&&(this.converter=ws)}setValue(e,t){let o=e[this.fieldName],i=this.converter;i!==void 0&&(t=i.fromView(t)),o!==t&&(e[this.fieldName]=t,this.tryReflectToAttribute(e),this.hasCallback&&e[this.callbackName](o,t),e.$fastController.notify(this.name))}getValue(e){return pe.track(e,this.name),e[this.fieldName]}onAttributeChangedCallback(e,t){this.guards.has(e)||(this.guards.add(e),this.setValue(e,t),this.guards.delete(e))}tryReflectToAttribute(e){let t=this.mode,o=this.guards;o.has(e)||t==="fromView"||Y.queueUpdate(()=>{o.add(e);let i=e[this.fieldName];switch(t){case"reflect":let n=this.converter;Y.setAttribute(e,this.attribute,n!==void 0?n.toView(i):i);break;case"boolean":Y.setBooleanAttribute(e,this.attribute,i);break}o.delete(e)})}static collect(e,...t){let o=[];t.push(Nu.locate(e));for(let i=0,n=t.length;i{l();c();d();ys();Pn();Wf();Ky();uT={mode:"open"},hT={},Wy=kl.getById(4,()=>{let r=new Map;return Object.freeze({register(e){return r.has(e.type)?!1:(r.set(e.type,e),!0)},getByType(e){return r.get(e)}})}),$n=class{constructor(e,t=e.definition){typeof t=="string"&&(t={name:t}),this.type=e,this.name=t.name,this.template=t.template;let o=Qf.collect(e,t.attributes),i=new Array(o.length),n={},s={};for(let a=0,u=o.length;a{l();c();d();Ci();Lu();Pn();Yf();pT=new WeakMap,W9={bubbles:!0,composed:!0,cancelable:!0};Zf=class r extends Dc{constructor(e,t){super(e),this.boundObservables=null,this.behaviors=null,this.needsInitialization=!0,this._template=null,this._styles=null,this._isConnected=!1,this.$fastController=this,this.view=null,this.element=e,this.definition=t;let o=t.shadowOptions;if(o!==void 0){let n=e.attachShadow(o);o.mode==="closed"&&pT.set(e,n)}let i=pe.getAccessors(e);if(i.length>0){let n=this.boundObservables=Object.create(null);for(let s=0,a=i.length;s{l();c();d();Yy();Yf();da=Object.assign(fT(HTMLElement),{from(r){return fT(r)},define(r,e){return new $n(r,e).define().type}})});var ua,Zy=y(()=>{l();c();d();ua=class{createCSS(){return""}createBehavior(){}}});function gT(r,e){let t=[],o="",i=[];for(let n=0,s=r.length-1;n{l();c();d();Zy();Wf();Jy=class extends ua{constructor(e,t){super(),this.behaviors=t,this.css="";let o=e.reduce((i,n)=>(typeof n=="string"?this.css+=n:i.push(n),i),[]);o.length&&(this.styles=nr.create(o))}createBehavior(){return this}createCSS(){return this.css}bind(e){this.styles&&e.$fastController.addStyles(this.styles),this.behaviors.length&&e.$fastController.addBehaviors(this.behaviors)}unbind(e){this.styles&&e.$fastController.removeStyles(this.styles),this.behaviors.length&&e.$fastController.removeBehaviors(this.behaviors)}}});function xi(r,e,t){return{index:r,removed:e,addedCount:t}}function Q9(r,e,t,o,i,n){let s=n-i+1,a=t-e+1,u=new Array(s),h,p;for(let f=0;f0||t>0;){if(e===0){i.push(Xy),t--;continue}if(t===0){i.push(eb),e--;continue}let n=r[e-1][t-1],s=r[e-1][t],a=r[e][t-1],u;s=0){r.splice(a,1),a--,s-=u.addedCount-u.removed.length,i.addedCount+=u.addedCount-h;let p=i.removed.length+u.removed.length-h;if(!i.addedCount&&!p)n=!0;else{let f=u.removed;if(i.indexu.index+u.addedCount){let b=i.removed.slice(u.index+u.addedCount-i.index);yT.apply(f,b)}i.removed=f,u.index{l();c();d();ys();bT=0,wT=1,Xy=2,eb=3;yT=Array.prototype.push});function ob(r,e){let t=r.index,o=e.length;return t>o?t=o-r.addedCount:t<0&&(t=o+r.removed.length+t-r.addedCount),t<0&&(t=0),r.index=t,r}function nb(){if(xT)return;xT=!0,pe.setArrayObserverFactory(u=>new ib(u));let r=Array.prototype;if(r.$fastPatch)return;Reflect.defineProperty(r,"$fastPatch",{value:1,enumerable:!1});let e=r.pop,t=r.push,o=r.reverse,i=r.shift,n=r.sort,s=r.splice,a=r.unshift;r.pop=function(){let u=this.length>0,h=e.apply(this,arguments),p=this.$fastController;return p!==void 0&&u&&p.addSplice(xi(this.length,[h],0)),h},r.push=function(){let u=t.apply(this,arguments),h=this.$fastController;return h!==void 0&&h.addSplice(ob(xi(this.length-arguments.length,[],arguments.length),this)),u},r.reverse=function(){let u,h=this.$fastController;h!==void 0&&(h.flush(),u=this.slice());let p=o.apply(this,arguments);return h!==void 0&&h.reset(u),p},r.shift=function(){let u=this.length>0,h=i.apply(this,arguments),p=this.$fastController;return p!==void 0&&u&&p.addSplice(xi(0,[h],0)),h},r.sort=function(){let u,h=this.$fastController;h!==void 0&&(h.flush(),u=this.slice());let p=n.apply(this,arguments);return h!==void 0&&h.reset(u),p},r.splice=function(){let u=s.apply(this,arguments),h=this.$fastController;return h!==void 0&&h.addSplice(ob(xi(+arguments[0],u,arguments.length>2?arguments.length-2:0),this)),u},r.unshift=function(){let u=a.apply(this,arguments),h=this.$fastController;return h!==void 0&&h.addSplice(ob(xi(0,[],arguments.length),this)),u}}var xT,ib,sb=y(()=>{l();c();d();Ci();rb();Lu();Pn();xT=!1;ib=class extends Rn{constructor(e){super(e),this.oldCollection=void 0,this.splices=void 0,this.needsQueue=!0,this.call=this.flush,Reflect.defineProperty(e,"$fastController",{value:this,enumerable:!1})}subscribe(e){this.flush(),super.subscribe(e)}addSplice(e){this.splices===void 0?this.splices=[e]:this.splices.push(e),this.needsQueue&&(this.needsQueue=!1,Y.queueUpdate(this))}reset(e){this.oldCollection=e,this.needsQueue&&(this.needsQueue=!1,Y.queueUpdate(this))}flush(){let e=this.splices,t=this.oldCollection;if(e===void 0&&t===void 0)return;this.needsQueue=!0,this.splices=void 0,this.oldCollection=void 0;let o=t===void 0?CT(this.source,e):tb(this.source,0,this.source.length,t,0,t.length);this.notify(o)}}});function Ee(r){return new bs("fast-ref",ab,r)}var ab,kT=y(()=>{l();c();d();ca();ab=class{constructor(e,t){this.target=e,this.propertyName=t}bind(e){e[this.propertyName]=this.target}unbind(){}}});var lb,ST=y(()=>{l();c();d();lb=r=>typeof r=="function"});function _T(r){return r===void 0?rM:lb(r)?r:()=>r}function Ze(r,e,t){let o=lb(r)?r:()=>r,i=_T(e),n=_T(t);return(s,a)=>o(s,a)?i(s,a):n(s,a)}var rM,TT=y(()=>{l();c();d();ST();rM=()=>null});function oM(r,e,t,o){r.bind(e[t],o)}function iM(r,e,t,o){let i=Object.create(o);i.index=t,i.length=e.length,r.bind(e[t],i)}function _l(r,e,t=ET){let o=typeof e=="function"?e:()=>e;return new On(r,o,Object.assign(Object.assign({},ET),t))}var ET,cb,On,IT=y(()=>{l();c();d();Ci();Pn();sb();ys();ca();Gf();ET=Object.freeze({positioning:!1,recycle:!0});cb=class{constructor(e,t,o,i,n,s){this.location=e,this.itemsBinding=t,this.templateBinding=i,this.options=s,this.source=null,this.views=[],this.items=null,this.itemsObserver=null,this.originalContext=void 0,this.childContext=void 0,this.bindView=oM,this.itemsBindingObserver=pe.binding(t,this,o),this.templateBindingObserver=pe.binding(i,this,n),s.positioning&&(this.bindView=iM)}bind(e,t){this.source=e,this.originalContext=t,this.childContext=Object.create(t),this.childContext.parent=e,this.childContext.parentContext=this.originalContext,this.items=this.itemsBindingObserver.observe(e,this.originalContext),this.template=this.templateBindingObserver.observe(e,this.originalContext),this.observeItems(!0),this.refreshAllViews()}unbind(){this.source=null,this.items=null,this.itemsObserver!==null&&this.itemsObserver.unsubscribe(this),this.unbindAllViews(),this.itemsBindingObserver.disconnect(),this.templateBindingObserver.disconnect()}handleChange(e,t){e===this.itemsBinding?(this.items=this.itemsBindingObserver.observe(this.source,this.originalContext),this.observeItems(),this.refreshAllViews()):e===this.templateBinding?(this.template=this.templateBindingObserver.observe(this.source,this.originalContext),this.refreshAllViews(!0)):this.updateViews(t)}observeItems(e=!1){if(!this.items){this.items=wi;return}let t=this.itemsObserver,o=this.itemsObserver=pe.getNotifier(this.items),i=t!==o;i&&t!==null&&t.unsubscribe(this),(i||e)&&o.subscribe(this)}updateViews(e){let t=this.childContext,o=this.views,i=this.bindView,n=this.items,s=this.template,a=this.options.recycle,u=[],h=0,p=0;for(let f=0,b=e.length;f0?(R<=me&&ie.length>0?(tt=ie[R],R++):(tt=u[h],h++),p--):tt=s.create(),o.splice(H,0,tt),i(tt,n,H,t),tt.insertBefore(Ge)}ie[R]&&u.push(...ie.slice(R))}for(let f=h,b=u.length;f{l();c();d();Pn();ys();Nc=class{constructor(e,t){this.target=e,this.options=t,this.source=null}bind(e){let t=this.options.property;this.shouldUpdate=pe.getAccessors(e).some(o=>o.name===t),this.source=e,this.updateTarget(this.computeNodes()),this.shouldUpdate&&this.observe()}unbind(){this.updateTarget(wi),this.source=null,this.shouldUpdate&&this.disconnect()}handleEvent(){this.updateTarget(this.computeNodes())}computeNodes(){let e=this.getNodes();return this.options.filter!==void 0&&(e=e.filter(this.options.filter)),e}updateTarget(e){this.source[this.options.property]=e}}});function Fe(r){return typeof r=="string"&&(r={property:r}),new bs("fast-slotted",db,r)}var db,AT=y(()=>{l();c();d();ca();Jf();db=class extends Nc{constructor(e,t){super(e,t)}observe(){this.target.addEventListener("slotchange",this)}disconnect(){this.target.removeEventListener("slotchange",this)}getNodes(){return this.target.assignedNodes(this.options)}}});function ha(r){return typeof r=="string"&&(r={property:r}),new bs("fast-children",ub,r)}var ub,RT=y(()=>{l();c();d();ca();Jf();ub=class extends Nc{constructor(e,t){super(e,t),this.observer=null,t.childList=!0}observe(){this.observer===null&&(this.observer=new MutationObserver(this.handleEvent.bind(this))),this.observer.observe(this.target,this.options)}disconnect(){this.observer.disconnect()}getNodes(){return"subtree"in this.options?Array.from(this.target.querySelectorAll(this.options.selector)):Array.from(this.target.childNodes)}}});var A=y(()=>{l();c();d();ys();sT();mT();Yf();Ky();Yy();zy();Wf();vT();Zy();Gf();Pn();Lu();rb();sb();Ci();qf();ca();kT();TT();IT();AT();RT();Jf()});var _t,wt,Ct,PT,$T,$t=y(()=>{l();c();d();A();_t=class{handleStartContentChange(){this.startContainer.classList.toggle("start",this.start.assignedNodes().length>0)}handleEndContentChange(){this.endContainer.classList.toggle("end",this.end.assignedNodes().length>0)}},wt=(r,e)=>O` -`});var T2=y(()=>{l();c();d();k2();Gb();_2()});function $l(r){let e=r.parentElement;if(e)return e;{let t=r.getRootNode();if(t.host instanceof HTMLElement)return t.host}return null}var vm=y(()=>{l();c();d()});function jb(r,e){let t=e;for(;t!==null;){if(t===r)return!0;t=$l(t)}return!1}var Kb=y(()=>{l();c();d();vm()});function EM(r){return r instanceof da}var Dn,Qu,Qb,Yb,Zb,ym,Jb,Ca,Wb,IM,Ol,Xb=y(()=>{l();c();d();Pe();A();Dn=document.createElement("div");Qu=class{setProperty(e,t){Y.queueUpdate(()=>this.target.setProperty(e,t))}removeProperty(e){Y.queueUpdate(()=>this.target.removeProperty(e))}},Qb=class extends Qu{constructor(e){super();let t=new CSSStyleSheet;t[Kf]=!0,this.target=t.cssRules[t.insertRule(":host{}")].style,e.$fastController.addStyles(nr.create([t]))}},Yb=class extends Qu{constructor(){super();let e=new CSSStyleSheet;this.target=e.cssRules[e.insertRule(":root{}")].style,document.adoptedStyleSheets=[...document.adoptedStyleSheets,e]}},Zb=class extends Qu{constructor(){super(),this.style=document.createElement("style"),document.head.appendChild(this.style);let{sheet:e}=this.style;if(e){let t=e.insertRule(":root{}",e.cssRules.length);this.target=e.cssRules[t].style}}},ym=class{constructor(e){this.store=new Map,this.target=null;let t=e.$fastController;this.style=document.createElement("style"),t.addStyles(this.style),pe.getNotifier(t).subscribe(this,"isConnected"),this.handleChange(t,"isConnected")}targetChanged(){if(this.target!==null)for(let[e,t]of this.store.entries())this.target.setProperty(e,t)}setProperty(e,t){this.store.set(e,t),Y.queueUpdate(()=>{this.target!==null&&this.target.setProperty(e,t)})}removeProperty(e){this.store.delete(e),Y.queueUpdate(()=>{this.target!==null&&this.target.removeProperty(e)})}handleChange(e,t){let{sheet:o}=this.style;if(o){let i=o.insertRule(":host{}",o.cssRules.length);this.target=o.cssRules[i].style}else this.target=null}};w([I],ym.prototype,"target",void 0);Jb=class{constructor(e){this.target=e.style}setProperty(e,t){Y.queueUpdate(()=>this.target.setProperty(e,t))}removeProperty(e){Y.queueUpdate(()=>this.target.removeProperty(e))}},Ca=class r{setProperty(e,t){r.properties[e]=t;for(let o of r.roots.values())Ol.getOrCreate(r.normalizeRoot(o)).setProperty(e,t)}removeProperty(e){delete r.properties[e];for(let t of r.roots.values())Ol.getOrCreate(r.normalizeRoot(t)).removeProperty(e)}static registerRoot(e){let{roots:t}=r;if(!t.has(e)){t.add(e);let o=Ol.getOrCreate(this.normalizeRoot(e));for(let i in r.properties)o.setProperty(i,r.properties[i])}}static unregisterRoot(e){let{roots:t}=r;if(t.has(e)){t.delete(e);let o=Ol.getOrCreate(r.normalizeRoot(e));for(let i in r.properties)o.removeProperty(i)}}static normalizeRoot(e){return e===Dn?document:e}};Ca.roots=new Set;Ca.properties={};Wb=new WeakMap,IM=Y.supportsAdoptedStyleSheets?Qb:ym,Ol=Object.freeze({getOrCreate(r){if(Wb.has(r))return Wb.get(r);let e;return r===Dn?e=new Ca:r instanceof Document?e=Y.supportsAdoptedStyleSheets?new Yb:new Zb:EM(r)?e=new IM(r):e=new Jb(r),Wb.set(r,e),e}})});function AM(r){return on.from(r)}var on,e1,t1,r1,Yu,Zu,Ro,Je,o1=y(()=>{l();c();d();Pe();A();vm();Kb();Xb();Xb();on=class r extends ua{constructor(e){super(),this.subscribers=new WeakMap,this._appliedTo=new Set,this.name=e.name,e.cssCustomPropertyName!==null&&(this.cssCustomProperty=`--${e.cssCustomPropertyName}`,this.cssVar=`var(${this.cssCustomProperty})`),this.id=r.uniqueId(),r.tokensById.set(this.id,this)}get appliedTo(){return[...this._appliedTo]}static from(e){return new r({name:typeof e=="string"?e:e.name,cssCustomPropertyName:typeof e=="string"?e:e.cssCustomPropertyName===void 0?e.name:e.cssCustomPropertyName})}static isCSSDesignToken(e){return typeof e.cssCustomProperty=="string"}static isDerivedDesignTokenValue(e){return typeof e=="function"}static getTokenById(e){return r.tokensById.get(e)}getOrCreateSubscriberSet(e=this){return this.subscribers.get(e)||this.subscribers.set(e,new Set)&&this.subscribers.get(e)}createCSS(){return this.cssVar||""}getValueFor(e){let t=Ro.getOrCreate(e).get(this);if(t!==void 0)return t;throw new Error(`Value could not be retrieved for token named "${this.name}". Ensure the value is set for ${e} or an ancestor of ${e}.`)}setValueFor(e,t){return this._appliedTo.add(e),t instanceof r&&(t=this.alias(t)),Ro.getOrCreate(e).set(this,t),this}deleteValueFor(e){return this._appliedTo.delete(e),Ro.existsFor(e)&&Ro.getOrCreate(e).delete(this),this}withDefault(e){return this.setValueFor(Dn,e),this}subscribe(e,t){let o=this.getOrCreateSubscriberSet(t);t&&!Ro.existsFor(t)&&Ro.getOrCreate(t),o.has(e)||o.add(e)}unsubscribe(e,t){let o=this.subscribers.get(t||this);o&&o.has(e)&&o.delete(e)}notify(e){let t=Object.freeze({token:this,target:e});this.subscribers.has(this)&&this.subscribers.get(this).forEach(o=>o.handleChange(t)),this.subscribers.has(e)&&this.subscribers.get(e).forEach(o=>o.handleChange(t))}alias(e){return t=>e.getValueFor(t)}};on.uniqueId=(()=>{let r=0;return()=>(r++,r.toString(16))})();on.tokensById=new Map;e1=class{startReflection(e,t){e.subscribe(this,t),this.handleChange({token:e,target:t})}stopReflection(e,t){e.unsubscribe(this,t),this.remove(e,t)}handleChange(e){let{token:t,target:o}=e;this.add(t,o)}add(e,t){Ol.getOrCreate(t).setProperty(e.cssCustomProperty,this.resolveCSSValue(Ro.getOrCreate(t).get(e)))}remove(e,t){Ol.getOrCreate(t).removeProperty(e.cssCustomProperty)}resolveCSSValue(e){return e&&typeof e.createCSS=="function"?e.createCSS():e}},t1=class{constructor(e,t,o){this.source=e,this.token=t,this.node=o,this.dependencies=new Set,this.observer=pe.binding(e,this,!1),this.observer.handleChange=this.observer.call,this.handleChange()}disconnect(){this.observer.disconnect()}handleChange(){this.node.store.set(this.token,this.observer.observe(this.node.target,aa))}},r1=class{constructor(){this.values=new Map}set(e,t){this.values.get(e)!==t&&(this.values.set(e,t),pe.getNotifier(this).notify(e.id))}get(e){return pe.track(this,e.id),this.values.get(e)}delete(e){this.values.delete(e)}all(){return this.values.entries()}},Yu=new WeakMap,Zu=new WeakMap,Ro=class r{constructor(e){this.target=e,this.store=new r1,this.children=[],this.assignedValues=new Map,this.reflecting=new Set,this.bindingObservers=new Map,this.tokenValueChangeHandler={handleChange:(t,o)=>{let i=on.getTokenById(o);i&&(i.notify(this.target),this.updateCSSTokenReflection(t,i))}},Yu.set(e,this),pe.getNotifier(this.store).subscribe(this.tokenValueChangeHandler),e instanceof da?e.$fastController.addBehaviors([this]):e.isConnected&&this.bind()}static getOrCreate(e){return Yu.get(e)||new r(e)}static existsFor(e){return Yu.has(e)}static findParent(e){if(Dn!==e.target){let t=$l(e.target);for(;t!==null;){if(Yu.has(t))return Yu.get(t);t=$l(t)}return r.getOrCreate(Dn)}return null}static findClosestAssignedNode(e,t){let o=t;do{if(o.has(e))return o;o=o.parent?o.parent:o.target!==Dn?r.getOrCreate(Dn):null}while(o!==null);return null}get parent(){return Zu.get(this)||null}updateCSSTokenReflection(e,t){if(on.isCSSDesignToken(t)){let o=this.parent,i=this.isReflecting(t);if(o){let n=o.get(t),s=e.get(t);n!==s&&!i?this.reflectToCSS(t):n===s&&i&&this.stopReflectToCSS(t)}else i||this.reflectToCSS(t)}}has(e){return this.assignedValues.has(e)}get(e){let t=this.store.get(e);if(t!==void 0)return t;let o=this.getRaw(e);if(o!==void 0)return this.hydrate(e,o),this.get(e)}getRaw(e){var t;return this.assignedValues.has(e)?this.assignedValues.get(e):(t=r.findClosestAssignedNode(e,this))===null||t===void 0?void 0:t.getRaw(e)}set(e,t){on.isDerivedDesignTokenValue(this.assignedValues.get(e))&&this.tearDownBindingObserver(e),this.assignedValues.set(e,t),on.isDerivedDesignTokenValue(t)?this.setupBindingObserver(e,t):this.store.set(e,t)}delete(e){this.assignedValues.delete(e),this.tearDownBindingObserver(e);let t=this.getRaw(e);t?this.hydrate(e,t):this.store.delete(e)}bind(){let e=r.findParent(this);e&&e.appendChild(this);for(let t of this.assignedValues.keys())t.notify(this.target)}unbind(){this.parent&&Zu.get(this).removeChild(this)}appendChild(e){e.parent&&Zu.get(e).removeChild(e);let t=this.children.filter(o=>e.contains(o));Zu.set(e,this),this.children.push(e),t.forEach(o=>e.appendChild(o)),pe.getNotifier(this.store).subscribe(e);for(let[o,i]of this.store.all())e.hydrate(o,this.bindingObservers.has(o)?this.getRaw(o):i)}removeChild(e){let t=this.children.indexOf(e);return t!==-1&&this.children.splice(t,1),pe.getNotifier(this.store).unsubscribe(e),e.parent===this?Zu.delete(e):!1}contains(e){return jb(this.target,e.target)}reflectToCSS(e){this.isReflecting(e)||(this.reflecting.add(e),r.cssCustomPropertyReflector.startReflection(e,this.target))}stopReflectToCSS(e){this.isReflecting(e)&&(this.reflecting.delete(e),r.cssCustomPropertyReflector.stopReflection(e,this.target))}isReflecting(e){return this.reflecting.has(e)}handleChange(e,t){let o=on.getTokenById(t);o&&(this.hydrate(o,this.getRaw(o)),this.updateCSSTokenReflection(this.store,o))}hydrate(e,t){if(!this.has(e)){let o=this.bindingObservers.get(e);on.isDerivedDesignTokenValue(t)?o?o.source!==t&&(this.tearDownBindingObserver(e),this.setupBindingObserver(e,t)):this.setupBindingObserver(e,t):(o&&this.tearDownBindingObserver(e),this.store.set(e,t))}}setupBindingObserver(e,t){let o=new t1(t,e,this);return this.bindingObservers.set(e,o),o}tearDownBindingObserver(e){return this.bindingObservers.has(e)?(this.bindingObservers.get(e).disconnect(),this.bindingObservers.delete(e),!0):!1}};Ro.cssCustomPropertyReflector=new e1;w([I],Ro.prototype,"children",void 0);Je=Object.freeze({create:AM,notifyConnection(r){return!r.isConnected||!Ro.existsFor(r)?!1:(Ro.getOrCreate(r).bind(),!0)},notifyDisconnection(r){return r.isConnected||!Ro.existsFor(r)?!1:(Ro.getOrCreate(r).unbind(),!0)},registerRoot(r=Dn){Ca.registerRoot(r)},unregisterRoot(r=Dn){Ca.unregisterRoot(r)}})});function RM(r,e,t){return typeof r=="string"?{name:r,type:e,callback:t}:r}var i1,n1,bm,jc,Ju,a1,wm,s1,E2=y(()=>{l();c();d();A();He();om();o1();am();i1=Object.freeze({definitionCallbackOnly:null,ignoreDuplicate:Symbol()}),n1=new Map,bm=new Map,jc=null,Ju=At.createInterface(r=>r.cachedCallback(e=>(jc===null&&(jc=new wm(null,e)),jc))),a1=Object.freeze({tagFor(r){return bm.get(r)},responsibleFor(r){let e=r.$$designSystem$$;return e||At.findResponsibleContainer(r).get(Ju)},getOrCreate(r){if(!r)return jc===null&&(jc=At.getOrCreateDOMContainer().get(Ju)),jc;let e=r.$$designSystem$$;if(e)return e;let t=At.getOrCreateDOMContainer(r);if(t.has(Ju,!1))return t.get(Ju);{let o=new wm(r,t);return t.register(Tl.instance(Ju,o)),o}}});wm=class{constructor(e,t){this.owner=e,this.container=t,this.designTokensInitialized=!1,this.prefix="fast",this.shadowRootMode=void 0,this.disambiguate=()=>i1.definitionCallbackOnly,e!==null&&(e.$$designSystem$$=this)}withPrefix(e){return this.prefix=e,this}withShadowRootMode(e){return this.shadowRootMode=e,this}withElementDisambiguation(e){return this.disambiguate=e,this}withDesignTokenRoot(e){return this.designTokenRoot=e,this}register(...e){let t=this.container,o=[],i=this.disambiguate,n=this.shadowRootMode,s={elementPrefix:this.prefix,tryDefineElement(a,u,h){let p=RM(a,u,h),{name:f,callback:b,baseClass:C}=p,{type:S}=p,R=f,H=n1.get(R),ye=!0;for(;H;){let oe=i(R,S,H);switch(oe){case i1.ignoreDuplicate:return;case i1.definitionCallbackOnly:ye=!1,H=void 0;break;default:R=oe,H=n1.get(R);break}}ye&&((bm.has(S)||S===G)&&(S=class extends S{}),n1.set(R,S),bm.set(S,R),C&&bm.set(C,R)),o.push(new s1(t,R,S,n,b,ye))}};this.designTokensInitialized||(this.designTokensInitialized=!0,this.designTokenRoot!==null&&Je.registerRoot(this.designTokenRoot)),t.registerWithContext(s,...e);for(let a of o)a.callback(a),a.willDefine&&a.definition!==null&&a.definition.define();return this}},s1=class{constructor(e,t,o,i,n,s){this.container=e,this.name=t,this.type=o,this.shadowRootMode=i,this.callback=n,this.willDefine=s,this.definition=null}definePresentation(e){sm.define(this.name,e,this.container)}defineElement(e){this.definition=new $n(this.type,Object.assign(Object.assign({},e),{name:this.name}))}tagFor(e){return a1.tagFor(e)}}});var I2=y(()=>{l();c();d()});var A2=y(()=>{l();c();d();E2();am();I2()});var R2=y(()=>{l();c();d()});var P2=y(()=>{l();c();d();om()});var $2,O2=y(()=>{l();c();d();A();$2=(r,e)=>O` +`});var T2=y(()=>{l();c();d();k2();Gb();_2()});function $l(r){let e=r.parentElement;if(e)return e;{let t=r.getRootNode();if(t.host instanceof HTMLElement)return t.host}return null}var vm=y(()=>{l();c();d()});function jb(r,e){let t=e;for(;t!==null;){if(t===r)return!0;t=$l(t)}return!1}var Kb=y(()=>{l();c();d();vm()});function EM(r){return r instanceof da}var Dn,Qu,Qb,Yb,Zb,ym,Jb,Ca,Wb,IM,Ol,Xb=y(()=>{l();c();d();Pe();A();Dn=document.createElement("div");Qu=class{setProperty(e,t){Y.queueUpdate(()=>this.target.setProperty(e,t))}removeProperty(e){Y.queueUpdate(()=>this.target.removeProperty(e))}},Qb=class extends Qu{constructor(e){super();let t=new CSSStyleSheet;t[Kf]=!0,this.target=t.cssRules[t.insertRule(":host{}")].style,e.$fastController.addStyles(nr.create([t]))}},Yb=class extends Qu{constructor(){super();let e=new CSSStyleSheet;this.target=e.cssRules[e.insertRule(":root{}")].style,document.adoptedStyleSheets=[...document.adoptedStyleSheets,e]}},Zb=class extends Qu{constructor(){super(),this.style=document.createElement("style"),document.head.appendChild(this.style);let{sheet:e}=this.style;if(e){let t=e.insertRule(":root{}",e.cssRules.length);this.target=e.cssRules[t].style}}},ym=class{constructor(e){this.store=new Map,this.target=null;let t=e.$fastController;this.style=document.createElement("style"),t.addStyles(this.style),pe.getNotifier(t).subscribe(this,"isConnected"),this.handleChange(t,"isConnected")}targetChanged(){if(this.target!==null)for(let[e,t]of this.store.entries())this.target.setProperty(e,t)}setProperty(e,t){this.store.set(e,t),Y.queueUpdate(()=>{this.target!==null&&this.target.setProperty(e,t)})}removeProperty(e){this.store.delete(e),Y.queueUpdate(()=>{this.target!==null&&this.target.removeProperty(e)})}handleChange(e,t){let{sheet:o}=this.style;if(o){let i=o.insertRule(":host{}",o.cssRules.length);this.target=o.cssRules[i].style}else this.target=null}};w([I],ym.prototype,"target",void 0);Jb=class{constructor(e){this.target=e.style}setProperty(e,t){Y.queueUpdate(()=>this.target.setProperty(e,t))}removeProperty(e){Y.queueUpdate(()=>this.target.removeProperty(e))}},Ca=class r{setProperty(e,t){r.properties[e]=t;for(let o of r.roots.values())Ol.getOrCreate(r.normalizeRoot(o)).setProperty(e,t)}removeProperty(e){delete r.properties[e];for(let t of r.roots.values())Ol.getOrCreate(r.normalizeRoot(t)).removeProperty(e)}static registerRoot(e){let{roots:t}=r;if(!t.has(e)){t.add(e);let o=Ol.getOrCreate(this.normalizeRoot(e));for(let i in r.properties)o.setProperty(i,r.properties[i])}}static unregisterRoot(e){let{roots:t}=r;if(t.has(e)){t.delete(e);let o=Ol.getOrCreate(r.normalizeRoot(e));for(let i in r.properties)o.removeProperty(i)}}static normalizeRoot(e){return e===Dn?document:e}};Ca.roots=new Set;Ca.properties={};Wb=new WeakMap,IM=Y.supportsAdoptedStyleSheets?Qb:ym,Ol=Object.freeze({getOrCreate(r){if(Wb.has(r))return Wb.get(r);let e;return r===Dn?e=new Ca:r instanceof Document?e=Y.supportsAdoptedStyleSheets?new Yb:new Zb:EM(r)?e=new IM(r):e=new Jb(r),Wb.set(r,e),e}})});function AM(r){return on.from(r)}var on,e1,t1,r1,Yu,Zu,Ro,Je,o1=y(()=>{l();c();d();Pe();A();vm();Kb();Xb();Xb();on=class r extends ua{constructor(e){super(),this.subscribers=new WeakMap,this._appliedTo=new Set,this.name=e.name,e.cssCustomPropertyName!==null&&(this.cssCustomProperty=`--${e.cssCustomPropertyName}`,this.cssVar=`var(${this.cssCustomProperty})`),this.id=r.uniqueId(),r.tokensById.set(this.id,this)}get appliedTo(){return[...this._appliedTo]}static from(e){return new r({name:typeof e=="string"?e:e.name,cssCustomPropertyName:typeof e=="string"?e:e.cssCustomPropertyName===void 0?e.name:e.cssCustomPropertyName})}static isCSSDesignToken(e){return typeof e.cssCustomProperty=="string"}static isDerivedDesignTokenValue(e){return typeof e=="function"}static getTokenById(e){return r.tokensById.get(e)}getOrCreateSubscriberSet(e=this){return this.subscribers.get(e)||this.subscribers.set(e,new Set)&&this.subscribers.get(e)}createCSS(){return this.cssVar||""}getValueFor(e){let t=Ro.getOrCreate(e).get(this);if(t!==void 0)return t;throw new Error(`Value could not be retrieved for token named "${this.name}". Ensure the value is set for ${e} or an ancestor of ${e}.`)}setValueFor(e,t){return this._appliedTo.add(e),t instanceof r&&(t=this.alias(t)),Ro.getOrCreate(e).set(this,t),this}deleteValueFor(e){return this._appliedTo.delete(e),Ro.existsFor(e)&&Ro.getOrCreate(e).delete(this),this}withDefault(e){return this.setValueFor(Dn,e),this}subscribe(e,t){let o=this.getOrCreateSubscriberSet(t);t&&!Ro.existsFor(t)&&Ro.getOrCreate(t),o.has(e)||o.add(e)}unsubscribe(e,t){let o=this.subscribers.get(t||this);o&&o.has(e)&&o.delete(e)}notify(e){let t=Object.freeze({token:this,target:e});this.subscribers.has(this)&&this.subscribers.get(this).forEach(o=>o.handleChange(t)),this.subscribers.has(e)&&this.subscribers.get(e).forEach(o=>o.handleChange(t))}alias(e){return t=>e.getValueFor(t)}};on.uniqueId=(()=>{let r=0;return()=>(r++,r.toString(16))})();on.tokensById=new Map;e1=class{startReflection(e,t){e.subscribe(this,t),this.handleChange({token:e,target:t})}stopReflection(e,t){e.unsubscribe(this,t),this.remove(e,t)}handleChange(e){let{token:t,target:o}=e;this.add(t,o)}add(e,t){Ol.getOrCreate(t).setProperty(e.cssCustomProperty,this.resolveCSSValue(Ro.getOrCreate(t).get(e)))}remove(e,t){Ol.getOrCreate(t).removeProperty(e.cssCustomProperty)}resolveCSSValue(e){return e&&typeof e.createCSS=="function"?e.createCSS():e}},t1=class{constructor(e,t,o){this.source=e,this.token=t,this.node=o,this.dependencies=new Set,this.observer=pe.binding(e,this,!1),this.observer.handleChange=this.observer.call,this.handleChange()}disconnect(){this.observer.disconnect()}handleChange(){this.node.store.set(this.token,this.observer.observe(this.node.target,aa))}},r1=class{constructor(){this.values=new Map}set(e,t){this.values.get(e)!==t&&(this.values.set(e,t),pe.getNotifier(this).notify(e.id))}get(e){return pe.track(this,e.id),this.values.get(e)}delete(e){this.values.delete(e)}all(){return this.values.entries()}},Yu=new WeakMap,Zu=new WeakMap,Ro=class r{constructor(e){this.target=e,this.store=new r1,this.children=[],this.assignedValues=new Map,this.reflecting=new Set,this.bindingObservers=new Map,this.tokenValueChangeHandler={handleChange:(t,o)=>{let i=on.getTokenById(o);i&&(i.notify(this.target),this.updateCSSTokenReflection(t,i))}},Yu.set(e,this),pe.getNotifier(this.store).subscribe(this.tokenValueChangeHandler),e instanceof da?e.$fastController.addBehaviors([this]):e.isConnected&&this.bind()}static getOrCreate(e){return Yu.get(e)||new r(e)}static existsFor(e){return Yu.has(e)}static findParent(e){if(Dn!==e.target){let t=$l(e.target);for(;t!==null;){if(Yu.has(t))return Yu.get(t);t=$l(t)}return r.getOrCreate(Dn)}return null}static findClosestAssignedNode(e,t){let o=t;do{if(o.has(e))return o;o=o.parent?o.parent:o.target!==Dn?r.getOrCreate(Dn):null}while(o!==null);return null}get parent(){return Zu.get(this)||null}updateCSSTokenReflection(e,t){if(on.isCSSDesignToken(t)){let o=this.parent,i=this.isReflecting(t);if(o){let n=o.get(t),s=e.get(t);n!==s&&!i?this.reflectToCSS(t):n===s&&i&&this.stopReflectToCSS(t)}else i||this.reflectToCSS(t)}}has(e){return this.assignedValues.has(e)}get(e){let t=this.store.get(e);if(t!==void 0)return t;let o=this.getRaw(e);if(o!==void 0)return this.hydrate(e,o),this.get(e)}getRaw(e){var t;return this.assignedValues.has(e)?this.assignedValues.get(e):(t=r.findClosestAssignedNode(e,this))===null||t===void 0?void 0:t.getRaw(e)}set(e,t){on.isDerivedDesignTokenValue(this.assignedValues.get(e))&&this.tearDownBindingObserver(e),this.assignedValues.set(e,t),on.isDerivedDesignTokenValue(t)?this.setupBindingObserver(e,t):this.store.set(e,t)}delete(e){this.assignedValues.delete(e),this.tearDownBindingObserver(e);let t=this.getRaw(e);t?this.hydrate(e,t):this.store.delete(e)}bind(){let e=r.findParent(this);e&&e.appendChild(this);for(let t of this.assignedValues.keys())t.notify(this.target)}unbind(){this.parent&&Zu.get(this).removeChild(this)}appendChild(e){e.parent&&Zu.get(e).removeChild(e);let t=this.children.filter(o=>e.contains(o));Zu.set(e,this),this.children.push(e),t.forEach(o=>e.appendChild(o)),pe.getNotifier(this.store).subscribe(e);for(let[o,i]of this.store.all())e.hydrate(o,this.bindingObservers.has(o)?this.getRaw(o):i)}removeChild(e){let t=this.children.indexOf(e);return t!==-1&&this.children.splice(t,1),pe.getNotifier(this.store).unsubscribe(e),e.parent===this?Zu.delete(e):!1}contains(e){return jb(this.target,e.target)}reflectToCSS(e){this.isReflecting(e)||(this.reflecting.add(e),r.cssCustomPropertyReflector.startReflection(e,this.target))}stopReflectToCSS(e){this.isReflecting(e)&&(this.reflecting.delete(e),r.cssCustomPropertyReflector.stopReflection(e,this.target))}isReflecting(e){return this.reflecting.has(e)}handleChange(e,t){let o=on.getTokenById(t);o&&(this.hydrate(o,this.getRaw(o)),this.updateCSSTokenReflection(this.store,o))}hydrate(e,t){if(!this.has(e)){let o=this.bindingObservers.get(e);on.isDerivedDesignTokenValue(t)?o?o.source!==t&&(this.tearDownBindingObserver(e),this.setupBindingObserver(e,t)):this.setupBindingObserver(e,t):(o&&this.tearDownBindingObserver(e),this.store.set(e,t))}}setupBindingObserver(e,t){let o=new t1(t,e,this);return this.bindingObservers.set(e,o),o}tearDownBindingObserver(e){return this.bindingObservers.has(e)?(this.bindingObservers.get(e).disconnect(),this.bindingObservers.delete(e),!0):!1}};Ro.cssCustomPropertyReflector=new e1;w([I],Ro.prototype,"children",void 0);Je=Object.freeze({create:AM,notifyConnection(r){return!r.isConnected||!Ro.existsFor(r)?!1:(Ro.getOrCreate(r).bind(),!0)},notifyDisconnection(r){return r.isConnected||!Ro.existsFor(r)?!1:(Ro.getOrCreate(r).unbind(),!0)},registerRoot(r=Dn){Ca.registerRoot(r)},unregisterRoot(r=Dn){Ca.unregisterRoot(r)}})});function RM(r,e,t){return typeof r=="string"?{name:r,type:e,callback:t}:r}var i1,n1,bm,jc,Ju,a1,wm,s1,E2=y(()=>{l();c();d();A();He();om();o1();am();i1=Object.freeze({definitionCallbackOnly:null,ignoreDuplicate:Symbol()}),n1=new Map,bm=new Map,jc=null,Ju=At.createInterface(r=>r.cachedCallback(e=>(jc===null&&(jc=new wm(null,e)),jc))),a1=Object.freeze({tagFor(r){return bm.get(r)},responsibleFor(r){let e=r.$$designSystem$$;return e||At.findResponsibleContainer(r).get(Ju)},getOrCreate(r){if(!r)return jc===null&&(jc=At.getOrCreateDOMContainer().get(Ju)),jc;let e=r.$$designSystem$$;if(e)return e;let t=At.getOrCreateDOMContainer(r);if(t.has(Ju,!1))return t.get(Ju);{let o=new wm(r,t);return t.register(Tl.instance(Ju,o)),o}}});wm=class{constructor(e,t){this.owner=e,this.container=t,this.designTokensInitialized=!1,this.prefix="fast",this.shadowRootMode=void 0,this.disambiguate=()=>i1.definitionCallbackOnly,e!==null&&(e.$$designSystem$$=this)}withPrefix(e){return this.prefix=e,this}withShadowRootMode(e){return this.shadowRootMode=e,this}withElementDisambiguation(e){return this.disambiguate=e,this}withDesignTokenRoot(e){return this.designTokenRoot=e,this}register(...e){let t=this.container,o=[],i=this.disambiguate,n=this.shadowRootMode,s={elementPrefix:this.prefix,tryDefineElement(a,u,h){let p=RM(a,u,h),{name:f,callback:b,baseClass:C}=p,{type:S}=p,R=f,H=n1.get(R),ye=!0;for(;H;){let ie=i(R,S,H);switch(ie){case i1.ignoreDuplicate:return;case i1.definitionCallbackOnly:ye=!1,H=void 0;break;default:R=ie,H=n1.get(R);break}}ye&&((bm.has(S)||S===G)&&(S=class extends S{}),n1.set(R,S),bm.set(S,R),C&&bm.set(C,R)),o.push(new s1(t,R,S,n,b,ye))}};this.designTokensInitialized||(this.designTokensInitialized=!0,this.designTokenRoot!==null&&Je.registerRoot(this.designTokenRoot)),t.registerWithContext(s,...e);for(let a of o)a.callback(a),a.willDefine&&a.definition!==null&&a.definition.define();return this}},s1=class{constructor(e,t,o,i,n,s){this.container=e,this.name=t,this.type=o,this.shadowRootMode=i,this.callback=n,this.willDefine=s,this.definition=null}definePresentation(e){sm.define(this.name,e,this.container)}defineElement(e){this.definition=new $n(this.type,Object.assign(Object.assign({},e),{name:this.name}))}tagFor(e){return a1.tagFor(e)}}});var I2=y(()=>{l();c();d()});var A2=y(()=>{l();c();d();E2();am();I2()});var R2=y(()=>{l();c();d()});var P2=y(()=>{l();c();d();om()});var $2,O2=y(()=>{l();c();d();A();$2=(r,e)=>O`
${Ze(t=>t.modal,O`
-`});var Ul,dA=y(()=>{l();c();d();Pe();A();we();A1();He();Ul=class extends G{constructor(){super(...arguments),this.currentFocused=null,this.handleFocus=e=>{if(!(this.slottedTreeItems.length<1)){if(e.target===this){this.currentFocused===null&&(this.currentFocused=this.getValidFocusableItem()),this.currentFocused!==null&&Zt.focusItem(this.currentFocused);return}this.contains(e.target)&&(this.setAttribute("tabindex","-1"),this.currentFocused=e.target)}},this.handleBlur=e=>{e.target instanceof HTMLElement&&(e.relatedTarget===null||!this.contains(e.relatedTarget))&&this.setAttribute("tabindex","0")},this.handleKeyDown=e=>{if(e.defaultPrevented)return;if(this.slottedTreeItems.length<1)return!0;let t=this.getVisibleNodes();switch(e.key){case xr:t.length&&Zt.focusItem(t[0]);return;case kr:t.length&&Zt.focusItem(t[t.length-1]);return;case yo:if(e.target&&this.isFocusableElement(e.target)){let o=e.target;o instanceof Zt&&o.childItemLength()>0&&o.expanded?o.expanded=!1:o instanceof Zt&&o.parentElement instanceof Zt&&Zt.focusItem(o.parentElement)}return!1;case bo:if(e.target&&this.isFocusableElement(e.target)){let o=e.target;o instanceof Zt&&o.childItemLength()>0&&!o.expanded?o.expanded=!0:o instanceof Zt&&o.childItemLength()>0&&this.focusNextNode(1,e.target)}return;case Vt:e.target&&this.isFocusableElement(e.target)&&this.focusNextNode(1,e.target);return;case qt:e.target&&this.isFocusableElement(e.target)&&this.focusNextNode(-1,e.target);return;case sr:this.handleClick(e);return}return!0},this.handleSelectedChange=e=>{if(e.defaultPrevented)return;if(!(e.target instanceof Element)||!Ts(e.target))return!0;let t=e.target;t.selected?(this.currentSelected&&this.currentSelected!==t&&(this.currentSelected.selected=!1),this.currentSelected=t):!t.selected&&this.currentSelected===t&&(this.currentSelected=null)},this.setItems=()=>{let e=this.treeView.querySelector("[aria-selected='true']");this.currentSelected=e,(this.currentFocused===null||!this.contains(this.currentFocused))&&(this.currentFocused=this.getValidFocusableItem()),this.nested=this.checkForNestedItems(),this.getVisibleNodes().forEach(o=>{Ts(o)&&(o.nested=this.nested)})},this.isFocusableElement=e=>Ts(e),this.isSelectedElement=e=>e.selected}slottedTreeItemsChanged(){this.$fastController.isConnected&&this.setItems()}connectedCallback(){super.connectedCallback(),this.setAttribute("tabindex","0"),Y.queueUpdate(()=>{this.setItems()})}handleClick(e){if(e.defaultPrevented)return;if(!(e.target instanceof Element)||!Ts(e.target))return!0;let t=e.target;t.disabled||(t.selected=!t.selected)}focusNextNode(e,t){let o=this.getVisibleNodes();if(!o)return;let i=o[o.indexOf(t)+e];Mn(i)&&Zt.focusItem(i)}getValidFocusableItem(){let e=this.getVisibleNodes(),t=e.findIndex(this.isSelectedElement);return t===-1&&(t=e.findIndex(this.isFocusableElement)),t!==-1?e[t]:null}checkForNestedItems(){return this.slottedTreeItems.some(e=>Ts(e)&&e.querySelector("[role='treeitem']"))}getVisibleNodes(){return iE(this,"[role='treeitem']")||[]}};w([k({attribute:"render-collapsed-nodes"})],Ul.prototype,"renderCollapsedNodes",void 0);w([I],Ul.prototype,"currentSelected",void 0);w([I],Ul.prototype,"slottedTreeItems",void 0)});var uA=y(()=>{l();c();d();cA();dA()});var R1,nh,fe,TFe,EFe,hA=y(()=>{l();c();d();R1=class{constructor(e){this.listenerCache=new WeakMap,this.query=e}bind(e){let{query:t}=this,o=this.constructListener(e);o.bind(t)(),t.addListener(o),this.listenerCache.set(e,o)}unbind(e){let t=this.listenerCache.get(e);t&&(this.query.removeListener(t),this.listenerCache.delete(e))}},nh=class r extends R1{constructor(e,t){super(e),this.styles=t}static with(e){return t=>new r(e,t)}constructListener(e){let t=!1,o=this.styles;return function(){let{matches:n}=this;n&&!t?(e.$fastController.addStyles(o),t=n):!n&&t&&(e.$fastController.removeStyles(o),t=n)}}unbind(e){super.unbind(e),e.$fastController.removeStyles(this.styles)}},fe=nh.with(window.matchMedia("(forced-colors)")),TFe=nh.with(window.matchMedia("(prefers-color-scheme: dark)")),EFe=nh.with(window.matchMedia("(prefers-color-scheme: light)"))});var Bm,pA=y(()=>{l();c();d();A();Bm=class{constructor(e,t,o){this.propertyName=e,this.value=t,this.styles=o}bind(e){pe.getNotifier(e).subscribe(this,this.propertyName),this.handleChange(e,this.propertyName)}unbind(e){pe.getNotifier(e).unsubscribe(this,this.propertyName),e.$fastController.removeStyles(this.styles)}handleChange(e,t){e[t]===this.value?e.$fastController.addStyles(this.styles):e.$fastController.removeStyles(this.styles)}}});var Jt,fA=y(()=>{l();c();d();Jt="not-allowed"});function de(r){return`${WM}:host{display:${r}}`}var WM,mA=y(()=>{l();c();d();WM=":host([hidden]){display:none}"});var ke,gA=y(()=>{l();c();d();we();ke=nE()?"focus-visible":"focus"});var vA=y(()=>{l();c();d();fA();mA();gA()});var yA=y(()=>{l();c();d();zr();vm();Kb();hA();pA();vA();ga();Pm()});var Q=y(()=>{l();c();d();WT();SE();_E();Mb();ME();NE();BE();GE();e2();h2();g2();C2();T2();Ub();A2();o1();R2();P2();U2();B2();q2();Y2();e5();t5();r5();n5();l5();g5();y1();k5();P5();Il();D5();H5();V5();W5();J5();rI();aI();uI();mI();wI();_I();AI();OI();NI();VI();jI();XI();iA();aA();uA();yA()});function Ai(r,e,t){return isNaN(r)||r<=e?e:r>=t?t:r}function zm(r,e,t){return isNaN(r)||r<=e?0:r>=t?1:r/(t-e)}function _a(r,e,t){return isNaN(r)?e:e+r*(t-e)}function P1(r){return r*(Math.PI/180)}function bA(r){return r*(180/Math.PI)}function wA(r){let e=Math.round(Ai(r,0,255)).toString(16);return e.length===1?"0"+e:e}function lo(r,e,t){return isNaN(r)||r<=0?e:r>=1?t:e+r*(t-e)}function Vm(r,e,t){if(r<=0)return e%360;if(r>=1)return t%360;let o=(e-t+360)%360,i=(t-e+360)%360;return o<=i?(e-o*r+360)%360:(e+o*r+360)%360}function Rt(r,e){let t=Math.pow(10,e);return Math.round(r*t)/t}var bNe,Ri=y(()=>{l();c();d();bNe=Math.PI*2});var Pi,Qc=y(()=>{l();c();d();Ri();Pi=class r{constructor(e,t,o){this.h=e,this.s=t,this.l=o}static fromObject(e){return e&&!isNaN(e.h)&&!isNaN(e.s)&&!isNaN(e.l)?new r(e.h,e.s,e.l):null}equalValue(e){return this.h===e.h&&this.s===e.s&&this.l===e.l}roundToPrecision(e){return new r(Rt(this.h,e),Rt(this.s,e),Rt(this.l,e))}toObject(){return{h:this.h,s:this.s,l:this.l}}}});var Yc,qm=y(()=>{l();c();d();Ri();Yc=class r{constructor(e,t,o){this.h=e,this.s=t,this.v=o}static fromObject(e){return e&&!isNaN(e.h)&&!isNaN(e.s)&&!isNaN(e.v)?new r(e.h,e.s,e.v):null}equalValue(e){return this.h===e.h&&this.s===e.s&&this.v===e.v}roundToPrecision(e){return new r(Rt(this.h,e),Rt(this.s,e),Rt(this.v,e))}toObject(){return{h:this.h,s:this.s,v:this.v}}}});var tr,sh=y(()=>{l();c();d();Ri();tr=class r{constructor(e,t,o){this.l=e,this.a=t,this.b=o}static fromObject(e){return e&&!isNaN(e.l)&&!isNaN(e.a)&&!isNaN(e.b)?new r(e.l,e.a,e.b):null}equalValue(e){return this.l===e.l&&this.a===e.a&&this.b===e.b}roundToPrecision(e){return new r(Rt(this.l,e),Rt(this.a,e),Rt(this.b,e))}toObject(){return{l:this.l,a:this.a,b:this.b}}};tr.epsilon=216/24389;tr.kappa=24389/27});var Ta,ah=y(()=>{l();c();d();Ri();Ta=class r{constructor(e,t,o){this.l=e,this.c=t,this.h=o}static fromObject(e){return e&&!isNaN(e.l)&&!isNaN(e.c)&&!isNaN(e.h)?new r(e.l,e.c,e.h):null}equalValue(e){return this.l===e.l&&this.c===e.c&&this.h===e.h}roundToPrecision(e){return new r(Rt(this.l,e),Rt(this.c,e),Rt(this.h,e))}toObject(){return{l:this.l,c:this.c,h:this.h}}}});var Qe,Ln=y(()=>{l();c();d();Ri();Qe=class r{constructor(e,t,o,i){this.r=e,this.g=t,this.b=o,this.a=typeof i=="number"&&!isNaN(i)?i:1}static fromObject(e){return e&&!isNaN(e.r)&&!isNaN(e.g)&&!isNaN(e.b)?new r(e.r,e.g,e.b,e.a):null}equalValue(e){return this.r===e.r&&this.g===e.g&&this.b===e.b&&this.a===e.a}toStringHexRGB(){return"#"+[this.r,this.g,this.b].map(this.formatHexValue).join("")}toStringHexRGBA(){return this.toStringHexRGB()+this.formatHexValue(this.a)}toStringHexARGB(){return"#"+[this.a,this.r,this.g,this.b].map(this.formatHexValue).join("")}toStringWebRGB(){return`rgb(${Math.round(_a(this.r,0,255))},${Math.round(_a(this.g,0,255))},${Math.round(_a(this.b,0,255))})`}toStringWebRGBA(){return`rgba(${Math.round(_a(this.r,0,255))},${Math.round(_a(this.g,0,255))},${Math.round(_a(this.b,0,255))},${Ai(this.a,0,1)})`}roundToPrecision(e){return new r(Rt(this.r,e),Rt(this.g,e),Rt(this.b,e),Rt(this.a,e))}clamp(){return new r(Ai(this.r,0,1),Ai(this.g,0,1),Ai(this.b,0,1),Ai(this.a,0,1))}toObject(){return{r:this.r,g:this.g,b:this.b,a:this.a}}formatHexValue(e){return wA(_a(e,0,255))}}});var $o,Gm=y(()=>{l();c();d();Ri();$o=class r{constructor(e,t,o){this.x=e,this.y=t,this.z=o}static fromObject(e){return e&&!isNaN(e.x)&&!isNaN(e.y)&&!isNaN(e.z)?new r(e.x,e.y,e.z):null}equalValue(e){return this.x===e.x&&this.y===e.y&&this.z===e.z}roundToPrecision(e){return new r(Rt(this.x,e),Rt(this.y,e),Rt(this.z,e))}toObject(){return{x:this.x,y:this.y,z:this.z}}};$o.whitePoint=new $o(.95047,1,1.08883)});function jm(r){return r.r*.2126+r.g*.7152+r.b*.0722}function Zc(r){function e(t){return t<=.03928?t/12.92:Math.pow((t+.055)/1.055,2.4)}return jm(new Qe(e(r.r),e(r.g),e(r.b),1))}function M1(r,e){let t=Zc(r),o=Zc(e);return t>o?CA(t,o):CA(o,t)}function $1(r,e,t){return t-e===0?0:(r-e)/(t-e)}function O1(r,e,t){let o=$1(r.r,e.r,t.r),i=$1(r.g,e.g,t.g),n=$1(r.b,e.b,t.b);return(o+i+n)/3}function xA(r,e,t=null){let o=0,i=t;return i!==null?o=O1(r,e,i):(i=new Qe(0,0,0,1),o=O1(r,e,i),o<=0&&(i=new Qe(1,1,1,1),o=O1(r,e,i))),o=Math.round(o*1e3)/1e3,new Qe(i.r,i.g,i.b,o)}function hi(r){let e=Math.max(r.r,r.g,r.b),t=Math.min(r.r,r.g,r.b),o=e-t,i=0;o!==0&&(e===r.r?i=60*((r.g-r.b)/o%6):e===r.g?i=60*((r.b-r.r)/o+2):i=60*((r.r-r.g)/o+4)),i<0&&(i+=360);let n=(e+t)/2,s=0;return o!==0&&(s=o/(1-Math.abs(2*n-1))),new Pi(i,s,n)}function Ea(r,e=1){let t=(1-Math.abs(2*r.l-1))*r.s,o=t*(1-Math.abs(r.h/60%2-1)),i=r.l-t/2,n=0,s=0,a=0;return r.h<60?(n=t,s=o,a=0):r.h<120?(n=o,s=t,a=0):r.h<180?(n=0,s=t,a=o):r.h<240?(n=0,s=o,a=t):r.h<300?(n=o,s=0,a=t):r.h<360&&(n=t,s=0,a=o),new Qe(n+i,s+i,a+i,e)}function D1(r){let e=Math.max(r.r,r.g,r.b),t=Math.min(r.r,r.g,r.b),o=e-t,i=0;o!==0&&(e===r.r?i=60*((r.g-r.b)/o%6):e===r.g?i=60*((r.b-r.r)/o+2):i=60*((r.r-r.g)/o+4)),i<0&&(i+=360);let n=0;return e!==0&&(n=o/e),new Yc(i,n,e)}function kA(r,e=1){let t=r.s*r.v,o=t*(1-Math.abs(r.h/60%2-1)),i=r.v-t,n=0,s=0,a=0;return r.h<60?(n=t,s=o,a=0):r.h<120?(n=o,s=t,a=0):r.h<180?(n=0,s=t,a=o):r.h<240?(n=0,s=o,a=t):r.h<300?(n=o,s=0,a=t):r.h<360&&(n=t,s=0,a=o),new Qe(n+i,s+i,a+i,e)}function QM(r){let e=0,t=0;return r.h!==0&&(e=Math.cos(P1(r.h))*r.c,t=Math.sin(P1(r.h))*r.c),new tr(r.l,e,t)}function YM(r){let e=0;(Math.abs(r.b)>.001||Math.abs(r.a)>.001)&&(e=bA(Math.atan2(r.b,r.a))),e<0&&(e+=360);let t=Math.sqrt(r.a*r.a+r.b*r.b);return new Ta(r.l,t,e)}function ZM(r){let e=(r.l+16)/116,t=e+r.a/500,o=e-r.b/200,i=Math.pow(t,3),n=Math.pow(e,3),s=Math.pow(o,3),a=0;i>tr.epsilon?a=i:a=(116*t-16)/tr.kappa;let u=0;r.l>tr.epsilon*tr.kappa?u=n:u=r.l/tr.kappa;let h=0;return s>tr.epsilon?h=s:h=(116*o-16)/tr.kappa,a=$o.whitePoint.x*a,u=$o.whitePoint.y*u,h=$o.whitePoint.z*h,new $o(a,u,h)}function JM(r){function e(u){return u>tr.epsilon?Math.pow(u,1/3):(tr.kappa*u+16)/116}let t=e(r.x/$o.whitePoint.x),o=e(r.y/$o.whitePoint.y),i=e(r.z/$o.whitePoint.z),n=116*o-16,s=500*(t-o),a=200*(o-i);return new tr(n,s,a)}function Km(r){function e(u){return u<=.04045?u/12.92:Math.pow((u+.055)/1.055,2.4)}let t=e(r.r),o=e(r.g),i=e(r.b),n=t*.4124564+o*.3575761+i*.1804375,s=t*.2126729+o*.7151522+i*.072175,a=t*.0193339+o*.119192+i*.9503041;return new $o(n,s,a)}function F1(r,e=1){function t(s){return s<=.0031308?s*12.92:1.055*Math.pow(s,1/2.4)-.055}let o=t(r.x*3.2404542-r.y*1.5371385-r.z*.4985314),i=t(r.x*-.969266+r.y*1.8760108+r.z*.041556),n=t(r.x*.0556434-r.y*.2040259+r.z*1.0572252);return new Qe(o,i,n,e)}function Bl(r){return JM(Km(r))}function Ia(r,e=1){return F1(ZM(r),e)}function lh(r){return YM(Bl(r))}function Wm(r,e=1){return Ia(QM(r),e)}var CA,Aa=y(()=>{l();c();d();Qc();qm();sh();ah();Ln();Gm();Ri();CA=(r,e)=>(r+.05)/(e+.05)});function H1(r,e,t=18){let o=lh(r),i=o.c+e*t;return i<0&&(i=0),Wm(new Ta(o.l,i,o.h))}function L1(r,e){return r*e}function U1(r,e){return new Qe(L1(r.r,e.r),L1(r.g,e.g),L1(r.b,e.b),1)}function N1(r,e){return r<.5?Ai(2*e*r,0,1):Ai(1-2*(1-e)*(1-r),0,1)}function B1(r,e){return new Qe(N1(r.r,e.r),N1(r.g,e.g),N1(r.b,e.b),1)}function _A(r,e){if(e.a>=1)return e;if(e.a<=0)return new Qe(r.r,r.g,r.b,1);let t=e.a*e.r+(1-e.a)*r.r,o=e.a*e.g+(1-e.a)*r.g,i=e.a*e.b+(1-e.a)*r.b;return new Qe(t,o,i,1)}var SA,z1=y(()=>{l();c();d();Aa();Qc();sh();ah();Ln();Ri();(function(r){r[r.Burn=0]="Burn",r[r.Color=1]="Color",r[r.Darken=2]="Darken",r[r.Dodge=3]="Dodge",r[r.Lighten=4]="Lighten",r[r.Multiply=5]="Multiply",r[r.Overlay=6]="Overlay",r[r.Screen=7]="Screen"})(SA||(SA={}))});function Jc(r,e,t){return isNaN(r)||r<=0?e:r>=1?t:new Qe(lo(r,e.r,t.r),lo(r,e.g,t.g),lo(r,e.b,t.b),lo(r,e.a,t.a))}function XM(r,e,t){return isNaN(r)||r<=0?e:r>=1?t:new Pi(Vm(r,e.h,t.h),lo(r,e.s,t.s),lo(r,e.l,t.l))}function e8(r,e,t){return isNaN(r)||r<=0?e:r>=1?t:new Yc(Vm(r,e.h,t.h),lo(r,e.s,t.s),lo(r,e.v,t.v))}function t8(r,e,t){return isNaN(r)||r<=0?e:r>=1?t:new $o(lo(r,e.x,t.x),lo(r,e.y,t.y),lo(r,e.z,t.z))}function r8(r,e,t){return isNaN(r)||r<=0?e:r>=1?t:new tr(lo(r,e.l,t.l),lo(r,e.a,t.a),lo(r,e.b,t.b))}function o8(r,e,t){return isNaN(r)||r<=0?e:r>=1?t:new Ta(lo(r,e.l,t.l),lo(r,e.c,t.c),Vm(r,e.h,t.h))}function zl(r,e,t,o){if(isNaN(r)||r<=0)return t;if(r>=1)return o;switch(e){case Co.HSL:return Ea(XM(r,hi(t),hi(o)));case Co.HSV:return kA(e8(r,D1(t),D1(o)));case Co.XYZ:return F1(t8(r,Km(t),Km(o)));case Co.LAB:return Ia(r8(r,Bl(t),Bl(o)));case Co.LCH:return Wm(o8(r,lh(t),lh(o)));default:return Jc(r,t,o)}}var Co,ch=y(()=>{l();c();d();Aa();Qc();qm();sh();ah();Ln();Gm();Ri();(function(r){r[r.RGB=0]="RGB",r[r.HSL=1]="HSL",r[r.HSV=2]="HSV",r[r.XYZ=3]="XYZ",r[r.LAB=4]="LAB",r[r.LCH=5]="LCH"})(Co||(Co={}))});var Nn,Qm=y(()=>{l();c();d();Aa();ch();Nn=class r{constructor(e){if(e==null||e.length===0)throw new Error("The stops argument must be non-empty");this.stops=this.sortColorScaleStops(e)}static createBalancedColorScale(e){if(e==null||e.length===0)throw new Error("The colors argument must be non-empty");let t=new Array(e.length);for(let o=0;o=1)return this.stops[this.stops.length-1].color;let o=0;for(let s=0;s=this.stops.length&&(i=this.stops.length-1);let n=(e-this.stops[o].position)*(1/(this.stops[i].position-this.stops[o].position));return zl(n,t,this.stops[o].color,this.stops[i].color)}trim(e,t,o=Co.RGB){if(e<0||t>1||t=e&&this.stops[a].position<=t&&i.push(this.stops[a]);if(i.length===0)return new r([{color:this.getColor(e),position:e},{color:this.getColor(t),position:t}]);i[0].position!==e&&i.unshift({color:this.getColor(e),position:e}),i[i.length-1].position!==t&&i.push({color:this.getColor(t),position:t});let n=t-e,s=new Array(i.length);for(let a=0;a=1&&(e=1);let a=this.getColor(e,i),u=o?0:1,h=this.getColor(u,i);if(M1(a,h)<=t)return u;let f=o?0:e,b=o?e:0,C=u,S=0;for(;S<=s;){C=Math.abs(b-f)/2+f;let R=this.getColor(C,i),H=M1(a,R);if(Math.abs(H-t)<=n)return C;H>t?o?f=C:b=C:o?b=C:f=C,S++}return C}clone(){let e=new Array(this.stops.length);for(let t=0;t{let i=t.position,n=o.position;return in?1:0})}}});var TA=y(()=>{l();c();d()});function ht(r){let e=i8.exec(r);if(e===null)return null;let t=e[1];if(t.length===3){let i=t.charAt(0),n=t.charAt(1),s=t.charAt(2);t=i.concat(i,n,n,s,s)}let o=parseInt(t,16);return isNaN(o)?null:new Qe(zm((o&16711680)>>>16,0,255),zm((o&65280)>>>8,0,255),zm(o&255,0,255),1)}var i8,Ym=y(()=>{l();c();d();Ln();Ri();TA();i8=/^#((?:[0-9a-f]{6}|[0-9a-f]{3}))$/i});var Es,oUe,V1=y(()=>{l();c();d();z1();Aa();ch();Ln();Qm();Ym();Es=class r{constructor(e){this.config=Object.assign({},r.defaultPaletteConfig,e),this.palette=[],this.updatePaletteColors()}updatePaletteGenerationValues(e){let t=!1;for(let o in e)this.config[o]&&(this.config[o].equalValue?this.config[o].equalValue(e[o])||(this.config[o]=e[o],t=!0):e[o]!==this.config[o]&&(this.config[o]=e[o],t=!0));return t&&this.updatePaletteColors(),t}updatePaletteColors(){let e=this.generatePaletteColorScale();for(let t=0;t=this.config.saturationAdjustmentCutoff&&(s=H1(s,this.config.saturationLight),a=H1(a,this.config.saturationDark)),this.config.multiplyLight!==0){let u=U1(this.config.baseColor,s);s=zl(this.config.multiplyLight,this.config.interpolationMode,s,u)}if(this.config.multiplyDark!==0){let u=U1(this.config.baseColor,a);a=zl(this.config.multiplyDark,this.config.interpolationMode,a,u)}if(this.config.overlayLight!==0){let u=B1(this.config.baseColor,s);s=zl(this.config.overlayLight,this.config.interpolationMode,s,u)}if(this.config.overlayDark!==0){let u=B1(this.config.baseColor,a);a=zl(this.config.overlayDark,this.config.interpolationMode,a,u)}return this.config.baseScalePosition?this.config.baseScalePosition<=0?new Nn([{position:0,color:this.config.baseColor},{position:1,color:a.clamp()}]):this.config.baseScalePosition>=1?new Nn([{position:0,color:s.clamp()},{position:1,color:this.config.baseColor}]):new Nn([{position:0,color:s.clamp()},{position:this.config.baseScalePosition,color:this.config.baseColor},{position:1,color:a.clamp()}]):new Nn([{position:0,color:s.clamp()},{position:.5,color:this.config.baseColor},{position:1,color:a.clamp()}])}};Es.defaultPaletteConfig={baseColor:ht("#808080"),steps:11,interpolationMode:Co.RGB,scaleColorLight:new Qe(1,1,1,1),scaleColorDark:new Qe(0,0,0,1),clipLight:.185,clipDark:.16,saturationAdjustmentCutoff:.05,saturationLight:.35,saturationDark:1.25,overlayLight:0,overlayDark:.25,multiplyLight:0,multiplyDark:0,baseScalePosition:.5};Es.greyscalePaletteConfig={baseColor:ht("#808080"),steps:11,interpolationMode:Co.RGB,scaleColorLight:new Qe(1,1,1,1),scaleColorDark:new Qe(0,0,0,1),clipLight:0,clipDark:0,saturationAdjustmentCutoff:0,saturationLight:0,saturationDark:0,overlayLight:0,overlayDark:0,multiplyLight:0,multiplyDark:0,baseScalePosition:.5};oUe={targetSize:63,spacing:4,scaleColorLight:Es.defaultPaletteConfig.scaleColorLight,scaleColorDark:Es.defaultPaletteConfig.scaleColorDark}});var q1=y(()=>{l();c();d()});var G1=y(()=>{l();c();d();Ln()});var EA=y(()=>{l();c();d();q1();G1()});var j1,IA=y(()=>{l();c();d();Ln();V1();Aa();Qm();Qc();ch();Ym();j1=class r{constructor(e){this.palette=[],this.config=Object.assign({},r.defaultPaletteConfig,e),this.regenPalettes()}regenPalettes(){let e=this.config.steps;(isNaN(e)||e<3)&&(e=3);let t=.14,o=.06,i=new Qe(t,t,t,1),n=94,a=new Es(Object.assign(Object.assign({},Es.greyscalePaletteConfig),{baseColor:i,baseScalePosition:(1-t)*100/n,steps:e})).palette,u=jm(this.config.baseColor),h=hi(this.config.baseColor).l,p=(u+h)/2,b=this.matchRelativeLuminanceIndex(p,a)/(e-1),S=this.matchRelativeLuminanceIndex(t,a)/(e-1),R=hi(this.config.baseColor),H=Ea(Pi.fromObject({h:R.h,s:R.s,l:t})),ye=Ea(Pi.fromObject({h:R.h,s:R.s,l:o})),oe=new Array(5);oe[0]={position:0,color:new Qe(1,1,1,1)},oe[1]={position:b,color:this.config.baseColor},oe[2]={position:S,color:H},oe[3]={position:.99,color:ye},oe[4]={position:1,color:new Qe(0,0,0,1)};let me=new Nn(oe);this.palette=new Array(e);for(let yt=0;yt{l();c();d();Aa()});var RA=y(()=>{l();c();d();Ln()});var Is=y(()=>{l();c();d();z1();Aa();Qc();qm();ch();sh();ah();V1();EA();Ln();Qm();Gm();IA();q1();Ri();AA();Ym();RA();G1()});function Vl(r,e){let t=r.relativeLuminance>e.relativeLuminance?r:e,o=r.relativeLuminance>e.relativeLuminance?e:r;return(t.relativeLuminance+.05)/(o.relativeLuminance+.05)}var Zm=y(()=>{l();c();d()});function PA(r){let e={r:0,g:0,b:0,toColorString:()=>"",contrast:()=>0,relativeLuminance:0};for(let t in e)if(typeof e[t]!=typeof r[t])return!1;return!0}var Xe,Jm,Ra=y(()=>{l();c();d();Is();Zm();Xe=Object.freeze({create(r,e,t){return new Jm(r,e,t)},from(r){return new Jm(r.r,r.g,r.b)}});Jm=class r extends Qe{constructor(e,t,o){super(e,t,o,1),this.toColorString=this.toStringHexRGB,this.contrast=Vl.bind(null,this),this.createCSS=this.toColorString,this.relativeLuminance=Zc(this)}static fromObject(e){return new r(e.r,e.g,e.b)}}});function Xm(r,e,t=0,o=r.length-1){if(o===t)return r[t];let i=Math.floor((o-t)/2)+t;return e(r[i])?Xm(r,e,t,i):Xm(r,e,i+1,o)}var $A=y(()=>{l();c();d()});function $i(r){return r.relativeLuminance<=n8}var n8,Xc=y(()=>{l();c();d();n8=(-.1+Math.sqrt(.21))/2});function Wo(r){return $i(r)?-1:1}var Pa=y(()=>{l();c();d();Xc()});function s8(r,e,t){return typeof r=="number"?$a.from(Xe.create(r,e,t)):$a.from(r)}function a8(r,e){return PA(r)?eg.from(r,e):eg.from(Xe.create(r.r,r.g,r.b),e)}var OA,$a,eg,tg=y(()=>{l();c();d();Is();Ra();$A();Pa();Zm();OA={stepContrast:1.03,stepContrastRamp:.03,preserveSource:!1};$a=Object.freeze({create:s8,from:a8}),eg=class r{constructor(e,t){this.closestIndexCache=new Map,this.source=e,this.swatches=t,this.reversedSwatches=Object.freeze([...this.swatches].reverse()),this.lastIndex=this.swatches.length-1}colorContrast(e,t,o,i){o===void 0&&(o=this.closestIndexOf(e));let n=this.swatches,s=this.lastIndex,a=o;i===void 0&&(i=Wo(e));let u=h=>Vl(e,h)>=t;return i===-1&&(n=this.reversedSwatches,a=s-a),Xm(n,u,a,s)}get(e){return this.swatches[e]||this.swatches[Ai(e,0,this.lastIndex)]}closestIndexOf(e){if(this.closestIndexCache.has(e.relativeLuminance))return this.closestIndexCache.get(e.relativeLuminance);let t=this.swatches.indexOf(e);if(t!==-1)return this.closestIndexCache.set(e.relativeLuminance,t),t;let o=this.swatches.reduce((i,n)=>Math.abs(n.relativeLuminance-e.relativeLuminance).5?(t-.5)/.5:2*t}static createHighResolutionPalette(e){let t=[],o=Bl(Qe.fromObject(e).roundToPrecision(4)),i=Ia(new tr(0,o.a,o.b)).clamp().roundToPrecision(4),n=Ia(new tr(50,o.a,o.b)).clamp().roundToPrecision(4),s=Ia(new tr(100,o.a,o.b)).clamp().roundToPrecision(4),a=new Qe(0,0,0),u=new Qe(1,1,1),h=s.equalValue(u)?0:14,p=i.equalValue(a)?0:14;for(let f=100+h;f>=0-p;f-=.5){let b;if(f<0){let C=f/p+1;b=Jc(C,a,i)}else if(f<=50)b=Jc(r.ramp(f),i,n);else if(f<=100)b=Jc(r.ramp(f),n,s);else{let C=(f-100)/h;b=Jc(C,s,u)}b=r.saturationBump(n,b).roundToPrecision(4),t.push(Xe.from(b))}return new r(e,t)}static adjustEnd(e,t,o,i){let n=i===-1?t.swatches:t.reversedSwatches,s=h=>{let p=t.closestIndexOf(h);return i===1?t.lastIndex-p:p};i===1&&o.reverse();let a=e(o[o.length-2]);if(Rt(Vl(o[o.length-1],o[o.length-2]),2){let u=t.stepContrast+t.stepContrast*(1-a.relativeLuminance)*t.stepContrastRamp;return Rt(u,2)},n=[],s=t.preserveSource?e:o.swatches[0];n.push(s);do{let a=i(s);s=o.colorContrast(s,a,void 0,1),n.push(s)}while(s.relativeLuminance>0);if(t.preserveSource){s=e;do{let a=i(s);s=o.colorContrast(s,a,void 0,-1),n.unshift(s)}while(s.relativeLuminance<1)}return this.adjustEnd(i,o,n,-1),t.preserveSource&&this.adjustEnd(i,o,n,1),n}static from(e,t){let o=t===void 0?OA:Object.assign(Object.assign({},OA),t);return new r(e,Object.freeze(r.createColorPaletteByContrast(e,o)))}}});var ed,dh,MA,K1,DA,rg=y(()=>{l();c();d();Is();Ra();ed=Xe.create(1,1,1),dh=Xe.create(0,0,0),MA=Xe.create(.5,.5,.5),K1=ht("#0078D4"),DA=Xe.create(K1.r,K1.g,K1.b)});function W1(r,e,t,o,i){let n=p=>p.contrast(ed)>=i?ed:dh,s=n(r),a=n(e),u=s.relativeLuminance===a.relativeLuminance?s:n(t),h=n(o);return{rest:s,hover:a,active:u,focus:h}}var FA=y(()=>{l();c();d();rg()});var td,Q1=y(()=>{l();c();d();Is();Zm();td=class r{constructor(e,t,o,i){this.toColorString=()=>this.cssGradient,this.contrast=Vl.bind(null,this),this.createCSS=this.toColorString,this.color=new Qe(e,t,o),this.cssGradient=i,this.relativeLuminance=Zc(this.color),this.r=e,this.g=t,this.b=o}static fromObject(e,t){return new r(e.r,e.g,e.b,t)}}});function Y1(r,e,t,o,i,n,s,a,u=10,h=!1){let p=r.closestIndexOf(e);a===void 0&&(a=Wo(e));function f(me){if(h){let yt=r.closestIndexOf(e),Ge=r.get(yt),tt=me.relativeLuminance{l();c();d();Is();Ra();Pa();Q1();l8=new Qe(0,0,0),c8=new Qe(1,1,1)});function NA(r,e,t,o,i,n,s,a){let u=r.closestIndexOf(e),h=Wo(e),p=u+h*t,f=p+h*(o-t),b=p+h*(i-t),C=p+h*(n-t),S=`calc(100% - ${a})`;function R(H,ye){let oe=r.get(H);if(ye){let me=r.get(H+h*s),yt=`linear-gradient(${oe.toColorString()} ${S}, ${me.toColorString()} ${S}, ${me.toColorString()})`;return td.fromObject(oe,yt)}else return oe}return{rest:R(p,!0),hover:R(f,!0),active:R(b,!1),focus:R(C,!0)}}var HA=y(()=>{l();c();d();Pa();Q1()});function UA(r,e,t){return r.colorContrast(e,t)}var BA=y(()=>{l();c();d()});function ql(r,e,t,o,i,n,s,a){a==null&&(a=Wo(e));let u=r.closestIndexOf(r.colorContrast(e,t));return{rest:r.get(u+a*o),hover:r.get(u+a*i),active:r.get(u+a*n),focus:r.get(u+a*s)}}function zA(r,e,t,o,i,n,s,a=void 0,u,h,p,f,b,C=void 0){return $i(e)?ql(r,e,u,h,p,f,b,C):ql(r,e,t,o,i,n,s,a)}var VA=y(()=>{l();c();d();Pa();Xc()});function qA(r,e,t){return r.get(r.closestIndexOf(e)+Wo(e)*t)}var GA=y(()=>{l();c();d();Pa()});function As(r,e,t,o,i,n,s){let a=r.closestIndexOf(e);return s==null&&(s=Wo(e)),{rest:r.get(a+s*t),hover:r.get(a+s*o),active:r.get(a+s*i),focus:r.get(a+s*n)}}function og(r,e,t,o,i,n,s=void 0,a,u,h,p,f=void 0){return $i(e)?As(r,e,a,u,h,p,f):As(r,e,t,o,i,n,s)}var jA=y(()=>{l();c();d();Pa();Xc()});function KA(r,e){return $i(e)?ed:dh}function WA(r,e,t){return $i(e)?dh:ed}var QA=y(()=>{l();c();d();rg();Xc()});function YA(r){return Xe.create(r,r,r)}var Hn,ig=y(()=>{l();c();d();Ra();(function(r){r[r.LightMode=.98]="LightMode",r[r.DarkMode=.15]="DarkMode"})(Hn||(Hn={}))});function Rs(r,e){return r.closestIndexOf(YA(e))}function ZA(r,e){return r.get(Rs(r,e))}var rd=y(()=>{l();c();d();ig()});function JA(r,e,t){return r.get(Rs(r,e)+t)}var XA=y(()=>{l();c();d();rd()});function Z1(r,e,t){return r.get(Rs(r,e)+t*-1)}var eR=y(()=>{l();c();d();rd()});function tR(r,e,t){return r.get(Rs(r,e)+t*-1*2)}var rR=y(()=>{l();c();d();rd()});function oR(r,e,t){return r.get(Rs(r,e)+t*-1*3)}var iR=y(()=>{l();c();d();rd()});var nR,sR=y(()=>{l();c();d();nR={Thin:100,ExtraLight:200,Light:300,Normal:400,Medium:500,SemiBold:600,Bold:700,ExtraBold:800,Black:900}});function re(r){return Je.create({name:r,cssCustomPropertyName:null})}function $s(r){return e=>{let t=r.getValueFor(e),o=d8.getValueFor(e);if(t.endsWith("px")){let i=Number.parseFloat(t.replace("px",""));if(i<=12)return`"wght" ${o}, "opsz" 8`;if(i>24)return`"wght" ${o}, "opsz" 36`}return`"wght" ${o}, "opsz" 10.5`}}function N8(r,e,t,o,i,n){let s=Wo(e),a=r.closestIndexOf(r.colorContrast(e,14)),u=a+s*Math.abs(t-o),h=s===1?ts*o,p,f;return h?(p=a,f=u):(p=u,f=a),{rest:r.get(p),hover:r.get(f),active:r.get(p+s*i),focus:r.get(p+s*n)}}var L,od,Ht,Oa,uR,xo,j,$e,Oo,te,Xt,ko,d8,uh,hg,hR,hh,id,pR,ph,pg,fR,fh,fg,mR,mh,mg,gR,gh,gg,vR,vh,vg,yR,yh,yg,bR,bh,bg,wR,Oi,ag,lg,cg,dg,J1,X1,ew,tw,rw,ow,iw,nw,sw,aw,lw,cw,ng,aR,lR,cR,Ps,u8,h8,sg,p8,f8,m8,g8,dw,uw,hw,pw,v8,fw,mw,gw,vw,yw,bw,ww,CR,xR,kR,SR,Cw,dR,y8,b8,w8,C8,x8,wh,Ot,Ch,xw,k8,JVe,S8,Un,_8,T8,E8,XVe,I8,eqe,A8,tqe,Ae,ug,wg,Ke,jr,Kr,nd,Cg,Mo,sd,ad,_R,xg,xh,kh,Sh,TR,kg,Sg,_g,Tg,ER,Eg,Do,kw,Sw,rqe,Bn,_h,_w,oqe,Tw,Ig,ld,cd,dd,ud,Os,IR,iqe,nqe,R8,AR,Ms,Mi,hd,RR,PR,Qo,Ds,zn,Vn,$R,Ag,Rg,OR,MR,sqe,Pg,De,DR,FR,aqe,pd,qn,$g,Ma,LR,NR,lqe,Og,fd,Mg,Dg,cqe,P8,Gl,Fg,Ew,HR,dqe,uqe,Iw,Fs,hqe,pqe,Lg,Di,md,gd,fqe,$8,vd,O8,UR,Ng,mqe,gqe,vqe,yqe,M8,D8,F8,L8,Hg,bqe,wqe,Cqe,xqe,Le=y(()=>{l();c();d();Q();we();tg();FA();LA();HA();BA();VA();GA();jA();QA();XA();rd();eR();rR();iR();rg();ig();Pa();sR();({create:L}=Je);od=L("direction").withDefault(et.ltr),Ht=L("disabled-opacity").withDefault(.3),Oa=L("base-height-multiplier").withDefault(8),uR=L("base-horizontal-spacing-multiplier").withDefault(3),xo=L("density").withDefault(0),j=L("design-unit").withDefault(4),$e=L("control-corner-radius").withDefault(4),Oo=L("layer-corner-radius").withDefault(8),te=L("stroke-width").withDefault(1),Xt=L("focus-stroke-width").withDefault(2),ko=L("body-font").withDefault('"Segoe UI Variable", "Segoe UI", sans-serif'),d8=L("font-weight").withDefault(nR.Normal);uh=L("type-ramp-base-font-size").withDefault("14px"),hg=L("type-ramp-base-line-height").withDefault("20px"),hR=L("type-ramp-base-font-variations").withDefault($s(uh)),hh=L("type-ramp-minus-1-font-size").withDefault("12px"),id=L("type-ramp-minus-1-line-height").withDefault("16px"),pR=L("type-ramp-minus-1-font-variations").withDefault($s(hh)),ph=L("type-ramp-minus-2-font-size").withDefault("10px"),pg=L("type-ramp-minus-2-line-height").withDefault("14px"),fR=L("type-ramp-minus-2-font-variations").withDefault($s(ph)),fh=L("type-ramp-plus-1-font-size").withDefault("16px"),fg=L("type-ramp-plus-1-line-height").withDefault("22px"),mR=L("type-ramp-plus-1-font-variations").withDefault($s(fh)),mh=L("type-ramp-plus-2-font-size").withDefault("20px"),mg=L("type-ramp-plus-2-line-height").withDefault("26px"),gR=L("type-ramp-plus-2-font-variations").withDefault($s(mh)),gh=L("type-ramp-plus-3-font-size").withDefault("24px"),gg=L("type-ramp-plus-3-line-height").withDefault("32px"),vR=L("type-ramp-plus-3-font-variations").withDefault($s(gh)),vh=L("type-ramp-plus-4-font-size").withDefault("28px"),vg=L("type-ramp-plus-4-line-height").withDefault("36px"),yR=L("type-ramp-plus-4-font-variations").withDefault($s(vh)),yh=L("type-ramp-plus-5-font-size").withDefault("32px"),yg=L("type-ramp-plus-5-line-height").withDefault("40px"),bR=L("type-ramp-plus-5-font-variations").withDefault($s(yh)),bh=L("type-ramp-plus-6-font-size").withDefault("40px"),bg=L("type-ramp-plus-6-line-height").withDefault("52px"),wR=L("type-ramp-plus-6-font-variations").withDefault($s(bh)),Oi=L("base-layer-luminance").withDefault(Hn.LightMode),ag=re("accent-fill-rest-delta").withDefault(0),lg=re("accent-fill-hover-delta").withDefault(-2),cg=re("accent-fill-active-delta").withDefault(-5),dg=re("accent-fill-focus-delta").withDefault(0),J1=re("accent-foreground-rest-delta").withDefault(0),X1=re("accent-foreground-hover-delta").withDefault(3),ew=re("accent-foreground-active-delta").withDefault(-8),tw=re("accent-foreground-focus-delta").withDefault(0),rw=re("neutral-fill-rest-delta").withDefault(-1),ow=re("neutral-fill-hover-delta").withDefault(1),iw=re("neutral-fill-active-delta").withDefault(0),nw=re("neutral-fill-focus-delta").withDefault(0),sw=re("neutral-fill-input-rest-delta").withDefault(-1),aw=re("neutral-fill-input-hover-delta").withDefault(1),lw=re("neutral-fill-input-active-delta").withDefault(0),cw=re("neutral-fill-input-focus-delta").withDefault(-2),ng=re("neutral-fill-input-alt-rest-delta").withDefault(2),aR=re("neutral-fill-input-alt-hover-delta").withDefault(4),lR=re("neutral-fill-input-alt-active-delta").withDefault(6),cR=re("neutral-fill-input-alt-focus-delta").withDefault(2),Ps=re("neutral-fill-layer-rest-delta").withDefault(-2),u8=re("neutral-fill-layer-hover-delta").withDefault(-3),h8=re("neutral-fill-layer-active-delta").withDefault(-3),sg=re("neutral-fill-layer-alt-rest-delta").withDefault(-1),p8=re("neutral-fill-secondary-rest-delta").withDefault(3),f8=re("neutral-fill-secondary-hover-delta").withDefault(2),m8=re("neutral-fill-secondary-active-delta").withDefault(1),g8=re("neutral-fill-secondary-focus-delta").withDefault(3),dw=re("neutral-fill-stealth-rest-delta").withDefault(0),uw=re("neutral-fill-stealth-hover-delta").withDefault(3),hw=re("neutral-fill-stealth-active-delta").withDefault(2),pw=re("neutral-fill-stealth-focus-delta").withDefault(0),v8=re("neutral-fill-strong-rest-delta").withDefault(0),fw=re("neutral-fill-strong-hover-delta").withDefault(8),mw=re("neutral-fill-strong-active-delta").withDefault(-5),gw=re("neutral-fill-strong-focus-delta").withDefault(0),vw=re("neutral-stroke-rest-delta").withDefault(8),yw=re("neutral-stroke-hover-delta").withDefault(12),bw=re("neutral-stroke-active-delta").withDefault(6),ww=re("neutral-stroke-focus-delta").withDefault(8),CR=re("neutral-stroke-control-rest-delta").withDefault(3),xR=re("neutral-stroke-control-hover-delta").withDefault(5),kR=re("neutral-stroke-control-active-delta").withDefault(5),SR=re("neutral-stroke-control-focus-delta").withDefault(5),Cw=re("neutral-stroke-divider-rest-delta").withDefault(4),dR=re("neutral-stroke-layer-rest-delta").withDefault(3),y8=re("neutral-stroke-layer-hover-delta").withDefault(3),b8=re("neutral-stroke-layer-active-delta").withDefault(3),w8=re("neutral-stroke-strong-hover-delta").withDefault(0),C8=re("neutral-stroke-strong-active-delta").withDefault(0),x8=re("neutral-stroke-strong-focus-delta").withDefault(0),wh=L("neutral-base-color").withDefault(MA),Ot=re("neutral-palette").withDefault(r=>$a.from(wh.getValueFor(r))),Ch=L("accent-base-color").withDefault(DA),xw=re("accent-palette").withDefault(r=>$a.from(Ch.getValueFor(r))),k8=re("neutral-layer-card-container-recipe").withDefault({evaluate:r=>Z1(Ot.getValueFor(r),Oi.getValueFor(r),Ps.getValueFor(r))}),JVe=L("neutral-layer-card-container").withDefault(r=>k8.getValueFor(r).evaluate(r)),S8=re("neutral-layer-floating-recipe").withDefault({evaluate:r=>JA(Ot.getValueFor(r),Oi.getValueFor(r),Ps.getValueFor(r))}),Un=L("neutral-layer-floating").withDefault(r=>S8.getValueFor(r).evaluate(r)),_8=re("neutral-layer-1-recipe").withDefault({evaluate:r=>ZA(Ot.getValueFor(r),Oi.getValueFor(r))}),T8=L("neutral-layer-1").withDefault(r=>_8.getValueFor(r).evaluate(r)),E8=re("neutral-layer-2-recipe").withDefault({evaluate:r=>Z1(Ot.getValueFor(r),Oi.getValueFor(r),Ps.getValueFor(r))}),XVe=L("neutral-layer-2").withDefault(r=>E8.getValueFor(r).evaluate(r)),I8=re("neutral-layer-3-recipe").withDefault({evaluate:r=>tR(Ot.getValueFor(r),Oi.getValueFor(r),Ps.getValueFor(r))}),eqe=L("neutral-layer-3").withDefault(r=>I8.getValueFor(r).evaluate(r)),A8=re("neutral-layer-4-recipe").withDefault({evaluate:r=>oR(Ot.getValueFor(r),Oi.getValueFor(r),Ps.getValueFor(r))}),tqe=L("neutral-layer-4").withDefault(r=>A8.getValueFor(r).evaluate(r)),Ae=L("fill-color").withDefault(r=>T8.getValueFor(r));(function(r){r[r.normal=4.5]="normal",r[r.large=3]="large"})(ug||(ug={}));wg=re("accent-fill-recipe").withDefault({evaluate:(r,e)=>zA(xw.getValueFor(r),e||Ae.getValueFor(r),5,ag.getValueFor(r),lg.getValueFor(r),cg.getValueFor(r),dg.getValueFor(r),void 0,8,ag.getValueFor(r),lg.getValueFor(r),cg.getValueFor(r),dg.getValueFor(r),void 0)}),Ke=L("accent-fill-rest").withDefault(r=>wg.getValueFor(r).evaluate(r).rest),jr=L("accent-fill-hover").withDefault(r=>wg.getValueFor(r).evaluate(r).hover),Kr=L("accent-fill-active").withDefault(r=>wg.getValueFor(r).evaluate(r).active),nd=L("accent-fill-focus").withDefault(r=>wg.getValueFor(r).evaluate(r).focus),Cg=re("foreground-on-accent-recipe").withDefault({evaluate:r=>W1(Ke.getValueFor(r),jr.getValueFor(r),Kr.getValueFor(r),nd.getValueFor(r),ug.normal)}),Mo=L("foreground-on-accent-rest").withDefault(r=>Cg.getValueFor(r).evaluate(r).rest),sd=L("foreground-on-accent-hover").withDefault(r=>Cg.getValueFor(r).evaluate(r).hover),ad=L("foreground-on-accent-active").withDefault(r=>Cg.getValueFor(r).evaluate(r).active),_R=L("foreground-on-accent-focus").withDefault(r=>Cg.getValueFor(r).evaluate(r).focus),xg=re("accent-foreground-recipe").withDefault({evaluate:(r,e)=>ql(xw.getValueFor(r),e||Ae.getValueFor(r),9.5,J1.getValueFor(r),X1.getValueFor(r),ew.getValueFor(r),tw.getValueFor(r))}),xh=L("accent-foreground-rest").withDefault(r=>xg.getValueFor(r).evaluate(r).rest),kh=L("accent-foreground-hover").withDefault(r=>xg.getValueFor(r).evaluate(r).hover),Sh=L("accent-foreground-active").withDefault(r=>xg.getValueFor(r).evaluate(r).active),TR=L("accent-foreground-focus").withDefault(r=>xg.getValueFor(r).evaluate(r).focus),kg=re("accent-stroke-control-recipe").withDefault({evaluate:(r,e)=>Y1(Ot.getValueFor(r),e||Ae.getValueFor(r),-3,-3,-3,-3,10,1,void 0,!0)}),Sg=L("accent-stroke-control-rest").withDefault(r=>kg.getValueFor(r).evaluate(r,Ke.getValueFor(r)).rest),_g=L("accent-stroke-control-hover").withDefault(r=>kg.getValueFor(r).evaluate(r,jr.getValueFor(r)).hover),Tg=L("accent-stroke-control-active").withDefault(r=>kg.getValueFor(r).evaluate(r,Kr.getValueFor(r)).active),ER=L("accent-stroke-control-focus").withDefault(r=>kg.getValueFor(r).evaluate(r,nd.getValueFor(r)).focus),Eg=re("neutral-fill-recipe").withDefault({evaluate:(r,e)=>og(Ot.getValueFor(r),e||Ae.getValueFor(r),rw.getValueFor(r),ow.getValueFor(r),iw.getValueFor(r),nw.getValueFor(r),void 0,2,3,1,2,void 0)}),Do=L("neutral-fill-rest").withDefault(r=>Eg.getValueFor(r).evaluate(r).rest),kw=L("neutral-fill-hover").withDefault(r=>Eg.getValueFor(r).evaluate(r).hover),Sw=L("neutral-fill-active").withDefault(r=>Eg.getValueFor(r).evaluate(r).active),rqe=L("neutral-fill-focus").withDefault(r=>Eg.getValueFor(r).evaluate(r).focus),Bn=re("neutral-fill-input-recipe").withDefault({evaluate:(r,e)=>og(Ot.getValueFor(r),e||Ae.getValueFor(r),sw.getValueFor(r),aw.getValueFor(r),lw.getValueFor(r),cw.getValueFor(r),void 0,2,3,1,0,void 0)}),_h=L("neutral-fill-input-rest").withDefault(r=>Bn.getValueFor(r).evaluate(r).rest),_w=L("neutral-fill-input-hover").withDefault(r=>Bn.getValueFor(r).evaluate(r).hover),oqe=L("neutral-fill-input-active").withDefault(r=>Bn.getValueFor(r).evaluate(r).active),Tw=L("neutral-fill-input-focus").withDefault(r=>Bn.getValueFor(r).evaluate(r).focus),Ig=re("neutral-fill-input-alt-recipe").withDefault({evaluate:(r,e)=>og(Ot.getValueFor(r),e||Ae.getValueFor(r),ng.getValueFor(r),aR.getValueFor(r),lR.getValueFor(r),cR.getValueFor(r),1,ng.getValueFor(r),ng.getValueFor(r)-aR.getValueFor(r),ng.getValueFor(r)-lR.getValueFor(r),cR.getValueFor(r),1)}),ld=L("neutral-fill-input-alt-rest").withDefault(r=>Ig.getValueFor(r).evaluate(r).rest),cd=L("neutral-fill-input-alt-hover").withDefault(r=>Ig.getValueFor(r).evaluate(r).hover),dd=L("neutral-fill-input-alt-active").withDefault(r=>Ig.getValueFor(r).evaluate(r).active),ud=L("neutral-fill-input-alt-focus").withDefault(r=>Ig.getValueFor(r).evaluate(r).focus),Os=re("neutral-fill-layer-recipe").withDefault({evaluate:(r,e)=>As(Ot.getValueFor(r),e||Ae.getValueFor(r),Ps.getValueFor(r),u8.getValueFor(r),h8.getValueFor(r),Ps.getValueFor(r),1)}),IR=L("neutral-fill-layer-rest").withDefault(r=>Os.getValueFor(r).evaluate(r).rest),iqe=L("neutral-fill-layer-hover").withDefault(r=>Os.getValueFor(r).evaluate(r).hover),nqe=L("neutral-fill-layer-active").withDefault(r=>Os.getValueFor(r).evaluate(r).active),R8=re("neutral-fill-layer-alt-recipe").withDefault({evaluate:(r,e)=>As(Ot.getValueFor(r),e||Ae.getValueFor(r),sg.getValueFor(r),sg.getValueFor(r),sg.getValueFor(r),sg.getValueFor(r))}),AR=L("neutral-fill-layer-alt-rest").withDefault(r=>R8.getValueFor(r).evaluate(r).rest),Ms=re("neutral-fill-secondary-recipe").withDefault({evaluate:(r,e)=>As(Ot.getValueFor(r),e||Ae.getValueFor(r),p8.getValueFor(r),f8.getValueFor(r),m8.getValueFor(r),g8.getValueFor(r))}),Mi=L("neutral-fill-secondary-rest").withDefault(r=>Ms.getValueFor(r).evaluate(r).rest),hd=L("neutral-fill-secondary-hover").withDefault(r=>Ms.getValueFor(r).evaluate(r).hover),RR=L("neutral-fill-secondary-active").withDefault(r=>Ms.getValueFor(r).evaluate(r).active),PR=L("neutral-fill-secondary-focus").withDefault(r=>Ms.getValueFor(r).evaluate(r).focus),Qo=re("neutral-fill-stealth-recipe").withDefault({evaluate:(r,e)=>As(Ot.getValueFor(r),e||Ae.getValueFor(r),dw.getValueFor(r),uw.getValueFor(r),hw.getValueFor(r),pw.getValueFor(r))}),Ds=L("neutral-fill-stealth-rest").withDefault(r=>Qo.getValueFor(r).evaluate(r).rest),zn=L("neutral-fill-stealth-hover").withDefault(r=>Qo.getValueFor(r).evaluate(r).hover),Vn=L("neutral-fill-stealth-active").withDefault(r=>Qo.getValueFor(r).evaluate(r).active),$R=L("neutral-fill-stealth-focus").withDefault(r=>Qo.getValueFor(r).evaluate(r).focus),Ag=re("neutral-fill-strong-recipe").withDefault({evaluate:(r,e)=>ql(Ot.getValueFor(r),e||Ae.getValueFor(r),4.5,v8.getValueFor(r),fw.getValueFor(r),mw.getValueFor(r),gw.getValueFor(r))}),Rg=L("neutral-fill-strong-rest").withDefault(r=>Ag.getValueFor(r).evaluate(r).rest),OR=L("neutral-fill-strong-hover").withDefault(r=>Ag.getValueFor(r).evaluate(r).hover),MR=L("neutral-fill-strong-active").withDefault(r=>Ag.getValueFor(r).evaluate(r).active),sqe=L("neutral-fill-strong-focus").withDefault(r=>Ag.getValueFor(r).evaluate(r).focus),Pg=re("neutral-foreground-recipe").withDefault({evaluate:(r,e)=>ql(Ot.getValueFor(r),e||Ae.getValueFor(r),16,0,-19,-30,0)}),De=L("neutral-foreground-rest").withDefault(r=>Pg.getValueFor(r).evaluate(r).rest),DR=L("neutral-foreground-hover").withDefault(r=>Pg.getValueFor(r).evaluate(r).hover),FR=L("neutral-foreground-active").withDefault(r=>Pg.getValueFor(r).evaluate(r).active),aqe=L("neutral-foreground-focus").withDefault(r=>Pg.getValueFor(r).evaluate(r).focus),pd=re("neutral-foreground-hint-recipe").withDefault({evaluate:(r,e)=>UA(Ot.getValueFor(r),e||Ae.getValueFor(r),4.5)}),qn=L("neutral-foreground-hint").withDefault(r=>pd.getValueFor(r).evaluate(r)),$g=re("neutral-stroke-recipe").withDefault({evaluate:(r,e)=>As(Ot.getValueFor(r),e||Ae.getValueFor(r),vw.getValueFor(r),yw.getValueFor(r),bw.getValueFor(r),ww.getValueFor(r))}),Ma=L("neutral-stroke-rest").withDefault(r=>$g.getValueFor(r).evaluate(r).rest),LR=L("neutral-stroke-hover").withDefault(r=>$g.getValueFor(r).evaluate(r).hover),NR=L("neutral-stroke-active").withDefault(r=>$g.getValueFor(r).evaluate(r).active),lqe=L("neutral-stroke-focus").withDefault(r=>$g.getValueFor(r).evaluate(r).focus),Og=re("neutral-stroke-control-recipe").withDefault({evaluate:(r,e)=>Y1(Ot.getValueFor(r),e||Ae.getValueFor(r),CR.getValueFor(r),xR.getValueFor(r),kR.getValueFor(r),SR.getValueFor(r),5)}),fd=L("neutral-stroke-control-rest").withDefault(r=>Og.getValueFor(r).evaluate(r).rest),Mg=L("neutral-stroke-control-hover").withDefault(r=>Og.getValueFor(r).evaluate(r).hover),Dg=L("neutral-stroke-control-active").withDefault(r=>Og.getValueFor(r).evaluate(r).active),cqe=L("neutral-stroke-control-focus").withDefault(r=>Og.getValueFor(r).evaluate(r).focus),P8=re("neutral-stroke-divider-recipe").withDefault({evaluate:(r,e)=>qA(Ot.getValueFor(r),e||Ae.getValueFor(r),Cw.getValueFor(r))}),Gl=L("neutral-stroke-divider-rest").withDefault(r=>P8.getValueFor(r).evaluate(r)),Fg=re("neutral-stroke-input-recipe").withDefault({evaluate:(r,e)=>NA(Ot.getValueFor(r),e||Ae.getValueFor(r),CR.getValueFor(r),xR.getValueFor(r),kR.getValueFor(r),SR.getValueFor(r),20,te.getValueFor(r)+"px")}),Ew=L("neutral-stroke-input-rest").withDefault(r=>Fg.getValueFor(r).evaluate(r).rest),HR=L("neutral-stroke-input-hover").withDefault(r=>Fg.getValueFor(r).evaluate(r).hover),dqe=L("neutral-stroke-input-active").withDefault(r=>Fg.getValueFor(r).evaluate(r).active),uqe=L("neutral-stroke-input-focus").withDefault(r=>Fg.getValueFor(r).evaluate(r).focus),Iw=re("neutral-stroke-layer-recipe").withDefault({evaluate:(r,e)=>As(Ot.getValueFor(r),e||Ae.getValueFor(r),dR.getValueFor(r),y8.getValueFor(r),b8.getValueFor(r),dR.getValueFor(r))}),Fs=L("neutral-stroke-layer-rest").withDefault(r=>Iw.getValueFor(r).evaluate(r).rest),hqe=L("neutral-stroke-layer-hover").withDefault(r=>Iw.getValueFor(r).evaluate(r).hover),pqe=L("neutral-stroke-layer-active").withDefault(r=>Iw.getValueFor(r).evaluate(r).active),Lg=re("neutral-stroke-strong-recipe").withDefault({evaluate:(r,e)=>ql(Ot.getValueFor(r),e||Ae.getValueFor(r),5.5,0,w8.getValueFor(r),C8.getValueFor(r),x8.getValueFor(r))}),Di=L("neutral-stroke-strong-rest").withDefault(r=>Lg.getValueFor(r).evaluate(r).rest),md=L("neutral-stroke-strong-hover").withDefault(r=>Lg.getValueFor(r).evaluate(r).hover),gd=L("neutral-stroke-strong-active").withDefault(r=>Lg.getValueFor(r).evaluate(r).active),fqe=L("neutral-stroke-strong-focus").withDefault(r=>Lg.getValueFor(r).evaluate(r).focus),$8=re("focus-stroke-outer-recipe").withDefault({evaluate:r=>KA(Ot.getValueFor(r),Ae.getValueFor(r))}),vd=L("focus-stroke-outer").withDefault(r=>$8.getValueFor(r).evaluate(r)),O8=re("focus-stroke-inner-recipe").withDefault({evaluate:r=>WA(xw.getValueFor(r),Ae.getValueFor(r),vd.getValueFor(r))}),UR=L("focus-stroke-inner").withDefault(r=>O8.getValueFor(r).evaluate(r)),Ng=re("foreground-on-accent-large-recipe").withDefault({evaluate:r=>W1(Ke.getValueFor(r),jr.getValueFor(r),Kr.getValueFor(r),nd.getValueFor(r),ug.large)}),mqe=L("foreground-on-accent-rest-large").withDefault(r=>Ng.getValueFor(r).evaluate(r).rest),gqe=L("foreground-on-accent-hover-large").withDefault(r=>Ng.getValueFor(r).evaluate(r,jr.getValueFor(r)).hover),vqe=L("foreground-on-accent-active-large").withDefault(r=>Ng.getValueFor(r).evaluate(r,Kr.getValueFor(r)).active),yqe=L("foreground-on-accent-focus-large").withDefault(r=>Ng.getValueFor(r).evaluate(r,nd.getValueFor(r)).focus),M8=L("neutral-fill-inverse-rest-delta").withDefault(0),D8=L("neutral-fill-inverse-hover-delta").withDefault(-3),F8=L("neutral-fill-inverse-active-delta").withDefault(7),L8=L("neutral-fill-inverse-focus-delta").withDefault(0);Hg=re("neutral-fill-inverse-recipe").withDefault({evaluate:(r,e)=>N8(Ot.getValueFor(r),e||Ae.getValueFor(r),M8.getValueFor(r),D8.getValueFor(r),F8.getValueFor(r),L8.getValueFor(r))}),bqe=L("neutral-fill-inverse-rest").withDefault(r=>Hg.getValueFor(r).evaluate(r).rest),wqe=L("neutral-fill-inverse-hover").withDefault(r=>Hg.getValueFor(r).evaluate(r).hover),Cqe=L("neutral-fill-inverse-active").withDefault(r=>Hg.getValueFor(r).evaluate(r).active),xqe=L("neutral-fill-inverse-focus").withDefault(r=>Hg.getValueFor(r).evaluate(r).focus)});var Ve,Ug,Aqe,Rqe,Pqe,$qe,Oqe,Mqe,Dqe,Gt=y(()=>{l();c();d();A();Le();Ve=Ur` +`});var Ul,dA=y(()=>{l();c();d();Pe();A();we();A1();He();Ul=class extends G{constructor(){super(...arguments),this.currentFocused=null,this.handleFocus=e=>{if(!(this.slottedTreeItems.length<1)){if(e.target===this){this.currentFocused===null&&(this.currentFocused=this.getValidFocusableItem()),this.currentFocused!==null&&Zt.focusItem(this.currentFocused);return}this.contains(e.target)&&(this.setAttribute("tabindex","-1"),this.currentFocused=e.target)}},this.handleBlur=e=>{e.target instanceof HTMLElement&&(e.relatedTarget===null||!this.contains(e.relatedTarget))&&this.setAttribute("tabindex","0")},this.handleKeyDown=e=>{if(e.defaultPrevented)return;if(this.slottedTreeItems.length<1)return!0;let t=this.getVisibleNodes();switch(e.key){case xr:t.length&&Zt.focusItem(t[0]);return;case kr:t.length&&Zt.focusItem(t[t.length-1]);return;case yo:if(e.target&&this.isFocusableElement(e.target)){let o=e.target;o instanceof Zt&&o.childItemLength()>0&&o.expanded?o.expanded=!1:o instanceof Zt&&o.parentElement instanceof Zt&&Zt.focusItem(o.parentElement)}return!1;case bo:if(e.target&&this.isFocusableElement(e.target)){let o=e.target;o instanceof Zt&&o.childItemLength()>0&&!o.expanded?o.expanded=!0:o instanceof Zt&&o.childItemLength()>0&&this.focusNextNode(1,e.target)}return;case Vt:e.target&&this.isFocusableElement(e.target)&&this.focusNextNode(1,e.target);return;case qt:e.target&&this.isFocusableElement(e.target)&&this.focusNextNode(-1,e.target);return;case sr:this.handleClick(e);return}return!0},this.handleSelectedChange=e=>{if(e.defaultPrevented)return;if(!(e.target instanceof Element)||!Ts(e.target))return!0;let t=e.target;t.selected?(this.currentSelected&&this.currentSelected!==t&&(this.currentSelected.selected=!1),this.currentSelected=t):!t.selected&&this.currentSelected===t&&(this.currentSelected=null)},this.setItems=()=>{let e=this.treeView.querySelector("[aria-selected='true']");this.currentSelected=e,(this.currentFocused===null||!this.contains(this.currentFocused))&&(this.currentFocused=this.getValidFocusableItem()),this.nested=this.checkForNestedItems(),this.getVisibleNodes().forEach(o=>{Ts(o)&&(o.nested=this.nested)})},this.isFocusableElement=e=>Ts(e),this.isSelectedElement=e=>e.selected}slottedTreeItemsChanged(){this.$fastController.isConnected&&this.setItems()}connectedCallback(){super.connectedCallback(),this.setAttribute("tabindex","0"),Y.queueUpdate(()=>{this.setItems()})}handleClick(e){if(e.defaultPrevented)return;if(!(e.target instanceof Element)||!Ts(e.target))return!0;let t=e.target;t.disabled||(t.selected=!t.selected)}focusNextNode(e,t){let o=this.getVisibleNodes();if(!o)return;let i=o[o.indexOf(t)+e];Mn(i)&&Zt.focusItem(i)}getValidFocusableItem(){let e=this.getVisibleNodes(),t=e.findIndex(this.isSelectedElement);return t===-1&&(t=e.findIndex(this.isFocusableElement)),t!==-1?e[t]:null}checkForNestedItems(){return this.slottedTreeItems.some(e=>Ts(e)&&e.querySelector("[role='treeitem']"))}getVisibleNodes(){return iE(this,"[role='treeitem']")||[]}};w([k({attribute:"render-collapsed-nodes"})],Ul.prototype,"renderCollapsedNodes",void 0);w([I],Ul.prototype,"currentSelected",void 0);w([I],Ul.prototype,"slottedTreeItems",void 0)});var uA=y(()=>{l();c();d();cA();dA()});var R1,nh,fe,TFe,EFe,hA=y(()=>{l();c();d();R1=class{constructor(e){this.listenerCache=new WeakMap,this.query=e}bind(e){let{query:t}=this,o=this.constructListener(e);o.bind(t)(),t.addListener(o),this.listenerCache.set(e,o)}unbind(e){let t=this.listenerCache.get(e);t&&(this.query.removeListener(t),this.listenerCache.delete(e))}},nh=class r extends R1{constructor(e,t){super(e),this.styles=t}static with(e){return t=>new r(e,t)}constructListener(e){let t=!1,o=this.styles;return function(){let{matches:n}=this;n&&!t?(e.$fastController.addStyles(o),t=n):!n&&t&&(e.$fastController.removeStyles(o),t=n)}}unbind(e){super.unbind(e),e.$fastController.removeStyles(this.styles)}},fe=nh.with(window.matchMedia("(forced-colors)")),TFe=nh.with(window.matchMedia("(prefers-color-scheme: dark)")),EFe=nh.with(window.matchMedia("(prefers-color-scheme: light)"))});var Bm,pA=y(()=>{l();c();d();A();Bm=class{constructor(e,t,o){this.propertyName=e,this.value=t,this.styles=o}bind(e){pe.getNotifier(e).subscribe(this,this.propertyName),this.handleChange(e,this.propertyName)}unbind(e){pe.getNotifier(e).unsubscribe(this,this.propertyName),e.$fastController.removeStyles(this.styles)}handleChange(e,t){e[t]===this.value?e.$fastController.addStyles(this.styles):e.$fastController.removeStyles(this.styles)}}});var Jt,fA=y(()=>{l();c();d();Jt="not-allowed"});function de(r){return`${WM}:host{display:${r}}`}var WM,mA=y(()=>{l();c();d();WM=":host([hidden]){display:none}"});var ke,gA=y(()=>{l();c();d();we();ke=nE()?"focus-visible":"focus"});var vA=y(()=>{l();c();d();fA();mA();gA()});var yA=y(()=>{l();c();d();zr();vm();Kb();hA();pA();vA();ga();Pm()});var Q=y(()=>{l();c();d();WT();SE();_E();Mb();ME();NE();BE();GE();e2();h2();g2();C2();T2();Ub();A2();o1();R2();P2();U2();B2();q2();Y2();e5();t5();r5();n5();l5();g5();y1();k5();P5();Il();D5();H5();V5();W5();J5();rI();aI();uI();mI();wI();_I();AI();OI();NI();VI();jI();XI();iA();aA();uA();yA()});function Ai(r,e,t){return isNaN(r)||r<=e?e:r>=t?t:r}function zm(r,e,t){return isNaN(r)||r<=e?0:r>=t?1:r/(t-e)}function _a(r,e,t){return isNaN(r)?e:e+r*(t-e)}function P1(r){return r*(Math.PI/180)}function bA(r){return r*(180/Math.PI)}function wA(r){let e=Math.round(Ai(r,0,255)).toString(16);return e.length===1?"0"+e:e}function lo(r,e,t){return isNaN(r)||r<=0?e:r>=1?t:e+r*(t-e)}function Vm(r,e,t){if(r<=0)return e%360;if(r>=1)return t%360;let o=(e-t+360)%360,i=(t-e+360)%360;return o<=i?(e-o*r+360)%360:(e+o*r+360)%360}function Rt(r,e){let t=Math.pow(10,e);return Math.round(r*t)/t}var bNe,Ri=y(()=>{l();c();d();bNe=Math.PI*2});var Pi,Qc=y(()=>{l();c();d();Ri();Pi=class r{constructor(e,t,o){this.h=e,this.s=t,this.l=o}static fromObject(e){return e&&!isNaN(e.h)&&!isNaN(e.s)&&!isNaN(e.l)?new r(e.h,e.s,e.l):null}equalValue(e){return this.h===e.h&&this.s===e.s&&this.l===e.l}roundToPrecision(e){return new r(Rt(this.h,e),Rt(this.s,e),Rt(this.l,e))}toObject(){return{h:this.h,s:this.s,l:this.l}}}});var Yc,qm=y(()=>{l();c();d();Ri();Yc=class r{constructor(e,t,o){this.h=e,this.s=t,this.v=o}static fromObject(e){return e&&!isNaN(e.h)&&!isNaN(e.s)&&!isNaN(e.v)?new r(e.h,e.s,e.v):null}equalValue(e){return this.h===e.h&&this.s===e.s&&this.v===e.v}roundToPrecision(e){return new r(Rt(this.h,e),Rt(this.s,e),Rt(this.v,e))}toObject(){return{h:this.h,s:this.s,v:this.v}}}});var tr,sh=y(()=>{l();c();d();Ri();tr=class r{constructor(e,t,o){this.l=e,this.a=t,this.b=o}static fromObject(e){return e&&!isNaN(e.l)&&!isNaN(e.a)&&!isNaN(e.b)?new r(e.l,e.a,e.b):null}equalValue(e){return this.l===e.l&&this.a===e.a&&this.b===e.b}roundToPrecision(e){return new r(Rt(this.l,e),Rt(this.a,e),Rt(this.b,e))}toObject(){return{l:this.l,a:this.a,b:this.b}}};tr.epsilon=216/24389;tr.kappa=24389/27});var Ta,ah=y(()=>{l();c();d();Ri();Ta=class r{constructor(e,t,o){this.l=e,this.c=t,this.h=o}static fromObject(e){return e&&!isNaN(e.l)&&!isNaN(e.c)&&!isNaN(e.h)?new r(e.l,e.c,e.h):null}equalValue(e){return this.l===e.l&&this.c===e.c&&this.h===e.h}roundToPrecision(e){return new r(Rt(this.l,e),Rt(this.c,e),Rt(this.h,e))}toObject(){return{l:this.l,c:this.c,h:this.h}}}});var Qe,Ln=y(()=>{l();c();d();Ri();Qe=class r{constructor(e,t,o,i){this.r=e,this.g=t,this.b=o,this.a=typeof i=="number"&&!isNaN(i)?i:1}static fromObject(e){return e&&!isNaN(e.r)&&!isNaN(e.g)&&!isNaN(e.b)?new r(e.r,e.g,e.b,e.a):null}equalValue(e){return this.r===e.r&&this.g===e.g&&this.b===e.b&&this.a===e.a}toStringHexRGB(){return"#"+[this.r,this.g,this.b].map(this.formatHexValue).join("")}toStringHexRGBA(){return this.toStringHexRGB()+this.formatHexValue(this.a)}toStringHexARGB(){return"#"+[this.a,this.r,this.g,this.b].map(this.formatHexValue).join("")}toStringWebRGB(){return`rgb(${Math.round(_a(this.r,0,255))},${Math.round(_a(this.g,0,255))},${Math.round(_a(this.b,0,255))})`}toStringWebRGBA(){return`rgba(${Math.round(_a(this.r,0,255))},${Math.round(_a(this.g,0,255))},${Math.round(_a(this.b,0,255))},${Ai(this.a,0,1)})`}roundToPrecision(e){return new r(Rt(this.r,e),Rt(this.g,e),Rt(this.b,e),Rt(this.a,e))}clamp(){return new r(Ai(this.r,0,1),Ai(this.g,0,1),Ai(this.b,0,1),Ai(this.a,0,1))}toObject(){return{r:this.r,g:this.g,b:this.b,a:this.a}}formatHexValue(e){return wA(_a(e,0,255))}}});var $o,Gm=y(()=>{l();c();d();Ri();$o=class r{constructor(e,t,o){this.x=e,this.y=t,this.z=o}static fromObject(e){return e&&!isNaN(e.x)&&!isNaN(e.y)&&!isNaN(e.z)?new r(e.x,e.y,e.z):null}equalValue(e){return this.x===e.x&&this.y===e.y&&this.z===e.z}roundToPrecision(e){return new r(Rt(this.x,e),Rt(this.y,e),Rt(this.z,e))}toObject(){return{x:this.x,y:this.y,z:this.z}}};$o.whitePoint=new $o(.95047,1,1.08883)});function jm(r){return r.r*.2126+r.g*.7152+r.b*.0722}function Zc(r){function e(t){return t<=.03928?t/12.92:Math.pow((t+.055)/1.055,2.4)}return jm(new Qe(e(r.r),e(r.g),e(r.b),1))}function M1(r,e){let t=Zc(r),o=Zc(e);return t>o?CA(t,o):CA(o,t)}function $1(r,e,t){return t-e===0?0:(r-e)/(t-e)}function O1(r,e,t){let o=$1(r.r,e.r,t.r),i=$1(r.g,e.g,t.g),n=$1(r.b,e.b,t.b);return(o+i+n)/3}function xA(r,e,t=null){let o=0,i=t;return i!==null?o=O1(r,e,i):(i=new Qe(0,0,0,1),o=O1(r,e,i),o<=0&&(i=new Qe(1,1,1,1),o=O1(r,e,i))),o=Math.round(o*1e3)/1e3,new Qe(i.r,i.g,i.b,o)}function hi(r){let e=Math.max(r.r,r.g,r.b),t=Math.min(r.r,r.g,r.b),o=e-t,i=0;o!==0&&(e===r.r?i=60*((r.g-r.b)/o%6):e===r.g?i=60*((r.b-r.r)/o+2):i=60*((r.r-r.g)/o+4)),i<0&&(i+=360);let n=(e+t)/2,s=0;return o!==0&&(s=o/(1-Math.abs(2*n-1))),new Pi(i,s,n)}function Ea(r,e=1){let t=(1-Math.abs(2*r.l-1))*r.s,o=t*(1-Math.abs(r.h/60%2-1)),i=r.l-t/2,n=0,s=0,a=0;return r.h<60?(n=t,s=o,a=0):r.h<120?(n=o,s=t,a=0):r.h<180?(n=0,s=t,a=o):r.h<240?(n=0,s=o,a=t):r.h<300?(n=o,s=0,a=t):r.h<360&&(n=t,s=0,a=o),new Qe(n+i,s+i,a+i,e)}function D1(r){let e=Math.max(r.r,r.g,r.b),t=Math.min(r.r,r.g,r.b),o=e-t,i=0;o!==0&&(e===r.r?i=60*((r.g-r.b)/o%6):e===r.g?i=60*((r.b-r.r)/o+2):i=60*((r.r-r.g)/o+4)),i<0&&(i+=360);let n=0;return e!==0&&(n=o/e),new Yc(i,n,e)}function kA(r,e=1){let t=r.s*r.v,o=t*(1-Math.abs(r.h/60%2-1)),i=r.v-t,n=0,s=0,a=0;return r.h<60?(n=t,s=o,a=0):r.h<120?(n=o,s=t,a=0):r.h<180?(n=0,s=t,a=o):r.h<240?(n=0,s=o,a=t):r.h<300?(n=o,s=0,a=t):r.h<360&&(n=t,s=0,a=o),new Qe(n+i,s+i,a+i,e)}function QM(r){let e=0,t=0;return r.h!==0&&(e=Math.cos(P1(r.h))*r.c,t=Math.sin(P1(r.h))*r.c),new tr(r.l,e,t)}function YM(r){let e=0;(Math.abs(r.b)>.001||Math.abs(r.a)>.001)&&(e=bA(Math.atan2(r.b,r.a))),e<0&&(e+=360);let t=Math.sqrt(r.a*r.a+r.b*r.b);return new Ta(r.l,t,e)}function ZM(r){let e=(r.l+16)/116,t=e+r.a/500,o=e-r.b/200,i=Math.pow(t,3),n=Math.pow(e,3),s=Math.pow(o,3),a=0;i>tr.epsilon?a=i:a=(116*t-16)/tr.kappa;let u=0;r.l>tr.epsilon*tr.kappa?u=n:u=r.l/tr.kappa;let h=0;return s>tr.epsilon?h=s:h=(116*o-16)/tr.kappa,a=$o.whitePoint.x*a,u=$o.whitePoint.y*u,h=$o.whitePoint.z*h,new $o(a,u,h)}function JM(r){function e(u){return u>tr.epsilon?Math.pow(u,1/3):(tr.kappa*u+16)/116}let t=e(r.x/$o.whitePoint.x),o=e(r.y/$o.whitePoint.y),i=e(r.z/$o.whitePoint.z),n=116*o-16,s=500*(t-o),a=200*(o-i);return new tr(n,s,a)}function Km(r){function e(u){return u<=.04045?u/12.92:Math.pow((u+.055)/1.055,2.4)}let t=e(r.r),o=e(r.g),i=e(r.b),n=t*.4124564+o*.3575761+i*.1804375,s=t*.2126729+o*.7151522+i*.072175,a=t*.0193339+o*.119192+i*.9503041;return new $o(n,s,a)}function F1(r,e=1){function t(s){return s<=.0031308?s*12.92:1.055*Math.pow(s,1/2.4)-.055}let o=t(r.x*3.2404542-r.y*1.5371385-r.z*.4985314),i=t(r.x*-.969266+r.y*1.8760108+r.z*.041556),n=t(r.x*.0556434-r.y*.2040259+r.z*1.0572252);return new Qe(o,i,n,e)}function Bl(r){return JM(Km(r))}function Ia(r,e=1){return F1(ZM(r),e)}function lh(r){return YM(Bl(r))}function Wm(r,e=1){return Ia(QM(r),e)}var CA,Aa=y(()=>{l();c();d();Qc();qm();sh();ah();Ln();Gm();Ri();CA=(r,e)=>(r+.05)/(e+.05)});function H1(r,e,t=18){let o=lh(r),i=o.c+e*t;return i<0&&(i=0),Wm(new Ta(o.l,i,o.h))}function L1(r,e){return r*e}function U1(r,e){return new Qe(L1(r.r,e.r),L1(r.g,e.g),L1(r.b,e.b),1)}function N1(r,e){return r<.5?Ai(2*e*r,0,1):Ai(1-2*(1-e)*(1-r),0,1)}function B1(r,e){return new Qe(N1(r.r,e.r),N1(r.g,e.g),N1(r.b,e.b),1)}function _A(r,e){if(e.a>=1)return e;if(e.a<=0)return new Qe(r.r,r.g,r.b,1);let t=e.a*e.r+(1-e.a)*r.r,o=e.a*e.g+(1-e.a)*r.g,i=e.a*e.b+(1-e.a)*r.b;return new Qe(t,o,i,1)}var SA,z1=y(()=>{l();c();d();Aa();Qc();sh();ah();Ln();Ri();(function(r){r[r.Burn=0]="Burn",r[r.Color=1]="Color",r[r.Darken=2]="Darken",r[r.Dodge=3]="Dodge",r[r.Lighten=4]="Lighten",r[r.Multiply=5]="Multiply",r[r.Overlay=6]="Overlay",r[r.Screen=7]="Screen"})(SA||(SA={}))});function Jc(r,e,t){return isNaN(r)||r<=0?e:r>=1?t:new Qe(lo(r,e.r,t.r),lo(r,e.g,t.g),lo(r,e.b,t.b),lo(r,e.a,t.a))}function XM(r,e,t){return isNaN(r)||r<=0?e:r>=1?t:new Pi(Vm(r,e.h,t.h),lo(r,e.s,t.s),lo(r,e.l,t.l))}function e8(r,e,t){return isNaN(r)||r<=0?e:r>=1?t:new Yc(Vm(r,e.h,t.h),lo(r,e.s,t.s),lo(r,e.v,t.v))}function t8(r,e,t){return isNaN(r)||r<=0?e:r>=1?t:new $o(lo(r,e.x,t.x),lo(r,e.y,t.y),lo(r,e.z,t.z))}function r8(r,e,t){return isNaN(r)||r<=0?e:r>=1?t:new tr(lo(r,e.l,t.l),lo(r,e.a,t.a),lo(r,e.b,t.b))}function o8(r,e,t){return isNaN(r)||r<=0?e:r>=1?t:new Ta(lo(r,e.l,t.l),lo(r,e.c,t.c),Vm(r,e.h,t.h))}function zl(r,e,t,o){if(isNaN(r)||r<=0)return t;if(r>=1)return o;switch(e){case Co.HSL:return Ea(XM(r,hi(t),hi(o)));case Co.HSV:return kA(e8(r,D1(t),D1(o)));case Co.XYZ:return F1(t8(r,Km(t),Km(o)));case Co.LAB:return Ia(r8(r,Bl(t),Bl(o)));case Co.LCH:return Wm(o8(r,lh(t),lh(o)));default:return Jc(r,t,o)}}var Co,ch=y(()=>{l();c();d();Aa();Qc();qm();sh();ah();Ln();Gm();Ri();(function(r){r[r.RGB=0]="RGB",r[r.HSL=1]="HSL",r[r.HSV=2]="HSV",r[r.XYZ=3]="XYZ",r[r.LAB=4]="LAB",r[r.LCH=5]="LCH"})(Co||(Co={}))});var Nn,Qm=y(()=>{l();c();d();Aa();ch();Nn=class r{constructor(e){if(e==null||e.length===0)throw new Error("The stops argument must be non-empty");this.stops=this.sortColorScaleStops(e)}static createBalancedColorScale(e){if(e==null||e.length===0)throw new Error("The colors argument must be non-empty");let t=new Array(e.length);for(let o=0;o=1)return this.stops[this.stops.length-1].color;let o=0;for(let s=0;s=this.stops.length&&(i=this.stops.length-1);let n=(e-this.stops[o].position)*(1/(this.stops[i].position-this.stops[o].position));return zl(n,t,this.stops[o].color,this.stops[i].color)}trim(e,t,o=Co.RGB){if(e<0||t>1||t=e&&this.stops[a].position<=t&&i.push(this.stops[a]);if(i.length===0)return new r([{color:this.getColor(e),position:e},{color:this.getColor(t),position:t}]);i[0].position!==e&&i.unshift({color:this.getColor(e),position:e}),i[i.length-1].position!==t&&i.push({color:this.getColor(t),position:t});let n=t-e,s=new Array(i.length);for(let a=0;a=1&&(e=1);let a=this.getColor(e,i),u=o?0:1,h=this.getColor(u,i);if(M1(a,h)<=t)return u;let f=o?0:e,b=o?e:0,C=u,S=0;for(;S<=s;){C=Math.abs(b-f)/2+f;let R=this.getColor(C,i),H=M1(a,R);if(Math.abs(H-t)<=n)return C;H>t?o?f=C:b=C:o?b=C:f=C,S++}return C}clone(){let e=new Array(this.stops.length);for(let t=0;t{let i=t.position,n=o.position;return in?1:0})}}});var TA=y(()=>{l();c();d()});function ht(r){let e=i8.exec(r);if(e===null)return null;let t=e[1];if(t.length===3){let i=t.charAt(0),n=t.charAt(1),s=t.charAt(2);t=i.concat(i,n,n,s,s)}let o=parseInt(t,16);return isNaN(o)?null:new Qe(zm((o&16711680)>>>16,0,255),zm((o&65280)>>>8,0,255),zm(o&255,0,255),1)}var i8,Ym=y(()=>{l();c();d();Ln();Ri();TA();i8=/^#((?:[0-9a-f]{6}|[0-9a-f]{3}))$/i});var Es,oUe,V1=y(()=>{l();c();d();z1();Aa();ch();Ln();Qm();Ym();Es=class r{constructor(e){this.config=Object.assign({},r.defaultPaletteConfig,e),this.palette=[],this.updatePaletteColors()}updatePaletteGenerationValues(e){let t=!1;for(let o in e)this.config[o]&&(this.config[o].equalValue?this.config[o].equalValue(e[o])||(this.config[o]=e[o],t=!0):e[o]!==this.config[o]&&(this.config[o]=e[o],t=!0));return t&&this.updatePaletteColors(),t}updatePaletteColors(){let e=this.generatePaletteColorScale();for(let t=0;t=this.config.saturationAdjustmentCutoff&&(s=H1(s,this.config.saturationLight),a=H1(a,this.config.saturationDark)),this.config.multiplyLight!==0){let u=U1(this.config.baseColor,s);s=zl(this.config.multiplyLight,this.config.interpolationMode,s,u)}if(this.config.multiplyDark!==0){let u=U1(this.config.baseColor,a);a=zl(this.config.multiplyDark,this.config.interpolationMode,a,u)}if(this.config.overlayLight!==0){let u=B1(this.config.baseColor,s);s=zl(this.config.overlayLight,this.config.interpolationMode,s,u)}if(this.config.overlayDark!==0){let u=B1(this.config.baseColor,a);a=zl(this.config.overlayDark,this.config.interpolationMode,a,u)}return this.config.baseScalePosition?this.config.baseScalePosition<=0?new Nn([{position:0,color:this.config.baseColor},{position:1,color:a.clamp()}]):this.config.baseScalePosition>=1?new Nn([{position:0,color:s.clamp()},{position:1,color:this.config.baseColor}]):new Nn([{position:0,color:s.clamp()},{position:this.config.baseScalePosition,color:this.config.baseColor},{position:1,color:a.clamp()}]):new Nn([{position:0,color:s.clamp()},{position:.5,color:this.config.baseColor},{position:1,color:a.clamp()}])}};Es.defaultPaletteConfig={baseColor:ht("#808080"),steps:11,interpolationMode:Co.RGB,scaleColorLight:new Qe(1,1,1,1),scaleColorDark:new Qe(0,0,0,1),clipLight:.185,clipDark:.16,saturationAdjustmentCutoff:.05,saturationLight:.35,saturationDark:1.25,overlayLight:0,overlayDark:.25,multiplyLight:0,multiplyDark:0,baseScalePosition:.5};Es.greyscalePaletteConfig={baseColor:ht("#808080"),steps:11,interpolationMode:Co.RGB,scaleColorLight:new Qe(1,1,1,1),scaleColorDark:new Qe(0,0,0,1),clipLight:0,clipDark:0,saturationAdjustmentCutoff:0,saturationLight:0,saturationDark:0,overlayLight:0,overlayDark:0,multiplyLight:0,multiplyDark:0,baseScalePosition:.5};oUe={targetSize:63,spacing:4,scaleColorLight:Es.defaultPaletteConfig.scaleColorLight,scaleColorDark:Es.defaultPaletteConfig.scaleColorDark}});var q1=y(()=>{l();c();d()});var G1=y(()=>{l();c();d();Ln()});var EA=y(()=>{l();c();d();q1();G1()});var j1,IA=y(()=>{l();c();d();Ln();V1();Aa();Qm();Qc();ch();Ym();j1=class r{constructor(e){this.palette=[],this.config=Object.assign({},r.defaultPaletteConfig,e),this.regenPalettes()}regenPalettes(){let e=this.config.steps;(isNaN(e)||e<3)&&(e=3);let t=.14,o=.06,i=new Qe(t,t,t,1),n=94,a=new Es(Object.assign(Object.assign({},Es.greyscalePaletteConfig),{baseColor:i,baseScalePosition:(1-t)*100/n,steps:e})).palette,u=jm(this.config.baseColor),h=hi(this.config.baseColor).l,p=(u+h)/2,b=this.matchRelativeLuminanceIndex(p,a)/(e-1),S=this.matchRelativeLuminanceIndex(t,a)/(e-1),R=hi(this.config.baseColor),H=Ea(Pi.fromObject({h:R.h,s:R.s,l:t})),ye=Ea(Pi.fromObject({h:R.h,s:R.s,l:o})),ie=new Array(5);ie[0]={position:0,color:new Qe(1,1,1,1)},ie[1]={position:b,color:this.config.baseColor},ie[2]={position:S,color:H},ie[3]={position:.99,color:ye},ie[4]={position:1,color:new Qe(0,0,0,1)};let me=new Nn(ie);this.palette=new Array(e);for(let yt=0;yt{l();c();d();Aa()});var RA=y(()=>{l();c();d();Ln()});var Is=y(()=>{l();c();d();z1();Aa();Qc();qm();ch();sh();ah();V1();EA();Ln();Qm();Gm();IA();q1();Ri();AA();Ym();RA();G1()});function Vl(r,e){let t=r.relativeLuminance>e.relativeLuminance?r:e,o=r.relativeLuminance>e.relativeLuminance?e:r;return(t.relativeLuminance+.05)/(o.relativeLuminance+.05)}var Zm=y(()=>{l();c();d()});function PA(r){let e={r:0,g:0,b:0,toColorString:()=>"",contrast:()=>0,relativeLuminance:0};for(let t in e)if(typeof e[t]!=typeof r[t])return!1;return!0}var Xe,Jm,Ra=y(()=>{l();c();d();Is();Zm();Xe=Object.freeze({create(r,e,t){return new Jm(r,e,t)},from(r){return new Jm(r.r,r.g,r.b)}});Jm=class r extends Qe{constructor(e,t,o){super(e,t,o,1),this.toColorString=this.toStringHexRGB,this.contrast=Vl.bind(null,this),this.createCSS=this.toColorString,this.relativeLuminance=Zc(this)}static fromObject(e){return new r(e.r,e.g,e.b)}}});function Xm(r,e,t=0,o=r.length-1){if(o===t)return r[t];let i=Math.floor((o-t)/2)+t;return e(r[i])?Xm(r,e,t,i):Xm(r,e,i+1,o)}var $A=y(()=>{l();c();d()});function $i(r){return r.relativeLuminance<=n8}var n8,Xc=y(()=>{l();c();d();n8=(-.1+Math.sqrt(.21))/2});function Wo(r){return $i(r)?-1:1}var Pa=y(()=>{l();c();d();Xc()});function s8(r,e,t){return typeof r=="number"?$a.from(Xe.create(r,e,t)):$a.from(r)}function a8(r,e){return PA(r)?eg.from(r,e):eg.from(Xe.create(r.r,r.g,r.b),e)}var OA,$a,eg,tg=y(()=>{l();c();d();Is();Ra();$A();Pa();Zm();OA={stepContrast:1.03,stepContrastRamp:.03,preserveSource:!1};$a=Object.freeze({create:s8,from:a8}),eg=class r{constructor(e,t){this.closestIndexCache=new Map,this.source=e,this.swatches=t,this.reversedSwatches=Object.freeze([...this.swatches].reverse()),this.lastIndex=this.swatches.length-1}colorContrast(e,t,o,i){o===void 0&&(o=this.closestIndexOf(e));let n=this.swatches,s=this.lastIndex,a=o;i===void 0&&(i=Wo(e));let u=h=>Vl(e,h)>=t;return i===-1&&(n=this.reversedSwatches,a=s-a),Xm(n,u,a,s)}get(e){return this.swatches[e]||this.swatches[Ai(e,0,this.lastIndex)]}closestIndexOf(e){if(this.closestIndexCache.has(e.relativeLuminance))return this.closestIndexCache.get(e.relativeLuminance);let t=this.swatches.indexOf(e);if(t!==-1)return this.closestIndexCache.set(e.relativeLuminance,t),t;let o=this.swatches.reduce((i,n)=>Math.abs(n.relativeLuminance-e.relativeLuminance).5?(t-.5)/.5:2*t}static createHighResolutionPalette(e){let t=[],o=Bl(Qe.fromObject(e).roundToPrecision(4)),i=Ia(new tr(0,o.a,o.b)).clamp().roundToPrecision(4),n=Ia(new tr(50,o.a,o.b)).clamp().roundToPrecision(4),s=Ia(new tr(100,o.a,o.b)).clamp().roundToPrecision(4),a=new Qe(0,0,0),u=new Qe(1,1,1),h=s.equalValue(u)?0:14,p=i.equalValue(a)?0:14;for(let f=100+h;f>=0-p;f-=.5){let b;if(f<0){let C=f/p+1;b=Jc(C,a,i)}else if(f<=50)b=Jc(r.ramp(f),i,n);else if(f<=100)b=Jc(r.ramp(f),n,s);else{let C=(f-100)/h;b=Jc(C,s,u)}b=r.saturationBump(n,b).roundToPrecision(4),t.push(Xe.from(b))}return new r(e,t)}static adjustEnd(e,t,o,i){let n=i===-1?t.swatches:t.reversedSwatches,s=h=>{let p=t.closestIndexOf(h);return i===1?t.lastIndex-p:p};i===1&&o.reverse();let a=e(o[o.length-2]);if(Rt(Vl(o[o.length-1],o[o.length-2]),2){let u=t.stepContrast+t.stepContrast*(1-a.relativeLuminance)*t.stepContrastRamp;return Rt(u,2)},n=[],s=t.preserveSource?e:o.swatches[0];n.push(s);do{let a=i(s);s=o.colorContrast(s,a,void 0,1),n.push(s)}while(s.relativeLuminance>0);if(t.preserveSource){s=e;do{let a=i(s);s=o.colorContrast(s,a,void 0,-1),n.unshift(s)}while(s.relativeLuminance<1)}return this.adjustEnd(i,o,n,-1),t.preserveSource&&this.adjustEnd(i,o,n,1),n}static from(e,t){let o=t===void 0?OA:Object.assign(Object.assign({},OA),t);return new r(e,Object.freeze(r.createColorPaletteByContrast(e,o)))}}});var ed,dh,MA,K1,DA,rg=y(()=>{l();c();d();Is();Ra();ed=Xe.create(1,1,1),dh=Xe.create(0,0,0),MA=Xe.create(.5,.5,.5),K1=ht("#0078D4"),DA=Xe.create(K1.r,K1.g,K1.b)});function W1(r,e,t,o,i){let n=p=>p.contrast(ed)>=i?ed:dh,s=n(r),a=n(e),u=s.relativeLuminance===a.relativeLuminance?s:n(t),h=n(o);return{rest:s,hover:a,active:u,focus:h}}var FA=y(()=>{l();c();d();rg()});var td,Q1=y(()=>{l();c();d();Is();Zm();td=class r{constructor(e,t,o,i){this.toColorString=()=>this.cssGradient,this.contrast=Vl.bind(null,this),this.createCSS=this.toColorString,this.color=new Qe(e,t,o),this.cssGradient=i,this.relativeLuminance=Zc(this.color),this.r=e,this.g=t,this.b=o}static fromObject(e,t){return new r(e.r,e.g,e.b,t)}}});function Y1(r,e,t,o,i,n,s,a,u=10,h=!1){let p=r.closestIndexOf(e);a===void 0&&(a=Wo(e));function f(me){if(h){let yt=r.closestIndexOf(e),Ge=r.get(yt),tt=me.relativeLuminance{l();c();d();Is();Ra();Pa();Q1();l8=new Qe(0,0,0),c8=new Qe(1,1,1)});function NA(r,e,t,o,i,n,s,a){let u=r.closestIndexOf(e),h=Wo(e),p=u+h*t,f=p+h*(o-t),b=p+h*(i-t),C=p+h*(n-t),S=`calc(100% - ${a})`;function R(H,ye){let ie=r.get(H);if(ye){let me=r.get(H+h*s),yt=`linear-gradient(${ie.toColorString()} ${S}, ${me.toColorString()} ${S}, ${me.toColorString()})`;return td.fromObject(ie,yt)}else return ie}return{rest:R(p,!0),hover:R(f,!0),active:R(b,!1),focus:R(C,!0)}}var HA=y(()=>{l();c();d();Pa();Q1()});function UA(r,e,t){return r.colorContrast(e,t)}var BA=y(()=>{l();c();d()});function ql(r,e,t,o,i,n,s,a){a==null&&(a=Wo(e));let u=r.closestIndexOf(r.colorContrast(e,t));return{rest:r.get(u+a*o),hover:r.get(u+a*i),active:r.get(u+a*n),focus:r.get(u+a*s)}}function zA(r,e,t,o,i,n,s,a=void 0,u,h,p,f,b,C=void 0){return $i(e)?ql(r,e,u,h,p,f,b,C):ql(r,e,t,o,i,n,s,a)}var VA=y(()=>{l();c();d();Pa();Xc()});function qA(r,e,t){return r.get(r.closestIndexOf(e)+Wo(e)*t)}var GA=y(()=>{l();c();d();Pa()});function As(r,e,t,o,i,n,s){let a=r.closestIndexOf(e);return s==null&&(s=Wo(e)),{rest:r.get(a+s*t),hover:r.get(a+s*o),active:r.get(a+s*i),focus:r.get(a+s*n)}}function og(r,e,t,o,i,n,s=void 0,a,u,h,p,f=void 0){return $i(e)?As(r,e,a,u,h,p,f):As(r,e,t,o,i,n,s)}var jA=y(()=>{l();c();d();Pa();Xc()});function KA(r,e){return $i(e)?ed:dh}function WA(r,e,t){return $i(e)?dh:ed}var QA=y(()=>{l();c();d();rg();Xc()});function YA(r){return Xe.create(r,r,r)}var Hn,ig=y(()=>{l();c();d();Ra();(function(r){r[r.LightMode=.98]="LightMode",r[r.DarkMode=.15]="DarkMode"})(Hn||(Hn={}))});function Rs(r,e){return r.closestIndexOf(YA(e))}function ZA(r,e){return r.get(Rs(r,e))}var rd=y(()=>{l();c();d();ig()});function JA(r,e,t){return r.get(Rs(r,e)+t)}var XA=y(()=>{l();c();d();rd()});function Z1(r,e,t){return r.get(Rs(r,e)+t*-1)}var eR=y(()=>{l();c();d();rd()});function tR(r,e,t){return r.get(Rs(r,e)+t*-1*2)}var rR=y(()=>{l();c();d();rd()});function oR(r,e,t){return r.get(Rs(r,e)+t*-1*3)}var iR=y(()=>{l();c();d();rd()});var nR,sR=y(()=>{l();c();d();nR={Thin:100,ExtraLight:200,Light:300,Normal:400,Medium:500,SemiBold:600,Bold:700,ExtraBold:800,Black:900}});function re(r){return Je.create({name:r,cssCustomPropertyName:null})}function $s(r){return e=>{let t=r.getValueFor(e),o=d8.getValueFor(e);if(t.endsWith("px")){let i=Number.parseFloat(t.replace("px",""));if(i<=12)return`"wght" ${o}, "opsz" 8`;if(i>24)return`"wght" ${o}, "opsz" 36`}return`"wght" ${o}, "opsz" 10.5`}}function N8(r,e,t,o,i,n){let s=Wo(e),a=r.closestIndexOf(r.colorContrast(e,14)),u=a+s*Math.abs(t-o),h=s===1?ts*o,p,f;return h?(p=a,f=u):(p=u,f=a),{rest:r.get(p),hover:r.get(f),active:r.get(p+s*i),focus:r.get(p+s*n)}}var L,od,Ht,Oa,uR,xo,j,$e,Oo,te,Xt,ko,d8,uh,hg,hR,hh,id,pR,ph,pg,fR,fh,fg,mR,mh,mg,gR,gh,gg,vR,vh,vg,yR,yh,yg,bR,bh,bg,wR,Oi,ag,lg,cg,dg,J1,X1,ew,tw,rw,ow,iw,nw,sw,aw,lw,cw,ng,aR,lR,cR,Ps,u8,h8,sg,p8,f8,m8,g8,dw,uw,hw,pw,v8,fw,mw,gw,vw,yw,bw,ww,CR,xR,kR,SR,Cw,dR,y8,b8,w8,C8,x8,wh,Ot,Ch,xw,k8,JVe,S8,Un,_8,T8,E8,XVe,I8,eqe,A8,tqe,Ae,ug,wg,Ke,jr,Kr,nd,Cg,Mo,sd,ad,_R,xg,xh,kh,Sh,TR,kg,Sg,_g,Tg,ER,Eg,Do,kw,Sw,rqe,Bn,_h,_w,oqe,Tw,Ig,ld,cd,dd,ud,Os,IR,iqe,nqe,R8,AR,Ms,Mi,hd,RR,PR,Qo,Ds,zn,Vn,$R,Ag,Rg,OR,MR,sqe,Pg,De,DR,FR,aqe,pd,qn,$g,Ma,LR,NR,lqe,Og,fd,Mg,Dg,cqe,P8,Gl,Fg,Ew,HR,dqe,uqe,Iw,Fs,hqe,pqe,Lg,Di,md,gd,fqe,$8,vd,O8,UR,Ng,mqe,gqe,vqe,yqe,M8,D8,F8,L8,Hg,bqe,wqe,Cqe,xqe,Le=y(()=>{l();c();d();Q();we();tg();FA();LA();HA();BA();VA();GA();jA();QA();XA();rd();eR();rR();iR();rg();ig();Pa();sR();({create:L}=Je);od=L("direction").withDefault(et.ltr),Ht=L("disabled-opacity").withDefault(.3),Oa=L("base-height-multiplier").withDefault(8),uR=L("base-horizontal-spacing-multiplier").withDefault(3),xo=L("density").withDefault(0),j=L("design-unit").withDefault(4),$e=L("control-corner-radius").withDefault(4),Oo=L("layer-corner-radius").withDefault(8),te=L("stroke-width").withDefault(1),Xt=L("focus-stroke-width").withDefault(2),ko=L("body-font").withDefault('"Segoe UI Variable", "Segoe UI", sans-serif'),d8=L("font-weight").withDefault(nR.Normal);uh=L("type-ramp-base-font-size").withDefault("14px"),hg=L("type-ramp-base-line-height").withDefault("20px"),hR=L("type-ramp-base-font-variations").withDefault($s(uh)),hh=L("type-ramp-minus-1-font-size").withDefault("12px"),id=L("type-ramp-minus-1-line-height").withDefault("16px"),pR=L("type-ramp-minus-1-font-variations").withDefault($s(hh)),ph=L("type-ramp-minus-2-font-size").withDefault("10px"),pg=L("type-ramp-minus-2-line-height").withDefault("14px"),fR=L("type-ramp-minus-2-font-variations").withDefault($s(ph)),fh=L("type-ramp-plus-1-font-size").withDefault("16px"),fg=L("type-ramp-plus-1-line-height").withDefault("22px"),mR=L("type-ramp-plus-1-font-variations").withDefault($s(fh)),mh=L("type-ramp-plus-2-font-size").withDefault("20px"),mg=L("type-ramp-plus-2-line-height").withDefault("26px"),gR=L("type-ramp-plus-2-font-variations").withDefault($s(mh)),gh=L("type-ramp-plus-3-font-size").withDefault("24px"),gg=L("type-ramp-plus-3-line-height").withDefault("32px"),vR=L("type-ramp-plus-3-font-variations").withDefault($s(gh)),vh=L("type-ramp-plus-4-font-size").withDefault("28px"),vg=L("type-ramp-plus-4-line-height").withDefault("36px"),yR=L("type-ramp-plus-4-font-variations").withDefault($s(vh)),yh=L("type-ramp-plus-5-font-size").withDefault("32px"),yg=L("type-ramp-plus-5-line-height").withDefault("40px"),bR=L("type-ramp-plus-5-font-variations").withDefault($s(yh)),bh=L("type-ramp-plus-6-font-size").withDefault("40px"),bg=L("type-ramp-plus-6-line-height").withDefault("52px"),wR=L("type-ramp-plus-6-font-variations").withDefault($s(bh)),Oi=L("base-layer-luminance").withDefault(Hn.LightMode),ag=re("accent-fill-rest-delta").withDefault(0),lg=re("accent-fill-hover-delta").withDefault(-2),cg=re("accent-fill-active-delta").withDefault(-5),dg=re("accent-fill-focus-delta").withDefault(0),J1=re("accent-foreground-rest-delta").withDefault(0),X1=re("accent-foreground-hover-delta").withDefault(3),ew=re("accent-foreground-active-delta").withDefault(-8),tw=re("accent-foreground-focus-delta").withDefault(0),rw=re("neutral-fill-rest-delta").withDefault(-1),ow=re("neutral-fill-hover-delta").withDefault(1),iw=re("neutral-fill-active-delta").withDefault(0),nw=re("neutral-fill-focus-delta").withDefault(0),sw=re("neutral-fill-input-rest-delta").withDefault(-1),aw=re("neutral-fill-input-hover-delta").withDefault(1),lw=re("neutral-fill-input-active-delta").withDefault(0),cw=re("neutral-fill-input-focus-delta").withDefault(-2),ng=re("neutral-fill-input-alt-rest-delta").withDefault(2),aR=re("neutral-fill-input-alt-hover-delta").withDefault(4),lR=re("neutral-fill-input-alt-active-delta").withDefault(6),cR=re("neutral-fill-input-alt-focus-delta").withDefault(2),Ps=re("neutral-fill-layer-rest-delta").withDefault(-2),u8=re("neutral-fill-layer-hover-delta").withDefault(-3),h8=re("neutral-fill-layer-active-delta").withDefault(-3),sg=re("neutral-fill-layer-alt-rest-delta").withDefault(-1),p8=re("neutral-fill-secondary-rest-delta").withDefault(3),f8=re("neutral-fill-secondary-hover-delta").withDefault(2),m8=re("neutral-fill-secondary-active-delta").withDefault(1),g8=re("neutral-fill-secondary-focus-delta").withDefault(3),dw=re("neutral-fill-stealth-rest-delta").withDefault(0),uw=re("neutral-fill-stealth-hover-delta").withDefault(3),hw=re("neutral-fill-stealth-active-delta").withDefault(2),pw=re("neutral-fill-stealth-focus-delta").withDefault(0),v8=re("neutral-fill-strong-rest-delta").withDefault(0),fw=re("neutral-fill-strong-hover-delta").withDefault(8),mw=re("neutral-fill-strong-active-delta").withDefault(-5),gw=re("neutral-fill-strong-focus-delta").withDefault(0),vw=re("neutral-stroke-rest-delta").withDefault(8),yw=re("neutral-stroke-hover-delta").withDefault(12),bw=re("neutral-stroke-active-delta").withDefault(6),ww=re("neutral-stroke-focus-delta").withDefault(8),CR=re("neutral-stroke-control-rest-delta").withDefault(3),xR=re("neutral-stroke-control-hover-delta").withDefault(5),kR=re("neutral-stroke-control-active-delta").withDefault(5),SR=re("neutral-stroke-control-focus-delta").withDefault(5),Cw=re("neutral-stroke-divider-rest-delta").withDefault(4),dR=re("neutral-stroke-layer-rest-delta").withDefault(3),y8=re("neutral-stroke-layer-hover-delta").withDefault(3),b8=re("neutral-stroke-layer-active-delta").withDefault(3),w8=re("neutral-stroke-strong-hover-delta").withDefault(0),C8=re("neutral-stroke-strong-active-delta").withDefault(0),x8=re("neutral-stroke-strong-focus-delta").withDefault(0),wh=L("neutral-base-color").withDefault(MA),Ot=re("neutral-palette").withDefault(r=>$a.from(wh.getValueFor(r))),Ch=L("accent-base-color").withDefault(DA),xw=re("accent-palette").withDefault(r=>$a.from(Ch.getValueFor(r))),k8=re("neutral-layer-card-container-recipe").withDefault({evaluate:r=>Z1(Ot.getValueFor(r),Oi.getValueFor(r),Ps.getValueFor(r))}),JVe=L("neutral-layer-card-container").withDefault(r=>k8.getValueFor(r).evaluate(r)),S8=re("neutral-layer-floating-recipe").withDefault({evaluate:r=>JA(Ot.getValueFor(r),Oi.getValueFor(r),Ps.getValueFor(r))}),Un=L("neutral-layer-floating").withDefault(r=>S8.getValueFor(r).evaluate(r)),_8=re("neutral-layer-1-recipe").withDefault({evaluate:r=>ZA(Ot.getValueFor(r),Oi.getValueFor(r))}),T8=L("neutral-layer-1").withDefault(r=>_8.getValueFor(r).evaluate(r)),E8=re("neutral-layer-2-recipe").withDefault({evaluate:r=>Z1(Ot.getValueFor(r),Oi.getValueFor(r),Ps.getValueFor(r))}),XVe=L("neutral-layer-2").withDefault(r=>E8.getValueFor(r).evaluate(r)),I8=re("neutral-layer-3-recipe").withDefault({evaluate:r=>tR(Ot.getValueFor(r),Oi.getValueFor(r),Ps.getValueFor(r))}),eqe=L("neutral-layer-3").withDefault(r=>I8.getValueFor(r).evaluate(r)),A8=re("neutral-layer-4-recipe").withDefault({evaluate:r=>oR(Ot.getValueFor(r),Oi.getValueFor(r),Ps.getValueFor(r))}),tqe=L("neutral-layer-4").withDefault(r=>A8.getValueFor(r).evaluate(r)),Ae=L("fill-color").withDefault(r=>T8.getValueFor(r));(function(r){r[r.normal=4.5]="normal",r[r.large=3]="large"})(ug||(ug={}));wg=re("accent-fill-recipe").withDefault({evaluate:(r,e)=>zA(xw.getValueFor(r),e||Ae.getValueFor(r),5,ag.getValueFor(r),lg.getValueFor(r),cg.getValueFor(r),dg.getValueFor(r),void 0,8,ag.getValueFor(r),lg.getValueFor(r),cg.getValueFor(r),dg.getValueFor(r),void 0)}),Ke=L("accent-fill-rest").withDefault(r=>wg.getValueFor(r).evaluate(r).rest),jr=L("accent-fill-hover").withDefault(r=>wg.getValueFor(r).evaluate(r).hover),Kr=L("accent-fill-active").withDefault(r=>wg.getValueFor(r).evaluate(r).active),nd=L("accent-fill-focus").withDefault(r=>wg.getValueFor(r).evaluate(r).focus),Cg=re("foreground-on-accent-recipe").withDefault({evaluate:r=>W1(Ke.getValueFor(r),jr.getValueFor(r),Kr.getValueFor(r),nd.getValueFor(r),ug.normal)}),Mo=L("foreground-on-accent-rest").withDefault(r=>Cg.getValueFor(r).evaluate(r).rest),sd=L("foreground-on-accent-hover").withDefault(r=>Cg.getValueFor(r).evaluate(r).hover),ad=L("foreground-on-accent-active").withDefault(r=>Cg.getValueFor(r).evaluate(r).active),_R=L("foreground-on-accent-focus").withDefault(r=>Cg.getValueFor(r).evaluate(r).focus),xg=re("accent-foreground-recipe").withDefault({evaluate:(r,e)=>ql(xw.getValueFor(r),e||Ae.getValueFor(r),9.5,J1.getValueFor(r),X1.getValueFor(r),ew.getValueFor(r),tw.getValueFor(r))}),xh=L("accent-foreground-rest").withDefault(r=>xg.getValueFor(r).evaluate(r).rest),kh=L("accent-foreground-hover").withDefault(r=>xg.getValueFor(r).evaluate(r).hover),Sh=L("accent-foreground-active").withDefault(r=>xg.getValueFor(r).evaluate(r).active),TR=L("accent-foreground-focus").withDefault(r=>xg.getValueFor(r).evaluate(r).focus),kg=re("accent-stroke-control-recipe").withDefault({evaluate:(r,e)=>Y1(Ot.getValueFor(r),e||Ae.getValueFor(r),-3,-3,-3,-3,10,1,void 0,!0)}),Sg=L("accent-stroke-control-rest").withDefault(r=>kg.getValueFor(r).evaluate(r,Ke.getValueFor(r)).rest),_g=L("accent-stroke-control-hover").withDefault(r=>kg.getValueFor(r).evaluate(r,jr.getValueFor(r)).hover),Tg=L("accent-stroke-control-active").withDefault(r=>kg.getValueFor(r).evaluate(r,Kr.getValueFor(r)).active),ER=L("accent-stroke-control-focus").withDefault(r=>kg.getValueFor(r).evaluate(r,nd.getValueFor(r)).focus),Eg=re("neutral-fill-recipe").withDefault({evaluate:(r,e)=>og(Ot.getValueFor(r),e||Ae.getValueFor(r),rw.getValueFor(r),ow.getValueFor(r),iw.getValueFor(r),nw.getValueFor(r),void 0,2,3,1,2,void 0)}),Do=L("neutral-fill-rest").withDefault(r=>Eg.getValueFor(r).evaluate(r).rest),kw=L("neutral-fill-hover").withDefault(r=>Eg.getValueFor(r).evaluate(r).hover),Sw=L("neutral-fill-active").withDefault(r=>Eg.getValueFor(r).evaluate(r).active),rqe=L("neutral-fill-focus").withDefault(r=>Eg.getValueFor(r).evaluate(r).focus),Bn=re("neutral-fill-input-recipe").withDefault({evaluate:(r,e)=>og(Ot.getValueFor(r),e||Ae.getValueFor(r),sw.getValueFor(r),aw.getValueFor(r),lw.getValueFor(r),cw.getValueFor(r),void 0,2,3,1,0,void 0)}),_h=L("neutral-fill-input-rest").withDefault(r=>Bn.getValueFor(r).evaluate(r).rest),_w=L("neutral-fill-input-hover").withDefault(r=>Bn.getValueFor(r).evaluate(r).hover),oqe=L("neutral-fill-input-active").withDefault(r=>Bn.getValueFor(r).evaluate(r).active),Tw=L("neutral-fill-input-focus").withDefault(r=>Bn.getValueFor(r).evaluate(r).focus),Ig=re("neutral-fill-input-alt-recipe").withDefault({evaluate:(r,e)=>og(Ot.getValueFor(r),e||Ae.getValueFor(r),ng.getValueFor(r),aR.getValueFor(r),lR.getValueFor(r),cR.getValueFor(r),1,ng.getValueFor(r),ng.getValueFor(r)-aR.getValueFor(r),ng.getValueFor(r)-lR.getValueFor(r),cR.getValueFor(r),1)}),ld=L("neutral-fill-input-alt-rest").withDefault(r=>Ig.getValueFor(r).evaluate(r).rest),cd=L("neutral-fill-input-alt-hover").withDefault(r=>Ig.getValueFor(r).evaluate(r).hover),dd=L("neutral-fill-input-alt-active").withDefault(r=>Ig.getValueFor(r).evaluate(r).active),ud=L("neutral-fill-input-alt-focus").withDefault(r=>Ig.getValueFor(r).evaluate(r).focus),Os=re("neutral-fill-layer-recipe").withDefault({evaluate:(r,e)=>As(Ot.getValueFor(r),e||Ae.getValueFor(r),Ps.getValueFor(r),u8.getValueFor(r),h8.getValueFor(r),Ps.getValueFor(r),1)}),IR=L("neutral-fill-layer-rest").withDefault(r=>Os.getValueFor(r).evaluate(r).rest),iqe=L("neutral-fill-layer-hover").withDefault(r=>Os.getValueFor(r).evaluate(r).hover),nqe=L("neutral-fill-layer-active").withDefault(r=>Os.getValueFor(r).evaluate(r).active),R8=re("neutral-fill-layer-alt-recipe").withDefault({evaluate:(r,e)=>As(Ot.getValueFor(r),e||Ae.getValueFor(r),sg.getValueFor(r),sg.getValueFor(r),sg.getValueFor(r),sg.getValueFor(r))}),AR=L("neutral-fill-layer-alt-rest").withDefault(r=>R8.getValueFor(r).evaluate(r).rest),Ms=re("neutral-fill-secondary-recipe").withDefault({evaluate:(r,e)=>As(Ot.getValueFor(r),e||Ae.getValueFor(r),p8.getValueFor(r),f8.getValueFor(r),m8.getValueFor(r),g8.getValueFor(r))}),Mi=L("neutral-fill-secondary-rest").withDefault(r=>Ms.getValueFor(r).evaluate(r).rest),hd=L("neutral-fill-secondary-hover").withDefault(r=>Ms.getValueFor(r).evaluate(r).hover),RR=L("neutral-fill-secondary-active").withDefault(r=>Ms.getValueFor(r).evaluate(r).active),PR=L("neutral-fill-secondary-focus").withDefault(r=>Ms.getValueFor(r).evaluate(r).focus),Qo=re("neutral-fill-stealth-recipe").withDefault({evaluate:(r,e)=>As(Ot.getValueFor(r),e||Ae.getValueFor(r),dw.getValueFor(r),uw.getValueFor(r),hw.getValueFor(r),pw.getValueFor(r))}),Ds=L("neutral-fill-stealth-rest").withDefault(r=>Qo.getValueFor(r).evaluate(r).rest),zn=L("neutral-fill-stealth-hover").withDefault(r=>Qo.getValueFor(r).evaluate(r).hover),Vn=L("neutral-fill-stealth-active").withDefault(r=>Qo.getValueFor(r).evaluate(r).active),$R=L("neutral-fill-stealth-focus").withDefault(r=>Qo.getValueFor(r).evaluate(r).focus),Ag=re("neutral-fill-strong-recipe").withDefault({evaluate:(r,e)=>ql(Ot.getValueFor(r),e||Ae.getValueFor(r),4.5,v8.getValueFor(r),fw.getValueFor(r),mw.getValueFor(r),gw.getValueFor(r))}),Rg=L("neutral-fill-strong-rest").withDefault(r=>Ag.getValueFor(r).evaluate(r).rest),OR=L("neutral-fill-strong-hover").withDefault(r=>Ag.getValueFor(r).evaluate(r).hover),MR=L("neutral-fill-strong-active").withDefault(r=>Ag.getValueFor(r).evaluate(r).active),sqe=L("neutral-fill-strong-focus").withDefault(r=>Ag.getValueFor(r).evaluate(r).focus),Pg=re("neutral-foreground-recipe").withDefault({evaluate:(r,e)=>ql(Ot.getValueFor(r),e||Ae.getValueFor(r),16,0,-19,-30,0)}),De=L("neutral-foreground-rest").withDefault(r=>Pg.getValueFor(r).evaluate(r).rest),DR=L("neutral-foreground-hover").withDefault(r=>Pg.getValueFor(r).evaluate(r).hover),FR=L("neutral-foreground-active").withDefault(r=>Pg.getValueFor(r).evaluate(r).active),aqe=L("neutral-foreground-focus").withDefault(r=>Pg.getValueFor(r).evaluate(r).focus),pd=re("neutral-foreground-hint-recipe").withDefault({evaluate:(r,e)=>UA(Ot.getValueFor(r),e||Ae.getValueFor(r),4.5)}),qn=L("neutral-foreground-hint").withDefault(r=>pd.getValueFor(r).evaluate(r)),$g=re("neutral-stroke-recipe").withDefault({evaluate:(r,e)=>As(Ot.getValueFor(r),e||Ae.getValueFor(r),vw.getValueFor(r),yw.getValueFor(r),bw.getValueFor(r),ww.getValueFor(r))}),Ma=L("neutral-stroke-rest").withDefault(r=>$g.getValueFor(r).evaluate(r).rest),LR=L("neutral-stroke-hover").withDefault(r=>$g.getValueFor(r).evaluate(r).hover),NR=L("neutral-stroke-active").withDefault(r=>$g.getValueFor(r).evaluate(r).active),lqe=L("neutral-stroke-focus").withDefault(r=>$g.getValueFor(r).evaluate(r).focus),Og=re("neutral-stroke-control-recipe").withDefault({evaluate:(r,e)=>Y1(Ot.getValueFor(r),e||Ae.getValueFor(r),CR.getValueFor(r),xR.getValueFor(r),kR.getValueFor(r),SR.getValueFor(r),5)}),fd=L("neutral-stroke-control-rest").withDefault(r=>Og.getValueFor(r).evaluate(r).rest),Mg=L("neutral-stroke-control-hover").withDefault(r=>Og.getValueFor(r).evaluate(r).hover),Dg=L("neutral-stroke-control-active").withDefault(r=>Og.getValueFor(r).evaluate(r).active),cqe=L("neutral-stroke-control-focus").withDefault(r=>Og.getValueFor(r).evaluate(r).focus),P8=re("neutral-stroke-divider-recipe").withDefault({evaluate:(r,e)=>qA(Ot.getValueFor(r),e||Ae.getValueFor(r),Cw.getValueFor(r))}),Gl=L("neutral-stroke-divider-rest").withDefault(r=>P8.getValueFor(r).evaluate(r)),Fg=re("neutral-stroke-input-recipe").withDefault({evaluate:(r,e)=>NA(Ot.getValueFor(r),e||Ae.getValueFor(r),CR.getValueFor(r),xR.getValueFor(r),kR.getValueFor(r),SR.getValueFor(r),20,te.getValueFor(r)+"px")}),Ew=L("neutral-stroke-input-rest").withDefault(r=>Fg.getValueFor(r).evaluate(r).rest),HR=L("neutral-stroke-input-hover").withDefault(r=>Fg.getValueFor(r).evaluate(r).hover),dqe=L("neutral-stroke-input-active").withDefault(r=>Fg.getValueFor(r).evaluate(r).active),uqe=L("neutral-stroke-input-focus").withDefault(r=>Fg.getValueFor(r).evaluate(r).focus),Iw=re("neutral-stroke-layer-recipe").withDefault({evaluate:(r,e)=>As(Ot.getValueFor(r),e||Ae.getValueFor(r),dR.getValueFor(r),y8.getValueFor(r),b8.getValueFor(r),dR.getValueFor(r))}),Fs=L("neutral-stroke-layer-rest").withDefault(r=>Iw.getValueFor(r).evaluate(r).rest),hqe=L("neutral-stroke-layer-hover").withDefault(r=>Iw.getValueFor(r).evaluate(r).hover),pqe=L("neutral-stroke-layer-active").withDefault(r=>Iw.getValueFor(r).evaluate(r).active),Lg=re("neutral-stroke-strong-recipe").withDefault({evaluate:(r,e)=>ql(Ot.getValueFor(r),e||Ae.getValueFor(r),5.5,0,w8.getValueFor(r),C8.getValueFor(r),x8.getValueFor(r))}),Di=L("neutral-stroke-strong-rest").withDefault(r=>Lg.getValueFor(r).evaluate(r).rest),md=L("neutral-stroke-strong-hover").withDefault(r=>Lg.getValueFor(r).evaluate(r).hover),gd=L("neutral-stroke-strong-active").withDefault(r=>Lg.getValueFor(r).evaluate(r).active),fqe=L("neutral-stroke-strong-focus").withDefault(r=>Lg.getValueFor(r).evaluate(r).focus),$8=re("focus-stroke-outer-recipe").withDefault({evaluate:r=>KA(Ot.getValueFor(r),Ae.getValueFor(r))}),vd=L("focus-stroke-outer").withDefault(r=>$8.getValueFor(r).evaluate(r)),O8=re("focus-stroke-inner-recipe").withDefault({evaluate:r=>WA(xw.getValueFor(r),Ae.getValueFor(r),vd.getValueFor(r))}),UR=L("focus-stroke-inner").withDefault(r=>O8.getValueFor(r).evaluate(r)),Ng=re("foreground-on-accent-large-recipe").withDefault({evaluate:r=>W1(Ke.getValueFor(r),jr.getValueFor(r),Kr.getValueFor(r),nd.getValueFor(r),ug.large)}),mqe=L("foreground-on-accent-rest-large").withDefault(r=>Ng.getValueFor(r).evaluate(r).rest),gqe=L("foreground-on-accent-hover-large").withDefault(r=>Ng.getValueFor(r).evaluate(r,jr.getValueFor(r)).hover),vqe=L("foreground-on-accent-active-large").withDefault(r=>Ng.getValueFor(r).evaluate(r,Kr.getValueFor(r)).active),yqe=L("foreground-on-accent-focus-large").withDefault(r=>Ng.getValueFor(r).evaluate(r,nd.getValueFor(r)).focus),M8=L("neutral-fill-inverse-rest-delta").withDefault(0),D8=L("neutral-fill-inverse-hover-delta").withDefault(-3),F8=L("neutral-fill-inverse-active-delta").withDefault(7),L8=L("neutral-fill-inverse-focus-delta").withDefault(0);Hg=re("neutral-fill-inverse-recipe").withDefault({evaluate:(r,e)=>N8(Ot.getValueFor(r),e||Ae.getValueFor(r),M8.getValueFor(r),D8.getValueFor(r),F8.getValueFor(r),L8.getValueFor(r))}),bqe=L("neutral-fill-inverse-rest").withDefault(r=>Hg.getValueFor(r).evaluate(r).rest),wqe=L("neutral-fill-inverse-hover").withDefault(r=>Hg.getValueFor(r).evaluate(r).hover),Cqe=L("neutral-fill-inverse-active").withDefault(r=>Hg.getValueFor(r).evaluate(r).active),xqe=L("neutral-fill-inverse-focus").withDefault(r=>Hg.getValueFor(r).evaluate(r).focus)});var Ve,Ug,Aqe,Rqe,Pqe,$qe,Oqe,Mqe,Dqe,Gt=y(()=>{l();c();d();A();Le();Ve=Ur` font-family: ${ko}; font-size: ${uh}; line-height: ${hg}; @@ -5458,7 +5458,7 @@ ${de("inline-block")} :host { `}renderFlyout(){return x` - `}updateFlyout(e=!0){if(!this.isOpen)return;let t=this._anchor,o=this._flyout;if(o&&t){let i=window.innerWidth&&document.documentElement.clientWidth?Math.min(window.innerWidth,document.documentElement.clientWidth):window.innerWidth||document.documentElement.clientWidth;this._windowHeight=window.innerHeight&&document.documentElement.clientHeight?Math.min(window.innerHeight,document.documentElement.clientHeight):window.innerHeight||document.documentElement.clientHeight;let n=0,s,a=0,u,h,p=o.getBoundingClientRect(),f=t.getBoundingClientRect(),b=this._topScout.getBoundingClientRect(),C=this._bottomScout.getBoundingClientRect(),S={height:this._windowHeight,left:0,top:0,width:i};if(QC()){let oe=iP().getWindowSegments(),me,yt=f.left+f.width/2,Ge=f.top+f.height/2;for(let tt of oe)if(yt>=tt.left&&Ge>=tt.top){me=tt;break}me&&(S.left=me.left,S.top=me.top,S.width=me.width,S.height=me.height)}p.width+2*this._edgePadding>S.width?p.width>S.width?(h=S.width,n=0):n=(S.width-p.width)/2:f.left+p.width+this._edgePadding>S.width?n=f.left-(f.left+p.width+this._edgePadding-S.width):f.leftR?(s=S.height-f.top,u=H):(a=f.bottom,u=R):(s=S.height-f.top,u=H):(a=f.bottom,u=R):p.height+2*this._edgePadding>S.height?p.height>=S.height?(u=S.height,a=0):a=(S.height-p.height)/2:f.top+f.height+p.height+this._edgePadding>S.height?a=S.height-p.height-this._edgePadding:a=Math.max(f.top+f.height,this._edgePadding),(b.top!==0||b.left!==0)&&(n-=b.left,typeof s<"u"?s+=C.top-this._windowHeight:a-=b.top),this.direction==="rtl"?n>100&&this.offsetLeft>100&&(o.style.left=`${S.width-n+p.left-p.width-30}px`):o.style.left=`${n+S.left}px`,typeof s<"u"?(o.style.top="unset",o.style.bottom=`${s}px`):(o.style.bottom="unset",o.style.top=`${a+S.top}px`),h&&(o.style.width=`${h}px`,o.style.setProperty("--mgt-flyout-set-width",`${h}px`),window.requestAnimationFrame(()=>this.updateFlyout())),u&&!e?(o.style.maxHeight=`${u}px`,o.style.setProperty("--mgt-flyout-set-height",`${u}px`)):(o.style.maxHeight=null,o.style.setProperty("--mgt-flyout-set-height","unset")),e&&window.requestAnimationFrame(()=>this.updateFlyout(!1))}}setupWindowEvents(e){e&&this.isLightDismiss?(window.addEventListener("wheel",this.handleWindowEvent),window.addEventListener("pointerdown",this.handleWindowEvent),window.addEventListener("resize",this.handleResize),window.addEventListener("keyup",this.handleKeyUp)):(window.removeEventListener("wheel",this.handleWindowEvent),window.removeEventListener("pointerdown",this.handleWindowEvent),window.removeEventListener("resize",this.handleResize),window.removeEventListener("keyup",this.handleKeyUp))}};YC([E({attribute:"light-dismiss",type:Boolean}),wv("design:type",Boolean)],Id.prototype,"isLightDismiss",void 0);YC([E({attribute:null,type:Boolean}),wv("design:type",Boolean)],Id.prototype,"avoidHidingAnchor",void 0);YC([E({attribute:"isOpen",type:Boolean}),wv("design:type",Boolean),wv("design:paramtypes",[Boolean])],Id.prototype,"isOpen",null)});var UD,BD,Rd,Cv=y(()=>{l();c();d();UD=["none","hover","click"],BD=r=>typeof r=="string"&&UD.includes(r),Rd=(r,e="none")=>BD(r)?r:e});var lP,cP=y(()=>{l();c();d();xe();lP=[Oe` + `}updateFlyout(e=!0){if(!this.isOpen)return;let t=this._anchor,o=this._flyout;if(o&&t){let i=window.innerWidth&&document.documentElement.clientWidth?Math.min(window.innerWidth,document.documentElement.clientWidth):window.innerWidth||document.documentElement.clientWidth;this._windowHeight=window.innerHeight&&document.documentElement.clientHeight?Math.min(window.innerHeight,document.documentElement.clientHeight):window.innerHeight||document.documentElement.clientHeight;let n=0,s,a=0,u,h,p=o.getBoundingClientRect(),f=t.getBoundingClientRect(),b=this._topScout.getBoundingClientRect(),C=this._bottomScout.getBoundingClientRect(),S={height:this._windowHeight,left:0,top:0,width:i};if(QC()){let ie=iP().getWindowSegments(),me,yt=f.left+f.width/2,Ge=f.top+f.height/2;for(let tt of ie)if(yt>=tt.left&&Ge>=tt.top){me=tt;break}me&&(S.left=me.left,S.top=me.top,S.width=me.width,S.height=me.height)}p.width+2*this._edgePadding>S.width?p.width>S.width?(h=S.width,n=0):n=(S.width-p.width)/2:f.left+p.width+this._edgePadding>S.width?n=f.left-(f.left+p.width+this._edgePadding-S.width):f.leftR?(s=S.height-f.top,u=H):(a=f.bottom,u=R):(s=S.height-f.top,u=H):(a=f.bottom,u=R):p.height+2*this._edgePadding>S.height?p.height>=S.height?(u=S.height,a=0):a=(S.height-p.height)/2:f.top+f.height+p.height+this._edgePadding>S.height?a=S.height-p.height-this._edgePadding:a=Math.max(f.top+f.height,this._edgePadding),(b.top!==0||b.left!==0)&&(n-=b.left,typeof s<"u"?s+=C.top-this._windowHeight:a-=b.top),this.direction==="rtl"?n>100&&this.offsetLeft>100&&(o.style.left=`${S.width-n+p.left-p.width-30}px`):o.style.left=`${n+S.left}px`,typeof s<"u"?(o.style.top="unset",o.style.bottom=`${s}px`):(o.style.bottom="unset",o.style.top=`${a+S.top}px`),h&&(o.style.width=`${h}px`,o.style.setProperty("--mgt-flyout-set-width",`${h}px`),window.requestAnimationFrame(()=>this.updateFlyout())),u&&!e?(o.style.maxHeight=`${u}px`,o.style.setProperty("--mgt-flyout-set-height",`${u}px`)):(o.style.maxHeight=null,o.style.setProperty("--mgt-flyout-set-height","unset")),e&&window.requestAnimationFrame(()=>this.updateFlyout(!1))}}setupWindowEvents(e){e&&this.isLightDismiss?(window.addEventListener("wheel",this.handleWindowEvent),window.addEventListener("pointerdown",this.handleWindowEvent),window.addEventListener("resize",this.handleResize),window.addEventListener("keyup",this.handleKeyUp)):(window.removeEventListener("wheel",this.handleWindowEvent),window.removeEventListener("pointerdown",this.handleWindowEvent),window.removeEventListener("resize",this.handleResize),window.removeEventListener("keyup",this.handleKeyUp))}};YC([E({attribute:"light-dismiss",type:Boolean}),wv("design:type",Boolean)],Id.prototype,"isLightDismiss",void 0);YC([E({attribute:null,type:Boolean}),wv("design:type",Boolean)],Id.prototype,"avoidHidingAnchor",void 0);YC([E({attribute:"isOpen",type:Boolean}),wv("design:type",Boolean),wv("design:paramtypes",[Boolean])],Id.prototype,"isOpen",null)});var UD,BD,Rd,Cv=y(()=>{l();c();d();UD=["none","hover","click"],BD=r=>typeof r=="string"&&UD.includes(r),Rd=(r,e="none")=>BD(r)?r:e});var lP,cP=y(()=>{l();c();d();xe();lP=[Oe` :host([hidden]){display:none}:host{display:block;font-family:var(--default-font-family, "Segoe UI", "Segoe UI Web (West European)", "Segoe UI", -apple-system, "BlinkMacSystemFont", "Roboto", "Helvetica Neue", sans-serif);font-size:var(--default-font-size, 14px);--theme-primary-color:#0078d7;--theme-dark-color:#005a9e}:focus-visible{outline-color:var(--focus-ring-color,Highlight);outline-color:var(--focus-ring-color,-webkit-focus-ring-color);outline-style:var(--focus-ring-style,auto)}.ms-icon{display:inline-block;font-family:FabricMDL2Icons;font-style:normal;font-weight:400;font-size:16px;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;margin:4px 0}.error{background-color:#fde7e9;padding-block:8px;padding-inline:8px 12px}.ms-icon-chevron-down::before{content:"\\\e70d"}.ms-icon-chevron-up::before{content:"\\\e70e"}.ms-icon-contact::before{content:"\\\e77b"}.ms-icon-add-friend::before{content:"\\\e8fa"}.ms-icon-outlook-logo-inverser::before{content:"\\\eb6d"}:host{font-size:var(--default-font-size)}:host .flyout [slot=anchor]{display:flex;cursor:pointer}:host .flyout [slot=anchor].vertical{flex-direction:column;justify-content:center;align-items:center;margin-inline-start:0}:host .person-root{display:flex;flex-direction:row;align-items:center;background-color:var(--person-background-color,transparent);border-radius:var(--person-border-radius,4px)}:host .person-root.small .avatar-wrapper{min-width:var(--person-avatar-size,24px);width:var(--person-avatar-size,24px);height:var(--person-avatar-size,24px)}:host .person-root.small .contact-icon,:host .person-root.small .initials{font-size:calc(var(--person-avatar-size, 24px) * .4)}:host .person-root.small .presence-wrapper svg{width:calc(var(--person-avatar-size,24px) * .28);height:calc(var(--person-avatar-size,24px) * .28)}:host .person-root.noline .avatar-wrapper,:host .person-root.oneline .avatar-wrapper{min-width:var(--person-avatar-size,24px);width:var(--person-avatar-size,24px);height:var(--person-avatar-size,24px)}:host .person-root.noline .avatar-wrapper .contact-icon,:host .person-root.noline .avatar-wrapper .initials,:host .person-root.oneline .avatar-wrapper .contact-icon,:host .person-root.oneline .avatar-wrapper .initials{font-size:calc(var(--person-avatar-size, 24px) * .4)}:host .person-root.noline .avatar-wrapper .presence-wrapper svg,:host .person-root.oneline .avatar-wrapper .presence-wrapper svg{width:calc(var(--person-avatar-size,24px) * .28);height:calc(var(--person-avatar-size,24px) * .28)}:host .person-root.noline .presence-basic,:host .person-root.oneline .presence-basic{border-width:1px;position:relative;bottom:calc(var(--person-avatar-size,24px) * .12 - 4px)}:host .person-root.twolines .avatar-wrapper{min-width:var(--person-avatar-size,40px);width:var(--person-avatar-size,40px);height:var(--person-avatar-size,40px)}:host .person-root.twolines .avatar-wrapper .contact-icon,:host .person-root.twolines .avatar-wrapper .initials{font-size:calc(var(--person-avatar-size, 40px) * .4)}:host .person-root.twolines .avatar-wrapper .presence-wrapper svg{width:calc(var(--person-avatar-size,40px) * .28);height:calc(var(--person-avatar-size,40px) * .28)}:host .person-root.large .avatar-wrapper,:host .person-root.threelines .avatar-wrapper{min-width:var(--person-avatar-size,56px);width:var(--person-avatar-size,56px);height:var(--person-avatar-size,56px)}:host .person-root.large .avatar-wrapper .contact-icon,:host .person-root.large .avatar-wrapper .initials,:host .person-root.threelines .avatar-wrapper .contact-icon,:host .person-root.threelines .avatar-wrapper .initials{font-size:calc(var(--person-avatar-size, 56px) * .4)}:host .person-root.large .avatar-wrapper .presence-wrapper svg,:host .person-root.threelines .avatar-wrapper .presence-wrapper svg{width:calc(var(--person-avatar-size,56px) * .28);height:calc(var(--person-avatar-size,56px) * .28)}:host .person-root.fourlines .avatar-wrapper,:host .person-root.vertical .avatar-wrapper{min-width:var(--person-avatar-size,72px);width:var(--person-avatar-size,72px);height:var(--person-avatar-size,72px)}:host .person-root.fourlines .avatar-wrapper .contact-icon,:host .person-root.fourlines .avatar-wrapper .initials,:host .person-root.vertical .avatar-wrapper .contact-icon,:host .person-root.vertical .avatar-wrapper .initials{font-size:calc(var(--person-avatar-size, 72px) * .4)}:host .person-root.fourlines .avatar-wrapper .presence-wrapper svg,:host .person-root.vertical .avatar-wrapper .presence-wrapper svg{width:calc(var(--person-avatar-size,72px) * .28);height:calc(var(--person-avatar-size,72px) * .28)}:host .person-root.vertical{flex-direction:column;justify-content:center;align-items:center}:host .person-root .avatar-wrapper{min-width:var(--person-avatar-size,24px);width:var(--person-avatar-size,24px);height:var(--person-avatar-size,24px);position:relative;box-sizing:border-box}:host .person-root .avatar-wrapper .contact-icon,:host .person-root .avatar-wrapper .initials,:host .person-root .avatar-wrapper .shimmer,:host .person-root .avatar-wrapper img{height:100%;width:100%;border:var(--person-avatar-border,none);border-radius:var(--person-avatar-border-radius,50%);margin-block-start:var(--person-avatar-top-spacing,0);object-fit:cover;object-position:center top}:host .person-root .avatar-wrapper .contact-icon,:host .person-root .avatar-wrapper .initials,:host .person-root .avatar-wrapper .shimmer{display:flex;justify-content:center;align-items:center;font-size:calc(var(--person-avatar-size, 24px) * .4);font-weight:400;background:var(--person-initials-background-color,var(--neutral-fill-secondary-rest));color:var(--person-initials-text-color,var(--neutral-fill-strong-hover))}:host .person-root .avatar-wrapper .presence-wrapper{bottom:var(--person-presence-wrapper-bottom,0);right:0;position:absolute;border-radius:50%;background-color:var(--neutral-layer-1);border:1px solid var(--neutral-layer-1)}:host .person-root .avatar-wrapper .presence-wrapper svg{display:flex;width:calc(var(--person-avatar-size,24px) * .28);height:calc(var(--person-avatar-size,24px) * .28)}:host .person-root .details-wrapper{display:flex;flex-direction:column;align-items:flex-start;justify-content:center;min-width:var(--person-details-wrapper-width,168px);margin-inline-start:var(--person-details-left-spacing,12px);margin-block-end:var(--person-details-bottom-spacing,0)}:host .person-root .details-wrapper .shimmer.text{width:200px;height:16px;margin:2px 0}:host .person-root .details-wrapper.vertical{display:inline-flex;flex-direction:column;justify-content:center;align-items:center;margin-inline-start:0}:host .person-root .details-wrapper .line1{font-size:var(--person-line1-font-size, ms-font-size-14);font-weight:var(--person-line1-font-weight,600);color:var(--person-line1-text-color,var(--neutral-foreground-rest));text-transform:var(--person-line1-text-transform,inherit);line-height:var(--person-line1-text-line-height, 20px)}:host .person-root .details-wrapper .line2{font-size:var(--person-line2-font-size, var(--email-font-size, ms-font-size-12));font-weight:var(--person-line2-font-weight,400);color:var(--person-line2-text-color,var(--secondary-text-color));text-transform:var(--person-line2-text-transform,inherit);line-height:var(--person-line2-text-line-height, 16px)}:host .person-root .details-wrapper .line3{font-size:var(--person-line3-font-size, var(--email-font-size, ms-font-size-12));font-weight:var(--person-line3-font-weight,400);color:var(--person-line3-text-color,var(--secondary-text-color));text-transform:var(--person-line3-text-transform,inherit);line-height:var(--person-line3-text-line-height, 16px)}:host .person-root .details-wrapper .line4{font-size:var(--person-line4-font-size, var(--email-font-size, ms-font-size-12));font-weight:var(--person-line4-font-weight,400);color:var(--person-line4-text-color,var(--secondary-text-color));text-transform:var(--person-line4-text-transform,inherit);line-height:var(--person-line4-text-line-height, 16px)}@media (forced-colors:active) and (prefers-color-scheme:dark){:host svg,:host svg>path{fill:rgb(255,255,255);fill-rule:nonzero;clip-rule:nonzero}}[dir=rtl] .presence-wrapper{right:unset!important;left:0} `]});var zD,VD,dP,xv=y(()=>{l();c();d();zD=["photo","initials"],VD=r=>typeof r=="string"&&zD.includes(r),dP=(r,e="photo")=>VD(r)?r:e});var qD,uP,hP=y(()=>{l();c();d();qD={Available:"Available",Away:"Away",BeRightBack:"Be right back",Busy:"Busy",DoNotDisturb:"Do not disturb",InACall:"In a call",InAConferenceCall:"In a conference call",Inactive:"Inactive",InAMeeting:"In a meeting",Offline:"Offline",OffWork:"Off work",OutOfOffice:"Out of office",PresenceUnknown:"Presence unknown",Presenting:"Presenting",UrgentInterruptionsOnly:"Urgent interruptions only"},uP=Object.assign(Object.assign({},qD),{photoFor:"Photo for",emailAddress:"Email address"})});var Ut,zh=y(()=>{l();c();d();Ut=class{};Ut.sections={files:!0,mailMessages:!0,organization:{showWorksWith:!0},profile:!0};Ut.useContactApis=!0;Ut.isSendMessageVisible=!0});var qe,pP,kv,fP,nc,GD,Vh,Sv,Ba,_v,So,mP,gP,vP,yP,bP,wP,CP,xP,kP,SP,_P,TP,EP,Hi,IP,AP,RP,PP,$P,OP,MP,DP,FP,LP,NP,HP,UP,BP,zP,VP,jD,KD,WD,ZC,JC,qP,GP,jP,KP,WP,QP,Pd=y(()=>{l();c();d();ge();Ni();Za();Jo();qe=function(r,e,t,o){function i(n){return n instanceof t?n:new t(function(s){s(n)})}return new(t||(t=Promise))(function(n,s){function a(p){try{h(o.next(p))}catch(f){s(f)}}function u(p){try{h(o.throw(p))}catch(f){s(f)}}function h(p){p.done?n(p.value):i(p.value).then(a,u)}h((o=o.apply(r,e||[])).next())})},pP=r=>Array.isArray(r.nextExpectedRanges),kv=()=>qe(void 0,void 0,void 0,function*(){yield W.getCache(N.fileLists,N.fileLists.stores.fileLists).clearStore()}),fP=()=>W.config.files.invalidationPeriod||W.config.defaultInvalidationPeriod,nc=()=>W.config.files.isEnabled&&W.config.isEnabled,GD=()=>W.config.fileLists.invalidationPeriod||W.config.defaultInvalidationPeriod,Vh=()=>W.config.fileLists.isEnabled&&W.config.isEnabled,Sv=["Files.Read","Files.ReadWrite","Files.Read.All","Files.ReadWrite.All","Group.Read.All","Group.ReadWrite.All","Sites.Read.All","Sites.ReadWrite.All"],Ba=["Sites.Read.All","Sites.ReadWrite.All"],_v=["Files.ReadWrite","Files.ReadWrite.All","Sites.ReadWrite.All"],So=(r,e,t=N.files.stores.fileQueries,o=Sv)=>qe(void 0,void 0,void 0,function*(){let i=W.getCache(N.files,t),n=yield WD(i,e);if(n)return n;let s;try{s=yield r.api(e).middlewareOptions(be(o)).get(),nc()&&(yield i.putValue(e,{file:JSON.stringify(s)}))}catch{}return s||null}),mP=(r,e,t)=>qe(void 0,void 0,void 0,function*(){let o=`/drives/${e}/items/${t}`;return So(r,o,N.files.stores.driveFiles)}),gP=(r,e,t)=>qe(void 0,void 0,void 0,function*(){let o=`/drives/${e}/root:/${t}`;return So(r,o,N.files.stores.driveFiles)}),vP=(r,e,t)=>qe(void 0,void 0,void 0,function*(){let o=`/groups/${e}/drive/items/${t}`;return So(r,o,N.files.stores.groupFiles)}),yP=(r,e,t)=>qe(void 0,void 0,void 0,function*(){let o=`/groups/${e}/drive/root:/${t}`;return So(r,o,N.files.stores.groupFiles)}),bP=(r,e)=>qe(void 0,void 0,void 0,function*(){let t=`/me/drive/items/${e}`;return So(r,t,N.files.stores.userFiles)}),wP=(r,e)=>qe(void 0,void 0,void 0,function*(){let t=`/me/drive/root:/${e}`;return So(r,t,N.files.stores.userFiles)}),CP=(r,e,t)=>qe(void 0,void 0,void 0,function*(){let o=`/sites/${e}/drive/items/${t}`;return So(r,o,N.files.stores.siteFiles)}),xP=(r,e,t)=>qe(void 0,void 0,void 0,function*(){let o=`/sites/${e}/drive/root:/${t}`;return So(r,o,N.files.stores.siteFiles)}),kP=(r,e,t,o)=>qe(void 0,void 0,void 0,function*(){let i=`/sites/${e}/lists/${t}/items/${o}/driveItem`;return So(r,i,N.files.stores.siteFiles)}),SP=(r,e,t)=>qe(void 0,void 0,void 0,function*(){let o=`/users/${e}/drive/items/${t}`;return So(r,o,N.files.stores.userFiles)}),_P=(r,e,t)=>qe(void 0,void 0,void 0,function*(){let o=`/users/${e}/drive/root:/${t}`;return So(r,o,N.files.stores.userFiles)}),TP=(r,e,t)=>qe(void 0,void 0,void 0,function*(){let o=`/me/insights/${e}/${t}/resource`;return So(r,o,N.files.stores.insightFiles,Ba)}),EP=(r,e,t,o)=>qe(void 0,void 0,void 0,function*(){let i=`/users/${e}/insights/${t}/${o}/resource`;return So(r,i,N.files.stores.insightFiles,Ba)}),Hi=(r,e,t,o)=>qe(void 0,void 0,void 0,function*(){let i,n=W.getCache(N.fileLists,t),s=`${e}:${o}`,a=yield ZC(n,t,s);if(a)return i=KD(r,a.files,a.nextLink),i;let u;try{if(u=r.api(e).middlewareOptions(be(Sv)),o&&u.top(o),i=yield jD(r,u),Vh()){let h=i.nextLink;yield n.putValue(s,{files:i.value.map(p=>JSON.stringify(p)),nextLink:h})}}catch{}return i||null}),IP=(r,e)=>qe(void 0,void 0,void 0,function*(){let t="/me/drive/root/children",o=N.fileLists.stores.fileLists;return Hi(r,t,o,e)}),AP=(r,e,t,o)=>qe(void 0,void 0,void 0,function*(){let i=`/drives/${e}/items/${t}/children`,n=N.fileLists.stores.fileLists;return Hi(r,i,n,o)}),RP=(r,e,t,o)=>qe(void 0,void 0,void 0,function*(){let i=`/drives/${e}/root:/${t}:/children`,n=N.fileLists.stores.fileLists;return Hi(r,i,n,o)}),PP=(r,e,t,o)=>qe(void 0,void 0,void 0,function*(){let i=`/groups/${e}/drive/items/${t}/children`,n=N.fileLists.stores.fileLists;return Hi(r,i,n,o)}),$P=(r,e,t,o)=>qe(void 0,void 0,void 0,function*(){let i=`/groups/${e}/drive/root:/${t}:/children`,n=N.fileLists.stores.fileLists;return Hi(r,i,n,o)}),OP=(r,e,t)=>qe(void 0,void 0,void 0,function*(){let o=`/me/drive/items/${e}/children`,i=N.fileLists.stores.fileLists;return Hi(r,o,i,t)}),MP=(r,e,t)=>qe(void 0,void 0,void 0,function*(){let o=`/me/drive/root:/${e}:/children`,i=N.fileLists.stores.fileLists;return Hi(r,o,i,t)}),DP=(r,e,t,o)=>qe(void 0,void 0,void 0,function*(){let i=`/sites/${e}/drive/items/${t}/children`,n=N.fileLists.stores.fileLists;return Hi(r,i,n,o)}),FP=(r,e,t,o)=>qe(void 0,void 0,void 0,function*(){let i=`/sites/${e}/drive/root:/${t}:/children`,n=N.fileLists.stores.fileLists;return Hi(r,i,n,o)}),LP=(r,e,t,o)=>qe(void 0,void 0,void 0,function*(){let i=`/users/${e}/drive/items/${t}/children`,n=N.fileLists.stores.fileLists;return Hi(r,i,n,o)}),NP=(r,e,t,o)=>qe(void 0,void 0,void 0,function*(){let i=`/users/${e}/drive/root:/${t}:/children`,n=N.fileLists.stores.fileLists;return Hi(r,i,n,o)}),HP=(r,e,t)=>qe(void 0,void 0,void 0,function*(){let o=N.fileLists.stores.fileLists;return Hi(r,e,o,t)}),UP=(r,e)=>qe(void 0,void 0,void 0,function*(){let t=`/me/insights/${e}`,o=N.fileLists.stores.insightfileLists,i=W.getCache(N.fileLists,o),n=yield ZC(i,o,t);if(n)return n.files.map(u=>JSON.parse(u));let s;try{s=yield r.api(t).filter("resourceReference/type eq 'microsoft.graph.driveItem'").middlewareOptions(be(Ba)).get()}catch{}let a=yield VP(r,s,Ba);return Vh()&&(yield i.putValue(t,{files:a.map(u=>JSON.stringify(u))})),a||null}),BP=(r,e,t)=>qe(void 0,void 0,void 0,function*(){let o,i;t==="shared"?(o="/me/insights/shared",i=`((lastshared/sharedby/id eq '${e}') and (resourceReference/type eq 'microsoft.graph.driveItem'))`):(o=`/users/${e}/insights/${t}`,i="resourceReference/type eq 'microsoft.graph.driveItem'");let n=`${o}?$filter=${i}`,s=N.fileLists.stores.insightfileLists,a=W.getCache(N.fileLists,s),u=yield ZC(a,s,n);if(u)return u.files.map(f=>JSON.parse(f));let h;try{h=yield r.api(o).filter(i).middlewareOptions(be(Ba)).get()}catch{}let p=yield VP(r,h,Ba);return Vh()&&(yield a.putValue(o,{files:p.map(f=>JSON.stringify(f))})),p||null}),zP=(r,e)=>qe(void 0,void 0,void 0,function*(){if(!e||e.length===0)return[];let t=r.createBatch(),o=[],i,n;nc()&&(i=W.getCache(N.files,N.files.stores.fileQueries));for(let s of e)nc()&&(n=yield i.getValue(s)),nc()&&n&&fP()>Date.now()-n.timeCached?o.push(JSON.parse(n.file)):s!==""&&t.get(s,s,Sv);try{let s=yield t.executeAll();for(let a of e){let u=s.get(a);u?.content&&(o.push(u.content),nc()&&(yield i.putValue(a,{file:JSON.stringify(u.content)})))}return o}catch{try{return Promise.all(e.filter(a=>a&&a!=="").map(a=>qe(void 0,void 0,void 0,function*(){let u=yield So(r,a);if(u)return nc()&&(yield i.putValue(a,{file:JSON.stringify(u)})),u})))}catch{return[]}}}),VP=(r,e,t)=>qe(void 0,void 0,void 0,function*(){if(!e)return[];let o=e.value,i=r.createBatch(),n=[];for(let s of o){let a=s.resourceReference.id;a!==""&&i.get(a,a,t)}try{let s=yield i.executeAll();for(let a of o){let u=s.get(a.resourceReference.id);u?.content&&n.push(u.content)}return n}catch{try{return Promise.all(o.filter(a=>!!a.resourceReference.id).map(a=>qe(void 0,void 0,void 0,function*(){return yield r.api(a.resourceReference.id).middlewareOptions(be(t)).get()})))}catch{return[]}}}),jD=(r,e)=>qe(void 0,void 0,void 0,function*(){return pl.create(r,e)}),KD=(r,e,t)=>pl.createFromValue(r,e.map(o=>JSON.parse(o)),t),WD=(r,e)=>qe(void 0,void 0,void 0,function*(){if(nc()){let t=yield r.getValue(e);if(t&&fP()>Date.now()-t.timeCached)return JSON.parse(t.file)}return null}),ZC=(r,e,t)=>qe(void 0,void 0,void 0,function*(){if(r||(r=W.getCache(N.fileLists,e)),Vh()){let o=yield r.getValue(t);if(o&&GD()>Date.now()-o.timeCached)return o}return null}),JC=r=>qe(void 0,void 0,void 0,function*(){let e=r.nextLink;if(r.hasNext&&(yield r.next()),Vh()){let t=W.getCache(N.fileLists,N.fileLists.stores.fileLists),n=/(graph.microsoft.com\/(v1.0|beta))(.*?)(?=\?)/gi.exec(e)[3];yield t.putValue(n,{files:r.value.map(s=>JSON.stringify(s)),nextLink:e})}}),qP=(r,e,t)=>qe(void 0,void 0,void 0,function*(){try{let o=yield r.api(e).responseType(vr.RAW).middlewareOptions(be(t)).get();if(o.status===404)return{eTag:null,thumbnail:null};if(!o.ok)return null;let i=o.headers.get("eTag"),n=yield lv(yield o.blob());return{eTag:i,thumbnail:n}}catch{return null}}),GP=(r,e)=>qe(void 0,void 0,void 0,function*(){try{return(yield r.api(e).middlewareOptions(be(Sv)).get())||null}catch{}return null}),jP=(r,e,t)=>qe(void 0,void 0,void 0,function*(){try{let o={item:{"@microsoft.graph.conflictBehavior":t||"rename"}},i;try{i=yield r.api(e).middlewareOptions(be(_v)).post(JSON.stringify(o))}catch{}return i||null}catch{return null}}),KP=(r,e,t,o,i)=>qe(void 0,void 0,void 0,function*(){try{let n={"Content-Length":t,"Content-Range":o},s;try{s=yield r.client.api(e).middlewareOptions(be(_v)).headers(n).put(i)}catch{}return s||null}catch{return null}}),WP=(r,e,t)=>qe(void 0,void 0,void 0,function*(){try{let o;try{o=yield r.client.api(e).middlewareOptions(be(_v)).put(t)}catch{}return o||null}catch{return null}}),QP=(r,e)=>qe(void 0,void 0,void 0,function*(){try{yield r.client.api(e).middlewareOptions(be(_v)).delete()}catch{return null}})});var Tv,XC,qh,QD,Ev,YD,ZD,JD,XD,eF,tF,rF,oF,iF,YP,nF,ZP,ex=y(()=>{l();c();d();ge();Us();zh();Ha();Pd();Ni();Tv=function(r,e,t,o){function i(n){return n instanceof t?n:new t(function(s){s(n)})}return new(t||(t=Promise))(function(n,s){function a(p){try{h(o.next(p))}catch(f){s(f)}}function u(p){try{h(o.throw(p))}catch(f){s(f)}}function h(p){p.done?n(p.value):i(p.value).then(a,u)}h((o=o.apply(r,e||[])).next())})},XC="businessPhones,companyName,department,displayName,givenName,jobTitle,mail,mobilePhone,officeLocation,preferredLanguage,surname,userPrincipalName,id,accountEnabled",qh={directReports:"directReports",files:"files",messages:"messages",people:"people",person:"person"},QD=()=>W.config.users.invalidationPeriod||W.config.defaultInvalidationPeriod,Ev=(r,e,t)=>Tv(void 0,void 0,void 0,function*(){var o;let i=e?.id||e?.userPrincipalName,n=Fo(e),s=W.getCache(N.users,N.users.stores.cardState),a=yield s.getValue(i);if(a&&QD()>Date.now()-a.timeCached)return a;let u="classification"in e||"personType"in e&&(e.personType.subclass==="PersonalContact"||e.personType.class==="Group"),h=r.createBatch();u||Ut.sections.organization&&(YD(h,i),Ut.sections.organization.showWorksWith&&JD(h,i)),Ut.sections.mailMessages&&n&&eF(h,n),Ut.sections.files&&tF(h,t?null:n);let p,f={};try{p=yield h.executeAll()}catch{}if(p)for(let[b,C]of p)f[b]=((o=C.content)===null||o===void 0?void 0:o.value)||C.content;if(!u&&Ut.sections.profile)try{let b=yield oF(r,i);b&&(f.profile=b)}catch{}return f.directReports&&f.directReports.length>0&&(f.directReports=f.directReports.filter(b=>b.accountEnabled)),yield s.putValue(i,f),f}),YD=(r,e)=>{let t=`manager($levels=max;$select=${XC})`;r.get(qh.person,`users/${e}?$expand=${t}&$select=${XC}&$count=true`,Sd,{ConsistencyLevel:"eventual"}),r.get(qh.directReports,`users/${e}/directReports?$select=${XC}`)},ZD=["People.Read.All"],JD=(r,e)=>{r.get(qh.people,`users/${e}/people?$filter=personType/class eq 'Person'`,ZD)},XD=["Mail.ReadBasic","Mail.Read","Mail.ReadWrite"],eF=(r,e)=>{r.get(qh.messages,`me/messages?$search="from:${e}"`,XD)},tF=(r,e)=>{let t;e?t=`me/insights/shared?$filter=lastshared/sharedby/address eq '${e}'`:t="me/insights/used",r.get(qh.files,t,Ba)},rF=["User.Read.All","User.ReadWrite.All"],oF=(r,e)=>Tv(void 0,void 0,void 0,function*(){return yield r.api(`/users/${e}/profile`).version("beta").middlewareOptions(be(rF)).get()}),iF=["Chat.Create","Chat.ReadWrite"],YP=(r,e,t)=>Tv(void 0,void 0,void 0,function*(){let o={chatType:"oneOnOne",members:[{"@odata.type":"#microsoft.graph.aadUserConversationMember",roles:["owner"],"user@odata.bind":`https://graph.microsoft.com/v1.0/users('${t}')`},{"@odata.type":"#microsoft.graph.aadUserConversationMember",roles:["owner"],"user@odata.bind":`https://graph.microsoft.com/v1.0/users('${e}')`}]};return yield r.api("/chats").header("Cache-Control","no-store").middlewareOptions(be(iF)).post(o)}),nF=["ChatMessage.Send","Chat.ReadWrite"],ZP=(r,e,t)=>Tv(void 0,void 0,void 0,function*(){return yield r.api(`/chats/${e}/messages`).header("Cache-Control","no-store").middlewareOptions(be(nF)).post(t)})});var JP,XP=y(()=>{l();c();d();xe();JP=[Oe` :host([hidden]){display:none}:host{display:block;font-family:var(--default-font-family, "Segoe UI", "Segoe UI Web (West European)", "Segoe UI", -apple-system, "BlinkMacSystemFont", "Roboto", "Helvetica Neue", sans-serif);font-size:var(--default-font-size, 14px);--theme-primary-color:#0078d7;--theme-dark-color:#005a9e}:focus-visible{outline-color:var(--focus-ring-color,Highlight);outline-color:var(--focus-ring-color,-webkit-focus-ring-color);outline-style:var(--focus-ring-style,auto)}.ms-icon{display:inline-block;font-family:FabricMDL2Icons;font-style:normal;font-weight:400;font-size:16px;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;margin:4px 0}.error{background-color:#fde7e9;padding-block:8px;padding-inline:8px 12px}.ms-icon-chevron-down::before{content:"\\\e70d"}.ms-icon-chevron-up::before{content:"\\\e70e"}.ms-icon-contact::before{content:"\\\e77b"}.ms-icon-add-friend::before{content:"\\\e8fa"}.ms-icon-outlook-logo-inverser::before{content:"\\\eb6d"}:host{box-shadow:var(--person-card-box-shadow,var(--elevation-shadow-card-rest));width:var(--mgt-flyout-set-width,375px);overflow:hidden;user-select:none;border-radius:8px;background-color:var(--person-card-background-color,var(--neutral-layer-floating));--file-list-background-color:transparent;--file-list-box-shadow:none;--file-item-background-color:transparent}:host .small{max-height:100vh;overflow:hidden auto}:host .nav{height:0;position:relative;z-index:100}:host .nav__back{padding-top:18px;padding-inline-start:12px;height:32px;width:32px}:host .nav__back svg{fill:var(--person-card-icon-color,var(--accent-foreground-rest))}:host .nav__back:hover{cursor:pointer}:host .nav__back:hover svg{fill:var(--person-card-nav-back-arrow-hover-color,var(--neutral-foreground-rest))}:host .close-card-container{position:relative;z-index:100}:host .close-card-container .close-button{position:absolute;right:10px;margin-top:9px;z-index:1;border:1px solid transparent}:host .close-card-container .close-button svg path{fill:var(--person-card-icon-color,var(--accent-foreground-rest))}:host .close-card-container .close-button:hover svg path{fill:var(--person-card-close-button-hover-color,var(--neutral-foreground-rest))}:host .person-details-container{display:flex;flex-direction:column;padding-inline-start:22px;padding-block:36px;border-bottom:1px solid var(--person-card-border-color,var(--neutral-stroke-rest))}:host .person-details-container .person-image{--person-avatar-top-spacing:var(--person-card-avatar-top-spacing, 15px);--person-details-left-spacing:var(--person-card-details-left-spacing, 15px);--person-details-bottom-spacing:var(--person-card-details-bottom-spacing, 0);--person-background-color:var(--person-card-background-color, var(--neutral-layer-floating));--person-line1-font-size:var(--person-card-line1-font-size, 20px);--person-line1-font-weight:var(--person-card-line1-font-weight, 600);--person-line1-text-line-height:var(--person-card-line1-line-height, 28px);--person-line1-text-color:var(--person-card-line1-text-color, var(--neutral-foreground-rest));--person-line2-font-size:var(--person-card-line2-font-size, 14px);--person-line2-font-weight:var(--person-card-line2-font-weight, 400);--person-line2-text-line-height:var(--person-card-line2-line-height, 20px);--person-line2-text-color:var(--person-card-line2-text-color, var(--neutral-foreground-hint));--person-line3-font-size:var(--person-card-line3-font-size, 14px);--person-line3-font-weight:var(--person-card-line3-font-weight, 400);--person-line3-text-line-height:var(--person-card-line3-line-height, 19px);--person-line3-text-color:var(--person-card-line3-text-color, var(--neutral-foreground-hint));--person-avatar-size:var(--person-card-avatar-size, 75px);--person-presence-wrapper-bottom:-15px}:host .person-details-container .base-icons{display:flex;align-items:center;margin-inline-start:var(--person-card-base-icons-left-spacing,calc(var(--person-card-avatar-size,75px) + var(--person-card-details-left-spacing,15px) - 8px));z-index:1}:host .person-details-container .base-icons .icon{display:flex;align-items:center;font-size:13px;white-space:nowrap}:host .person-details-container .base-icons .icon:not(:last-child){margin-inline-end:28px}:host .person-details-container .base-icons .icon svg .filled{display:none}:host .person-details-container .base-icons .icon svg .regular{display:block}:host .person-details-container .base-icons .icon svg path{fill:var(--person-card-icon-color,var(--accent-foreground-rest))}:host .person-details-container .base-icons .icon:active svg .filled,:host .person-details-container .base-icons .icon:hover svg .filled{display:block}:host .person-details-container .base-icons .icon:active svg .regular,:host .person-details-container .base-icons .icon:hover svg .regular{display:none}:host .person-details-container .base-icons .icon:active svg path,:host .person-details-container .base-icons .icon:hover svg path{fill:var(--person-card-icon-hover-color,var(--accent-foreground-hover))}:host .expanded-details-container{display:flex;flex-direction:column;position:relative}:host .expanded-details-container .expanded-details-button{display:flex;justify-content:center;height:32px}:host .expanded-details-container .expanded-details-button svg path{stroke:var(--person-card-icon-color,var(--accent-foreground-rest))}:host .expanded-details-container .expanded-details-button:hover{cursor:pointer;background-color:var(--person-card-expanded-background-color-hover,var(--neutral-fill-hover))}:host .expanded-details-container .sections .section{padding:20px 0;display:flex;flex-direction:column;position:relative}:host .expanded-details-container .sections .section:not(:last-child)::after{position:absolute;content:"";width:90%;transform:translateX(-50%);border-bottom:1px solid var(--person-card-border-color,var(--neutral-stroke-rest));left:50%;bottom:0}:host .expanded-details-container .sections .section__header{display:flex;flex-direction:row;padding:0 20px}:host .expanded-details-container .sections .section__title{flex-grow:1;color:var(--person-card-line1-text-color,var(--neutral-foreground-rest));font-size:14px;font-weight:600;line-height:19px}:host .expanded-details-container .sections .section__show-more{font-size:12px;font-weight:600;align-self:center;vertical-align:top;--base-height-multiplier:6}:host .expanded-details-container .sections .section__show-more:hover{background-color:var(--person-card-fluent-background-color-hover,var(--neutral-fill-hover))}:host .expanded-details-container .sections .section__content{margin-top:14px}:host .expanded-details-container .sections .section .additional-details{padding:0 20px}:host .expanded-details-container .divider{z-index:100;position:relative;width:375px;margin:0;border-style:none;border-bottom:1px solid var(--person-card-border-color,var(--neutral-stroke-rest))}:host .expanded-details-container .section-nav{height:35px}:host .expanded-details-container .section-nav fluent-tabs{grid-template-columns:minmax(1px,0.1fr)}:host .expanded-details-container .section-nav fluent-tabs.horizontal::part(activeIndicator){width:10px}:host .expanded-details-container .section-nav fluent-tabs fluent-tab-panel{max-height:360px;min-height:360px;overflow:hidden auto;padding:0;scrollbar-width:thin}:host .expanded-details-container .section-nav fluent-tabs fluent-tab-panel .inserted{padding:20px 0;max-width:var(--mgt-flyout-set-width,375px);min-width:var(--mgt-flyout-set-width,360px);--file-list-box-shadow:none;--file-list-padding:0}:host .expanded-details-container .section-nav fluent-tabs fluent-tab-panel .inserted .title{font-size:14px;font-weight:600;color:var(--title-color-subtitle,var(--neutral-foreground-rest,#1a1a1a));margin:0 20px 20px;line-height:19px}:host .expanded-details-container .section-nav fluent-tabs fluent-tab-panel .overview-panel{max-width:var(--mgt-flyout-set-width,375px)}:host .expanded-details-container .section-nav fluent-tabs fluent-tab-panel::-webkit-scrollbar{height:4em;width:4px;border-radius:11px}:host .expanded-details-container .section-nav fluent-tabs fluent-tab-panel::-webkit-scrollbar-button{height:1px}:host .expanded-details-container .section-nav fluent-tabs fluent-tab-panel::-webkit-scrollbar-track{border-radius:10px}:host .expanded-details-container .section-nav fluent-tabs fluent-tab-panel::-webkit-scrollbar-thumb{background:grey;border-radius:10px;height:4px}:host .expanded-details-container .section-nav fluent-tabs fluent-tab{padding-bottom:1px!important;border:1px solid transparent!important}:host .expanded-details-container .section-nav fluent-tabs fluent-tab:focus-visible{border:1px solid #2b2b2b!important}:host .expanded-details-container .section-nav fluent-tabs fluent-tab.section-nav__icon{cursor:pointer;box-sizing:border-box;width:53px;height:36px;display:flex;align-items:center;justify-content:center}:host .expanded-details-container .section-nav fluent-tabs fluent-tab.section-nav__icon svg{fill:var(--person-card-fluent-background-color,transparent)}:host .expanded-details-container .section-nav fluent-tabs fluent-tab.section-nav__icon:hover{background:var(--person-card-fluent-background-color-hover,var(--neutral-fill-hover));border-radius:4px;z-index:0;position:relative}:host .expanded-details-container .section-host{min-height:360px;overflow:hidden auto}:host .expanded-details-container .section-host::-webkit-scrollbar{height:4em;width:4px;border-radius:11px}:host .expanded-details-container .section-host::-webkit-scrollbar-button{background:#fff}:host .expanded-details-container .section-host::-webkit-scrollbar-track{background:#fff;border-radius:10px}:host .expanded-details-container .section-host::-webkit-scrollbar-track-piece{background:#fff}:host .expanded-details-container .section-host::-webkit-scrollbar-thumb{background:grey;border-radius:10px;height:4px}:host .expanded-details-container .section-host.small{overflow-y:hidden}:host .loading{margin:40px 20px;display:flex;justify-content:center;height:360px}:host .message-section{border-bottom:1px solid var(--person-card-chat-input-border-color,var(--neutral-foreground-hint));display:flex}:host .message-section fluent-text-field{margin:10px 10px 10px 16px;--neutral-fill-input-rest:$person-card-background-color;--neutral-fill-input-hover:$person-card-chat-input-hover-color;--neutral-fill-input-focus:$person-card-chat-input-focus-color;width:300px;margin-inline-start:16px;border-radius:4px;border:1px solid var(--person-card-chat-input-border-color,var(--neutral-foreground-hint))}:host .message-section .send-message-icon{max-width:15px;margin-top:10px}:host .message-section svg{height:17px;width:16px;fill:var(--person-card-chat-input-border-color,var(--neutral-foreground-hint))}:host .message-section svg:hover{filter:brightness(.5)}:host .message-section svg:disabled{filter:none}:host .person-root.large,:host .person-root.threelines{--person-avatar-size-3-lines:75px}:host fluent-button.close-button.lightweight::part(control),:host fluent-button.expanded-details-button::part(control),:host fluent-button.section__show-more.lightweight::part(control){background:var(--person-card-fluent-background-color,transparent)}:host fluent-button.icon::part(control),:host fluent-button.nav__back::part(control){border:none;padding:0;background:0 0}:host fluent-button.icon::part(control) :hover,:host fluent-button.nav__back::part(control) :hover{background:0 0}[dir=rtl] .base-icons{right:91px}[dir=rtl] .nav__back{width:20px!important;transform:scaleX(-1);filter:fliph;filter:"FlipH"}[dir=rtl] .close-card-container .close-button{right:auto;left:10px}[dir=rtl] .message-section svg{transform:scale(-1,1)}@media (forced-colors:active) and (prefers-color-scheme:dark){.root{border:1px solid #fff;border-radius:inherit}.root svg,.root svg>path{fill:rgb(255,255,255)!important;fill-rule:nonzero!important;clip-rule:nonzero!important}.expanded-details-container>svg,.expanded-details-container>svg>path,svg,svg>path{fill:rgb(255,255,255)!important;fill-rule:nonzero!important;clip-rule:nonzero!important}}@media (forced-colors:active) and (prefers-color-scheme:light){.root{border:1px solid #000;border-radius:inherit}.root svg,.root svg>path{fill:rgb(0,0,0)!important;fill-rule:nonzero!important;clip-rule:nonzero!important}.expanded-details-container>svg,.expanded-details-container>svg>path,svg,svg>path{fill:rgb(0,0,0)!important;fill-rule:nonzero!important;clip-rule:nonzero!important}} @@ -5528,7 +5528,7 @@ ${de("inline-block")} :host {
${t}
- `}loadState(){return lF(this,void 0,void 0,function*(){if(this.fileDetails){this.driveItem=this.fileDetails;return}let e=V.globalProvider;if(!e||e.state===ie.Loading)return;if(e.state===ie.SignedOut){this.driveItem=null;return}let t=e.graph.forComponent(this),o,i=!this.driveId&&!this.siteId&&!this.groupId&&!this.listId&&!this.userId;this.driveId&&!this.itemId&&!this.itemPath||this.siteId&&!this.itemId&&!this.itemPath||this.groupId&&!this.itemId&&!this.itemPath||this.listId&&!this.siteId&&!this.itemId||this.insightType&&!this.insightId||this.userId&&!this.itemId&&!this.itemPath&&!this.insightType&&!this.insightId?o=null:this.fileQuery?o=yield So(t,this.fileQuery):this.itemId&&i?o=yield bP(t,this.itemId):this.itemPath&&i?o=yield wP(t,this.itemPath):this.userId?this.itemId?o=yield SP(t,this.userId,this.itemId):this.itemPath?o=yield _P(t,this.userId,this.itemPath):this.insightType&&this.insightId&&(o=yield EP(t,this.userId,this.insightType,this.insightId)):this.driveId?this.itemId?o=yield mP(t,this.driveId,this.itemId):this.itemPath&&(o=yield gP(t,this.driveId,this.itemPath)):this.siteId&&!this.listId?this.itemId?o=yield CP(t,this.siteId,this.itemId):this.itemPath&&(o=yield xP(t,this.siteId,this.itemPath)):this.listId?o=yield kP(t,this.siteId,this.listId,this.itemId):this.groupId?this.itemId?o=yield vP(t,this.groupId,this.itemId):this.itemPath&&(o=yield yP(t,this.groupId,this.itemPath)):this.insightType&&!this.userId&&(o=yield TP(t,this.insightType,this.insightId)),this.driveItem=o})}getTextFromProperty(e,t){if(!t||t.length===0)return null;let o=t.trim().split(","),i,n=0;for(;!i&&nEd(r,"threelines")}),ho("design:type",String)],dr.prototype,"view",void 0)});var S$,_$,ac,nx,cF,dF,uF,T$,hF,Wh,sx=y(()=>{l();c();d();cr();ge();xe();gt();pi();Pd();Or();Qr();Jo();g$();v$();ge();Od();S$=function(r,e,t,o){var i=arguments.length,n=i<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,t):o,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(r,e,t,o);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(n=(i<3?s(n):i>3?s(e,t,n):s(e,t))||n);return i>3&&n&&Object.defineProperty(e,t,n),n},_$=function(r,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(r,e)},ac=function(r,e,t,o){function i(n){return n instanceof t?n:new t(function(s){s(n)})}return new(t||(t=Promise))(function(n,s){function a(p){try{h(o.next(p))}catch(f){s(f)}}function u(p){try{h(o.throw(p))}catch(f){s(f)}}function h(p){p.done?n(p.value):i(p.value).then(a,u)}h((o=o.apply(r,e||[])).next())})},nx=r=>r.isDirectory,cF=r=>r.isFile,dF=r=>"getAsEntry"in r&&typeof r.getAsEntry=="function",uF=r=>"getAsFile"in r&&typeof r.getAsFile=="function"||"webkitGetAsEntry"in r&&typeof r.webkitGetAsEntry=="function",T$=()=>{at(pC,$r,Yl,Zw),qs(),Re("file-upload",Wh)},hF=r=>r?.length>1?r[1]==="replace"?"replace":"rename":null,Wh=class extends kn{static get styles(){return m$}get strings(){return Bt}static get requiredScopes(){return[...new Set(["files.readwrite","files.readwrite.all","sites.readwrite.all"])]}get _dropEffect(){return"copy"}constructor(){super(),this._dragCounter=0,this._maxChunkSize=4*1024*1024,this._dialogTitle="",this._dialogContent="",this._dialogPrimaryButton="",this._dialogSecondaryButton="",this._dialogCheckBox="",this._applyAll=!1,this._applyAllConflictBehavior=null,this._maximumFileSize=!1,this._excludedFileType=!1,this.onFileUploadChange=e=>{let t=e.target;!e||t.files.length<1||this.readUploadedFiles(t.files,()=>t.value=null)},this.onFileUploadClick=()=>{this.renderRoot.querySelector("#file-upload-input").click()},this.handleonDragOver=e=>{e.preventDefault(),e.stopPropagation(),e.dataTransfer.items&&e.dataTransfer.items.length>0&&(e.dataTransfer.dropEffect=e.dataTransfer.dropEffect=this._dropEffect)},this.handleonDragEnter=e=>{e.preventDefault(),e.stopPropagation(),this._dragCounter++,e.dataTransfer.items&&e.dataTransfer.items.length>0&&(e.dataTransfer.dropEffect=this._dropEffect,this.renderRoot.querySelector("#file-upload-border").classList.add("visible"))},this.handleonDragLeave=e=>{e.preventDefault(),e.stopPropagation(),this._dragCounter--,this._dragCounter===0&&this.renderRoot.querySelector("#file-upload-border").classList.remove("visible")},this.handleonDrop=e=>{var t;e.preventDefault(),e.stopPropagation();let o=()=>{e.dataTransfer.clearData()};this.renderRoot.querySelector("#file-upload-border").classList.remove("visible"),!((t=e.dataTransfer)===null||t===void 0)&&t.items&&this.readUploadedFiles(e.dataTransfer.items,o),this._dragCounter=0},this.filesToUpload=[],this.addEventListener("__uploadfailed",this.focusOnUpload),this.addEventListener("__uploadsuccess",this.focusOnUpload)}focusOnUpload(){let e=this.renderRoot.querySelector('mgt-file[part="upload"]');e&&(e.setAttribute("tabindex","0"),e.classList.add("upload"),e.focus())}render(){if(this.parentElement!==null){let e=this.parentElement;e.addEventListener("dragenter",this.handleonDragEnter),e.addEventListener("dragleave",this.handleonDragLeave),e.addEventListener("dragover",this.handleonDragOver),e.addEventListener("drop",this.handleonDrop)}return x` + `}loadState(){return lF(this,void 0,void 0,function*(){if(this.fileDetails){this.driveItem=this.fileDetails;return}let e=V.globalProvider;if(!e||e.state===oe.Loading)return;if(e.state===oe.SignedOut){this.driveItem=null;return}let t=e.graph.forComponent(this),o,i=!this.driveId&&!this.siteId&&!this.groupId&&!this.listId&&!this.userId;this.driveId&&!this.itemId&&!this.itemPath||this.siteId&&!this.itemId&&!this.itemPath||this.groupId&&!this.itemId&&!this.itemPath||this.listId&&!this.siteId&&!this.itemId||this.insightType&&!this.insightId||this.userId&&!this.itemId&&!this.itemPath&&!this.insightType&&!this.insightId?o=null:this.fileQuery?o=yield So(t,this.fileQuery):this.itemId&&i?o=yield bP(t,this.itemId):this.itemPath&&i?o=yield wP(t,this.itemPath):this.userId?this.itemId?o=yield SP(t,this.userId,this.itemId):this.itemPath?o=yield _P(t,this.userId,this.itemPath):this.insightType&&this.insightId&&(o=yield EP(t,this.userId,this.insightType,this.insightId)):this.driveId?this.itemId?o=yield mP(t,this.driveId,this.itemId):this.itemPath&&(o=yield gP(t,this.driveId,this.itemPath)):this.siteId&&!this.listId?this.itemId?o=yield CP(t,this.siteId,this.itemId):this.itemPath&&(o=yield xP(t,this.siteId,this.itemPath)):this.listId?o=yield kP(t,this.siteId,this.listId,this.itemId):this.groupId?this.itemId?o=yield vP(t,this.groupId,this.itemId):this.itemPath&&(o=yield yP(t,this.groupId,this.itemPath)):this.insightType&&!this.userId&&(o=yield TP(t,this.insightType,this.insightId)),this.driveItem=o})}getTextFromProperty(e,t){if(!t||t.length===0)return null;let o=t.trim().split(","),i,n=0;for(;!i&&nEd(r,"threelines")}),ho("design:type",String)],dr.prototype,"view",void 0)});var S$,_$,ac,nx,cF,dF,uF,T$,hF,Wh,sx=y(()=>{l();c();d();cr();ge();xe();gt();pi();Pd();Or();Qr();Jo();g$();v$();ge();Od();S$=function(r,e,t,o){var i=arguments.length,n=i<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,t):o,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(r,e,t,o);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(n=(i<3?s(n):i>3?s(e,t,n):s(e,t))||n);return i>3&&n&&Object.defineProperty(e,t,n),n},_$=function(r,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(r,e)},ac=function(r,e,t,o){function i(n){return n instanceof t?n:new t(function(s){s(n)})}return new(t||(t=Promise))(function(n,s){function a(p){try{h(o.next(p))}catch(f){s(f)}}function u(p){try{h(o.throw(p))}catch(f){s(f)}}function h(p){p.done?n(p.value):i(p.value).then(a,u)}h((o=o.apply(r,e||[])).next())})},nx=r=>r.isDirectory,cF=r=>r.isFile,dF=r=>"getAsEntry"in r&&typeof r.getAsEntry=="function",uF=r=>"getAsFile"in r&&typeof r.getAsFile=="function"||"webkitGetAsEntry"in r&&typeof r.webkitGetAsEntry=="function",T$=()=>{at(pC,$r,Yl,Zw),qs(),Re("file-upload",Wh)},hF=r=>r?.length>1?r[1]==="replace"?"replace":"rename":null,Wh=class extends kn{static get styles(){return m$}get strings(){return Bt}static get requiredScopes(){return[...new Set(["files.readwrite","files.readwrite.all","sites.readwrite.all"])]}get _dropEffect(){return"copy"}constructor(){super(),this._dragCounter=0,this._maxChunkSize=4*1024*1024,this._dialogTitle="",this._dialogContent="",this._dialogPrimaryButton="",this._dialogSecondaryButton="",this._dialogCheckBox="",this._applyAll=!1,this._applyAllConflictBehavior=null,this._maximumFileSize=!1,this._excludedFileType=!1,this.onFileUploadChange=e=>{let t=e.target;!e||t.files.length<1||this.readUploadedFiles(t.files,()=>t.value=null)},this.onFileUploadClick=()=>{this.renderRoot.querySelector("#file-upload-input").click()},this.handleonDragOver=e=>{e.preventDefault(),e.stopPropagation(),e.dataTransfer.items&&e.dataTransfer.items.length>0&&(e.dataTransfer.dropEffect=e.dataTransfer.dropEffect=this._dropEffect)},this.handleonDragEnter=e=>{e.preventDefault(),e.stopPropagation(),this._dragCounter++,e.dataTransfer.items&&e.dataTransfer.items.length>0&&(e.dataTransfer.dropEffect=this._dropEffect,this.renderRoot.querySelector("#file-upload-border").classList.add("visible"))},this.handleonDragLeave=e=>{e.preventDefault(),e.stopPropagation(),this._dragCounter--,this._dragCounter===0&&this.renderRoot.querySelector("#file-upload-border").classList.remove("visible")},this.handleonDrop=e=>{var t;e.preventDefault(),e.stopPropagation();let o=()=>{e.dataTransfer.clearData()};this.renderRoot.querySelector("#file-upload-border").classList.remove("visible"),!((t=e.dataTransfer)===null||t===void 0)&&t.items&&this.readUploadedFiles(e.dataTransfer.items,o),this._dragCounter=0},this.filesToUpload=[],this.addEventListener("__uploadfailed",this.focusOnUpload),this.addEventListener("__uploadsuccess",this.focusOnUpload)}focusOnUpload(){let e=this.renderRoot.querySelector('mgt-file[part="upload"]');e&&(e.setAttribute("tabindex","0"),e.classList.add("upload"),e.focus())}render(){if(this.parentElement!==null){let e=this.parentElement;e.addEventListener("dragenter",this.handleonDragEnter),e.addEventListener("dragleave",this.handleonDragLeave),e.addEventListener("dragover",this.handleonDragOver),e.addEventListener("drop",this.handleonDrop)}return x`
@@ -5700,7 +5700,7 @@ ${de("inline-block")} :host { ${this.strings.showMoreSubtitle} `}renderFileUpload(){let e={graph:V.globalProvider.graph.forComponent(this),driveId:this.driveId,excludedFileExtensions:this.excludedFileExtensions,groupId:this.groupId,itemId:this.itemId,itemPath:this.itemPath,userId:this.userId,siteId:this.siteId,maxFileSize:this.maxFileSize,maxUploadFile:this.maxUploadFile};return Te` - `}loadState(){var e,t;return P$(this,void 0,void 0,function*(){let o=V.globalProvider;if(!o||o.state===ie.Loading)return;if(o.state===ie.SignedOut){this.files=null;return}let i=o.graph.forComponent(this),n,s,a=!this.driveId&&!this.siteId&&!this.groupId&&!this.userId;if((this.driveId&&!this.itemId&&!this.itemPath||this.groupId&&!this.itemId&&!this.itemPath||this.siteId&&!this.itemId&&!this.itemPath||this.userId&&!this.insightType&&!this.itemId&&!this.itemPath)&&(this.files=null),!this.files){this.fileListQuery?s=yield HP(i,this.fileListQuery,this.pageSize):this.fileQueries?n=yield zP(i,this.fileQueries):a?this.itemId?s=yield OP(i,this.itemId,this.pageSize):this.itemPath?s=yield MP(i,this.itemPath,this.pageSize):this.insightType?n=yield UP(i,this.insightType):s=yield IP(i,this.pageSize):this.driveId?this.itemId?s=yield AP(i,this.driveId,this.itemId,this.pageSize):this.itemPath&&(s=yield RP(i,this.driveId,this.itemPath,this.pageSize)):this.groupId?this.itemId?s=yield PP(i,this.groupId,this.itemId,this.pageSize):this.itemPath&&(s=yield $P(i,this.groupId,this.itemPath,this.pageSize)):this.siteId?this.itemId?s=yield DP(i,this.siteId,this.itemId,this.pageSize):this.itemPath&&(s=yield FP(i,this.siteId,this.itemPath,this.pageSize)):this.userId&&(this.itemId?s=yield LP(i,this.userId,this.itemId,this.pageSize):this.itemPath?s=yield NP(i,this.userId,this.itemPath,this.pageSize):this.insightType&&(n=yield BP(i,this.userId,this.insightType))),s&&(this.pageIterator=s,this._preloadedFiles=[...this.pageIterator.value],this._preloadedFiles.length>=this.pageSize?n=this._preloadedFiles.splice(0,this.pageSize):n=this._preloadedFiles.splice(0,this._preloadedFiles.length));let u;if(((e=this.fileExtensions)===null||e===void 0?void 0:e.length)>0){if(!((t=this.pageIterator)===null||t===void 0)&&t.value){for(;this.pageIterator.hasNext;)yield JC(this.pageIterator);n=this.pageIterator.value,this._preloadedFiles=[]}u=n.filter(h=>{for(let p of this.fileExtensions)if(p===this.getFileExtension(h.name))return h})}u?.length>=0?(this.files=u,this.pageSize&&(n=this.files.splice(0,this.pageSize),this.files=n)):this.files=n}})}handleItemSelect(e,t){if(this.handleFileClick(e),this.fireCustomEvent("itemClick",e),t){let o=this.renderRoot.querySelector(".file-list"),i=Array.from(o.children),n=t.target.closest("li"),s=i.indexOf(n);this._focusedItemIndex=s;let a=o.children[this._focusedItemIndex];this.updateItemBackgroundColor(o,a,"selected")}}renderNextPage(){return P$(this,void 0,void 0,function*(){if(this._preloadedFiles.length>0)this.files=[...this.files,...this._preloadedFiles.splice(0,Math.min(this.pageSize,this._preloadedFiles.length))];else if(this.pageIterator.hasNext){this._isLoadingMore=!0;let e=this.renderRoot.querySelector("#file-list-wrapper");e?.animate&&e.animate([{height:"auto",transformOrigin:"top left"},{height:"auto",transformOrigin:"top left"}],{duration:1e3,easing:"ease-in-out",fill:"both"}),yield JC(this.pageIterator),this._isLoadingMore=!1,this.files=this.pageIterator.value}this.requestUpdate()})}getFileExtension(e){return/(?:\.([^.]+))?$/.exec(e)[1]||""}updateItemBackgroundColor(e,t,o){for(let i of e.children)i.classList.remove(o),i.removeAttribute("tabindex");t&&(t.classList.add(o),t.scrollIntoView({behavior:"smooth",block:"nearest",inline:"start"}),t.setAttribute("tabindex","0"),t.focus());for(let i of e.children)i.classList.remove("selected")}reload(e=!1){e&&kv(),this._task.run()}};ur([X(),hr("design:type",Object)],Dt.prototype,"_isCompact",void 0);ur([X(),hr("design:type",Array)],Dt.prototype,"_personCardFiles",void 0);ur([E({attribute:"file-list-query"}),hr("design:type",String)],Dt.prototype,"fileListQuery",void 0);ur([E({attribute:"file-queries",converter:(r,e)=>r?r.split(",").map(t=>t.trim()):null}),hr("design:type",Array)],Dt.prototype,"fileQueries",void 0);ur([E({type:Object}),hr("design:type",Array)],Dt.prototype,"files",void 0);ur([E({attribute:"site-id"}),hr("design:type",String)],Dt.prototype,"siteId",void 0);ur([E({attribute:"drive-id"}),hr("design:type",String)],Dt.prototype,"driveId",void 0);ur([E({attribute:"group-id"}),hr("design:type",String)],Dt.prototype,"groupId",void 0);ur([E({attribute:"item-id"}),hr("design:type",String)],Dt.prototype,"itemId",void 0);ur([E({attribute:"item-path"}),hr("design:type",String)],Dt.prototype,"itemPath",void 0);ur([E({attribute:"user-id"}),hr("design:type",String)],Dt.prototype,"userId",void 0);ur([E({attribute:"insight-type"}),hr("design:type",String)],Dt.prototype,"insightType",void 0);ur([E({attribute:"item-view",converter:r=>Ed(r,"threelines")}),hr("design:type",String)],Dt.prototype,"itemView",void 0);ur([E({attribute:"file-extensions",converter:(r,e)=>r.split(",").map(t=>t.trim())}),hr("design:type",Array)],Dt.prototype,"fileExtensions",void 0);ur([E({attribute:"page-size",type:Number}),hr("design:type",Object)],Dt.prototype,"pageSize",void 0);ur([E({attribute:"disable-open-on-click",type:Boolean}),hr("design:type",Object)],Dt.prototype,"disableOpenOnClick",void 0);ur([E({attribute:"hide-more-files-button",type:Boolean}),hr("design:type",Object)],Dt.prototype,"hideMoreFilesButton",void 0);ur([E({attribute:"max-file-size",type:Number}),hr("design:type",Number)],Dt.prototype,"maxFileSize",void 0);ur([E({attribute:"enable-file-upload",type:Boolean}),hr("design:type",Object)],Dt.prototype,"enableFileUpload",void 0);ur([E({attribute:"max-upload-file",type:Number}),hr("design:type",Object)],Dt.prototype,"maxUploadFile",void 0);ur([E({attribute:"excluded-file-extensions",converter:(r,e)=>r.split(",").map(t=>t.trim())}),hr("design:type",Array)],Dt.prototype,"excludedFileExtensions",void 0);ur([X(),hr("design:type",Boolean)],Dt.prototype,"_isLoadingMore",void 0)});var $$,O$=y(()=>{l();c();d();xe();$$=[Oe` + `}loadState(){var e,t;return P$(this,void 0,void 0,function*(){let o=V.globalProvider;if(!o||o.state===oe.Loading)return;if(o.state===oe.SignedOut){this.files=null;return}let i=o.graph.forComponent(this),n,s,a=!this.driveId&&!this.siteId&&!this.groupId&&!this.userId;if((this.driveId&&!this.itemId&&!this.itemPath||this.groupId&&!this.itemId&&!this.itemPath||this.siteId&&!this.itemId&&!this.itemPath||this.userId&&!this.insightType&&!this.itemId&&!this.itemPath)&&(this.files=null),!this.files){this.fileListQuery?s=yield HP(i,this.fileListQuery,this.pageSize):this.fileQueries?n=yield zP(i,this.fileQueries):a?this.itemId?s=yield OP(i,this.itemId,this.pageSize):this.itemPath?s=yield MP(i,this.itemPath,this.pageSize):this.insightType?n=yield UP(i,this.insightType):s=yield IP(i,this.pageSize):this.driveId?this.itemId?s=yield AP(i,this.driveId,this.itemId,this.pageSize):this.itemPath&&(s=yield RP(i,this.driveId,this.itemPath,this.pageSize)):this.groupId?this.itemId?s=yield PP(i,this.groupId,this.itemId,this.pageSize):this.itemPath&&(s=yield $P(i,this.groupId,this.itemPath,this.pageSize)):this.siteId?this.itemId?s=yield DP(i,this.siteId,this.itemId,this.pageSize):this.itemPath&&(s=yield FP(i,this.siteId,this.itemPath,this.pageSize)):this.userId&&(this.itemId?s=yield LP(i,this.userId,this.itemId,this.pageSize):this.itemPath?s=yield NP(i,this.userId,this.itemPath,this.pageSize):this.insightType&&(n=yield BP(i,this.userId,this.insightType))),s&&(this.pageIterator=s,this._preloadedFiles=[...this.pageIterator.value],this._preloadedFiles.length>=this.pageSize?n=this._preloadedFiles.splice(0,this.pageSize):n=this._preloadedFiles.splice(0,this._preloadedFiles.length));let u;if(((e=this.fileExtensions)===null||e===void 0?void 0:e.length)>0){if(!((t=this.pageIterator)===null||t===void 0)&&t.value){for(;this.pageIterator.hasNext;)yield JC(this.pageIterator);n=this.pageIterator.value,this._preloadedFiles=[]}u=n.filter(h=>{for(let p of this.fileExtensions)if(p===this.getFileExtension(h.name))return h})}u?.length>=0?(this.files=u,this.pageSize&&(n=this.files.splice(0,this.pageSize),this.files=n)):this.files=n}})}handleItemSelect(e,t){if(this.handleFileClick(e),this.fireCustomEvent("itemClick",e),t){let o=this.renderRoot.querySelector(".file-list"),i=Array.from(o.children),n=t.target.closest("li"),s=i.indexOf(n);this._focusedItemIndex=s;let a=o.children[this._focusedItemIndex];this.updateItemBackgroundColor(o,a,"selected")}}renderNextPage(){return P$(this,void 0,void 0,function*(){if(this._preloadedFiles.length>0)this.files=[...this.files,...this._preloadedFiles.splice(0,Math.min(this.pageSize,this._preloadedFiles.length))];else if(this.pageIterator.hasNext){this._isLoadingMore=!0;let e=this.renderRoot.querySelector("#file-list-wrapper");e?.animate&&e.animate([{height:"auto",transformOrigin:"top left"},{height:"auto",transformOrigin:"top left"}],{duration:1e3,easing:"ease-in-out",fill:"both"}),yield JC(this.pageIterator),this._isLoadingMore=!1,this.files=this.pageIterator.value}this.requestUpdate()})}getFileExtension(e){return/(?:\.([^.]+))?$/.exec(e)[1]||""}updateItemBackgroundColor(e,t,o){for(let i of e.children)i.classList.remove(o),i.removeAttribute("tabindex");t&&(t.classList.add(o),t.scrollIntoView({behavior:"smooth",block:"nearest",inline:"start"}),t.setAttribute("tabindex","0"),t.focus());for(let i of e.children)i.classList.remove("selected")}reload(e=!1){e&&kv(),this._task.run()}};ur([X(),hr("design:type",Object)],Dt.prototype,"_isCompact",void 0);ur([X(),hr("design:type",Array)],Dt.prototype,"_personCardFiles",void 0);ur([E({attribute:"file-list-query"}),hr("design:type",String)],Dt.prototype,"fileListQuery",void 0);ur([E({attribute:"file-queries",converter:(r,e)=>r?r.split(",").map(t=>t.trim()):null}),hr("design:type",Array)],Dt.prototype,"fileQueries",void 0);ur([E({type:Object}),hr("design:type",Array)],Dt.prototype,"files",void 0);ur([E({attribute:"site-id"}),hr("design:type",String)],Dt.prototype,"siteId",void 0);ur([E({attribute:"drive-id"}),hr("design:type",String)],Dt.prototype,"driveId",void 0);ur([E({attribute:"group-id"}),hr("design:type",String)],Dt.prototype,"groupId",void 0);ur([E({attribute:"item-id"}),hr("design:type",String)],Dt.prototype,"itemId",void 0);ur([E({attribute:"item-path"}),hr("design:type",String)],Dt.prototype,"itemPath",void 0);ur([E({attribute:"user-id"}),hr("design:type",String)],Dt.prototype,"userId",void 0);ur([E({attribute:"insight-type"}),hr("design:type",String)],Dt.prototype,"insightType",void 0);ur([E({attribute:"item-view",converter:r=>Ed(r,"threelines")}),hr("design:type",String)],Dt.prototype,"itemView",void 0);ur([E({attribute:"file-extensions",converter:(r,e)=>r.split(",").map(t=>t.trim())}),hr("design:type",Array)],Dt.prototype,"fileExtensions",void 0);ur([E({attribute:"page-size",type:Number}),hr("design:type",Object)],Dt.prototype,"pageSize",void 0);ur([E({attribute:"disable-open-on-click",type:Boolean}),hr("design:type",Object)],Dt.prototype,"disableOpenOnClick",void 0);ur([E({attribute:"hide-more-files-button",type:Boolean}),hr("design:type",Object)],Dt.prototype,"hideMoreFilesButton",void 0);ur([E({attribute:"max-file-size",type:Number}),hr("design:type",Number)],Dt.prototype,"maxFileSize",void 0);ur([E({attribute:"enable-file-upload",type:Boolean}),hr("design:type",Object)],Dt.prototype,"enableFileUpload",void 0);ur([E({attribute:"max-upload-file",type:Number}),hr("design:type",Object)],Dt.prototype,"maxUploadFile",void 0);ur([E({attribute:"excluded-file-extensions",converter:(r,e)=>r.split(",").map(t=>t.trim())}),hr("design:type",Array)],Dt.prototype,"excludedFileExtensions",void 0);ur([X(),hr("design:type",Boolean)],Dt.prototype,"_isLoadingMore",void 0)});var $$,O$=y(()=>{l();c();d();xe();$$=[Oe` :host([hidden]){display:none}:host{display:block;font-family:var(--default-font-family, "Segoe UI", "Segoe UI Web (West European)", "Segoe UI", -apple-system, "BlinkMacSystemFont", "Roboto", "Helvetica Neue", sans-serif);font-size:var(--default-font-size, 14px);--theme-primary-color:#0078d7;--theme-dark-color:#005a9e}:focus-visible{outline-color:var(--focus-ring-color,Highlight);outline-color:var(--focus-ring-color,-webkit-focus-ring-color);outline-style:var(--focus-ring-style,auto)}.ms-icon{display:inline-block;font-family:FabricMDL2Icons;font-style:normal;font-weight:400;font-size:16px;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;margin:4px 0}.error{background-color:#fde7e9;padding-block:8px;padding-inline:8px 12px}.ms-icon-chevron-down::before{content:"\\\e70d"}.ms-icon-chevron-up::before{content:"\\\e70e"}.ms-icon-contact::before{content:"\\\e77b"}.ms-icon-add-friend::before{content:"\\\e8fa"}.ms-icon-outlook-logo-inverser::before{content:"\\\eb6d"}:host .loading,:host .no-data{margin:0 20px;display:flex;justify-content:center}:host .no-data{font-style:normal;font-weight:600;font-size:14px;color:var(--font-color,#323130);line-height:19px}:host([hidden]){display:none}:host{display:block;font-family:var(--default-font-family, "Segoe UI", "Segoe UI Web (West European)", "Segoe UI", -apple-system, "BlinkMacSystemFont", "Roboto", "Helvetica Neue", sans-serif);font-size:var(--default-font-size, 14px);--theme-primary-color:#0078d7;--theme-dark-color:#005a9e}:focus-visible{outline-color:var(--focus-ring-color,Highlight);outline-color:var(--focus-ring-color,-webkit-focus-ring-color);outline-style:var(--focus-ring-style,auto)}.ms-icon{display:inline-block;font-family:FabricMDL2Icons;font-style:normal;font-weight:400;font-size:16px;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;margin:4px 0}.error{background-color:#fde7e9;padding-block:8px;padding-inline:8px 12px}.ms-icon-chevron-down::before{content:"\\\e70d"}.ms-icon-chevron-up::before{content:"\\\e70e"}.ms-icon-contact::before{content:"\\\e77b"}.ms-icon-add-friend::before{content:"\\\e8fa"}.ms-icon-outlook-logo-inverser::before{content:"\\\eb6d"}:host{position:relative;user-select:none}:host .root.compact{padding:0}:host .root .message{padding:8px 20px;display:flex;align-items:center;justify-content:space-between}:host .root .message:hover{background-color:var(--message-hover-color,var(--neutral-fill-hover));cursor:pointer}:host .root .message:last-child{margin-bottom:unset}:host .root .message .message__detail{min-width:0;line-height:normal}:host .root .message .message__detail .message__subject{color:var(--message-subject-color,var(--neutral-foreground-color));font-size:var(--message-subject-font-size, 14px);font-weight:var(--message-subject-font-weight,600);line-height:var(--message-subject-line-height, 20px)}:host .root .message .message__detail .message__from{font-size:var(--message-from-font-size, 12px);color:var(--message-from-color,var(--neutral-foreground-color));line-height:var(--message-from-line-height, 16px);font-weight:var(--message-from-font-weight,400)}:host .root .message .message__detail .message__message{font-size:var(--message-from-font-size, 12px);color:var(--message-color,var(--neutral-foreground-hint));line-height:var(--message-from-line-height, 16px);font-weight:var(--message-from-font-weight,400)}:host .root .message .message__detail>div{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}:host .root .message .message__date{margin-top:8px;font-size:12px;color:var(--message-date-color,var(--neutral-foreground-hint));margin-left:10px;white-space:nowrap} `]});var M$,D$=y(()=>{l();c();d();M$={emailsSectionTitle:"Emails"}});var pF,fF,F$,Md,Rv=y(()=>{l();c();d();xe();Gh();Qr();Jo();O$();D$();ge();gt();pF=function(r,e,t,o){var i=arguments.length,n=i<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,t):o,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(r,e,t,o);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(n=(i<3?s(n):i>3?s(e,t,n):s(e,t))||n);return i>3&&n&&Object.defineProperty(e,t,n),n},fF=function(r,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(r,e)},F$=()=>Re("messages",Md),Md=class extends Ui{static get styles(){return $$}get strings(){return M$}constructor(e){super(),this._messages=e}get displayName(){return this.strings.emailsSectionTitle}get cardTitle(){return this.strings.emailsSectionTitle}clearState(){super.clearState(),this._messages=[]}renderIcon(){return Z(P.Messages)}renderCompactView(){var e;let t;if(!(!((e=this._messages)===null||e===void 0)&&e.length))t=this.renderNoData();else{let o=this._messages?this._messages.slice(0,3).map(i=>this.renderMessage(i)):[];t=x` ${o} @@ -6043,7 +6043,7 @@ ${de("inline-block")} :host {
- `;V.globalProvider.state===ie.SignedOut&&this.loadSections();let t=this.renderSectionNavigation();return x` + `;V.globalProvider.state===oe.SignedOut&&this.loadSections();let t=this.renderSectionNavigation();return x`
${t}
@@ -6134,7 +6134,7 @@ ${de("inline-block")} :host { ${this.isSendingMessage?Z(P.Confirmation):Z(P.Send)}
- `:ot}loadState(){var e,t,o;return e6(this,void 0,void 0,function*(){if(this._cardState)return;if(!this.personDetails&&this.inheritDetails){let u=this.parentElement;for(;u&&u.tagName!==`${Jr.prefix}-PERSON`.toUpperCase();)u=u.parentElement;let h=u.personDetails||u.personDetailsInternal;u&&h&&(this.personDetails=h,this.personImage=u.personImage)}let i=V.globalProvider;if(!i||i.state!==ie.SignedIn)return;let n=i.graph.forComponent(this);if(this._graph=n,this._isStateLoading=!0,this._me||(this._me=yield V.me()),this.personDetails){let u=this.personDetails,h=u.userPrincipalName||u.id;if(h&&!Fo(u)){let p=yield ic(n,h);this.personDetails=p,this.personImage=this.getImage()}}else if(this.userId||this.personQuery==="me"){let u=yield ic(n,this.userId);this.personDetails=u,this.personImage=this.getImage()}else if(this.personQuery){let u=yield Na(n,this.personQuery,1);u?.length&&(this.personDetails=u[0],yield Nh(n,this.personDetails,Ut.useContactApis).then(h=>{h&&(this.personDetails.personImage=h,this.personImage=h)}))}let s={activity:"Offline",availability:"Offline",id:null};if(!this.personPresence&&this.showPresence)try{!((e=this.personDetails)===null||e===void 0)&&e.id?this.personPresence=yield Uh(n,this.personDetails.id):this.personPresence=s}catch{this.personPresence=s}let a=((t=this.personDetails)===null||t===void 0?void 0:t.id)||((o=this.personDetails)===null||o===void 0?void 0:o.userPrincipalName);a&&(this._cardState=yield Ev(n,this.personDetails,this._me===a)),this.loadSections(),this._isStateLoading=!1})}get hasPhone(){var e,t;let o=this.internalPersonDetails,i=this.internalPersonDetails;return!!(!((e=o?.businessPhones)===null||e===void 0)&&e.length)||!!(!((t=i?.phones)===null||t===void 0)&&t.length)}loadSections(){if(this.sections=[],!this.internalPersonDetails)return;let e=new jh(this.internalPersonDetails);if(e.hasData&&this.sections.push(e),!this._cardState)return;let{person:t,directReports:o,messages:i,files:n,profile:s}=this._cardState;if(Ut.sections.organization&&(t?.manager||o?.length)&&this.sections.push(new lc(this._cardState,this._me)),Ut.sections.mailMessages&&i?.length&&this.sections.push(new Md(i)),Ut.sections.files&&n?.length&&this.sections.push(new Dt(n)),Ut.sections.profile&&s){let a=new Dd(s);a.hasData&&this.sections.push(a)}}getImage(){if(this.personImage)return this.personImage;let e=this.internalPersonDetails;return e?.personImage?e.personImage:null}clearInputData(){this._chatInput="",this.requestUpdate()}getPersonBusinessPhones(e){let t=e.phones,o=[];for(let i of t)i.type==="business"&&o.push(i.number);return o}updateCurrentSection(e){if(e){let o=e.tagName.toLowerCase();this.renderRoot.querySelector(`#${o}-Tab`).click()}let t=this.renderRoot.querySelectorAll("fluent-tab-panel");for(let o of t)o.scrollTop=0;this._currentSection=e,this.requestUpdate()}handleSectionScroll(e){let t=this.renderRoot.querySelectorAll("fluent-tab-panel");for(let o of t)o&&!(e.deltaY<0&&o.scrollTop===0)&&!(e.deltaY>0&&o.clientHeight+o.scrollTop>=o.scrollHeight-1)&&e.stopPropagation()}};Xo([E({attribute:"person-details",type:Object}),po("design:type",Object),po("design:paramtypes",[Object])],Yr.prototype,"personDetails",null);Xo([E({attribute:"person-query"}),po("design:type",String),po("design:paramtypes",[String])],Yr.prototype,"personQuery",null);Xo([E({attribute:"lock-tab-navigation",type:Boolean}),po("design:type",Boolean)],Yr.prototype,"lockTabNavigation",void 0);Xo([E({attribute:"user-id"}),po("design:type",String),po("design:paramtypes",[String])],Yr.prototype,"userId",null);Xo([E({attribute:"person-image",type:String}),po("design:type",String)],Yr.prototype,"personImage",void 0);Xo([E({attribute:"fetch-image",type:Boolean}),po("design:type",Boolean)],Yr.prototype,"fetchImage",void 0);Xo([E({attribute:"is-expanded",type:Boolean}),po("design:type",Boolean)],Yr.prototype,"isExpanded",void 0);Xo([E({attribute:"inherit-details",type:Boolean}),po("design:type",Boolean)],Yr.prototype,"inheritDetails",void 0);Xo([E({attribute:"show-presence",type:Boolean}),po("design:type",Boolean)],Yr.prototype,"showPresence",void 0);Xo([E({attribute:"person-presence",type:Object}),po("design:type",Object)],Yr.prototype,"personPresence",void 0);Xo([X(),po("design:type",Object)],Yr.prototype,"isSendingMessage",void 0);Xo([X(),po("design:type",Object)],Yr.prototype,"_cardState",void 0);Xo([X(),po("design:type",Boolean)],Yr.prototype,"_isStateLoading",void 0);Xo([X(),po("design:type",Object)],Yr.prototype,"_currentSection",void 0)});var jt,vt,r6,cx,Lo,pt,un=y(()=>{l();c();d();cr();ge();xe();gt();pi();Cd();av();Us();_d();vv();Ha();bv();Bh();vs();Or();Qr();Jo();Ad();Ad();Cv();cP();xv();hP();ex();jt=function(r,e,t,o){var i=arguments.length,n=i<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,t):o,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(r,e,t,o);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(n=(i<3?s(n):i>3?s(e,t,n):s(e,t))||n);return i>3&&n&&Object.defineProperty(e,t,n),n},vt=function(r,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(r,e)},r6=function(r,e,t,o){function i(n){return n instanceof t?n:new t(function(s){s(n)})}return new(t||(t=Promise))(function(n,s){function a(p){try{h(o.next(p))}catch(f){s(f)}}function u(p){try{h(o.throw(p))}catch(f){s(f)}}function h(p){p.done?n(p.value):i(p.value).then(a,u)}h((o=o.apply(r,e||[])).next())})},cx=["businessPhones","displayName","givenName","jobTitle","department","mail","mobilePhone","officeLocation","preferredLanguage","surname","userPrincipalName","id","userType"],Lo=()=>{at(Jl),Re("person",pt),Ua()},pt=class r extends it{static get styles(){return lP}get strings(){return uP}get personQuery(){return this._personQuery}set personQuery(e){e!==this._personQuery&&(this._personQuery=e,this._personDetails=null,this.personDetailsInternal=null)}get fallbackDetails(){return this._fallbackDetails}set fallbackDetails(e){e!==this._fallbackDetails&&(this._fallbackDetails=e,this.personDetailsInternal)}get userId(){return this._userId}set userId(e){e!==this._userId&&(this._userId=e,this.personDetailsInternal=null,this._personDetails=null)}get usage(){return this._usage}set usage(e){e!==this._usage&&(this._usage=e)}get personDetailsInternal(){return this._personDetailsInternal}set personDetailsInternal(e){this._personDetailsInternal!==e&&(this._personDetailsInternal=e,this._fetchedImage=null,this._fetchedPresence=null)}get personDetails(){return this._personDetails}set personDetails(e){this._personDetails!==e&&(this._personDetails=e,this._fetchedImage=null,this._fetchedPresence=null)}get personImage(){return this._personImage||this._fetchedImage}set personImage(e){e!==this._personImage&&(this._isInvalidImageSrc=!e,this._personImage=e)}get personPresence(){return this._personPresence||this._fetchedPresence}set personPresence(e){e!==this._personPresence&&(this._personPresence=e)}static get requiredScopes(){let e=["user.readbasic.all","user.read","people.read","presence.read.all","presence.read"];return r.config.useContactApis&&e.push("contacts.read"),e}get flyout(){return this.renderRoot.querySelector(".flyout")}constructor(){super(),this.avatarType="photo",this.personCardInteraction="none",this.view="image",this._hasLoadedPersonCard=!1,this._mouseLeaveTimeout=-1,this._mouseEnterTimeout=-1,this.renderContent=()=>{let e=this.personDetails||this.personDetailsInternal||this.fallbackDetails,t=this.getImage(),o=this.personPresence||this._fetchedPresence;if(!e&&!t)return this.renderNoData();!e?.personImage&&t&&(e.personImage=t);let i=this.renderTemplate("default",{person:e,personImage:t,personPresence:o});if(!i){let a=this.renderDetails(e,o),u=this.renderAvatar(e,t,o);i=x` + `:ot}loadState(){var e,t,o;return e6(this,void 0,void 0,function*(){if(this._cardState)return;if(!this.personDetails&&this.inheritDetails){let u=this.parentElement;for(;u&&u.tagName!==`${Jr.prefix}-PERSON`.toUpperCase();)u=u.parentElement;let h=u.personDetails||u.personDetailsInternal;u&&h&&(this.personDetails=h,this.personImage=u.personImage)}let i=V.globalProvider;if(!i||i.state!==oe.SignedIn)return;let n=i.graph.forComponent(this);if(this._graph=n,this._isStateLoading=!0,this._me||(this._me=yield V.me()),this.personDetails){let u=this.personDetails,h=u.userPrincipalName||u.id;if(h&&!Fo(u)){let p=yield ic(n,h);this.personDetails=p,this.personImage=this.getImage()}}else if(this.userId||this.personQuery==="me"){let u=yield ic(n,this.userId);this.personDetails=u,this.personImage=this.getImage()}else if(this.personQuery){let u=yield Na(n,this.personQuery,1);u?.length&&(this.personDetails=u[0],yield Nh(n,this.personDetails,Ut.useContactApis).then(h=>{h&&(this.personDetails.personImage=h,this.personImage=h)}))}let s={activity:"Offline",availability:"Offline",id:null};if(!this.personPresence&&this.showPresence)try{!((e=this.personDetails)===null||e===void 0)&&e.id?this.personPresence=yield Uh(n,this.personDetails.id):this.personPresence=s}catch{this.personPresence=s}let a=((t=this.personDetails)===null||t===void 0?void 0:t.id)||((o=this.personDetails)===null||o===void 0?void 0:o.userPrincipalName);a&&(this._cardState=yield Ev(n,this.personDetails,this._me===a)),this.loadSections(),this._isStateLoading=!1})}get hasPhone(){var e,t;let o=this.internalPersonDetails,i=this.internalPersonDetails;return!!(!((e=o?.businessPhones)===null||e===void 0)&&e.length)||!!(!((t=i?.phones)===null||t===void 0)&&t.length)}loadSections(){if(this.sections=[],!this.internalPersonDetails)return;let e=new jh(this.internalPersonDetails);if(e.hasData&&this.sections.push(e),!this._cardState)return;let{person:t,directReports:o,messages:i,files:n,profile:s}=this._cardState;if(Ut.sections.organization&&(t?.manager||o?.length)&&this.sections.push(new lc(this._cardState,this._me)),Ut.sections.mailMessages&&i?.length&&this.sections.push(new Md(i)),Ut.sections.files&&n?.length&&this.sections.push(new Dt(n)),Ut.sections.profile&&s){let a=new Dd(s);a.hasData&&this.sections.push(a)}}getImage(){if(this.personImage)return this.personImage;let e=this.internalPersonDetails;return e?.personImage?e.personImage:null}clearInputData(){this._chatInput="",this.requestUpdate()}getPersonBusinessPhones(e){let t=e.phones,o=[];for(let i of t)i.type==="business"&&o.push(i.number);return o}updateCurrentSection(e){if(e){let o=e.tagName.toLowerCase();this.renderRoot.querySelector(`#${o}-Tab`).click()}let t=this.renderRoot.querySelectorAll("fluent-tab-panel");for(let o of t)o.scrollTop=0;this._currentSection=e,this.requestUpdate()}handleSectionScroll(e){let t=this.renderRoot.querySelectorAll("fluent-tab-panel");for(let o of t)o&&!(e.deltaY<0&&o.scrollTop===0)&&!(e.deltaY>0&&o.clientHeight+o.scrollTop>=o.scrollHeight-1)&&e.stopPropagation()}};Xo([E({attribute:"person-details",type:Object}),po("design:type",Object),po("design:paramtypes",[Object])],Yr.prototype,"personDetails",null);Xo([E({attribute:"person-query"}),po("design:type",String),po("design:paramtypes",[String])],Yr.prototype,"personQuery",null);Xo([E({attribute:"lock-tab-navigation",type:Boolean}),po("design:type",Boolean)],Yr.prototype,"lockTabNavigation",void 0);Xo([E({attribute:"user-id"}),po("design:type",String),po("design:paramtypes",[String])],Yr.prototype,"userId",null);Xo([E({attribute:"person-image",type:String}),po("design:type",String)],Yr.prototype,"personImage",void 0);Xo([E({attribute:"fetch-image",type:Boolean}),po("design:type",Boolean)],Yr.prototype,"fetchImage",void 0);Xo([E({attribute:"is-expanded",type:Boolean}),po("design:type",Boolean)],Yr.prototype,"isExpanded",void 0);Xo([E({attribute:"inherit-details",type:Boolean}),po("design:type",Boolean)],Yr.prototype,"inheritDetails",void 0);Xo([E({attribute:"show-presence",type:Boolean}),po("design:type",Boolean)],Yr.prototype,"showPresence",void 0);Xo([E({attribute:"person-presence",type:Object}),po("design:type",Object)],Yr.prototype,"personPresence",void 0);Xo([X(),po("design:type",Object)],Yr.prototype,"isSendingMessage",void 0);Xo([X(),po("design:type",Object)],Yr.prototype,"_cardState",void 0);Xo([X(),po("design:type",Boolean)],Yr.prototype,"_isStateLoading",void 0);Xo([X(),po("design:type",Object)],Yr.prototype,"_currentSection",void 0)});var jt,vt,r6,cx,Lo,pt,un=y(()=>{l();c();d();cr();ge();xe();gt();pi();Cd();av();Us();_d();vv();Ha();bv();Bh();vs();Or();Qr();Jo();Ad();Ad();Cv();cP();xv();hP();ex();jt=function(r,e,t,o){var i=arguments.length,n=i<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,t):o,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(r,e,t,o);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(n=(i<3?s(n):i>3?s(e,t,n):s(e,t))||n);return i>3&&n&&Object.defineProperty(e,t,n),n},vt=function(r,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(r,e)},r6=function(r,e,t,o){function i(n){return n instanceof t?n:new t(function(s){s(n)})}return new(t||(t=Promise))(function(n,s){function a(p){try{h(o.next(p))}catch(f){s(f)}}function u(p){try{h(o.throw(p))}catch(f){s(f)}}function h(p){p.done?n(p.value):i(p.value).then(a,u)}h((o=o.apply(r,e||[])).next())})},cx=["businessPhones","displayName","givenName","jobTitle","department","mail","mobilePhone","officeLocation","preferredLanguage","surname","userPrincipalName","id","userType"],Lo=()=>{at(Jl),Re("person",pt),Ua()},pt=class r extends it{static get styles(){return lP}get strings(){return uP}get personQuery(){return this._personQuery}set personQuery(e){e!==this._personQuery&&(this._personQuery=e,this._personDetails=null,this.personDetailsInternal=null)}get fallbackDetails(){return this._fallbackDetails}set fallbackDetails(e){e!==this._fallbackDetails&&(this._fallbackDetails=e,this.personDetailsInternal)}get userId(){return this._userId}set userId(e){e!==this._userId&&(this._userId=e,this.personDetailsInternal=null,this._personDetails=null)}get usage(){return this._usage}set usage(e){e!==this._usage&&(this._usage=e)}get personDetailsInternal(){return this._personDetailsInternal}set personDetailsInternal(e){this._personDetailsInternal!==e&&(this._personDetailsInternal=e,this._fetchedImage=null,this._fetchedPresence=null)}get personDetails(){return this._personDetails}set personDetails(e){this._personDetails!==e&&(this._personDetails=e,this._fetchedImage=null,this._fetchedPresence=null)}get personImage(){return this._personImage||this._fetchedImage}set personImage(e){e!==this._personImage&&(this._isInvalidImageSrc=!e,this._personImage=e)}get personPresence(){return this._personPresence||this._fetchedPresence}set personPresence(e){e!==this._personPresence&&(this._personPresence=e)}static get requiredScopes(){let e=["user.readbasic.all","user.read","people.read","presence.read.all","presence.read"];return r.config.useContactApis&&e.push("contacts.read"),e}get flyout(){return this.renderRoot.querySelector(".flyout")}constructor(){super(),this.avatarType="photo",this.personCardInteraction="none",this.view="image",this._hasLoadedPersonCard=!1,this._mouseLeaveTimeout=-1,this._mouseEnterTimeout=-1,this.renderContent=()=>{let e=this.personDetails||this.personDetailsInternal||this.fallbackDetails,t=this.getImage(),o=this.personPresence||this._fetchedPresence;if(!e&&!t)return this.renderNoData();!e?.personImage&&t&&(e.personImage=t);let i=this.renderTemplate("default",{person:e,personImage:t,personPresence:o});if(!i){let a=this.renderDetails(e,o),u=this.renderAvatar(e,t,o);i=x` ${u} ${a} `}this.personCardInteraction!=="none"&&(i=this.renderFlyout(i,e,t,o));let s=ze({"person-root":!0,small:!this.isThreeLines()&&!this.isFourLines()&&!this.isLargeAvatar(),large:this.avatarSize!=="auto"&&this.isLargeAvatar(),noline:this.isNoLine(),oneline:this.isOneLine(),twolines:this.isTwoLines(),threelines:this.isThreeLines(),fourlines:this.isFourLines(),vertical:this.isVertical()});return x` @@ -6223,7 +6223,7 @@ ${de("inline-block")} :host { .personImage=${t} .personPresence=${o} .showPresence=${this.showPresence}> - `}args(){return[this.providerState,this.verticalLayout,this.view,this.fallbackDetails,this.line1Property,this.line2Property,this.line3Property,this.line4Property,this.fetchImage,this.avatarType,this.userId,this.personQuery,this.disableImageFetch,this.showPresence,this.personPresence,this.personDetails]}loadState(){return r6(this,void 0,void 0,function*(){let e=V.globalProvider;if(!e||e.state===ie.Loading)return;if(e&&e.state===ie.SignedOut){this.personDetailsInternal=null;return}let t=e.graph.forComponent(this);(this.verticalLayout&&this.view!=="fourlines"||this.fallbackDetails)&&(this.line2Property="email");let o=[...cx,this.line1Property,this.line2Property,this.line3Property,this.line4Property];o=o.filter(s=>s!=="email");let i=this.personDetailsInternal||this.personDetails;if(i){if(!i.personImage&&this.fetchImage&&this.avatarType==="photo"&&!this.personImage&&!this._fetchedImage){let s;"groupTypes"in i?s=yield X3(t,i):s=yield Nh(t,i,r.config.useContactApis),s&&(i.personImage=s,this._fetchedImage=s)}}else if(this.userId||this.personQuery==="me"){let s;this.avatarType==="photo"&&!this.disableImageFetch?s=yield ic(t,this.userId,o):this.personQuery==="me"?s=yield Fh(t,o):s=yield Lh(t,this.userId,o),this.personDetailsInternal=s,this.personDetails=s,this._fetchedImage=this.getImage()}else if(this.personQuery){let s=yield Na(t,this.personQuery,1);if((!s||s.length===0)&&(s=(yield ec(t,this.personQuery,1))||[]),s?.length&&(this.personDetailsInternal=s[0],this.personDetails=s[0],this.avatarType==="photo"&&!this.disableImageFetch)){let a=yield Nh(t,s[0],r.config.useContactApis);a&&(this.personDetailsInternal.personImage=a,this.personDetails.personImage=a,this._fetchedImage=a)}}i=this.personDetailsInternal||this.personDetails||this.fallbackDetails,this.personCardInteraction!=="none"&&Ev(t,i,this.personQuery==="me");let n={activity:"Offline",availability:"Offline",id:null};if(this.showPresence&&!this.personPresence&&!this._fetchedPresence)try{if(i){let s=this.personQuery!=="me"?i?.id:null;this._fetchedPresence=yield Uh(t,s)}else this._fetchedPresence=n}catch{this._fetchedPresence=n}})}getInitials(e){var t,o,i,n,s,a;if(e||(e=this.personDetailsInternal),z3(e))return e.initials;let u="";if(sv(e)&&(u+=(i=(o=(t=e.givenName)===null||t===void 0?void 0:t[0])===null||o===void 0?void 0:o.toUpperCase())!==null&&i!==void 0?i:"",u+=(a=(s=(n=e.surname)===null||n===void 0?void 0:n[0])===null||s===void 0?void 0:s.toUpperCase())!==null&&a!==void 0?a:""),!u&&e.displayName){let h=e.displayName.split(/\s+/);for(let p=0;p<2&&pdP(r,"photo")}),vt("design:type",String)],pt.prototype,"avatarType",void 0);jt([E({attribute:"person-presence",type:Object}),vt("design:type",Object),vt("design:paramtypes",[Object])],pt.prototype,"personPresence",null);jt([E({attribute:"person-card",converter:r=>Rd(r)}),vt("design:type",String)],pt.prototype,"personCardInteraction",void 0);jt([E({attribute:"line1-property"}),vt("design:type",String)],pt.prototype,"line1Property",void 0);jt([E({attribute:"line2-property"}),vt("design:type",String)],pt.prototype,"line2Property",void 0);jt([E({attribute:"line3-property"}),vt("design:type",String)],pt.prototype,"line3Property",void 0);jt([E({attribute:"line4-property"}),vt("design:type",String)],pt.prototype,"line4Property",void 0);jt([E({converter:r=>Ed(r,"image")}),vt("design:type",String)],pt.prototype,"view",void 0);jt([X(),vt("design:type",String)],pt.prototype,"_fetchedImage",void 0);jt([X(),vt("design:type",Object)],pt.prototype,"_fetchedPresence",void 0);jt([X(),vt("design:type",Boolean)],pt.prototype,"_isInvalidImageSrc",void 0);jt([X(),vt("design:type",Boolean)],pt.prototype,"_personCardShouldRender",void 0);jt([X(),vt("design:type",Object)],pt.prototype,"_hasLoadedPersonCard",void 0)});l();c();d();l();c();d();l();c();d();var zF=__STORYBOOK_API__,{ActiveTabs:VF,Consumer:qF,ManagerContext:GF,Provider:jF,addons:lp,combineParameters:KF,controlOrMetaKey:WF,controlOrMetaSymbol:QF,eventMatchesShortcut:YF,eventToShortcut:ZF,isMacLike:JF,isShortcutTaken:XF,keyToSymbol:eL,merge:tL,mockChannel:rL,optionOrAltSymbol:oL,shortcutMatchesShortcut:iL,shortcutToHumanString:nL,types:Hx,useAddonState:sL,useArgTypes:aL,useArgs:lL,useChannel:cL,useGlobalTypes:dL,useGlobals:uL,useParameter:hL,useSharedState:pL,useStoryPrepared:fL,useStorybookApi:mL,useStorybookState:gL}=__STORYBOOK_API__;l();c();d();l();c();d();l();c();d();l();c();d();var Ux=(()=>{let r;return typeof window<"u"?r=window:typeof globalThis<"u"?r=globalThis:typeof window<"u"?r=window:typeof self<"u"?r=self:r={},r})();l();c();d();var _L=__STORYBOOK_CLIENT_LOGGER__,{deprecate:TL,logger:Bx,once:EL,pretty:IL}=__STORYBOOK_CLIENT_LOGGER__;function uc(){return uc=Object.assign?Object.assign.bind():function(r){for(var e=1;e"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function cp(r,e,t){return C7()?cp=Reflect.construct.bind():cp=function(o,i,n){var s=[null];s.push.apply(s,i);var a=Function.bind.apply(o,s),u=new a;return n&&Bd(u,n.prototype),u},cp.apply(null,arguments)}function Zv(r){var e=typeof Map=="function"?new Map:void 0;return Zv=function(t){if(t===null||!w7(t))return t;if(typeof t!="function")throw new TypeError("Super expression must either be null or a function");if(typeof e<"u"){if(e.has(t))return e.get(t);e.set(t,o)}function o(){return cp(t,arguments,Yv(this).constructor)}return o.prototype=Object.create(t.prototype,{constructor:{value:o,enumerable:!1,writable:!0,configurable:!0}}),Bd(o,t)},Zv(r)}var x7={1:`Passed invalid arguments to hsl, please pass multiple numbers e.g. hsl(360, 0.75, 0.4) or an object e.g. rgb({ hue: 255, saturation: 0.4, lightness: 0.75 }). + `}args(){return[this.providerState,this.verticalLayout,this.view,this.fallbackDetails,this.line1Property,this.line2Property,this.line3Property,this.line4Property,this.fetchImage,this.avatarType,this.userId,this.personQuery,this.disableImageFetch,this.showPresence,this.personPresence,this.personDetails]}loadState(){return r6(this,void 0,void 0,function*(){let e=V.globalProvider;if(!e||e.state===oe.Loading)return;if(e&&e.state===oe.SignedOut){this.personDetailsInternal=null;return}let t=e.graph.forComponent(this);(this.verticalLayout&&this.view!=="fourlines"||this.fallbackDetails)&&(this.line2Property="email");let o=[...cx,this.line1Property,this.line2Property,this.line3Property,this.line4Property];o=o.filter(s=>s!=="email");let i=this.personDetailsInternal||this.personDetails;if(i){if(!i.personImage&&this.fetchImage&&this.avatarType==="photo"&&!this.personImage&&!this._fetchedImage){let s;"groupTypes"in i?s=yield X3(t,i):s=yield Nh(t,i,r.config.useContactApis),s&&(i.personImage=s,this._fetchedImage=s)}}else if(this.userId||this.personQuery==="me"){let s;this.avatarType==="photo"&&!this.disableImageFetch?s=yield ic(t,this.userId,o):this.personQuery==="me"?s=yield Fh(t,o):s=yield Lh(t,this.userId,o),this.personDetailsInternal=s,this.personDetails=s,this._fetchedImage=this.getImage()}else if(this.personQuery){let s=yield Na(t,this.personQuery,1);if((!s||s.length===0)&&(s=(yield ec(t,this.personQuery,1))||[]),s?.length&&(this.personDetailsInternal=s[0],this.personDetails=s[0],this.avatarType==="photo"&&!this.disableImageFetch)){let a=yield Nh(t,s[0],r.config.useContactApis);a&&(this.personDetailsInternal.personImage=a,this.personDetails.personImage=a,this._fetchedImage=a)}}i=this.personDetailsInternal||this.personDetails||this.fallbackDetails,this.personCardInteraction!=="none"&&Ev(t,i,this.personQuery==="me");let n={activity:"Offline",availability:"Offline",id:null};if(this.showPresence&&!this.personPresence&&!this._fetchedPresence)try{if(i){let s=this.personQuery!=="me"?i?.id:null;this._fetchedPresence=yield Uh(t,s)}else this._fetchedPresence=n}catch{this._fetchedPresence=n}})}getInitials(e){var t,o,i,n,s,a;if(e||(e=this.personDetailsInternal),z3(e))return e.initials;let u="";if(sv(e)&&(u+=(i=(o=(t=e.givenName)===null||t===void 0?void 0:t[0])===null||o===void 0?void 0:o.toUpperCase())!==null&&i!==void 0?i:"",u+=(a=(s=(n=e.surname)===null||n===void 0?void 0:n[0])===null||s===void 0?void 0:s.toUpperCase())!==null&&a!==void 0?a:""),!u&&e.displayName){let h=e.displayName.split(/\s+/);for(let p=0;p<2&&pdP(r,"photo")}),vt("design:type",String)],pt.prototype,"avatarType",void 0);jt([E({attribute:"person-presence",type:Object}),vt("design:type",Object),vt("design:paramtypes",[Object])],pt.prototype,"personPresence",null);jt([E({attribute:"person-card",converter:r=>Rd(r)}),vt("design:type",String)],pt.prototype,"personCardInteraction",void 0);jt([E({attribute:"line1-property"}),vt("design:type",String)],pt.prototype,"line1Property",void 0);jt([E({attribute:"line2-property"}),vt("design:type",String)],pt.prototype,"line2Property",void 0);jt([E({attribute:"line3-property"}),vt("design:type",String)],pt.prototype,"line3Property",void 0);jt([E({attribute:"line4-property"}),vt("design:type",String)],pt.prototype,"line4Property",void 0);jt([E({converter:r=>Ed(r,"image")}),vt("design:type",String)],pt.prototype,"view",void 0);jt([X(),vt("design:type",String)],pt.prototype,"_fetchedImage",void 0);jt([X(),vt("design:type",Object)],pt.prototype,"_fetchedPresence",void 0);jt([X(),vt("design:type",Boolean)],pt.prototype,"_isInvalidImageSrc",void 0);jt([X(),vt("design:type",Boolean)],pt.prototype,"_personCardShouldRender",void 0);jt([X(),vt("design:type",Object)],pt.prototype,"_hasLoadedPersonCard",void 0)});l();c();d();l();c();d();l();c();d();var zF=__STORYBOOK_API__,{ActiveTabs:VF,Consumer:qF,ManagerContext:GF,Provider:jF,addons:lp,combineParameters:KF,controlOrMetaKey:WF,controlOrMetaSymbol:QF,eventMatchesShortcut:YF,eventToShortcut:ZF,isMacLike:JF,isShortcutTaken:XF,keyToSymbol:eL,merge:tL,mockChannel:rL,optionOrAltSymbol:oL,shortcutMatchesShortcut:iL,shortcutToHumanString:nL,types:Hx,useAddonState:sL,useArgTypes:aL,useArgs:lL,useChannel:cL,useGlobalTypes:dL,useGlobals:uL,useParameter:hL,useSharedState:pL,useStoryPrepared:fL,useStorybookApi:mL,useStorybookState:gL}=__STORYBOOK_API__;l();c();d();l();c();d();l();c();d();l();c();d();var Ux=(()=>{let r;return typeof window<"u"?r=window:typeof globalThis<"u"?r=globalThis:typeof window<"u"?r=window:typeof self<"u"?r=self:r={},r})();l();c();d();var _L=__STORYBOOK_CLIENT_LOGGER__,{deprecate:TL,logger:Bx,once:EL,pretty:IL}=__STORYBOOK_CLIENT_LOGGER__;function uc(){return uc=Object.assign?Object.assign.bind():function(r){for(var e=1;e"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function cp(r,e,t){return C7()?cp=Reflect.construct.bind():cp=function(o,i,n){var s=[null];s.push.apply(s,i);var a=Function.bind.apply(o,s),u=new a;return n&&Bd(u,n.prototype),u},cp.apply(null,arguments)}function Zv(r){var e=typeof Map=="function"?new Map:void 0;return Zv=function(t){if(t===null||!w7(t))return t;if(typeof t!="function")throw new TypeError("Super expression must either be null or a function");if(typeof e<"u"){if(e.has(t))return e.get(t);e.set(t,o)}function o(){return cp(t,arguments,Yv(this).constructor)}return o.prototype=Object.create(t.prototype,{constructor:{value:o,enumerable:!1,writable:!0,configurable:!0}}),Bd(o,t)},Zv(r)}var x7={1:`Passed invalid arguments to hsl, please pass multiple numbers e.g. hsl(360, 0.75, 0.4) or an object e.g. rgb({ hue: 255, saturation: 0.4, lightness: 0.75 }). `,2:`Passed invalid arguments to hsla, please pass multiple numbers e.g. hsla(360, 0.75, 0.4, 0.7) or an object e.g. rgb({ hue: 255, saturation: 0.4, lightness: 0.75, alpha: 0.7 }). @@ -6371,11 +6371,11 @@ To pass a single animation please supply them in simple values, e.g. animation(' `,77:`remToPx expects a value in "rem" but you provided it in "%s". `,78:`base must be set in "px" or "%" but you set it in "%s". -`};function k7(){for(var r=arguments.length,e=new Array(r),t=0;t1?i-1:0),s=1;s=0&&i<1?(a=n,u=s):i>=1&&i<2?(a=s,u=n):i>=2&&i<3?(u=n,h=s):i>=3&&i<4?(u=s,h=n):i>=4&&i<5?(a=s,h=n):i>=5&&i<6&&(a=n,h=s);var p=t-n/2,f=a+p,b=u+p,C=h+p;return o(f,b,C)}var zx={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"00ffff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"0000ff",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"00ffff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"ff00ff",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"639",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"};function _7(r){if(typeof r!="string")return r;var e=r.toLowerCase();return zx[e]?"#"+zx[e]:r}var T7=/^#[a-fA-F0-9]{6}$/,E7=/^#[a-fA-F0-9]{8}$/,I7=/^#[a-fA-F0-9]{3}$/,A7=/^#[a-fA-F0-9]{4}$/,jv=/^rgb\(\s*(\d{1,3})\s*(?:,)?\s*(\d{1,3})\s*(?:,)?\s*(\d{1,3})\s*\)$/i,R7=/^rgb(?:a)?\(\s*(\d{1,3})\s*(?:,)?\s*(\d{1,3})\s*(?:,)?\s*(\d{1,3})\s*(?:,|\/)\s*([-+]?\d*[.]?\d+[%]?)\s*\)$/i,P7=/^hsl\(\s*(\d{0,3}[.]?[0-9]+(?:deg)?)\s*(?:,)?\s*(\d{1,3}[.]?[0-9]?)%\s*(?:,)?\s*(\d{1,3}[.]?[0-9]?)%\s*\)$/i,$7=/^hsl(?:a)?\(\s*(\d{0,3}[.]?[0-9]+(?:deg)?)\s*(?:,)?\s*(\d{1,3}[.]?[0-9]?)%\s*(?:,)?\s*(\d{1,3}[.]?[0-9]?)%\s*(?:,|\/)\s*([-+]?\d*[.]?\d+[%]?)\s*\)$/i;function pp(r){if(typeof r!="string")throw new yn(3);var e=_7(r);if(e.match(T7))return{red:parseInt(""+e[1]+e[2],16),green:parseInt(""+e[3]+e[4],16),blue:parseInt(""+e[5]+e[6],16)};if(e.match(E7)){var t=parseFloat((parseInt(""+e[7]+e[8],16)/255).toFixed(2));return{red:parseInt(""+e[1]+e[2],16),green:parseInt(""+e[3]+e[4],16),blue:parseInt(""+e[5]+e[6],16),alpha:t}}if(e.match(I7))return{red:parseInt(""+e[1]+e[1],16),green:parseInt(""+e[2]+e[2],16),blue:parseInt(""+e[3]+e[3],16)};if(e.match(A7)){var o=parseFloat((parseInt(""+e[4]+e[4],16)/255).toFixed(2));return{red:parseInt(""+e[1]+e[1],16),green:parseInt(""+e[2]+e[2],16),blue:parseInt(""+e[3]+e[3],16),alpha:o}}var i=jv.exec(e);if(i)return{red:parseInt(""+i[1],10),green:parseInt(""+i[2],10),blue:parseInt(""+i[3],10)};var n=R7.exec(e.substring(0,50));if(n)return{red:parseInt(""+n[1],10),green:parseInt(""+n[2],10),blue:parseInt(""+n[3],10),alpha:parseFloat(""+n[4])>1?parseFloat(""+n[4])/100:parseFloat(""+n[4])};var s=P7.exec(e);if(s){var a=parseInt(""+s[1],10),u=parseInt(""+s[2],10)/100,h=parseInt(""+s[3],10)/100,p="rgb("+zd(a,u,h)+")",f=jv.exec(p);if(!f)throw new yn(4,e,p);return{red:parseInt(""+f[1],10),green:parseInt(""+f[2],10),blue:parseInt(""+f[3],10)}}var b=$7.exec(e.substring(0,50));if(b){var C=parseInt(""+b[1],10),S=parseInt(""+b[2],10)/100,R=parseInt(""+b[3],10)/100,H="rgb("+zd(C,S,R)+")",ye=jv.exec(H);if(!ye)throw new yn(4,e,H);return{red:parseInt(""+ye[1],10),green:parseInt(""+ye[2],10),blue:parseInt(""+ye[3],10),alpha:parseFloat(""+b[4])>1?parseFloat(""+b[4])/100:parseFloat(""+b[4])}}throw new yn(5)}function O7(r){var e=r.red/255,t=r.green/255,o=r.blue/255,i=Math.max(e,t,o),n=Math.min(e,t,o),s=(i+n)/2;if(i===n)return r.alpha!==void 0?{hue:0,saturation:0,lightness:s,alpha:r.alpha}:{hue:0,saturation:0,lightness:s};var a,u=i-n,h=s>.5?u/(2-i-n):u/(i+n);switch(i){case e:a=(t-o)/u+(t=1?up(r,e,t):"rgba("+zd(r,e,t)+","+o+")";if(typeof r=="object"&&e===void 0&&t===void 0&&o===void 0)return r.alpha>=1?up(r.hue,r.saturation,r.lightness):"rgba("+zd(r.hue,r.saturation,r.lightness)+","+r.alpha+")";throw new yn(2)}function Xv(r,e,t){if(typeof r=="number"&&typeof e=="number"&&typeof t=="number")return Jv("#"+Ga(r)+Ga(e)+Ga(t));if(typeof r=="object"&&e===void 0&&t===void 0)return Jv("#"+Ga(r.red)+Ga(r.green)+Ga(r.blue));throw new yn(6)}function Vd(r,e,t,o){if(typeof r=="string"&&typeof e=="number"){var i=pp(r);return"rgba("+i.red+","+i.green+","+i.blue+","+e+")"}else{if(typeof r=="number"&&typeof e=="number"&&typeof t=="number"&&typeof o=="number")return o>=1?Xv(r,e,t):"rgba("+r+","+e+","+t+","+o+")";if(typeof r=="object"&&e===void 0&&t===void 0&&o===void 0)return r.alpha>=1?Xv(r.red,r.green,r.blue):"rgba("+r.red+","+r.green+","+r.blue+","+r.alpha+")"}throw new yn(7)}var N7=function(r){return typeof r.red=="number"&&typeof r.green=="number"&&typeof r.blue=="number"&&(typeof r.alpha!="number"||typeof r.alpha>"u")},H7=function(r){return typeof r.red=="number"&&typeof r.green=="number"&&typeof r.blue=="number"&&typeof r.alpha=="number"},U7=function(r){return typeof r.hue=="number"&&typeof r.saturation=="number"&&typeof r.lightness=="number"&&(typeof r.alpha!="number"||typeof r.alpha>"u")},B7=function(r){return typeof r.hue=="number"&&typeof r.saturation=="number"&&typeof r.lightness=="number"&&typeof r.alpha=="number"};function jx(r){if(typeof r!="object")throw new yn(8);if(H7(r))return Vd(r);if(N7(r))return Xv(r);if(B7(r))return L7(r);if(U7(r))return F7(r);throw new yn(8)}function Kx(r,e,t){return function(){var o=t.concat(Array.prototype.slice.call(arguments));return o.length>=e?r.apply(this,o):Kx(r,e,o)}}function fp(r){return Kx(r,r.length,[])}function mp(r,e,t){return Math.max(r,Math.min(e,t))}function z7(r,e){if(e==="transparent")return e;var t=Gx(e);return jx(uc({},t,{lightness:mp(0,1,t.lightness-parseFloat(r))}))}var V7=fp(z7),q7=V7;function G7(r,e){if(e==="transparent")return e;var t=Gx(e);return jx(uc({},t,{lightness:mp(0,1,t.lightness+parseFloat(r))}))}var j7=fp(G7),K7=j7;function W7(r,e){if(e==="transparent")return e;var t=pp(e),o=typeof t.alpha=="number"?t.alpha:1,i=uc({},t,{alpha:mp(0,1,(o*100+parseFloat(r)*100)/100)});return Vd(i)}var DL=fp(W7);function Q7(r,e){if(e==="transparent")return e;var t=pp(e),o=typeof t.alpha=="number"?t.alpha:1,i=uc({},t,{alpha:mp(0,1,+(o*100-parseFloat(r)*100).toFixed(2)/100)});return Vd(i)}var Y7=fp(Q7),Z7=Y7,Qt={primary:"#FF4785",secondary:"#029CFD",tertiary:"#FAFBFC",ancillary:"#22a699",orange:"#FC521F",gold:"#FFAE00",green:"#66BF3C",seafoam:"#37D5D3",purple:"#6F2CAC",ultraviolet:"#2A0481",lightest:"#FFFFFF",lighter:"#F7FAFC",light:"#EEF3F6",mediumlight:"#ECF4F9",medium:"#D9E8F2",mediumdark:"#73828C",dark:"#5C6870",darker:"#454E54",darkest:"#2E3438",border:"hsla(203, 50%, 30%, 0.15)",positive:"#66BF3C",negative:"#FF4400",warning:"#E69D00",critical:"#FFFFFF",defaultText:"#2E3438",inverseText:"#FFFFFF",positiveText:"#448028",negativeText:"#D43900",warningText:"#A15C20"},Vx={app:"#F6F9FC",bar:Qt.lightest,content:Qt.lightest,preview:Qt.lightest,gridCellSize:10,hoverable:Z7(.9,Qt.secondary),positive:"#E1FFD4",negative:"#FEDED2",warning:"#FFF5CF",critical:"#FF4400"},hp={fonts:{base:['"Nunito Sans"',"-apple-system",'".SFNSText-Regular"','"San Francisco"',"BlinkMacSystemFont",'"Segoe UI"','"Helvetica Neue"',"Helvetica","Arial","sans-serif"].join(", "),mono:["ui-monospace","Menlo","Monaco",'"Roboto Mono"','"Oxygen Mono"','"Ubuntu Monospace"','"Source Code Pro"','"Droid Sans Mono"','"Courier New"',"monospace"].join(", ")},weight:{regular:400,bold:700},size:{s1:12,s2:14,s3:16,m1:20,m2:24,m3:28,l1:32,l2:40,l3:48,code:90}},J7={base:"light",colorPrimary:"#FF4785",colorSecondary:"#029CFD",appBg:Vx.app,appContentBg:Qt.lightest,appPreviewBg:Qt.lightest,appBorderColor:Qt.border,appBorderRadius:4,fontBase:hp.fonts.base,fontCode:hp.fonts.mono,textColor:Qt.darkest,textInverseColor:Qt.lightest,textMutedColor:Qt.dark,barTextColor:Qt.mediumdark,barHoverColor:Qt.secondary,barSelectedColor:Qt.secondary,barBg:Qt.lightest,buttonBg:Vx.app,buttonBorder:Qt.medium,booleanBg:Qt.mediumlight,booleanSelectedBg:Qt.lightest,inputBg:Qt.lightest,inputBorder:Qt.border,inputTextColor:Qt.darkest,inputBorderRadius:4},qx=J7,X7={base:"dark",colorPrimary:"#FF4785",colorSecondary:"#029CFD",appBg:"#222425",appContentBg:"#1B1C1D",appPreviewBg:Qt.lightest,appBorderColor:"rgba(255,255,255,.1)",appBorderRadius:4,fontBase:hp.fonts.base,fontCode:hp.fonts.mono,textColor:"#C9CDCF",textInverseColor:"#222425",textMutedColor:"#798186",barTextColor:"#798186",barHoverColor:Qt.secondary,barSelectedColor:Qt.secondary,barBg:"#292C2E",buttonBg:"#222425",buttonBorder:"rgba(255,255,255,.1)",booleanBg:"#222425",booleanSelectedBg:"#2E3438",inputBg:"#1B1C1D",inputBorder:"rgba(255,255,255,.1)",inputTextColor:Qt.lightest,inputBorderRadius:4},eO=X7,{window:Wv}=Ux;var tO=r=>typeof r!="string"?(Bx.warn(`Color passed to theme object should be a string. Instead ${r}(${typeof r}) was passed.`),!1):!0,rO=r=>!/(gradient|var|calc)/.test(r),oO=(r,e)=>r==="darken"?Vd(`${q7(1,e)}`,.95):r==="lighten"?Vd(`${K7(1,e)}`,.95):e,Wx=r=>e=>{if(!tO(e)||!rO(e))return e;try{return oO(r,e)}catch{return e}},FL=Wx("lighten"),LL=Wx("darken"),iO=()=>!Wv||!Wv.matchMedia?"light":Wv.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light",dp={light:qx,dark:eO,normal:qx},Qv=iO(),e0=(r={base:Qv},e)=>{let t={...dp[Qv],...dp[r.base]||{},...r,base:dp[r.base]?r.base:Qv};return{...e,...t,barSelectedColor:r.barSelectedColor||t.colorSecondary}};var Qx=e0({base:"light",colorSecondary:"#0360B9",textColor:"#1A1A1A",textInverseColor:"rgba(255,255,255,0.9)",barTextColor:"#717171",brandTitle:"Microsoft Graph Toolkit Playground",brandUrl:"https://aka.ms/mgt"});l();c();d();var Tr=__REACT__,{Children:JL,Component:Yx,Fragment:XL,Profiler:eN,PureComponent:tN,StrictMode:rN,Suspense:oN,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:iN,cloneElement:nN,createContext:sN,createElement:aN,createFactory:lN,createRef:cN,forwardRef:dN,isValidElement:uN,lazy:hN,memo:pN,useCallback:fN,useContext:mN,useDebugValue:gN,useEffect:vN,useImperativeHandle:yN,useLayoutEffect:bN,useMemo:wN,useReducer:CN,useRef:xN,useState:Zx,version:kN}=__REACT__;l();c();d();var IN=__STORYBOOK_API__,{ActiveTabs:AN,Consumer:RN,ManagerContext:PN,Provider:$N,addons:ON,combineParameters:MN,controlOrMetaKey:DN,controlOrMetaSymbol:FN,eventMatchesShortcut:LN,eventToShortcut:NN,isMacLike:HN,isShortcutTaken:UN,keyToSymbol:BN,merge:zN,mockChannel:VN,optionOrAltSymbol:qN,shortcutMatchesShortcut:GN,shortcutToHumanString:jN,types:KN,useAddonState:WN,useArgTypes:QN,useArgs:YN,useChannel:Jx,useGlobalTypes:ZN,useGlobals:JN,useParameter:XN,useSharedState:eH,useStoryPrepared:tH,useStorybookApi:rH,useStorybookState:oH}=__STORYBOOK_API__;es();bn();l();c();d();ge();l();c();d();l();c();d();l();c();d();l();c();d();var ny=function(r,e){return ny=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,o){t.__proto__=o}||function(t,o){for(var i in o)Object.prototype.hasOwnProperty.call(o,i)&&(t[i]=o[i])},ny(r,e)};function mt(r,e){ny(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}var ae=function(){return ae=Object.assign||function(e){for(var t,o=1,i=arguments.length;o0&&n[n.length-1])&&(h[0]===6||h[0]===2)){t=0;continue}if(h[0]===3&&(!n||h[1]>n[0]&&h[1]0)&&!(i=o.next()).done;)n.push(i.value)}catch(a){s={error:a}}finally{try{i&&!i.done&&(t=o.return)&&t.call(o)}finally{if(s)throw s.error}}return n}function Tc(){for(var r=[],e=0;e0&&n[n.length-1])&&(h[0]===6||h[0]===2)){t=0;continue}if(h[0]===3&&(!n||h[1]>n[0]&&h[1]"u"||!e||e.length===0},r.isEmptyObj=function(e){if(e&&!r.isEmpty(e))try{var t=JSON.parse(e);return Object.keys(t).length===0}catch{}return!0},r.startsWith=function(e,t){return e.indexOf(t)===0},r.endsWith=function(e,t){return e.length>=t.length&&e.lastIndexOf(t)===e.length-t.length},r.queryStringToObject=function(e){var t={},o=e.split("&"),i=function(n){return decodeURIComponent(n.replace(/\+/g," "))};return o.forEach(function(n){if(n.trim()){var s=n.split(/=(.+)/g,2),a=s[0],u=s[1];a&&u&&(t[i(a)]=i(u))}}),t},r.trimArrayEntries=function(e){return e.map(function(t){return t.trim()})},r.removeEmptyStringsFromArray=function(e){return e.filter(function(t){return!r.isEmpty(t)})},r.jsonParseHelper=function(e){try{return JSON.parse(e)}catch{return null}},r.matchPattern=function(e,t){var o=new RegExp(e.replace(/\\/g,"\\\\").replace(/\*/g,"[^ ]*").replace(/\?/g,"\\?"));return o.test(t)},r}();var ir;(function(r){r[r.Error=0]="Error",r[r.Warning=1]="Warning",r[r.Info=2]="Info",r[r.Verbose=3]="Verbose",r[r.Trace=4]="Trace"})(ir||(ir={}));var _n=function(){function r(e,t,o){this.level=ir.Info;var i=function(){},n=e||r.createDefaultLoggerOptions();this.localCallback=n.loggerCallback||i,this.piiLoggingEnabled=n.piiLoggingEnabled||!1,this.level=typeof n.logLevel=="number"?n.logLevel:ir.Info,this.correlationId=n.correlationId||_.EMPTY_STRING,this.packageName=t||_.EMPTY_STRING,this.packageVersion=o||_.EMPTY_STRING}return r.createDefaultLoggerOptions=function(){return{loggerCallback:function(){},piiLoggingEnabled:!1,logLevel:ir.Info}},r.prototype.clone=function(e,t,o){return new r({loggerCallback:this.localCallback,piiLoggingEnabled:this.piiLoggingEnabled,logLevel:this.level,correlationId:o||this.correlationId},e,t)},r.prototype.logMessage=function(e,t){if(!(t.logLevel>this.level||!this.piiLoggingEnabled&&t.containsPii)){var o=new Date().toUTCString(),i;B.isEmpty(t.correlationId)?B.isEmpty(this.correlationId)?i="["+o+"]":i="["+o+"] : ["+this.correlationId+"]":i="["+o+"] : ["+t.correlationId+"]";var n=i+" : "+this.packageName+"@"+this.packageVersion+" : "+ir[t.logLevel]+" - "+e;this.executeCallback(t.logLevel,n,t.containsPii||!1)}},r.prototype.executeCallback=function(e,t,o){this.localCallback&&this.localCallback(e,t,o)},r.prototype.error=function(e,t){this.logMessage(e,{logLevel:ir.Error,containsPii:!1,correlationId:t||_.EMPTY_STRING})},r.prototype.errorPii=function(e,t){this.logMessage(e,{logLevel:ir.Error,containsPii:!0,correlationId:t||_.EMPTY_STRING})},r.prototype.warning=function(e,t){this.logMessage(e,{logLevel:ir.Warning,containsPii:!1,correlationId:t||_.EMPTY_STRING})},r.prototype.warningPii=function(e,t){this.logMessage(e,{logLevel:ir.Warning,containsPii:!0,correlationId:t||_.EMPTY_STRING})},r.prototype.info=function(e,t){this.logMessage(e,{logLevel:ir.Info,containsPii:!1,correlationId:t||_.EMPTY_STRING})},r.prototype.infoPii=function(e,t){this.logMessage(e,{logLevel:ir.Info,containsPii:!0,correlationId:t||_.EMPTY_STRING})},r.prototype.verbose=function(e,t){this.logMessage(e,{logLevel:ir.Verbose,containsPii:!1,correlationId:t||_.EMPTY_STRING})},r.prototype.verbosePii=function(e,t){this.logMessage(e,{logLevel:ir.Verbose,containsPii:!0,correlationId:t||_.EMPTY_STRING})},r.prototype.trace=function(e,t){this.logMessage(e,{logLevel:ir.Trace,containsPii:!1,correlationId:t||_.EMPTY_STRING})},r.prototype.tracePii=function(e,t){this.logMessage(e,{logLevel:ir.Trace,containsPii:!0,correlationId:t||_.EMPTY_STRING})},r.prototype.isPiiLoggingEnabled=function(){return this.piiLoggingEnabled||!1},r}();l();c();d();var Ef="@azure/msal-common",yl="13.3.1";l();c();d();var Tn;(function(r){r[r.None=0]="None",r.AzurePublic="https://login.microsoftonline.com",r.AzurePpe="https://login.windows-ppe.net",r.AzureChina="https://login.chinacloudapi.cn",r.AzureGermany="https://login.microsoftonline.de",r.AzureUsGovernment="https://login.microsoftonline.us"})(Tn||(Tn={}));l();c();d();l();c();d();l();c();d();var Ue={redirectUriNotSet:{code:"redirect_uri_empty",desc:"A redirect URI is required for all calls, and none has been set."},postLogoutUriNotSet:{code:"post_logout_uri_empty",desc:"A post logout redirect has not been set."},claimsRequestParsingError:{code:"claims_request_parsing_error",desc:"Could not parse the given claims request object."},authorityUriInsecure:{code:"authority_uri_insecure",desc:"Authority URIs must use https. Please see here for valid authority configuration options: https://docs.microsoft.com/en-us/azure/active-directory/develop/msal-js-initializing-client-applications#configuration-options"},urlParseError:{code:"url_parse_error",desc:"URL could not be parsed into appropriate segments."},urlEmptyError:{code:"empty_url_error",desc:"URL was empty or null."},emptyScopesError:{code:"empty_input_scopes_error",desc:"Scopes cannot be passed as null, undefined or empty array because they are required to obtain an access token."},nonArrayScopesError:{code:"nonarray_input_scopes_error",desc:"Scopes cannot be passed as non-array."},clientIdSingleScopeError:{code:"clientid_input_scopes_error",desc:"Client ID can only be provided as a single scope."},invalidPrompt:{code:"invalid_prompt_value",desc:"Supported prompt values are 'login', 'select_account', 'consent', 'create', 'none' and 'no_session'. Please see here for valid configuration options: https://azuread.github.io/microsoft-authentication-library-for-js/ref/modules/_azure_msal_common.html#commonauthorizationurlrequest"},invalidClaimsRequest:{code:"invalid_claims",desc:"Given claims parameter must be a stringified JSON object."},tokenRequestEmptyError:{code:"token_request_empty",desc:"Token request was empty and not found in cache."},logoutRequestEmptyError:{code:"logout_request_empty",desc:"The logout request was null or undefined."},invalidCodeChallengeMethod:{code:"invalid_code_challenge_method",desc:'code_challenge_method passed is invalid. Valid values are "plain" and "S256".'},invalidCodeChallengeParams:{code:"pkce_params_missing",desc:"Both params: code_challenge and code_challenge_method are to be passed if to be sent in the request"},invalidCloudDiscoveryMetadata:{code:"invalid_cloud_discovery_metadata",desc:"Invalid cloudDiscoveryMetadata provided. Must be a stringified JSON object containing tenant_discovery_endpoint and metadata fields"},invalidAuthorityMetadata:{code:"invalid_authority_metadata",desc:"Invalid authorityMetadata provided. Must by a stringified JSON object containing authorization_endpoint, token_endpoint, issuer fields."},untrustedAuthority:{code:"untrusted_authority",desc:"The provided authority is not a trusted authority. Please include this authority in the knownAuthorities config parameter."},invalidAzureCloudInstance:{code:"invalid_azure_cloud_instance",desc:"Invalid AzureCloudInstance provided. Please refer MSAL JS docs: aks.ms/msaljs/azure_cloud_instance for valid values"},missingSshJwk:{code:"missing_ssh_jwk",desc:"Missing sshJwk in SSH certificate request. A stringified JSON Web Key is required when using the SSH authentication scheme."},missingSshKid:{code:"missing_ssh_kid",desc:"Missing sshKid in SSH certificate request. A string that uniquely identifies the public SSH key is required when using the SSH authentication scheme."},missingNonceAuthenticationHeader:{code:"missing_nonce_authentication_header",desc:"Unable to find an authentication header containing server nonce. Either the Authentication-Info or WWW-Authenticate headers must be present in order to obtain a server nonce."},invalidAuthenticationHeader:{code:"invalid_authentication_header",desc:"Invalid authentication header provided"},authorityMismatch:{code:"authority_mismatch",desc:"Authority mismatch error. Authority provided in login request or PublicClientApplication config does not match the environment of the provided account. Please use a matching account or make an interactive request to login to this authority."}},je=function(r){nt(e,r);function e(t,o){var i=r.call(this,t,o)||this;return i.name="ClientConfigurationError",Object.setPrototypeOf(i,e.prototype),i}return e.createRedirectUriEmptyError=function(){return new e(Ue.redirectUriNotSet.code,Ue.redirectUriNotSet.desc)},e.createPostLogoutRedirectUriEmptyError=function(){return new e(Ue.postLogoutUriNotSet.code,Ue.postLogoutUriNotSet.desc)},e.createClaimsRequestParsingError=function(t){return new e(Ue.claimsRequestParsingError.code,Ue.claimsRequestParsingError.desc+" Given value: "+t)},e.createInsecureAuthorityUriError=function(t){return new e(Ue.authorityUriInsecure.code,Ue.authorityUriInsecure.desc+" Given URI: "+t)},e.createUrlParseError=function(t){return new e(Ue.urlParseError.code,Ue.urlParseError.desc+" Given Error: "+t)},e.createUrlEmptyError=function(){return new e(Ue.urlEmptyError.code,Ue.urlEmptyError.desc)},e.createEmptyScopesArrayError=function(){return new e(Ue.emptyScopesError.code,""+Ue.emptyScopesError.desc)},e.createClientIdSingleScopeError=function(t){return new e(Ue.clientIdSingleScopeError.code,Ue.clientIdSingleScopeError.desc+" Given Scopes: "+t)},e.createInvalidPromptError=function(t){return new e(Ue.invalidPrompt.code,Ue.invalidPrompt.desc+" Given value: "+t)},e.createInvalidClaimsRequestError=function(){return new e(Ue.invalidClaimsRequest.code,Ue.invalidClaimsRequest.desc)},e.createEmptyLogoutRequestError=function(){return new e(Ue.logoutRequestEmptyError.code,Ue.logoutRequestEmptyError.desc)},e.createEmptyTokenRequestError=function(){return new e(Ue.tokenRequestEmptyError.code,Ue.tokenRequestEmptyError.desc)},e.createInvalidCodeChallengeMethodError=function(){return new e(Ue.invalidCodeChallengeMethod.code,Ue.invalidCodeChallengeMethod.desc)},e.createInvalidCodeChallengeParamsError=function(){return new e(Ue.invalidCodeChallengeParams.code,Ue.invalidCodeChallengeParams.desc)},e.createInvalidCloudDiscoveryMetadataError=function(){return new e(Ue.invalidCloudDiscoveryMetadata.code,Ue.invalidCloudDiscoveryMetadata.desc)},e.createInvalidAuthorityMetadataError=function(){return new e(Ue.invalidAuthorityMetadata.code,Ue.invalidAuthorityMetadata.desc)},e.createUntrustedAuthorityError=function(){return new e(Ue.untrustedAuthority.code,Ue.untrustedAuthority.desc)},e.createInvalidAzureCloudInstanceError=function(){return new e(Ue.invalidAzureCloudInstance.code,Ue.invalidAzureCloudInstance.desc)},e.createMissingSshJwkError=function(){return new e(Ue.missingSshJwk.code,Ue.missingSshJwk.desc)},e.createMissingSshKidError=function(){return new e(Ue.missingSshKid.code,Ue.missingSshKid.desc)},e.createMissingNonceAuthenticationHeadersError=function(){return new e(Ue.missingNonceAuthenticationHeader.code,Ue.missingNonceAuthenticationHeader.desc)},e.createInvalidAuthenticationHeaderError=function(t,o){return new e(Ue.invalidAuthenticationHeader.code,Ue.invalidAuthenticationHeader.desc+". Invalid header: "+t+". Details: "+o)},e.createAuthorityMismatchError=function(){return new e(Ue.authorityMismatch.code,Ue.authorityMismatch.desc)},e}(U);var It=function(){function r(e){var t=this,o=e?B.trimArrayEntries(Js(e)):[],i=o?B.removeEmptyStringsFromArray(o):[];this.validateInputScopes(i),this.scopes=new Set,i.forEach(function(n){return t.scopes.add(n)})}return r.fromString=function(e){var t=e||_.EMPTY_STRING,o=t.split(" ");return new r(o)},r.createSearchScopes=function(e){var t=new r(e);return t.containsOnlyOIDCScopes()?t.removeScope(_.OFFLINE_ACCESS_SCOPE):t.removeOIDCScopes(),t},r.prototype.validateInputScopes=function(e){if(!e||e.length<1)throw je.createEmptyScopesArrayError()},r.prototype.containsScope=function(e){var t=this.printScopesLowerCase().split(" "),o=new r(t);return B.isEmpty(e)?!1:o.scopes.has(e.toLowerCase())},r.prototype.containsScopeSet=function(e){var t=this;return!e||e.scopes.size<=0?!1:this.scopes.size>=e.scopes.size&&e.asArray().every(function(o){return t.containsScope(o)})},r.prototype.containsOnlyOIDCScopes=function(){var e=this,t=0;return ly.forEach(function(o){e.containsScope(o)&&(t+=1)}),this.scopes.size===t},r.prototype.appendScope=function(e){B.isEmpty(e)||this.scopes.add(e.trim())},r.prototype.appendScopes=function(e){var t=this;try{e.forEach(function(o){return t.appendScope(o)})}catch(o){throw U.createAppendScopeSetError(o)}},r.prototype.removeScope=function(e){if(B.isEmpty(e))throw U.createRemoveEmptyScopeFromSetError(e);this.scopes.delete(e.trim())},r.prototype.removeOIDCScopes=function(){var e=this;ly.forEach(function(t){e.scopes.delete(t)})},r.prototype.unionScopeSets=function(e){if(!e)throw U.createEmptyInputScopeSetError();var t=new Set;return e.scopes.forEach(function(o){return t.add(o.toLowerCase())}),this.scopes.forEach(function(o){return t.add(o.toLowerCase())}),t},r.prototype.intersectingScopeSets=function(e){if(!e)throw U.createEmptyInputScopeSetError();e.containsOnlyOIDCScopes()||e.removeOIDCScopes();var t=this.unionScopeSets(e),o=e.getScopeCount(),i=this.getScopeCount(),n=t.size;return ne+t)throw U.createMaxAgeTranspiredError()},r}();var Xr=function(){function r(e,t,o){this.clientId=e,this.cryptoImpl=t,this.commonLogger=o.clone(Ef,yl)}return r.prototype.getAllAccounts=function(){var e=this,t=this.getAccountKeys();if(t.length<1)return[];var o=t.reduce(function(n,s){var a=e.getAccount(s);return a&&n.push(a),n},[]);if(o.length<1)return[];var i=o.map(function(n){return e.getAccountInfoFromEntity(n)});return i},r.prototype.getAccountInfoFilteredBy=function(e){var t=this.getAccountsFilteredBy(e);return t.length>0?this.getAccountInfoFromEntity(t[0]):null},r.prototype.getAccountInfoFromEntity=function(e){var t=e.getAccountInfo(),o=this.getIdToken(t);return o&&(t.idToken=o.secret,t.idTokenClaims=new fr(o.secret,this.cryptoImpl).claims),t},r.prototype.saveCacheRecord=function(e){return le(this,void 0,void 0,function(){return ce(this,function(t){switch(t.label){case 0:if(!e)throw U.createNullOrUndefinedCacheRecord();return e.account&&this.setAccount(e.account),e.idToken&&this.setIdTokenCredential(e.idToken),e.accessToken?[4,this.saveAccessToken(e.accessToken)]:[3,2];case 1:t.sent(),t.label=2;case 2:return e.refreshToken&&this.setRefreshTokenCredential(e.refreshToken),e.appMetadata&&this.setAppMetadata(e.appMetadata),[2]}})})},r.prototype.saveAccessToken=function(e){return le(this,void 0,void 0,function(){var t,o,i,n,s=this;return ce(this,function(a){switch(a.label){case 0:return t={clientId:e.clientId,credentialType:e.credentialType,environment:e.environment,homeAccountId:e.homeAccountId,realm:e.realm,tokenType:e.tokenType,requestedClaimsHash:e.requestedClaimsHash},o=this.getTokenKeys(),i=It.fromString(e.target),n=[],o.accessToken.forEach(function(u){if(s.accessTokenKeyMatchesFilter(u,t,!1)){var h=s.getAccessTokenCredential(u);if(h&&s.credentialMatchesFilter(h,t)){var p=It.fromString(h.target);p.intersectingScopeSets(i)&&n.push(s.removeAccessToken(u))}}}),[4,Promise.all(n)];case 1:return a.sent(),this.setAccessTokenCredential(e),[2]}})})},r.prototype.getAccountsFilteredBy=function(e){var t=this,o=this.getAccountKeys(),i=[];return o.forEach(function(n){if(t.isAccountKey(n,e.homeAccountId,e.realm)){var s=t.getAccount(n);s&&(e.homeAccountId&&!t.matchHomeAccountId(s,e.homeAccountId)||e.localAccountId&&!t.matchLocalAccountId(s,e.localAccountId)||e.username&&!t.matchUsername(s,e.username)||e.environment&&!t.matchEnvironment(s,e.environment)||e.realm&&!t.matchRealm(s,e.realm)||e.nativeAccountId&&!t.matchNativeAccountId(s,e.nativeAccountId)||i.push(s))}}),i},r.prototype.isAccountKey=function(e,t,o){return!(e.split(Lt.CACHE_KEY_SEPARATOR).length<3||t&&!e.toLowerCase().includes(t.toLowerCase())||o&&!e.toLowerCase().includes(o.toLowerCase()))},r.prototype.isCredentialKey=function(e){if(e.split(Lt.CACHE_KEY_SEPARATOR).length<6)return!1;var t=e.toLowerCase();if(t.indexOf(ue.ID_TOKEN.toLowerCase())===-1&&t.indexOf(ue.ACCESS_TOKEN.toLowerCase())===-1&&t.indexOf(ue.ACCESS_TOKEN_WITH_AUTH_SCHEME.toLowerCase())===-1&&t.indexOf(ue.REFRESH_TOKEN.toLowerCase())===-1)return!1;if(t.indexOf(ue.REFRESH_TOKEN.toLowerCase())>-1){var o=""+ue.REFRESH_TOKEN+Lt.CACHE_KEY_SEPARATOR+this.clientId+Lt.CACHE_KEY_SEPARATOR,i=""+ue.REFRESH_TOKEN+Lt.CACHE_KEY_SEPARATOR+ea+Lt.CACHE_KEY_SEPARATOR;if(t.indexOf(o.toLowerCase())===-1&&t.indexOf(i.toLowerCase())===-1)return!1}else if(t.indexOf(this.clientId.toLowerCase())===-1)return!1;return!0},r.prototype.credentialMatchesFilter=function(e,t){return!(t.clientId&&!this.matchClientId(e,t.clientId)||t.userAssertionHash&&!this.matchUserAssertionHash(e,t.userAssertionHash)||typeof t.homeAccountId=="string"&&!this.matchHomeAccountId(e,t.homeAccountId)||t.environment&&!this.matchEnvironment(e,t.environment)||t.realm&&!this.matchRealm(e,t.realm)||t.credentialType&&!this.matchCredentialType(e,t.credentialType)||t.familyId&&!this.matchFamilyId(e,t.familyId)||t.target&&!this.matchTarget(e,t.target)||(t.requestedClaimsHash||e.requestedClaimsHash)&&e.requestedClaimsHash!==t.requestedClaimsHash||e.credentialType===ue.ACCESS_TOKEN_WITH_AUTH_SCHEME&&(t.tokenType&&!this.matchTokenType(e,t.tokenType)||t.tokenType===Be.SSH&&t.keyId&&!this.matchKeyId(e,t.keyId)))},r.prototype.getAppMetadataFilteredBy=function(e){return this.getAppMetadataFilteredByInternal(e.environment,e.clientId)},r.prototype.getAppMetadataFilteredByInternal=function(e,t){var o=this,i=this.getKeys(),n={};return i.forEach(function(s){if(o.isAppMetadata(s)){var a=o.getAppMetadata(s);a&&(e&&!o.matchEnvironment(a,e)||t&&!o.matchClientId(a,t)||(n[s]=a))}}),n},r.prototype.getAuthorityMetadataByAlias=function(e){var t=this,o=this.getAuthorityMetadataKeys(),i=null;return o.forEach(function(n){if(!(!t.isAuthorityMetadata(n)||n.indexOf(t.clientId)===-1)){var s=t.getAuthorityMetadata(n);s&&s.aliases.indexOf(e)!==-1&&(i=s)}}),i},r.prototype.removeAllAccounts=function(){return le(this,void 0,void 0,function(){var e,t,o=this;return ce(this,function(i){switch(i.label){case 0:return e=this.getAccountKeys(),t=[],e.forEach(function(n){t.push(o.removeAccount(n))}),[4,Promise.all(t)];case 1:return i.sent(),[2]}})})},r.prototype.removeAccount=function(e){return le(this,void 0,void 0,function(){var t;return ce(this,function(o){switch(o.label){case 0:if(t=this.getAccount(e),!t)throw U.createNoAccountFoundError();return[4,this.removeAccountContext(t)];case 1:return o.sent(),this.removeItem(e),[2]}})})},r.prototype.removeAccountContext=function(e){return le(this,void 0,void 0,function(){var t,o,i,n=this;return ce(this,function(s){switch(s.label){case 0:return t=this.getTokenKeys(),o=e.generateAccountId(),i=[],t.idToken.forEach(function(a){a.indexOf(o)===0&&n.removeIdToken(a)}),t.accessToken.forEach(function(a){a.indexOf(o)===0&&i.push(n.removeAccessToken(a))}),t.refreshToken.forEach(function(a){a.indexOf(o)===0&&n.removeRefreshToken(a)}),[4,Promise.all(i)];case 1:return s.sent(),[2]}})})},r.prototype.removeAccessToken=function(e){return le(this,void 0,void 0,function(){var t,o,i;return ce(this,function(n){switch(n.label){case 0:if(t=this.getAccessTokenCredential(e),!t)return[2];if(t.credentialType.toLowerCase()!==ue.ACCESS_TOKEN_WITH_AUTH_SCHEME.toLowerCase())return[3,4];if(t.tokenType!==Be.POP)return[3,4];if(o=t,i=o.keyId,!i)return[3,4];n.label=1;case 1:return n.trys.push([1,3,,4]),[4,this.cryptoImpl.removeTokenBindingKey(i)];case 2:return n.sent(),[3,4];case 3:throw n.sent(),U.createBindingKeyNotRemovedError();case 4:return[2,this.removeItem(e)]}})})},r.prototype.removeAppMetadata=function(){var e=this,t=this.getKeys();return t.forEach(function(o){e.isAppMetadata(o)&&e.removeItem(o)}),!0},r.prototype.readCacheRecord=function(e,t,o){var i=this.getTokenKeys(),n=this.readAccountFromCache(e),s=this.getIdToken(e,i),a=this.getAccessToken(e,t,i),u=this.getRefreshToken(e,!1,i),h=this.readAppMetadataFromCache(o);return n&&s&&(n.idTokenClaims=new fr(s.secret,this.cryptoImpl).claims),{account:n,idToken:s,accessToken:a,refreshToken:u,appMetadata:h}},r.prototype.readAccountFromCache=function(e){var t=Nt.generateAccountCacheKey(e);return this.getAccount(t)},r.prototype.getIdToken=function(e,t){var o=this;this.commonLogger.trace("CacheManager - getIdToken called");var i={homeAccountId:e.homeAccountId,environment:e.environment,credentialType:ue.ID_TOKEN,clientId:this.clientId,realm:e.tenantId},n=this.getIdTokensByFilter(i,t),s=n.length;return s<1?(this.commonLogger.info("CacheManager:getIdToken - No token found"),null):s>1?(this.commonLogger.info("CacheManager:getIdToken - Multiple id tokens found, clearing them"),n.forEach(function(a){o.removeIdToken(a.generateCredentialKey())}),null):(this.commonLogger.info("CacheManager:getIdToken - Returning id token"),n[0])},r.prototype.getIdTokensByFilter=function(e,t){var o=this,i=t&&t.idToken||this.getTokenKeys().idToken,n=[];return i.forEach(function(s){if(o.idTokenKeyMatchesFilter(s,rt({clientId:o.clientId},e))){var a=o.getIdTokenCredential(s);a&&o.credentialMatchesFilter(a,e)&&n.push(a)}}),n},r.prototype.idTokenKeyMatchesFilter=function(e,t){var o=e.toLowerCase();return!(t.clientId&&o.indexOf(t.clientId.toLowerCase())===-1||t.homeAccountId&&o.indexOf(t.homeAccountId.toLowerCase())===-1)},r.prototype.removeIdToken=function(e){this.removeItem(e)},r.prototype.removeRefreshToken=function(e){this.removeItem(e)},r.prototype.getAccessToken=function(e,t,o){var i=this;this.commonLogger.trace("CacheManager - getAccessToken called");var n=It.createSearchScopes(t.scopes),s=t.authenticationScheme||Be.BEARER,a=s&&s.toLowerCase()!==Be.BEARER.toLowerCase()?ue.ACCESS_TOKEN_WITH_AUTH_SCHEME:ue.ACCESS_TOKEN,u={homeAccountId:e.homeAccountId,environment:e.environment,credentialType:a,clientId:this.clientId,realm:e.tenantId,target:n,tokenType:s,keyId:t.sshKid,requestedClaimsHash:t.requestedClaimsHash},h=o&&o.accessToken||this.getTokenKeys().accessToken,p=[];h.forEach(function(b){if(i.accessTokenKeyMatchesFilter(b,u,!0)){var C=i.getAccessTokenCredential(b);C&&i.credentialMatchesFilter(C,u)&&p.push(C)}});var f=p.length;return f<1?(this.commonLogger.info("CacheManager:getAccessToken - No token found"),null):f>1?(this.commonLogger.info("CacheManager:getAccessToken - Multiple access tokens found, clearing them"),p.forEach(function(b){i.removeAccessToken(b.generateCredentialKey())}),null):(this.commonLogger.info("CacheManager:getAccessToken - Returning access token"),p[0])},r.prototype.accessTokenKeyMatchesFilter=function(e,t,o){var i=e.toLowerCase();if(t.clientId&&i.indexOf(t.clientId.toLowerCase())===-1||t.homeAccountId&&i.indexOf(t.homeAccountId.toLowerCase())===-1||t.realm&&i.indexOf(t.realm.toLowerCase())===-1||t.requestedClaimsHash&&i.indexOf(t.requestedClaimsHash.toLowerCase())===-1)return!1;if(t.target)for(var n=t.target.asArray(),s=0;s1)throw U.createMultipleMatchingAppMetadataInCacheError();return i[0]},r.prototype.isAppMetadataFOCI=function(e){var t=this.readAppMetadataFromCache(e);return!!(t&&t.familyId===ea)},r.prototype.matchHomeAccountId=function(e,t){return typeof e.homeAccountId=="string"&&t===e.homeAccountId},r.prototype.matchLocalAccountId=function(e,t){return typeof e.localAccountId=="string"&&t===e.localAccountId},r.prototype.matchUsername=function(e,t){return typeof e.username=="string"&&t.toLowerCase()===e.username.toLowerCase()},r.prototype.matchUserAssertionHash=function(e,t){return!!(e.userAssertionHash&&t===e.userAssertionHash)},r.prototype.matchEnvironment=function(e,t){var o=this.getAuthorityMetadataByAlias(t);return!!(o&&o.aliases.indexOf(e.environment)>-1)},r.prototype.matchCredentialType=function(e,t){return e.credentialType&&t.toLowerCase()===e.credentialType.toLowerCase()},r.prototype.matchClientId=function(e,t){return!!(e.clientId&&t===e.clientId)},r.prototype.matchFamilyId=function(e,t){return!!(e.familyId&&t===e.familyId)},r.prototype.matchRealm=function(e,t){return!!(e.realm&&t===e.realm)},r.prototype.matchNativeAccountId=function(e,t){return!!(e.nativeAccountId&&t===e.nativeAccountId)},r.prototype.matchTarget=function(e,t){var o=e.credentialType!==ue.ACCESS_TOKEN&&e.credentialType!==ue.ACCESS_TOKEN_WITH_AUTH_SCHEME;if(o||!e.target)return!1;var i=It.fromString(e.target);return i.containsScopeSet(t)},r.prototype.matchTokenType=function(e,t){return!!(e.tokenType&&e.tokenType===t)},r.prototype.matchKeyId=function(e,t){return!!(e.keyId&&e.keyId===t)},r.prototype.isAppMetadata=function(e){return e.indexOf(_u)!==-1},r.prototype.isAuthorityMetadata=function(e){return e.indexOf(vl.CACHE_KEY)!==-1},r.prototype.generateAuthorityMetadataCacheKey=function(e){return vl.CACHE_KEY+"-"+this.clientId+"-"+e},r.toObject=function(e,t){for(var o in t)e[o]=t[o];return e},r}(),cy=function(r){nt(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.setAccount=function(){var t="Storage interface - setAccount() has not been implemented for the cacheStorage interface.";throw ee.createUnexpectedError(t)},e.prototype.getAccount=function(){var t="Storage interface - getAccount() has not been implemented for the cacheStorage interface.";throw ee.createUnexpectedError(t)},e.prototype.setIdTokenCredential=function(){var t="Storage interface - setIdTokenCredential() has not been implemented for the cacheStorage interface.";throw ee.createUnexpectedError(t)},e.prototype.getIdTokenCredential=function(){var t="Storage interface - getIdTokenCredential() has not been implemented for the cacheStorage interface.";throw ee.createUnexpectedError(t)},e.prototype.setAccessTokenCredential=function(){var t="Storage interface - setAccessTokenCredential() has not been implemented for the cacheStorage interface.";throw ee.createUnexpectedError(t)},e.prototype.getAccessTokenCredential=function(){var t="Storage interface - getAccessTokenCredential() has not been implemented for the cacheStorage interface.";throw ee.createUnexpectedError(t)},e.prototype.setRefreshTokenCredential=function(){var t="Storage interface - setRefreshTokenCredential() has not been implemented for the cacheStorage interface.";throw ee.createUnexpectedError(t)},e.prototype.getRefreshTokenCredential=function(){var t="Storage interface - getRefreshTokenCredential() has not been implemented for the cacheStorage interface.";throw ee.createUnexpectedError(t)},e.prototype.setAppMetadata=function(){var t="Storage interface - setAppMetadata() has not been implemented for the cacheStorage interface.";throw ee.createUnexpectedError(t)},e.prototype.getAppMetadata=function(){var t="Storage interface - getAppMetadata() has not been implemented for the cacheStorage interface.";throw ee.createUnexpectedError(t)},e.prototype.setServerTelemetry=function(){var t="Storage interface - setServerTelemetry() has not been implemented for the cacheStorage interface.";throw ee.createUnexpectedError(t)},e.prototype.getServerTelemetry=function(){var t="Storage interface - getServerTelemetry() has not been implemented for the cacheStorage interface.";throw ee.createUnexpectedError(t)},e.prototype.setAuthorityMetadata=function(){var t="Storage interface - setAuthorityMetadata() has not been implemented for the cacheStorage interface.";throw ee.createUnexpectedError(t)},e.prototype.getAuthorityMetadata=function(){var t="Storage interface - getAuthorityMetadata() has not been implemented for the cacheStorage interface.";throw ee.createUnexpectedError(t)},e.prototype.getAuthorityMetadataKeys=function(){var t="Storage interface - getAuthorityMetadataKeys() has not been implemented for the cacheStorage interface.";throw ee.createUnexpectedError(t)},e.prototype.setThrottlingCache=function(){var t="Storage interface - setThrottlingCache() has not been implemented for the cacheStorage interface.";throw ee.createUnexpectedError(t)},e.prototype.getThrottlingCache=function(){var t="Storage interface - getThrottlingCache() has not been implemented for the cacheStorage interface.";throw ee.createUnexpectedError(t)},e.prototype.removeItem=function(){var t="Storage interface - removeItem() has not been implemented for the cacheStorage interface.";throw ee.createUnexpectedError(t)},e.prototype.containsKey=function(){var t="Storage interface - containsKey() has not been implemented for the cacheStorage interface.";throw ee.createUnexpectedError(t)},e.prototype.getKeys=function(){var t="Storage interface - getKeys() has not been implemented for the cacheStorage interface.";throw ee.createUnexpectedError(t)},e.prototype.getAccountKeys=function(){var t="Storage interface - getAccountKeys() has not been implemented for the cacheStorage interface.";throw ee.createUnexpectedError(t)},e.prototype.getTokenKeys=function(){var t="Storage interface - getTokenKeys() has not been implemented for the cacheStorage interface.";throw ee.createUnexpectedError(t)},e.prototype.clear=function(){return le(this,void 0,void 0,function(){var t;return ce(this,function(o){throw t="Storage interface - clear() has not been implemented for the cacheStorage interface.",ee.createUnexpectedError(t)})})},e.prototype.updateCredentialCacheKey=function(){var t="Storage interface - updateCredentialCacheKey() has not been implemented for the cacheStorage interface.";throw ee.createUnexpectedError(t)},e}(Xr);var l9=300,If={tokenRenewalOffsetSeconds:l9,preventCorsPreflight:!1},c9={loggerCallback:function(){},piiLoggingEnabled:!1,logLevel:ir.Info,correlationId:_.EMPTY_STRING},d9={claimsBasedCachingEnabled:!0},u9={sendGetRequestAsync:function(){return le(this,void 0,void 0,function(){var r;return ce(this,function(e){throw r="Network interface - sendGetRequestAsync() has not been implemented",ee.createUnexpectedError(r)})})},sendPostRequestAsync:function(){return le(this,void 0,void 0,function(){var r;return ce(this,function(e){throw r="Network interface - sendPostRequestAsync() has not been implemented",ee.createUnexpectedError(r)})})}},h9={sku:_.SKU,version:yl,cpu:_.EMPTY_STRING,os:_.EMPTY_STRING},p9={clientSecret:_.EMPTY_STRING,clientAssertion:void 0},f9={azureCloudInstance:Tn.None,tenant:""+_.DEFAULT_COMMON_TENANT},m9={application:{appName:"",appVersion:""}};function w_(r){var e=r.authOptions,t=r.systemOptions,o=r.loggerOptions,i=r.cacheOptions,n=r.storageInterface,s=r.networkInterface,a=r.cryptoInterface,u=r.clientCredentials,h=r.libraryInfo,p=r.telemetry,f=r.serverTelemetryManager,b=r.persistencePlugin,C=r.serializableCache,S=rt(rt({},c9),o);return{authOptions:g9(e),systemOptions:rt(rt({},If),t),loggerOptions:S,cacheOptions:rt(rt({},d9),i),storageInterface:n||new cy(e.clientId,ta,new _n(S)),networkInterface:s||u9,cryptoInterface:a||ta,clientCredentials:u||p9,libraryInfo:rt(rt({},h9),h),telemetry:rt(rt({},m9),p),serverTelemetryManager:f||null,persistencePlugin:b||null,serializableCache:C||null}}function g9(r){return rt({clientCapabilities:[],azureCloudOptions:f9,skipAuthorityMetadataCache:!1},r)}l();c();d();l();c();d();l();c();d();var eo=function(r){nt(e,r);function e(t,o,i){var n=r.call(this,t,o,i)||this;return n.name="ServerError",Object.setPrototypeOf(n,e.prototype),n}return e}(ee);var oa=function(){function r(){}return r.generateThrottlingStorageKey=function(e){return ds.THROTTLING_PREFIX+"."+JSON.stringify(e)},r.preProcess=function(e,t){var o,i=r.generateThrottlingStorageKey(t),n=e.getThrottlingCache(i);if(n){if(n.throttleTime=500&&e.status<600},r.checkResponseForRetryAfter=function(e){return e.headers?e.headers.hasOwnProperty(Ft.RETRY_AFTER)&&(e.status<200||e.status>=300):!1},r.calculateThrottleTime=function(e){var t=e<=0?0:e,o=Date.now()/1e3;return Math.floor(Math.min(o+(t||ds.DEFAULT_THROTTLE_TIME_SECONDS),o+ds.DEFAULT_MAX_THROTTLE_TIME_SECONDS)*1e3)},r.removeThrottle=function(e,t,o,i){var n={clientId:t,authority:o.authority,scopes:o.scopes,homeAccountIdentifier:i,claims:o.claims,authenticationScheme:o.authenticationScheme,resourceRequestMethod:o.resourceRequestMethod,resourceRequestUri:o.resourceRequestUri,shrClaims:o.shrClaims,sshKid:o.sshKid},s=this.generateThrottlingStorageKey(n);e.removeItem(s)},r}();var dy=function(){function r(e,t){this.networkClient=e,this.cacheManager=t}return r.prototype.sendPostRequest=function(e,t,o){return le(this,void 0,void 0,function(){var i,n;return ce(this,function(s){switch(s.label){case 0:oa.preProcess(this.cacheManager,e),s.label=1;case 1:return s.trys.push([1,3,,4]),[4,this.networkClient.sendPostRequestAsync(t,o)];case 2:return i=s.sent(),[3,4];case 3:throw n=s.sent(),n instanceof ee?n:U.createNetworkError(t,n);case 4:return oa.postProcess(this.cacheManager,e,i),[2,i]}})})},r}();l();c();d();var wr;(function(r){r.HOME_ACCOUNT_ID="home_account_id",r.UPN="UPN"})(wr||(wr={}));l();c();d();l();c();d();var us=function(){function r(){}return r.validateRedirectUri=function(e){if(B.isEmpty(e))throw je.createRedirectUriEmptyError()},r.validatePrompt=function(e){var t=[];for(var o in or)t.push(or[o]);if(t.indexOf(e)<0)throw je.createInvalidPromptError(e)},r.validateClaims=function(e){try{JSON.parse(e)}catch{throw je.createInvalidClaimsRequestError()}},r.validateCodeChallengeParams=function(e,t){if(B.isEmpty(e)||B.isEmpty(t))throw je.createInvalidCodeChallengeParamsError();this.validateCodeChallengeMethod(t)},r.validateCodeChallengeMethod=function(e){if([_f.PLAIN,_f.S256].indexOf(e)<0)throw je.createInvalidCodeChallengeMethodError()},r.sanitizeEQParams=function(e,t){return e?(t.forEach(function(o,i){e[i]&&delete e[i]}),Object.fromEntries(Object.entries(e).filter(function(o){var i=o[1];return i!==""}))):{}},r}();var Lr=function(){function r(){this.parameters=new Map}return r.prototype.addResponseTypeCode=function(){this.parameters.set(Ne.RESPONSE_TYPE,encodeURIComponent(_.CODE_RESPONSE_TYPE))},r.prototype.addResponseTypeForTokenAndIdToken=function(){this.parameters.set(Ne.RESPONSE_TYPE,encodeURIComponent(_.TOKEN_RESPONSE_TYPE+" "+_.ID_TOKEN_RESPONSE_TYPE))},r.prototype.addResponseMode=function(e){this.parameters.set(Ne.RESPONSE_MODE,encodeURIComponent(e||ml.QUERY))},r.prototype.addNativeBroker=function(){this.parameters.set(Ne.NATIVE_BROKER,encodeURIComponent("1"))},r.prototype.addScopes=function(e,t){t===void 0&&(t=!0);var o=t?Js(e||[],Yi):e||[],i=new It(o);this.parameters.set(Ne.SCOPE,encodeURIComponent(i.printScopes()))},r.prototype.addClientId=function(e){this.parameters.set(Ne.CLIENT_ID,encodeURIComponent(e))},r.prototype.addRedirectUri=function(e){us.validateRedirectUri(e),this.parameters.set(Ne.REDIRECT_URI,encodeURIComponent(e))},r.prototype.addPostLogoutRedirectUri=function(e){us.validateRedirectUri(e),this.parameters.set(Ne.POST_LOGOUT_URI,encodeURIComponent(e))},r.prototype.addIdTokenHint=function(e){this.parameters.set(Ne.ID_TOKEN_HINT,encodeURIComponent(e))},r.prototype.addDomainHint=function(e){this.parameters.set(fl.DOMAIN_HINT,encodeURIComponent(e))},r.prototype.addLoginHint=function(e){this.parameters.set(fl.LOGIN_HINT,encodeURIComponent(e))},r.prototype.addCcsUpn=function(e){this.parameters.set(Ft.CCS_HEADER,encodeURIComponent("UPN:"+e))},r.prototype.addCcsOid=function(e){this.parameters.set(Ft.CCS_HEADER,encodeURIComponent("Oid:"+e.uid+"@"+e.utid))},r.prototype.addSid=function(e){this.parameters.set(fl.SID,encodeURIComponent(e))},r.prototype.addClaims=function(e,t){var o=this.addClientCapabilitiesToClaims(e,t);us.validateClaims(o),this.parameters.set(Ne.CLAIMS,encodeURIComponent(o))},r.prototype.addCorrelationId=function(e){this.parameters.set(Ne.CLIENT_REQUEST_ID,encodeURIComponent(e))},r.prototype.addLibraryInfo=function(e){this.parameters.set(Ne.X_CLIENT_SKU,e.sku),this.parameters.set(Ne.X_CLIENT_VER,e.version),e.os&&this.parameters.set(Ne.X_CLIENT_OS,e.os),e.cpu&&this.parameters.set(Ne.X_CLIENT_CPU,e.cpu)},r.prototype.addApplicationTelemetry=function(e){e?.appName&&this.parameters.set(Ne.X_APP_NAME,e.appName),e?.appVersion&&this.parameters.set(Ne.X_APP_VER,e.appVersion)},r.prototype.addPrompt=function(e){us.validatePrompt(e),this.parameters.set(""+Ne.PROMPT,encodeURIComponent(e))},r.prototype.addState=function(e){B.isEmpty(e)||this.parameters.set(Ne.STATE,encodeURIComponent(e))},r.prototype.addNonce=function(e){this.parameters.set(Ne.NONCE,encodeURIComponent(e))},r.prototype.addCodeChallengeParams=function(e,t){if(us.validateCodeChallengeParams(e,t),e&&t)this.parameters.set(Ne.CODE_CHALLENGE,encodeURIComponent(e)),this.parameters.set(Ne.CODE_CHALLENGE_METHOD,encodeURIComponent(t));else throw je.createInvalidCodeChallengeParamsError()},r.prototype.addAuthorizationCode=function(e){this.parameters.set(Ne.CODE,encodeURIComponent(e))},r.prototype.addDeviceCode=function(e){this.parameters.set(Ne.DEVICE_CODE,encodeURIComponent(e))},r.prototype.addRefreshToken=function(e){this.parameters.set(Ne.REFRESH_TOKEN,encodeURIComponent(e))},r.prototype.addCodeVerifier=function(e){this.parameters.set(Ne.CODE_VERIFIER,encodeURIComponent(e))},r.prototype.addClientSecret=function(e){this.parameters.set(Ne.CLIENT_SECRET,encodeURIComponent(e))},r.prototype.addClientAssertion=function(e){B.isEmpty(e)||this.parameters.set(Ne.CLIENT_ASSERTION,encodeURIComponent(e))},r.prototype.addClientAssertionType=function(e){B.isEmpty(e)||this.parameters.set(Ne.CLIENT_ASSERTION_TYPE,encodeURIComponent(e))},r.prototype.addOboAssertion=function(e){this.parameters.set(Ne.OBO_ASSERTION,encodeURIComponent(e))},r.prototype.addRequestTokenUse=function(e){this.parameters.set(Ne.REQUESTED_TOKEN_USE,encodeURIComponent(e))},r.prototype.addGrantType=function(e){this.parameters.set(Ne.GRANT_TYPE,encodeURIComponent(e))},r.prototype.addClientInfo=function(){this.parameters.set(b_,"1")},r.prototype.addExtraQueryParameters=function(e){var t=this,o=us.sanitizeEQParams(e,this.parameters);Object.keys(o).forEach(function(i){t.parameters.set(i,e[i])})},r.prototype.addClientCapabilitiesToClaims=function(e,t){var o;if(!e)o={};else try{o=JSON.parse(e)}catch{throw je.createInvalidClaimsRequestError()}return t&&t.length>0&&(o.hasOwnProperty(Xs.ACCESS_TOKEN)||(o[Xs.ACCESS_TOKEN]={}),o[Xs.ACCESS_TOKEN][Xs.XMS_CC]={values:t}),JSON.stringify(o)},r.prototype.addUsername=function(e){this.parameters.set(Ec.username,encodeURIComponent(e))},r.prototype.addPassword=function(e){this.parameters.set(Ec.password,encodeURIComponent(e))},r.prototype.addPopToken=function(e){B.isEmpty(e)||(this.parameters.set(Ne.TOKEN_TYPE,Be.POP),this.parameters.set(Ne.REQ_CNF,encodeURIComponent(e)))},r.prototype.addSshJwk=function(e){B.isEmpty(e)||(this.parameters.set(Ne.TOKEN_TYPE,Be.SSH),this.parameters.set(Ne.REQ_CNF,encodeURIComponent(e)))},r.prototype.addServerTelemetry=function(e){this.parameters.set(Ne.X_CLIENT_CURR_TELEM,e.generateCurrentRequestHeaderValue()),this.parameters.set(Ne.X_CLIENT_LAST_TELEM,e.generateLastRequestHeaderValue())},r.prototype.addThrottling=function(){this.parameters.set(Ne.X_MS_LIB_CAPABILITY,ds.X_MS_LIB_CAPABILITY_VALUE)},r.prototype.addLogoutHint=function(e){this.parameters.set(Ne.LOGOUT_HINT,encodeURIComponent(e))},r.prototype.createQueryString=function(){var e=new Array;return this.parameters.forEach(function(t,o){e.push(o+"="+t)}),e.join("&")},r}();var Bo=function(){function r(e,t){this.config=w_(e),this.logger=new _n(this.config.loggerOptions,Ef,yl),this.cryptoUtils=this.config.cryptoInterface,this.cacheManager=this.config.storageInterface,this.networkClient=this.config.networkInterface,this.networkManager=new dy(this.networkClient,this.cacheManager),this.serverTelemetryManager=this.config.serverTelemetryManager,this.authority=this.config.authOptions.authority,this.performanceClient=t}return r.prototype.createTokenRequestHeaders=function(e){var t={};if(t[Ft.CONTENT_TYPE]=_.URL_FORM_CONTENT_TYPE,!this.config.systemOptions.preventCorsPreflight&&e)switch(e.type){case wr.HOME_ACCOUNT_ID:try{var o=En(e.credential);t[Ft.CCS_HEADER]="Oid:"+o.uid+"@"+o.utid}catch(i){this.logger.verbose("Could not parse home account ID for CCS Header: "+i)}break;case wr.UPN:t[Ft.CCS_HEADER]="UPN: "+e.credential;break}return t},r.prototype.executePostToTokenEndpoint=function(e,t,o,i){return le(this,void 0,void 0,function(){var n;return ce(this,function(s){switch(s.label){case 0:return[4,this.networkManager.sendPostRequest(i,e,{body:t,headers:o})];case 1:return n=s.sent(),this.config.serverTelemetryManager&&n.status<500&&n.status!==429&&this.config.serverTelemetryManager.clearTelemetryCache(),[2,n]}})})},r.prototype.updateAuthority=function(e){if(!e.discoveryComplete())throw U.createEndpointDiscoveryIncompleteError("Updated authority has not completed endpoint discovery.");this.authority=e},r.prototype.createTokenQueryParameters=function(e){var t=new Lr;return e.tokenQueryParameters&&t.addExtraQueryParameters(e.tokenQueryParameters),t.createQueryString()},r}();l();c();d();l();c();d();l();c();d();var bl=function(){function r(){}return r.prototype.generateAccountId=function(){return r.generateAccountIdForCacheKey(this.homeAccountId,this.environment)},r.prototype.generateCredentialId=function(){return r.generateCredentialIdForCacheKey(this.credentialType,this.clientId,this.realm,this.familyId)},r.prototype.generateTarget=function(){return r.generateTargetForCacheKey(this.target)},r.prototype.generateCredentialKey=function(){return r.generateCredentialCacheKey(this.homeAccountId,this.environment,this.credentialType,this.clientId,this.realm,this.target,this.familyId,this.tokenType,this.requestedClaimsHash)},r.prototype.generateType=function(){switch(this.credentialType){case ue.ID_TOKEN:return gi.ID_TOKEN;case ue.ACCESS_TOKEN:case ue.ACCESS_TOKEN_WITH_AUTH_SCHEME:return gi.ACCESS_TOKEN;case ue.REFRESH_TOKEN:return gi.REFRESH_TOKEN;default:throw U.createUnexpectedCredentialTypeError()}},r.generateCredentialCacheKey=function(e,t,o,i,n,s,a,u,h){var p=[this.generateAccountIdForCacheKey(e,t),this.generateCredentialIdForCacheKey(o,i,n,a),this.generateTargetForCacheKey(s),this.generateClaimsHashForCacheKey(h),this.generateSchemeForCacheKey(u)];return p.join(Lt.CACHE_KEY_SEPARATOR).toLowerCase()},r.generateAccountIdForCacheKey=function(e,t){var o=[e,t];return o.join(Lt.CACHE_KEY_SEPARATOR).toLowerCase()},r.generateCredentialIdForCacheKey=function(e,t,o,i){var n=e===ue.REFRESH_TOKEN&&i||t,s=[e,n,o||_.EMPTY_STRING];return s.join(Lt.CACHE_KEY_SEPARATOR).toLowerCase()},r.generateTargetForCacheKey=function(e){return(e||_.EMPTY_STRING).toLowerCase()},r.generateClaimsHashForCacheKey=function(e){return(e||_.EMPTY_STRING).toLowerCase()},r.generateSchemeForCacheKey=function(e){return e&&e.toLowerCase()!==Be.BEARER.toLowerCase()?e.toLowerCase():_.EMPTY_STRING},r}();var vi=function(r){nt(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.createIdTokenEntity=function(t,o,i,n,s){var a=new e;return a.credentialType=ue.ID_TOKEN,a.homeAccountId=t,a.environment=o,a.clientId=n,a.secret=i,a.realm=s,a},e.isIdTokenEntity=function(t){return t?t.hasOwnProperty("homeAccountId")&&t.hasOwnProperty("environment")&&t.hasOwnProperty("credentialType")&&t.hasOwnProperty("realm")&&t.hasOwnProperty("clientId")&&t.hasOwnProperty("secret")&&t.credentialType===ue.ID_TOKEN:!1},e}(bl);l();c();d();l();c();d();var st=function(){function r(){}return r.nowSeconds=function(){return Math.round(new Date().getTime()/1e3)},r.isTokenExpired=function(e,t){var o=Number(e)||0,i=r.nowSeconds()+t;return i>o},r.wasClockTurnedBack=function(e){var t=Number(e);return t>r.nowSeconds()},r.delay=function(e,t){return new Promise(function(o){return setTimeout(function(){return o(t)},e)})},r}();var yi=function(r){nt(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.createAccessTokenEntity=function(t,o,i,n,s,a,u,h,p,f,b,C,S,R,H){var ye,oe,me=new e;me.homeAccountId=t,me.credentialType=ue.ACCESS_TOKEN,me.secret=i;var yt=st.nowSeconds();if(me.cachedAt=yt.toString(),me.expiresOn=u.toString(),me.extendedExpiresOn=h.toString(),f&&(me.refreshOn=f.toString()),me.environment=o,me.clientId=n,me.realm=s,me.target=a,me.userAssertionHash=C,me.tokenType=B.isEmpty(b)?Be.BEARER:b,R&&(me.requestedClaims=R,me.requestedClaimsHash=H),((ye=me.tokenType)===null||ye===void 0?void 0:ye.toLowerCase())!==Be.BEARER.toLowerCase())switch(me.credentialType=ue.ACCESS_TOKEN_WITH_AUTH_SCHEME,me.tokenType){case Be.POP:var Ge=fr.extractTokenClaims(i,p);if(!(!((oe=Ge?.cnf)===null||oe===void 0)&&oe.kid))throw U.createTokenClaimsRequiredError();me.keyId=Ge.cnf.kid;break;case Be.SSH:me.keyId=S}return me},e.isAccessTokenEntity=function(t){return t?t.hasOwnProperty("homeAccountId")&&t.hasOwnProperty("environment")&&t.hasOwnProperty("credentialType")&&t.hasOwnProperty("realm")&&t.hasOwnProperty("clientId")&&t.hasOwnProperty("secret")&&t.hasOwnProperty("target")&&(t.credentialType===ue.ACCESS_TOKEN||t.credentialType===ue.ACCESS_TOKEN_WITH_AUTH_SCHEME):!1},e}(bl);l();c();d();var In=function(r){nt(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.createRefreshTokenEntity=function(t,o,i,n,s,a){var u=new e;return u.clientId=n,u.credentialType=ue.REFRESH_TOKEN,u.environment=o,u.homeAccountId=t,u.secret=i,u.userAssertionHash=a,s&&(u.familyId=s),u},e.isRefreshTokenEntity=function(t){return t?t.hasOwnProperty("homeAccountId")&&t.hasOwnProperty("environment")&&t.hasOwnProperty("credentialType")&&t.hasOwnProperty("clientId")&&t.hasOwnProperty("secret")&&t.credentialType===ue.REFRESH_TOKEN:!1},e}(bl);l();c();d();var C_=["interaction_required","consent_required","login_required"],v9=["message_only","additional_action","basic_action","user_password_expired","consent_required"],An={noTokensFoundError:{code:"no_tokens_found",desc:"No refresh token found in the cache. Please sign-in."},native_account_unavailable:{code:"native_account_unavailable",desc:"The requested account is not available in the native broker. It may have been deleted or logged out. Please sign-in again using an interactive API."}},Cr=function(r){nt(e,r);function e(t,o,i,n,s,a,u){var h=r.call(this,t,o,i)||this;return Object.setPrototypeOf(h,e.prototype),h.timestamp=n||_.EMPTY_STRING,h.traceId=s||_.EMPTY_STRING,h.correlationId=a||_.EMPTY_STRING,h.claims=u||_.EMPTY_STRING,h.name="InteractionRequiredAuthError",h}return e.isInteractionRequiredError=function(t,o,i){var n=!!t&&C_.indexOf(t)>-1,s=!!i&&v9.indexOf(i)>-1,a=!!o&&C_.some(function(u){return o.indexOf(u)>-1});return n||a||s},e.createNoTokensFoundError=function(){return new e(An.noTokensFoundError.code,An.noTokensFoundError.desc)},e.createNativeAccountUnavailableError=function(){return new e(An.native_account_unavailable.code,An.native_account_unavailable.desc)},e}(ee);l();c();d();var hs=function(){function r(e,t,o,i,n){this.account=e||null,this.idToken=t||null,this.accessToken=o||null,this.refreshToken=i||null,this.appMetadata=n||null}return r}();l();c();d();var to=function(){function r(){}return r.setRequestState=function(e,t,o){var i=r.generateLibraryState(e,o);return B.isEmpty(t)?i:""+i+_.RESOURCE_DELIM+t},r.generateLibraryState=function(e,t){if(!e)throw U.createNoCryptoObjectError("generateLibraryState");var o={id:e.createNewGuid()};t&&(o.meta=t);var i=JSON.stringify(o);return e.base64Encode(i)},r.parseRequestState=function(e,t){if(!e)throw U.createNoCryptoObjectError("parseRequestState");if(B.isEmpty(t))throw U.createInvalidStateError(t,"Null, undefined or empty state");try{var o=t.split(_.RESOURCE_DELIM),i=o[0],n=o.length>1?o.slice(1).join(_.RESOURCE_DELIM):_.EMPTY_STRING,s=e.base64Decode(i),a=JSON.parse(s);return{userRequestState:B.isEmpty(n)?_.EMPTY_STRING:n,libraryState:a}}catch(u){throw U.createInvalidStateError(t,u)}},r}();l();c();d();l();c();d();var Se=function(){function r(e){if(this._urlString=e,B.isEmpty(this._urlString))throw je.createUrlEmptyError();B.isEmpty(this.getHash())&&(this._urlString=r.canonicalizeUri(e))}return Object.defineProperty(r.prototype,"urlString",{get:function(){return this._urlString},enumerable:!1,configurable:!0}),r.canonicalizeUri=function(e){if(e){var t=e.toLowerCase();return B.endsWith(t,"?")?t=t.slice(0,-1):B.endsWith(t,"?/")&&(t=t.slice(0,-2)),B.endsWith(t,"/")||(t+="/"),t}return e},r.prototype.validateAsUri=function(){var e;try{e=this.getUrlComponents()}catch(t){throw je.createUrlParseError(t)}if(!e.HostNameAndPort||!e.PathSegments)throw je.createUrlParseError("Given url string: "+this.urlString);if(!e.Protocol||e.Protocol.toLowerCase()!=="https:")throw je.createInsecureAuthorityUriError(this.urlString)},r.appendQueryString=function(e,t){return B.isEmpty(t)?e:e.indexOf("?")<0?e+"?"+t:e+"&"+t},r.removeHashFromUrl=function(e){return r.canonicalizeUri(e.split("#")[0])},r.prototype.replaceTenantPath=function(e){var t=this.getUrlComponents(),o=t.PathSegments;return e&&o.length!==0&&(o[0]===ls.COMMON||o[0]===ls.ORGANIZATIONS)&&(o[0]=e),r.constructAuthorityUriFromObject(t)},r.prototype.getHash=function(){return r.parseHash(this.urlString)},r.prototype.getUrlComponents=function(){var e=RegExp("^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\\?([^#]*))?(#(.*))?"),t=this.urlString.match(e);if(!t)throw je.createUrlParseError("Given url string: "+this.urlString);var o={Protocol:t[1],HostNameAndPort:t[4],AbsolutePath:t[5],QueryString:t[7]},i=o.AbsolutePath.split("/");return i=i.filter(function(n){return n&&n.length>0}),o.PathSegments=i,!B.isEmpty(o.QueryString)&&o.QueryString.endsWith("/")&&(o.QueryString=o.QueryString.substring(0,o.QueryString.length-1)),o},r.getDomainFromUrl=function(e){var t=RegExp("^([^:/?#]+://)?([^/?#]*)"),o=e.match(t);if(!o)throw je.createUrlParseError("Given url string: "+e);return o[2]},r.getAbsoluteUrl=function(e,t){if(e[0]===_.FORWARD_SLASH){var o=new r(t),i=o.getUrlComponents();return i.Protocol+"//"+i.HostNameAndPort+e}return e},r.parseHash=function(e){var t=e.indexOf("#"),o=e.indexOf("#/");return o>-1?e.substring(o+2):t>-1?e.substring(t+1):_.EMPTY_STRING},r.parseQueryString=function(e){var t=e.indexOf("?"),o=e.indexOf("/?");return o>-1?e.substring(o+2):t>-1?e.substring(t+1):_.EMPTY_STRING},r.constructAuthorityUriFromObject=function(e){return new r(e.Protocol+"//"+e.HostNameAndPort+"/"+e.PathSegments.join("/"))},r.getDeserializedHash=function(e){if(B.isEmpty(e))return{};var t=r.parseHash(e),o=B.queryStringToObject(B.isEmpty(t)?e:t);if(!o)throw U.createHashNotDeserializedError(JSON.stringify(o));return o},r.getDeserializedQueryString=function(e){if(B.isEmpty(e))return{};var t=r.parseQueryString(e),o=B.queryStringToObject(B.isEmpty(t)?e:t);if(!o)throw U.createHashNotDeserializedError(JSON.stringify(o));return o},r.hashContainsKnownProperties=function(e){if(B.isEmpty(e)||e.indexOf("=")<0)return!1;var t=r.getDeserializedHash(e);return!!(t.code||t.error_description||t.error||t.state)},r}();l();c();d();var $;(function(r){r.AcquireTokenByCode="acquireTokenByCode",r.AcquireTokenByRefreshToken="acquireTokenByRefreshToken",r.AcquireTokenSilent="acquireTokenSilent",r.AcquireTokenSilentAsync="acquireTokenSilentAsync",r.AcquireTokenPopup="acquireTokenPopup",r.CryptoOptsGetPublicKeyThumbprint="cryptoOptsGetPublicKeyThumbprint",r.CryptoOptsSignJwt="cryptoOptsSignJwt",r.SilentCacheClientAcquireToken="silentCacheClientAcquireToken",r.SilentIframeClientAcquireToken="silentIframeClientAcquireToken",r.SilentRefreshClientAcquireToken="silentRefreshClientAcquireToken",r.SsoSilent="ssoSilent",r.StandardInteractionClientGetDiscoveredAuthority="standardInteractionClientGetDiscoveredAuthority",r.FetchAccountIdWithNativeBroker="fetchAccountIdWithNativeBroker",r.NativeInteractionClientAcquireToken="nativeInteractionClientAcquireToken",r.BaseClientCreateTokenRequestHeaders="baseClientCreateTokenRequestHeaders",r.BrokerHandhshake="brokerHandshake",r.AcquireTokenByRefreshTokenInBroker="acquireTokenByRefreshTokenInBroker",r.AcquireTokenByBroker="acquireTokenByBroker",r.RefreshTokenClientExecuteTokenRequest="refreshTokenClientExecuteTokenRequest",r.RefreshTokenClientAcquireToken="refreshTokenClientAcquireToken",r.RefreshTokenClientAcquireTokenWithCachedRefreshToken="refreshTokenClientAcquireTokenWithCachedRefreshToken",r.RefreshTokenClientAcquireTokenByRefreshToken="refreshTokenClientAcquireTokenByRefreshToken",r.RefreshTokenClientCreateTokenRequestBody="refreshTokenClientCreateTokenRequestBody",r.AcquireTokenFromCache="acquireTokenFromCache",r.AcquireTokenBySilentIframe="acquireTokenBySilentIframe",r.InitializeBaseRequest="initializeBaseRequest",r.InitializeSilentRequest="initializeSilentRequest",r.InitializeClientApplication="initializeClientApplication",r.SilentIframeClientTokenHelper="silentIframeClientTokenHelper",r.SilentHandlerInitiateAuthRequest="silentHandlerInitiateAuthRequest",r.SilentHandlerMonitorIframeForHash="silentHandlerMonitorIframeForHash",r.SilentHandlerLoadFrame="silentHandlerLoadFrame",r.StandardInteractionClientCreateAuthCodeClient="standardInteractionClientCreateAuthCodeClient",r.StandardInteractionClientGetClientConfiguration="standardInteractionClientGetClientConfiguration",r.StandardInteractionClientInitializeAuthorizationRequest="standardInteractionClientInitializeAuthorizationRequest",r.StandardInteractionClientInitializeAuthorizationCodeRequest="standardInteractionClientInitializeAuthorizationCodeRequest",r.GetAuthCodeUrl="getAuthCodeUrl",r.HandleCodeResponseFromServer="handleCodeResponseFromServer",r.HandleCodeResponseFromHash="handleCodeResponseFromHash",r.UpdateTokenEndpointAuthority="updateTokenEndpointAuthority",r.AuthClientAcquireToken="authClientAcquireToken",r.AuthClientExecuteTokenRequest="authClientExecuteTokenRequest",r.AuthClientCreateTokenRequestBody="authClientCreateTokenRequestBody",r.AuthClientCreateQueryString="authClientCreateQueryString",r.PopTokenGenerateCnf="popTokenGenerateCnf",r.PopTokenGenerateKid="popTokenGenerateKid",r.HandleServerTokenResponse="handleServerTokenResponse",r.AuthorityFactoryCreateDiscoveredInstance="authorityFactoryCreateDiscoveredInstance",r.AuthorityResolveEndpointsAsync="authorityResolveEndpointsAsync",r.AuthorityGetCloudDiscoveryMetadataFromNetwork="authorityGetCloudDiscoveryMetadataFromNetwork",r.AuthorityUpdateCloudDiscoveryMetadata="authorityUpdateCloudDiscoveryMetadata",r.AuthorityGetEndpointMetadataFromNetwork="authorityGetEndpointMetadataFromNetwork",r.AuthorityUpdateEndpointMetadata="authorityUpdateEndpointMetadata",r.AuthorityUpdateMetadataWithRegionalInformation="authorityUpdateMetadataWithRegionalInformation",r.RegionDiscoveryDetectRegion="regionDiscoveryDetectRegion",r.RegionDiscoveryGetRegionFromIMDS="regionDiscoveryGetRegionFromIMDS",r.RegionDiscoveryGetCurrentVersion="regionDiscoveryGetCurrentVersion",r.AcquireTokenByCodeAsync="acquireTokenByCodeAsync",r.GetEndpointMetadataFromNetwork="getEndpointMetadataFromNetwork",r.GetCloudDiscoveryMetadataFromNetworkMeasurement="getCloudDiscoveryMetadataFromNetworkMeasurement",r.HandleRedirectPromiseMeasurement="handleRedirectPromiseMeasurement",r.UpdateCloudDiscoveryMetadataMeasurement="updateCloudDiscoveryMetadataMeasurement",r.UsernamePasswordClientAcquireToken="usernamePasswordClientAcquireToken",r.NativeMessageHandlerHandshake="nativeMessageHandlerHandshake",r.ClearTokensAndKeysWithClaims="clearTokensAndKeysWithClaims"})($||($={}));var Rc;(function(r){r[r.NotStarted=0]="NotStarted",r[r.InProgress=1]="InProgress",r[r.Completed=2]="Completed"})(Rc||(Rc={}));var uy=new Set(["accessTokenSize","durationMs","idTokenSize","matsSilentStatus","matsHttpStatus","refreshTokenSize","queuedTimeMs","startTimeMs","status"]);var hy;(function(r){r.SW="sw",r.UHW="uhw"})(hy||(hy={}));var ai=function(){function r(e,t){this.cryptoUtils=e,this.performanceClient=t}return r.prototype.generateCnf=function(e){var t,o;return le(this,void 0,void 0,function(){var i,n,s;return ce(this,function(a){switch(a.label){case 0:return(t=this.performanceClient)===null||t===void 0||t.addQueueMeasurement($.PopTokenGenerateCnf,e.correlationId),(o=this.performanceClient)===null||o===void 0||o.setPreQueueTime($.PopTokenGenerateKid,e.correlationId),[4,this.generateKid(e)];case 1:return i=a.sent(),n=this.cryptoUtils.base64Encode(JSON.stringify(i)),s={kid:i.kid,reqCnfString:n},[4,this.cryptoUtils.hashString(n)];case 2:return[2,(s.reqCnfHash=a.sent(),s)]}})})},r.prototype.generateKid=function(e){var t;return le(this,void 0,void 0,function(){var o;return ce(this,function(i){switch(i.label){case 0:return(t=this.performanceClient)===null||t===void 0||t.addQueueMeasurement($.PopTokenGenerateKid,e.correlationId),[4,this.cryptoUtils.getPublicKeyThumbprint(e)];case 1:return o=i.sent(),[2,{kid:o,xms_ksl:hy.SW}]}})})},r.prototype.signPopToken=function(e,t,o){return le(this,void 0,void 0,function(){return ce(this,function(i){return[2,this.signPayload(e,t,o)]})})},r.prototype.signPayload=function(e,t,o,i){return le(this,void 0,void 0,function(){var n,s,a,u,h,p;return ce(this,function(f){switch(f.label){case 0:return n=o.resourceRequestMethod,s=o.resourceRequestUri,a=o.shrClaims,u=o.shrNonce,h=s?new Se(s):void 0,p=h?.getUrlComponents(),[4,this.cryptoUtils.signJwt(rt({at:e,ts:st.nowSeconds(),m:n?.toUpperCase(),u:p?.HostNameAndPort,nonce:u||this.cryptoUtils.createNewGuid(),p:p?.AbsolutePath,q:p?.QueryString?[[],p.QueryString]:void 0,client_claims:a||void 0},i),t,o.correlationId)];case 1:return[2,f.sent()]}})})},r}();l();c();d();var Pc=function(){function r(){}return r.prototype.generateAppMetadataKey=function(){return r.generateAppMetadataCacheKey(this.environment,this.clientId)},r.generateAppMetadataCacheKey=function(e,t){var o=[_u,e,t];return o.join(Lt.CACHE_KEY_SEPARATOR).toLowerCase()},r.createAppMetadataEntity=function(e,t,o){var i=new r;return i.clientId=e,i.environment=t,o&&(i.familyId=o),i},r.isAppMetadataEntity=function(e,t){return t?e.indexOf(_u)===0&&t.hasOwnProperty("clientId")&&t.hasOwnProperty("environment"):!1},r}();l();c();d();var py=function(){function r(e,t){this.cache=e,this.hasChanged=t}return Object.defineProperty(r.prototype,"cacheHasChanged",{get:function(){return this.hasChanged},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"tokenCache",{get:function(){return this.cache},enumerable:!1,configurable:!0}),r}();var ro=function(){function r(e,t,o,i,n,s,a){this.clientId=e,this.cacheStorage=t,this.cryptoObj=o,this.logger=i,this.serializableCache=n,this.persistencePlugin=s,this.performanceClient=a}return r.prototype.validateServerAuthorizationCodeResponse=function(e,t,o){if(!e.state||!t)throw e.state?U.createStateNotFoundError("Cached State"):U.createStateNotFoundError("Server State");if(decodeURIComponent(e.state)!==decodeURIComponent(t))throw U.createStateMismatchError();if(e.error||e.error_description||e.suberror)throw Cr.isInteractionRequiredError(e.error,e.error_description,e.suberror)?new Cr(e.error||_.EMPTY_STRING,e.error_description,e.suberror,e.timestamp||_.EMPTY_STRING,e.trace_id||_.EMPTY_STRING,e.correlation_id||_.EMPTY_STRING,e.claims||_.EMPTY_STRING):new eo(e.error||_.EMPTY_STRING,e.error_description,e.suberror);e.client_info&&ra(e.client_info,o)},r.prototype.validateTokenResponse=function(e){if(e.error||e.error_description||e.suberror){if(Cr.isInteractionRequiredError(e.error,e.error_description,e.suberror))throw new Cr(e.error,e.error_description,e.suberror,e.timestamp||_.EMPTY_STRING,e.trace_id||_.EMPTY_STRING,e.correlation_id||_.EMPTY_STRING,e.claims||_.EMPTY_STRING);var t=e.error_codes+" - ["+e.timestamp+"]: "+e.error_description+" - Correlation ID: "+e.correlation_id+" - Trace ID: "+e.trace_id;throw new eo(e.error,t,e.suberror)}},r.prototype.handleServerTokenResponse=function(e,t,o,i,n,s,a,u,h){var p;return le(this,void 0,void 0,function(){var f,b,C,S,R,H,ye;return ce(this,function(oe){switch(oe.label){case 0:if((p=this.performanceClient)===null||p===void 0||p.addQueueMeasurement($.HandleServerTokenResponse,e.correlation_id),e.id_token){if(f=new fr(e.id_token||_.EMPTY_STRING,this.cryptoObj),n&&!B.isEmpty(n.nonce)&&f.claims.nonce!==n.nonce)throw U.createNonceMismatchError();if(i.maxAge||i.maxAge===0){if(b=f.claims.auth_time,!b)throw U.createAuthTimeNotFoundError();fr.checkMaxAge(b,i.maxAge)}}this.homeAccountIdentifier=Nt.generateHomeAccountId(e.client_info||_.EMPTY_STRING,t.authorityType,this.logger,this.cryptoObj,f),n&&n.state&&(C=to.parseRequestState(this.cryptoObj,n.state)),e.key_id=e.key_id||i.sshKid||void 0,S=this.generateCacheRecord(e,t,o,i,f,s,n),oe.label=1;case 1:return oe.trys.push([1,,5,8]),this.persistencePlugin&&this.serializableCache?(this.logger.verbose("Persistence enabled, calling beforeCacheAccess"),R=new py(this.serializableCache,!0),[4,this.persistencePlugin.beforeCacheAccess(R)]):[3,3];case 2:oe.sent(),oe.label=3;case 3:return a&&!u&&S.account&&(H=S.account.generateAccountKey(),ye=this.cacheStorage.getAccount(H),!ye)?(this.logger.warning("Account used to refresh tokens not in persistence, refreshed tokens will not be stored in the cache"),[2,r.generateAuthenticationResult(this.cryptoObj,t,S,!1,i,f,C,void 0,h)]):[4,this.cacheStorage.saveCacheRecord(S)];case 4:return oe.sent(),[3,8];case 5:return this.persistencePlugin&&this.serializableCache&&R?(this.logger.verbose("Persistence enabled, calling afterCacheAccess"),[4,this.persistencePlugin.afterCacheAccess(R)]):[3,7];case 6:oe.sent(),oe.label=7;case 7:return[7];case 8:return[2,r.generateAuthenticationResult(this.cryptoObj,t,S,!1,i,f,C,e,h)]}})})},r.prototype.generateCacheRecord=function(e,t,o,i,n,s,a){var u=t.getPreferredCache();if(B.isEmpty(u))throw U.createInvalidCacheEnvironmentError();var h,p;!B.isEmpty(e.id_token)&&n&&(h=vi.createIdTokenEntity(this.homeAccountIdentifier,u,e.id_token||_.EMPTY_STRING,this.clientId,n.claims.tid||_.EMPTY_STRING),p=this.generateAccountEntity(e,n,t,a));var f=null;if(!B.isEmpty(e.access_token)){var b=e.scope?It.fromString(e.scope):new It(i.scopes||[]),C=(typeof e.expires_in=="string"?parseInt(e.expires_in,10):e.expires_in)||0,S=(typeof e.ext_expires_in=="string"?parseInt(e.ext_expires_in,10):e.ext_expires_in)||0,R=(typeof e.refresh_in=="string"?parseInt(e.refresh_in,10):e.refresh_in)||void 0,H=o+C,ye=H+S,oe=R&&R>0?o+R:void 0;f=yi.createAccessTokenEntity(this.homeAccountIdentifier,u,e.access_token||_.EMPTY_STRING,this.clientId,n?n.claims.tid||_.EMPTY_STRING:t.tenant,b.printScopes(),H,ye,this.cryptoObj,oe,e.token_type,s,e.key_id,i.claims,i.requestedClaimsHash)}var me=null;B.isEmpty(e.refresh_token)||(me=In.createRefreshTokenEntity(this.homeAccountIdentifier,u,e.refresh_token||_.EMPTY_STRING,this.clientId,e.foci,s));var yt=null;return B.isEmpty(e.foci)||(yt=Pc.createAppMetadataEntity(this.clientId,u,e.foci)),new hs(p,h,f,me,yt)},r.prototype.generateAccountEntity=function(e,t,o,i){var n=o.authorityType,s=i?i.cloud_graph_host_name:_.EMPTY_STRING,a=i?i.msgraph_host:_.EMPTY_STRING;if(n===br.Adfs)return this.logger.verbose("Authority type is ADFS, creating ADFS account"),Nt.createGenericAccount(this.homeAccountIdentifier,t,o,s,a);if(B.isEmpty(e.client_info)&&o.protocolMode==="AAD")throw U.createClientInfoEmptyError();return e.client_info?Nt.createAccount(e.client_info,this.homeAccountIdentifier,t,o,s,a):Nt.createGenericAccount(this.homeAccountIdentifier,t,o,s,a)},r.generateAuthenticationResult=function(e,t,o,i,n,s,a,u,h){var p,f,b;return le(this,void 0,void 0,function(){var C,S,R,H,ye,oe,me,yt,Ge,tt,_o;return ce(this,function(_r){switch(_r.label){case 0:if(C=_.EMPTY_STRING,S=[],R=null,ye=_.EMPTY_STRING,!o.accessToken)return[3,4];if(o.accessToken.tokenType!==Be.POP)return[3,2];if(oe=new ai(e),me=o.accessToken,yt=me.secret,Ge=me.keyId,!Ge)throw U.createKeyIdMissingError();return[4,oe.signPopToken(yt,Ge,n)];case 1:return C=_r.sent(),[3,3];case 2:C=o.accessToken.secret,_r.label=3;case 3:S=It.fromString(o.accessToken.target).asArray(),R=new Date(Number(o.accessToken.expiresOn)*1e3),H=new Date(Number(o.accessToken.extendedExpiresOn)*1e3),_r.label=4;case 4:return o.appMetadata&&(ye=o.appMetadata.familyId===ea?ea:_.EMPTY_STRING),tt=s?.claims.oid||s?.claims.sub||_.EMPTY_STRING,_o=s?.claims.tid||_.EMPTY_STRING,u?.spa_accountid&&o.account&&(o.account.nativeAccountId=u?.spa_accountid),[2,{authority:t.canonicalAuthority,uniqueId:tt,tenantId:_o,scopes:S,account:o.account?o.account.getAccountInfo():null,idToken:s?s.rawToken:_.EMPTY_STRING,idTokenClaims:s?s.claims:{},accessToken:C,fromCache:i,expiresOn:R,correlationId:n.correlationId,requestId:h||_.EMPTY_STRING,extExpiresOn:H,familyId:ye,tokenType:((p=o.accessToken)===null||p===void 0?void 0:p.tokenType)||_.EMPTY_STRING,state:a?a.userRequestState:_.EMPTY_STRING,cloudGraphHostName:((f=o.account)===null||f===void 0?void 0:f.cloudGraphHostName)||_.EMPTY_STRING,msGraphHost:((b=o.account)===null||b===void 0?void 0:b.msGraphHost)||_.EMPTY_STRING,code:u?.spa_code,fromNativeBroker:!1}]}})})},r}();var Tu=function(r){nt(e,r);function e(t,o){var i=r.call(this,t,o)||this;return i.includeRedirectUri=!0,i}return e.prototype.getAuthCodeUrl=function(t){var o,i;return le(this,void 0,void 0,function(){var n;return ce(this,function(s){switch(s.label){case 0:return(o=this.performanceClient)===null||o===void 0||o.addQueueMeasurement($.GetAuthCodeUrl,t.correlationId),(i=this.performanceClient)===null||i===void 0||i.setPreQueueTime($.AuthClientCreateQueryString,t.correlationId),[4,this.createAuthCodeUrlQueryString(t)];case 1:return n=s.sent(),[2,Se.appendQueryString(this.authority.authorizationEndpoint,n)]}})})},e.prototype.acquireToken=function(t,o){var i,n,s,a,u,h;return le(this,void 0,void 0,function(){var p,f,b,C,S,R,H=this;return ce(this,function(ye){switch(ye.label){case 0:if(!t||!t.code)throw U.createTokenRequestCannotBeMadeError();return(i=this.performanceClient)===null||i===void 0||i.addQueueMeasurement($.AuthClientAcquireToken,t.correlationId),p=(n=this.performanceClient)===null||n===void 0?void 0:n.startMeasurement("AuthCodeClientAcquireToken",t.correlationId),this.logger.info("in acquireToken call in auth-code client"),f=st.nowSeconds(),(s=this.performanceClient)===null||s===void 0||s.setPreQueueTime($.AuthClientExecuteTokenRequest,t.correlationId),[4,this.executeTokenRequest(this.authority,t)];case 1:return b=ye.sent(),C=(a=b.headers)===null||a===void 0?void 0:a[Ft.X_MS_REQUEST_ID],S=(u=b.headers)===null||u===void 0?void 0:u[Ft.X_MS_HTTP_VERSION],S&&p?.addStaticFields({httpVerAuthority:S}),R=new ro(this.config.authOptions.clientId,this.cacheManager,this.cryptoUtils,this.logger,this.config.serializableCache,this.config.persistencePlugin,this.performanceClient),R.validateTokenResponse(b.body),(h=this.performanceClient)===null||h===void 0||h.setPreQueueTime($.HandleServerTokenResponse,t.correlationId),[2,R.handleServerTokenResponse(b.body,this.authority,f,t,o,void 0,void 0,void 0,C).then(function(oe){return p?.endMeasurement({success:!0}),oe}).catch(function(oe){throw H.logger.verbose("Error in fetching token in ACC",t.correlationId),p?.endMeasurement({errorCode:oe.errorCode,subErrorCode:oe.subError,success:!1}),oe})]}})})},e.prototype.handleFragmentResponse=function(t,o){var i=new ro(this.config.authOptions.clientId,this.cacheManager,this.cryptoUtils,this.logger,null,null),n=new Se(t),s=Se.getDeserializedHash(n.getHash());if(i.validateServerAuthorizationCodeResponse(s,o,this.cryptoUtils),!s.code)throw U.createNoAuthCodeInServerResponseError();return rt(rt({},s),{code:s.code})},e.prototype.getLogoutUri=function(t){if(!t)throw je.createEmptyLogoutRequestError();var o=this.createLogoutUrlQueryString(t);return Se.appendQueryString(this.authority.endSessionEndpoint,o)},e.prototype.executeTokenRequest=function(t,o){var i,n;return le(this,void 0,void 0,function(){var s,a,u,h,p,f,b;return ce(this,function(C){switch(C.label){case 0:return(i=this.performanceClient)===null||i===void 0||i.addQueueMeasurement($.AuthClientExecuteTokenRequest,o.correlationId),(n=this.performanceClient)===null||n===void 0||n.setPreQueueTime($.AuthClientCreateTokenRequestBody,o.correlationId),s=this.createTokenQueryParameters(o),a=Se.appendQueryString(t.tokenEndpoint,s),[4,this.createTokenRequestBody(o)];case 1:if(u=C.sent(),h=void 0,o.clientInfo)try{p=ra(o.clientInfo,this.cryptoUtils),h={credential:""+p.uid+Lt.CLIENT_INFO_SEPARATOR+p.utid,type:wr.HOME_ACCOUNT_ID}}catch(S){this.logger.verbose("Could not parse client info for CCS Header: "+S)}return f=this.createTokenRequestHeaders(h||o.ccsCredential),b={clientId:this.config.authOptions.clientId,authority:t.canonicalAuthority,scopes:o.scopes,claims:o.claims,authenticationScheme:o.authenticationScheme,resourceRequestMethod:o.resourceRequestMethod,resourceRequestUri:o.resourceRequestUri,shrClaims:o.shrClaims,sshKid:o.sshKid},[2,this.executePostToTokenEndpoint(a,u,f,b)]}})})},e.prototype.createTokenRequestBody=function(t){var o,i;return le(this,void 0,void 0,function(){var n,s,a,u,h,p,f,f,b;return ce(this,function(C){switch(C.label){case 0:return(o=this.performanceClient)===null||o===void 0||o.addQueueMeasurement($.AuthClientCreateTokenRequestBody,t.correlationId),n=new Lr,n.addClientId(this.config.authOptions.clientId),this.includeRedirectUri?n.addRedirectUri(t.redirectUri):us.validateRedirectUri(t.redirectUri),n.addScopes(t.scopes),n.addAuthorizationCode(t.code),n.addLibraryInfo(this.config.libraryInfo),n.addApplicationTelemetry(this.config.telemetry.application),n.addThrottling(),this.serverTelemetryManager&&n.addServerTelemetry(this.serverTelemetryManager),t.codeVerifier&&n.addCodeVerifier(t.codeVerifier),this.config.clientCredentials.clientSecret&&n.addClientSecret(this.config.clientCredentials.clientSecret),this.config.clientCredentials.clientAssertion&&(s=this.config.clientCredentials.clientAssertion,n.addClientAssertion(s.assertion),n.addClientAssertionType(s.assertionType)),n.addGrantType(Uo.AUTHORIZATION_CODE_GRANT),n.addClientInfo(),t.authenticationScheme!==Be.POP?[3,2]:(a=new ai(this.cryptoUtils,this.performanceClient),(i=this.performanceClient)===null||i===void 0||i.setPreQueueTime($.PopTokenGenerateCnf,t.correlationId),[4,a.generateCnf(t)]);case 1:return u=C.sent(),n.addPopToken(u.reqCnfString),[3,3];case 2:if(t.authenticationScheme===Be.SSH)if(t.sshJwk)n.addSshJwk(t.sshJwk);else throw je.createMissingSshJwkError();C.label=3;case 3:if(h=t.correlationId||this.config.cryptoInterface.createNewGuid(),n.addCorrelationId(h),(!B.isEmptyObj(t.claims)||this.config.authOptions.clientCapabilities&&this.config.authOptions.clientCapabilities.length>0)&&n.addClaims(t.claims,this.config.authOptions.clientCapabilities),p=void 0,t.clientInfo)try{f=ra(t.clientInfo,this.cryptoUtils),p={credential:""+f.uid+Lt.CLIENT_INFO_SEPARATOR+f.utid,type:wr.HOME_ACCOUNT_ID}}catch(S){this.logger.verbose("Could not parse client info for CCS Header: "+S)}else p=t.ccsCredential;if(this.config.systemOptions.preventCorsPreflight&&p)switch(p.type){case wr.HOME_ACCOUNT_ID:try{f=En(p.credential),n.addCcsOid(f)}catch(S){this.logger.verbose("Could not parse home account ID for CCS Header: "+S)}break;case wr.UPN:n.addCcsUpn(p.credential);break}return t.tokenBodyParameters&&n.addExtraQueryParameters(t.tokenBodyParameters),t.enableSpaAuthorizationCode&&(!t.tokenBodyParameters||!t.tokenBodyParameters[Ne.RETURN_SPA_CODE])&&n.addExtraQueryParameters((b={},b[Ne.RETURN_SPA_CODE]="1",b)),[2,n.createQueryString()]}})})},e.prototype.createAuthCodeUrlQueryString=function(t){var o;return le(this,void 0,void 0,function(){var i,n,s,a,u,h,h,h,p,f;return ce(this,function(b){switch(b.label){case 0:if((o=this.performanceClient)===null||o===void 0||o.addQueueMeasurement($.AuthClientCreateQueryString,t.correlationId),i=new Lr,i.addClientId(this.config.authOptions.clientId),n=Js(t.scopes||[],t.extraScopesToConsent||[]),i.addScopes(n),i.addRedirectUri(t.redirectUri),s=t.correlationId||this.config.cryptoInterface.createNewGuid(),i.addCorrelationId(s),i.addResponseMode(t.responseMode),i.addResponseTypeCode(),i.addLibraryInfo(this.config.libraryInfo),i.addApplicationTelemetry(this.config.telemetry.application),i.addClientInfo(),t.codeChallenge&&t.codeChallengeMethod&&i.addCodeChallengeParams(t.codeChallenge,t.codeChallengeMethod),t.prompt&&i.addPrompt(t.prompt),t.domainHint&&i.addDomainHint(t.domainHint),t.prompt!==or.SELECT_ACCOUNT)if(t.sid&&t.prompt===or.NONE)this.logger.verbose("createAuthCodeUrlQueryString: Prompt is none, adding sid from request"),i.addSid(t.sid);else if(t.account){if(a=this.extractAccountSid(t.account),u=this.extractLoginHint(t.account),u){this.logger.verbose("createAuthCodeUrlQueryString: login_hint claim present on account"),i.addLoginHint(u);try{h=En(t.account.homeAccountId),i.addCcsOid(h)}catch{this.logger.verbose("createAuthCodeUrlQueryString: Could not parse home account ID for CCS Header")}}else if(a&&t.prompt===or.NONE){this.logger.verbose("createAuthCodeUrlQueryString: Prompt is none, adding sid from account"),i.addSid(a);try{h=En(t.account.homeAccountId),i.addCcsOid(h)}catch{this.logger.verbose("createAuthCodeUrlQueryString: Could not parse home account ID for CCS Header")}}else if(t.loginHint)this.logger.verbose("createAuthCodeUrlQueryString: Adding login_hint from request"),i.addLoginHint(t.loginHint),i.addCcsUpn(t.loginHint);else if(t.account.username){this.logger.verbose("createAuthCodeUrlQueryString: Adding login_hint from account"),i.addLoginHint(t.account.username);try{h=En(t.account.homeAccountId),i.addCcsOid(h)}catch{this.logger.verbose("createAuthCodeUrlQueryString: Could not parse home account ID for CCS Header")}}}else t.loginHint&&(this.logger.verbose("createAuthCodeUrlQueryString: No account, adding login_hint from request"),i.addLoginHint(t.loginHint),i.addCcsUpn(t.loginHint));else this.logger.verbose("createAuthCodeUrlQueryString: Prompt is select_account, ignoring account hints");return t.nonce&&i.addNonce(t.nonce),t.state&&i.addState(t.state),(!B.isEmpty(t.claims)||this.config.authOptions.clientCapabilities&&this.config.authOptions.clientCapabilities.length>0)&&i.addClaims(t.claims,this.config.authOptions.clientCapabilities),t.extraQueryParameters&&i.addExtraQueryParameters(t.extraQueryParameters),t.nativeBroker?(i.addNativeBroker(),t.authenticationScheme!==Be.POP?[3,2]:(p=new ai(this.cryptoUtils),[4,p.generateCnf(t)])):[3,2];case 1:f=b.sent(),i.addPopToken(f.reqCnfString),b.label=2;case 2:return[2,i.createQueryString()]}})})},e.prototype.createLogoutUrlQueryString=function(t){var o=new Lr;return t.postLogoutRedirectUri&&o.addPostLogoutRedirectUri(t.postLogoutRedirectUri),t.correlationId&&o.addCorrelationId(t.correlationId),t.idTokenHint&&o.addIdTokenHint(t.idTokenHint),t.state&&o.addState(t.state),t.logoutHint&&o.addLogoutHint(t.logoutHint),t.extraQueryParameters&&o.addExtraQueryParameters(t.extraQueryParameters),o.createQueryString()},e.prototype.extractAccountSid=function(t){var o;return((o=t.idTokenClaims)===null||o===void 0?void 0:o.sid)||null},e.prototype.extractLoginHint=function(t){var o;return((o=t.idTokenClaims)===null||o===void 0?void 0:o.login_hint)||null},e}(Bo);l();c();d();var y9=function(r){nt(e,r);function e(t){return r.call(this,t)||this}return e.prototype.acquireToken=function(t){return le(this,void 0,void 0,function(){var o,i,n,s;return ce(this,function(a){switch(a.label){case 0:return[4,this.getDeviceCode(t)];case 1:return o=a.sent(),t.deviceCodeCallback(o),i=st.nowSeconds(),[4,this.acquireTokenWithDeviceCode(t,o)];case 2:return n=a.sent(),s=new ro(this.config.authOptions.clientId,this.cacheManager,this.cryptoUtils,this.logger,this.config.serializableCache,this.config.persistencePlugin),s.validateTokenResponse(n),[4,s.handleServerTokenResponse(n,this.authority,i,t)];case 3:return[2,a.sent()]}})})},e.prototype.getDeviceCode=function(t){return le(this,void 0,void 0,function(){var o,i,n,s,a;return ce(this,function(u){return o=this.createExtraQueryParameters(t),i=Se.appendQueryString(this.authority.deviceCodeEndpoint,o),n=this.createQueryString(t),s=this.createTokenRequestHeaders(),a={clientId:this.config.authOptions.clientId,authority:t.authority,scopes:t.scopes,claims:t.claims,authenticationScheme:t.authenticationScheme,resourceRequestMethod:t.resourceRequestMethod,resourceRequestUri:t.resourceRequestUri,shrClaims:t.shrClaims,sshKid:t.sshKid},[2,this.executePostRequestToDeviceCodeEndpoint(i,n,s,a)]})})},e.prototype.createExtraQueryParameters=function(t){var o=new Lr;return t.extraQueryParameters&&o.addExtraQueryParameters(t.extraQueryParameters),o.createQueryString()},e.prototype.executePostRequestToDeviceCodeEndpoint=function(t,o,i,n){return le(this,void 0,void 0,function(){var s,a,u,h,p,f,b;return ce(this,function(C){switch(C.label){case 0:return[4,this.networkManager.sendPostRequest(n,t,{body:o,headers:i})];case 1:return s=C.sent().body,a=s.user_code,u=s.device_code,h=s.verification_uri,p=s.expires_in,f=s.interval,b=s.message,[2,{userCode:a,deviceCode:u,verificationUri:h,expiresIn:p,interval:f,message:b}]}})})},e.prototype.createQueryString=function(t){var o=new Lr;return o.addScopes(t.scopes),o.addClientId(this.config.authOptions.clientId),t.extraQueryParameters&&o.addExtraQueryParameters(t.extraQueryParameters),(!B.isEmpty(t.claims)||this.config.authOptions.clientCapabilities&&this.config.authOptions.clientCapabilities.length>0)&&o.addClaims(t.claims,this.config.authOptions.clientCapabilities),o.createQueryString()},e.prototype.continuePolling=function(t,o,i){if(i)throw this.logger.error("Token request cancelled by setting DeviceCodeRequest.cancel = true"),U.createDeviceCodeCancelledError();if(o&&oo)throw this.logger.error("User defined timeout for device code polling reached. The timeout was set for "+o),U.createUserTimeoutReachedError();if(st.nowSeconds()>t)throw o&&this.logger.verbose("User specified timeout ignored as the device code has expired before the timeout elapsed. The user specified timeout was set for "+o),this.logger.error("Device code expired. Expiration time of device code was "+t),U.createDeviceCodeExpiredError();return!0},e.prototype.acquireTokenWithDeviceCode=function(t,o){return le(this,void 0,void 0,function(){var i,n,s,a,u,h,p,f,b;return ce(this,function(C){switch(C.label){case 0:i=this.createTokenQueryParameters(t),n=Se.appendQueryString(this.authority.tokenEndpoint,i),s=this.createTokenRequestBody(t,o),a=this.createTokenRequestHeaders(),u=t.timeout?st.nowSeconds()+t.timeout:void 0,h=st.nowSeconds()+o.expiresIn,p=o.interval*1e3,C.label=1;case 1:return this.continuePolling(h,u,t.cancel)?(f={clientId:this.config.authOptions.clientId,authority:t.authority,scopes:t.scopes,claims:t.claims,authenticationScheme:t.authenticationScheme,resourceRequestMethod:t.resourceRequestMethod,resourceRequestUri:t.resourceRequestUri,shrClaims:t.shrClaims,sshKid:t.sshKid},[4,this.executePostToTokenEndpoint(n,s,a,f)]):[3,8];case 2:return b=C.sent(),b.body&&b.body.error?b.body.error!==_.AUTHORIZATION_PENDING?[3,4]:(this.logger.info("Authorization pending. Continue polling."),[4,st.delay(p)]):[3,6];case 3:return C.sent(),[3,5];case 4:throw this.logger.info("Unexpected error in polling from the server"),eo.createPostRequestFailed(b.body.error);case 5:return[3,7];case 6:return this.logger.verbose("Authorization completed successfully. Polling stopped."),[2,b.body];case 7:return[3,1];case 8:throw this.logger.error("Polling stopped for unknown reasons."),U.createDeviceCodeUnknownError()}})})},e.prototype.createTokenRequestBody=function(t,o){var i=new Lr;i.addScopes(t.scopes),i.addClientId(this.config.authOptions.clientId),i.addGrantType(Uo.DEVICE_CODE_GRANT),i.addDeviceCode(o.deviceCode);var n=t.correlationId||this.config.cryptoInterface.createNewGuid();return i.addCorrelationId(n),i.addClientInfo(),i.addLibraryInfo(this.config.libraryInfo),i.addApplicationTelemetry(this.config.telemetry.application),i.addThrottling(),this.serverTelemetryManager&&i.addServerTelemetry(this.serverTelemetryManager),(!B.isEmptyObj(t.claims)||this.config.authOptions.clientCapabilities&&this.config.authOptions.clientCapabilities.length>0)&&i.addClaims(t.claims,this.config.authOptions.clientCapabilities),i.createQueryString()},e}(Bo);l();c();d();var Eu=function(r){nt(e,r);function e(t,o){return r.call(this,t,o)||this}return e.prototype.acquireToken=function(t){var o,i,n,s,a,u,h;return le(this,void 0,void 0,function(){var p,f,b,C,S,R,H=this;return ce(this,function(ye){switch(ye.label){case 0:return(o=this.performanceClient)===null||o===void 0||o.addQueueMeasurement($.RefreshTokenClientAcquireToken,t.correlationId),p=(i=this.performanceClient)===null||i===void 0?void 0:i.startMeasurement($.RefreshTokenClientAcquireToken,t.correlationId),this.logger.verbose("RefreshTokenClientAcquireToken called",t.correlationId),f=st.nowSeconds(),(n=this.performanceClient)===null||n===void 0||n.setPreQueueTime($.RefreshTokenClientExecuteTokenRequest,t.correlationId),[4,this.executeTokenRequest(t,this.authority)];case 1:return b=ye.sent(),C=(s=b.headers)===null||s===void 0?void 0:s[Ft.X_MS_HTTP_VERSION],p?.addStaticFields({refreshTokenSize:((a=b.body.refresh_token)===null||a===void 0?void 0:a.length)||0}),C&&p?.addStaticFields({httpVerToken:C}),S=(u=b.headers)===null||u===void 0?void 0:u[Ft.X_MS_REQUEST_ID],R=new ro(this.config.authOptions.clientId,this.cacheManager,this.cryptoUtils,this.logger,this.config.serializableCache,this.config.persistencePlugin),R.validateTokenResponse(b.body),(h=this.performanceClient)===null||h===void 0||h.setPreQueueTime($.HandleServerTokenResponse,t.correlationId),[2,R.handleServerTokenResponse(b.body,this.authority,f,t,void 0,void 0,!0,t.forceCache,S).then(function(oe){return p?.endMeasurement({success:!0}),oe}).catch(function(oe){throw H.logger.verbose("Error in fetching refresh token",t.correlationId),p?.endMeasurement({errorCode:oe.errorCode,subErrorCode:oe.subError,success:!1}),oe})]}})})},e.prototype.acquireTokenByRefreshToken=function(t){var o,i,n,s;return le(this,void 0,void 0,function(){var a,u,h;return ce(this,function(p){if(!t)throw je.createEmptyTokenRequestError();if((o=this.performanceClient)===null||o===void 0||o.addQueueMeasurement($.RefreshTokenClientAcquireTokenByRefreshToken,t.correlationId),!t.account)throw U.createNoAccountInSilentRequestError();if(a=this.cacheManager.isAppMetadataFOCI(t.account.environment),a)try{return(i=this.performanceClient)===null||i===void 0||i.setPreQueueTime($.RefreshTokenClientAcquireTokenWithCachedRefreshToken,t.correlationId),[2,this.acquireTokenWithCachedRefreshToken(t,!0)]}catch(f){if(u=f instanceof Cr&&f.errorCode===An.noTokensFoundError.code,h=f instanceof eo&&f.errorCode===Tf.INVALID_GRANT_ERROR&&f.subError===Tf.CLIENT_MISMATCH_ERROR,u||h)return(n=this.performanceClient)===null||n===void 0||n.setPreQueueTime($.RefreshTokenClientAcquireTokenWithCachedRefreshToken,t.correlationId),[2,this.acquireTokenWithCachedRefreshToken(t,!1)];throw f}return(s=this.performanceClient)===null||s===void 0||s.setPreQueueTime($.RefreshTokenClientAcquireTokenWithCachedRefreshToken,t.correlationId),[2,this.acquireTokenWithCachedRefreshToken(t,!1)]})})},e.prototype.acquireTokenWithCachedRefreshToken=function(t,o){var i,n,s;return le(this,void 0,void 0,function(){var a,u,h;return ce(this,function(p){if((i=this.performanceClient)===null||i===void 0||i.addQueueMeasurement($.RefreshTokenClientAcquireTokenWithCachedRefreshToken,t.correlationId),a=(n=this.performanceClient)===null||n===void 0?void 0:n.startMeasurement($.RefreshTokenClientAcquireTokenWithCachedRefreshToken,t.correlationId),this.logger.verbose("RefreshTokenClientAcquireTokenWithCachedRefreshToken called",t.correlationId),u=this.cacheManager.getRefreshToken(t.account,o),!u)throw a?.discardMeasurement(),Cr.createNoTokensFoundError();return a?.endMeasurement({success:!0}),h=rt(rt({},t),{refreshToken:u.secret,authenticationScheme:t.authenticationScheme||Be.BEARER,ccsCredential:{credential:t.account.homeAccountId,type:wr.HOME_ACCOUNT_ID}}),(s=this.performanceClient)===null||s===void 0||s.setPreQueueTime($.RefreshTokenClientAcquireToken,t.correlationId),[2,this.acquireToken(h)]})})},e.prototype.executeTokenRequest=function(t,o){var i,n,s;return le(this,void 0,void 0,function(){var a,u,h,p,f,b;return ce(this,function(C){switch(C.label){case 0:return(i=this.performanceClient)===null||i===void 0||i.addQueueMeasurement($.RefreshTokenClientExecuteTokenRequest,t.correlationId),a=(n=this.performanceClient)===null||n===void 0?void 0:n.startMeasurement($.RefreshTokenClientExecuteTokenRequest,t.correlationId),(s=this.performanceClient)===null||s===void 0||s.setPreQueueTime($.RefreshTokenClientCreateTokenRequestBody,t.correlationId),u=this.createTokenQueryParameters(t),h=Se.appendQueryString(o.tokenEndpoint,u),[4,this.createTokenRequestBody(t)];case 1:return p=C.sent(),f=this.createTokenRequestHeaders(t.ccsCredential),b={clientId:this.config.authOptions.clientId,authority:o.canonicalAuthority,scopes:t.scopes,claims:t.claims,authenticationScheme:t.authenticationScheme,resourceRequestMethod:t.resourceRequestMethod,resourceRequestUri:t.resourceRequestUri,shrClaims:t.shrClaims,sshKid:t.sshKid},[2,this.executePostToTokenEndpoint(h,p,f,b).then(function(S){return a?.endMeasurement({success:!0}),S}).catch(function(S){throw a?.endMeasurement({success:!1}),S})]}})})},e.prototype.createTokenRequestBody=function(t){var o,i,n;return le(this,void 0,void 0,function(){var s,a,u,h,p,f,b;return ce(this,function(C){switch(C.label){case 0:return(o=this.performanceClient)===null||o===void 0||o.addQueueMeasurement($.RefreshTokenClientCreateTokenRequestBody,t.correlationId),s=t.correlationId,a=(i=this.performanceClient)===null||i===void 0?void 0:i.startMeasurement($.BaseClientCreateTokenRequestHeaders,s),u=new Lr,u.addClientId(this.config.authOptions.clientId),u.addScopes(t.scopes),u.addGrantType(Uo.REFRESH_TOKEN_GRANT),u.addClientInfo(),u.addLibraryInfo(this.config.libraryInfo),u.addApplicationTelemetry(this.config.telemetry.application),u.addThrottling(),this.serverTelemetryManager&&u.addServerTelemetry(this.serverTelemetryManager),u.addCorrelationId(s),u.addRefreshToken(t.refreshToken),this.config.clientCredentials.clientSecret&&u.addClientSecret(this.config.clientCredentials.clientSecret),this.config.clientCredentials.clientAssertion&&(h=this.config.clientCredentials.clientAssertion,u.addClientAssertion(h.assertion),u.addClientAssertionType(h.assertionType)),t.authenticationScheme!==Be.POP?[3,2]:(p=new ai(this.cryptoUtils,this.performanceClient),(n=this.performanceClient)===null||n===void 0||n.setPreQueueTime($.PopTokenGenerateCnf,t.correlationId),[4,p.generateCnf(t)]);case 1:return f=C.sent(),u.addPopToken(f.reqCnfString),[3,3];case 2:if(t.authenticationScheme===Be.SSH)if(t.sshJwk)u.addSshJwk(t.sshJwk);else throw a?.endMeasurement({success:!1}),je.createMissingSshJwkError();C.label=3;case 3:if((!B.isEmptyObj(t.claims)||this.config.authOptions.clientCapabilities&&this.config.authOptions.clientCapabilities.length>0)&&u.addClaims(t.claims,this.config.authOptions.clientCapabilities),this.config.systemOptions.preventCorsPreflight&&t.ccsCredential)switch(t.ccsCredential.type){case wr.HOME_ACCOUNT_ID:try{b=En(t.ccsCredential.credential),u.addCcsOid(b)}catch(S){this.logger.verbose("Could not parse home account ID for CCS Header: "+S)}break;case wr.UPN:u.addCcsUpn(t.ccsCredential.credential);break}return a?.endMeasurement({success:!0}),[2,u.createQueryString()]}})})},e}(Bo);l();c();d();var b9=function(r){nt(e,r);function e(t,o){var i=r.call(this,t)||this;return i.appTokenProvider=o,i}return e.prototype.acquireToken=function(t){return le(this,void 0,void 0,function(){var o;return ce(this,function(i){switch(i.label){case 0:return this.scopeSet=new It(t.scopes||[]),t.skipCache?[4,this.executeTokenRequest(t,this.authority)]:[3,2];case 1:return[2,i.sent()];case 2:return[4,this.getCachedAuthenticationResult(t)];case 3:return o=i.sent(),o?[2,o]:[3,4];case 4:return[4,this.executeTokenRequest(t,this.authority)];case 5:return[2,i.sent()]}})})},e.prototype.getCachedAuthenticationResult=function(t){var o,i;return le(this,void 0,void 0,function(){var n;return ce(this,function(s){switch(s.label){case 0:return n=this.readAccessTokenFromCache(),n?st.isTokenExpired(n.expiresOn,this.config.systemOptions.tokenRenewalOffsetSeconds)?((i=this.serverTelemetryManager)===null||i===void 0||i.setCacheOutcome(vo.CACHED_ACCESS_TOKEN_EXPIRED),[2,null]):[4,ro.generateAuthenticationResult(this.cryptoUtils,this.authority,{account:null,idToken:null,accessToken:n,refreshToken:null,appMetadata:null},!0,t)]:((o=this.serverTelemetryManager)===null||o===void 0||o.setCacheOutcome(vo.NO_CACHED_ACCESS_TOKEN),[2,null]);case 1:return[2,s.sent()]}})})},e.prototype.readAccessTokenFromCache=function(){var t={homeAccountId:_.EMPTY_STRING,environment:this.authority.canonicalAuthorityUrlComponents.HostNameAndPort,credentialType:ue.ACCESS_TOKEN,clientId:this.config.authOptions.clientId,realm:this.authority.tenant,target:It.createSearchScopes(this.scopeSet.asArray())},o=this.cacheManager.getAccessTokensByFilter(t);if(o.length<1)return null;if(o.length>1)throw U.createMultipleMatchingTokensInCacheError();return o[0]},e.prototype.executeTokenRequest=function(t,o){return le(this,void 0,void 0,function(){var i,n,s,a,u,h,p,f,b,C,S,R;return ce(this,function(H){switch(H.label){case 0:return this.appTokenProvider?(this.logger.info("Using appTokenProvider extensibility."),s={correlationId:t.correlationId,tenantId:this.config.authOptions.authority.tenant,scopes:t.scopes,claims:t.claims},n=st.nowSeconds(),[4,this.appTokenProvider(s)]):[3,2];case 1:return a=H.sent(),i={access_token:a.accessToken,expires_in:a.expiresInSeconds,refresh_in:a.refreshInSeconds,token_type:Be.BEARER},[3,4];case 2:return u=this.createTokenQueryParameters(t),h=Se.appendQueryString(o.tokenEndpoint,u),p=this.createTokenRequestBody(t),f=this.createTokenRequestHeaders(),b={clientId:this.config.authOptions.clientId,authority:t.authority,scopes:t.scopes,claims:t.claims,authenticationScheme:t.authenticationScheme,resourceRequestMethod:t.resourceRequestMethod,resourceRequestUri:t.resourceRequestUri,shrClaims:t.shrClaims,sshKid:t.sshKid},n=st.nowSeconds(),[4,this.executePostToTokenEndpoint(h,p,f,b)];case 3:C=H.sent(),i=C.body,H.label=4;case 4:return S=new ro(this.config.authOptions.clientId,this.cacheManager,this.cryptoUtils,this.logger,this.config.serializableCache,this.config.persistencePlugin),S.validateTokenResponse(i),[4,S.handleServerTokenResponse(i,this.authority,n,t)];case 5:return R=H.sent(),[2,R]}})})},e.prototype.createTokenRequestBody=function(t){var o=new Lr;o.addClientId(this.config.authOptions.clientId),o.addScopes(t.scopes,!1),o.addGrantType(Uo.CLIENT_CREDENTIALS_GRANT),o.addLibraryInfo(this.config.libraryInfo),o.addApplicationTelemetry(this.config.telemetry.application),o.addThrottling(),this.serverTelemetryManager&&o.addServerTelemetry(this.serverTelemetryManager);var i=t.correlationId||this.config.cryptoInterface.createNewGuid();o.addCorrelationId(i),this.config.clientCredentials.clientSecret&&o.addClientSecret(this.config.clientCredentials.clientSecret);var n=t.clientAssertion||this.config.clientCredentials.clientAssertion;return n&&(o.addClientAssertion(n.assertion),o.addClientAssertionType(n.assertionType)),(!B.isEmptyObj(t.claims)||this.config.authOptions.clientCapabilities&&this.config.authOptions.clientCapabilities.length>0)&&o.addClaims(t.claims,this.config.authOptions.clientCapabilities),o.createQueryString()},e}(Bo);l();c();d();var w9=function(r){nt(e,r);function e(t){return r.call(this,t)||this}return e.prototype.acquireToken=function(t){return le(this,void 0,void 0,function(){var o;return ce(this,function(i){switch(i.label){case 0:return this.scopeSet=new It(t.scopes||[]),o=this,[4,this.cryptoUtils.hashString(t.oboAssertion)];case 1:return o.userAssertionHash=i.sent(),t.skipCache?[4,this.executeTokenRequest(t,this.authority,this.userAssertionHash)]:[3,3];case 2:return[2,i.sent()];case 3:return i.trys.push([3,5,,7]),[4,this.getCachedAuthenticationResult(t)];case 4:return[2,i.sent()];case 5:return i.sent(),[4,this.executeTokenRequest(t,this.authority,this.userAssertionHash)];case 6:return[2,i.sent()];case 7:return[2]}})})},e.prototype.getCachedAuthenticationResult=function(t){var o,i;return le(this,void 0,void 0,function(){var n,s,a,u,h,p;return ce(this,function(f){switch(f.label){case 0:if(n=this.readAccessTokenFromCacheForOBO(this.config.authOptions.clientId,t),n){if(st.isTokenExpired(n.expiresOn,this.config.systemOptions.tokenRenewalOffsetSeconds))throw(i=this.serverTelemetryManager)===null||i===void 0||i.setCacheOutcome(vo.CACHED_ACCESS_TOKEN_EXPIRED),this.logger.info("OnbehalfofFlow:getCachedAuthenticationResult - Cached access token is expired or will expire within "+this.config.systemOptions.tokenRenewalOffsetSeconds+" seconds."),U.createRefreshRequiredError()}else throw(o=this.serverTelemetryManager)===null||o===void 0||o.setCacheOutcome(vo.NO_CACHED_ACCESS_TOKEN),this.logger.info("SilentFlowClient:acquireCachedToken - No access token found in cache for the given properties."),U.createRefreshRequiredError();return s=this.readIdTokenFromCacheForOBO(n.homeAccountId),u=null,s&&(a=new fr(s.secret,this.config.cryptoInterface),h=a.claims.oid?a.claims.oid:a.claims.sub,p={homeAccountId:s.homeAccountId,environment:s.environment,tenantId:s.realm,username:_.EMPTY_STRING,localAccountId:h||_.EMPTY_STRING},u=this.cacheManager.readAccountFromCache(p)),this.config.serverTelemetryManager&&this.config.serverTelemetryManager.incrementCacheHits(),[4,ro.generateAuthenticationResult(this.cryptoUtils,this.authority,{account:u,accessToken:n,idToken:s,refreshToken:null,appMetadata:null},!0,t,a)];case 1:return[2,f.sent()]}})})},e.prototype.readIdTokenFromCacheForOBO=function(t){var o={homeAccountId:t,environment:this.authority.canonicalAuthorityUrlComponents.HostNameAndPort,credentialType:ue.ID_TOKEN,clientId:this.config.authOptions.clientId,realm:this.authority.tenant},i=this.cacheManager.getIdTokensByFilter(o);return i.length<1?null:i[0]},e.prototype.readAccessTokenFromCacheForOBO=function(t,o){var i=o.authenticationScheme||Be.BEARER,n=i&&i.toLowerCase()!==Be.BEARER.toLowerCase()?ue.ACCESS_TOKEN_WITH_AUTH_SCHEME:ue.ACCESS_TOKEN,s={credentialType:n,clientId:t,target:It.createSearchScopes(this.scopeSet.asArray()),tokenType:i,keyId:o.sshKid,requestedClaimsHash:o.requestedClaimsHash,userAssertionHash:this.userAssertionHash},a=this.cacheManager.getAccessTokensByFilter(s),u=a.length;if(u<1)return null;if(u>1)throw U.createMultipleMatchingTokensInCacheError();return a[0]},e.prototype.executeTokenRequest=function(t,o,i){return le(this,void 0,void 0,function(){var n,s,a,u,h,p,f,b,C;return ce(this,function(S){switch(S.label){case 0:return n=this.createTokenQueryParameters(t),s=Se.appendQueryString(o.tokenEndpoint,n),a=this.createTokenRequestBody(t),u=this.createTokenRequestHeaders(),h={clientId:this.config.authOptions.clientId,authority:t.authority,scopes:t.scopes,claims:t.claims,authenticationScheme:t.authenticationScheme,resourceRequestMethod:t.resourceRequestMethod,resourceRequestUri:t.resourceRequestUri,shrClaims:t.shrClaims,sshKid:t.sshKid},p=st.nowSeconds(),[4,this.executePostToTokenEndpoint(s,a,u,h)];case 1:return f=S.sent(),b=new ro(this.config.authOptions.clientId,this.cacheManager,this.cryptoUtils,this.logger,this.config.serializableCache,this.config.persistencePlugin),b.validateTokenResponse(f.body),[4,b.handleServerTokenResponse(f.body,this.authority,p,t,void 0,i)];case 2:return C=S.sent(),[2,C]}})})},e.prototype.createTokenRequestBody=function(t){var o=new Lr;o.addClientId(this.config.authOptions.clientId),o.addScopes(t.scopes),o.addGrantType(Uo.JWT_BEARER),o.addClientInfo(),o.addLibraryInfo(this.config.libraryInfo),o.addApplicationTelemetry(this.config.telemetry.application),o.addThrottling(),this.serverTelemetryManager&&o.addServerTelemetry(this.serverTelemetryManager);var i=t.correlationId||this.config.cryptoInterface.createNewGuid();if(o.addCorrelationId(i),o.addRequestTokenUse(Ne.ON_BEHALF_OF),o.addOboAssertion(t.oboAssertion),this.config.clientCredentials.clientSecret&&o.addClientSecret(this.config.clientCredentials.clientSecret),this.config.clientCredentials.clientAssertion){var n=this.config.clientCredentials.clientAssertion;o.addClientAssertion(n.assertion),o.addClientAssertionType(n.assertionType)}return(t.claims||this.config.authOptions.clientCapabilities&&this.config.authOptions.clientCapabilities.length>0)&&o.addClaims(t.claims,this.config.authOptions.clientCapabilities),o.createQueryString()},e}(Bo);l();c();d();var fy=function(r){nt(e,r);function e(t,o){return r.call(this,t,o)||this}return e.prototype.acquireToken=function(t){return le(this,void 0,void 0,function(){var o,i;return ce(this,function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,this.acquireCachedToken(t)];case 1:return[2,n.sent()];case 2:if(o=n.sent(),o instanceof U&&o.errorCode===K.tokenRefreshRequired.code)return i=new Eu(this.config,this.performanceClient),[2,i.acquireTokenByRefreshToken(t)];throw o;case 3:return[2]}})})},e.prototype.acquireCachedToken=function(t){var o,i,n,s,a;return le(this,void 0,void 0,function(){var u,h;return ce(this,function(p){switch(p.label){case 0:if(!t)throw je.createEmptyTokenRequestError();if(t.forceRefresh)throw(o=this.serverTelemetryManager)===null||o===void 0||o.setCacheOutcome(vo.FORCE_REFRESH),this.logger.info("SilentFlowClient:acquireCachedToken - Skipping cache because forceRefresh is true."),U.createRefreshRequiredError();if(!this.config.cacheOptions.claimsBasedCachingEnabled&&!B.isEmptyObj(t.claims))throw(i=this.serverTelemetryManager)===null||i===void 0||i.setCacheOutcome(vo.CLAIMS_REQUESTED_CACHE_SKIPPED),this.logger.info("SilentFlowClient:acquireCachedToken - Skipping cache because claims-based caching is disabled and claims were requested."),U.createRefreshRequiredError();if(!t.account)throw U.createNoAccountInSilentRequestError();if(u=t.authority||this.authority.getPreferredCache(),h=this.cacheManager.readCacheRecord(t.account,t,u),h.accessToken){if(st.wasClockTurnedBack(h.accessToken.cachedAt)||st.isTokenExpired(h.accessToken.expiresOn,this.config.systemOptions.tokenRenewalOffsetSeconds))throw(s=this.serverTelemetryManager)===null||s===void 0||s.setCacheOutcome(vo.CACHED_ACCESS_TOKEN_EXPIRED),this.logger.info("SilentFlowClient:acquireCachedToken - Cached access token is expired or will expire within "+this.config.systemOptions.tokenRenewalOffsetSeconds+" seconds."),U.createRefreshRequiredError();if(h.accessToken.refreshOn&&st.isTokenExpired(h.accessToken.refreshOn,0))throw(a=this.serverTelemetryManager)===null||a===void 0||a.setCacheOutcome(vo.REFRESH_CACHED_ACCESS_TOKEN),this.logger.info("SilentFlowClient:acquireCachedToken - Cached access token's refreshOn property has been exceeded'."),U.createRefreshRequiredError()}else throw(n=this.serverTelemetryManager)===null||n===void 0||n.setCacheOutcome(vo.NO_CACHED_ACCESS_TOKEN),this.logger.info("SilentFlowClient:acquireCachedToken - No access token found in cache for the given properties."),U.createRefreshRequiredError();return this.config.serverTelemetryManager&&this.config.serverTelemetryManager.incrementCacheHits(),[4,this.generateResultFromCacheRecord(h,t)];case 1:return[2,p.sent()]}})})},e.prototype.generateResultFromCacheRecord=function(t,o){return le(this,void 0,void 0,function(){var i,n;return ce(this,function(s){switch(s.label){case 0:if(t.idToken&&(i=new fr(t.idToken.secret,this.config.cryptoInterface)),o.maxAge||o.maxAge===0){if(n=i?.claims.auth_time,!n)throw U.createAuthTimeNotFoundError();fr.checkMaxAge(n,o.maxAge)}return[4,ro.generateAuthenticationResult(this.cryptoUtils,this.authority,t,!0,o,i)];case 1:return[2,s.sent()]}})})},e}(Bo);l();c();d();var C9=function(r){nt(e,r);function e(t){return r.call(this,t)||this}return e.prototype.acquireToken=function(t){var o,i;return le(this,void 0,void 0,function(){var n,s,a,u,h,p;return ce(this,function(f){switch(f.label){case 0:return n=(o=this.performanceClient)===null||o===void 0?void 0:o.startMeasurement("UsernamePasswordClientAcquireToken",t.correlationId),this.logger.info("in acquireToken call in username-password client"),s=st.nowSeconds(),[4,this.executeTokenRequest(this.authority,t)];case 1:return a=f.sent(),u=(i=a.headers)===null||i===void 0?void 0:i[Ft.X_MS_HTTP_VERSION],n?.addStaticFields({httpVerToken:u}),h=new ro(this.config.authOptions.clientId,this.cacheManager,this.cryptoUtils,this.logger,this.config.serializableCache,this.config.persistencePlugin),h.validateTokenResponse(a.body),p=h.handleServerTokenResponse(a.body,this.authority,s,t),[2,p]}})})},e.prototype.executeTokenRequest=function(t,o){return le(this,void 0,void 0,function(){var i,n,s,a,u;return ce(this,function(h){return i=this.createTokenQueryParameters(o),n=Se.appendQueryString(t.tokenEndpoint,i),s=this.createTokenRequestBody(o),a=this.createTokenRequestHeaders({credential:o.username,type:wr.UPN}),u={clientId:this.config.authOptions.clientId,authority:t.canonicalAuthority,scopes:o.scopes,claims:o.claims,authenticationScheme:o.authenticationScheme,resourceRequestMethod:o.resourceRequestMethod,resourceRequestUri:o.resourceRequestUri,shrClaims:o.shrClaims,sshKid:o.sshKid},[2,this.executePostToTokenEndpoint(n,s,a,u)]})})},e.prototype.createTokenRequestBody=function(t){var o=new Lr;o.addClientId(this.config.authOptions.clientId),o.addUsername(t.username),o.addPassword(t.password),o.addScopes(t.scopes),o.addResponseTypeForTokenAndIdToken(),o.addGrantType(Uo.RESOURCE_OWNER_PASSWORD_GRANT),o.addClientInfo(),o.addLibraryInfo(this.config.libraryInfo),o.addApplicationTelemetry(this.config.telemetry.application),o.addThrottling(),this.serverTelemetryManager&&o.addServerTelemetry(this.serverTelemetryManager);var i=t.correlationId||this.config.cryptoInterface.createNewGuid();if(o.addCorrelationId(i),this.config.clientCredentials.clientSecret&&o.addClientSecret(this.config.clientCredentials.clientSecret),this.config.clientCredentials.clientAssertion){var n=this.config.clientCredentials.clientAssertion;o.addClientAssertion(n.assertion),o.addClientAssertionType(n.assertionType)}return(!B.isEmptyObj(t.claims)||this.config.authOptions.clientCapabilities&&this.config.authOptions.clientCapabilities.length>0)&&o.addClaims(t.claims,this.config.authOptions.clientCapabilities),this.config.systemOptions.preventCorsPreflight&&t.username&&o.addCcsUpn(t.username),o.createQueryString()},e}(Bo);l();c();d();l();c();d();function x_(r){return r.hasOwnProperty("authorization_endpoint")&&r.hasOwnProperty("token_endpoint")&&r.hasOwnProperty("issuer")&&r.hasOwnProperty("jwks_uri")}l();c();d();var k_={endpointMetadata:{"https://login.microsoftonline.com/common/":{token_endpoint:"https://login.microsoftonline.com/common/oauth2/v2.0/token",token_endpoint_auth_methods_supported:["client_secret_post","private_key_jwt","client_secret_basic"],jwks_uri:"https://login.microsoftonline.com/common/discovery/v2.0/keys",response_modes_supported:["query","fragment","form_post"],subject_types_supported:["pairwise"],id_token_signing_alg_values_supported:["RS256"],response_types_supported:["code","id_token","code id_token","id_token token"],scopes_supported:["openid","profile","email","offline_access"],issuer:"https://login.microsoftonline.com/{tenantid}/v2.0",request_uri_parameter_supported:!1,userinfo_endpoint:"https://graph.microsoft.com/oidc/userinfo",authorization_endpoint:"https://login.microsoftonline.com/common/oauth2/v2.0/authorize",device_authorization_endpoint:"https://login.microsoftonline.com/common/oauth2/v2.0/devicecode",http_logout_supported:!0,frontchannel_logout_supported:!0,end_session_endpoint:"https://login.microsoftonline.com/common/oauth2/v2.0/logout",claims_supported:["sub","iss","cloud_instance_name","cloud_instance_host_name","cloud_graph_host_name","msgraph_host","aud","exp","iat","auth_time","acr","nonce","preferred_username","name","tid","ver","at_hash","c_hash","email"],kerberos_endpoint:"https://login.microsoftonline.com/common/kerberos",tenant_region_scope:null,cloud_instance_name:"microsoftonline.com",cloud_graph_host_name:"graph.windows.net",msgraph_host:"graph.microsoft.com",rbac_url:"https://pas.windows.net"},"https://login.chinacloudapi.cn/common/":{token_endpoint:"https://login.chinacloudapi.cn/common/oauth2/v2.0/token",token_endpoint_auth_methods_supported:["client_secret_post","private_key_jwt","client_secret_basic"],jwks_uri:"https://login.chinacloudapi.cn/common/discovery/v2.0/keys",response_modes_supported:["query","fragment","form_post"],subject_types_supported:["pairwise"],id_token_signing_alg_values_supported:["RS256"],response_types_supported:["code","id_token","code id_token","id_token token"],scopes_supported:["openid","profile","email","offline_access"],issuer:"https://login.partner.microsoftonline.cn/{tenantid}/v2.0",request_uri_parameter_supported:!1,userinfo_endpoint:"https://microsoftgraph.chinacloudapi.cn/oidc/userinfo",authorization_endpoint:"https://login.chinacloudapi.cn/common/oauth2/v2.0/authorize",device_authorization_endpoint:"https://login.chinacloudapi.cn/common/oauth2/v2.0/devicecode",http_logout_supported:!0,frontchannel_logout_supported:!0,end_session_endpoint:"https://login.chinacloudapi.cn/common/oauth2/v2.0/logout",claims_supported:["sub","iss","cloud_instance_name","cloud_instance_host_name","cloud_graph_host_name","msgraph_host","aud","exp","iat","auth_time","acr","nonce","preferred_username","name","tid","ver","at_hash","c_hash","email"],kerberos_endpoint:"https://login.chinacloudapi.cn/common/kerberos",tenant_region_scope:null,cloud_instance_name:"partner.microsoftonline.cn",cloud_graph_host_name:"graph.chinacloudapi.cn",msgraph_host:"microsoftgraph.chinacloudapi.cn",rbac_url:"https://pas.chinacloudapi.cn"},"https://login.microsoftonline.us/common/":{token_endpoint:"https://login.microsoftonline.us/common/oauth2/v2.0/token",token_endpoint_auth_methods_supported:["client_secret_post","private_key_jwt","client_secret_basic"],jwks_uri:"https://login.microsoftonline.us/common/discovery/v2.0/keys",response_modes_supported:["query","fragment","form_post"],subject_types_supported:["pairwise"],id_token_signing_alg_values_supported:["RS256"],response_types_supported:["code","id_token","code id_token","id_token token"],scopes_supported:["openid","profile","email","offline_access"],issuer:"https://login.microsoftonline.us/{tenantid}/v2.0",request_uri_parameter_supported:!1,userinfo_endpoint:"https://graph.microsoft.com/oidc/userinfo",authorization_endpoint:"https://login.microsoftonline.us/common/oauth2/v2.0/authorize",device_authorization_endpoint:"https://login.microsoftonline.us/common/oauth2/v2.0/devicecode",http_logout_supported:!0,frontchannel_logout_supported:!0,end_session_endpoint:"https://login.microsoftonline.us/common/oauth2/v2.0/logout",claims_supported:["sub","iss","cloud_instance_name","cloud_instance_host_name","cloud_graph_host_name","msgraph_host","aud","exp","iat","auth_time","acr","nonce","preferred_username","name","tid","ver","at_hash","c_hash","email"],kerberos_endpoint:"https://login.microsoftonline.us/common/kerberos",tenant_region_scope:null,cloud_instance_name:"microsoftonline.us",cloud_graph_host_name:"graph.windows.net",msgraph_host:"graph.microsoft.com",rbac_url:"https://pasff.usgovcloudapi.net"},"https://login.microsoftonline.com/consumers/":{token_endpoint:"https://login.microsoftonline.com/consumers/oauth2/v2.0/token",token_endpoint_auth_methods_supported:["client_secret_post","private_key_jwt","client_secret_basic"],jwks_uri:"https://login.microsoftonline.com/consumers/discovery/v2.0/keys",response_modes_supported:["query","fragment","form_post"],subject_types_supported:["pairwise"],id_token_signing_alg_values_supported:["RS256"],response_types_supported:["code","id_token","code id_token","id_token token"],scopes_supported:["openid","profile","email","offline_access"],issuer:"https://login.microsoftonline.com/9188040d-6c67-4c5b-b112-36a304b66dad/v2.0",request_uri_parameter_supported:!1,userinfo_endpoint:"https://graph.microsoft.com/oidc/userinfo",authorization_endpoint:"https://login.microsoftonline.com/consumers/oauth2/v2.0/authorize",device_authorization_endpoint:"https://login.microsoftonline.com/consumers/oauth2/v2.0/devicecode",http_logout_supported:!0,frontchannel_logout_supported:!0,end_session_endpoint:"https://login.microsoftonline.com/consumers/oauth2/v2.0/logout",claims_supported:["sub","iss","cloud_instance_name","cloud_instance_host_name","cloud_graph_host_name","msgraph_host","aud","exp","iat","auth_time","acr","nonce","preferred_username","name","tid","ver","at_hash","c_hash","email"],kerberos_endpoint:"https://login.microsoftonline.com/consumers/kerberos",tenant_region_scope:null,cloud_instance_name:"microsoftonline.com",cloud_graph_host_name:"graph.windows.net",msgraph_host:"graph.microsoft.com",rbac_url:"https://pas.windows.net"},"https://login.chinacloudapi.cn/consumers/":{token_endpoint:"https://login.chinacloudapi.cn/consumers/oauth2/v2.0/token",token_endpoint_auth_methods_supported:["client_secret_post","private_key_jwt","client_secret_basic"],jwks_uri:"https://login.chinacloudapi.cn/consumers/discovery/v2.0/keys",response_modes_supported:["query","fragment","form_post"],subject_types_supported:["pairwise"],id_token_signing_alg_values_supported:["RS256"],response_types_supported:["code","id_token","code id_token","id_token token"],scopes_supported:["openid","profile","email","offline_access"],issuer:"https://login.partner.microsoftonline.cn/9188040d-6c67-4c5b-b112-36a304b66dad/v2.0",request_uri_parameter_supported:!1,userinfo_endpoint:"https://microsoftgraph.chinacloudapi.cn/oidc/userinfo",authorization_endpoint:"https://login.chinacloudapi.cn/consumers/oauth2/v2.0/authorize",device_authorization_endpoint:"https://login.chinacloudapi.cn/consumers/oauth2/v2.0/devicecode",http_logout_supported:!0,frontchannel_logout_supported:!0,end_session_endpoint:"https://login.chinacloudapi.cn/consumers/oauth2/v2.0/logout",claims_supported:["sub","iss","cloud_instance_name","cloud_instance_host_name","cloud_graph_host_name","msgraph_host","aud","exp","iat","auth_time","acr","nonce","preferred_username","name","tid","ver","at_hash","c_hash","email"],kerberos_endpoint:"https://login.chinacloudapi.cn/consumers/kerberos",tenant_region_scope:null,cloud_instance_name:"partner.microsoftonline.cn",cloud_graph_host_name:"graph.chinacloudapi.cn",msgraph_host:"microsoftgraph.chinacloudapi.cn",rbac_url:"https://pas.chinacloudapi.cn"},"https://login.microsoftonline.us/consumers/":{token_endpoint:"https://login.microsoftonline.us/consumers/oauth2/v2.0/token",token_endpoint_auth_methods_supported:["client_secret_post","private_key_jwt","client_secret_basic"],jwks_uri:"https://login.microsoftonline.us/consumers/discovery/v2.0/keys",response_modes_supported:["query","fragment","form_post"],subject_types_supported:["pairwise"],id_token_signing_alg_values_supported:["RS256"],response_types_supported:["code","id_token","code id_token","id_token token"],scopes_supported:["openid","profile","email","offline_access"],issuer:"https://login.microsoftonline.us/9188040d-6c67-4c5b-b112-36a304b66dad/v2.0",request_uri_parameter_supported:!1,userinfo_endpoint:"https://graph.microsoft.com/oidc/userinfo",authorization_endpoint:"https://login.microsoftonline.us/consumers/oauth2/v2.0/authorize",device_authorization_endpoint:"https://login.microsoftonline.us/consumers/oauth2/v2.0/devicecode",http_logout_supported:!0,frontchannel_logout_supported:!0,end_session_endpoint:"https://login.microsoftonline.us/consumers/oauth2/v2.0/logout",claims_supported:["sub","iss","cloud_instance_name","cloud_instance_host_name","cloud_graph_host_name","msgraph_host","aud","exp","iat","auth_time","acr","nonce","preferred_username","name","tid","ver","at_hash","c_hash","email"],kerberos_endpoint:"https://login.microsoftonline.us/consumers/kerberos",tenant_region_scope:null,cloud_instance_name:"microsoftonline.us",cloud_graph_host_name:"graph.windows.net",msgraph_host:"graph.microsoft.com",rbac_url:"https://pasff.usgovcloudapi.net"},"https://login.microsoftonline.com/organizations/":{token_endpoint:"https://login.microsoftonline.com/organizations/oauth2/v2.0/token",token_endpoint_auth_methods_supported:["client_secret_post","private_key_jwt","client_secret_basic"],jwks_uri:"https://login.microsoftonline.com/organizations/discovery/v2.0/keys",response_modes_supported:["query","fragment","form_post"],subject_types_supported:["pairwise"],id_token_signing_alg_values_supported:["RS256"],response_types_supported:["code","id_token","code id_token","id_token token"],scopes_supported:["openid","profile","email","offline_access"],issuer:"https://login.microsoftonline.com/{tenantid}/v2.0",request_uri_parameter_supported:!1,userinfo_endpoint:"https://graph.microsoft.com/oidc/userinfo",authorization_endpoint:"https://login.microsoftonline.com/organizations/oauth2/v2.0/authorize",device_authorization_endpoint:"https://login.microsoftonline.com/organizations/oauth2/v2.0/devicecode",http_logout_supported:!0,frontchannel_logout_supported:!0,end_session_endpoint:"https://login.microsoftonline.com/organizations/oauth2/v2.0/logout",claims_supported:["sub","iss","cloud_instance_name","cloud_instance_host_name","cloud_graph_host_name","msgraph_host","aud","exp","iat","auth_time","acr","nonce","preferred_username","name","tid","ver","at_hash","c_hash","email"],kerberos_endpoint:"https://login.microsoftonline.com/organizations/kerberos",tenant_region_scope:null,cloud_instance_name:"microsoftonline.com",cloud_graph_host_name:"graph.windows.net",msgraph_host:"graph.microsoft.com",rbac_url:"https://pas.windows.net"},"https://login.chinacloudapi.cn/organizations/":{token_endpoint:"https://login.chinacloudapi.cn/organizations/oauth2/v2.0/token",token_endpoint_auth_methods_supported:["client_secret_post","private_key_jwt","client_secret_basic"],jwks_uri:"https://login.chinacloudapi.cn/organizations/discovery/v2.0/keys",response_modes_supported:["query","fragment","form_post"],subject_types_supported:["pairwise"],id_token_signing_alg_values_supported:["RS256"],response_types_supported:["code","id_token","code id_token","id_token token"],scopes_supported:["openid","profile","email","offline_access"],issuer:"https://login.partner.microsoftonline.cn/{tenantid}/v2.0",request_uri_parameter_supported:!1,userinfo_endpoint:"https://microsoftgraph.chinacloudapi.cn/oidc/userinfo",authorization_endpoint:"https://login.chinacloudapi.cn/organizations/oauth2/v2.0/authorize",device_authorization_endpoint:"https://login.chinacloudapi.cn/organizations/oauth2/v2.0/devicecode",http_logout_supported:!0,frontchannel_logout_supported:!0,end_session_endpoint:"https://login.chinacloudapi.cn/organizations/oauth2/v2.0/logout",claims_supported:["sub","iss","cloud_instance_name","cloud_instance_host_name","cloud_graph_host_name","msgraph_host","aud","exp","iat","auth_time","acr","nonce","preferred_username","name","tid","ver","at_hash","c_hash","email"],kerberos_endpoint:"https://login.chinacloudapi.cn/organizations/kerberos",tenant_region_scope:null,cloud_instance_name:"partner.microsoftonline.cn",cloud_graph_host_name:"graph.chinacloudapi.cn",msgraph_host:"microsoftgraph.chinacloudapi.cn",rbac_url:"https://pas.chinacloudapi.cn"},"https://login.microsoftonline.us/organizations/":{token_endpoint:"https://login.microsoftonline.us/organizations/oauth2/v2.0/token",token_endpoint_auth_methods_supported:["client_secret_post","private_key_jwt","client_secret_basic"],jwks_uri:"https://login.microsoftonline.us/organizations/discovery/v2.0/keys",response_modes_supported:["query","fragment","form_post"],subject_types_supported:["pairwise"],id_token_signing_alg_values_supported:["RS256"],response_types_supported:["code","id_token","code id_token","id_token token"],scopes_supported:["openid","profile","email","offline_access"],issuer:"https://login.microsoftonline.us/{tenantid}/v2.0",request_uri_parameter_supported:!1,userinfo_endpoint:"https://graph.microsoft.com/oidc/userinfo",authorization_endpoint:"https://login.microsoftonline.us/organizations/oauth2/v2.0/authorize",device_authorization_endpoint:"https://login.microsoftonline.us/organizations/oauth2/v2.0/devicecode",http_logout_supported:!0,frontchannel_logout_supported:!0,end_session_endpoint:"https://login.microsoftonline.us/organizations/oauth2/v2.0/logout",claims_supported:["sub","iss","cloud_instance_name","cloud_instance_host_name","cloud_graph_host_name","msgraph_host","aud","exp","iat","auth_time","acr","nonce","preferred_username","name","tid","ver","at_hash","c_hash","email"],kerberos_endpoint:"https://login.microsoftonline.us/organizations/kerberos",tenant_region_scope:null,cloud_instance_name:"microsoftonline.us",cloud_graph_host_name:"graph.windows.net",msgraph_host:"graph.microsoft.com",rbac_url:"https://pasff.usgovcloudapi.net"}},instanceDiscoveryMetadata:{"https://login.microsoftonline.com/common/":{tenant_discovery_endpoint:"https://login.microsoftonline.com/common/v2.0/.well-known/openid-configuration","api-version":"1.1",metadata:[{preferred_network:"login.microsoftonline.com",preferred_cache:"login.windows.net",aliases:["login.microsoftonline.com","login.windows.net","login.microsoft.com","sts.windows.net"]},{preferred_network:"login.partner.microsoftonline.cn",preferred_cache:"login.partner.microsoftonline.cn",aliases:["login.partner.microsoftonline.cn","login.chinacloudapi.cn"]},{preferred_network:"login.microsoftonline.de",preferred_cache:"login.microsoftonline.de",aliases:["login.microsoftonline.de"]},{preferred_network:"login.microsoftonline.us",preferred_cache:"login.microsoftonline.us",aliases:["login.microsoftonline.us","login.usgovcloudapi.net"]},{preferred_network:"login-us.microsoftonline.com",preferred_cache:"login-us.microsoftonline.com",aliases:["login-us.microsoftonline.com"]}]},"https://login.chinacloudapi.cn/common/":{tenant_discovery_endpoint:"https://login.chinacloudapi.cn/common/v2.0/.well-known/openid-configuration","api-version":"1.1",metadata:[{preferred_network:"login.microsoftonline.com",preferred_cache:"login.windows.net",aliases:["login.microsoftonline.com","login.windows.net","login.microsoft.com","sts.windows.net"]},{preferred_network:"login.partner.microsoftonline.cn",preferred_cache:"login.partner.microsoftonline.cn",aliases:["login.partner.microsoftonline.cn","login.chinacloudapi.cn"]},{preferred_network:"login.microsoftonline.de",preferred_cache:"login.microsoftonline.de",aliases:["login.microsoftonline.de"]},{preferred_network:"login.microsoftonline.us",preferred_cache:"login.microsoftonline.us",aliases:["login.microsoftonline.us","login.usgovcloudapi.net"]},{preferred_network:"login-us.microsoftonline.com",preferred_cache:"login-us.microsoftonline.com",aliases:["login-us.microsoftonline.com"]}]},"https://login.microsoftonline.us/common/":{tenant_discovery_endpoint:"https://login.microsoftonline.us/common/v2.0/.well-known/openid-configuration","api-version":"1.1",metadata:[{preferred_network:"login.microsoftonline.com",preferred_cache:"login.windows.net",aliases:["login.microsoftonline.com","login.windows.net","login.microsoft.com","sts.windows.net"]},{preferred_network:"login.partner.microsoftonline.cn",preferred_cache:"login.partner.microsoftonline.cn",aliases:["login.partner.microsoftonline.cn","login.chinacloudapi.cn"]},{preferred_network:"login.microsoftonline.de",preferred_cache:"login.microsoftonline.de",aliases:["login.microsoftonline.de"]},{preferred_network:"login.microsoftonline.us",preferred_cache:"login.microsoftonline.us",aliases:["login.microsoftonline.us","login.usgovcloudapi.net"]},{preferred_network:"login-us.microsoftonline.com",preferred_cache:"login-us.microsoftonline.com",aliases:["login-us.microsoftonline.com"]}]},"https://login.microsoftonline.com/consumers/":{tenant_discovery_endpoint:"https://login.microsoftonline.com/consumers/v2.0/.well-known/openid-configuration","api-version":"1.1",metadata:[{preferred_network:"login.microsoftonline.com",preferred_cache:"login.windows.net",aliases:["login.microsoftonline.com","login.windows.net","login.microsoft.com","sts.windows.net"]},{preferred_network:"login.partner.microsoftonline.cn",preferred_cache:"login.partner.microsoftonline.cn",aliases:["login.partner.microsoftonline.cn","login.chinacloudapi.cn"]},{preferred_network:"login.microsoftonline.de",preferred_cache:"login.microsoftonline.de",aliases:["login.microsoftonline.de"]},{preferred_network:"login.microsoftonline.us",preferred_cache:"login.microsoftonline.us",aliases:["login.microsoftonline.us","login.usgovcloudapi.net"]},{preferred_network:"login-us.microsoftonline.com",preferred_cache:"login-us.microsoftonline.com",aliases:["login-us.microsoftonline.com"]}]},"https://login.chinacloudapi.cn/consumers/":{tenant_discovery_endpoint:"https://login.chinacloudapi.cn/consumers/v2.0/.well-known/openid-configuration","api-version":"1.1",metadata:[{preferred_network:"login.microsoftonline.com",preferred_cache:"login.windows.net",aliases:["login.microsoftonline.com","login.windows.net","login.microsoft.com","sts.windows.net"]},{preferred_network:"login.partner.microsoftonline.cn",preferred_cache:"login.partner.microsoftonline.cn",aliases:["login.partner.microsoftonline.cn","login.chinacloudapi.cn"]},{preferred_network:"login.microsoftonline.de",preferred_cache:"login.microsoftonline.de",aliases:["login.microsoftonline.de"]},{preferred_network:"login.microsoftonline.us",preferred_cache:"login.microsoftonline.us",aliases:["login.microsoftonline.us","login.usgovcloudapi.net"]},{preferred_network:"login-us.microsoftonline.com",preferred_cache:"login-us.microsoftonline.com",aliases:["login-us.microsoftonline.com"]}]},"https://login.microsoftonline.us/consumers/":{tenant_discovery_endpoint:"https://login.microsoftonline.us/consumers/v2.0/.well-known/openid-configuration","api-version":"1.1",metadata:[{preferred_network:"login.microsoftonline.com",preferred_cache:"login.windows.net",aliases:["login.microsoftonline.com","login.windows.net","login.microsoft.com","sts.windows.net"]},{preferred_network:"login.partner.microsoftonline.cn",preferred_cache:"login.partner.microsoftonline.cn",aliases:["login.partner.microsoftonline.cn","login.chinacloudapi.cn"]},{preferred_network:"login.microsoftonline.de",preferred_cache:"login.microsoftonline.de",aliases:["login.microsoftonline.de"]},{preferred_network:"login.microsoftonline.us",preferred_cache:"login.microsoftonline.us",aliases:["login.microsoftonline.us","login.usgovcloudapi.net"]},{preferred_network:"login-us.microsoftonline.com",preferred_cache:"login-us.microsoftonline.com",aliases:["login-us.microsoftonline.com"]}]},"https://login.microsoftonline.com/organizations/":{tenant_discovery_endpoint:"https://login.microsoftonline.com/organizations/v2.0/.well-known/openid-configuration","api-version":"1.1",metadata:[{preferred_network:"login.microsoftonline.com",preferred_cache:"login.windows.net",aliases:["login.microsoftonline.com","login.windows.net","login.microsoft.com","sts.windows.net"]},{preferred_network:"login.partner.microsoftonline.cn",preferred_cache:"login.partner.microsoftonline.cn",aliases:["login.partner.microsoftonline.cn","login.chinacloudapi.cn"]},{preferred_network:"login.microsoftonline.de",preferred_cache:"login.microsoftonline.de",aliases:["login.microsoftonline.de"]},{preferred_network:"login.microsoftonline.us",preferred_cache:"login.microsoftonline.us",aliases:["login.microsoftonline.us","login.usgovcloudapi.net"]},{preferred_network:"login-us.microsoftonline.com",preferred_cache:"login-us.microsoftonline.com",aliases:["login-us.microsoftonline.com"]}]},"https://login.chinacloudapi.cn/organizations/":{tenant_discovery_endpoint:"https://login.chinacloudapi.cn/organizations/v2.0/.well-known/openid-configuration","api-version":"1.1",metadata:[{preferred_network:"login.microsoftonline.com",preferred_cache:"login.windows.net",aliases:["login.microsoftonline.com","login.windows.net","login.microsoft.com","sts.windows.net"]},{preferred_network:"login.partner.microsoftonline.cn",preferred_cache:"login.partner.microsoftonline.cn",aliases:["login.partner.microsoftonline.cn","login.chinacloudapi.cn"]},{preferred_network:"login.microsoftonline.de",preferred_cache:"login.microsoftonline.de",aliases:["login.microsoftonline.de"]},{preferred_network:"login.microsoftonline.us",preferred_cache:"login.microsoftonline.us",aliases:["login.microsoftonline.us","login.usgovcloudapi.net"]},{preferred_network:"login-us.microsoftonline.com",preferred_cache:"login-us.microsoftonline.com",aliases:["login-us.microsoftonline.com"]}]},"https://login.microsoftonline.us/organizations/":{tenant_discovery_endpoint:"https://login.microsoftonline.us/organizations/v2.0/.well-known/openid-configuration","api-version":"1.1",metadata:[{preferred_network:"login.microsoftonline.com",preferred_cache:"login.windows.net",aliases:["login.microsoftonline.com","login.windows.net","login.microsoft.com","sts.windows.net"]},{preferred_network:"login.partner.microsoftonline.cn",preferred_cache:"login.partner.microsoftonline.cn",aliases:["login.partner.microsoftonline.cn","login.chinacloudapi.cn"]},{preferred_network:"login.microsoftonline.de",preferred_cache:"login.microsoftonline.de",aliases:["login.microsoftonline.de"]},{preferred_network:"login.microsoftonline.us",preferred_cache:"login.microsoftonline.us",aliases:["login.microsoftonline.us","login.usgovcloudapi.net"]},{preferred_network:"login-us.microsoftonline.com",preferred_cache:"login-us.microsoftonline.com",aliases:["login-us.microsoftonline.com"]}]}}},my=k_.endpointMetadata,gy=k_.instanceDiscoveryMetadata;l();c();d();var ps;(function(r){r.AAD="AAD",r.OIDC="OIDC"})(ps||(ps={}));l();c();d();var $c=function(){function r(){this.expiresAt=st.nowSeconds()+vl.REFRESH_TIME_SECONDS}return r.prototype.updateCloudDiscoveryMetadata=function(e,t){this.aliases=e.aliases,this.preferred_cache=e.preferred_cache,this.preferred_network=e.preferred_network,this.aliasesFromNetwork=t},r.prototype.updateEndpointMetadata=function(e,t){this.authorization_endpoint=e.authorization_endpoint,this.token_endpoint=e.token_endpoint,this.end_session_endpoint=e.end_session_endpoint,this.issuer=e.issuer,this.endpointsFromNetwork=t,this.jwks_uri=e.jwks_uri},r.prototype.updateCanonicalAuthority=function(e){this.canonical_authority=e},r.prototype.resetExpiresAt=function(){this.expiresAt=st.nowSeconds()+vl.REFRESH_TIME_SECONDS},r.prototype.isExpired=function(){return this.expiresAt<=st.nowSeconds()},r.isAuthorityMetadataEntity=function(e,t){return t?e.indexOf(vl.CACHE_KEY)===0&&t.hasOwnProperty("aliases")&&t.hasOwnProperty("preferred_cache")&&t.hasOwnProperty("preferred_network")&&t.hasOwnProperty("canonical_authority")&&t.hasOwnProperty("authorization_endpoint")&&t.hasOwnProperty("token_endpoint")&&t.hasOwnProperty("issuer")&&t.hasOwnProperty("aliasesFromNetwork")&&t.hasOwnProperty("endpointsFromNetwork")&&t.hasOwnProperty("expiresAt")&&t.hasOwnProperty("jwks_uri"):!1},r}();l();c();d();function S_(r){return r.hasOwnProperty("tenant_discovery_endpoint")&&r.hasOwnProperty("metadata")}l();c();d();function __(r){return r.hasOwnProperty("error")&&r.hasOwnProperty("error_description")}l();c();d();var T_=function(){function r(e,t,o){this.networkInterface=e,this.performanceClient=t,this.correlationId=o}return r.prototype.detectRegion=function(e,t){var o,i,n,s;return le(this,void 0,void 0,function(){var a,u,h,p,f;return ce(this,function(b){switch(b.label){case 0:if((o=this.performanceClient)===null||o===void 0||o.addQueueMeasurement($.RegionDiscoveryDetectRegion,this.correlationId),a=e,a)return[3,8];u=r.IMDS_OPTIONS,b.label=1;case 1:return b.trys.push([1,6,,7]),(i=this.performanceClient)===null||i===void 0||i.setPreQueueTime($.RegionDiscoveryGetRegionFromIMDS,this.correlationId),[4,this.getRegionFromIMDS(_.IMDS_VERSION,u)];case 2:return h=b.sent(),h.status===gl.httpSuccess&&(a=h.body,t.region_source=cs.IMDS),h.status!==gl.httpBadRequest?[3,5]:((n=this.performanceClient)===null||n===void 0||n.setPreQueueTime($.RegionDiscoveryGetCurrentVersion,this.correlationId),[4,this.getCurrentVersion(u)]);case 3:return p=b.sent(),p?((s=this.performanceClient)===null||s===void 0||s.setPreQueueTime($.RegionDiscoveryGetRegionFromIMDS,this.correlationId),[4,this.getRegionFromIMDS(p,u)]):(t.region_source=cs.FAILED_AUTO_DETECTION,[2,null]);case 4:f=b.sent(),f.status===gl.httpSuccess&&(a=f.body,t.region_source=cs.IMDS),b.label=5;case 5:return[3,7];case 6:return b.sent(),t.region_source=cs.FAILED_AUTO_DETECTION,[2,null];case 7:return[3,9];case 8:t.region_source=cs.ENVIRONMENT_VARIABLE,b.label=9;case 9:return a||(t.region_source=cs.FAILED_AUTO_DETECTION),[2,a||null]}})})},r.prototype.getRegionFromIMDS=function(e,t){var o;return le(this,void 0,void 0,function(){return ce(this,function(i){return(o=this.performanceClient)===null||o===void 0||o.addQueueMeasurement($.RegionDiscoveryGetRegionFromIMDS,this.correlationId),[2,this.networkInterface.sendGetRequestAsync(_.IMDS_ENDPOINT+"?api-version="+e+"&format=text",t,_.IMDS_TIMEOUT)]})})},r.prototype.getCurrentVersion=function(e){var t;return le(this,void 0,void 0,function(){var o;return ce(this,function(i){switch(i.label){case 0:(t=this.performanceClient)===null||t===void 0||t.addQueueMeasurement($.RegionDiscoveryGetCurrentVersion,this.correlationId),i.label=1;case 1:return i.trys.push([1,3,,4]),[4,this.networkInterface.sendGetRequestAsync(_.IMDS_ENDPOINT+"?format=json",e)];case 2:return o=i.sent(),o.status===gl.httpBadRequest&&o.body&&o.body["newest-versions"]&&o.body["newest-versions"].length>0?[2,o.body["newest-versions"][0]]:[2,null];case 3:return i.sent(),[2,null];case 4:return[2]}})})},r.IMDS_OPTIONS={headers:{Metadata:"true"}},r}();var fs=function(){function r(e,t,o,i,n,s,a){this.canonicalAuthority=e,this._canonicalAuthority.validateAsUri(),this.networkInterface=t,this.cacheManager=o,this.authorityOptions=i,this.regionDiscoveryMetadata={region_used:void 0,region_source:void 0,region_outcome:void 0},this.logger=n,this.performanceClient=s,this.correlationId=a,this.regionDiscovery=new T_(t,this.performanceClient,this.correlationId)}return r.prototype.getAuthorityType=function(e){if(e.HostNameAndPort.endsWith(_.CIAM_AUTH_URL))return br.Ciam;var t=e.PathSegments;if(t.length)switch(t[0].toLowerCase()){case _.ADFS:return br.Adfs;case _.DSTS:return br.Dsts}return br.Default},Object.defineProperty(r.prototype,"authorityType",{get:function(){return this.getAuthorityType(this.canonicalAuthorityUrlComponents)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"protocolMode",{get:function(){return this.authorityOptions.protocolMode},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"options",{get:function(){return this.authorityOptions},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"canonicalAuthority",{get:function(){return this._canonicalAuthority.urlString},set:function(e){this._canonicalAuthority=new Se(e),this._canonicalAuthority.validateAsUri(),this._canonicalAuthorityUrlComponents=null},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"canonicalAuthorityUrlComponents",{get:function(){return this._canonicalAuthorityUrlComponents||(this._canonicalAuthorityUrlComponents=this._canonicalAuthority.getUrlComponents()),this._canonicalAuthorityUrlComponents},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"hostnameAndPort",{get:function(){return this.canonicalAuthorityUrlComponents.HostNameAndPort.toLowerCase()},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"tenant",{get:function(){return this.canonicalAuthorityUrlComponents.PathSegments[0]},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"authorizationEndpoint",{get:function(){if(this.discoveryComplete())return this.replacePath(this.metadata.authorization_endpoint);throw U.createEndpointDiscoveryIncompleteError("Discovery incomplete.")},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"tokenEndpoint",{get:function(){if(this.discoveryComplete())return this.replacePath(this.metadata.token_endpoint);throw U.createEndpointDiscoveryIncompleteError("Discovery incomplete.")},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"deviceCodeEndpoint",{get:function(){if(this.discoveryComplete())return this.replacePath(this.metadata.token_endpoint.replace("/token","/devicecode"));throw U.createEndpointDiscoveryIncompleteError("Discovery incomplete.")},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"endSessionEndpoint",{get:function(){if(this.discoveryComplete()){if(!this.metadata.end_session_endpoint)throw U.createLogoutNotSupportedError();return this.replacePath(this.metadata.end_session_endpoint)}else throw U.createEndpointDiscoveryIncompleteError("Discovery incomplete.")},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"selfSignedJwtAudience",{get:function(){if(this.discoveryComplete())return this.replacePath(this.metadata.issuer);throw U.createEndpointDiscoveryIncompleteError("Discovery incomplete.")},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"jwksUri",{get:function(){if(this.discoveryComplete())return this.replacePath(this.metadata.jwks_uri);throw U.createEndpointDiscoveryIncompleteError("Discovery incomplete.")},enumerable:!1,configurable:!0}),r.prototype.canReplaceTenant=function(e){return e.PathSegments.length===1&&!r.reservedTenantDomains.has(e.PathSegments[0])&&this.getAuthorityType(e)===br.Default&&this.protocolMode===ps.AAD},r.prototype.replaceTenant=function(e){return e.replace(/{tenant}|{tenantid}/g,this.tenant)},r.prototype.replacePath=function(e){var t=this,o=e,i=new Se(this.metadata.canonical_authority),n=i.getUrlComponents(),s=n.PathSegments,a=this.canonicalAuthorityUrlComponents.PathSegments;return a.forEach(function(u,h){var p=s[h];if(h===0&&t.canReplaceTenant(n)){var f=new Se(t.metadata.authorization_endpoint).getUrlComponents().PathSegments[0];p!==f&&(t.logger.verbose("Replacing tenant domain name "+p+" with id "+f),p=f)}u!==p&&(o=o.replace("/"+p+"/","/"+u+"/"))}),this.replaceTenant(o)},Object.defineProperty(r.prototype,"defaultOpenIdConfigurationEndpoint",{get:function(){return this.authorityType===br.Adfs||this.authorityType===br.Dsts||this.protocolMode===ps.OIDC?this.canonicalAuthority+".well-known/openid-configuration":this.canonicalAuthority+"v2.0/.well-known/openid-configuration"},enumerable:!1,configurable:!0}),r.prototype.discoveryComplete=function(){return!!this.metadata},r.prototype.resolveEndpointsAsync=function(){var e,t,o;return le(this,void 0,void 0,function(){var i,n,s,a;return ce(this,function(u){switch(u.label){case 0:return(e=this.performanceClient)===null||e===void 0||e.addQueueMeasurement($.AuthorityResolveEndpointsAsync,this.correlationId),i=this.cacheManager.getAuthorityMetadataByAlias(this.hostnameAndPort),i||(i=new $c,i.updateCanonicalAuthority(this.canonicalAuthority)),(t=this.performanceClient)===null||t===void 0||t.setPreQueueTime($.AuthorityUpdateCloudDiscoveryMetadata,this.correlationId),[4,this.updateCloudDiscoveryMetadata(i)];case 1:return n=u.sent(),this.canonicalAuthority=this.canonicalAuthority.replace(this.hostnameAndPort,i.preferred_network),(o=this.performanceClient)===null||o===void 0||o.setPreQueueTime($.AuthorityUpdateEndpointMetadata,this.correlationId),[4,this.updateEndpointMetadata(i)];case 2:return s=u.sent(),n!==si.CACHE&&s!==si.CACHE&&(i.resetExpiresAt(),i.updateCanonicalAuthority(this.canonicalAuthority)),a=this.cacheManager.generateAuthorityMetadataCacheKey(i.preferred_cache),this.cacheManager.setAuthorityMetadata(a,i),this.metadata=i,[2]}})})},r.prototype.updateEndpointMetadata=function(e){var t,o,i,n,s,a;return le(this,void 0,void 0,function(){var u,h;return ce(this,function(p){switch(p.label){case 0:return(t=this.performanceClient)===null||t===void 0||t.addQueueMeasurement($.AuthorityUpdateEndpointMetadata,this.correlationId),u=this.getEndpointMetadataFromConfig(),u?(e.updateEndpointMetadata(u,!1),[2,si.CONFIG]):this.isAuthoritySameType(e)&&e.endpointsFromNetwork&&!e.isExpired()?[2,si.CACHE]:((o=this.performanceClient)===null||o===void 0||o.setPreQueueTime($.AuthorityGetEndpointMetadataFromNetwork,this.correlationId),[4,this.getEndpointMetadataFromNetwork()]);case 1:return u=p.sent(),u?!((i=this.authorityOptions.azureRegionConfiguration)===null||i===void 0)&&i.azureRegion?((n=this.performanceClient)===null||n===void 0||n.setPreQueueTime($.AuthorityUpdateMetadataWithRegionalInformation,this.correlationId),[4,this.updateMetadataWithRegionalInformation(u)]):[3,3]:[3,4];case 2:u=p.sent(),p.label=3;case 3:return e.updateEndpointMetadata(u,!0),[2,si.NETWORK];case 4:return h=this.getEndpointMetadataFromHardcodedValues(),h&&!this.authorityOptions.skipAuthorityMetadataCache?!((s=this.authorityOptions.azureRegionConfiguration)===null||s===void 0)&&s.azureRegion?((a=this.performanceClient)===null||a===void 0||a.setPreQueueTime($.AuthorityUpdateMetadataWithRegionalInformation,this.correlationId),[4,this.updateMetadataWithRegionalInformation(h)]):[3,6]:[3,7];case 5:h=p.sent(),p.label=6;case 6:return e.updateEndpointMetadata(h,!1),[2,si.HARDCODED_VALUES];case 7:throw U.createUnableToGetOpenidConfigError(this.defaultOpenIdConfigurationEndpoint)}})})},r.prototype.isAuthoritySameType=function(e){var t=new Se(e.canonical_authority),o=t.getUrlComponents().PathSegments;return o.length===this.canonicalAuthorityUrlComponents.PathSegments.length},r.prototype.getEndpointMetadataFromConfig=function(){if(this.authorityOptions.authorityMetadata)try{return JSON.parse(this.authorityOptions.authorityMetadata)}catch{throw je.createInvalidAuthorityMetadataError()}return null},r.prototype.getEndpointMetadataFromNetwork=function(){var e;return le(this,void 0,void 0,function(){var t,o;return ce(this,function(i){switch(i.label){case 0:(e=this.performanceClient)===null||e===void 0||e.addQueueMeasurement($.AuthorityGetEndpointMetadataFromNetwork,this.correlationId),t={},i.label=1;case 1:return i.trys.push([1,3,,4]),[4,this.networkInterface.sendGetRequestAsync(this.defaultOpenIdConfigurationEndpoint,t)];case 2:return o=i.sent(),[2,x_(o.body)?o.body:null];case 3:return i.sent(),[2,null];case 4:return[2]}})})},r.prototype.getEndpointMetadataFromHardcodedValues=function(){return this.canonicalAuthority in my?my[this.canonicalAuthority]:null},r.prototype.updateMetadataWithRegionalInformation=function(e){var t,o,i,n;return le(this,void 0,void 0,function(){var s,a;return ce(this,function(u){switch(u.label){case 0:return(t=this.performanceClient)===null||t===void 0||t.addQueueMeasurement($.AuthorityUpdateMetadataWithRegionalInformation,this.correlationId),s=(o=this.authorityOptions.azureRegionConfiguration)===null||o===void 0?void 0:o.azureRegion,s?s!==_.AZURE_REGION_AUTO_DISCOVER_FLAG?(this.regionDiscoveryMetadata.region_outcome=Ic.CONFIGURED_NO_AUTO_DETECTION,this.regionDiscoveryMetadata.region_used=s,[2,r.replaceWithRegionalInformation(e,s)]):((i=this.performanceClient)===null||i===void 0||i.setPreQueueTime($.RegionDiscoveryDetectRegion,this.correlationId),[4,this.regionDiscovery.detectRegion((n=this.authorityOptions.azureRegionConfiguration)===null||n===void 0?void 0:n.environmentRegion,this.regionDiscoveryMetadata)]):[3,2];case 1:if(a=u.sent(),a)return this.regionDiscoveryMetadata.region_outcome=Ic.AUTO_DETECTION_REQUESTED_SUCCESSFUL,this.regionDiscoveryMetadata.region_used=a,[2,r.replaceWithRegionalInformation(e,a)];this.regionDiscoveryMetadata.region_outcome=Ic.AUTO_DETECTION_REQUESTED_FAILED,u.label=2;case 2:return[2,e]}})})},r.prototype.updateCloudDiscoveryMetadata=function(e){var t,o;return le(this,void 0,void 0,function(){var i,n,s;return ce(this,function(a){switch(a.label){case 0:return(t=this.performanceClient)===null||t===void 0||t.addQueueMeasurement($.AuthorityUpdateCloudDiscoveryMetadata,this.correlationId),this.logger.verbose("Attempting to get cloud discovery metadata in the config"),this.logger.verbosePii("Known Authorities: "+(this.authorityOptions.knownAuthorities||_.NOT_APPLICABLE)),this.logger.verbosePii("Authority Metadata: "+(this.authorityOptions.authorityMetadata||_.NOT_APPLICABLE)),this.logger.verbosePii("Canonical Authority: "+(e.canonical_authority||_.NOT_APPLICABLE)),i=this.getCloudDiscoveryMetadataFromConfig(),i?(this.logger.verbose("Found cloud discovery metadata in the config."),e.updateCloudDiscoveryMetadata(i,!1),[2,si.CONFIG]):(this.logger.verbose("Did not find cloud discovery metadata in the config... Attempting to get cloud discovery metadata from the cache."),n=e.isExpired(),this.isAuthoritySameType(e)&&e.aliasesFromNetwork&&!n?(this.logger.verbose("Found metadata in the cache."),[2,si.CACHE]):(n&&this.logger.verbose("The metadata entity is expired."),this.logger.verbose("Did not find cloud discovery metadata in the cache... Attempting to get cloud discovery metadata from the network."),(o=this.performanceClient)===null||o===void 0||o.setPreQueueTime($.AuthorityGetCloudDiscoveryMetadataFromNetwork,this.correlationId),[4,this.getCloudDiscoveryMetadataFromNetwork()]));case 1:if(i=a.sent(),i)return this.logger.verbose("cloud discovery metadata was successfully returned from getCloudDiscoveryMetadataFromNetwork()"),e.updateCloudDiscoveryMetadata(i,!0),[2,si.NETWORK];if(this.logger.verbose("Did not find cloud discovery metadata from the network... Attempting to get cloud discovery metadata from hardcoded values."),s=this.getCloudDiscoveryMetadataFromHarcodedValues(),s&&!this.options.skipAuthorityMetadataCache)return this.logger.verbose("Found cloud discovery metadata from hardcoded values."),e.updateCloudDiscoveryMetadata(s,!1),[2,si.HARDCODED_VALUES];throw this.logger.error("Did not find cloud discovery metadata from hardcoded values... Metadata could not be obtained from config, cache, network or hardcoded values. Throwing Untrusted Authority Error."),je.createUntrustedAuthorityError()}})})},r.prototype.getCloudDiscoveryMetadataFromConfig=function(){if(this.authorityType===br.Ciam)return this.logger.verbose("CIAM authorities do not support cloud discovery metadata, generate the aliases from authority host."),r.createCloudDiscoveryMetadataFromHost(this.hostnameAndPort);if(this.authorityOptions.cloudDiscoveryMetadata){this.logger.verbose("The cloud discovery metadata has been provided as a network response, in the config.");try{this.logger.verbose("Attempting to parse the cloud discovery metadata.");var e=JSON.parse(this.authorityOptions.cloudDiscoveryMetadata),t=r.getCloudDiscoveryMetadataFromNetworkResponse(e.metadata,this.hostnameAndPort);if(this.logger.verbose("Parsed the cloud discovery metadata."),t)return this.logger.verbose("There is returnable metadata attached to the parsed cloud discovery metadata."),t;this.logger.verbose("There is no metadata attached to the parsed cloud discovery metadata.")}catch{throw this.logger.verbose("Unable to parse the cloud discovery metadata. Throwing Invalid Cloud Discovery Metadata Error."),je.createInvalidCloudDiscoveryMetadataError()}}return this.isInKnownAuthorities()?(this.logger.verbose("The host is included in knownAuthorities. Creating new cloud discovery metadata from the host."),r.createCloudDiscoveryMetadataFromHost(this.hostnameAndPort)):null},r.prototype.getCloudDiscoveryMetadataFromNetwork=function(){var e;return le(this,void 0,void 0,function(){var t,o,i,n,s,a,u,h;return ce(this,function(p){switch(p.label){case 0:(e=this.performanceClient)===null||e===void 0||e.addQueueMeasurement($.AuthorityGetCloudDiscoveryMetadataFromNetwork,this.correlationId),t=""+_.AAD_INSTANCE_DISCOVERY_ENDPT+this.canonicalAuthority+"oauth2/v2.0/authorize",o={},i=null,p.label=1;case 1:return p.trys.push([1,3,,4]),[4,this.networkInterface.sendGetRequestAsync(t,o)];case 2:if(n=p.sent(),s=void 0,a=void 0,S_(n.body))s=n.body,a=s.metadata,this.logger.verbosePii("tenant_discovery_endpoint is: "+s.tenant_discovery_endpoint);else if(__(n.body)){if(this.logger.warning("A CloudInstanceDiscoveryErrorResponse was returned. The cloud instance discovery network request's status code is: "+n.status),s=n.body,s.error===_.INVALID_INSTANCE)return this.logger.error("The CloudInstanceDiscoveryErrorResponse error is invalid_instance."),[2,null];this.logger.warning("The CloudInstanceDiscoveryErrorResponse error is "+s.error),this.logger.warning("The CloudInstanceDiscoveryErrorResponse error description is "+s.error_description),this.logger.warning("Setting the value of the CloudInstanceDiscoveryMetadata (returned from the network) to []"),a=[]}else return this.logger.error("AAD did not return a CloudInstanceDiscoveryResponse or CloudInstanceDiscoveryErrorResponse"),[2,null];return this.logger.verbose("Attempting to find a match between the developer's authority and the CloudInstanceDiscoveryMetadata returned from the network request."),i=r.getCloudDiscoveryMetadataFromNetworkResponse(a,this.hostnameAndPort),[3,4];case 3:return u=p.sent(),u instanceof ee?this.logger.error(`There was a network error while attempting to get the cloud discovery instance metadata. +`};function k7(){for(var r=arguments.length,e=new Array(r),t=0;t1?i-1:0),s=1;s=0&&i<1?(a=n,u=s):i>=1&&i<2?(a=s,u=n):i>=2&&i<3?(u=n,h=s):i>=3&&i<4?(u=s,h=n):i>=4&&i<5?(a=s,h=n):i>=5&&i<6&&(a=n,h=s);var p=t-n/2,f=a+p,b=u+p,C=h+p;return o(f,b,C)}var zx={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"00ffff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"0000ff",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"00ffff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"ff00ff",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"639",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"};function _7(r){if(typeof r!="string")return r;var e=r.toLowerCase();return zx[e]?"#"+zx[e]:r}var T7=/^#[a-fA-F0-9]{6}$/,E7=/^#[a-fA-F0-9]{8}$/,I7=/^#[a-fA-F0-9]{3}$/,A7=/^#[a-fA-F0-9]{4}$/,jv=/^rgb\(\s*(\d{1,3})\s*(?:,)?\s*(\d{1,3})\s*(?:,)?\s*(\d{1,3})\s*\)$/i,R7=/^rgb(?:a)?\(\s*(\d{1,3})\s*(?:,)?\s*(\d{1,3})\s*(?:,)?\s*(\d{1,3})\s*(?:,|\/)\s*([-+]?\d*[.]?\d+[%]?)\s*\)$/i,P7=/^hsl\(\s*(\d{0,3}[.]?[0-9]+(?:deg)?)\s*(?:,)?\s*(\d{1,3}[.]?[0-9]?)%\s*(?:,)?\s*(\d{1,3}[.]?[0-9]?)%\s*\)$/i,$7=/^hsl(?:a)?\(\s*(\d{0,3}[.]?[0-9]+(?:deg)?)\s*(?:,)?\s*(\d{1,3}[.]?[0-9]?)%\s*(?:,)?\s*(\d{1,3}[.]?[0-9]?)%\s*(?:,|\/)\s*([-+]?\d*[.]?\d+[%]?)\s*\)$/i;function pp(r){if(typeof r!="string")throw new yn(3);var e=_7(r);if(e.match(T7))return{red:parseInt(""+e[1]+e[2],16),green:parseInt(""+e[3]+e[4],16),blue:parseInt(""+e[5]+e[6],16)};if(e.match(E7)){var t=parseFloat((parseInt(""+e[7]+e[8],16)/255).toFixed(2));return{red:parseInt(""+e[1]+e[2],16),green:parseInt(""+e[3]+e[4],16),blue:parseInt(""+e[5]+e[6],16),alpha:t}}if(e.match(I7))return{red:parseInt(""+e[1]+e[1],16),green:parseInt(""+e[2]+e[2],16),blue:parseInt(""+e[3]+e[3],16)};if(e.match(A7)){var o=parseFloat((parseInt(""+e[4]+e[4],16)/255).toFixed(2));return{red:parseInt(""+e[1]+e[1],16),green:parseInt(""+e[2]+e[2],16),blue:parseInt(""+e[3]+e[3],16),alpha:o}}var i=jv.exec(e);if(i)return{red:parseInt(""+i[1],10),green:parseInt(""+i[2],10),blue:parseInt(""+i[3],10)};var n=R7.exec(e.substring(0,50));if(n)return{red:parseInt(""+n[1],10),green:parseInt(""+n[2],10),blue:parseInt(""+n[3],10),alpha:parseFloat(""+n[4])>1?parseFloat(""+n[4])/100:parseFloat(""+n[4])};var s=P7.exec(e);if(s){var a=parseInt(""+s[1],10),u=parseInt(""+s[2],10)/100,h=parseInt(""+s[3],10)/100,p="rgb("+zd(a,u,h)+")",f=jv.exec(p);if(!f)throw new yn(4,e,p);return{red:parseInt(""+f[1],10),green:parseInt(""+f[2],10),blue:parseInt(""+f[3],10)}}var b=$7.exec(e.substring(0,50));if(b){var C=parseInt(""+b[1],10),S=parseInt(""+b[2],10)/100,R=parseInt(""+b[3],10)/100,H="rgb("+zd(C,S,R)+")",ye=jv.exec(H);if(!ye)throw new yn(4,e,H);return{red:parseInt(""+ye[1],10),green:parseInt(""+ye[2],10),blue:parseInt(""+ye[3],10),alpha:parseFloat(""+b[4])>1?parseFloat(""+b[4])/100:parseFloat(""+b[4])}}throw new yn(5)}function O7(r){var e=r.red/255,t=r.green/255,o=r.blue/255,i=Math.max(e,t,o),n=Math.min(e,t,o),s=(i+n)/2;if(i===n)return r.alpha!==void 0?{hue:0,saturation:0,lightness:s,alpha:r.alpha}:{hue:0,saturation:0,lightness:s};var a,u=i-n,h=s>.5?u/(2-i-n):u/(i+n);switch(i){case e:a=(t-o)/u+(t=1?up(r,e,t):"rgba("+zd(r,e,t)+","+o+")";if(typeof r=="object"&&e===void 0&&t===void 0&&o===void 0)return r.alpha>=1?up(r.hue,r.saturation,r.lightness):"rgba("+zd(r.hue,r.saturation,r.lightness)+","+r.alpha+")";throw new yn(2)}function Xv(r,e,t){if(typeof r=="number"&&typeof e=="number"&&typeof t=="number")return Jv("#"+Ga(r)+Ga(e)+Ga(t));if(typeof r=="object"&&e===void 0&&t===void 0)return Jv("#"+Ga(r.red)+Ga(r.green)+Ga(r.blue));throw new yn(6)}function Vd(r,e,t,o){if(typeof r=="string"&&typeof e=="number"){var i=pp(r);return"rgba("+i.red+","+i.green+","+i.blue+","+e+")"}else{if(typeof r=="number"&&typeof e=="number"&&typeof t=="number"&&typeof o=="number")return o>=1?Xv(r,e,t):"rgba("+r+","+e+","+t+","+o+")";if(typeof r=="object"&&e===void 0&&t===void 0&&o===void 0)return r.alpha>=1?Xv(r.red,r.green,r.blue):"rgba("+r.red+","+r.green+","+r.blue+","+r.alpha+")"}throw new yn(7)}var N7=function(r){return typeof r.red=="number"&&typeof r.green=="number"&&typeof r.blue=="number"&&(typeof r.alpha!="number"||typeof r.alpha>"u")},H7=function(r){return typeof r.red=="number"&&typeof r.green=="number"&&typeof r.blue=="number"&&typeof r.alpha=="number"},U7=function(r){return typeof r.hue=="number"&&typeof r.saturation=="number"&&typeof r.lightness=="number"&&(typeof r.alpha!="number"||typeof r.alpha>"u")},B7=function(r){return typeof r.hue=="number"&&typeof r.saturation=="number"&&typeof r.lightness=="number"&&typeof r.alpha=="number"};function jx(r){if(typeof r!="object")throw new yn(8);if(H7(r))return Vd(r);if(N7(r))return Xv(r);if(B7(r))return L7(r);if(U7(r))return F7(r);throw new yn(8)}function Kx(r,e,t){return function(){var o=t.concat(Array.prototype.slice.call(arguments));return o.length>=e?r.apply(this,o):Kx(r,e,o)}}function fp(r){return Kx(r,r.length,[])}function mp(r,e,t){return Math.max(r,Math.min(e,t))}function z7(r,e){if(e==="transparent")return e;var t=Gx(e);return jx(uc({},t,{lightness:mp(0,1,t.lightness-parseFloat(r))}))}var V7=fp(z7),q7=V7;function G7(r,e){if(e==="transparent")return e;var t=Gx(e);return jx(uc({},t,{lightness:mp(0,1,t.lightness+parseFloat(r))}))}var j7=fp(G7),K7=j7;function W7(r,e){if(e==="transparent")return e;var t=pp(e),o=typeof t.alpha=="number"?t.alpha:1,i=uc({},t,{alpha:mp(0,1,(o*100+parseFloat(r)*100)/100)});return Vd(i)}var DL=fp(W7);function Q7(r,e){if(e==="transparent")return e;var t=pp(e),o=typeof t.alpha=="number"?t.alpha:1,i=uc({},t,{alpha:mp(0,1,+(o*100-parseFloat(r)*100).toFixed(2)/100)});return Vd(i)}var Y7=fp(Q7),Z7=Y7,Qt={primary:"#FF4785",secondary:"#029CFD",tertiary:"#FAFBFC",ancillary:"#22a699",orange:"#FC521F",gold:"#FFAE00",green:"#66BF3C",seafoam:"#37D5D3",purple:"#6F2CAC",ultraviolet:"#2A0481",lightest:"#FFFFFF",lighter:"#F7FAFC",light:"#EEF3F6",mediumlight:"#ECF4F9",medium:"#D9E8F2",mediumdark:"#73828C",dark:"#5C6870",darker:"#454E54",darkest:"#2E3438",border:"hsla(203, 50%, 30%, 0.15)",positive:"#66BF3C",negative:"#FF4400",warning:"#E69D00",critical:"#FFFFFF",defaultText:"#2E3438",inverseText:"#FFFFFF",positiveText:"#448028",negativeText:"#D43900",warningText:"#A15C20"},Vx={app:"#F6F9FC",bar:Qt.lightest,content:Qt.lightest,preview:Qt.lightest,gridCellSize:10,hoverable:Z7(.9,Qt.secondary),positive:"#E1FFD4",negative:"#FEDED2",warning:"#FFF5CF",critical:"#FF4400"},hp={fonts:{base:['"Nunito Sans"',"-apple-system",'".SFNSText-Regular"','"San Francisco"',"BlinkMacSystemFont",'"Segoe UI"','"Helvetica Neue"',"Helvetica","Arial","sans-serif"].join(", "),mono:["ui-monospace","Menlo","Monaco",'"Roboto Mono"','"Oxygen Mono"','"Ubuntu Monospace"','"Source Code Pro"','"Droid Sans Mono"','"Courier New"',"monospace"].join(", ")},weight:{regular:400,bold:700},size:{s1:12,s2:14,s3:16,m1:20,m2:24,m3:28,l1:32,l2:40,l3:48,code:90}},J7={base:"light",colorPrimary:"#FF4785",colorSecondary:"#029CFD",appBg:Vx.app,appContentBg:Qt.lightest,appPreviewBg:Qt.lightest,appBorderColor:Qt.border,appBorderRadius:4,fontBase:hp.fonts.base,fontCode:hp.fonts.mono,textColor:Qt.darkest,textInverseColor:Qt.lightest,textMutedColor:Qt.dark,barTextColor:Qt.mediumdark,barHoverColor:Qt.secondary,barSelectedColor:Qt.secondary,barBg:Qt.lightest,buttonBg:Vx.app,buttonBorder:Qt.medium,booleanBg:Qt.mediumlight,booleanSelectedBg:Qt.lightest,inputBg:Qt.lightest,inputBorder:Qt.border,inputTextColor:Qt.darkest,inputBorderRadius:4},qx=J7,X7={base:"dark",colorPrimary:"#FF4785",colorSecondary:"#029CFD",appBg:"#222425",appContentBg:"#1B1C1D",appPreviewBg:Qt.lightest,appBorderColor:"rgba(255,255,255,.1)",appBorderRadius:4,fontBase:hp.fonts.base,fontCode:hp.fonts.mono,textColor:"#C9CDCF",textInverseColor:"#222425",textMutedColor:"#798186",barTextColor:"#798186",barHoverColor:Qt.secondary,barSelectedColor:Qt.secondary,barBg:"#292C2E",buttonBg:"#222425",buttonBorder:"rgba(255,255,255,.1)",booleanBg:"#222425",booleanSelectedBg:"#2E3438",inputBg:"#1B1C1D",inputBorder:"rgba(255,255,255,.1)",inputTextColor:Qt.lightest,inputBorderRadius:4},eO=X7,{window:Wv}=Ux;var tO=r=>typeof r!="string"?(Bx.warn(`Color passed to theme object should be a string. Instead ${r}(${typeof r}) was passed.`),!1):!0,rO=r=>!/(gradient|var|calc)/.test(r),oO=(r,e)=>r==="darken"?Vd(`${q7(1,e)}`,.95):r==="lighten"?Vd(`${K7(1,e)}`,.95):e,Wx=r=>e=>{if(!tO(e)||!rO(e))return e;try{return oO(r,e)}catch{return e}},FL=Wx("lighten"),LL=Wx("darken"),iO=()=>!Wv||!Wv.matchMedia?"light":Wv.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light",dp={light:qx,dark:eO,normal:qx},Qv=iO(),e0=(r={base:Qv},e)=>{let t={...dp[Qv],...dp[r.base]||{},...r,base:dp[r.base]?r.base:Qv};return{...e,...t,barSelectedColor:r.barSelectedColor||t.colorSecondary}};var Qx=e0({base:"light",colorSecondary:"#0360B9",textColor:"#1A1A1A",textInverseColor:"rgba(255,255,255,0.9)",barTextColor:"#717171",brandTitle:"Microsoft Graph Toolkit Playground",brandUrl:"https://aka.ms/mgt"});l();c();d();var Tr=__REACT__,{Children:JL,Component:Yx,Fragment:XL,Profiler:eN,PureComponent:tN,StrictMode:rN,Suspense:oN,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:iN,cloneElement:nN,createContext:sN,createElement:aN,createFactory:lN,createRef:cN,forwardRef:dN,isValidElement:uN,lazy:hN,memo:pN,useCallback:fN,useContext:mN,useDebugValue:gN,useEffect:vN,useImperativeHandle:yN,useLayoutEffect:bN,useMemo:wN,useReducer:CN,useRef:xN,useState:Zx,version:kN}=__REACT__;l();c();d();var IN=__STORYBOOK_API__,{ActiveTabs:AN,Consumer:RN,ManagerContext:PN,Provider:$N,addons:ON,combineParameters:MN,controlOrMetaKey:DN,controlOrMetaSymbol:FN,eventMatchesShortcut:LN,eventToShortcut:NN,isMacLike:HN,isShortcutTaken:UN,keyToSymbol:BN,merge:zN,mockChannel:VN,optionOrAltSymbol:qN,shortcutMatchesShortcut:GN,shortcutToHumanString:jN,types:KN,useAddonState:WN,useArgTypes:QN,useArgs:YN,useChannel:Jx,useGlobalTypes:ZN,useGlobals:JN,useParameter:XN,useSharedState:eH,useStoryPrepared:tH,useStorybookApi:rH,useStorybookState:oH}=__STORYBOOK_API__;es();bn();l();c();d();ge();l();c();d();l();c();d();l();c();d();l();c();d();var ny=function(r,e){return ny=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,o){t.__proto__=o}||function(t,o){for(var i in o)Object.prototype.hasOwnProperty.call(o,i)&&(t[i]=o[i])},ny(r,e)};function mt(r,e){ny(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}var ae=function(){return ae=Object.assign||function(e){for(var t,o=1,i=arguments.length;o0&&n[n.length-1])&&(h[0]===6||h[0]===2)){t=0;continue}if(h[0]===3&&(!n||h[1]>n[0]&&h[1]0)&&!(i=o.next()).done;)n.push(i.value)}catch(a){s={error:a}}finally{try{i&&!i.done&&(t=o.return)&&t.call(o)}finally{if(s)throw s.error}}return n}function Tc(){for(var r=[],e=0;e0&&n[n.length-1])&&(h[0]===6||h[0]===2)){t=0;continue}if(h[0]===3&&(!n||h[1]>n[0]&&h[1]"u"||!e||e.length===0},r.isEmptyObj=function(e){if(e&&!r.isEmpty(e))try{var t=JSON.parse(e);return Object.keys(t).length===0}catch{}return!0},r.startsWith=function(e,t){return e.indexOf(t)===0},r.endsWith=function(e,t){return e.length>=t.length&&e.lastIndexOf(t)===e.length-t.length},r.queryStringToObject=function(e){var t={},o=e.split("&"),i=function(n){return decodeURIComponent(n.replace(/\+/g," "))};return o.forEach(function(n){if(n.trim()){var s=n.split(/=(.+)/g,2),a=s[0],u=s[1];a&&u&&(t[i(a)]=i(u))}}),t},r.trimArrayEntries=function(e){return e.map(function(t){return t.trim()})},r.removeEmptyStringsFromArray=function(e){return e.filter(function(t){return!r.isEmpty(t)})},r.jsonParseHelper=function(e){try{return JSON.parse(e)}catch{return null}},r.matchPattern=function(e,t){var o=new RegExp(e.replace(/\\/g,"\\\\").replace(/\*/g,"[^ ]*").replace(/\?/g,"\\?"));return o.test(t)},r}();var ir;(function(r){r[r.Error=0]="Error",r[r.Warning=1]="Warning",r[r.Info=2]="Info",r[r.Verbose=3]="Verbose",r[r.Trace=4]="Trace"})(ir||(ir={}));var _n=function(){function r(e,t,o){this.level=ir.Info;var i=function(){},n=e||r.createDefaultLoggerOptions();this.localCallback=n.loggerCallback||i,this.piiLoggingEnabled=n.piiLoggingEnabled||!1,this.level=typeof n.logLevel=="number"?n.logLevel:ir.Info,this.correlationId=n.correlationId||_.EMPTY_STRING,this.packageName=t||_.EMPTY_STRING,this.packageVersion=o||_.EMPTY_STRING}return r.createDefaultLoggerOptions=function(){return{loggerCallback:function(){},piiLoggingEnabled:!1,logLevel:ir.Info}},r.prototype.clone=function(e,t,o){return new r({loggerCallback:this.localCallback,piiLoggingEnabled:this.piiLoggingEnabled,logLevel:this.level,correlationId:o||this.correlationId},e,t)},r.prototype.logMessage=function(e,t){if(!(t.logLevel>this.level||!this.piiLoggingEnabled&&t.containsPii)){var o=new Date().toUTCString(),i;z.isEmpty(t.correlationId)?z.isEmpty(this.correlationId)?i="["+o+"]":i="["+o+"] : ["+this.correlationId+"]":i="["+o+"] : ["+t.correlationId+"]";var n=i+" : "+this.packageName+"@"+this.packageVersion+" : "+ir[t.logLevel]+" - "+e;this.executeCallback(t.logLevel,n,t.containsPii||!1)}},r.prototype.executeCallback=function(e,t,o){this.localCallback&&this.localCallback(e,t,o)},r.prototype.error=function(e,t){this.logMessage(e,{logLevel:ir.Error,containsPii:!1,correlationId:t||_.EMPTY_STRING})},r.prototype.errorPii=function(e,t){this.logMessage(e,{logLevel:ir.Error,containsPii:!0,correlationId:t||_.EMPTY_STRING})},r.prototype.warning=function(e,t){this.logMessage(e,{logLevel:ir.Warning,containsPii:!1,correlationId:t||_.EMPTY_STRING})},r.prototype.warningPii=function(e,t){this.logMessage(e,{logLevel:ir.Warning,containsPii:!0,correlationId:t||_.EMPTY_STRING})},r.prototype.info=function(e,t){this.logMessage(e,{logLevel:ir.Info,containsPii:!1,correlationId:t||_.EMPTY_STRING})},r.prototype.infoPii=function(e,t){this.logMessage(e,{logLevel:ir.Info,containsPii:!0,correlationId:t||_.EMPTY_STRING})},r.prototype.verbose=function(e,t){this.logMessage(e,{logLevel:ir.Verbose,containsPii:!1,correlationId:t||_.EMPTY_STRING})},r.prototype.verbosePii=function(e,t){this.logMessage(e,{logLevel:ir.Verbose,containsPii:!0,correlationId:t||_.EMPTY_STRING})},r.prototype.trace=function(e,t){this.logMessage(e,{logLevel:ir.Trace,containsPii:!1,correlationId:t||_.EMPTY_STRING})},r.prototype.tracePii=function(e,t){this.logMessage(e,{logLevel:ir.Trace,containsPii:!0,correlationId:t||_.EMPTY_STRING})},r.prototype.isPiiLoggingEnabled=function(){return this.piiLoggingEnabled||!1},r}();l();c();d();var Ef="@azure/msal-common",yl="13.3.1";l();c();d();var Tn;(function(r){r[r.None=0]="None",r.AzurePublic="https://login.microsoftonline.com",r.AzurePpe="https://login.windows-ppe.net",r.AzureChina="https://login.chinacloudapi.cn",r.AzureGermany="https://login.microsoftonline.de",r.AzureUsGovernment="https://login.microsoftonline.us"})(Tn||(Tn={}));l();c();d();l();c();d();l();c();d();var Ue={redirectUriNotSet:{code:"redirect_uri_empty",desc:"A redirect URI is required for all calls, and none has been set."},postLogoutUriNotSet:{code:"post_logout_uri_empty",desc:"A post logout redirect has not been set."},claimsRequestParsingError:{code:"claims_request_parsing_error",desc:"Could not parse the given claims request object."},authorityUriInsecure:{code:"authority_uri_insecure",desc:"Authority URIs must use https. Please see here for valid authority configuration options: https://docs.microsoft.com/en-us/azure/active-directory/develop/msal-js-initializing-client-applications#configuration-options"},urlParseError:{code:"url_parse_error",desc:"URL could not be parsed into appropriate segments."},urlEmptyError:{code:"empty_url_error",desc:"URL was empty or null."},emptyScopesError:{code:"empty_input_scopes_error",desc:"Scopes cannot be passed as null, undefined or empty array because they are required to obtain an access token."},nonArrayScopesError:{code:"nonarray_input_scopes_error",desc:"Scopes cannot be passed as non-array."},clientIdSingleScopeError:{code:"clientid_input_scopes_error",desc:"Client ID can only be provided as a single scope."},invalidPrompt:{code:"invalid_prompt_value",desc:"Supported prompt values are 'login', 'select_account', 'consent', 'create', 'none' and 'no_session'. Please see here for valid configuration options: https://azuread.github.io/microsoft-authentication-library-for-js/ref/modules/_azure_msal_common.html#commonauthorizationurlrequest"},invalidClaimsRequest:{code:"invalid_claims",desc:"Given claims parameter must be a stringified JSON object."},tokenRequestEmptyError:{code:"token_request_empty",desc:"Token request was empty and not found in cache."},logoutRequestEmptyError:{code:"logout_request_empty",desc:"The logout request was null or undefined."},invalidCodeChallengeMethod:{code:"invalid_code_challenge_method",desc:'code_challenge_method passed is invalid. Valid values are "plain" and "S256".'},invalidCodeChallengeParams:{code:"pkce_params_missing",desc:"Both params: code_challenge and code_challenge_method are to be passed if to be sent in the request"},invalidCloudDiscoveryMetadata:{code:"invalid_cloud_discovery_metadata",desc:"Invalid cloudDiscoveryMetadata provided. Must be a stringified JSON object containing tenant_discovery_endpoint and metadata fields"},invalidAuthorityMetadata:{code:"invalid_authority_metadata",desc:"Invalid authorityMetadata provided. Must by a stringified JSON object containing authorization_endpoint, token_endpoint, issuer fields."},untrustedAuthority:{code:"untrusted_authority",desc:"The provided authority is not a trusted authority. Please include this authority in the knownAuthorities config parameter."},invalidAzureCloudInstance:{code:"invalid_azure_cloud_instance",desc:"Invalid AzureCloudInstance provided. Please refer MSAL JS docs: aks.ms/msaljs/azure_cloud_instance for valid values"},missingSshJwk:{code:"missing_ssh_jwk",desc:"Missing sshJwk in SSH certificate request. A stringified JSON Web Key is required when using the SSH authentication scheme."},missingSshKid:{code:"missing_ssh_kid",desc:"Missing sshKid in SSH certificate request. A string that uniquely identifies the public SSH key is required when using the SSH authentication scheme."},missingNonceAuthenticationHeader:{code:"missing_nonce_authentication_header",desc:"Unable to find an authentication header containing server nonce. Either the Authentication-Info or WWW-Authenticate headers must be present in order to obtain a server nonce."},invalidAuthenticationHeader:{code:"invalid_authentication_header",desc:"Invalid authentication header provided"},authorityMismatch:{code:"authority_mismatch",desc:"Authority mismatch error. Authority provided in login request or PublicClientApplication config does not match the environment of the provided account. Please use a matching account or make an interactive request to login to this authority."}},je=function(r){nt(e,r);function e(t,o){var i=r.call(this,t,o)||this;return i.name="ClientConfigurationError",Object.setPrototypeOf(i,e.prototype),i}return e.createRedirectUriEmptyError=function(){return new e(Ue.redirectUriNotSet.code,Ue.redirectUriNotSet.desc)},e.createPostLogoutRedirectUriEmptyError=function(){return new e(Ue.postLogoutUriNotSet.code,Ue.postLogoutUriNotSet.desc)},e.createClaimsRequestParsingError=function(t){return new e(Ue.claimsRequestParsingError.code,Ue.claimsRequestParsingError.desc+" Given value: "+t)},e.createInsecureAuthorityUriError=function(t){return new e(Ue.authorityUriInsecure.code,Ue.authorityUriInsecure.desc+" Given URI: "+t)},e.createUrlParseError=function(t){return new e(Ue.urlParseError.code,Ue.urlParseError.desc+" Given Error: "+t)},e.createUrlEmptyError=function(){return new e(Ue.urlEmptyError.code,Ue.urlEmptyError.desc)},e.createEmptyScopesArrayError=function(){return new e(Ue.emptyScopesError.code,""+Ue.emptyScopesError.desc)},e.createClientIdSingleScopeError=function(t){return new e(Ue.clientIdSingleScopeError.code,Ue.clientIdSingleScopeError.desc+" Given Scopes: "+t)},e.createInvalidPromptError=function(t){return new e(Ue.invalidPrompt.code,Ue.invalidPrompt.desc+" Given value: "+t)},e.createInvalidClaimsRequestError=function(){return new e(Ue.invalidClaimsRequest.code,Ue.invalidClaimsRequest.desc)},e.createEmptyLogoutRequestError=function(){return new e(Ue.logoutRequestEmptyError.code,Ue.logoutRequestEmptyError.desc)},e.createEmptyTokenRequestError=function(){return new e(Ue.tokenRequestEmptyError.code,Ue.tokenRequestEmptyError.desc)},e.createInvalidCodeChallengeMethodError=function(){return new e(Ue.invalidCodeChallengeMethod.code,Ue.invalidCodeChallengeMethod.desc)},e.createInvalidCodeChallengeParamsError=function(){return new e(Ue.invalidCodeChallengeParams.code,Ue.invalidCodeChallengeParams.desc)},e.createInvalidCloudDiscoveryMetadataError=function(){return new e(Ue.invalidCloudDiscoveryMetadata.code,Ue.invalidCloudDiscoveryMetadata.desc)},e.createInvalidAuthorityMetadataError=function(){return new e(Ue.invalidAuthorityMetadata.code,Ue.invalidAuthorityMetadata.desc)},e.createUntrustedAuthorityError=function(){return new e(Ue.untrustedAuthority.code,Ue.untrustedAuthority.desc)},e.createInvalidAzureCloudInstanceError=function(){return new e(Ue.invalidAzureCloudInstance.code,Ue.invalidAzureCloudInstance.desc)},e.createMissingSshJwkError=function(){return new e(Ue.missingSshJwk.code,Ue.missingSshJwk.desc)},e.createMissingSshKidError=function(){return new e(Ue.missingSshKid.code,Ue.missingSshKid.desc)},e.createMissingNonceAuthenticationHeadersError=function(){return new e(Ue.missingNonceAuthenticationHeader.code,Ue.missingNonceAuthenticationHeader.desc)},e.createInvalidAuthenticationHeaderError=function(t,o){return new e(Ue.invalidAuthenticationHeader.code,Ue.invalidAuthenticationHeader.desc+". Invalid header: "+t+". Details: "+o)},e.createAuthorityMismatchError=function(){return new e(Ue.authorityMismatch.code,Ue.authorityMismatch.desc)},e}(U);var It=function(){function r(e){var t=this,o=e?z.trimArrayEntries(Js(e)):[],i=o?z.removeEmptyStringsFromArray(o):[];this.validateInputScopes(i),this.scopes=new Set,i.forEach(function(n){return t.scopes.add(n)})}return r.fromString=function(e){var t=e||_.EMPTY_STRING,o=t.split(" ");return new r(o)},r.createSearchScopes=function(e){var t=new r(e);return t.containsOnlyOIDCScopes()?t.removeScope(_.OFFLINE_ACCESS_SCOPE):t.removeOIDCScopes(),t},r.prototype.validateInputScopes=function(e){if(!e||e.length<1)throw je.createEmptyScopesArrayError()},r.prototype.containsScope=function(e){var t=this.printScopesLowerCase().split(" "),o=new r(t);return z.isEmpty(e)?!1:o.scopes.has(e.toLowerCase())},r.prototype.containsScopeSet=function(e){var t=this;return!e||e.scopes.size<=0?!1:this.scopes.size>=e.scopes.size&&e.asArray().every(function(o){return t.containsScope(o)})},r.prototype.containsOnlyOIDCScopes=function(){var e=this,t=0;return ly.forEach(function(o){e.containsScope(o)&&(t+=1)}),this.scopes.size===t},r.prototype.appendScope=function(e){z.isEmpty(e)||this.scopes.add(e.trim())},r.prototype.appendScopes=function(e){var t=this;try{e.forEach(function(o){return t.appendScope(o)})}catch(o){throw U.createAppendScopeSetError(o)}},r.prototype.removeScope=function(e){if(z.isEmpty(e))throw U.createRemoveEmptyScopeFromSetError(e);this.scopes.delete(e.trim())},r.prototype.removeOIDCScopes=function(){var e=this;ly.forEach(function(t){e.scopes.delete(t)})},r.prototype.unionScopeSets=function(e){if(!e)throw U.createEmptyInputScopeSetError();var t=new Set;return e.scopes.forEach(function(o){return t.add(o.toLowerCase())}),this.scopes.forEach(function(o){return t.add(o.toLowerCase())}),t},r.prototype.intersectingScopeSets=function(e){if(!e)throw U.createEmptyInputScopeSetError();e.containsOnlyOIDCScopes()||e.removeOIDCScopes();var t=this.unionScopeSets(e),o=e.getScopeCount(),i=this.getScopeCount(),n=t.size;return ne+t)throw U.createMaxAgeTranspiredError()},r}();var Xr=function(){function r(e,t,o){this.clientId=e,this.cryptoImpl=t,this.commonLogger=o.clone(Ef,yl)}return r.prototype.getAllAccounts=function(){var e=this,t=this.getAccountKeys();if(t.length<1)return[];var o=t.reduce(function(n,s){var a=e.getAccount(s);return a&&n.push(a),n},[]);if(o.length<1)return[];var i=o.map(function(n){return e.getAccountInfoFromEntity(n)});return i},r.prototype.getAccountInfoFilteredBy=function(e){var t=this.getAccountsFilteredBy(e);return t.length>0?this.getAccountInfoFromEntity(t[0]):null},r.prototype.getAccountInfoFromEntity=function(e){var t=e.getAccountInfo(),o=this.getIdToken(t);return o&&(t.idToken=o.secret,t.idTokenClaims=new fr(o.secret,this.cryptoImpl).claims),t},r.prototype.saveCacheRecord=function(e){return le(this,void 0,void 0,function(){return ce(this,function(t){switch(t.label){case 0:if(!e)throw U.createNullOrUndefinedCacheRecord();return e.account&&this.setAccount(e.account),e.idToken&&this.setIdTokenCredential(e.idToken),e.accessToken?[4,this.saveAccessToken(e.accessToken)]:[3,2];case 1:t.sent(),t.label=2;case 2:return e.refreshToken&&this.setRefreshTokenCredential(e.refreshToken),e.appMetadata&&this.setAppMetadata(e.appMetadata),[2]}})})},r.prototype.saveAccessToken=function(e){return le(this,void 0,void 0,function(){var t,o,i,n,s=this;return ce(this,function(a){switch(a.label){case 0:return t={clientId:e.clientId,credentialType:e.credentialType,environment:e.environment,homeAccountId:e.homeAccountId,realm:e.realm,tokenType:e.tokenType,requestedClaimsHash:e.requestedClaimsHash},o=this.getTokenKeys(),i=It.fromString(e.target),n=[],o.accessToken.forEach(function(u){if(s.accessTokenKeyMatchesFilter(u,t,!1)){var h=s.getAccessTokenCredential(u);if(h&&s.credentialMatchesFilter(h,t)){var p=It.fromString(h.target);p.intersectingScopeSets(i)&&n.push(s.removeAccessToken(u))}}}),[4,Promise.all(n)];case 1:return a.sent(),this.setAccessTokenCredential(e),[2]}})})},r.prototype.getAccountsFilteredBy=function(e){var t=this,o=this.getAccountKeys(),i=[];return o.forEach(function(n){if(t.isAccountKey(n,e.homeAccountId,e.realm)){var s=t.getAccount(n);s&&(e.homeAccountId&&!t.matchHomeAccountId(s,e.homeAccountId)||e.localAccountId&&!t.matchLocalAccountId(s,e.localAccountId)||e.username&&!t.matchUsername(s,e.username)||e.environment&&!t.matchEnvironment(s,e.environment)||e.realm&&!t.matchRealm(s,e.realm)||e.nativeAccountId&&!t.matchNativeAccountId(s,e.nativeAccountId)||i.push(s))}}),i},r.prototype.isAccountKey=function(e,t,o){return!(e.split(Lt.CACHE_KEY_SEPARATOR).length<3||t&&!e.toLowerCase().includes(t.toLowerCase())||o&&!e.toLowerCase().includes(o.toLowerCase()))},r.prototype.isCredentialKey=function(e){if(e.split(Lt.CACHE_KEY_SEPARATOR).length<6)return!1;var t=e.toLowerCase();if(t.indexOf(ue.ID_TOKEN.toLowerCase())===-1&&t.indexOf(ue.ACCESS_TOKEN.toLowerCase())===-1&&t.indexOf(ue.ACCESS_TOKEN_WITH_AUTH_SCHEME.toLowerCase())===-1&&t.indexOf(ue.REFRESH_TOKEN.toLowerCase())===-1)return!1;if(t.indexOf(ue.REFRESH_TOKEN.toLowerCase())>-1){var o=""+ue.REFRESH_TOKEN+Lt.CACHE_KEY_SEPARATOR+this.clientId+Lt.CACHE_KEY_SEPARATOR,i=""+ue.REFRESH_TOKEN+Lt.CACHE_KEY_SEPARATOR+ea+Lt.CACHE_KEY_SEPARATOR;if(t.indexOf(o.toLowerCase())===-1&&t.indexOf(i.toLowerCase())===-1)return!1}else if(t.indexOf(this.clientId.toLowerCase())===-1)return!1;return!0},r.prototype.credentialMatchesFilter=function(e,t){return!(t.clientId&&!this.matchClientId(e,t.clientId)||t.userAssertionHash&&!this.matchUserAssertionHash(e,t.userAssertionHash)||typeof t.homeAccountId=="string"&&!this.matchHomeAccountId(e,t.homeAccountId)||t.environment&&!this.matchEnvironment(e,t.environment)||t.realm&&!this.matchRealm(e,t.realm)||t.credentialType&&!this.matchCredentialType(e,t.credentialType)||t.familyId&&!this.matchFamilyId(e,t.familyId)||t.target&&!this.matchTarget(e,t.target)||(t.requestedClaimsHash||e.requestedClaimsHash)&&e.requestedClaimsHash!==t.requestedClaimsHash||e.credentialType===ue.ACCESS_TOKEN_WITH_AUTH_SCHEME&&(t.tokenType&&!this.matchTokenType(e,t.tokenType)||t.tokenType===Be.SSH&&t.keyId&&!this.matchKeyId(e,t.keyId)))},r.prototype.getAppMetadataFilteredBy=function(e){return this.getAppMetadataFilteredByInternal(e.environment,e.clientId)},r.prototype.getAppMetadataFilteredByInternal=function(e,t){var o=this,i=this.getKeys(),n={};return i.forEach(function(s){if(o.isAppMetadata(s)){var a=o.getAppMetadata(s);a&&(e&&!o.matchEnvironment(a,e)||t&&!o.matchClientId(a,t)||(n[s]=a))}}),n},r.prototype.getAuthorityMetadataByAlias=function(e){var t=this,o=this.getAuthorityMetadataKeys(),i=null;return o.forEach(function(n){if(!(!t.isAuthorityMetadata(n)||n.indexOf(t.clientId)===-1)){var s=t.getAuthorityMetadata(n);s&&s.aliases.indexOf(e)!==-1&&(i=s)}}),i},r.prototype.removeAllAccounts=function(){return le(this,void 0,void 0,function(){var e,t,o=this;return ce(this,function(i){switch(i.label){case 0:return e=this.getAccountKeys(),t=[],e.forEach(function(n){t.push(o.removeAccount(n))}),[4,Promise.all(t)];case 1:return i.sent(),[2]}})})},r.prototype.removeAccount=function(e){return le(this,void 0,void 0,function(){var t;return ce(this,function(o){switch(o.label){case 0:if(t=this.getAccount(e),!t)throw U.createNoAccountFoundError();return[4,this.removeAccountContext(t)];case 1:return o.sent(),this.removeItem(e),[2]}})})},r.prototype.removeAccountContext=function(e){return le(this,void 0,void 0,function(){var t,o,i,n=this;return ce(this,function(s){switch(s.label){case 0:return t=this.getTokenKeys(),o=e.generateAccountId(),i=[],t.idToken.forEach(function(a){a.indexOf(o)===0&&n.removeIdToken(a)}),t.accessToken.forEach(function(a){a.indexOf(o)===0&&i.push(n.removeAccessToken(a))}),t.refreshToken.forEach(function(a){a.indexOf(o)===0&&n.removeRefreshToken(a)}),[4,Promise.all(i)];case 1:return s.sent(),[2]}})})},r.prototype.removeAccessToken=function(e){return le(this,void 0,void 0,function(){var t,o,i;return ce(this,function(n){switch(n.label){case 0:if(t=this.getAccessTokenCredential(e),!t)return[2];if(t.credentialType.toLowerCase()!==ue.ACCESS_TOKEN_WITH_AUTH_SCHEME.toLowerCase())return[3,4];if(t.tokenType!==Be.POP)return[3,4];if(o=t,i=o.keyId,!i)return[3,4];n.label=1;case 1:return n.trys.push([1,3,,4]),[4,this.cryptoImpl.removeTokenBindingKey(i)];case 2:return n.sent(),[3,4];case 3:throw n.sent(),U.createBindingKeyNotRemovedError();case 4:return[2,this.removeItem(e)]}})})},r.prototype.removeAppMetadata=function(){var e=this,t=this.getKeys();return t.forEach(function(o){e.isAppMetadata(o)&&e.removeItem(o)}),!0},r.prototype.readCacheRecord=function(e,t,o){var i=this.getTokenKeys(),n=this.readAccountFromCache(e),s=this.getIdToken(e,i),a=this.getAccessToken(e,t,i),u=this.getRefreshToken(e,!1,i),h=this.readAppMetadataFromCache(o);return n&&s&&(n.idTokenClaims=new fr(s.secret,this.cryptoImpl).claims),{account:n,idToken:s,accessToken:a,refreshToken:u,appMetadata:h}},r.prototype.readAccountFromCache=function(e){var t=Nt.generateAccountCacheKey(e);return this.getAccount(t)},r.prototype.getIdToken=function(e,t){var o=this;this.commonLogger.trace("CacheManager - getIdToken called");var i={homeAccountId:e.homeAccountId,environment:e.environment,credentialType:ue.ID_TOKEN,clientId:this.clientId,realm:e.tenantId},n=this.getIdTokensByFilter(i,t),s=n.length;return s<1?(this.commonLogger.info("CacheManager:getIdToken - No token found"),null):s>1?(this.commonLogger.info("CacheManager:getIdToken - Multiple id tokens found, clearing them"),n.forEach(function(a){o.removeIdToken(a.generateCredentialKey())}),null):(this.commonLogger.info("CacheManager:getIdToken - Returning id token"),n[0])},r.prototype.getIdTokensByFilter=function(e,t){var o=this,i=t&&t.idToken||this.getTokenKeys().idToken,n=[];return i.forEach(function(s){if(o.idTokenKeyMatchesFilter(s,rt({clientId:o.clientId},e))){var a=o.getIdTokenCredential(s);a&&o.credentialMatchesFilter(a,e)&&n.push(a)}}),n},r.prototype.idTokenKeyMatchesFilter=function(e,t){var o=e.toLowerCase();return!(t.clientId&&o.indexOf(t.clientId.toLowerCase())===-1||t.homeAccountId&&o.indexOf(t.homeAccountId.toLowerCase())===-1)},r.prototype.removeIdToken=function(e){this.removeItem(e)},r.prototype.removeRefreshToken=function(e){this.removeItem(e)},r.prototype.getAccessToken=function(e,t,o){var i=this;this.commonLogger.trace("CacheManager - getAccessToken called");var n=It.createSearchScopes(t.scopes),s=t.authenticationScheme||Be.BEARER,a=s&&s.toLowerCase()!==Be.BEARER.toLowerCase()?ue.ACCESS_TOKEN_WITH_AUTH_SCHEME:ue.ACCESS_TOKEN,u={homeAccountId:e.homeAccountId,environment:e.environment,credentialType:a,clientId:this.clientId,realm:e.tenantId,target:n,tokenType:s,keyId:t.sshKid,requestedClaimsHash:t.requestedClaimsHash},h=o&&o.accessToken||this.getTokenKeys().accessToken,p=[];h.forEach(function(b){if(i.accessTokenKeyMatchesFilter(b,u,!0)){var C=i.getAccessTokenCredential(b);C&&i.credentialMatchesFilter(C,u)&&p.push(C)}});var f=p.length;return f<1?(this.commonLogger.info("CacheManager:getAccessToken - No token found"),null):f>1?(this.commonLogger.info("CacheManager:getAccessToken - Multiple access tokens found, clearing them"),p.forEach(function(b){i.removeAccessToken(b.generateCredentialKey())}),null):(this.commonLogger.info("CacheManager:getAccessToken - Returning access token"),p[0])},r.prototype.accessTokenKeyMatchesFilter=function(e,t,o){var i=e.toLowerCase();if(t.clientId&&i.indexOf(t.clientId.toLowerCase())===-1||t.homeAccountId&&i.indexOf(t.homeAccountId.toLowerCase())===-1||t.realm&&i.indexOf(t.realm.toLowerCase())===-1||t.requestedClaimsHash&&i.indexOf(t.requestedClaimsHash.toLowerCase())===-1)return!1;if(t.target)for(var n=t.target.asArray(),s=0;s1)throw U.createMultipleMatchingAppMetadataInCacheError();return i[0]},r.prototype.isAppMetadataFOCI=function(e){var t=this.readAppMetadataFromCache(e);return!!(t&&t.familyId===ea)},r.prototype.matchHomeAccountId=function(e,t){return typeof e.homeAccountId=="string"&&t===e.homeAccountId},r.prototype.matchLocalAccountId=function(e,t){return typeof e.localAccountId=="string"&&t===e.localAccountId},r.prototype.matchUsername=function(e,t){return typeof e.username=="string"&&t.toLowerCase()===e.username.toLowerCase()},r.prototype.matchUserAssertionHash=function(e,t){return!!(e.userAssertionHash&&t===e.userAssertionHash)},r.prototype.matchEnvironment=function(e,t){var o=this.getAuthorityMetadataByAlias(t);return!!(o&&o.aliases.indexOf(e.environment)>-1)},r.prototype.matchCredentialType=function(e,t){return e.credentialType&&t.toLowerCase()===e.credentialType.toLowerCase()},r.prototype.matchClientId=function(e,t){return!!(e.clientId&&t===e.clientId)},r.prototype.matchFamilyId=function(e,t){return!!(e.familyId&&t===e.familyId)},r.prototype.matchRealm=function(e,t){return!!(e.realm&&t===e.realm)},r.prototype.matchNativeAccountId=function(e,t){return!!(e.nativeAccountId&&t===e.nativeAccountId)},r.prototype.matchTarget=function(e,t){var o=e.credentialType!==ue.ACCESS_TOKEN&&e.credentialType!==ue.ACCESS_TOKEN_WITH_AUTH_SCHEME;if(o||!e.target)return!1;var i=It.fromString(e.target);return i.containsScopeSet(t)},r.prototype.matchTokenType=function(e,t){return!!(e.tokenType&&e.tokenType===t)},r.prototype.matchKeyId=function(e,t){return!!(e.keyId&&e.keyId===t)},r.prototype.isAppMetadata=function(e){return e.indexOf(_u)!==-1},r.prototype.isAuthorityMetadata=function(e){return e.indexOf(vl.CACHE_KEY)!==-1},r.prototype.generateAuthorityMetadataCacheKey=function(e){return vl.CACHE_KEY+"-"+this.clientId+"-"+e},r.toObject=function(e,t){for(var o in t)e[o]=t[o];return e},r}(),cy=function(r){nt(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.setAccount=function(){var t="Storage interface - setAccount() has not been implemented for the cacheStorage interface.";throw ee.createUnexpectedError(t)},e.prototype.getAccount=function(){var t="Storage interface - getAccount() has not been implemented for the cacheStorage interface.";throw ee.createUnexpectedError(t)},e.prototype.setIdTokenCredential=function(){var t="Storage interface - setIdTokenCredential() has not been implemented for the cacheStorage interface.";throw ee.createUnexpectedError(t)},e.prototype.getIdTokenCredential=function(){var t="Storage interface - getIdTokenCredential() has not been implemented for the cacheStorage interface.";throw ee.createUnexpectedError(t)},e.prototype.setAccessTokenCredential=function(){var t="Storage interface - setAccessTokenCredential() has not been implemented for the cacheStorage interface.";throw ee.createUnexpectedError(t)},e.prototype.getAccessTokenCredential=function(){var t="Storage interface - getAccessTokenCredential() has not been implemented for the cacheStorage interface.";throw ee.createUnexpectedError(t)},e.prototype.setRefreshTokenCredential=function(){var t="Storage interface - setRefreshTokenCredential() has not been implemented for the cacheStorage interface.";throw ee.createUnexpectedError(t)},e.prototype.getRefreshTokenCredential=function(){var t="Storage interface - getRefreshTokenCredential() has not been implemented for the cacheStorage interface.";throw ee.createUnexpectedError(t)},e.prototype.setAppMetadata=function(){var t="Storage interface - setAppMetadata() has not been implemented for the cacheStorage interface.";throw ee.createUnexpectedError(t)},e.prototype.getAppMetadata=function(){var t="Storage interface - getAppMetadata() has not been implemented for the cacheStorage interface.";throw ee.createUnexpectedError(t)},e.prototype.setServerTelemetry=function(){var t="Storage interface - setServerTelemetry() has not been implemented for the cacheStorage interface.";throw ee.createUnexpectedError(t)},e.prototype.getServerTelemetry=function(){var t="Storage interface - getServerTelemetry() has not been implemented for the cacheStorage interface.";throw ee.createUnexpectedError(t)},e.prototype.setAuthorityMetadata=function(){var t="Storage interface - setAuthorityMetadata() has not been implemented for the cacheStorage interface.";throw ee.createUnexpectedError(t)},e.prototype.getAuthorityMetadata=function(){var t="Storage interface - getAuthorityMetadata() has not been implemented for the cacheStorage interface.";throw ee.createUnexpectedError(t)},e.prototype.getAuthorityMetadataKeys=function(){var t="Storage interface - getAuthorityMetadataKeys() has not been implemented for the cacheStorage interface.";throw ee.createUnexpectedError(t)},e.prototype.setThrottlingCache=function(){var t="Storage interface - setThrottlingCache() has not been implemented for the cacheStorage interface.";throw ee.createUnexpectedError(t)},e.prototype.getThrottlingCache=function(){var t="Storage interface - getThrottlingCache() has not been implemented for the cacheStorage interface.";throw ee.createUnexpectedError(t)},e.prototype.removeItem=function(){var t="Storage interface - removeItem() has not been implemented for the cacheStorage interface.";throw ee.createUnexpectedError(t)},e.prototype.containsKey=function(){var t="Storage interface - containsKey() has not been implemented for the cacheStorage interface.";throw ee.createUnexpectedError(t)},e.prototype.getKeys=function(){var t="Storage interface - getKeys() has not been implemented for the cacheStorage interface.";throw ee.createUnexpectedError(t)},e.prototype.getAccountKeys=function(){var t="Storage interface - getAccountKeys() has not been implemented for the cacheStorage interface.";throw ee.createUnexpectedError(t)},e.prototype.getTokenKeys=function(){var t="Storage interface - getTokenKeys() has not been implemented for the cacheStorage interface.";throw ee.createUnexpectedError(t)},e.prototype.clear=function(){return le(this,void 0,void 0,function(){var t;return ce(this,function(o){throw t="Storage interface - clear() has not been implemented for the cacheStorage interface.",ee.createUnexpectedError(t)})})},e.prototype.updateCredentialCacheKey=function(){var t="Storage interface - updateCredentialCacheKey() has not been implemented for the cacheStorage interface.";throw ee.createUnexpectedError(t)},e}(Xr);var l9=300,If={tokenRenewalOffsetSeconds:l9,preventCorsPreflight:!1},c9={loggerCallback:function(){},piiLoggingEnabled:!1,logLevel:ir.Info,correlationId:_.EMPTY_STRING},d9={claimsBasedCachingEnabled:!0},u9={sendGetRequestAsync:function(){return le(this,void 0,void 0,function(){var r;return ce(this,function(e){throw r="Network interface - sendGetRequestAsync() has not been implemented",ee.createUnexpectedError(r)})})},sendPostRequestAsync:function(){return le(this,void 0,void 0,function(){var r;return ce(this,function(e){throw r="Network interface - sendPostRequestAsync() has not been implemented",ee.createUnexpectedError(r)})})}},h9={sku:_.SKU,version:yl,cpu:_.EMPTY_STRING,os:_.EMPTY_STRING},p9={clientSecret:_.EMPTY_STRING,clientAssertion:void 0},f9={azureCloudInstance:Tn.None,tenant:""+_.DEFAULT_COMMON_TENANT},m9={application:{appName:"",appVersion:""}};function w_(r){var e=r.authOptions,t=r.systemOptions,o=r.loggerOptions,i=r.cacheOptions,n=r.storageInterface,s=r.networkInterface,a=r.cryptoInterface,u=r.clientCredentials,h=r.libraryInfo,p=r.telemetry,f=r.serverTelemetryManager,b=r.persistencePlugin,C=r.serializableCache,S=rt(rt({},c9),o);return{authOptions:g9(e),systemOptions:rt(rt({},If),t),loggerOptions:S,cacheOptions:rt(rt({},d9),i),storageInterface:n||new cy(e.clientId,ta,new _n(S)),networkInterface:s||u9,cryptoInterface:a||ta,clientCredentials:u||p9,libraryInfo:rt(rt({},h9),h),telemetry:rt(rt({},m9),p),serverTelemetryManager:f||null,persistencePlugin:b||null,serializableCache:C||null}}function g9(r){return rt({clientCapabilities:[],azureCloudOptions:f9,skipAuthorityMetadataCache:!1},r)}l();c();d();l();c();d();l();c();d();var eo=function(r){nt(e,r);function e(t,o,i){var n=r.call(this,t,o,i)||this;return n.name="ServerError",Object.setPrototypeOf(n,e.prototype),n}return e}(ee);var oa=function(){function r(){}return r.generateThrottlingStorageKey=function(e){return ds.THROTTLING_PREFIX+"."+JSON.stringify(e)},r.preProcess=function(e,t){var o,i=r.generateThrottlingStorageKey(t),n=e.getThrottlingCache(i);if(n){if(n.throttleTime=500&&e.status<600},r.checkResponseForRetryAfter=function(e){return e.headers?e.headers.hasOwnProperty(Ft.RETRY_AFTER)&&(e.status<200||e.status>=300):!1},r.calculateThrottleTime=function(e){var t=e<=0?0:e,o=Date.now()/1e3;return Math.floor(Math.min(o+(t||ds.DEFAULT_THROTTLE_TIME_SECONDS),o+ds.DEFAULT_MAX_THROTTLE_TIME_SECONDS)*1e3)},r.removeThrottle=function(e,t,o,i){var n={clientId:t,authority:o.authority,scopes:o.scopes,homeAccountIdentifier:i,claims:o.claims,authenticationScheme:o.authenticationScheme,resourceRequestMethod:o.resourceRequestMethod,resourceRequestUri:o.resourceRequestUri,shrClaims:o.shrClaims,sshKid:o.sshKid},s=this.generateThrottlingStorageKey(n);e.removeItem(s)},r}();var dy=function(){function r(e,t){this.networkClient=e,this.cacheManager=t}return r.prototype.sendPostRequest=function(e,t,o){return le(this,void 0,void 0,function(){var i,n;return ce(this,function(s){switch(s.label){case 0:oa.preProcess(this.cacheManager,e),s.label=1;case 1:return s.trys.push([1,3,,4]),[4,this.networkClient.sendPostRequestAsync(t,o)];case 2:return i=s.sent(),[3,4];case 3:throw n=s.sent(),n instanceof ee?n:U.createNetworkError(t,n);case 4:return oa.postProcess(this.cacheManager,e,i),[2,i]}})})},r}();l();c();d();var wr;(function(r){r.HOME_ACCOUNT_ID="home_account_id",r.UPN="UPN"})(wr||(wr={}));l();c();d();l();c();d();var us=function(){function r(){}return r.validateRedirectUri=function(e){if(z.isEmpty(e))throw je.createRedirectUriEmptyError()},r.validatePrompt=function(e){var t=[];for(var o in or)t.push(or[o]);if(t.indexOf(e)<0)throw je.createInvalidPromptError(e)},r.validateClaims=function(e){try{JSON.parse(e)}catch{throw je.createInvalidClaimsRequestError()}},r.validateCodeChallengeParams=function(e,t){if(z.isEmpty(e)||z.isEmpty(t))throw je.createInvalidCodeChallengeParamsError();this.validateCodeChallengeMethod(t)},r.validateCodeChallengeMethod=function(e){if([_f.PLAIN,_f.S256].indexOf(e)<0)throw je.createInvalidCodeChallengeMethodError()},r.sanitizeEQParams=function(e,t){return e?(t.forEach(function(o,i){e[i]&&delete e[i]}),Object.fromEntries(Object.entries(e).filter(function(o){var i=o[1];return i!==""}))):{}},r}();var Lr=function(){function r(){this.parameters=new Map}return r.prototype.addResponseTypeCode=function(){this.parameters.set(Ne.RESPONSE_TYPE,encodeURIComponent(_.CODE_RESPONSE_TYPE))},r.prototype.addResponseTypeForTokenAndIdToken=function(){this.parameters.set(Ne.RESPONSE_TYPE,encodeURIComponent(_.TOKEN_RESPONSE_TYPE+" "+_.ID_TOKEN_RESPONSE_TYPE))},r.prototype.addResponseMode=function(e){this.parameters.set(Ne.RESPONSE_MODE,encodeURIComponent(e||ml.QUERY))},r.prototype.addNativeBroker=function(){this.parameters.set(Ne.NATIVE_BROKER,encodeURIComponent("1"))},r.prototype.addScopes=function(e,t){t===void 0&&(t=!0);var o=t?Js(e||[],Yi):e||[],i=new It(o);this.parameters.set(Ne.SCOPE,encodeURIComponent(i.printScopes()))},r.prototype.addClientId=function(e){this.parameters.set(Ne.CLIENT_ID,encodeURIComponent(e))},r.prototype.addRedirectUri=function(e){us.validateRedirectUri(e),this.parameters.set(Ne.REDIRECT_URI,encodeURIComponent(e))},r.prototype.addPostLogoutRedirectUri=function(e){us.validateRedirectUri(e),this.parameters.set(Ne.POST_LOGOUT_URI,encodeURIComponent(e))},r.prototype.addIdTokenHint=function(e){this.parameters.set(Ne.ID_TOKEN_HINT,encodeURIComponent(e))},r.prototype.addDomainHint=function(e){this.parameters.set(fl.DOMAIN_HINT,encodeURIComponent(e))},r.prototype.addLoginHint=function(e){this.parameters.set(fl.LOGIN_HINT,encodeURIComponent(e))},r.prototype.addCcsUpn=function(e){this.parameters.set(Ft.CCS_HEADER,encodeURIComponent("UPN:"+e))},r.prototype.addCcsOid=function(e){this.parameters.set(Ft.CCS_HEADER,encodeURIComponent("Oid:"+e.uid+"@"+e.utid))},r.prototype.addSid=function(e){this.parameters.set(fl.SID,encodeURIComponent(e))},r.prototype.addClaims=function(e,t){var o=this.addClientCapabilitiesToClaims(e,t);us.validateClaims(o),this.parameters.set(Ne.CLAIMS,encodeURIComponent(o))},r.prototype.addCorrelationId=function(e){this.parameters.set(Ne.CLIENT_REQUEST_ID,encodeURIComponent(e))},r.prototype.addLibraryInfo=function(e){this.parameters.set(Ne.X_CLIENT_SKU,e.sku),this.parameters.set(Ne.X_CLIENT_VER,e.version),e.os&&this.parameters.set(Ne.X_CLIENT_OS,e.os),e.cpu&&this.parameters.set(Ne.X_CLIENT_CPU,e.cpu)},r.prototype.addApplicationTelemetry=function(e){e?.appName&&this.parameters.set(Ne.X_APP_NAME,e.appName),e?.appVersion&&this.parameters.set(Ne.X_APP_VER,e.appVersion)},r.prototype.addPrompt=function(e){us.validatePrompt(e),this.parameters.set(""+Ne.PROMPT,encodeURIComponent(e))},r.prototype.addState=function(e){z.isEmpty(e)||this.parameters.set(Ne.STATE,encodeURIComponent(e))},r.prototype.addNonce=function(e){this.parameters.set(Ne.NONCE,encodeURIComponent(e))},r.prototype.addCodeChallengeParams=function(e,t){if(us.validateCodeChallengeParams(e,t),e&&t)this.parameters.set(Ne.CODE_CHALLENGE,encodeURIComponent(e)),this.parameters.set(Ne.CODE_CHALLENGE_METHOD,encodeURIComponent(t));else throw je.createInvalidCodeChallengeParamsError()},r.prototype.addAuthorizationCode=function(e){this.parameters.set(Ne.CODE,encodeURIComponent(e))},r.prototype.addDeviceCode=function(e){this.parameters.set(Ne.DEVICE_CODE,encodeURIComponent(e))},r.prototype.addRefreshToken=function(e){this.parameters.set(Ne.REFRESH_TOKEN,encodeURIComponent(e))},r.prototype.addCodeVerifier=function(e){this.parameters.set(Ne.CODE_VERIFIER,encodeURIComponent(e))},r.prototype.addClientSecret=function(e){this.parameters.set(Ne.CLIENT_SECRET,encodeURIComponent(e))},r.prototype.addClientAssertion=function(e){z.isEmpty(e)||this.parameters.set(Ne.CLIENT_ASSERTION,encodeURIComponent(e))},r.prototype.addClientAssertionType=function(e){z.isEmpty(e)||this.parameters.set(Ne.CLIENT_ASSERTION_TYPE,encodeURIComponent(e))},r.prototype.addOboAssertion=function(e){this.parameters.set(Ne.OBO_ASSERTION,encodeURIComponent(e))},r.prototype.addRequestTokenUse=function(e){this.parameters.set(Ne.REQUESTED_TOKEN_USE,encodeURIComponent(e))},r.prototype.addGrantType=function(e){this.parameters.set(Ne.GRANT_TYPE,encodeURIComponent(e))},r.prototype.addClientInfo=function(){this.parameters.set(b_,"1")},r.prototype.addExtraQueryParameters=function(e){var t=this,o=us.sanitizeEQParams(e,this.parameters);Object.keys(o).forEach(function(i){t.parameters.set(i,e[i])})},r.prototype.addClientCapabilitiesToClaims=function(e,t){var o;if(!e)o={};else try{o=JSON.parse(e)}catch{throw je.createInvalidClaimsRequestError()}return t&&t.length>0&&(o.hasOwnProperty(Xs.ACCESS_TOKEN)||(o[Xs.ACCESS_TOKEN]={}),o[Xs.ACCESS_TOKEN][Xs.XMS_CC]={values:t}),JSON.stringify(o)},r.prototype.addUsername=function(e){this.parameters.set(Ec.username,encodeURIComponent(e))},r.prototype.addPassword=function(e){this.parameters.set(Ec.password,encodeURIComponent(e))},r.prototype.addPopToken=function(e){z.isEmpty(e)||(this.parameters.set(Ne.TOKEN_TYPE,Be.POP),this.parameters.set(Ne.REQ_CNF,encodeURIComponent(e)))},r.prototype.addSshJwk=function(e){z.isEmpty(e)||(this.parameters.set(Ne.TOKEN_TYPE,Be.SSH),this.parameters.set(Ne.REQ_CNF,encodeURIComponent(e)))},r.prototype.addServerTelemetry=function(e){this.parameters.set(Ne.X_CLIENT_CURR_TELEM,e.generateCurrentRequestHeaderValue()),this.parameters.set(Ne.X_CLIENT_LAST_TELEM,e.generateLastRequestHeaderValue())},r.prototype.addThrottling=function(){this.parameters.set(Ne.X_MS_LIB_CAPABILITY,ds.X_MS_LIB_CAPABILITY_VALUE)},r.prototype.addLogoutHint=function(e){this.parameters.set(Ne.LOGOUT_HINT,encodeURIComponent(e))},r.prototype.createQueryString=function(){var e=new Array;return this.parameters.forEach(function(t,o){e.push(o+"="+t)}),e.join("&")},r}();var Bo=function(){function r(e,t){this.config=w_(e),this.logger=new _n(this.config.loggerOptions,Ef,yl),this.cryptoUtils=this.config.cryptoInterface,this.cacheManager=this.config.storageInterface,this.networkClient=this.config.networkInterface,this.networkManager=new dy(this.networkClient,this.cacheManager),this.serverTelemetryManager=this.config.serverTelemetryManager,this.authority=this.config.authOptions.authority,this.performanceClient=t}return r.prototype.createTokenRequestHeaders=function(e){var t={};if(t[Ft.CONTENT_TYPE]=_.URL_FORM_CONTENT_TYPE,!this.config.systemOptions.preventCorsPreflight&&e)switch(e.type){case wr.HOME_ACCOUNT_ID:try{var o=En(e.credential);t[Ft.CCS_HEADER]="Oid:"+o.uid+"@"+o.utid}catch(i){this.logger.verbose("Could not parse home account ID for CCS Header: "+i)}break;case wr.UPN:t[Ft.CCS_HEADER]="UPN: "+e.credential;break}return t},r.prototype.executePostToTokenEndpoint=function(e,t,o,i){return le(this,void 0,void 0,function(){var n;return ce(this,function(s){switch(s.label){case 0:return[4,this.networkManager.sendPostRequest(i,e,{body:t,headers:o})];case 1:return n=s.sent(),this.config.serverTelemetryManager&&n.status<500&&n.status!==429&&this.config.serverTelemetryManager.clearTelemetryCache(),[2,n]}})})},r.prototype.updateAuthority=function(e){if(!e.discoveryComplete())throw U.createEndpointDiscoveryIncompleteError("Updated authority has not completed endpoint discovery.");this.authority=e},r.prototype.createTokenQueryParameters=function(e){var t=new Lr;return e.tokenQueryParameters&&t.addExtraQueryParameters(e.tokenQueryParameters),t.createQueryString()},r}();l();c();d();l();c();d();l();c();d();var bl=function(){function r(){}return r.prototype.generateAccountId=function(){return r.generateAccountIdForCacheKey(this.homeAccountId,this.environment)},r.prototype.generateCredentialId=function(){return r.generateCredentialIdForCacheKey(this.credentialType,this.clientId,this.realm,this.familyId)},r.prototype.generateTarget=function(){return r.generateTargetForCacheKey(this.target)},r.prototype.generateCredentialKey=function(){return r.generateCredentialCacheKey(this.homeAccountId,this.environment,this.credentialType,this.clientId,this.realm,this.target,this.familyId,this.tokenType,this.requestedClaimsHash)},r.prototype.generateType=function(){switch(this.credentialType){case ue.ID_TOKEN:return gi.ID_TOKEN;case ue.ACCESS_TOKEN:case ue.ACCESS_TOKEN_WITH_AUTH_SCHEME:return gi.ACCESS_TOKEN;case ue.REFRESH_TOKEN:return gi.REFRESH_TOKEN;default:throw U.createUnexpectedCredentialTypeError()}},r.generateCredentialCacheKey=function(e,t,o,i,n,s,a,u,h){var p=[this.generateAccountIdForCacheKey(e,t),this.generateCredentialIdForCacheKey(o,i,n,a),this.generateTargetForCacheKey(s),this.generateClaimsHashForCacheKey(h),this.generateSchemeForCacheKey(u)];return p.join(Lt.CACHE_KEY_SEPARATOR).toLowerCase()},r.generateAccountIdForCacheKey=function(e,t){var o=[e,t];return o.join(Lt.CACHE_KEY_SEPARATOR).toLowerCase()},r.generateCredentialIdForCacheKey=function(e,t,o,i){var n=e===ue.REFRESH_TOKEN&&i||t,s=[e,n,o||_.EMPTY_STRING];return s.join(Lt.CACHE_KEY_SEPARATOR).toLowerCase()},r.generateTargetForCacheKey=function(e){return(e||_.EMPTY_STRING).toLowerCase()},r.generateClaimsHashForCacheKey=function(e){return(e||_.EMPTY_STRING).toLowerCase()},r.generateSchemeForCacheKey=function(e){return e&&e.toLowerCase()!==Be.BEARER.toLowerCase()?e.toLowerCase():_.EMPTY_STRING},r}();var vi=function(r){nt(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.createIdTokenEntity=function(t,o,i,n,s){var a=new e;return a.credentialType=ue.ID_TOKEN,a.homeAccountId=t,a.environment=o,a.clientId=n,a.secret=i,a.realm=s,a},e.isIdTokenEntity=function(t){return t?t.hasOwnProperty("homeAccountId")&&t.hasOwnProperty("environment")&&t.hasOwnProperty("credentialType")&&t.hasOwnProperty("realm")&&t.hasOwnProperty("clientId")&&t.hasOwnProperty("secret")&&t.credentialType===ue.ID_TOKEN:!1},e}(bl);l();c();d();l();c();d();var st=function(){function r(){}return r.nowSeconds=function(){return Math.round(new Date().getTime()/1e3)},r.isTokenExpired=function(e,t){var o=Number(e)||0,i=r.nowSeconds()+t;return i>o},r.wasClockTurnedBack=function(e){var t=Number(e);return t>r.nowSeconds()},r.delay=function(e,t){return new Promise(function(o){return setTimeout(function(){return o(t)},e)})},r}();var yi=function(r){nt(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.createAccessTokenEntity=function(t,o,i,n,s,a,u,h,p,f,b,C,S,R,H){var ye,ie,me=new e;me.homeAccountId=t,me.credentialType=ue.ACCESS_TOKEN,me.secret=i;var yt=st.nowSeconds();if(me.cachedAt=yt.toString(),me.expiresOn=u.toString(),me.extendedExpiresOn=h.toString(),f&&(me.refreshOn=f.toString()),me.environment=o,me.clientId=n,me.realm=s,me.target=a,me.userAssertionHash=C,me.tokenType=z.isEmpty(b)?Be.BEARER:b,R&&(me.requestedClaims=R,me.requestedClaimsHash=H),((ye=me.tokenType)===null||ye===void 0?void 0:ye.toLowerCase())!==Be.BEARER.toLowerCase())switch(me.credentialType=ue.ACCESS_TOKEN_WITH_AUTH_SCHEME,me.tokenType){case Be.POP:var Ge=fr.extractTokenClaims(i,p);if(!(!((ie=Ge?.cnf)===null||ie===void 0)&&ie.kid))throw U.createTokenClaimsRequiredError();me.keyId=Ge.cnf.kid;break;case Be.SSH:me.keyId=S}return me},e.isAccessTokenEntity=function(t){return t?t.hasOwnProperty("homeAccountId")&&t.hasOwnProperty("environment")&&t.hasOwnProperty("credentialType")&&t.hasOwnProperty("realm")&&t.hasOwnProperty("clientId")&&t.hasOwnProperty("secret")&&t.hasOwnProperty("target")&&(t.credentialType===ue.ACCESS_TOKEN||t.credentialType===ue.ACCESS_TOKEN_WITH_AUTH_SCHEME):!1},e}(bl);l();c();d();var In=function(r){nt(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.createRefreshTokenEntity=function(t,o,i,n,s,a){var u=new e;return u.clientId=n,u.credentialType=ue.REFRESH_TOKEN,u.environment=o,u.homeAccountId=t,u.secret=i,u.userAssertionHash=a,s&&(u.familyId=s),u},e.isRefreshTokenEntity=function(t){return t?t.hasOwnProperty("homeAccountId")&&t.hasOwnProperty("environment")&&t.hasOwnProperty("credentialType")&&t.hasOwnProperty("clientId")&&t.hasOwnProperty("secret")&&t.credentialType===ue.REFRESH_TOKEN:!1},e}(bl);l();c();d();var C_=["interaction_required","consent_required","login_required"],v9=["message_only","additional_action","basic_action","user_password_expired","consent_required"],An={noTokensFoundError:{code:"no_tokens_found",desc:"No refresh token found in the cache. Please sign-in."},native_account_unavailable:{code:"native_account_unavailable",desc:"The requested account is not available in the native broker. It may have been deleted or logged out. Please sign-in again using an interactive API."}},Cr=function(r){nt(e,r);function e(t,o,i,n,s,a,u){var h=r.call(this,t,o,i)||this;return Object.setPrototypeOf(h,e.prototype),h.timestamp=n||_.EMPTY_STRING,h.traceId=s||_.EMPTY_STRING,h.correlationId=a||_.EMPTY_STRING,h.claims=u||_.EMPTY_STRING,h.name="InteractionRequiredAuthError",h}return e.isInteractionRequiredError=function(t,o,i){var n=!!t&&C_.indexOf(t)>-1,s=!!i&&v9.indexOf(i)>-1,a=!!o&&C_.some(function(u){return o.indexOf(u)>-1});return n||a||s},e.createNoTokensFoundError=function(){return new e(An.noTokensFoundError.code,An.noTokensFoundError.desc)},e.createNativeAccountUnavailableError=function(){return new e(An.native_account_unavailable.code,An.native_account_unavailable.desc)},e}(ee);l();c();d();var hs=function(){function r(e,t,o,i,n){this.account=e||null,this.idToken=t||null,this.accessToken=o||null,this.refreshToken=i||null,this.appMetadata=n||null}return r}();l();c();d();var to=function(){function r(){}return r.setRequestState=function(e,t,o){var i=r.generateLibraryState(e,o);return z.isEmpty(t)?i:""+i+_.RESOURCE_DELIM+t},r.generateLibraryState=function(e,t){if(!e)throw U.createNoCryptoObjectError("generateLibraryState");var o={id:e.createNewGuid()};t&&(o.meta=t);var i=JSON.stringify(o);return e.base64Encode(i)},r.parseRequestState=function(e,t){if(!e)throw U.createNoCryptoObjectError("parseRequestState");if(z.isEmpty(t))throw U.createInvalidStateError(t,"Null, undefined or empty state");try{var o=t.split(_.RESOURCE_DELIM),i=o[0],n=o.length>1?o.slice(1).join(_.RESOURCE_DELIM):_.EMPTY_STRING,s=e.base64Decode(i),a=JSON.parse(s);return{userRequestState:z.isEmpty(n)?_.EMPTY_STRING:n,libraryState:a}}catch(u){throw U.createInvalidStateError(t,u)}},r}();l();c();d();l();c();d();var Se=function(){function r(e){if(this._urlString=e,z.isEmpty(this._urlString))throw je.createUrlEmptyError();z.isEmpty(this.getHash())&&(this._urlString=r.canonicalizeUri(e))}return Object.defineProperty(r.prototype,"urlString",{get:function(){return this._urlString},enumerable:!1,configurable:!0}),r.canonicalizeUri=function(e){if(e){var t=e.toLowerCase();return z.endsWith(t,"?")?t=t.slice(0,-1):z.endsWith(t,"?/")&&(t=t.slice(0,-2)),z.endsWith(t,"/")||(t+="/"),t}return e},r.prototype.validateAsUri=function(){var e;try{e=this.getUrlComponents()}catch(t){throw je.createUrlParseError(t)}if(!e.HostNameAndPort||!e.PathSegments)throw je.createUrlParseError("Given url string: "+this.urlString);if(!e.Protocol||e.Protocol.toLowerCase()!=="https:")throw je.createInsecureAuthorityUriError(this.urlString)},r.appendQueryString=function(e,t){return z.isEmpty(t)?e:e.indexOf("?")<0?e+"?"+t:e+"&"+t},r.removeHashFromUrl=function(e){return r.canonicalizeUri(e.split("#")[0])},r.prototype.replaceTenantPath=function(e){var t=this.getUrlComponents(),o=t.PathSegments;return e&&o.length!==0&&(o[0]===ls.COMMON||o[0]===ls.ORGANIZATIONS)&&(o[0]=e),r.constructAuthorityUriFromObject(t)},r.prototype.getHash=function(){return r.parseHash(this.urlString)},r.prototype.getUrlComponents=function(){var e=RegExp("^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\\?([^#]*))?(#(.*))?"),t=this.urlString.match(e);if(!t)throw je.createUrlParseError("Given url string: "+this.urlString);var o={Protocol:t[1],HostNameAndPort:t[4],AbsolutePath:t[5],QueryString:t[7]},i=o.AbsolutePath.split("/");return i=i.filter(function(n){return n&&n.length>0}),o.PathSegments=i,!z.isEmpty(o.QueryString)&&o.QueryString.endsWith("/")&&(o.QueryString=o.QueryString.substring(0,o.QueryString.length-1)),o},r.getDomainFromUrl=function(e){var t=RegExp("^([^:/?#]+://)?([^/?#]*)"),o=e.match(t);if(!o)throw je.createUrlParseError("Given url string: "+e);return o[2]},r.getAbsoluteUrl=function(e,t){if(e[0]===_.FORWARD_SLASH){var o=new r(t),i=o.getUrlComponents();return i.Protocol+"//"+i.HostNameAndPort+e}return e},r.parseHash=function(e){var t=e.indexOf("#"),o=e.indexOf("#/");return o>-1?e.substring(o+2):t>-1?e.substring(t+1):_.EMPTY_STRING},r.parseQueryString=function(e){var t=e.indexOf("?"),o=e.indexOf("/?");return o>-1?e.substring(o+2):t>-1?e.substring(t+1):_.EMPTY_STRING},r.constructAuthorityUriFromObject=function(e){return new r(e.Protocol+"//"+e.HostNameAndPort+"/"+e.PathSegments.join("/"))},r.getDeserializedHash=function(e){if(z.isEmpty(e))return{};var t=r.parseHash(e),o=z.queryStringToObject(z.isEmpty(t)?e:t);if(!o)throw U.createHashNotDeserializedError(JSON.stringify(o));return o},r.getDeserializedQueryString=function(e){if(z.isEmpty(e))return{};var t=r.parseQueryString(e),o=z.queryStringToObject(z.isEmpty(t)?e:t);if(!o)throw U.createHashNotDeserializedError(JSON.stringify(o));return o},r.hashContainsKnownProperties=function(e){if(z.isEmpty(e)||e.indexOf("=")<0)return!1;var t=r.getDeserializedHash(e);return!!(t.code||t.error_description||t.error||t.state)},r}();l();c();d();var $;(function(r){r.AcquireTokenByCode="acquireTokenByCode",r.AcquireTokenByRefreshToken="acquireTokenByRefreshToken",r.AcquireTokenSilent="acquireTokenSilent",r.AcquireTokenSilentAsync="acquireTokenSilentAsync",r.AcquireTokenPopup="acquireTokenPopup",r.CryptoOptsGetPublicKeyThumbprint="cryptoOptsGetPublicKeyThumbprint",r.CryptoOptsSignJwt="cryptoOptsSignJwt",r.SilentCacheClientAcquireToken="silentCacheClientAcquireToken",r.SilentIframeClientAcquireToken="silentIframeClientAcquireToken",r.SilentRefreshClientAcquireToken="silentRefreshClientAcquireToken",r.SsoSilent="ssoSilent",r.StandardInteractionClientGetDiscoveredAuthority="standardInteractionClientGetDiscoveredAuthority",r.FetchAccountIdWithNativeBroker="fetchAccountIdWithNativeBroker",r.NativeInteractionClientAcquireToken="nativeInteractionClientAcquireToken",r.BaseClientCreateTokenRequestHeaders="baseClientCreateTokenRequestHeaders",r.BrokerHandhshake="brokerHandshake",r.AcquireTokenByRefreshTokenInBroker="acquireTokenByRefreshTokenInBroker",r.AcquireTokenByBroker="acquireTokenByBroker",r.RefreshTokenClientExecuteTokenRequest="refreshTokenClientExecuteTokenRequest",r.RefreshTokenClientAcquireToken="refreshTokenClientAcquireToken",r.RefreshTokenClientAcquireTokenWithCachedRefreshToken="refreshTokenClientAcquireTokenWithCachedRefreshToken",r.RefreshTokenClientAcquireTokenByRefreshToken="refreshTokenClientAcquireTokenByRefreshToken",r.RefreshTokenClientCreateTokenRequestBody="refreshTokenClientCreateTokenRequestBody",r.AcquireTokenFromCache="acquireTokenFromCache",r.AcquireTokenBySilentIframe="acquireTokenBySilentIframe",r.InitializeBaseRequest="initializeBaseRequest",r.InitializeSilentRequest="initializeSilentRequest",r.InitializeClientApplication="initializeClientApplication",r.SilentIframeClientTokenHelper="silentIframeClientTokenHelper",r.SilentHandlerInitiateAuthRequest="silentHandlerInitiateAuthRequest",r.SilentHandlerMonitorIframeForHash="silentHandlerMonitorIframeForHash",r.SilentHandlerLoadFrame="silentHandlerLoadFrame",r.StandardInteractionClientCreateAuthCodeClient="standardInteractionClientCreateAuthCodeClient",r.StandardInteractionClientGetClientConfiguration="standardInteractionClientGetClientConfiguration",r.StandardInteractionClientInitializeAuthorizationRequest="standardInteractionClientInitializeAuthorizationRequest",r.StandardInteractionClientInitializeAuthorizationCodeRequest="standardInteractionClientInitializeAuthorizationCodeRequest",r.GetAuthCodeUrl="getAuthCodeUrl",r.HandleCodeResponseFromServer="handleCodeResponseFromServer",r.HandleCodeResponseFromHash="handleCodeResponseFromHash",r.UpdateTokenEndpointAuthority="updateTokenEndpointAuthority",r.AuthClientAcquireToken="authClientAcquireToken",r.AuthClientExecuteTokenRequest="authClientExecuteTokenRequest",r.AuthClientCreateTokenRequestBody="authClientCreateTokenRequestBody",r.AuthClientCreateQueryString="authClientCreateQueryString",r.PopTokenGenerateCnf="popTokenGenerateCnf",r.PopTokenGenerateKid="popTokenGenerateKid",r.HandleServerTokenResponse="handleServerTokenResponse",r.AuthorityFactoryCreateDiscoveredInstance="authorityFactoryCreateDiscoveredInstance",r.AuthorityResolveEndpointsAsync="authorityResolveEndpointsAsync",r.AuthorityGetCloudDiscoveryMetadataFromNetwork="authorityGetCloudDiscoveryMetadataFromNetwork",r.AuthorityUpdateCloudDiscoveryMetadata="authorityUpdateCloudDiscoveryMetadata",r.AuthorityGetEndpointMetadataFromNetwork="authorityGetEndpointMetadataFromNetwork",r.AuthorityUpdateEndpointMetadata="authorityUpdateEndpointMetadata",r.AuthorityUpdateMetadataWithRegionalInformation="authorityUpdateMetadataWithRegionalInformation",r.RegionDiscoveryDetectRegion="regionDiscoveryDetectRegion",r.RegionDiscoveryGetRegionFromIMDS="regionDiscoveryGetRegionFromIMDS",r.RegionDiscoveryGetCurrentVersion="regionDiscoveryGetCurrentVersion",r.AcquireTokenByCodeAsync="acquireTokenByCodeAsync",r.GetEndpointMetadataFromNetwork="getEndpointMetadataFromNetwork",r.GetCloudDiscoveryMetadataFromNetworkMeasurement="getCloudDiscoveryMetadataFromNetworkMeasurement",r.HandleRedirectPromiseMeasurement="handleRedirectPromiseMeasurement",r.UpdateCloudDiscoveryMetadataMeasurement="updateCloudDiscoveryMetadataMeasurement",r.UsernamePasswordClientAcquireToken="usernamePasswordClientAcquireToken",r.NativeMessageHandlerHandshake="nativeMessageHandlerHandshake",r.ClearTokensAndKeysWithClaims="clearTokensAndKeysWithClaims"})($||($={}));var Rc;(function(r){r[r.NotStarted=0]="NotStarted",r[r.InProgress=1]="InProgress",r[r.Completed=2]="Completed"})(Rc||(Rc={}));var uy=new Set(["accessTokenSize","durationMs","idTokenSize","matsSilentStatus","matsHttpStatus","refreshTokenSize","queuedTimeMs","startTimeMs","status"]);var hy;(function(r){r.SW="sw",r.UHW="uhw"})(hy||(hy={}));var ai=function(){function r(e,t){this.cryptoUtils=e,this.performanceClient=t}return r.prototype.generateCnf=function(e){var t,o;return le(this,void 0,void 0,function(){var i,n,s;return ce(this,function(a){switch(a.label){case 0:return(t=this.performanceClient)===null||t===void 0||t.addQueueMeasurement($.PopTokenGenerateCnf,e.correlationId),(o=this.performanceClient)===null||o===void 0||o.setPreQueueTime($.PopTokenGenerateKid,e.correlationId),[4,this.generateKid(e)];case 1:return i=a.sent(),n=this.cryptoUtils.base64Encode(JSON.stringify(i)),s={kid:i.kid,reqCnfString:n},[4,this.cryptoUtils.hashString(n)];case 2:return[2,(s.reqCnfHash=a.sent(),s)]}})})},r.prototype.generateKid=function(e){var t;return le(this,void 0,void 0,function(){var o;return ce(this,function(i){switch(i.label){case 0:return(t=this.performanceClient)===null||t===void 0||t.addQueueMeasurement($.PopTokenGenerateKid,e.correlationId),[4,this.cryptoUtils.getPublicKeyThumbprint(e)];case 1:return o=i.sent(),[2,{kid:o,xms_ksl:hy.SW}]}})})},r.prototype.signPopToken=function(e,t,o){return le(this,void 0,void 0,function(){return ce(this,function(i){return[2,this.signPayload(e,t,o)]})})},r.prototype.signPayload=function(e,t,o,i){return le(this,void 0,void 0,function(){var n,s,a,u,h,p;return ce(this,function(f){switch(f.label){case 0:return n=o.resourceRequestMethod,s=o.resourceRequestUri,a=o.shrClaims,u=o.shrNonce,h=s?new Se(s):void 0,p=h?.getUrlComponents(),[4,this.cryptoUtils.signJwt(rt({at:e,ts:st.nowSeconds(),m:n?.toUpperCase(),u:p?.HostNameAndPort,nonce:u||this.cryptoUtils.createNewGuid(),p:p?.AbsolutePath,q:p?.QueryString?[[],p.QueryString]:void 0,client_claims:a||void 0},i),t,o.correlationId)];case 1:return[2,f.sent()]}})})},r}();l();c();d();var Pc=function(){function r(){}return r.prototype.generateAppMetadataKey=function(){return r.generateAppMetadataCacheKey(this.environment,this.clientId)},r.generateAppMetadataCacheKey=function(e,t){var o=[_u,e,t];return o.join(Lt.CACHE_KEY_SEPARATOR).toLowerCase()},r.createAppMetadataEntity=function(e,t,o){var i=new r;return i.clientId=e,i.environment=t,o&&(i.familyId=o),i},r.isAppMetadataEntity=function(e,t){return t?e.indexOf(_u)===0&&t.hasOwnProperty("clientId")&&t.hasOwnProperty("environment"):!1},r}();l();c();d();var py=function(){function r(e,t){this.cache=e,this.hasChanged=t}return Object.defineProperty(r.prototype,"cacheHasChanged",{get:function(){return this.hasChanged},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"tokenCache",{get:function(){return this.cache},enumerable:!1,configurable:!0}),r}();var ro=function(){function r(e,t,o,i,n,s,a){this.clientId=e,this.cacheStorage=t,this.cryptoObj=o,this.logger=i,this.serializableCache=n,this.persistencePlugin=s,this.performanceClient=a}return r.prototype.validateServerAuthorizationCodeResponse=function(e,t,o){if(!e.state||!t)throw e.state?U.createStateNotFoundError("Cached State"):U.createStateNotFoundError("Server State");if(decodeURIComponent(e.state)!==decodeURIComponent(t))throw U.createStateMismatchError();if(e.error||e.error_description||e.suberror)throw Cr.isInteractionRequiredError(e.error,e.error_description,e.suberror)?new Cr(e.error||_.EMPTY_STRING,e.error_description,e.suberror,e.timestamp||_.EMPTY_STRING,e.trace_id||_.EMPTY_STRING,e.correlation_id||_.EMPTY_STRING,e.claims||_.EMPTY_STRING):new eo(e.error||_.EMPTY_STRING,e.error_description,e.suberror);e.client_info&&ra(e.client_info,o)},r.prototype.validateTokenResponse=function(e){if(e.error||e.error_description||e.suberror){if(Cr.isInteractionRequiredError(e.error,e.error_description,e.suberror))throw new Cr(e.error,e.error_description,e.suberror,e.timestamp||_.EMPTY_STRING,e.trace_id||_.EMPTY_STRING,e.correlation_id||_.EMPTY_STRING,e.claims||_.EMPTY_STRING);var t=e.error_codes+" - ["+e.timestamp+"]: "+e.error_description+" - Correlation ID: "+e.correlation_id+" - Trace ID: "+e.trace_id;throw new eo(e.error,t,e.suberror)}},r.prototype.handleServerTokenResponse=function(e,t,o,i,n,s,a,u,h){var p;return le(this,void 0,void 0,function(){var f,b,C,S,R,H,ye;return ce(this,function(ie){switch(ie.label){case 0:if((p=this.performanceClient)===null||p===void 0||p.addQueueMeasurement($.HandleServerTokenResponse,e.correlation_id),e.id_token){if(f=new fr(e.id_token||_.EMPTY_STRING,this.cryptoObj),n&&!z.isEmpty(n.nonce)&&f.claims.nonce!==n.nonce)throw U.createNonceMismatchError();if(i.maxAge||i.maxAge===0){if(b=f.claims.auth_time,!b)throw U.createAuthTimeNotFoundError();fr.checkMaxAge(b,i.maxAge)}}this.homeAccountIdentifier=Nt.generateHomeAccountId(e.client_info||_.EMPTY_STRING,t.authorityType,this.logger,this.cryptoObj,f),n&&n.state&&(C=to.parseRequestState(this.cryptoObj,n.state)),e.key_id=e.key_id||i.sshKid||void 0,S=this.generateCacheRecord(e,t,o,i,f,s,n),ie.label=1;case 1:return ie.trys.push([1,,5,8]),this.persistencePlugin&&this.serializableCache?(this.logger.verbose("Persistence enabled, calling beforeCacheAccess"),R=new py(this.serializableCache,!0),[4,this.persistencePlugin.beforeCacheAccess(R)]):[3,3];case 2:ie.sent(),ie.label=3;case 3:return a&&!u&&S.account&&(H=S.account.generateAccountKey(),ye=this.cacheStorage.getAccount(H),!ye)?(this.logger.warning("Account used to refresh tokens not in persistence, refreshed tokens will not be stored in the cache"),[2,r.generateAuthenticationResult(this.cryptoObj,t,S,!1,i,f,C,void 0,h)]):[4,this.cacheStorage.saveCacheRecord(S)];case 4:return ie.sent(),[3,8];case 5:return this.persistencePlugin&&this.serializableCache&&R?(this.logger.verbose("Persistence enabled, calling afterCacheAccess"),[4,this.persistencePlugin.afterCacheAccess(R)]):[3,7];case 6:ie.sent(),ie.label=7;case 7:return[7];case 8:return[2,r.generateAuthenticationResult(this.cryptoObj,t,S,!1,i,f,C,e,h)]}})})},r.prototype.generateCacheRecord=function(e,t,o,i,n,s,a){var u=t.getPreferredCache();if(z.isEmpty(u))throw U.createInvalidCacheEnvironmentError();var h,p;!z.isEmpty(e.id_token)&&n&&(h=vi.createIdTokenEntity(this.homeAccountIdentifier,u,e.id_token||_.EMPTY_STRING,this.clientId,n.claims.tid||_.EMPTY_STRING),p=this.generateAccountEntity(e,n,t,a));var f=null;if(!z.isEmpty(e.access_token)){var b=e.scope?It.fromString(e.scope):new It(i.scopes||[]),C=(typeof e.expires_in=="string"?parseInt(e.expires_in,10):e.expires_in)||0,S=(typeof e.ext_expires_in=="string"?parseInt(e.ext_expires_in,10):e.ext_expires_in)||0,R=(typeof e.refresh_in=="string"?parseInt(e.refresh_in,10):e.refresh_in)||void 0,H=o+C,ye=H+S,ie=R&&R>0?o+R:void 0;f=yi.createAccessTokenEntity(this.homeAccountIdentifier,u,e.access_token||_.EMPTY_STRING,this.clientId,n?n.claims.tid||_.EMPTY_STRING:t.tenant,b.printScopes(),H,ye,this.cryptoObj,ie,e.token_type,s,e.key_id,i.claims,i.requestedClaimsHash)}var me=null;z.isEmpty(e.refresh_token)||(me=In.createRefreshTokenEntity(this.homeAccountIdentifier,u,e.refresh_token||_.EMPTY_STRING,this.clientId,e.foci,s));var yt=null;return z.isEmpty(e.foci)||(yt=Pc.createAppMetadataEntity(this.clientId,u,e.foci)),new hs(p,h,f,me,yt)},r.prototype.generateAccountEntity=function(e,t,o,i){var n=o.authorityType,s=i?i.cloud_graph_host_name:_.EMPTY_STRING,a=i?i.msgraph_host:_.EMPTY_STRING;if(n===br.Adfs)return this.logger.verbose("Authority type is ADFS, creating ADFS account"),Nt.createGenericAccount(this.homeAccountIdentifier,t,o,s,a);if(z.isEmpty(e.client_info)&&o.protocolMode==="AAD")throw U.createClientInfoEmptyError();return e.client_info?Nt.createAccount(e.client_info,this.homeAccountIdentifier,t,o,s,a):Nt.createGenericAccount(this.homeAccountIdentifier,t,o,s,a)},r.generateAuthenticationResult=function(e,t,o,i,n,s,a,u,h){var p,f,b;return le(this,void 0,void 0,function(){var C,S,R,H,ye,ie,me,yt,Ge,tt,_o;return ce(this,function(_r){switch(_r.label){case 0:if(C=_.EMPTY_STRING,S=[],R=null,ye=_.EMPTY_STRING,!o.accessToken)return[3,4];if(o.accessToken.tokenType!==Be.POP)return[3,2];if(ie=new ai(e),me=o.accessToken,yt=me.secret,Ge=me.keyId,!Ge)throw U.createKeyIdMissingError();return[4,ie.signPopToken(yt,Ge,n)];case 1:return C=_r.sent(),[3,3];case 2:C=o.accessToken.secret,_r.label=3;case 3:S=It.fromString(o.accessToken.target).asArray(),R=new Date(Number(o.accessToken.expiresOn)*1e3),H=new Date(Number(o.accessToken.extendedExpiresOn)*1e3),_r.label=4;case 4:return o.appMetadata&&(ye=o.appMetadata.familyId===ea?ea:_.EMPTY_STRING),tt=s?.claims.oid||s?.claims.sub||_.EMPTY_STRING,_o=s?.claims.tid||_.EMPTY_STRING,u?.spa_accountid&&o.account&&(o.account.nativeAccountId=u?.spa_accountid),[2,{authority:t.canonicalAuthority,uniqueId:tt,tenantId:_o,scopes:S,account:o.account?o.account.getAccountInfo():null,idToken:s?s.rawToken:_.EMPTY_STRING,idTokenClaims:s?s.claims:{},accessToken:C,fromCache:i,expiresOn:R,correlationId:n.correlationId,requestId:h||_.EMPTY_STRING,extExpiresOn:H,familyId:ye,tokenType:((p=o.accessToken)===null||p===void 0?void 0:p.tokenType)||_.EMPTY_STRING,state:a?a.userRequestState:_.EMPTY_STRING,cloudGraphHostName:((f=o.account)===null||f===void 0?void 0:f.cloudGraphHostName)||_.EMPTY_STRING,msGraphHost:((b=o.account)===null||b===void 0?void 0:b.msGraphHost)||_.EMPTY_STRING,code:u?.spa_code,fromNativeBroker:!1}]}})})},r}();var Tu=function(r){nt(e,r);function e(t,o){var i=r.call(this,t,o)||this;return i.includeRedirectUri=!0,i}return e.prototype.getAuthCodeUrl=function(t){var o,i;return le(this,void 0,void 0,function(){var n;return ce(this,function(s){switch(s.label){case 0:return(o=this.performanceClient)===null||o===void 0||o.addQueueMeasurement($.GetAuthCodeUrl,t.correlationId),(i=this.performanceClient)===null||i===void 0||i.setPreQueueTime($.AuthClientCreateQueryString,t.correlationId),[4,this.createAuthCodeUrlQueryString(t)];case 1:return n=s.sent(),[2,Se.appendQueryString(this.authority.authorizationEndpoint,n)]}})})},e.prototype.acquireToken=function(t,o){var i,n,s,a,u,h;return le(this,void 0,void 0,function(){var p,f,b,C,S,R,H=this;return ce(this,function(ye){switch(ye.label){case 0:if(!t||!t.code)throw U.createTokenRequestCannotBeMadeError();return(i=this.performanceClient)===null||i===void 0||i.addQueueMeasurement($.AuthClientAcquireToken,t.correlationId),p=(n=this.performanceClient)===null||n===void 0?void 0:n.startMeasurement("AuthCodeClientAcquireToken",t.correlationId),this.logger.info("in acquireToken call in auth-code client"),f=st.nowSeconds(),(s=this.performanceClient)===null||s===void 0||s.setPreQueueTime($.AuthClientExecuteTokenRequest,t.correlationId),[4,this.executeTokenRequest(this.authority,t)];case 1:return b=ye.sent(),C=(a=b.headers)===null||a===void 0?void 0:a[Ft.X_MS_REQUEST_ID],S=(u=b.headers)===null||u===void 0?void 0:u[Ft.X_MS_HTTP_VERSION],S&&p?.addStaticFields({httpVerAuthority:S}),R=new ro(this.config.authOptions.clientId,this.cacheManager,this.cryptoUtils,this.logger,this.config.serializableCache,this.config.persistencePlugin,this.performanceClient),R.validateTokenResponse(b.body),(h=this.performanceClient)===null||h===void 0||h.setPreQueueTime($.HandleServerTokenResponse,t.correlationId),[2,R.handleServerTokenResponse(b.body,this.authority,f,t,o,void 0,void 0,void 0,C).then(function(ie){return p?.endMeasurement({success:!0}),ie}).catch(function(ie){throw H.logger.verbose("Error in fetching token in ACC",t.correlationId),p?.endMeasurement({errorCode:ie.errorCode,subErrorCode:ie.subError,success:!1}),ie})]}})})},e.prototype.handleFragmentResponse=function(t,o){var i=new ro(this.config.authOptions.clientId,this.cacheManager,this.cryptoUtils,this.logger,null,null),n=new Se(t),s=Se.getDeserializedHash(n.getHash());if(i.validateServerAuthorizationCodeResponse(s,o,this.cryptoUtils),!s.code)throw U.createNoAuthCodeInServerResponseError();return rt(rt({},s),{code:s.code})},e.prototype.getLogoutUri=function(t){if(!t)throw je.createEmptyLogoutRequestError();var o=this.createLogoutUrlQueryString(t);return Se.appendQueryString(this.authority.endSessionEndpoint,o)},e.prototype.executeTokenRequest=function(t,o){var i,n;return le(this,void 0,void 0,function(){var s,a,u,h,p,f,b;return ce(this,function(C){switch(C.label){case 0:return(i=this.performanceClient)===null||i===void 0||i.addQueueMeasurement($.AuthClientExecuteTokenRequest,o.correlationId),(n=this.performanceClient)===null||n===void 0||n.setPreQueueTime($.AuthClientCreateTokenRequestBody,o.correlationId),s=this.createTokenQueryParameters(o),a=Se.appendQueryString(t.tokenEndpoint,s),[4,this.createTokenRequestBody(o)];case 1:if(u=C.sent(),h=void 0,o.clientInfo)try{p=ra(o.clientInfo,this.cryptoUtils),h={credential:""+p.uid+Lt.CLIENT_INFO_SEPARATOR+p.utid,type:wr.HOME_ACCOUNT_ID}}catch(S){this.logger.verbose("Could not parse client info for CCS Header: "+S)}return f=this.createTokenRequestHeaders(h||o.ccsCredential),b={clientId:this.config.authOptions.clientId,authority:t.canonicalAuthority,scopes:o.scopes,claims:o.claims,authenticationScheme:o.authenticationScheme,resourceRequestMethod:o.resourceRequestMethod,resourceRequestUri:o.resourceRequestUri,shrClaims:o.shrClaims,sshKid:o.sshKid},[2,this.executePostToTokenEndpoint(a,u,f,b)]}})})},e.prototype.createTokenRequestBody=function(t){var o,i;return le(this,void 0,void 0,function(){var n,s,a,u,h,p,f,f,b;return ce(this,function(C){switch(C.label){case 0:return(o=this.performanceClient)===null||o===void 0||o.addQueueMeasurement($.AuthClientCreateTokenRequestBody,t.correlationId),n=new Lr,n.addClientId(this.config.authOptions.clientId),this.includeRedirectUri?n.addRedirectUri(t.redirectUri):us.validateRedirectUri(t.redirectUri),n.addScopes(t.scopes),n.addAuthorizationCode(t.code),n.addLibraryInfo(this.config.libraryInfo),n.addApplicationTelemetry(this.config.telemetry.application),n.addThrottling(),this.serverTelemetryManager&&n.addServerTelemetry(this.serverTelemetryManager),t.codeVerifier&&n.addCodeVerifier(t.codeVerifier),this.config.clientCredentials.clientSecret&&n.addClientSecret(this.config.clientCredentials.clientSecret),this.config.clientCredentials.clientAssertion&&(s=this.config.clientCredentials.clientAssertion,n.addClientAssertion(s.assertion),n.addClientAssertionType(s.assertionType)),n.addGrantType(Uo.AUTHORIZATION_CODE_GRANT),n.addClientInfo(),t.authenticationScheme!==Be.POP?[3,2]:(a=new ai(this.cryptoUtils,this.performanceClient),(i=this.performanceClient)===null||i===void 0||i.setPreQueueTime($.PopTokenGenerateCnf,t.correlationId),[4,a.generateCnf(t)]);case 1:return u=C.sent(),n.addPopToken(u.reqCnfString),[3,3];case 2:if(t.authenticationScheme===Be.SSH)if(t.sshJwk)n.addSshJwk(t.sshJwk);else throw je.createMissingSshJwkError();C.label=3;case 3:if(h=t.correlationId||this.config.cryptoInterface.createNewGuid(),n.addCorrelationId(h),(!z.isEmptyObj(t.claims)||this.config.authOptions.clientCapabilities&&this.config.authOptions.clientCapabilities.length>0)&&n.addClaims(t.claims,this.config.authOptions.clientCapabilities),p=void 0,t.clientInfo)try{f=ra(t.clientInfo,this.cryptoUtils),p={credential:""+f.uid+Lt.CLIENT_INFO_SEPARATOR+f.utid,type:wr.HOME_ACCOUNT_ID}}catch(S){this.logger.verbose("Could not parse client info for CCS Header: "+S)}else p=t.ccsCredential;if(this.config.systemOptions.preventCorsPreflight&&p)switch(p.type){case wr.HOME_ACCOUNT_ID:try{f=En(p.credential),n.addCcsOid(f)}catch(S){this.logger.verbose("Could not parse home account ID for CCS Header: "+S)}break;case wr.UPN:n.addCcsUpn(p.credential);break}return t.tokenBodyParameters&&n.addExtraQueryParameters(t.tokenBodyParameters),t.enableSpaAuthorizationCode&&(!t.tokenBodyParameters||!t.tokenBodyParameters[Ne.RETURN_SPA_CODE])&&n.addExtraQueryParameters((b={},b[Ne.RETURN_SPA_CODE]="1",b)),[2,n.createQueryString()]}})})},e.prototype.createAuthCodeUrlQueryString=function(t){var o;return le(this,void 0,void 0,function(){var i,n,s,a,u,h,h,h,p,f;return ce(this,function(b){switch(b.label){case 0:if((o=this.performanceClient)===null||o===void 0||o.addQueueMeasurement($.AuthClientCreateQueryString,t.correlationId),i=new Lr,i.addClientId(this.config.authOptions.clientId),n=Js(t.scopes||[],t.extraScopesToConsent||[]),i.addScopes(n),i.addRedirectUri(t.redirectUri),s=t.correlationId||this.config.cryptoInterface.createNewGuid(),i.addCorrelationId(s),i.addResponseMode(t.responseMode),i.addResponseTypeCode(),i.addLibraryInfo(this.config.libraryInfo),i.addApplicationTelemetry(this.config.telemetry.application),i.addClientInfo(),t.codeChallenge&&t.codeChallengeMethod&&i.addCodeChallengeParams(t.codeChallenge,t.codeChallengeMethod),t.prompt&&i.addPrompt(t.prompt),t.domainHint&&i.addDomainHint(t.domainHint),t.prompt!==or.SELECT_ACCOUNT)if(t.sid&&t.prompt===or.NONE)this.logger.verbose("createAuthCodeUrlQueryString: Prompt is none, adding sid from request"),i.addSid(t.sid);else if(t.account){if(a=this.extractAccountSid(t.account),u=this.extractLoginHint(t.account),u){this.logger.verbose("createAuthCodeUrlQueryString: login_hint claim present on account"),i.addLoginHint(u);try{h=En(t.account.homeAccountId),i.addCcsOid(h)}catch{this.logger.verbose("createAuthCodeUrlQueryString: Could not parse home account ID for CCS Header")}}else if(a&&t.prompt===or.NONE){this.logger.verbose("createAuthCodeUrlQueryString: Prompt is none, adding sid from account"),i.addSid(a);try{h=En(t.account.homeAccountId),i.addCcsOid(h)}catch{this.logger.verbose("createAuthCodeUrlQueryString: Could not parse home account ID for CCS Header")}}else if(t.loginHint)this.logger.verbose("createAuthCodeUrlQueryString: Adding login_hint from request"),i.addLoginHint(t.loginHint),i.addCcsUpn(t.loginHint);else if(t.account.username){this.logger.verbose("createAuthCodeUrlQueryString: Adding login_hint from account"),i.addLoginHint(t.account.username);try{h=En(t.account.homeAccountId),i.addCcsOid(h)}catch{this.logger.verbose("createAuthCodeUrlQueryString: Could not parse home account ID for CCS Header")}}}else t.loginHint&&(this.logger.verbose("createAuthCodeUrlQueryString: No account, adding login_hint from request"),i.addLoginHint(t.loginHint),i.addCcsUpn(t.loginHint));else this.logger.verbose("createAuthCodeUrlQueryString: Prompt is select_account, ignoring account hints");return t.nonce&&i.addNonce(t.nonce),t.state&&i.addState(t.state),(!z.isEmpty(t.claims)||this.config.authOptions.clientCapabilities&&this.config.authOptions.clientCapabilities.length>0)&&i.addClaims(t.claims,this.config.authOptions.clientCapabilities),t.extraQueryParameters&&i.addExtraQueryParameters(t.extraQueryParameters),t.nativeBroker?(i.addNativeBroker(),t.authenticationScheme!==Be.POP?[3,2]:(p=new ai(this.cryptoUtils),[4,p.generateCnf(t)])):[3,2];case 1:f=b.sent(),i.addPopToken(f.reqCnfString),b.label=2;case 2:return[2,i.createQueryString()]}})})},e.prototype.createLogoutUrlQueryString=function(t){var o=new Lr;return t.postLogoutRedirectUri&&o.addPostLogoutRedirectUri(t.postLogoutRedirectUri),t.correlationId&&o.addCorrelationId(t.correlationId),t.idTokenHint&&o.addIdTokenHint(t.idTokenHint),t.state&&o.addState(t.state),t.logoutHint&&o.addLogoutHint(t.logoutHint),t.extraQueryParameters&&o.addExtraQueryParameters(t.extraQueryParameters),o.createQueryString()},e.prototype.extractAccountSid=function(t){var o;return((o=t.idTokenClaims)===null||o===void 0?void 0:o.sid)||null},e.prototype.extractLoginHint=function(t){var o;return((o=t.idTokenClaims)===null||o===void 0?void 0:o.login_hint)||null},e}(Bo);l();c();d();var y9=function(r){nt(e,r);function e(t){return r.call(this,t)||this}return e.prototype.acquireToken=function(t){return le(this,void 0,void 0,function(){var o,i,n,s;return ce(this,function(a){switch(a.label){case 0:return[4,this.getDeviceCode(t)];case 1:return o=a.sent(),t.deviceCodeCallback(o),i=st.nowSeconds(),[4,this.acquireTokenWithDeviceCode(t,o)];case 2:return n=a.sent(),s=new ro(this.config.authOptions.clientId,this.cacheManager,this.cryptoUtils,this.logger,this.config.serializableCache,this.config.persistencePlugin),s.validateTokenResponse(n),[4,s.handleServerTokenResponse(n,this.authority,i,t)];case 3:return[2,a.sent()]}})})},e.prototype.getDeviceCode=function(t){return le(this,void 0,void 0,function(){var o,i,n,s,a;return ce(this,function(u){return o=this.createExtraQueryParameters(t),i=Se.appendQueryString(this.authority.deviceCodeEndpoint,o),n=this.createQueryString(t),s=this.createTokenRequestHeaders(),a={clientId:this.config.authOptions.clientId,authority:t.authority,scopes:t.scopes,claims:t.claims,authenticationScheme:t.authenticationScheme,resourceRequestMethod:t.resourceRequestMethod,resourceRequestUri:t.resourceRequestUri,shrClaims:t.shrClaims,sshKid:t.sshKid},[2,this.executePostRequestToDeviceCodeEndpoint(i,n,s,a)]})})},e.prototype.createExtraQueryParameters=function(t){var o=new Lr;return t.extraQueryParameters&&o.addExtraQueryParameters(t.extraQueryParameters),o.createQueryString()},e.prototype.executePostRequestToDeviceCodeEndpoint=function(t,o,i,n){return le(this,void 0,void 0,function(){var s,a,u,h,p,f,b;return ce(this,function(C){switch(C.label){case 0:return[4,this.networkManager.sendPostRequest(n,t,{body:o,headers:i})];case 1:return s=C.sent().body,a=s.user_code,u=s.device_code,h=s.verification_uri,p=s.expires_in,f=s.interval,b=s.message,[2,{userCode:a,deviceCode:u,verificationUri:h,expiresIn:p,interval:f,message:b}]}})})},e.prototype.createQueryString=function(t){var o=new Lr;return o.addScopes(t.scopes),o.addClientId(this.config.authOptions.clientId),t.extraQueryParameters&&o.addExtraQueryParameters(t.extraQueryParameters),(!z.isEmpty(t.claims)||this.config.authOptions.clientCapabilities&&this.config.authOptions.clientCapabilities.length>0)&&o.addClaims(t.claims,this.config.authOptions.clientCapabilities),o.createQueryString()},e.prototype.continuePolling=function(t,o,i){if(i)throw this.logger.error("Token request cancelled by setting DeviceCodeRequest.cancel = true"),U.createDeviceCodeCancelledError();if(o&&oo)throw this.logger.error("User defined timeout for device code polling reached. The timeout was set for "+o),U.createUserTimeoutReachedError();if(st.nowSeconds()>t)throw o&&this.logger.verbose("User specified timeout ignored as the device code has expired before the timeout elapsed. The user specified timeout was set for "+o),this.logger.error("Device code expired. Expiration time of device code was "+t),U.createDeviceCodeExpiredError();return!0},e.prototype.acquireTokenWithDeviceCode=function(t,o){return le(this,void 0,void 0,function(){var i,n,s,a,u,h,p,f,b;return ce(this,function(C){switch(C.label){case 0:i=this.createTokenQueryParameters(t),n=Se.appendQueryString(this.authority.tokenEndpoint,i),s=this.createTokenRequestBody(t,o),a=this.createTokenRequestHeaders(),u=t.timeout?st.nowSeconds()+t.timeout:void 0,h=st.nowSeconds()+o.expiresIn,p=o.interval*1e3,C.label=1;case 1:return this.continuePolling(h,u,t.cancel)?(f={clientId:this.config.authOptions.clientId,authority:t.authority,scopes:t.scopes,claims:t.claims,authenticationScheme:t.authenticationScheme,resourceRequestMethod:t.resourceRequestMethod,resourceRequestUri:t.resourceRequestUri,shrClaims:t.shrClaims,sshKid:t.sshKid},[4,this.executePostToTokenEndpoint(n,s,a,f)]):[3,8];case 2:return b=C.sent(),b.body&&b.body.error?b.body.error!==_.AUTHORIZATION_PENDING?[3,4]:(this.logger.info("Authorization pending. Continue polling."),[4,st.delay(p)]):[3,6];case 3:return C.sent(),[3,5];case 4:throw this.logger.info("Unexpected error in polling from the server"),eo.createPostRequestFailed(b.body.error);case 5:return[3,7];case 6:return this.logger.verbose("Authorization completed successfully. Polling stopped."),[2,b.body];case 7:return[3,1];case 8:throw this.logger.error("Polling stopped for unknown reasons."),U.createDeviceCodeUnknownError()}})})},e.prototype.createTokenRequestBody=function(t,o){var i=new Lr;i.addScopes(t.scopes),i.addClientId(this.config.authOptions.clientId),i.addGrantType(Uo.DEVICE_CODE_GRANT),i.addDeviceCode(o.deviceCode);var n=t.correlationId||this.config.cryptoInterface.createNewGuid();return i.addCorrelationId(n),i.addClientInfo(),i.addLibraryInfo(this.config.libraryInfo),i.addApplicationTelemetry(this.config.telemetry.application),i.addThrottling(),this.serverTelemetryManager&&i.addServerTelemetry(this.serverTelemetryManager),(!z.isEmptyObj(t.claims)||this.config.authOptions.clientCapabilities&&this.config.authOptions.clientCapabilities.length>0)&&i.addClaims(t.claims,this.config.authOptions.clientCapabilities),i.createQueryString()},e}(Bo);l();c();d();var Eu=function(r){nt(e,r);function e(t,o){return r.call(this,t,o)||this}return e.prototype.acquireToken=function(t){var o,i,n,s,a,u,h;return le(this,void 0,void 0,function(){var p,f,b,C,S,R,H=this;return ce(this,function(ye){switch(ye.label){case 0:return(o=this.performanceClient)===null||o===void 0||o.addQueueMeasurement($.RefreshTokenClientAcquireToken,t.correlationId),p=(i=this.performanceClient)===null||i===void 0?void 0:i.startMeasurement($.RefreshTokenClientAcquireToken,t.correlationId),this.logger.verbose("RefreshTokenClientAcquireToken called",t.correlationId),f=st.nowSeconds(),(n=this.performanceClient)===null||n===void 0||n.setPreQueueTime($.RefreshTokenClientExecuteTokenRequest,t.correlationId),[4,this.executeTokenRequest(t,this.authority)];case 1:return b=ye.sent(),C=(s=b.headers)===null||s===void 0?void 0:s[Ft.X_MS_HTTP_VERSION],p?.addStaticFields({refreshTokenSize:((a=b.body.refresh_token)===null||a===void 0?void 0:a.length)||0}),C&&p?.addStaticFields({httpVerToken:C}),S=(u=b.headers)===null||u===void 0?void 0:u[Ft.X_MS_REQUEST_ID],R=new ro(this.config.authOptions.clientId,this.cacheManager,this.cryptoUtils,this.logger,this.config.serializableCache,this.config.persistencePlugin),R.validateTokenResponse(b.body),(h=this.performanceClient)===null||h===void 0||h.setPreQueueTime($.HandleServerTokenResponse,t.correlationId),[2,R.handleServerTokenResponse(b.body,this.authority,f,t,void 0,void 0,!0,t.forceCache,S).then(function(ie){return p?.endMeasurement({success:!0}),ie}).catch(function(ie){throw H.logger.verbose("Error in fetching refresh token",t.correlationId),p?.endMeasurement({errorCode:ie.errorCode,subErrorCode:ie.subError,success:!1}),ie})]}})})},e.prototype.acquireTokenByRefreshToken=function(t){var o,i,n,s;return le(this,void 0,void 0,function(){var a,u,h;return ce(this,function(p){if(!t)throw je.createEmptyTokenRequestError();if((o=this.performanceClient)===null||o===void 0||o.addQueueMeasurement($.RefreshTokenClientAcquireTokenByRefreshToken,t.correlationId),!t.account)throw U.createNoAccountInSilentRequestError();if(a=this.cacheManager.isAppMetadataFOCI(t.account.environment),a)try{return(i=this.performanceClient)===null||i===void 0||i.setPreQueueTime($.RefreshTokenClientAcquireTokenWithCachedRefreshToken,t.correlationId),[2,this.acquireTokenWithCachedRefreshToken(t,!0)]}catch(f){if(u=f instanceof Cr&&f.errorCode===An.noTokensFoundError.code,h=f instanceof eo&&f.errorCode===Tf.INVALID_GRANT_ERROR&&f.subError===Tf.CLIENT_MISMATCH_ERROR,u||h)return(n=this.performanceClient)===null||n===void 0||n.setPreQueueTime($.RefreshTokenClientAcquireTokenWithCachedRefreshToken,t.correlationId),[2,this.acquireTokenWithCachedRefreshToken(t,!1)];throw f}return(s=this.performanceClient)===null||s===void 0||s.setPreQueueTime($.RefreshTokenClientAcquireTokenWithCachedRefreshToken,t.correlationId),[2,this.acquireTokenWithCachedRefreshToken(t,!1)]})})},e.prototype.acquireTokenWithCachedRefreshToken=function(t,o){var i,n,s;return le(this,void 0,void 0,function(){var a,u,h;return ce(this,function(p){if((i=this.performanceClient)===null||i===void 0||i.addQueueMeasurement($.RefreshTokenClientAcquireTokenWithCachedRefreshToken,t.correlationId),a=(n=this.performanceClient)===null||n===void 0?void 0:n.startMeasurement($.RefreshTokenClientAcquireTokenWithCachedRefreshToken,t.correlationId),this.logger.verbose("RefreshTokenClientAcquireTokenWithCachedRefreshToken called",t.correlationId),u=this.cacheManager.getRefreshToken(t.account,o),!u)throw a?.discardMeasurement(),Cr.createNoTokensFoundError();return a?.endMeasurement({success:!0}),h=rt(rt({},t),{refreshToken:u.secret,authenticationScheme:t.authenticationScheme||Be.BEARER,ccsCredential:{credential:t.account.homeAccountId,type:wr.HOME_ACCOUNT_ID}}),(s=this.performanceClient)===null||s===void 0||s.setPreQueueTime($.RefreshTokenClientAcquireToken,t.correlationId),[2,this.acquireToken(h)]})})},e.prototype.executeTokenRequest=function(t,o){var i,n,s;return le(this,void 0,void 0,function(){var a,u,h,p,f,b;return ce(this,function(C){switch(C.label){case 0:return(i=this.performanceClient)===null||i===void 0||i.addQueueMeasurement($.RefreshTokenClientExecuteTokenRequest,t.correlationId),a=(n=this.performanceClient)===null||n===void 0?void 0:n.startMeasurement($.RefreshTokenClientExecuteTokenRequest,t.correlationId),(s=this.performanceClient)===null||s===void 0||s.setPreQueueTime($.RefreshTokenClientCreateTokenRequestBody,t.correlationId),u=this.createTokenQueryParameters(t),h=Se.appendQueryString(o.tokenEndpoint,u),[4,this.createTokenRequestBody(t)];case 1:return p=C.sent(),f=this.createTokenRequestHeaders(t.ccsCredential),b={clientId:this.config.authOptions.clientId,authority:o.canonicalAuthority,scopes:t.scopes,claims:t.claims,authenticationScheme:t.authenticationScheme,resourceRequestMethod:t.resourceRequestMethod,resourceRequestUri:t.resourceRequestUri,shrClaims:t.shrClaims,sshKid:t.sshKid},[2,this.executePostToTokenEndpoint(h,p,f,b).then(function(S){return a?.endMeasurement({success:!0}),S}).catch(function(S){throw a?.endMeasurement({success:!1}),S})]}})})},e.prototype.createTokenRequestBody=function(t){var o,i,n;return le(this,void 0,void 0,function(){var s,a,u,h,p,f,b;return ce(this,function(C){switch(C.label){case 0:return(o=this.performanceClient)===null||o===void 0||o.addQueueMeasurement($.RefreshTokenClientCreateTokenRequestBody,t.correlationId),s=t.correlationId,a=(i=this.performanceClient)===null||i===void 0?void 0:i.startMeasurement($.BaseClientCreateTokenRequestHeaders,s),u=new Lr,u.addClientId(this.config.authOptions.clientId),u.addScopes(t.scopes),u.addGrantType(Uo.REFRESH_TOKEN_GRANT),u.addClientInfo(),u.addLibraryInfo(this.config.libraryInfo),u.addApplicationTelemetry(this.config.telemetry.application),u.addThrottling(),this.serverTelemetryManager&&u.addServerTelemetry(this.serverTelemetryManager),u.addCorrelationId(s),u.addRefreshToken(t.refreshToken),this.config.clientCredentials.clientSecret&&u.addClientSecret(this.config.clientCredentials.clientSecret),this.config.clientCredentials.clientAssertion&&(h=this.config.clientCredentials.clientAssertion,u.addClientAssertion(h.assertion),u.addClientAssertionType(h.assertionType)),t.authenticationScheme!==Be.POP?[3,2]:(p=new ai(this.cryptoUtils,this.performanceClient),(n=this.performanceClient)===null||n===void 0||n.setPreQueueTime($.PopTokenGenerateCnf,t.correlationId),[4,p.generateCnf(t)]);case 1:return f=C.sent(),u.addPopToken(f.reqCnfString),[3,3];case 2:if(t.authenticationScheme===Be.SSH)if(t.sshJwk)u.addSshJwk(t.sshJwk);else throw a?.endMeasurement({success:!1}),je.createMissingSshJwkError();C.label=3;case 3:if((!z.isEmptyObj(t.claims)||this.config.authOptions.clientCapabilities&&this.config.authOptions.clientCapabilities.length>0)&&u.addClaims(t.claims,this.config.authOptions.clientCapabilities),this.config.systemOptions.preventCorsPreflight&&t.ccsCredential)switch(t.ccsCredential.type){case wr.HOME_ACCOUNT_ID:try{b=En(t.ccsCredential.credential),u.addCcsOid(b)}catch(S){this.logger.verbose("Could not parse home account ID for CCS Header: "+S)}break;case wr.UPN:u.addCcsUpn(t.ccsCredential.credential);break}return a?.endMeasurement({success:!0}),[2,u.createQueryString()]}})})},e}(Bo);l();c();d();var b9=function(r){nt(e,r);function e(t,o){var i=r.call(this,t)||this;return i.appTokenProvider=o,i}return e.prototype.acquireToken=function(t){return le(this,void 0,void 0,function(){var o;return ce(this,function(i){switch(i.label){case 0:return this.scopeSet=new It(t.scopes||[]),t.skipCache?[4,this.executeTokenRequest(t,this.authority)]:[3,2];case 1:return[2,i.sent()];case 2:return[4,this.getCachedAuthenticationResult(t)];case 3:return o=i.sent(),o?[2,o]:[3,4];case 4:return[4,this.executeTokenRequest(t,this.authority)];case 5:return[2,i.sent()]}})})},e.prototype.getCachedAuthenticationResult=function(t){var o,i;return le(this,void 0,void 0,function(){var n;return ce(this,function(s){switch(s.label){case 0:return n=this.readAccessTokenFromCache(),n?st.isTokenExpired(n.expiresOn,this.config.systemOptions.tokenRenewalOffsetSeconds)?((i=this.serverTelemetryManager)===null||i===void 0||i.setCacheOutcome(vo.CACHED_ACCESS_TOKEN_EXPIRED),[2,null]):[4,ro.generateAuthenticationResult(this.cryptoUtils,this.authority,{account:null,idToken:null,accessToken:n,refreshToken:null,appMetadata:null},!0,t)]:((o=this.serverTelemetryManager)===null||o===void 0||o.setCacheOutcome(vo.NO_CACHED_ACCESS_TOKEN),[2,null]);case 1:return[2,s.sent()]}})})},e.prototype.readAccessTokenFromCache=function(){var t={homeAccountId:_.EMPTY_STRING,environment:this.authority.canonicalAuthorityUrlComponents.HostNameAndPort,credentialType:ue.ACCESS_TOKEN,clientId:this.config.authOptions.clientId,realm:this.authority.tenant,target:It.createSearchScopes(this.scopeSet.asArray())},o=this.cacheManager.getAccessTokensByFilter(t);if(o.length<1)return null;if(o.length>1)throw U.createMultipleMatchingTokensInCacheError();return o[0]},e.prototype.executeTokenRequest=function(t,o){return le(this,void 0,void 0,function(){var i,n,s,a,u,h,p,f,b,C,S,R;return ce(this,function(H){switch(H.label){case 0:return this.appTokenProvider?(this.logger.info("Using appTokenProvider extensibility."),s={correlationId:t.correlationId,tenantId:this.config.authOptions.authority.tenant,scopes:t.scopes,claims:t.claims},n=st.nowSeconds(),[4,this.appTokenProvider(s)]):[3,2];case 1:return a=H.sent(),i={access_token:a.accessToken,expires_in:a.expiresInSeconds,refresh_in:a.refreshInSeconds,token_type:Be.BEARER},[3,4];case 2:return u=this.createTokenQueryParameters(t),h=Se.appendQueryString(o.tokenEndpoint,u),p=this.createTokenRequestBody(t),f=this.createTokenRequestHeaders(),b={clientId:this.config.authOptions.clientId,authority:t.authority,scopes:t.scopes,claims:t.claims,authenticationScheme:t.authenticationScheme,resourceRequestMethod:t.resourceRequestMethod,resourceRequestUri:t.resourceRequestUri,shrClaims:t.shrClaims,sshKid:t.sshKid},n=st.nowSeconds(),[4,this.executePostToTokenEndpoint(h,p,f,b)];case 3:C=H.sent(),i=C.body,H.label=4;case 4:return S=new ro(this.config.authOptions.clientId,this.cacheManager,this.cryptoUtils,this.logger,this.config.serializableCache,this.config.persistencePlugin),S.validateTokenResponse(i),[4,S.handleServerTokenResponse(i,this.authority,n,t)];case 5:return R=H.sent(),[2,R]}})})},e.prototype.createTokenRequestBody=function(t){var o=new Lr;o.addClientId(this.config.authOptions.clientId),o.addScopes(t.scopes,!1),o.addGrantType(Uo.CLIENT_CREDENTIALS_GRANT),o.addLibraryInfo(this.config.libraryInfo),o.addApplicationTelemetry(this.config.telemetry.application),o.addThrottling(),this.serverTelemetryManager&&o.addServerTelemetry(this.serverTelemetryManager);var i=t.correlationId||this.config.cryptoInterface.createNewGuid();o.addCorrelationId(i),this.config.clientCredentials.clientSecret&&o.addClientSecret(this.config.clientCredentials.clientSecret);var n=t.clientAssertion||this.config.clientCredentials.clientAssertion;return n&&(o.addClientAssertion(n.assertion),o.addClientAssertionType(n.assertionType)),(!z.isEmptyObj(t.claims)||this.config.authOptions.clientCapabilities&&this.config.authOptions.clientCapabilities.length>0)&&o.addClaims(t.claims,this.config.authOptions.clientCapabilities),o.createQueryString()},e}(Bo);l();c();d();var w9=function(r){nt(e,r);function e(t){return r.call(this,t)||this}return e.prototype.acquireToken=function(t){return le(this,void 0,void 0,function(){var o;return ce(this,function(i){switch(i.label){case 0:return this.scopeSet=new It(t.scopes||[]),o=this,[4,this.cryptoUtils.hashString(t.oboAssertion)];case 1:return o.userAssertionHash=i.sent(),t.skipCache?[4,this.executeTokenRequest(t,this.authority,this.userAssertionHash)]:[3,3];case 2:return[2,i.sent()];case 3:return i.trys.push([3,5,,7]),[4,this.getCachedAuthenticationResult(t)];case 4:return[2,i.sent()];case 5:return i.sent(),[4,this.executeTokenRequest(t,this.authority,this.userAssertionHash)];case 6:return[2,i.sent()];case 7:return[2]}})})},e.prototype.getCachedAuthenticationResult=function(t){var o,i;return le(this,void 0,void 0,function(){var n,s,a,u,h,p;return ce(this,function(f){switch(f.label){case 0:if(n=this.readAccessTokenFromCacheForOBO(this.config.authOptions.clientId,t),n){if(st.isTokenExpired(n.expiresOn,this.config.systemOptions.tokenRenewalOffsetSeconds))throw(i=this.serverTelemetryManager)===null||i===void 0||i.setCacheOutcome(vo.CACHED_ACCESS_TOKEN_EXPIRED),this.logger.info("OnbehalfofFlow:getCachedAuthenticationResult - Cached access token is expired or will expire within "+this.config.systemOptions.tokenRenewalOffsetSeconds+" seconds."),U.createRefreshRequiredError()}else throw(o=this.serverTelemetryManager)===null||o===void 0||o.setCacheOutcome(vo.NO_CACHED_ACCESS_TOKEN),this.logger.info("SilentFlowClient:acquireCachedToken - No access token found in cache for the given properties."),U.createRefreshRequiredError();return s=this.readIdTokenFromCacheForOBO(n.homeAccountId),u=null,s&&(a=new fr(s.secret,this.config.cryptoInterface),h=a.claims.oid?a.claims.oid:a.claims.sub,p={homeAccountId:s.homeAccountId,environment:s.environment,tenantId:s.realm,username:_.EMPTY_STRING,localAccountId:h||_.EMPTY_STRING},u=this.cacheManager.readAccountFromCache(p)),this.config.serverTelemetryManager&&this.config.serverTelemetryManager.incrementCacheHits(),[4,ro.generateAuthenticationResult(this.cryptoUtils,this.authority,{account:u,accessToken:n,idToken:s,refreshToken:null,appMetadata:null},!0,t,a)];case 1:return[2,f.sent()]}})})},e.prototype.readIdTokenFromCacheForOBO=function(t){var o={homeAccountId:t,environment:this.authority.canonicalAuthorityUrlComponents.HostNameAndPort,credentialType:ue.ID_TOKEN,clientId:this.config.authOptions.clientId,realm:this.authority.tenant},i=this.cacheManager.getIdTokensByFilter(o);return i.length<1?null:i[0]},e.prototype.readAccessTokenFromCacheForOBO=function(t,o){var i=o.authenticationScheme||Be.BEARER,n=i&&i.toLowerCase()!==Be.BEARER.toLowerCase()?ue.ACCESS_TOKEN_WITH_AUTH_SCHEME:ue.ACCESS_TOKEN,s={credentialType:n,clientId:t,target:It.createSearchScopes(this.scopeSet.asArray()),tokenType:i,keyId:o.sshKid,requestedClaimsHash:o.requestedClaimsHash,userAssertionHash:this.userAssertionHash},a=this.cacheManager.getAccessTokensByFilter(s),u=a.length;if(u<1)return null;if(u>1)throw U.createMultipleMatchingTokensInCacheError();return a[0]},e.prototype.executeTokenRequest=function(t,o,i){return le(this,void 0,void 0,function(){var n,s,a,u,h,p,f,b,C;return ce(this,function(S){switch(S.label){case 0:return n=this.createTokenQueryParameters(t),s=Se.appendQueryString(o.tokenEndpoint,n),a=this.createTokenRequestBody(t),u=this.createTokenRequestHeaders(),h={clientId:this.config.authOptions.clientId,authority:t.authority,scopes:t.scopes,claims:t.claims,authenticationScheme:t.authenticationScheme,resourceRequestMethod:t.resourceRequestMethod,resourceRequestUri:t.resourceRequestUri,shrClaims:t.shrClaims,sshKid:t.sshKid},p=st.nowSeconds(),[4,this.executePostToTokenEndpoint(s,a,u,h)];case 1:return f=S.sent(),b=new ro(this.config.authOptions.clientId,this.cacheManager,this.cryptoUtils,this.logger,this.config.serializableCache,this.config.persistencePlugin),b.validateTokenResponse(f.body),[4,b.handleServerTokenResponse(f.body,this.authority,p,t,void 0,i)];case 2:return C=S.sent(),[2,C]}})})},e.prototype.createTokenRequestBody=function(t){var o=new Lr;o.addClientId(this.config.authOptions.clientId),o.addScopes(t.scopes),o.addGrantType(Uo.JWT_BEARER),o.addClientInfo(),o.addLibraryInfo(this.config.libraryInfo),o.addApplicationTelemetry(this.config.telemetry.application),o.addThrottling(),this.serverTelemetryManager&&o.addServerTelemetry(this.serverTelemetryManager);var i=t.correlationId||this.config.cryptoInterface.createNewGuid();if(o.addCorrelationId(i),o.addRequestTokenUse(Ne.ON_BEHALF_OF),o.addOboAssertion(t.oboAssertion),this.config.clientCredentials.clientSecret&&o.addClientSecret(this.config.clientCredentials.clientSecret),this.config.clientCredentials.clientAssertion){var n=this.config.clientCredentials.clientAssertion;o.addClientAssertion(n.assertion),o.addClientAssertionType(n.assertionType)}return(t.claims||this.config.authOptions.clientCapabilities&&this.config.authOptions.clientCapabilities.length>0)&&o.addClaims(t.claims,this.config.authOptions.clientCapabilities),o.createQueryString()},e}(Bo);l();c();d();var fy=function(r){nt(e,r);function e(t,o){return r.call(this,t,o)||this}return e.prototype.acquireToken=function(t){return le(this,void 0,void 0,function(){var o,i;return ce(this,function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,this.acquireCachedToken(t)];case 1:return[2,n.sent()];case 2:if(o=n.sent(),o instanceof U&&o.errorCode===K.tokenRefreshRequired.code)return i=new Eu(this.config,this.performanceClient),[2,i.acquireTokenByRefreshToken(t)];throw o;case 3:return[2]}})})},e.prototype.acquireCachedToken=function(t){var o,i,n,s,a;return le(this,void 0,void 0,function(){var u,h;return ce(this,function(p){switch(p.label){case 0:if(!t)throw je.createEmptyTokenRequestError();if(t.forceRefresh)throw(o=this.serverTelemetryManager)===null||o===void 0||o.setCacheOutcome(vo.FORCE_REFRESH),this.logger.info("SilentFlowClient:acquireCachedToken - Skipping cache because forceRefresh is true."),U.createRefreshRequiredError();if(!this.config.cacheOptions.claimsBasedCachingEnabled&&!z.isEmptyObj(t.claims))throw(i=this.serverTelemetryManager)===null||i===void 0||i.setCacheOutcome(vo.CLAIMS_REQUESTED_CACHE_SKIPPED),this.logger.info("SilentFlowClient:acquireCachedToken - Skipping cache because claims-based caching is disabled and claims were requested."),U.createRefreshRequiredError();if(!t.account)throw U.createNoAccountInSilentRequestError();if(u=t.authority||this.authority.getPreferredCache(),h=this.cacheManager.readCacheRecord(t.account,t,u),h.accessToken){if(st.wasClockTurnedBack(h.accessToken.cachedAt)||st.isTokenExpired(h.accessToken.expiresOn,this.config.systemOptions.tokenRenewalOffsetSeconds))throw(s=this.serverTelemetryManager)===null||s===void 0||s.setCacheOutcome(vo.CACHED_ACCESS_TOKEN_EXPIRED),this.logger.info("SilentFlowClient:acquireCachedToken - Cached access token is expired or will expire within "+this.config.systemOptions.tokenRenewalOffsetSeconds+" seconds."),U.createRefreshRequiredError();if(h.accessToken.refreshOn&&st.isTokenExpired(h.accessToken.refreshOn,0))throw(a=this.serverTelemetryManager)===null||a===void 0||a.setCacheOutcome(vo.REFRESH_CACHED_ACCESS_TOKEN),this.logger.info("SilentFlowClient:acquireCachedToken - Cached access token's refreshOn property has been exceeded'."),U.createRefreshRequiredError()}else throw(n=this.serverTelemetryManager)===null||n===void 0||n.setCacheOutcome(vo.NO_CACHED_ACCESS_TOKEN),this.logger.info("SilentFlowClient:acquireCachedToken - No access token found in cache for the given properties."),U.createRefreshRequiredError();return this.config.serverTelemetryManager&&this.config.serverTelemetryManager.incrementCacheHits(),[4,this.generateResultFromCacheRecord(h,t)];case 1:return[2,p.sent()]}})})},e.prototype.generateResultFromCacheRecord=function(t,o){return le(this,void 0,void 0,function(){var i,n;return ce(this,function(s){switch(s.label){case 0:if(t.idToken&&(i=new fr(t.idToken.secret,this.config.cryptoInterface)),o.maxAge||o.maxAge===0){if(n=i?.claims.auth_time,!n)throw U.createAuthTimeNotFoundError();fr.checkMaxAge(n,o.maxAge)}return[4,ro.generateAuthenticationResult(this.cryptoUtils,this.authority,t,!0,o,i)];case 1:return[2,s.sent()]}})})},e}(Bo);l();c();d();var C9=function(r){nt(e,r);function e(t){return r.call(this,t)||this}return e.prototype.acquireToken=function(t){var o,i;return le(this,void 0,void 0,function(){var n,s,a,u,h,p;return ce(this,function(f){switch(f.label){case 0:return n=(o=this.performanceClient)===null||o===void 0?void 0:o.startMeasurement("UsernamePasswordClientAcquireToken",t.correlationId),this.logger.info("in acquireToken call in username-password client"),s=st.nowSeconds(),[4,this.executeTokenRequest(this.authority,t)];case 1:return a=f.sent(),u=(i=a.headers)===null||i===void 0?void 0:i[Ft.X_MS_HTTP_VERSION],n?.addStaticFields({httpVerToken:u}),h=new ro(this.config.authOptions.clientId,this.cacheManager,this.cryptoUtils,this.logger,this.config.serializableCache,this.config.persistencePlugin),h.validateTokenResponse(a.body),p=h.handleServerTokenResponse(a.body,this.authority,s,t),[2,p]}})})},e.prototype.executeTokenRequest=function(t,o){return le(this,void 0,void 0,function(){var i,n,s,a,u;return ce(this,function(h){return i=this.createTokenQueryParameters(o),n=Se.appendQueryString(t.tokenEndpoint,i),s=this.createTokenRequestBody(o),a=this.createTokenRequestHeaders({credential:o.username,type:wr.UPN}),u={clientId:this.config.authOptions.clientId,authority:t.canonicalAuthority,scopes:o.scopes,claims:o.claims,authenticationScheme:o.authenticationScheme,resourceRequestMethod:o.resourceRequestMethod,resourceRequestUri:o.resourceRequestUri,shrClaims:o.shrClaims,sshKid:o.sshKid},[2,this.executePostToTokenEndpoint(n,s,a,u)]})})},e.prototype.createTokenRequestBody=function(t){var o=new Lr;o.addClientId(this.config.authOptions.clientId),o.addUsername(t.username),o.addPassword(t.password),o.addScopes(t.scopes),o.addResponseTypeForTokenAndIdToken(),o.addGrantType(Uo.RESOURCE_OWNER_PASSWORD_GRANT),o.addClientInfo(),o.addLibraryInfo(this.config.libraryInfo),o.addApplicationTelemetry(this.config.telemetry.application),o.addThrottling(),this.serverTelemetryManager&&o.addServerTelemetry(this.serverTelemetryManager);var i=t.correlationId||this.config.cryptoInterface.createNewGuid();if(o.addCorrelationId(i),this.config.clientCredentials.clientSecret&&o.addClientSecret(this.config.clientCredentials.clientSecret),this.config.clientCredentials.clientAssertion){var n=this.config.clientCredentials.clientAssertion;o.addClientAssertion(n.assertion),o.addClientAssertionType(n.assertionType)}return(!z.isEmptyObj(t.claims)||this.config.authOptions.clientCapabilities&&this.config.authOptions.clientCapabilities.length>0)&&o.addClaims(t.claims,this.config.authOptions.clientCapabilities),this.config.systemOptions.preventCorsPreflight&&t.username&&o.addCcsUpn(t.username),o.createQueryString()},e}(Bo);l();c();d();l();c();d();function x_(r){return r.hasOwnProperty("authorization_endpoint")&&r.hasOwnProperty("token_endpoint")&&r.hasOwnProperty("issuer")&&r.hasOwnProperty("jwks_uri")}l();c();d();var k_={endpointMetadata:{"https://login.microsoftonline.com/common/":{token_endpoint:"https://login.microsoftonline.com/common/oauth2/v2.0/token",token_endpoint_auth_methods_supported:["client_secret_post","private_key_jwt","client_secret_basic"],jwks_uri:"https://login.microsoftonline.com/common/discovery/v2.0/keys",response_modes_supported:["query","fragment","form_post"],subject_types_supported:["pairwise"],id_token_signing_alg_values_supported:["RS256"],response_types_supported:["code","id_token","code id_token","id_token token"],scopes_supported:["openid","profile","email","offline_access"],issuer:"https://login.microsoftonline.com/{tenantid}/v2.0",request_uri_parameter_supported:!1,userinfo_endpoint:"https://graph.microsoft.com/oidc/userinfo",authorization_endpoint:"https://login.microsoftonline.com/common/oauth2/v2.0/authorize",device_authorization_endpoint:"https://login.microsoftonline.com/common/oauth2/v2.0/devicecode",http_logout_supported:!0,frontchannel_logout_supported:!0,end_session_endpoint:"https://login.microsoftonline.com/common/oauth2/v2.0/logout",claims_supported:["sub","iss","cloud_instance_name","cloud_instance_host_name","cloud_graph_host_name","msgraph_host","aud","exp","iat","auth_time","acr","nonce","preferred_username","name","tid","ver","at_hash","c_hash","email"],kerberos_endpoint:"https://login.microsoftonline.com/common/kerberos",tenant_region_scope:null,cloud_instance_name:"microsoftonline.com",cloud_graph_host_name:"graph.windows.net",msgraph_host:"graph.microsoft.com",rbac_url:"https://pas.windows.net"},"https://login.chinacloudapi.cn/common/":{token_endpoint:"https://login.chinacloudapi.cn/common/oauth2/v2.0/token",token_endpoint_auth_methods_supported:["client_secret_post","private_key_jwt","client_secret_basic"],jwks_uri:"https://login.chinacloudapi.cn/common/discovery/v2.0/keys",response_modes_supported:["query","fragment","form_post"],subject_types_supported:["pairwise"],id_token_signing_alg_values_supported:["RS256"],response_types_supported:["code","id_token","code id_token","id_token token"],scopes_supported:["openid","profile","email","offline_access"],issuer:"https://login.partner.microsoftonline.cn/{tenantid}/v2.0",request_uri_parameter_supported:!1,userinfo_endpoint:"https://microsoftgraph.chinacloudapi.cn/oidc/userinfo",authorization_endpoint:"https://login.chinacloudapi.cn/common/oauth2/v2.0/authorize",device_authorization_endpoint:"https://login.chinacloudapi.cn/common/oauth2/v2.0/devicecode",http_logout_supported:!0,frontchannel_logout_supported:!0,end_session_endpoint:"https://login.chinacloudapi.cn/common/oauth2/v2.0/logout",claims_supported:["sub","iss","cloud_instance_name","cloud_instance_host_name","cloud_graph_host_name","msgraph_host","aud","exp","iat","auth_time","acr","nonce","preferred_username","name","tid","ver","at_hash","c_hash","email"],kerberos_endpoint:"https://login.chinacloudapi.cn/common/kerberos",tenant_region_scope:null,cloud_instance_name:"partner.microsoftonline.cn",cloud_graph_host_name:"graph.chinacloudapi.cn",msgraph_host:"microsoftgraph.chinacloudapi.cn",rbac_url:"https://pas.chinacloudapi.cn"},"https://login.microsoftonline.us/common/":{token_endpoint:"https://login.microsoftonline.us/common/oauth2/v2.0/token",token_endpoint_auth_methods_supported:["client_secret_post","private_key_jwt","client_secret_basic"],jwks_uri:"https://login.microsoftonline.us/common/discovery/v2.0/keys",response_modes_supported:["query","fragment","form_post"],subject_types_supported:["pairwise"],id_token_signing_alg_values_supported:["RS256"],response_types_supported:["code","id_token","code id_token","id_token token"],scopes_supported:["openid","profile","email","offline_access"],issuer:"https://login.microsoftonline.us/{tenantid}/v2.0",request_uri_parameter_supported:!1,userinfo_endpoint:"https://graph.microsoft.com/oidc/userinfo",authorization_endpoint:"https://login.microsoftonline.us/common/oauth2/v2.0/authorize",device_authorization_endpoint:"https://login.microsoftonline.us/common/oauth2/v2.0/devicecode",http_logout_supported:!0,frontchannel_logout_supported:!0,end_session_endpoint:"https://login.microsoftonline.us/common/oauth2/v2.0/logout",claims_supported:["sub","iss","cloud_instance_name","cloud_instance_host_name","cloud_graph_host_name","msgraph_host","aud","exp","iat","auth_time","acr","nonce","preferred_username","name","tid","ver","at_hash","c_hash","email"],kerberos_endpoint:"https://login.microsoftonline.us/common/kerberos",tenant_region_scope:null,cloud_instance_name:"microsoftonline.us",cloud_graph_host_name:"graph.windows.net",msgraph_host:"graph.microsoft.com",rbac_url:"https://pasff.usgovcloudapi.net"},"https://login.microsoftonline.com/consumers/":{token_endpoint:"https://login.microsoftonline.com/consumers/oauth2/v2.0/token",token_endpoint_auth_methods_supported:["client_secret_post","private_key_jwt","client_secret_basic"],jwks_uri:"https://login.microsoftonline.com/consumers/discovery/v2.0/keys",response_modes_supported:["query","fragment","form_post"],subject_types_supported:["pairwise"],id_token_signing_alg_values_supported:["RS256"],response_types_supported:["code","id_token","code id_token","id_token token"],scopes_supported:["openid","profile","email","offline_access"],issuer:"https://login.microsoftonline.com/9188040d-6c67-4c5b-b112-36a304b66dad/v2.0",request_uri_parameter_supported:!1,userinfo_endpoint:"https://graph.microsoft.com/oidc/userinfo",authorization_endpoint:"https://login.microsoftonline.com/consumers/oauth2/v2.0/authorize",device_authorization_endpoint:"https://login.microsoftonline.com/consumers/oauth2/v2.0/devicecode",http_logout_supported:!0,frontchannel_logout_supported:!0,end_session_endpoint:"https://login.microsoftonline.com/consumers/oauth2/v2.0/logout",claims_supported:["sub","iss","cloud_instance_name","cloud_instance_host_name","cloud_graph_host_name","msgraph_host","aud","exp","iat","auth_time","acr","nonce","preferred_username","name","tid","ver","at_hash","c_hash","email"],kerberos_endpoint:"https://login.microsoftonline.com/consumers/kerberos",tenant_region_scope:null,cloud_instance_name:"microsoftonline.com",cloud_graph_host_name:"graph.windows.net",msgraph_host:"graph.microsoft.com",rbac_url:"https://pas.windows.net"},"https://login.chinacloudapi.cn/consumers/":{token_endpoint:"https://login.chinacloudapi.cn/consumers/oauth2/v2.0/token",token_endpoint_auth_methods_supported:["client_secret_post","private_key_jwt","client_secret_basic"],jwks_uri:"https://login.chinacloudapi.cn/consumers/discovery/v2.0/keys",response_modes_supported:["query","fragment","form_post"],subject_types_supported:["pairwise"],id_token_signing_alg_values_supported:["RS256"],response_types_supported:["code","id_token","code id_token","id_token token"],scopes_supported:["openid","profile","email","offline_access"],issuer:"https://login.partner.microsoftonline.cn/9188040d-6c67-4c5b-b112-36a304b66dad/v2.0",request_uri_parameter_supported:!1,userinfo_endpoint:"https://microsoftgraph.chinacloudapi.cn/oidc/userinfo",authorization_endpoint:"https://login.chinacloudapi.cn/consumers/oauth2/v2.0/authorize",device_authorization_endpoint:"https://login.chinacloudapi.cn/consumers/oauth2/v2.0/devicecode",http_logout_supported:!0,frontchannel_logout_supported:!0,end_session_endpoint:"https://login.chinacloudapi.cn/consumers/oauth2/v2.0/logout",claims_supported:["sub","iss","cloud_instance_name","cloud_instance_host_name","cloud_graph_host_name","msgraph_host","aud","exp","iat","auth_time","acr","nonce","preferred_username","name","tid","ver","at_hash","c_hash","email"],kerberos_endpoint:"https://login.chinacloudapi.cn/consumers/kerberos",tenant_region_scope:null,cloud_instance_name:"partner.microsoftonline.cn",cloud_graph_host_name:"graph.chinacloudapi.cn",msgraph_host:"microsoftgraph.chinacloudapi.cn",rbac_url:"https://pas.chinacloudapi.cn"},"https://login.microsoftonline.us/consumers/":{token_endpoint:"https://login.microsoftonline.us/consumers/oauth2/v2.0/token",token_endpoint_auth_methods_supported:["client_secret_post","private_key_jwt","client_secret_basic"],jwks_uri:"https://login.microsoftonline.us/consumers/discovery/v2.0/keys",response_modes_supported:["query","fragment","form_post"],subject_types_supported:["pairwise"],id_token_signing_alg_values_supported:["RS256"],response_types_supported:["code","id_token","code id_token","id_token token"],scopes_supported:["openid","profile","email","offline_access"],issuer:"https://login.microsoftonline.us/9188040d-6c67-4c5b-b112-36a304b66dad/v2.0",request_uri_parameter_supported:!1,userinfo_endpoint:"https://graph.microsoft.com/oidc/userinfo",authorization_endpoint:"https://login.microsoftonline.us/consumers/oauth2/v2.0/authorize",device_authorization_endpoint:"https://login.microsoftonline.us/consumers/oauth2/v2.0/devicecode",http_logout_supported:!0,frontchannel_logout_supported:!0,end_session_endpoint:"https://login.microsoftonline.us/consumers/oauth2/v2.0/logout",claims_supported:["sub","iss","cloud_instance_name","cloud_instance_host_name","cloud_graph_host_name","msgraph_host","aud","exp","iat","auth_time","acr","nonce","preferred_username","name","tid","ver","at_hash","c_hash","email"],kerberos_endpoint:"https://login.microsoftonline.us/consumers/kerberos",tenant_region_scope:null,cloud_instance_name:"microsoftonline.us",cloud_graph_host_name:"graph.windows.net",msgraph_host:"graph.microsoft.com",rbac_url:"https://pasff.usgovcloudapi.net"},"https://login.microsoftonline.com/organizations/":{token_endpoint:"https://login.microsoftonline.com/organizations/oauth2/v2.0/token",token_endpoint_auth_methods_supported:["client_secret_post","private_key_jwt","client_secret_basic"],jwks_uri:"https://login.microsoftonline.com/organizations/discovery/v2.0/keys",response_modes_supported:["query","fragment","form_post"],subject_types_supported:["pairwise"],id_token_signing_alg_values_supported:["RS256"],response_types_supported:["code","id_token","code id_token","id_token token"],scopes_supported:["openid","profile","email","offline_access"],issuer:"https://login.microsoftonline.com/{tenantid}/v2.0",request_uri_parameter_supported:!1,userinfo_endpoint:"https://graph.microsoft.com/oidc/userinfo",authorization_endpoint:"https://login.microsoftonline.com/organizations/oauth2/v2.0/authorize",device_authorization_endpoint:"https://login.microsoftonline.com/organizations/oauth2/v2.0/devicecode",http_logout_supported:!0,frontchannel_logout_supported:!0,end_session_endpoint:"https://login.microsoftonline.com/organizations/oauth2/v2.0/logout",claims_supported:["sub","iss","cloud_instance_name","cloud_instance_host_name","cloud_graph_host_name","msgraph_host","aud","exp","iat","auth_time","acr","nonce","preferred_username","name","tid","ver","at_hash","c_hash","email"],kerberos_endpoint:"https://login.microsoftonline.com/organizations/kerberos",tenant_region_scope:null,cloud_instance_name:"microsoftonline.com",cloud_graph_host_name:"graph.windows.net",msgraph_host:"graph.microsoft.com",rbac_url:"https://pas.windows.net"},"https://login.chinacloudapi.cn/organizations/":{token_endpoint:"https://login.chinacloudapi.cn/organizations/oauth2/v2.0/token",token_endpoint_auth_methods_supported:["client_secret_post","private_key_jwt","client_secret_basic"],jwks_uri:"https://login.chinacloudapi.cn/organizations/discovery/v2.0/keys",response_modes_supported:["query","fragment","form_post"],subject_types_supported:["pairwise"],id_token_signing_alg_values_supported:["RS256"],response_types_supported:["code","id_token","code id_token","id_token token"],scopes_supported:["openid","profile","email","offline_access"],issuer:"https://login.partner.microsoftonline.cn/{tenantid}/v2.0",request_uri_parameter_supported:!1,userinfo_endpoint:"https://microsoftgraph.chinacloudapi.cn/oidc/userinfo",authorization_endpoint:"https://login.chinacloudapi.cn/organizations/oauth2/v2.0/authorize",device_authorization_endpoint:"https://login.chinacloudapi.cn/organizations/oauth2/v2.0/devicecode",http_logout_supported:!0,frontchannel_logout_supported:!0,end_session_endpoint:"https://login.chinacloudapi.cn/organizations/oauth2/v2.0/logout",claims_supported:["sub","iss","cloud_instance_name","cloud_instance_host_name","cloud_graph_host_name","msgraph_host","aud","exp","iat","auth_time","acr","nonce","preferred_username","name","tid","ver","at_hash","c_hash","email"],kerberos_endpoint:"https://login.chinacloudapi.cn/organizations/kerberos",tenant_region_scope:null,cloud_instance_name:"partner.microsoftonline.cn",cloud_graph_host_name:"graph.chinacloudapi.cn",msgraph_host:"microsoftgraph.chinacloudapi.cn",rbac_url:"https://pas.chinacloudapi.cn"},"https://login.microsoftonline.us/organizations/":{token_endpoint:"https://login.microsoftonline.us/organizations/oauth2/v2.0/token",token_endpoint_auth_methods_supported:["client_secret_post","private_key_jwt","client_secret_basic"],jwks_uri:"https://login.microsoftonline.us/organizations/discovery/v2.0/keys",response_modes_supported:["query","fragment","form_post"],subject_types_supported:["pairwise"],id_token_signing_alg_values_supported:["RS256"],response_types_supported:["code","id_token","code id_token","id_token token"],scopes_supported:["openid","profile","email","offline_access"],issuer:"https://login.microsoftonline.us/{tenantid}/v2.0",request_uri_parameter_supported:!1,userinfo_endpoint:"https://graph.microsoft.com/oidc/userinfo",authorization_endpoint:"https://login.microsoftonline.us/organizations/oauth2/v2.0/authorize",device_authorization_endpoint:"https://login.microsoftonline.us/organizations/oauth2/v2.0/devicecode",http_logout_supported:!0,frontchannel_logout_supported:!0,end_session_endpoint:"https://login.microsoftonline.us/organizations/oauth2/v2.0/logout",claims_supported:["sub","iss","cloud_instance_name","cloud_instance_host_name","cloud_graph_host_name","msgraph_host","aud","exp","iat","auth_time","acr","nonce","preferred_username","name","tid","ver","at_hash","c_hash","email"],kerberos_endpoint:"https://login.microsoftonline.us/organizations/kerberos",tenant_region_scope:null,cloud_instance_name:"microsoftonline.us",cloud_graph_host_name:"graph.windows.net",msgraph_host:"graph.microsoft.com",rbac_url:"https://pasff.usgovcloudapi.net"}},instanceDiscoveryMetadata:{"https://login.microsoftonline.com/common/":{tenant_discovery_endpoint:"https://login.microsoftonline.com/common/v2.0/.well-known/openid-configuration","api-version":"1.1",metadata:[{preferred_network:"login.microsoftonline.com",preferred_cache:"login.windows.net",aliases:["login.microsoftonline.com","login.windows.net","login.microsoft.com","sts.windows.net"]},{preferred_network:"login.partner.microsoftonline.cn",preferred_cache:"login.partner.microsoftonline.cn",aliases:["login.partner.microsoftonline.cn","login.chinacloudapi.cn"]},{preferred_network:"login.microsoftonline.de",preferred_cache:"login.microsoftonline.de",aliases:["login.microsoftonline.de"]},{preferred_network:"login.microsoftonline.us",preferred_cache:"login.microsoftonline.us",aliases:["login.microsoftonline.us","login.usgovcloudapi.net"]},{preferred_network:"login-us.microsoftonline.com",preferred_cache:"login-us.microsoftonline.com",aliases:["login-us.microsoftonline.com"]}]},"https://login.chinacloudapi.cn/common/":{tenant_discovery_endpoint:"https://login.chinacloudapi.cn/common/v2.0/.well-known/openid-configuration","api-version":"1.1",metadata:[{preferred_network:"login.microsoftonline.com",preferred_cache:"login.windows.net",aliases:["login.microsoftonline.com","login.windows.net","login.microsoft.com","sts.windows.net"]},{preferred_network:"login.partner.microsoftonline.cn",preferred_cache:"login.partner.microsoftonline.cn",aliases:["login.partner.microsoftonline.cn","login.chinacloudapi.cn"]},{preferred_network:"login.microsoftonline.de",preferred_cache:"login.microsoftonline.de",aliases:["login.microsoftonline.de"]},{preferred_network:"login.microsoftonline.us",preferred_cache:"login.microsoftonline.us",aliases:["login.microsoftonline.us","login.usgovcloudapi.net"]},{preferred_network:"login-us.microsoftonline.com",preferred_cache:"login-us.microsoftonline.com",aliases:["login-us.microsoftonline.com"]}]},"https://login.microsoftonline.us/common/":{tenant_discovery_endpoint:"https://login.microsoftonline.us/common/v2.0/.well-known/openid-configuration","api-version":"1.1",metadata:[{preferred_network:"login.microsoftonline.com",preferred_cache:"login.windows.net",aliases:["login.microsoftonline.com","login.windows.net","login.microsoft.com","sts.windows.net"]},{preferred_network:"login.partner.microsoftonline.cn",preferred_cache:"login.partner.microsoftonline.cn",aliases:["login.partner.microsoftonline.cn","login.chinacloudapi.cn"]},{preferred_network:"login.microsoftonline.de",preferred_cache:"login.microsoftonline.de",aliases:["login.microsoftonline.de"]},{preferred_network:"login.microsoftonline.us",preferred_cache:"login.microsoftonline.us",aliases:["login.microsoftonline.us","login.usgovcloudapi.net"]},{preferred_network:"login-us.microsoftonline.com",preferred_cache:"login-us.microsoftonline.com",aliases:["login-us.microsoftonline.com"]}]},"https://login.microsoftonline.com/consumers/":{tenant_discovery_endpoint:"https://login.microsoftonline.com/consumers/v2.0/.well-known/openid-configuration","api-version":"1.1",metadata:[{preferred_network:"login.microsoftonline.com",preferred_cache:"login.windows.net",aliases:["login.microsoftonline.com","login.windows.net","login.microsoft.com","sts.windows.net"]},{preferred_network:"login.partner.microsoftonline.cn",preferred_cache:"login.partner.microsoftonline.cn",aliases:["login.partner.microsoftonline.cn","login.chinacloudapi.cn"]},{preferred_network:"login.microsoftonline.de",preferred_cache:"login.microsoftonline.de",aliases:["login.microsoftonline.de"]},{preferred_network:"login.microsoftonline.us",preferred_cache:"login.microsoftonline.us",aliases:["login.microsoftonline.us","login.usgovcloudapi.net"]},{preferred_network:"login-us.microsoftonline.com",preferred_cache:"login-us.microsoftonline.com",aliases:["login-us.microsoftonline.com"]}]},"https://login.chinacloudapi.cn/consumers/":{tenant_discovery_endpoint:"https://login.chinacloudapi.cn/consumers/v2.0/.well-known/openid-configuration","api-version":"1.1",metadata:[{preferred_network:"login.microsoftonline.com",preferred_cache:"login.windows.net",aliases:["login.microsoftonline.com","login.windows.net","login.microsoft.com","sts.windows.net"]},{preferred_network:"login.partner.microsoftonline.cn",preferred_cache:"login.partner.microsoftonline.cn",aliases:["login.partner.microsoftonline.cn","login.chinacloudapi.cn"]},{preferred_network:"login.microsoftonline.de",preferred_cache:"login.microsoftonline.de",aliases:["login.microsoftonline.de"]},{preferred_network:"login.microsoftonline.us",preferred_cache:"login.microsoftonline.us",aliases:["login.microsoftonline.us","login.usgovcloudapi.net"]},{preferred_network:"login-us.microsoftonline.com",preferred_cache:"login-us.microsoftonline.com",aliases:["login-us.microsoftonline.com"]}]},"https://login.microsoftonline.us/consumers/":{tenant_discovery_endpoint:"https://login.microsoftonline.us/consumers/v2.0/.well-known/openid-configuration","api-version":"1.1",metadata:[{preferred_network:"login.microsoftonline.com",preferred_cache:"login.windows.net",aliases:["login.microsoftonline.com","login.windows.net","login.microsoft.com","sts.windows.net"]},{preferred_network:"login.partner.microsoftonline.cn",preferred_cache:"login.partner.microsoftonline.cn",aliases:["login.partner.microsoftonline.cn","login.chinacloudapi.cn"]},{preferred_network:"login.microsoftonline.de",preferred_cache:"login.microsoftonline.de",aliases:["login.microsoftonline.de"]},{preferred_network:"login.microsoftonline.us",preferred_cache:"login.microsoftonline.us",aliases:["login.microsoftonline.us","login.usgovcloudapi.net"]},{preferred_network:"login-us.microsoftonline.com",preferred_cache:"login-us.microsoftonline.com",aliases:["login-us.microsoftonline.com"]}]},"https://login.microsoftonline.com/organizations/":{tenant_discovery_endpoint:"https://login.microsoftonline.com/organizations/v2.0/.well-known/openid-configuration","api-version":"1.1",metadata:[{preferred_network:"login.microsoftonline.com",preferred_cache:"login.windows.net",aliases:["login.microsoftonline.com","login.windows.net","login.microsoft.com","sts.windows.net"]},{preferred_network:"login.partner.microsoftonline.cn",preferred_cache:"login.partner.microsoftonline.cn",aliases:["login.partner.microsoftonline.cn","login.chinacloudapi.cn"]},{preferred_network:"login.microsoftonline.de",preferred_cache:"login.microsoftonline.de",aliases:["login.microsoftonline.de"]},{preferred_network:"login.microsoftonline.us",preferred_cache:"login.microsoftonline.us",aliases:["login.microsoftonline.us","login.usgovcloudapi.net"]},{preferred_network:"login-us.microsoftonline.com",preferred_cache:"login-us.microsoftonline.com",aliases:["login-us.microsoftonline.com"]}]},"https://login.chinacloudapi.cn/organizations/":{tenant_discovery_endpoint:"https://login.chinacloudapi.cn/organizations/v2.0/.well-known/openid-configuration","api-version":"1.1",metadata:[{preferred_network:"login.microsoftonline.com",preferred_cache:"login.windows.net",aliases:["login.microsoftonline.com","login.windows.net","login.microsoft.com","sts.windows.net"]},{preferred_network:"login.partner.microsoftonline.cn",preferred_cache:"login.partner.microsoftonline.cn",aliases:["login.partner.microsoftonline.cn","login.chinacloudapi.cn"]},{preferred_network:"login.microsoftonline.de",preferred_cache:"login.microsoftonline.de",aliases:["login.microsoftonline.de"]},{preferred_network:"login.microsoftonline.us",preferred_cache:"login.microsoftonline.us",aliases:["login.microsoftonline.us","login.usgovcloudapi.net"]},{preferred_network:"login-us.microsoftonline.com",preferred_cache:"login-us.microsoftonline.com",aliases:["login-us.microsoftonline.com"]}]},"https://login.microsoftonline.us/organizations/":{tenant_discovery_endpoint:"https://login.microsoftonline.us/organizations/v2.0/.well-known/openid-configuration","api-version":"1.1",metadata:[{preferred_network:"login.microsoftonline.com",preferred_cache:"login.windows.net",aliases:["login.microsoftonline.com","login.windows.net","login.microsoft.com","sts.windows.net"]},{preferred_network:"login.partner.microsoftonline.cn",preferred_cache:"login.partner.microsoftonline.cn",aliases:["login.partner.microsoftonline.cn","login.chinacloudapi.cn"]},{preferred_network:"login.microsoftonline.de",preferred_cache:"login.microsoftonline.de",aliases:["login.microsoftonline.de"]},{preferred_network:"login.microsoftonline.us",preferred_cache:"login.microsoftonline.us",aliases:["login.microsoftonline.us","login.usgovcloudapi.net"]},{preferred_network:"login-us.microsoftonline.com",preferred_cache:"login-us.microsoftonline.com",aliases:["login-us.microsoftonline.com"]}]}}},my=k_.endpointMetadata,gy=k_.instanceDiscoveryMetadata;l();c();d();var ps;(function(r){r.AAD="AAD",r.OIDC="OIDC"})(ps||(ps={}));l();c();d();var $c=function(){function r(){this.expiresAt=st.nowSeconds()+vl.REFRESH_TIME_SECONDS}return r.prototype.updateCloudDiscoveryMetadata=function(e,t){this.aliases=e.aliases,this.preferred_cache=e.preferred_cache,this.preferred_network=e.preferred_network,this.aliasesFromNetwork=t},r.prototype.updateEndpointMetadata=function(e,t){this.authorization_endpoint=e.authorization_endpoint,this.token_endpoint=e.token_endpoint,this.end_session_endpoint=e.end_session_endpoint,this.issuer=e.issuer,this.endpointsFromNetwork=t,this.jwks_uri=e.jwks_uri},r.prototype.updateCanonicalAuthority=function(e){this.canonical_authority=e},r.prototype.resetExpiresAt=function(){this.expiresAt=st.nowSeconds()+vl.REFRESH_TIME_SECONDS},r.prototype.isExpired=function(){return this.expiresAt<=st.nowSeconds()},r.isAuthorityMetadataEntity=function(e,t){return t?e.indexOf(vl.CACHE_KEY)===0&&t.hasOwnProperty("aliases")&&t.hasOwnProperty("preferred_cache")&&t.hasOwnProperty("preferred_network")&&t.hasOwnProperty("canonical_authority")&&t.hasOwnProperty("authorization_endpoint")&&t.hasOwnProperty("token_endpoint")&&t.hasOwnProperty("issuer")&&t.hasOwnProperty("aliasesFromNetwork")&&t.hasOwnProperty("endpointsFromNetwork")&&t.hasOwnProperty("expiresAt")&&t.hasOwnProperty("jwks_uri"):!1},r}();l();c();d();function S_(r){return r.hasOwnProperty("tenant_discovery_endpoint")&&r.hasOwnProperty("metadata")}l();c();d();function __(r){return r.hasOwnProperty("error")&&r.hasOwnProperty("error_description")}l();c();d();var T_=function(){function r(e,t,o){this.networkInterface=e,this.performanceClient=t,this.correlationId=o}return r.prototype.detectRegion=function(e,t){var o,i,n,s;return le(this,void 0,void 0,function(){var a,u,h,p,f;return ce(this,function(b){switch(b.label){case 0:if((o=this.performanceClient)===null||o===void 0||o.addQueueMeasurement($.RegionDiscoveryDetectRegion,this.correlationId),a=e,a)return[3,8];u=r.IMDS_OPTIONS,b.label=1;case 1:return b.trys.push([1,6,,7]),(i=this.performanceClient)===null||i===void 0||i.setPreQueueTime($.RegionDiscoveryGetRegionFromIMDS,this.correlationId),[4,this.getRegionFromIMDS(_.IMDS_VERSION,u)];case 2:return h=b.sent(),h.status===gl.httpSuccess&&(a=h.body,t.region_source=cs.IMDS),h.status!==gl.httpBadRequest?[3,5]:((n=this.performanceClient)===null||n===void 0||n.setPreQueueTime($.RegionDiscoveryGetCurrentVersion,this.correlationId),[4,this.getCurrentVersion(u)]);case 3:return p=b.sent(),p?((s=this.performanceClient)===null||s===void 0||s.setPreQueueTime($.RegionDiscoveryGetRegionFromIMDS,this.correlationId),[4,this.getRegionFromIMDS(p,u)]):(t.region_source=cs.FAILED_AUTO_DETECTION,[2,null]);case 4:f=b.sent(),f.status===gl.httpSuccess&&(a=f.body,t.region_source=cs.IMDS),b.label=5;case 5:return[3,7];case 6:return b.sent(),t.region_source=cs.FAILED_AUTO_DETECTION,[2,null];case 7:return[3,9];case 8:t.region_source=cs.ENVIRONMENT_VARIABLE,b.label=9;case 9:return a||(t.region_source=cs.FAILED_AUTO_DETECTION),[2,a||null]}})})},r.prototype.getRegionFromIMDS=function(e,t){var o;return le(this,void 0,void 0,function(){return ce(this,function(i){return(o=this.performanceClient)===null||o===void 0||o.addQueueMeasurement($.RegionDiscoveryGetRegionFromIMDS,this.correlationId),[2,this.networkInterface.sendGetRequestAsync(_.IMDS_ENDPOINT+"?api-version="+e+"&format=text",t,_.IMDS_TIMEOUT)]})})},r.prototype.getCurrentVersion=function(e){var t;return le(this,void 0,void 0,function(){var o;return ce(this,function(i){switch(i.label){case 0:(t=this.performanceClient)===null||t===void 0||t.addQueueMeasurement($.RegionDiscoveryGetCurrentVersion,this.correlationId),i.label=1;case 1:return i.trys.push([1,3,,4]),[4,this.networkInterface.sendGetRequestAsync(_.IMDS_ENDPOINT+"?format=json",e)];case 2:return o=i.sent(),o.status===gl.httpBadRequest&&o.body&&o.body["newest-versions"]&&o.body["newest-versions"].length>0?[2,o.body["newest-versions"][0]]:[2,null];case 3:return i.sent(),[2,null];case 4:return[2]}})})},r.IMDS_OPTIONS={headers:{Metadata:"true"}},r}();var fs=function(){function r(e,t,o,i,n,s,a){this.canonicalAuthority=e,this._canonicalAuthority.validateAsUri(),this.networkInterface=t,this.cacheManager=o,this.authorityOptions=i,this.regionDiscoveryMetadata={region_used:void 0,region_source:void 0,region_outcome:void 0},this.logger=n,this.performanceClient=s,this.correlationId=a,this.regionDiscovery=new T_(t,this.performanceClient,this.correlationId)}return r.prototype.getAuthorityType=function(e){if(e.HostNameAndPort.endsWith(_.CIAM_AUTH_URL))return br.Ciam;var t=e.PathSegments;if(t.length)switch(t[0].toLowerCase()){case _.ADFS:return br.Adfs;case _.DSTS:return br.Dsts}return br.Default},Object.defineProperty(r.prototype,"authorityType",{get:function(){return this.getAuthorityType(this.canonicalAuthorityUrlComponents)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"protocolMode",{get:function(){return this.authorityOptions.protocolMode},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"options",{get:function(){return this.authorityOptions},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"canonicalAuthority",{get:function(){return this._canonicalAuthority.urlString},set:function(e){this._canonicalAuthority=new Se(e),this._canonicalAuthority.validateAsUri(),this._canonicalAuthorityUrlComponents=null},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"canonicalAuthorityUrlComponents",{get:function(){return this._canonicalAuthorityUrlComponents||(this._canonicalAuthorityUrlComponents=this._canonicalAuthority.getUrlComponents()),this._canonicalAuthorityUrlComponents},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"hostnameAndPort",{get:function(){return this.canonicalAuthorityUrlComponents.HostNameAndPort.toLowerCase()},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"tenant",{get:function(){return this.canonicalAuthorityUrlComponents.PathSegments[0]},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"authorizationEndpoint",{get:function(){if(this.discoveryComplete())return this.replacePath(this.metadata.authorization_endpoint);throw U.createEndpointDiscoveryIncompleteError("Discovery incomplete.")},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"tokenEndpoint",{get:function(){if(this.discoveryComplete())return this.replacePath(this.metadata.token_endpoint);throw U.createEndpointDiscoveryIncompleteError("Discovery incomplete.")},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"deviceCodeEndpoint",{get:function(){if(this.discoveryComplete())return this.replacePath(this.metadata.token_endpoint.replace("/token","/devicecode"));throw U.createEndpointDiscoveryIncompleteError("Discovery incomplete.")},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"endSessionEndpoint",{get:function(){if(this.discoveryComplete()){if(!this.metadata.end_session_endpoint)throw U.createLogoutNotSupportedError();return this.replacePath(this.metadata.end_session_endpoint)}else throw U.createEndpointDiscoveryIncompleteError("Discovery incomplete.")},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"selfSignedJwtAudience",{get:function(){if(this.discoveryComplete())return this.replacePath(this.metadata.issuer);throw U.createEndpointDiscoveryIncompleteError("Discovery incomplete.")},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"jwksUri",{get:function(){if(this.discoveryComplete())return this.replacePath(this.metadata.jwks_uri);throw U.createEndpointDiscoveryIncompleteError("Discovery incomplete.")},enumerable:!1,configurable:!0}),r.prototype.canReplaceTenant=function(e){return e.PathSegments.length===1&&!r.reservedTenantDomains.has(e.PathSegments[0])&&this.getAuthorityType(e)===br.Default&&this.protocolMode===ps.AAD},r.prototype.replaceTenant=function(e){return e.replace(/{tenant}|{tenantid}/g,this.tenant)},r.prototype.replacePath=function(e){var t=this,o=e,i=new Se(this.metadata.canonical_authority),n=i.getUrlComponents(),s=n.PathSegments,a=this.canonicalAuthorityUrlComponents.PathSegments;return a.forEach(function(u,h){var p=s[h];if(h===0&&t.canReplaceTenant(n)){var f=new Se(t.metadata.authorization_endpoint).getUrlComponents().PathSegments[0];p!==f&&(t.logger.verbose("Replacing tenant domain name "+p+" with id "+f),p=f)}u!==p&&(o=o.replace("/"+p+"/","/"+u+"/"))}),this.replaceTenant(o)},Object.defineProperty(r.prototype,"defaultOpenIdConfigurationEndpoint",{get:function(){return this.authorityType===br.Adfs||this.authorityType===br.Dsts||this.protocolMode===ps.OIDC?this.canonicalAuthority+".well-known/openid-configuration":this.canonicalAuthority+"v2.0/.well-known/openid-configuration"},enumerable:!1,configurable:!0}),r.prototype.discoveryComplete=function(){return!!this.metadata},r.prototype.resolveEndpointsAsync=function(){var e,t,o;return le(this,void 0,void 0,function(){var i,n,s,a;return ce(this,function(u){switch(u.label){case 0:return(e=this.performanceClient)===null||e===void 0||e.addQueueMeasurement($.AuthorityResolveEndpointsAsync,this.correlationId),i=this.cacheManager.getAuthorityMetadataByAlias(this.hostnameAndPort),i||(i=new $c,i.updateCanonicalAuthority(this.canonicalAuthority)),(t=this.performanceClient)===null||t===void 0||t.setPreQueueTime($.AuthorityUpdateCloudDiscoveryMetadata,this.correlationId),[4,this.updateCloudDiscoveryMetadata(i)];case 1:return n=u.sent(),this.canonicalAuthority=this.canonicalAuthority.replace(this.hostnameAndPort,i.preferred_network),(o=this.performanceClient)===null||o===void 0||o.setPreQueueTime($.AuthorityUpdateEndpointMetadata,this.correlationId),[4,this.updateEndpointMetadata(i)];case 2:return s=u.sent(),n!==si.CACHE&&s!==si.CACHE&&(i.resetExpiresAt(),i.updateCanonicalAuthority(this.canonicalAuthority)),a=this.cacheManager.generateAuthorityMetadataCacheKey(i.preferred_cache),this.cacheManager.setAuthorityMetadata(a,i),this.metadata=i,[2]}})})},r.prototype.updateEndpointMetadata=function(e){var t,o,i,n,s,a;return le(this,void 0,void 0,function(){var u,h;return ce(this,function(p){switch(p.label){case 0:return(t=this.performanceClient)===null||t===void 0||t.addQueueMeasurement($.AuthorityUpdateEndpointMetadata,this.correlationId),u=this.getEndpointMetadataFromConfig(),u?(e.updateEndpointMetadata(u,!1),[2,si.CONFIG]):this.isAuthoritySameType(e)&&e.endpointsFromNetwork&&!e.isExpired()?[2,si.CACHE]:((o=this.performanceClient)===null||o===void 0||o.setPreQueueTime($.AuthorityGetEndpointMetadataFromNetwork,this.correlationId),[4,this.getEndpointMetadataFromNetwork()]);case 1:return u=p.sent(),u?!((i=this.authorityOptions.azureRegionConfiguration)===null||i===void 0)&&i.azureRegion?((n=this.performanceClient)===null||n===void 0||n.setPreQueueTime($.AuthorityUpdateMetadataWithRegionalInformation,this.correlationId),[4,this.updateMetadataWithRegionalInformation(u)]):[3,3]:[3,4];case 2:u=p.sent(),p.label=3;case 3:return e.updateEndpointMetadata(u,!0),[2,si.NETWORK];case 4:return h=this.getEndpointMetadataFromHardcodedValues(),h&&!this.authorityOptions.skipAuthorityMetadataCache?!((s=this.authorityOptions.azureRegionConfiguration)===null||s===void 0)&&s.azureRegion?((a=this.performanceClient)===null||a===void 0||a.setPreQueueTime($.AuthorityUpdateMetadataWithRegionalInformation,this.correlationId),[4,this.updateMetadataWithRegionalInformation(h)]):[3,6]:[3,7];case 5:h=p.sent(),p.label=6;case 6:return e.updateEndpointMetadata(h,!1),[2,si.HARDCODED_VALUES];case 7:throw U.createUnableToGetOpenidConfigError(this.defaultOpenIdConfigurationEndpoint)}})})},r.prototype.isAuthoritySameType=function(e){var t=new Se(e.canonical_authority),o=t.getUrlComponents().PathSegments;return o.length===this.canonicalAuthorityUrlComponents.PathSegments.length},r.prototype.getEndpointMetadataFromConfig=function(){if(this.authorityOptions.authorityMetadata)try{return JSON.parse(this.authorityOptions.authorityMetadata)}catch{throw je.createInvalidAuthorityMetadataError()}return null},r.prototype.getEndpointMetadataFromNetwork=function(){var e;return le(this,void 0,void 0,function(){var t,o;return ce(this,function(i){switch(i.label){case 0:(e=this.performanceClient)===null||e===void 0||e.addQueueMeasurement($.AuthorityGetEndpointMetadataFromNetwork,this.correlationId),t={},i.label=1;case 1:return i.trys.push([1,3,,4]),[4,this.networkInterface.sendGetRequestAsync(this.defaultOpenIdConfigurationEndpoint,t)];case 2:return o=i.sent(),[2,x_(o.body)?o.body:null];case 3:return i.sent(),[2,null];case 4:return[2]}})})},r.prototype.getEndpointMetadataFromHardcodedValues=function(){return this.canonicalAuthority in my?my[this.canonicalAuthority]:null},r.prototype.updateMetadataWithRegionalInformation=function(e){var t,o,i,n;return le(this,void 0,void 0,function(){var s,a;return ce(this,function(u){switch(u.label){case 0:return(t=this.performanceClient)===null||t===void 0||t.addQueueMeasurement($.AuthorityUpdateMetadataWithRegionalInformation,this.correlationId),s=(o=this.authorityOptions.azureRegionConfiguration)===null||o===void 0?void 0:o.azureRegion,s?s!==_.AZURE_REGION_AUTO_DISCOVER_FLAG?(this.regionDiscoveryMetadata.region_outcome=Ic.CONFIGURED_NO_AUTO_DETECTION,this.regionDiscoveryMetadata.region_used=s,[2,r.replaceWithRegionalInformation(e,s)]):((i=this.performanceClient)===null||i===void 0||i.setPreQueueTime($.RegionDiscoveryDetectRegion,this.correlationId),[4,this.regionDiscovery.detectRegion((n=this.authorityOptions.azureRegionConfiguration)===null||n===void 0?void 0:n.environmentRegion,this.regionDiscoveryMetadata)]):[3,2];case 1:if(a=u.sent(),a)return this.regionDiscoveryMetadata.region_outcome=Ic.AUTO_DETECTION_REQUESTED_SUCCESSFUL,this.regionDiscoveryMetadata.region_used=a,[2,r.replaceWithRegionalInformation(e,a)];this.regionDiscoveryMetadata.region_outcome=Ic.AUTO_DETECTION_REQUESTED_FAILED,u.label=2;case 2:return[2,e]}})})},r.prototype.updateCloudDiscoveryMetadata=function(e){var t,o;return le(this,void 0,void 0,function(){var i,n,s;return ce(this,function(a){switch(a.label){case 0:return(t=this.performanceClient)===null||t===void 0||t.addQueueMeasurement($.AuthorityUpdateCloudDiscoveryMetadata,this.correlationId),this.logger.verbose("Attempting to get cloud discovery metadata in the config"),this.logger.verbosePii("Known Authorities: "+(this.authorityOptions.knownAuthorities||_.NOT_APPLICABLE)),this.logger.verbosePii("Authority Metadata: "+(this.authorityOptions.authorityMetadata||_.NOT_APPLICABLE)),this.logger.verbosePii("Canonical Authority: "+(e.canonical_authority||_.NOT_APPLICABLE)),i=this.getCloudDiscoveryMetadataFromConfig(),i?(this.logger.verbose("Found cloud discovery metadata in the config."),e.updateCloudDiscoveryMetadata(i,!1),[2,si.CONFIG]):(this.logger.verbose("Did not find cloud discovery metadata in the config... Attempting to get cloud discovery metadata from the cache."),n=e.isExpired(),this.isAuthoritySameType(e)&&e.aliasesFromNetwork&&!n?(this.logger.verbose("Found metadata in the cache."),[2,si.CACHE]):(n&&this.logger.verbose("The metadata entity is expired."),this.logger.verbose("Did not find cloud discovery metadata in the cache... Attempting to get cloud discovery metadata from the network."),(o=this.performanceClient)===null||o===void 0||o.setPreQueueTime($.AuthorityGetCloudDiscoveryMetadataFromNetwork,this.correlationId),[4,this.getCloudDiscoveryMetadataFromNetwork()]));case 1:if(i=a.sent(),i)return this.logger.verbose("cloud discovery metadata was successfully returned from getCloudDiscoveryMetadataFromNetwork()"),e.updateCloudDiscoveryMetadata(i,!0),[2,si.NETWORK];if(this.logger.verbose("Did not find cloud discovery metadata from the network... Attempting to get cloud discovery metadata from hardcoded values."),s=this.getCloudDiscoveryMetadataFromHarcodedValues(),s&&!this.options.skipAuthorityMetadataCache)return this.logger.verbose("Found cloud discovery metadata from hardcoded values."),e.updateCloudDiscoveryMetadata(s,!1),[2,si.HARDCODED_VALUES];throw this.logger.error("Did not find cloud discovery metadata from hardcoded values... Metadata could not be obtained from config, cache, network or hardcoded values. Throwing Untrusted Authority Error."),je.createUntrustedAuthorityError()}})})},r.prototype.getCloudDiscoveryMetadataFromConfig=function(){if(this.authorityType===br.Ciam)return this.logger.verbose("CIAM authorities do not support cloud discovery metadata, generate the aliases from authority host."),r.createCloudDiscoveryMetadataFromHost(this.hostnameAndPort);if(this.authorityOptions.cloudDiscoveryMetadata){this.logger.verbose("The cloud discovery metadata has been provided as a network response, in the config.");try{this.logger.verbose("Attempting to parse the cloud discovery metadata.");var e=JSON.parse(this.authorityOptions.cloudDiscoveryMetadata),t=r.getCloudDiscoveryMetadataFromNetworkResponse(e.metadata,this.hostnameAndPort);if(this.logger.verbose("Parsed the cloud discovery metadata."),t)return this.logger.verbose("There is returnable metadata attached to the parsed cloud discovery metadata."),t;this.logger.verbose("There is no metadata attached to the parsed cloud discovery metadata.")}catch{throw this.logger.verbose("Unable to parse the cloud discovery metadata. Throwing Invalid Cloud Discovery Metadata Error."),je.createInvalidCloudDiscoveryMetadataError()}}return this.isInKnownAuthorities()?(this.logger.verbose("The host is included in knownAuthorities. Creating new cloud discovery metadata from the host."),r.createCloudDiscoveryMetadataFromHost(this.hostnameAndPort)):null},r.prototype.getCloudDiscoveryMetadataFromNetwork=function(){var e;return le(this,void 0,void 0,function(){var t,o,i,n,s,a,u,h;return ce(this,function(p){switch(p.label){case 0:(e=this.performanceClient)===null||e===void 0||e.addQueueMeasurement($.AuthorityGetCloudDiscoveryMetadataFromNetwork,this.correlationId),t=""+_.AAD_INSTANCE_DISCOVERY_ENDPT+this.canonicalAuthority+"oauth2/v2.0/authorize",o={},i=null,p.label=1;case 1:return p.trys.push([1,3,,4]),[4,this.networkInterface.sendGetRequestAsync(t,o)];case 2:if(n=p.sent(),s=void 0,a=void 0,S_(n.body))s=n.body,a=s.metadata,this.logger.verbosePii("tenant_discovery_endpoint is: "+s.tenant_discovery_endpoint);else if(__(n.body)){if(this.logger.warning("A CloudInstanceDiscoveryErrorResponse was returned. The cloud instance discovery network request's status code is: "+n.status),s=n.body,s.error===_.INVALID_INSTANCE)return this.logger.error("The CloudInstanceDiscoveryErrorResponse error is invalid_instance."),[2,null];this.logger.warning("The CloudInstanceDiscoveryErrorResponse error is "+s.error),this.logger.warning("The CloudInstanceDiscoveryErrorResponse error description is "+s.error_description),this.logger.warning("Setting the value of the CloudInstanceDiscoveryMetadata (returned from the network) to []"),a=[]}else return this.logger.error("AAD did not return a CloudInstanceDiscoveryResponse or CloudInstanceDiscoveryErrorResponse"),[2,null];return this.logger.verbose("Attempting to find a match between the developer's authority and the CloudInstanceDiscoveryMetadata returned from the network request."),i=r.getCloudDiscoveryMetadataFromNetworkResponse(a,this.hostnameAndPort),[3,4];case 3:return u=p.sent(),u instanceof ee?this.logger.error(`There was a network error while attempting to get the cloud discovery instance metadata. Error: `+u.errorCode+` Error Description: `+u.errorMessage):(h=u,this.logger.error(`A non-MSALJS error was thrown while attempting to get the cloud instance discovery metadata. Error: `+h.name+` -Error Description: `+h.message)),[2,null];case 4:return i||(this.logger.warning("The developer's authority was not found within the CloudInstanceDiscoveryMetadata returned from the network request."),this.logger.verbose("Creating custom Authority for custom domain scenario."),i=r.createCloudDiscoveryMetadataFromHost(this.hostnameAndPort)),[2,i]}})})},r.prototype.getCloudDiscoveryMetadataFromHarcodedValues=function(){return this.canonicalAuthority in gy?gy[this.canonicalAuthority]:null},r.prototype.isInKnownAuthorities=function(){var e=this,t=this.authorityOptions.knownAuthorities.filter(function(o){return Se.getDomainFromUrl(o).toLowerCase()===e.hostnameAndPort});return t.length>0},r.generateAuthority=function(e,t){var o;if(t&&t.azureCloudInstance!==Tn.None){var i=t.tenant?t.tenant:_.DEFAULT_COMMON_TENANT;o=t.azureCloudInstance+"/"+i+"/"}return o||e},r.createCloudDiscoveryMetadataFromHost=function(e){return{preferred_network:e,preferred_cache:e,aliases:[e]}},r.getCloudDiscoveryMetadataFromNetworkResponse=function(e,t){for(var o=0;o-1)return i}return null},r.prototype.getPreferredCache=function(){if(this.discoveryComplete())return this.metadata.preferred_cache;throw U.createEndpointDiscoveryIncompleteError("Discovery incomplete.")},r.prototype.isAlias=function(e){return this.metadata.aliases.indexOf(e)>-1},r.isPublicCloudAuthority=function(e){return _.KNOWN_PUBLIC_CLOUDS.indexOf(e)>=0},r.buildRegionalAuthorityString=function(e,t,o){var i=new Se(e);i.validateAsUri();var n=i.getUrlComponents(),s=t+"."+n.HostNameAndPort;this.isPublicCloudAuthority(n.HostNameAndPort)&&(s=t+"."+_.REGIONAL_AUTH_PUBLIC_CLOUD_SUFFIX);var a=Se.constructAuthorityUriFromObject(rt(rt({},i.getUrlComponents()),{HostNameAndPort:s})).urlString;return o?a+"?"+o:a},r.replaceWithRegionalInformation=function(e,t){return e.authorization_endpoint=r.buildRegionalAuthorityString(e.authorization_endpoint,t),e.token_endpoint=r.buildRegionalAuthorityString(e.token_endpoint,t,_.REGIONAL_AUTH_NON_MSI_QUERY_STRING),e.end_session_endpoint&&(e.end_session_endpoint=r.buildRegionalAuthorityString(e.end_session_endpoint,t)),e},r.transformCIAMAuthority=function(e){var t=e.endsWith(_.FORWARD_SLASH)?e:""+e+_.FORWARD_SLASH,o=new Se(e),i=o.getUrlComponents();if(i.PathSegments.length===0&&i.HostNameAndPort.endsWith(_.CIAM_AUTH_URL)){var n=i.HostNameAndPort.split(".")[0];t=""+t+n+_.AAD_TENANT_DOMAIN_SUFFIX}return t},r.reservedTenantDomains=new Set(["{tenant}","{tenantid}",ls.COMMON,ls.CONSUMERS,ls.ORGANIZATIONS]),r}();l();c();d();var ia=function(){function r(){}return r.createDiscoveredInstance=function(e,t,o,i,n,s,a){return le(this,void 0,void 0,function(){var u,h,p;return ce(this,function(f){switch(f.label){case 0:s?.addQueueMeasurement($.AuthorityFactoryCreateDiscoveredInstance,a),u=fs.transformCIAMAuthority(e),h=r.createInstance(u,t,o,i,n,s,a),f.label=1;case 1:return f.trys.push([1,3,,4]),s?.setPreQueueTime($.AuthorityResolveEndpointsAsync,a),[4,h.resolveEndpointsAsync()];case 2:return f.sent(),[2,h];case 3:throw p=f.sent(),U.createEndpointDiscoveryIncompleteError(p);case 4:return[2]}})})},r.createInstance=function(e,t,o,i,n,s,a){if(B.isEmpty(e))throw je.createUrlEmptyError();return new fs(e,t,o,i,n,s,a)},r}();l();c();d();var wl=function(){function r(){this.failedRequests=[],this.errors=[],this.cacheHits=0}return r.isServerTelemetryEntity=function(e,t){var o=e.indexOf(Ir.CACHE_KEY)===0,i=!0;return t&&(i=t.hasOwnProperty("failedRequests")&&t.hasOwnProperty("errors")&&t.hasOwnProperty("cacheHits")),o&&i},r}();l();c();d();var Af=function(){function r(){}return r.isThrottlingEntity=function(e,t){var o=!1;e&&(o=e.indexOf(ds.THROTTLING_PREFIX)===0);var i=!0;return t&&(i=t.hasOwnProperty("throttleTime")),o&&i},r}();l();c();d();var vy={sendGetRequestAsync:function(){var r="Network interface - sendGetRequestAsync() has not been implemented for the Network interface.";return Promise.reject(ee.createUnexpectedError(r))},sendPostRequestAsync:function(){var r="Network interface - sendPostRequestAsync() has not been implemented for the Network interface.";return Promise.reject(ee.createUnexpectedError(r))}};l();c();d();l();c();d();var Rf={missingKidError:{code:"missing_kid_error",desc:"The JOSE Header for the requested JWT, JWS or JWK object requires a keyId to be configured as the 'kid' header claim. No 'kid' value was provided."},missingAlgError:{code:"missing_alg_error",desc:"The JOSE Header for the requested JWT, JWS or JWK object requires an algorithm to be specified as the 'alg' header claim. No 'alg' value was provided."}},yy=function(r){nt(e,r);function e(t,o){var i=r.call(this,t,o)||this;return i.name="JoseHeaderError",Object.setPrototypeOf(i,e.prototype),i}return e.createMissingKidError=function(){return new e(Rf.missingKidError.code,Rf.missingKidError.desc)},e.createMissingAlgError=function(){return new e(Rf.missingAlgError.code,Rf.missingAlgError.desc)},e}(ee);var by=function(){function r(e){this.typ=e.typ,this.alg=e.alg,this.kid=e.kid}return r.getShrHeaderString=function(e){if(!e.kid)throw yy.createMissingKidError();if(!e.alg)throw yy.createMissingAlgError();var t=new r({typ:e.typ||Sf.Pop,kid:e.kid,alg:e.alg});return JSON.stringify(t)},r}();l();c();d();var E_=function(){function r(e){this.headers=e}return r.prototype.getShrNonce=function(){var e=this.headers[Ft.AuthenticationInfo];if(e){var t=this.parseChallenges(e);if(t.nextnonce)return t.nextnonce;throw je.createInvalidAuthenticationHeaderError(Ft.AuthenticationInfo,"nextnonce challenge is missing.")}var o=this.headers[Ft.WWWAuthenticate];if(o){var i=this.parseChallenges(o);if(i.nonce)return i.nonce;throw je.createInvalidAuthenticationHeaderError(Ft.WWWAuthenticate,"nonce challenge is missing.")}throw je.createMissingNonceAuthenticationHeadersError()},r.prototype.parseChallenges=function(e){var t=e.indexOf(" "),o=e.substr(t+1).split(","),i={};return o.forEach(function(n){var s=n.split("="),a=s[0],u=s[1];i[a]=unescape(u.replace(/['"]+/g,_.EMPTY_STRING))}),i},r}();l();c();d();var wy=function(){function r(e,t){this.cacheOutcome=vo.NO_CACHE_HIT,this.cacheManager=t,this.apiId=e.apiId,this.correlationId=e.correlationId,this.wrapperSKU=e.wrapperSKU||_.EMPTY_STRING,this.wrapperVer=e.wrapperVer||_.EMPTY_STRING,this.telemetryCacheKey=Ir.CACHE_KEY+Lt.CACHE_KEY_SEPARATOR+e.clientId}return r.prototype.generateCurrentRequestHeaderValue=function(){var e=""+this.apiId+Ir.VALUE_SEPARATOR+this.cacheOutcome,t=[this.wrapperSKU,this.wrapperVer].join(Ir.VALUE_SEPARATOR),o=this.getRegionDiscoveryFields(),i=[e,o].join(Ir.VALUE_SEPARATOR);return[Ir.SCHEMA_VERSION,i,t].join(Ir.CATEGORY_SEPARATOR)},r.prototype.generateLastRequestHeaderValue=function(){var e=this.getLastRequests(),t=r.maxErrorsToSend(e),o=e.failedRequests.slice(0,2*t).join(Ir.VALUE_SEPARATOR),i=e.errors.slice(0,t).join(Ir.VALUE_SEPARATOR),n=e.errors.length,s=t=Ir.MAX_CACHED_ERRORS&&(t.failedRequests.shift(),t.failedRequests.shift(),t.errors.shift()),t.failedRequests.push(this.apiId,this.correlationId),B.isEmpty(e.subError)?B.isEmpty(e.errorCode)?e&&e.toString()?t.errors.push(e.toString()):t.errors.push(Ir.UNKNOWN_ERROR):t.errors.push(e.errorCode):t.errors.push(e.subError),this.cacheManager.setServerTelemetry(this.telemetryCacheKey,t)},r.prototype.incrementCacheHits=function(){var e=this.getLastRequests();return e.cacheHits+=1,this.cacheManager.setServerTelemetry(this.telemetryCacheKey,e),e.cacheHits},r.prototype.getLastRequests=function(){var e=new wl,t=this.cacheManager.getServerTelemetry(this.telemetryCacheKey);return t||e},r.prototype.clearTelemetryCache=function(){var e=this.getLastRequests(),t=r.maxErrorsToSend(e),o=e.errors.length;if(t===o)this.cacheManager.removeItem(this.telemetryCacheKey);else{var i=new wl;i.failedRequests=e.failedRequests.slice(t*2),i.errors=e.errors.slice(t),this.cacheManager.setServerTelemetry(this.telemetryCacheKey,i)}},r.maxErrorsToSend=function(e){var t,o=0,i=0,n=e.errors.length;for(t=0;t "+t)},e.createBlockReloadInHiddenIframeError=function(){return new e(q.blockTokenRequestsInHiddenIframeError.code,q.blockTokenRequestsInHiddenIframeError.desc)},e.createBlockAcquireTokenInPopupsError=function(){return new e(q.blockAcquireTokenInPopupsError.code,q.blockAcquireTokenInPopupsError.desc)},e.createIframeClosedPrematurelyError=function(){return new e(q.iframeClosedPrematurelyError.code,q.iframeClosedPrematurelyError.desc)},e.createSilentLogoutUnsupportedError=function(){return new e(q.silentLogoutUnsupportedError.code,q.silentLogoutUnsupportedError.desc)},e.createNoAccountError=function(){return new e(q.noAccountError.code,q.noAccountError.desc)},e.createSilentPromptValueError=function(t){return new e(q.silentPromptValueError.code,q.silentPromptValueError.desc+" Given value: "+t)},e.createUnableToParseTokenRequestCacheError=function(){return new e(q.unableToParseTokenRequestCacheError.code,q.unableToParseTokenRequestCacheError.desc)},e.createNoTokenRequestCacheError=function(){return new e(q.noTokenRequestCacheError.code,q.noTokenRequestCacheError.desc)},e.createAuthRequestNotSetError=function(){return new e(q.authRequestNotSet.code,q.authRequestNotSet.desc)},e.createNoCachedAuthorityError=function(){return new e(q.noCachedAuthorityError.code,q.noCachedAuthorityError.desc)},e.createInvalidCacheTypeError=function(){return new e(q.invalidCacheType.code,""+q.invalidCacheType.desc)},e.createNonBrowserEnvironmentError=function(){return new e(q.notInBrowserEnvironment.code,q.notInBrowserEnvironment.desc)},e.createDatabaseNotOpenError=function(){return new e(q.databaseNotOpen.code,q.databaseNotOpen.desc)},e.createNoNetworkConnectivityError=function(){return new e(q.noNetworkConnectivity.code,q.noNetworkConnectivity.desc)},e.createPostRequestFailedError=function(t,o){return new e(q.postRequestFailed.code,q.postRequestFailed.desc+" | Network client threw: "+t+" | Attempted to reach: "+o.split("?")[0])},e.createGetRequestFailedError=function(t,o){return new e(q.getRequestFailed.code,q.getRequestFailed.desc+" | Network client threw: "+t+" | Attempted to reach: "+o.split("?")[0])},e.createFailedToParseNetworkResponseError=function(t){return new e(q.failedToParseNetworkResponse.code,q.failedToParseNetworkResponse.desc+" | Attempted to reach: "+t.split("?")[0])},e.createUnableToLoadTokenError=function(t){return new e(q.unableToLoadTokenError.code,q.unableToLoadTokenError.desc+" | "+t)},e.createSigningKeyNotFoundInStorageError=function(t){return new e(q.signingKeyNotFoundInStorage.code,q.signingKeyNotFoundInStorage.desc+" | No match found for KeyId: "+t)},e.createAuthCodeRequiredError=function(){return new e(q.authCodeRequired.code,q.authCodeRequired.desc)},e.createAuthCodeOrNativeAccountIdRequiredError=function(){return new e(q.authCodeOrNativeAccountRequired.code,q.authCodeOrNativeAccountRequired.desc)},e.createSpaCodeAndNativeAccountIdPresentError=function(){return new e(q.spaCodeAndNativeAccountPresent.code,q.spaCodeAndNativeAccountPresent.desc)},e.createDatabaseUnavailableError=function(){return new e(q.databaseUnavailable.code,q.databaseUnavailable.desc)},e.createUnableToAcquireTokenFromNativePlatformError=function(){return new e(q.unableToAcquireTokenFromNativePlatform.code,q.unableToAcquireTokenFromNativePlatform.desc)},e.createNativeHandshakeTimeoutError=function(){return new e(q.nativeHandshakeTimeout.code,q.nativeHandshakeTimeout.desc)},e.createNativeExtensionNotInstalledError=function(){return new e(q.nativeExtensionNotInstalled.code,q.nativeExtensionNotInstalled.desc)},e.createNativeConnectionNotEstablishedError=function(){return new e(q.nativeConnectionNotEstablished.code,q.nativeConnectionNotEstablished.desc)},e.createNativeBrokerCalledBeforeInitialize=function(){return new e(q.nativeBrokerCalledBeforeInitialize.code,q.nativeBrokerCalledBeforeInitialize.desc)},e.createNativePromptParameterNotSupportedError=function(){return new e(q.nativePromptNotSupported.code,q.nativePromptNotSupported.desc)},e}(ee);l();c();d();var Hr={INTERACTION_IN_PROGRESS_VALUE:"interaction_in_progress",INVALID_GRANT_ERROR:"invalid_grant",POPUP_WIDTH:483,POPUP_HEIGHT:600,POPUP_NAME_PREFIX:"msal",DEFAULT_POLL_INTERVAL_MS:30,MSAL_SKU:"msal.js.browser"},xl={CHANNEL_ID:"53ee284d-920a-4b59-9d30-a60315b26836",PREFERRED_EXTENSION_ID:"ppnbnpeolgkicgegkbkbjmhlideopiji",MATS_TELEMETRY:"MATS"},Zi;(function(r){r.HandshakeRequest="Handshake",r.HandshakeResponse="HandshakeResponse",r.GetToken="GetToken",r.Response="Response"})(Zi||(Zi={}));var zt;(function(r){r.LocalStorage="localStorage",r.SessionStorage="sessionStorage",r.MemoryStorage="memoryStorage"})(zt||(zt={}));var bi;(function(r){r.GET="GET",r.POST="POST"})(bi||(bi={}));var Ye;(function(r){r.AUTHORITY="authority",r.ACQUIRE_TOKEN_ACCOUNT="acquireToken.account",r.SESSION_STATE="session.state",r.REQUEST_STATE="request.state",r.NONCE_IDTOKEN="nonce.id_token",r.ORIGIN_URI="request.origin",r.RENEW_STATUS="token.renew.status",r.URL_HASH="urlHash",r.REQUEST_PARAMS="request.params",r.SCOPES="scopes",r.INTERACTION_STATUS_KEY="interaction.status",r.CCS_CREDENTIAL="ccs.credential",r.CORRELATION_ID="request.correlationId",r.NATIVE_REQUEST="request.native",r.REDIRECT_CONTEXT="request.redirect.context"})(Ye||(Ye={}));var Ji;(function(r){r.ACCOUNT_KEYS="msal.account.keys",r.TOKEN_KEYS="msal.token.keys"})(Ji||(Ji={}));var Cl;(function(r){r.WRAPPER_SKU="wrapper.sku",r.WRAPPER_VER="wrapper.version"})(Cl||(Cl={}));var ct;(function(r){r[r.acquireTokenRedirect=861]="acquireTokenRedirect",r[r.acquireTokenPopup=862]="acquireTokenPopup",r[r.ssoSilent=863]="ssoSilent",r[r.acquireTokenSilent_authCode=864]="acquireTokenSilent_authCode",r[r.handleRedirectPromise=865]="handleRedirectPromise",r[r.acquireTokenByCode=866]="acquireTokenByCode",r[r.acquireTokenSilent_silentFlow=61]="acquireTokenSilent_silentFlow",r[r.logout=961]="logout",r[r.logoutPopup=962]="logoutPopup"})(ct||(ct={}));var ne;(function(r){r.Redirect="redirect",r.Popup="popup",r.Silent="silent",r.None="none"})(ne||(ne={}));var Nr;(function(r){r.Startup="startup",r.Login="login",r.Logout="logout",r.AcquireToken="acquireToken",r.SsoSilent="ssoSilent",r.HandleRedirect="handleRedirect",r.None="none"})(Nr||(Nr={}));var ky={scopes:Yi},ms="jwk",xy;(function(r){r.React="@azure/msal-react",r.Angular="@azure/msal-angular"})(xy||(xy={}));var Pf="msal.db",A_=1,R_=Pf+".keys",oo;(function(r){r[r.Default=0]="Default",r[r.AccessToken=1]="AccessToken",r[r.AccessTokenAndRefreshToken=2]="AccessTokenAndRefreshToken",r[r.RefreshToken=3]="RefreshToken",r[r.RefreshTokenAndNetwork=4]="RefreshTokenAndNetwork",r[r.Skip=5]="Skip"})(oo||(oo={}));l();c();d();l();c();d();var To={redirectUriNotSet:{code:"redirect_uri_empty",desc:"A redirect URI is required for all calls, and none has been set."},postLogoutUriNotSet:{code:"post_logout_uri_empty",desc:"A post logout redirect has not been set."},storageNotSupportedError:{code:"storage_not_supported",desc:"Given storage configuration option was not supported."},noRedirectCallbacksSet:{code:"no_redirect_callbacks",desc:"No redirect callbacks have been set. Please call setRedirectCallbacks() with the appropriate function arguments before continuing. More information is available here: https://github.com/AzureAD/microsoft-authentication-library-for-js/wiki/MSAL-basics."},invalidCallbackObject:{code:"invalid_callback_object",desc:"The object passed for the callback was invalid. More information is available here: https://github.com/AzureAD/microsoft-authentication-library-for-js/wiki/MSAL-basics."},stubPcaInstanceCalled:{code:"stubbed_public_client_application_called",desc:"Stub instance of Public Client Application was called. If using msal-react, please ensure context is not used without a provider. For more visit: aka.ms/msaljs/browser-errors"},inMemRedirectUnavailable:{code:"in_mem_redirect_unavailable",desc:"Redirect cannot be supported. In-memory storage was selected and storeAuthStateInCookie=false, which would cause the library to be unable to handle the incoming hash. If you would like to use the redirect API, please use session/localStorage or set storeAuthStateInCookie=true."},entropyNotProvided:{code:"entropy_not_provided",desc:"The available browser crypto interface requires entropy set via system.cryptoOptions.entropy configuration option."}},gs=function(r){mt(e,r);function e(t,o){var i=r.call(this,t,o)||this;return i.name="BrowserConfigurationAuthError",Object.setPrototypeOf(i,e.prototype),i}return e.createRedirectUriEmptyError=function(){return new e(To.redirectUriNotSet.code,To.redirectUriNotSet.desc)},e.createPostLogoutRedirectUriEmptyError=function(){return new e(To.postLogoutUriNotSet.code,To.postLogoutUriNotSet.desc)},e.createStorageNotSupportedError=function(t){return new e(To.storageNotSupportedError.code,To.storageNotSupportedError.desc+" Given Location: "+t)},e.createRedirectCallbacksNotSetError=function(){return new e(To.noRedirectCallbacksSet.code,To.noRedirectCallbacksSet.desc)},e.createStubPcaInstanceCalledError=function(){return new e(To.stubPcaInstanceCalled.code,To.stubPcaInstanceCalled.desc)},e.createInMemoryRedirectUnavailableError=function(){return new e(To.inMemRedirectUnavailable.code,To.inMemRedirectUnavailable.desc)},e.createEntropyNotProvided=function(){return new e(To.entropyNotProvided.code,To.entropyNotProvided.desc)},e}(ee);var Sy=function(){function r(e){this.validateWindowStorage(e),this.windowStorage=window[e]}return r.prototype.validateWindowStorage=function(e){if(e!==zt.LocalStorage&&e!==zt.SessionStorage)throw gs.createStorageNotSupportedError(e);var t=!!window[e];if(!t)throw gs.createStorageNotSupportedError(e)},r.prototype.getItem=function(e){return this.windowStorage.getItem(e)},r.prototype.setItem=function(e,t){this.windowStorage.setItem(e,t)},r.prototype.removeItem=function(e){this.windowStorage.removeItem(e)},r.prototype.getKeys=function(){return Object.keys(this.windowStorage)},r.prototype.containsKey=function(e){return this.windowStorage.hasOwnProperty(e)},r}();l();c();d();var Au=function(){function r(){this.cache=new Map}return r.prototype.getItem=function(e){return this.cache.get(e)||null},r.prototype.setItem=function(e,t){this.cache.set(e,t)},r.prototype.removeItem=function(e){this.cache.delete(e)},r.prototype.getKeys=function(){var e=[];return this.cache.forEach(function(t,o){e.push(o)}),e},r.prototype.containsKey=function(e){return this.cache.has(e)},r.prototype.clear=function(){this.cache.clear()},r}();l();c();d();var $f=function(){function r(){}return r.extractBrowserRequestState=function(e,t){if(B.isEmpty(t))return null;try{var o=to.parseRequestState(e,t);return o.libraryState.meta}catch(i){throw U.createInvalidStateError(t,i)}},r.parseServerResponseFromHash=function(e){if(!e)return{};var t=new Se(e);return Se.getDeserializedHash(t.getHash())},r}();var Ru=function(r){mt(e,r);function e(t,o,i,n){var s=r.call(this,t,i,n)||this;return s.COOKIE_LIFE_MULTIPLIER=24*60*60*1e3,s.cacheConfig=o,s.logger=n,s.internalStorage=new Au,s.browserStorage=s.setupBrowserStorage(s.cacheConfig.cacheLocation),s.temporaryCacheStorage=s.setupTemporaryCacheStorage(s.cacheConfig.temporaryCacheLocation,s.cacheConfig.cacheLocation),o.cacheMigrationEnabled&&(s.migrateCacheEntries(),s.createKeyMaps()),s}return e.prototype.setupBrowserStorage=function(t){switch(t){case zt.LocalStorage:case zt.SessionStorage:try{return new Sy(t)}catch(o){this.logger.verbose(o);break}}return this.cacheConfig.cacheLocation=zt.MemoryStorage,new Au},e.prototype.setupTemporaryCacheStorage=function(t,o){switch(o){case zt.LocalStorage:case zt.SessionStorage:try{return new Sy(t||zt.SessionStorage)}catch(i){return this.logger.verbose(i),this.internalStorage}case zt.MemoryStorage:default:return this.internalStorage}},e.prototype.migrateCacheEntries=function(){var t=this,o=_.CACHE_PREFIX+"."+pr.ID_TOKEN,i=_.CACHE_PREFIX+"."+pr.CLIENT_INFO,n=_.CACHE_PREFIX+"."+pr.ERROR,s=_.CACHE_PREFIX+"."+pr.ERROR_DESC,a=this.browserStorage.getItem(o),u=this.browserStorage.getItem(i),h=this.browserStorage.getItem(n),p=this.browserStorage.getItem(s),f=[a,u,h,p],b=[pr.ID_TOKEN,pr.CLIENT_INFO,pr.ERROR,pr.ERROR_DESC];b.forEach(function(C,S){return t.migrateCacheEntry(C,f[S])})},e.prototype.migrateCacheEntry=function(t,o){o&&this.setTemporaryCache(t,o,!0)},e.prototype.createKeyMaps=function(){var t=this;this.logger.trace("BrowserCacheManager - createKeyMaps called.");var o=this.getItem(Ji.ACCOUNT_KEYS),i=this.getItem(Ji.TOKEN_KEYS+"."+this.clientId);if(o&&i){this.logger.verbose("BrowserCacheManager:createKeyMaps - account and token key maps already exist, skipping migration.");return}var n=this.browserStorage.getKeys();n.forEach(function(s){if(t.isCredentialKey(s)){var a=t.getItem(s);if(a){var u=t.validateAndParseJson(a);if(u&&u.hasOwnProperty("credentialType"))switch(u.credentialType){case ue.ID_TOKEN:if(vi.isIdTokenEntity(u)){t.logger.trace("BrowserCacheManager:createKeyMaps - idToken found, saving key to token key map"),t.logger.tracePii("BrowserCacheManager:createKeyMaps - idToken with key: "+s+" found, saving key to token key map");var h=Xr.toObject(new vi,u),p=t.updateCredentialCacheKey(s,h);t.addTokenKey(p,ue.ID_TOKEN);return}else t.logger.trace("BrowserCacheManager:createKeyMaps - key found matching idToken schema with value containing idToken credentialType field but value failed IdTokenEntity validation, skipping."),t.logger.tracePii("BrowserCacheManager:createKeyMaps - failed idToken validation on key: "+s);break;case ue.ACCESS_TOKEN:case ue.ACCESS_TOKEN_WITH_AUTH_SCHEME:if(yi.isAccessTokenEntity(u)){t.logger.trace("BrowserCacheManager:createKeyMaps - accessToken found, saving key to token key map"),t.logger.tracePii("BrowserCacheManager:createKeyMaps - accessToken with key: "+s+" found, saving key to token key map");var f=Xr.toObject(new yi,u),p=t.updateCredentialCacheKey(s,f);t.addTokenKey(p,ue.ACCESS_TOKEN);return}else t.logger.trace("BrowserCacheManager:createKeyMaps - key found matching accessToken schema with value containing accessToken credentialType field but value failed AccessTokenEntity validation, skipping."),t.logger.tracePii("BrowserCacheManager:createKeyMaps - failed accessToken validation on key: "+s);break;case ue.REFRESH_TOKEN:if(In.isRefreshTokenEntity(u)){t.logger.trace("BrowserCacheManager:createKeyMaps - refreshToken found, saving key to token key map"),t.logger.tracePii("BrowserCacheManager:createKeyMaps - refreshToken with key: "+s+" found, saving key to token key map");var b=Xr.toObject(new In,u),p=t.updateCredentialCacheKey(s,b);t.addTokenKey(p,ue.REFRESH_TOKEN);return}else t.logger.trace("BrowserCacheManager:createKeyMaps - key found matching refreshToken schema with value containing refreshToken credentialType field but value failed RefreshTokenEntity validation, skipping."),t.logger.tracePii("BrowserCacheManager:createKeyMaps - failed refreshToken validation on key: "+s);break}}}if(t.isAccountKey(s)){var a=t.getItem(s);if(a){var C=t.validateAndParseJson(a);C&&Nt.isAccountEntity(C)&&(t.logger.trace("BrowserCacheManager:createKeyMaps - account found, saving key to account key map"),t.logger.tracePii("BrowserCacheManager:createKeyMaps - account with key: "+s+" found, saving key to account key map"),t.addAccountKeyToMap(s))}}})},e.prototype.validateAndParseJson=function(t){try{var o=JSON.parse(t);return o&&typeof o=="object"?o:null}catch{return null}},e.prototype.getItem=function(t){return this.browserStorage.getItem(t)},e.prototype.setItem=function(t,o){this.browserStorage.setItem(t,o)},e.prototype.getAccount=function(t){this.logger.trace("BrowserCacheManager.getAccount called");var o=this.getItem(t);if(!o)return this.removeAccountKeyFromMap(t),null;var i=this.validateAndParseJson(o);return!i||!Nt.isAccountEntity(i)?(this.removeAccountKeyFromMap(t),null):Xr.toObject(new Nt,i)},e.prototype.setAccount=function(t){this.logger.trace("BrowserCacheManager.setAccount called");var o=t.generateAccountKey();this.setItem(o,JSON.stringify(t)),this.addAccountKeyToMap(o)},e.prototype.getAccountKeys=function(){this.logger.trace("BrowserCacheManager.getAccountKeys called");var t=this.getItem(Ji.ACCOUNT_KEYS);return t?JSON.parse(t):(this.logger.verbose("BrowserCacheManager.getAccountKeys - No account keys found"),[])},e.prototype.addAccountKeyToMap=function(t){this.logger.trace("BrowserCacheManager.addAccountKeyToMap called"),this.logger.tracePii("BrowserCacheManager.addAccountKeyToMap called with key: "+t);var o=this.getAccountKeys();o.indexOf(t)===-1?(o.push(t),this.setItem(Ji.ACCOUNT_KEYS,JSON.stringify(o)),this.logger.verbose("BrowserCacheManager.addAccountKeyToMap account key added")):this.logger.verbose("BrowserCacheManager.addAccountKeyToMap account key already exists in map")},e.prototype.removeAccountKeyFromMap=function(t){this.logger.trace("BrowserCacheManager.removeAccountKeyFromMap called"),this.logger.tracePii("BrowserCacheManager.removeAccountKeyFromMap called with key: "+t);var o=this.getAccountKeys(),i=o.indexOf(t);i>-1?(o.splice(i,1),this.setItem(Ji.ACCOUNT_KEYS,JSON.stringify(o)),this.logger.trace("BrowserCacheManager.removeAccountKeyFromMap account key removed")):this.logger.trace("BrowserCacheManager.removeAccountKeyFromMap key not found in existing map")},e.prototype.removeAccount=function(t){return D(this,void 0,void 0,function(){return F(this,function(o){return r.prototype.removeAccount.call(this,t),this.removeAccountKeyFromMap(t),[2]})})},e.prototype.removeIdToken=function(t){r.prototype.removeIdToken.call(this,t),this.removeTokenKey(t,ue.ID_TOKEN)},e.prototype.removeAccessToken=function(t){return D(this,void 0,void 0,function(){return F(this,function(o){return r.prototype.removeAccessToken.call(this,t),this.removeTokenKey(t,ue.ACCESS_TOKEN),[2]})})},e.prototype.removeRefreshToken=function(t){r.prototype.removeRefreshToken.call(this,t),this.removeTokenKey(t,ue.REFRESH_TOKEN)},e.prototype.getTokenKeys=function(){this.logger.trace("BrowserCacheManager.getTokenKeys called");var t=this.getItem(Ji.TOKEN_KEYS+"."+this.clientId);if(t){var o=this.validateAndParseJson(t);if(o&&o.hasOwnProperty("idToken")&&o.hasOwnProperty("accessToken")&&o.hasOwnProperty("refreshToken"))return o;this.logger.error("BrowserCacheManager.getTokenKeys - Token keys found but in an unknown format. Returning empty key map.")}else this.logger.verbose("BrowserCacheManager.getTokenKeys - No token keys found");return{idToken:[],accessToken:[],refreshToken:[]}},e.prototype.addTokenKey=function(t,o){this.logger.trace("BrowserCacheManager addTokenKey called");var i=this.getTokenKeys();switch(o){case ue.ID_TOKEN:i.idToken.indexOf(t)===-1&&(this.logger.info("BrowserCacheManager: addTokenKey - idToken added to map"),i.idToken.push(t));break;case ue.ACCESS_TOKEN:i.accessToken.indexOf(t)===-1&&(this.logger.info("BrowserCacheManager: addTokenKey - accessToken added to map"),i.accessToken.push(t));break;case ue.REFRESH_TOKEN:i.refreshToken.indexOf(t)===-1&&(this.logger.info("BrowserCacheManager: addTokenKey - refreshToken added to map"),i.refreshToken.push(t));break;default:this.logger.error("BrowserCacheManager:addTokenKey - CredentialType provided invalid. CredentialType: "+o),U.createUnexpectedCredentialTypeError()}this.setItem(Ji.TOKEN_KEYS+"."+this.clientId,JSON.stringify(i))},e.prototype.removeTokenKey=function(t,o){this.logger.trace("BrowserCacheManager removeTokenKey called");var i=this.getTokenKeys();switch(o){case ue.ID_TOKEN:this.logger.infoPii("BrowserCacheManager: removeTokenKey - attempting to remove idToken with key: "+t+" from map");var n=i.idToken.indexOf(t);n>-1?(this.logger.info("BrowserCacheManager: removeTokenKey - idToken removed from map"),i.idToken.splice(n,1)):this.logger.info("BrowserCacheManager: removeTokenKey - idToken does not exist in map. Either it was previously removed or it was never added.");break;case ue.ACCESS_TOKEN:this.logger.infoPii("BrowserCacheManager: removeTokenKey - attempting to remove accessToken with key: "+t+" from map");var s=i.accessToken.indexOf(t);s>-1?(this.logger.info("BrowserCacheManager: removeTokenKey - accessToken removed from map"),i.accessToken.splice(s,1)):this.logger.info("BrowserCacheManager: removeTokenKey - accessToken does not exist in map. Either it was previously removed or it was never added.");break;case ue.REFRESH_TOKEN:this.logger.infoPii("BrowserCacheManager: removeTokenKey - attempting to remove refreshToken with key: "+t+" from map");var a=i.refreshToken.indexOf(t);a>-1?(this.logger.info("BrowserCacheManager: removeTokenKey - refreshToken removed from map"),i.refreshToken.splice(a,1)):this.logger.info("BrowserCacheManager: removeTokenKey - refreshToken does not exist in map. Either it was previously removed or it was never added.");break;default:this.logger.error("BrowserCacheManager:removeTokenKey - CredentialType provided invalid. CredentialType: "+o),U.createUnexpectedCredentialTypeError()}this.setItem(Ji.TOKEN_KEYS+"."+this.clientId,JSON.stringify(i))},e.prototype.getIdTokenCredential=function(t){var o=this.getItem(t);if(!o)return this.logger.trace("BrowserCacheManager.getIdTokenCredential: called, no cache hit"),this.removeTokenKey(t,ue.ID_TOKEN),null;var i=this.validateAndParseJson(o);return!i||!vi.isIdTokenEntity(i)?(this.logger.trace("BrowserCacheManager.getIdTokenCredential: called, no cache hit"),this.removeTokenKey(t,ue.ID_TOKEN),null):(this.logger.trace("BrowserCacheManager.getIdTokenCredential: cache hit"),Xr.toObject(new vi,i))},e.prototype.setIdTokenCredential=function(t){this.logger.trace("BrowserCacheManager.setIdTokenCredential called");var o=t.generateCredentialKey();this.setItem(o,JSON.stringify(t)),this.addTokenKey(o,ue.ID_TOKEN)},e.prototype.getAccessTokenCredential=function(t){var o=this.getItem(t);if(!o)return this.logger.trace("BrowserCacheManager.getAccessTokenCredential: called, no cache hit"),this.removeTokenKey(t,ue.ACCESS_TOKEN),null;var i=this.validateAndParseJson(o);return!i||!yi.isAccessTokenEntity(i)?(this.logger.trace("BrowserCacheManager.getAccessTokenCredential: called, no cache hit"),this.removeTokenKey(t,ue.ACCESS_TOKEN),null):(this.logger.trace("BrowserCacheManager.getAccessTokenCredential: cache hit"),Xr.toObject(new yi,i))},e.prototype.setAccessTokenCredential=function(t){this.logger.trace("BrowserCacheManager.setAccessTokenCredential called");var o=t.generateCredentialKey();this.setItem(o,JSON.stringify(t)),this.addTokenKey(o,ue.ACCESS_TOKEN)},e.prototype.getRefreshTokenCredential=function(t){var o=this.getItem(t);if(!o)return this.logger.trace("BrowserCacheManager.getRefreshTokenCredential: called, no cache hit"),this.removeTokenKey(t,ue.REFRESH_TOKEN),null;var i=this.validateAndParseJson(o);return!i||!In.isRefreshTokenEntity(i)?(this.logger.trace("BrowserCacheManager.getRefreshTokenCredential: called, no cache hit"),this.removeTokenKey(t,ue.REFRESH_TOKEN),null):(this.logger.trace("BrowserCacheManager.getRefreshTokenCredential: cache hit"),Xr.toObject(new In,i))},e.prototype.setRefreshTokenCredential=function(t){this.logger.trace("BrowserCacheManager.setRefreshTokenCredential called");var o=t.generateCredentialKey();this.setItem(o,JSON.stringify(t)),this.addTokenKey(o,ue.REFRESH_TOKEN)},e.prototype.getAppMetadata=function(t){var o=this.getItem(t);if(!o)return this.logger.trace("BrowserCacheManager.getAppMetadata: called, no cache hit"),null;var i=this.validateAndParseJson(o);return!i||!Pc.isAppMetadataEntity(t,i)?(this.logger.trace("BrowserCacheManager.getAppMetadata: called, no cache hit"),null):(this.logger.trace("BrowserCacheManager.getAppMetadata: cache hit"),Xr.toObject(new Pc,i))},e.prototype.setAppMetadata=function(t){this.logger.trace("BrowserCacheManager.setAppMetadata called");var o=t.generateAppMetadataKey();this.setItem(o,JSON.stringify(t))},e.prototype.getServerTelemetry=function(t){var o=this.getItem(t);if(!o)return this.logger.trace("BrowserCacheManager.getServerTelemetry: called, no cache hit"),null;var i=this.validateAndParseJson(o);return!i||!wl.isServerTelemetryEntity(t,i)?(this.logger.trace("BrowserCacheManager.getServerTelemetry: called, no cache hit"),null):(this.logger.trace("BrowserCacheManager.getServerTelemetry: cache hit"),Xr.toObject(new wl,i))},e.prototype.setServerTelemetry=function(t,o){this.logger.trace("BrowserCacheManager.setServerTelemetry called"),this.setItem(t,JSON.stringify(o))},e.prototype.getAuthorityMetadata=function(t){var o=this.internalStorage.getItem(t);if(!o)return this.logger.trace("BrowserCacheManager.getAuthorityMetadata: called, no cache hit"),null;var i=this.validateAndParseJson(o);return i&&$c.isAuthorityMetadataEntity(t,i)?(this.logger.trace("BrowserCacheManager.getAuthorityMetadata: cache hit"),Xr.toObject(new $c,i)):null},e.prototype.getAuthorityMetadataKeys=function(){var t=this,o=this.internalStorage.getKeys();return o.filter(function(i){return t.isAuthorityMetadata(i)})},e.prototype.setWrapperMetadata=function(t,o){this.internalStorage.setItem(Cl.WRAPPER_SKU,t),this.internalStorage.setItem(Cl.WRAPPER_VER,o)},e.prototype.getWrapperMetadata=function(){var t=this.internalStorage.getItem(Cl.WRAPPER_SKU)||_.EMPTY_STRING,o=this.internalStorage.getItem(Cl.WRAPPER_VER)||_.EMPTY_STRING;return[t,o]},e.prototype.setAuthorityMetadata=function(t,o){this.logger.trace("BrowserCacheManager.setAuthorityMetadata called"),this.internalStorage.setItem(t,JSON.stringify(o))},e.prototype.getActiveAccount=function(){var t=this.generateCacheKey(pr.ACTIVE_ACCOUNT_FILTERS),o=this.getItem(t);if(!o){this.logger.trace("BrowserCacheManager.getActiveAccount: No active account filters cache schema found, looking for legacy schema");var i=this.generateCacheKey(pr.ACTIVE_ACCOUNT),n=this.getItem(i);if(!n)return this.logger.trace("BrowserCacheManager.getActiveAccount: No active account found"),null;var s=this.getAccountInfoByFilter({localAccountId:n})[0]||null;return s?(this.logger.trace("BrowserCacheManager.getActiveAccount: Legacy active account cache schema found"),this.logger.trace("BrowserCacheManager.getActiveAccount: Adding active account filters cache schema"),this.setActiveAccount(s),s):null}var a=this.validateAndParseJson(o);return a?(this.logger.trace("BrowserCacheManager.getActiveAccount: Active account filters schema found"),this.getAccountInfoByFilter({homeAccountId:a.homeAccountId,localAccountId:a.localAccountId})[0]||null):(this.logger.trace("BrowserCacheManager.getActiveAccount: No active account found"),null)},e.prototype.setActiveAccount=function(t){var o=this.generateCacheKey(pr.ACTIVE_ACCOUNT_FILTERS),i=this.generateCacheKey(pr.ACTIVE_ACCOUNT);if(t){this.logger.verbose("setActiveAccount: Active account set");var n={homeAccountId:t.homeAccountId,localAccountId:t.localAccountId};this.browserStorage.setItem(o,JSON.stringify(n)),this.browserStorage.setItem(i,t.localAccountId)}else this.logger.verbose("setActiveAccount: No account passed, active account not set"),this.browserStorage.removeItem(o),this.browserStorage.removeItem(i)},e.prototype.getAccountInfoByFilter=function(t){var o=this.getAllAccounts();return this.logger.trace("BrowserCacheManager.getAccountInfoByFilter: total "+o.length+" accounts found"),o.filter(function(i){return!(t.username&&t.username.toLowerCase()!==i.username.toLowerCase()||t.homeAccountId&&t.homeAccountId!==i.homeAccountId||t.localAccountId&&t.localAccountId!==i.localAccountId||t.tenantId&&t.tenantId!==i.tenantId||t.environment&&t.environment!==i.environment)})},e.prototype.getAccountInfoByHints=function(t,o){var i=this.getAllAccounts().filter(function(n){if(o){var s=n.idTokenClaims&&n.idTokenClaims.sid;return o===s}return t?t===n.username:!1});if(i.length===1)return i[0];if(i.length>1)throw U.createMultipleMatchingAccountsInCacheError();return null},e.prototype.getThrottlingCache=function(t){var o=this.getItem(t);if(!o)return this.logger.trace("BrowserCacheManager.getThrottlingCache: called, no cache hit"),null;var i=this.validateAndParseJson(o);return!i||!Af.isThrottlingEntity(t,i)?(this.logger.trace("BrowserCacheManager.getThrottlingCache: called, no cache hit"),null):(this.logger.trace("BrowserCacheManager.getThrottlingCache: cache hit"),Xr.toObject(new Af,i))},e.prototype.setThrottlingCache=function(t,o){this.logger.trace("BrowserCacheManager.setThrottlingCache called"),this.setItem(t,JSON.stringify(o))},e.prototype.getTemporaryCache=function(t,o){var i=o?this.generateCacheKey(t):t;if(this.cacheConfig.storeAuthStateInCookie){var n=this.getItemCookie(i);if(n)return this.logger.trace("BrowserCacheManager.getTemporaryCache: storeAuthStateInCookies set to true, retrieving from cookies"),n}var s=this.temporaryCacheStorage.getItem(i);if(!s){if(this.cacheConfig.cacheLocation===zt.LocalStorage){var a=this.browserStorage.getItem(i);if(a)return this.logger.trace("BrowserCacheManager.getTemporaryCache: Temporary cache item found in local storage"),a}return this.logger.trace("BrowserCacheManager.getTemporaryCache: No cache item found in local storage"),null}return this.logger.trace("BrowserCacheManager.getTemporaryCache: Temporary cache item returned"),s},e.prototype.setTemporaryCache=function(t,o,i){var n=i?this.generateCacheKey(t):t;this.temporaryCacheStorage.setItem(n,o),this.cacheConfig.storeAuthStateInCookie&&(this.logger.trace("BrowserCacheManager.setTemporaryCache: storeAuthStateInCookie set to true, setting item cookie"),this.setItemCookie(n,o))},e.prototype.removeItem=function(t){this.browserStorage.removeItem(t),this.temporaryCacheStorage.removeItem(t),this.cacheConfig.storeAuthStateInCookie&&(this.logger.trace("BrowserCacheManager.removeItem: storeAuthStateInCookie is true, clearing item cookie"),this.clearItemCookie(t))},e.prototype.containsKey=function(t){return this.browserStorage.containsKey(t)||this.temporaryCacheStorage.containsKey(t)},e.prototype.getKeys=function(){return Tc(this.browserStorage.getKeys(),this.temporaryCacheStorage.getKeys())},e.prototype.clear=function(){return D(this,void 0,void 0,function(){var t=this;return F(this,function(o){switch(o.label){case 0:return[4,this.removeAllAccounts()];case 1:return o.sent(),this.removeAppMetadata(),this.getKeys().forEach(function(i){(t.browserStorage.containsKey(i)||t.temporaryCacheStorage.containsKey(i))&&(i.indexOf(_.CACHE_PREFIX)!==-1||i.indexOf(t.clientId)!==-1)&&t.removeItem(i)}),this.internalStorage.clear(),[2]}})})},e.prototype.clearTokensAndKeysWithClaims=function(){return D(this,void 0,void 0,function(){var t,o,i=this;return F(this,function(n){switch(n.label){case 0:return this.logger.trace("BrowserCacheManager.clearTokensAndKeysWithClaims called"),t=this.getTokenKeys(),o=[],t.accessToken.forEach(function(s){var a=i.getAccessTokenCredential(s);a?.requestedClaimsHash&&s.includes(a.requestedClaimsHash.toLowerCase())&&o.push(i.removeAccessToken(s))}),[4,Promise.all(o)];case 1:return n.sent(),o.length>0&&this.logger.warning(o.length+" access tokens with claims in the cache keys have been removed from the cache."),[2]}})})},e.prototype.setItemCookie=function(t,o,i){var n=encodeURIComponent(t)+"="+encodeURIComponent(o)+";path=/;SameSite=Lax;";if(i){var s=this.getCookieExpirationTime(i);n+="expires="+s+";"}this.cacheConfig.secureCookies&&(n+="Secure;"),document.cookie=n},e.prototype.getItemCookie=function(t){for(var o=encodeURIComponent(t)+"=",i=document.cookie.split(";"),n=0;n=300)&&(t===bi.POST?s(z.createPostRequestFailedError("Failed with status "+a.status,e)):s(z.createGetRequestFailedError("Failed with status "+a.status,e)));try{var u=JSON.parse(a.responseText),h={headers:i.getHeaderDict(a),body:u,status:a.status};n(h)}catch{s(z.createFailedToParseNetworkResponseError(e))}},a.onerror=function(){window.navigator.onLine?t===bi.POST?s(z.createPostRequestFailedError("Failed with status "+a.status,e)):s(z.createGetRequestFailedError("Failed with status "+a.status,e)):s(z.createNoNetworkConnectivityError())},t===bi.POST&&o&&o.body)a.send(o.body);else if(t===bi.GET)a.send();else throw z.createHttpMethodNotImplementedError(t)})},r.prototype.setXhrHeaders=function(e,t){if(t&&t.headers){var o=t.headers;Object.keys(o).forEach(function(i){e.setRequestHeader(i,o[i])})}},r.prototype.getHeaderDict=function(e){var t=e.getAllResponseHeaders(),o=t.trim().split(/[\r\n]+/),i={};return o.forEach(function(n){var s=n.split(": "),a=s.shift(),u=s.join(": ");a&&u&&(i[a]=u)}),i},r}();var St=function(){function r(){}return r.clearHash=function(e){e.location.hash=_.EMPTY_STRING,typeof e.history.replaceState=="function"&&e.history.replaceState(null,_.EMPTY_STRING,""+e.location.origin+e.location.pathname+e.location.search)},r.replaceHash=function(e){var t=e.split("#");t.shift(),window.location.hash=t.length>0?t.join("#"):_.EMPTY_STRING},r.isInIframe=function(){return window.parent!==window},r.isInPopup=function(){return typeof window<"u"&&!!window.opener&&window.opener!==window&&typeof window.name=="string"&&window.name.indexOf(Hr.POPUP_NAME_PREFIX+".")===0},r.getCurrentUri=function(){return window.location.href.split("?")[0].split("#")[0]},r.getHomepage=function(){var e=new Se(window.location.href),t=e.getUrlComponents();return t.Protocol+"//"+t.HostNameAndPort+"/"},r.getBrowserNetworkClient=function(){return window.fetch&&window.Headers?new $_:new O_},r.blockReloadInHiddenIframes=function(){var e=Se.hashContainsKnownProperties(window.location.hash);if(e&&r.isInIframe())throw z.createBlockReloadInHiddenIframeError()},r.blockRedirectInIframe=function(e,t){var o=r.isInIframe();if(e===ne.Redirect&&o&&!t)throw z.createRedirectInIframeError(o)},r.blockAcquireTokenInPopups=function(){if(r.isInPopup())throw z.createBlockAcquireTokenInPopupsError()},r.blockNonBrowserEnvironment=function(e){if(!e)throw z.createNonBrowserEnvironmentError()},r.blockNativeBrokerCalledBeforeInitialized=function(e,t){if(e&&!t)throw z.createNativeBrokerCalledBeforeInitialize()},r.detectIEOrEdge=function(){var e=window.navigator.userAgent,t=e.indexOf("MSIE "),o=e.indexOf("Trident/"),i=e.indexOf("Edge/"),n=t>0||o>0,s=i>0;return n||s},r}();var Of=function(){function r(e,t,o,i,n,s,a,u,h){this.config=e,this.browserStorage=t,this.browserCrypto=o,this.networkClient=this.config.system.networkClient,this.eventHandler=n,this.navigationClient=s,this.nativeMessageHandler=u,this.correlationId=h||this.browserCrypto.createNewGuid(),this.logger=i.clone(Hr.MSAL_SKU,Xi,this.correlationId),this.performanceClient=a}return r.prototype.clearCacheOnLogout=function(e){return D(this,void 0,void 0,function(){return F(this,function(t){switch(t.label){case 0:if(!e)return[3,5];Nt.accountInfoIsEqual(e,this.browserStorage.getActiveAccount(),!1)&&(this.logger.verbose("Setting active account to null"),this.browserStorage.setActiveAccount(null)),t.label=1;case 1:return t.trys.push([1,3,,4]),[4,this.browserStorage.removeAccount(Nt.generateAccountCacheKey(e))];case 2:return t.sent(),this.logger.verbose("Cleared cache items belonging to the account provided in the logout request."),[3,4];case 3:return t.sent(),this.logger.error("Account provided in logout request was not found. Local cache unchanged."),[3,4];case 4:return[3,9];case 5:return t.trys.push([5,8,,9]),this.logger.verbose("No account provided in logout request, clearing all cache items.",this.correlationId),[4,this.browserStorage.clear()];case 6:return t.sent(),[4,this.browserCrypto.clearKeystore()];case 7:return t.sent(),[3,9];case 8:return t.sent(),this.logger.error("Attempted to clear all MSAL cache items and failed. Local cache unchanged."),[3,9];case 9:return[2]}})})},r.prototype.initializeBaseRequest=function(e,t){return D(this,void 0,void 0,function(){var o,i,n,s;return F(this,function(a){switch(a.label){case 0:return this.performanceClient.addQueueMeasurement($.InitializeBaseRequest,e.correlationId),this.logger.verbose("Initializing BaseAuthRequest"),o=e.authority||this.config.auth.authority,t?[4,this.validateRequestAuthority(o,t)]:[3,2];case 1:a.sent(),a.label=2;case 2:if(i=Tc(e&&e.scopes||[]),n=ae(ae({},e),{correlationId:this.correlationId,authority:o,scopes:i}),!n.authenticationScheme)n.authenticationScheme=Be.BEARER,this.logger.verbose(`Authentication Scheme wasn't explicitly set in request, defaulting to "Bearer" request`);else{if(n.authenticationScheme===Be.SSH){if(!e.sshJwk)throw je.createMissingSshJwkError();if(!e.sshKid)throw je.createMissingSshKidError()}this.logger.verbose('Authentication Scheme set to "'+n.authenticationScheme+'" as configured in Auth request')}return this.config.cache.claimsBasedCachingEnabled&&e.claims&&!B.isEmptyObj(e.claims)?(s=n,[4,this.browserCrypto.hashString(e.claims)]):[3,4];case 3:s.requestedClaimsHash=a.sent(),a.label=4;case 4:return[2,n]}})})},r.prototype.getRedirectUri=function(e){this.logger.verbose("getRedirectUri called");var t=e||this.config.auth.redirectUri||St.getCurrentUri();return Se.getAbsoluteUrl(t,St.getCurrentUri())},r.prototype.validateRequestAuthority=function(e,t){return D(this,void 0,void 0,function(){var o;return F(this,function(i){switch(i.label){case 0:return[4,this.getDiscoveredAuthority(e)];case 1:if(o=i.sent(),!o.isAlias(t.environment))throw je.createAuthorityMismatchError();return[2]}})})},r.prototype.initializeServerTelemetryManager=function(e,t){this.logger.verbose("initializeServerTelemetryManager called");var o={clientId:this.config.auth.clientId,correlationId:this.correlationId,apiId:e,forceRefresh:t||!1,wrapperSKU:this.browserStorage.getWrapperMetadata()[0],wrapperVer:this.browserStorage.getWrapperMetadata()[1]};return new wy(o,this.browserStorage)},r.prototype.getDiscoveredAuthority=function(e){return D(this,void 0,void 0,function(){var t;return F(this,function(o){switch(o.label){case 0:return this.logger.verbose("getDiscoveredAuthority called"),t={protocolMode:this.config.auth.protocolMode,knownAuthorities:this.config.auth.knownAuthorities,cloudDiscoveryMetadata:this.config.auth.cloudDiscoveryMetadata,authorityMetadata:this.config.auth.authorityMetadata},e?(this.logger.verbose("Creating discovered authority with request authority"),[4,ia.createDiscoveredInstance(e,this.config.system.networkClient,this.browserStorage,t,this.logger)]):[3,2];case 1:return[2,o.sent()];case 2:return this.logger.verbose("Creating discovered authority with configured authority"),[4,ia.createDiscoveredInstance(this.config.auth.authority,this.config.system.networkClient,this.browserStorage,t,this.logger)];case 3:return[2,o.sent()]}})})},r}();var li=function(r){mt(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.initializeAuthorizationCodeRequest=function(t){return D(this,void 0,void 0,function(){var o,i;return F(this,function(n){switch(n.label){case 0:return this.performanceClient.addQueueMeasurement($.StandardInteractionClientInitializeAuthorizationCodeRequest,t.correlationId),this.logger.verbose("initializeAuthorizationRequest called",t.correlationId),[4,this.browserCrypto.generatePkceCodes()];case 1:return o=n.sent(),i=ae(ae({},t),{redirectUri:t.redirectUri,code:_.EMPTY_STRING,codeVerifier:o.verifier}),t.codeChallenge=o.challenge,t.codeChallengeMethod=_.S256_CODE_CHALLENGE_METHOD,[2,i]}})})},e.prototype.initializeLogoutRequest=function(t){this.logger.verbose("initializeLogoutRequest called",t?.correlationId);var o=ae({correlationId:this.correlationId||this.browserCrypto.createNewGuid()},t);if(t)if(t.logoutHint)this.logger.verbose("logoutHint has already been set in logoutRequest");else if(t.account){var i=this.getLogoutHintFromIdTokenClaims(t.account);i&&(this.logger.verbose("Setting logoutHint to login_hint ID Token Claim value for the account provided"),o.logoutHint=i)}else this.logger.verbose("logoutHint was not set and account was not passed into logout request, logoutHint will not be set");else this.logger.verbose("logoutHint will not be set since no logout request was configured");return!t||t.postLogoutRedirectUri!==null?t&&t.postLogoutRedirectUri?(this.logger.verbose("Setting postLogoutRedirectUri to uri set on logout request",o.correlationId),o.postLogoutRedirectUri=Se.getAbsoluteUrl(t.postLogoutRedirectUri,St.getCurrentUri())):this.config.auth.postLogoutRedirectUri===null?this.logger.verbose("postLogoutRedirectUri configured as null and no uri set on request, not passing post logout redirect",o.correlationId):this.config.auth.postLogoutRedirectUri?(this.logger.verbose("Setting postLogoutRedirectUri to configured uri",o.correlationId),o.postLogoutRedirectUri=Se.getAbsoluteUrl(this.config.auth.postLogoutRedirectUri,St.getCurrentUri())):(this.logger.verbose("Setting postLogoutRedirectUri to current page",o.correlationId),o.postLogoutRedirectUri=Se.getAbsoluteUrl(St.getCurrentUri(),St.getCurrentUri())):this.logger.verbose("postLogoutRedirectUri passed as null, not setting post logout redirect uri",o.correlationId),o},e.prototype.getLogoutHintFromIdTokenClaims=function(t){var o=t.idTokenClaims;if(o){if(o.login_hint)return o.login_hint;this.logger.verbose("The ID Token Claims tied to the provided account do not contain a login_hint claim, logoutHint will not be added to logout request")}else this.logger.verbose("The provided account does not contain ID Token Claims, logoutHint will not be added to logout request");return null},e.prototype.createAuthCodeClient=function(t,o,i){return D(this,void 0,void 0,function(){var n;return F(this,function(s){switch(s.label){case 0:return this.performanceClient.addQueueMeasurement($.StandardInteractionClientCreateAuthCodeClient,this.correlationId),this.performanceClient.setPreQueueTime($.StandardInteractionClientGetClientConfiguration,this.correlationId),[4,this.getClientConfiguration(t,o,i)];case 1:return n=s.sent(),[2,new Tu(n,this.performanceClient)]}})})},e.prototype.getClientConfiguration=function(t,o,i){return D(this,void 0,void 0,function(){var n,s;return F(this,function(a){switch(a.label){case 0:return this.performanceClient.addQueueMeasurement($.StandardInteractionClientGetClientConfiguration,this.correlationId),this.logger.verbose("getClientConfiguration called",this.correlationId),this.performanceClient.setPreQueueTime($.StandardInteractionClientGetDiscoveredAuthority,this.correlationId),[4,this.getDiscoveredAuthority(o,i)];case 1:return n=a.sent(),s=this.config.system.loggerOptions,[2,{authOptions:{clientId:this.config.auth.clientId,authority:n,clientCapabilities:this.config.auth.clientCapabilities},systemOptions:{tokenRenewalOffsetSeconds:this.config.system.tokenRenewalOffsetSeconds,preventCorsPreflight:!0},loggerOptions:{loggerCallback:s.loggerCallback,piiLoggingEnabled:s.piiLoggingEnabled,logLevel:s.logLevel,correlationId:this.correlationId},cacheOptions:{claimsBasedCachingEnabled:this.config.cache.claimsBasedCachingEnabled},cryptoInterface:this.browserCrypto,networkInterface:this.networkClient,storageInterface:this.browserStorage,serverTelemetryManager:t,libraryInfo:{sku:Hr.MSAL_SKU,version:Xi,cpu:_.EMPTY_STRING,os:_.EMPTY_STRING},telemetry:this.config.telemetry}]}})})},e.prototype.validateAndExtractStateFromHash=function(t,o,i){if(this.logger.verbose("validateAndExtractStateFromHash called",i),!t.state)throw z.createHashDoesNotContainStateError();var n=$f.extractBrowserRequestState(this.browserCrypto,t.state);if(!n)throw z.createUnableToParseStateError();if(n.interactionType!==o)throw z.createStateInteractionTypeMismatchError();return this.logger.verbose("Returning state from hash",i),t.state},e.prototype.getDiscoveredAuthority=function(t,o){var i;return D(this,void 0,void 0,function(){var n,s,a,u;return F(this,function(h){switch(h.label){case 0:return this.performanceClient.addQueueMeasurement($.StandardInteractionClientGetDiscoveredAuthority,this.correlationId),this.logger.verbose("getDiscoveredAuthority called",this.correlationId),n=(i=this.performanceClient)===null||i===void 0?void 0:i.startMeasurement($.StandardInteractionClientGetDiscoveredAuthority,this.correlationId),s={protocolMode:this.config.auth.protocolMode,knownAuthorities:this.config.auth.knownAuthorities,cloudDiscoveryMetadata:this.config.auth.cloudDiscoveryMetadata,authorityMetadata:this.config.auth.authorityMetadata,skipAuthorityMetadataCache:this.config.auth.skipAuthorityMetadataCache},a=t||this.config.auth.authority,u=fs.generateAuthority(a,o||this.config.auth.azureCloudOptions),this.logger.verbose("Creating discovered authority with configured authority",this.correlationId),this.performanceClient.setPreQueueTime($.AuthorityFactoryCreateDiscoveredInstance,this.correlationId),[4,ia.createDiscoveredInstance(u,this.config.system.networkClient,this.browserStorage,s,this.logger,this.performanceClient,this.correlationId).then(function(p){return n.endMeasurement({success:!0}),p}).catch(function(p){throw n.endMeasurement({errorCode:p.errorCode,subErrorCode:p.subError,success:!1}),p})];case 1:return[2,h.sent()]}})})},e.prototype.initializeAuthorizationRequest=function(t,o){return D(this,void 0,void 0,function(){var i,n,s,a,u,h,p;return F(this,function(f){switch(f.label){case 0:return this.performanceClient.addQueueMeasurement($.StandardInteractionClientInitializeAuthorizationRequest,this.correlationId),this.logger.verbose("initializeAuthorizationRequest called",this.correlationId),i=this.getRedirectUri(t.redirectUri),n={interactionType:o},s=to.setRequestState(this.browserCrypto,t&&t.state||_.EMPTY_STRING,n),this.performanceClient.setPreQueueTime($.InitializeBaseRequest,this.correlationId),u=[{}],[4,this.initializeBaseRequest(t)];case 1:return a=ae.apply(void 0,[ae.apply(void 0,u.concat([f.sent()])),{redirectUri:i,state:s,nonce:t.nonce||this.browserCrypto.createNewGuid(),responseMode:ml.FRAGMENT}]),h=t.account||this.browserStorage.getActiveAccount(),h&&(this.logger.verbose("Setting validated request account",this.correlationId),this.logger.verbosePii("Setting validated request account: "+h.homeAccountId,this.correlationId),a.account=h),B.isEmpty(a.loginHint)&&!h&&(p=this.browserStorage.getLegacyLoginHint(),p&&(a.loginHint=p)),[2,a]}})})},e}(Of);l();c();d();l();c();d();l();c();d();var Mc=function(){function r(e,t,o,i,n){this.authModule=e,this.browserStorage=t,this.authCodeRequest=o,this.logger=i,this.performanceClient=n}return r.prototype.handleCodeResponseFromHash=function(e,t,o,i){return D(this,void 0,void 0,function(){var n,s,a;return F(this,function(u){if(this.performanceClient.addQueueMeasurement($.HandleCodeResponseFromHash,this.authCodeRequest.correlationId),this.logger.verbose("InteractionHandler.handleCodeResponse called"),B.isEmpty(e))throw z.createEmptyHashError(e);if(n=this.browserStorage.generateStateKey(t),s=this.browserStorage.getTemporaryCache(n),!s)throw U.createStateNotFoundError("Cached State");try{a=this.authModule.handleFragmentResponse(e,s)}catch(h){throw h instanceof eo&&h.subError===q.userCancelledError.code?z.createUserCancelledError():h}return this.performanceClient.setPreQueueTime($.HandleCodeResponseFromServer,this.authCodeRequest.correlationId),[2,this.handleCodeResponseFromServer(a,t,o,i)]})})},r.prototype.handleCodeResponseFromServer=function(e,t,o,i,n){return n===void 0&&(n=!0),D(this,void 0,void 0,function(){var s,a,u,h,p,f;return F(this,function(b){switch(b.label){case 0:if(this.performanceClient.addQueueMeasurement($.HandleCodeResponseFromServer,this.authCodeRequest.correlationId),this.logger.trace("InteractionHandler.handleCodeResponseFromServer called"),s=this.browserStorage.generateStateKey(t),a=this.browserStorage.getTemporaryCache(s),!a)throw U.createStateNotFoundError("Cached State");return u=this.browserStorage.generateNonceKey(a),h=this.browserStorage.getTemporaryCache(u),this.authCodeRequest.code=e.code,e.cloud_instance_host_name?(this.performanceClient.setPreQueueTime($.UpdateTokenEndpointAuthority,this.authCodeRequest.correlationId),[4,this.updateTokenEndpointAuthority(e.cloud_instance_host_name,o,i)]):[3,2];case 1:b.sent(),b.label=2;case 2:return n&&(e.nonce=h||void 0),e.state=a,e.client_info?this.authCodeRequest.clientInfo=e.client_info:(p=this.checkCcsCredentials(),p&&(this.authCodeRequest.ccsCredential=p)),this.performanceClient.setPreQueueTime($.AuthClientAcquireToken,this.authCodeRequest.correlationId),[4,this.authModule.acquireToken(this.authCodeRequest,e)];case 3:return f=b.sent(),this.browserStorage.cleanRequestByState(t),[2,f]}})})},r.prototype.updateTokenEndpointAuthority=function(e,t,o){return D(this,void 0,void 0,function(){var i,n;return F(this,function(s){switch(s.label){case 0:return this.performanceClient.addQueueMeasurement($.UpdateTokenEndpointAuthority,this.authCodeRequest.correlationId),i="https://"+e+"/"+t.tenant+"/",[4,ia.createDiscoveredInstance(i,o,this.browserStorage,t.options,this.logger,this.performanceClient,this.authCodeRequest.correlationId)];case 1:return n=s.sent(),this.authModule.updateAuthority(n),[2]}})})},r.prototype.checkCcsCredentials=function(){var e=this.browserStorage.getTemporaryCache(Ye.CCS_CREDENTIAL,!0);if(e)try{return JSON.parse(e)}catch{this.authModule.logger.error("Cache credential could not be parsed"),this.authModule.logger.errorPii("Cache credential could not be parsed: "+e)}return null},r}();var Mf=function(r){mt(e,r);function e(t,o,i,n,s,a){var u=r.call(this,t,o,i,n,a)||this;return u.browserCrypto=s,u}return e.prototype.initiateAuthRequest=function(t,o){return D(this,void 0,void 0,function(){var i,n;return F(this,function(s){switch(s.label){case 0:return this.logger.verbose("RedirectHandler.initiateAuthRequest called"),B.isEmpty(t)?[3,7]:(o.redirectStartPage&&(this.logger.verbose("RedirectHandler.initiateAuthRequest: redirectStartPage set, caching start page"),this.browserStorage.setTemporaryCache(Ye.ORIGIN_URI,o.redirectStartPage,!0)),this.browserStorage.setTemporaryCache(Ye.CORRELATION_ID,this.authCodeRequest.correlationId,!0),this.browserStorage.cacheCodeRequest(this.authCodeRequest,this.browserCrypto),this.logger.infoPii("RedirectHandler.initiateAuthRequest: Navigate to: "+t),i={apiId:ct.acquireTokenRedirect,timeout:o.redirectTimeout,noHistory:!1},typeof o.onRedirectNavigate!="function"?[3,4]:(this.logger.verbose("RedirectHandler.initiateAuthRequest: Invoking onRedirectNavigate callback"),n=o.onRedirectNavigate(t),n===!1?[3,2]:(this.logger.verbose("RedirectHandler.initiateAuthRequest: onRedirectNavigate did not return false, navigating"),[4,o.navigationClient.navigateExternal(t,i)])));case 1:return s.sent(),[2];case 2:return this.logger.verbose("RedirectHandler.initiateAuthRequest: onRedirectNavigate returned false, stopping navigation"),[2];case 3:return[3,6];case 4:return this.logger.verbose("RedirectHandler.initiateAuthRequest: Navigating window to navigate url"),[4,o.navigationClient.navigateExternal(t,i)];case 5:return s.sent(),[2];case 6:return[3,8];case 7:throw this.logger.info("RedirectHandler.initiateAuthRequest: Navigate url is empty"),z.createEmptyNavigationUriError();case 8:return[2]}})})},e.prototype.handleCodeResponseFromHash=function(t,o,i,n){return D(this,void 0,void 0,function(){var s,a,u,h,p,f,b;return F(this,function(C){switch(C.label){case 0:if(this.logger.verbose("RedirectHandler.handleCodeResponse called"),B.isEmpty(t))throw z.createEmptyHashError(t);if(this.browserStorage.setInteractionInProgress(!1),s=this.browserStorage.generateStateKey(o),a=this.browserStorage.getTemporaryCache(s),!a)throw U.createStateNotFoundError("Cached State");try{u=this.authModule.handleFragmentResponse(t,a)}catch(S){throw S instanceof eo&&S.subError===q.userCancelledError.code?z.createUserCancelledError():S}return h=this.browserStorage.generateNonceKey(a),p=this.browserStorage.getTemporaryCache(h),this.authCodeRequest.code=u.code,u.cloud_instance_host_name?[4,this.updateTokenEndpointAuthority(u.cloud_instance_host_name,i,n)]:[3,2];case 1:C.sent(),C.label=2;case 2:return u.nonce=p||void 0,u.state=a,u.client_info?this.authCodeRequest.clientInfo=u.client_info:(f=this.checkCcsCredentials(),f&&(this.authCodeRequest.ccsCredential=f)),[4,this.authModule.acquireToken(this.authCodeRequest,u)];case 3:return b=C.sent(),this.browserStorage.cleanRequestByState(o),[2,b]}})})},e}(Mc);l();c();d();var he;(function(r){r.INITIALIZE_START="msal:initializeStart",r.INITIALIZE_END="msal:initializeEnd",r.ACCOUNT_ADDED="msal:accountAdded",r.ACCOUNT_REMOVED="msal:accountRemoved",r.LOGIN_START="msal:loginStart",r.LOGIN_SUCCESS="msal:loginSuccess",r.LOGIN_FAILURE="msal:loginFailure",r.ACQUIRE_TOKEN_START="msal:acquireTokenStart",r.ACQUIRE_TOKEN_SUCCESS="msal:acquireTokenSuccess",r.ACQUIRE_TOKEN_FAILURE="msal:acquireTokenFailure",r.ACQUIRE_TOKEN_NETWORK_START="msal:acquireTokenFromNetworkStart",r.SSO_SILENT_START="msal:ssoSilentStart",r.SSO_SILENT_SUCCESS="msal:ssoSilentSuccess",r.SSO_SILENT_FAILURE="msal:ssoSilentFailure",r.ACQUIRE_TOKEN_BY_CODE_START="msal:acquireTokenByCodeStart",r.ACQUIRE_TOKEN_BY_CODE_SUCCESS="msal:acquireTokenByCodeSuccess",r.ACQUIRE_TOKEN_BY_CODE_FAILURE="msal:acquireTokenByCodeFailure",r.HANDLE_REDIRECT_START="msal:handleRedirectStart",r.HANDLE_REDIRECT_END="msal:handleRedirectEnd",r.POPUP_OPENED="msal:popupOpened",r.LOGOUT_START="msal:logoutStart",r.LOGOUT_SUCCESS="msal:logoutSuccess",r.LOGOUT_FAILURE="msal:logoutFailure",r.LOGOUT_END="msal:logoutEnd",r.RESTORE_FROM_BFCACHE="msal:restoreFromBFCache"})(he||(he={}));l();c();d();l();c();d();var na;(function(r){r.USER_INTERACTION_REQUIRED="USER_INTERACTION_REQUIRED",r.USER_CANCEL="USER_CANCEL",r.NO_NETWORK="NO_NETWORK",r.TRANSIENT_ERROR="TRANSIENT_ERROR",r.PERSISTENT_ERROR="PERSISTENT_ERROR",r.DISABLED="DISABLED",r.ACCOUNT_UNAVAILABLE="ACCOUNT_UNAVAILABLE"})(na||(na={}));var Pu={extensionError:{code:"ContentError"},userSwitch:{code:"user_switch",desc:"User attempted to switch accounts in the native broker, which is not allowed. All new accounts must sign-in through the standard web flow first, please try again."},tokensNotFoundInCache:{code:"tokens_not_found_in_internal_memory_cache",desc:"Tokens not cached in MSAL JS internal memory, please make the WAM request"}},Eo=function(r){mt(e,r);function e(t,o,i){var n=r.call(this,t,o)||this;return Object.setPrototypeOf(n,e.prototype),n.name="NativeAuthError",n.ext=i,n}return e.prototype.isFatal=function(){if(this.ext&&this.ext.status&&(this.ext.status===na.PERSISTENT_ERROR||this.ext.status===na.DISABLED))return!0;switch(this.errorCode){case Pu.extensionError.code:return!0;default:return!1}},e.createError=function(t,o,i){if(i&&i.status)switch(i.status){case na.ACCOUNT_UNAVAILABLE:return Cr.createNativeAccountUnavailableError();case na.USER_INTERACTION_REQUIRED:return new Cr(t,o);case na.USER_CANCEL:return z.createUserCancelledError();case na.NO_NETWORK:return z.createNoNetworkConnectivityError()}return new e(t,o,i)},e.createUserSwitchError=function(){return new e(Pu.userSwitch.code,Pu.userSwitch.desc)},e.createTokensNotFoundInCacheError=function(){return new e(Pu.tokensNotFoundInCache.code,Pu.tokensNotFoundInCache.desc)},e}(ee);l();c();d();var $u=function(r){mt(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.acquireToken=function(t){return D(this,void 0,void 0,function(){var o,i,n,s,a;return F(this,function(u){switch(u.label){case 0:return o=this.performanceClient.startMeasurement($.SilentCacheClientAcquireToken,t.correlationId),i=this.initializeServerTelemetryManager(ct.acquireTokenSilent_silentFlow),[4,this.createSilentFlowClient(i,t.authority,t.azureCloudOptions)];case 1:n=u.sent(),this.logger.verbose("Silent auth client created"),u.label=2;case 2:return u.trys.push([2,4,,5]),[4,n.acquireCachedToken(t)];case 3:return s=u.sent(),o.endMeasurement({success:!0,fromCache:!0}),[2,s];case 4:throw a=u.sent(),a instanceof z&&a.errorCode===q.signingKeyNotFoundInStorage.code&&this.logger.verbose("Signing keypair for bound access token not found. Refreshing bound access token and generating a new crypto keypair."),o.endMeasurement({errorCode:a instanceof ee&&a.errorCode||void 0,subErrorCode:a instanceof ee&&a.subError||void 0,success:!1}),a;case 5:return[2]}})})},e.prototype.logout=function(){return Promise.reject(z.createSilentLogoutUnsupportedError())},e.prototype.createSilentFlowClient=function(t,o,i){return D(this,void 0,void 0,function(){var n;return F(this,function(s){switch(s.label){case 0:return this.performanceClient.setPreQueueTime($.StandardInteractionClientGetClientConfiguration,this.correlationId),[4,this.getClientConfiguration(t,o,i)];case 1:return n=s.sent(),[2,new fy(n,this.performanceClient)]}})})},e.prototype.initializeSilentRequest=function(t,o){return D(this,void 0,void 0,function(){var i;return F(this,function(n){switch(n.label){case 0:return this.performanceClient.addQueueMeasurement($.InitializeSilentRequest,this.correlationId),this.performanceClient.setPreQueueTime($.InitializeBaseRequest,this.correlationId),i=[ae({},t)],[4,this.initializeBaseRequest(t,o)];case 1:return[2,ae.apply(void 0,[ae.apply(void 0,i.concat([n.sent()])),{account:o,forceRefresh:t.forceRefresh||!1}])]}})})},e}(li);var en=function(r){mt(e,r);function e(t,o,i,n,s,a,u,h,p,f,b,C){var S=r.call(this,t,o,i,n,s,a,h,p,C)||this;return S.apiId=u,S.accountId=f,S.nativeMessageHandler=p,S.nativeStorageManager=b,S.silentCacheClient=new $u(t,S.nativeStorageManager,i,n,s,a,h,p,C),S}return e.prototype.acquireToken=function(t){return D(this,void 0,void 0,function(){var o,i,n,s,a,u,h;return F(this,function(p){switch(p.label){case 0:return this.logger.trace("NativeInteractionClient - acquireToken called."),o=this.performanceClient.startMeasurement($.NativeInteractionClientAcquireToken,t.correlationId),i=st.nowSeconds(),[4,this.initializeNativeRequest(t)];case 1:n=p.sent(),p.label=2;case 2:return p.trys.push([2,4,,5]),[4,this.acquireTokensFromCache(this.accountId,n)];case 3:return s=p.sent(),o.endMeasurement({success:!0,isNativeBroker:!1,fromCache:!0}),[2,s];case 4:return p.sent(),this.logger.info("MSAL internal Cache does not contain tokens, proceed to make a native call"),[3,5];case 5:return a={method:Zi.GetToken,request:n},[4,this.nativeMessageHandler.sendMessage(a)];case 6:return u=p.sent(),h=this.validateNativeResponse(u),[2,this.handleNativeResponse(h,n,i).then(function(f){return o.endMeasurement({success:!0,isNativeBroker:!0,requestId:f.requestId}),f}).catch(function(f){throw o.endMeasurement({success:!1,errorCode:f.errorCode,subErrorCode:f.subError,isNativeBroker:!0}),f})]}})})},e.prototype.createSilentCacheRequest=function(t,o){return{authority:t.authority,correlationId:this.correlationId,scopes:It.fromString(t.scope).asArray(),account:o,forceRefresh:!1}},e.prototype.acquireTokensFromCache=function(t,o){return D(this,void 0,void 0,function(){var i,n,s,a;return F(this,function(u){switch(u.label){case 0:if(!t)throw this.logger.warning("NativeInteractionClient:acquireTokensFromCache - No nativeAccountId provided"),U.createNoAccountFoundError();if(i=this.browserStorage.getAccountInfoFilteredBy({nativeAccountId:t}),!i)throw U.createNoAccountFoundError();u.label=1;case 1:return u.trys.push([1,3,,4]),n=this.createSilentCacheRequest(o,i),[4,this.silentCacheClient.acquireToken(n)];case 2:return s=u.sent(),[2,s];case 3:throw a=u.sent(),a;case 4:return[2]}})})},e.prototype.acquireTokenRedirect=function(t){return D(this,void 0,void 0,function(){var o,i,n,s,a,u;return F(this,function(h){switch(h.label){case 0:return this.logger.trace("NativeInteractionClient - acquireTokenRedirect called."),[4,this.initializeNativeRequest(t)];case 1:o=h.sent(),i={method:Zi.GetToken,request:o},h.label=2;case 2:return h.trys.push([2,4,,5]),[4,this.nativeMessageHandler.sendMessage(i)];case 3:return n=h.sent(),this.validateNativeResponse(n),[3,5];case 4:if(s=h.sent(),s instanceof Eo&&s.isFatal())throw s;return[3,5];case 5:return this.browserStorage.setTemporaryCache(Ye.NATIVE_REQUEST,JSON.stringify(o),!0),a={apiId:ct.acquireTokenRedirect,timeout:this.config.system.redirectNavigationTimeout,noHistory:!1},u=this.config.auth.navigateToLoginRequestUrl?window.location.href:this.getRedirectUri(t.redirectUri),[4,this.navigationClient.navigateExternal(u,a)];case 6:return h.sent(),[2]}})})},e.prototype.handleRedirectPromise=function(){return D(this,void 0,void 0,function(){var t,o,i,n,s,a,u,h;return F(this,function(p){switch(p.label){case 0:if(this.logger.trace("NativeInteractionClient - handleRedirectPromise called."),!this.browserStorage.isInteractionInProgress(!0))return this.logger.info("handleRedirectPromise called but there is no interaction in progress, returning null."),[2,null];if(t=this.browserStorage.getCachedNativeRequest(),!t)return this.logger.verbose("NativeInteractionClient - handleRedirectPromise called but there is no cached request, returning null."),[2,null];o=t.prompt,i=sy(t,["prompt"]),o&&this.logger.verbose("NativeInteractionClient - handleRedirectPromise called and prompt was included in the original request, removing prompt from cached request to prevent second interaction with native broker window."),this.browserStorage.removeItem(this.browserStorage.generateCacheKey(Ye.NATIVE_REQUEST)),n={method:Zi.GetToken,request:i},s=st.nowSeconds(),p.label=1;case 1:return p.trys.push([1,3,,4]),this.logger.verbose("NativeInteractionClient - handleRedirectPromise sending message to native broker."),[4,this.nativeMessageHandler.sendMessage(n)];case 2:return a=p.sent(),this.validateNativeResponse(a),u=this.handleNativeResponse(a,i,s),this.browserStorage.setInteractionInProgress(!1),[2,u];case 3:throw h=p.sent(),this.browserStorage.setInteractionInProgress(!1),h;case 4:return[2]}})})},e.prototype.logout=function(){return this.logger.trace("NativeInteractionClient - logout called."),Promise.reject("Logout not implemented yet")},e.prototype.handleNativeResponse=function(t,o,i){return D(this,void 0,void 0,function(){var n,s,a,u,h,p;return F(this,function(f){switch(f.label){case 0:if(this.logger.trace("NativeInteractionClient - handleNativeResponse called."),t.account.id!==o.accountId)throw Eo.createUserSwitchError();return[4,this.getDiscoveredAuthority(o.authority)];case 1:return n=f.sent(),s=n.getPreferredCache(),a=this.createIdTokenObj(t),u=this.createHomeAccountIdentifier(t,a),h=this.createAccountEntity(t,u,a,s),[4,this.generateAuthenticationResult(t,o,a,h,n.canonicalAuthority,i)];case 2:return p=f.sent(),this.cacheAccount(h),this.cacheNativeTokens(t,o,u,h,a,p.accessToken,p.tenantId,i),[2,p]}})})},e.prototype.createIdTokenObj=function(t){return new fr(t.id_token||_.EMPTY_STRING,this.browserCrypto)},e.prototype.createHomeAccountIdentifier=function(t,o){var i=Nt.generateHomeAccountId(t.client_info||_.EMPTY_STRING,br.Default,this.logger,this.browserCrypto,o);return i},e.prototype.createAccountEntity=function(t,o,i,n){return Nt.createAccount(t.client_info,o,i,void 0,void 0,void 0,n,t.account.id)},e.prototype.generateScopes=function(t,o){return t.scope?It.fromString(t.scope):It.fromString(o.scope)},e.prototype.generatePopAccessToken=function(t,o){return D(this,void 0,void 0,function(){var i,n;return F(this,function(s){switch(s.label){case 0:if(o.tokenType!==Be.POP)return[3,2];if(t.shr)return this.logger.trace("handleNativeServerResponse: SHR is enabled in native layer"),[2,t.shr];if(i=new ai(this.browserCrypto),n={resourceRequestMethod:o.resourceRequestMethod,resourceRequestUri:o.resourceRequestUri,shrClaims:o.shrClaims,shrNonce:o.shrNonce},!o.keyId)throw U.createKeyIdMissingError();return[4,i.signPopToken(t.access_token,o.keyId,n)];case 1:return[2,s.sent()];case 2:return[2,t.access_token]}})})},e.prototype.generateAuthenticationResult=function(t,o,i,n,s,a){return D(this,void 0,void 0,function(){var u,h,p,f,b,C,S,R;return F(this,function(H){switch(H.label){case 0:return u=this.addTelemetryFromNativeResponse(t),h=t.scope?It.fromString(t.scope):It.fromString(o.scope),p=t.account.properties||{},f=p.UID||i.claims.oid||i.claims.sub||_.EMPTY_STRING,b=p.TenantId||i.claims.tid||_.EMPTY_STRING,[4,this.generatePopAccessToken(t,o)];case 1:return C=H.sent(),S=o.tokenType===Be.POP?Be.POP:Be.BEARER,R={authority:s,uniqueId:f,tenantId:b,scopes:h.asArray(),account:n.getAccountInfo(),idToken:t.id_token,idTokenClaims:i.claims,accessToken:C,fromCache:u?this.isResponseFromCache(u):!1,expiresOn:new Date(Number(a+t.expires_in)*1e3),tokenType:S,correlationId:this.correlationId,state:t.state,fromNativeBroker:!0},[2,R]}})})},e.prototype.cacheAccount=function(t){var o=this;this.browserStorage.setAccount(t),this.browserStorage.removeAccountContext(t).catch(function(i){o.logger.error("Error occurred while removing account context from browser storage. "+i)})},e.prototype.cacheNativeTokens=function(t,o,i,n,s,a,u,h){var p=vi.createIdTokenEntity(i,o.authority,t.id_token||_.EMPTY_STRING,o.clientId,s.claims.tid||_.EMPTY_STRING),f=o.tokenType===Be.POP?_.SHR_NONCE_VALIDITY:(typeof t.expires_in=="string"?parseInt(t.expires_in,10):t.expires_in)||0,b=h+f,C=this.generateScopes(t,o),S=yi.createAccessTokenEntity(i,o.authority,a,o.clientId,s?s.claims.tid||_.EMPTY_STRING:u,C.printScopes(),b,0,this.browserCrypto),R=new hs(n,p,S);this.nativeStorageManager.saveCacheRecord(R)},e.prototype.addTelemetryFromNativeResponse=function(t){var o=this.getMATSFromResponse(t);return o?(this.performanceClient.addStaticFields({extensionId:this.nativeMessageHandler.getExtensionId(),extensionVersion:this.nativeMessageHandler.getExtensionVersion(),matsBrokerVersion:o.broker_version,matsAccountJoinOnStart:o.account_join_on_start,matsAccountJoinOnEnd:o.account_join_on_end,matsDeviceJoin:o.device_join,matsPromptBehavior:o.prompt_behavior,matsApiErrorCode:o.api_error_code,matsUiVisible:o.ui_visible,matsSilentCode:o.silent_code,matsSilentBiSubCode:o.silent_bi_sub_code,matsSilentMessage:o.silent_message,matsSilentStatus:o.silent_status,matsHttpStatus:o.http_status,matsHttpEventCount:o.http_event_count},this.correlationId),o):null},e.prototype.validateNativeResponse=function(t){if(t.hasOwnProperty("access_token")&&t.hasOwnProperty("id_token")&&t.hasOwnProperty("client_info")&&t.hasOwnProperty("account")&&t.hasOwnProperty("scope")&&t.hasOwnProperty("expires_in"))return t;throw Eo.createUnexpectedError("Response missing expected properties.")},e.prototype.getMATSFromResponse=function(t){if(t.properties.MATS)try{return JSON.parse(t.properties.MATS)}catch{this.logger.error("NativeInteractionClient - Error parsing MATS telemetry, returning null instead")}return null},e.prototype.isResponseFromCache=function(t){return typeof t.is_cached>"u"?(this.logger.verbose("NativeInteractionClient - MATS telemetry does not contain field indicating if response was served from cache. Returning false."),!1):!!t.is_cached},e.prototype.initializeNativeRequest=function(t){return D(this,void 0,void 0,function(){var o,i,n,s,a,u,h,p,f,b,C=this;return F(this,function(S){switch(S.label){case 0:return this.logger.trace("NativeInteractionClient - initializeNativeRequest called"),o=t.authority||this.config.auth.authority,t.account?[4,this.validateRequestAuthority(o,t.account)]:[3,2];case 1:S.sent(),S.label=2;case 2:return i=new Se(o),i.validateAsUri(),n=t.scopes,s=sy(t,["scopes"]),a=new It(n||[]),a.appendScopes(Yi),u=function(){switch(C.apiId){case ct.ssoSilent:case ct.acquireTokenSilent_silentFlow:return C.logger.trace("initializeNativeRequest: silent request sets prompt to none"),or.NONE}if(!t.prompt){C.logger.trace("initializeNativeRequest: prompt was not provided");return}switch(t.prompt){case or.NONE:case or.CONSENT:case or.LOGIN:return C.logger.trace("initializeNativeRequest: prompt is compatible with native flow"),t.prompt;default:throw C.logger.trace("initializeNativeRequest: prompt = "+t.prompt+" is not compatible with native flow"),z.createNativePromptParameterNotSupportedError()}},h=ae(ae({},s),{accountId:this.accountId,clientId:this.config.auth.clientId,authority:i.urlString,scope:a.printScopes(),redirectUri:this.getRedirectUri(t.redirectUri),prompt:u(),correlationId:this.correlationId,tokenType:t.authenticationScheme,windowTitleSubstring:document.title,extraParameters:ae(ae(ae({},t.extraQueryParameters),t.tokenQueryParameters),{telemetry:xl.MATS_TELEMETRY}),extendedExpiryToken:!1}),t.authenticationScheme!==Be.POP?[3,4]:(p={resourceRequestUri:t.resourceRequestUri,resourceRequestMethod:t.resourceRequestMethod,shrClaims:t.shrClaims,shrNonce:t.shrNonce},f=new ai(this.browserCrypto),[4,f.generateCnf(p)]);case 3:b=S.sent(),h.reqCnf=b.reqCnfString,h.keyId=b.kid,S.label=4;case 4:return[2,h]}})})},e}(Of);l();c();d();var ci=function(){function r(e,t,o,i){this.logger=e,this.handshakeTimeoutMs=t,this.extensionId=i,this.resolvers=new Map,this.handshakeResolvers=new Map,this.responseId=0,this.messageChannel=new MessageChannel,this.windowListener=this.onWindowMessage.bind(this),this.performanceClient=o,this.handshakeEvent=o.startMeasurement($.NativeMessageHandlerHandshake)}return r.prototype.sendMessage=function(e){return D(this,void 0,void 0,function(){var t,o=this;return F(this,function(i){return this.logger.trace("NativeMessageHandler - sendMessage called."),t={channel:xl.CHANNEL_ID,extensionId:this.extensionId,responseId:this.responseId++,body:e},this.logger.trace("NativeMessageHandler - Sending request to browser extension"),this.logger.tracePii("NativeMessageHandler - Sending request to browser extension: "+JSON.stringify(t)),this.messageChannel.port1.postMessage(t),[2,new Promise(function(n,s){o.resolvers.set(t.responseId,{resolve:n,reject:s})})]})})},r.createProvider=function(e,t,o){return D(this,void 0,void 0,function(){var i,n;return F(this,function(s){switch(s.label){case 0:e.trace("NativeMessageHandler - createProvider called."),s.label=1;case 1:return s.trys.push([1,3,,5]),i=new r(e,t,o,xl.PREFERRED_EXTENSION_ID),[4,i.sendHandshakeRequest()];case 2:return s.sent(),[2,i];case 3:return s.sent(),n=new r(e,t,o),[4,n.sendHandshakeRequest()];case 4:return s.sent(),[2,n];case 5:return[2]}})})},r.prototype.sendHandshakeRequest=function(){return D(this,void 0,void 0,function(){var e,t=this;return F(this,function(o){return this.logger.trace("NativeMessageHandler - sendHandshakeRequest called."),window.addEventListener("message",this.windowListener,!1),e={channel:xl.CHANNEL_ID,extensionId:this.extensionId,responseId:this.responseId++,body:{method:Zi.HandshakeRequest}},this.handshakeEvent.addStaticFields({extensionId:this.extensionId,extensionHandshakeTimeoutMs:this.handshakeTimeoutMs}),this.messageChannel.port1.onmessage=function(i){t.onChannelMessage(i)},window.postMessage(e,window.origin,[this.messageChannel.port2]),[2,new Promise(function(i,n){t.handshakeResolvers.set(e.responseId,{resolve:i,reject:n}),t.timeoutId=window.setTimeout(function(){window.removeEventListener("message",t.windowListener,!1),t.messageChannel.port1.close(),t.messageChannel.port2.close(),t.handshakeEvent.endMeasurement({extensionHandshakeTimedOut:!0,success:!1}),n(z.createNativeHandshakeTimeoutError()),t.handshakeResolvers.delete(e.responseId)},t.handshakeTimeoutMs)})]})})},r.prototype.onWindowMessage=function(e){if(this.logger.trace("NativeMessageHandler - onWindowMessage called"),e.source===window){var t=e.data;if(!(!t.channel||t.channel!==xl.CHANNEL_ID)&&!(t.extensionId&&t.extensionId!==this.extensionId)&&t.body.method===Zi.HandshakeRequest){this.logger.verbose(t.extensionId?"Extension with id: "+t.extensionId+" not installed":"No extension installed"),clearTimeout(this.timeoutId),this.messageChannel.port1.close(),this.messageChannel.port2.close(),window.removeEventListener("message",this.windowListener,!1);var o=this.handshakeResolvers.get(t.responseId);o&&(this.handshakeEvent.endMeasurement({success:!1,extensionInstalled:!1}),o.reject(z.createNativeExtensionNotInstalledError()))}}},r.prototype.onChannelMessage=function(e){this.logger.trace("NativeMessageHandler - onChannelMessage called.");var t=e.data,o=this.resolvers.get(t.responseId),i=this.handshakeResolvers.get(t.responseId);try{var n=t.body.method;if(n===Zi.Response){if(!o)return;var s=t.body.response;if(this.logger.trace("NativeMessageHandler - Received response from browser extension"),this.logger.tracePii("NativeMessageHandler - Received response from browser extension: "+JSON.stringify(s)),s.status!=="Success")o.reject(Eo.createError(s.code,s.description,s.ext));else if(s.result)s.result.code&&s.result.description?o.reject(Eo.createError(s.result.code,s.result.description,s.result.ext)):o.resolve(s.result);else throw ee.createUnexpectedError("Event does not contain result.");this.resolvers.delete(t.responseId)}else if(n===Zi.HandshakeResponse){if(!i)return;clearTimeout(this.timeoutId),window.removeEventListener("message",this.windowListener,!1),this.extensionId=t.extensionId,this.extensionVersion=t.body.version,this.logger.verbose("NativeMessageHandler - Received HandshakeResponse from extension: "+this.extensionId),this.handshakeEvent.endMeasurement({extensionInstalled:!0,success:!0}),i.resolve(),this.handshakeResolvers.delete(t.responseId)}}catch(a){this.logger.error("Error parsing response from WAM Extension"),this.logger.errorPii("Error parsing response from WAM Extension: "+a.toString()),this.logger.errorPii("Unable to parse "+e),o?o.reject(a):i&&i.reject(a)}},r.prototype.getExtensionId=function(){return this.extensionId},r.prototype.getExtensionVersion=function(){return this.extensionVersion},r.isNativeAvailable=function(e,t,o,i){if(t.trace("isNativeAvailable called"),!e.system.allowNativeBroker)return t.trace("isNativeAvailable: allowNativeBroker is not enabled, returning false"),!1;if(!o)return t.trace("isNativeAvailable: WAM extension provider is not initialized, returning false"),!1;if(i)switch(i){case Be.BEARER:case Be.POP:return t.trace("isNativeAvailable: authenticationScheme is supported, returning true"),!0;default:return t.trace("isNativeAvailable: authenticationScheme is not supported, returning false"),!1}return!0},r}();var _y=function(r){mt(e,r);function e(t,o,i,n,s,a,u,h,p,f){var b=r.call(this,t,o,i,n,s,a,u,p,f)||this;return b.nativeStorage=h,b}return e.prototype.acquireToken=function(t){return D(this,void 0,void 0,function(){var o,i,n,s,a,u,h,p,f,b=this;return F(this,function(C){switch(C.label){case 0:return this.performanceClient.setPreQueueTime($.StandardInteractionClientInitializeAuthorizationRequest,t.correlationId),[4,this.initializeAuthorizationRequest(t,ne.Redirect)];case 1:o=C.sent(),this.browserStorage.updateCacheEntries(o.state,o.nonce,o.authority,o.loginHint||_.EMPTY_STRING,o.account||null),i=this.initializeServerTelemetryManager(ct.acquireTokenRedirect),n=function(S){S.persisted&&(b.logger.verbose("Page was restored from back/forward cache. Clearing temporary cache."),b.browserStorage.cleanRequestByState(o.state),b.eventHandler.emitEvent(he.RESTORE_FROM_BFCACHE,ne.Redirect))},C.label=2;case 2:return C.trys.push([2,7,,8]),this.performanceClient.setPreQueueTime($.StandardInteractionClientInitializeAuthorizationCodeRequest,t.correlationId),[4,this.initializeAuthorizationCodeRequest(o)];case 3:return s=C.sent(),this.performanceClient.setPreQueueTime($.StandardInteractionClientCreateAuthCodeClient,t.correlationId),[4,this.createAuthCodeClient(i,o.authority,o.azureCloudOptions)];case 4:return a=C.sent(),this.logger.verbose("Auth code client created"),u=new Mf(a,this.browserStorage,s,this.logger,this.browserCrypto,this.performanceClient),[4,a.getAuthCodeUrl(ae(ae({},o),{nativeBroker:ci.isNativeAvailable(this.config,this.logger,this.nativeMessageHandler,t.authenticationScheme)}))];case 5:return h=C.sent(),p=this.getRedirectStartPage(t.redirectStartPage),this.logger.verbosePii("Redirect start page: "+p),window.addEventListener("pageshow",n),[4,u.initiateAuthRequest(h,{navigationClient:this.navigationClient,redirectTimeout:this.config.system.redirectNavigationTimeout,redirectStartPage:p,onRedirectNavigate:t.onRedirectNavigate})];case 6:return[2,C.sent()];case 7:throw f=C.sent(),f instanceof ee&&f.setCorrelationId(this.correlationId),window.removeEventListener("pageshow",n),i.cacheFailedRequest(f),this.browserStorage.cleanRequestByState(o.state),f;case 8:return[2]}})})},e.prototype.handleRedirectPromise=function(t){return D(this,void 0,void 0,function(){var o,i,n,s,a,u,h,p,f,b,C,S;return F(this,function(R){switch(R.label){case 0:o=this.initializeServerTelemetryManager(ct.handleRedirectPromise),R.label=1;case 1:if(R.trys.push([1,10,,11]),!this.browserStorage.isInteractionInProgress(!0))return this.logger.info("handleRedirectPromise called but there is no interaction in progress, returning null."),[2,null];if(i=this.getRedirectResponseHash(t||window.location.hash),!i)return this.logger.info("handleRedirectPromise did not detect a response hash as a result of a redirect. Cleaning temporary cache."),this.browserStorage.cleanRequestByInteractionType(ne.Redirect),[2,null];n=void 0;try{s=Se.getDeserializedHash(i),n=this.validateAndExtractStateFromHash(s,ne.Redirect),this.logger.verbose("State extracted from hash")}catch(H){return this.logger.info("handleRedirectPromise was unable to extract state due to: "+H),this.browserStorage.cleanRequestByInteractionType(ne.Redirect),[2,null]}return a=this.browserStorage.getTemporaryCache(Ye.ORIGIN_URI,!0)||_.EMPTY_STRING,u=Se.removeHashFromUrl(a),h=Se.removeHashFromUrl(window.location.href),u===h&&this.config.auth.navigateToLoginRequestUrl?(this.logger.verbose("Current page is loginRequestUrl, handling hash"),[4,this.handleHash(i,n,o)]):[3,3];case 2:return p=R.sent(),a.indexOf("#")>-1&&St.replaceHash(a),[2,p];case 3:return this.config.auth.navigateToLoginRequestUrl?[3,4]:(this.logger.verbose("NavigateToLoginRequestUrl set to false, handling hash"),[2,this.handleHash(i,n,o)]);case 4:return!St.isInIframe()||this.config.system.allowRedirectInIframe?(this.browserStorage.setTemporaryCache(Ye.URL_HASH,i,!0),f={apiId:ct.handleRedirectPromise,timeout:this.config.system.redirectNavigationTimeout,noHistory:!0},b=!0,!a||a==="null"?(C=St.getHomepage(),this.browserStorage.setTemporaryCache(Ye.ORIGIN_URI,C,!0),this.logger.warning("Unable to get valid login request url from cache, redirecting to home page"),[4,this.navigationClient.navigateInternal(C,f)]):[3,6]):[3,9];case 5:return b=R.sent(),[3,8];case 6:return this.logger.verbose("Navigating to loginRequestUrl: "+a),[4,this.navigationClient.navigateInternal(a,f)];case 7:b=R.sent(),R.label=8;case 8:if(!b)return[2,this.handleHash(i,n,o)];R.label=9;case 9:return[2,null];case 10:throw S=R.sent(),S instanceof ee&&S.setCorrelationId(this.correlationId),o.cacheFailedRequest(S),this.browserStorage.cleanRequestByInteractionType(ne.Redirect),S;case 11:return[2]}})})},e.prototype.getRedirectResponseHash=function(t){this.logger.verbose("getRedirectResponseHash called");var o=Se.hashContainsKnownProperties(t);if(o)return St.clearHash(window),this.logger.verbose("Hash contains known properties, returning response hash"),t;var i=this.browserStorage.getTemporaryCache(Ye.URL_HASH,!0);return this.browserStorage.removeItem(this.browserStorage.generateCacheKey(Ye.URL_HASH)),this.logger.verbose("Hash does not contain known properties, returning cached hash"),i},e.prototype.handleHash=function(t,o,i){return D(this,void 0,void 0,function(){var n,s,a,u,h,p,f,b=this;return F(this,function(C){switch(C.label){case 0:if(n=this.browserStorage.getCachedRequest(o,this.browserCrypto),this.logger.verbose("handleHash called, retrieved cached request"),s=Se.getDeserializedHash(t),s.accountId){if(this.logger.verbose("Account id found in hash, calling WAM for token"),!this.nativeMessageHandler)throw z.createNativeConnectionNotEstablishedError();return a=new en(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,ct.acquireTokenPopup,this.performanceClient,this.nativeMessageHandler,s.accountId,this.nativeStorage,n.correlationId),u=to.parseRequestState(this.browserCrypto,o).userRequestState,[2,a.acquireToken(ae(ae({},n),{state:u,prompt:void 0})).finally(function(){b.browserStorage.cleanRequestByState(o)})]}if(h=this.browserStorage.getCachedAuthority(o),!h)throw z.createNoCachedAuthorityError();return this.performanceClient.setPreQueueTime($.StandardInteractionClientCreateAuthCodeClient,n.correlationId),[4,this.createAuthCodeClient(i,h)];case 1:return p=C.sent(),this.logger.verbose("Auth code client created"),oa.removeThrottle(this.browserStorage,this.config.auth.clientId,n),f=new Mf(p,this.browserStorage,n,this.logger,this.browserCrypto,this.performanceClient),[4,f.handleCodeResponseFromHash(t,o,p.authority,this.networkClient)];case 2:return[2,C.sent()]}})})},e.prototype.logout=function(t){return D(this,void 0,void 0,function(){var o,i,n,s,a,u,h;return F(this,function(p){switch(p.label){case 0:this.logger.verbose("logoutRedirect called"),o=this.initializeLogoutRequest(t),i=this.initializeServerTelemetryManager(ct.logout),p.label=1;case 1:return p.trys.push([1,10,,11]),this.eventHandler.emitEvent(he.LOGOUT_START,ne.Redirect,t),[4,this.clearCacheOnLogout(o.account)];case 2:return p.sent(),n={apiId:ct.logout,timeout:this.config.system.redirectNavigationTimeout,noHistory:!1},this.performanceClient.setPreQueueTime($.StandardInteractionClientCreateAuthCodeClient,o.correlationId),[4,this.createAuthCodeClient(i,t&&t.authority)];case 3:return s=p.sent(),this.logger.verbose("Auth code client created"),a=s.getLogoutUri(o),this.eventHandler.emitEvent(he.LOGOUT_SUCCESS,ne.Redirect,o),t&&typeof t.onRedirectNavigate=="function"?(u=t.onRedirectNavigate(a),u===!1?[3,5]:(this.logger.verbose("Logout onRedirectNavigate did not return false, navigating"),this.browserStorage.getInteractionInProgress()||this.browserStorage.setInteractionInProgress(!0),[4,this.navigationClient.navigateExternal(a,n)])):[3,7];case 4:return p.sent(),[2];case 5:this.browserStorage.setInteractionInProgress(!1),this.logger.verbose("Logout onRedirectNavigate returned false, stopping navigation"),p.label=6;case 6:return[3,9];case 7:return this.browserStorage.getInteractionInProgress()||this.browserStorage.setInteractionInProgress(!0),[4,this.navigationClient.navigateExternal(a,n)];case 8:return p.sent(),[2];case 9:return[3,11];case 10:throw h=p.sent(),h instanceof ee&&h.setCorrelationId(this.correlationId),i.cacheFailedRequest(h),this.eventHandler.emitEvent(he.LOGOUT_FAILURE,ne.Redirect,null,h),this.eventHandler.emitEvent(he.LOGOUT_END,ne.Redirect),h;case 11:return this.eventHandler.emitEvent(he.LOGOUT_END,ne.Redirect),[2]}})})},e.prototype.getRedirectStartPage=function(t){var o=t||window.location.href;return Se.getAbsoluteUrl(o,St.getCurrentUri())},e}(li);l();c();d();var Ty=function(r){mt(e,r);function e(t,o,i,n,s,a,u,h,p,f){var b=r.call(this,t,o,i,n,s,a,u,p,f)||this;return b.unloadWindow=b.unloadWindow.bind(b),b.nativeStorage=h,b}return e.prototype.acquireToken=function(t){try{var o=this.generatePopupName(t.scopes||Yi,t.authority||this.config.auth.authority),i=t.popupWindowAttributes||{};if(this.config.system.asyncPopups)return this.logger.verbose("asyncPopups set to true, acquiring token"),this.acquireTokenPopupAsync(t,o,i);this.logger.verbose("asyncPopup set to false, opening popup before acquiring token");var n=this.openSizedPopup("about:blank",o,i);return this.acquireTokenPopupAsync(t,o,i,n)}catch(s){return Promise.reject(s)}},e.prototype.logout=function(t){try{this.logger.verbose("logoutPopup called");var o=this.initializeLogoutRequest(t),i=this.generateLogoutPopupName(o),n=t&&t.authority,s=t&&t.mainWindowRedirectUri,a=t?.popupWindowAttributes||{};if(this.config.system.asyncPopups)return this.logger.verbose("asyncPopups set to true"),this.logoutPopupAsync(o,i,a,n,void 0,s);this.logger.verbose("asyncPopup set to false, opening popup");var u=this.openSizedPopup("about:blank",i,a);return this.logoutPopupAsync(o,i,a,n,u,s)}catch(h){return Promise.reject(h)}},e.prototype.acquireTokenPopupAsync=function(t,o,i,n){return D(this,void 0,void 0,function(){var s,a,u,h,p,f,b,C,S,R,H,ye,oe,me,yt,Ge,tt,_o=this;return F(this,function(_r){switch(_r.label){case 0:return this.logger.verbose("acquireTokenPopupAsync called"),s=this.initializeServerTelemetryManager(ct.acquireTokenPopup),this.performanceClient.setPreQueueTime($.StandardInteractionClientInitializeAuthorizationRequest,t.correlationId),[4,this.initializeAuthorizationRequest(t,ne.Popup)];case 1:a=_r.sent(),this.browserStorage.updateCacheEntries(a.state,a.nonce,a.authority,a.loginHint||_.EMPTY_STRING,a.account||null),_r.label=2;case 2:return _r.trys.push([2,8,,9]),this.performanceClient.setPreQueueTime($.StandardInteractionClientInitializeAuthorizationCodeRequest,t.correlationId),[4,this.initializeAuthorizationCodeRequest(a)];case 3:return u=_r.sent(),this.performanceClient.setPreQueueTime($.StandardInteractionClientCreateAuthCodeClient,t.correlationId),[4,this.createAuthCodeClient(s,a.authority,a.azureCloudOptions)];case 4:return h=_r.sent(),this.logger.verbose("Auth code client created"),p=ci.isNativeAvailable(this.config,this.logger,this.nativeMessageHandler,t.authenticationScheme),f=void 0,p&&(f=this.performanceClient.startMeasurement($.FetchAccountIdWithNativeBroker,t.correlationId)),[4,h.getAuthCodeUrl(ae(ae({},a),{nativeBroker:p}))];case 5:return b=_r.sent(),C=new Mc(h,this.browserStorage,u,this.logger,this.performanceClient),S={popup:n,popupName:o,popupWindowAttributes:i},R=this.initiateAuthRequest(b,S),this.eventHandler.emitEvent(he.POPUP_OPENED,ne.Popup,{popupWindow:R},null),[4,this.monitorPopupForHash(R)];case 6:if(H=_r.sent(),ye=Se.getDeserializedHash(H),oe=this.validateAndExtractStateFromHash(ye,ne.Popup,a.correlationId),oa.removeThrottle(this.browserStorage,this.config.auth.clientId,u),ye.accountId){if(this.logger.verbose("Account id found in hash, calling WAM for token"),f&&f.endMeasurement({success:!0,isNativeBroker:!0}),!this.nativeMessageHandler)throw z.createNativeConnectionNotEstablishedError();return me=new en(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,ct.acquireTokenPopup,this.performanceClient,this.nativeMessageHandler,ye.accountId,this.nativeStorage,a.correlationId),yt=to.parseRequestState(this.browserCrypto,oe).userRequestState,[2,me.acquireToken(ae(ae({},a),{state:yt,prompt:void 0})).finally(function(){_o.browserStorage.cleanRequestByState(oe)})]}return[4,C.handleCodeResponseFromHash(H,oe,h.authority,this.networkClient)];case 7:return Ge=_r.sent(),[2,Ge];case 8:throw tt=_r.sent(),n&&n.close(),tt instanceof ee&&tt.setCorrelationId(this.correlationId),s.cacheFailedRequest(tt),this.browserStorage.cleanRequestByState(a.state),tt;case 9:return[2]}})})},e.prototype.logoutPopupAsync=function(t,o,i,n,s,a){return D(this,void 0,void 0,function(){var u,h,p,f,b,C,S;return F(this,function(R){switch(R.label){case 0:this.logger.verbose("logoutPopupAsync called"),this.eventHandler.emitEvent(he.LOGOUT_START,ne.Popup,t),u=this.initializeServerTelemetryManager(ct.logoutPopup),R.label=1;case 1:return R.trys.push([1,5,,6]),[4,this.clearCacheOnLogout(t.account)];case 2:return R.sent(),this.performanceClient.setPreQueueTime($.StandardInteractionClientCreateAuthCodeClient,t.correlationId),[4,this.createAuthCodeClient(u,n)];case 3:return h=R.sent(),this.logger.verbose("Auth code client created"),p=h.getLogoutUri(t),this.eventHandler.emitEvent(he.LOGOUT_SUCCESS,ne.Popup,t),f=this.openPopup(p,{popupName:o,popupWindowAttributes:i,popup:s}),this.eventHandler.emitEvent(he.POPUP_OPENED,ne.Popup,{popupWindow:f},null),[4,this.waitForLogoutPopup(f)];case 4:return R.sent(),a?(b={apiId:ct.logoutPopup,timeout:this.config.system.redirectNavigationTimeout,noHistory:!1},C=Se.getAbsoluteUrl(a,St.getCurrentUri()),this.logger.verbose("Redirecting main window to url specified in the request"),this.logger.verbosePii("Redirecting main window to: "+C),this.navigationClient.navigateInternal(C,b)):this.logger.verbose("No main window navigation requested"),[3,6];case 5:throw S=R.sent(),s&&s.close(),S instanceof ee&&S.setCorrelationId(this.correlationId),this.browserStorage.setInteractionInProgress(!1),this.eventHandler.emitEvent(he.LOGOUT_FAILURE,ne.Popup,null,S),this.eventHandler.emitEvent(he.LOGOUT_END,ne.Popup),u.cacheFailedRequest(S),S;case 6:return this.eventHandler.emitEvent(he.LOGOUT_END,ne.Popup),[2]}})})},e.prototype.initiateAuthRequest=function(t,o){if(B.isEmpty(t))throw this.logger.error("Navigate url is empty"),z.createEmptyNavigationUriError();return this.logger.infoPii("Navigate to: "+t),this.openPopup(t,o)},e.prototype.monitorPopupForHash=function(t){var o=this;return new Promise(function(i,n){var s=o.config.system.windowHashTimeout/o.config.system.pollIntervalMilliseconds,a=0;o.logger.verbose("PopupHandler.monitorPopupForHash - polling started");var u=setInterval(function(){if(t.closed){o.logger.error("PopupHandler.monitorPopupForHash - window closed"),o.cleanPopup(),clearInterval(u),n(z.createUserCancelledError());return}var h=_.EMPTY_STRING,p=_.EMPTY_STRING;try{h=t.location.href,p=t.location.hash}catch{}B.isEmpty(h)||h==="about:blank"||(o.logger.verbose("PopupHandler.monitorPopupForHash - popup window is on same origin as caller"),a++,p?(o.logger.verbose("PopupHandler.monitorPopupForHash - found hash in url"),clearInterval(u),o.cleanPopup(t),Se.hashContainsKnownProperties(p)?(o.logger.verbose("PopupHandler.monitorPopupForHash - hash contains known properties, returning."),i(p)):(o.logger.error("PopupHandler.monitorPopupForHash - found hash in url but it does not contain known properties. Check that your router is not changing the hash prematurely."),o.logger.errorPii("PopupHandler.monitorPopupForHash - hash found: "+p),n(z.createHashDoesNotContainKnownPropertiesError()))):a>s&&(o.logger.error("PopupHandler.monitorPopupForHash - unable to find hash in url, timing out"),clearInterval(u),n(z.createMonitorPopupTimeoutError())))},o.config.system.pollIntervalMilliseconds)})},e.prototype.waitForLogoutPopup=function(t){var o=this;return new Promise(function(i){o.logger.verbose("PopupHandler.waitForLogoutPopup - polling started");var n=setInterval(function(){t.closed&&(o.logger.error("PopupHandler.waitForLogoutPopup - window closed"),o.cleanPopup(),clearInterval(n),i());var s=_.EMPTY_STRING;try{s=t.location.href}catch{}B.isEmpty(s)||s==="about:blank"||(o.logger.verbose("PopupHandler.waitForLogoutPopup - popup window is on same origin as caller, closing."),clearInterval(n),o.cleanPopup(t),i())},o.config.system.pollIntervalMilliseconds)})},e.prototype.openPopup=function(t,o){try{var i=void 0;if(o.popup?(i=o.popup,this.logger.verbosePii("Navigating popup window to: "+t),i.location.assign(t)):typeof o.popup>"u"&&(this.logger.verbosePii("Opening popup window to: "+t),i=this.openSizedPopup(t,o.popupName,o.popupWindowAttributes)),!i)throw z.createEmptyWindowCreatedError();return i.focus&&i.focus(),this.currentWindow=i,window.addEventListener("beforeunload",this.unloadWindow),i}catch(n){throw this.logger.error("error opening popup "+n.message),this.browserStorage.setInteractionInProgress(!1),z.createPopupWindowError(n.toString())}},e.prototype.openSizedPopup=function(t,o,i){var n,s,a,u,h=window.screenLeft?window.screenLeft:window.screenX,p=window.screenTop?window.screenTop:window.screenY,f=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,b=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight,C=(n=i.popupSize)===null||n===void 0?void 0:n.width,S=(s=i.popupSize)===null||s===void 0?void 0:s.height,R=(a=i.popupPosition)===null||a===void 0?void 0:a.top,H=(u=i.popupPosition)===null||u===void 0?void 0:u.left;return(!C||C<0||C>f)&&(this.logger.verbose("Default popup window width used. Window width not configured or invalid."),C=Hr.POPUP_WIDTH),(!S||S<0||S>b)&&(this.logger.verbose("Default popup window height used. Window height not configured or invalid."),S=Hr.POPUP_HEIGHT),(!R||R<0||R>b)&&(this.logger.verbose("Default popup window top position used. Window top not configured or invalid."),R=Math.max(0,b/2-Hr.POPUP_HEIGHT/2+p)),(!H||H<0||H>f)&&(this.logger.verbose("Default popup window left position used. Window left not configured or invalid."),H=Math.max(0,f/2-Hr.POPUP_WIDTH/2+h)),window.open(t,o,"width="+C+", height="+S+", top="+R+", left="+H+", scrollbars=yes")},e.prototype.unloadWindow=function(t){this.browserStorage.cleanRequestByInteractionType(ne.Popup),this.currentWindow&&this.currentWindow.close(),t.preventDefault()},e.prototype.cleanPopup=function(t){t&&t.close(),window.removeEventListener("beforeunload",this.unloadWindow),this.browserStorage.setInteractionInProgress(!1)},e.prototype.generatePopupName=function(t,o){return Hr.POPUP_NAME_PREFIX+"."+this.config.auth.clientId+"."+t.join("-")+"."+o+"."+this.correlationId},e.prototype.generateLogoutPopupName=function(t){var o=t.account&&t.account.homeAccountId;return Hr.POPUP_NAME_PREFIX+"."+this.config.auth.clientId+"."+o+"."+this.correlationId},e}(li);l();c();d();l();c();d();l();c();d();l();c();d();var Ey=function(){function r(){}return r.prototype.navigateInternal=function(e,t){return r.defaultNavigateWindow(e,t)},r.prototype.navigateExternal=function(e,t){return r.defaultNavigateWindow(e,t)},r.defaultNavigateWindow=function(e,t){return t.noHistory?window.location.replace(e):window.location.assign(e),new Promise(function(o){setTimeout(function(){o(!0)},t.timeout)})},r}();var x9=6e4,Ou=6e3,k9=3e4,S9=2e3;function M_(r,e){var t=r.auth,o=r.cache,i=r.system,n=r.telemetry,s={clientId:_.EMPTY_STRING,authority:""+_.DEFAULT_AUTHORITY,knownAuthorities:[],cloudDiscoveryMetadata:_.EMPTY_STRING,authorityMetadata:_.EMPTY_STRING,redirectUri:_.EMPTY_STRING,postLogoutRedirectUri:_.EMPTY_STRING,navigateToLoginRequestUrl:!0,clientCapabilities:[],protocolMode:ps.AAD,azureCloudOptions:{azureCloudInstance:Tn.None,tenant:_.EMPTY_STRING},skipAuthorityMetadataCache:!1},a={cacheLocation:zt.SessionStorage,temporaryCacheLocation:zt.SessionStorage,storeAuthStateInCookie:!1,secureCookies:!1,cacheMigrationEnabled:!!(o&&o.cacheLocation===zt.LocalStorage),claimsBasedCachingEnabled:!0},u={loggerCallback:function(){},logLevel:ir.Info,piiLoggingEnabled:!1},h=ae(ae({},If),{loggerOptions:u,networkClient:e?St.getBrowserNetworkClient():vy,navigationClient:new Ey,loadFrameTimeout:0,windowHashTimeout:i?.loadFrameTimeout||x9,iframeHashTimeout:i?.loadFrameTimeout||Ou,navigateFrameWait:e&&St.detectIEOrEdge()?500:0,redirectNavigationTimeout:k9,asyncPopups:!1,allowRedirectInIframe:!1,allowNativeBroker:!1,nativeBrokerHandshakeTimeout:i?.nativeBrokerHandshakeTimeout||S9,pollIntervalMilliseconds:Hr.DEFAULT_POLL_INTERVAL_MS,cryptoOptions:{useMsrCrypto:!1,entropy:void 0}}),p=ae(ae({},i),{loggerOptions:i?.loggerOptions||u}),f={application:{appName:_.EMPTY_STRING,appVersion:_.EMPTY_STRING}},b={auth:ae(ae({},s),t),cache:ae(ae({},a),o),system:ae(ae({},h),p),telemetry:ae(ae({},f),n)};return b}var Df=function(r){mt(e,r);function e(t,o,i,n,s,a){var u=r.call(this,t,o,i,n,a)||this;return u.navigateFrameWait=s.navigateFrameWait,u.pollIntervalMilliseconds=s.pollIntervalMilliseconds,u}return e.prototype.initiateAuthRequest=function(t){return D(this,void 0,void 0,function(){return F(this,function(o){switch(o.label){case 0:if(this.performanceClient.addQueueMeasurement($.SilentHandlerInitiateAuthRequest,this.authCodeRequest.correlationId),B.isEmpty(t))throw this.logger.info("Navigate url is empty"),z.createEmptyNavigationUriError();return this.navigateFrameWait?(this.performanceClient.setPreQueueTime($.SilentHandlerLoadFrame,this.authCodeRequest.correlationId),[4,this.loadFrame(t)]):[3,2];case 1:return[2,o.sent()];case 2:return[2,this.loadFrameSync(t)]}})})},e.prototype.monitorIframeForHash=function(t,o){var i=this;return this.performanceClient.addQueueMeasurement($.SilentHandlerMonitorIframeForHash,this.authCodeRequest.correlationId),new Promise(function(n,s){ou){i.removeHiddenIframe(t),clearInterval(h),s(z.createMonitorIframeTimeoutError());return}var p=_.EMPTY_STRING,f=t.contentWindow;try{p=f?f.location.href:_.EMPTY_STRING}catch{}if(!B.isEmpty(p)){var b=f?f.location.hash:_.EMPTY_STRING;if(Se.hashContainsKnownProperties(b)){i.removeHiddenIframe(t),clearInterval(h),n(b);return}}},i.pollIntervalMilliseconds)})},e.prototype.loadFrame=function(t){var o=this;return this.performanceClient.addQueueMeasurement($.SilentHandlerLoadFrame,this.authCodeRequest.correlationId),new Promise(function(i,n){var s=o.createHiddenIframe();setTimeout(function(){if(!s){n("Unable to load iframe");return}s.src=t,i(s)},o.navigateFrameWait)})},e.prototype.loadFrameSync=function(t){var o=this.createHiddenIframe();return o.src=t,o},e.prototype.createHiddenIframe=function(){var t=document.createElement("iframe");return t.style.visibility="hidden",t.style.position="absolute",t.style.width=t.style.height="0",t.style.border="0",t.setAttribute("sandbox","allow-scripts allow-same-origin allow-forms"),document.getElementsByTagName("body")[0].appendChild(t),t},e.prototype.removeHiddenIframe=function(t){document.body===t.parentNode&&document.body.removeChild(t)},e}(Mc);var Iy=function(r){mt(e,r);function e(t,o,i,n,s,a,u,h,p,f,b){var C=r.call(this,t,o,i,n,s,a,h,f,b)||this;return C.apiId=u,C.nativeStorage=p,C}return e.prototype.acquireToken=function(t){return D(this,void 0,void 0,function(){var o,i,n,s,a;return F(this,function(u){switch(u.label){case 0:if(this.performanceClient.addQueueMeasurement($.SilentIframeClientAcquireToken,t.correlationId),this.logger.verbose("acquireTokenByIframe called"),o=this.performanceClient.startMeasurement($.SilentIframeClientAcquireToken,t.correlationId),B.isEmpty(t.loginHint)&&B.isEmpty(t.sid)&&(!t.account||B.isEmpty(t.account.username))&&this.logger.warning("No user hint provided. The authorization server may need more information to complete this request."),t.prompt&&t.prompt!==or.NONE&&t.prompt!==or.NO_SESSION)throw o.endMeasurement({success:!1}),z.createSilentPromptValueError(t.prompt);return this.performanceClient.setPreQueueTime($.StandardInteractionClientInitializeAuthorizationRequest,t.correlationId),[4,this.initializeAuthorizationRequest(ae(ae({},t),{prompt:t.prompt||or.NONE}),ne.Silent)];case 1:i=u.sent(),this.browserStorage.updateCacheEntries(i.state,i.nonce,i.authority,i.loginHint||_.EMPTY_STRING,i.account||null),n=this.initializeServerTelemetryManager(this.apiId),u.label=2;case 2:return u.trys.push([2,5,,6]),this.performanceClient.setPreQueueTime($.StandardInteractionClientCreateAuthCodeClient,t.correlationId),[4,this.createAuthCodeClient(n,i.authority,i.azureCloudOptions)];case 3:return s=u.sent(),this.logger.verbose("Auth code client created"),this.performanceClient.setPreQueueTime($.SilentIframeClientTokenHelper,t.correlationId),[4,this.silentTokenHelper(s,i).then(function(h){return o.endMeasurement({success:!0,fromCache:!1,requestId:h.requestId}),h})];case 4:return[2,u.sent()];case 5:throw a=u.sent(),a instanceof ee&&a.setCorrelationId(this.correlationId),n.cacheFailedRequest(a),this.browserStorage.cleanRequestByState(i.state),o.endMeasurement({errorCode:a instanceof ee&&a.errorCode||void 0,subErrorCode:a instanceof ee&&a.subError||void 0,success:!1}),a;case 6:return[2]}})})},e.prototype.logout=function(){return Promise.reject(z.createSilentLogoutUnsupportedError())},e.prototype.silentTokenHelper=function(t,o){return D(this,void 0,void 0,function(){var i,n,s,a,u,h,p,f,b,C=this;return F(this,function(S){switch(S.label){case 0:return this.performanceClient.addQueueMeasurement($.SilentIframeClientTokenHelper,o.correlationId),this.performanceClient.setPreQueueTime($.StandardInteractionClientInitializeAuthorizationCodeRequest,o.correlationId),[4,this.initializeAuthorizationCodeRequest(o)];case 1:return i=S.sent(),this.performanceClient.setPreQueueTime($.GetAuthCodeUrl,o.correlationId),[4,t.getAuthCodeUrl(ae(ae({},o),{nativeBroker:ci.isNativeAvailable(this.config,this.logger,this.nativeMessageHandler,o.authenticationScheme)}))];case 2:return n=S.sent(),s=new Df(t,this.browserStorage,i,this.logger,this.config.system,this.performanceClient),this.performanceClient.setPreQueueTime($.SilentHandlerInitiateAuthRequest,o.correlationId),[4,s.initiateAuthRequest(n)];case 3:return a=S.sent(),this.performanceClient.setPreQueueTime($.SilentHandlerMonitorIframeForHash,o.correlationId),[4,s.monitorIframeForHash(a,this.config.system.iframeHashTimeout)];case 4:if(u=S.sent(),h=Se.getDeserializedHash(u),p=this.validateAndExtractStateFromHash(h,ne.Silent,i.correlationId),h.accountId){if(this.logger.verbose("Account id found in hash, calling WAM for token"),!this.nativeMessageHandler)throw z.createNativeConnectionNotEstablishedError();return f=new en(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,this.apiId,this.performanceClient,this.nativeMessageHandler,h.accountId,this.browserStorage,this.correlationId),b=to.parseRequestState(this.browserCrypto,p).userRequestState,[2,f.acquireToken(ae(ae({},o),{state:b,prompt:o.prompt||or.NONE})).finally(function(){C.browserStorage.cleanRequestByState(p)})]}return this.performanceClient.setPreQueueTime($.HandleCodeResponseFromHash,o.correlationId),[2,s.handleCodeResponseFromHash(u,p,t.authority,this.networkClient)]}})})},e}(li);l();c();d();var Ay=function(r){mt(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.acquireToken=function(t){return D(this,void 0,void 0,function(){var o,i,n,s,a,u=this;return F(this,function(h){switch(h.label){case 0:return this.performanceClient.addQueueMeasurement($.SilentRefreshClientAcquireToken,t.correlationId),this.performanceClient.setPreQueueTime($.InitializeBaseRequest,t.correlationId),i=[ae({},t)],[4,this.initializeBaseRequest(t,t.account)];case 1:return o=ae.apply(void 0,i.concat([h.sent()])),n=this.performanceClient.startMeasurement($.SilentRefreshClientAcquireToken,o.correlationId),s=this.initializeServerTelemetryManager(ct.acquireTokenSilent_silentFlow),[4,this.createRefreshTokenClient(s,o.authority,o.azureCloudOptions)];case 2:return a=h.sent(),this.logger.verbose("Refresh token client created"),this.performanceClient.setPreQueueTime($.RefreshTokenClientAcquireTokenByRefreshToken,t.correlationId),[2,a.acquireTokenByRefreshToken(o).then(function(p){return n.endMeasurement({success:!0,fromCache:p.fromCache,requestId:p.requestId}),p}).catch(function(p){throw p instanceof ee&&p.setCorrelationId(u.correlationId),s.cacheFailedRequest(p),n.endMeasurement({errorCode:p.errorCode,subErrorCode:p.subError,success:!1}),p})]}})})},e.prototype.logout=function(){return Promise.reject(z.createSilentLogoutUnsupportedError())},e.prototype.createRefreshTokenClient=function(t,o,i){return D(this,void 0,void 0,function(){var n;return F(this,function(s){switch(s.label){case 0:return this.performanceClient.setPreQueueTime($.StandardInteractionClientGetClientConfiguration,this.correlationId),[4,this.getClientConfiguration(t,o,i)];case 1:return n=s.sent(),[2,new Eu(n,this.performanceClient)]}})})},e}(li);l();c();d();var Ry=function(){function r(e,t){this.eventCallbacks=new Map,this.logger=e,this.browserCrypto=t,this.listeningToStorageEvents=!1,this.handleAccountCacheChange=this.handleAccountCacheChange.bind(this)}return r.prototype.addEventCallback=function(e){if(typeof window<"u"){var t=this.browserCrypto.createNewGuid();return this.eventCallbacks.set(t,e),this.logger.verbose("Event callback registered with id: "+t),t}return null},r.prototype.removeEventCallback=function(e){this.eventCallbacks.delete(e),this.logger.verbose("Event callback "+e+" removed.")},r.prototype.enableAccountStorageEvents=function(){typeof window>"u"||(this.listeningToStorageEvents?this.logger.verbose("Account storage listener already registered."):(this.logger.verbose("Adding account storage listener."),this.listeningToStorageEvents=!0,window.addEventListener("storage",this.handleAccountCacheChange)))},r.prototype.disableAccountStorageEvents=function(){typeof window>"u"||(this.listeningToStorageEvents?(this.logger.verbose("Removing account storage listener."),window.removeEventListener("storage",this.handleAccountCacheChange),this.listeningToStorageEvents=!1):this.logger.verbose("No account storage listener registered."))},r.prototype.emitEvent=function(e,t,o,i){var n=this;if(typeof window<"u"){var s={eventType:e,interactionType:t||null,payload:o||null,error:i||null,timestamp:Date.now()};this.logger.info("Emitting event: "+e),this.eventCallbacks.forEach(function(a,u){n.logger.verbose("Emitting event to callback "+u+": "+e),a.apply(null,[s])})}},r.prototype.handleAccountCacheChange=function(e){try{var t=e.newValue||e.oldValue;if(!t)return;var o=JSON.parse(t);if(typeof o!="object"||!Nt.isAccountEntity(o))return;var i=Xr.toObject(new Nt,o),n=i.getAccountInfo();!e.oldValue&&e.newValue?(this.logger.info("Account was added to cache in a different window"),this.emitEvent(he.ACCOUNT_ADDED,void 0,n)):!e.newValue&&e.oldValue&&(this.logger.info("Account was removed from cache in a different window"),this.emitEvent(he.ACCOUNT_REMOVED,void 0,n))}catch{return}},r}();l();c();d();l();c();d();l();c();d();var io=function(){function r(){}return r.decimalToHex=function(e){for(var t=e.toString(16);t.length<2;)t="0"+t;return t},r}();var Ff=function(){function r(e){this.cryptoObj=e}return r.prototype.generateGuid=function(){try{var e=new Uint8Array(16);return this.cryptoObj.getRandomValues(e),e[6]|=64,e[6]&=79,e[8]|=128,e[8]&=191,io.decimalToHex(e[0])+io.decimalToHex(e[1])+io.decimalToHex(e[2])+io.decimalToHex(e[3])+"-"+io.decimalToHex(e[4])+io.decimalToHex(e[5])+"-"+io.decimalToHex(e[6])+io.decimalToHex(e[7])+"-"+io.decimalToHex(e[8])+io.decimalToHex(e[9])+"-"+io.decimalToHex(e[10])+io.decimalToHex(e[11])+io.decimalToHex(e[12])+io.decimalToHex(e[13])+io.decimalToHex(e[14])+io.decimalToHex(e[15])}catch{for(var t="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx",o="0123456789abcdef",i=0,n=_.EMPTY_STRING,s=0;s<36;s++)t[s]!=="-"&&t[s]!=="4"&&(i=Math.random()*16|0),t[s]==="x"?n+=o[i]:t[s]==="y"?(i&=3,i|=8,n+=o[i]):n+=t[s];return n}},r.prototype.isGuid=function(e){var t=/^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i;return t.test(e)},r}();l();c();d();l();c();d();var zo=function(){function r(){}return r.stringToUtf8Arr=function(e){for(var t,o=0,i=e.length,n=0;n>>6),s[a++]=128+(t&63)):t<65536?(s[a++]=224+(t>>>12),s[a++]=128+(t>>>6&63),s[a++]=128+(t&63)):t<2097152?(s[a++]=240+(t>>>18),s[a++]=128+(t>>>12&63),s[a++]=128+(t>>>6&63),s[a++]=128+(t&63)):t<67108864?(s[a++]=248+(t>>>24),s[a++]=128+(t>>>18&63),s[a++]=128+(t>>>12&63),s[a++]=128+(t>>>6&63),s[a++]=128+(t&63)):(s[a++]=252+(t>>>30),s[a++]=128+(t>>>24&63),s[a++]=128+(t>>>18&63),s[a++]=128+(t>>>12&63),s[a++]=128+(t>>>6&63),s[a++]=128+(t&63));return s},r.stringToArrayBuffer=function(e){for(var t=new ArrayBuffer(e.length),o=new Uint8Array(t),i=0;i251&&o<254&&n+5247&&o<252&&n+4239&&o<248&&n+3223&&o<240&&n+2191&&o<224&&n+1>>i&24),(i===2||e.length-a===1)&&(o+=String.fromCharCode(this.uint6ToB64(s>>>18&63),this.uint6ToB64(s>>>12&63),this.uint6ToB64(s>>>6&63),this.uint6ToB64(s&63)),s=0);return t===0?o:o.substring(0,o.length-t)+(t===1?"=":"==")},r.prototype.uint6ToB64=function(e){return e<26?e+65:e<52?e+71:e<62?e-4:e===62?43:e===63?47:65},r}();l();c();d();var D_=function(){function r(){}return r.prototype.decode=function(e){var t=e.replace(/-/g,"+").replace(/_/g,"/");switch(t.length%4){case 0:break;case 2:t+="==";break;case 3:t+="=";break;default:throw new Error("Invalid base64 string")}var o=this.base64DecToArr(t);return zo.utf8ArrToString(o)},r.prototype.base64DecToArr=function(e,t){for(var o=e.replace(/[^A-Za-z0-9\+\/]/g,_.EMPTY_STRING),i=o.length,n=t?Math.ceil((i*3+1>>>2)/t)*t:i*3+1>>>2,s=new Uint8Array(n),a=void 0,u=void 0,h=0,p=0,f=0;f>>(16>>>a&24)&255;h=0}return s},r.prototype.b64ToUint6=function(e){return e>64&&e<91?e-65:e>96&&e<123?e-71:e>47&&e<58?e+4:e===43?62:e===47?63:0},r}();l();c();d();var _9=32,F_=function(){function r(e){this.base64Encode=new Lf,this.cryptoObj=e}return r.prototype.generateCodes=function(){return D(this,void 0,void 0,function(){var e,t;return F(this,function(o){switch(o.label){case 0:return e=this.generateCodeVerifier(),[4,this.generateCodeChallengeFromVerifier(e)];case 1:return t=o.sent(),[2,{verifier:e,challenge:t}]}})})},r.prototype.generateCodeVerifier=function(){try{var e=new Uint8Array(_9);this.cryptoObj.getRandomValues(e);var t=this.base64Encode.urlEncodeArr(e);return t}catch(o){throw z.createPkceNotGeneratedError(o)}},r.prototype.generateCodeChallengeFromVerifier=function(e){return D(this,void 0,void 0,function(){var t,o;return F(this,function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),[4,this.cryptoObj.sha256Digest(e)];case 1:return t=i.sent(),[2,this.base64Encode.urlEncodeArr(new Uint8Array(t))];case 2:throw o=i.sent(),z.createPkceNotGeneratedError(o);case 3:return[2]}})})},r}();l();c();d();l();c();d();var L_=function(){function r(){}return r.prototype.getRandomValues=function(e){return window.crypto.getRandomValues(e)},r.prototype.generateKey=function(e,t,o){return D(this,void 0,void 0,function(){return F(this,function(i){return[2,window.crypto.subtle.generateKey(e,t,o)]})})},r.prototype.exportKey=function(e){return D(this,void 0,void 0,function(){return F(this,function(t){return[2,window.crypto.subtle.exportKey(ms,e)]})})},r.prototype.importKey=function(e,t,o,i){return D(this,void 0,void 0,function(){return F(this,function(n){return[2,window.crypto.subtle.importKey(ms,e,t,o,i)]})})},r.prototype.sign=function(e,t,o){return D(this,void 0,void 0,function(){return F(this,function(i){return[2,window.crypto.subtle.sign(e,t,o)]})})},r.prototype.digest=function(e,t){return D(this,void 0,void 0,function(){return F(this,function(o){return[2,window.crypto.subtle.digest(e,t)]})})},r}();l();c();d();var N_=function(){function r(){}return r.prototype.initPrng=function(e){return window.msrCrypto.initPrng(Tc(e))},r.prototype.getRandomValues=function(e){return window.msrCrypto.getRandomValues(e)},r.prototype.generateKey=function(e,t,o){return D(this,void 0,void 0,function(){return F(this,function(i){return[2,window.msrCrypto.subtle.generateKey(e,t,o)]})})},r.prototype.exportKey=function(e){return D(this,void 0,void 0,function(){return F(this,function(t){return[2,window.msrCrypto.subtle.exportKey(ms,e)]})})},r.prototype.importKey=function(e,t,o,i){return D(this,void 0,void 0,function(){return F(this,function(n){return[2,window.msrCrypto.subtle.importKey(ms,e,t,o,i)]})})},r.prototype.sign=function(e,t,o){return D(this,void 0,void 0,function(){return F(this,function(i){return[2,window.msrCrypto.subtle.sign(e,t,o)]})})},r.prototype.digest=function(e,t){return D(this,void 0,void 0,function(){return F(this,function(o){return[2,window.msrCrypto.subtle.digest(e,t)]})})},r}();l();c();d();var H_=function(){function r(){}return r.prototype.getRandomValues=function(e){return window.msCrypto.getRandomValues(e)},r.prototype.generateKey=function(e,t,o){return D(this,void 0,void 0,function(){return F(this,function(i){return[2,new Promise(function(n,s){var a=window.msCrypto.subtle.generateKey(e,t,o);a.addEventListener("complete",function(u){n(u.target.result)}),a.addEventListener("error",function(u){s(u)})})]})})},r.prototype.exportKey=function(e){return D(this,void 0,void 0,function(){return F(this,function(t){return[2,new Promise(function(o,i){var n=window.msCrypto.subtle.exportKey(ms,e);n.addEventListener("complete",function(s){var a=s.target.result,u=zo.utf8ArrToString(new Uint8Array(a)).replace(/\r/g,_.EMPTY_STRING).replace(/\n/g,_.EMPTY_STRING).replace(/\t/g,_.EMPTY_STRING).split(" ").join(_.EMPTY_STRING).replace("\0",_.EMPTY_STRING);try{o(JSON.parse(u))}catch(h){i(h)}}),n.addEventListener("error",function(s){i(s)})})]})})},r.prototype.importKey=function(e,t,o,i){return D(this,void 0,void 0,function(){var n,s;return F(this,function(a){return n=zo.getSortedObjectString(e),s=zo.stringToArrayBuffer(n),[2,new Promise(function(u,h){var p=window.msCrypto.subtle.importKey(ms,s,t,o,i);p.addEventListener("complete",function(f){u(f.target.result)}),p.addEventListener("error",function(f){h(f)})})]})})},r.prototype.sign=function(e,t,o){return D(this,void 0,void 0,function(){return F(this,function(i){return[2,new Promise(function(n,s){var a=window.msCrypto.subtle.sign(e,t,o);a.addEventListener("complete",function(u){n(u.target.result)}),a.addEventListener("error",function(u){s(u)})})]})})},r.prototype.digest=function(e,t){return D(this,void 0,void 0,function(){return F(this,function(o){return[2,new Promise(function(i,n){var s=window.msCrypto.subtle.digest(e,t.buffer);s.addEventListener("complete",function(a){i(a.target.result)}),s.addEventListener("error",function(a){n(a)})})]})})},r}();var T9="RSASSA-PKCS1-v1_5",U_="SHA-256",E9=2048,I9=new Uint8Array([1,0,1]),Nf=function(){function r(e,t){var o,i;if(this.logger=e,this.cryptoOptions=t,this.hasBrowserCrypto())this.logger.verbose("BrowserCrypto: modern crypto interface available"),this.subtleCrypto=new L_;else if(this.hasIECrypto())this.logger.verbose("BrowserCrypto: MS crypto interface available"),this.subtleCrypto=new H_;else if(this.hasMsrCrypto()&&(!((o=this.cryptoOptions)===null||o===void 0)&&o.useMsrCrypto))this.logger.verbose("BrowserCrypto: MSR crypto interface available"),this.subtleCrypto=new N_;else throw this.hasMsrCrypto()&&this.logger.info("BrowserCrypto: MSR Crypto interface available but system.cryptoOptions.useMsrCrypto not enabled"),this.logger.error("BrowserCrypto: No crypto interfaces available."),z.createCryptoNotAvailableError("Browser crypto, msCrypto, or msrCrypto interfaces not available.");if(this.subtleCrypto.initPrng){if(this.logger.verbose("BrowserCrypto: Interface requires entropy"),!(!((i=this.cryptoOptions)===null||i===void 0)&&i.entropy))throw this.logger.error("BrowserCrypto: Interface requires entropy but none provided."),gs.createEntropyNotProvided();this.logger.verbose("BrowserCrypto: Entropy provided"),this.subtleCrypto.initPrng(this.cryptoOptions.entropy)}this.keygenAlgorithmOptions={name:T9,hash:U_,modulusLength:E9,publicExponent:I9}}return r.prototype.hasIECrypto=function(){return"msCrypto"in window},r.prototype.hasBrowserCrypto=function(){return"crypto"in window},r.prototype.hasMsrCrypto=function(){return"msrCrypto"in window},r.prototype.sha256Digest=function(e){return D(this,void 0,void 0,function(){var t;return F(this,function(o){return t=zo.stringToUtf8Arr(e),[2,this.subtleCrypto.digest({name:U_},t)]})})},r.prototype.getRandomValues=function(e){return this.subtleCrypto.getRandomValues(e)},r.prototype.generateKeyPair=function(e,t){return D(this,void 0,void 0,function(){return F(this,function(o){return[2,this.subtleCrypto.generateKey(this.keygenAlgorithmOptions,e,t)]})})},r.prototype.exportJwk=function(e){return D(this,void 0,void 0,function(){return F(this,function(t){return[2,this.subtleCrypto.exportKey(e)]})})},r.prototype.importJwk=function(e,t,o){return D(this,void 0,void 0,function(){return F(this,function(i){return[2,this.subtleCrypto.importKey(e,this.keygenAlgorithmOptions,t,o)]})})},r.prototype.sign=function(e,t){return D(this,void 0,void 0,function(){return F(this,function(o){return[2,this.subtleCrypto.sign(this.keygenAlgorithmOptions,e,t)]})})},r}();l();c();d();l();c();d();l();c();d();var B_=function(){function r(){this.dbName=Pf,this.version=A_,this.tableName=R_,this.dbOpen=!1}return r.prototype.open=function(){return D(this,void 0,void 0,function(){var e=this;return F(this,function(t){return[2,new Promise(function(o,i){var n=window.indexedDB.open(e.dbName,e.version);n.addEventListener("upgradeneeded",function(s){var a=s;a.target.result.createObjectStore(e.tableName)}),n.addEventListener("success",function(s){var a=s;e.db=a.target.result,e.dbOpen=!0,o()}),n.addEventListener("error",function(){return i(z.createDatabaseUnavailableError())})})]})})},r.prototype.closeConnection=function(){var e=this.db;e&&this.dbOpen&&(e.close(),this.dbOpen=!1)},r.prototype.validateDbIsOpen=function(){return D(this,void 0,void 0,function(){return F(this,function(e){switch(e.label){case 0:return this.dbOpen?[3,2]:[4,this.open()];case 1:return[2,e.sent()];case 2:return[2]}})})},r.prototype.getItem=function(e){return D(this,void 0,void 0,function(){var t=this;return F(this,function(o){switch(o.label){case 0:return[4,this.validateDbIsOpen()];case 1:return o.sent(),[2,new Promise(function(i,n){if(!t.db)return n(z.createDatabaseNotOpenError());var s=t.db.transaction([t.tableName],"readonly"),a=s.objectStore(t.tableName),u=a.get(e);u.addEventListener("success",function(h){var p=h;t.closeConnection(),i(p.target.result)}),u.addEventListener("error",function(h){t.closeConnection(),n(h)})})]}})})},r.prototype.setItem=function(e,t){return D(this,void 0,void 0,function(){var o=this;return F(this,function(i){switch(i.label){case 0:return[4,this.validateDbIsOpen()];case 1:return i.sent(),[2,new Promise(function(n,s){if(!o.db)return s(z.createDatabaseNotOpenError());var a=o.db.transaction([o.tableName],"readwrite"),u=a.objectStore(o.tableName),h=u.put(t,e);h.addEventListener("success",function(){o.closeConnection(),n()}),h.addEventListener("error",function(p){o.closeConnection(),s(p)})})]}})})},r.prototype.removeItem=function(e){return D(this,void 0,void 0,function(){var t=this;return F(this,function(o){switch(o.label){case 0:return[4,this.validateDbIsOpen()];case 1:return o.sent(),[2,new Promise(function(i,n){if(!t.db)return n(z.createDatabaseNotOpenError());var s=t.db.transaction([t.tableName],"readwrite"),a=s.objectStore(t.tableName),u=a.delete(e);u.addEventListener("success",function(){t.closeConnection(),i()}),u.addEventListener("error",function(h){t.closeConnection(),n(h)})})]}})})},r.prototype.getKeys=function(){return D(this,void 0,void 0,function(){var e=this;return F(this,function(t){switch(t.label){case 0:return[4,this.validateDbIsOpen()];case 1:return t.sent(),[2,new Promise(function(o,i){if(!e.db)return i(z.createDatabaseNotOpenError());var n=e.db.transaction([e.tableName],"readonly"),s=n.objectStore(e.tableName),a=s.getAllKeys();a.addEventListener("success",function(u){var h=u;e.closeConnection(),o(h.target.result)}),a.addEventListener("error",function(u){e.closeConnection(),i(u)})})]}})})},r.prototype.containsKey=function(e){return D(this,void 0,void 0,function(){var t=this;return F(this,function(o){switch(o.label){case 0:return[4,this.validateDbIsOpen()];case 1:return o.sent(),[2,new Promise(function(i,n){if(!t.db)return n(z.createDatabaseNotOpenError());var s=t.db.transaction([t.tableName],"readonly"),a=s.objectStore(t.tableName),u=a.count(e);u.addEventListener("success",function(h){var p=h;t.closeConnection(),i(p.target.result===1)}),u.addEventListener("error",function(h){t.closeConnection(),n(h)})})]}})})},r.prototype.deleteDatabase=function(){return D(this,void 0,void 0,function(){return F(this,function(e){return this.db&&this.dbOpen&&this.closeConnection(),[2,new Promise(function(t,o){var i=window.indexedDB.deleteDatabase(Pf);i.addEventListener("success",function(){return t(!0)}),i.addEventListener("blocked",function(){return t(!0)}),i.addEventListener("error",function(){return o(!1)})})]})})},r}();var Py=function(){function r(e,t){this.inMemoryCache=new Au,this.indexedDBCache=new B_,this.logger=e,this.storeName=t}return r.prototype.handleDatabaseAccessError=function(e){if(e instanceof z&&e.errorCode===q.databaseUnavailable.code)this.logger.error("Could not access persistent storage. This may be caused by browser privacy features which block persistent storage in third-party contexts.");else throw e},r.prototype.getItem=function(e){return D(this,void 0,void 0,function(){var t,o;return F(this,function(i){switch(i.label){case 0:if(t=this.inMemoryCache.getItem(e),t)return[3,4];i.label=1;case 1:return i.trys.push([1,3,,4]),this.logger.verbose("Queried item not found in in-memory cache, now querying persistent storage."),[4,this.indexedDBCache.getItem(e)];case 2:return[2,i.sent()];case 3:return o=i.sent(),this.handleDatabaseAccessError(o),[3,4];case 4:return[2,t]}})})},r.prototype.setItem=function(e,t){return D(this,void 0,void 0,function(){var o;return F(this,function(i){switch(i.label){case 0:this.inMemoryCache.setItem(e,t),i.label=1;case 1:return i.trys.push([1,3,,4]),[4,this.indexedDBCache.setItem(e,t)];case 2:return i.sent(),[3,4];case 3:return o=i.sent(),this.handleDatabaseAccessError(o),[3,4];case 4:return[2]}})})},r.prototype.removeItem=function(e){return D(this,void 0,void 0,function(){var t;return F(this,function(o){switch(o.label){case 0:this.inMemoryCache.removeItem(e),o.label=1;case 1:return o.trys.push([1,3,,4]),[4,this.indexedDBCache.removeItem(e)];case 2:return o.sent(),[3,4];case 3:return t=o.sent(),this.handleDatabaseAccessError(t),[3,4];case 4:return[2]}})})},r.prototype.getKeys=function(){return D(this,void 0,void 0,function(){var e,t;return F(this,function(o){switch(o.label){case 0:if(e=this.inMemoryCache.getKeys(),e.length!==0)return[3,4];o.label=1;case 1:return o.trys.push([1,3,,4]),this.logger.verbose("In-memory cache is empty, now querying persistent storage."),[4,this.indexedDBCache.getKeys()];case 2:return[2,o.sent()];case 3:return t=o.sent(),this.handleDatabaseAccessError(t),[3,4];case 4:return[2,e]}})})},r.prototype.containsKey=function(e){return D(this,void 0,void 0,function(){var t,o;return F(this,function(i){switch(i.label){case 0:if(t=this.inMemoryCache.containsKey(e),t)return[3,4];i.label=1;case 1:return i.trys.push([1,3,,4]),this.logger.verbose("Key not found in in-memory cache, now querying persistent storage."),[4,this.indexedDBCache.containsKey(e)];case 2:return[2,i.sent()];case 3:return o=i.sent(),this.handleDatabaseAccessError(o),[3,4];case 4:return[2,t]}})})},r.prototype.clearInMemory=function(){this.logger.verbose("Deleting in-memory keystore "+this.storeName),this.inMemoryCache.clear(),this.logger.verbose("In-memory keystore "+this.storeName+" deleted")},r.prototype.clearPersistent=function(){return D(this,void 0,void 0,function(){var e,t;return F(this,function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),this.logger.verbose("Deleting persistent keystore"),[4,this.indexedDBCache.deleteDatabase()];case 1:return e=o.sent(),e&&this.logger.verbose("Persistent keystore deleted"),[2,e];case 2:return t=o.sent(),this.handleDatabaseAccessError(t),[2,!1];case 3:return[2]}})})},r}();var Hf;(function(r){r.asymmetricKeys="asymmetricKeys",r.symmetricKeys="symmetricKeys"})(Hf||(Hf={}));var z_=function(){function r(e){this.logger=e,this.asymmetricKeys=new Py(this.logger,Hf.asymmetricKeys),this.symmetricKeys=new Py(this.logger,Hf.symmetricKeys)}return r.prototype.clear=function(){return D(this,void 0,void 0,function(){var e;return F(this,function(t){switch(t.label){case 0:this.asymmetricKeys.clearInMemory(),this.symmetricKeys.clearInMemory(),t.label=1;case 1:return t.trys.push([1,3,,4]),[4,this.asymmetricKeys.clearPersistent()];case 2:return t.sent(),[2,!0];case 3:return e=t.sent(),e instanceof Error?this.logger.error("Clearing keystore failed with error: "+e.message):this.logger.error("Clearing keystore failed with unknown error"),[2,!1];case 4:return[2]}})})},r}();var Mu=function(){function r(e,t,o){this.logger=e,this.browserCrypto=new Nf(this.logger,o),this.b64Encode=new Lf,this.b64Decode=new D_,this.guidGenerator=new Ff(this.browserCrypto),this.pkceGenerator=new F_(this.browserCrypto),this.cache=new z_(this.logger),this.performanceClient=t}return r.prototype.createNewGuid=function(){return this.guidGenerator.generateGuid()},r.prototype.base64Encode=function(e){return this.b64Encode.encode(e)},r.prototype.base64Decode=function(e){return this.b64Decode.decode(e)},r.prototype.generatePkceCodes=function(){return D(this,void 0,void 0,function(){return F(this,function(e){return[2,this.pkceGenerator.generateCodes()]})})},r.prototype.getPublicKeyThumbprint=function(e){var t;return D(this,void 0,void 0,function(){var o,i,n,s,a,u,h,p;return F(this,function(f){switch(f.label){case 0:return o=(t=this.performanceClient)===null||t===void 0?void 0:t.startMeasurement($.CryptoOptsGetPublicKeyThumbprint,e.correlationId),[4,this.browserCrypto.generateKeyPair(r.EXTRACTABLE,r.POP_KEY_USAGES)];case 1:return i=f.sent(),[4,this.browserCrypto.exportJwk(i.publicKey)];case 2:return n=f.sent(),s={e:n.e,kty:n.kty,n:n.n},a=zo.getSortedObjectString(s),[4,this.hashString(a)];case 3:return u=f.sent(),[4,this.browserCrypto.exportJwk(i.privateKey)];case 4:return h=f.sent(),[4,this.browserCrypto.importJwk(h,!1,["sign"])];case 5:return p=f.sent(),[4,this.cache.asymmetricKeys.setItem(u,{privateKey:p,publicKey:i.publicKey,requestMethod:e.resourceRequestMethod,requestUri:e.resourceRequestUri})];case 6:return f.sent(),o&&o.endMeasurement({success:!0}),[2,u]}})})},r.prototype.removeTokenBindingKey=function(e){return D(this,void 0,void 0,function(){var t;return F(this,function(o){switch(o.label){case 0:return[4,this.cache.asymmetricKeys.removeItem(e)];case 1:return o.sent(),[4,this.cache.asymmetricKeys.containsKey(e)];case 2:return t=o.sent(),[2,!t]}})})},r.prototype.clearKeystore=function(){return D(this,void 0,void 0,function(){return F(this,function(e){switch(e.label){case 0:return[4,this.cache.clear()];case 1:return[2,e.sent()]}})})},r.prototype.signJwt=function(e,t,o){var i;return D(this,void 0,void 0,function(){var n,s,a,u,h,p,f,b,C,S,R,H,ye;return F(this,function(oe){switch(oe.label){case 0:return n=(i=this.performanceClient)===null||i===void 0?void 0:i.startMeasurement($.CryptoOptsSignJwt,o),[4,this.cache.asymmetricKeys.getItem(t)];case 1:if(s=oe.sent(),!s)throw z.createSigningKeyNotFoundInStorageError(t);return[4,this.browserCrypto.exportJwk(s.publicKey)];case 2:return a=oe.sent(),u=zo.getSortedObjectString(a),h=this.b64Encode.urlEncode(JSON.stringify({kid:t})),p=by.getShrHeaderString({kid:h,alg:a.alg}),f=this.b64Encode.urlEncode(p),e.cnf={jwk:JSON.parse(u)},b=this.b64Encode.urlEncode(JSON.stringify(e)),C=f+"."+b,S=zo.stringToArrayBuffer(C),[4,this.browserCrypto.sign(s.privateKey,S)];case 3:return R=oe.sent(),H=this.b64Encode.urlEncodeArr(new Uint8Array(R)),ye=C+"."+H,n&&n.endMeasurement({success:!0}),[2,ye]}})})},r.prototype.hashString=function(e){return D(this,void 0,void 0,function(){var t,o;return F(this,function(i){switch(i.label){case 0:return[4,this.browserCrypto.sha256Digest(e)];case 1:return t=i.sent(),o=new Uint8Array(t),[2,this.b64Encode.urlEncodeArr(o)]}})})},r.POP_KEY_USAGES=["sign","verify"],r.EXTRACTABLE=!0,r}();l();c();d();l();c();d();var Uf=function(){function r(e,t){this.correlationId=t,this.measureName=r.makeMeasureName(e,t),this.startMark=r.makeStartMark(e,t),this.endMark=r.makeEndMark(e,t)}return r.makeMeasureName=function(e,t){return"msal.measure."+e+"."+t},r.makeStartMark=function(e,t){return"msal.start."+e+"."+t},r.makeEndMark=function(e,t){return"msal.end."+e+"."+t},r.supportsBrowserPerformance=function(){return typeof window<"u"&&typeof window.performance<"u"&&typeof window.performance.mark=="function"&&typeof window.performance.measure=="function"&&typeof window.performance.clearMarks=="function"&&typeof window.performance.clearMeasures=="function"&&typeof window.performance.getEntriesByName=="function"},r.flushMeasurements=function(e,t){if(r.supportsBrowserPerformance())try{t.forEach(function(o){var i=r.makeMeasureName(o.name,e),n=window.performance.getEntriesByName(i,"measure");n.length>0&&(window.performance.clearMeasures(i),window.performance.clearMarks(r.makeStartMark(i,e)),window.performance.clearMarks(r.makeEndMark(i,e)))})}catch{}},r.prototype.startMeasurement=function(){if(r.supportsBrowserPerformance())try{window.performance.mark(this.startMark)}catch{}},r.prototype.endMeasurement=function(){if(r.supportsBrowserPerformance())try{window.performance.mark(this.endMark),window.performance.measure(this.measureName,this.startMark,this.endMark)}catch{}},r.prototype.flushMeasurement=function(){if(r.supportsBrowserPerformance())try{var e=window.performance.getEntriesByName(this.measureName,"measure");if(e.length>0){var t=e[0].duration;return window.performance.clearMeasures(this.measureName),window.performance.clearMarks(this.startMark),window.performance.clearMarks(this.endMark),t}}catch{}return null},r}();var $y=function(r){mt(e,r);function e(t,o,i,n,s,a,u){var h=r.call(this,t,o,i,n,s,a)||this;return h.browserCrypto=new Nf(h.logger,u),h.guidGenerator=new Ff(h.browserCrypto),h}return e.prototype.startPerformanceMeasuremeant=function(t,o){return new Uf(t,o)},e.prototype.generateId=function(){return this.guidGenerator.generateGuid()},e.prototype.getPageVisibility=function(){var t;return((t=document.visibilityState)===null||t===void 0?void 0:t.toString())||null},e.prototype.deleteIncompleteSubMeasurements=function(t){var o=this.eventsByCorrelationId.get(t.event.correlationId),i=o&&o.eventId===t.event.eventId,n=[];i&&o?.incompleteSubMeasurements&&o.incompleteSubMeasurements.forEach(function(s){n.push(ae({},s))}),n.length>0&&Uf.flushMeasurements(t.event.correlationId,n)},e.prototype.supportsBrowserPerformanceNow=function(){return typeof window<"u"&&typeof window.performance<"u"&&typeof window.performance.now=="function"},e.prototype.startMeasurement=function(t,o){var i=this,n=this.getPageVisibility(),s=r.prototype.startMeasurement.call(this,t,o);return ae(ae({},s),{endMeasurement:function(a){var u=s.endMeasurement(ae({startPageVisibility:n,endPageVisibility:i.getPageVisibility()},a));return i.deleteIncompleteSubMeasurements(s),u},discardMeasurement:function(){s.discardMeasurement(),i.deleteIncompleteSubMeasurements(s),s.measurement.flushMeasurement()}})},e.prototype.setPreQueueTime=function(t,o){if(!this.supportsBrowserPerformanceNow()){this.logger.trace("BrowserPerformanceClient: window performance API not available, unable to set telemetry queue time for "+t);return}if(!o){this.logger.trace("BrowserPerformanceClient: correlationId for "+t+" not provided, unable to set telemetry queue time");return}var i=this.preQueueTimeByCorrelationId.get(o);i&&(this.logger.trace("BrowserPerformanceClient: Incomplete pre-queue "+i.name+" found",o),this.addQueueMeasurement(i.name,o,void 0,!0)),this.preQueueTimeByCorrelationId.set(o,{name:t,time:window.performance.now()})},e.prototype.addQueueMeasurement=function(t,o,i,n){if(!this.supportsBrowserPerformanceNow()){this.logger.trace("BrowserPerformanceClient: window performance API not available, unable to add queue measurement for "+t);return}if(!o){this.logger.trace("BrowserPerformanceClient: correlationId for "+t+" not provided, unable to add queue measurement");return}var s=r.prototype.getPreQueueTime.call(this,t,o);if(s){var a=window.performance.now(),u=i||r.prototype.calculateQueuedTime.call(this,s,a);return r.prototype.addQueueMeasurement.call(this,t,o,u,n)}},e}(Iu);l();c();d();l();c();d();l();c();d();var V_=function(){function r(e,t,o,i){this.isBrowserEnvironment=typeof window<"u",this.config=e,this.storage=t,this.logger=o,this.cryptoObj=i}return r.prototype.loadExternalTokens=function(e,t,o){if(this.logger.info("TokenCache - loadExternalTokens called"),!t.id_token)throw z.createUnableToLoadTokenError("Please ensure server response includes id token.");var i=new fr(t.id_token,this.cryptoObj),n,s;if(e.account){var a=this.loadAccount(i,e.account.environment,void 0,void 0,e.account.homeAccountId);n=new hs(a,this.loadIdToken(i,a.homeAccountId,e.account.environment,e.account.tenantId),this.loadAccessToken(e,t,a.homeAccountId,e.account.environment,e.account.tenantId,o),this.loadRefreshToken(e,t,a.homeAccountId,e.account.environment))}else if(e.authority){var u=fs.generateAuthority(e.authority,e.azureCloudOptions),h={protocolMode:this.config.auth.protocolMode,knownAuthorities:this.config.auth.knownAuthorities,cloudDiscoveryMetadata:this.config.auth.cloudDiscoveryMetadata,authorityMetadata:this.config.auth.authorityMetadata,skipAuthorityMetadataCache:this.config.auth.skipAuthorityMetadataCache};if(s=new fs(u,this.config.system.networkClient,this.storage,h,this.logger),o.clientInfo){this.logger.trace("TokenCache - homeAccountId from options");var a=this.loadAccount(i,s.hostnameAndPort,o.clientInfo,s.authorityType);n=new hs(a,this.loadIdToken(i,a.homeAccountId,s.hostnameAndPort,s.tenant),this.loadAccessToken(e,t,a.homeAccountId,s.hostnameAndPort,s.tenant,o),this.loadRefreshToken(e,t,a.homeAccountId,s.hostnameAndPort))}else if(t.client_info){this.logger.trace("TokenCache - homeAccountId from response");var a=this.loadAccount(i,s.hostnameAndPort,t.client_info,s.authorityType);n=new hs(a,this.loadIdToken(i,a.homeAccountId,s.hostnameAndPort,s.tenant),this.loadAccessToken(e,t,a.homeAccountId,s.hostnameAndPort,s.tenant,o),this.loadRefreshToken(e,t,a.homeAccountId,s.hostnameAndPort))}else throw z.createUnableToLoadTokenError("Please provide clientInfo in the response or options.")}else throw z.createUnableToLoadTokenError("Please provide a request with an account or a request with authority.");return this.generateAuthenticationResult(e,i,n,s)},r.prototype.loadAccount=function(e,t,o,i,n){var s;if(n?s=n:i!==void 0&&o&&(s=Nt.generateHomeAccountId(o,i,this.logger,this.cryptoObj,e)),!s)throw z.createUnableToLoadTokenError("Unexpected missing homeAccountId");var a=o?Nt.createAccount(o,s,e,void 0,void 0,void 0,t):Nt.createGenericAccount(s,e,void 0,void 0,void 0,t);if(this.isBrowserEnvironment)return this.logger.verbose("TokenCache - loading account"),this.storage.setAccount(a),a;throw z.createUnableToLoadTokenError("loadExternalTokens is designed to work in browser environments only.")},r.prototype.loadIdToken=function(e,t,o,i){var n=vi.createIdTokenEntity(t,o,e.rawToken,this.config.auth.clientId,i);if(this.isBrowserEnvironment)return this.logger.verbose("TokenCache - loading id token"),this.storage.setIdTokenCredential(n),n;throw z.createUnableToLoadTokenError("loadExternalTokens is designed to work in browser environments only.")},r.prototype.loadAccessToken=function(e,t,o,i,n,s){if(!t.access_token)return this.logger.verbose("TokenCache - No access token provided for caching"),null;if(!t.expires_in)throw z.createUnableToLoadTokenError("Please ensure server response includes expires_in value.");if(!s.extendedExpiresOn)throw z.createUnableToLoadTokenError("Please provide an extendedExpiresOn value in the options.");var a=new It(e.scopes).printScopes(),u=s.expiresOn||t.expires_in+new Date().getTime()/1e3,h=s.extendedExpiresOn,p=yi.createAccessTokenEntity(o,i,t.access_token,this.config.auth.clientId,n,a,u,h,this.cryptoObj);if(this.isBrowserEnvironment)return this.logger.verbose("TokenCache - loading access token"),this.storage.setAccessTokenCredential(p),p;throw z.createUnableToLoadTokenError("loadExternalTokens is designed to work in browser environments only.")},r.prototype.loadRefreshToken=function(e,t,o,i){if(!t.refresh_token)return this.logger.verbose("TokenCache - No refresh token provided for caching"),null;var n=In.createRefreshTokenEntity(o,i,t.refresh_token,this.config.auth.clientId);if(this.isBrowserEnvironment)return this.logger.verbose("TokenCache - loading refresh token"),this.storage.setRefreshTokenCredential(n),n;throw z.createUnableToLoadTokenError("loadExternalTokens is designed to work in browser environments only.")},r.prototype.generateAuthenticationResult=function(e,t,o,i){var n,s,a,u=_.EMPTY_STRING,h=[],p=null,f;o?.accessToken&&(u=o.accessToken.secret,h=It.fromString(o.accessToken.target).asArray(),p=new Date(Number(o.accessToken.expiresOn)*1e3),f=new Date(Number(o.accessToken.extendedExpiresOn)*1e3));var b=t?.claims.oid||t?.claims.sub||_.EMPTY_STRING,C=t?.claims.tid||_.EMPTY_STRING;return{authority:i?i.canonicalAuthority:_.EMPTY_STRING,uniqueId:b,tenantId:C,scopes:h,account:o?.account?o.account.getAccountInfo():null,idToken:t?t.rawToken:_.EMPTY_STRING,idTokenClaims:t?t.claims:{},accessToken:u,fromCache:!0,expiresOn:p,correlationId:e.correlationId||_.EMPTY_STRING,requestId:_.EMPTY_STRING,extExpiresOn:f,familyId:_.EMPTY_STRING,tokenType:((n=o?.accessToken)===null||n===void 0?void 0:n.tokenType)||_.EMPTY_STRING,state:_.EMPTY_STRING,cloudGraphHostName:((s=o?.account)===null||s===void 0?void 0:s.cloudGraphHostName)||_.EMPTY_STRING,msGraphHost:((a=o?.account)===null||a===void 0?void 0:a.msGraphHost)||_.EMPTY_STRING,code:void 0,fromNativeBroker:!1}},r}();l();c();d();l();c();d();var q_=function(r){mt(e,r);function e(t){var o=r.call(this,t)||this;return o.includeRedirectUri=!1,o}return e}(Tu);var G_=function(r){mt(e,r);function e(t,o,i,n,s,a,u,h,p,f){var b=r.call(this,t,o,i,n,s,a,h,p,f)||this;return b.apiId=u,b}return e.prototype.acquireToken=function(t){return D(this,void 0,void 0,function(){var o,i,n,s,a,u,h;return F(this,function(p){switch(p.label){case 0:if(this.logger.trace("SilentAuthCodeClient.acquireToken called"),!t.code)throw z.createAuthCodeRequiredError();return this.performanceClient.setPreQueueTime($.StandardInteractionClientInitializeAuthorizationRequest,t.correlationId),[4,this.initializeAuthorizationRequest(t,ne.Silent)];case 1:o=p.sent(),this.browserStorage.updateCacheEntries(o.state,o.nonce,o.authority,o.loginHint||_.EMPTY_STRING,o.account||null),i=this.initializeServerTelemetryManager(this.apiId),p.label=2;case 2:return p.trys.push([2,4,,5]),n=ae(ae({},o),{code:t.code}),this.performanceClient.setPreQueueTime($.StandardInteractionClientGetClientConfiguration,t.correlationId),[4,this.getClientConfiguration(i,o.authority)];case 3:return s=p.sent(),a=new q_(s),this.logger.verbose("Auth code client created"),u=new Df(a,this.browserStorage,n,this.logger,this.config.system,this.performanceClient),[2,u.handleCodeResponseFromServer({code:t.code,msgraph_host:t.msGraphHost,cloud_graph_host_name:t.cloudGraphHostName,cloud_instance_host_name:t.cloudInstanceHostName},o.state,a.authority,this.networkClient,!1)];case 4:throw h=p.sent(),h instanceof ee&&h.setCorrelationId(this.correlationId),i.cacheFailedRequest(h),this.browserStorage.cleanRequestByState(o.state),h;case 5:return[2]}})})},e.prototype.logout=function(){return Promise.reject(z.createSilentLogoutUnsupportedError())},e}(li);var j_=function(){function r(e){this.isBrowserEnvironment=typeof window<"u",this.config=M_(e,this.isBrowserEnvironment),this.initialized=!1,this.logger=new _n(this.config.system.loggerOptions,Oc,Xi),this.networkClient=this.config.system.networkClient,this.navigationClient=this.config.system.navigationClient,this.redirectResponse=new Map,this.hybridAuthCodeResponses=new Map,this.performanceClient=this.isBrowserEnvironment?new $y(this.config.auth.clientId,this.config.auth.authority,this.logger,Oc,Xi,this.config.telemetry.application,this.config.system.cryptoOptions):new Cy(this.config.auth.clientId,this.config.auth.authority,this.logger,Oc,Xi,this.config.telemetry.application),this.browserCrypto=this.isBrowserEnvironment?new Mu(this.logger,this.performanceClient,this.config.system.cryptoOptions):ta,this.eventHandler=new Ry(this.logger,this.browserCrypto),this.browserStorage=this.isBrowserEnvironment?new Ru(this.config.auth.clientId,this.config.cache,this.browserCrypto,this.logger):P_(this.config.auth.clientId,this.logger);var t={cacheLocation:zt.MemoryStorage,temporaryCacheLocation:zt.MemoryStorage,storeAuthStateInCookie:!1,secureCookies:!1,cacheMigrationEnabled:!1,claimsBasedCachingEnabled:!0};this.nativeInternalStorage=new Ru(this.config.auth.clientId,t,this.browserCrypto,this.logger),this.tokenCache=new V_(this.config,this.browserStorage,this.logger,this.browserCrypto),this.trackPageVisibilityWithMeasurement=this.trackPageVisibilityWithMeasurement.bind(this)}return r.prototype.initialize=function(){return D(this,void 0,void 0,function(){var e,t,o,i,n;return F(this,function(s){switch(s.label){case 0:if(this.logger.trace("initialize called"),this.initialized)return this.logger.info("initialize has already been called, exiting early."),[2];if(e=this.config.system.allowNativeBroker,t=this.performanceClient.startMeasurement($.InitializeClientApplication),this.eventHandler.emitEvent(he.INITIALIZE_START),!e)return[3,4];s.label=1;case 1:return s.trys.push([1,3,,4]),o=this,[4,ci.createProvider(this.logger,this.config.system.nativeBrokerHandshakeTimeout,this.performanceClient)];case 2:return o.nativeExtensionProvider=s.sent(),[3,4];case 3:return i=s.sent(),this.logger.verbose(i),[3,4];case 4:return this.config.cache.claimsBasedCachingEnabled?[3,6]:(this.logger.verbose("Claims-based caching is disabled. Clearing the previous cache with claims"),n=this.performanceClient.startMeasurement($.ClearTokensAndKeysWithClaims),[4,this.browserStorage.clearTokensAndKeysWithClaims()]);case 5:s.sent(),n.endMeasurement({success:!0}),s.label=6;case 6:return this.initialized=!0,this.eventHandler.emitEvent(he.INITIALIZE_END),t.endMeasurement({allowNativeBroker:e,success:!0}),[2]}})})},r.prototype.handleRedirectPromise=function(e){return D(this,void 0,void 0,function(){var t,o,i,n,s,a,u,h,p=this;return F(this,function(f){return this.logger.verbose("handleRedirectPromise called"),St.blockNativeBrokerCalledBeforeInitialized(this.config.system.allowNativeBroker,this.initialized),t=this.getAllAccounts(),this.isBrowserEnvironment?(o=e||_.EMPTY_STRING,i=this.redirectResponse.get(o),typeof i>"u"?(this.eventHandler.emitEvent(he.HANDLE_REDIRECT_START,ne.Redirect),this.logger.verbose("handleRedirectPromise has been called for the first time, storing the promise"),n=this.browserStorage.getCachedNativeRequest(),s=void 0,n&&ci.isNativeAvailable(this.config,this.logger,this.nativeExtensionProvider)&&this.nativeExtensionProvider&&!e?(this.logger.trace("handleRedirectPromise - acquiring token from native platform"),a=new en(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,ct.handleRedirectPromise,this.performanceClient,this.nativeExtensionProvider,n.accountId,this.nativeInternalStorage,n.correlationId),s=a.handleRedirectPromise()):(this.logger.trace("handleRedirectPromise - acquiring token from web flow"),u=this.browserStorage.getTemporaryCache(Ye.CORRELATION_ID,!0)||_.EMPTY_STRING,h=this.createRedirectClient(u),s=h.handleRedirectPromise(e)),i=s.then(function(b){if(b){var C=t.length0?p.eventHandler.emitEvent(he.ACQUIRE_TOKEN_FAILURE,ne.Redirect,null,b):p.eventHandler.emitEvent(he.LOGIN_FAILURE,ne.Redirect,null,b),p.eventHandler.emitEvent(he.HANDLE_REDIRECT_END,ne.Redirect),b}),this.redirectResponse.set(o,i)):this.logger.verbose("handleRedirectPromise has been called previously, returning the result from the first call"),[2,i]):(this.logger.verbose("handleRedirectPromise returns null, not browser environment"),[2,null])})})},r.prototype.acquireTokenRedirect=function(e){return D(this,void 0,void 0,function(){var t,o,i,n,s,a=this;return F(this,function(u){return t=this.getRequestCorrelationId(e),this.logger.verbose("acquireTokenRedirect called",t),this.preflightBrowserEnvironmentCheck(ne.Redirect),o=this.getAllAccounts().length>0,o?this.eventHandler.emitEvent(he.ACQUIRE_TOKEN_START,ne.Redirect,e):this.eventHandler.emitEvent(he.LOGIN_START,ne.Redirect,e),this.nativeExtensionProvider&&this.canUseNative(e)?(n=new en(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,ct.acquireTokenRedirect,this.performanceClient,this.nativeExtensionProvider,this.getNativeAccountId(e),this.nativeInternalStorage,e.correlationId),i=n.acquireTokenRedirect(e).catch(function(h){if(h instanceof Eo&&h.isFatal()){a.nativeExtensionProvider=void 0;var p=a.createRedirectClient(e.correlationId);return p.acquireToken(e)}else if(h instanceof Cr){a.logger.verbose("acquireTokenRedirect - Resolving interaction required error thrown by native broker by falling back to web flow");var p=a.createRedirectClient(e.correlationId);return p.acquireToken(e)}throw a.browserStorage.setInteractionInProgress(!1),h})):(s=this.createRedirectClient(e.correlationId),i=s.acquireToken(e)),[2,i.catch(function(h){throw o?a.eventHandler.emitEvent(he.ACQUIRE_TOKEN_FAILURE,ne.Redirect,null,h):a.eventHandler.emitEvent(he.LOGIN_FAILURE,ne.Redirect,null,h),h})]})})},r.prototype.acquireTokenPopup=function(e){var t=this,o=this.getRequestCorrelationId(e),i=this.performanceClient.startMeasurement($.AcquireTokenPopup,o);try{this.logger.verbose("acquireTokenPopup called",o),this.preflightBrowserEnvironmentCheck(ne.Popup)}catch(u){return Promise.reject(u)}var n=this.getAllAccounts();n.length>0?this.eventHandler.emitEvent(he.ACQUIRE_TOKEN_START,ne.Popup,e):this.eventHandler.emitEvent(he.LOGIN_START,ne.Popup,e);var s;if(this.canUseNative(e))s=this.acquireTokenNative(e,ct.acquireTokenPopup).then(function(u){return t.browserStorage.setInteractionInProgress(!1),i.endMeasurement({success:!0,isNativeBroker:!0,requestId:u.requestId}),u}).catch(function(u){if(u instanceof Eo&&u.isFatal()){t.nativeExtensionProvider=void 0;var h=t.createPopupClient(e.correlationId);return h.acquireToken(e)}else if(u instanceof Cr){t.logger.verbose("acquireTokenPopup - Resolving interaction required error thrown by native broker by falling back to web flow");var h=t.createPopupClient(e.correlationId);return h.acquireToken(e)}throw t.browserStorage.setInteractionInProgress(!1),u});else{var a=this.createPopupClient(e.correlationId);s=a.acquireToken(e)}return s.then(function(u){var h=n.length0?t.eventHandler.emitEvent(he.ACQUIRE_TOKEN_FAILURE,ne.Popup,null,u):t.eventHandler.emitEvent(he.LOGIN_FAILURE,ne.Popup,null,u),i.endMeasurement({errorCode:u.errorCode,subErrorCode:u.subError,success:!1}),Promise.reject(u)})},r.prototype.trackPageVisibilityWithMeasurement=function(){var e=this.ssoSilentMeasurement||this.acquireTokenByCodeAsyncMeasurement;e&&(this.logger.info("Perf: Visibility change detected in ",e.event.name),e.increment({visibilityChangeCount:1}))},r.prototype.ssoSilent=function(e){var t;return D(this,void 0,void 0,function(){var o,i,n,s,a=this;return F(this,function(u){return o=this.getRequestCorrelationId(e),i=ae(ae({},e),{prompt:e.prompt,correlationId:o}),this.preflightBrowserEnvironmentCheck(ne.Silent),this.ssoSilentMeasurement=this.performanceClient.startMeasurement($.SsoSilent,o),(t=this.ssoSilentMeasurement)===null||t===void 0||t.increment({visibilityChangeCount:0}),document.addEventListener("visibilitychange",this.trackPageVisibilityWithMeasurement),this.logger.verbose("ssoSilent called",o),this.eventHandler.emitEvent(he.SSO_SILENT_START,ne.Silent,i),this.canUseNative(i)?n=this.acquireTokenNative(i,ct.ssoSilent).catch(function(h){if(h instanceof Eo&&h.isFatal()){a.nativeExtensionProvider=void 0;var p=a.createSilentIframeClient(i.correlationId);return p.acquireToken(i)}throw h}):(s=this.createSilentIframeClient(i.correlationId),n=s.acquireToken(i)),[2,n.then(function(h){var p,f;return a.eventHandler.emitEvent(he.SSO_SILENT_SUCCESS,ne.Silent,h),(p=a.ssoSilentMeasurement)===null||p===void 0||p.addStaticFields({accessTokenSize:h.accessToken.length,idTokenSize:h.idToken.length}),(f=a.ssoSilentMeasurement)===null||f===void 0||f.endMeasurement({success:!0,isNativeBroker:h.fromNativeBroker,requestId:h.requestId}),h}).catch(function(h){var p;throw a.eventHandler.emitEvent(he.SSO_SILENT_FAILURE,ne.Silent,null,h),(p=a.ssoSilentMeasurement)===null||p===void 0||p.endMeasurement({errorCode:h.errorCode,subErrorCode:h.subError,success:!1}),h}).finally(function(){document.removeEventListener("visibilitychange",a.trackPageVisibilityWithMeasurement)})]})})},r.prototype.acquireTokenByCode=function(e){return D(this,void 0,void 0,function(){var t,o,i,n,s=this;return F(this,function(a){t=this.getRequestCorrelationId(e),this.preflightBrowserEnvironmentCheck(ne.Silent),this.logger.trace("acquireTokenByCode called",t),this.eventHandler.emitEvent(he.ACQUIRE_TOKEN_BY_CODE_START,ne.Silent,e),o=this.performanceClient.startMeasurement($.AcquireTokenByCode,e.correlationId);try{if(e.code&&e.nativeAccountId)throw z.createSpaCodeAndNativeAccountIdPresentError();if(e.code)return i=e.code,n=this.hybridAuthCodeResponses.get(i),n?(this.logger.verbose("Existing acquireTokenByCode request found",e.correlationId),o.discardMeasurement()):(this.logger.verbose("Initiating new acquireTokenByCode request",t),n=this.acquireTokenByCodeAsync(ae(ae({},e),{correlationId:t})).then(function(u){return s.eventHandler.emitEvent(he.ACQUIRE_TOKEN_BY_CODE_SUCCESS,ne.Silent,u),s.hybridAuthCodeResponses.delete(i),o.addStaticFields({accessTokenSize:u.accessToken.length,idTokenSize:u.idToken.length}),o.endMeasurement({success:!0,isNativeBroker:u.fromNativeBroker,requestId:u.requestId}),u}).catch(function(u){throw s.hybridAuthCodeResponses.delete(i),s.eventHandler.emitEvent(he.ACQUIRE_TOKEN_BY_CODE_FAILURE,ne.Silent,null,u),o.endMeasurement({errorCode:u.errorCode,subErrorCode:u.subError,success:!1}),u}),this.hybridAuthCodeResponses.set(i,n)),[2,n];if(e.nativeAccountId){if(this.canUseNative(e,e.nativeAccountId))return[2,this.acquireTokenNative(e,ct.acquireTokenByCode,e.nativeAccountId).catch(function(u){throw u instanceof Eo&&u.isFatal()&&(s.nativeExtensionProvider=void 0),u})];throw z.createUnableToAcquireTokenFromNativePlatformError()}else throw z.createAuthCodeOrNativeAccountIdRequiredError()}catch(u){throw this.eventHandler.emitEvent(he.ACQUIRE_TOKEN_BY_CODE_FAILURE,ne.Silent,null,u),o.endMeasurement({errorCode:u instanceof ee&&u.errorCode||void 0,subErrorCode:u instanceof ee&&u.subError||void 0,success:!1}),u}return[2]})})},r.prototype.acquireTokenByCodeAsync=function(e){var t;return D(this,void 0,void 0,function(){var o,i,n=this;return F(this,function(s){switch(s.label){case 0:return this.logger.trace("acquireTokenByCodeAsync called",e.correlationId),this.acquireTokenByCodeAsyncMeasurement=this.performanceClient.startMeasurement($.AcquireTokenByCodeAsync,e.correlationId),(t=this.acquireTokenByCodeAsyncMeasurement)===null||t===void 0||t.increment({visibilityChangeCount:0}),document.addEventListener("visibilitychange",this.trackPageVisibilityWithMeasurement),o=this.createSilentAuthCodeClient(e.correlationId),[4,o.acquireToken(e).then(function(a){var u;return(u=n.acquireTokenByCodeAsyncMeasurement)===null||u===void 0||u.endMeasurement({success:!0,fromCache:a.fromCache,isNativeBroker:a.fromNativeBroker,requestId:a.requestId}),a}).catch(function(a){var u;throw(u=n.acquireTokenByCodeAsyncMeasurement)===null||u===void 0||u.endMeasurement({errorCode:a.errorCode,subErrorCode:a.subError,success:!1}),a}).finally(function(){document.removeEventListener("visibilitychange",n.trackPageVisibilityWithMeasurement)})];case 1:return i=s.sent(),[2,i]}})})},r.prototype.acquireTokenFromCache=function(e,t,o){return D(this,void 0,void 0,function(){return F(this,function(i){switch(this.performanceClient.addQueueMeasurement($.AcquireTokenFromCache,t.correlationId),o.cacheLookupPolicy){case oo.Default:case oo.AccessToken:case oo.AccessTokenAndRefreshToken:return[2,e.acquireToken(t)];default:throw U.createRefreshRequiredError()}return[2]})})},r.prototype.acquireTokenByRefreshToken=function(e,t){return D(this,void 0,void 0,function(){var o;return F(this,function(i){switch(this.performanceClient.addQueueMeasurement($.AcquireTokenByRefreshToken,e.correlationId),t.cacheLookupPolicy){case oo.Default:case oo.AccessTokenAndRefreshToken:case oo.RefreshToken:case oo.RefreshTokenAndNetwork:return o=this.createSilentRefreshClient(e.correlationId),this.performanceClient.setPreQueueTime($.SilentRefreshClientAcquireToken,e.correlationId),[2,o.acquireToken(e)];default:throw U.createRefreshRequiredError()}return[2]})})},r.prototype.acquireTokenBySilentIframe=function(e){return D(this,void 0,void 0,function(){var t;return F(this,function(o){return this.performanceClient.addQueueMeasurement($.AcquireTokenBySilentIframe,e.correlationId),t=this.createSilentIframeClient(e.correlationId),this.performanceClient.setPreQueueTime($.SilentIframeClientAcquireToken,e.correlationId),[2,t.acquireToken(e)]})})},r.prototype.logout=function(e){return D(this,void 0,void 0,function(){var t;return F(this,function(o){return t=this.getRequestCorrelationId(e),this.logger.warning("logout API is deprecated and will be removed in msal-browser v3.0.0. Use logoutRedirect instead.",t),[2,this.logoutRedirect(ae({correlationId:t},e))]})})},r.prototype.logoutRedirect=function(e){return D(this,void 0,void 0,function(){var t,o;return F(this,function(i){return t=this.getRequestCorrelationId(e),this.preflightBrowserEnvironmentCheck(ne.Redirect),o=this.createRedirectClient(t),[2,o.logout(e)]})})},r.prototype.logoutPopup=function(e){try{var t=this.getRequestCorrelationId(e);this.preflightBrowserEnvironmentCheck(ne.Popup);var o=this.createPopupClient(t);return o.logout(e)}catch(i){return Promise.reject(i)}},r.prototype.getAllAccounts=function(){return this.logger.verbose("getAllAccounts called"),this.isBrowserEnvironment?this.browserStorage.getAllAccounts():[]},r.prototype.getAccountByUsername=function(e){if(this.logger.trace("getAccountByUsername called"),!e)return this.logger.warning("getAccountByUsername: No username provided"),null;var t=this.browserStorage.getAccountInfoFilteredBy({username:e});return t?(this.logger.verbose("getAccountByUsername: Account matching username found, returning"),this.logger.verbosePii("getAccountByUsername: Returning signed-in accounts matching username: "+e),t):(this.logger.verbose("getAccountByUsername: No matching account found, returning null"),null)},r.prototype.getAccountByHomeId=function(e){if(this.logger.trace("getAccountByHomeId called"),!e)return this.logger.warning("getAccountByHomeId: No homeAccountId provided"),null;var t=this.browserStorage.getAccountInfoFilteredBy({homeAccountId:e});return t?(this.logger.verbose("getAccountByHomeId: Account matching homeAccountId found, returning"),this.logger.verbosePii("getAccountByHomeId: Returning signed-in accounts matching homeAccountId: "+e),t):(this.logger.verbose("getAccountByHomeId: No matching account found, returning null"),null)},r.prototype.getAccountByLocalId=function(e){if(this.logger.trace("getAccountByLocalId called"),!e)return this.logger.warning("getAccountByLocalId: No localAccountId provided"),null;var t=this.browserStorage.getAccountInfoFilteredBy({localAccountId:e});return t?(this.logger.verbose("getAccountByLocalId: Account matching localAccountId found, returning"),this.logger.verbosePii("getAccountByLocalId: Returning signed-in accounts matching localAccountId: "+e),t):(this.logger.verbose("getAccountByLocalId: No matching account found, returning null"),null)},r.prototype.setActiveAccount=function(e){this.browserStorage.setActiveAccount(e)},r.prototype.getActiveAccount=function(){return this.browserStorage.getActiveAccount()},r.prototype.preflightBrowserEnvironmentCheck=function(e,t){if(t===void 0&&(t=!0),this.logger.verbose("preflightBrowserEnvironmentCheck started"),St.blockNonBrowserEnvironment(this.isBrowserEnvironment),St.blockRedirectInIframe(e,this.config.system.allowRedirectInIframe),St.blockReloadInHiddenIframes(),St.blockAcquireTokenInPopups(),St.blockNativeBrokerCalledBeforeInitialized(this.config.system.allowNativeBroker,this.initialized),e===ne.Redirect&&this.config.cache.cacheLocation===zt.MemoryStorage&&!this.config.cache.storeAuthStateInCookie)throw gs.createInMemoryRedirectUnavailableError();(e===ne.Redirect||e===ne.Popup)&&this.preflightInteractiveRequest(t)},r.prototype.preflightInteractiveRequest=function(e){this.logger.verbose("preflightInteractiveRequest called, validating app environment"),St.blockReloadInHiddenIframes(),e&&this.browserStorage.setInteractionInProgress(!0)},r.prototype.acquireTokenNative=function(e,t,o){return D(this,void 0,void 0,function(){var i;return F(this,function(n){if(this.logger.trace("acquireTokenNative called"),!this.nativeExtensionProvider)throw z.createNativeConnectionNotEstablishedError();return i=new en(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,t,this.performanceClient,this.nativeExtensionProvider,o||this.getNativeAccountId(e),this.nativeInternalStorage,e.correlationId),[2,i.acquireToken(e)]})})},r.prototype.canUseNative=function(e,t){if(this.logger.trace("canUseNative called"),!ci.isNativeAvailable(this.config,this.logger,this.nativeExtensionProvider,e.authenticationScheme))return this.logger.trace("canUseNative: isNativeAvailable returned false, returning false"),!1;if(e.prompt)switch(e.prompt){case or.NONE:case or.CONSENT:case or.LOGIN:this.logger.trace("canUseNative: prompt is compatible with native flow");break;default:return this.logger.trace("canUseNative: prompt = "+e.prompt+" is not compatible with native flow, returning false"),!1}return!t&&!this.getNativeAccountId(e)?(this.logger.trace("canUseNative: nativeAccountId is not available, returning false"),!1):!0},r.prototype.getNativeAccountId=function(e){var t=e.account||this.browserStorage.getAccountInfoByHints(e.loginHint,e.sid)||this.getActiveAccount();return t&&t.nativeAccountId||""},r.prototype.createPopupClient=function(e){return new Ty(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,this.performanceClient,this.nativeInternalStorage,this.nativeExtensionProvider,e)},r.prototype.createRedirectClient=function(e){return new _y(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,this.performanceClient,this.nativeInternalStorage,this.nativeExtensionProvider,e)},r.prototype.createSilentIframeClient=function(e){return new Iy(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,ct.ssoSilent,this.performanceClient,this.nativeInternalStorage,this.nativeExtensionProvider,e)},r.prototype.createSilentCacheClient=function(e){return new $u(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,this.performanceClient,this.nativeExtensionProvider,e)},r.prototype.createSilentRefreshClient=function(e){return new Ay(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,this.performanceClient,this.nativeExtensionProvider,e)},r.prototype.createSilentAuthCodeClient=function(e){return new G_(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,ct.acquireTokenByCode,this.performanceClient,this.nativeExtensionProvider,e)},r.prototype.addEventCallback=function(e){return this.eventHandler.addEventCallback(e)},r.prototype.removeEventCallback=function(e){this.eventHandler.removeEventCallback(e)},r.prototype.addPerformanceCallback=function(e){return this.performanceClient.addPerformanceCallback(e)},r.prototype.removePerformanceCallback=function(e){return this.performanceClient.removePerformanceCallback(e)},r.prototype.enableAccountStorageEvents=function(){this.eventHandler.enableAccountStorageEvents()},r.prototype.disableAccountStorageEvents=function(){this.eventHandler.disableAccountStorageEvents()},r.prototype.getTokenCache=function(){return this.tokenCache},r.prototype.getLogger=function(){return this.logger},r.prototype.setLogger=function(e){this.logger=e},r.prototype.initializeWrapperLibrary=function(e,t){this.browserStorage.setWrapperMetadata(e,t)},r.prototype.setNavigationClient=function(e){this.navigationClient=e},r.prototype.getConfiguration=function(){return this.config},r.prototype.getRequestCorrelationId=function(e){return e?.correlationId?e.correlationId:this.isBrowserEnvironment?this.browserCrypto.createNewGuid():_.EMPTY_STRING},r}();var Oy=function(r){mt(e,r);function e(t){var o=r.call(this,t)||this;return o.astsAsyncMeasurement=void 0,o.activeSilentTokenRequests=new Map,o.trackPageVisibility=o.trackPageVisibility.bind(o),o}return e.prototype.loginRedirect=function(t){return D(this,void 0,void 0,function(){var o;return F(this,function(i){return o=this.getRequestCorrelationId(t),this.logger.verbose("loginRedirect called",o),[2,this.acquireTokenRedirect(ae({correlationId:o},t||ky))]})})},e.prototype.loginPopup=function(t){var o=this.getRequestCorrelationId(t);return this.logger.verbose("loginPopup called",o),this.acquireTokenPopup(ae({correlationId:o},t||ky))},e.prototype.acquireTokenSilent=function(t){return D(this,void 0,void 0,function(){var o,i,n,s,a,u,h,p=this;return F(this,function(f){if(o=this.getRequestCorrelationId(t),i=this.performanceClient.startMeasurement($.AcquireTokenSilent,o),i.addStaticFields({cacheLookupPolicy:t.cacheLookupPolicy}),this.preflightBrowserEnvironmentCheck(ne.Silent),this.logger.verbose("acquireTokenSilent called",o),n=t.account||this.getActiveAccount(),!n)throw z.createNoAccountError();return s={clientId:this.config.auth.clientId,authority:t.authority||_.EMPTY_STRING,scopes:t.scopes,homeAccountIdentifier:n.homeAccountId,claims:t.claims,authenticationScheme:t.authenticationScheme,resourceRequestMethod:t.resourceRequestMethod,resourceRequestUri:t.resourceRequestUri,shrClaims:t.shrClaims,sshKid:t.sshKid},a=JSON.stringify(s),u=this.activeSilentTokenRequests.get(a),typeof u>"u"?(this.logger.verbose("acquireTokenSilent called for the first time, storing active request",o),this.performanceClient.setPreQueueTime($.AcquireTokenSilentAsync,o),h=this.acquireTokenSilentAsync(ae(ae({},t),{correlationId:o}),n).then(function(b){return p.activeSilentTokenRequests.delete(a),i.addStaticFields({accessTokenSize:b.accessToken.length,idTokenSize:b.idToken.length}),i.endMeasurement({success:!0,fromCache:b.fromCache,isNativeBroker:b.fromNativeBroker,cacheLookupPolicy:t.cacheLookupPolicy,requestId:b.requestId}),b}).catch(function(b){throw p.activeSilentTokenRequests.delete(a),i.endMeasurement({errorCode:b.errorCode,subErrorCode:b.subError,success:!1}),b}),this.activeSilentTokenRequests.set(a,h),[2,h]):(this.logger.verbose("acquireTokenSilent has been called previously, returning the result from the first call",o),i.discardMeasurement(),[2,u])})})},e.prototype.trackPageVisibility=function(){this.astsAsyncMeasurement&&(this.logger.info("Perf: Visibility change detected"),this.astsAsyncMeasurement.increment({visibilityChangeCount:1}))},e.prototype.acquireTokenSilentAsync=function(t,o){var i;return D(this,void 0,void 0,function(){var n,s,a,u,h,p=this;return F(this,function(f){switch(f.label){case 0:return this.performanceClient.addQueueMeasurement($.AcquireTokenSilentAsync,t.correlationId),this.eventHandler.emitEvent(he.ACQUIRE_TOKEN_START,ne.Silent,t),this.astsAsyncMeasurement=this.performanceClient.startMeasurement($.AcquireTokenSilentAsync,t.correlationId),(i=this.astsAsyncMeasurement)===null||i===void 0||i.increment({visibilityChangeCount:0}),document.addEventListener("visibilitychange",this.trackPageVisibility),ci.isNativeAvailable(this.config,this.logger,this.nativeExtensionProvider,t.authenticationScheme)&&o.nativeAccountId?(this.logger.verbose("acquireTokenSilent - attempting to acquire token from native platform"),s=ae(ae({},t),{account:o}),n=this.acquireTokenNative(s,ct.acquireTokenSilent_silentFlow).catch(function(b){return D(p,void 0,void 0,function(){var C;return F(this,function(S){if(b instanceof Eo&&b.isFatal())return this.logger.verbose("acquireTokenSilent - native platform unavailable, falling back to web flow"),this.nativeExtensionProvider=void 0,C=this.createSilentIframeClient(t.correlationId),[2,C.acquireToken(t)];throw b})})}),[3,3]):[3,1];case 1:return this.logger.verbose("acquireTokenSilent - attempting to acquire token from web flow"),a=this.createSilentCacheClient(t.correlationId),this.performanceClient.setPreQueueTime($.InitializeSilentRequest,t.correlationId),[4,a.initializeSilentRequest(t,o)];case 2:u=f.sent(),h=ae(ae({},t),{cacheLookupPolicy:t.cacheLookupPolicy||oo.Default}),this.performanceClient.setPreQueueTime($.AcquireTokenFromCache,u.correlationId),n=this.acquireTokenFromCache(a,u,h).catch(function(b){if(h.cacheLookupPolicy===oo.AccessToken)throw b;return St.blockReloadInHiddenIframes(),p.eventHandler.emitEvent(he.ACQUIRE_TOKEN_NETWORK_START,ne.Silent,u),p.performanceClient.setPreQueueTime($.AcquireTokenByRefreshToken,u.correlationId),p.acquireTokenByRefreshToken(u,h).catch(function(C){var S=C instanceof eo,R=C instanceof Cr,H=C.errorCode===An.noTokensFoundError.code,ye=C.errorCode===Hr.INVALID_GRANT_ERROR;if((!S||!ye||R||h.cacheLookupPolicy===oo.AccessTokenAndRefreshToken||h.cacheLookupPolicy===oo.RefreshToken)&&h.cacheLookupPolicy!==oo.Skip&&!H)throw C;return p.logger.verbose("Refresh token expired/invalid or CacheLookupPolicy is set to Skip, attempting acquire token by iframe.",t.correlationId),p.performanceClient.setPreQueueTime($.AcquireTokenBySilentIframe,u.correlationId),p.acquireTokenBySilentIframe(u)})}),f.label=3;case 3:return[2,n.then(function(b){var C;return p.eventHandler.emitEvent(he.ACQUIRE_TOKEN_SUCCESS,ne.Silent,b),(C=p.astsAsyncMeasurement)===null||C===void 0||C.endMeasurement({success:!0,fromCache:b.fromCache,isNativeBroker:b.fromNativeBroker,requestId:b.requestId}),b}).catch(function(b){var C;throw p.eventHandler.emitEvent(he.ACQUIRE_TOKEN_FAILURE,ne.Silent,null,b),(C=p.astsAsyncMeasurement)===null||C===void 0||C.endMeasurement({errorCode:b.errorCode,subErrorCode:b.subError,success:!1}),b}).finally(function(){document.removeEventListener("visibilitychange",p.trackPageVisibility)})]}})})},e}(j_);l();c();d();l();c();d();var R9=function(){function r(){}return r.getInteractionStatusFromEvent=function(e,t){switch(e.eventType){case he.LOGIN_START:return Nr.Login;case he.SSO_SILENT_START:return Nr.SsoSilent;case he.ACQUIRE_TOKEN_START:if(e.interactionType===ne.Redirect||e.interactionType===ne.Popup)return Nr.AcquireToken;break;case he.HANDLE_REDIRECT_START:return Nr.HandleRedirect;case he.LOGOUT_START:return Nr.Logout;case he.SSO_SILENT_SUCCESS:case he.SSO_SILENT_FAILURE:if(t&&t!==Nr.SsoSilent)break;return Nr.None;case he.LOGOUT_END:if(t&&t!==Nr.Logout)break;return Nr.None;case he.HANDLE_REDIRECT_END:if(t&&t!==Nr.HandleRedirect)break;return Nr.None;case he.LOGIN_SUCCESS:case he.LOGIN_FAILURE:case he.ACQUIRE_TOKEN_SUCCESS:case he.ACQUIRE_TOKEN_FAILURE:case he.RESTORE_FROM_BFCACHE:if(e.interactionType===ne.Redirect||e.interactionType===ne.Popup){if(t&&t!==Nr.Login&&t!==Nr.AcquireToken)break;return Nr.None}break}return null},r}();l();c();d();var P9=function(){function r(e,t){var o=t&&t.loggerOptions||{};this.logger=new _n(o,Oc,Xi),this.cryptoOps=new Mu(this.logger),this.popTokenGenerator=new ai(this.cryptoOps),this.shrParameters=e}return r.prototype.generatePublicKeyThumbprint=function(){return D(this,void 0,void 0,function(){var e;return F(this,function(t){switch(t.label){case 0:return[4,this.popTokenGenerator.generateKid(this.shrParameters)];case 1:return e=t.sent().kid,[2,e]}})})},r.prototype.signRequest=function(e,t,o){return D(this,void 0,void 0,function(){return F(this,function(i){return[2,this.popTokenGenerator.signPayload(e,t,this.shrParameters,o)]})})},r.prototype.removeKeys=function(e){return D(this,void 0,void 0,function(){return F(this,function(t){switch(t.label){case 0:return[4,this.cryptoOps.removeTokenBindingKey(e)];case 1:return[2,t.sent()]}})})},r}();var Du=function(r,e,t,o){function i(n){return n instanceof t?n:new t(function(s){s(n)})}return new(t||(t=Promise))(function(n,s){function a(p){try{h(o.next(p))}catch(f){s(f)}}function u(p){try{h(o.throw(p))}catch(f){s(f)}}function h(p){p.done?n(p.value):i(p.value).then(a,u)}h((o=o.apply(r,e||[])).next())})},My;(function(r){r.SELECT_ACCOUNT="select_account",r.LOGIN="login",r.CONSENT="consent"})(My||(My={}));var Bf=class extends ja{get publicClientApplication(){return this._publicClientApplication}get name(){return"MgtMsal2Provider"}get isMultiAccountDisabled(){return!this.isMultipleAccountEnabled}set isMultiAccountDisabled(e){this.isMultipleAccountEnabled=!e}get isMultiAccountSupportedAndEnabled(){return this.isMultipleAccountEnabled}get sessionStorageRequestedScopesKey(){return"mgt-requested-scopes"}get sessionStorageDeniedScopesKey(){return"mgt-denied-scopes"}get homeAccountKey(){return"275f3731-e4a4-468a-bf9c-baca24b31e26"}constructor(e){super(),this.isMultipleAccountEnabled=!0,this.handleMsalEvent=t=>{t.eventType==="msal:acquireTokenSuccess"&&"scopes"in t.payload&&(this.approvedScopes=t.payload.scopes)},this.initProvider(e)}initProvider(e){return Du(this,void 0,void 0,function*(){let t=e.options||{auth:{clientId:""}};if(this.ms_config=t,this.ms_config.cache=t.cache||{},this.ms_config.cache.cacheLocation=t.cache.cacheLocation||"localStorage",(typeof this.ms_config.cache.storeAuthStateInCookie>"u"||this.ms_config.cache.storeAuthStateInCookie===null)&&(this.ms_config.cache.storeAuthStateInCookie=!0),this.ms_config.system=t.system||{},this.ms_config.system.iframeHashTimeout=t.system.iframeHashTimeout||1e4,e.authority&&(this.ms_config.auth.authority=e.authority),e.redirectUri&&(this.ms_config.auth.redirectUri=e.redirectUri),"clientId"in e)if(e.clientId)this.ms_config.auth.clientId=e.clientId,this._publicClientApplication=new Oy(this.ms_config);else throw new Error("clientId must be provided");else if("publicClientApplication"in e)if(e.publicClientApplication)this._publicClientApplication=e.publicClientApplication;else throw new Error("publicClientApplication must be provided");else throw new Error("either clientId or publicClientApplication must be provided");this._publicClientApplication.addEventCallback(this.handleMsalEvent),yield this._publicClientApplication.initialize(),this.ms_config.system=t.system||{},this.ms_config.system.iframeHashTimeout=t.system.iframeHashTimeout||1e4,this._loginType=typeof e.loginType<"u"?e.loginType:Xn.Redirect,this._loginHint=typeof e.loginHint<"u"?e.loginHint:null,this._sid=typeof e.sid<"u"?e.sid:null,this.isIncrementalConsentDisabled=typeof e.isIncrementalConsentDisabled<"u"?e.isIncrementalConsentDisabled:!1,this._domainHint=typeof e.domainHint<"u"?e.domainHint:null,this.scopes=typeof e.scopes<"u"?e.scopes:["user.read"],this._prompt=typeof e.prompt<"u"?e.prompt:My.SELECT_ACCOUNT;let o=e;this.isMultipleAccountEnabled=typeof o.isMultiAccountEnabled<"u"?o.isMultiAccountEnabled:!0,this.baseURL=typeof o.baseURL<"u"?o.baseURL:this.baseURL,this.customHosts=o.customHosts,this.graph=C0(this);try{let i=yield this._publicClientApplication.handleRedirectPromise();i!==null?this.handleResponse(i?.account):yield this.trySilentSignIn()}catch(i){throw console.error("\u{1F992}: Problem attempting to sign in",i),i}})}trySilentSignIn(){return Du(this,void 0,void 0,function*(){let e={scopes:this.scopes,domainHint:this._domainHint};if(this._sid||this._loginHint){e.sid=this._sid,e.loginHint=this._loginHint;try{this.setState(ie.Loading);let t=yield this._publicClientApplication.ssoSilent(e);t&&this.handleResponse(t?.account)}catch{this.setState(ie.SignedOut)}}else{let t=this.getAccount();if(t&&(yield this.getAccessToken(null))){this.handleResponse(t);return}this.setState(ie.SignedOut)}})}login(){return Du(this,void 0,void 0,function*(){let e={scopes:this.scopes,loginHint:this._loginHint,prompt:this._prompt,domainHint:this._domainHint};if(this._loginType===Xn.Popup){let t=yield this._publicClientApplication.loginPopup(e);this.handleResponse(t?.account)}else{let t=Object.assign({},e);yield this._publicClientApplication.loginRedirect(t)}})}getAllAccounts(){let e=[];return this._publicClientApplication.getAllAccounts().forEach(t=>{e.push({name:t.name,mail:t.username,id:t.homeAccountId})}),e}setActiveAccount(e){let t=this._publicClientApplication.getAccountByHomeId(e.id),o=this._publicClientApplication.getActiveAccount(),i=this.getStoredAccount();i&&t&&o&&i.homeAccountId===t.homeAccountId&&o.homeAccountId===t.homeAccountId||(this._publicClientApplication.setActiveAccount(t),this.setStoredAccount(),super.setActiveAccount(e))}getActiveAccount(){let e=this._publicClientApplication.getActiveAccount();if(e)return{name:e.name,mail:e.username,id:e.homeAccountId,tenantId:e.tenantId}}handleResponse(e){e!==null?(this.setActiveAccount({name:e.name,id:e.homeAccountId,mail:e.username}),this.setState(ie.SignedIn)):this.setState(ie.SignedOut),this.clearRequestedScopes()}storage(){switch(this.ms_config.cache.cacheLocation){case"localStorage":return window.localStorage;case"sessionStorage":default:return window.sessionStorage}}setStoredAccount(){this.clearStoredAccount(),this.storage().setItem(this.homeAccountKey,this._publicClientApplication.getActiveAccount().homeAccountId)}getStoredAccount(){let e=this.storage().getItem(this.homeAccountKey);return this._publicClientApplication.getAccountByHomeId(e)}clearStoredAccount(){this.storage().removeItem(this.homeAccountKey)}setRequestedScopes(e){e&&sessionStorage.setItem(this.sessionStorageRequestedScopesKey,JSON.stringify(e))}addDeniedScopes(e){if(e){let t=this.getDeniedScopes()||[];t=t.concat(e);let o=t.indexOf("openid");o!==-1&&t.splice(o,1),o=t.indexOf("profile"),o!==-1&&t.splice(o,1),sessionStorage.setItem(this.sessionStorageDeniedScopesKey,JSON.stringify(t))}}getDeniedScopes(){let e=sessionStorage.getItem(this.sessionStorageDeniedScopesKey);return e?JSON.parse(e):null}areScopesDenied(e){if(e){let t=this.getDeniedScopes();if(t&&t.filter(o=>e.indexOf(o)!==-1).length>0)return!0}return!1}clearRequestedScopes(){sessionStorage.removeItem(this.sessionStorageRequestedScopesKey)}getAccount(){let e=this.getStoredAccount();return e||(this._publicClientApplication.getAllAccounts().length>0?this._publicClientApplication.getAllAccounts()[0]:null)}logout(){return Du(this,void 0,void 0,function*(){let t={account:this._publicClientApplication.getActiveAccount()};this.clearStoredAccount(),this._loginType===Xn.Redirect?(this.setState(ie.SignedOut),yield this._publicClientApplication.logoutRedirect(t)):(yield this._publicClientApplication.logoutPopup(Object.assign({},t)),this._publicClientApplication.getAllAccounts.length===1||!this.isMultipleAccountEnabled?this.setState(ie.SignedOut):yield this.trySilentSignIn())})}getAccessToken(e){var t;return Du(this,void 0,void 0,function*(){let o=!((t=e?.scopes)===null||t===void 0)&&t.length?e.scopes:this.scopes,i={scopes:o,account:this.getAccount()};try{let n=i;return(yield this._publicClientApplication.acquireTokenSilent(n)).accessToken}catch(n){if(n instanceof Cr){if(this.isIncrementalConsentDisabled)return null;if(this._loginType===Xn.Redirect)if(!this.areScopesDenied(o))this.setRequestedScopes(o),yield this._publicClientApplication.acquireTokenRedirect(i);else throw n;else try{return(yield this._publicClientApplication.acquireTokenPopup(i)).accessToken}catch(s){throw console.error("\u{1F992}: problem with pop-up sign in",s),s}}else this.setState(ie.SignedOut)}throw null})}};l();c();d();var K_="9aeac104-a6b6-45ca-bb7c-bf7c3083eeb2";var Dy="mgt/setProvider",W_="blank.html";ge();l();c();d();l();c();d();l();c();d();l();c();d();l();c();d();l();c();d();xe();gt();ge();vs();un();l();c();d();xe();var o6=[Oe` +Error Description: `+h.message)),[2,null];case 4:return i||(this.logger.warning("The developer's authority was not found within the CloudInstanceDiscoveryMetadata returned from the network request."),this.logger.verbose("Creating custom Authority for custom domain scenario."),i=r.createCloudDiscoveryMetadataFromHost(this.hostnameAndPort)),[2,i]}})})},r.prototype.getCloudDiscoveryMetadataFromHarcodedValues=function(){return this.canonicalAuthority in gy?gy[this.canonicalAuthority]:null},r.prototype.isInKnownAuthorities=function(){var e=this,t=this.authorityOptions.knownAuthorities.filter(function(o){return Se.getDomainFromUrl(o).toLowerCase()===e.hostnameAndPort});return t.length>0},r.generateAuthority=function(e,t){var o;if(t&&t.azureCloudInstance!==Tn.None){var i=t.tenant?t.tenant:_.DEFAULT_COMMON_TENANT;o=t.azureCloudInstance+"/"+i+"/"}return o||e},r.createCloudDiscoveryMetadataFromHost=function(e){return{preferred_network:e,preferred_cache:e,aliases:[e]}},r.getCloudDiscoveryMetadataFromNetworkResponse=function(e,t){for(var o=0;o-1)return i}return null},r.prototype.getPreferredCache=function(){if(this.discoveryComplete())return this.metadata.preferred_cache;throw U.createEndpointDiscoveryIncompleteError("Discovery incomplete.")},r.prototype.isAlias=function(e){return this.metadata.aliases.indexOf(e)>-1},r.isPublicCloudAuthority=function(e){return _.KNOWN_PUBLIC_CLOUDS.indexOf(e)>=0},r.buildRegionalAuthorityString=function(e,t,o){var i=new Se(e);i.validateAsUri();var n=i.getUrlComponents(),s=t+"."+n.HostNameAndPort;this.isPublicCloudAuthority(n.HostNameAndPort)&&(s=t+"."+_.REGIONAL_AUTH_PUBLIC_CLOUD_SUFFIX);var a=Se.constructAuthorityUriFromObject(rt(rt({},i.getUrlComponents()),{HostNameAndPort:s})).urlString;return o?a+"?"+o:a},r.replaceWithRegionalInformation=function(e,t){return e.authorization_endpoint=r.buildRegionalAuthorityString(e.authorization_endpoint,t),e.token_endpoint=r.buildRegionalAuthorityString(e.token_endpoint,t,_.REGIONAL_AUTH_NON_MSI_QUERY_STRING),e.end_session_endpoint&&(e.end_session_endpoint=r.buildRegionalAuthorityString(e.end_session_endpoint,t)),e},r.transformCIAMAuthority=function(e){var t=e.endsWith(_.FORWARD_SLASH)?e:""+e+_.FORWARD_SLASH,o=new Se(e),i=o.getUrlComponents();if(i.PathSegments.length===0&&i.HostNameAndPort.endsWith(_.CIAM_AUTH_URL)){var n=i.HostNameAndPort.split(".")[0];t=""+t+n+_.AAD_TENANT_DOMAIN_SUFFIX}return t},r.reservedTenantDomains=new Set(["{tenant}","{tenantid}",ls.COMMON,ls.CONSUMERS,ls.ORGANIZATIONS]),r}();l();c();d();var ia=function(){function r(){}return r.createDiscoveredInstance=function(e,t,o,i,n,s,a){return le(this,void 0,void 0,function(){var u,h,p;return ce(this,function(f){switch(f.label){case 0:s?.addQueueMeasurement($.AuthorityFactoryCreateDiscoveredInstance,a),u=fs.transformCIAMAuthority(e),h=r.createInstance(u,t,o,i,n,s,a),f.label=1;case 1:return f.trys.push([1,3,,4]),s?.setPreQueueTime($.AuthorityResolveEndpointsAsync,a),[4,h.resolveEndpointsAsync()];case 2:return f.sent(),[2,h];case 3:throw p=f.sent(),U.createEndpointDiscoveryIncompleteError(p);case 4:return[2]}})})},r.createInstance=function(e,t,o,i,n,s,a){if(z.isEmpty(e))throw je.createUrlEmptyError();return new fs(e,t,o,i,n,s,a)},r}();l();c();d();var wl=function(){function r(){this.failedRequests=[],this.errors=[],this.cacheHits=0}return r.isServerTelemetryEntity=function(e,t){var o=e.indexOf(Ir.CACHE_KEY)===0,i=!0;return t&&(i=t.hasOwnProperty("failedRequests")&&t.hasOwnProperty("errors")&&t.hasOwnProperty("cacheHits")),o&&i},r}();l();c();d();var Af=function(){function r(){}return r.isThrottlingEntity=function(e,t){var o=!1;e&&(o=e.indexOf(ds.THROTTLING_PREFIX)===0);var i=!0;return t&&(i=t.hasOwnProperty("throttleTime")),o&&i},r}();l();c();d();var vy={sendGetRequestAsync:function(){var r="Network interface - sendGetRequestAsync() has not been implemented for the Network interface.";return Promise.reject(ee.createUnexpectedError(r))},sendPostRequestAsync:function(){var r="Network interface - sendPostRequestAsync() has not been implemented for the Network interface.";return Promise.reject(ee.createUnexpectedError(r))}};l();c();d();l();c();d();var Rf={missingKidError:{code:"missing_kid_error",desc:"The JOSE Header for the requested JWT, JWS or JWK object requires a keyId to be configured as the 'kid' header claim. No 'kid' value was provided."},missingAlgError:{code:"missing_alg_error",desc:"The JOSE Header for the requested JWT, JWS or JWK object requires an algorithm to be specified as the 'alg' header claim. No 'alg' value was provided."}},yy=function(r){nt(e,r);function e(t,o){var i=r.call(this,t,o)||this;return i.name="JoseHeaderError",Object.setPrototypeOf(i,e.prototype),i}return e.createMissingKidError=function(){return new e(Rf.missingKidError.code,Rf.missingKidError.desc)},e.createMissingAlgError=function(){return new e(Rf.missingAlgError.code,Rf.missingAlgError.desc)},e}(ee);var by=function(){function r(e){this.typ=e.typ,this.alg=e.alg,this.kid=e.kid}return r.getShrHeaderString=function(e){if(!e.kid)throw yy.createMissingKidError();if(!e.alg)throw yy.createMissingAlgError();var t=new r({typ:e.typ||Sf.Pop,kid:e.kid,alg:e.alg});return JSON.stringify(t)},r}();l();c();d();var E_=function(){function r(e){this.headers=e}return r.prototype.getShrNonce=function(){var e=this.headers[Ft.AuthenticationInfo];if(e){var t=this.parseChallenges(e);if(t.nextnonce)return t.nextnonce;throw je.createInvalidAuthenticationHeaderError(Ft.AuthenticationInfo,"nextnonce challenge is missing.")}var o=this.headers[Ft.WWWAuthenticate];if(o){var i=this.parseChallenges(o);if(i.nonce)return i.nonce;throw je.createInvalidAuthenticationHeaderError(Ft.WWWAuthenticate,"nonce challenge is missing.")}throw je.createMissingNonceAuthenticationHeadersError()},r.prototype.parseChallenges=function(e){var t=e.indexOf(" "),o=e.substr(t+1).split(","),i={};return o.forEach(function(n){var s=n.split("="),a=s[0],u=s[1];i[a]=unescape(u.replace(/['"]+/g,_.EMPTY_STRING))}),i},r}();l();c();d();var wy=function(){function r(e,t){this.cacheOutcome=vo.NO_CACHE_HIT,this.cacheManager=t,this.apiId=e.apiId,this.correlationId=e.correlationId,this.wrapperSKU=e.wrapperSKU||_.EMPTY_STRING,this.wrapperVer=e.wrapperVer||_.EMPTY_STRING,this.telemetryCacheKey=Ir.CACHE_KEY+Lt.CACHE_KEY_SEPARATOR+e.clientId}return r.prototype.generateCurrentRequestHeaderValue=function(){var e=""+this.apiId+Ir.VALUE_SEPARATOR+this.cacheOutcome,t=[this.wrapperSKU,this.wrapperVer].join(Ir.VALUE_SEPARATOR),o=this.getRegionDiscoveryFields(),i=[e,o].join(Ir.VALUE_SEPARATOR);return[Ir.SCHEMA_VERSION,i,t].join(Ir.CATEGORY_SEPARATOR)},r.prototype.generateLastRequestHeaderValue=function(){var e=this.getLastRequests(),t=r.maxErrorsToSend(e),o=e.failedRequests.slice(0,2*t).join(Ir.VALUE_SEPARATOR),i=e.errors.slice(0,t).join(Ir.VALUE_SEPARATOR),n=e.errors.length,s=t=Ir.MAX_CACHED_ERRORS&&(t.failedRequests.shift(),t.failedRequests.shift(),t.errors.shift()),t.failedRequests.push(this.apiId,this.correlationId),z.isEmpty(e.subError)?z.isEmpty(e.errorCode)?e&&e.toString()?t.errors.push(e.toString()):t.errors.push(Ir.UNKNOWN_ERROR):t.errors.push(e.errorCode):t.errors.push(e.subError),this.cacheManager.setServerTelemetry(this.telemetryCacheKey,t)},r.prototype.incrementCacheHits=function(){var e=this.getLastRequests();return e.cacheHits+=1,this.cacheManager.setServerTelemetry(this.telemetryCacheKey,e),e.cacheHits},r.prototype.getLastRequests=function(){var e=new wl,t=this.cacheManager.getServerTelemetry(this.telemetryCacheKey);return t||e},r.prototype.clearTelemetryCache=function(){var e=this.getLastRequests(),t=r.maxErrorsToSend(e),o=e.errors.length;if(t===o)this.cacheManager.removeItem(this.telemetryCacheKey);else{var i=new wl;i.failedRequests=e.failedRequests.slice(t*2),i.errors=e.errors.slice(t),this.cacheManager.setServerTelemetry(this.telemetryCacheKey,i)}},r.maxErrorsToSend=function(e){var t,o=0,i=0,n=e.errors.length;for(t=0;t "+t)},e.createBlockReloadInHiddenIframeError=function(){return new e(q.blockTokenRequestsInHiddenIframeError.code,q.blockTokenRequestsInHiddenIframeError.desc)},e.createBlockAcquireTokenInPopupsError=function(){return new e(q.blockAcquireTokenInPopupsError.code,q.blockAcquireTokenInPopupsError.desc)},e.createIframeClosedPrematurelyError=function(){return new e(q.iframeClosedPrematurelyError.code,q.iframeClosedPrematurelyError.desc)},e.createSilentLogoutUnsupportedError=function(){return new e(q.silentLogoutUnsupportedError.code,q.silentLogoutUnsupportedError.desc)},e.createNoAccountError=function(){return new e(q.noAccountError.code,q.noAccountError.desc)},e.createSilentPromptValueError=function(t){return new e(q.silentPromptValueError.code,q.silentPromptValueError.desc+" Given value: "+t)},e.createUnableToParseTokenRequestCacheError=function(){return new e(q.unableToParseTokenRequestCacheError.code,q.unableToParseTokenRequestCacheError.desc)},e.createNoTokenRequestCacheError=function(){return new e(q.noTokenRequestCacheError.code,q.noTokenRequestCacheError.desc)},e.createAuthRequestNotSetError=function(){return new e(q.authRequestNotSet.code,q.authRequestNotSet.desc)},e.createNoCachedAuthorityError=function(){return new e(q.noCachedAuthorityError.code,q.noCachedAuthorityError.desc)},e.createInvalidCacheTypeError=function(){return new e(q.invalidCacheType.code,""+q.invalidCacheType.desc)},e.createNonBrowserEnvironmentError=function(){return new e(q.notInBrowserEnvironment.code,q.notInBrowserEnvironment.desc)},e.createDatabaseNotOpenError=function(){return new e(q.databaseNotOpen.code,q.databaseNotOpen.desc)},e.createNoNetworkConnectivityError=function(){return new e(q.noNetworkConnectivity.code,q.noNetworkConnectivity.desc)},e.createPostRequestFailedError=function(t,o){return new e(q.postRequestFailed.code,q.postRequestFailed.desc+" | Network client threw: "+t+" | Attempted to reach: "+o.split("?")[0])},e.createGetRequestFailedError=function(t,o){return new e(q.getRequestFailed.code,q.getRequestFailed.desc+" | Network client threw: "+t+" | Attempted to reach: "+o.split("?")[0])},e.createFailedToParseNetworkResponseError=function(t){return new e(q.failedToParseNetworkResponse.code,q.failedToParseNetworkResponse.desc+" | Attempted to reach: "+t.split("?")[0])},e.createUnableToLoadTokenError=function(t){return new e(q.unableToLoadTokenError.code,q.unableToLoadTokenError.desc+" | "+t)},e.createSigningKeyNotFoundInStorageError=function(t){return new e(q.signingKeyNotFoundInStorage.code,q.signingKeyNotFoundInStorage.desc+" | No match found for KeyId: "+t)},e.createAuthCodeRequiredError=function(){return new e(q.authCodeRequired.code,q.authCodeRequired.desc)},e.createAuthCodeOrNativeAccountIdRequiredError=function(){return new e(q.authCodeOrNativeAccountRequired.code,q.authCodeOrNativeAccountRequired.desc)},e.createSpaCodeAndNativeAccountIdPresentError=function(){return new e(q.spaCodeAndNativeAccountPresent.code,q.spaCodeAndNativeAccountPresent.desc)},e.createDatabaseUnavailableError=function(){return new e(q.databaseUnavailable.code,q.databaseUnavailable.desc)},e.createUnableToAcquireTokenFromNativePlatformError=function(){return new e(q.unableToAcquireTokenFromNativePlatform.code,q.unableToAcquireTokenFromNativePlatform.desc)},e.createNativeHandshakeTimeoutError=function(){return new e(q.nativeHandshakeTimeout.code,q.nativeHandshakeTimeout.desc)},e.createNativeExtensionNotInstalledError=function(){return new e(q.nativeExtensionNotInstalled.code,q.nativeExtensionNotInstalled.desc)},e.createNativeConnectionNotEstablishedError=function(){return new e(q.nativeConnectionNotEstablished.code,q.nativeConnectionNotEstablished.desc)},e.createNativeBrokerCalledBeforeInitialize=function(){return new e(q.nativeBrokerCalledBeforeInitialize.code,q.nativeBrokerCalledBeforeInitialize.desc)},e.createNativePromptParameterNotSupportedError=function(){return new e(q.nativePromptNotSupported.code,q.nativePromptNotSupported.desc)},e}(ee);l();c();d();var Hr={INTERACTION_IN_PROGRESS_VALUE:"interaction_in_progress",INVALID_GRANT_ERROR:"invalid_grant",POPUP_WIDTH:483,POPUP_HEIGHT:600,POPUP_NAME_PREFIX:"msal",DEFAULT_POLL_INTERVAL_MS:30,MSAL_SKU:"msal.js.browser"},xl={CHANNEL_ID:"53ee284d-920a-4b59-9d30-a60315b26836",PREFERRED_EXTENSION_ID:"ppnbnpeolgkicgegkbkbjmhlideopiji",MATS_TELEMETRY:"MATS"},Zi;(function(r){r.HandshakeRequest="Handshake",r.HandshakeResponse="HandshakeResponse",r.GetToken="GetToken",r.Response="Response"})(Zi||(Zi={}));var zt;(function(r){r.LocalStorage="localStorage",r.SessionStorage="sessionStorage",r.MemoryStorage="memoryStorage"})(zt||(zt={}));var bi;(function(r){r.GET="GET",r.POST="POST"})(bi||(bi={}));var Ye;(function(r){r.AUTHORITY="authority",r.ACQUIRE_TOKEN_ACCOUNT="acquireToken.account",r.SESSION_STATE="session.state",r.REQUEST_STATE="request.state",r.NONCE_IDTOKEN="nonce.id_token",r.ORIGIN_URI="request.origin",r.RENEW_STATUS="token.renew.status",r.URL_HASH="urlHash",r.REQUEST_PARAMS="request.params",r.SCOPES="scopes",r.INTERACTION_STATUS_KEY="interaction.status",r.CCS_CREDENTIAL="ccs.credential",r.CORRELATION_ID="request.correlationId",r.NATIVE_REQUEST="request.native",r.REDIRECT_CONTEXT="request.redirect.context"})(Ye||(Ye={}));var Ji;(function(r){r.ACCOUNT_KEYS="msal.account.keys",r.TOKEN_KEYS="msal.token.keys"})(Ji||(Ji={}));var Cl;(function(r){r.WRAPPER_SKU="wrapper.sku",r.WRAPPER_VER="wrapper.version"})(Cl||(Cl={}));var ct;(function(r){r[r.acquireTokenRedirect=861]="acquireTokenRedirect",r[r.acquireTokenPopup=862]="acquireTokenPopup",r[r.ssoSilent=863]="ssoSilent",r[r.acquireTokenSilent_authCode=864]="acquireTokenSilent_authCode",r[r.handleRedirectPromise=865]="handleRedirectPromise",r[r.acquireTokenByCode=866]="acquireTokenByCode",r[r.acquireTokenSilent_silentFlow=61]="acquireTokenSilent_silentFlow",r[r.logout=961]="logout",r[r.logoutPopup=962]="logoutPopup"})(ct||(ct={}));var ne;(function(r){r.Redirect="redirect",r.Popup="popup",r.Silent="silent",r.None="none"})(ne||(ne={}));var Nr;(function(r){r.Startup="startup",r.Login="login",r.Logout="logout",r.AcquireToken="acquireToken",r.SsoSilent="ssoSilent",r.HandleRedirect="handleRedirect",r.None="none"})(Nr||(Nr={}));var ky={scopes:Yi},ms="jwk",xy;(function(r){r.React="@azure/msal-react",r.Angular="@azure/msal-angular"})(xy||(xy={}));var Pf="msal.db",A_=1,R_=Pf+".keys",oo;(function(r){r[r.Default=0]="Default",r[r.AccessToken=1]="AccessToken",r[r.AccessTokenAndRefreshToken=2]="AccessTokenAndRefreshToken",r[r.RefreshToken=3]="RefreshToken",r[r.RefreshTokenAndNetwork=4]="RefreshTokenAndNetwork",r[r.Skip=5]="Skip"})(oo||(oo={}));l();c();d();l();c();d();var To={redirectUriNotSet:{code:"redirect_uri_empty",desc:"A redirect URI is required for all calls, and none has been set."},postLogoutUriNotSet:{code:"post_logout_uri_empty",desc:"A post logout redirect has not been set."},storageNotSupportedError:{code:"storage_not_supported",desc:"Given storage configuration option was not supported."},noRedirectCallbacksSet:{code:"no_redirect_callbacks",desc:"No redirect callbacks have been set. Please call setRedirectCallbacks() with the appropriate function arguments before continuing. More information is available here: https://github.com/AzureAD/microsoft-authentication-library-for-js/wiki/MSAL-basics."},invalidCallbackObject:{code:"invalid_callback_object",desc:"The object passed for the callback was invalid. More information is available here: https://github.com/AzureAD/microsoft-authentication-library-for-js/wiki/MSAL-basics."},stubPcaInstanceCalled:{code:"stubbed_public_client_application_called",desc:"Stub instance of Public Client Application was called. If using msal-react, please ensure context is not used without a provider. For more visit: aka.ms/msaljs/browser-errors"},inMemRedirectUnavailable:{code:"in_mem_redirect_unavailable",desc:"Redirect cannot be supported. In-memory storage was selected and storeAuthStateInCookie=false, which would cause the library to be unable to handle the incoming hash. If you would like to use the redirect API, please use session/localStorage or set storeAuthStateInCookie=true."},entropyNotProvided:{code:"entropy_not_provided",desc:"The available browser crypto interface requires entropy set via system.cryptoOptions.entropy configuration option."}},gs=function(r){mt(e,r);function e(t,o){var i=r.call(this,t,o)||this;return i.name="BrowserConfigurationAuthError",Object.setPrototypeOf(i,e.prototype),i}return e.createRedirectUriEmptyError=function(){return new e(To.redirectUriNotSet.code,To.redirectUriNotSet.desc)},e.createPostLogoutRedirectUriEmptyError=function(){return new e(To.postLogoutUriNotSet.code,To.postLogoutUriNotSet.desc)},e.createStorageNotSupportedError=function(t){return new e(To.storageNotSupportedError.code,To.storageNotSupportedError.desc+" Given Location: "+t)},e.createRedirectCallbacksNotSetError=function(){return new e(To.noRedirectCallbacksSet.code,To.noRedirectCallbacksSet.desc)},e.createStubPcaInstanceCalledError=function(){return new e(To.stubPcaInstanceCalled.code,To.stubPcaInstanceCalled.desc)},e.createInMemoryRedirectUnavailableError=function(){return new e(To.inMemRedirectUnavailable.code,To.inMemRedirectUnavailable.desc)},e.createEntropyNotProvided=function(){return new e(To.entropyNotProvided.code,To.entropyNotProvided.desc)},e}(ee);var Sy=function(){function r(e){this.validateWindowStorage(e),this.windowStorage=window[e]}return r.prototype.validateWindowStorage=function(e){if(e!==zt.LocalStorage&&e!==zt.SessionStorage)throw gs.createStorageNotSupportedError(e);var t=!!window[e];if(!t)throw gs.createStorageNotSupportedError(e)},r.prototype.getItem=function(e){return this.windowStorage.getItem(e)},r.prototype.setItem=function(e,t){this.windowStorage.setItem(e,t)},r.prototype.removeItem=function(e){this.windowStorage.removeItem(e)},r.prototype.getKeys=function(){return Object.keys(this.windowStorage)},r.prototype.containsKey=function(e){return this.windowStorage.hasOwnProperty(e)},r}();l();c();d();var Au=function(){function r(){this.cache=new Map}return r.prototype.getItem=function(e){return this.cache.get(e)||null},r.prototype.setItem=function(e,t){this.cache.set(e,t)},r.prototype.removeItem=function(e){this.cache.delete(e)},r.prototype.getKeys=function(){var e=[];return this.cache.forEach(function(t,o){e.push(o)}),e},r.prototype.containsKey=function(e){return this.cache.has(e)},r.prototype.clear=function(){this.cache.clear()},r}();l();c();d();var $f=function(){function r(){}return r.extractBrowserRequestState=function(e,t){if(z.isEmpty(t))return null;try{var o=to.parseRequestState(e,t);return o.libraryState.meta}catch(i){throw U.createInvalidStateError(t,i)}},r.parseServerResponseFromHash=function(e){if(!e)return{};var t=new Se(e);return Se.getDeserializedHash(t.getHash())},r}();var Ru=function(r){mt(e,r);function e(t,o,i,n){var s=r.call(this,t,i,n)||this;return s.COOKIE_LIFE_MULTIPLIER=24*60*60*1e3,s.cacheConfig=o,s.logger=n,s.internalStorage=new Au,s.browserStorage=s.setupBrowserStorage(s.cacheConfig.cacheLocation),s.temporaryCacheStorage=s.setupTemporaryCacheStorage(s.cacheConfig.temporaryCacheLocation,s.cacheConfig.cacheLocation),o.cacheMigrationEnabled&&(s.migrateCacheEntries(),s.createKeyMaps()),s}return e.prototype.setupBrowserStorage=function(t){switch(t){case zt.LocalStorage:case zt.SessionStorage:try{return new Sy(t)}catch(o){this.logger.verbose(o);break}}return this.cacheConfig.cacheLocation=zt.MemoryStorage,new Au},e.prototype.setupTemporaryCacheStorage=function(t,o){switch(o){case zt.LocalStorage:case zt.SessionStorage:try{return new Sy(t||zt.SessionStorage)}catch(i){return this.logger.verbose(i),this.internalStorage}case zt.MemoryStorage:default:return this.internalStorage}},e.prototype.migrateCacheEntries=function(){var t=this,o=_.CACHE_PREFIX+"."+pr.ID_TOKEN,i=_.CACHE_PREFIX+"."+pr.CLIENT_INFO,n=_.CACHE_PREFIX+"."+pr.ERROR,s=_.CACHE_PREFIX+"."+pr.ERROR_DESC,a=this.browserStorage.getItem(o),u=this.browserStorage.getItem(i),h=this.browserStorage.getItem(n),p=this.browserStorage.getItem(s),f=[a,u,h,p],b=[pr.ID_TOKEN,pr.CLIENT_INFO,pr.ERROR,pr.ERROR_DESC];b.forEach(function(C,S){return t.migrateCacheEntry(C,f[S])})},e.prototype.migrateCacheEntry=function(t,o){o&&this.setTemporaryCache(t,o,!0)},e.prototype.createKeyMaps=function(){var t=this;this.logger.trace("BrowserCacheManager - createKeyMaps called.");var o=this.getItem(Ji.ACCOUNT_KEYS),i=this.getItem(Ji.TOKEN_KEYS+"."+this.clientId);if(o&&i){this.logger.verbose("BrowserCacheManager:createKeyMaps - account and token key maps already exist, skipping migration.");return}var n=this.browserStorage.getKeys();n.forEach(function(s){if(t.isCredentialKey(s)){var a=t.getItem(s);if(a){var u=t.validateAndParseJson(a);if(u&&u.hasOwnProperty("credentialType"))switch(u.credentialType){case ue.ID_TOKEN:if(vi.isIdTokenEntity(u)){t.logger.trace("BrowserCacheManager:createKeyMaps - idToken found, saving key to token key map"),t.logger.tracePii("BrowserCacheManager:createKeyMaps - idToken with key: "+s+" found, saving key to token key map");var h=Xr.toObject(new vi,u),p=t.updateCredentialCacheKey(s,h);t.addTokenKey(p,ue.ID_TOKEN);return}else t.logger.trace("BrowserCacheManager:createKeyMaps - key found matching idToken schema with value containing idToken credentialType field but value failed IdTokenEntity validation, skipping."),t.logger.tracePii("BrowserCacheManager:createKeyMaps - failed idToken validation on key: "+s);break;case ue.ACCESS_TOKEN:case ue.ACCESS_TOKEN_WITH_AUTH_SCHEME:if(yi.isAccessTokenEntity(u)){t.logger.trace("BrowserCacheManager:createKeyMaps - accessToken found, saving key to token key map"),t.logger.tracePii("BrowserCacheManager:createKeyMaps - accessToken with key: "+s+" found, saving key to token key map");var f=Xr.toObject(new yi,u),p=t.updateCredentialCacheKey(s,f);t.addTokenKey(p,ue.ACCESS_TOKEN);return}else t.logger.trace("BrowserCacheManager:createKeyMaps - key found matching accessToken schema with value containing accessToken credentialType field but value failed AccessTokenEntity validation, skipping."),t.logger.tracePii("BrowserCacheManager:createKeyMaps - failed accessToken validation on key: "+s);break;case ue.REFRESH_TOKEN:if(In.isRefreshTokenEntity(u)){t.logger.trace("BrowserCacheManager:createKeyMaps - refreshToken found, saving key to token key map"),t.logger.tracePii("BrowserCacheManager:createKeyMaps - refreshToken with key: "+s+" found, saving key to token key map");var b=Xr.toObject(new In,u),p=t.updateCredentialCacheKey(s,b);t.addTokenKey(p,ue.REFRESH_TOKEN);return}else t.logger.trace("BrowserCacheManager:createKeyMaps - key found matching refreshToken schema with value containing refreshToken credentialType field but value failed RefreshTokenEntity validation, skipping."),t.logger.tracePii("BrowserCacheManager:createKeyMaps - failed refreshToken validation on key: "+s);break}}}if(t.isAccountKey(s)){var a=t.getItem(s);if(a){var C=t.validateAndParseJson(a);C&&Nt.isAccountEntity(C)&&(t.logger.trace("BrowserCacheManager:createKeyMaps - account found, saving key to account key map"),t.logger.tracePii("BrowserCacheManager:createKeyMaps - account with key: "+s+" found, saving key to account key map"),t.addAccountKeyToMap(s))}}})},e.prototype.validateAndParseJson=function(t){try{var o=JSON.parse(t);return o&&typeof o=="object"?o:null}catch{return null}},e.prototype.getItem=function(t){return this.browserStorage.getItem(t)},e.prototype.setItem=function(t,o){this.browserStorage.setItem(t,o)},e.prototype.getAccount=function(t){this.logger.trace("BrowserCacheManager.getAccount called");var o=this.getItem(t);if(!o)return this.removeAccountKeyFromMap(t),null;var i=this.validateAndParseJson(o);return!i||!Nt.isAccountEntity(i)?(this.removeAccountKeyFromMap(t),null):Xr.toObject(new Nt,i)},e.prototype.setAccount=function(t){this.logger.trace("BrowserCacheManager.setAccount called");var o=t.generateAccountKey();this.setItem(o,JSON.stringify(t)),this.addAccountKeyToMap(o)},e.prototype.getAccountKeys=function(){this.logger.trace("BrowserCacheManager.getAccountKeys called");var t=this.getItem(Ji.ACCOUNT_KEYS);return t?JSON.parse(t):(this.logger.verbose("BrowserCacheManager.getAccountKeys - No account keys found"),[])},e.prototype.addAccountKeyToMap=function(t){this.logger.trace("BrowserCacheManager.addAccountKeyToMap called"),this.logger.tracePii("BrowserCacheManager.addAccountKeyToMap called with key: "+t);var o=this.getAccountKeys();o.indexOf(t)===-1?(o.push(t),this.setItem(Ji.ACCOUNT_KEYS,JSON.stringify(o)),this.logger.verbose("BrowserCacheManager.addAccountKeyToMap account key added")):this.logger.verbose("BrowserCacheManager.addAccountKeyToMap account key already exists in map")},e.prototype.removeAccountKeyFromMap=function(t){this.logger.trace("BrowserCacheManager.removeAccountKeyFromMap called"),this.logger.tracePii("BrowserCacheManager.removeAccountKeyFromMap called with key: "+t);var o=this.getAccountKeys(),i=o.indexOf(t);i>-1?(o.splice(i,1),this.setItem(Ji.ACCOUNT_KEYS,JSON.stringify(o)),this.logger.trace("BrowserCacheManager.removeAccountKeyFromMap account key removed")):this.logger.trace("BrowserCacheManager.removeAccountKeyFromMap key not found in existing map")},e.prototype.removeAccount=function(t){return D(this,void 0,void 0,function(){return F(this,function(o){return r.prototype.removeAccount.call(this,t),this.removeAccountKeyFromMap(t),[2]})})},e.prototype.removeIdToken=function(t){r.prototype.removeIdToken.call(this,t),this.removeTokenKey(t,ue.ID_TOKEN)},e.prototype.removeAccessToken=function(t){return D(this,void 0,void 0,function(){return F(this,function(o){return r.prototype.removeAccessToken.call(this,t),this.removeTokenKey(t,ue.ACCESS_TOKEN),[2]})})},e.prototype.removeRefreshToken=function(t){r.prototype.removeRefreshToken.call(this,t),this.removeTokenKey(t,ue.REFRESH_TOKEN)},e.prototype.getTokenKeys=function(){this.logger.trace("BrowserCacheManager.getTokenKeys called");var t=this.getItem(Ji.TOKEN_KEYS+"."+this.clientId);if(t){var o=this.validateAndParseJson(t);if(o&&o.hasOwnProperty("idToken")&&o.hasOwnProperty("accessToken")&&o.hasOwnProperty("refreshToken"))return o;this.logger.error("BrowserCacheManager.getTokenKeys - Token keys found but in an unknown format. Returning empty key map.")}else this.logger.verbose("BrowserCacheManager.getTokenKeys - No token keys found");return{idToken:[],accessToken:[],refreshToken:[]}},e.prototype.addTokenKey=function(t,o){this.logger.trace("BrowserCacheManager addTokenKey called");var i=this.getTokenKeys();switch(o){case ue.ID_TOKEN:i.idToken.indexOf(t)===-1&&(this.logger.info("BrowserCacheManager: addTokenKey - idToken added to map"),i.idToken.push(t));break;case ue.ACCESS_TOKEN:i.accessToken.indexOf(t)===-1&&(this.logger.info("BrowserCacheManager: addTokenKey - accessToken added to map"),i.accessToken.push(t));break;case ue.REFRESH_TOKEN:i.refreshToken.indexOf(t)===-1&&(this.logger.info("BrowserCacheManager: addTokenKey - refreshToken added to map"),i.refreshToken.push(t));break;default:this.logger.error("BrowserCacheManager:addTokenKey - CredentialType provided invalid. CredentialType: "+o),U.createUnexpectedCredentialTypeError()}this.setItem(Ji.TOKEN_KEYS+"."+this.clientId,JSON.stringify(i))},e.prototype.removeTokenKey=function(t,o){this.logger.trace("BrowserCacheManager removeTokenKey called");var i=this.getTokenKeys();switch(o){case ue.ID_TOKEN:this.logger.infoPii("BrowserCacheManager: removeTokenKey - attempting to remove idToken with key: "+t+" from map");var n=i.idToken.indexOf(t);n>-1?(this.logger.info("BrowserCacheManager: removeTokenKey - idToken removed from map"),i.idToken.splice(n,1)):this.logger.info("BrowserCacheManager: removeTokenKey - idToken does not exist in map. Either it was previously removed or it was never added.");break;case ue.ACCESS_TOKEN:this.logger.infoPii("BrowserCacheManager: removeTokenKey - attempting to remove accessToken with key: "+t+" from map");var s=i.accessToken.indexOf(t);s>-1?(this.logger.info("BrowserCacheManager: removeTokenKey - accessToken removed from map"),i.accessToken.splice(s,1)):this.logger.info("BrowserCacheManager: removeTokenKey - accessToken does not exist in map. Either it was previously removed or it was never added.");break;case ue.REFRESH_TOKEN:this.logger.infoPii("BrowserCacheManager: removeTokenKey - attempting to remove refreshToken with key: "+t+" from map");var a=i.refreshToken.indexOf(t);a>-1?(this.logger.info("BrowserCacheManager: removeTokenKey - refreshToken removed from map"),i.refreshToken.splice(a,1)):this.logger.info("BrowserCacheManager: removeTokenKey - refreshToken does not exist in map. Either it was previously removed or it was never added.");break;default:this.logger.error("BrowserCacheManager:removeTokenKey - CredentialType provided invalid. CredentialType: "+o),U.createUnexpectedCredentialTypeError()}this.setItem(Ji.TOKEN_KEYS+"."+this.clientId,JSON.stringify(i))},e.prototype.getIdTokenCredential=function(t){var o=this.getItem(t);if(!o)return this.logger.trace("BrowserCacheManager.getIdTokenCredential: called, no cache hit"),this.removeTokenKey(t,ue.ID_TOKEN),null;var i=this.validateAndParseJson(o);return!i||!vi.isIdTokenEntity(i)?(this.logger.trace("BrowserCacheManager.getIdTokenCredential: called, no cache hit"),this.removeTokenKey(t,ue.ID_TOKEN),null):(this.logger.trace("BrowserCacheManager.getIdTokenCredential: cache hit"),Xr.toObject(new vi,i))},e.prototype.setIdTokenCredential=function(t){this.logger.trace("BrowserCacheManager.setIdTokenCredential called");var o=t.generateCredentialKey();this.setItem(o,JSON.stringify(t)),this.addTokenKey(o,ue.ID_TOKEN)},e.prototype.getAccessTokenCredential=function(t){var o=this.getItem(t);if(!o)return this.logger.trace("BrowserCacheManager.getAccessTokenCredential: called, no cache hit"),this.removeTokenKey(t,ue.ACCESS_TOKEN),null;var i=this.validateAndParseJson(o);return!i||!yi.isAccessTokenEntity(i)?(this.logger.trace("BrowserCacheManager.getAccessTokenCredential: called, no cache hit"),this.removeTokenKey(t,ue.ACCESS_TOKEN),null):(this.logger.trace("BrowserCacheManager.getAccessTokenCredential: cache hit"),Xr.toObject(new yi,i))},e.prototype.setAccessTokenCredential=function(t){this.logger.trace("BrowserCacheManager.setAccessTokenCredential called");var o=t.generateCredentialKey();this.setItem(o,JSON.stringify(t)),this.addTokenKey(o,ue.ACCESS_TOKEN)},e.prototype.getRefreshTokenCredential=function(t){var o=this.getItem(t);if(!o)return this.logger.trace("BrowserCacheManager.getRefreshTokenCredential: called, no cache hit"),this.removeTokenKey(t,ue.REFRESH_TOKEN),null;var i=this.validateAndParseJson(o);return!i||!In.isRefreshTokenEntity(i)?(this.logger.trace("BrowserCacheManager.getRefreshTokenCredential: called, no cache hit"),this.removeTokenKey(t,ue.REFRESH_TOKEN),null):(this.logger.trace("BrowserCacheManager.getRefreshTokenCredential: cache hit"),Xr.toObject(new In,i))},e.prototype.setRefreshTokenCredential=function(t){this.logger.trace("BrowserCacheManager.setRefreshTokenCredential called");var o=t.generateCredentialKey();this.setItem(o,JSON.stringify(t)),this.addTokenKey(o,ue.REFRESH_TOKEN)},e.prototype.getAppMetadata=function(t){var o=this.getItem(t);if(!o)return this.logger.trace("BrowserCacheManager.getAppMetadata: called, no cache hit"),null;var i=this.validateAndParseJson(o);return!i||!Pc.isAppMetadataEntity(t,i)?(this.logger.trace("BrowserCacheManager.getAppMetadata: called, no cache hit"),null):(this.logger.trace("BrowserCacheManager.getAppMetadata: cache hit"),Xr.toObject(new Pc,i))},e.prototype.setAppMetadata=function(t){this.logger.trace("BrowserCacheManager.setAppMetadata called");var o=t.generateAppMetadataKey();this.setItem(o,JSON.stringify(t))},e.prototype.getServerTelemetry=function(t){var o=this.getItem(t);if(!o)return this.logger.trace("BrowserCacheManager.getServerTelemetry: called, no cache hit"),null;var i=this.validateAndParseJson(o);return!i||!wl.isServerTelemetryEntity(t,i)?(this.logger.trace("BrowserCacheManager.getServerTelemetry: called, no cache hit"),null):(this.logger.trace("BrowserCacheManager.getServerTelemetry: cache hit"),Xr.toObject(new wl,i))},e.prototype.setServerTelemetry=function(t,o){this.logger.trace("BrowserCacheManager.setServerTelemetry called"),this.setItem(t,JSON.stringify(o))},e.prototype.getAuthorityMetadata=function(t){var o=this.internalStorage.getItem(t);if(!o)return this.logger.trace("BrowserCacheManager.getAuthorityMetadata: called, no cache hit"),null;var i=this.validateAndParseJson(o);return i&&$c.isAuthorityMetadataEntity(t,i)?(this.logger.trace("BrowserCacheManager.getAuthorityMetadata: cache hit"),Xr.toObject(new $c,i)):null},e.prototype.getAuthorityMetadataKeys=function(){var t=this,o=this.internalStorage.getKeys();return o.filter(function(i){return t.isAuthorityMetadata(i)})},e.prototype.setWrapperMetadata=function(t,o){this.internalStorage.setItem(Cl.WRAPPER_SKU,t),this.internalStorage.setItem(Cl.WRAPPER_VER,o)},e.prototype.getWrapperMetadata=function(){var t=this.internalStorage.getItem(Cl.WRAPPER_SKU)||_.EMPTY_STRING,o=this.internalStorage.getItem(Cl.WRAPPER_VER)||_.EMPTY_STRING;return[t,o]},e.prototype.setAuthorityMetadata=function(t,o){this.logger.trace("BrowserCacheManager.setAuthorityMetadata called"),this.internalStorage.setItem(t,JSON.stringify(o))},e.prototype.getActiveAccount=function(){var t=this.generateCacheKey(pr.ACTIVE_ACCOUNT_FILTERS),o=this.getItem(t);if(!o){this.logger.trace("BrowserCacheManager.getActiveAccount: No active account filters cache schema found, looking for legacy schema");var i=this.generateCacheKey(pr.ACTIVE_ACCOUNT),n=this.getItem(i);if(!n)return this.logger.trace("BrowserCacheManager.getActiveAccount: No active account found"),null;var s=this.getAccountInfoByFilter({localAccountId:n})[0]||null;return s?(this.logger.trace("BrowserCacheManager.getActiveAccount: Legacy active account cache schema found"),this.logger.trace("BrowserCacheManager.getActiveAccount: Adding active account filters cache schema"),this.setActiveAccount(s),s):null}var a=this.validateAndParseJson(o);return a?(this.logger.trace("BrowserCacheManager.getActiveAccount: Active account filters schema found"),this.getAccountInfoByFilter({homeAccountId:a.homeAccountId,localAccountId:a.localAccountId})[0]||null):(this.logger.trace("BrowserCacheManager.getActiveAccount: No active account found"),null)},e.prototype.setActiveAccount=function(t){var o=this.generateCacheKey(pr.ACTIVE_ACCOUNT_FILTERS),i=this.generateCacheKey(pr.ACTIVE_ACCOUNT);if(t){this.logger.verbose("setActiveAccount: Active account set");var n={homeAccountId:t.homeAccountId,localAccountId:t.localAccountId};this.browserStorage.setItem(o,JSON.stringify(n)),this.browserStorage.setItem(i,t.localAccountId)}else this.logger.verbose("setActiveAccount: No account passed, active account not set"),this.browserStorage.removeItem(o),this.browserStorage.removeItem(i)},e.prototype.getAccountInfoByFilter=function(t){var o=this.getAllAccounts();return this.logger.trace("BrowserCacheManager.getAccountInfoByFilter: total "+o.length+" accounts found"),o.filter(function(i){return!(t.username&&t.username.toLowerCase()!==i.username.toLowerCase()||t.homeAccountId&&t.homeAccountId!==i.homeAccountId||t.localAccountId&&t.localAccountId!==i.localAccountId||t.tenantId&&t.tenantId!==i.tenantId||t.environment&&t.environment!==i.environment)})},e.prototype.getAccountInfoByHints=function(t,o){var i=this.getAllAccounts().filter(function(n){if(o){var s=n.idTokenClaims&&n.idTokenClaims.sid;return o===s}return t?t===n.username:!1});if(i.length===1)return i[0];if(i.length>1)throw U.createMultipleMatchingAccountsInCacheError();return null},e.prototype.getThrottlingCache=function(t){var o=this.getItem(t);if(!o)return this.logger.trace("BrowserCacheManager.getThrottlingCache: called, no cache hit"),null;var i=this.validateAndParseJson(o);return!i||!Af.isThrottlingEntity(t,i)?(this.logger.trace("BrowserCacheManager.getThrottlingCache: called, no cache hit"),null):(this.logger.trace("BrowserCacheManager.getThrottlingCache: cache hit"),Xr.toObject(new Af,i))},e.prototype.setThrottlingCache=function(t,o){this.logger.trace("BrowserCacheManager.setThrottlingCache called"),this.setItem(t,JSON.stringify(o))},e.prototype.getTemporaryCache=function(t,o){var i=o?this.generateCacheKey(t):t;if(this.cacheConfig.storeAuthStateInCookie){var n=this.getItemCookie(i);if(n)return this.logger.trace("BrowserCacheManager.getTemporaryCache: storeAuthStateInCookies set to true, retrieving from cookies"),n}var s=this.temporaryCacheStorage.getItem(i);if(!s){if(this.cacheConfig.cacheLocation===zt.LocalStorage){var a=this.browserStorage.getItem(i);if(a)return this.logger.trace("BrowserCacheManager.getTemporaryCache: Temporary cache item found in local storage"),a}return this.logger.trace("BrowserCacheManager.getTemporaryCache: No cache item found in local storage"),null}return this.logger.trace("BrowserCacheManager.getTemporaryCache: Temporary cache item returned"),s},e.prototype.setTemporaryCache=function(t,o,i){var n=i?this.generateCacheKey(t):t;this.temporaryCacheStorage.setItem(n,o),this.cacheConfig.storeAuthStateInCookie&&(this.logger.trace("BrowserCacheManager.setTemporaryCache: storeAuthStateInCookie set to true, setting item cookie"),this.setItemCookie(n,o))},e.prototype.removeItem=function(t){this.browserStorage.removeItem(t),this.temporaryCacheStorage.removeItem(t),this.cacheConfig.storeAuthStateInCookie&&(this.logger.trace("BrowserCacheManager.removeItem: storeAuthStateInCookie is true, clearing item cookie"),this.clearItemCookie(t))},e.prototype.containsKey=function(t){return this.browserStorage.containsKey(t)||this.temporaryCacheStorage.containsKey(t)},e.prototype.getKeys=function(){return Tc(this.browserStorage.getKeys(),this.temporaryCacheStorage.getKeys())},e.prototype.clear=function(){return D(this,void 0,void 0,function(){var t=this;return F(this,function(o){switch(o.label){case 0:return[4,this.removeAllAccounts()];case 1:return o.sent(),this.removeAppMetadata(),this.getKeys().forEach(function(i){(t.browserStorage.containsKey(i)||t.temporaryCacheStorage.containsKey(i))&&(i.indexOf(_.CACHE_PREFIX)!==-1||i.indexOf(t.clientId)!==-1)&&t.removeItem(i)}),this.internalStorage.clear(),[2]}})})},e.prototype.clearTokensAndKeysWithClaims=function(){return D(this,void 0,void 0,function(){var t,o,i=this;return F(this,function(n){switch(n.label){case 0:return this.logger.trace("BrowserCacheManager.clearTokensAndKeysWithClaims called"),t=this.getTokenKeys(),o=[],t.accessToken.forEach(function(s){var a=i.getAccessTokenCredential(s);a?.requestedClaimsHash&&s.includes(a.requestedClaimsHash.toLowerCase())&&o.push(i.removeAccessToken(s))}),[4,Promise.all(o)];case 1:return n.sent(),o.length>0&&this.logger.warning(o.length+" access tokens with claims in the cache keys have been removed from the cache."),[2]}})})},e.prototype.setItemCookie=function(t,o,i){var n=encodeURIComponent(t)+"="+encodeURIComponent(o)+";path=/;SameSite=Lax;";if(i){var s=this.getCookieExpirationTime(i);n+="expires="+s+";"}this.cacheConfig.secureCookies&&(n+="Secure;"),document.cookie=n},e.prototype.getItemCookie=function(t){for(var o=encodeURIComponent(t)+"=",i=document.cookie.split(";"),n=0;n=300)&&(t===bi.POST?s(B.createPostRequestFailedError("Failed with status "+a.status,e)):s(B.createGetRequestFailedError("Failed with status "+a.status,e)));try{var u=JSON.parse(a.responseText),h={headers:i.getHeaderDict(a),body:u,status:a.status};n(h)}catch{s(B.createFailedToParseNetworkResponseError(e))}},a.onerror=function(){window.navigator.onLine?t===bi.POST?s(B.createPostRequestFailedError("Failed with status "+a.status,e)):s(B.createGetRequestFailedError("Failed with status "+a.status,e)):s(B.createNoNetworkConnectivityError())},t===bi.POST&&o&&o.body)a.send(o.body);else if(t===bi.GET)a.send();else throw B.createHttpMethodNotImplementedError(t)})},r.prototype.setXhrHeaders=function(e,t){if(t&&t.headers){var o=t.headers;Object.keys(o).forEach(function(i){e.setRequestHeader(i,o[i])})}},r.prototype.getHeaderDict=function(e){var t=e.getAllResponseHeaders(),o=t.trim().split(/[\r\n]+/),i={};return o.forEach(function(n){var s=n.split(": "),a=s.shift(),u=s.join(": ");a&&u&&(i[a]=u)}),i},r}();var St=function(){function r(){}return r.clearHash=function(e){e.location.hash=_.EMPTY_STRING,typeof e.history.replaceState=="function"&&e.history.replaceState(null,_.EMPTY_STRING,""+e.location.origin+e.location.pathname+e.location.search)},r.replaceHash=function(e){var t=e.split("#");t.shift(),window.location.hash=t.length>0?t.join("#"):_.EMPTY_STRING},r.isInIframe=function(){return window.parent!==window},r.isInPopup=function(){return typeof window<"u"&&!!window.opener&&window.opener!==window&&typeof window.name=="string"&&window.name.indexOf(Hr.POPUP_NAME_PREFIX+".")===0},r.getCurrentUri=function(){return window.location.href.split("?")[0].split("#")[0]},r.getHomepage=function(){var e=new Se(window.location.href),t=e.getUrlComponents();return t.Protocol+"//"+t.HostNameAndPort+"/"},r.getBrowserNetworkClient=function(){return window.fetch&&window.Headers?new $_:new O_},r.blockReloadInHiddenIframes=function(){var e=Se.hashContainsKnownProperties(window.location.hash);if(e&&r.isInIframe())throw B.createBlockReloadInHiddenIframeError()},r.blockRedirectInIframe=function(e,t){var o=r.isInIframe();if(e===ne.Redirect&&o&&!t)throw B.createRedirectInIframeError(o)},r.blockAcquireTokenInPopups=function(){if(r.isInPopup())throw B.createBlockAcquireTokenInPopupsError()},r.blockNonBrowserEnvironment=function(e){if(!e)throw B.createNonBrowserEnvironmentError()},r.blockNativeBrokerCalledBeforeInitialized=function(e,t){if(e&&!t)throw B.createNativeBrokerCalledBeforeInitialize()},r.detectIEOrEdge=function(){var e=window.navigator.userAgent,t=e.indexOf("MSIE "),o=e.indexOf("Trident/"),i=e.indexOf("Edge/"),n=t>0||o>0,s=i>0;return n||s},r}();var Of=function(){function r(e,t,o,i,n,s,a,u,h){this.config=e,this.browserStorage=t,this.browserCrypto=o,this.networkClient=this.config.system.networkClient,this.eventHandler=n,this.navigationClient=s,this.nativeMessageHandler=u,this.correlationId=h||this.browserCrypto.createNewGuid(),this.logger=i.clone(Hr.MSAL_SKU,Xi,this.correlationId),this.performanceClient=a}return r.prototype.clearCacheOnLogout=function(e){return D(this,void 0,void 0,function(){return F(this,function(t){switch(t.label){case 0:if(!e)return[3,5];Nt.accountInfoIsEqual(e,this.browserStorage.getActiveAccount(),!1)&&(this.logger.verbose("Setting active account to null"),this.browserStorage.setActiveAccount(null)),t.label=1;case 1:return t.trys.push([1,3,,4]),[4,this.browserStorage.removeAccount(Nt.generateAccountCacheKey(e))];case 2:return t.sent(),this.logger.verbose("Cleared cache items belonging to the account provided in the logout request."),[3,4];case 3:return t.sent(),this.logger.error("Account provided in logout request was not found. Local cache unchanged."),[3,4];case 4:return[3,9];case 5:return t.trys.push([5,8,,9]),this.logger.verbose("No account provided in logout request, clearing all cache items.",this.correlationId),[4,this.browserStorage.clear()];case 6:return t.sent(),[4,this.browserCrypto.clearKeystore()];case 7:return t.sent(),[3,9];case 8:return t.sent(),this.logger.error("Attempted to clear all MSAL cache items and failed. Local cache unchanged."),[3,9];case 9:return[2]}})})},r.prototype.initializeBaseRequest=function(e,t){return D(this,void 0,void 0,function(){var o,i,n,s;return F(this,function(a){switch(a.label){case 0:return this.performanceClient.addQueueMeasurement($.InitializeBaseRequest,e.correlationId),this.logger.verbose("Initializing BaseAuthRequest"),o=e.authority||this.config.auth.authority,t?[4,this.validateRequestAuthority(o,t)]:[3,2];case 1:a.sent(),a.label=2;case 2:if(i=Tc(e&&e.scopes||[]),n=ae(ae({},e),{correlationId:this.correlationId,authority:o,scopes:i}),!n.authenticationScheme)n.authenticationScheme=Be.BEARER,this.logger.verbose(`Authentication Scheme wasn't explicitly set in request, defaulting to "Bearer" request`);else{if(n.authenticationScheme===Be.SSH){if(!e.sshJwk)throw je.createMissingSshJwkError();if(!e.sshKid)throw je.createMissingSshKidError()}this.logger.verbose('Authentication Scheme set to "'+n.authenticationScheme+'" as configured in Auth request')}return this.config.cache.claimsBasedCachingEnabled&&e.claims&&!z.isEmptyObj(e.claims)?(s=n,[4,this.browserCrypto.hashString(e.claims)]):[3,4];case 3:s.requestedClaimsHash=a.sent(),a.label=4;case 4:return[2,n]}})})},r.prototype.getRedirectUri=function(e){this.logger.verbose("getRedirectUri called");var t=e||this.config.auth.redirectUri||St.getCurrentUri();return Se.getAbsoluteUrl(t,St.getCurrentUri())},r.prototype.validateRequestAuthority=function(e,t){return D(this,void 0,void 0,function(){var o;return F(this,function(i){switch(i.label){case 0:return[4,this.getDiscoveredAuthority(e)];case 1:if(o=i.sent(),!o.isAlias(t.environment))throw je.createAuthorityMismatchError();return[2]}})})},r.prototype.initializeServerTelemetryManager=function(e,t){this.logger.verbose("initializeServerTelemetryManager called");var o={clientId:this.config.auth.clientId,correlationId:this.correlationId,apiId:e,forceRefresh:t||!1,wrapperSKU:this.browserStorage.getWrapperMetadata()[0],wrapperVer:this.browserStorage.getWrapperMetadata()[1]};return new wy(o,this.browserStorage)},r.prototype.getDiscoveredAuthority=function(e){return D(this,void 0,void 0,function(){var t;return F(this,function(o){switch(o.label){case 0:return this.logger.verbose("getDiscoveredAuthority called"),t={protocolMode:this.config.auth.protocolMode,knownAuthorities:this.config.auth.knownAuthorities,cloudDiscoveryMetadata:this.config.auth.cloudDiscoveryMetadata,authorityMetadata:this.config.auth.authorityMetadata},e?(this.logger.verbose("Creating discovered authority with request authority"),[4,ia.createDiscoveredInstance(e,this.config.system.networkClient,this.browserStorage,t,this.logger)]):[3,2];case 1:return[2,o.sent()];case 2:return this.logger.verbose("Creating discovered authority with configured authority"),[4,ia.createDiscoveredInstance(this.config.auth.authority,this.config.system.networkClient,this.browserStorage,t,this.logger)];case 3:return[2,o.sent()]}})})},r}();var li=function(r){mt(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.initializeAuthorizationCodeRequest=function(t){return D(this,void 0,void 0,function(){var o,i;return F(this,function(n){switch(n.label){case 0:return this.performanceClient.addQueueMeasurement($.StandardInteractionClientInitializeAuthorizationCodeRequest,t.correlationId),this.logger.verbose("initializeAuthorizationRequest called",t.correlationId),[4,this.browserCrypto.generatePkceCodes()];case 1:return o=n.sent(),i=ae(ae({},t),{redirectUri:t.redirectUri,code:_.EMPTY_STRING,codeVerifier:o.verifier}),t.codeChallenge=o.challenge,t.codeChallengeMethod=_.S256_CODE_CHALLENGE_METHOD,[2,i]}})})},e.prototype.initializeLogoutRequest=function(t){this.logger.verbose("initializeLogoutRequest called",t?.correlationId);var o=ae({correlationId:this.correlationId||this.browserCrypto.createNewGuid()},t);if(t)if(t.logoutHint)this.logger.verbose("logoutHint has already been set in logoutRequest");else if(t.account){var i=this.getLogoutHintFromIdTokenClaims(t.account);i&&(this.logger.verbose("Setting logoutHint to login_hint ID Token Claim value for the account provided"),o.logoutHint=i)}else this.logger.verbose("logoutHint was not set and account was not passed into logout request, logoutHint will not be set");else this.logger.verbose("logoutHint will not be set since no logout request was configured");return!t||t.postLogoutRedirectUri!==null?t&&t.postLogoutRedirectUri?(this.logger.verbose("Setting postLogoutRedirectUri to uri set on logout request",o.correlationId),o.postLogoutRedirectUri=Se.getAbsoluteUrl(t.postLogoutRedirectUri,St.getCurrentUri())):this.config.auth.postLogoutRedirectUri===null?this.logger.verbose("postLogoutRedirectUri configured as null and no uri set on request, not passing post logout redirect",o.correlationId):this.config.auth.postLogoutRedirectUri?(this.logger.verbose("Setting postLogoutRedirectUri to configured uri",o.correlationId),o.postLogoutRedirectUri=Se.getAbsoluteUrl(this.config.auth.postLogoutRedirectUri,St.getCurrentUri())):(this.logger.verbose("Setting postLogoutRedirectUri to current page",o.correlationId),o.postLogoutRedirectUri=Se.getAbsoluteUrl(St.getCurrentUri(),St.getCurrentUri())):this.logger.verbose("postLogoutRedirectUri passed as null, not setting post logout redirect uri",o.correlationId),o},e.prototype.getLogoutHintFromIdTokenClaims=function(t){var o=t.idTokenClaims;if(o){if(o.login_hint)return o.login_hint;this.logger.verbose("The ID Token Claims tied to the provided account do not contain a login_hint claim, logoutHint will not be added to logout request")}else this.logger.verbose("The provided account does not contain ID Token Claims, logoutHint will not be added to logout request");return null},e.prototype.createAuthCodeClient=function(t,o,i){return D(this,void 0,void 0,function(){var n;return F(this,function(s){switch(s.label){case 0:return this.performanceClient.addQueueMeasurement($.StandardInteractionClientCreateAuthCodeClient,this.correlationId),this.performanceClient.setPreQueueTime($.StandardInteractionClientGetClientConfiguration,this.correlationId),[4,this.getClientConfiguration(t,o,i)];case 1:return n=s.sent(),[2,new Tu(n,this.performanceClient)]}})})},e.prototype.getClientConfiguration=function(t,o,i){return D(this,void 0,void 0,function(){var n,s;return F(this,function(a){switch(a.label){case 0:return this.performanceClient.addQueueMeasurement($.StandardInteractionClientGetClientConfiguration,this.correlationId),this.logger.verbose("getClientConfiguration called",this.correlationId),this.performanceClient.setPreQueueTime($.StandardInteractionClientGetDiscoveredAuthority,this.correlationId),[4,this.getDiscoveredAuthority(o,i)];case 1:return n=a.sent(),s=this.config.system.loggerOptions,[2,{authOptions:{clientId:this.config.auth.clientId,authority:n,clientCapabilities:this.config.auth.clientCapabilities},systemOptions:{tokenRenewalOffsetSeconds:this.config.system.tokenRenewalOffsetSeconds,preventCorsPreflight:!0},loggerOptions:{loggerCallback:s.loggerCallback,piiLoggingEnabled:s.piiLoggingEnabled,logLevel:s.logLevel,correlationId:this.correlationId},cacheOptions:{claimsBasedCachingEnabled:this.config.cache.claimsBasedCachingEnabled},cryptoInterface:this.browserCrypto,networkInterface:this.networkClient,storageInterface:this.browserStorage,serverTelemetryManager:t,libraryInfo:{sku:Hr.MSAL_SKU,version:Xi,cpu:_.EMPTY_STRING,os:_.EMPTY_STRING},telemetry:this.config.telemetry}]}})})},e.prototype.validateAndExtractStateFromHash=function(t,o,i){if(this.logger.verbose("validateAndExtractStateFromHash called",i),!t.state)throw B.createHashDoesNotContainStateError();var n=$f.extractBrowserRequestState(this.browserCrypto,t.state);if(!n)throw B.createUnableToParseStateError();if(n.interactionType!==o)throw B.createStateInteractionTypeMismatchError();return this.logger.verbose("Returning state from hash",i),t.state},e.prototype.getDiscoveredAuthority=function(t,o){var i;return D(this,void 0,void 0,function(){var n,s,a,u;return F(this,function(h){switch(h.label){case 0:return this.performanceClient.addQueueMeasurement($.StandardInteractionClientGetDiscoveredAuthority,this.correlationId),this.logger.verbose("getDiscoveredAuthority called",this.correlationId),n=(i=this.performanceClient)===null||i===void 0?void 0:i.startMeasurement($.StandardInteractionClientGetDiscoveredAuthority,this.correlationId),s={protocolMode:this.config.auth.protocolMode,knownAuthorities:this.config.auth.knownAuthorities,cloudDiscoveryMetadata:this.config.auth.cloudDiscoveryMetadata,authorityMetadata:this.config.auth.authorityMetadata,skipAuthorityMetadataCache:this.config.auth.skipAuthorityMetadataCache},a=t||this.config.auth.authority,u=fs.generateAuthority(a,o||this.config.auth.azureCloudOptions),this.logger.verbose("Creating discovered authority with configured authority",this.correlationId),this.performanceClient.setPreQueueTime($.AuthorityFactoryCreateDiscoveredInstance,this.correlationId),[4,ia.createDiscoveredInstance(u,this.config.system.networkClient,this.browserStorage,s,this.logger,this.performanceClient,this.correlationId).then(function(p){return n.endMeasurement({success:!0}),p}).catch(function(p){throw n.endMeasurement({errorCode:p.errorCode,subErrorCode:p.subError,success:!1}),p})];case 1:return[2,h.sent()]}})})},e.prototype.initializeAuthorizationRequest=function(t,o){return D(this,void 0,void 0,function(){var i,n,s,a,u,h,p;return F(this,function(f){switch(f.label){case 0:return this.performanceClient.addQueueMeasurement($.StandardInteractionClientInitializeAuthorizationRequest,this.correlationId),this.logger.verbose("initializeAuthorizationRequest called",this.correlationId),i=this.getRedirectUri(t.redirectUri),n={interactionType:o},s=to.setRequestState(this.browserCrypto,t&&t.state||_.EMPTY_STRING,n),this.performanceClient.setPreQueueTime($.InitializeBaseRequest,this.correlationId),u=[{}],[4,this.initializeBaseRequest(t)];case 1:return a=ae.apply(void 0,[ae.apply(void 0,u.concat([f.sent()])),{redirectUri:i,state:s,nonce:t.nonce||this.browserCrypto.createNewGuid(),responseMode:ml.FRAGMENT}]),h=t.account||this.browserStorage.getActiveAccount(),h&&(this.logger.verbose("Setting validated request account",this.correlationId),this.logger.verbosePii("Setting validated request account: "+h.homeAccountId,this.correlationId),a.account=h),z.isEmpty(a.loginHint)&&!h&&(p=this.browserStorage.getLegacyLoginHint(),p&&(a.loginHint=p)),[2,a]}})})},e}(Of);l();c();d();l();c();d();l();c();d();var Mc=function(){function r(e,t,o,i,n){this.authModule=e,this.browserStorage=t,this.authCodeRequest=o,this.logger=i,this.performanceClient=n}return r.prototype.handleCodeResponseFromHash=function(e,t,o,i){return D(this,void 0,void 0,function(){var n,s,a;return F(this,function(u){if(this.performanceClient.addQueueMeasurement($.HandleCodeResponseFromHash,this.authCodeRequest.correlationId),this.logger.verbose("InteractionHandler.handleCodeResponse called"),z.isEmpty(e))throw B.createEmptyHashError(e);if(n=this.browserStorage.generateStateKey(t),s=this.browserStorage.getTemporaryCache(n),!s)throw U.createStateNotFoundError("Cached State");try{a=this.authModule.handleFragmentResponse(e,s)}catch(h){throw h instanceof eo&&h.subError===q.userCancelledError.code?B.createUserCancelledError():h}return this.performanceClient.setPreQueueTime($.HandleCodeResponseFromServer,this.authCodeRequest.correlationId),[2,this.handleCodeResponseFromServer(a,t,o,i)]})})},r.prototype.handleCodeResponseFromServer=function(e,t,o,i,n){return n===void 0&&(n=!0),D(this,void 0,void 0,function(){var s,a,u,h,p,f;return F(this,function(b){switch(b.label){case 0:if(this.performanceClient.addQueueMeasurement($.HandleCodeResponseFromServer,this.authCodeRequest.correlationId),this.logger.trace("InteractionHandler.handleCodeResponseFromServer called"),s=this.browserStorage.generateStateKey(t),a=this.browserStorage.getTemporaryCache(s),!a)throw U.createStateNotFoundError("Cached State");return u=this.browserStorage.generateNonceKey(a),h=this.browserStorage.getTemporaryCache(u),this.authCodeRequest.code=e.code,e.cloud_instance_host_name?(this.performanceClient.setPreQueueTime($.UpdateTokenEndpointAuthority,this.authCodeRequest.correlationId),[4,this.updateTokenEndpointAuthority(e.cloud_instance_host_name,o,i)]):[3,2];case 1:b.sent(),b.label=2;case 2:return n&&(e.nonce=h||void 0),e.state=a,e.client_info?this.authCodeRequest.clientInfo=e.client_info:(p=this.checkCcsCredentials(),p&&(this.authCodeRequest.ccsCredential=p)),this.performanceClient.setPreQueueTime($.AuthClientAcquireToken,this.authCodeRequest.correlationId),[4,this.authModule.acquireToken(this.authCodeRequest,e)];case 3:return f=b.sent(),this.browserStorage.cleanRequestByState(t),[2,f]}})})},r.prototype.updateTokenEndpointAuthority=function(e,t,o){return D(this,void 0,void 0,function(){var i,n;return F(this,function(s){switch(s.label){case 0:return this.performanceClient.addQueueMeasurement($.UpdateTokenEndpointAuthority,this.authCodeRequest.correlationId),i="https://"+e+"/"+t.tenant+"/",[4,ia.createDiscoveredInstance(i,o,this.browserStorage,t.options,this.logger,this.performanceClient,this.authCodeRequest.correlationId)];case 1:return n=s.sent(),this.authModule.updateAuthority(n),[2]}})})},r.prototype.checkCcsCredentials=function(){var e=this.browserStorage.getTemporaryCache(Ye.CCS_CREDENTIAL,!0);if(e)try{return JSON.parse(e)}catch{this.authModule.logger.error("Cache credential could not be parsed"),this.authModule.logger.errorPii("Cache credential could not be parsed: "+e)}return null},r}();var Mf=function(r){mt(e,r);function e(t,o,i,n,s,a){var u=r.call(this,t,o,i,n,a)||this;return u.browserCrypto=s,u}return e.prototype.initiateAuthRequest=function(t,o){return D(this,void 0,void 0,function(){var i,n;return F(this,function(s){switch(s.label){case 0:return this.logger.verbose("RedirectHandler.initiateAuthRequest called"),z.isEmpty(t)?[3,7]:(o.redirectStartPage&&(this.logger.verbose("RedirectHandler.initiateAuthRequest: redirectStartPage set, caching start page"),this.browserStorage.setTemporaryCache(Ye.ORIGIN_URI,o.redirectStartPage,!0)),this.browserStorage.setTemporaryCache(Ye.CORRELATION_ID,this.authCodeRequest.correlationId,!0),this.browserStorage.cacheCodeRequest(this.authCodeRequest,this.browserCrypto),this.logger.infoPii("RedirectHandler.initiateAuthRequest: Navigate to: "+t),i={apiId:ct.acquireTokenRedirect,timeout:o.redirectTimeout,noHistory:!1},typeof o.onRedirectNavigate!="function"?[3,4]:(this.logger.verbose("RedirectHandler.initiateAuthRequest: Invoking onRedirectNavigate callback"),n=o.onRedirectNavigate(t),n===!1?[3,2]:(this.logger.verbose("RedirectHandler.initiateAuthRequest: onRedirectNavigate did not return false, navigating"),[4,o.navigationClient.navigateExternal(t,i)])));case 1:return s.sent(),[2];case 2:return this.logger.verbose("RedirectHandler.initiateAuthRequest: onRedirectNavigate returned false, stopping navigation"),[2];case 3:return[3,6];case 4:return this.logger.verbose("RedirectHandler.initiateAuthRequest: Navigating window to navigate url"),[4,o.navigationClient.navigateExternal(t,i)];case 5:return s.sent(),[2];case 6:return[3,8];case 7:throw this.logger.info("RedirectHandler.initiateAuthRequest: Navigate url is empty"),B.createEmptyNavigationUriError();case 8:return[2]}})})},e.prototype.handleCodeResponseFromHash=function(t,o,i,n){return D(this,void 0,void 0,function(){var s,a,u,h,p,f,b;return F(this,function(C){switch(C.label){case 0:if(this.logger.verbose("RedirectHandler.handleCodeResponse called"),z.isEmpty(t))throw B.createEmptyHashError(t);if(this.browserStorage.setInteractionInProgress(!1),s=this.browserStorage.generateStateKey(o),a=this.browserStorage.getTemporaryCache(s),!a)throw U.createStateNotFoundError("Cached State");try{u=this.authModule.handleFragmentResponse(t,a)}catch(S){throw S instanceof eo&&S.subError===q.userCancelledError.code?B.createUserCancelledError():S}return h=this.browserStorage.generateNonceKey(a),p=this.browserStorage.getTemporaryCache(h),this.authCodeRequest.code=u.code,u.cloud_instance_host_name?[4,this.updateTokenEndpointAuthority(u.cloud_instance_host_name,i,n)]:[3,2];case 1:C.sent(),C.label=2;case 2:return u.nonce=p||void 0,u.state=a,u.client_info?this.authCodeRequest.clientInfo=u.client_info:(f=this.checkCcsCredentials(),f&&(this.authCodeRequest.ccsCredential=f)),[4,this.authModule.acquireToken(this.authCodeRequest,u)];case 3:return b=C.sent(),this.browserStorage.cleanRequestByState(o),[2,b]}})})},e}(Mc);l();c();d();var he;(function(r){r.INITIALIZE_START="msal:initializeStart",r.INITIALIZE_END="msal:initializeEnd",r.ACCOUNT_ADDED="msal:accountAdded",r.ACCOUNT_REMOVED="msal:accountRemoved",r.LOGIN_START="msal:loginStart",r.LOGIN_SUCCESS="msal:loginSuccess",r.LOGIN_FAILURE="msal:loginFailure",r.ACQUIRE_TOKEN_START="msal:acquireTokenStart",r.ACQUIRE_TOKEN_SUCCESS="msal:acquireTokenSuccess",r.ACQUIRE_TOKEN_FAILURE="msal:acquireTokenFailure",r.ACQUIRE_TOKEN_NETWORK_START="msal:acquireTokenFromNetworkStart",r.SSO_SILENT_START="msal:ssoSilentStart",r.SSO_SILENT_SUCCESS="msal:ssoSilentSuccess",r.SSO_SILENT_FAILURE="msal:ssoSilentFailure",r.ACQUIRE_TOKEN_BY_CODE_START="msal:acquireTokenByCodeStart",r.ACQUIRE_TOKEN_BY_CODE_SUCCESS="msal:acquireTokenByCodeSuccess",r.ACQUIRE_TOKEN_BY_CODE_FAILURE="msal:acquireTokenByCodeFailure",r.HANDLE_REDIRECT_START="msal:handleRedirectStart",r.HANDLE_REDIRECT_END="msal:handleRedirectEnd",r.POPUP_OPENED="msal:popupOpened",r.LOGOUT_START="msal:logoutStart",r.LOGOUT_SUCCESS="msal:logoutSuccess",r.LOGOUT_FAILURE="msal:logoutFailure",r.LOGOUT_END="msal:logoutEnd",r.RESTORE_FROM_BFCACHE="msal:restoreFromBFCache"})(he||(he={}));l();c();d();l();c();d();var na;(function(r){r.USER_INTERACTION_REQUIRED="USER_INTERACTION_REQUIRED",r.USER_CANCEL="USER_CANCEL",r.NO_NETWORK="NO_NETWORK",r.TRANSIENT_ERROR="TRANSIENT_ERROR",r.PERSISTENT_ERROR="PERSISTENT_ERROR",r.DISABLED="DISABLED",r.ACCOUNT_UNAVAILABLE="ACCOUNT_UNAVAILABLE"})(na||(na={}));var Pu={extensionError:{code:"ContentError"},userSwitch:{code:"user_switch",desc:"User attempted to switch accounts in the native broker, which is not allowed. All new accounts must sign-in through the standard web flow first, please try again."},tokensNotFoundInCache:{code:"tokens_not_found_in_internal_memory_cache",desc:"Tokens not cached in MSAL JS internal memory, please make the WAM request"}},Eo=function(r){mt(e,r);function e(t,o,i){var n=r.call(this,t,o)||this;return Object.setPrototypeOf(n,e.prototype),n.name="NativeAuthError",n.ext=i,n}return e.prototype.isFatal=function(){if(this.ext&&this.ext.status&&(this.ext.status===na.PERSISTENT_ERROR||this.ext.status===na.DISABLED))return!0;switch(this.errorCode){case Pu.extensionError.code:return!0;default:return!1}},e.createError=function(t,o,i){if(i&&i.status)switch(i.status){case na.ACCOUNT_UNAVAILABLE:return Cr.createNativeAccountUnavailableError();case na.USER_INTERACTION_REQUIRED:return new Cr(t,o);case na.USER_CANCEL:return B.createUserCancelledError();case na.NO_NETWORK:return B.createNoNetworkConnectivityError()}return new e(t,o,i)},e.createUserSwitchError=function(){return new e(Pu.userSwitch.code,Pu.userSwitch.desc)},e.createTokensNotFoundInCacheError=function(){return new e(Pu.tokensNotFoundInCache.code,Pu.tokensNotFoundInCache.desc)},e}(ee);l();c();d();var $u=function(r){mt(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.acquireToken=function(t){return D(this,void 0,void 0,function(){var o,i,n,s,a;return F(this,function(u){switch(u.label){case 0:return o=this.performanceClient.startMeasurement($.SilentCacheClientAcquireToken,t.correlationId),i=this.initializeServerTelemetryManager(ct.acquireTokenSilent_silentFlow),[4,this.createSilentFlowClient(i,t.authority,t.azureCloudOptions)];case 1:n=u.sent(),this.logger.verbose("Silent auth client created"),u.label=2;case 2:return u.trys.push([2,4,,5]),[4,n.acquireCachedToken(t)];case 3:return s=u.sent(),o.endMeasurement({success:!0,fromCache:!0}),[2,s];case 4:throw a=u.sent(),a instanceof B&&a.errorCode===q.signingKeyNotFoundInStorage.code&&this.logger.verbose("Signing keypair for bound access token not found. Refreshing bound access token and generating a new crypto keypair."),o.endMeasurement({errorCode:a instanceof ee&&a.errorCode||void 0,subErrorCode:a instanceof ee&&a.subError||void 0,success:!1}),a;case 5:return[2]}})})},e.prototype.logout=function(){return Promise.reject(B.createSilentLogoutUnsupportedError())},e.prototype.createSilentFlowClient=function(t,o,i){return D(this,void 0,void 0,function(){var n;return F(this,function(s){switch(s.label){case 0:return this.performanceClient.setPreQueueTime($.StandardInteractionClientGetClientConfiguration,this.correlationId),[4,this.getClientConfiguration(t,o,i)];case 1:return n=s.sent(),[2,new fy(n,this.performanceClient)]}})})},e.prototype.initializeSilentRequest=function(t,o){return D(this,void 0,void 0,function(){var i;return F(this,function(n){switch(n.label){case 0:return this.performanceClient.addQueueMeasurement($.InitializeSilentRequest,this.correlationId),this.performanceClient.setPreQueueTime($.InitializeBaseRequest,this.correlationId),i=[ae({},t)],[4,this.initializeBaseRequest(t,o)];case 1:return[2,ae.apply(void 0,[ae.apply(void 0,i.concat([n.sent()])),{account:o,forceRefresh:t.forceRefresh||!1}])]}})})},e}(li);var en=function(r){mt(e,r);function e(t,o,i,n,s,a,u,h,p,f,b,C){var S=r.call(this,t,o,i,n,s,a,h,p,C)||this;return S.apiId=u,S.accountId=f,S.nativeMessageHandler=p,S.nativeStorageManager=b,S.silentCacheClient=new $u(t,S.nativeStorageManager,i,n,s,a,h,p,C),S}return e.prototype.acquireToken=function(t){return D(this,void 0,void 0,function(){var o,i,n,s,a,u,h;return F(this,function(p){switch(p.label){case 0:return this.logger.trace("NativeInteractionClient - acquireToken called."),o=this.performanceClient.startMeasurement($.NativeInteractionClientAcquireToken,t.correlationId),i=st.nowSeconds(),[4,this.initializeNativeRequest(t)];case 1:n=p.sent(),p.label=2;case 2:return p.trys.push([2,4,,5]),[4,this.acquireTokensFromCache(this.accountId,n)];case 3:return s=p.sent(),o.endMeasurement({success:!0,isNativeBroker:!1,fromCache:!0}),[2,s];case 4:return p.sent(),this.logger.info("MSAL internal Cache does not contain tokens, proceed to make a native call"),[3,5];case 5:return a={method:Zi.GetToken,request:n},[4,this.nativeMessageHandler.sendMessage(a)];case 6:return u=p.sent(),h=this.validateNativeResponse(u),[2,this.handleNativeResponse(h,n,i).then(function(f){return o.endMeasurement({success:!0,isNativeBroker:!0,requestId:f.requestId}),f}).catch(function(f){throw o.endMeasurement({success:!1,errorCode:f.errorCode,subErrorCode:f.subError,isNativeBroker:!0}),f})]}})})},e.prototype.createSilentCacheRequest=function(t,o){return{authority:t.authority,correlationId:this.correlationId,scopes:It.fromString(t.scope).asArray(),account:o,forceRefresh:!1}},e.prototype.acquireTokensFromCache=function(t,o){return D(this,void 0,void 0,function(){var i,n,s,a;return F(this,function(u){switch(u.label){case 0:if(!t)throw this.logger.warning("NativeInteractionClient:acquireTokensFromCache - No nativeAccountId provided"),U.createNoAccountFoundError();if(i=this.browserStorage.getAccountInfoFilteredBy({nativeAccountId:t}),!i)throw U.createNoAccountFoundError();u.label=1;case 1:return u.trys.push([1,3,,4]),n=this.createSilentCacheRequest(o,i),[4,this.silentCacheClient.acquireToken(n)];case 2:return s=u.sent(),[2,s];case 3:throw a=u.sent(),a;case 4:return[2]}})})},e.prototype.acquireTokenRedirect=function(t){return D(this,void 0,void 0,function(){var o,i,n,s,a,u;return F(this,function(h){switch(h.label){case 0:return this.logger.trace("NativeInteractionClient - acquireTokenRedirect called."),[4,this.initializeNativeRequest(t)];case 1:o=h.sent(),i={method:Zi.GetToken,request:o},h.label=2;case 2:return h.trys.push([2,4,,5]),[4,this.nativeMessageHandler.sendMessage(i)];case 3:return n=h.sent(),this.validateNativeResponse(n),[3,5];case 4:if(s=h.sent(),s instanceof Eo&&s.isFatal())throw s;return[3,5];case 5:return this.browserStorage.setTemporaryCache(Ye.NATIVE_REQUEST,JSON.stringify(o),!0),a={apiId:ct.acquireTokenRedirect,timeout:this.config.system.redirectNavigationTimeout,noHistory:!1},u=this.config.auth.navigateToLoginRequestUrl?window.location.href:this.getRedirectUri(t.redirectUri),[4,this.navigationClient.navigateExternal(u,a)];case 6:return h.sent(),[2]}})})},e.prototype.handleRedirectPromise=function(){return D(this,void 0,void 0,function(){var t,o,i,n,s,a,u,h;return F(this,function(p){switch(p.label){case 0:if(this.logger.trace("NativeInteractionClient - handleRedirectPromise called."),!this.browserStorage.isInteractionInProgress(!0))return this.logger.info("handleRedirectPromise called but there is no interaction in progress, returning null."),[2,null];if(t=this.browserStorage.getCachedNativeRequest(),!t)return this.logger.verbose("NativeInteractionClient - handleRedirectPromise called but there is no cached request, returning null."),[2,null];o=t.prompt,i=sy(t,["prompt"]),o&&this.logger.verbose("NativeInteractionClient - handleRedirectPromise called and prompt was included in the original request, removing prompt from cached request to prevent second interaction with native broker window."),this.browserStorage.removeItem(this.browserStorage.generateCacheKey(Ye.NATIVE_REQUEST)),n={method:Zi.GetToken,request:i},s=st.nowSeconds(),p.label=1;case 1:return p.trys.push([1,3,,4]),this.logger.verbose("NativeInteractionClient - handleRedirectPromise sending message to native broker."),[4,this.nativeMessageHandler.sendMessage(n)];case 2:return a=p.sent(),this.validateNativeResponse(a),u=this.handleNativeResponse(a,i,s),this.browserStorage.setInteractionInProgress(!1),[2,u];case 3:throw h=p.sent(),this.browserStorage.setInteractionInProgress(!1),h;case 4:return[2]}})})},e.prototype.logout=function(){return this.logger.trace("NativeInteractionClient - logout called."),Promise.reject("Logout not implemented yet")},e.prototype.handleNativeResponse=function(t,o,i){return D(this,void 0,void 0,function(){var n,s,a,u,h,p;return F(this,function(f){switch(f.label){case 0:if(this.logger.trace("NativeInteractionClient - handleNativeResponse called."),t.account.id!==o.accountId)throw Eo.createUserSwitchError();return[4,this.getDiscoveredAuthority(o.authority)];case 1:return n=f.sent(),s=n.getPreferredCache(),a=this.createIdTokenObj(t),u=this.createHomeAccountIdentifier(t,a),h=this.createAccountEntity(t,u,a,s),[4,this.generateAuthenticationResult(t,o,a,h,n.canonicalAuthority,i)];case 2:return p=f.sent(),this.cacheAccount(h),this.cacheNativeTokens(t,o,u,h,a,p.accessToken,p.tenantId,i),[2,p]}})})},e.prototype.createIdTokenObj=function(t){return new fr(t.id_token||_.EMPTY_STRING,this.browserCrypto)},e.prototype.createHomeAccountIdentifier=function(t,o){var i=Nt.generateHomeAccountId(t.client_info||_.EMPTY_STRING,br.Default,this.logger,this.browserCrypto,o);return i},e.prototype.createAccountEntity=function(t,o,i,n){return Nt.createAccount(t.client_info,o,i,void 0,void 0,void 0,n,t.account.id)},e.prototype.generateScopes=function(t,o){return t.scope?It.fromString(t.scope):It.fromString(o.scope)},e.prototype.generatePopAccessToken=function(t,o){return D(this,void 0,void 0,function(){var i,n;return F(this,function(s){switch(s.label){case 0:if(o.tokenType!==Be.POP)return[3,2];if(t.shr)return this.logger.trace("handleNativeServerResponse: SHR is enabled in native layer"),[2,t.shr];if(i=new ai(this.browserCrypto),n={resourceRequestMethod:o.resourceRequestMethod,resourceRequestUri:o.resourceRequestUri,shrClaims:o.shrClaims,shrNonce:o.shrNonce},!o.keyId)throw U.createKeyIdMissingError();return[4,i.signPopToken(t.access_token,o.keyId,n)];case 1:return[2,s.sent()];case 2:return[2,t.access_token]}})})},e.prototype.generateAuthenticationResult=function(t,o,i,n,s,a){return D(this,void 0,void 0,function(){var u,h,p,f,b,C,S,R;return F(this,function(H){switch(H.label){case 0:return u=this.addTelemetryFromNativeResponse(t),h=t.scope?It.fromString(t.scope):It.fromString(o.scope),p=t.account.properties||{},f=p.UID||i.claims.oid||i.claims.sub||_.EMPTY_STRING,b=p.TenantId||i.claims.tid||_.EMPTY_STRING,[4,this.generatePopAccessToken(t,o)];case 1:return C=H.sent(),S=o.tokenType===Be.POP?Be.POP:Be.BEARER,R={authority:s,uniqueId:f,tenantId:b,scopes:h.asArray(),account:n.getAccountInfo(),idToken:t.id_token,idTokenClaims:i.claims,accessToken:C,fromCache:u?this.isResponseFromCache(u):!1,expiresOn:new Date(Number(a+t.expires_in)*1e3),tokenType:S,correlationId:this.correlationId,state:t.state,fromNativeBroker:!0},[2,R]}})})},e.prototype.cacheAccount=function(t){var o=this;this.browserStorage.setAccount(t),this.browserStorage.removeAccountContext(t).catch(function(i){o.logger.error("Error occurred while removing account context from browser storage. "+i)})},e.prototype.cacheNativeTokens=function(t,o,i,n,s,a,u,h){var p=vi.createIdTokenEntity(i,o.authority,t.id_token||_.EMPTY_STRING,o.clientId,s.claims.tid||_.EMPTY_STRING),f=o.tokenType===Be.POP?_.SHR_NONCE_VALIDITY:(typeof t.expires_in=="string"?parseInt(t.expires_in,10):t.expires_in)||0,b=h+f,C=this.generateScopes(t,o),S=yi.createAccessTokenEntity(i,o.authority,a,o.clientId,s?s.claims.tid||_.EMPTY_STRING:u,C.printScopes(),b,0,this.browserCrypto),R=new hs(n,p,S);this.nativeStorageManager.saveCacheRecord(R)},e.prototype.addTelemetryFromNativeResponse=function(t){var o=this.getMATSFromResponse(t);return o?(this.performanceClient.addStaticFields({extensionId:this.nativeMessageHandler.getExtensionId(),extensionVersion:this.nativeMessageHandler.getExtensionVersion(),matsBrokerVersion:o.broker_version,matsAccountJoinOnStart:o.account_join_on_start,matsAccountJoinOnEnd:o.account_join_on_end,matsDeviceJoin:o.device_join,matsPromptBehavior:o.prompt_behavior,matsApiErrorCode:o.api_error_code,matsUiVisible:o.ui_visible,matsSilentCode:o.silent_code,matsSilentBiSubCode:o.silent_bi_sub_code,matsSilentMessage:o.silent_message,matsSilentStatus:o.silent_status,matsHttpStatus:o.http_status,matsHttpEventCount:o.http_event_count},this.correlationId),o):null},e.prototype.validateNativeResponse=function(t){if(t.hasOwnProperty("access_token")&&t.hasOwnProperty("id_token")&&t.hasOwnProperty("client_info")&&t.hasOwnProperty("account")&&t.hasOwnProperty("scope")&&t.hasOwnProperty("expires_in"))return t;throw Eo.createUnexpectedError("Response missing expected properties.")},e.prototype.getMATSFromResponse=function(t){if(t.properties.MATS)try{return JSON.parse(t.properties.MATS)}catch{this.logger.error("NativeInteractionClient - Error parsing MATS telemetry, returning null instead")}return null},e.prototype.isResponseFromCache=function(t){return typeof t.is_cached>"u"?(this.logger.verbose("NativeInteractionClient - MATS telemetry does not contain field indicating if response was served from cache. Returning false."),!1):!!t.is_cached},e.prototype.initializeNativeRequest=function(t){return D(this,void 0,void 0,function(){var o,i,n,s,a,u,h,p,f,b,C=this;return F(this,function(S){switch(S.label){case 0:return this.logger.trace("NativeInteractionClient - initializeNativeRequest called"),o=t.authority||this.config.auth.authority,t.account?[4,this.validateRequestAuthority(o,t.account)]:[3,2];case 1:S.sent(),S.label=2;case 2:return i=new Se(o),i.validateAsUri(),n=t.scopes,s=sy(t,["scopes"]),a=new It(n||[]),a.appendScopes(Yi),u=function(){switch(C.apiId){case ct.ssoSilent:case ct.acquireTokenSilent_silentFlow:return C.logger.trace("initializeNativeRequest: silent request sets prompt to none"),or.NONE}if(!t.prompt){C.logger.trace("initializeNativeRequest: prompt was not provided");return}switch(t.prompt){case or.NONE:case or.CONSENT:case or.LOGIN:return C.logger.trace("initializeNativeRequest: prompt is compatible with native flow"),t.prompt;default:throw C.logger.trace("initializeNativeRequest: prompt = "+t.prompt+" is not compatible with native flow"),B.createNativePromptParameterNotSupportedError()}},h=ae(ae({},s),{accountId:this.accountId,clientId:this.config.auth.clientId,authority:i.urlString,scope:a.printScopes(),redirectUri:this.getRedirectUri(t.redirectUri),prompt:u(),correlationId:this.correlationId,tokenType:t.authenticationScheme,windowTitleSubstring:document.title,extraParameters:ae(ae(ae({},t.extraQueryParameters),t.tokenQueryParameters),{telemetry:xl.MATS_TELEMETRY}),extendedExpiryToken:!1}),t.authenticationScheme!==Be.POP?[3,4]:(p={resourceRequestUri:t.resourceRequestUri,resourceRequestMethod:t.resourceRequestMethod,shrClaims:t.shrClaims,shrNonce:t.shrNonce},f=new ai(this.browserCrypto),[4,f.generateCnf(p)]);case 3:b=S.sent(),h.reqCnf=b.reqCnfString,h.keyId=b.kid,S.label=4;case 4:return[2,h]}})})},e}(Of);l();c();d();var ci=function(){function r(e,t,o,i){this.logger=e,this.handshakeTimeoutMs=t,this.extensionId=i,this.resolvers=new Map,this.handshakeResolvers=new Map,this.responseId=0,this.messageChannel=new MessageChannel,this.windowListener=this.onWindowMessage.bind(this),this.performanceClient=o,this.handshakeEvent=o.startMeasurement($.NativeMessageHandlerHandshake)}return r.prototype.sendMessage=function(e){return D(this,void 0,void 0,function(){var t,o=this;return F(this,function(i){return this.logger.trace("NativeMessageHandler - sendMessage called."),t={channel:xl.CHANNEL_ID,extensionId:this.extensionId,responseId:this.responseId++,body:e},this.logger.trace("NativeMessageHandler - Sending request to browser extension"),this.logger.tracePii("NativeMessageHandler - Sending request to browser extension: "+JSON.stringify(t)),this.messageChannel.port1.postMessage(t),[2,new Promise(function(n,s){o.resolvers.set(t.responseId,{resolve:n,reject:s})})]})})},r.createProvider=function(e,t,o){return D(this,void 0,void 0,function(){var i,n;return F(this,function(s){switch(s.label){case 0:e.trace("NativeMessageHandler - createProvider called."),s.label=1;case 1:return s.trys.push([1,3,,5]),i=new r(e,t,o,xl.PREFERRED_EXTENSION_ID),[4,i.sendHandshakeRequest()];case 2:return s.sent(),[2,i];case 3:return s.sent(),n=new r(e,t,o),[4,n.sendHandshakeRequest()];case 4:return s.sent(),[2,n];case 5:return[2]}})})},r.prototype.sendHandshakeRequest=function(){return D(this,void 0,void 0,function(){var e,t=this;return F(this,function(o){return this.logger.trace("NativeMessageHandler - sendHandshakeRequest called."),window.addEventListener("message",this.windowListener,!1),e={channel:xl.CHANNEL_ID,extensionId:this.extensionId,responseId:this.responseId++,body:{method:Zi.HandshakeRequest}},this.handshakeEvent.addStaticFields({extensionId:this.extensionId,extensionHandshakeTimeoutMs:this.handshakeTimeoutMs}),this.messageChannel.port1.onmessage=function(i){t.onChannelMessage(i)},window.postMessage(e,window.origin,[this.messageChannel.port2]),[2,new Promise(function(i,n){t.handshakeResolvers.set(e.responseId,{resolve:i,reject:n}),t.timeoutId=window.setTimeout(function(){window.removeEventListener("message",t.windowListener,!1),t.messageChannel.port1.close(),t.messageChannel.port2.close(),t.handshakeEvent.endMeasurement({extensionHandshakeTimedOut:!0,success:!1}),n(B.createNativeHandshakeTimeoutError()),t.handshakeResolvers.delete(e.responseId)},t.handshakeTimeoutMs)})]})})},r.prototype.onWindowMessage=function(e){if(this.logger.trace("NativeMessageHandler - onWindowMessage called"),e.source===window){var t=e.data;if(!(!t.channel||t.channel!==xl.CHANNEL_ID)&&!(t.extensionId&&t.extensionId!==this.extensionId)&&t.body.method===Zi.HandshakeRequest){this.logger.verbose(t.extensionId?"Extension with id: "+t.extensionId+" not installed":"No extension installed"),clearTimeout(this.timeoutId),this.messageChannel.port1.close(),this.messageChannel.port2.close(),window.removeEventListener("message",this.windowListener,!1);var o=this.handshakeResolvers.get(t.responseId);o&&(this.handshakeEvent.endMeasurement({success:!1,extensionInstalled:!1}),o.reject(B.createNativeExtensionNotInstalledError()))}}},r.prototype.onChannelMessage=function(e){this.logger.trace("NativeMessageHandler - onChannelMessage called.");var t=e.data,o=this.resolvers.get(t.responseId),i=this.handshakeResolvers.get(t.responseId);try{var n=t.body.method;if(n===Zi.Response){if(!o)return;var s=t.body.response;if(this.logger.trace("NativeMessageHandler - Received response from browser extension"),this.logger.tracePii("NativeMessageHandler - Received response from browser extension: "+JSON.stringify(s)),s.status!=="Success")o.reject(Eo.createError(s.code,s.description,s.ext));else if(s.result)s.result.code&&s.result.description?o.reject(Eo.createError(s.result.code,s.result.description,s.result.ext)):o.resolve(s.result);else throw ee.createUnexpectedError("Event does not contain result.");this.resolvers.delete(t.responseId)}else if(n===Zi.HandshakeResponse){if(!i)return;clearTimeout(this.timeoutId),window.removeEventListener("message",this.windowListener,!1),this.extensionId=t.extensionId,this.extensionVersion=t.body.version,this.logger.verbose("NativeMessageHandler - Received HandshakeResponse from extension: "+this.extensionId),this.handshakeEvent.endMeasurement({extensionInstalled:!0,success:!0}),i.resolve(),this.handshakeResolvers.delete(t.responseId)}}catch(a){this.logger.error("Error parsing response from WAM Extension"),this.logger.errorPii("Error parsing response from WAM Extension: "+a.toString()),this.logger.errorPii("Unable to parse "+e),o?o.reject(a):i&&i.reject(a)}},r.prototype.getExtensionId=function(){return this.extensionId},r.prototype.getExtensionVersion=function(){return this.extensionVersion},r.isNativeAvailable=function(e,t,o,i){if(t.trace("isNativeAvailable called"),!e.system.allowNativeBroker)return t.trace("isNativeAvailable: allowNativeBroker is not enabled, returning false"),!1;if(!o)return t.trace("isNativeAvailable: WAM extension provider is not initialized, returning false"),!1;if(i)switch(i){case Be.BEARER:case Be.POP:return t.trace("isNativeAvailable: authenticationScheme is supported, returning true"),!0;default:return t.trace("isNativeAvailable: authenticationScheme is not supported, returning false"),!1}return!0},r}();var _y=function(r){mt(e,r);function e(t,o,i,n,s,a,u,h,p,f){var b=r.call(this,t,o,i,n,s,a,u,p,f)||this;return b.nativeStorage=h,b}return e.prototype.acquireToken=function(t){return D(this,void 0,void 0,function(){var o,i,n,s,a,u,h,p,f,b=this;return F(this,function(C){switch(C.label){case 0:return this.performanceClient.setPreQueueTime($.StandardInteractionClientInitializeAuthorizationRequest,t.correlationId),[4,this.initializeAuthorizationRequest(t,ne.Redirect)];case 1:o=C.sent(),this.browserStorage.updateCacheEntries(o.state,o.nonce,o.authority,o.loginHint||_.EMPTY_STRING,o.account||null),i=this.initializeServerTelemetryManager(ct.acquireTokenRedirect),n=function(S){S.persisted&&(b.logger.verbose("Page was restored from back/forward cache. Clearing temporary cache."),b.browserStorage.cleanRequestByState(o.state),b.eventHandler.emitEvent(he.RESTORE_FROM_BFCACHE,ne.Redirect))},C.label=2;case 2:return C.trys.push([2,7,,8]),this.performanceClient.setPreQueueTime($.StandardInteractionClientInitializeAuthorizationCodeRequest,t.correlationId),[4,this.initializeAuthorizationCodeRequest(o)];case 3:return s=C.sent(),this.performanceClient.setPreQueueTime($.StandardInteractionClientCreateAuthCodeClient,t.correlationId),[4,this.createAuthCodeClient(i,o.authority,o.azureCloudOptions)];case 4:return a=C.sent(),this.logger.verbose("Auth code client created"),u=new Mf(a,this.browserStorage,s,this.logger,this.browserCrypto,this.performanceClient),[4,a.getAuthCodeUrl(ae(ae({},o),{nativeBroker:ci.isNativeAvailable(this.config,this.logger,this.nativeMessageHandler,t.authenticationScheme)}))];case 5:return h=C.sent(),p=this.getRedirectStartPage(t.redirectStartPage),this.logger.verbosePii("Redirect start page: "+p),window.addEventListener("pageshow",n),[4,u.initiateAuthRequest(h,{navigationClient:this.navigationClient,redirectTimeout:this.config.system.redirectNavigationTimeout,redirectStartPage:p,onRedirectNavigate:t.onRedirectNavigate})];case 6:return[2,C.sent()];case 7:throw f=C.sent(),f instanceof ee&&f.setCorrelationId(this.correlationId),window.removeEventListener("pageshow",n),i.cacheFailedRequest(f),this.browserStorage.cleanRequestByState(o.state),f;case 8:return[2]}})})},e.prototype.handleRedirectPromise=function(t){return D(this,void 0,void 0,function(){var o,i,n,s,a,u,h,p,f,b,C,S;return F(this,function(R){switch(R.label){case 0:o=this.initializeServerTelemetryManager(ct.handleRedirectPromise),R.label=1;case 1:if(R.trys.push([1,10,,11]),!this.browserStorage.isInteractionInProgress(!0))return this.logger.info("handleRedirectPromise called but there is no interaction in progress, returning null."),[2,null];if(i=this.getRedirectResponseHash(t||window.location.hash),!i)return this.logger.info("handleRedirectPromise did not detect a response hash as a result of a redirect. Cleaning temporary cache."),this.browserStorage.cleanRequestByInteractionType(ne.Redirect),[2,null];n=void 0;try{s=Se.getDeserializedHash(i),n=this.validateAndExtractStateFromHash(s,ne.Redirect),this.logger.verbose("State extracted from hash")}catch(H){return this.logger.info("handleRedirectPromise was unable to extract state due to: "+H),this.browserStorage.cleanRequestByInteractionType(ne.Redirect),[2,null]}return a=this.browserStorage.getTemporaryCache(Ye.ORIGIN_URI,!0)||_.EMPTY_STRING,u=Se.removeHashFromUrl(a),h=Se.removeHashFromUrl(window.location.href),u===h&&this.config.auth.navigateToLoginRequestUrl?(this.logger.verbose("Current page is loginRequestUrl, handling hash"),[4,this.handleHash(i,n,o)]):[3,3];case 2:return p=R.sent(),a.indexOf("#")>-1&&St.replaceHash(a),[2,p];case 3:return this.config.auth.navigateToLoginRequestUrl?[3,4]:(this.logger.verbose("NavigateToLoginRequestUrl set to false, handling hash"),[2,this.handleHash(i,n,o)]);case 4:return!St.isInIframe()||this.config.system.allowRedirectInIframe?(this.browserStorage.setTemporaryCache(Ye.URL_HASH,i,!0),f={apiId:ct.handleRedirectPromise,timeout:this.config.system.redirectNavigationTimeout,noHistory:!0},b=!0,!a||a==="null"?(C=St.getHomepage(),this.browserStorage.setTemporaryCache(Ye.ORIGIN_URI,C,!0),this.logger.warning("Unable to get valid login request url from cache, redirecting to home page"),[4,this.navigationClient.navigateInternal(C,f)]):[3,6]):[3,9];case 5:return b=R.sent(),[3,8];case 6:return this.logger.verbose("Navigating to loginRequestUrl: "+a),[4,this.navigationClient.navigateInternal(a,f)];case 7:b=R.sent(),R.label=8;case 8:if(!b)return[2,this.handleHash(i,n,o)];R.label=9;case 9:return[2,null];case 10:throw S=R.sent(),S instanceof ee&&S.setCorrelationId(this.correlationId),o.cacheFailedRequest(S),this.browserStorage.cleanRequestByInteractionType(ne.Redirect),S;case 11:return[2]}})})},e.prototype.getRedirectResponseHash=function(t){this.logger.verbose("getRedirectResponseHash called");var o=Se.hashContainsKnownProperties(t);if(o)return St.clearHash(window),this.logger.verbose("Hash contains known properties, returning response hash"),t;var i=this.browserStorage.getTemporaryCache(Ye.URL_HASH,!0);return this.browserStorage.removeItem(this.browserStorage.generateCacheKey(Ye.URL_HASH)),this.logger.verbose("Hash does not contain known properties, returning cached hash"),i},e.prototype.handleHash=function(t,o,i){return D(this,void 0,void 0,function(){var n,s,a,u,h,p,f,b=this;return F(this,function(C){switch(C.label){case 0:if(n=this.browserStorage.getCachedRequest(o,this.browserCrypto),this.logger.verbose("handleHash called, retrieved cached request"),s=Se.getDeserializedHash(t),s.accountId){if(this.logger.verbose("Account id found in hash, calling WAM for token"),!this.nativeMessageHandler)throw B.createNativeConnectionNotEstablishedError();return a=new en(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,ct.acquireTokenPopup,this.performanceClient,this.nativeMessageHandler,s.accountId,this.nativeStorage,n.correlationId),u=to.parseRequestState(this.browserCrypto,o).userRequestState,[2,a.acquireToken(ae(ae({},n),{state:u,prompt:void 0})).finally(function(){b.browserStorage.cleanRequestByState(o)})]}if(h=this.browserStorage.getCachedAuthority(o),!h)throw B.createNoCachedAuthorityError();return this.performanceClient.setPreQueueTime($.StandardInteractionClientCreateAuthCodeClient,n.correlationId),[4,this.createAuthCodeClient(i,h)];case 1:return p=C.sent(),this.logger.verbose("Auth code client created"),oa.removeThrottle(this.browserStorage,this.config.auth.clientId,n),f=new Mf(p,this.browserStorage,n,this.logger,this.browserCrypto,this.performanceClient),[4,f.handleCodeResponseFromHash(t,o,p.authority,this.networkClient)];case 2:return[2,C.sent()]}})})},e.prototype.logout=function(t){return D(this,void 0,void 0,function(){var o,i,n,s,a,u,h;return F(this,function(p){switch(p.label){case 0:this.logger.verbose("logoutRedirect called"),o=this.initializeLogoutRequest(t),i=this.initializeServerTelemetryManager(ct.logout),p.label=1;case 1:return p.trys.push([1,10,,11]),this.eventHandler.emitEvent(he.LOGOUT_START,ne.Redirect,t),[4,this.clearCacheOnLogout(o.account)];case 2:return p.sent(),n={apiId:ct.logout,timeout:this.config.system.redirectNavigationTimeout,noHistory:!1},this.performanceClient.setPreQueueTime($.StandardInteractionClientCreateAuthCodeClient,o.correlationId),[4,this.createAuthCodeClient(i,t&&t.authority)];case 3:return s=p.sent(),this.logger.verbose("Auth code client created"),a=s.getLogoutUri(o),this.eventHandler.emitEvent(he.LOGOUT_SUCCESS,ne.Redirect,o),t&&typeof t.onRedirectNavigate=="function"?(u=t.onRedirectNavigate(a),u===!1?[3,5]:(this.logger.verbose("Logout onRedirectNavigate did not return false, navigating"),this.browserStorage.getInteractionInProgress()||this.browserStorage.setInteractionInProgress(!0),[4,this.navigationClient.navigateExternal(a,n)])):[3,7];case 4:return p.sent(),[2];case 5:this.browserStorage.setInteractionInProgress(!1),this.logger.verbose("Logout onRedirectNavigate returned false, stopping navigation"),p.label=6;case 6:return[3,9];case 7:return this.browserStorage.getInteractionInProgress()||this.browserStorage.setInteractionInProgress(!0),[4,this.navigationClient.navigateExternal(a,n)];case 8:return p.sent(),[2];case 9:return[3,11];case 10:throw h=p.sent(),h instanceof ee&&h.setCorrelationId(this.correlationId),i.cacheFailedRequest(h),this.eventHandler.emitEvent(he.LOGOUT_FAILURE,ne.Redirect,null,h),this.eventHandler.emitEvent(he.LOGOUT_END,ne.Redirect),h;case 11:return this.eventHandler.emitEvent(he.LOGOUT_END,ne.Redirect),[2]}})})},e.prototype.getRedirectStartPage=function(t){var o=t||window.location.href;return Se.getAbsoluteUrl(o,St.getCurrentUri())},e}(li);l();c();d();var Ty=function(r){mt(e,r);function e(t,o,i,n,s,a,u,h,p,f){var b=r.call(this,t,o,i,n,s,a,u,p,f)||this;return b.unloadWindow=b.unloadWindow.bind(b),b.nativeStorage=h,b}return e.prototype.acquireToken=function(t){try{var o=this.generatePopupName(t.scopes||Yi,t.authority||this.config.auth.authority),i=t.popupWindowAttributes||{};if(this.config.system.asyncPopups)return this.logger.verbose("asyncPopups set to true, acquiring token"),this.acquireTokenPopupAsync(t,o,i);this.logger.verbose("asyncPopup set to false, opening popup before acquiring token");var n=this.openSizedPopup("about:blank",o,i);return this.acquireTokenPopupAsync(t,o,i,n)}catch(s){return Promise.reject(s)}},e.prototype.logout=function(t){try{this.logger.verbose("logoutPopup called");var o=this.initializeLogoutRequest(t),i=this.generateLogoutPopupName(o),n=t&&t.authority,s=t&&t.mainWindowRedirectUri,a=t?.popupWindowAttributes||{};if(this.config.system.asyncPopups)return this.logger.verbose("asyncPopups set to true"),this.logoutPopupAsync(o,i,a,n,void 0,s);this.logger.verbose("asyncPopup set to false, opening popup");var u=this.openSizedPopup("about:blank",i,a);return this.logoutPopupAsync(o,i,a,n,u,s)}catch(h){return Promise.reject(h)}},e.prototype.acquireTokenPopupAsync=function(t,o,i,n){return D(this,void 0,void 0,function(){var s,a,u,h,p,f,b,C,S,R,H,ye,ie,me,yt,Ge,tt,_o=this;return F(this,function(_r){switch(_r.label){case 0:return this.logger.verbose("acquireTokenPopupAsync called"),s=this.initializeServerTelemetryManager(ct.acquireTokenPopup),this.performanceClient.setPreQueueTime($.StandardInteractionClientInitializeAuthorizationRequest,t.correlationId),[4,this.initializeAuthorizationRequest(t,ne.Popup)];case 1:a=_r.sent(),this.browserStorage.updateCacheEntries(a.state,a.nonce,a.authority,a.loginHint||_.EMPTY_STRING,a.account||null),_r.label=2;case 2:return _r.trys.push([2,8,,9]),this.performanceClient.setPreQueueTime($.StandardInteractionClientInitializeAuthorizationCodeRequest,t.correlationId),[4,this.initializeAuthorizationCodeRequest(a)];case 3:return u=_r.sent(),this.performanceClient.setPreQueueTime($.StandardInteractionClientCreateAuthCodeClient,t.correlationId),[4,this.createAuthCodeClient(s,a.authority,a.azureCloudOptions)];case 4:return h=_r.sent(),this.logger.verbose("Auth code client created"),p=ci.isNativeAvailable(this.config,this.logger,this.nativeMessageHandler,t.authenticationScheme),f=void 0,p&&(f=this.performanceClient.startMeasurement($.FetchAccountIdWithNativeBroker,t.correlationId)),[4,h.getAuthCodeUrl(ae(ae({},a),{nativeBroker:p}))];case 5:return b=_r.sent(),C=new Mc(h,this.browserStorage,u,this.logger,this.performanceClient),S={popup:n,popupName:o,popupWindowAttributes:i},R=this.initiateAuthRequest(b,S),this.eventHandler.emitEvent(he.POPUP_OPENED,ne.Popup,{popupWindow:R},null),[4,this.monitorPopupForHash(R)];case 6:if(H=_r.sent(),ye=Se.getDeserializedHash(H),ie=this.validateAndExtractStateFromHash(ye,ne.Popup,a.correlationId),oa.removeThrottle(this.browserStorage,this.config.auth.clientId,u),ye.accountId){if(this.logger.verbose("Account id found in hash, calling WAM for token"),f&&f.endMeasurement({success:!0,isNativeBroker:!0}),!this.nativeMessageHandler)throw B.createNativeConnectionNotEstablishedError();return me=new en(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,ct.acquireTokenPopup,this.performanceClient,this.nativeMessageHandler,ye.accountId,this.nativeStorage,a.correlationId),yt=to.parseRequestState(this.browserCrypto,ie).userRequestState,[2,me.acquireToken(ae(ae({},a),{state:yt,prompt:void 0})).finally(function(){_o.browserStorage.cleanRequestByState(ie)})]}return[4,C.handleCodeResponseFromHash(H,ie,h.authority,this.networkClient)];case 7:return Ge=_r.sent(),[2,Ge];case 8:throw tt=_r.sent(),n&&n.close(),tt instanceof ee&&tt.setCorrelationId(this.correlationId),s.cacheFailedRequest(tt),this.browserStorage.cleanRequestByState(a.state),tt;case 9:return[2]}})})},e.prototype.logoutPopupAsync=function(t,o,i,n,s,a){return D(this,void 0,void 0,function(){var u,h,p,f,b,C,S;return F(this,function(R){switch(R.label){case 0:this.logger.verbose("logoutPopupAsync called"),this.eventHandler.emitEvent(he.LOGOUT_START,ne.Popup,t),u=this.initializeServerTelemetryManager(ct.logoutPopup),R.label=1;case 1:return R.trys.push([1,5,,6]),[4,this.clearCacheOnLogout(t.account)];case 2:return R.sent(),this.performanceClient.setPreQueueTime($.StandardInteractionClientCreateAuthCodeClient,t.correlationId),[4,this.createAuthCodeClient(u,n)];case 3:return h=R.sent(),this.logger.verbose("Auth code client created"),p=h.getLogoutUri(t),this.eventHandler.emitEvent(he.LOGOUT_SUCCESS,ne.Popup,t),f=this.openPopup(p,{popupName:o,popupWindowAttributes:i,popup:s}),this.eventHandler.emitEvent(he.POPUP_OPENED,ne.Popup,{popupWindow:f},null),[4,this.waitForLogoutPopup(f)];case 4:return R.sent(),a?(b={apiId:ct.logoutPopup,timeout:this.config.system.redirectNavigationTimeout,noHistory:!1},C=Se.getAbsoluteUrl(a,St.getCurrentUri()),this.logger.verbose("Redirecting main window to url specified in the request"),this.logger.verbosePii("Redirecting main window to: "+C),this.navigationClient.navigateInternal(C,b)):this.logger.verbose("No main window navigation requested"),[3,6];case 5:throw S=R.sent(),s&&s.close(),S instanceof ee&&S.setCorrelationId(this.correlationId),this.browserStorage.setInteractionInProgress(!1),this.eventHandler.emitEvent(he.LOGOUT_FAILURE,ne.Popup,null,S),this.eventHandler.emitEvent(he.LOGOUT_END,ne.Popup),u.cacheFailedRequest(S),S;case 6:return this.eventHandler.emitEvent(he.LOGOUT_END,ne.Popup),[2]}})})},e.prototype.initiateAuthRequest=function(t,o){if(z.isEmpty(t))throw this.logger.error("Navigate url is empty"),B.createEmptyNavigationUriError();return this.logger.infoPii("Navigate to: "+t),this.openPopup(t,o)},e.prototype.monitorPopupForHash=function(t){var o=this;return new Promise(function(i,n){var s=o.config.system.windowHashTimeout/o.config.system.pollIntervalMilliseconds,a=0;o.logger.verbose("PopupHandler.monitorPopupForHash - polling started");var u=setInterval(function(){if(t.closed){o.logger.error("PopupHandler.monitorPopupForHash - window closed"),o.cleanPopup(),clearInterval(u),n(B.createUserCancelledError());return}var h=_.EMPTY_STRING,p=_.EMPTY_STRING;try{h=t.location.href,p=t.location.hash}catch{}z.isEmpty(h)||h==="about:blank"||(o.logger.verbose("PopupHandler.monitorPopupForHash - popup window is on same origin as caller"),a++,p?(o.logger.verbose("PopupHandler.monitorPopupForHash - found hash in url"),clearInterval(u),o.cleanPopup(t),Se.hashContainsKnownProperties(p)?(o.logger.verbose("PopupHandler.monitorPopupForHash - hash contains known properties, returning."),i(p)):(o.logger.error("PopupHandler.monitorPopupForHash - found hash in url but it does not contain known properties. Check that your router is not changing the hash prematurely."),o.logger.errorPii("PopupHandler.monitorPopupForHash - hash found: "+p),n(B.createHashDoesNotContainKnownPropertiesError()))):a>s&&(o.logger.error("PopupHandler.monitorPopupForHash - unable to find hash in url, timing out"),clearInterval(u),n(B.createMonitorPopupTimeoutError())))},o.config.system.pollIntervalMilliseconds)})},e.prototype.waitForLogoutPopup=function(t){var o=this;return new Promise(function(i){o.logger.verbose("PopupHandler.waitForLogoutPopup - polling started");var n=setInterval(function(){t.closed&&(o.logger.error("PopupHandler.waitForLogoutPopup - window closed"),o.cleanPopup(),clearInterval(n),i());var s=_.EMPTY_STRING;try{s=t.location.href}catch{}z.isEmpty(s)||s==="about:blank"||(o.logger.verbose("PopupHandler.waitForLogoutPopup - popup window is on same origin as caller, closing."),clearInterval(n),o.cleanPopup(t),i())},o.config.system.pollIntervalMilliseconds)})},e.prototype.openPopup=function(t,o){try{var i=void 0;if(o.popup?(i=o.popup,this.logger.verbosePii("Navigating popup window to: "+t),i.location.assign(t)):typeof o.popup>"u"&&(this.logger.verbosePii("Opening popup window to: "+t),i=this.openSizedPopup(t,o.popupName,o.popupWindowAttributes)),!i)throw B.createEmptyWindowCreatedError();return i.focus&&i.focus(),this.currentWindow=i,window.addEventListener("beforeunload",this.unloadWindow),i}catch(n){throw this.logger.error("error opening popup "+n.message),this.browserStorage.setInteractionInProgress(!1),B.createPopupWindowError(n.toString())}},e.prototype.openSizedPopup=function(t,o,i){var n,s,a,u,h=window.screenLeft?window.screenLeft:window.screenX,p=window.screenTop?window.screenTop:window.screenY,f=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,b=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight,C=(n=i.popupSize)===null||n===void 0?void 0:n.width,S=(s=i.popupSize)===null||s===void 0?void 0:s.height,R=(a=i.popupPosition)===null||a===void 0?void 0:a.top,H=(u=i.popupPosition)===null||u===void 0?void 0:u.left;return(!C||C<0||C>f)&&(this.logger.verbose("Default popup window width used. Window width not configured or invalid."),C=Hr.POPUP_WIDTH),(!S||S<0||S>b)&&(this.logger.verbose("Default popup window height used. Window height not configured or invalid."),S=Hr.POPUP_HEIGHT),(!R||R<0||R>b)&&(this.logger.verbose("Default popup window top position used. Window top not configured or invalid."),R=Math.max(0,b/2-Hr.POPUP_HEIGHT/2+p)),(!H||H<0||H>f)&&(this.logger.verbose("Default popup window left position used. Window left not configured or invalid."),H=Math.max(0,f/2-Hr.POPUP_WIDTH/2+h)),window.open(t,o,"width="+C+", height="+S+", top="+R+", left="+H+", scrollbars=yes")},e.prototype.unloadWindow=function(t){this.browserStorage.cleanRequestByInteractionType(ne.Popup),this.currentWindow&&this.currentWindow.close(),t.preventDefault()},e.prototype.cleanPopup=function(t){t&&t.close(),window.removeEventListener("beforeunload",this.unloadWindow),this.browserStorage.setInteractionInProgress(!1)},e.prototype.generatePopupName=function(t,o){return Hr.POPUP_NAME_PREFIX+"."+this.config.auth.clientId+"."+t.join("-")+"."+o+"."+this.correlationId},e.prototype.generateLogoutPopupName=function(t){var o=t.account&&t.account.homeAccountId;return Hr.POPUP_NAME_PREFIX+"."+this.config.auth.clientId+"."+o+"."+this.correlationId},e}(li);l();c();d();l();c();d();l();c();d();l();c();d();var Ey=function(){function r(){}return r.prototype.navigateInternal=function(e,t){return r.defaultNavigateWindow(e,t)},r.prototype.navigateExternal=function(e,t){return r.defaultNavigateWindow(e,t)},r.defaultNavigateWindow=function(e,t){return t.noHistory?window.location.replace(e):window.location.assign(e),new Promise(function(o){setTimeout(function(){o(!0)},t.timeout)})},r}();var x9=6e4,Ou=6e3,k9=3e4,S9=2e3;function M_(r,e){var t=r.auth,o=r.cache,i=r.system,n=r.telemetry,s={clientId:_.EMPTY_STRING,authority:""+_.DEFAULT_AUTHORITY,knownAuthorities:[],cloudDiscoveryMetadata:_.EMPTY_STRING,authorityMetadata:_.EMPTY_STRING,redirectUri:_.EMPTY_STRING,postLogoutRedirectUri:_.EMPTY_STRING,navigateToLoginRequestUrl:!0,clientCapabilities:[],protocolMode:ps.AAD,azureCloudOptions:{azureCloudInstance:Tn.None,tenant:_.EMPTY_STRING},skipAuthorityMetadataCache:!1},a={cacheLocation:zt.SessionStorage,temporaryCacheLocation:zt.SessionStorage,storeAuthStateInCookie:!1,secureCookies:!1,cacheMigrationEnabled:!!(o&&o.cacheLocation===zt.LocalStorage),claimsBasedCachingEnabled:!0},u={loggerCallback:function(){},logLevel:ir.Info,piiLoggingEnabled:!1},h=ae(ae({},If),{loggerOptions:u,networkClient:e?St.getBrowserNetworkClient():vy,navigationClient:new Ey,loadFrameTimeout:0,windowHashTimeout:i?.loadFrameTimeout||x9,iframeHashTimeout:i?.loadFrameTimeout||Ou,navigateFrameWait:e&&St.detectIEOrEdge()?500:0,redirectNavigationTimeout:k9,asyncPopups:!1,allowRedirectInIframe:!1,allowNativeBroker:!1,nativeBrokerHandshakeTimeout:i?.nativeBrokerHandshakeTimeout||S9,pollIntervalMilliseconds:Hr.DEFAULT_POLL_INTERVAL_MS,cryptoOptions:{useMsrCrypto:!1,entropy:void 0}}),p=ae(ae({},i),{loggerOptions:i?.loggerOptions||u}),f={application:{appName:_.EMPTY_STRING,appVersion:_.EMPTY_STRING}},b={auth:ae(ae({},s),t),cache:ae(ae({},a),o),system:ae(ae({},h),p),telemetry:ae(ae({},f),n)};return b}var Df=function(r){mt(e,r);function e(t,o,i,n,s,a){var u=r.call(this,t,o,i,n,a)||this;return u.navigateFrameWait=s.navigateFrameWait,u.pollIntervalMilliseconds=s.pollIntervalMilliseconds,u}return e.prototype.initiateAuthRequest=function(t){return D(this,void 0,void 0,function(){return F(this,function(o){switch(o.label){case 0:if(this.performanceClient.addQueueMeasurement($.SilentHandlerInitiateAuthRequest,this.authCodeRequest.correlationId),z.isEmpty(t))throw this.logger.info("Navigate url is empty"),B.createEmptyNavigationUriError();return this.navigateFrameWait?(this.performanceClient.setPreQueueTime($.SilentHandlerLoadFrame,this.authCodeRequest.correlationId),[4,this.loadFrame(t)]):[3,2];case 1:return[2,o.sent()];case 2:return[2,this.loadFrameSync(t)]}})})},e.prototype.monitorIframeForHash=function(t,o){var i=this;return this.performanceClient.addQueueMeasurement($.SilentHandlerMonitorIframeForHash,this.authCodeRequest.correlationId),new Promise(function(n,s){ou){i.removeHiddenIframe(t),clearInterval(h),s(B.createMonitorIframeTimeoutError());return}var p=_.EMPTY_STRING,f=t.contentWindow;try{p=f?f.location.href:_.EMPTY_STRING}catch{}if(!z.isEmpty(p)){var b=f?f.location.hash:_.EMPTY_STRING;if(Se.hashContainsKnownProperties(b)){i.removeHiddenIframe(t),clearInterval(h),n(b);return}}},i.pollIntervalMilliseconds)})},e.prototype.loadFrame=function(t){var o=this;return this.performanceClient.addQueueMeasurement($.SilentHandlerLoadFrame,this.authCodeRequest.correlationId),new Promise(function(i,n){var s=o.createHiddenIframe();setTimeout(function(){if(!s){n("Unable to load iframe");return}s.src=t,i(s)},o.navigateFrameWait)})},e.prototype.loadFrameSync=function(t){var o=this.createHiddenIframe();return o.src=t,o},e.prototype.createHiddenIframe=function(){var t=document.createElement("iframe");return t.style.visibility="hidden",t.style.position="absolute",t.style.width=t.style.height="0",t.style.border="0",t.setAttribute("sandbox","allow-scripts allow-same-origin allow-forms"),document.getElementsByTagName("body")[0].appendChild(t),t},e.prototype.removeHiddenIframe=function(t){document.body===t.parentNode&&document.body.removeChild(t)},e}(Mc);var Iy=function(r){mt(e,r);function e(t,o,i,n,s,a,u,h,p,f,b){var C=r.call(this,t,o,i,n,s,a,h,f,b)||this;return C.apiId=u,C.nativeStorage=p,C}return e.prototype.acquireToken=function(t){return D(this,void 0,void 0,function(){var o,i,n,s,a;return F(this,function(u){switch(u.label){case 0:if(this.performanceClient.addQueueMeasurement($.SilentIframeClientAcquireToken,t.correlationId),this.logger.verbose("acquireTokenByIframe called"),o=this.performanceClient.startMeasurement($.SilentIframeClientAcquireToken,t.correlationId),z.isEmpty(t.loginHint)&&z.isEmpty(t.sid)&&(!t.account||z.isEmpty(t.account.username))&&this.logger.warning("No user hint provided. The authorization server may need more information to complete this request."),t.prompt&&t.prompt!==or.NONE&&t.prompt!==or.NO_SESSION)throw o.endMeasurement({success:!1}),B.createSilentPromptValueError(t.prompt);return this.performanceClient.setPreQueueTime($.StandardInteractionClientInitializeAuthorizationRequest,t.correlationId),[4,this.initializeAuthorizationRequest(ae(ae({},t),{prompt:t.prompt||or.NONE}),ne.Silent)];case 1:i=u.sent(),this.browserStorage.updateCacheEntries(i.state,i.nonce,i.authority,i.loginHint||_.EMPTY_STRING,i.account||null),n=this.initializeServerTelemetryManager(this.apiId),u.label=2;case 2:return u.trys.push([2,5,,6]),this.performanceClient.setPreQueueTime($.StandardInteractionClientCreateAuthCodeClient,t.correlationId),[4,this.createAuthCodeClient(n,i.authority,i.azureCloudOptions)];case 3:return s=u.sent(),this.logger.verbose("Auth code client created"),this.performanceClient.setPreQueueTime($.SilentIframeClientTokenHelper,t.correlationId),[4,this.silentTokenHelper(s,i).then(function(h){return o.endMeasurement({success:!0,fromCache:!1,requestId:h.requestId}),h})];case 4:return[2,u.sent()];case 5:throw a=u.sent(),a instanceof ee&&a.setCorrelationId(this.correlationId),n.cacheFailedRequest(a),this.browserStorage.cleanRequestByState(i.state),o.endMeasurement({errorCode:a instanceof ee&&a.errorCode||void 0,subErrorCode:a instanceof ee&&a.subError||void 0,success:!1}),a;case 6:return[2]}})})},e.prototype.logout=function(){return Promise.reject(B.createSilentLogoutUnsupportedError())},e.prototype.silentTokenHelper=function(t,o){return D(this,void 0,void 0,function(){var i,n,s,a,u,h,p,f,b,C=this;return F(this,function(S){switch(S.label){case 0:return this.performanceClient.addQueueMeasurement($.SilentIframeClientTokenHelper,o.correlationId),this.performanceClient.setPreQueueTime($.StandardInteractionClientInitializeAuthorizationCodeRequest,o.correlationId),[4,this.initializeAuthorizationCodeRequest(o)];case 1:return i=S.sent(),this.performanceClient.setPreQueueTime($.GetAuthCodeUrl,o.correlationId),[4,t.getAuthCodeUrl(ae(ae({},o),{nativeBroker:ci.isNativeAvailable(this.config,this.logger,this.nativeMessageHandler,o.authenticationScheme)}))];case 2:return n=S.sent(),s=new Df(t,this.browserStorage,i,this.logger,this.config.system,this.performanceClient),this.performanceClient.setPreQueueTime($.SilentHandlerInitiateAuthRequest,o.correlationId),[4,s.initiateAuthRequest(n)];case 3:return a=S.sent(),this.performanceClient.setPreQueueTime($.SilentHandlerMonitorIframeForHash,o.correlationId),[4,s.monitorIframeForHash(a,this.config.system.iframeHashTimeout)];case 4:if(u=S.sent(),h=Se.getDeserializedHash(u),p=this.validateAndExtractStateFromHash(h,ne.Silent,i.correlationId),h.accountId){if(this.logger.verbose("Account id found in hash, calling WAM for token"),!this.nativeMessageHandler)throw B.createNativeConnectionNotEstablishedError();return f=new en(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,this.apiId,this.performanceClient,this.nativeMessageHandler,h.accountId,this.browserStorage,this.correlationId),b=to.parseRequestState(this.browserCrypto,p).userRequestState,[2,f.acquireToken(ae(ae({},o),{state:b,prompt:o.prompt||or.NONE})).finally(function(){C.browserStorage.cleanRequestByState(p)})]}return this.performanceClient.setPreQueueTime($.HandleCodeResponseFromHash,o.correlationId),[2,s.handleCodeResponseFromHash(u,p,t.authority,this.networkClient)]}})})},e}(li);l();c();d();var Ay=function(r){mt(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.acquireToken=function(t){return D(this,void 0,void 0,function(){var o,i,n,s,a,u=this;return F(this,function(h){switch(h.label){case 0:return this.performanceClient.addQueueMeasurement($.SilentRefreshClientAcquireToken,t.correlationId),this.performanceClient.setPreQueueTime($.InitializeBaseRequest,t.correlationId),i=[ae({},t)],[4,this.initializeBaseRequest(t,t.account)];case 1:return o=ae.apply(void 0,i.concat([h.sent()])),n=this.performanceClient.startMeasurement($.SilentRefreshClientAcquireToken,o.correlationId),s=this.initializeServerTelemetryManager(ct.acquireTokenSilent_silentFlow),[4,this.createRefreshTokenClient(s,o.authority,o.azureCloudOptions)];case 2:return a=h.sent(),this.logger.verbose("Refresh token client created"),this.performanceClient.setPreQueueTime($.RefreshTokenClientAcquireTokenByRefreshToken,t.correlationId),[2,a.acquireTokenByRefreshToken(o).then(function(p){return n.endMeasurement({success:!0,fromCache:p.fromCache,requestId:p.requestId}),p}).catch(function(p){throw p instanceof ee&&p.setCorrelationId(u.correlationId),s.cacheFailedRequest(p),n.endMeasurement({errorCode:p.errorCode,subErrorCode:p.subError,success:!1}),p})]}})})},e.prototype.logout=function(){return Promise.reject(B.createSilentLogoutUnsupportedError())},e.prototype.createRefreshTokenClient=function(t,o,i){return D(this,void 0,void 0,function(){var n;return F(this,function(s){switch(s.label){case 0:return this.performanceClient.setPreQueueTime($.StandardInteractionClientGetClientConfiguration,this.correlationId),[4,this.getClientConfiguration(t,o,i)];case 1:return n=s.sent(),[2,new Eu(n,this.performanceClient)]}})})},e}(li);l();c();d();var Ry=function(){function r(e,t){this.eventCallbacks=new Map,this.logger=e,this.browserCrypto=t,this.listeningToStorageEvents=!1,this.handleAccountCacheChange=this.handleAccountCacheChange.bind(this)}return r.prototype.addEventCallback=function(e){if(typeof window<"u"){var t=this.browserCrypto.createNewGuid();return this.eventCallbacks.set(t,e),this.logger.verbose("Event callback registered with id: "+t),t}return null},r.prototype.removeEventCallback=function(e){this.eventCallbacks.delete(e),this.logger.verbose("Event callback "+e+" removed.")},r.prototype.enableAccountStorageEvents=function(){typeof window>"u"||(this.listeningToStorageEvents?this.logger.verbose("Account storage listener already registered."):(this.logger.verbose("Adding account storage listener."),this.listeningToStorageEvents=!0,window.addEventListener("storage",this.handleAccountCacheChange)))},r.prototype.disableAccountStorageEvents=function(){typeof window>"u"||(this.listeningToStorageEvents?(this.logger.verbose("Removing account storage listener."),window.removeEventListener("storage",this.handleAccountCacheChange),this.listeningToStorageEvents=!1):this.logger.verbose("No account storage listener registered."))},r.prototype.emitEvent=function(e,t,o,i){var n=this;if(typeof window<"u"){var s={eventType:e,interactionType:t||null,payload:o||null,error:i||null,timestamp:Date.now()};this.logger.info("Emitting event: "+e),this.eventCallbacks.forEach(function(a,u){n.logger.verbose("Emitting event to callback "+u+": "+e),a.apply(null,[s])})}},r.prototype.handleAccountCacheChange=function(e){try{var t=e.newValue||e.oldValue;if(!t)return;var o=JSON.parse(t);if(typeof o!="object"||!Nt.isAccountEntity(o))return;var i=Xr.toObject(new Nt,o),n=i.getAccountInfo();!e.oldValue&&e.newValue?(this.logger.info("Account was added to cache in a different window"),this.emitEvent(he.ACCOUNT_ADDED,void 0,n)):!e.newValue&&e.oldValue&&(this.logger.info("Account was removed from cache in a different window"),this.emitEvent(he.ACCOUNT_REMOVED,void 0,n))}catch{return}},r}();l();c();d();l();c();d();l();c();d();var io=function(){function r(){}return r.decimalToHex=function(e){for(var t=e.toString(16);t.length<2;)t="0"+t;return t},r}();var Ff=function(){function r(e){this.cryptoObj=e}return r.prototype.generateGuid=function(){try{var e=new Uint8Array(16);return this.cryptoObj.getRandomValues(e),e[6]|=64,e[6]&=79,e[8]|=128,e[8]&=191,io.decimalToHex(e[0])+io.decimalToHex(e[1])+io.decimalToHex(e[2])+io.decimalToHex(e[3])+"-"+io.decimalToHex(e[4])+io.decimalToHex(e[5])+"-"+io.decimalToHex(e[6])+io.decimalToHex(e[7])+"-"+io.decimalToHex(e[8])+io.decimalToHex(e[9])+"-"+io.decimalToHex(e[10])+io.decimalToHex(e[11])+io.decimalToHex(e[12])+io.decimalToHex(e[13])+io.decimalToHex(e[14])+io.decimalToHex(e[15])}catch{for(var t="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx",o="0123456789abcdef",i=0,n=_.EMPTY_STRING,s=0;s<36;s++)t[s]!=="-"&&t[s]!=="4"&&(i=Math.random()*16|0),t[s]==="x"?n+=o[i]:t[s]==="y"?(i&=3,i|=8,n+=o[i]):n+=t[s];return n}},r.prototype.isGuid=function(e){var t=/^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i;return t.test(e)},r}();l();c();d();l();c();d();var zo=function(){function r(){}return r.stringToUtf8Arr=function(e){for(var t,o=0,i=e.length,n=0;n>>6),s[a++]=128+(t&63)):t<65536?(s[a++]=224+(t>>>12),s[a++]=128+(t>>>6&63),s[a++]=128+(t&63)):t<2097152?(s[a++]=240+(t>>>18),s[a++]=128+(t>>>12&63),s[a++]=128+(t>>>6&63),s[a++]=128+(t&63)):t<67108864?(s[a++]=248+(t>>>24),s[a++]=128+(t>>>18&63),s[a++]=128+(t>>>12&63),s[a++]=128+(t>>>6&63),s[a++]=128+(t&63)):(s[a++]=252+(t>>>30),s[a++]=128+(t>>>24&63),s[a++]=128+(t>>>18&63),s[a++]=128+(t>>>12&63),s[a++]=128+(t>>>6&63),s[a++]=128+(t&63));return s},r.stringToArrayBuffer=function(e){for(var t=new ArrayBuffer(e.length),o=new Uint8Array(t),i=0;i251&&o<254&&n+5247&&o<252&&n+4239&&o<248&&n+3223&&o<240&&n+2191&&o<224&&n+1>>i&24),(i===2||e.length-a===1)&&(o+=String.fromCharCode(this.uint6ToB64(s>>>18&63),this.uint6ToB64(s>>>12&63),this.uint6ToB64(s>>>6&63),this.uint6ToB64(s&63)),s=0);return t===0?o:o.substring(0,o.length-t)+(t===1?"=":"==")},r.prototype.uint6ToB64=function(e){return e<26?e+65:e<52?e+71:e<62?e-4:e===62?43:e===63?47:65},r}();l();c();d();var D_=function(){function r(){}return r.prototype.decode=function(e){var t=e.replace(/-/g,"+").replace(/_/g,"/");switch(t.length%4){case 0:break;case 2:t+="==";break;case 3:t+="=";break;default:throw new Error("Invalid base64 string")}var o=this.base64DecToArr(t);return zo.utf8ArrToString(o)},r.prototype.base64DecToArr=function(e,t){for(var o=e.replace(/[^A-Za-z0-9\+\/]/g,_.EMPTY_STRING),i=o.length,n=t?Math.ceil((i*3+1>>>2)/t)*t:i*3+1>>>2,s=new Uint8Array(n),a=void 0,u=void 0,h=0,p=0,f=0;f>>(16>>>a&24)&255;h=0}return s},r.prototype.b64ToUint6=function(e){return e>64&&e<91?e-65:e>96&&e<123?e-71:e>47&&e<58?e+4:e===43?62:e===47?63:0},r}();l();c();d();var _9=32,F_=function(){function r(e){this.base64Encode=new Lf,this.cryptoObj=e}return r.prototype.generateCodes=function(){return D(this,void 0,void 0,function(){var e,t;return F(this,function(o){switch(o.label){case 0:return e=this.generateCodeVerifier(),[4,this.generateCodeChallengeFromVerifier(e)];case 1:return t=o.sent(),[2,{verifier:e,challenge:t}]}})})},r.prototype.generateCodeVerifier=function(){try{var e=new Uint8Array(_9);this.cryptoObj.getRandomValues(e);var t=this.base64Encode.urlEncodeArr(e);return t}catch(o){throw B.createPkceNotGeneratedError(o)}},r.prototype.generateCodeChallengeFromVerifier=function(e){return D(this,void 0,void 0,function(){var t,o;return F(this,function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),[4,this.cryptoObj.sha256Digest(e)];case 1:return t=i.sent(),[2,this.base64Encode.urlEncodeArr(new Uint8Array(t))];case 2:throw o=i.sent(),B.createPkceNotGeneratedError(o);case 3:return[2]}})})},r}();l();c();d();l();c();d();var L_=function(){function r(){}return r.prototype.getRandomValues=function(e){return window.crypto.getRandomValues(e)},r.prototype.generateKey=function(e,t,o){return D(this,void 0,void 0,function(){return F(this,function(i){return[2,window.crypto.subtle.generateKey(e,t,o)]})})},r.prototype.exportKey=function(e){return D(this,void 0,void 0,function(){return F(this,function(t){return[2,window.crypto.subtle.exportKey(ms,e)]})})},r.prototype.importKey=function(e,t,o,i){return D(this,void 0,void 0,function(){return F(this,function(n){return[2,window.crypto.subtle.importKey(ms,e,t,o,i)]})})},r.prototype.sign=function(e,t,o){return D(this,void 0,void 0,function(){return F(this,function(i){return[2,window.crypto.subtle.sign(e,t,o)]})})},r.prototype.digest=function(e,t){return D(this,void 0,void 0,function(){return F(this,function(o){return[2,window.crypto.subtle.digest(e,t)]})})},r}();l();c();d();var N_=function(){function r(){}return r.prototype.initPrng=function(e){return window.msrCrypto.initPrng(Tc(e))},r.prototype.getRandomValues=function(e){return window.msrCrypto.getRandomValues(e)},r.prototype.generateKey=function(e,t,o){return D(this,void 0,void 0,function(){return F(this,function(i){return[2,window.msrCrypto.subtle.generateKey(e,t,o)]})})},r.prototype.exportKey=function(e){return D(this,void 0,void 0,function(){return F(this,function(t){return[2,window.msrCrypto.subtle.exportKey(ms,e)]})})},r.prototype.importKey=function(e,t,o,i){return D(this,void 0,void 0,function(){return F(this,function(n){return[2,window.msrCrypto.subtle.importKey(ms,e,t,o,i)]})})},r.prototype.sign=function(e,t,o){return D(this,void 0,void 0,function(){return F(this,function(i){return[2,window.msrCrypto.subtle.sign(e,t,o)]})})},r.prototype.digest=function(e,t){return D(this,void 0,void 0,function(){return F(this,function(o){return[2,window.msrCrypto.subtle.digest(e,t)]})})},r}();l();c();d();var H_=function(){function r(){}return r.prototype.getRandomValues=function(e){return window.msCrypto.getRandomValues(e)},r.prototype.generateKey=function(e,t,o){return D(this,void 0,void 0,function(){return F(this,function(i){return[2,new Promise(function(n,s){var a=window.msCrypto.subtle.generateKey(e,t,o);a.addEventListener("complete",function(u){n(u.target.result)}),a.addEventListener("error",function(u){s(u)})})]})})},r.prototype.exportKey=function(e){return D(this,void 0,void 0,function(){return F(this,function(t){return[2,new Promise(function(o,i){var n=window.msCrypto.subtle.exportKey(ms,e);n.addEventListener("complete",function(s){var a=s.target.result,u=zo.utf8ArrToString(new Uint8Array(a)).replace(/\r/g,_.EMPTY_STRING).replace(/\n/g,_.EMPTY_STRING).replace(/\t/g,_.EMPTY_STRING).split(" ").join(_.EMPTY_STRING).replace("\0",_.EMPTY_STRING);try{o(JSON.parse(u))}catch(h){i(h)}}),n.addEventListener("error",function(s){i(s)})})]})})},r.prototype.importKey=function(e,t,o,i){return D(this,void 0,void 0,function(){var n,s;return F(this,function(a){return n=zo.getSortedObjectString(e),s=zo.stringToArrayBuffer(n),[2,new Promise(function(u,h){var p=window.msCrypto.subtle.importKey(ms,s,t,o,i);p.addEventListener("complete",function(f){u(f.target.result)}),p.addEventListener("error",function(f){h(f)})})]})})},r.prototype.sign=function(e,t,o){return D(this,void 0,void 0,function(){return F(this,function(i){return[2,new Promise(function(n,s){var a=window.msCrypto.subtle.sign(e,t,o);a.addEventListener("complete",function(u){n(u.target.result)}),a.addEventListener("error",function(u){s(u)})})]})})},r.prototype.digest=function(e,t){return D(this,void 0,void 0,function(){return F(this,function(o){return[2,new Promise(function(i,n){var s=window.msCrypto.subtle.digest(e,t.buffer);s.addEventListener("complete",function(a){i(a.target.result)}),s.addEventListener("error",function(a){n(a)})})]})})},r}();var T9="RSASSA-PKCS1-v1_5",U_="SHA-256",E9=2048,I9=new Uint8Array([1,0,1]),Nf=function(){function r(e,t){var o,i;if(this.logger=e,this.cryptoOptions=t,this.hasBrowserCrypto())this.logger.verbose("BrowserCrypto: modern crypto interface available"),this.subtleCrypto=new L_;else if(this.hasIECrypto())this.logger.verbose("BrowserCrypto: MS crypto interface available"),this.subtleCrypto=new H_;else if(this.hasMsrCrypto()&&(!((o=this.cryptoOptions)===null||o===void 0)&&o.useMsrCrypto))this.logger.verbose("BrowserCrypto: MSR crypto interface available"),this.subtleCrypto=new N_;else throw this.hasMsrCrypto()&&this.logger.info("BrowserCrypto: MSR Crypto interface available but system.cryptoOptions.useMsrCrypto not enabled"),this.logger.error("BrowserCrypto: No crypto interfaces available."),B.createCryptoNotAvailableError("Browser crypto, msCrypto, or msrCrypto interfaces not available.");if(this.subtleCrypto.initPrng){if(this.logger.verbose("BrowserCrypto: Interface requires entropy"),!(!((i=this.cryptoOptions)===null||i===void 0)&&i.entropy))throw this.logger.error("BrowserCrypto: Interface requires entropy but none provided."),gs.createEntropyNotProvided();this.logger.verbose("BrowserCrypto: Entropy provided"),this.subtleCrypto.initPrng(this.cryptoOptions.entropy)}this.keygenAlgorithmOptions={name:T9,hash:U_,modulusLength:E9,publicExponent:I9}}return r.prototype.hasIECrypto=function(){return"msCrypto"in window},r.prototype.hasBrowserCrypto=function(){return"crypto"in window},r.prototype.hasMsrCrypto=function(){return"msrCrypto"in window},r.prototype.sha256Digest=function(e){return D(this,void 0,void 0,function(){var t;return F(this,function(o){return t=zo.stringToUtf8Arr(e),[2,this.subtleCrypto.digest({name:U_},t)]})})},r.prototype.getRandomValues=function(e){return this.subtleCrypto.getRandomValues(e)},r.prototype.generateKeyPair=function(e,t){return D(this,void 0,void 0,function(){return F(this,function(o){return[2,this.subtleCrypto.generateKey(this.keygenAlgorithmOptions,e,t)]})})},r.prototype.exportJwk=function(e){return D(this,void 0,void 0,function(){return F(this,function(t){return[2,this.subtleCrypto.exportKey(e)]})})},r.prototype.importJwk=function(e,t,o){return D(this,void 0,void 0,function(){return F(this,function(i){return[2,this.subtleCrypto.importKey(e,this.keygenAlgorithmOptions,t,o)]})})},r.prototype.sign=function(e,t){return D(this,void 0,void 0,function(){return F(this,function(o){return[2,this.subtleCrypto.sign(this.keygenAlgorithmOptions,e,t)]})})},r}();l();c();d();l();c();d();l();c();d();var B_=function(){function r(){this.dbName=Pf,this.version=A_,this.tableName=R_,this.dbOpen=!1}return r.prototype.open=function(){return D(this,void 0,void 0,function(){var e=this;return F(this,function(t){return[2,new Promise(function(o,i){var n=window.indexedDB.open(e.dbName,e.version);n.addEventListener("upgradeneeded",function(s){var a=s;a.target.result.createObjectStore(e.tableName)}),n.addEventListener("success",function(s){var a=s;e.db=a.target.result,e.dbOpen=!0,o()}),n.addEventListener("error",function(){return i(B.createDatabaseUnavailableError())})})]})})},r.prototype.closeConnection=function(){var e=this.db;e&&this.dbOpen&&(e.close(),this.dbOpen=!1)},r.prototype.validateDbIsOpen=function(){return D(this,void 0,void 0,function(){return F(this,function(e){switch(e.label){case 0:return this.dbOpen?[3,2]:[4,this.open()];case 1:return[2,e.sent()];case 2:return[2]}})})},r.prototype.getItem=function(e){return D(this,void 0,void 0,function(){var t=this;return F(this,function(o){switch(o.label){case 0:return[4,this.validateDbIsOpen()];case 1:return o.sent(),[2,new Promise(function(i,n){if(!t.db)return n(B.createDatabaseNotOpenError());var s=t.db.transaction([t.tableName],"readonly"),a=s.objectStore(t.tableName),u=a.get(e);u.addEventListener("success",function(h){var p=h;t.closeConnection(),i(p.target.result)}),u.addEventListener("error",function(h){t.closeConnection(),n(h)})})]}})})},r.prototype.setItem=function(e,t){return D(this,void 0,void 0,function(){var o=this;return F(this,function(i){switch(i.label){case 0:return[4,this.validateDbIsOpen()];case 1:return i.sent(),[2,new Promise(function(n,s){if(!o.db)return s(B.createDatabaseNotOpenError());var a=o.db.transaction([o.tableName],"readwrite"),u=a.objectStore(o.tableName),h=u.put(t,e);h.addEventListener("success",function(){o.closeConnection(),n()}),h.addEventListener("error",function(p){o.closeConnection(),s(p)})})]}})})},r.prototype.removeItem=function(e){return D(this,void 0,void 0,function(){var t=this;return F(this,function(o){switch(o.label){case 0:return[4,this.validateDbIsOpen()];case 1:return o.sent(),[2,new Promise(function(i,n){if(!t.db)return n(B.createDatabaseNotOpenError());var s=t.db.transaction([t.tableName],"readwrite"),a=s.objectStore(t.tableName),u=a.delete(e);u.addEventListener("success",function(){t.closeConnection(),i()}),u.addEventListener("error",function(h){t.closeConnection(),n(h)})})]}})})},r.prototype.getKeys=function(){return D(this,void 0,void 0,function(){var e=this;return F(this,function(t){switch(t.label){case 0:return[4,this.validateDbIsOpen()];case 1:return t.sent(),[2,new Promise(function(o,i){if(!e.db)return i(B.createDatabaseNotOpenError());var n=e.db.transaction([e.tableName],"readonly"),s=n.objectStore(e.tableName),a=s.getAllKeys();a.addEventListener("success",function(u){var h=u;e.closeConnection(),o(h.target.result)}),a.addEventListener("error",function(u){e.closeConnection(),i(u)})})]}})})},r.prototype.containsKey=function(e){return D(this,void 0,void 0,function(){var t=this;return F(this,function(o){switch(o.label){case 0:return[4,this.validateDbIsOpen()];case 1:return o.sent(),[2,new Promise(function(i,n){if(!t.db)return n(B.createDatabaseNotOpenError());var s=t.db.transaction([t.tableName],"readonly"),a=s.objectStore(t.tableName),u=a.count(e);u.addEventListener("success",function(h){var p=h;t.closeConnection(),i(p.target.result===1)}),u.addEventListener("error",function(h){t.closeConnection(),n(h)})})]}})})},r.prototype.deleteDatabase=function(){return D(this,void 0,void 0,function(){return F(this,function(e){return this.db&&this.dbOpen&&this.closeConnection(),[2,new Promise(function(t,o){var i=window.indexedDB.deleteDatabase(Pf);i.addEventListener("success",function(){return t(!0)}),i.addEventListener("blocked",function(){return t(!0)}),i.addEventListener("error",function(){return o(!1)})})]})})},r}();var Py=function(){function r(e,t){this.inMemoryCache=new Au,this.indexedDBCache=new B_,this.logger=e,this.storeName=t}return r.prototype.handleDatabaseAccessError=function(e){if(e instanceof B&&e.errorCode===q.databaseUnavailable.code)this.logger.error("Could not access persistent storage. This may be caused by browser privacy features which block persistent storage in third-party contexts.");else throw e},r.prototype.getItem=function(e){return D(this,void 0,void 0,function(){var t,o;return F(this,function(i){switch(i.label){case 0:if(t=this.inMemoryCache.getItem(e),t)return[3,4];i.label=1;case 1:return i.trys.push([1,3,,4]),this.logger.verbose("Queried item not found in in-memory cache, now querying persistent storage."),[4,this.indexedDBCache.getItem(e)];case 2:return[2,i.sent()];case 3:return o=i.sent(),this.handleDatabaseAccessError(o),[3,4];case 4:return[2,t]}})})},r.prototype.setItem=function(e,t){return D(this,void 0,void 0,function(){var o;return F(this,function(i){switch(i.label){case 0:this.inMemoryCache.setItem(e,t),i.label=1;case 1:return i.trys.push([1,3,,4]),[4,this.indexedDBCache.setItem(e,t)];case 2:return i.sent(),[3,4];case 3:return o=i.sent(),this.handleDatabaseAccessError(o),[3,4];case 4:return[2]}})})},r.prototype.removeItem=function(e){return D(this,void 0,void 0,function(){var t;return F(this,function(o){switch(o.label){case 0:this.inMemoryCache.removeItem(e),o.label=1;case 1:return o.trys.push([1,3,,4]),[4,this.indexedDBCache.removeItem(e)];case 2:return o.sent(),[3,4];case 3:return t=o.sent(),this.handleDatabaseAccessError(t),[3,4];case 4:return[2]}})})},r.prototype.getKeys=function(){return D(this,void 0,void 0,function(){var e,t;return F(this,function(o){switch(o.label){case 0:if(e=this.inMemoryCache.getKeys(),e.length!==0)return[3,4];o.label=1;case 1:return o.trys.push([1,3,,4]),this.logger.verbose("In-memory cache is empty, now querying persistent storage."),[4,this.indexedDBCache.getKeys()];case 2:return[2,o.sent()];case 3:return t=o.sent(),this.handleDatabaseAccessError(t),[3,4];case 4:return[2,e]}})})},r.prototype.containsKey=function(e){return D(this,void 0,void 0,function(){var t,o;return F(this,function(i){switch(i.label){case 0:if(t=this.inMemoryCache.containsKey(e),t)return[3,4];i.label=1;case 1:return i.trys.push([1,3,,4]),this.logger.verbose("Key not found in in-memory cache, now querying persistent storage."),[4,this.indexedDBCache.containsKey(e)];case 2:return[2,i.sent()];case 3:return o=i.sent(),this.handleDatabaseAccessError(o),[3,4];case 4:return[2,t]}})})},r.prototype.clearInMemory=function(){this.logger.verbose("Deleting in-memory keystore "+this.storeName),this.inMemoryCache.clear(),this.logger.verbose("In-memory keystore "+this.storeName+" deleted")},r.prototype.clearPersistent=function(){return D(this,void 0,void 0,function(){var e,t;return F(this,function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),this.logger.verbose("Deleting persistent keystore"),[4,this.indexedDBCache.deleteDatabase()];case 1:return e=o.sent(),e&&this.logger.verbose("Persistent keystore deleted"),[2,e];case 2:return t=o.sent(),this.handleDatabaseAccessError(t),[2,!1];case 3:return[2]}})})},r}();var Hf;(function(r){r.asymmetricKeys="asymmetricKeys",r.symmetricKeys="symmetricKeys"})(Hf||(Hf={}));var z_=function(){function r(e){this.logger=e,this.asymmetricKeys=new Py(this.logger,Hf.asymmetricKeys),this.symmetricKeys=new Py(this.logger,Hf.symmetricKeys)}return r.prototype.clear=function(){return D(this,void 0,void 0,function(){var e;return F(this,function(t){switch(t.label){case 0:this.asymmetricKeys.clearInMemory(),this.symmetricKeys.clearInMemory(),t.label=1;case 1:return t.trys.push([1,3,,4]),[4,this.asymmetricKeys.clearPersistent()];case 2:return t.sent(),[2,!0];case 3:return e=t.sent(),e instanceof Error?this.logger.error("Clearing keystore failed with error: "+e.message):this.logger.error("Clearing keystore failed with unknown error"),[2,!1];case 4:return[2]}})})},r}();var Mu=function(){function r(e,t,o){this.logger=e,this.browserCrypto=new Nf(this.logger,o),this.b64Encode=new Lf,this.b64Decode=new D_,this.guidGenerator=new Ff(this.browserCrypto),this.pkceGenerator=new F_(this.browserCrypto),this.cache=new z_(this.logger),this.performanceClient=t}return r.prototype.createNewGuid=function(){return this.guidGenerator.generateGuid()},r.prototype.base64Encode=function(e){return this.b64Encode.encode(e)},r.prototype.base64Decode=function(e){return this.b64Decode.decode(e)},r.prototype.generatePkceCodes=function(){return D(this,void 0,void 0,function(){return F(this,function(e){return[2,this.pkceGenerator.generateCodes()]})})},r.prototype.getPublicKeyThumbprint=function(e){var t;return D(this,void 0,void 0,function(){var o,i,n,s,a,u,h,p;return F(this,function(f){switch(f.label){case 0:return o=(t=this.performanceClient)===null||t===void 0?void 0:t.startMeasurement($.CryptoOptsGetPublicKeyThumbprint,e.correlationId),[4,this.browserCrypto.generateKeyPair(r.EXTRACTABLE,r.POP_KEY_USAGES)];case 1:return i=f.sent(),[4,this.browserCrypto.exportJwk(i.publicKey)];case 2:return n=f.sent(),s={e:n.e,kty:n.kty,n:n.n},a=zo.getSortedObjectString(s),[4,this.hashString(a)];case 3:return u=f.sent(),[4,this.browserCrypto.exportJwk(i.privateKey)];case 4:return h=f.sent(),[4,this.browserCrypto.importJwk(h,!1,["sign"])];case 5:return p=f.sent(),[4,this.cache.asymmetricKeys.setItem(u,{privateKey:p,publicKey:i.publicKey,requestMethod:e.resourceRequestMethod,requestUri:e.resourceRequestUri})];case 6:return f.sent(),o&&o.endMeasurement({success:!0}),[2,u]}})})},r.prototype.removeTokenBindingKey=function(e){return D(this,void 0,void 0,function(){var t;return F(this,function(o){switch(o.label){case 0:return[4,this.cache.asymmetricKeys.removeItem(e)];case 1:return o.sent(),[4,this.cache.asymmetricKeys.containsKey(e)];case 2:return t=o.sent(),[2,!t]}})})},r.prototype.clearKeystore=function(){return D(this,void 0,void 0,function(){return F(this,function(e){switch(e.label){case 0:return[4,this.cache.clear()];case 1:return[2,e.sent()]}})})},r.prototype.signJwt=function(e,t,o){var i;return D(this,void 0,void 0,function(){var n,s,a,u,h,p,f,b,C,S,R,H,ye;return F(this,function(ie){switch(ie.label){case 0:return n=(i=this.performanceClient)===null||i===void 0?void 0:i.startMeasurement($.CryptoOptsSignJwt,o),[4,this.cache.asymmetricKeys.getItem(t)];case 1:if(s=ie.sent(),!s)throw B.createSigningKeyNotFoundInStorageError(t);return[4,this.browserCrypto.exportJwk(s.publicKey)];case 2:return a=ie.sent(),u=zo.getSortedObjectString(a),h=this.b64Encode.urlEncode(JSON.stringify({kid:t})),p=by.getShrHeaderString({kid:h,alg:a.alg}),f=this.b64Encode.urlEncode(p),e.cnf={jwk:JSON.parse(u)},b=this.b64Encode.urlEncode(JSON.stringify(e)),C=f+"."+b,S=zo.stringToArrayBuffer(C),[4,this.browserCrypto.sign(s.privateKey,S)];case 3:return R=ie.sent(),H=this.b64Encode.urlEncodeArr(new Uint8Array(R)),ye=C+"."+H,n&&n.endMeasurement({success:!0}),[2,ye]}})})},r.prototype.hashString=function(e){return D(this,void 0,void 0,function(){var t,o;return F(this,function(i){switch(i.label){case 0:return[4,this.browserCrypto.sha256Digest(e)];case 1:return t=i.sent(),o=new Uint8Array(t),[2,this.b64Encode.urlEncodeArr(o)]}})})},r.POP_KEY_USAGES=["sign","verify"],r.EXTRACTABLE=!0,r}();l();c();d();l();c();d();var Uf=function(){function r(e,t){this.correlationId=t,this.measureName=r.makeMeasureName(e,t),this.startMark=r.makeStartMark(e,t),this.endMark=r.makeEndMark(e,t)}return r.makeMeasureName=function(e,t){return"msal.measure."+e+"."+t},r.makeStartMark=function(e,t){return"msal.start."+e+"."+t},r.makeEndMark=function(e,t){return"msal.end."+e+"."+t},r.supportsBrowserPerformance=function(){return typeof window<"u"&&typeof window.performance<"u"&&typeof window.performance.mark=="function"&&typeof window.performance.measure=="function"&&typeof window.performance.clearMarks=="function"&&typeof window.performance.clearMeasures=="function"&&typeof window.performance.getEntriesByName=="function"},r.flushMeasurements=function(e,t){if(r.supportsBrowserPerformance())try{t.forEach(function(o){var i=r.makeMeasureName(o.name,e),n=window.performance.getEntriesByName(i,"measure");n.length>0&&(window.performance.clearMeasures(i),window.performance.clearMarks(r.makeStartMark(i,e)),window.performance.clearMarks(r.makeEndMark(i,e)))})}catch{}},r.prototype.startMeasurement=function(){if(r.supportsBrowserPerformance())try{window.performance.mark(this.startMark)}catch{}},r.prototype.endMeasurement=function(){if(r.supportsBrowserPerformance())try{window.performance.mark(this.endMark),window.performance.measure(this.measureName,this.startMark,this.endMark)}catch{}},r.prototype.flushMeasurement=function(){if(r.supportsBrowserPerformance())try{var e=window.performance.getEntriesByName(this.measureName,"measure");if(e.length>0){var t=e[0].duration;return window.performance.clearMeasures(this.measureName),window.performance.clearMarks(this.startMark),window.performance.clearMarks(this.endMark),t}}catch{}return null},r}();var $y=function(r){mt(e,r);function e(t,o,i,n,s,a,u){var h=r.call(this,t,o,i,n,s,a)||this;return h.browserCrypto=new Nf(h.logger,u),h.guidGenerator=new Ff(h.browserCrypto),h}return e.prototype.startPerformanceMeasuremeant=function(t,o){return new Uf(t,o)},e.prototype.generateId=function(){return this.guidGenerator.generateGuid()},e.prototype.getPageVisibility=function(){var t;return((t=document.visibilityState)===null||t===void 0?void 0:t.toString())||null},e.prototype.deleteIncompleteSubMeasurements=function(t){var o=this.eventsByCorrelationId.get(t.event.correlationId),i=o&&o.eventId===t.event.eventId,n=[];i&&o?.incompleteSubMeasurements&&o.incompleteSubMeasurements.forEach(function(s){n.push(ae({},s))}),n.length>0&&Uf.flushMeasurements(t.event.correlationId,n)},e.prototype.supportsBrowserPerformanceNow=function(){return typeof window<"u"&&typeof window.performance<"u"&&typeof window.performance.now=="function"},e.prototype.startMeasurement=function(t,o){var i=this,n=this.getPageVisibility(),s=r.prototype.startMeasurement.call(this,t,o);return ae(ae({},s),{endMeasurement:function(a){var u=s.endMeasurement(ae({startPageVisibility:n,endPageVisibility:i.getPageVisibility()},a));return i.deleteIncompleteSubMeasurements(s),u},discardMeasurement:function(){s.discardMeasurement(),i.deleteIncompleteSubMeasurements(s),s.measurement.flushMeasurement()}})},e.prototype.setPreQueueTime=function(t,o){if(!this.supportsBrowserPerformanceNow()){this.logger.trace("BrowserPerformanceClient: window performance API not available, unable to set telemetry queue time for "+t);return}if(!o){this.logger.trace("BrowserPerformanceClient: correlationId for "+t+" not provided, unable to set telemetry queue time");return}var i=this.preQueueTimeByCorrelationId.get(o);i&&(this.logger.trace("BrowserPerformanceClient: Incomplete pre-queue "+i.name+" found",o),this.addQueueMeasurement(i.name,o,void 0,!0)),this.preQueueTimeByCorrelationId.set(o,{name:t,time:window.performance.now()})},e.prototype.addQueueMeasurement=function(t,o,i,n){if(!this.supportsBrowserPerformanceNow()){this.logger.trace("BrowserPerformanceClient: window performance API not available, unable to add queue measurement for "+t);return}if(!o){this.logger.trace("BrowserPerformanceClient: correlationId for "+t+" not provided, unable to add queue measurement");return}var s=r.prototype.getPreQueueTime.call(this,t,o);if(s){var a=window.performance.now(),u=i||r.prototype.calculateQueuedTime.call(this,s,a);return r.prototype.addQueueMeasurement.call(this,t,o,u,n)}},e}(Iu);l();c();d();l();c();d();l();c();d();var V_=function(){function r(e,t,o,i){this.isBrowserEnvironment=typeof window<"u",this.config=e,this.storage=t,this.logger=o,this.cryptoObj=i}return r.prototype.loadExternalTokens=function(e,t,o){if(this.logger.info("TokenCache - loadExternalTokens called"),!t.id_token)throw B.createUnableToLoadTokenError("Please ensure server response includes id token.");var i=new fr(t.id_token,this.cryptoObj),n,s;if(e.account){var a=this.loadAccount(i,e.account.environment,void 0,void 0,e.account.homeAccountId);n=new hs(a,this.loadIdToken(i,a.homeAccountId,e.account.environment,e.account.tenantId),this.loadAccessToken(e,t,a.homeAccountId,e.account.environment,e.account.tenantId,o),this.loadRefreshToken(e,t,a.homeAccountId,e.account.environment))}else if(e.authority){var u=fs.generateAuthority(e.authority,e.azureCloudOptions),h={protocolMode:this.config.auth.protocolMode,knownAuthorities:this.config.auth.knownAuthorities,cloudDiscoveryMetadata:this.config.auth.cloudDiscoveryMetadata,authorityMetadata:this.config.auth.authorityMetadata,skipAuthorityMetadataCache:this.config.auth.skipAuthorityMetadataCache};if(s=new fs(u,this.config.system.networkClient,this.storage,h,this.logger),o.clientInfo){this.logger.trace("TokenCache - homeAccountId from options");var a=this.loadAccount(i,s.hostnameAndPort,o.clientInfo,s.authorityType);n=new hs(a,this.loadIdToken(i,a.homeAccountId,s.hostnameAndPort,s.tenant),this.loadAccessToken(e,t,a.homeAccountId,s.hostnameAndPort,s.tenant,o),this.loadRefreshToken(e,t,a.homeAccountId,s.hostnameAndPort))}else if(t.client_info){this.logger.trace("TokenCache - homeAccountId from response");var a=this.loadAccount(i,s.hostnameAndPort,t.client_info,s.authorityType);n=new hs(a,this.loadIdToken(i,a.homeAccountId,s.hostnameAndPort,s.tenant),this.loadAccessToken(e,t,a.homeAccountId,s.hostnameAndPort,s.tenant,o),this.loadRefreshToken(e,t,a.homeAccountId,s.hostnameAndPort))}else throw B.createUnableToLoadTokenError("Please provide clientInfo in the response or options.")}else throw B.createUnableToLoadTokenError("Please provide a request with an account or a request with authority.");return this.generateAuthenticationResult(e,i,n,s)},r.prototype.loadAccount=function(e,t,o,i,n){var s;if(n?s=n:i!==void 0&&o&&(s=Nt.generateHomeAccountId(o,i,this.logger,this.cryptoObj,e)),!s)throw B.createUnableToLoadTokenError("Unexpected missing homeAccountId");var a=o?Nt.createAccount(o,s,e,void 0,void 0,void 0,t):Nt.createGenericAccount(s,e,void 0,void 0,void 0,t);if(this.isBrowserEnvironment)return this.logger.verbose("TokenCache - loading account"),this.storage.setAccount(a),a;throw B.createUnableToLoadTokenError("loadExternalTokens is designed to work in browser environments only.")},r.prototype.loadIdToken=function(e,t,o,i){var n=vi.createIdTokenEntity(t,o,e.rawToken,this.config.auth.clientId,i);if(this.isBrowserEnvironment)return this.logger.verbose("TokenCache - loading id token"),this.storage.setIdTokenCredential(n),n;throw B.createUnableToLoadTokenError("loadExternalTokens is designed to work in browser environments only.")},r.prototype.loadAccessToken=function(e,t,o,i,n,s){if(!t.access_token)return this.logger.verbose("TokenCache - No access token provided for caching"),null;if(!t.expires_in)throw B.createUnableToLoadTokenError("Please ensure server response includes expires_in value.");if(!s.extendedExpiresOn)throw B.createUnableToLoadTokenError("Please provide an extendedExpiresOn value in the options.");var a=new It(e.scopes).printScopes(),u=s.expiresOn||t.expires_in+new Date().getTime()/1e3,h=s.extendedExpiresOn,p=yi.createAccessTokenEntity(o,i,t.access_token,this.config.auth.clientId,n,a,u,h,this.cryptoObj);if(this.isBrowserEnvironment)return this.logger.verbose("TokenCache - loading access token"),this.storage.setAccessTokenCredential(p),p;throw B.createUnableToLoadTokenError("loadExternalTokens is designed to work in browser environments only.")},r.prototype.loadRefreshToken=function(e,t,o,i){if(!t.refresh_token)return this.logger.verbose("TokenCache - No refresh token provided for caching"),null;var n=In.createRefreshTokenEntity(o,i,t.refresh_token,this.config.auth.clientId);if(this.isBrowserEnvironment)return this.logger.verbose("TokenCache - loading refresh token"),this.storage.setRefreshTokenCredential(n),n;throw B.createUnableToLoadTokenError("loadExternalTokens is designed to work in browser environments only.")},r.prototype.generateAuthenticationResult=function(e,t,o,i){var n,s,a,u=_.EMPTY_STRING,h=[],p=null,f;o?.accessToken&&(u=o.accessToken.secret,h=It.fromString(o.accessToken.target).asArray(),p=new Date(Number(o.accessToken.expiresOn)*1e3),f=new Date(Number(o.accessToken.extendedExpiresOn)*1e3));var b=t?.claims.oid||t?.claims.sub||_.EMPTY_STRING,C=t?.claims.tid||_.EMPTY_STRING;return{authority:i?i.canonicalAuthority:_.EMPTY_STRING,uniqueId:b,tenantId:C,scopes:h,account:o?.account?o.account.getAccountInfo():null,idToken:t?t.rawToken:_.EMPTY_STRING,idTokenClaims:t?t.claims:{},accessToken:u,fromCache:!0,expiresOn:p,correlationId:e.correlationId||_.EMPTY_STRING,requestId:_.EMPTY_STRING,extExpiresOn:f,familyId:_.EMPTY_STRING,tokenType:((n=o?.accessToken)===null||n===void 0?void 0:n.tokenType)||_.EMPTY_STRING,state:_.EMPTY_STRING,cloudGraphHostName:((s=o?.account)===null||s===void 0?void 0:s.cloudGraphHostName)||_.EMPTY_STRING,msGraphHost:((a=o?.account)===null||a===void 0?void 0:a.msGraphHost)||_.EMPTY_STRING,code:void 0,fromNativeBroker:!1}},r}();l();c();d();l();c();d();var q_=function(r){mt(e,r);function e(t){var o=r.call(this,t)||this;return o.includeRedirectUri=!1,o}return e}(Tu);var G_=function(r){mt(e,r);function e(t,o,i,n,s,a,u,h,p,f){var b=r.call(this,t,o,i,n,s,a,h,p,f)||this;return b.apiId=u,b}return e.prototype.acquireToken=function(t){return D(this,void 0,void 0,function(){var o,i,n,s,a,u,h;return F(this,function(p){switch(p.label){case 0:if(this.logger.trace("SilentAuthCodeClient.acquireToken called"),!t.code)throw B.createAuthCodeRequiredError();return this.performanceClient.setPreQueueTime($.StandardInteractionClientInitializeAuthorizationRequest,t.correlationId),[4,this.initializeAuthorizationRequest(t,ne.Silent)];case 1:o=p.sent(),this.browserStorage.updateCacheEntries(o.state,o.nonce,o.authority,o.loginHint||_.EMPTY_STRING,o.account||null),i=this.initializeServerTelemetryManager(this.apiId),p.label=2;case 2:return p.trys.push([2,4,,5]),n=ae(ae({},o),{code:t.code}),this.performanceClient.setPreQueueTime($.StandardInteractionClientGetClientConfiguration,t.correlationId),[4,this.getClientConfiguration(i,o.authority)];case 3:return s=p.sent(),a=new q_(s),this.logger.verbose("Auth code client created"),u=new Df(a,this.browserStorage,n,this.logger,this.config.system,this.performanceClient),[2,u.handleCodeResponseFromServer({code:t.code,msgraph_host:t.msGraphHost,cloud_graph_host_name:t.cloudGraphHostName,cloud_instance_host_name:t.cloudInstanceHostName},o.state,a.authority,this.networkClient,!1)];case 4:throw h=p.sent(),h instanceof ee&&h.setCorrelationId(this.correlationId),i.cacheFailedRequest(h),this.browserStorage.cleanRequestByState(o.state),h;case 5:return[2]}})})},e.prototype.logout=function(){return Promise.reject(B.createSilentLogoutUnsupportedError())},e}(li);var j_=function(){function r(e){this.isBrowserEnvironment=typeof window<"u",this.config=M_(e,this.isBrowserEnvironment),this.initialized=!1,this.logger=new _n(this.config.system.loggerOptions,Oc,Xi),this.networkClient=this.config.system.networkClient,this.navigationClient=this.config.system.navigationClient,this.redirectResponse=new Map,this.hybridAuthCodeResponses=new Map,this.performanceClient=this.isBrowserEnvironment?new $y(this.config.auth.clientId,this.config.auth.authority,this.logger,Oc,Xi,this.config.telemetry.application,this.config.system.cryptoOptions):new Cy(this.config.auth.clientId,this.config.auth.authority,this.logger,Oc,Xi,this.config.telemetry.application),this.browserCrypto=this.isBrowserEnvironment?new Mu(this.logger,this.performanceClient,this.config.system.cryptoOptions):ta,this.eventHandler=new Ry(this.logger,this.browserCrypto),this.browserStorage=this.isBrowserEnvironment?new Ru(this.config.auth.clientId,this.config.cache,this.browserCrypto,this.logger):P_(this.config.auth.clientId,this.logger);var t={cacheLocation:zt.MemoryStorage,temporaryCacheLocation:zt.MemoryStorage,storeAuthStateInCookie:!1,secureCookies:!1,cacheMigrationEnabled:!1,claimsBasedCachingEnabled:!0};this.nativeInternalStorage=new Ru(this.config.auth.clientId,t,this.browserCrypto,this.logger),this.tokenCache=new V_(this.config,this.browserStorage,this.logger,this.browserCrypto),this.trackPageVisibilityWithMeasurement=this.trackPageVisibilityWithMeasurement.bind(this)}return r.prototype.initialize=function(){return D(this,void 0,void 0,function(){var e,t,o,i,n;return F(this,function(s){switch(s.label){case 0:if(this.logger.trace("initialize called"),this.initialized)return this.logger.info("initialize has already been called, exiting early."),[2];if(e=this.config.system.allowNativeBroker,t=this.performanceClient.startMeasurement($.InitializeClientApplication),this.eventHandler.emitEvent(he.INITIALIZE_START),!e)return[3,4];s.label=1;case 1:return s.trys.push([1,3,,4]),o=this,[4,ci.createProvider(this.logger,this.config.system.nativeBrokerHandshakeTimeout,this.performanceClient)];case 2:return o.nativeExtensionProvider=s.sent(),[3,4];case 3:return i=s.sent(),this.logger.verbose(i),[3,4];case 4:return this.config.cache.claimsBasedCachingEnabled?[3,6]:(this.logger.verbose("Claims-based caching is disabled. Clearing the previous cache with claims"),n=this.performanceClient.startMeasurement($.ClearTokensAndKeysWithClaims),[4,this.browserStorage.clearTokensAndKeysWithClaims()]);case 5:s.sent(),n.endMeasurement({success:!0}),s.label=6;case 6:return this.initialized=!0,this.eventHandler.emitEvent(he.INITIALIZE_END),t.endMeasurement({allowNativeBroker:e,success:!0}),[2]}})})},r.prototype.handleRedirectPromise=function(e){return D(this,void 0,void 0,function(){var t,o,i,n,s,a,u,h,p=this;return F(this,function(f){return this.logger.verbose("handleRedirectPromise called"),St.blockNativeBrokerCalledBeforeInitialized(this.config.system.allowNativeBroker,this.initialized),t=this.getAllAccounts(),this.isBrowserEnvironment?(o=e||_.EMPTY_STRING,i=this.redirectResponse.get(o),typeof i>"u"?(this.eventHandler.emitEvent(he.HANDLE_REDIRECT_START,ne.Redirect),this.logger.verbose("handleRedirectPromise has been called for the first time, storing the promise"),n=this.browserStorage.getCachedNativeRequest(),s=void 0,n&&ci.isNativeAvailable(this.config,this.logger,this.nativeExtensionProvider)&&this.nativeExtensionProvider&&!e?(this.logger.trace("handleRedirectPromise - acquiring token from native platform"),a=new en(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,ct.handleRedirectPromise,this.performanceClient,this.nativeExtensionProvider,n.accountId,this.nativeInternalStorage,n.correlationId),s=a.handleRedirectPromise()):(this.logger.trace("handleRedirectPromise - acquiring token from web flow"),u=this.browserStorage.getTemporaryCache(Ye.CORRELATION_ID,!0)||_.EMPTY_STRING,h=this.createRedirectClient(u),s=h.handleRedirectPromise(e)),i=s.then(function(b){if(b){var C=t.length0?p.eventHandler.emitEvent(he.ACQUIRE_TOKEN_FAILURE,ne.Redirect,null,b):p.eventHandler.emitEvent(he.LOGIN_FAILURE,ne.Redirect,null,b),p.eventHandler.emitEvent(he.HANDLE_REDIRECT_END,ne.Redirect),b}),this.redirectResponse.set(o,i)):this.logger.verbose("handleRedirectPromise has been called previously, returning the result from the first call"),[2,i]):(this.logger.verbose("handleRedirectPromise returns null, not browser environment"),[2,null])})})},r.prototype.acquireTokenRedirect=function(e){return D(this,void 0,void 0,function(){var t,o,i,n,s,a=this;return F(this,function(u){return t=this.getRequestCorrelationId(e),this.logger.verbose("acquireTokenRedirect called",t),this.preflightBrowserEnvironmentCheck(ne.Redirect),o=this.getAllAccounts().length>0,o?this.eventHandler.emitEvent(he.ACQUIRE_TOKEN_START,ne.Redirect,e):this.eventHandler.emitEvent(he.LOGIN_START,ne.Redirect,e),this.nativeExtensionProvider&&this.canUseNative(e)?(n=new en(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,ct.acquireTokenRedirect,this.performanceClient,this.nativeExtensionProvider,this.getNativeAccountId(e),this.nativeInternalStorage,e.correlationId),i=n.acquireTokenRedirect(e).catch(function(h){if(h instanceof Eo&&h.isFatal()){a.nativeExtensionProvider=void 0;var p=a.createRedirectClient(e.correlationId);return p.acquireToken(e)}else if(h instanceof Cr){a.logger.verbose("acquireTokenRedirect - Resolving interaction required error thrown by native broker by falling back to web flow");var p=a.createRedirectClient(e.correlationId);return p.acquireToken(e)}throw a.browserStorage.setInteractionInProgress(!1),h})):(s=this.createRedirectClient(e.correlationId),i=s.acquireToken(e)),[2,i.catch(function(h){throw o?a.eventHandler.emitEvent(he.ACQUIRE_TOKEN_FAILURE,ne.Redirect,null,h):a.eventHandler.emitEvent(he.LOGIN_FAILURE,ne.Redirect,null,h),h})]})})},r.prototype.acquireTokenPopup=function(e){var t=this,o=this.getRequestCorrelationId(e),i=this.performanceClient.startMeasurement($.AcquireTokenPopup,o);try{this.logger.verbose("acquireTokenPopup called",o),this.preflightBrowserEnvironmentCheck(ne.Popup)}catch(u){return Promise.reject(u)}var n=this.getAllAccounts();n.length>0?this.eventHandler.emitEvent(he.ACQUIRE_TOKEN_START,ne.Popup,e):this.eventHandler.emitEvent(he.LOGIN_START,ne.Popup,e);var s;if(this.canUseNative(e))s=this.acquireTokenNative(e,ct.acquireTokenPopup).then(function(u){return t.browserStorage.setInteractionInProgress(!1),i.endMeasurement({success:!0,isNativeBroker:!0,requestId:u.requestId}),u}).catch(function(u){if(u instanceof Eo&&u.isFatal()){t.nativeExtensionProvider=void 0;var h=t.createPopupClient(e.correlationId);return h.acquireToken(e)}else if(u instanceof Cr){t.logger.verbose("acquireTokenPopup - Resolving interaction required error thrown by native broker by falling back to web flow");var h=t.createPopupClient(e.correlationId);return h.acquireToken(e)}throw t.browserStorage.setInteractionInProgress(!1),u});else{var a=this.createPopupClient(e.correlationId);s=a.acquireToken(e)}return s.then(function(u){var h=n.length0?t.eventHandler.emitEvent(he.ACQUIRE_TOKEN_FAILURE,ne.Popup,null,u):t.eventHandler.emitEvent(he.LOGIN_FAILURE,ne.Popup,null,u),i.endMeasurement({errorCode:u.errorCode,subErrorCode:u.subError,success:!1}),Promise.reject(u)})},r.prototype.trackPageVisibilityWithMeasurement=function(){var e=this.ssoSilentMeasurement||this.acquireTokenByCodeAsyncMeasurement;e&&(this.logger.info("Perf: Visibility change detected in ",e.event.name),e.increment({visibilityChangeCount:1}))},r.prototype.ssoSilent=function(e){var t;return D(this,void 0,void 0,function(){var o,i,n,s,a=this;return F(this,function(u){return o=this.getRequestCorrelationId(e),i=ae(ae({},e),{prompt:e.prompt,correlationId:o}),this.preflightBrowserEnvironmentCheck(ne.Silent),this.ssoSilentMeasurement=this.performanceClient.startMeasurement($.SsoSilent,o),(t=this.ssoSilentMeasurement)===null||t===void 0||t.increment({visibilityChangeCount:0}),document.addEventListener("visibilitychange",this.trackPageVisibilityWithMeasurement),this.logger.verbose("ssoSilent called",o),this.eventHandler.emitEvent(he.SSO_SILENT_START,ne.Silent,i),this.canUseNative(i)?n=this.acquireTokenNative(i,ct.ssoSilent).catch(function(h){if(h instanceof Eo&&h.isFatal()){a.nativeExtensionProvider=void 0;var p=a.createSilentIframeClient(i.correlationId);return p.acquireToken(i)}throw h}):(s=this.createSilentIframeClient(i.correlationId),n=s.acquireToken(i)),[2,n.then(function(h){var p,f;return a.eventHandler.emitEvent(he.SSO_SILENT_SUCCESS,ne.Silent,h),(p=a.ssoSilentMeasurement)===null||p===void 0||p.addStaticFields({accessTokenSize:h.accessToken.length,idTokenSize:h.idToken.length}),(f=a.ssoSilentMeasurement)===null||f===void 0||f.endMeasurement({success:!0,isNativeBroker:h.fromNativeBroker,requestId:h.requestId}),h}).catch(function(h){var p;throw a.eventHandler.emitEvent(he.SSO_SILENT_FAILURE,ne.Silent,null,h),(p=a.ssoSilentMeasurement)===null||p===void 0||p.endMeasurement({errorCode:h.errorCode,subErrorCode:h.subError,success:!1}),h}).finally(function(){document.removeEventListener("visibilitychange",a.trackPageVisibilityWithMeasurement)})]})})},r.prototype.acquireTokenByCode=function(e){return D(this,void 0,void 0,function(){var t,o,i,n,s=this;return F(this,function(a){t=this.getRequestCorrelationId(e),this.preflightBrowserEnvironmentCheck(ne.Silent),this.logger.trace("acquireTokenByCode called",t),this.eventHandler.emitEvent(he.ACQUIRE_TOKEN_BY_CODE_START,ne.Silent,e),o=this.performanceClient.startMeasurement($.AcquireTokenByCode,e.correlationId);try{if(e.code&&e.nativeAccountId)throw B.createSpaCodeAndNativeAccountIdPresentError();if(e.code)return i=e.code,n=this.hybridAuthCodeResponses.get(i),n?(this.logger.verbose("Existing acquireTokenByCode request found",e.correlationId),o.discardMeasurement()):(this.logger.verbose("Initiating new acquireTokenByCode request",t),n=this.acquireTokenByCodeAsync(ae(ae({},e),{correlationId:t})).then(function(u){return s.eventHandler.emitEvent(he.ACQUIRE_TOKEN_BY_CODE_SUCCESS,ne.Silent,u),s.hybridAuthCodeResponses.delete(i),o.addStaticFields({accessTokenSize:u.accessToken.length,idTokenSize:u.idToken.length}),o.endMeasurement({success:!0,isNativeBroker:u.fromNativeBroker,requestId:u.requestId}),u}).catch(function(u){throw s.hybridAuthCodeResponses.delete(i),s.eventHandler.emitEvent(he.ACQUIRE_TOKEN_BY_CODE_FAILURE,ne.Silent,null,u),o.endMeasurement({errorCode:u.errorCode,subErrorCode:u.subError,success:!1}),u}),this.hybridAuthCodeResponses.set(i,n)),[2,n];if(e.nativeAccountId){if(this.canUseNative(e,e.nativeAccountId))return[2,this.acquireTokenNative(e,ct.acquireTokenByCode,e.nativeAccountId).catch(function(u){throw u instanceof Eo&&u.isFatal()&&(s.nativeExtensionProvider=void 0),u})];throw B.createUnableToAcquireTokenFromNativePlatformError()}else throw B.createAuthCodeOrNativeAccountIdRequiredError()}catch(u){throw this.eventHandler.emitEvent(he.ACQUIRE_TOKEN_BY_CODE_FAILURE,ne.Silent,null,u),o.endMeasurement({errorCode:u instanceof ee&&u.errorCode||void 0,subErrorCode:u instanceof ee&&u.subError||void 0,success:!1}),u}return[2]})})},r.prototype.acquireTokenByCodeAsync=function(e){var t;return D(this,void 0,void 0,function(){var o,i,n=this;return F(this,function(s){switch(s.label){case 0:return this.logger.trace("acquireTokenByCodeAsync called",e.correlationId),this.acquireTokenByCodeAsyncMeasurement=this.performanceClient.startMeasurement($.AcquireTokenByCodeAsync,e.correlationId),(t=this.acquireTokenByCodeAsyncMeasurement)===null||t===void 0||t.increment({visibilityChangeCount:0}),document.addEventListener("visibilitychange",this.trackPageVisibilityWithMeasurement),o=this.createSilentAuthCodeClient(e.correlationId),[4,o.acquireToken(e).then(function(a){var u;return(u=n.acquireTokenByCodeAsyncMeasurement)===null||u===void 0||u.endMeasurement({success:!0,fromCache:a.fromCache,isNativeBroker:a.fromNativeBroker,requestId:a.requestId}),a}).catch(function(a){var u;throw(u=n.acquireTokenByCodeAsyncMeasurement)===null||u===void 0||u.endMeasurement({errorCode:a.errorCode,subErrorCode:a.subError,success:!1}),a}).finally(function(){document.removeEventListener("visibilitychange",n.trackPageVisibilityWithMeasurement)})];case 1:return i=s.sent(),[2,i]}})})},r.prototype.acquireTokenFromCache=function(e,t,o){return D(this,void 0,void 0,function(){return F(this,function(i){switch(this.performanceClient.addQueueMeasurement($.AcquireTokenFromCache,t.correlationId),o.cacheLookupPolicy){case oo.Default:case oo.AccessToken:case oo.AccessTokenAndRefreshToken:return[2,e.acquireToken(t)];default:throw U.createRefreshRequiredError()}return[2]})})},r.prototype.acquireTokenByRefreshToken=function(e,t){return D(this,void 0,void 0,function(){var o;return F(this,function(i){switch(this.performanceClient.addQueueMeasurement($.AcquireTokenByRefreshToken,e.correlationId),t.cacheLookupPolicy){case oo.Default:case oo.AccessTokenAndRefreshToken:case oo.RefreshToken:case oo.RefreshTokenAndNetwork:return o=this.createSilentRefreshClient(e.correlationId),this.performanceClient.setPreQueueTime($.SilentRefreshClientAcquireToken,e.correlationId),[2,o.acquireToken(e)];default:throw U.createRefreshRequiredError()}return[2]})})},r.prototype.acquireTokenBySilentIframe=function(e){return D(this,void 0,void 0,function(){var t;return F(this,function(o){return this.performanceClient.addQueueMeasurement($.AcquireTokenBySilentIframe,e.correlationId),t=this.createSilentIframeClient(e.correlationId),this.performanceClient.setPreQueueTime($.SilentIframeClientAcquireToken,e.correlationId),[2,t.acquireToken(e)]})})},r.prototype.logout=function(e){return D(this,void 0,void 0,function(){var t;return F(this,function(o){return t=this.getRequestCorrelationId(e),this.logger.warning("logout API is deprecated and will be removed in msal-browser v3.0.0. Use logoutRedirect instead.",t),[2,this.logoutRedirect(ae({correlationId:t},e))]})})},r.prototype.logoutRedirect=function(e){return D(this,void 0,void 0,function(){var t,o;return F(this,function(i){return t=this.getRequestCorrelationId(e),this.preflightBrowserEnvironmentCheck(ne.Redirect),o=this.createRedirectClient(t),[2,o.logout(e)]})})},r.prototype.logoutPopup=function(e){try{var t=this.getRequestCorrelationId(e);this.preflightBrowserEnvironmentCheck(ne.Popup);var o=this.createPopupClient(t);return o.logout(e)}catch(i){return Promise.reject(i)}},r.prototype.getAllAccounts=function(){return this.logger.verbose("getAllAccounts called"),this.isBrowserEnvironment?this.browserStorage.getAllAccounts():[]},r.prototype.getAccountByUsername=function(e){if(this.logger.trace("getAccountByUsername called"),!e)return this.logger.warning("getAccountByUsername: No username provided"),null;var t=this.browserStorage.getAccountInfoFilteredBy({username:e});return t?(this.logger.verbose("getAccountByUsername: Account matching username found, returning"),this.logger.verbosePii("getAccountByUsername: Returning signed-in accounts matching username: "+e),t):(this.logger.verbose("getAccountByUsername: No matching account found, returning null"),null)},r.prototype.getAccountByHomeId=function(e){if(this.logger.trace("getAccountByHomeId called"),!e)return this.logger.warning("getAccountByHomeId: No homeAccountId provided"),null;var t=this.browserStorage.getAccountInfoFilteredBy({homeAccountId:e});return t?(this.logger.verbose("getAccountByHomeId: Account matching homeAccountId found, returning"),this.logger.verbosePii("getAccountByHomeId: Returning signed-in accounts matching homeAccountId: "+e),t):(this.logger.verbose("getAccountByHomeId: No matching account found, returning null"),null)},r.prototype.getAccountByLocalId=function(e){if(this.logger.trace("getAccountByLocalId called"),!e)return this.logger.warning("getAccountByLocalId: No localAccountId provided"),null;var t=this.browserStorage.getAccountInfoFilteredBy({localAccountId:e});return t?(this.logger.verbose("getAccountByLocalId: Account matching localAccountId found, returning"),this.logger.verbosePii("getAccountByLocalId: Returning signed-in accounts matching localAccountId: "+e),t):(this.logger.verbose("getAccountByLocalId: No matching account found, returning null"),null)},r.prototype.setActiveAccount=function(e){this.browserStorage.setActiveAccount(e)},r.prototype.getActiveAccount=function(){return this.browserStorage.getActiveAccount()},r.prototype.preflightBrowserEnvironmentCheck=function(e,t){if(t===void 0&&(t=!0),this.logger.verbose("preflightBrowserEnvironmentCheck started"),St.blockNonBrowserEnvironment(this.isBrowserEnvironment),St.blockRedirectInIframe(e,this.config.system.allowRedirectInIframe),St.blockReloadInHiddenIframes(),St.blockAcquireTokenInPopups(),St.blockNativeBrokerCalledBeforeInitialized(this.config.system.allowNativeBroker,this.initialized),e===ne.Redirect&&this.config.cache.cacheLocation===zt.MemoryStorage&&!this.config.cache.storeAuthStateInCookie)throw gs.createInMemoryRedirectUnavailableError();(e===ne.Redirect||e===ne.Popup)&&this.preflightInteractiveRequest(t)},r.prototype.preflightInteractiveRequest=function(e){this.logger.verbose("preflightInteractiveRequest called, validating app environment"),St.blockReloadInHiddenIframes(),e&&this.browserStorage.setInteractionInProgress(!0)},r.prototype.acquireTokenNative=function(e,t,o){return D(this,void 0,void 0,function(){var i;return F(this,function(n){if(this.logger.trace("acquireTokenNative called"),!this.nativeExtensionProvider)throw B.createNativeConnectionNotEstablishedError();return i=new en(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,t,this.performanceClient,this.nativeExtensionProvider,o||this.getNativeAccountId(e),this.nativeInternalStorage,e.correlationId),[2,i.acquireToken(e)]})})},r.prototype.canUseNative=function(e,t){if(this.logger.trace("canUseNative called"),!ci.isNativeAvailable(this.config,this.logger,this.nativeExtensionProvider,e.authenticationScheme))return this.logger.trace("canUseNative: isNativeAvailable returned false, returning false"),!1;if(e.prompt)switch(e.prompt){case or.NONE:case or.CONSENT:case or.LOGIN:this.logger.trace("canUseNative: prompt is compatible with native flow");break;default:return this.logger.trace("canUseNative: prompt = "+e.prompt+" is not compatible with native flow, returning false"),!1}return!t&&!this.getNativeAccountId(e)?(this.logger.trace("canUseNative: nativeAccountId is not available, returning false"),!1):!0},r.prototype.getNativeAccountId=function(e){var t=e.account||this.browserStorage.getAccountInfoByHints(e.loginHint,e.sid)||this.getActiveAccount();return t&&t.nativeAccountId||""},r.prototype.createPopupClient=function(e){return new Ty(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,this.performanceClient,this.nativeInternalStorage,this.nativeExtensionProvider,e)},r.prototype.createRedirectClient=function(e){return new _y(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,this.performanceClient,this.nativeInternalStorage,this.nativeExtensionProvider,e)},r.prototype.createSilentIframeClient=function(e){return new Iy(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,ct.ssoSilent,this.performanceClient,this.nativeInternalStorage,this.nativeExtensionProvider,e)},r.prototype.createSilentCacheClient=function(e){return new $u(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,this.performanceClient,this.nativeExtensionProvider,e)},r.prototype.createSilentRefreshClient=function(e){return new Ay(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,this.performanceClient,this.nativeExtensionProvider,e)},r.prototype.createSilentAuthCodeClient=function(e){return new G_(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,ct.acquireTokenByCode,this.performanceClient,this.nativeExtensionProvider,e)},r.prototype.addEventCallback=function(e){return this.eventHandler.addEventCallback(e)},r.prototype.removeEventCallback=function(e){this.eventHandler.removeEventCallback(e)},r.prototype.addPerformanceCallback=function(e){return this.performanceClient.addPerformanceCallback(e)},r.prototype.removePerformanceCallback=function(e){return this.performanceClient.removePerformanceCallback(e)},r.prototype.enableAccountStorageEvents=function(){this.eventHandler.enableAccountStorageEvents()},r.prototype.disableAccountStorageEvents=function(){this.eventHandler.disableAccountStorageEvents()},r.prototype.getTokenCache=function(){return this.tokenCache},r.prototype.getLogger=function(){return this.logger},r.prototype.setLogger=function(e){this.logger=e},r.prototype.initializeWrapperLibrary=function(e,t){this.browserStorage.setWrapperMetadata(e,t)},r.prototype.setNavigationClient=function(e){this.navigationClient=e},r.prototype.getConfiguration=function(){return this.config},r.prototype.getRequestCorrelationId=function(e){return e?.correlationId?e.correlationId:this.isBrowserEnvironment?this.browserCrypto.createNewGuid():_.EMPTY_STRING},r}();var Oy=function(r){mt(e,r);function e(t){var o=r.call(this,t)||this;return o.astsAsyncMeasurement=void 0,o.activeSilentTokenRequests=new Map,o.trackPageVisibility=o.trackPageVisibility.bind(o),o}return e.prototype.loginRedirect=function(t){return D(this,void 0,void 0,function(){var o;return F(this,function(i){return o=this.getRequestCorrelationId(t),this.logger.verbose("loginRedirect called",o),[2,this.acquireTokenRedirect(ae({correlationId:o},t||ky))]})})},e.prototype.loginPopup=function(t){var o=this.getRequestCorrelationId(t);return this.logger.verbose("loginPopup called",o),this.acquireTokenPopup(ae({correlationId:o},t||ky))},e.prototype.acquireTokenSilent=function(t){return D(this,void 0,void 0,function(){var o,i,n,s,a,u,h,p=this;return F(this,function(f){if(o=this.getRequestCorrelationId(t),i=this.performanceClient.startMeasurement($.AcquireTokenSilent,o),i.addStaticFields({cacheLookupPolicy:t.cacheLookupPolicy}),this.preflightBrowserEnvironmentCheck(ne.Silent),this.logger.verbose("acquireTokenSilent called",o),n=t.account||this.getActiveAccount(),!n)throw B.createNoAccountError();return s={clientId:this.config.auth.clientId,authority:t.authority||_.EMPTY_STRING,scopes:t.scopes,homeAccountIdentifier:n.homeAccountId,claims:t.claims,authenticationScheme:t.authenticationScheme,resourceRequestMethod:t.resourceRequestMethod,resourceRequestUri:t.resourceRequestUri,shrClaims:t.shrClaims,sshKid:t.sshKid},a=JSON.stringify(s),u=this.activeSilentTokenRequests.get(a),typeof u>"u"?(this.logger.verbose("acquireTokenSilent called for the first time, storing active request",o),this.performanceClient.setPreQueueTime($.AcquireTokenSilentAsync,o),h=this.acquireTokenSilentAsync(ae(ae({},t),{correlationId:o}),n).then(function(b){return p.activeSilentTokenRequests.delete(a),i.addStaticFields({accessTokenSize:b.accessToken.length,idTokenSize:b.idToken.length}),i.endMeasurement({success:!0,fromCache:b.fromCache,isNativeBroker:b.fromNativeBroker,cacheLookupPolicy:t.cacheLookupPolicy,requestId:b.requestId}),b}).catch(function(b){throw p.activeSilentTokenRequests.delete(a),i.endMeasurement({errorCode:b.errorCode,subErrorCode:b.subError,success:!1}),b}),this.activeSilentTokenRequests.set(a,h),[2,h]):(this.logger.verbose("acquireTokenSilent has been called previously, returning the result from the first call",o),i.discardMeasurement(),[2,u])})})},e.prototype.trackPageVisibility=function(){this.astsAsyncMeasurement&&(this.logger.info("Perf: Visibility change detected"),this.astsAsyncMeasurement.increment({visibilityChangeCount:1}))},e.prototype.acquireTokenSilentAsync=function(t,o){var i;return D(this,void 0,void 0,function(){var n,s,a,u,h,p=this;return F(this,function(f){switch(f.label){case 0:return this.performanceClient.addQueueMeasurement($.AcquireTokenSilentAsync,t.correlationId),this.eventHandler.emitEvent(he.ACQUIRE_TOKEN_START,ne.Silent,t),this.astsAsyncMeasurement=this.performanceClient.startMeasurement($.AcquireTokenSilentAsync,t.correlationId),(i=this.astsAsyncMeasurement)===null||i===void 0||i.increment({visibilityChangeCount:0}),document.addEventListener("visibilitychange",this.trackPageVisibility),ci.isNativeAvailable(this.config,this.logger,this.nativeExtensionProvider,t.authenticationScheme)&&o.nativeAccountId?(this.logger.verbose("acquireTokenSilent - attempting to acquire token from native platform"),s=ae(ae({},t),{account:o}),n=this.acquireTokenNative(s,ct.acquireTokenSilent_silentFlow).catch(function(b){return D(p,void 0,void 0,function(){var C;return F(this,function(S){if(b instanceof Eo&&b.isFatal())return this.logger.verbose("acquireTokenSilent - native platform unavailable, falling back to web flow"),this.nativeExtensionProvider=void 0,C=this.createSilentIframeClient(t.correlationId),[2,C.acquireToken(t)];throw b})})}),[3,3]):[3,1];case 1:return this.logger.verbose("acquireTokenSilent - attempting to acquire token from web flow"),a=this.createSilentCacheClient(t.correlationId),this.performanceClient.setPreQueueTime($.InitializeSilentRequest,t.correlationId),[4,a.initializeSilentRequest(t,o)];case 2:u=f.sent(),h=ae(ae({},t),{cacheLookupPolicy:t.cacheLookupPolicy||oo.Default}),this.performanceClient.setPreQueueTime($.AcquireTokenFromCache,u.correlationId),n=this.acquireTokenFromCache(a,u,h).catch(function(b){if(h.cacheLookupPolicy===oo.AccessToken)throw b;return St.blockReloadInHiddenIframes(),p.eventHandler.emitEvent(he.ACQUIRE_TOKEN_NETWORK_START,ne.Silent,u),p.performanceClient.setPreQueueTime($.AcquireTokenByRefreshToken,u.correlationId),p.acquireTokenByRefreshToken(u,h).catch(function(C){var S=C instanceof eo,R=C instanceof Cr,H=C.errorCode===An.noTokensFoundError.code,ye=C.errorCode===Hr.INVALID_GRANT_ERROR;if((!S||!ye||R||h.cacheLookupPolicy===oo.AccessTokenAndRefreshToken||h.cacheLookupPolicy===oo.RefreshToken)&&h.cacheLookupPolicy!==oo.Skip&&!H)throw C;return p.logger.verbose("Refresh token expired/invalid or CacheLookupPolicy is set to Skip, attempting acquire token by iframe.",t.correlationId),p.performanceClient.setPreQueueTime($.AcquireTokenBySilentIframe,u.correlationId),p.acquireTokenBySilentIframe(u)})}),f.label=3;case 3:return[2,n.then(function(b){var C;return p.eventHandler.emitEvent(he.ACQUIRE_TOKEN_SUCCESS,ne.Silent,b),(C=p.astsAsyncMeasurement)===null||C===void 0||C.endMeasurement({success:!0,fromCache:b.fromCache,isNativeBroker:b.fromNativeBroker,requestId:b.requestId}),b}).catch(function(b){var C;throw p.eventHandler.emitEvent(he.ACQUIRE_TOKEN_FAILURE,ne.Silent,null,b),(C=p.astsAsyncMeasurement)===null||C===void 0||C.endMeasurement({errorCode:b.errorCode,subErrorCode:b.subError,success:!1}),b}).finally(function(){document.removeEventListener("visibilitychange",p.trackPageVisibility)})]}})})},e}(j_);l();c();d();l();c();d();var R9=function(){function r(){}return r.getInteractionStatusFromEvent=function(e,t){switch(e.eventType){case he.LOGIN_START:return Nr.Login;case he.SSO_SILENT_START:return Nr.SsoSilent;case he.ACQUIRE_TOKEN_START:if(e.interactionType===ne.Redirect||e.interactionType===ne.Popup)return Nr.AcquireToken;break;case he.HANDLE_REDIRECT_START:return Nr.HandleRedirect;case he.LOGOUT_START:return Nr.Logout;case he.SSO_SILENT_SUCCESS:case he.SSO_SILENT_FAILURE:if(t&&t!==Nr.SsoSilent)break;return Nr.None;case he.LOGOUT_END:if(t&&t!==Nr.Logout)break;return Nr.None;case he.HANDLE_REDIRECT_END:if(t&&t!==Nr.HandleRedirect)break;return Nr.None;case he.LOGIN_SUCCESS:case he.LOGIN_FAILURE:case he.ACQUIRE_TOKEN_SUCCESS:case he.ACQUIRE_TOKEN_FAILURE:case he.RESTORE_FROM_BFCACHE:if(e.interactionType===ne.Redirect||e.interactionType===ne.Popup){if(t&&t!==Nr.Login&&t!==Nr.AcquireToken)break;return Nr.None}break}return null},r}();l();c();d();var P9=function(){function r(e,t){var o=t&&t.loggerOptions||{};this.logger=new _n(o,Oc,Xi),this.cryptoOps=new Mu(this.logger),this.popTokenGenerator=new ai(this.cryptoOps),this.shrParameters=e}return r.prototype.generatePublicKeyThumbprint=function(){return D(this,void 0,void 0,function(){var e;return F(this,function(t){switch(t.label){case 0:return[4,this.popTokenGenerator.generateKid(this.shrParameters)];case 1:return e=t.sent().kid,[2,e]}})})},r.prototype.signRequest=function(e,t,o){return D(this,void 0,void 0,function(){return F(this,function(i){return[2,this.popTokenGenerator.signPayload(e,t,this.shrParameters,o)]})})},r.prototype.removeKeys=function(e){return D(this,void 0,void 0,function(){return F(this,function(t){switch(t.label){case 0:return[4,this.cryptoOps.removeTokenBindingKey(e)];case 1:return[2,t.sent()]}})})},r}();var Du=function(r,e,t,o){function i(n){return n instanceof t?n:new t(function(s){s(n)})}return new(t||(t=Promise))(function(n,s){function a(p){try{h(o.next(p))}catch(f){s(f)}}function u(p){try{h(o.throw(p))}catch(f){s(f)}}function h(p){p.done?n(p.value):i(p.value).then(a,u)}h((o=o.apply(r,e||[])).next())})},My;(function(r){r.SELECT_ACCOUNT="select_account",r.LOGIN="login",r.CONSENT="consent"})(My||(My={}));var Bf=class extends ja{get publicClientApplication(){return this._publicClientApplication}get name(){return"MgtMsal2Provider"}get isMultiAccountDisabled(){return!this.isMultipleAccountEnabled}set isMultiAccountDisabled(e){this.isMultipleAccountEnabled=!e}get isMultiAccountSupportedAndEnabled(){return this.isMultipleAccountEnabled}get sessionStorageRequestedScopesKey(){return"mgt-requested-scopes"}get sessionStorageDeniedScopesKey(){return"mgt-denied-scopes"}get homeAccountKey(){return"275f3731-e4a4-468a-bf9c-baca24b31e26"}constructor(e){super(),this.isMultipleAccountEnabled=!0,this.handleMsalEvent=t=>{t.eventType==="msal:acquireTokenSuccess"&&"scopes"in t.payload&&(this.approvedScopes=t.payload.scopes)},this.initProvider(e)}initProvider(e){return Du(this,void 0,void 0,function*(){let t=e.options||{auth:{clientId:""}};if(this.ms_config=t,this.ms_config.cache=t.cache||{},this.ms_config.cache.cacheLocation=t.cache.cacheLocation||"localStorage",(typeof this.ms_config.cache.storeAuthStateInCookie>"u"||this.ms_config.cache.storeAuthStateInCookie===null)&&(this.ms_config.cache.storeAuthStateInCookie=!0),this.ms_config.system=t.system||{},this.ms_config.system.iframeHashTimeout=t.system.iframeHashTimeout||1e4,e.authority&&(this.ms_config.auth.authority=e.authority),e.redirectUri&&(this.ms_config.auth.redirectUri=e.redirectUri),"clientId"in e)if(e.clientId)this.ms_config.auth.clientId=e.clientId,this._publicClientApplication=new Oy(this.ms_config);else throw new Error("clientId must be provided");else if("publicClientApplication"in e)if(e.publicClientApplication)this._publicClientApplication=e.publicClientApplication;else throw new Error("publicClientApplication must be provided");else throw new Error("either clientId or publicClientApplication must be provided");this._publicClientApplication.addEventCallback(this.handleMsalEvent),yield this._publicClientApplication.initialize(),this.ms_config.system=t.system||{},this.ms_config.system.iframeHashTimeout=t.system.iframeHashTimeout||1e4,this._loginType=typeof e.loginType<"u"?e.loginType:Xn.Redirect,this._loginHint=typeof e.loginHint<"u"?e.loginHint:null,this._sid=typeof e.sid<"u"?e.sid:null,this.isIncrementalConsentDisabled=typeof e.isIncrementalConsentDisabled<"u"?e.isIncrementalConsentDisabled:!1,this._domainHint=typeof e.domainHint<"u"?e.domainHint:null,this.scopes=typeof e.scopes<"u"?e.scopes:["user.read"],this._prompt=typeof e.prompt<"u"?e.prompt:My.SELECT_ACCOUNT;let o=e;this.isMultipleAccountEnabled=typeof o.isMultiAccountEnabled<"u"?o.isMultiAccountEnabled:!0,this.baseURL=typeof o.baseURL<"u"?o.baseURL:this.baseURL,this.customHosts=o.customHosts,this.graph=C0(this);try{let i=yield this._publicClientApplication.handleRedirectPromise();i!==null?this.handleResponse(i?.account):yield this.trySilentSignIn()}catch(i){throw console.error("\u{1F992}: Problem attempting to sign in",i),i}})}trySilentSignIn(){return Du(this,void 0,void 0,function*(){let e={scopes:this.scopes,domainHint:this._domainHint};if(this._sid||this._loginHint){e.sid=this._sid,e.loginHint=this._loginHint;try{this.setState(oe.Loading);let t=yield this._publicClientApplication.ssoSilent(e);t&&this.handleResponse(t?.account)}catch{this.setState(oe.SignedOut)}}else{let t=this.getAccount();if(t&&(yield this.getAccessToken(null))){this.handleResponse(t);return}this.setState(oe.SignedOut)}})}login(){return Du(this,void 0,void 0,function*(){let e={scopes:this.scopes,loginHint:this._loginHint,prompt:this._prompt,domainHint:this._domainHint};if(this._loginType===Xn.Popup)try{let t=yield this._publicClientApplication.loginPopup(e);this.handleResponse(t?.account)}catch(t){switch(!0){case(t instanceof B&&t.errorCode==="user_cancelled"):console.warn("\u{1F992}: User cancelled the login flow."),this.setState(oe.SignedOut);break;case(t instanceof B&&t.errorCode==="interaction_in_progress"):console.warn("\u{1F992}: Login already in progess. Close the popup to login again."),this.setState(oe.SignedOut);break;default:throw console.error("\u{1F992}: Error occurred during login:",t),t}}else{let t=Object.assign({},e);yield this._publicClientApplication.loginRedirect(t)}})}getAllAccounts(){let e=[];return this._publicClientApplication.getAllAccounts().forEach(t=>{e.push({name:t.name,mail:t.username,id:t.homeAccountId})}),e}setActiveAccount(e){let t=this._publicClientApplication.getAccountByHomeId(e.id),o=this._publicClientApplication.getActiveAccount(),i=this.getStoredAccount();i&&t&&o&&i.homeAccountId===t.homeAccountId&&o.homeAccountId===t.homeAccountId||(this._publicClientApplication.setActiveAccount(t),this.setStoredAccount(),super.setActiveAccount(e))}getActiveAccount(){let e=this._publicClientApplication.getActiveAccount();if(e)return{name:e.name,mail:e.username,id:e.homeAccountId,tenantId:e.tenantId}}handleResponse(e){e!==null?(this.setActiveAccount({name:e.name,id:e.homeAccountId,mail:e.username}),this.setState(oe.SignedIn)):this.setState(oe.SignedOut),this.clearRequestedScopes()}storage(){switch(this.ms_config.cache.cacheLocation){case"localStorage":return window.localStorage;case"sessionStorage":default:return window.sessionStorage}}setStoredAccount(){this.clearStoredAccount(),this.storage().setItem(this.homeAccountKey,this._publicClientApplication.getActiveAccount().homeAccountId)}getStoredAccount(){let e=this.storage().getItem(this.homeAccountKey);return this._publicClientApplication.getAccountByHomeId(e)}clearStoredAccount(){this.storage().removeItem(this.homeAccountKey)}setRequestedScopes(e){e&&sessionStorage.setItem(this.sessionStorageRequestedScopesKey,JSON.stringify(e))}addDeniedScopes(e){if(e){let t=this.getDeniedScopes()||[];t=t.concat(e);let o=t.indexOf("openid");o!==-1&&t.splice(o,1),o=t.indexOf("profile"),o!==-1&&t.splice(o,1),sessionStorage.setItem(this.sessionStorageDeniedScopesKey,JSON.stringify(t))}}getDeniedScopes(){let e=sessionStorage.getItem(this.sessionStorageDeniedScopesKey);return e?JSON.parse(e):null}areScopesDenied(e){if(e){let t=this.getDeniedScopes();if(t&&t.filter(o=>e.indexOf(o)!==-1).length>0)return!0}return!1}clearRequestedScopes(){sessionStorage.removeItem(this.sessionStorageRequestedScopesKey)}getAccount(){let e=this.getStoredAccount();return e||(this._publicClientApplication.getAllAccounts().length>0?this._publicClientApplication.getAllAccounts()[0]:null)}logout(){return Du(this,void 0,void 0,function*(){let t={account:this._publicClientApplication.getActiveAccount()};this.clearStoredAccount(),this._loginType===Xn.Redirect?(this.setState(oe.SignedOut),yield this._publicClientApplication.logoutRedirect(t)):(yield this._publicClientApplication.logoutPopup(Object.assign({},t)),this._publicClientApplication.getAllAccounts.length===1||!this.isMultipleAccountEnabled?this.setState(oe.SignedOut):yield this.trySilentSignIn())})}getAccessToken(e){var t;return Du(this,void 0,void 0,function*(){let o=!((t=e?.scopes)===null||t===void 0)&&t.length?e.scopes:this.scopes,i={scopes:o,account:this.getAccount()};try{let n=i;return(yield this._publicClientApplication.acquireTokenSilent(n)).accessToken}catch(n){if(n instanceof Cr){if(this.isIncrementalConsentDisabled)return null;if(this._loginType===Xn.Redirect)if(!this.areScopesDenied(o))this.setRequestedScopes(o),yield this._publicClientApplication.acquireTokenRedirect(i);else throw n;else try{return(yield this._publicClientApplication.acquireTokenPopup(i)).accessToken}catch(s){throw console.error("\u{1F992}: problem with pop-up sign in",s),s}}else this.setState(oe.SignedOut)}throw null})}};l();c();d();var K_="9aeac104-a6b6-45ca-bb7c-bf7c3083eeb2";var Dy="mgt/setProvider",W_="blank.html";ge();l();c();d();l();c();d();l();c();d();l();c();d();l();c();d();l();c();d();xe();gt();ge();vs();un();l();c();d();xe();var o6=[Oe` :host([hidden]){display:none}:host{display:block;font-family:var(--default-font-family, "Segoe UI", "Segoe UI Web (West European)", "Segoe UI", -apple-system, "BlinkMacSystemFont", "Roboto", "Helvetica Neue", sans-serif);font-size:var(--default-font-size, 14px);--theme-primary-color:#0078d7;--theme-dark-color:#005a9e}:focus-visible{outline-color:var(--focus-ring-color,Highlight);outline-color:var(--focus-ring-color,-webkit-focus-ring-color);outline-style:var(--focus-ring-style,auto)}.ms-icon{display:inline-block;font-family:FabricMDL2Icons;font-style:normal;font-weight:400;font-size:16px;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;margin:4px 0}.error{background-color:#fde7e9;padding-block:8px;padding-inline:8px 12px}.ms-icon-chevron-down::before{content:"\\\e70d"}.ms-icon-chevron-up::before{content:"\\\e70e"}.ms-icon-contact::before{content:"\\\e77b"}.ms-icon-add-friend::before{content:"\\\e8fa"}.ms-icon-outlook-logo-inverser::before{content:"\\\eb6d"}:host{--card-height:auto;--card-width:99%;background-color:var(--agenda-background-color,transparent)}:host .header{margin:var(--agenda-header-margin,18px 0 12px 10px);font-size:var(--agenda-header-font-size, 24px);font-style:normal;font-weight:400;line-height:32px;color:var(--agenda-header-color,var(--neutral-foreground-rest));opacity:.9}:host .agenda,:host .group{display:flex;flex-direction:column;row-gap:var(--agenda-event-row-gap,14px)}:host .agenda>.group:first-child>.header,:host .group>.group:first-child>.header{margin-top:0}:host .agenda .event,:host .group .event{background:var(--agenda-event-background-color,var(--fill-color));border:var(--agenda-event-border,solid 2px transparent);box-shadow:var(--agenda-event-box-shadow,var(--elevation-shadow-card-rest));padding:var(--agenda-event-padding,12px);position:relative;display:flex;flex:1 1 auto;content-visibility:visible;contain:none}:host .agenda .event-container,:host .group .event-container{border-radius:calc(var(--layer-corner-radius) * 1px);padding:1px}:host .agenda .event.narrow,:host .group .event.narrow{display:flex;flex-direction:column;inset:0}:host .agenda .event-time-container,:host .group .event-time-container{font-style:normal;font-weight:600;font-size:12px;color:var(--agenda-event-time-color,var(--neutral-foreground-rest));width:112px;height:16px}:host .agenda .event-time-container.narrow,:host .group .event-time-container.narrow{margin-bottom:1px;width:100%}:host .agenda .event-time,:host .group .event-time{font-size:var(--agenda-event-time-font-size, 12px);color:var(--agenda-event-time-color,var(--neutral-foreground-rest));font-weight:600}:host .agenda .event-details-container,:host .group .event-details-container{display:flex;flex-direction:column;position:relative;bottom:8px;top:0;padding-inline-start:32px}:host .agenda .event-details-container.narrow,:host .group .event-details-container.narrow{position:inherit;left:6px;display:flex;flex-direction:column;padding-inline-start:0}:host .agenda .event-subject,:host .group .event-subject{font-style:normal;font-weight:400;font-size:var(--agenda-event-subject-font-size, 20px);line-height:28px;color:var(--agenda-event-subject-color,var(--neutral-foreground-rest));mix-blend-mode:normal;position:inherit;bottom:8px}:host .agenda .event-location-container,:host .group .event-location-container{display:inline-flex;flex-direction:row}:host .agenda .event-location-container .event-location,:host .group .event-location-container .event-location{padding-inline-start:3px;font-style:normal;font-weight:400;font-size:var(--agenda-event-location-font-size, 12px);line-height:16px;color:var(--agenda-event-location-color,var(--neutral-foreground-rest))}:host .agenda .event-location-container .event-location-loading,:host .group .event-location-container .event-location-loading{width:90px;height:10px;margin:2px 0 0 4px}:host .agenda .event-location-container .event-location-icon,:host .group .event-location-container .event-location-icon{display:inline-flex}:host .agenda .event-location-container .event-location-icon svg,:host .group .event-location-container .event-location-icon svg{position:relative;top:2px;width:12px;height:12px}:host .agenda .event-location-container .event-location-icon svg path,:host .group .event-location-container .event-location-icon svg path{stroke:var(--agenda-event-location-color,var(--neutral-foreground-rest))}:host .agenda .event-location-container .event-location-icon-loading,:host .group .event-location-container .event-location-icon-loading{width:14px;height:14px}:host .agenda .event-location-container .event-attendee-loading,:host .group .event-location-container .event-attendee-loading{width:20px;height:20px;border-radius:10px;margin:0 2px 0 0}:host .agenda .event-attendees,:host .group .event-attendees{--list-margin:8px 0 0 0;--person-avatar-size:20px}fluent-card.event.event-loading{--card-height:90px}:host .event-attendees{--color:$agenda-event-attendees-color}:host fluent-tooltip{width:auto;contain:inline-size}[dir=rtl] :host{direction:rtl}[dir=rtl] .event-time-container{direction:ltr;display:flex;justify-content:flex-end}@media (forced-colors:active) and (prefers-color-scheme:dark){:host .agenda .event-location-container .event-location-icon svg path{stroke:rgb(255,255,255)!important}}@media (forced-colors:active) and (prefers-color-scheme:light){:host .agenda .event-location-container .event-location-icon svg path{stroke:rgb(0,0,0)!important}} `];l();c();d();ge();var i6=function(r,e,t,o){function i(n){return n instanceof t?n:new t(function(s){s(n)})}return new(t||(t=Promise))(function(n,s){function a(p){try{h(o.next(p))}catch(f){s(f)}}function u(p){try{h(o.throw(p))}catch(f){s(f)}}function h(p){p.done?n(p.value):i(p.value).then(a,u)}h((o=o.apply(r,e||[])).next())})},dx=(r,e,t)=>i6(void 0,void 0,void 0,function*(){let o=r.api(e).middlewareOptions(be(t)).orderby("start/dateTime");return pl.create(r,o)}),n6=(r,e,t,o)=>i6(void 0,void 0,void 0,function*(){let i=`startdatetime=${e.toISOString()}`,n=`enddatetime=${t.toISOString()}`,s=o?`groups/${o}/calendar/calendarview?${i}&${n}`:`me/calendarview?${i}&${n}`;return dx(r,s,o?["Group.Read.All","Group.ReadWrite.All"]:["Calendars.ReadBasic","Calendars.Read","Calendars.ReadWrite"])});Qr();l();c();d();xe();gt();sc();Us();vv();Ha();ge();vs();Cv();l();c();d();xe();var s6=[Oe` :host([hidden]){display:none}:host{display:block;font-family:var(--default-font-family, "Segoe UI", "Segoe UI Web (West European)", "Segoe UI", -apple-system, "BlinkMacSystemFont", "Roboto", "Helvetica Neue", sans-serif);font-size:var(--default-font-size, 14px);--theme-primary-color:#0078d7;--theme-dark-color:#005a9e}:focus-visible{outline-color:var(--focus-ring-color,Highlight);outline-color:var(--focus-ring-color,-webkit-focus-ring-color);outline-style:var(--focus-ring-style,auto)}.ms-icon{display:inline-block;font-family:FabricMDL2Icons;font-style:normal;font-weight:400;font-size:16px;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;margin:4px 0}.error{background-color:#fde7e9;padding-block:8px;padding-inline:8px 12px}.ms-icon-chevron-down::before{content:"\\\e70d"}.ms-icon-chevron-up::before{content:"\\\e70e"}.ms-icon-contact::before{content:"\\\e77b"}.ms-icon-add-friend::before{content:"\\\e8fa"}.ms-icon-outlook-logo-inverser::before{content:"\\\eb6d"}:host .people-list{list-style:none;margin:var(--people-list-margin,8px 4px 8px 8px);padding:unset;display:flex;align-items:center;gap:var(--people-avatar-gap,4px)}:host .people-list .people-person{--person-avatar-size:var(--people-person-avatar-size, 24px)}:host .overflow span{vertical-align:middle;color:var(--people-overflow-font-color,currentColor);font-size:var(--people-overflow-font-size, 12px);font-weight:var(--people-overflow-font-weight,400)} @@ -6404,7 +6404,7 @@ Error Description: `+h.message)),[2,null];case 4:return i||(this.logger.warning( .personPresence=${t} .usage=${"people"} > - `}renderNoData(){return this.renderTemplate("no-data",null)||x``}loadState(){return gF(this,void 0,void 0,function*(){if(!this.people){let e=V.globalProvider;if(e&&e.state===ie.SignedIn){let t=e.graph.forComponent(this);this.groupId?this.people=yield tc(t,null,this.groupId,this.showMax,"person"):this.userIds?this.people=yield Xl(t,this.userIds,"","",this.fallbackDetails):this.peopleQueries?this.people=yield Y3(t,this.peopleQueries,this.fallbackDetails):this.resource?this.people=yield W3(t,this.version,this.resource,this.scopes):this.people=yield mv(t),this.showPresence?this._peoplePresence=yield oP(t,this.people):this._peoplePresence=null}}})}};Bi([E({attribute:"group-id",type:String}),zi("design:type",String)],Mr.prototype,"groupId",void 0);Bi([E({attribute:"user-ids",converter:(r,e)=>r.split(",").map(t=>t.trim())}),zi("design:type",Array)],Mr.prototype,"userIds",void 0);Bi([E({attribute:"people",type:Object}),zi("design:type",Array)],Mr.prototype,"people",void 0);Bi([E({attribute:"people-queries",converter:(r,e)=>r.split(",").map(t=>t.trim())}),zi("design:type",Array)],Mr.prototype,"peopleQueries",void 0);Bi([E({attribute:"show-max",type:Number}),zi("design:type",Number)],Mr.prototype,"showMax",void 0);Bi([E({attribute:"show-presence",type:Boolean}),zi("design:type",Boolean)],Mr.prototype,"showPresence",void 0);Bi([E({attribute:"person-card",converter:(r,e)=>Rd(r,"hover")}),zi("design:type",String)],Mr.prototype,"personCardInteraction",void 0);Bi([E({attribute:"resource",type:String}),zi("design:type",String)],Mr.prototype,"resource",void 0);Bi([E({attribute:"version",type:String}),zi("design:type",Object)],Mr.prototype,"version",void 0);Bi([E({attribute:"scopes",converter:r=>r?r.toLowerCase().split(","):null,reflect:!0}),zi("design:type",Array)],Mr.prototype,"scopes",void 0);Bi([E({attribute:"fallback-details",type:Array}),zi("design:type",Array)],Mr.prototype,"fallbackDetails",void 0);Bi([X(),zi("design:type",Object)],Mr.prototype,"_arrowKeyLocation",void 0);Or();cr();pi();ge();var Gs=function(r,e,t,o){var i=arguments.length,n=i<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,t):o,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(r,e,t,o);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(n=(i<3?s(n):i>3?s(e,t,n):s(e,t))||n);return i>3&&n&&Object.defineProperty(e,t,n),n},js=function(r,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(r,e)},ux=function(r,e,t,o){function i(n){return n instanceof t?n:new t(function(s){s(n)})}return new(t||(t=Promise))(function(n,s){function a(p){try{h(o.next(p))}catch(f){s(f)}}function u(p){try{h(o.throw(p))}catch(f){s(f)}}function h(p){p.done?n(p.value):i(p.value).then(a,u)}h((o=o.apply(r,e||[])).next())})},hx=()=>{at(ln),cc(),Re("agenda",Vi)},Vi=class extends it{constructor(){super(...arguments),this.days=3,this.renderContent=()=>{if(!this.events||this.events.length===0)return this.renderNoData();let e=this.showMax&&this.showMax>0?this.events.slice(0,this.showMax):this.events,t=this.renderTemplate("default",{events:e});if(t)return t;let o={agenda:!0,grouped:this.groupByDay};return x` + `}renderNoData(){return this.renderTemplate("no-data",null)||x``}loadState(){return gF(this,void 0,void 0,function*(){if(!this.people){let e=V.globalProvider;if(e&&e.state===oe.SignedIn){let t=e.graph.forComponent(this);this.groupId?this.people=yield tc(t,null,this.groupId,this.showMax,"person"):this.userIds?this.people=yield Xl(t,this.userIds,"","",this.fallbackDetails):this.peopleQueries?this.people=yield Y3(t,this.peopleQueries,this.fallbackDetails):this.resource?this.people=yield W3(t,this.version,this.resource,this.scopes):this.people=yield mv(t),this.showPresence?this._peoplePresence=yield oP(t,this.people):this._peoplePresence=null}}})}};Bi([E({attribute:"group-id",type:String}),zi("design:type",String)],Mr.prototype,"groupId",void 0);Bi([E({attribute:"user-ids",converter:(r,e)=>r.split(",").map(t=>t.trim())}),zi("design:type",Array)],Mr.prototype,"userIds",void 0);Bi([E({attribute:"people",type:Object}),zi("design:type",Array)],Mr.prototype,"people",void 0);Bi([E({attribute:"people-queries",converter:(r,e)=>r.split(",").map(t=>t.trim())}),zi("design:type",Array)],Mr.prototype,"peopleQueries",void 0);Bi([E({attribute:"show-max",type:Number}),zi("design:type",Number)],Mr.prototype,"showMax",void 0);Bi([E({attribute:"show-presence",type:Boolean}),zi("design:type",Boolean)],Mr.prototype,"showPresence",void 0);Bi([E({attribute:"person-card",converter:(r,e)=>Rd(r,"hover")}),zi("design:type",String)],Mr.prototype,"personCardInteraction",void 0);Bi([E({attribute:"resource",type:String}),zi("design:type",String)],Mr.prototype,"resource",void 0);Bi([E({attribute:"version",type:String}),zi("design:type",Object)],Mr.prototype,"version",void 0);Bi([E({attribute:"scopes",converter:r=>r?r.toLowerCase().split(","):null,reflect:!0}),zi("design:type",Array)],Mr.prototype,"scopes",void 0);Bi([E({attribute:"fallback-details",type:Array}),zi("design:type",Array)],Mr.prototype,"fallbackDetails",void 0);Bi([X(),zi("design:type",Object)],Mr.prototype,"_arrowKeyLocation",void 0);Or();cr();pi();ge();var Gs=function(r,e,t,o){var i=arguments.length,n=i<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,t):o,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(r,e,t,o);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(n=(i<3?s(n):i>3?s(e,t,n):s(e,t))||n);return i>3&&n&&Object.defineProperty(e,t,n),n},js=function(r,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(r,e)},ux=function(r,e,t,o){function i(n){return n instanceof t?n:new t(function(s){s(n)})}return new(t||(t=Promise))(function(n,s){function a(p){try{h(o.next(p))}catch(f){s(f)}}function u(p){try{h(o.throw(p))}catch(f){s(f)}}function h(p){p.done?n(p.value):i(p.value).then(a,u)}h((o=o.apply(r,e||[])).next())})},hx=()=>{at(ln),cc(),Re("agenda",Vi)},Vi=class extends it{constructor(){super(...arguments),this.days=3,this.renderContent=()=>{if(!this.events||this.events.length===0)return this.renderNoData();let e=this.showMax&&this.showMax>0?this.events.slice(0,this.showMax):this.events,t=this.renderTemplate("default",{events:e});if(t)return t;let o={agenda:!0,grouped:this.groupByDay};return x`
${this.groupByDay?this.renderGroups(e):this.renderEvents(e)}
@@ -6468,13 +6468,13 @@ Error Description: `+h.message)),[2,null];case 4:return i||(this.logger.warning( tabindex="0" @focus=${()=>this.eventClicked(t)}> ${this.renderTemplate("event",{event:t},t.id)||this.renderEvent(t)} -
`)}`}args(){return[this.providerState,this.preferredTimezone,this.eventQuery,this.date,this.groupId,this.days]}loadState(){return ux(this,void 0,void 0,function*(){if(this.events)return;let e=yield this.loadEvents();e?.length>0&&(this.events=e)})}eventClicked(e){this.fireCustomEvent("eventClick",e)}getEventTimeString(e){if(e.isAllDay)return"ALL DAY";let t=e.start.dateTime;e.start.timeZone==="UTC"&&(t+="Z");let o=e.end.dateTime;e.end.timeZone==="UTC"&&(o+="Z");let i=this.prettyPrintTimeFromDateTime(new Date(t)),n=this.prettyPrintTimeFromDateTime(new Date(o));return`${i} - ${n}`}loadEvents(){return ux(this,void 0,void 0,function*(){let e=V.globalProvider,t=[];if(e?.state===ie.SignedIn){let o=e.graph.forComponent(this);if(this.eventQuery)try{let i=this.eventQuery.split("|"),n,s;i.length>1?(s=i[0].trim(),n=i[1].trim()):s=this.eventQuery;let a=yield dx(o,s,n?[n]:[]);if(a?.value)for(t=a.value;a.hasNext;)yield a.next(),t=a.value}catch{}else{let i=this.date?new Date(this.date):new Date,n=new Date(i.getTime());n.setDate(i.getDate()+this.days);try{let s=yield n6(o,i,n,this.groupId);if(s?.value)for(t=s.value;s.hasNext;)yield s.next(),t=s.value}catch{}}}return t})}prettyPrintTimeFromDateTime(e){return e.toLocaleTimeString(navigator.language,{timeStyle:"short",timeZone:this.preferredTimezone})}getDateHeaderFromDateTimeString(e){return new Date(e).toLocaleDateString(navigator.language,{dateStyle:"full",timeZone:this.preferredTimezone})}};Gs([E({attribute:"date",type:String}),js("design:type",String)],Vi.prototype,"date",void 0);Gs([E({attribute:"group-id",type:String}),js("design:type",String)],Vi.prototype,"groupId",void 0);Gs([E({attribute:"days",type:Number}),js("design:type",Object)],Vi.prototype,"days",void 0);Gs([E({attribute:"event-query",type:String}),js("design:type",String)],Vi.prototype,"eventQuery",void 0);Gs([E({attribute:"events",type:Array,hasChanged:(r,e)=>r!==e}),js("design:type",Array)],Vi.prototype,"events",void 0);Gs([E({attribute:"show-max",type:Number}),js("design:type",Number)],Vi.prototype,"showMax",void 0);Gs([E({attribute:"group-by-day",type:Boolean}),js("design:type",Boolean)],Vi.prototype,"groupByDay",void 0);Gs([E({attribute:"preferred-timezone",type:String}),js("design:type",String)],Vi.prototype,"preferredTimezone",void 0);Gs([E({attribute:!1}),js("design:type",Boolean)],Vi.prototype,"_isNarrow",void 0);Od();Av();l();c();d();xe();gt();Cd();ge();l();c();d();var a6={comboboxPlaceholder:"Select an item"};cr();Or();vs();l();c();d();xe();gt();ge();_d();Pd();Ni();ge();var Qn=function(r,e,t,o){var i=arguments.length,n=i<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,t):o,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(r,e,t,o);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(n=(i<3?s(n):i>3?s(e,t,n):s(e,t))||n);return i>3&&n&&Object.defineProperty(e,t,n),n},Yn=function(r,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(r,e)},vF=function(r,e,t,o){function i(n){return n instanceof t?n:new t(function(s){s(n)})}return new(t||(t=Promise))(function(n,s){function a(p){try{h(o.next(p))}catch(f){s(f)}}function u(p){try{h(o.throw(p))}catch(f){s(f)}}function h(p){p.done?n(p.value):i(p.value).then(a,u)}h((o=o.apply(r,e||[])).next())})},Fd=r=>Array.isArray(r?.value),yF=["json","image"],bF=r=>typeof r=="string"&&yF.includes(r),wF=(r,e="json")=>bF(r)?r:e,CF=r=>r||W.config.response.invalidationPeriod||W.config.defaultInvalidationPeriod,px=()=>W.config.response.isEnabled&&W.config.isEnabled,dc=()=>Re("get",mi),mi=class extends it{constructor(){super(...arguments),this.scopes=[],this.version="v1.0",this.type="json",this.maxPages=3,this.pollingRate=0,this.cacheEnabled=!1,this.cacheInvalidationPeriod=0,this.isPolling=!1,this.isRefreshing=!1,this.renderLoading=()=>{let e=this.renderTemplate("loading",null);return Fd(this.response)?this.renderValueContentWithDefaultTemplate(x`${this.response.value.map(t=>this.renderTemplate("value",t,t.id))} ${e} `):e},this.renderContent=()=>{if(this.hasTemplate("value")&&Fd(this.response)){let e=Fd(this.response)?x` +
`)}`}args(){return[this.providerState,this.preferredTimezone,this.eventQuery,this.date,this.groupId,this.days]}loadState(){return ux(this,void 0,void 0,function*(){if(this.events)return;let e=yield this.loadEvents();e?.length>0&&(this.events=e)})}eventClicked(e){this.fireCustomEvent("eventClick",e)}getEventTimeString(e){if(e.isAllDay)return"ALL DAY";let t=e.start.dateTime;e.start.timeZone==="UTC"&&(t+="Z");let o=e.end.dateTime;e.end.timeZone==="UTC"&&(o+="Z");let i=this.prettyPrintTimeFromDateTime(new Date(t)),n=this.prettyPrintTimeFromDateTime(new Date(o));return`${i} - ${n}`}loadEvents(){return ux(this,void 0,void 0,function*(){let e=V.globalProvider,t=[];if(e?.state===oe.SignedIn){let o=e.graph.forComponent(this);if(this.eventQuery)try{let i=this.eventQuery.split("|"),n,s;i.length>1?(s=i[0].trim(),n=i[1].trim()):s=this.eventQuery;let a=yield dx(o,s,n?[n]:[]);if(a?.value)for(t=a.value;a.hasNext;)yield a.next(),t=a.value}catch{}else{let i=this.date?new Date(this.date):new Date,n=new Date(i.getTime());n.setDate(i.getDate()+this.days);try{let s=yield n6(o,i,n,this.groupId);if(s?.value)for(t=s.value;s.hasNext;)yield s.next(),t=s.value}catch{}}}return t})}prettyPrintTimeFromDateTime(e){return e.toLocaleTimeString(navigator.language,{timeStyle:"short",timeZone:this.preferredTimezone})}getDateHeaderFromDateTimeString(e){return new Date(e).toLocaleDateString(navigator.language,{dateStyle:"full",timeZone:this.preferredTimezone})}};Gs([E({attribute:"date",type:String}),js("design:type",String)],Vi.prototype,"date",void 0);Gs([E({attribute:"group-id",type:String}),js("design:type",String)],Vi.prototype,"groupId",void 0);Gs([E({attribute:"days",type:Number}),js("design:type",Object)],Vi.prototype,"days",void 0);Gs([E({attribute:"event-query",type:String}),js("design:type",String)],Vi.prototype,"eventQuery",void 0);Gs([E({attribute:"events",type:Array,hasChanged:(r,e)=>r!==e}),js("design:type",Array)],Vi.prototype,"events",void 0);Gs([E({attribute:"show-max",type:Number}),js("design:type",Number)],Vi.prototype,"showMax",void 0);Gs([E({attribute:"group-by-day",type:Boolean}),js("design:type",Boolean)],Vi.prototype,"groupByDay",void 0);Gs([E({attribute:"preferred-timezone",type:String}),js("design:type",String)],Vi.prototype,"preferredTimezone",void 0);Gs([E({attribute:!1}),js("design:type",Boolean)],Vi.prototype,"_isNarrow",void 0);Od();Av();l();c();d();xe();gt();Cd();ge();l();c();d();var a6={comboboxPlaceholder:"Select an item"};cr();Or();vs();l();c();d();xe();gt();ge();_d();Pd();Ni();ge();var Qn=function(r,e,t,o){var i=arguments.length,n=i<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,t):o,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(r,e,t,o);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(n=(i<3?s(n):i>3?s(e,t,n):s(e,t))||n);return i>3&&n&&Object.defineProperty(e,t,n),n},Yn=function(r,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(r,e)},vF=function(r,e,t,o){function i(n){return n instanceof t?n:new t(function(s){s(n)})}return new(t||(t=Promise))(function(n,s){function a(p){try{h(o.next(p))}catch(f){s(f)}}function u(p){try{h(o.throw(p))}catch(f){s(f)}}function h(p){p.done?n(p.value):i(p.value).then(a,u)}h((o=o.apply(r,e||[])).next())})},Fd=r=>Array.isArray(r?.value),yF=["json","image"],bF=r=>typeof r=="string"&&yF.includes(r),wF=(r,e="json")=>bF(r)?r:e,CF=r=>r||W.config.response.invalidationPeriod||W.config.defaultInvalidationPeriod,px=()=>W.config.response.isEnabled&&W.config.isEnabled,dc=()=>Re("get",mi),mi=class extends it{constructor(){super(...arguments),this.scopes=[],this.version="v1.0",this.type="json",this.maxPages=3,this.pollingRate=0,this.cacheEnabled=!1,this.cacheInvalidationPeriod=0,this.isPolling=!1,this.isRefreshing=!1,this.renderLoading=()=>{let e=this.renderTemplate("loading",null);return Fd(this.response)?this.renderValueContentWithDefaultTemplate(x`${this.response.value.map(t=>this.renderTemplate("value",t,t.id))} ${e} `):e},this.renderContent=()=>{if(this.hasTemplate("value")&&Fd(this.response)){let e=Fd(this.response)?x` ${this.response.value.map(t=>this.renderTemplate("value",t,t.id))} `:this.renderTemplate("value",this.response);return this.renderValueContentWithDefaultTemplate(e)}else return this.response?this.renderTemplate("default",this.response)||x``:this.hasTemplate("no-data")?this.renderTemplate("no-data",null):x``}}refresh(e=!1){this.isRefreshing=!0,e&&this.clearState(),this._task.run()}clearState(){this.response=null}args(){return[this.providerState,this.resource,this.scopes,this.version,this.pollingRate,this.type,this.maxPages,this.cacheEnabled,this.cacheInvalidationPeriod]}renderValueContentWithDefaultTemplate(e){var t,o;if(this.hasTemplate("default")){let i=this.renderTemplate("default",this.response);return((o=(t=this.templates.value)===null||t===void 0?void 0:t.templateOrder)!==null&&o!==void 0?o:999)>this.templates.default.templateOrder?x` ${i}${e} `:x` ${e}${i} - `}else return e}loadState(){var e,t,o;return vF(this,void 0,void 0,function*(){let i=V.globalProvider;if(this.error=null,!(!i||i.state!==ie.SignedIn)){if(this.resource){try{let n,s=`${this.version}${this.resource}`,a=null;if(this.shouldRetrieveCache()){n=W.getCache(N.get,N.get.stores.responses);let u=px()?yield n.getValue(s):null;u&&CF(this.cacheInvalidationPeriod)>Date.now()-u.timeCached&&(a=JSON.parse(u.response))}if(!a){let u=this.resource,h=!1;!((e=this.response)===null||e===void 0)&&e["@odata.deltaLink"]?(u=this.response["@odata.deltaLink"],h=!0):h=new URL(u,"https://graph.microsoft.com").pathname.endsWith("delta");let p=i.graph.forComponent(this),f=p.api(u).version(this.version);if(!((t=this.scopes)===null||t===void 0)&&t.length&&(f=f.middlewareOptions(be(this.scopes))),this.type==="json"){if(a=yield f.get(),h&&Fd(this.response)&&Fd(a)){let b=a.value;a.value=this.response.value.concat(b)}if(!this.isPolling&&!as(this.response,a)&&(this.response=a),Fd(a)&&a["@odata.nextLink"]){let b=1,C=a;for(;(b-1){let C=this.resource.replace("/photo/$value",""),S=yield zs(p,C,this.scopes);S&&(b=S.photo)}else if(this.resource.indexOf("/thumbnails/")>-1){let C=yield qP(p,this.resource,this.scopes);C&&(b=C.thumbnail)}b&&(a={image:b})}this.shouldUpdateCache()&&a&&(n=W.getCache(N.get,N.get.stores.responses),yield n.putValue(s,{response:JSON.stringify(a)}))}as(this.response,a)||(this.response=a)}catch(n){this.error=n}this.response&&(this.error=null,this.pollingRate&&setTimeout(()=>{this.isPolling=!0,this.loadState().finally(()=>{this.isPolling=!1})},this.pollingRate))}else this.response=null;this.isRefreshing=!1,this.fireCustomEvent("dataChange",{response:this.response,error:this.error},!0,!1,!0)}})}shouldRetrieveCache(){return px()&&this.cacheEnabled&&!(this.isRefreshing||this.isPolling)}shouldUpdateCache(){return px()&&this.cacheEnabled}};Qn([E({attribute:"resource",reflect:!0,type:String}),Yn("design:type",String)],mi.prototype,"resource",void 0);Qn([E({attribute:"scopes",converter:(r,e)=>r?r.toLowerCase().split(","):null,reflect:!0}),Yn("design:type",Array)],mi.prototype,"scopes",void 0);Qn([E({attribute:"version",reflect:!0,type:String}),Yn("design:type",Object)],mi.prototype,"version",void 0);Qn([E({attribute:"type",reflect:!0,type:String,converter:r=>wF(r,"json")}),Yn("design:type",String)],mi.prototype,"type",void 0);Qn([E({attribute:"max-pages",reflect:!0,type:Number}),Yn("design:type",Object)],mi.prototype,"maxPages",void 0);Qn([E({attribute:"polling-rate",reflect:!0,type:Number}),Yn("design:type",Object)],mi.prototype,"pollingRate",void 0);Qn([E({attribute:"cache-enabled",reflect:!0,type:Boolean}),Yn("design:type",Object)],mi.prototype,"cacheEnabled",void 0);Qn([E({attribute:"cache-invalidation-period",type:Number}),Yn("design:type",Object)],mi.prototype,"cacheInvalidationPeriod",void 0);Qn([E({attribute:!1}),Yn("design:type",Object)],mi.prototype,"response",void 0);Qn([E({attribute:!1}),Yn("design:type",Object)],mi.prototype,"error",void 0);l();c();d();xe();var l6=[Oe` + `}else return e}loadState(){var e,t,o;return vF(this,void 0,void 0,function*(){let i=V.globalProvider;if(this.error=null,!(!i||i.state!==oe.SignedIn)){if(this.resource){try{let n,s=`${this.version}${this.resource}`,a=null;if(this.shouldRetrieveCache()){n=W.getCache(N.get,N.get.stores.responses);let u=px()?yield n.getValue(s):null;u&&CF(this.cacheInvalidationPeriod)>Date.now()-u.timeCached&&(a=JSON.parse(u.response))}if(!a){let u=this.resource,h=!1;!((e=this.response)===null||e===void 0)&&e["@odata.deltaLink"]?(u=this.response["@odata.deltaLink"],h=!0):h=new URL(u,"https://graph.microsoft.com").pathname.endsWith("delta");let p=i.graph.forComponent(this),f=p.api(u).version(this.version);if(!((t=this.scopes)===null||t===void 0)&&t.length&&(f=f.middlewareOptions(be(this.scopes))),this.type==="json"){if(a=yield f.get(),h&&Fd(this.response)&&Fd(a)){let b=a.value;a.value=this.response.value.concat(b)}if(!this.isPolling&&!as(this.response,a)&&(this.response=a),Fd(a)&&a["@odata.nextLink"]){let b=1,C=a;for(;(b-1){let C=this.resource.replace("/photo/$value",""),S=yield zs(p,C,this.scopes);S&&(b=S.photo)}else if(this.resource.indexOf("/thumbnails/")>-1){let C=yield qP(p,this.resource,this.scopes);C&&(b=C.thumbnail)}b&&(a={image:b})}this.shouldUpdateCache()&&a&&(n=W.getCache(N.get,N.get.stores.responses),yield n.putValue(s,{response:JSON.stringify(a)}))}as(this.response,a)||(this.response=a)}catch(n){this.error=n}this.response&&(this.error=null,this.pollingRate&&setTimeout(()=>{this.isPolling=!0,this.loadState().finally(()=>{this.isPolling=!1})},this.pollingRate))}else this.response=null;this.isRefreshing=!1,this.fireCustomEvent("dataChange",{response:this.response,error:this.error},!0,!1,!0)}})}shouldRetrieveCache(){return px()&&this.cacheEnabled&&!(this.isRefreshing||this.isPolling)}shouldUpdateCache(){return px()&&this.cacheEnabled}};Qn([E({attribute:"resource",reflect:!0,type:String}),Yn("design:type",String)],mi.prototype,"resource",void 0);Qn([E({attribute:"scopes",converter:(r,e)=>r?r.toLowerCase().split(","):null,reflect:!0}),Yn("design:type",Array)],mi.prototype,"scopes",void 0);Qn([E({attribute:"version",reflect:!0,type:String}),Yn("design:type",Object)],mi.prototype,"version",void 0);Qn([E({attribute:"type",reflect:!0,type:String,converter:r=>wF(r,"json")}),Yn("design:type",String)],mi.prototype,"type",void 0);Qn([E({attribute:"max-pages",reflect:!0,type:Number}),Yn("design:type",Object)],mi.prototype,"maxPages",void 0);Qn([E({attribute:"polling-rate",reflect:!0,type:Number}),Yn("design:type",Object)],mi.prototype,"pollingRate",void 0);Qn([E({attribute:"cache-enabled",reflect:!0,type:Boolean}),Yn("design:type",Object)],mi.prototype,"cacheEnabled",void 0);Qn([E({attribute:"cache-invalidation-period",type:Number}),Yn("design:type",Object)],mi.prototype,"cacheInvalidationPeriod",void 0);Qn([E({attribute:!1}),Yn("design:type",Object)],mi.prototype,"response",void 0);Qn([E({attribute:!1}),Yn("design:type",Object)],mi.prototype,"error",void 0);l();c();d();xe();var l6=[Oe` :host([hidden]){display:none}:host{display:block;font-family:var(--default-font-family, "Segoe UI", "Segoe UI Web (West European)", "Segoe UI", -apple-system, "BlinkMacSystemFont", "Roboto", "Helvetica Neue", sans-serif);font-size:var(--default-font-size, 14px);--theme-primary-color:#0078d7;--theme-dark-color:#005a9e}:focus-visible{outline-color:var(--focus-ring-color,Highlight);outline-color:var(--focus-ring-color,-webkit-focus-ring-color);outline-style:var(--focus-ring-style,auto)}.ms-icon{display:inline-block;font-family:FabricMDL2Icons;font-style:normal;font-weight:400;font-size:16px;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;margin:4px 0}.error{background-color:#fde7e9;padding-block:8px;padding-inline:8px 12px}.ms-icon-chevron-down::before{content:"\\\e70d"}.ms-icon-chevron-up::before{content:"\\\e70e"}.ms-icon-contact::before{content:"\\\e77b"}.ms-icon-add-friend::before{content:"\\\e8fa"}.ms-icon-outlook-logo-inverser::before{content:"\\\eb6d"}:host{--max-height:var(--picker-max-height, 380px);font-family:var(--default-font-family)}:host .picker{background-color:var(--picker-background-color,transparent)}:host fluent-combobox::part(selected-value)::placeholder{color:var(--picker-text-color,var(--input-filled-placeholder-rest))}:host fluent-combobox::part(selected-value):hover::placeholder{color:var(--picker-text-color-hover,var(--secondary-text-hover-color))}[dir=rtl] .picker{direction:rtl} `];ge();var hn=function(r,e,t,o){var i=arguments.length,n=i<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,t):o,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(r,e,t,o);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(n=(i<3?s(n):i>3?s(e,t,n):s(e,t))||n);return i>3&&n&&Object.defineProperty(e,t,n),n},pn=function(r,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(r,e)},Yh=()=>{at(Eh,Zl),dc(),Re("picker",ei)},ei=class extends it{get strings(){return a6}static get styles(){return l6}constructor(){super(),this.version="v1.0",this.maxPages=3,this.scopes=[],this.cacheEnabled=!1,this.cacheInvalidationPeriod=0,this.renderLoading=()=>this.response?this.renderContent():this.renderTemplate("loading",null),this.renderContent=()=>{var e;let t=this.error?this.error:null;return t&&this.hasTemplate("error")?this.renderTemplate("error",{error:t},"error"):this.hasTemplate("no-data")?this.renderTemplate("no-data",null):((e=this.response)===null||e===void 0?void 0:e.length)>0?this.renderPicker():this.renderGet()},this.handleComboboxKeydown=e=>{let t,o,i=e.key,s=e.target.querySelector(".selected");s&&(t=s.getAttribute("value")),i==="Enter"&&t&&(o=this.response.filter(a=>a.id===t).pop(),this.fireCustomEvent("selectionChanged",o,!0,!1,!0))},this.placeholder=this.strings.comboboxPlaceholder,this.entityType=null,this.keyName=null}refresh(e=!1){e&&this.clearState(),this._task.run()}clearState(){this.response=null,this.error=null}renderPicker(){return Te`