@equinor/fusion-framework-cli 2.0.3 → 2.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -12,7 +12,7 @@ Error generating stack: `+o.message+`
|
|
|
12
12
|
Error: `+s.errorCode+`
|
|
13
13
|
Error Description: `+s.errorMessage):(c=s,this.logger.error(`A non-MSALJS error was thrown while attempting to get the cloud instance discovery metadata.
|
|
14
14
|
Error: `+c.name+`
|
|
15
|
-
Error Description: `+c.message)),[2,null];case 4:return n||(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."),n=t.createCloudDiscoveryMetadataFromHost(this.hostnameAndPort)),[2,n]}})})},t.prototype.getCloudDiscoveryMetadataFromHarcodedValues=function(){return this.canonicalAuthority in sm?sm[this.canonicalAuthority]:null},t.prototype.isInKnownAuthorities=function(){var e=this,r=this.authorityOptions.knownAuthorities.filter(function(n){return be.getDomainFromUrl(n).toLowerCase()===e.hostnameAndPort});return r.length>0},t.generateAuthority=function(e,r){var n;if(r&&r.azureCloudInstance!==dc.None){var i=r.tenant?r.tenant:_.DEFAULT_COMMON_TENANT;n=r.azureCloudInstance+"/"+i+"/"}return n||e},t.createCloudDiscoveryMetadataFromHost=function(e){return{preferred_network:e,preferred_cache:e,aliases:[e]}},t.getCloudDiscoveryMetadataFromNetworkResponse=function(e,r){for(var n=0;n<e.length;n++){var i=e[n];if(i.aliases.indexOf(r)>-1)return i}return null},t.prototype.getPreferredCache=function(){if(this.discoveryComplete())return this.metadata.preferred_cache;throw j.createEndpointDiscoveryIncompleteError("Discovery incomplete.")},t.prototype.isAlias=function(e){return this.metadata.aliases.indexOf(e)>-1},t.isPublicCloudAuthority=function(e){return _.KNOWN_PUBLIC_CLOUDS.indexOf(e)>=0},t.buildRegionalAuthorityString=function(e,r,n){var i=new be(e);i.validateAsUri();var o=i.getUrlComponents(),a=r+"."+o.HostNameAndPort;this.isPublicCloudAuthority(o.HostNameAndPort)&&(a=r+"."+_.REGIONAL_AUTH_PUBLIC_CLOUD_SUFFIX);var s=be.constructAuthorityUriFromObject(Re(Re({},i.getUrlComponents()),{HostNameAndPort:a})).urlString;return n?s+"?"+n:s},t.replaceWithRegionalInformation=function(e,r){return e.authorization_endpoint=t.buildRegionalAuthorityString(e.authorization_endpoint,r),e.token_endpoint=t.buildRegionalAuthorityString(e.token_endpoint,r,_.REGIONAL_AUTH_NON_MSI_QUERY_STRING),e.end_session_endpoint&&(e.end_session_endpoint=t.buildRegionalAuthorityString(e.end_session_endpoint,r)),e},t}();var Kd=function(){function t(){}return t.createDiscoveredInstance=function(e,r,n,i,o,a){return Z(this,void 0,void 0,function(){var s,c;return ee(this,function(l){switch(l.label){case 0:s=t.createInstance(e,r,n,i,o,a),l.label=1;case 1:return l.trys.push([1,3,,4]),[4,s.resolveEndpointsAsync()];case 2:return l.sent(),[2,s];case 3:throw c=l.sent(),j.createEndpointDiscoveryIncompleteError(c);case 4:return[2]}})})},t.createInstance=function(e,r,n,i,o,a){if(V.isEmpty(e))throw Fe.createUrlEmptyError();return new Gd(e,r,n,i,o,a)},t}();var Wd=function(){function t(){this.failedRequests=[],this.errors=[],this.cacheHits=0}return t.isServerTelemetryEntity=function(e,r){var n=e.indexOf(wt.CACHE_KEY)===0,i=!0;return r&&(i=r.hasOwnProperty("failedRequests")&&r.hasOwnProperty("errors")&&r.hasOwnProperty("cacheHits")),n&&i},t}();var cm=function(){function t(){}return t.isThrottlingEntity=function(e,r){var n=!1;e&&(n=e.indexOf(Fs.THROTTLING_PREFIX)===0);var i=!0;return r&&(i=r.hasOwnProperty("throttleTime")),n&&i},t}();var E_={sendGetRequestAsync:function(){var t="Network interface - sendGetRequestAsync() has not been implemented for the Network interface.";return Promise.reject(W.createUnexpectedError(t))},sendPostRequestAsync:function(){var t="Network interface - sendPostRequestAsync() has not been implemented for the Network interface.";return Promise.reject(W.createUnexpectedError(t))}};var ml={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."}},lm=function(t){br(e,t);function e(r,n){var i=t.call(this,r,n)||this;return i.name="JoseHeaderError",Object.setPrototypeOf(i,e.prototype),i}return e.createMissingKidError=function(){return new e(ml.missingKidError.code,ml.missingKidError.desc)},e.createMissingAlgError=function(){return new e(ml.missingAlgError.code,ml.missingAlgError.desc)},e}(W);var C_=function(){function t(e){this.typ=e.typ,this.alg=e.alg,this.kid=e.kid}return t.getShrHeaderString=function(e){if(!e.kid)throw lm.createMissingKidError();if(!e.alg)throw lm.createMissingAlgError();var r=new t({typ:e.typ||s2.Jwt,kid:e.kid,alg:e.alg});return JSON.stringify(r)},t}();var z_=function(){function t(e,r){this.cacheOutcome=lo.NO_CACHE_HIT,this.cacheManager=r,this.apiId=e.apiId,this.correlationId=e.correlationId,this.wrapperSKU=e.wrapperSKU||_.EMPTY_STRING,this.wrapperVer=e.wrapperVer||_.EMPTY_STRING,this.telemetryCacheKey=wt.CACHE_KEY+Tr.CACHE_KEY_SEPARATOR+e.clientId}return t.prototype.generateCurrentRequestHeaderValue=function(){var e=""+this.apiId+wt.VALUE_SEPARATOR+this.cacheOutcome,r=[this.wrapperSKU,this.wrapperVer].join(wt.VALUE_SEPARATOR),n=this.getRegionDiscoveryFields(),i=[e,n].join(wt.VALUE_SEPARATOR);return[wt.SCHEMA_VERSION,i,r].join(wt.CATEGORY_SEPARATOR)},t.prototype.generateLastRequestHeaderValue=function(){var e=this.getLastRequests(),r=t.maxErrorsToSend(e),n=e.failedRequests.slice(0,2*r).join(wt.VALUE_SEPARATOR),i=e.errors.slice(0,r).join(wt.VALUE_SEPARATOR),o=e.errors.length,a=r<o?wt.OVERFLOW_TRUE:wt.OVERFLOW_FALSE,s=[o,a].join(wt.VALUE_SEPARATOR);return[wt.SCHEMA_VERSION,e.cacheHits,n,i,s].join(wt.CATEGORY_SEPARATOR)},t.prototype.cacheFailedRequest=function(e){var r=this.getLastRequests();r.errors.length>=wt.MAX_CACHED_ERRORS&&(r.failedRequests.shift(),r.failedRequests.shift(),r.errors.shift()),r.failedRequests.push(this.apiId,this.correlationId),V.isEmpty(e.subError)?V.isEmpty(e.errorCode)?!!e&&e.toString()?r.errors.push(e.toString()):r.errors.push(wt.UNKNOWN_ERROR):r.errors.push(e.errorCode):r.errors.push(e.subError),this.cacheManager.setServerTelemetry(this.telemetryCacheKey,r)},t.prototype.incrementCacheHits=function(){var e=this.getLastRequests();return e.cacheHits+=1,this.cacheManager.setServerTelemetry(this.telemetryCacheKey,e),e.cacheHits},t.prototype.getLastRequests=function(){var e=new Wd,r=this.cacheManager.getServerTelemetry(this.telemetryCacheKey);return r||e},t.prototype.clearTelemetryCache=function(){var e=this.getLastRequests(),r=t.maxErrorsToSend(e),n=e.errors.length;if(r===n)this.cacheManager.removeItem(this.telemetryCacheKey);else{var i=new Wd;i.failedRequests=e.failedRequests.slice(r*2),i.errors=e.errors.slice(r),this.cacheManager.setServerTelemetry(this.telemetryCacheKey,i)}},t.maxErrorsToSend=function(e){var r,n=0,i=0,o=e.errors.length;for(r=0;r<o;r++){var a=e.failedRequests[2*r]||_.EMPTY_STRING,s=e.failedRequests[2*r+1]||_.EMPTY_STRING,c=e.errors[r]||_.EMPTY_STRING;if(i+=a.toString().length+s.toString().length+c.length+3,i<wt.MAX_LAST_HEADER_BYTES)n+=1;else break}return n},t.prototype.getRegionDiscoveryFields=function(){var e=[];return e.push(this.regionUsed||_.EMPTY_STRING),e.push(this.regionSource||_.EMPTY_STRING),e.push(this.regionOutcome||_.EMPTY_STRING),e.join(",")},t.prototype.updateRegionDiscoveryMetadata=function(e){this.regionUsed=e.region_used,this.regionSource=e.region_source,this.regionOutcome=e.region_outcome},t.prototype.setCacheOutcome=function(e){this.cacheOutcome=e},t}();var i3=function(){function t(e,r,n,i,o,a){this.authority=r,this.libraryName=i,this.libraryVersion=o,this.applicationTelemetry=a,this.clientId=e,this.logger=n,this.callbacks=new Map,this.eventsByCorrelationId=new Map,this.staticFieldsByCorrelationId=new Map,this.measurementsById=new Map}return t.prototype.startMeasurement=function(e,r){var n=this,i,o,a=r||this.generateId();r||this.logger.info("PerformanceClient: No correlation id provided for "+e+", generating",a),this.logger.trace("PerformanceClient: Performance measurement started for "+e,a);var s=this.startPerformanceMeasuremeant(e,a);s.startMeasurement();var c={eventId:this.generateId(),status:ha.InProgress,authority:this.authority,libraryName:this.libraryName,libraryVersion:this.libraryVersion,clientId:this.clientId,name:e,startTimeMs:Date.now(),correlationId:a};this.cacheEventByCorrelationId(c);var l={appName:(i=this.applicationTelemetry)===null||i===void 0?void 0:i.appName,appVersion:(o=this.applicationTelemetry)===null||o===void 0?void 0:o.appVersion};return this.addStaticFields(l,a),this.cacheMeasurement(c,s),{endMeasurement:function(d){var h=n.endMeasurement(Re(Re({},c),d));return h&&n.cacheEventByCorrelationId(h),h},flushMeasurement:function(){return n.flushMeasurements(c.name,c.correlationId)},discardMeasurement:function(){return n.discardMeasurements(c.correlationId)},addStaticFields:function(d){return n.addStaticFields(d,c.correlationId)},measurement:s,event:c}},t.prototype.endMeasurement=function(e){var r=this.measurementsById.get(e.eventId);if(r){this.measurementsById.delete(e.eventId),r.endMeasurement();var n=r.flushMeasurement();if(n!==null){this.logger.trace("PerformanceClient: Performance measurement ended for "+e.name+": "+n+" ms",e.correlationId);var i=Re(Re({durationMs:Math.round(n)},e),{status:ha.Completed});return i}else this.logger.trace("PerformanceClient: Performance measurement not taken",e.correlationId)}else this.logger.trace("PerformanceClient: Measurement not found for "+e.eventId,e.correlationId);return null},t.prototype.addStaticFields=function(e,r){var n=this.staticFieldsByCorrelationId.get(r);n?(this.logger.trace("PerformanceClient: Updating static fields"),this.staticFieldsByCorrelationId.set(r,Re(Re({},n),e))):(this.logger.trace("PerformanceClient: Adding static fields"),this.staticFieldsByCorrelationId.set(r,e))},t.prototype.cacheEventByCorrelationId=function(e){var r=this.eventsByCorrelationId.get(e.correlationId);r?(this.logger.trace("PerformanceClient: Performance measurement for "+e.name+" added/updated",e.correlationId),r.set(e.eventId,e)):(this.logger.trace("PerformanceClient: Performance measurement for "+e.name+" started",e.correlationId),this.eventsByCorrelationId.set(e.correlationId,new Map().set(e.eventId,e)))},t.prototype.cacheMeasurement=function(e,r){this.measurementsById.set(e.eventId,r)},t.prototype.flushMeasurements=function(e,r){var n=this;this.logger.trace("PerformanceClient: Performance measurements flushed for "+e,r);var i=this.eventsByCorrelationId.get(r);if(i){this.discardMeasurements(r);var o=[];i.forEach(function(u){if(u.name!==e&&u.status!==ha.Completed){n.logger.trace("PerformanceClient: Incomplete submeasurement "+u.name+" found for "+e,r);var f=n.endMeasurement(u);f&&o.push(f)}o.push(u)});var a=o.sort(function(u,f){return u.startTimeMs-f.startTimeMs}),s=a.filter(function(u){return u.name===e&&u.status===ha.Completed});if(s.length>0){s.length>1&&this.logger.verbose("PerformanceClient: Multiple distinct top-level performance events found, using the first",r);var c=s[0];this.logger.verbose("PerformanceClient: Measurement found for "+e,r);var l=a.reduce(function(u,f){if(f.name!==e){n.logger.trace("PerformanceClient: Complete submeasurement found for "+f.name,r);var v=f.name+"DurationMs";u[v]?n.logger.verbose("PerformanceClient: Submeasurement for "+e+" already exists for "+f.name+", ignoring",r):u[v]=f.durationMs}return u},c),d=this.staticFieldsByCorrelationId.get(r),h=Re(Re({},l),d);this.emitEvents([h],l.correlationId)}else this.logger.verbose("PerformanceClient: No completed top-level measurements found for "+e,r)}else this.logger.verbose("PerformanceClient: No measurements found",r)},t.prototype.discardMeasurements=function(e){this.logger.trace("PerformanceClient: Performance measurements discarded",e),this.eventsByCorrelationId.delete(e)},t.prototype.addPerformanceCallback=function(e){var r=this.generateId();return this.callbacks.set(r,e),this.logger.verbose("PerformanceClient: Performance callback registered with id: "+r),r},t.prototype.removePerformanceCallback=function(e){var r=this.callbacks.delete(e);return r?this.logger.verbose("PerformanceClient: Performance callback "+e+" removed."):this.logger.verbose("PerformanceClient: Performance callback "+e+" not removed."),r},t.prototype.emitEvents=function(e,r){var n=this;this.logger.verbose("PerformanceClient: Emitting performance events",r),this.callbacks.forEach(function(i,o){n.logger.trace("PerformanceClient: Emitting event to callback "+o,r),i.apply(null,[e])})},t}();var S_=function(){function t(){}return t.prototype.startMeasurement=function(){},t.prototype.endMeasurement=function(){},t.prototype.flushMeasurement=function(){return null},t}(),k_=function(t){br(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.generateId=function(){return"callback-id"},e.prototype.startPerformanceMeasuremeant=function(){return new S_},e}(i3);var P={pkceNotGenerated:{code:"pkce_not_created",desc:"The PKCE code challenge and verifier could not be generated."},cryptoDoesNotExist:{code:"crypto_nonexistent",desc:"The crypto object or function is not available."},httpMethodNotImplementedError:{code:"http_method_not_implemented",desc:"The HTTP method given has not been implemented in this library."},emptyNavigateUriError:{code:"empty_navigate_uri",desc:"Navigation URI is empty. Please check stack trace for more info."},hashEmptyError:{code:"hash_empty_error",desc:"Hash value cannot be processed because it is empty. Please verify that your redirectUri is not clearing the hash. For more visit: aka.ms/msaljs/browser-errors."},hashDoesNotContainStateError:{code:"no_state_in_hash",desc:"Hash does not contain state. Please verify that the request originated from msal."},hashDoesNotContainKnownPropertiesError:{code:"hash_does_not_contain_known_properties",desc:"Hash does not contain known properites. Please verify that your redirectUri is not changing the hash. For more visit: aka.ms/msaljs/browser-errors."},unableToParseStateError:{code:"unable_to_parse_state",desc:"Unable to parse state. Please verify that the request originated from msal."},stateInteractionTypeMismatchError:{code:"state_interaction_type_mismatch",desc:"Hash contains state but the interaction type does not match the caller."},interactionInProgress:{code:"interaction_in_progress",desc:"Interaction is currently in progress. Please ensure that this interaction has been completed before calling an interactive API. For more visit: aka.ms/msaljs/browser-errors."},popupWindowError:{code:"popup_window_error",desc:"Error opening popup window. This can happen if you are using IE or if popups are blocked in the browser."},emptyWindowError:{code:"empty_window_error",desc:"window.open returned null or undefined window object."},userCancelledError:{code:"user_cancelled",desc:"User cancelled the flow."},monitorPopupTimeoutError:{code:"monitor_window_timeout",desc:"Token acquisition in popup failed due to timeout. For more visit: aka.ms/msaljs/browser-errors."},monitorIframeTimeoutError:{code:"monitor_window_timeout",desc:"Token acquisition in iframe failed due to timeout. For more visit: aka.ms/msaljs/browser-errors."},redirectInIframeError:{code:"redirect_in_iframe",desc:"Redirects are not supported for iframed or brokered applications. Please ensure you are using MSAL.js in a top frame of the window if using the redirect APIs, or use the popup APIs."},blockTokenRequestsInHiddenIframeError:{code:"block_iframe_reload",desc:"Request was blocked inside an iframe because MSAL detected an authentication response. For more visit: aka.ms/msaljs/browser-errors"},blockAcquireTokenInPopupsError:{code:"block_nested_popups",desc:"Request was blocked inside a popup because MSAL detected it was running in a popup."},iframeClosedPrematurelyError:{code:"iframe_closed_prematurely",desc:"The iframe being monitored was closed prematurely."},silentLogoutUnsupportedError:{code:"silent_logout_unsupported",desc:"Silent logout not supported. Please call logoutRedirect or logoutPopup instead."},noAccountError:{code:"no_account_error",desc:"No account object provided to acquireTokenSilent and no active account has been set. Please call setActiveAccount or provide an account on the request."},silentPromptValueError:{code:"silent_prompt_value_error",desc:"The value given for the prompt value is not valid for silent requests - must be set to 'none' or 'no_session'."},noTokenRequestCacheError:{code:"no_token_request_cache_error",desc:"No token request found in cache."},unableToParseTokenRequestCacheError:{code:"unable_to_parse_token_request_cache_error",desc:"The cached token request could not be parsed."},noCachedAuthorityError:{code:"no_cached_authority_error",desc:"No cached authority found."},authRequestNotSet:{code:"auth_request_not_set_error",desc:"Auth Request not set. Please ensure initiateAuthRequest was called from the InteractionHandler"},invalidCacheType:{code:"invalid_cache_type",desc:"Invalid cache type"},notInBrowserEnvironment:{code:"non_browser_environment",desc:"Login and token requests are not supported in non-browser environments."},databaseNotOpen:{code:"database_not_open",desc:"Database is not open!"},noNetworkConnectivity:{code:"no_network_connectivity",desc:"No network connectivity. Check your internet connection."},postRequestFailed:{code:"post_request_failed",desc:"Network request failed: If the browser threw a CORS error, check that the redirectUri is registered in the Azure App Portal as type 'SPA'"},getRequestFailed:{code:"get_request_failed",desc:"Network request failed. Please check the network trace to determine root cause."},failedToParseNetworkResponse:{code:"failed_to_parse_response",desc:"Failed to parse network response. Check network trace."},unableToLoadTokenError:{code:"unable_to_load_token",desc:"Error loading token to cache."},signingKeyNotFoundInStorage:{code:"crypto_key_not_found",desc:"Cryptographic Key or Keypair not found in browser storage."},authCodeRequired:{code:"auth_code_required",desc:"An authorization code must be provided (as the `code` property on the request) to this flow."},authCodeOrNativeAccountRequired:{code:"auth_code_or_nativeAccountId_required",desc:"An authorization code or nativeAccountId must be provided to this flow."},databaseUnavailable:{code:"database_unavailable",desc:"IndexedDB, which is required for persistent cryptographic key storage, is unavailable. This may be caused by browser privacy features which block persistent storage in third-party contexts."},unableToAcquireTokenFromNativePlatform:{code:"unable_to_acquire_token_from_native_platform",desc:"Unable to acquire token from native platform. For a list of possible reasons visit aka.ms/msaljs/browser-errors."},nativeHandshakeTimeout:{code:"native_handshake_timeout",desc:"Timed out while attempting to establish connection to browser extension"},nativeExtensionNotInstalled:{code:"native_extension_not_installed",desc:"Native extension is not installed. If you think this is a mistake call the initialize function."},nativeConnectionNotEstablished:{code:"native_connection_not_established",desc:"Connection to native platform has not been established. Please install a compatible browser extension and run initialize(). For more please visit aka.ms/msaljs/browser-errors."},nativeBrokerCalledBeforeInitialize:{code:"native_broker_called_before_initialize",desc:"You must call and await the initialize function before attempting to call any other MSAL API when native brokering is enabled. For more please visit aka.ms/msaljs/browser-errors."},nativePromptNotSupported:{code:"native_prompt_not_supported",desc:"The provided prompt is not supported by the native platform. This request should be routed to the web based flow."}},D=function(t){It(e,t);function e(r,n){var i=t.call(this,r,n)||this;return Object.setPrototypeOf(i,e.prototype),i.name="BrowserAuthError",i}return e.createPkceNotGeneratedError=function(r){return new e(P.pkceNotGenerated.code,P.pkceNotGenerated.desc+" Detail:"+r)},e.createCryptoNotAvailableError=function(r){return new e(P.cryptoDoesNotExist.code,P.cryptoDoesNotExist.desc+" Detail:"+r)},e.createHttpMethodNotImplementedError=function(r){return new e(P.httpMethodNotImplementedError.code,P.httpMethodNotImplementedError.desc+" Given Method: "+r)},e.createEmptyNavigationUriError=function(){return new e(P.emptyNavigateUriError.code,P.emptyNavigateUriError.desc)},e.createEmptyHashError=function(r){return new e(P.hashEmptyError.code,P.hashEmptyError.desc+" Given Url: "+r)},e.createHashDoesNotContainStateError=function(){return new e(P.hashDoesNotContainStateError.code,P.hashDoesNotContainStateError.desc)},e.createHashDoesNotContainKnownPropertiesError=function(){return new e(P.hashDoesNotContainKnownPropertiesError.code,P.hashDoesNotContainKnownPropertiesError.desc)},e.createUnableToParseStateError=function(){return new e(P.unableToParseStateError.code,P.unableToParseStateError.desc)},e.createStateInteractionTypeMismatchError=function(){return new e(P.stateInteractionTypeMismatchError.code,P.stateInteractionTypeMismatchError.desc)},e.createInteractionInProgressError=function(){return new e(P.interactionInProgress.code,P.interactionInProgress.desc)},e.createPopupWindowError=function(r){var n=P.popupWindowError.desc;return n=V.isEmpty(r)?n:n+" Details: "+r,new e(P.popupWindowError.code,n)},e.createEmptyWindowCreatedError=function(){return new e(P.emptyWindowError.code,P.emptyWindowError.desc)},e.createUserCancelledError=function(){return new e(P.userCancelledError.code,P.userCancelledError.desc)},e.createMonitorPopupTimeoutError=function(){return new e(P.monitorPopupTimeoutError.code,P.monitorPopupTimeoutError.desc)},e.createMonitorIframeTimeoutError=function(){return new e(P.monitorIframeTimeoutError.code,P.monitorIframeTimeoutError.desc)},e.createRedirectInIframeError=function(r){return new e(P.redirectInIframeError.code,P.redirectInIframeError.desc+" (window.parent !== window) => "+r)},e.createBlockReloadInHiddenIframeError=function(){return new e(P.blockTokenRequestsInHiddenIframeError.code,P.blockTokenRequestsInHiddenIframeError.desc)},e.createBlockAcquireTokenInPopupsError=function(){return new e(P.blockAcquireTokenInPopupsError.code,P.blockAcquireTokenInPopupsError.desc)},e.createIframeClosedPrematurelyError=function(){return new e(P.iframeClosedPrematurelyError.code,P.iframeClosedPrematurelyError.desc)},e.createSilentLogoutUnsupportedError=function(){return new e(P.silentLogoutUnsupportedError.code,P.silentLogoutUnsupportedError.desc)},e.createNoAccountError=function(){return new e(P.noAccountError.code,P.noAccountError.desc)},e.createSilentPromptValueError=function(r){return new e(P.silentPromptValueError.code,P.silentPromptValueError.desc+" Given value: "+r)},e.createUnableToParseTokenRequestCacheError=function(){return new e(P.unableToParseTokenRequestCacheError.code,P.unableToParseTokenRequestCacheError.desc)},e.createNoTokenRequestCacheError=function(){return new e(P.noTokenRequestCacheError.code,P.noTokenRequestCacheError.desc)},e.createAuthRequestNotSetError=function(){return new e(P.authRequestNotSet.code,P.authRequestNotSet.desc)},e.createNoCachedAuthorityError=function(){return new e(P.noCachedAuthorityError.code,P.noCachedAuthorityError.desc)},e.createInvalidCacheTypeError=function(){return new e(P.invalidCacheType.code,""+P.invalidCacheType.desc)},e.createNonBrowserEnvironmentError=function(){return new e(P.notInBrowserEnvironment.code,P.notInBrowserEnvironment.desc)},e.createDatabaseNotOpenError=function(){return new e(P.databaseNotOpen.code,P.databaseNotOpen.desc)},e.createNoNetworkConnectivityError=function(){return new e(P.noNetworkConnectivity.code,P.noNetworkConnectivity.desc)},e.createPostRequestFailedError=function(r,n){return new e(P.postRequestFailed.code,P.postRequestFailed.desc+" | Network client threw: "+r+" | Attempted to reach: "+n.split("?")[0])},e.createGetRequestFailedError=function(r,n){return new e(P.getRequestFailed.code,P.getRequestFailed.desc+" | Network client threw: "+r+" | Attempted to reach: "+n.split("?")[0])},e.createFailedToParseNetworkResponseError=function(r){return new e(P.failedToParseNetworkResponse.code,P.failedToParseNetworkResponse.desc+" | Attempted to reach: "+r.split("?")[0])},e.createUnableToLoadTokenError=function(r){return new e(P.unableToLoadTokenError.code,P.unableToLoadTokenError.desc+" | "+r)},e.createSigningKeyNotFoundInStorageError=function(r){return new e(P.signingKeyNotFoundInStorage.code,P.signingKeyNotFoundInStorage.desc+" | No match found for KeyId: "+r)},e.createAuthCodeRequiredError=function(){return new e(P.authCodeRequired.code,P.authCodeRequired.desc)},e.createAuthCodeOrNativeAccountIdRequiredError=function(){return new e(P.authCodeOrNativeAccountRequired.code,P.authCodeOrNativeAccountRequired.desc)},e.createDatabaseUnavailableError=function(){return new e(P.databaseUnavailable.code,P.databaseUnavailable.desc)},e.createUnableToAcquireTokenFromNativePlatformError=function(){return new e(P.unableToAcquireTokenFromNativePlatform.code,P.unableToAcquireTokenFromNativePlatform.desc)},e.createNativeHandshakeTimeoutError=function(){return new e(P.nativeHandshakeTimeout.code,P.nativeHandshakeTimeout.desc)},e.createNativeExtensionNotInstalledError=function(){return new e(P.nativeExtensionNotInstalled.code,P.nativeExtensionNotInstalled.desc)},e.createNativeConnectionNotEstablishedError=function(){return new e(P.nativeConnectionNotEstablished.code,P.nativeConnectionNotEstablished.desc)},e.createNativeBrokerCalledBeforeInitialize=function(){return new e(P.nativeBrokerCalledBeforeInitialize.code,P.nativeBrokerCalledBeforeInitialize.desc)},e.createNativePromptParameterNotSupportedError=function(){return new e(P.nativePromptNotSupported.code,P.nativePromptNotSupported.desc)},e}(W);var rn={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"},vs={CHANNEL_ID:"53ee284d-920a-4b59-9d30-a60315b26836",PREFERRED_EXTENSION_ID:"ppnbnpeolgkicgegkbkbjmhlideopiji",MATS_TELEMETRY:"MATS"},Gn;(function(t){t.HandshakeRequest="Handshake",t.HandshakeResponse="HandshakeResponse",t.GetToken="GetToken",t.Response="Response"})(Gn||(Gn={}));var Ut;(function(t){t.LocalStorage="localStorage",t.SessionStorage="sessionStorage",t.MemoryStorage="memoryStorage"})(Ut||(Ut={}));var _n;(function(t){t.GET="GET",t.POST="POST"})(_n||(_n={}));var ye;(function(t){t.AUTHORITY="authority",t.ACQUIRE_TOKEN_ACCOUNT="acquireToken.account",t.SESSION_STATE="session.state",t.REQUEST_STATE="request.state",t.NONCE_IDTOKEN="nonce.id_token",t.ORIGIN_URI="request.origin",t.RENEW_STATUS="token.renew.status",t.URL_HASH="urlHash",t.REQUEST_PARAMS="request.params",t.SCOPES="scopes",t.INTERACTION_STATUS_KEY="interaction.status",t.CCS_CREDENTIAL="ccs.credential",t.CORRELATION_ID="request.correlationId",t.NATIVE_REQUEST="request.native",t.REDIRECT_CONTEXT="request.redirect.context"})(ye||(ye={}));var ua;(function(t){t.WRAPPER_SKU="wrapper.sku",t.WRAPPER_VER="wrapper.version"})(ua||(ua={}));var He;(function(t){t[t.acquireTokenRedirect=861]="acquireTokenRedirect",t[t.acquireTokenPopup=862]="acquireTokenPopup",t[t.ssoSilent=863]="ssoSilent",t[t.acquireTokenSilent_authCode=864]="acquireTokenSilent_authCode",t[t.handleRedirectPromise=865]="handleRedirectPromise",t[t.acquireTokenByCode=866]="acquireTokenByCode",t[t.acquireTokenSilent_silentFlow=61]="acquireTokenSilent_silentFlow",t[t.logout=961]="logout",t[t.logoutPopup=962]="logoutPopup"})(He||(He={}));var G;(function(t){t.Redirect="redirect",t.Popup="popup",t.Silent="silent",t.None="none"})(G||(G={}));var dm;(function(t){t.Startup="startup",t.Login="login",t.Logout="logout",t.AcquireToken="acquireToken",t.SsoSilent="ssoSilent",t.HandleRedirect="handleRedirect",t.None="none"})(dm||(dm={}));var hm={scopes:Tc},Ra="jwk",um;(function(t){t.React="@azure/msal-react",t.Angular="@azure/msal-angular"})(um||(um={}));var h2="msal.db",A_=1,T_=h2+".keys",fr;(function(t){t[t.Default=0]="Default",t[t.AccessToken=1]="AccessToken",t[t.AccessTokenAndRefreshToken=2]="AccessTokenAndRefreshToken",t[t.RefreshToken=3]="RefreshToken",t[t.RefreshTokenAndNetwork=4]="RefreshTokenAndNetwork",t[t.Skip=5]="Skip"})(fr||(fr={}));var hr={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."}},Yd=function(t){It(e,t);function e(r,n){var i=t.call(this,r,n)||this;return i.name="BrowserConfigurationAuthError",Object.setPrototypeOf(i,e.prototype),i}return e.createRedirectUriEmptyError=function(){return new e(hr.redirectUriNotSet.code,hr.redirectUriNotSet.desc)},e.createPostLogoutRedirectUriEmptyError=function(){return new e(hr.postLogoutUriNotSet.code,hr.postLogoutUriNotSet.desc)},e.createStorageNotSupportedError=function(r){return new e(hr.storageNotSupportedError.code,hr.storageNotSupportedError.desc+" Given Location: "+r)},e.createRedirectCallbacksNotSetError=function(){return new e(hr.noRedirectCallbacksSet.code,hr.noRedirectCallbacksSet.desc)},e.createStubPcaInstanceCalledError=function(){return new e(hr.stubPcaInstanceCalled.code,hr.stubPcaInstanceCalled.desc)},e.createInMemoryRedirectUnavailableError=function(){return new e(hr.inMemRedirectUnavailable.code,hr.inMemRedirectUnavailable.desc)},e.createEntropyNotProvided=function(){return new e(hr.entropyNotProvided.code,hr.entropyNotProvided.desc)},e}(W);var fm=function(){function t(e){this.validateWindowStorage(e),this.windowStorage=window[e]}return t.prototype.validateWindowStorage=function(e){if(e!==Ut.LocalStorage&&e!==Ut.SessionStorage)throw Yd.createStorageNotSupportedError(e);var r=!!window[e];if(!r)throw Yd.createStorageNotSupportedError(e)},t.prototype.getItem=function(e){return this.windowStorage.getItem(e)},t.prototype.setItem=function(e,r){this.windowStorage.setItem(e,r)},t.prototype.removeItem=function(e){this.windowStorage.removeItem(e)},t.prototype.getKeys=function(){return Object.keys(this.windowStorage)},t.prototype.containsKey=function(e){return this.windowStorage.hasOwnProperty(e)},t}();var u2=function(){function t(){this.cache=new Map}return t.prototype.getItem=function(e){return this.cache.get(e)||null},t.prototype.setItem=function(e,r){this.cache.set(e,r)},t.prototype.removeItem=function(e){this.cache.delete(e)},t.prototype.getKeys=function(){var e=[];return this.cache.forEach(function(r,n){e.push(n)}),e},t.prototype.containsKey=function(e){return this.cache.has(e)},t.prototype.clear=function(){this.cache.clear()},t}();var o3=function(){function t(){}return t.extractBrowserRequestState=function(e,r){if(V.isEmpty(r))return null;try{var n=Yn.parseRequestState(e,r);return n.libraryState.meta}catch(i){throw j.createInvalidStateError(r,i)}},t.parseServerResponseFromHash=function(e){if(!e)return{};var r=new be(e);return be.getDeserializedHash(r.getHash())},t}();var f2=function(t){It(e,t);function e(r,n,i,o){var a=t.call(this,r,i)||this;return a.COOKIE_LIFE_MULTIPLIER=24*60*60*1e3,a.cacheConfig=n,a.logger=o,a.internalStorage=new u2,a.browserStorage=a.setupBrowserStorage(a.cacheConfig.cacheLocation),a.temporaryCacheStorage=a.setupTemporaryCacheStorage(a.cacheConfig.cacheLocation),a.migrateCacheEntries(),a}return e.prototype.setupBrowserStorage=function(r){switch(r){case Ut.LocalStorage:case Ut.SessionStorage:try{return new fm(r)}catch(n){this.logger.verbose(n);break}}return this.cacheConfig.cacheLocation=Ut.MemoryStorage,new u2},e.prototype.setupTemporaryCacheStorage=function(r){switch(r){case Ut.LocalStorage:case Ut.SessionStorage:try{return new fm(Ut.SessionStorage)}catch(n){return this.logger.verbose(n),this.internalStorage}case Ut.MemoryStorage:default:return this.internalStorage}},e.prototype.migrateCacheEntries=function(){var r=this,n=_.CACHE_PREFIX+"."+dt.ID_TOKEN,i=_.CACHE_PREFIX+"."+dt.CLIENT_INFO,o=_.CACHE_PREFIX+"."+dt.ERROR,a=_.CACHE_PREFIX+"."+dt.ERROR_DESC,s=this.browserStorage.getItem(n),c=this.browserStorage.getItem(i),l=this.browserStorage.getItem(o),d=this.browserStorage.getItem(a),h=[s,c,l,d],u=[dt.ID_TOKEN,dt.CLIENT_INFO,dt.ERROR,dt.ERROR_DESC];u.forEach(function(f,v){return r.migrateCacheEntry(f,h[v])})},e.prototype.migrateCacheEntry=function(r,n){n&&this.setTemporaryCache(r,n,!0)},e.prototype.validateAndParseJson=function(r){try{var n=JSON.parse(r);return n&&typeof n=="object"?n:null}catch{return null}},e.prototype.getItem=function(r){return this.browserStorage.getItem(r)},e.prototype.setItem=function(r,n){this.browserStorage.setItem(r,n)},e.prototype.getAccount=function(r){var n=this.getItem(r);if(!n)return null;var i=this.validateAndParseJson(n);return!i||!kt.isAccountEntity(i)?null:Jr.toObject(new kt,i)},e.prototype.setAccount=function(r){this.logger.trace("BrowserCacheManager.setAccount called");var n=r.generateAccountKey();this.setItem(n,JSON.stringify(r))},e.prototype.getIdTokenCredential=function(r){var n=this.getItem(r);if(!n)return this.logger.trace("BrowserCacheManager.getIdTokenCredential: called, no cache hit"),null;var i=this.validateAndParseJson(n);return!i||!uc.isIdTokenEntity(i)?(this.logger.trace("BrowserCacheManager.getIdTokenCredential: called, no cache hit"),null):(this.logger.trace("BrowserCacheManager.getIdTokenCredential: cache hit"),Jr.toObject(new uc,i))},e.prototype.setIdTokenCredential=function(r){this.logger.trace("BrowserCacheManager.setIdTokenCredential called");var n=r.generateCredentialKey();this.setItem(n,JSON.stringify(r))},e.prototype.getAccessTokenCredential=function(r){var n=this.getItem(r);if(!n)return this.logger.trace("BrowserCacheManager.getAccessTokenCredential: called, no cache hit"),null;var i=this.validateAndParseJson(n);return!i||!fc.isAccessTokenEntity(i)?(this.logger.trace("BrowserCacheManager.getAccessTokenCredential: called, no cache hit"),null):(this.logger.trace("BrowserCacheManager.getAccessTokenCredential: cache hit"),Jr.toObject(new fc,i))},e.prototype.setAccessTokenCredential=function(r){this.logger.trace("BrowserCacheManager.setAccessTokenCredential called");var n=r.generateCredentialKey();this.setItem(n,JSON.stringify(r))},e.prototype.getRefreshTokenCredential=function(r){var n=this.getItem(r);if(!n)return this.logger.trace("BrowserCacheManager.getRefreshTokenCredential: called, no cache hit"),null;var i=this.validateAndParseJson(n);return!i||!jd.isRefreshTokenEntity(i)?(this.logger.trace("BrowserCacheManager.getRefreshTokenCredential: called, no cache hit"),null):(this.logger.trace("BrowserCacheManager.getRefreshTokenCredential: cache hit"),Jr.toObject(new jd,i))},e.prototype.setRefreshTokenCredential=function(r){this.logger.trace("BrowserCacheManager.setRefreshTokenCredential called");var n=r.generateCredentialKey();this.setItem(n,JSON.stringify(r))},e.prototype.getAppMetadata=function(r){var n=this.getItem(r);if(!n)return this.logger.trace("BrowserCacheManager.getAppMetadata: called, no cache hit"),null;var i=this.validateAndParseJson(n);return!i||!l2.isAppMetadataEntity(r,i)?(this.logger.trace("BrowserCacheManager.getAppMetadata: called, no cache hit"),null):(this.logger.trace("BrowserCacheManager.getAppMetadata: cache hit"),Jr.toObject(new l2,i))},e.prototype.setAppMetadata=function(r){this.logger.trace("BrowserCacheManager.setAppMetadata called");var n=r.generateAppMetadataKey();this.setItem(n,JSON.stringify(r))},e.prototype.getServerTelemetry=function(r){var n=this.getItem(r);if(!n)return this.logger.trace("BrowserCacheManager.getServerTelemetry: called, no cache hit"),null;var i=this.validateAndParseJson(n);return!i||!Wd.isServerTelemetryEntity(r,i)?(this.logger.trace("BrowserCacheManager.getServerTelemetry: called, no cache hit"),null):(this.logger.trace("BrowserCacheManager.getServerTelemetry: cache hit"),Jr.toObject(new Wd,i))},e.prototype.setServerTelemetry=function(r,n){this.logger.trace("BrowserCacheManager.setServerTelemetry called"),this.setItem(r,JSON.stringify(n))},e.prototype.getAuthorityMetadata=function(r){var n=this.internalStorage.getItem(r);if(!n)return this.logger.trace("BrowserCacheManager.getAuthorityMetadata: called, no cache hit"),null;var i=this.validateAndParseJson(n);return i&&d2.isAuthorityMetadataEntity(r,i)?(this.logger.trace("BrowserCacheManager.getAuthorityMetadata: cache hit"),Jr.toObject(new d2,i)):null},e.prototype.getAuthorityMetadataKeys=function(){var r=this,n=this.internalStorage.getKeys();return n.filter(function(i){return r.isAuthorityMetadata(i)})},e.prototype.setWrapperMetadata=function(r,n){this.internalStorage.setItem(ua.WRAPPER_SKU,r),this.internalStorage.setItem(ua.WRAPPER_VER,n)},e.prototype.getWrapperMetadata=function(){var r=this.internalStorage.getItem(ua.WRAPPER_SKU)||_.EMPTY_STRING,n=this.internalStorage.getItem(ua.WRAPPER_VER)||_.EMPTY_STRING;return[r,n]},e.prototype.setAuthorityMetadata=function(r,n){this.logger.trace("BrowserCacheManager.setAuthorityMetadata called"),this.internalStorage.setItem(r,JSON.stringify(n))},e.prototype.getActiveAccount=function(){var r=this.generateCacheKey(dt.ACTIVE_ACCOUNT_FILTERS),n=this.getItem(r);if(!n){this.logger.trace("No active account filters cache schema found, looking for legacy schema");var i=this.generateCacheKey(dt.ACTIVE_ACCOUNT),o=this.getItem(i);if(!o)return this.logger.trace("No active account found"),null;var a=this.getAccountInfoByFilter({localAccountId:o})[0]||null;return a?(this.logger.trace("Legacy active account cache schema found"),this.logger.trace("Adding active account filters cache schema"),this.setActiveAccount(a),a):null}var s=this.validateAndParseJson(n);return s?(this.logger.trace("Active account filters schema found"),this.getAccountInfoByFilter({homeAccountId:s.homeAccountId,localAccountId:s.localAccountId})[0]||null):(this.logger.trace("No active account found"),null)},e.prototype.setActiveAccount=function(r){var n=this.generateCacheKey(dt.ACTIVE_ACCOUNT_FILTERS),i=this.generateCacheKey(dt.ACTIVE_ACCOUNT);if(r){this.logger.verbose("setActiveAccount: Active account set");var o={homeAccountId:r.homeAccountId,localAccountId:r.localAccountId};this.browserStorage.setItem(n,JSON.stringify(o)),this.browserStorage.setItem(i,r.localAccountId)}else this.logger.verbose("setActiveAccount: No account passed, active account not set"),this.browserStorage.removeItem(n),this.browserStorage.removeItem(i)},e.prototype.getAccountInfoByFilter=function(r){var n=this.getAllAccounts();return n.filter(function(i){return!(r.username&&r.username.toLowerCase()!==i.username.toLowerCase()||r.homeAccountId&&r.homeAccountId!==i.homeAccountId||r.localAccountId&&r.localAccountId!==i.localAccountId||r.tenantId&&r.tenantId!==i.tenantId||r.environment&&r.environment!==i.environment)})},e.prototype.getAccountInfoByHints=function(r,n){var i=this.getAllAccounts().filter(function(o){if(n){var a=o.idTokenClaims&&o.idTokenClaims.sid;return n===a}return r?r===o.username:!1});if(i.length===1)return i[0];if(i.length>1)throw j.createMultipleMatchingAccountsInCacheError();return null},e.prototype.getThrottlingCache=function(r){var n=this.getItem(r);if(!n)return this.logger.trace("BrowserCacheManager.getThrottlingCache: called, no cache hit"),null;var i=this.validateAndParseJson(n);return!i||!cm.isThrottlingEntity(r,i)?(this.logger.trace("BrowserCacheManager.getThrottlingCache: called, no cache hit"),null):(this.logger.trace("BrowserCacheManager.getThrottlingCache: cache hit"),Jr.toObject(new cm,i))},e.prototype.setThrottlingCache=function(r,n){this.logger.trace("BrowserCacheManager.setThrottlingCache called"),this.setItem(r,JSON.stringify(n))},e.prototype.getTemporaryCache=function(r,n){var i=n?this.generateCacheKey(r):r;if(this.cacheConfig.storeAuthStateInCookie){var o=this.getItemCookie(i);if(o)return this.logger.trace("BrowserCacheManager.getTemporaryCache: storeAuthStateInCookies set to true, retrieving from cookies"),o}var a=this.temporaryCacheStorage.getItem(i);if(!a){if(this.cacheConfig.cacheLocation===Ut.LocalStorage){var s=this.browserStorage.getItem(i);if(s)return this.logger.trace("BrowserCacheManager.getTemporaryCache: Temporary cache item found in local storage"),s}return this.logger.trace("BrowserCacheManager.getTemporaryCache: No cache item found in local storage"),null}return this.logger.trace("BrowserCacheManager.getTemporaryCache: Temporary cache item returned"),a},e.prototype.setTemporaryCache=function(r,n,i){var o=i?this.generateCacheKey(r):r;this.temporaryCacheStorage.setItem(o,n),this.cacheConfig.storeAuthStateInCookie&&(this.logger.trace("BrowserCacheManager.setTemporaryCache: storeAuthStateInCookie set to true, setting item cookie"),this.setItemCookie(o,n))},e.prototype.removeItem=function(r){return this.browserStorage.removeItem(r),this.temporaryCacheStorage.removeItem(r),this.cacheConfig.storeAuthStateInCookie&&(this.logger.trace("BrowserCacheManager.removeItem: storeAuthStateInCookie is true, clearing item cookie"),this.clearItemCookie(r)),!0},e.prototype.containsKey=function(r){return this.browserStorage.containsKey(r)||this.temporaryCacheStorage.containsKey(r)},e.prototype.getKeys=function(){return e0(this.browserStorage.getKeys(),this.temporaryCacheStorage.getKeys())},e.prototype.clear=function(){return S(this,void 0,void 0,function(){var r=this;return k(this,function(n){switch(n.label){case 0:return[4,this.removeAllAccounts()];case 1:return n.sent(),this.removeAppMetadata(),this.getKeys().forEach(function(i){(r.browserStorage.containsKey(i)||r.temporaryCacheStorage.containsKey(i))&&(i.indexOf(_.CACHE_PREFIX)!==-1||i.indexOf(r.clientId)!==-1)&&r.removeItem(i)}),this.internalStorage.clear(),[2]}})})},e.prototype.setItemCookie=function(r,n,i){var o=encodeURIComponent(r)+"="+encodeURIComponent(n)+";path=/;SameSite=Lax;";if(i){var a=this.getCookieExpirationTime(i);o+="expires="+a+";"}this.cacheConfig.secureCookies&&(o+="Secure;"),document.cookie=o},e.prototype.getItemCookie=function(r){for(var n=encodeURIComponent(r)+"=",i=document.cookie.split(";"),o=0;o<i.length;o++){for(var a=i[o];a.charAt(0)===" ";)a=a.substring(1);if(a.indexOf(n)===0)return decodeURIComponent(a.substring(n.length,a.length))}return _.EMPTY_STRING},e.prototype.clearMsalCookies=function(){var r=this,n=_.CACHE_PREFIX+"."+this.clientId,i=document.cookie.split(";");i.forEach(function(o){for(;o.charAt(0)===" ";)o=o.substring(1);if(o.indexOf(n)===0){var a=o.split("=")[0];r.clearItemCookie(a)}})},e.prototype.clearItemCookie=function(r){this.setItemCookie(r,_.EMPTY_STRING,-1)},e.prototype.getCookieExpirationTime=function(r){var n=new Date,i=new Date(n.getTime()+r*this.COOKIE_LIFE_MULTIPLIER);return i.toUTCString()},e.prototype.getCache=function(){return this.browserStorage},e.prototype.setCache=function(){},e.prototype.generateCacheKey=function(r){var n=this.validateAndParseJson(r);return n?JSON.stringify(r):V.startsWith(r,_.CACHE_PREFIX)||V.startsWith(r,dt.ADAL_ID_TOKEN)?r:_.CACHE_PREFIX+"."+this.clientId+"."+r},e.prototype.generateAuthorityKey=function(r){var n=Yn.parseRequestState(this.cryptoImpl,r).libraryState.id;return this.generateCacheKey(ye.AUTHORITY+"."+n)},e.prototype.generateNonceKey=function(r){var n=Yn.parseRequestState(this.cryptoImpl,r).libraryState.id;return this.generateCacheKey(ye.NONCE_IDTOKEN+"."+n)},e.prototype.generateStateKey=function(r){var n=Yn.parseRequestState(this.cryptoImpl,r).libraryState.id;return this.generateCacheKey(ye.REQUEST_STATE+"."+n)},e.prototype.getCachedAuthority=function(r){var n=this.generateStateKey(r),i=this.getTemporaryCache(n);if(!i)return null;var o=this.generateAuthorityKey(i);return this.getTemporaryCache(o)},e.prototype.updateCacheEntries=function(r,n,i,o,a){this.logger.trace("BrowserCacheManager.updateCacheEntries called");var s=this.generateStateKey(r);this.setTemporaryCache(s,r,!1);var c=this.generateNonceKey(r);this.setTemporaryCache(c,n,!1);var l=this.generateAuthorityKey(r);if(this.setTemporaryCache(l,i,!1),a){var d={credential:a.homeAccountId,type:kr.HOME_ACCOUNT_ID};this.setTemporaryCache(ye.CCS_CREDENTIAL,JSON.stringify(d),!0)}else if(!V.isEmpty(o)){var d={credential:o,type:kr.UPN};this.setTemporaryCache(ye.CCS_CREDENTIAL,JSON.stringify(d),!0)}},e.prototype.resetRequestCache=function(r){var n=this;this.logger.trace("BrowserCacheManager.resetRequestCache called"),V.isEmpty(r)||this.getKeys().forEach(function(i){i.indexOf(r)!==-1&&n.removeItem(i)}),r&&(this.removeItem(this.generateStateKey(r)),this.removeItem(this.generateNonceKey(r)),this.removeItem(this.generateAuthorityKey(r))),this.removeItem(this.generateCacheKey(ye.REQUEST_PARAMS)),this.removeItem(this.generateCacheKey(ye.ORIGIN_URI)),this.removeItem(this.generateCacheKey(ye.URL_HASH)),this.removeItem(this.generateCacheKey(ye.CORRELATION_ID)),this.removeItem(this.generateCacheKey(ye.CCS_CREDENTIAL)),this.removeItem(this.generateCacheKey(ye.NATIVE_REQUEST)),this.setInteractionInProgress(!1)},e.prototype.cleanRequestByState=function(r){if(this.logger.trace("BrowserCacheManager.cleanRequestByState called"),r){var n=this.generateStateKey(r),i=this.temporaryCacheStorage.getItem(n);this.logger.infoPii("BrowserCacheManager.cleanRequestByState: Removing temporary cache items for state: "+i),this.resetRequestCache(i||_.EMPTY_STRING)}this.clearMsalCookies()},e.prototype.cleanRequestByInteractionType=function(r){var n=this;this.logger.trace("BrowserCacheManager.cleanRequestByInteractionType called"),this.getKeys().forEach(function(i){if(i.indexOf(ye.REQUEST_STATE)!==-1){var o=n.temporaryCacheStorage.getItem(i);if(!!o){var a=o3.extractBrowserRequestState(n.cryptoImpl,o);a&&a.interactionType===r&&(n.logger.infoPii("BrowserCacheManager.cleanRequestByInteractionType: Removing temporary cache items for state: "+o),n.resetRequestCache(o))}}}),this.clearMsalCookies(),this.setInteractionInProgress(!1)},e.prototype.cacheCodeRequest=function(r,n){this.logger.trace("BrowserCacheManager.cacheCodeRequest called");var i=n.base64Encode(JSON.stringify(r));this.setTemporaryCache(ye.REQUEST_PARAMS,i,!0)},e.prototype.getCachedRequest=function(r,n){this.logger.trace("BrowserCacheManager.getCachedRequest called");var i=this.getTemporaryCache(ye.REQUEST_PARAMS,!0);if(!i)throw D.createNoTokenRequestCacheError();var o=this.validateAndParseJson(n.base64Decode(i));if(!o)throw D.createUnableToParseTokenRequestCacheError();if(this.removeItem(this.generateCacheKey(ye.REQUEST_PARAMS)),V.isEmpty(o.authority)){var a=this.generateAuthorityKey(r),s=this.getTemporaryCache(a);if(!s)throw D.createNoCachedAuthorityError();o.authority=s}return o},e.prototype.getCachedNativeRequest=function(){this.logger.trace("BrowserCacheManager.getCachedNativeRequest called");var r=this.getTemporaryCache(ye.NATIVE_REQUEST,!0);if(!r)return this.logger.trace("BrowserCacheManager.getCachedNativeRequest: No cached native request found"),null;var n=this.validateAndParseJson(r);return n||(this.logger.error("BrowserCacheManager.getCachedNativeRequest: Unable to parse native request"),null)},e.prototype.isInteractionInProgress=function(r){var n=this.getInteractionInProgress();return r?n===this.clientId:!!n},e.prototype.getInteractionInProgress=function(){var r=_.CACHE_PREFIX+"."+ye.INTERACTION_STATUS_KEY;return this.getTemporaryCache(r,!1)},e.prototype.setInteractionInProgress=function(r){var n=_.CACHE_PREFIX+"."+ye.INTERACTION_STATUS_KEY;if(r){if(this.getInteractionInProgress())throw D.createInteractionInProgressError();this.setTemporaryCache(n,this.clientId,!1)}else!r&&this.getInteractionInProgress()===this.clientId&&this.removeItem(n)},e.prototype.getLegacyLoginHint=function(){var r=this.getTemporaryCache(dt.ADAL_ID_TOKEN);r&&(this.browserStorage.removeItem(dt.ADAL_ID_TOKEN),this.logger.verbose("Cached ADAL id token retrieved."));var n=this.getTemporaryCache(dt.ID_TOKEN,!0);n&&(this.removeItem(this.generateCacheKey(dt.ID_TOKEN)),this.logger.verbose("Cached MSAL.js v1 id token retrieved"));var i=n||r;if(i){var o=new Tn(i,this.cryptoImpl);if(o.claims&&o.claims.preferred_username)return this.logger.verbose("No SSO params used and ADAL/MSAL v1 token retrieved, setting ADAL/MSAL v1 preferred_username as loginHint"),o.claims.preferred_username;if(o.claims&&o.claims.upn)return this.logger.verbose("No SSO params used and ADAL/MSAL v1 token retrieved, setting ADAL/MSAL v1 upn as loginHint"),o.claims.upn;this.logger.verbose("No SSO params used and ADAL/MSAL v1 token retrieved, however, no account hint claim found. Enable preferred_username or upn id token claim to get SSO.")}return null},e.prototype.updateCredentialCacheKey=function(r,n){var i=n.generateCredentialKey();if(r!==i){var o=this.getItem(r);if(o)return this.removeItem(r),this.setItem(i,o),this.logger.verbose("Updated an outdated "+n.credentialType+" cache key"),i;this.logger.error("Attempted to update an outdated "+n.credentialType+" cache key but no item matching the outdated key was found in storage")}return r},e.prototype.getRedirectRequestContext=function(){return this.getTemporaryCache(ye.REDIRECT_CONTEXT,!0)},e.prototype.setRedirectRequestContext=function(r){this.setTemporaryCache(ye.REDIRECT_CONTEXT,r,!0)},e}(Jr),I_=function(t,e){var r={cacheLocation:Ut.MemoryStorage,storeAuthStateInCookie:!1,secureCookies:!1};return new f2(t,r,Fd,e)};var wh="@azure/msal-browser",Us="2.32.1";var M_=function(){function t(){}return t.prototype.sendGetRequestAsync=function(e,r){return S(this,void 0,void 0,function(){var n,i,o;return k(this,function(a){switch(a.label){case 0:return a.trys.push([0,2,,3]),[4,fetch(e,{method:_n.GET,headers:this.getFetchHeaders(r)})];case 1:return n=a.sent(),[3,3];case 2:throw i=a.sent(),window.navigator.onLine?D.createGetRequestFailedError(i,e):D.createNoNetworkConnectivityError();case 3:return a.trys.push([3,5,,6]),o={headers:this.getHeaderDict(n.headers)},[4,n.json()];case 4:return[2,(o.body=a.sent(),o.status=n.status,o)];case 5:throw a.sent(),D.createFailedToParseNetworkResponseError(e);case 6:return[2]}})})},t.prototype.sendPostRequestAsync=function(e,r){return S(this,void 0,void 0,function(){var n,i,o,a;return k(this,function(s){switch(s.label){case 0:n=r&&r.body||_.EMPTY_STRING,s.label=1;case 1:return s.trys.push([1,3,,4]),[4,fetch(e,{method:_n.POST,headers:this.getFetchHeaders(r),body:n})];case 2:return i=s.sent(),[3,4];case 3:throw o=s.sent(),window.navigator.onLine?D.createPostRequestFailedError(o,e):D.createNoNetworkConnectivityError();case 4:return s.trys.push([4,6,,7]),a={headers:this.getHeaderDict(i.headers)},[4,i.json()];case 5:return[2,(a.body=s.sent(),a.status=i.status,a)];case 6:throw s.sent(),D.createFailedToParseNetworkResponseError(e);case 7:return[2]}})})},t.prototype.getFetchHeaders=function(e){var r=new Headers;if(!(e&&e.headers))return r;var n=e.headers;return Object.keys(n).forEach(function(i){r.append(i,n[i])}),r},t.prototype.getHeaderDict=function(e){var r={};return e.forEach(function(n,i){r[i]=n}),r},t}();var P_=function(){function t(){}return t.prototype.sendGetRequestAsync=function(e,r){return S(this,void 0,void 0,function(){return k(this,function(n){return[2,this.sendRequestAsync(e,_n.GET,r)]})})},t.prototype.sendPostRequestAsync=function(e,r){return S(this,void 0,void 0,function(){return k(this,function(n){return[2,this.sendRequestAsync(e,_n.POST,r)]})})},t.prototype.sendRequestAsync=function(e,r,n){var i=this;return new Promise(function(o,a){var s=new XMLHttpRequest;if(s.open(r,e,!0),i.setXhrHeaders(s,n),s.onload=function(){(s.status<200||s.status>=300)&&(r===_n.POST?a(D.createPostRequestFailedError("Failed with status "+s.status,e)):a(D.createGetRequestFailedError("Failed with status "+s.status,e)));try{var c=JSON.parse(s.responseText),l={headers:i.getHeaderDict(s),body:c,status:s.status};o(l)}catch{a(D.createFailedToParseNetworkResponseError(e))}},s.onerror=function(){window.navigator.onLine?r===_n.POST?a(D.createPostRequestFailedError("Failed with status "+s.status,e)):a(D.createGetRequestFailedError("Failed with status "+s.status,e)):a(D.createNoNetworkConnectivityError())},r===_n.POST&&n&&n.body)s.send(n.body);else if(r===_n.GET)s.send();else throw D.createHttpMethodNotImplementedError(r)})},t.prototype.setXhrHeaders=function(e,r){if(r&&r.headers){var n=r.headers;Object.keys(n).forEach(function(i){e.setRequestHeader(i,n[i])})}},t.prototype.getHeaderDict=function(e){var r=e.getAllResponseHeaders(),n=r.trim().split(/[\r\n]+/),i={};return n.forEach(function(o){var a=o.split(": "),s=a.shift(),c=a.join(": ");s&&c&&(i[s]=c)}),i},t}();var Je=function(){function t(){}return t.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)},t.replaceHash=function(e){var r=e.split("#");r.shift(),window.location.hash=r.length>0?r.join("#"):_.EMPTY_STRING},t.isInIframe=function(){return window.parent!==window},t.isInPopup=function(){return typeof window<"u"&&!!window.opener&&window.opener!==window&&typeof window.name=="string"&&window.name.indexOf(rn.POPUP_NAME_PREFIX+".")===0},t.getCurrentUri=function(){return window.location.href.split("?")[0].split("#")[0]},t.getHomepage=function(){var e=new be(window.location.href),r=e.getUrlComponents();return r.Protocol+"//"+r.HostNameAndPort+"/"},t.getBrowserNetworkClient=function(){return window.fetch&&window.Headers?new M_:new P_},t.blockReloadInHiddenIframes=function(){var e=be.hashContainsKnownProperties(window.location.hash);if(e&&t.isInIframe())throw D.createBlockReloadInHiddenIframeError()},t.blockRedirectInIframe=function(e,r){var n=t.isInIframe();if(e===G.Redirect&&n&&!r)throw D.createRedirectInIframeError(n)},t.blockAcquireTokenInPopups=function(){if(t.isInPopup())throw D.createBlockAcquireTokenInPopupsError()},t.blockNonBrowserEnvironment=function(e){if(!e)throw D.createNonBrowserEnvironmentError()},t.blockNativeBrokerCalledBeforeInitialized=function(e,r){if(e&&!r)throw D.createNativeBrokerCalledBeforeInitialize()},t.detectIEOrEdge=function(){var e=window.navigator.userAgent,r=e.indexOf("MSIE "),n=e.indexOf("Trident/"),i=e.indexOf("Edge/"),o=r>0||n>0,a=i>0;return o||a},t}();var a3=function(){function t(e,r,n,i,o,a,s,c,l){this.config=e,this.browserStorage=r,this.browserCrypto=n,this.networkClient=this.config.system.networkClient,this.eventHandler=o,this.navigationClient=a,this.nativeMessageHandler=c,this.correlationId=l||this.browserCrypto.createNewGuid(),this.logger=i.clone(rn.MSAL_SKU,Us,this.correlationId),this.performanceClient=s}return t.prototype.clearCacheOnLogout=function(e){return S(this,void 0,void 0,function(){return k(this,function(r){switch(r.label){case 0:if(!e)return[3,5];kt.accountInfoIsEqual(e,this.browserStorage.getActiveAccount(),!1)&&(this.logger.verbose("Setting active account to null"),this.browserStorage.setActiveAccount(null)),r.label=1;case 1:return r.trys.push([1,3,,4]),[4,this.browserStorage.removeAccount(kt.generateAccountCacheKey(e))];case 2:return r.sent(),this.logger.verbose("Cleared cache items belonging to the account provided in the logout request."),[3,4];case 3:return r.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 r.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 r.sent(),[4,this.browserCrypto.clearKeystore()];case 7:return r.sent(),[3,9];case 8:return r.sent(),this.logger.error("Attempted to clear all MSAL cache items and failed. Local cache unchanged."),[3,9];case 9:return[2]}})})},t.prototype.initializeBaseRequest=function(e){return S(this,void 0,void 0,function(){var r,n,i,o;return k(this,function(a){switch(a.label){case 0:if(this.logger.verbose("Initializing BaseAuthRequest"),r=e.authority||this.config.auth.authority,n=e0(e&&e.scopes||[]),i=K(K({},e),{correlationId:this.correlationId,authority:r,scopes:n}),!i.authenticationScheme)i.authenticationScheme=Se.BEARER,this.logger.verbose(`Authentication Scheme wasn't explicitly set in request, defaulting to "Bearer" request`);else{if(i.authenticationScheme===Se.SSH){if(!e.sshJwk)throw Fe.createMissingSshJwkError();if(!e.sshKid)throw Fe.createMissingSshKidError()}this.logger.verbose('Authentication Scheme set to "'+i.authenticationScheme+'" as configured in Auth request')}return e.claims&&!V.isEmpty(e.claims)?(o=i,[4,this.browserCrypto.hashString(e.claims)]):[3,2];case 1:o.requestedClaimsHash=a.sent(),a.label=2;case 2:return[2,i]}})})},t.prototype.getRedirectUri=function(e){this.logger.verbose("getRedirectUri called");var r=e||this.config.auth.redirectUri||Je.getCurrentUri();return be.getAbsoluteUrl(r,Je.getCurrentUri())},t.prototype.initializeServerTelemetryManager=function(e,r){this.logger.verbose("initializeServerTelemetryManager called");var n={clientId:this.config.auth.clientId,correlationId:this.correlationId,apiId:e,forceRefresh:r||!1,wrapperSKU:this.browserStorage.getWrapperMetadata()[0],wrapperVer:this.browserStorage.getWrapperMetadata()[1]};return new z_(n,this.browserStorage)},t.prototype.getDiscoveredAuthority=function(e){return S(this,void 0,void 0,function(){var r;return k(this,function(n){switch(n.label){case 0:return this.logger.verbose("getDiscoveredAuthority called"),r={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,Kd.createDiscoveredInstance(e,this.config.system.networkClient,this.browserStorage,r,this.logger)]):[3,2];case 1:return[2,n.sent()];case 2:return this.logger.verbose("Creating discovered authority with configured authority"),[4,Kd.createDiscoveredInstance(this.config.auth.authority,this.config.system.networkClient,this.browserStorage,r,this.logger)];case 3:return[2,n.sent()]}})})},t}();var $a=function(t){It(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.initializeAuthorizationCodeRequest=function(r){return S(this,void 0,void 0,function(){var n,i;return k(this,function(o){switch(o.label){case 0:return this.logger.verbose("initializeAuthorizationRequest called",r.correlationId),[4,this.browserCrypto.generatePkceCodes()];case 1:return n=o.sent(),i=K(K({},r),{redirectUri:r.redirectUri,code:_.EMPTY_STRING,codeVerifier:n.verifier}),r.codeChallenge=n.challenge,r.codeChallengeMethod=_.S256_CODE_CHALLENGE_METHOD,[2,i]}})})},e.prototype.initializeLogoutRequest=function(r){this.logger.verbose("initializeLogoutRequest called",r==null?void 0:r.correlationId);var n=K({correlationId:this.correlationId||this.browserCrypto.createNewGuid()},r);if(r)if(r.logoutHint)this.logger.verbose("logoutHint has already been set in logoutRequest");else if(r.account){var i=this.getLogoutHintFromIdTokenClaims(r.account);i&&(this.logger.verbose("Setting logoutHint to login_hint ID Token Claim value for the account provided"),n.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!r||r.postLogoutRedirectUri!==null?r&&r.postLogoutRedirectUri?(this.logger.verbose("Setting postLogoutRedirectUri to uri set on logout request",n.correlationId),n.postLogoutRedirectUri=be.getAbsoluteUrl(r.postLogoutRedirectUri,Je.getCurrentUri())):this.config.auth.postLogoutRedirectUri===null?this.logger.verbose("postLogoutRedirectUri configured as null and no uri set on request, not passing post logout redirect",n.correlationId):this.config.auth.postLogoutRedirectUri?(this.logger.verbose("Setting postLogoutRedirectUri to configured uri",n.correlationId),n.postLogoutRedirectUri=be.getAbsoluteUrl(this.config.auth.postLogoutRedirectUri,Je.getCurrentUri())):(this.logger.verbose("Setting postLogoutRedirectUri to current page",n.correlationId),n.postLogoutRedirectUri=be.getAbsoluteUrl(Je.getCurrentUri(),Je.getCurrentUri())):this.logger.verbose("postLogoutRedirectUri passed as null, not setting post logout redirect uri",n.correlationId),n},e.prototype.getLogoutHintFromIdTokenClaims=function(r){var n=r.idTokenClaims;if(n){if(n.login_hint)return n.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(r,n,i){return S(this,void 0,void 0,function(){var o;return k(this,function(a){switch(a.label){case 0:return[4,this.getClientConfiguration(r,n,i)];case 1:return o=a.sent(),[2,new t3(o)]}})})},e.prototype.getClientConfiguration=function(r,n,i){return S(this,void 0,void 0,function(){var o;return k(this,function(a){switch(a.label){case 0:return this.logger.verbose("getClientConfiguration called",this.correlationId),[4,this.getDiscoveredAuthority(n,i)];case 1:return o=a.sent(),[2,{authOptions:{clientId:this.config.auth.clientId,authority:o,clientCapabilities:this.config.auth.clientCapabilities},systemOptions:{tokenRenewalOffsetSeconds:this.config.system.tokenRenewalOffsetSeconds,preventCorsPreflight:!0},loggerOptions:{loggerCallback:this.config.system.loggerOptions.loggerCallback,piiLoggingEnabled:this.config.system.loggerOptions.piiLoggingEnabled,logLevel:this.config.system.loggerOptions.logLevel,correlationId:this.correlationId},cryptoInterface:this.browserCrypto,networkInterface:this.networkClient,storageInterface:this.browserStorage,serverTelemetryManager:r,libraryInfo:{sku:rn.MSAL_SKU,version:Us,cpu:_.EMPTY_STRING,os:_.EMPTY_STRING},telemetry:this.config.telemetry}]}})})},e.prototype.validateAndExtractStateFromHash=function(r,n,i){if(this.logger.verbose("validateAndExtractStateFromHash called",i),!r.state)throw D.createHashDoesNotContainStateError();var o=o3.extractBrowserRequestState(this.browserCrypto,r.state);if(!o)throw D.createUnableToParseStateError();if(o.interactionType!==n)throw D.createStateInteractionTypeMismatchError();return this.logger.verbose("Returning state from hash",i),r.state},e.prototype.getDiscoveredAuthority=function(r,n){return S(this,void 0,void 0,function(){var i,o,a,s;return k(this,function(c){switch(c.label){case 0:return this.logger.verbose("getDiscoveredAuthority called",this.correlationId),i=this.performanceClient.startMeasurement(pt.StandardInteractionClientGetDiscoveredAuthority,this.correlationId),o={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=r||this.config.auth.authority,s=Gd.generateAuthority(a,n||this.config.auth.azureCloudOptions),this.logger.verbose("Creating discovered authority with configured authority",this.correlationId),[4,Kd.createDiscoveredInstance(s,this.config.system.networkClient,this.browserStorage,o,this.logger).then(function(l){return i.endMeasurement({success:!0}),l}).catch(function(l){throw i.endMeasurement({errorCode:l.errorCode,subErrorCode:l.subError,success:!1}),l})];case 1:return[2,c.sent()]}})})},e.prototype.initializeAuthorizationRequest=function(r,n){return S(this,void 0,void 0,function(){var i,o,a,s,c,l,d;return k(this,function(h){switch(h.label){case 0:return this.logger.verbose("initializeAuthorizationRequest called",this.correlationId),i=this.getRedirectUri(r.redirectUri),o={interactionType:n},a=Yn.setRequestState(this.browserCrypto,r&&r.state||_.EMPTY_STRING,o),c=[{}],[4,this.initializeBaseRequest(r)];case 1:return s=K.apply(void 0,[K.apply(void 0,c.concat([h.sent()])),{redirectUri:i,state:a,nonce:r.nonce||this.browserCrypto.createNewGuid(),responseMode:Od.FRAGMENT}]),l=r.account||this.browserStorage.getActiveAccount(),l&&(this.logger.verbose("Setting validated request account",this.correlationId),this.logger.verbosePii("Setting validated request account: "+l.homeAccountId,this.correlationId),s.account=l),V.isEmpty(s.loginHint)&&!l&&(d=this.browserStorage.getLegacyLoginHint(),d&&(s.loginHint=d)),[2,s]}})})},e}(a3);var n0=function(){function t(e,r,n,i){this.authModule=e,this.browserStorage=r,this.authCodeRequest=n,this.logger=i}return t.prototype.handleCodeResponseFromHash=function(e,r,n,i){return S(this,void 0,void 0,function(){var o,a,s;return k(this,function(c){if(this.logger.verbose("InteractionHandler.handleCodeResponse called"),V.isEmpty(e))throw D.createEmptyHashError(e);if(o=this.browserStorage.generateStateKey(r),a=this.browserStorage.getTemporaryCache(o),!a)throw j.createStateNotFoundError("Cached State");try{s=this.authModule.handleFragmentResponse(e,a)}catch(l){throw l instanceof So&&l.subError===P.userCancelledError.code?D.createUserCancelledError():l}return[2,this.handleCodeResponseFromServer(s,r,n,i)]})})},t.prototype.handleCodeResponseFromServer=function(e,r,n,i,o){return o===void 0&&(o=!0),S(this,void 0,void 0,function(){var a,s,c,l,d,h;return k(this,function(u){switch(u.label){case 0:if(this.logger.trace("InteractionHandler.handleCodeResponseFromServer called"),a=this.browserStorage.generateStateKey(r),s=this.browserStorage.getTemporaryCache(a),!s)throw j.createStateNotFoundError("Cached State");return c=this.browserStorage.generateNonceKey(s),l=this.browserStorage.getTemporaryCache(c),this.authCodeRequest.code=e.code,e.cloud_instance_host_name?[4,this.updateTokenEndpointAuthority(e.cloud_instance_host_name,n,i)]:[3,2];case 1:u.sent(),u.label=2;case 2:return o&&(e.nonce=l||void 0),e.state=s,e.client_info?this.authCodeRequest.clientInfo=e.client_info:(d=this.checkCcsCredentials(),d&&(this.authCodeRequest.ccsCredential=d)),[4,this.authModule.acquireToken(this.authCodeRequest,e)];case 3:return h=u.sent(),this.browserStorage.cleanRequestByState(r),[2,h]}})})},t.prototype.updateTokenEndpointAuthority=function(e,r,n){return S(this,void 0,void 0,function(){var i,o;return k(this,function(a){switch(a.label){case 0:return i="https://"+e+"/"+r.tenant+"/",[4,Kd.createDiscoveredInstance(i,n,this.browserStorage,r.options,this.logger)];case 1:return o=a.sent(),this.authModule.updateAuthority(o),[2]}})})},t.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},t}();var pm=function(t){It(e,t);function e(r,n,i,o,a){var s=t.call(this,r,n,i,o)||this;return s.browserCrypto=a,s}return e.prototype.initiateAuthRequest=function(r,n){return S(this,void 0,void 0,function(){var i,o;return k(this,function(a){switch(a.label){case 0:return this.logger.verbose("RedirectHandler.initiateAuthRequest called"),V.isEmpty(r)?[3,7]:(n.redirectStartPage&&(this.logger.verbose("RedirectHandler.initiateAuthRequest: redirectStartPage set, caching start page"),this.browserStorage.setTemporaryCache(ye.ORIGIN_URI,n.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: "+r),i={apiId:He.acquireTokenRedirect,timeout:n.redirectTimeout,noHistory:!1},typeof n.onRedirectNavigate!="function"?[3,4]:(this.logger.verbose("RedirectHandler.initiateAuthRequest: Invoking onRedirectNavigate callback"),o=n.onRedirectNavigate(r),o===!1?[3,2]:(this.logger.verbose("RedirectHandler.initiateAuthRequest: onRedirectNavigate did not return false, navigating"),[4,n.navigationClient.navigateExternal(r,i)])));case 1:return a.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,n.navigationClient.navigateExternal(r,i)];case 5:return a.sent(),[2];case 6:return[3,8];case 7:throw this.logger.info("RedirectHandler.initiateAuthRequest: Navigate url is empty"),D.createEmptyNavigationUriError();case 8:return[2]}})})},e.prototype.handleCodeResponseFromHash=function(r,n,i,o){return S(this,void 0,void 0,function(){var a,s,c,l,d,h,u;return k(this,function(f){switch(f.label){case 0:if(this.logger.verbose("RedirectHandler.handleCodeResponse called"),V.isEmpty(r))throw D.createEmptyHashError(r);if(this.browserStorage.setInteractionInProgress(!1),a=this.browserStorage.generateStateKey(n),s=this.browserStorage.getTemporaryCache(a),!s)throw j.createStateNotFoundError("Cached State");try{c=this.authModule.handleFragmentResponse(r,s)}catch(v){throw v instanceof So&&v.subError===P.userCancelledError.code?D.createUserCancelledError():v}return l=this.browserStorage.generateNonceKey(s),d=this.browserStorage.getTemporaryCache(l),this.authCodeRequest.code=c.code,c.cloud_instance_host_name?[4,this.updateTokenEndpointAuthority(c.cloud_instance_host_name,i,o)]:[3,2];case 1:f.sent(),f.label=2;case 2:return c.nonce=d||void 0,c.state=s,c.client_info?this.authCodeRequest.clientInfo=c.client_info:(h=this.checkCcsCredentials(),h&&(this.authCodeRequest.ccsCredential=h)),[4,this.authModule.acquireToken(this.authCodeRequest,c)];case 3:return u=f.sent(),this.browserStorage.cleanRequestByState(n),[2,u]}})})},e}(n0);var J;(function(t){t.INITIALIZE_START="msal:initializeStart",t.INITIALIZE_END="msal:initializeEnd",t.ACCOUNT_ADDED="msal:accountAdded",t.ACCOUNT_REMOVED="msal:accountRemoved",t.LOGIN_START="msal:loginStart",t.LOGIN_SUCCESS="msal:loginSuccess",t.LOGIN_FAILURE="msal:loginFailure",t.ACQUIRE_TOKEN_START="msal:acquireTokenStart",t.ACQUIRE_TOKEN_SUCCESS="msal:acquireTokenSuccess",t.ACQUIRE_TOKEN_FAILURE="msal:acquireTokenFailure",t.ACQUIRE_TOKEN_NETWORK_START="msal:acquireTokenFromNetworkStart",t.SSO_SILENT_START="msal:ssoSilentStart",t.SSO_SILENT_SUCCESS="msal:ssoSilentSuccess",t.SSO_SILENT_FAILURE="msal:ssoSilentFailure",t.ACQUIRE_TOKEN_BY_CODE_START="msal:acquireTokenByCodeStart",t.ACQUIRE_TOKEN_BY_CODE_SUCCESS="msal:acquireTokenByCodeSuccess",t.ACQUIRE_TOKEN_BY_CODE_FAILURE="msal:acquireTokenByCodeFailure",t.HANDLE_REDIRECT_START="msal:handleRedirectStart",t.HANDLE_REDIRECT_END="msal:handleRedirectEnd",t.POPUP_OPENED="msal:popupOpened",t.LOGOUT_START="msal:logoutStart",t.LOGOUT_SUCCESS="msal:logoutSuccess",t.LOGOUT_FAILURE="msal:logoutFailure",t.LOGOUT_END="msal:logoutEnd"})(J||(J={}));var gi;(function(t){t.USER_INTERACTION_REQUIRED="USER_INTERACTION_REQUIRED",t.USER_CANCEL="USER_CANCEL",t.NO_NETWORK="NO_NETWORK",t.TRANSIENT_ERROR="TRANSIENT_ERROR",t.PERSISTENT_ERROR="PERSISTENT_ERROR",t.DISABLED="DISABLED",t.ACCOUNT_UNAVAILABLE="ACCOUNT_UNAVAILABLE"})(gi||(gi={}));var ns={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"}},xn=function(t){It(e,t);function e(r,n,i){var o=t.call(this,r,n)||this;return Object.setPrototypeOf(o,e.prototype),o.name="NativeAuthError",o.ext=i,o}return e.prototype.isFatal=function(){if(this.ext&&this.ext.status&&(this.ext.status===gi.PERSISTENT_ERROR||this.ext.status===gi.DISABLED))return!0;switch(this.errorCode){case ns.extensionError.code:return!0;default:return!1}},e.createError=function(r,n,i){if(i&&i.status)switch(i.status){case gi.ACCOUNT_UNAVAILABLE:return an.createNativeAccountUnavailableError();case gi.USER_INTERACTION_REQUIRED:return new an(r,n);case gi.USER_CANCEL:return D.createUserCancelledError();case gi.NO_NETWORK:return D.createNoNetworkConnectivityError()}return new e(r,n,i)},e.createUserSwitchError=function(){return new e(ns.userSwitch.code,ns.userSwitch.desc)},e.createTokensNotFoundInCacheError=function(){return new e(ns.tokensNotFoundInCache.code,ns.tokensNotFoundInCache.desc)},e}(W);var s3=function(t){It(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.acquireToken=function(r){return S(this,void 0,void 0,function(){var n,i,o,a,s;return k(this,function(c){switch(c.label){case 0:return n=this.performanceClient.startMeasurement(pt.SilentCacheClientAcquireToken,r.correlationId),i=this.initializeServerTelemetryManager(He.acquireTokenSilent_silentFlow),[4,this.createSilentFlowClient(i,r.authority,r.azureCloudOptions)];case 1:o=c.sent(),this.logger.verbose("Silent auth client created"),c.label=2;case 2:return c.trys.push([2,4,,5]),[4,o.acquireCachedToken(r)];case 3:return a=c.sent(),n.endMeasurement({success:!0,fromCache:!0}),[2,a];case 4:throw s=c.sent(),s instanceof D&&s.errorCode===P.signingKeyNotFoundInStorage.code&&this.logger.verbose("Signing keypair for bound access token not found. Refreshing bound access token and generating a new crypto keypair."),n.endMeasurement({errorCode:s instanceof W&&s.errorCode||void 0,subErrorCode:s instanceof W&&s.subError||void 0,success:!1}),s;case 5:return[2]}})})},e.prototype.logout=function(){return Promise.reject(D.createSilentLogoutUnsupportedError())},e.prototype.createSilentFlowClient=function(r,n,i){return S(this,void 0,void 0,function(){var o;return k(this,function(a){switch(a.label){case 0:return[4,this.getClientConfiguration(r,n,i)];case 1:return o=a.sent(),[2,new y_(o,this.performanceClient)]}})})},e.prototype.initializeSilentRequest=function(r,n){return S(this,void 0,void 0,function(){var i;return k(this,function(o){switch(o.label){case 0:return i=[K({},r)],[4,this.initializeBaseRequest(r)];case 1:return[2,K.apply(void 0,[K.apply(void 0,i.concat([o.sent()])),{account:n,forceRefresh:r.forceRefresh||!1}])]}})})},e}($a);var xa=function(t){It(e,t);function e(r,n,i,o,a,s,c,l,d,h,u,f){var v=t.call(this,r,n,i,o,a,s,l,d,f)||this;return v.apiId=c,v.accountId=h,v.nativeMessageHandler=d,v.nativeStorageManager=u,v.silentCacheClient=new s3(r,v.nativeStorageManager,i,o,a,s,l,d,f),v}return e.prototype.acquireToken=function(r){return S(this,void 0,void 0,function(){var n,i,o,a,s,c,l;return k(this,function(d){switch(d.label){case 0:return this.logger.trace("NativeInteractionClient - acquireToken called."),n=this.performanceClient.startMeasurement(pt.NativeInteractionClientAcquireToken,r.correlationId),i=Br.nowSeconds(),[4,this.initializeNativeRequest(r)];case 1:o=d.sent(),d.label=2;case 2:return d.trys.push([2,4,,5]),[4,this.acquireTokensFromCache(this.accountId,o)];case 3:return a=d.sent(),n.endMeasurement({success:!0,isNativeBroker:!1,fromCache:!0}),[2,a];case 4:return d.sent(),this.logger.info("MSAL internal Cache does not contain tokens, proceed to make a native call"),[3,5];case 5:return s={method:Gn.GetToken,request:o},[4,this.nativeMessageHandler.sendMessage(s)];case 6:return c=d.sent(),l=this.validateNativeResponse(c),[2,this.handleNativeResponse(l,o,i).then(function(h){return n.endMeasurement({success:!0,isNativeBroker:!0,requestId:h.requestId}),h}).catch(function(h){throw n.endMeasurement({success:!1,errorCode:h.errorCode,subErrorCode:h.subError,isNativeBroker:!0}),h})]}})})},e.prototype.createSilentCacheRequest=function(r,n){return{authority:r.authority,correlationId:this.correlationId,scopes:er.fromString(r.scope).asArray(),account:n,forceRefresh:!1}},e.prototype.acquireTokensFromCache=function(r,n){return S(this,void 0,void 0,function(){var i,o,a,s,c;return k(this,function(l){switch(l.label){case 0:if(i=this.browserStorage.readAccountFromCacheWithNativeAccountId(r),!i)throw j.createNoAccountFoundError();o=i.getAccountInfo(),l.label=1;case 1:return l.trys.push([1,3,,4]),a=this.createSilentCacheRequest(n,o),[4,this.silentCacheClient.acquireToken(a)];case 2:return s=l.sent(),[2,s];case 3:throw c=l.sent(),c;case 4:return[2]}})})},e.prototype.acquireTokenRedirect=function(r){return S(this,void 0,void 0,function(){var n,i,o,a,s,c;return k(this,function(l){switch(l.label){case 0:return this.logger.trace("NativeInteractionClient - acquireTokenRedirect called."),[4,this.initializeNativeRequest(r)];case 1:n=l.sent(),i={method:Gn.GetToken,request:n},l.label=2;case 2:return l.trys.push([2,4,,5]),[4,this.nativeMessageHandler.sendMessage(i)];case 3:return o=l.sent(),this.validateNativeResponse(o),[3,5];case 4:if(a=l.sent(),a instanceof xn&&a.isFatal())throw a;return[3,5];case 5:return this.browserStorage.setTemporaryCache(ye.NATIVE_REQUEST,JSON.stringify(n),!0),s={apiId:He.acquireTokenRedirect,timeout:this.config.system.redirectNavigationTimeout,noHistory:!1},c=this.config.auth.navigateToLoginRequestUrl?window.location.href:this.getRedirectUri(r.redirectUri),[4,this.navigationClient.navigateExternal(c,s)];case 6:return l.sent(),[2]}})})},e.prototype.handleRedirectPromise=function(){return S(this,void 0,void 0,function(){var r,n,i,o,a,s,c,l;return k(this,function(d){switch(d.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(r=this.browserStorage.getCachedNativeRequest(),!r)return this.logger.verbose("NativeInteractionClient - handleRedirectPromise called but there is no cached request, returning null."),[2,null];n=r.prompt,i=tm(r,["prompt"]),n&&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)),o={method:Gn.GetToken,request:i},a=Br.nowSeconds(),d.label=1;case 1:return d.trys.push([1,3,,4]),this.logger.verbose("NativeInteractionClient - handleRedirectPromise sending message to native broker."),[4,this.nativeMessageHandler.sendMessage(o)];case 2:return s=d.sent(),this.validateNativeResponse(s),c=this.handleNativeResponse(s,i,a),this.browserStorage.setInteractionInProgress(!1),[2,c];case 3:throw l=d.sent(),this.browserStorage.setInteractionInProgress(!1),l;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(r,n,i){return S(this,void 0,void 0,function(){var o,a,s,c,l,d,h,u,f,v,g,x,m,p,y,w,A,O,U,N,xe=this;return k(this,function(Y){switch(Y.label){case 0:if(this.logger.trace("NativeInteractionClient - handleNativeResponse called."),o=this.getMATSFromResponse(r),this.performanceClient.addStaticFields({extensionId:this.nativeMessageHandler.getExtensionId(),extensionVersion:this.nativeMessageHandler.getExtensionVersion(),matsBrokerVersion:o?o.broker_version:void 0,matsAccountJoinOnStart:o?o.account_join_on_start:void 0,matsAccountJoinOnEnd:o?o.account_join_on_end:void 0,matsDeviceJoin:o?o.device_join:void 0,matsPromptBehavior:o?o.prompt_behavior:void 0,matsApiErrorCode:o?o.api_error_code:void 0,matsUiVisible:o?o.ui_visible:void 0,matsSilentCode:o?o.silent_code:void 0,matsSilentBiSubCode:o?o.silent_bi_sub_code:void 0,matsSilentMessage:o?o.silent_message:void 0,matsSilentStatus:o?o.silent_status:void 0,matsHttpStatus:o?o.http_status:void 0,matsHttpEventCount:o?o.http_event_count:void 0},this.correlationId),r.account.id!==n.accountId)throw xn.createUserSwitchError();return a=new Tn(r.id_token||_.EMPTY_STRING,this.browserCrypto),[4,this.getDiscoveredAuthority(n.authority)];case 1:switch(s=Y.sent(),c=s.getPreferredCache(),l=kt.generateHomeAccountId(r.client_info||_.EMPTY_STRING,Fr.Default,this.logger,this.browserCrypto,a),d=kt.createAccount(r.client_info,l,a,void 0,void 0,void 0,c,r.account.id),this.browserStorage.setAccount(d),h=r.scope?er.fromString(r.scope):er.fromString(n.scope),u=r.account.properties||{},f=u.UID||a.claims.oid||a.claims.sub||_.EMPTY_STRING,v=u.TenantId||a.claims.tid||_.EMPTY_STRING,x=Se.BEARER,m=n.tokenType,m){case Se.POP:return[3,2]}return[3,4];case 2:if(x=Se.POP,r.shr)return this.logger.trace("handleNativeServerResponse: SHR is enabled in native layer"),g=r.shr,[3,5];if(p=new Pa(this.browserCrypto),y={resourceRequestMethod:n.resourceRequestMethod,resourceRequestUri:n.resourceRequestUri,shrClaims:n.shrClaims,shrNonce:n.shrNonce},!n.keyId)throw j.createKeyIdMissingError();return[4,p.signPopToken(r.access_token,n.keyId,y)];case 3:return g=Y.sent(),[3,5];case 4:g=r.access_token,Y.label=5;case 5:return w={authority:s.canonicalAuthority,uniqueId:f,tenantId:v,scopes:h.asArray(),account:d.getAccountInfo(),idToken:r.id_token,idTokenClaims:a.claims,accessToken:g,fromCache:o?this.isResponseFromCache(o):!1,expiresOn:new Date(Number(i+r.expires_in)*1e3),tokenType:x,correlationId:this.correlationId,state:r.state,fromNativeBroker:!0},A=uc.createIdTokenEntity(l,n.authority,r.id_token||_.EMPTY_STRING,n.clientId,a.claims.tid||_.EMPTY_STRING),this.nativeStorageManager.setIdTokenCredential(A),O=x===Se.POP?_.SHR_NONCE_VALIDITY:(typeof r.expires_in=="string"?parseInt(r.expires_in,10):r.expires_in)||0,U=i+O,N=fc.createAccessTokenEntity(l,n.authority,g,n.clientId,v,h.printScopes(),U,0,this.browserCrypto),this.nativeStorageManager.setAccessTokenCredential(N),this.browserStorage.removeAccountContext(d).catch(function(Xt){xe.logger.error("Error occurred while removing account context from browser storage. "+Xt)}),[2,w]}})})},e.prototype.validateNativeResponse=function(r){if(r.hasOwnProperty("access_token")&&r.hasOwnProperty("id_token")&&r.hasOwnProperty("client_info")&&r.hasOwnProperty("account")&&r.hasOwnProperty("scope")&&r.hasOwnProperty("expires_in"))return r;throw xn.createUnexpectedError("Response missing expected properties.")},e.prototype.getMATSFromResponse=function(r){if(r.properties.MATS)try{return JSON.parse(r.properties.MATS)}catch{this.logger.error("NativeInteractionClient - Error parsing MATS telemetry, returning null instead")}return null},e.prototype.isResponseFromCache=function(r){return typeof r.is_cached>"u"?(this.logger.verbose("NativeInteractionClient - MATS telemetry does not contain field indicating if response was served from cache. Returning false."),!1):!!r.is_cached},e.prototype.initializeNativeRequest=function(r){return S(this,void 0,void 0,function(){var n,i,o,a,s,c,l,d,h,u,f=this;return k(this,function(v){switch(v.label){case 0:return this.logger.trace("NativeInteractionClient - initializeNativeRequest called"),n=r.authority||this.config.auth.authority,i=new be(n),i.validateAsUri(),o=r.scopes,a=tm(r,["scopes"]),s=new er(o||[]),s.appendScopes(Tc),c=function(){switch(f.apiId){case He.ssoSilent:case He.acquireTokenSilent_silentFlow:return f.logger.trace("initializeNativeRequest: silent request sets prompt to none"),jt.NONE}if(!r.prompt){f.logger.trace("initializeNativeRequest: prompt was not provided");return}switch(r.prompt){case jt.NONE:case jt.CONSENT:case jt.LOGIN:return f.logger.trace("initializeNativeRequest: prompt is compatible with native flow"),r.prompt;default:throw f.logger.trace("initializeNativeRequest: prompt = "+r.prompt+" is not compatible with native flow"),D.createNativePromptParameterNotSupportedError()}},l=K(K({},a),{accountId:this.accountId,clientId:this.config.auth.clientId,authority:i.urlString,scope:s.printScopes(),redirectUri:this.getRedirectUri(r.redirectUri),prompt:c(),correlationId:this.correlationId,tokenType:r.authenticationScheme,windowTitleSubstring:document.title,extraParameters:K(K(K({},r.extraQueryParameters),r.tokenQueryParameters),{telemetry:vs.MATS_TELEMETRY}),extendedExpiryToken:!1}),r.authenticationScheme!==Se.POP?[3,2]:(d={resourceRequestUri:r.resourceRequestUri,resourceRequestMethod:r.resourceRequestMethod,shrClaims:r.shrClaims,shrNonce:r.shrNonce},h=new Pa(this.browserCrypto),[4,h.generateCnf(d)]);case 1:u=v.sent(),l.reqCnf=u.reqCnfHash,l.keyId=u.kid,v.label=2;case 2:return[2,l]}})})},e}(a3);var vo=function(){function t(e,r,n){this.logger=e,this.handshakeTimeoutMs=r,this.extensionId=n,this.resolvers=new Map,this.handshakeResolvers=new Map,this.responseId=0,this.messageChannel=new MessageChannel,this.windowListener=this.onWindowMessage.bind(this)}return t.prototype.sendMessage=function(e){return S(this,void 0,void 0,function(){var r,n=this;return k(this,function(i){return this.logger.trace("NativeMessageHandler - sendMessage called."),r={channel:vs.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(r)),this.messageChannel.port1.postMessage(r),[2,new Promise(function(o,a){n.resolvers.set(r.responseId,{resolve:o,reject:a})})]})})},t.createProvider=function(e,r){return S(this,void 0,void 0,function(){var n,i;return k(this,function(o){switch(o.label){case 0:e.trace("NativeMessageHandler - createProvider called."),o.label=1;case 1:return o.trys.push([1,3,,5]),n=new t(e,r,vs.PREFERRED_EXTENSION_ID),[4,n.sendHandshakeRequest()];case 2:return o.sent(),[2,n];case 3:return o.sent(),i=new t(e,r),[4,i.sendHandshakeRequest()];case 4:return o.sent(),[2,i];case 5:return[2]}})})},t.prototype.sendHandshakeRequest=function(){return S(this,void 0,void 0,function(){var e,r=this;return k(this,function(n){return this.logger.trace("NativeMessageHandler - sendHandshakeRequest called."),window.addEventListener("message",this.windowListener,!1),e={channel:vs.CHANNEL_ID,extensionId:this.extensionId,responseId:this.responseId++,body:{method:Gn.HandshakeRequest}},this.messageChannel.port1.onmessage=function(i){r.onChannelMessage(i)},window.postMessage(e,window.origin,[this.messageChannel.port2]),[2,new Promise(function(i,o){r.handshakeResolvers.set(e.responseId,{resolve:i,reject:o}),r.timeoutId=window.setTimeout(function(){window.removeEventListener("message",r.windowListener,!1),r.messageChannel.port1.close(),r.messageChannel.port2.close(),o(D.createNativeHandshakeTimeoutError()),r.handshakeResolvers.delete(e.responseId)},r.handshakeTimeoutMs)})]})})},t.prototype.onWindowMessage=function(e){if(this.logger.trace("NativeMessageHandler - onWindowMessage called"),e.source===window){var r=e.data;if(!(!r.channel||r.channel!==vs.CHANNEL_ID)&&!(r.extensionId&&r.extensionId!==this.extensionId)&&r.body.method===Gn.HandshakeRequest){this.logger.verbose(r.extensionId?"Extension with id: "+r.extensionId+" not installed":"No extension installed"),clearTimeout(this.timeoutId),this.messageChannel.port1.close(),this.messageChannel.port2.close(),window.removeEventListener("message",this.windowListener,!1);var n=this.handshakeResolvers.get(r.responseId);n&&n.reject(D.createNativeExtensionNotInstalledError())}}},t.prototype.onChannelMessage=function(e){this.logger.trace("NativeMessageHandler - onChannelMessage called.");var r=e.data,n=this.resolvers.get(r.responseId),i=this.handshakeResolvers.get(r.responseId);try{var o=r.body.method;if(o===Gn.Response){if(!n)return;var a=r.body.response;if(this.logger.trace("NativeMessageHandler - Received response from browser extension"),this.logger.tracePii("NativeMessageHandler - Received response from browser extension: "+JSON.stringify(a)),a.status!=="Success")n.reject(xn.createError(a.code,a.description,a.ext));else if(a.result)a.result.code&&a.result.description?n.reject(xn.createError(a.result.code,a.result.description,a.result.ext)):n.resolve(a.result);else throw W.createUnexpectedError("Event does not contain result.");this.resolvers.delete(r.responseId)}else if(o===Gn.HandshakeResponse){if(!i)return;clearTimeout(this.timeoutId),window.removeEventListener("message",this.windowListener,!1),this.extensionId=r.extensionId,this.extensionVersion=r.body.version,this.logger.verbose("NativeMessageHandler - Received HandshakeResponse from extension: "+this.extensionId),i.resolve(),this.handshakeResolvers.delete(r.responseId)}}catch(s){this.logger.error("Error parsing response from WAM Extension"),this.logger.errorPii("Error parsing response from WAM Extension: "+s.toString()),this.logger.errorPii("Unable to parse "+e),n?n.reject(s):i&&i.reject(s)}},t.prototype.getExtensionId=function(){return this.extensionId},t.prototype.getExtensionVersion=function(){return this.extensionVersion},t.isNativeAvailable=function(e,r,n,i){if(r.trace("isNativeAvailable called"),!e.system.allowNativeBroker)return r.trace("isNativeAvailable: allowNativeBroker is not enabled, returning false"),!1;if(!n)return r.trace("isNativeAvailable: WAM extension provider is not initialized, returning false"),!1;if(i)switch(i){case Se.BEARER:case Se.POP:return r.trace("isNativeAvailable: authenticationScheme is supported, returning true"),!0;default:return r.trace("isNativeAvailable: authenticationScheme is not supported, returning false"),!1}return!0},t}();var R_=function(t){It(e,t);function e(r,n,i,o,a,s,c,l,d,h){var u=t.call(this,r,n,i,o,a,s,c,d,h)||this;return u.nativeStorage=l,u}return e.prototype.acquireToken=function(r){return S(this,void 0,void 0,function(){var n,i,o,a,s,c,l,d,h,u=this;return k(this,function(f){switch(f.label){case 0:return[4,this.initializeAuthorizationRequest(r,G.Redirect)];case 1:n=f.sent(),this.browserStorage.updateCacheEntries(n.state,n.nonce,n.authority,n.loginHint||_.EMPTY_STRING,n.account||null),i=this.initializeServerTelemetryManager(He.acquireTokenRedirect),o=function(v){v.persisted&&(u.logger.verbose("Page was restored from back/forward cache. Clearing temporary cache."),u.browserStorage.cleanRequestByState(n.state))},f.label=2;case 2:return f.trys.push([2,7,,8]),[4,this.initializeAuthorizationCodeRequest(n)];case 3:return a=f.sent(),[4,this.createAuthCodeClient(i,n.authority,n.azureCloudOptions)];case 4:return s=f.sent(),this.logger.verbose("Auth code client created"),c=new pm(s,this.browserStorage,a,this.logger,this.browserCrypto),[4,s.getAuthCodeUrl(K(K({},n),{nativeBroker:vo.isNativeAvailable(this.config,this.logger,this.nativeMessageHandler,r.authenticationScheme)}))];case 5:return l=f.sent(),d=this.getRedirectStartPage(r.redirectStartPage),this.logger.verbosePii("Redirect start page: "+d),window.addEventListener("pageshow",o),[4,c.initiateAuthRequest(l,{navigationClient:this.navigationClient,redirectTimeout:this.config.system.redirectNavigationTimeout,redirectStartPage:d,onRedirectNavigate:r.onRedirectNavigate})];case 6:return[2,f.sent()];case 7:throw h=f.sent(),h instanceof W&&h.setCorrelationId(this.correlationId),window.removeEventListener("pageshow",o),i.cacheFailedRequest(h),this.browserStorage.cleanRequestByState(n.state),h;case 8:return[2]}})})},e.prototype.handleRedirectPromise=function(r){return S(this,void 0,void 0,function(){var n,i,o,a,s,c,l,d,h,u,f,v;return k(this,function(g){switch(g.label){case 0:n=this.initializeServerTelemetryManager(He.handleRedirectPromise),g.label=1;case 1:if(g.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(r||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(G.Redirect),[2,null];o=void 0;try{a=be.getDeserializedHash(i),o=this.validateAndExtractStateFromHash(a,G.Redirect),this.logger.verbose("State extracted from hash")}catch(x){return this.logger.info("handleRedirectPromise was unable to extract state due to: "+x),this.browserStorage.cleanRequestByInteractionType(G.Redirect),[2,null]}return s=this.browserStorage.getTemporaryCache(ye.ORIGIN_URI,!0)||_.EMPTY_STRING,c=be.removeHashFromUrl(s),l=be.removeHashFromUrl(window.location.href),c===l&&this.config.auth.navigateToLoginRequestUrl?(this.logger.verbose("Current page is loginRequestUrl, handling hash"),[4,this.handleHash(i,o,n)]):[3,3];case 2:return d=g.sent(),s.indexOf("#")>-1&&Je.replaceHash(s),[2,d];case 3:return this.config.auth.navigateToLoginRequestUrl?[3,4]:(this.logger.verbose("NavigateToLoginRequestUrl set to false, handling hash"),[2,this.handleHash(i,o,n)]);case 4:return!Je.isInIframe()||this.config.system.allowRedirectInIframe?(this.browserStorage.setTemporaryCache(ye.URL_HASH,i,!0),h={apiId:He.handleRedirectPromise,timeout:this.config.system.redirectNavigationTimeout,noHistory:!0},u=!0,!s||s==="null"?(f=Je.getHomepage(),this.browserStorage.setTemporaryCache(ye.ORIGIN_URI,f,!0),this.logger.warning("Unable to get valid login request url from cache, redirecting to home page"),[4,this.navigationClient.navigateInternal(f,h)]):[3,6]):[3,9];case 5:return u=g.sent(),[3,8];case 6:return this.logger.verbose("Navigating to loginRequestUrl: "+s),[4,this.navigationClient.navigateInternal(s,h)];case 7:u=g.sent(),g.label=8;case 8:if(!u)return[2,this.handleHash(i,o,n)];g.label=9;case 9:return[2,null];case 10:throw v=g.sent(),v instanceof W&&v.setCorrelationId(this.correlationId),n.cacheFailedRequest(v),this.browserStorage.cleanRequestByInteractionType(G.Redirect),v;case 11:return[2]}})})},e.prototype.getRedirectResponseHash=function(r){this.logger.verbose("getRedirectResponseHash called");var n=be.hashContainsKnownProperties(r);if(n)return Je.clearHash(window),this.logger.verbose("Hash contains known properties, returning response hash"),r;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(r,n,i){return S(this,void 0,void 0,function(){var o,a,s,c,l,d,h,u=this;return k(this,function(f){switch(f.label){case 0:if(o=this.browserStorage.getCachedRequest(n,this.browserCrypto),this.logger.verbose("handleHash called, retrieved cached request"),a=be.getDeserializedHash(r),a.accountId){if(this.logger.verbose("Account id found in hash, calling WAM for token"),!this.nativeMessageHandler)throw D.createNativeConnectionNotEstablishedError();return s=new xa(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,He.acquireTokenPopup,this.performanceClient,this.nativeMessageHandler,a.accountId,this.browserStorage,o.correlationId),c=Yn.parseRequestState(this.browserCrypto,n).userRequestState,[2,s.acquireToken(K(K({},o),{state:c,prompt:void 0})).finally(function(){u.browserStorage.cleanRequestByState(n)})]}if(l=this.browserStorage.getCachedAuthority(n),!l)throw D.createNoCachedAuthorityError();return[4,this.createAuthCodeClient(i,l)];case 1:return d=f.sent(),this.logger.verbose("Auth code client created"),$d.removeThrottle(this.browserStorage,this.config.auth.clientId,o),h=new pm(d,this.browserStorage,o,this.logger,this.browserCrypto),[4,h.handleCodeResponseFromHash(r,n,d.authority,this.networkClient)];case 2:return[2,f.sent()]}})})},e.prototype.logout=function(r){return S(this,void 0,void 0,function(){var n,i,o,a,s,c,l;return k(this,function(d){switch(d.label){case 0:this.logger.verbose("logoutRedirect called"),n=this.initializeLogoutRequest(r),i=this.initializeServerTelemetryManager(He.logout),d.label=1;case 1:return d.trys.push([1,10,,11]),this.eventHandler.emitEvent(J.LOGOUT_START,G.Redirect,r),[4,this.clearCacheOnLogout(n.account)];case 2:return d.sent(),o={apiId:He.logout,timeout:this.config.system.redirectNavigationTimeout,noHistory:!1},[4,this.createAuthCodeClient(i,r&&r.authority)];case 3:return a=d.sent(),this.logger.verbose("Auth code client created"),s=a.getLogoutUri(n),this.eventHandler.emitEvent(J.LOGOUT_SUCCESS,G.Redirect,n),r&&typeof r.onRedirectNavigate=="function"?(c=r.onRedirectNavigate(s),c===!1?[3,5]:(this.logger.verbose("Logout onRedirectNavigate did not return false, navigating"),this.browserStorage.getInteractionInProgress()||this.browserStorage.setInteractionInProgress(!0),[4,this.navigationClient.navigateExternal(s,o)])):[3,7];case 4:return d.sent(),[2];case 5:this.browserStorage.setInteractionInProgress(!1),this.logger.verbose("Logout onRedirectNavigate returned false, stopping navigation"),d.label=6;case 6:return[3,9];case 7:return this.browserStorage.getInteractionInProgress()||this.browserStorage.setInteractionInProgress(!0),[4,this.navigationClient.navigateExternal(s,o)];case 8:return d.sent(),[2];case 9:return[3,11];case 10:throw l=d.sent(),l instanceof W&&l.setCorrelationId(this.correlationId),i.cacheFailedRequest(l),this.eventHandler.emitEvent(J.LOGOUT_FAILURE,G.Redirect,null,l),this.eventHandler.emitEvent(J.LOGOUT_END,G.Redirect),l;case 11:return this.eventHandler.emitEvent(J.LOGOUT_END,G.Redirect),[2]}})})},e.prototype.getRedirectStartPage=function(r){var n=r||window.location.href;return be.getAbsoluteUrl(n,Je.getCurrentUri())},e}($a);var H_=function(t){It(e,t);function e(r,n,i,o,a,s,c,l,d,h){var u=t.call(this,r,n,i,o,a,s,c,d,h)||this;return u.unloadWindow=u.unloadWindow.bind(u),u.nativeStorage=l,u}return e.prototype.acquireToken=function(r){try{var n=this.generatePopupName(r.scopes||Tc,r.authority||this.config.auth.authority),i=r.popupWindowAttributes||{};if(this.config.system.asyncPopups)return this.logger.verbose("asyncPopups set to true, acquiring token"),this.acquireTokenPopupAsync(r,n,i);this.logger.verbose("asyncPopup set to false, opening popup before acquiring token");var o=this.openSizedPopup("about:blank",n,i);return this.acquireTokenPopupAsync(r,n,i,o)}catch(a){return Promise.reject(a)}},e.prototype.logout=function(r){try{this.logger.verbose("logoutPopup called");var n=this.initializeLogoutRequest(r),i=this.generateLogoutPopupName(n),o=r&&r.authority,a=r&&r.mainWindowRedirectUri,s=(r==null?void 0:r.popupWindowAttributes)||{};if(this.config.system.asyncPopups)return this.logger.verbose("asyncPopups set to true"),this.logoutPopupAsync(n,i,s,o,void 0,a);this.logger.verbose("asyncPopup set to false, opening popup");var c=this.openSizedPopup("about:blank",i,s);return this.logoutPopupAsync(n,i,s,o,c,a)}catch(l){return Promise.reject(l)}},e.prototype.acquireTokenPopupAsync=function(r,n,i,o){return S(this,void 0,void 0,function(){var a,s,c,l,d,h,u,f,v,g,x,m,p,y,w,A,O,U=this;return k(this,function(N){switch(N.label){case 0:return this.logger.verbose("acquireTokenPopupAsync called"),a=this.initializeServerTelemetryManager(He.acquireTokenPopup),[4,this.initializeAuthorizationRequest(r,G.Popup)];case 1:s=N.sent(),this.browserStorage.updateCacheEntries(s.state,s.nonce,s.authority,s.loginHint||_.EMPTY_STRING,s.account||null),N.label=2;case 2:return N.trys.push([2,8,,9]),[4,this.initializeAuthorizationCodeRequest(s)];case 3:return c=N.sent(),[4,this.createAuthCodeClient(a,s.authority,s.azureCloudOptions)];case 4:return l=N.sent(),this.logger.verbose("Auth code client created"),d=vo.isNativeAvailable(this.config,this.logger,this.nativeMessageHandler,r.authenticationScheme),h=void 0,d&&(h=this.performanceClient.startMeasurement(pt.FetchAccountIdWithNativeBroker,r.correlationId)),[4,l.getAuthCodeUrl(K(K({},s),{nativeBroker:d}))];case 5:return u=N.sent(),f=new n0(l,this.browserStorage,c,this.logger),v={popup:o,popupName:n,popupWindowAttributes:i},g=this.initiateAuthRequest(u,v),this.eventHandler.emitEvent(J.POPUP_OPENED,G.Popup,{popupWindow:g},null),[4,this.monitorPopupForHash(g)];case 6:if(x=N.sent(),m=be.getDeserializedHash(x),p=this.validateAndExtractStateFromHash(m,G.Popup,s.correlationId),$d.removeThrottle(this.browserStorage,this.config.auth.clientId,c),m.accountId){if(this.logger.verbose("Account id found in hash, calling WAM for token"),h&&h.endMeasurement({success:!0,isNativeBroker:!0}),!this.nativeMessageHandler)throw D.createNativeConnectionNotEstablishedError();return y=new xa(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,He.acquireTokenPopup,this.performanceClient,this.nativeMessageHandler,m.accountId,this.nativeStorage,s.correlationId),w=Yn.parseRequestState(this.browserCrypto,p).userRequestState,[2,y.acquireToken(K(K({},s),{state:w,prompt:void 0})).finally(function(){U.browserStorage.cleanRequestByState(p)})]}return[4,f.handleCodeResponseFromHash(x,p,l.authority,this.networkClient)];case 7:return A=N.sent(),[2,A];case 8:throw O=N.sent(),o&&o.close(),O instanceof W&&O.setCorrelationId(this.correlationId),a.cacheFailedRequest(O),this.browserStorage.cleanRequestByState(s.state),O;case 9:return[2]}})})},e.prototype.logoutPopupAsync=function(r,n,i,o,a,s){return S(this,void 0,void 0,function(){var c,l,d,h,u,f,v;return k(this,function(g){switch(g.label){case 0:this.logger.verbose("logoutPopupAsync called"),this.eventHandler.emitEvent(J.LOGOUT_START,G.Popup,r),c=this.initializeServerTelemetryManager(He.logoutPopup),g.label=1;case 1:return g.trys.push([1,5,,6]),[4,this.clearCacheOnLogout(r.account)];case 2:return g.sent(),[4,this.createAuthCodeClient(c,o)];case 3:return l=g.sent(),this.logger.verbose("Auth code client created"),d=l.getLogoutUri(r),this.eventHandler.emitEvent(J.LOGOUT_SUCCESS,G.Popup,r),h=this.openPopup(d,{popupName:n,popupWindowAttributes:i,popup:a}),this.eventHandler.emitEvent(J.POPUP_OPENED,G.Popup,{popupWindow:h},null),[4,this.waitForLogoutPopup(h)];case 4:return g.sent(),s?(u={apiId:He.logoutPopup,timeout:this.config.system.redirectNavigationTimeout,noHistory:!1},f=be.getAbsoluteUrl(s,Je.getCurrentUri()),this.logger.verbose("Redirecting main window to url specified in the request"),this.logger.verbosePii("Redirecting main window to: "+f),this.navigationClient.navigateInternal(f,u)):this.logger.verbose("No main window navigation requested"),[3,6];case 5:throw v=g.sent(),a&&a.close(),v instanceof W&&v.setCorrelationId(this.correlationId),this.browserStorage.setInteractionInProgress(!1),this.eventHandler.emitEvent(J.LOGOUT_FAILURE,G.Popup,null,v),this.eventHandler.emitEvent(J.LOGOUT_END,G.Popup),c.cacheFailedRequest(v),v;case 6:return this.eventHandler.emitEvent(J.LOGOUT_END,G.Popup),[2]}})})},e.prototype.initiateAuthRequest=function(r,n){if(V.isEmpty(r))throw this.logger.error("Navigate url is empty"),D.createEmptyNavigationUriError();return this.logger.infoPii("Navigate to: "+r),this.openPopup(r,n)},e.prototype.monitorPopupForHash=function(r){var n=this;return new Promise(function(i,o){var a=n.config.system.windowHashTimeout/n.config.system.pollIntervalMilliseconds,s=0;n.logger.verbose("PopupHandler.monitorPopupForHash - polling started");var c=setInterval(function(){if(r.closed){n.logger.error("PopupHandler.monitorPopupForHash - window closed"),n.cleanPopup(),clearInterval(c),o(D.createUserCancelledError());return}var l=_.EMPTY_STRING,d=_.EMPTY_STRING;try{l=r.location.href,d=r.location.hash}catch{}V.isEmpty(l)||l==="about:blank"||(n.logger.verbose("PopupHandler.monitorPopupForHash - popup window is on same origin as caller"),s++,d?(n.logger.verbose("PopupHandler.monitorPopupForHash - found hash in url"),clearInterval(c),n.cleanPopup(r),be.hashContainsKnownProperties(d)?(n.logger.verbose("PopupHandler.monitorPopupForHash - hash contains known properties, returning."),i(d)):(n.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."),n.logger.errorPii("PopupHandler.monitorPopupForHash - hash found: "+d),o(D.createHashDoesNotContainKnownPropertiesError()))):s>a&&(n.logger.error("PopupHandler.monitorPopupForHash - unable to find hash in url, timing out"),clearInterval(c),o(D.createMonitorPopupTimeoutError())))},n.config.system.pollIntervalMilliseconds)})},e.prototype.waitForLogoutPopup=function(r){var n=this;return new Promise(function(i){n.logger.verbose("PopupHandler.waitForLogoutPopup - polling started");var o=setInterval(function(){r.closed&&(n.logger.error("PopupHandler.waitForLogoutPopup - window closed"),n.cleanPopup(),clearInterval(o),i());var a=_.EMPTY_STRING;try{a=r.location.href}catch{}V.isEmpty(a)||a==="about:blank"||(n.logger.verbose("PopupHandler.waitForLogoutPopup - popup window is on same origin as caller, closing."),clearInterval(o),n.cleanPopup(r),i())},n.config.system.pollIntervalMilliseconds)})},e.prototype.openPopup=function(r,n){try{var i=void 0;if(n.popup?(i=n.popup,this.logger.verbosePii("Navigating popup window to: "+r),i.location.assign(r)):typeof n.popup>"u"&&(this.logger.verbosePii("Opening popup window to: "+r),i=this.openSizedPopup(r,n.popupName,n.popupWindowAttributes)),!i)throw D.createEmptyWindowCreatedError();return i.focus&&i.focus(),this.currentWindow=i,window.addEventListener("beforeunload",this.unloadWindow),i}catch(o){throw this.logger.error("error opening popup "+o.message),this.browserStorage.setInteractionInProgress(!1),D.createPopupWindowError(o.toString())}},e.prototype.openSizedPopup=function(r,n,i){var o,a,s,c,l=window.screenLeft?window.screenLeft:window.screenX,d=window.screenTop?window.screenTop:window.screenY,h=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,u=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight,f=(o=i.popupSize)===null||o===void 0?void 0:o.width,v=(a=i.popupSize)===null||a===void 0?void 0:a.height,g=(s=i.popupPosition)===null||s===void 0?void 0:s.top,x=(c=i.popupPosition)===null||c===void 0?void 0:c.left;return(!f||f<0||f>h)&&(this.logger.verbose("Default popup window width used. Window width not configured or invalid."),f=rn.POPUP_WIDTH),(!v||v<0||v>u)&&(this.logger.verbose("Default popup window height used. Window height not configured or invalid."),v=rn.POPUP_HEIGHT),(!g||g<0||g>u)&&(this.logger.verbose("Default popup window top position used. Window top not configured or invalid."),g=Math.max(0,u/2-rn.POPUP_HEIGHT/2+d)),(!x||x<0||x>h)&&(this.logger.verbose("Default popup window left position used. Window left not configured or invalid."),x=Math.max(0,h/2-rn.POPUP_WIDTH/2+l)),window.open(r,n,"width="+f+", height="+v+", top="+g+", left="+x+", scrollbars=yes")},e.prototype.unloadWindow=function(r){this.browserStorage.cleanRequestByInteractionType(G.Popup),this.currentWindow&&this.currentWindow.close(),r.preventDefault()},e.prototype.cleanPopup=function(r){r&&r.close(),window.removeEventListener("beforeunload",this.unloadWindow),this.browserStorage.setInteractionInProgress(!1)},e.prototype.generatePopupName=function(r,n){return rn.POPUP_NAME_PREFIX+"."+this.config.auth.clientId+"."+r.join("-")+"."+n+"."+this.correlationId},e.prototype.generateLogoutPopupName=function(r){var n=r.account&&r.account.homeAccountId;return rn.POPUP_NAME_PREFIX+"."+this.config.auth.clientId+"."+n+"."+this.correlationId},e}($a);var L_=function(){function t(){}return t.prototype.navigateInternal=function(e,r){return t.defaultNavigateWindow(e,r)},t.prototype.navigateExternal=function(e,r){return t.defaultNavigateWindow(e,r)},t.defaultNavigateWindow=function(e,r){return r.noHistory?window.location.replace(e):window.location.assign(e),new Promise(function(n){setTimeout(function(){n(!0)},r.timeout)})},t}();var O_=6e4,p2=6e3,D_=3e4,N_=2e3;function V_(t,e){var r=t.auth,n=t.cache,i=t.system,o=t.telemetry,a={clientId:_.EMPTY_STRING,authority:""+_.DEFAULT_AUTHORITY,knownAuthorities:[],cloudDiscoveryMetadata:_.EMPTY_STRING,authorityMetadata:_.EMPTY_STRING,redirectUri:_.EMPTY_STRING,postLogoutRedirectUri:_.EMPTY_STRING,navigateToLoginRequestUrl:!0,clientCapabilities:[],protocolMode:qd.AAD,azureCloudOptions:{azureCloudInstance:dc.None,tenant:_.EMPTY_STRING},skipAuthorityMetadataCache:!1},s={cacheLocation:Ut.SessionStorage,storeAuthStateInCookie:!1,secureCookies:!1},c={loggerCallback:function(){},logLevel:tt.Info,piiLoggingEnabled:!1},l=K(K({},e3),{loggerOptions:c,networkClient:e?Je.getBrowserNetworkClient():E_,navigationClient:new L_,loadFrameTimeout:0,windowHashTimeout:(i==null?void 0:i.loadFrameTimeout)||O_,iframeHashTimeout:(i==null?void 0:i.loadFrameTimeout)||p2,navigateFrameWait:e&&Je.detectIEOrEdge()?500:0,redirectNavigationTimeout:D_,asyncPopups:!1,allowRedirectInIframe:!1,allowNativeBroker:!1,nativeBrokerHandshakeTimeout:(i==null?void 0:i.nativeBrokerHandshakeTimeout)||N_,pollIntervalMilliseconds:rn.DEFAULT_POLL_INTERVAL_MS,cryptoOptions:{useMsrCrypto:!1,entropy:void 0}}),d={application:{appName:_.EMPTY_STRING,appVersion:_.EMPTY_STRING}},h={auth:K(K({},a),r),cache:K(K({},s),n),system:K(K({},l),i),telemetry:K(K({},d),o)};return h}var c3=function(t){It(e,t);function e(r,n,i,o,a){var s=t.call(this,r,n,i,o)||this;return s.navigateFrameWait=a.navigateFrameWait,s.pollIntervalMilliseconds=a.pollIntervalMilliseconds,s}return e.prototype.initiateAuthRequest=function(r){return S(this,void 0,void 0,function(){var n;return k(this,function(i){switch(i.label){case 0:if(V.isEmpty(r))throw this.logger.info("Navigate url is empty"),D.createEmptyNavigationUriError();return this.navigateFrameWait?[4,this.loadFrame(r)]:[3,2];case 1:return n=i.sent(),[3,3];case 2:n=this.loadFrameSync(r),i.label=3;case 3:return[2,n]}})})},e.prototype.monitorIframeForHash=function(r,n){var i=this;return new Promise(function(o,a){n<p2&&i.logger.warning("system.loadFrameTimeout or system.iframeHashTimeout set to lower ("+n+"ms) than the default ("+p2+"ms). This may result in timeouts.");var s=window.performance.now(),c=s+n,l=setInterval(function(){if(window.performance.now()>c){i.removeHiddenIframe(r),clearInterval(l),a(D.createMonitorIframeTimeoutError());return}var d=_.EMPTY_STRING,h=r.contentWindow;try{d=h?h.location.href:_.EMPTY_STRING}catch{}if(!V.isEmpty(d)){var u=h?h.location.hash:_.EMPTY_STRING;if(be.hashContainsKnownProperties(u)){i.removeHiddenIframe(r),clearInterval(l),o(u);return}}},i.pollIntervalMilliseconds)})},e.prototype.loadFrame=function(r){var n=this;return new Promise(function(i,o){var a=n.createHiddenIframe();setTimeout(function(){if(!a){o("Unable to load iframe");return}a.src=r,i(a)},n.navigateFrameWait)})},e.prototype.loadFrameSync=function(r){var n=this.createHiddenIframe();return n.src=r,n},e.prototype.createHiddenIframe=function(){var r=document.createElement("iframe");return r.style.visibility="hidden",r.style.position="absolute",r.style.width=r.style.height="0",r.style.border="0",r.setAttribute("sandbox","allow-scripts allow-same-origin allow-forms"),document.getElementsByTagName("body")[0].appendChild(r),r},e.prototype.removeHiddenIframe=function(r){document.body===r.parentNode&&document.body.removeChild(r)},e}(n0);var F_=function(t){It(e,t);function e(r,n,i,o,a,s,c,l,d,h,u){var f=t.call(this,r,n,i,o,a,s,l,h,u)||this;return f.apiId=c,f.nativeStorage=d,f}return e.prototype.acquireToken=function(r){return S(this,void 0,void 0,function(){var n,i,o,a,s;return k(this,function(c){switch(c.label){case 0:if(this.logger.verbose("acquireTokenByIframe called"),n=this.performanceClient.startMeasurement(pt.SilentIframeClientAcquireToken,r.correlationId),V.isEmpty(r.loginHint)&&V.isEmpty(r.sid)&&(!r.account||V.isEmpty(r.account.username))&&this.logger.warning("No user hint provided. The authorization server may need more information to complete this request."),r.prompt&&r.prompt!==jt.NONE&&r.prompt!==jt.NO_SESSION)throw n.endMeasurement({success:!1}),D.createSilentPromptValueError(r.prompt);return[4,this.initializeAuthorizationRequest(K(K({},r),{prompt:r.prompt||jt.NONE}),G.Silent)];case 1:i=c.sent(),this.browserStorage.updateCacheEntries(i.state,i.nonce,i.authority,i.loginHint||_.EMPTY_STRING,i.account||null),o=this.initializeServerTelemetryManager(this.apiId),c.label=2;case 2:return c.trys.push([2,5,,6]),[4,this.createAuthCodeClient(o,i.authority,i.azureCloudOptions)];case 3:return a=c.sent(),this.logger.verbose("Auth code client created"),[4,this.silentTokenHelper(a,i).then(function(l){return n.endMeasurement({success:!0,fromCache:!1,requestId:l.requestId}),l})];case 4:return[2,c.sent()];case 5:throw s=c.sent(),s instanceof W&&s.setCorrelationId(this.correlationId),o.cacheFailedRequest(s),this.browserStorage.cleanRequestByState(i.state),n.endMeasurement({errorCode:s instanceof W&&s.errorCode||void 0,subErrorCode:s instanceof W&&s.subError||void 0,success:!1}),s;case 6:return[2]}})})},e.prototype.logout=function(){return Promise.reject(D.createSilentLogoutUnsupportedError())},e.prototype.silentTokenHelper=function(r,n){return S(this,void 0,void 0,function(){var i,o,a,s,c,l,d,h,u,f=this;return k(this,function(v){switch(v.label){case 0:return[4,this.initializeAuthorizationCodeRequest(n)];case 1:return i=v.sent(),[4,r.getAuthCodeUrl(K(K({},n),{nativeBroker:vo.isNativeAvailable(this.config,this.logger,this.nativeMessageHandler,n.authenticationScheme)}))];case 2:return o=v.sent(),a=new c3(r,this.browserStorage,i,this.logger,this.config.system),[4,a.initiateAuthRequest(o)];case 3:return s=v.sent(),[4,a.monitorIframeForHash(s,this.config.system.iframeHashTimeout)];case 4:if(c=v.sent(),l=be.getDeserializedHash(c),d=this.validateAndExtractStateFromHash(l,G.Silent,i.correlationId),l.accountId){if(this.logger.verbose("Account id found in hash, calling WAM for token"),!this.nativeMessageHandler)throw D.createNativeConnectionNotEstablishedError();return h=new xa(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,this.apiId,this.performanceClient,this.nativeMessageHandler,l.accountId,this.browserStorage,this.correlationId),u=Yn.parseRequestState(this.browserCrypto,d).userRequestState,[2,h.acquireToken(K(K({},n),{state:u,prompt:n.prompt||jt.NONE})).finally(function(){f.browserStorage.cleanRequestByState(d)})]}return[2,a.handleCodeResponseFromHash(c,d,r.authority,this.networkClient)]}})})},e}($a);var U_=function(t){It(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.acquireToken=function(r){return S(this,void 0,void 0,function(){var n,i,o,a,s,c=this;return k(this,function(l){switch(l.label){case 0:return i=[K({},r)],[4,this.initializeBaseRequest(r)];case 1:return n=K.apply(void 0,i.concat([l.sent()])),o=this.performanceClient.startMeasurement(pt.SilentRefreshClientAcquireToken,n.correlationId),a=this.initializeServerTelemetryManager(He.acquireTokenSilent_silentFlow),[4,this.createRefreshTokenClient(a,n.authority,n.azureCloudOptions)];case 2:return s=l.sent(),this.logger.verbose("Refresh token client created"),[2,s.acquireTokenByRefreshToken(n).then(function(d){return o.endMeasurement({success:!0,fromCache:d.fromCache,requestId:d.requestId}),d}).catch(function(d){throw d instanceof W&&d.setCorrelationId(c.correlationId),a.cacheFailedRequest(d),o.endMeasurement({errorCode:d.errorCode,subErrorCode:d.subError,success:!1}),d})]}})})},e.prototype.logout=function(){return Promise.reject(D.createSilentLogoutUnsupportedError())},e.prototype.createRefreshTokenClient=function(r,n,i){return S(this,void 0,void 0,function(){var o;return k(this,function(a){switch(a.label){case 0:return[4,this.getClientConfiguration(r,n,i)];case 1:return o=a.sent(),[2,new r3(o,this.performanceClient)]}})})},e}($a);var $_=function(){function t(e,r){this.eventCallbacks=new Map,this.logger=e,this.browserCrypto=r,this.listeningToStorageEvents=!1,this.handleAccountCacheChange=this.handleAccountCacheChange.bind(this)}return t.prototype.addEventCallback=function(e){if(typeof window<"u"){var r=this.browserCrypto.createNewGuid();return this.eventCallbacks.set(r,e),this.logger.verbose("Event callback registered with id: "+r),r}return null},t.prototype.removeEventCallback=function(e){this.eventCallbacks.delete(e),this.logger.verbose("Event callback "+e+" removed.")},t.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)))},t.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."))},t.prototype.emitEvent=function(e,r,n,i){var o=this;if(typeof window<"u"){var a={eventType:e,interactionType:r||null,payload:n||null,error:i||null,timestamp:Date.now()};this.logger.info("Emitting event: "+e),this.eventCallbacks.forEach(function(s,c){o.logger.verbose("Emitting event to callback "+c+": "+e),s.apply(null,[a])})}},t.prototype.handleAccountCacheChange=function(e){try{var r=e.newValue||e.oldValue;if(!r)return;var n=JSON.parse(r);if(typeof n!="object"||!kt.isAccountEntity(n))return;var i=Jr.toObject(new kt,n),o=i.getAccountInfo();!e.oldValue&&e.newValue?(this.logger.info("Account was added to cache in a different window"),this.emitEvent(J.ACCOUNT_ADDED,void 0,o)):!e.newValue&&e.oldValue&&(this.logger.info("Account was removed from cache in a different window"),this.emitEvent(J.ACCOUNT_REMOVED,void 0,o))}catch{return}},t}();var Nt=function(){function t(){}return t.decimalToHex=function(e){for(var r=e.toString(16);r.length<2;)r="0"+r;return r},t}();var l3=function(){function t(e){this.cryptoObj=e}return t.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,Nt.decimalToHex(e[0])+Nt.decimalToHex(e[1])+Nt.decimalToHex(e[2])+Nt.decimalToHex(e[3])+"-"+Nt.decimalToHex(e[4])+Nt.decimalToHex(e[5])+"-"+Nt.decimalToHex(e[6])+Nt.decimalToHex(e[7])+"-"+Nt.decimalToHex(e[8])+Nt.decimalToHex(e[9])+"-"+Nt.decimalToHex(e[10])+Nt.decimalToHex(e[11])+Nt.decimalToHex(e[12])+Nt.decimalToHex(e[13])+Nt.decimalToHex(e[14])+Nt.decimalToHex(e[15])}catch{for(var r="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx",n="0123456789abcdef",i=0,o=_.EMPTY_STRING,a=0;a<36;a++)r[a]!=="-"&&r[a]!=="4"&&(i=Math.random()*16|0),r[a]==="x"?o+=n[i]:r[a]==="y"?(i&=3,i|=8,o+=n[i]):o+=r[a];return o}},t.prototype.isGuid=function(e){var r=/^[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 r.test(e)},t}();var Qn=function(){function t(){}return t.stringToUtf8Arr=function(e){for(var r,n=0,i=e.length,o=0;o<i;o++)r=e.charCodeAt(o),n+=r<128?1:r<2048?2:r<65536?3:r<2097152?4:r<67108864?5:6;for(var a=new Uint8Array(n),s=0,c=0;s<n;c++)r=e.charCodeAt(c),r<128?a[s++]=r:r<2048?(a[s++]=192+(r>>>6),a[s++]=128+(r&63)):r<65536?(a[s++]=224+(r>>>12),a[s++]=128+(r>>>6&63),a[s++]=128+(r&63)):r<2097152?(a[s++]=240+(r>>>18),a[s++]=128+(r>>>12&63),a[s++]=128+(r>>>6&63),a[s++]=128+(r&63)):r<67108864?(a[s++]=248+(r>>>24),a[s++]=128+(r>>>18&63),a[s++]=128+(r>>>12&63),a[s++]=128+(r>>>6&63),a[s++]=128+(r&63)):(a[s++]=252+(r>>>30),a[s++]=128+(r>>>24&63),a[s++]=128+(r>>>18&63),a[s++]=128+(r>>>12&63),a[s++]=128+(r>>>6&63),a[s++]=128+(r&63));return a},t.stringToArrayBuffer=function(e){for(var r=new ArrayBuffer(e.length),n=new Uint8Array(r),i=0;i<e.length;i++)n[i]=e.charCodeAt(i);return r},t.utf8ArrToString=function(e){for(var r=_.EMPTY_STRING,n=void 0,i=e.length,o=0;o<i;o++)n=e[o],r+=String.fromCharCode(n>251&&n<254&&o+5<i?(n-252)*1073741824+(e[++o]-128<<24)+(e[++o]-128<<18)+(e[++o]-128<<12)+(e[++o]-128<<6)+e[++o]-128:n>247&&n<252&&o+4<i?(n-248<<24)+(e[++o]-128<<18)+(e[++o]-128<<12)+(e[++o]-128<<6)+e[++o]-128:n>239&&n<248&&o+3<i?(n-240<<18)+(e[++o]-128<<12)+(e[++o]-128<<6)+e[++o]-128:n>223&&n<240&&o+2<i?(n-224<<12)+(e[++o]-128<<6)+e[++o]-128:n>191&&n<224&&o+1<i?(n-192<<6)+e[++o]-128:n);return r},t.getSortedObjectString=function(e){return JSON.stringify(e,Object.keys(e).sort())},t}();var d3=function(){function t(){}return t.prototype.urlEncode=function(e){return encodeURIComponent(this.encode(e).replace(/=/g,_.EMPTY_STRING).replace(/\+/g,"-").replace(/\//g,"_"))},t.prototype.urlEncodeArr=function(e){return this.base64EncArr(e).replace(/=/g,_.EMPTY_STRING).replace(/\+/g,"-").replace(/\//g,"_")},t.prototype.encode=function(e){var r=Qn.stringToUtf8Arr(e);return this.base64EncArr(r)},t.prototype.base64EncArr=function(e){for(var r=(3-e.length%3)%3,n=_.EMPTY_STRING,i=void 0,o=e.length,a=0,s=0;s<o;s++)i=s%3,a|=e[s]<<(16>>>i&24),(i===2||e.length-s===1)&&(n+=String.fromCharCode(this.uint6ToB64(a>>>18&63),this.uint6ToB64(a>>>12&63),this.uint6ToB64(a>>>6&63),this.uint6ToB64(a&63)),a=0);return r===0?n:n.substring(0,n.length-r)+(r===1?"=":"==")},t.prototype.uint6ToB64=function(e){return e<26?e+65:e<52?e+71:e<62?e-4:e===62?43:e===63?47:65},t}();var j_=function(){function t(){}return t.prototype.decode=function(e){var r=e.replace(/-/g,"+").replace(/_/g,"/");switch(r.length%4){case 0:break;case 2:r+="==";break;case 3:r+="=";break;default:throw new Error("Invalid base64 string")}var n=this.base64DecToArr(r);return Qn.utf8ArrToString(n)},t.prototype.base64DecToArr=function(e,r){for(var n=e.replace(/[^A-Za-z0-9\+\/]/g,_.EMPTY_STRING),i=n.length,o=r?Math.ceil((i*3+1>>>2)/r)*r:i*3+1>>>2,a=new Uint8Array(o),s=void 0,c=void 0,l=0,d=0,h=0;h<i;h++)if(c=h&3,l|=this.b64ToUint6(n.charCodeAt(h))<<18-6*c,c===3||i-h===1){for(s=0;s<3&&d<o;s++,d++)a[d]=l>>>(16>>>s&24)&255;l=0}return a},t.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},t}();var B_=32,q_=function(){function t(e){this.base64Encode=new d3,this.cryptoObj=e}return t.prototype.generateCodes=function(){return S(this,void 0,void 0,function(){var e,r;return k(this,function(n){switch(n.label){case 0:return e=this.generateCodeVerifier(),[4,this.generateCodeChallengeFromVerifier(e)];case 1:return r=n.sent(),[2,{verifier:e,challenge:r}]}})})},t.prototype.generateCodeVerifier=function(){try{var e=new Uint8Array(B_);this.cryptoObj.getRandomValues(e);var r=this.base64Encode.urlEncodeArr(e);return r}catch(n){throw D.createPkceNotGeneratedError(n)}},t.prototype.generateCodeChallengeFromVerifier=function(e){return S(this,void 0,void 0,function(){var r,n;return k(this,function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),[4,this.cryptoObj.sha256Digest(e)];case 1:return r=i.sent(),[2,this.base64Encode.urlEncodeArr(new Uint8Array(r))];case 2:throw n=i.sent(),D.createPkceNotGeneratedError(n);case 3:return[2]}})})},t}();var G_=function(){function t(){}return t.prototype.getRandomValues=function(e){return window.crypto.getRandomValues(e)},t.prototype.generateKey=function(e,r,n){return S(this,void 0,void 0,function(){return k(this,function(i){return[2,window.crypto.subtle.generateKey(e,r,n)]})})},t.prototype.exportKey=function(e){return S(this,void 0,void 0,function(){return k(this,function(r){return[2,window.crypto.subtle.exportKey(Ra,e)]})})},t.prototype.importKey=function(e,r,n,i){return S(this,void 0,void 0,function(){return k(this,function(o){return[2,window.crypto.subtle.importKey(Ra,e,r,n,i)]})})},t.prototype.sign=function(e,r,n){return S(this,void 0,void 0,function(){return k(this,function(i){return[2,window.crypto.subtle.sign(e,r,n)]})})},t.prototype.digest=function(e,r){return S(this,void 0,void 0,function(){return k(this,function(n){return[2,window.crypto.subtle.digest(e,r)]})})},t}();var K_=function(){function t(){}return t.prototype.initPrng=function(e){return window.msrCrypto.initPrng(e0(e))},t.prototype.getRandomValues=function(e){return window.msrCrypto.getRandomValues(e)},t.prototype.generateKey=function(e,r,n){return S(this,void 0,void 0,function(){return k(this,function(i){return[2,window.msrCrypto.subtle.generateKey(e,r,n)]})})},t.prototype.exportKey=function(e){return S(this,void 0,void 0,function(){return k(this,function(r){return[2,window.msrCrypto.subtle.exportKey(Ra,e)]})})},t.prototype.importKey=function(e,r,n,i){return S(this,void 0,void 0,function(){return k(this,function(o){return[2,window.msrCrypto.subtle.importKey(Ra,e,r,n,i)]})})},t.prototype.sign=function(e,r,n){return S(this,void 0,void 0,function(){return k(this,function(i){return[2,window.msrCrypto.subtle.sign(e,r,n)]})})},t.prototype.digest=function(e,r){return S(this,void 0,void 0,function(){return k(this,function(n){return[2,window.msrCrypto.subtle.digest(e,r)]})})},t}();var W_=function(){function t(){}return t.prototype.getRandomValues=function(e){return window.msCrypto.getRandomValues(e)},t.prototype.generateKey=function(e,r,n){return S(this,void 0,void 0,function(){return k(this,function(i){return[2,new Promise(function(o,a){var s=window.msCrypto.subtle.generateKey(e,r,n);s.addEventListener("complete",function(c){o(c.target.result)}),s.addEventListener("error",function(c){a(c)})})]})})},t.prototype.exportKey=function(e){return S(this,void 0,void 0,function(){return k(this,function(r){return[2,new Promise(function(n,i){var o=window.msCrypto.subtle.exportKey(Ra,e);o.addEventListener("complete",function(a){var s=a.target.result,c=Qn.utf8ArrToString(new Uint8Array(s)).replace(/\r/g,_.EMPTY_STRING).replace(/\n/g,_.EMPTY_STRING).replace(/\t/g,_.EMPTY_STRING).split(" ").join(_.EMPTY_STRING).replace("\0",_.EMPTY_STRING);try{n(JSON.parse(c))}catch(l){i(l)}}),o.addEventListener("error",function(a){i(a)})})]})})},t.prototype.importKey=function(e,r,n,i){return S(this,void 0,void 0,function(){var o,a;return k(this,function(s){return o=Qn.getSortedObjectString(e),a=Qn.stringToArrayBuffer(o),[2,new Promise(function(c,l){var d=window.msCrypto.subtle.importKey(Ra,a,r,n,i);d.addEventListener("complete",function(h){c(h.target.result)}),d.addEventListener("error",function(h){l(h)})})]})})},t.prototype.sign=function(e,r,n){return S(this,void 0,void 0,function(){return k(this,function(i){return[2,new Promise(function(o,a){var s=window.msCrypto.subtle.sign(e,r,n);s.addEventListener("complete",function(c){o(c.target.result)}),s.addEventListener("error",function(c){a(c)})})]})})},t.prototype.digest=function(e,r){return S(this,void 0,void 0,function(){return k(this,function(n){return[2,new Promise(function(i,o){var a=window.msCrypto.subtle.digest(e,r.buffer);a.addEventListener("complete",function(s){i(s.target.result)}),a.addEventListener("error",function(s){o(s)})})]})})},t}();var Y_="RSASSA-PKCS1-v1_5",mm="SHA-256",Q_=2048,X_=new Uint8Array([1,0,1]),h3=function(){function t(e,r){var n,i;if(this.logger=e,this.cryptoOptions=r,this.hasBrowserCrypto())this.logger.verbose("BrowserCrypto: modern crypto interface available"),this.subtleCrypto=new G_;else if(this.hasIECrypto())this.logger.verbose("BrowserCrypto: MS crypto interface available"),this.subtleCrypto=new W_;else if(this.hasMsrCrypto()&&((n=this.cryptoOptions)===null||n===void 0?void 0:n.useMsrCrypto))this.logger.verbose("BrowserCrypto: MSR crypto interface available"),this.subtleCrypto=new K_;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."),D.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."),Yd.createEntropyNotProvided();this.logger.verbose("BrowserCrypto: Entropy provided"),this.subtleCrypto.initPrng(this.cryptoOptions.entropy)}this.keygenAlgorithmOptions={name:Y_,hash:mm,modulusLength:Q_,publicExponent:X_}}return t.prototype.hasIECrypto=function(){return"msCrypto"in window},t.prototype.hasBrowserCrypto=function(){return"crypto"in window},t.prototype.hasMsrCrypto=function(){return"msrCrypto"in window},t.prototype.sha256Digest=function(e){return S(this,void 0,void 0,function(){var r;return k(this,function(n){return r=Qn.stringToUtf8Arr(e),[2,this.subtleCrypto.digest({name:mm},r)]})})},t.prototype.getRandomValues=function(e){return this.subtleCrypto.getRandomValues(e)},t.prototype.generateKeyPair=function(e,r){return S(this,void 0,void 0,function(){return k(this,function(n){return[2,this.subtleCrypto.generateKey(this.keygenAlgorithmOptions,e,r)]})})},t.prototype.exportJwk=function(e){return S(this,void 0,void 0,function(){return k(this,function(r){return[2,this.subtleCrypto.exportKey(e)]})})},t.prototype.importJwk=function(e,r,n){return S(this,void 0,void 0,function(){return k(this,function(i){return[2,this.subtleCrypto.importKey(e,this.keygenAlgorithmOptions,r,n)]})})},t.prototype.sign=function(e,r){return S(this,void 0,void 0,function(){return k(this,function(n){return[2,this.subtleCrypto.sign(this.keygenAlgorithmOptions,e,r)]})})},t}();var J_=function(){function t(){this.dbName=h2,this.version=A_,this.tableName=T_,this.dbOpen=!1}return t.prototype.open=function(){return S(this,void 0,void 0,function(){var e=this;return k(this,function(r){return[2,new Promise(function(n,i){var o=window.indexedDB.open(e.dbName,e.version);o.addEventListener("upgradeneeded",function(a){var s=a;s.target.result.createObjectStore(e.tableName)}),o.addEventListener("success",function(a){var s=a;e.db=s.target.result,e.dbOpen=!0,n()}),o.addEventListener("error",function(){return i(D.createDatabaseUnavailableError())})})]})})},t.prototype.closeConnection=function(){var e=this.db;e&&this.dbOpen&&(e.close(),this.dbOpen=!1)},t.prototype.validateDbIsOpen=function(){return S(this,void 0,void 0,function(){return k(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]}})})},t.prototype.getItem=function(e){return S(this,void 0,void 0,function(){var r=this;return k(this,function(n){switch(n.label){case 0:return[4,this.validateDbIsOpen()];case 1:return n.sent(),[2,new Promise(function(i,o){if(!r.db)return o(D.createDatabaseNotOpenError());var a=r.db.transaction([r.tableName],"readonly"),s=a.objectStore(r.tableName),c=s.get(e);c.addEventListener("success",function(l){var d=l;r.closeConnection(),i(d.target.result)}),c.addEventListener("error",function(l){r.closeConnection(),o(l)})})]}})})},t.prototype.setItem=function(e,r){return S(this,void 0,void 0,function(){var n=this;return k(this,function(i){switch(i.label){case 0:return[4,this.validateDbIsOpen()];case 1:return i.sent(),[2,new Promise(function(o,a){if(!n.db)return a(D.createDatabaseNotOpenError());var s=n.db.transaction([n.tableName],"readwrite"),c=s.objectStore(n.tableName),l=c.put(r,e);l.addEventListener("success",function(){n.closeConnection(),o()}),l.addEventListener("error",function(d){n.closeConnection(),a(d)})})]}})})},t.prototype.removeItem=function(e){return S(this,void 0,void 0,function(){var r=this;return k(this,function(n){switch(n.label){case 0:return[4,this.validateDbIsOpen()];case 1:return n.sent(),[2,new Promise(function(i,o){if(!r.db)return o(D.createDatabaseNotOpenError());var a=r.db.transaction([r.tableName],"readwrite"),s=a.objectStore(r.tableName),c=s.delete(e);c.addEventListener("success",function(){r.closeConnection(),i()}),c.addEventListener("error",function(l){r.closeConnection(),o(l)})})]}})})},t.prototype.getKeys=function(){return S(this,void 0,void 0,function(){var e=this;return k(this,function(r){switch(r.label){case 0:return[4,this.validateDbIsOpen()];case 1:return r.sent(),[2,new Promise(function(n,i){if(!e.db)return i(D.createDatabaseNotOpenError());var o=e.db.transaction([e.tableName],"readonly"),a=o.objectStore(e.tableName),s=a.getAllKeys();s.addEventListener("success",function(c){var l=c;e.closeConnection(),n(l.target.result)}),s.addEventListener("error",function(c){e.closeConnection(),i(c)})})]}})})},t.prototype.containsKey=function(e){return S(this,void 0,void 0,function(){var r=this;return k(this,function(n){switch(n.label){case 0:return[4,this.validateDbIsOpen()];case 1:return n.sent(),[2,new Promise(function(i,o){if(!r.db)return o(D.createDatabaseNotOpenError());var a=r.db.transaction([r.tableName],"readonly"),s=a.objectStore(r.tableName),c=s.count(e);c.addEventListener("success",function(l){var d=l;r.closeConnection(),i(d.target.result===1)}),c.addEventListener("error",function(l){r.closeConnection(),o(l)})})]}})})},t.prototype.deleteDatabase=function(){return S(this,void 0,void 0,function(){return k(this,function(e){return this.db&&this.dbOpen&&this.closeConnection(),[2,new Promise(function(r,n){var i=window.indexedDB.deleteDatabase(h2);i.addEventListener("success",function(){return r(!0)}),i.addEventListener("blocked",function(){return r(!0)}),i.addEventListener("error",function(){return n(!1)})})]})})},t}();var vm=function(){function t(e,r){this.inMemoryCache=new u2,this.indexedDBCache=new J_,this.logger=e,this.storeName=r}return t.prototype.handleDatabaseAccessError=function(e){if(e instanceof D&&e.errorCode===P.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},t.prototype.getItem=function(e){return S(this,void 0,void 0,function(){var r,n;return k(this,function(i){switch(i.label){case 0:if(r=this.inMemoryCache.getItem(e),r)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 n=i.sent(),this.handleDatabaseAccessError(n),[3,4];case 4:return[2,r]}})})},t.prototype.setItem=function(e,r){return S(this,void 0,void 0,function(){var n;return k(this,function(i){switch(i.label){case 0:this.inMemoryCache.setItem(e,r),i.label=1;case 1:return i.trys.push([1,3,,4]),[4,this.indexedDBCache.setItem(e,r)];case 2:return i.sent(),[3,4];case 3:return n=i.sent(),this.handleDatabaseAccessError(n),[3,4];case 4:return[2]}})})},t.prototype.removeItem=function(e){return S(this,void 0,void 0,function(){var r;return k(this,function(n){switch(n.label){case 0:this.inMemoryCache.removeItem(e),n.label=1;case 1:return n.trys.push([1,3,,4]),[4,this.indexedDBCache.removeItem(e)];case 2:return n.sent(),[3,4];case 3:return r=n.sent(),this.handleDatabaseAccessError(r),[3,4];case 4:return[2]}})})},t.prototype.getKeys=function(){return S(this,void 0,void 0,function(){var e,r;return k(this,function(n){switch(n.label){case 0:if(e=this.inMemoryCache.getKeys(),e.length!==0)return[3,4];n.label=1;case 1:return n.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,n.sent()];case 3:return r=n.sent(),this.handleDatabaseAccessError(r),[3,4];case 4:return[2,e]}})})},t.prototype.containsKey=function(e){return S(this,void 0,void 0,function(){var r,n;return k(this,function(i){switch(i.label){case 0:if(r=this.inMemoryCache.containsKey(e),r)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 n=i.sent(),this.handleDatabaseAccessError(n),[3,4];case 4:return[2,r]}})})},t.prototype.clearInMemory=function(){this.logger.verbose("Deleting in-memory keystore "+this.storeName),this.inMemoryCache.clear(),this.logger.verbose("In-memory keystore "+this.storeName+" deleted")},t.prototype.clearPersistent=function(){return S(this,void 0,void 0,function(){var e,r;return k(this,function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),this.logger.verbose("Deleting persistent keystore"),[4,this.indexedDBCache.deleteDatabase()];case 1:return e=n.sent(),e&&this.logger.verbose("Persistent keystore deleted"),[2,e];case 2:return r=n.sent(),this.handleDatabaseAccessError(r),[2,!1];case 3:return[2]}})})},t}();var Qd;(function(t){t.asymmetricKeys="asymmetricKeys",t.symmetricKeys="symmetricKeys"})(Qd||(Qd={}));var Z_=function(){function t(e){this.logger=e,this.asymmetricKeys=new vm(this.logger,Qd.asymmetricKeys),this.symmetricKeys=new vm(this.logger,Qd.symmetricKeys)}return t.prototype.clear=function(){return S(this,void 0,void 0,function(){var e;return k(this,function(r){switch(r.label){case 0:this.asymmetricKeys.clearInMemory(),this.symmetricKeys.clearInMemory(),r.label=1;case 1:return r.trys.push([1,3,,4]),[4,this.asymmetricKeys.clearPersistent()];case 2:return r.sent(),[2,!0];case 3:return e=r.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]}})})},t}();var eb=function(){function t(e,r,n){this.logger=e,this.browserCrypto=new h3(this.logger,n),this.b64Encode=new d3,this.b64Decode=new j_,this.guidGenerator=new l3(this.browserCrypto),this.pkceGenerator=new q_(this.browserCrypto),this.cache=new Z_(this.logger),this.performanceClient=r}return t.prototype.createNewGuid=function(){return this.guidGenerator.generateGuid()},t.prototype.base64Encode=function(e){return this.b64Encode.encode(e)},t.prototype.base64Decode=function(e){return this.b64Decode.decode(e)},t.prototype.generatePkceCodes=function(){return S(this,void 0,void 0,function(){return k(this,function(e){return[2,this.pkceGenerator.generateCodes()]})})},t.prototype.getPublicKeyThumbprint=function(e){var r;return S(this,void 0,void 0,function(){var n,i,o,a,s,c,l,d;return k(this,function(h){switch(h.label){case 0:return n=(r=this.performanceClient)===null||r===void 0?void 0:r.startMeasurement(pt.CryptoOptsGetPublicKeyThumbprint,e.correlationId),[4,this.browserCrypto.generateKeyPair(t.EXTRACTABLE,t.POP_KEY_USAGES)];case 1:return i=h.sent(),[4,this.browserCrypto.exportJwk(i.publicKey)];case 2:return o=h.sent(),a={e:o.e,kty:o.kty,n:o.n},s=Qn.getSortedObjectString(a),[4,this.hashString(s)];case 3:return c=h.sent(),[4,this.browserCrypto.exportJwk(i.privateKey)];case 4:return l=h.sent(),[4,this.browserCrypto.importJwk(l,!1,["sign"])];case 5:return d=h.sent(),[4,this.cache.asymmetricKeys.setItem(c,{privateKey:d,publicKey:i.publicKey,requestMethod:e.resourceRequestMethod,requestUri:e.resourceRequestUri})];case 6:return h.sent(),n&&n.endMeasurement({success:!0}),[2,c]}})})},t.prototype.removeTokenBindingKey=function(e){return S(this,void 0,void 0,function(){var r;return k(this,function(n){switch(n.label){case 0:return[4,this.cache.asymmetricKeys.removeItem(e)];case 1:return n.sent(),[4,this.cache.asymmetricKeys.containsKey(e)];case 2:return r=n.sent(),[2,!r]}})})},t.prototype.clearKeystore=function(){return S(this,void 0,void 0,function(){return k(this,function(e){switch(e.label){case 0:return[4,this.cache.clear()];case 1:return[2,e.sent()]}})})},t.prototype.signJwt=function(e,r,n){var i;return S(this,void 0,void 0,function(){var o,a,s,c,l,d,h,u,f,v,g,x,m;return k(this,function(p){switch(p.label){case 0:return o=(i=this.performanceClient)===null||i===void 0?void 0:i.startMeasurement(pt.CryptoOptsSignJwt,n),[4,this.cache.asymmetricKeys.getItem(r)];case 1:if(a=p.sent(),!a)throw D.createSigningKeyNotFoundInStorageError(r);return[4,this.browserCrypto.exportJwk(a.publicKey)];case 2:return s=p.sent(),c=Qn.getSortedObjectString(s),l=this.b64Encode.urlEncode(JSON.stringify({kid:r})),d=C_.getShrHeaderString({kid:l,alg:s.alg}),h=this.b64Encode.urlEncode(d),e.cnf={jwk:JSON.parse(c)},u=this.b64Encode.urlEncode(JSON.stringify(e)),f=h+"."+u,v=Qn.stringToArrayBuffer(f),[4,this.browserCrypto.sign(a.privateKey,v)];case 3:return g=p.sent(),x=this.b64Encode.urlEncodeArr(new Uint8Array(g)),m=f+"."+x,o&&o.endMeasurement({success:!0}),[2,m]}})})},t.prototype.hashString=function(e){return S(this,void 0,void 0,function(){var r,n;return k(this,function(i){switch(i.label){case 0:return[4,this.browserCrypto.sha256Digest(e)];case 1:return r=i.sent(),n=new Uint8Array(r),[2,this.b64Encode.urlEncodeArr(n)]}})})},t.POP_KEY_USAGES=["sign","verify"],t.EXTRACTABLE=!0,t}();var tb=function(){function t(e,r,n,i){this.isBrowserEnvironment=typeof window<"u",this.config=e,this.storage=r,this.logger=n,this.cryptoObj=i}return t.prototype.loadExternalTokens=function(e,r,n){if(this.logger.info("TokenCache - loadExternalTokens called"),!r.id_token)throw D.createUnableToLoadTokenError("Please ensure server response includes id token.");var i=new Tn(r.id_token,this.cryptoObj),o,a;if(e.account){var s=this.loadAccount(i,e.account.environment,void 0,void 0,e.account.homeAccountId);o=new Bl(s,this.loadIdToken(i,s.homeAccountId,e.account.environment,e.account.tenantId),this.loadAccessToken(e,r,s.homeAccountId,e.account.environment,e.account.tenantId,n),this.loadRefreshToken(e,r,s.homeAccountId,e.account.environment))}else if(e.authority){var c=Gd.generateAuthority(e.authority,e.azureCloudOptions),l={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(a=new Gd(c,this.config.system.networkClient,this.storage,l,this.logger),n.clientInfo){this.logger.trace("TokenCache - homeAccountId from options");var s=this.loadAccount(i,a.hostnameAndPort,n.clientInfo,a.authorityType);o=new Bl(s,this.loadIdToken(i,s.homeAccountId,a.hostnameAndPort,a.tenant),this.loadAccessToken(e,r,s.homeAccountId,a.hostnameAndPort,a.tenant,n),this.loadRefreshToken(e,r,s.homeAccountId,a.hostnameAndPort))}else if(r.client_info){this.logger.trace("TokenCache - homeAccountId from response");var s=this.loadAccount(i,a.hostnameAndPort,r.client_info,a.authorityType);o=new Bl(s,this.loadIdToken(i,s.homeAccountId,a.hostnameAndPort,a.tenant),this.loadAccessToken(e,r,s.homeAccountId,a.hostnameAndPort,a.tenant,n),this.loadRefreshToken(e,r,s.homeAccountId,a.hostnameAndPort))}else throw D.createUnableToLoadTokenError("Please provide clientInfo in the response or options.")}else throw D.createUnableToLoadTokenError("Please provide a request with an account or a request with authority.");return this.generateAuthenticationResult(e,i,o,a)},t.prototype.loadAccount=function(e,r,n,i,o){var a;if(o?a=o:i!==void 0&&n&&(a=kt.generateHomeAccountId(n,i,this.logger,this.cryptoObj,e)),!a)throw D.createUnableToLoadTokenError("Unexpected missing homeAccountId");var s=n?kt.createAccount(n,a,e,void 0,void 0,void 0,r):kt.createGenericAccount(a,e,void 0,void 0,void 0,r);if(this.isBrowserEnvironment)return this.logger.verbose("TokenCache - loading account"),this.storage.setAccount(s),s;throw D.createUnableToLoadTokenError("loadExternalTokens is designed to work in browser environments only.")},t.prototype.loadIdToken=function(e,r,n,i){var o=uc.createIdTokenEntity(r,n,e.rawToken,this.config.auth.clientId,i);if(this.isBrowserEnvironment)return this.logger.verbose("TokenCache - loading id token"),this.storage.setIdTokenCredential(o),o;throw D.createUnableToLoadTokenError("loadExternalTokens is designed to work in browser environments only.")},t.prototype.loadAccessToken=function(e,r,n,i,o,a){if(!r.access_token)return this.logger.verbose("TokenCache - No access token provided for caching"),null;if(!r.expires_in)throw D.createUnableToLoadTokenError("Please ensure server response includes expires_in value.");if(!a.extendedExpiresOn)throw D.createUnableToLoadTokenError("Please provide an extendedExpiresOn value in the options.");var s=new er(e.scopes).printScopes(),c=a.expiresOn||r.expires_in+new Date().getTime()/1e3,l=a.extendedExpiresOn,d=fc.createAccessTokenEntity(n,i,r.access_token,this.config.auth.clientId,o,s,c,l,this.cryptoObj);if(this.isBrowserEnvironment)return this.logger.verbose("TokenCache - loading access token"),this.storage.setAccessTokenCredential(d),d;throw D.createUnableToLoadTokenError("loadExternalTokens is designed to work in browser environments only.")},t.prototype.loadRefreshToken=function(e,r,n,i){if(!r.refresh_token)return this.logger.verbose("TokenCache - No refresh token provided for caching"),null;var o=jd.createRefreshTokenEntity(n,i,r.refresh_token,this.config.auth.clientId);if(this.isBrowserEnvironment)return this.logger.verbose("TokenCache - loading refresh token"),this.storage.setRefreshTokenCredential(o),o;throw D.createUnableToLoadTokenError("loadExternalTokens is designed to work in browser environments only.")},t.prototype.generateAuthenticationResult=function(e,r,n,i){var o,a,s,c=_.EMPTY_STRING,l=[],d=null,h;n!=null&&n.accessToken&&(c=n.accessToken.secret,l=er.fromString(n.accessToken.target).asArray(),d=new Date(Number(n.accessToken.expiresOn)*1e3),h=new Date(Number(n.accessToken.extendedExpiresOn)*1e3));var u=(r==null?void 0:r.claims.oid)||(r==null?void 0:r.claims.sub)||_.EMPTY_STRING,f=(r==null?void 0:r.claims.tid)||_.EMPTY_STRING;return{authority:i?i.canonicalAuthority:_.EMPTY_STRING,uniqueId:u,tenantId:f,scopes:l,account:n!=null&&n.account?n.account.getAccountInfo():null,idToken:r?r.rawToken:_.EMPTY_STRING,idTokenClaims:r?r.claims:{},accessToken:c,fromCache:!0,expiresOn:d,correlationId:e.correlationId||_.EMPTY_STRING,requestId:_.EMPTY_STRING,extExpiresOn:h,familyId:_.EMPTY_STRING,tokenType:((o=n==null?void 0:n.accessToken)===null||o===void 0?void 0:o.tokenType)||_.EMPTY_STRING,state:_.EMPTY_STRING,cloudGraphHostName:((a=n==null?void 0:n.account)===null||a===void 0?void 0:a.cloudGraphHostName)||_.EMPTY_STRING,msGraphHost:((s=n==null?void 0:n.account)===null||s===void 0?void 0:s.msGraphHost)||_.EMPTY_STRING,code:void 0,fromNativeBroker:!1}},t}();var rb=function(t){It(e,t);function e(r){var n=t.call(this,r)||this;return n.includeRedirectUri=!1,n}return e}(t3);var nb=function(t){It(e,t);function e(r,n,i,o,a,s,c,l,d,h){var u=t.call(this,r,n,i,o,a,s,l,d,h)||this;return u.apiId=c,u}return e.prototype.acquireToken=function(r){return S(this,void 0,void 0,function(){var n,i,o,a,s,c,l;return k(this,function(d){switch(d.label){case 0:if(this.logger.trace("SilentAuthCodeClient.acquireToken called"),!r.code)throw D.createAuthCodeRequiredError();return[4,this.initializeAuthorizationRequest(r,G.Silent)];case 1:n=d.sent(),this.browserStorage.updateCacheEntries(n.state,n.nonce,n.authority,n.loginHint||_.EMPTY_STRING,n.account||null),i=this.initializeServerTelemetryManager(this.apiId),d.label=2;case 2:return d.trys.push([2,4,,5]),o=K(K({},n),{code:r.code}),[4,this.getClientConfiguration(i,n.authority)];case 3:return a=d.sent(),s=new rb(a),this.logger.verbose("Auth code client created"),c=new c3(s,this.browserStorage,o,this.logger,this.config.system),[2,c.handleCodeResponseFromServer({code:r.code,msgraph_host:r.msGraphHost,cloud_graph_host_name:r.cloudGraphHostName,cloud_instance_host_name:r.cloudInstanceHostName},n.state,s.authority,this.networkClient,!1)];case 4:throw l=d.sent(),l instanceof W&&l.setCorrelationId(this.correlationId),i.cacheFailedRequest(l),this.browserStorage.cleanRequestByState(n.state),l;case 5:return[2]}})})},e.prototype.logout=function(){return Promise.reject(D.createSilentLogoutUnsupportedError())},e}($a);var ib=function(){function t(e,r){this.correlationId=r,this.measureName="msal.measure."+e+"."+this.correlationId,this.startMark="msal.start."+e+"."+this.correlationId,this.endMark="msal.end."+e+"."+this.correlationId}return t.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"},t.prototype.startMeasurement=function(){if(t.supportsBrowserPerformance())try{window.performance.mark(this.startMark)}catch{}},t.prototype.endMeasurement=function(){if(t.supportsBrowserPerformance())try{window.performance.mark(this.endMark),window.performance.measure(this.measureName,this.startMark,this.endMark)}catch{}},t.prototype.flushMeasurement=function(){if(t.supportsBrowserPerformance())try{var e=window.performance.getEntriesByName(this.measureName,"measure");if(e.length>0){var r=e[0].duration;return window.performance.clearMeasures(this.measureName),window.performance.clearMarks(this.startMark),window.performance.clearMarks(this.endMark),r}}catch{}return null},t}();var ob=function(t){It(e,t);function e(r,n,i,o,a,s,c){var l=t.call(this,r,n,i,o,a,s)||this;return l.browserCrypto=new h3(l.logger,c),l.guidGenerator=new l3(l.browserCrypto),l}return e.prototype.startPerformanceMeasuremeant=function(r,n){return new ib(r,n)},e.prototype.generateId=function(){return this.guidGenerator.generateGuid()},e.prototype.getPageVisibility=function(){var r;return((r=document.visibilityState)===null||r===void 0?void 0:r.toString())||null},e.prototype.startMeasurement=function(r,n){var i=this,o=this.getPageVisibility(),a=t.prototype.startMeasurement.call(this,r,n);return K(K({},a),{endMeasurement:function(s){return a.endMeasurement(K({startPageVisibility:o,endPageVisibility:i.getPageVisibility()},s))}})},e}(i3);var ab=function(){function t(e){this.isBrowserEnvironment=typeof window<"u",this.config=V_(e,this.isBrowserEnvironment),this.initialized=!1,this.logger=new t0(this.config.system.loggerOptions,wh,Us),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 ob(this.config.auth.clientId,this.config.auth.authority,this.logger,wh,Us,this.config.telemetry.application,this.config.system.cryptoOptions):new k_(this.config.auth.clientId,this.config.auth.authority,this.logger,wh,Us,this.config.telemetry.application),this.browserCrypto=this.isBrowserEnvironment?new eb(this.logger,this.performanceClient,this.config.system.cryptoOptions):Fd,this.eventHandler=new $_(this.logger,this.browserCrypto),this.browserStorage=this.isBrowserEnvironment?new f2(this.config.auth.clientId,this.config.cache,this.browserCrypto,this.logger):I_(this.config.auth.clientId,this.logger);var r={cacheLocation:Ut.MemoryStorage,storeAuthStateInCookie:!1,secureCookies:!1};this.nativeInternalStorage=new f2(this.config.auth.clientId,r,this.browserCrypto,this.logger),this.tokenCache=new tb(this.config,this.browserStorage,this.logger,this.browserCrypto)}return t.prototype.initialize=function(){return S(this,void 0,void 0,function(){var e,r;return k(this,function(n){switch(n.label){case 0:if(this.logger.trace("initialize called"),this.initialized)return this.logger.info("initialize has already been called, exiting early."),[2];if(this.eventHandler.emitEvent(J.INITIALIZE_START),!this.config.system.allowNativeBroker)return[3,4];n.label=1;case 1:return n.trys.push([1,3,,4]),e=this,[4,vo.createProvider(this.logger,this.config.system.nativeBrokerHandshakeTimeout)];case 2:return e.nativeExtensionProvider=n.sent(),[3,4];case 3:return r=n.sent(),this.logger.verbose(r),[3,4];case 4:return this.initialized=!0,this.eventHandler.emitEvent(J.INITIALIZE_END),[2]}})})},t.prototype.handleRedirectPromise=function(e){return S(this,void 0,void 0,function(){var r,n,i,o,a,s,c,l,d=this;return k(this,function(h){return this.logger.verbose("handleRedirectPromise called"),Je.blockNativeBrokerCalledBeforeInitialized(this.config.system.allowNativeBroker,this.initialized),r=this.getAllAccounts(),this.isBrowserEnvironment?(n=e||_.EMPTY_STRING,i=this.redirectResponse.get(n),typeof i>"u"?(this.eventHandler.emitEvent(J.HANDLE_REDIRECT_START,G.Redirect),this.logger.verbose("handleRedirectPromise has been called for the first time, storing the promise"),o=this.browserStorage.getCachedNativeRequest(),a=void 0,o&&vo.isNativeAvailable(this.config,this.logger,this.nativeExtensionProvider)&&this.nativeExtensionProvider&&!e?(this.logger.trace("handleRedirectPromise - acquiring token from native platform"),s=new xa(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,He.handleRedirectPromise,this.performanceClient,this.nativeExtensionProvider,o.accountId,this.nativeInternalStorage,o.correlationId),a=s.handleRedirectPromise()):(this.logger.trace("handleRedirectPromise - acquiring token from web flow"),c=this.browserStorage.getTemporaryCache(ye.CORRELATION_ID,!0)||_.EMPTY_STRING,l=this.createRedirectClient(c),a=l.handleRedirectPromise(e)),i=a.then(function(u){if(u){var f=r.length<d.getAllAccounts().length;f?(d.eventHandler.emitEvent(J.LOGIN_SUCCESS,G.Redirect,u),d.logger.verbose("handleRedirectResponse returned result, login success")):(d.eventHandler.emitEvent(J.ACQUIRE_TOKEN_SUCCESS,G.Redirect,u),d.logger.verbose("handleRedirectResponse returned result, acquire token success"))}return d.eventHandler.emitEvent(J.HANDLE_REDIRECT_END,G.Redirect),u}).catch(function(u){throw r.length>0?d.eventHandler.emitEvent(J.ACQUIRE_TOKEN_FAILURE,G.Redirect,null,u):d.eventHandler.emitEvent(J.LOGIN_FAILURE,G.Redirect,null,u),d.eventHandler.emitEvent(J.HANDLE_REDIRECT_END,G.Redirect),u}),this.redirectResponse.set(n,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])})})},t.prototype.acquireTokenRedirect=function(e){return S(this,void 0,void 0,function(){var r,n,i,o,a,s=this;return k(this,function(c){return r=this.getRequestCorrelationId(e),this.logger.verbose("acquireTokenRedirect called",r),this.preflightBrowserEnvironmentCheck(G.Redirect),n=this.getAllAccounts().length>0,n?this.eventHandler.emitEvent(J.ACQUIRE_TOKEN_START,G.Redirect,e):this.eventHandler.emitEvent(J.LOGIN_START,G.Redirect,e),this.nativeExtensionProvider&&this.canUseNative(e)?(o=new xa(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,He.acquireTokenRedirect,this.performanceClient,this.nativeExtensionProvider,this.getNativeAccountId(e),this.nativeInternalStorage,e.correlationId),i=o.acquireTokenRedirect(e).catch(function(l){if(l instanceof xn&&l.isFatal()){s.nativeExtensionProvider=void 0;var d=s.createRedirectClient(e.correlationId);return d.acquireToken(e)}else if(l instanceof an){s.logger.verbose("acquireTokenRedirect - Resolving interaction required error thrown by native broker by falling back to web flow");var d=s.createRedirectClient(e.correlationId);return d.acquireToken(e)}throw s.browserStorage.setInteractionInProgress(!1),l})):(a=this.createRedirectClient(e.correlationId),i=a.acquireToken(e)),[2,i.catch(function(l){throw n?s.eventHandler.emitEvent(J.ACQUIRE_TOKEN_FAILURE,G.Redirect,null,l):s.eventHandler.emitEvent(J.LOGIN_FAILURE,G.Redirect,null,l),l})]})})},t.prototype.acquireTokenPopup=function(e){var r=this,n=this.getRequestCorrelationId(e),i=this.performanceClient.startMeasurement(pt.AcquireTokenPopup,n);try{this.logger.verbose("acquireTokenPopup called",n),this.preflightBrowserEnvironmentCheck(G.Popup)}catch(c){return Promise.reject(c)}var o=this.getAllAccounts();o.length>0?this.eventHandler.emitEvent(J.ACQUIRE_TOKEN_START,G.Popup,e):this.eventHandler.emitEvent(J.LOGIN_START,G.Popup,e);var a;if(this.canUseNative(e))a=this.acquireTokenNative(e,He.acquireTokenPopup).then(function(c){return r.browserStorage.setInteractionInProgress(!1),i.endMeasurement({success:!0,isNativeBroker:!0,requestId:c.requestId}),i.flushMeasurement(),c}).catch(function(c){if(c instanceof xn&&c.isFatal()){r.nativeExtensionProvider=void 0;var l=r.createPopupClient(e.correlationId);return l.acquireToken(e)}else if(c instanceof an){r.logger.verbose("acquireTokenPopup - Resolving interaction required error thrown by native broker by falling back to web flow");var l=r.createPopupClient(e.correlationId);return l.acquireToken(e)}throw r.browserStorage.setInteractionInProgress(!1),c});else{var s=this.createPopupClient(e.correlationId);a=s.acquireToken(e)}return a.then(function(c){var l=o.length<r.getAllAccounts().length;return l?r.eventHandler.emitEvent(J.LOGIN_SUCCESS,G.Popup,c):r.eventHandler.emitEvent(J.ACQUIRE_TOKEN_SUCCESS,G.Popup,c),i.addStaticFields({accessTokenSize:c.accessToken.length,idTokenSize:c.idToken.length}),i.endMeasurement({success:!0,requestId:c.requestId}),i.flushMeasurement(),c}).catch(function(c){return o.length>0?r.eventHandler.emitEvent(J.ACQUIRE_TOKEN_FAILURE,G.Popup,null,c):r.eventHandler.emitEvent(J.LOGIN_FAILURE,G.Popup,null,c),i.endMeasurement({errorCode:c.errorCode,subErrorCode:c.subError,success:!1}),i.flushMeasurement(),Promise.reject(c)})},t.prototype.ssoSilent=function(e){return S(this,void 0,void 0,function(){var r,n,i,o,a,s=this;return k(this,function(c){return r=this.getRequestCorrelationId(e),n=K(K({},e),{prompt:e.prompt,correlationId:r}),this.preflightBrowserEnvironmentCheck(G.Silent),i=this.performanceClient.startMeasurement(pt.SsoSilent,r),this.logger.verbose("ssoSilent called",r),this.eventHandler.emitEvent(J.SSO_SILENT_START,G.Silent,n),this.canUseNative(n)?o=this.acquireTokenNative(n,He.ssoSilent).catch(function(l){if(l instanceof xn&&l.isFatal()){s.nativeExtensionProvider=void 0;var d=s.createSilentIframeClient(n.correlationId);return d.acquireToken(n)}throw l}):(a=this.createSilentIframeClient(n.correlationId),o=a.acquireToken(n)),[2,o.then(function(l){return s.eventHandler.emitEvent(J.SSO_SILENT_SUCCESS,G.Silent,l),i.addStaticFields({accessTokenSize:l.accessToken.length,idTokenSize:l.idToken.length}),i.endMeasurement({success:!0,isNativeBroker:l.fromNativeBroker,requestId:l.requestId}),i.flushMeasurement(),l}).catch(function(l){throw s.eventHandler.emitEvent(J.SSO_SILENT_FAILURE,G.Silent,null,l),i.endMeasurement({errorCode:l.errorCode,subErrorCode:l.subError,success:!1}),i.flushMeasurement(),l})]})})},t.prototype.acquireTokenByCode=function(e){return S(this,void 0,void 0,function(){var r,n,i,o,a=this;return k(this,function(s){r=this.getRequestCorrelationId(e),this.preflightBrowserEnvironmentCheck(G.Silent),this.logger.trace("acquireTokenByCode called",r),this.eventHandler.emitEvent(J.ACQUIRE_TOKEN_BY_CODE_START,G.Silent,e),n=this.performanceClient.startMeasurement(pt.AcquireTokenByCode,e.correlationId);try{if(e.code)return i=e.code,o=this.hybridAuthCodeResponses.get(i),o?(this.logger.verbose("Existing acquireTokenByCode request found",e.correlationId),n.endMeasurement({success:!0}),n.discardMeasurement()):(this.logger.verbose("Initiating new acquireTokenByCode request",r),o=this.acquireTokenByCodeAsync(K(K({},e),{correlationId:r})).then(function(c){return a.eventHandler.emitEvent(J.ACQUIRE_TOKEN_BY_CODE_SUCCESS,G.Silent,c),a.hybridAuthCodeResponses.delete(i),n.addStaticFields({accessTokenSize:c.accessToken.length,idTokenSize:c.idToken.length}),n.endMeasurement({success:!0,isNativeBroker:c.fromNativeBroker,requestId:c.requestId}),n.flushMeasurement(),c}).catch(function(c){throw a.hybridAuthCodeResponses.delete(i),a.eventHandler.emitEvent(J.ACQUIRE_TOKEN_BY_CODE_FAILURE,G.Silent,null,c),n.endMeasurement({errorCode:c.errorCode,subErrorCode:c.subError,success:!1}),n.flushMeasurement(),c}),this.hybridAuthCodeResponses.set(i,o)),[2,o];if(e.nativeAccountId){if(this.canUseNative(e,e.nativeAccountId))return[2,this.acquireTokenNative(e,He.acquireTokenByCode,e.nativeAccountId).catch(function(c){throw c instanceof xn&&c.isFatal()&&(a.nativeExtensionProvider=void 0),c})];throw D.createUnableToAcquireTokenFromNativePlatformError()}else throw D.createAuthCodeOrNativeAccountIdRequiredError()}catch(c){throw this.eventHandler.emitEvent(J.ACQUIRE_TOKEN_BY_CODE_FAILURE,G.Silent,null,c),n.endMeasurement({errorCode:c instanceof W&&c.errorCode||void 0,subErrorCode:c instanceof W&&c.subError||void 0,success:!1}),c}return[2]})})},t.prototype.acquireTokenByCodeAsync=function(e){return S(this,void 0,void 0,function(){var r,n;return k(this,function(i){switch(i.label){case 0:return this.logger.trace("acquireTokenByCodeAsync called",e.correlationId),r=this.createSilentAuthCodeClient(e.correlationId),[4,r.acquireToken(e)];case 1:return n=i.sent(),[2,n]}})})},t.prototype.acquireTokenFromCache=function(e,r,n){return S(this,void 0,void 0,function(){return k(this,function(i){switch(n.cacheLookupPolicy){case fr.Default:case fr.AccessToken:case fr.AccessTokenAndRefreshToken:return[2,e.acquireToken(r)];default:throw j.createRefreshRequiredError()}return[2]})})},t.prototype.acquireTokenByRefreshToken=function(e,r){return S(this,void 0,void 0,function(){var n;return k(this,function(i){switch(r.cacheLookupPolicy){case fr.Default:case fr.AccessTokenAndRefreshToken:case fr.RefreshToken:case fr.RefreshTokenAndNetwork:return n=this.createSilentRefreshClient(e.correlationId),[2,n.acquireToken(e)];default:throw j.createRefreshRequiredError()}return[2]})})},t.prototype.acquireTokenBySilentIframe=function(e){return S(this,void 0,void 0,function(){var r;return k(this,function(n){return r=this.createSilentIframeClient(e.correlationId),[2,r.acquireToken(e)]})})},t.prototype.logout=function(e){return S(this,void 0,void 0,function(){var r;return k(this,function(n){return r=this.getRequestCorrelationId(e),this.logger.warning("logout API is deprecated and will be removed in msal-browser v3.0.0. Use logoutRedirect instead.",r),[2,this.logoutRedirect(K({correlationId:r},e))]})})},t.prototype.logoutRedirect=function(e){return S(this,void 0,void 0,function(){var r,n;return k(this,function(i){return r=this.getRequestCorrelationId(e),this.preflightBrowserEnvironmentCheck(G.Redirect),n=this.createRedirectClient(r),[2,n.logout(e)]})})},t.prototype.logoutPopup=function(e){try{var r=this.getRequestCorrelationId(e);this.preflightBrowserEnvironmentCheck(G.Popup);var n=this.createPopupClient(r);return n.logout(e)}catch(i){return Promise.reject(i)}},t.prototype.getAllAccounts=function(){return this.logger.verbose("getAllAccounts called"),this.isBrowserEnvironment?this.browserStorage.getAllAccounts():[]},t.prototype.getAccountByUsername=function(e){var r=this.getAllAccounts();return!V.isEmpty(e)&&r&&r.length?(this.logger.verbose("Account matching username found, returning"),this.logger.verbosePii("Returning signed-in accounts matching username: "+e),r.filter(function(n){return n.username.toLowerCase()===e.toLowerCase()})[0]||null):(this.logger.verbose("getAccountByUsername: No matching account found, returning null"),null)},t.prototype.getAccountByHomeId=function(e){var r=this.getAllAccounts();return!V.isEmpty(e)&&r&&r.length?(this.logger.verbose("Account matching homeAccountId found, returning"),this.logger.verbosePii("Returning signed-in accounts matching homeAccountId: "+e),r.filter(function(n){return n.homeAccountId===e})[0]||null):(this.logger.verbose("getAccountByHomeId: No matching account found, returning null"),null)},t.prototype.getAccountByLocalId=function(e){var r=this.getAllAccounts();return!V.isEmpty(e)&&r&&r.length?(this.logger.verbose("Account matching localAccountId found, returning"),this.logger.verbosePii("Returning signed-in accounts matching localAccountId: "+e),r.filter(function(n){return n.localAccountId===e})[0]||null):(this.logger.verbose("getAccountByLocalId: No matching account found, returning null"),null)},t.prototype.setActiveAccount=function(e){this.browserStorage.setActiveAccount(e)},t.prototype.getActiveAccount=function(){return this.browserStorage.getActiveAccount()},t.prototype.preflightBrowserEnvironmentCheck=function(e,r){if(r===void 0&&(r=!0),this.logger.verbose("preflightBrowserEnvironmentCheck started"),Je.blockNonBrowserEnvironment(this.isBrowserEnvironment),Je.blockRedirectInIframe(e,this.config.system.allowRedirectInIframe),Je.blockReloadInHiddenIframes(),Je.blockAcquireTokenInPopups(),Je.blockNativeBrokerCalledBeforeInitialized(this.config.system.allowNativeBroker,this.initialized),e===G.Redirect&&this.config.cache.cacheLocation===Ut.MemoryStorage&&!this.config.cache.storeAuthStateInCookie)throw Yd.createInMemoryRedirectUnavailableError();(e===G.Redirect||e===G.Popup)&&this.preflightInteractiveRequest(r)},t.prototype.preflightInteractiveRequest=function(e){this.logger.verbose("preflightInteractiveRequest called, validating app environment"),Je.blockReloadInHiddenIframes(),e&&this.browserStorage.setInteractionInProgress(!0)},t.prototype.acquireTokenNative=function(e,r,n){return S(this,void 0,void 0,function(){var i;return k(this,function(o){if(this.logger.trace("acquireTokenNative called"),!this.nativeExtensionProvider)throw D.createNativeConnectionNotEstablishedError();return i=new xa(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,r,this.performanceClient,this.nativeExtensionProvider,n||this.getNativeAccountId(e),this.nativeInternalStorage,e.correlationId),[2,i.acquireToken(e)]})})},t.prototype.canUseNative=function(e,r){if(this.logger.trace("canUseNative called"),!vo.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 jt.NONE:case jt.CONSENT:case jt.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!r&&!this.getNativeAccountId(e)?(this.logger.trace("canUseNative: nativeAccountId is not available, returning false"),!1):!0},t.prototype.getNativeAccountId=function(e){var r=e.account||this.browserStorage.getAccountInfoByHints(e.loginHint,e.sid)||this.getActiveAccount();return r&&r.nativeAccountId||""},t.prototype.createPopupClient=function(e){return new H_(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,this.performanceClient,this.nativeInternalStorage,this.nativeExtensionProvider,e)},t.prototype.createRedirectClient=function(e){return new R_(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,this.performanceClient,this.nativeInternalStorage,this.nativeExtensionProvider,e)},t.prototype.createSilentIframeClient=function(e){return new F_(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,He.ssoSilent,this.performanceClient,this.nativeInternalStorage,this.nativeExtensionProvider,e)},t.prototype.createSilentCacheClient=function(e){return new s3(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,this.performanceClient,this.nativeExtensionProvider,e)},t.prototype.createSilentRefreshClient=function(e){return new U_(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,this.performanceClient,this.nativeExtensionProvider,e)},t.prototype.createSilentAuthCodeClient=function(e){return new nb(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,He.acquireTokenByCode,this.performanceClient,this.nativeExtensionProvider,e)},t.prototype.addEventCallback=function(e){return this.eventHandler.addEventCallback(e)},t.prototype.removeEventCallback=function(e){this.eventHandler.removeEventCallback(e)},t.prototype.addPerformanceCallback=function(e){return this.performanceClient.addPerformanceCallback(e)},t.prototype.removePerformanceCallback=function(e){return this.performanceClient.removePerformanceCallback(e)},t.prototype.enableAccountStorageEvents=function(){this.eventHandler.enableAccountStorageEvents()},t.prototype.disableAccountStorageEvents=function(){this.eventHandler.disableAccountStorageEvents()},t.prototype.getTokenCache=function(){return this.tokenCache},t.prototype.getLogger=function(){return this.logger},t.prototype.setLogger=function(e){this.logger=e},t.prototype.initializeWrapperLibrary=function(e,r){this.browserStorage.setWrapperMetadata(e,r)},t.prototype.setNavigationClient=function(e){this.navigationClient=e},t.prototype.getConfiguration=function(){return this.config},t.prototype.getRequestCorrelationId=function(e){return e!=null&&e.correlationId?e.correlationId:this.isBrowserEnvironment?this.browserCrypto.createNewGuid():_.EMPTY_STRING},t}();var sb=function(t){It(e,t);function e(r){var n=t.call(this,r)||this;return n.activeSilentTokenRequests=new Map,n}return e.prototype.loginRedirect=function(r){return S(this,void 0,void 0,function(){var n;return k(this,function(i){return n=this.getRequestCorrelationId(r),this.logger.verbose("loginRedirect called",n),[2,this.acquireTokenRedirect(K({correlationId:n},r||hm))]})})},e.prototype.loginPopup=function(r){var n=this.getRequestCorrelationId(r);return this.logger.verbose("loginPopup called",n),this.acquireTokenPopup(K({correlationId:n},r||hm))},e.prototype.acquireTokenSilent=function(r){return S(this,void 0,void 0,function(){var n,i,o,a,s,c,l,d=this;return k(this,function(h){if(n=this.getRequestCorrelationId(r),i=this.performanceClient.startMeasurement(pt.AcquireTokenSilent,n),i.addStaticFields({cacheLookupPolicy:r.cacheLookupPolicy}),this.preflightBrowserEnvironmentCheck(G.Silent),this.logger.verbose("acquireTokenSilent called",n),o=r.account||this.getActiveAccount(),!o)throw D.createNoAccountError();return a={clientId:this.config.auth.clientId,authority:r.authority||_.EMPTY_STRING,scopes:r.scopes,homeAccountIdentifier:o.homeAccountId,claims:r.claims,authenticationScheme:r.authenticationScheme,resourceRequestMethod:r.resourceRequestMethod,resourceRequestUri:r.resourceRequestUri,shrClaims:r.shrClaims,sshKid:r.sshKid},s=JSON.stringify(a),c=this.activeSilentTokenRequests.get(s),typeof c>"u"?(this.logger.verbose("acquireTokenSilent called for the first time, storing active request",n),l=this.acquireTokenSilentAsync(K(K({},r),{correlationId:n}),o).then(function(u){return d.activeSilentTokenRequests.delete(s),i.addStaticFields({accessTokenSize:u.accessToken.length,idTokenSize:u.idToken.length}),i.endMeasurement({success:!0,fromCache:u.fromCache,isNativeBroker:u.fromNativeBroker,requestId:u.requestId}),i.flushMeasurement(),u}).catch(function(u){throw d.activeSilentTokenRequests.delete(s),i.endMeasurement({errorCode:u.errorCode,subErrorCode:u.subError,success:!1}),i.flushMeasurement(),u}),this.activeSilentTokenRequests.set(s,l),[2,l]):(this.logger.verbose("acquireTokenSilent has been called previously, returning the result from the first call",n),i.endMeasurement({success:!0}),i.discardMeasurement(),[2,c])})})},e.prototype.acquireTokenSilentAsync=function(r,n){return S(this,void 0,void 0,function(){var i,o,a,s,c,l,d=this;return k(this,function(h){switch(h.label){case 0:return this.eventHandler.emitEvent(J.ACQUIRE_TOKEN_START,G.Silent,r),i=this.performanceClient.startMeasurement(pt.AcquireTokenSilentAsync,r.correlationId),vo.isNativeAvailable(this.config,this.logger,this.nativeExtensionProvider,r.authenticationScheme)&&n.nativeAccountId?(this.logger.verbose("acquireTokenSilent - attempting to acquire token from native platform"),a=K(K({},r),{account:n}),o=this.acquireTokenNative(a,He.acquireTokenSilent_silentFlow).catch(function(u){return S(d,void 0,void 0,function(){var f;return k(this,function(v){if(u instanceof xn&&u.isFatal())return this.logger.verbose("acquireTokenSilent - native platform unavailable, falling back to web flow"),this.nativeExtensionProvider=void 0,f=this.createSilentIframeClient(r.correlationId),[2,f.acquireToken(r)];throw u})})}),[3,3]):[3,1];case 1:return this.logger.verbose("acquireTokenSilent - attempting to acquire token from web flow"),s=this.createSilentCacheClient(r.correlationId),[4,s.initializeSilentRequest(r,n)];case 2:c=h.sent(),l=K(K({},r),{cacheLookupPolicy:r.cacheLookupPolicy||fr.Default}),o=this.acquireTokenFromCache(s,c,l).catch(function(u){if(l.cacheLookupPolicy===fr.AccessToken)throw u;return Je.blockReloadInHiddenIframes(),d.eventHandler.emitEvent(J.ACQUIRE_TOKEN_NETWORK_START,G.Silent,c),d.acquireTokenByRefreshToken(c,l).catch(function(f){var v=f instanceof So,g=f instanceof an,x=f.errorCode===rn.INVALID_GRANT_ERROR;if((!v||!x||g||l.cacheLookupPolicy===fr.AccessTokenAndRefreshToken||l.cacheLookupPolicy===fr.RefreshToken)&&l.cacheLookupPolicy!==fr.Skip)throw f;return d.logger.verbose("Refresh token expired/invalid or CacheLookupPolicy is set to Skip, attempting acquire token by iframe.",r.correlationId),d.acquireTokenBySilentIframe(c)})}),h.label=3;case 3:return[2,o.then(function(u){return d.eventHandler.emitEvent(J.ACQUIRE_TOKEN_SUCCESS,G.Silent,u),i.endMeasurement({success:!0,fromCache:u.fromCache,isNativeBroker:u.fromNativeBroker,requestId:u.requestId}),u}).catch(function(u){throw d.eventHandler.emitEvent(J.ACQUIRE_TOKEN_FAILURE,G.Silent,null,u),i.endMeasurement({errorCode:u.errorCode,subErrorCode:u.subError,success:!1}),u})]}})})},e}(ab);const gm="redirect";var ym=globalThis&&globalThis.__awaiter||function(t,e,r,n){function i(o){return o instanceof r?o:new r(function(a){a(o)})}return new(r||(r=Promise))(function(o,a){function s(d){try{l(n.next(d))}catch(h){a(h)}}function c(d){try{l(n.throw(d))}catch(h){a(h)}}function l(d){d.done?o(d.value):i(d.value).then(s,c)}l((n=n.apply(t,e||[])).next())})};class cb extends sb{get account(){return this.getAllAccounts().find(n=>{var i;return((i=n.idTokenClaims)===null||i===void 0?void 0:i.aud)===this.clientId})}get hasValidClaims(){var e;const r=(e=this.account)===null||e===void 0?void 0:e.idTokenClaims;if(r){const n=Math.ceil(Date.now()/1e3);return r.exp>n}return!1}get clientId(){var e;return(e=this.config.auth)===null||e===void 0?void 0:e.clientId}get requestOrigin(){return this.browserStorage.getTemporaryCache("request.origin",!0)}constructor(e,r){super(r),this.tenantId=e}login(e,r=gm,n=!0){var i;return ym(this,void 0,void 0,function*(){const o=(e==null?void 0:e.loginHint)||((i=this.account)===null||i===void 0?void 0:i.username),a=(e==null?void 0:e.scopes)||[],s=Object.assign(Object.assign({},e),{loginHint:o,scopes:a});if(o&&n){this.logger.verbose("Attempting to login in silently");try{return yield this.ssoSilent(s)}catch{this.logger.verbose("Silent login attempt failed")}}switch(this.logger.verbose(`Attempting to login in by [${r}]`),r){case"popup":return this.loginPopup(s);case"redirect":return this.loginRedirect(s)}})}acquireToken(e={scopes:[]},r=gm,n=!0){return ym(this,void 0,void 0,function*(){const i=yield this.account;if(n&&i){this.logger.verbose("Attempting to acquire token in silently");try{return yield this.acquireTokenSilent(Object.assign({account:i},e))}catch{this.logger.info("Expected to navigate away from the current page but timeout occurred.")}}switch(this.logger.verbose(`Attempting to acquire token by [${r}]`),r){case"popup":return this.acquireTokenPopup(e);case"redirect":return this.acquireTokenRedirect(e)}})}}const lb=(t,e=window.location.origin)=>{t=t.match(/^http[s]?/)?t:e+t;const{origin:r,pathname:n}=new URL(t);return r+n.replace(/([^:]\/)\/+/g,"$1")},db=(t,e,r,n,i)=>{const o=Object.assign({clientId:e,redirectUri:lb(r||""),navigateToLoginRequestUrl:!1,authority:`https://login.microsoftonline.com/${t}`},n==null?void 0:n.auth),a=Object.assign({cacheLocation:"localStorage"},n==null?void 0:n.cache),s=n==null?void 0:n.system;return new(i||cb)(t,{auth:o,cache:a,system:s})};class u3 extends t0{constructor(e){super({logLevel:e,loggerCallback:(...r)=>this.loggerCallback(...r)}),this.getLogType=r=>{switch(r){case tt.Error:return"error";case tt.Warning:return"warn";case tt.Info:return"info";case tt.Verbose:default:return"debug"}}}loggerCallback(e,r,n){console[this.getLogType(e)]("%c FUSION::MSAL %c %s","border: 1px solid;","border: none;",r)}}var xh=globalThis&&globalThis.__awaiter||function(t,e,r,n){function i(o){return o instanceof r?o:new r(function(a){a(o)})}return new(r||(r=Promise))(function(o,a){function s(d){try{l(n.next(d))}catch(h){a(h)}}function c(d){try{l(n.throw(d))}catch(h){a(h)}}function l(d){d.done?o(d.value):i(d.value).then(s,c)}l((n=n.apply(t,e||[])).next())})};const hb="default";class ub{get defaultClient(){return this.getClient(hb)}get defaultAccount(){return this.defaultClient.account}get defaultConfig(){return this._config.defaultConfig}constructor(e){this._config=e,this._clients={}}getClient(e){return this._clients[e]||(this._clients[e]=this.createClient(e)),this._clients[e]}createClient(e){const r=e?this._config.getClientConfig(e):this._config.defaultConfig;if(!r)throw Error("Could not find any config");const n=db(r.tenantId,r.clientId,r.redirectUri,r.config);return n.setLogger(new u3(0)),n}handleRedirect(){return xh(this,void 0,void 0,function*(){const{redirectUri:e}=this.defaultConfig||{};if(window.location.pathname===e){const r=this.defaultClient,n=r.getLogger(),{requestOrigin:i}=r;yield r.handleRedirectPromise(),i===e?(n.warning(`detected callback loop from url ${e}, redirecting to root`),window.location.replace("/")):window.location.replace(i||"/")}return null})}acquireToken(e){return this.defaultClient.acquireToken(e)}acquireAccessToken(e){return xh(this,void 0,void 0,function*(){const r=yield this.acquireToken(e);return r?r.accessToken:void 0})}login(){return xh(this,void 0,void 0,function*(){yield this.defaultClient.login()})}}var fb=globalThis&&globalThis.__awaiter||function(t,e,r,n){function i(o){return o instanceof r?o:new r(function(a){a(o)})}return new(r||(r=Promise))(function(o,a){function s(d){try{l(n.next(d))}catch(h){a(h)}}function c(d){try{l(n.throw(d))}catch(h){a(h)}}function l(d){d.done?o(d.value):i(d.value).then(s,c)}l((n=n.apply(t,e||[])).next())})};const f3={name:"auth",configure:t=>{var e;const r=new t_;return!((e=t==null?void 0:t.auth)===null||e===void 0)&&e.defaultConfig&&r.configureDefault(t.auth.defaultConfig),r},initialize:({config:t})=>fb(void 0,void 0,void 0,function*(){const e=new ub(t);return t.requiresAuth&&(yield e.handleRedirect(),e.defaultAccount||(yield e.login())),e})},pb=(t,e)=>({module:f3,configure:r=>{r.configureDefault(t),(e==null?void 0:e.requiresAuth)!==void 0&&(r.requiresAuth=e==null?void 0:e.requiresAuth);const{clients:n}=e??{};n&&Object.entries(n).forEach(([i,o])=>r.configureClient(i,o))}});var p3=globalThis&&globalThis.__awaiter||function(t,e,r,n){function i(o){return o instanceof r?o:new r(function(a){a(o)})}return new(r||(r=Promise))(function(o,a){function s(d){try{l(n.next(d))}catch(h){a(h)}}function c(d){try{l(n.throw(d))}catch(h){a(h)}}function l(d){d.done?o(d.value):i(d.value).then(s,c)}l((n=n.apply(t,e||[])).next())})};const mb=t=>{var e;return{id:t.id,isChildType:t.isChildType,parentTypeIds:(e=t.parentTypeIds)!==null&&e!==void 0?e:[]}},m3=t=>{var e,r,n,i;return{id:t.id,externalId:(e=t.externalId)!==null&&e!==void 0?e:void 0,isActive:t.isActive,isDeleted:t.isDeleted,created:new Date(t.created),source:(r=t.source)!==null&&r!==void 0?r:void 0,title:(n=t.title)!==null&&n!==void 0?n:void 0,type:mb(t.type),value:(i=t.value)!==null&&i!==void 0?i:{}}},vb=t=>p3(void 0,void 0,void 0,function*(){const e=yield t.json();return m3(e)}),gb=t=>p3(void 0,void 0,void 0,function*(){return(yield t.json()).map(m3)});var yb=globalThis&&globalThis.__classPrivateFieldSet||function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},_b=globalThis&&globalThis.__classPrivateFieldGet||function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},ql;class bb{constructor(e,r={}){this.config=r,ql.set(this,void 0),yb(this,ql,e,"f")}requireInstance(e){return _b(this,ql,"f").requireInstance(e)}setContextType(e){this.config.contextType=e}setContextFilter(e){this.config.contextFilter=e}setContextParameterFn(e){this.config.contextParameterFn=e}setContextClient(e,r=1*60*1e3){this.config.client={get:typeof e.get=="function"?{key:({id:n})=>n,client:{fn:e.get},expire:r}:e.get,query:typeof e.query=="function"?{key:n=>JSON.stringify(n),client:{fn:e.query},expire:r}:e.query}}}ql=new WeakMap;var vl=globalThis&&globalThis.__awaiter||function(t,e,r,n){function i(o){return o instanceof r?o:new r(function(a){a(o)})}return new(r||(r=Promise))(function(o,a){function s(d){try{l(n.next(d))}catch(h){a(h)}}function c(d){try{l(n.throw(d))}catch(h){a(h)}}function l(d){d.done?o(d.value):i(d.value).then(s,c)}l((n=n.apply(t,e||[])).next())})},_m=globalThis&&globalThis.__classPrivateFieldGet||function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},Gl;class wb{constructor(){this.defaultExpireTime=1*60*1e3,Gl.set(this,[])}addConfigBuilder(e){_m(this,Gl,"f").push(e)}_getServiceProvider(e){var r;return vl(this,void 0,void 0,function*(){if(e.hasModule("services"))return e.requireInstance("services");{const n=(r=e.ref)===null||r===void 0?void 0:r.services;if(n)return n;throw Error("no service services provider configures [ServicesModule]")}})}createConfig(e){var r;return vl(this,void 0,void 0,function*(){const n=yield _m(this,Gl,"f").reduce((i,o)=>vl(this,void 0,void 0,function*(){const a=new bb(e,yield i);return yield Promise.resolve(o(a)),Object.assign(i,a.config)}),Promise.resolve({}));return(r=n.client)!==null&&r!==void 0||(n.client=yield(()=>vl(this,void 0,void 0,function*(){const o=yield(yield this._getServiceProvider(e)).createContextClient("json$");return{get:{client:{fn:a=>o.get("v1",a,{selector:vb})},key:({id:a})=>a,expire:this.defaultExpireTime},query:{client:{fn:a=>o.query("v1",{query:a},{selector:gb})},key:a=>JSON.stringify(a),expire:this.defaultExpireTime}}}))()),n})}}Gl=new WeakMap;var bm;(function(t){t.IDLE="idle",t.ACTIVE="active",t.FAILED="failed",t.CANCELED="canceled"})(bm||(bm={}));const xb=t=>e=>e.pipe(Bn(t)),Eb=t=>t.pipe(Ge(e=>e.value));var gl,Cb=new Uint8Array(16);function zb(){if(!gl&&(gl=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||typeof msCrypto<"u"&&typeof msCrypto.getRandomValues=="function"&&msCrypto.getRandomValues.bind(msCrypto),!gl))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return gl(Cb)}const Sb=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;function v3(t){return typeof t=="string"&&Sb.test(t)}var xt=[];for(var Eh=0;Eh<256;++Eh)xt.push((Eh+256).toString(16).substr(1));function g3(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,r=(xt[t[e+0]]+xt[t[e+1]]+xt[t[e+2]]+xt[t[e+3]]+"-"+xt[t[e+4]]+xt[t[e+5]]+"-"+xt[t[e+6]]+xt[t[e+7]]+"-"+xt[t[e+8]]+xt[t[e+9]]+"-"+xt[t[e+10]]+xt[t[e+11]]+xt[t[e+12]]+xt[t[e+13]]+xt[t[e+14]]+xt[t[e+15]]).toLowerCase();if(!v3(r))throw TypeError("Stringified UUID is invalid");return r}function kb(t){if(!v3(t))throw TypeError("Invalid UUID");var e,r=new Uint8Array(16);return r[0]=(e=parseInt(t.slice(0,8),16))>>>24,r[1]=e>>>16&255,r[2]=e>>>8&255,r[3]=e&255,r[4]=(e=parseInt(t.slice(9,13),16))>>>8,r[5]=e&255,r[6]=(e=parseInt(t.slice(14,18),16))>>>8,r[7]=e&255,r[8]=(e=parseInt(t.slice(19,23),16))>>>8,r[9]=e&255,r[10]=(e=parseInt(t.slice(24,36),16))/1099511627776&255,r[11]=e/4294967296&255,r[12]=e>>>24&255,r[13]=e>>>16&255,r[14]=e>>>8&255,r[15]=e&255,r}function Ab(t){t=unescape(encodeURIComponent(t));for(var e=[],r=0;r<t.length;++r)e.push(t.charCodeAt(r));return e}var Tb="6ba7b810-9dad-11d1-80b4-00c04fd430c8",Ib="6ba7b811-9dad-11d1-80b4-00c04fd430c8";function Mb(t,e,r){function n(i,o,a,s){if(typeof i=="string"&&(i=Ab(i)),typeof o=="string"&&(o=kb(o)),o.length!==16)throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");var c=new Uint8Array(16+i.length);if(c.set(o),c.set(i,o.length),c=r(c),c[6]=c[6]&15|e,c[8]=c[8]&63|128,a){s=s||0;for(var l=0;l<16;++l)a[s+l]=c[l];return a}return g3(c)}try{n.name=t}catch{}return n.DNS=Tb,n.URL=Ib,n}function y3(t,e,r){t=t||{};var n=t.random||(t.rng||zb)();if(n[6]=n[6]&15|64,n[8]=n[8]&63|128,e){r=r||0;for(var i=0;i<16;++i)e[r+i]=n[i];return e}return g3(n)}function Pb(t,e,r,n){switch(t){case 0:return e&r^~e&n;case 1:return e^r^n;case 2:return e&r^e&n^r&n;case 3:return e^r^n}}function Ch(t,e){return t<<e|t>>>32-e}function Rb(t){var e=[1518500249,1859775393,2400959708,3395469782],r=[1732584193,4023233417,2562383102,271733878,3285377520];if(typeof t=="string"){var n=unescape(encodeURIComponent(t));t=[];for(var i=0;i<n.length;++i)t.push(n.charCodeAt(i))}else Array.isArray(t)||(t=Array.prototype.slice.call(t));t.push(128);for(var o=t.length/4+2,a=Math.ceil(o/16),s=new Array(a),c=0;c<a;++c){for(var l=new Uint32Array(16),d=0;d<16;++d)l[d]=t[c*64+d*4]<<24|t[c*64+d*4+1]<<16|t[c*64+d*4+2]<<8|t[c*64+d*4+3];s[c]=l}s[a-1][14]=(t.length-1)*8/Math.pow(2,32),s[a-1][14]=Math.floor(s[a-1][14]),s[a-1][15]=(t.length-1)*8&4294967295;for(var h=0;h<a;++h){for(var u=new Uint32Array(80),f=0;f<16;++f)u[f]=s[h][f];for(var v=16;v<80;++v)u[v]=Ch(u[v-3]^u[v-8]^u[v-14]^u[v-16],1);for(var g=r[0],x=r[1],m=r[2],p=r[3],y=r[4],w=0;w<80;++w){var A=Math.floor(w/20),O=Ch(g,5)+Pb(A,x,m,p)+y+e[A]+u[w]>>>0;y=p,p=m,m=Ch(x,30)>>>0,x=g,g=O}r[0]=r[0]+g>>>0,r[1]=r[1]+x>>>0,r[2]=r[2]+m>>>0,r[3]=r[3]+p>>>0,r[4]=r[4]+y>>>0}return[r[0]>>24&255,r[0]>>16&255,r[0]>>8&255,r[0]&255,r[1]>>24&255,r[1]>>16&255,r[1]>>8&255,r[1]&255,r[2]>>24&255,r[2]>>16&255,r[2]>>8&255,r[2]&255,r[3]>>24&255,r[3]>>16&255,r[3]>>8&255,r[3]&255,r[4]>>24&255,r[4]>>16&255,r[4]>>8&255,r[4]&255]}var Hb=Mb("v5",80,Rb);const Lb=Hb;class m2 extends Error{constructor(e,r){super(r.message,{cause:r.cause}),this.type=e,this.request=r.request}}const _3=(...t)=>Kt(e=>t.includes(e.type));var Vt=globalThis&&globalThis.__classPrivateFieldGet||function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},Ob=globalThis&&globalThis.__classPrivateFieldSet||function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},gn,Qr;class i0 extends Pe{get action$(){return Vt(this,gn,"f").asObservable()}get value(){return Vt(this,Qr,"f").value}get closed(){return Vt(this,Qr,"f").closed||Vt(this,gn,"f").closed}constructor(e,r){super(i=>Vt(this,Qr,"f").subscribe(i)),gn.set(this,new Wn),Qr.set(this,void 0);const n="getInitialState"in e?e.getInitialState():r;Ob(this,Qr,new C1(n),"f"),Vt(this,gn,"f").pipe(Kg(e,n),Gg()).subscribe(Vt(this,Qr,"f")),this.reset=()=>Vt(this,Qr,"f").next(n)}next(e){Vt(this,gn,"f").next(e)}addEffect(e,r){const n=typeof e=="string"?this.action$.pipe(_3(e)):this.action$,i=r||e;return n.pipe(zo(o=>nr(new Promise((a,s)=>{try{a(i(o,this.value))}catch(c){s(c)}})).pipe(Kr(a=>(console.warn("unhandled effect",a),Li)))),Kt(o=>!!o),Hd(Rd)).subscribe(Vt(this,gn,"f"))}addEpic(e){return this.addFlow(e)}addFlow(e){const r=e(this.action$,this);if(!r)throw new TypeError(`addEpic: one of the provided effects "${e.name||"<anonymous>"}" does not return a stream. Double check you're not missing a return statement!`);return r.pipe(Kr(n=>(console.trace("unhandled exception, epic closed!",n),Li)),Hd(Rd)).subscribe(Vt(this,gn,"f"))}unsubscribe(){Vt(this,gn,"f").unsubscribe(),Vt(this,Qr,"f").unsubscribe()}complete(){Vt(this,gn,"f").complete(),Vt(this,Qr,"f").complete()}asObservable(){return Vt(this,Qr,"f").asObservable()}}gn=new WeakMap,Qr=new WeakMap;function St(t,e){function r(...n){if(e){const i=e(...n);if(!i)throw new Error("prepareAction did not return an object");return Object.assign(Object.assign({type:t,payload:i.payload},"meta"in i&&{meta:i.meta}),"error"in i&&{error:i.error})}return{type:t,payload:n[0]}}return r.toString=()=>`${t}`,r.type=t,r.match=n=>n.type===t,r}const Kl="::",o0=t=>new RegExp(`${Kl}\\${t}$`),wm=t=>t.type.replace(o0("\\w+$"),"");function yl(t,e,r,n){const i=St([t,"request"].join(Kl),e);return r&&Object.assign(i,{success:St([t,"success"].join(Kl),r)}),n&&Object.assign(i,{failure:St([t,"failure"].join(Kl),n)}),i}const Db=t=>!!t.type.match(/::request$/),Nb=t=>!!t.type.match(o0("success")),Vb=t=>!!t.type.match(o0("failure")),Fb=t=>Nb(t)||Vb(t);function zr(t){for(var e=arguments.length,r=Array(e>1?e-1:0),n=1;n<e;n++)r[n-1]=arguments[n];throw Error("[Immer] minified error nr: "+t+(r.length?" "+r.map(function(i){return"'"+i+"'"}).join(","):"")+". Find the full error at: https://bit.ly/3cXEKWf")}function Di(t){return!!t&&!!t[we]}function hn(t){var e;return!!t&&(function(r){if(!r||typeof r!="object")return!1;var n=Object.getPrototypeOf(r);if(n===null)return!0;var i=Object.hasOwnProperty.call(n,"constructor")&&n.constructor;return i===Object||typeof i=="function"&&Function.toString.call(i)===Qb}(t)||Array.isArray(t)||!!t[Tm]||!!(!((e=t.constructor)===null||e===void 0)&&e[Tm])||a0(t)||s0(t))}function xm(t){return Di(t)||zr(23,t),t[we].t}function Ha(t,e,r){r===void 0&&(r=!1),ja(t)===0?(r?Object.keys:u0)(t).forEach(function(n){r&&typeof n=="symbol"||e(n,t[n],t)}):t.forEach(function(n,i){return e(i,n,t)})}function ja(t){var e=t[we];return e?e.i>3?e.i-4:e.i:Array.isArray(t)?1:a0(t)?2:s0(t)?3:0}function v2(t,e){return ja(t)===2?t.has(e):Object.prototype.hasOwnProperty.call(t,e)}function Ub(t,e){return ja(t)===2?t.get(e):t[e]}function b3(t,e,r){var n=ja(t);n===2?t.set(e,r):n===3?(t.delete(e),t.add(r)):t[e]=r}function $b(t,e){return t===e?t!==0||1/t==1/e:t!=t&&e!=e}function a0(t){return Wb&&t instanceof Map}function s0(t){return Yb&&t instanceof Set}function gt(t){return t.o||t.t}function c0(t){if(Array.isArray(t))return Array.prototype.slice.call(t);var e=Xb(t);delete e[we];for(var r=u0(e),n=0;n<r.length;n++){var i=r[n],o=e[i];o.writable===!1&&(o.writable=!0,o.configurable=!0),(o.get||o.set)&&(e[i]={configurable:!0,writable:!0,enumerable:o.enumerable,value:t[i]})}return Object.create(Object.getPrototypeOf(t),e)}function l0(t,e){return e===void 0&&(e=!1),d0(t)||Di(t)||!hn(t)||(ja(t)>1&&(t.set=t.add=t.clear=t.delete=jb),Object.freeze(t),e&&Ha(t,function(r,n){return l0(n,!0)},!0)),t}function jb(){zr(2)}function d0(t){return t==null||typeof t!="object"||Object.isFrozen(t)}function kn(t){var e=y2[t];return e||zr(18,t),e}function Bb(t,e){y2[t]||(y2[t]=e)}function Xd(){return mc}function zh(t,e){e&&(kn("Patches"),t.u=[],t.s=[],t.v=e)}function Jd(t){g2(t),t.p.forEach(qb),t.p=null}function g2(t){t===mc&&(mc=t.l)}function Em(t){return mc={p:[],l:mc,h:t,m:!0,_:0}}function qb(t){var e=t[we];e.i===0||e.i===1?e.j():e.O=!0}function Sh(t,e){e._=e.p.length;var r=e.p[0],n=t!==void 0&&t!==r;return e.h.g||kn("ES5").S(e,t,n),n?(r[we].P&&(Jd(e),zr(4)),hn(t)&&(t=Zd(e,t),e.l||e1(e,t)),e.u&&kn("Patches").M(r[we].t,t,e.u,e.s)):t=Zd(e,r,[]),Jd(e),e.u&&e.v(e.u,e.s),t!==w3?t:void 0}function Zd(t,e,r){if(d0(e))return e;var n=e[we];if(!n)return Ha(e,function(o,a){return Cm(t,n,e,o,a,r)},!0),e;if(n.A!==t)return e;if(!n.P)return e1(t,n.t,!0),n.t;if(!n.I){n.I=!0,n.A._--;var i=n.i===4||n.i===5?n.o=c0(n.k):n.o;Ha(n.i===3?new Set(i):i,function(o,a){return Cm(t,n,i,o,a,r)}),e1(t,i,!1),r&&t.u&&kn("Patches").R(n,r,t.u,t.s)}return n.o}function Cm(t,e,r,n,i,o){if(Di(i)){var a=Zd(t,i,o&&e&&e.i!==3&&!v2(e.D,n)?o.concat(n):void 0);if(b3(r,n,a),!Di(a))return;t.m=!1}if(hn(i)&&!d0(i)){if(!t.h.F&&t._<1)return;Zd(t,i),e&&e.A.l||e1(t,i)}}function e1(t,e,r){r===void 0&&(r=!1),t.h.F&&t.m&&l0(e,r)}function kh(t,e){var r=t[we];return(r?gt(r):t)[e]}function zm(t,e){if(e in t)for(var r=Object.getPrototypeOf(t);r;){var n=Object.getOwnPropertyDescriptor(r,e);if(n)return n;r=Object.getPrototypeOf(r)}}function Un(t){t.P||(t.P=!0,t.l&&Un(t.l))}function Ah(t){t.o||(t.o=c0(t.t))}function pc(t,e,r){var n=a0(e)?kn("MapSet").N(e,r):s0(e)?kn("MapSet").T(e,r):t.g?function(i,o){var a=Array.isArray(i),s={i:a?1:0,A:o?o.A:Xd(),P:!1,I:!1,D:{},l:o,t:i,k:null,o:null,j:null,C:!1},c=s,l=_2;a&&(c=[s],l=gs);var d=Proxy.revocable(c,l),h=d.revoke,u=d.proxy;return s.k=u,s.j=h,u}(e,r):kn("ES5").J(e,r);return(r?r.A:Xd()).p.push(n),n}function Gb(t){return Di(t)||zr(22,t),function e(r){if(!hn(r))return r;var n,i=r[we],o=ja(r);if(i){if(!i.P&&(i.i<4||!kn("ES5").K(i)))return i.t;i.I=!0,n=Sm(r,o),i.I=!1}else n=Sm(r,o);return Ha(n,function(a,s){i&&Ub(i.t,a)===s||b3(n,a,e(s))}),o===3?new Set(n):n}(t)}function Sm(t,e){switch(e){case 2:return new Map(t);case 3:return Array.from(t)}return c0(t)}function Kb(){function t(s,c){function l(){this.constructor=s}i(s,c),s.prototype=(l.prototype=c.prototype,new l)}function e(s){s.o||(s.D=new Map,s.o=new Map(s.t))}function r(s){s.o||(s.o=new Set,s.t.forEach(function(c){if(hn(c)){var l=pc(s.A.h,c,s);s.p.set(c,l),s.o.add(l)}else s.o.add(c)}))}function n(s){s.O&&zr(3,JSON.stringify(gt(s)))}var i=function(s,c){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(l,d){l.__proto__=d}||function(l,d){for(var h in d)d.hasOwnProperty(h)&&(l[h]=d[h])})(s,c)},o=function(){function s(l,d){return this[we]={i:2,l:d,A:d?d.A:Xd(),P:!1,I:!1,o:void 0,D:void 0,t:l,k:this,C:!1,O:!1},this}t(s,Map);var c=s.prototype;return Object.defineProperty(c,"size",{get:function(){return gt(this[we]).size}}),c.has=function(l){return gt(this[we]).has(l)},c.set=function(l,d){var h=this[we];return n(h),gt(h).has(l)&>(h).get(l)===d||(e(h),Un(h),h.D.set(l,!0),h.o.set(l,d),h.D.set(l,!0)),this},c.delete=function(l){if(!this.has(l))return!1;var d=this[we];return n(d),e(d),Un(d),d.t.has(l)?d.D.set(l,!1):d.D.delete(l),d.o.delete(l),!0},c.clear=function(){var l=this[we];n(l),gt(l).size&&(e(l),Un(l),l.D=new Map,Ha(l.t,function(d){l.D.set(d,!1)}),l.o.clear())},c.forEach=function(l,d){var h=this;gt(this[we]).forEach(function(u,f){l.call(d,h.get(f),f,h)})},c.get=function(l){var d=this[we];n(d);var h=gt(d).get(l);if(d.I||!hn(h)||h!==d.t.get(l))return h;var u=pc(d.A.h,h,d);return e(d),d.o.set(l,u),u},c.keys=function(){return gt(this[we]).keys()},c.values=function(){var l,d=this,h=this.keys();return(l={})[_l]=function(){return d.values()},l.next=function(){var u=h.next();return u.done?u:{done:!1,value:d.get(u.value)}},l},c.entries=function(){var l,d=this,h=this.keys();return(l={})[_l]=function(){return d.entries()},l.next=function(){var u=h.next();if(u.done)return u;var f=d.get(u.value);return{done:!1,value:[u.value,f]}},l},c[_l]=function(){return this.entries()},s}(),a=function(){function s(l,d){return this[we]={i:3,l:d,A:d?d.A:Xd(),P:!1,I:!1,o:void 0,t:l,k:this,p:new Map,O:!1,C:!1},this}t(s,Set);var c=s.prototype;return Object.defineProperty(c,"size",{get:function(){return gt(this[we]).size}}),c.has=function(l){var d=this[we];return n(d),d.o?!!d.o.has(l)||!(!d.p.has(l)||!d.o.has(d.p.get(l))):d.t.has(l)},c.add=function(l){var d=this[we];return n(d),this.has(l)||(r(d),Un(d),d.o.add(l)),this},c.delete=function(l){if(!this.has(l))return!1;var d=this[we];return n(d),r(d),Un(d),d.o.delete(l)||!!d.p.has(l)&&d.o.delete(d.p.get(l))},c.clear=function(){var l=this[we];n(l),gt(l).size&&(r(l),Un(l),l.o.clear())},c.values=function(){var l=this[we];return n(l),r(l),l.o.values()},c.entries=function(){var l=this[we];return n(l),r(l),l.o.entries()},c.keys=function(){return this.values()},c[_l]=function(){return this.values()},c.forEach=function(l,d){for(var h=this.values(),u=h.next();!u.done;)l.call(d,u.value,u.value,this),u=h.next()},s}();Bb("MapSet",{N:function(s,c){return new o(s,c)},T:function(s,c){return new a(s,c)}})}var km,mc,h0=typeof Symbol<"u"&&typeof Symbol("x")=="symbol",Wb=typeof Map<"u",Yb=typeof Set<"u",Am=typeof Proxy<"u"&&Proxy.revocable!==void 0&&typeof Reflect<"u",w3=h0?Symbol.for("immer-nothing"):((km={})["immer-nothing"]=!0,km),Tm=h0?Symbol.for("immer-draftable"):"__$immer_draftable",we=h0?Symbol.for("immer-state"):"__$immer_state",_l=typeof Symbol<"u"&&Symbol.iterator||"@@iterator",Qb=""+Object.prototype.constructor,u0=typeof Reflect<"u"&&Reflect.ownKeys?Reflect.ownKeys:Object.getOwnPropertySymbols!==void 0?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:Object.getOwnPropertyNames,Xb=Object.getOwnPropertyDescriptors||function(t){var e={};return u0(t).forEach(function(r){e[r]=Object.getOwnPropertyDescriptor(t,r)}),e},y2={},_2={get:function(t,e){if(e===we)return t;var r=gt(t);if(!v2(r,e))return function(i,o,a){var s,c=zm(o,a);return c?"value"in c?c.value:(s=c.get)===null||s===void 0?void 0:s.call(i.k):void 0}(t,r,e);var n=r[e];return t.I||!hn(n)?n:n===kh(t.t,e)?(Ah(t),t.o[e]=pc(t.A.h,n,t)):n},has:function(t,e){return e in gt(t)},ownKeys:function(t){return Reflect.ownKeys(gt(t))},set:function(t,e,r){var n=zm(gt(t),e);if(n!=null&&n.set)return n.set.call(t.k,r),!0;if(!t.P){var i=kh(gt(t),e),o=i==null?void 0:i[we];if(o&&o.t===r)return t.o[e]=r,t.D[e]=!1,!0;if($b(r,i)&&(r!==void 0||v2(t.t,e)))return!0;Ah(t),Un(t)}return t.o[e]===r&&typeof r!="number"&&(r!==void 0||e in t.o)||(t.o[e]=r,t.D[e]=!0,!0)},deleteProperty:function(t,e){return kh(t.t,e)!==void 0||e in t.t?(t.D[e]=!1,Ah(t),Un(t)):delete t.D[e],t.o&&delete t.o[e],!0},getOwnPropertyDescriptor:function(t,e){var r=gt(t),n=Reflect.getOwnPropertyDescriptor(r,e);return n&&{writable:!0,configurable:t.i!==1||e!=="length",enumerable:n.enumerable,value:r[e]}},defineProperty:function(){zr(11)},getPrototypeOf:function(t){return Object.getPrototypeOf(t.t)},setPrototypeOf:function(){zr(12)}},gs={};Ha(_2,function(t,e){gs[t]=function(){return arguments[0]=arguments[0][0],e.apply(this,arguments)}}),gs.deleteProperty=function(t,e){return gs.set.call(this,t,e,void 0)},gs.set=function(t,e,r){return _2.set.call(this,t[0],e,r,t[0])};var Jb=function(){function t(r){var n=this;this.g=Am,this.F=!0,this.produce=function(i,o,a){if(typeof i=="function"&&typeof o!="function"){var s=o;o=i;var c=n;return function(g){var x=this;g===void 0&&(g=s);for(var m=arguments.length,p=Array(m>1?m-1:0),y=1;y<m;y++)p[y-1]=arguments[y];return c.produce(g,function(w){var A;return(A=o).call.apply(A,[x,w].concat(p))})}}var l;if(typeof o!="function"&&zr(6),a!==void 0&&typeof a!="function"&&zr(7),hn(i)){var d=Em(n),h=pc(n,i,void 0),u=!0;try{l=o(h),u=!1}finally{u?Jd(d):g2(d)}return typeof Promise<"u"&&l instanceof Promise?l.then(function(g){return zh(d,a),Sh(g,d)},function(g){throw Jd(d),g}):(zh(d,a),Sh(l,d))}if(!i||typeof i!="object"){if((l=o(i))===void 0&&(l=i),l===w3&&(l=void 0),n.F&&l0(l,!0),a){var f=[],v=[];kn("Patches").M(i,l,f,v),a(f,v)}return l}zr(21,i)},this.produceWithPatches=function(i,o){if(typeof i=="function")return function(l){for(var d=arguments.length,h=Array(d>1?d-1:0),u=1;u<d;u++)h[u-1]=arguments[u];return n.produceWithPatches(l,function(f){return i.apply(void 0,[f].concat(h))})};var a,s,c=n.produce(i,o,function(l,d){a=l,s=d});return typeof Promise<"u"&&c instanceof Promise?c.then(function(l){return[l,a,s]}):[c,a,s]},typeof(r==null?void 0:r.useProxies)=="boolean"&&this.setUseProxies(r.useProxies),typeof(r==null?void 0:r.autoFreeze)=="boolean"&&this.setAutoFreeze(r.autoFreeze)}var e=t.prototype;return e.createDraft=function(r){hn(r)||zr(8),Di(r)&&(r=Gb(r));var n=Em(this),i=pc(this,r,void 0);return i[we].C=!0,g2(n),i},e.finishDraft=function(r,n){var i=r&&r[we],o=i.A;return zh(o,n),Sh(void 0,o)},e.setAutoFreeze=function(r){this.F=r},e.setUseProxies=function(r){r&&!Am&&zr(20),this.g=r},e.applyPatches=function(r,n){var i;for(i=n.length-1;i>=0;i--){var o=n[i];if(o.path.length===0&&o.op==="replace"){r=o.value;break}}i>-1&&(n=n.slice(i+1));var a=kn("Patches").$;return Di(r)?a(r,n):this.produce(r,function(s){return a(s,n)})},t}(),Mr=new Jb,x3=Mr.produce;Mr.produceWithPatches.bind(Mr);Mr.setAutoFreeze.bind(Mr);Mr.setUseProxies.bind(Mr);Mr.applyPatches.bind(Mr);Mr.createDraft.bind(Mr);Mr.finishDraft.bind(Mr);function Im(t){return hn(t)?x3(t,()=>{}):t}function Zb(t){return typeof t=="function"}function f0(t,e){const[r,n,i]=ew(e);let o;if(Zb(t))o=()=>Im(t());else{const s=Im(t);o=()=>s}function a(s=o(),c){let l=[r[c.type],...n.filter(({matcher:d})=>d(c)).map(({reducer:d})=>d)];return l.filter(d=>!!d).length===0&&(l=[i]),l.reduce((d,h)=>{if(h)if(Di(d)){const f=h(d,c);return f===void 0?d:f}else{if(hn(d))return x3(d,u=>h(u,c));{const u=h(d,c);if(u===void 0){if(d===null)return d;throw Error("A case reducer on a non-draftable value must not return undefined")}return u}}return d},s)}return a.getInitialState=o,a}function ew(t){const e={},r=[];let n;const i={addCase(o,a){const s=typeof o=="string"?o:o.type;if(s in e)throw new Error("addCase cannot be called with two reducers for the same action type");return e[s]=a,i},addMatcher(o,a){return r.push({matcher:o,reducer:a}),i},addDefaultCase(o){return n=o,i}};return t(i),[e,r,n]}const tw=()=>({request:St("client/request",(e,r)=>{var n,i,o,a;return r??(r={}),(n=r.transaction)!==null&&n!==void 0||(r.transaction=y3()),(i=r.created)!==null&&i!==void 0||(r.created=Date.now()),(o=r.controller)!==null&&o!==void 0||(r.controller=new AbortController),(a=r.task)!==null&&a!==void 0||(r.task=new Ag),{payload:e,meta:r}}),retry:St("client/retry",e=>({payload:e})),success:St("client/success",(e,r)=>({payload:e,meta:r})),cancel:St("client/cancel",e=>({payload:e})),failure:St("client/failure",(e,r)=>({payload:e,meta:r})),error:St("client/error",(e,r)=>({payload:e,meta:r}))}),at=tw(),E3=t=>e=>e.pipe(Kt(at.request.match),zo(r=>{const{meta:{controller:n,transaction:i}}=r;return new Pe(o=>{if(n.signal.aborted)return o.next(at.cancel({transaction:i,reason:`request [${i}] was aborted!`})),o.complete();o.add(e.pipe(Kt(at.cancel.match)).subscribe(a=>{a.payload.transaction===i&&(n.signal.aborted||n.abort(),o.complete())})),o.add(e2(n.signal,"abort").subscribe(()=>{o.next(at.cancel({transaction:i,reason:`request [${i}] was aborted!`})),o.complete()})),o.add(nr(t(r)).subscribe({next:a=>o.next(a),error:a=>o.next(at.error(a,{request:r})),complete:()=>o.complete()}))})})),rw=t=>(t=Object.assign({},{count:0,delay:0},t),(e,r)=>e.pipe(E3(n=>e.pipe(Kt(at.failure.match),Kt(i=>i.meta.request===n),Yg(r),Bn(([i,o])=>{var a,s;const{transaction:c}=n.meta,l=o[c];if(!l)return Li;const d=(s=(a=l.retry)===null||a===void 0?void 0:a.length)!==null&&s!==void 0?s:0,h=Object.assign({},t,n.meta.retry);if(d>=h.count)throw h.count?Error("maximum retries executed!",{cause:i.payload}):i.payload;return(typeof h.delay=="function"?nr(h.delay(i.payload.cause)).pipe(Kr(f=>{throw Error("failed to resolve delay",{cause:f})})):Sy(h.delay)).pipe(Ge(()=>at.retry(n)))}))))),nw=t=>e=>e.pipe(E3(r=>nr(t(r.payload,r.meta.controller.signal)).pipe(Ge(n=>at.success(n,{request:r})),Kr(n=>Oi(at.failure(Error(`failed to execute request for transaction ${r.meta.transaction}`,{cause:n}),{request:r})))))),iw=t=>t.pipe(Kt(at.retry.match),Ge(e=>e.payload)),C3=()=>Kt(t=>t.status==="complete"),ow=(t={})=>f0(t,e=>e.addCase(at.request,(r,n)=>{const{transaction:i,task:o,ref:a,created:s}=n.meta;r[i]={transaction:i,task:o,ref:a,created:s}}).addCase(at.success,(r,n)=>{const{request:i}=n.meta,{transaction:o,ref:a}=i.meta,s=r[o];if(s){const c={status:"complete",transaction:o,ref:a,value:n.payload,args:i.payload,created:s.created,completed:Date.now()};s.task.next(c),s.task.complete()}delete r[o]}).addCase(at.retry,(r,n)=>{var i;const{transaction:o}=n.payload.meta,a=r[o];a&&((i=a.retry)!==null&&i!==void 0||(a.retry=[]),a.retry.push(Date.now()))}).addCase(at.cancel,(r,n)=>{const{transaction:i,reason:o}=n.payload;if(r[i]){const a=Object.assign({},xm(r[i]));a.task.error(new m2("abort",{request:a,message:o??"request was canceled"})),delete r[i]}}).addCase(at.failure,(r,n)=>{var i;const{payload:o,meta:a}=n,{transaction:s}=a.request.meta,c=r[s];c&&((i=c.errors)!==null&&i!==void 0||(c.errors=[]),c.errors.push(o))}).addCase(at.error,(r,n)=>{const{payload:i,meta:o}=n,{transaction:a}=o.request.meta;if(r[a]){const s=Object.assign({},xm(r[a]));s.task.error(new m2("error",{request:s,message:`failed to process task [${a}]`,cause:i.cause})),delete r[a]}}));var aw=globalThis&&globalThis.__awaiter||function(t,e,r,n){function i(o){return o instanceof r?o:new r(function(a){a(o)})}return new(r||(r=Promise))(function(o,a){function s(d){try{l(n.next(d))}catch(h){a(h)}}function c(d){try{l(n.throw(d))}catch(h){a(h)}}function l(d){d.done?o(d.value):i(d.value).then(s,c)}l((n=n.apply(t,e||[])).next())})},et=globalThis&&globalThis.__classPrivateFieldGet||function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},Mm=globalThis&&globalThis.__classPrivateFieldSet||function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},ot,to;class Pm extends Pe{get closed(){return et(this,ot,"f").closed}get state$(){return et(this,ot,"f")}get action$(){return et(this,ot,"f").action$}get success$(){return this.action$.pipe(Kt(at.success.match),Ge(({payload:e})=>e))}get error$(){return this.action$.pipe(_3("client/error"),Yg(et(this,ot,"f")),Ge(([e,r])=>{const{payload:n,meta:i}=e,{transaction:o}=i.request.meta,a=r[e.meta.request.meta.transaction];return new m2("error",{request:a,message:`failed to process task [${o}]`,cause:n})}))}constructor(e,r){super(o=>et(this,ot,"f").subscribe(o)),ot.set(this,void 0),to.set(this,void 0);const n={};Mm(this,ot,new i0(ow(n)),"f"),Mm(this,to,new un(()=>et(this,ot,"f").complete()),"f"),et(this,to,"f").add(et(this,ot,"f").addFlow(nw(e))),et(this,to,"f").add(et(this,ot,"f").addFlow(iw));const i=Object.assign({count:0,delay:0},r==null?void 0:r.retry);et(this,to,"f").add(et(this,ot,"f").addFlow(rw(i)))}next(e,r){const n=at.request(e,r);return et(this,ot,"f").next(n),n.meta}nextAsync(e,r){return aw(this,void 0,void 0,function*(){return on(this.next(e,r).task.pipe(C3()))})}getTaskByTransaction(e){const r=et(this,ot,"f").value[e];return r&&r.task}getTaskByRef(e){const r=Object.values(et(this,ot,"f").value).find(n=>n.ref===e);return r&&r.task}cancel(e,r){if(e&&et(this,ot,"f").value[e])r??(r=`[${e}]: transaction canceled`),et(this,ot,"f").next(at.cancel({transaction:e,reason:r}));else for(const n of Object.keys(et(this,ot,"f").value))this.cancel(n,`[${e}]: all transactions canceled`)}on(e,r){return et(this,ot,"f").addEffect(at[e].type,n=>{r(n,this)})}complete(){et(this,to,"f").unsubscribe()}asObservable(){return et(this,ot,"f").asObservable()}}ot=new WeakMap,to=new WeakMap;function sw(){return{set:St("cache/set",(t,e)=>({payload:{key:t,entry:e}})),remove:St("cache/remove",t=>({payload:t})),invalidate:St("cache/invalidate",t=>({payload:t})),trim:St("cache/trim",t=>({payload:t}))}}const No=sw(),cw=(t,e)=>{var r,n;return((r=e.updated)!==null&&r!==void 0?r:0)-((n=t.updated)!==null&&n!==void 0?n:0)};function lw(t,e={}){return f0(e,r=>r.addCase(t.set,(n,i)=>{var o;const{key:a,entry:s}=i.payload,c=n[a];c?(c.updated=Date.now(),(o=c.updates)!==null&&o!==void 0||(c.updates=0),c.updates++):n[a]=Object.assign(Object.assign({},s),{created:Date.now()})}).addCase(t.remove,(n,i)=>{delete n[i.payload]}).addCase(t.invalidate,(n,i)=>{const o=n[i.payload];o&&delete o.updated}).addCase(t.trim,(n,i)=>{var o,a;const{payload:s}=i,c=(o=s.sort)!==null&&o!==void 0?o:cw,l=Object.keys(n),d=Object.entries(n).filter(([h,u])=>!s.validate||s.validate(u)).sort((h,u)=>c(h[1],u[1])).slice(0,(a=s.size)!==null&&a!==void 0?a:Number.MAX_SAFE_INTEGER).map(([h])=>h);if(l.length!==d.length)for(const h of l){const u=d.indexOf(h);u!==-1?d.splice(u,1):delete n[h]}}))}var vn=globalThis&&globalThis.__classPrivateFieldGet||function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},dw=globalThis&&globalThis.__classPrivateFieldSet||function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},Er;class Rm{get state$(){return vn(this,Er,"f").asObservable()}constructor(e){Er.set(this,void 0);const{trimming:r,initial:n}=e;dw(this,Er,new i0(lw(No,n)),"f"),r&&vn(this,Er,"f").addEffect("cache/set",()=>vn(this,Er,"f").next(No.trim(r)))}setItem(...e){vn(this,Er,"f").next(No.set(...e))}getItem(e){return vn(this,Er,"f").value[e]}removeItem(e){vn(this,Er,"f").next(No.remove(e))}invalidate(e){vn(this,Er,"f").next(No.invalidate(e))}trim(e){vn(this,Er,"f").next(No.trim(e))}reset(){vn(this,Er,"f").reset()}complete(){vn(this,Er,"f").complete()}}Er=new WeakMap;var De=globalThis&&globalThis.__classPrivateFieldGet||function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},Vo=globalThis&&globalThis.__classPrivateFieldSet||function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},hw=globalThis&&globalThis.__rest||function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(t);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(t,n[i])&&(r[n[i]]=t[n[i]]);return r},ro,Xr,di,qo,Go,Wl,b2;const uw=(t=0)=>e=>{var r;return((r=e.updated)!==null&&r!==void 0?r:0)+t>Date.now()};class nn{get client(){return De(this,Xr,"f")}get cache(){return De(this,di,"f")}constructor(e){var r,n;ro.set(this,new un),Xr.set(this,void 0),di.set(this,void 0),qo.set(this,new Wn),Go.set(this,void 0),Wl.set(this,void 0),b2.set(this,y3()),Vo(this,Go,o=>Lb(e.key(o),De(this,b2,"f")),"f"),Vo(this,Wl,(r=e==null?void 0:e.validate)!==null&&r!==void 0?r:uw(e==null?void 0:e.expire),"f"),e.client instanceof Pm?Vo(this,Xr,e.client,"f"):(Vo(this,Xr,new Pm(e.client.fn,e.client.options),"f"),De(this,ro,"f").add(()=>De(this,Xr,"f").complete())),e.cache instanceof Rm?Vo(this,di,e.cache,"f"):(Vo(this,di,new Rm(e.cache||{}),"f"),De(this,ro,"f").add(()=>De(this,di,"f").complete()));const i=(n=e.queueOperator)!==null&&n!==void 0?n:xb;De(this,ro,"f").add(()=>De(this,qo,"f").complete()),De(this,ro,"f").add(De(this,qo,"f").pipe(i(({args:o,options:a})=>new Pe(s=>{const{task:c,transaction:l}=De(this,Xr,"f").next(o,a);s.add(c.pipe(Kr(()=>Li)).subscribe(s)),s.add(()=>{setTimeout(()=>De(this,Xr,"f").cancel(l))})})),C3(),Wg(()=>!De(this,Xr,"f").closed)).subscribe(o=>{const{args:a,value:s,transaction:c,ref:l}=o,d=l??De(this,Go,"f").call(this,a);De(this,di,"f").setItem(d,{value:s,args:a,transaction:c})}))}next(e,r){De(this,qo,"f").next({args:e,options:r})}query(e,r){var n;const i=De(this,Go,"f").call(this,e);return(n=De(this,Xr,"f").getTaskByRef(i))!==null&&n!==void 0?n:this._createTask(i,e,r)}queryAsync(e,r){const n=r||{},{awaitResolve:i}=n,o=hw(n,["awaitResolve"]);return(i?po:on)(this._query(e,o))}complete(){De(this,ro,"f").unsubscribe()}_query(e,r){var n;const i=De(this,Go,"f").call(this,e);return(n=De(this,Xr,"f").getTaskByRef(i))!==null&&n!==void 0?n:this._createTask(i,e,r)}_createTask(e,r,n){var i;const o=new Ag,a=De(this,di,"f").getItem(e);if(a){const{value:l,args:d,created:h,updated:u,updates:f,transaction:v}=a,g={status:"cache",value:l,args:d,created:h,updated:u,updates:f,transaction:v};o.next(g)}const s=((i=n==null?void 0:n.cache)===null||i===void 0?void 0:i.validate)||De(this,Wl,"f");return a&&s(a,r)?o.complete():De(this,qo,"f").next({args:r,options:{ref:e,task:o}}),o.asObservable()}}ro=new WeakMap,Xr=new WeakMap,di=new WeakMap,qo=new WeakMap,Go=new WeakMap,Wl=new WeakMap,b2=new WeakMap;nn.extractQueryValue=Eb;var si=globalThis&&globalThis.__classPrivateFieldGet||function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},Hm=globalThis&&globalThis.__classPrivateFieldSet||function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},ys,On;class fw extends Pe{get currentContext(){return si(this,On,"f").value}get currentContext$(){return si(this,On,"f").asObservable()}get client(){return si(this,ys,"f")}constructor(e){super(r=>si(this,On,"f").subscribe(r)),ys.set(this,void 0),On.set(this,void 0),Hm(this,ys,new nn(e),"f"),Hm(this,On,new C1(void 0),"f")}setCurrentContext(e){typeof e=="string"?this.resolveContext(e).pipe(Kr(()=>Li)).subscribe(r=>si(this,On,"f").next(r)):e!==si(this,On,"f").value&&si(this,On,"f").next(e)}resolveContext(e){return si(this,ys,"f").query({id:e}).pipe(Ge(r=>r.value))}}ys=new WeakMap,On=new WeakMap;var bt=globalThis&&globalThis.__classPrivateFieldGet||function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},Fo=globalThis&&globalThis.__classPrivateFieldSet||function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},Dn,Yl,_s,Ko,Ql,bs,Xl;class pw{get contextClient(){return bt(this,Dn,"f")}get queryClient(){return bt(this,Yl,"f")}get currentContext$(){return bt(this,Dn,"f").currentContext$}get currentContext(){return bt(this,Dn,"f").currentContext}set currentContext(e){bt(this,_s,"f")?bt(this,_s,"f").dispatchEvent("onCurrentContextChange",{source:this,canBubble:!0,cancelable:!0,detail:{context:e}}).then(r=>{r.canceled||bt(this,Dn,"f").setCurrentContext(e)}):bt(this,Dn,"f").setCurrentContext(e)}constructor(e){var r;Dn.set(this,void 0),Yl.set(this,void 0),_s.set(this,void 0),Ko.set(this,new un),Ql.set(this,void 0),bs.set(this,void 0),Xl.set(this,void 0);const{config:n,event:i,parentContext:o}=e;Fo(this,Ql,n.contextType,"f"),Fo(this,bs,n.contextFilter,"f"),Fo(this,Dn,new fw(n.client.get),"f"),Fo(this,Yl,new nn(n.client.query),"f"),Fo(this,Xl,(r=n.contextParameterFn)!==null&&r!==void 0?r:a=>({search:a.search,filter:{type:a.type}}),"f"),i&&(Fo(this,_s,i,"f"),bt(this,Ko,"f").add(bt(this,Dn,"f").currentContext$.pipe(t2()).subscribe(([a,s])=>{i.dispatchEvent("onCurrentContextChanged",{source:this,canBubble:!0,detail:{previous:a,next:s}})})),bt(this,Ko,"f").add(i.addEventListener("onCurrentContextChanged",a=>{a.source!==this&&(this.currentContext=a.detail.next)}))),o&&bt(this,Ko,"f").add(o.contextClient.currentContext$.subscribe(a=>this.currentContext=a))}queryContext(e){const r=this.queryClient.query(bt(this,Xl,"f").call(this,{search:e,type:bt(this,Ql,"f")})).pipe(Ge(n=>n.value));return bt(this,bs,"f")?r.pipe(Ge(bt(this,bs,"f"))):r}queryContextAsync(e){return po(this.queryContext(e))}clearCurrentContext(){this.currentContext=void 0}dispose(){bt(this,Ko,"f").unsubscribe()}}Dn=new WeakMap,Yl=new WeakMap,_s=new WeakMap,Ko=new WeakMap,Ql=new WeakMap,bs=new WeakMap,Xl=new WeakMap;var mw=globalThis&&globalThis.__awaiter||function(t,e,r,n){function i(o){return o instanceof r?o:new r(function(a){a(o)})}return new(r||(r=Promise))(function(o,a){function s(d){try{l(n.next(d))}catch(h){a(h)}}function c(d){try{l(n.throw(d))}catch(h){a(h)}}function l(d){d.done?o(d.value):i(d.value).then(s,c)}l((n=n.apply(t,e||[])).next())})};const vw="context",gw={name:vw,configure:()=>new wb,initialize:t=>mw(void 0,void 0,void 0,function*(){var e;const r=yield t.config.createConfig(t),n=t.hasModule("event")?yield t.requireInstance("event"):void 0,i=(e=t.ref)===null||e===void 0?void 0:e.context;return new pw({config:r,event:n,parentContext:i})}),dispose:t=>{t.instance.dispose()}};var Lm=globalThis&&globalThis.__awaiter||function(t,e,r,n){function i(o){return o instanceof r?o:new r(function(a){a(o)})}return new(r||(r=Promise))(function(o,a){function s(d){try{l(n.next(d))}catch(h){a(h)}}function c(d){try{l(n.throw(d))}catch(h){a(h)}}function l(d){d.done?o(d.value):i(d.value).then(s,c)}l((n=n.apply(t,e||[])).next())})};class yw{constructor(e){this.clientKey=e.clientKey,this.endpoint=e.endpoint,this.clientCtor=e.clientCtor}createHttpClientClient(e){return Lm(this,void 0,void 0,function*(){if(!this.clientKey)throw Error("no http client for service discovery is provided!");return e.createClient(this.clientKey)})}createClient(e){return Lm(this,void 0,void 0,function*(){if(!this.endpoint)throw Error("no endpoint defined!");return new this.clientCtor({http:e,endpoint:this.endpoint})})}}var Th=globalThis&&globalThis.__awaiter||function(t,e,r,n){function i(o){return o instanceof r?o:new r(function(a){a(o)})}return new(r||(r=Promise))(function(o,a){function s(d){try{l(n.next(d))}catch(h){a(h)}}function c(d){try{l(n.throw(d))}catch(h){a(h)}}function l(d){d.done?o(d.value):i(d.value).then(s,c)}l((n=n.apply(t,e||[])).next())})};class _w{constructor(e,r){this._client=e,this._http=r}get environment(){return this._client.environment}resolveService(e){return Th(this,void 0,void 0,function*(){return this._client.resolveService(e)})}createClient(e,r){return Th(this,void 0,void 0,function*(){const n=yield this.resolveService(e);if(!n)throw Error(`Could not load configuration of service [${e}]`);return this._http.createClient(Object.assign(Object.assign({},r),{baseUri:n.uri,defaultScopes:n.defaultScopes}))})}configureClient(e,r){return Th(this,void 0,void 0,function*(){const{key:n,alias:i}=typeof e=="string"?{key:e,alias:e}:e,{uri:o,defaultScopes:a}=yield this.resolveService(n);r.addConfig(Jg(i,{baseUri:o,defaultScopes:a}))})}}var Om=globalThis&&globalThis.__awaiter||function(t,e,r,n){function i(o){return o instanceof r?o:new r(function(a){a(o)})}return new(r||(r=Promise))(function(o,a){function s(d){try{l(n.next(d))}catch(h){a(h)}}function c(d){try{l(n.throw(d))}catch(h){a(h)}}function l(d){d.done?o(d.value):i(d.value).then(s,c)}l((n=n.apply(t,e||[])).next())})},bw=globalThis&&globalThis.__classPrivateFieldGet||function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},ww=globalThis&&globalThis.__classPrivateFieldSet||function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},Jl;class xw{get environment(){return on(nn.extractQueryValue(bw(this,Jl,"f").query(void 0,{cache:{suppressInvalid:!0}})))}constructor({http:e,endpoint:r}){Jl.set(this,void 0),this.http=e,this.endpoint=r,ww(this,Jl,new nn({client:{fn:()=>e.fetch$(r,{selector:this.selector.bind(this)})},key:()=>"services",expire:5*60*1e3}),"f")}selector(e){return Om(this,void 0,void 0,function*(){const r=yield e.json(),n=r.services.reduce((i,o)=>Object.assign(i,{[o.key]:{clientId:r.clientId,uri:o.uri,defaultScopes:[r.clientId+"/.default"]}}),{});return Object.assign(Object.assign({},r),{services:n})})}resolveService(e){return Om(this,void 0,void 0,function*(){try{const{services:r}=yield this.environment;return r[e]}catch(r){throw console.error(r),r}})}}Jl=new WeakMap;const Ew="serviceDiscovery";var Cw=globalThis&&globalThis.__awaiter||function(t,e,r,n){function i(o){return o instanceof r?o:new r(function(a){a(o)})}return new(r||(r=Promise))(function(o,a){function s(d){try{l(n.next(d))}catch(h){a(h)}}function c(d){try{l(n.throw(d))}catch(h){a(h)}}function l(d){d.done?o(d.value):i(d.value).then(s,c)}l((n=n.apply(t,e||[])).next())})};const zw={name:Ew,configure:()=>new yw({clientCtor:xw,clientKey:"service_discovery",endpoint:"/_discovery/environments/current"}),initialize:({config:t,requireInstance:e})=>Cw(void 0,void 0,void 0,function*(){const r=yield e("http"),n=yield t.createHttpClientClient(r),i=yield t.createClient(n);return new _w(i,r)})};class Sw{}class z3 extends Error{constructor(e,r){super(`unsupported version ${e}`,{cause:r}),this.version=e}}const kw=(t,e)=>{var r;const n=(r=Xn[t])!==null&&r!==void 0?r:t;switch(n){case Xn.v2:throw new z3(t);case Xn.v1:default:{const{id:i}=e,o=new URLSearchParams;return o.append("api-version",n),`/contexts/${i}/?${String(o)}`}}},Aw=(t,e,r)=>[kw(t,e),r],Tw=(t,e,r="json")=>(n,i)=>t[r](...Aw(e,n,i));var Iw=["eq","ne","gt","ge","lt","le"],bl=["and","or","not"],Mw=["any","all"],Pw=["startswith","endswith","contains"],Rw=["expand","levels","select","skip","top","count","orderby","filter"],Dm=/\((.*)\)/,Nm=/(?!indexof)\((\w+)\)/,Vm;(function(t){t.sum="sum",t.min="min",t.max="max",t.average="average",t.countdistinct="countdistinct"})(Vm||(Vm={}));var Hn="";function Hw(t){var e=t===void 0?{}:t,r=e.select,n=e.search,i=e.skiptoken,o=e.format,a=e.top,s=e.skip,c=e.filter,l=e.transform,d=e.orderBy,h=e.key,u=e.count,f=e.expand,v=e.action,g=e.func,x="",m=[],p={};if(h!=null&&(x+="(".concat(En(h,m),")")),(c||typeof u=="object")&&(p.$filter=vc(typeof u=="object"?u:c,m)),l&&(p.$apply=S3(l)),f&&(p.$expand=Zl(f)),d&&(p.$orderby=p0(d)),u&&(typeof u=="boolean"?p.$count=!0:x+="/$count"),typeof a=="number"&&(p.$top=a),typeof s=="number"&&(p.$skip=s),v&&(x+="/".concat(v)),g){if(typeof g=="string")x+="/".concat(g);else if(typeof g=="object"){var y=Object.keys(g)[0],w=En(g[y],m);x+="/".concat(y),w!==""&&(x+="(".concat(w,")"))}}return m.length>0&&Object.assign(p,m.reduce(function(A,O){var U;return Object.assign(A,(U={},U["@".concat(O.name)]=En(O.value),U))},{})),Vw(x,lt({$select:r,$search:n,$skiptoken:i,$format:o},p))}function Ih(t,e,r){return r===void 0&&(r=[]),"".concat(t," eq ").concat(En(e,r))}function vc(t,e,r){return t===void 0&&(t={}),e===void 0&&(e=[]),r===void 0&&(r=""),(Array.isArray(t)?t:[t]).reduce(function(o,a){if(a){var s=n(a,e,r);s&&o.push(s)}return o},[]).join(" and ");function n(o,a,s){o===void 0&&(o={}),a===void 0&&(a=[]),s===void 0&&(s="");var c="";if(typeof o=="string")c=o;else if(o&&typeof o=="object"){var l=Object.keys(o).reduce(function(d,h){var u=o[h];if(u===void 0)return d;var f="";if(s?h===Hn?f=s:Nm.test(h)?f=h.replace(Nm,function(p,y){return y.trim()===Hn?"(".concat(s,")"):"(".concat(s,"/").concat(y.trim(),")")}):Dm.test(h)?f=h.replace(Dm,function(p,y){return y.trim()===Hn?"(".concat(s,")"):"(".concat(s,"/").concat(y.trim(),")")}):f="".concat(s,"/").concat(h):f=h,h===Hn&&Array.isArray(u))return d.concat(u.map(function(p){return Ih(f,p)}));if(["number","string","boolean"].indexOf(typeof u)!==-1||u instanceof Date||u===null)d.push(Ih(f,u,a));else if(Array.isArray(u)){var v=h,g=u.map(function(p){return vc(p,a,s)}).filter(function(p){return p}).map(function(p){return bl.indexOf(v)!==-1?"(".concat(p,")"):p});g.length&&(bl.indexOf(v)!==-1?g.length&&(v==="not"?d.push(Fm(g)):d.push("(".concat(g.join(" ".concat(v," ")),")"))):d.push(g.join(" ".concat(v," "))))}else if(bl.indexOf(f)!==-1){var x=f,g=Object.keys(u).map(function(y){var w;return n((w={},w[y]=u[y],w))});g.length&&(x==="not"?d.push(Fm(g)):d.push("(".concat(g.join(" ".concat(x," ")),")")))}else if(typeof u=="object")if("type"in u)d.push(Ih(f,u,a));else{var m=Object.keys(u);m.forEach(function(p){if(u[p]!==void 0)if(Iw.indexOf(p)!==-1)d.push("".concat(f," ").concat(p," ").concat(En(u[p],a)));else if(bl.indexOf(p)!==-1)Array.isArray(u[p])?d.push(u[p].map(function(O){return"("+n(O,a,f)+")"}).join(" ".concat(p," "))):d.push("("+n(u[p],a,f)+")");else if(Mw.indexOf(p)!==-1){var y=i(h.toLowerCase(),u[p],p,f);y&&d.push(y)}else if(p==="has")d.push("".concat(f," ").concat(p," ").concat(En(u[p],a)));else if(p==="in"){var w=Array.isArray(u[p])?u[p]:u[p].value.map(function(O){return{type:u[p].type,value:O}});d.push(f+" in ("+w.map(function(O){return En(O,a)}).join(",")+")")}else if(Pw.indexOf(p)!==-1)d.push("".concat(p,"(").concat(f,",").concat(En(u[p],a),")"));else{var A=n(u,a,f);A&&d.push(A)}})}else throw new Error("Unexpected value type: ".concat(u));return d},[]);c=l.join(" and ")}return c}function i(o,a,s,c){var l="";if(typeof a=="string"||a instanceof String)l=Lw(o,a,s,c);else if(a){var d=Array.isArray(a)?a.reduce(function(u,f){return f.hasOwnProperty(Hn)?(u.hasOwnProperty(Hn)||(u[Hn]=[]),u[Hn].push(f[Hn]),u):lt(lt({},u),f)},{}):a,h=n(d,e,o);l="".concat(c,"/").concat(s,"(").concat(h?"".concat(o,":").concat(h):"",")")}return l}}function Lw(t,e,r,n){var i="",o=r=="all"?"ne":"eq";return i="".concat(n,"/").concat(r,"(").concat(t,": ").concat(t," ").concat(o," '").concat(e,"')"),i}function Ow(t){return t=t.replace(/%/g,"%25"),t=t.replace(/\+/g,"%2B"),t=t.replace(/\//g,"%2F"),t=t.replace(/\?/g,"%3F"),t=t.replace(/#/g,"%23"),t=t.replace(/&/g,"%26"),t=t.replace(/'/g,"''"),t}function En(t,e){if(typeof t=="string")return"'".concat(Ow(t),"'");if(t instanceof Date)return t.toISOString();if(typeof t=="number")return t;if(Array.isArray(t))return"[".concat(t.map(function(r){return En(r)}).join(","),"]");if(t===null)return t;if(typeof t=="object")switch(t.type){case"raw":case"guid":return t.value;case"duration":return"duration'".concat(t.value,"'");case"binary":return"binary'".concat(t.value,"'");case"alias":return Array.isArray(e)&&e.push(t),"@".concat(t.name);case"json":return escape(JSON.stringify(t.value));case"decimal":return"".concat(t.value,"M");default:return Object.entries(t).filter(function(r){var n=r[1];return n!==void 0}).map(function(r){var n=r[0],i=r[1];return"".concat(n,"=").concat(En(i,e))}).join(",")}return t}function Zl(t){if(typeof t=="number")return t;if(typeof t=="string")return t.indexOf("/")===-1?t:t.split("/").reverse().reduce(function(r,n,i,o){return i===0?"$expand=".concat(n):i===o.length-1?"".concat(n,"(").concat(r,")"):"$expand=".concat(n,"(").concat(r,")")},"");if(Array.isArray(t))return"".concat(t.map(function(r){return Zl(r)}).join(","));if(typeof t=="object"){var e=Object.keys(t);return e.some(function(r){return Rw.indexOf(r.toLowerCase())!==-1})?e.map(function(r){var n;switch(r){case"filter":n=vc(t[r]);break;case"orderBy":n=p0(t[r]);break;case"levels":case"count":case"skip":case"top":n="".concat(t[r]);break;default:n=Zl(t[r])}return"$".concat(r.toLowerCase(),"=").concat(n)}).join(";"):e.map(function(r){var n=Zl(t[r]);return n?"".concat(r,"(").concat(n,")"):r}).join(",")}return""}function S3(t){var e=Array.isArray(t)?t:[t],r=e.reduce(function(n,i){var o=i.aggregate,a=i.filter,s=i.groupBy,c=Eg(i,["aggregate","filter","groupBy"]),l=Object.keys(c);if(l.length)throw new Error("Unsupported transform(s): ".concat(l));if(o&&n.push("aggregate(".concat(Dw(o),")")),a){var d=vc(a);d&&n.push("filter(".concat(vc(d),")"))}return s&&n.push("groupby(".concat(Nw(s),")")),n},[]);return r.join("/")||void 0}function Dw(t){var e=Array.isArray(t)?t:[t];return e.map(function(r){return typeof r=="string"?r:Object.keys(r).map(function(n){var i=r[n];if(!i.with)throw new Error("'with' property required for '".concat(n,"'"));if(!i.as)throw new Error("'as' property required for '".concat(n,"'"));return"".concat(n," with ").concat(i.with," as ").concat(i.as)})}).join(",")}function Nw(t){if(!t.properties)throw new Error("'properties' property required for groupBy");var e="(".concat(t.properties.join(","),")");return t.transform&&(e+=",".concat(S3(t.transform))),e}function p0(t,e){return e===void 0&&(e=""),Array.isArray(t)?t.map(function(r){return Array.isArray(r)&&r.length===2&&["asc","desc"].indexOf(r[1])!==-1?r.join(" "):r}).map(function(r){return"".concat(e).concat(String(r))}).join(","):typeof t=="object"?Object.entries(t).map(function(r){var n=r[0],i=r[1];return p0(i,"".concat(n,"/"))}).map(function(r){return"".concat(e).concat(r)}).join(","):"".concat(e).concat(String(t))}function Vw(t,e){var r=Object.getOwnPropertyNames(e).filter(function(n){return e[n]!==void 0&&e[n]!==""}).map(function(n){return"".concat(n,"=").concat(e[n])});return r.length?"".concat(t,"?").concat(r.join("&")):t}function Fm(t){return"not(".concat(t.join(" and "),")")}const Fw=t=>Object.keys(t).reduce((e,r)=>{var n;switch(r){case"type":return!((n=t[r])===null||n===void 0)&&n.length?Object.assign(Object.assign({},e),{[r]:{in:t[r]}}):e;default:return Object.assign(Object.assign({},e),{[r]:t[r]})}},{}),Uw=t=>Object.keys(t).reduce((e,r)=>{switch(r){case"filter":return Object.assign(Object.assign({},e),{[r]:Fw(t.filter)});default:return Object.assign(Object.assign({},e),{[r]:t[r]})}},{}),$w=t=>typeof t=="string"?t:Hw(Uw(t)),jw=(t,e)=>{var r;const n=(r=Xn[t])!==null&&r!==void 0?r:t;switch(n){case Xn.v2:throw new z3(t);case Xn.v1:default:{const{query:i,includeDeleted:o}=e,a=new URLSearchParams($w(i));return a.append("api-version",n),o&&a.append("includeDeleted","true"),`/contexts/?${String(a)}`}}},Bw=(t,e,r)=>[jw(t,e),r],qw=(t,e,r="json")=>(n,i)=>t[r](...Bw(e,n,i));class Gw{get Version(){return Xn}constructor(e,r){this._client=e,this._method=r}get(e,...r){return Tw(this._client,e,this._method)(...r)}query(e,...r){return qw(this._client,e,this._method)(...r)}}var Xn;(function(t){t.v1="1.0",t.v2="2.0"})(Xn||(Xn={}));const Kw=(t,e)=>{switch(t){case"v1":{const{id:r}=e,n=new URLSearchParams;return n.append("api-version","1.0"),`/bookmarks/${r}/?${String(n)}`}default:{const{id:r}=e,n=new URLSearchParams;return n.append("api-version",t),`/bookmarks/${r}/?${String(n)}`}}},Ww=(t,e,r)=>{const n=Kw(t,e),i=Object.assign({},{method:"Delete"},r);return[n,i]},Yw=(t,e,r="json")=>(n,i)=>t[r](...Ww(e,n,i)),Qw=Yw,Xw=(t,e)=>{switch(t){case"v1":{const{id:r}=e,n=new URLSearchParams;return n.append("api-version","1.0"),`/bookmarks/${r}/?${String(n)}`}default:{const{id:r}=e,n=new URLSearchParams;return n.append("api-version",t),`/bookmarks/${r}/?${String(n)}`}}},Jw=(t,e,r)=>[Xw(t,e),r],Zw=(t,e,r="json")=>(n,i)=>t[r](...Jw(e,n,i)),ex=Zw,tx=(t,e)=>{switch(t){case"v1":{const r=new URLSearchParams;return r.append("api-version","1.0"),`/bookmarks?${String(r)}`}default:{const r=new URLSearchParams;return r.append("api-version",t),`/bookmarks?${String(r)}`}}},rx=(t,e,r)=>{const n=tx(t),i=new Headers;i.append("content-type","application/json");const o=Object.assign({},{method:"post",body:JSON.stringify(e),headers:i},r);return[n,o]},nx=(t,e,r="json")=>(n,i)=>t[r](...rx(e,n,i)),ix=nx;class ox{constructor(e,r){this._client=e,this._method=r}get(e,...r){return ex(this._client,e,this._method)(...r)}post(e,...r){return ix(this._client,e,this._method)(...r)}delete(e,...r){return Qw(this._client,e,this._method)(...r)}}const ax=ox;var Um=globalThis&&globalThis.__awaiter||function(t,e,r,n){function i(o){return o instanceof r?o:new r(function(a){a(o)})}return new(r||(r=Promise))(function(o,a){function s(d){try{l(n.next(d))}catch(h){a(h)}}function c(d){try{l(n.throw(d))}catch(h){a(h)}}function l(d){d.done?o(d.value):i(d.value).then(s,c)}l((n=n.apply(t,e||[])).next())})};class sx{constructor({createClient:e}){this._createClientFn=e}createBookmarksClient(e){return Um(this,void 0,void 0,function*(){const r=yield this._createClientFn("bookmarks");return new ax(r,e)})}createContextClient(e){return Um(this,void 0,void 0,function*(){const r=yield this._createClientFn("context");return new Gw(r,e)})}}var k3=globalThis&&globalThis.__awaiter||function(t,e,r,n){function i(o){return o instanceof r?o:new r(function(a){a(o)})}return new(r||(r=Promise))(function(o,a){function s(d){try{l(n.next(d))}catch(h){a(h)}}function c(d){try{l(n.throw(d))}catch(h){a(h)}}function l(d){d.done?o(d.value):i(d.value).then(s,c)}l((n=n.apply(t,e||[])).next())})};const cx="services",lx=(t,e)=>r=>k3(void 0,void 0,void 0,function*(){if(t.hasClient(r))return t.createClient(r);if(e)return e.createClient(r);throw Error(`failed to create http client for service ${r}`)}),dx={name:cx,configure:()=>new Sw,initialize:({ref:t,config:e,requireInstance:r,hasModule:n})=>k3(void 0,void 0,void 0,function*(){if(!e.createClient){const i=yield r("http"),o=n("serviceDiscovery")?yield r("serviceDiscovery"):t==null?void 0:t.serviceDiscovery;e.createClient=lx(i,o)}if(!e.createClient)throw Error("missing configuration for creating API client");return new sx(e)})},hx=dx;class ux extends Oy{constructor(){super([jy,f3,Zf,zw,hx,gw]),this.logger=new xg("FrameworkConfigurator")}configureHttp(...e){this.addConfig(e_(...e))}configureHttpClient(...e){this.addConfig(Jg(...e))}configureMsal(...e){this.addConfig(pb(...e))}configureServiceDiscovery(e){this.configureHttpClient("service_discovery",e.client)}}var fx=globalThis&&globalThis.__awaiter||function(t,e,r,n){function i(o){return o instanceof r?o:new r(function(a){a(o)})}return new(r||(r=Promise))(function(o,a){function s(d){try{l(n.next(d))}catch(h){a(h)}}function c(d){try{l(n.throw(d))}catch(h){a(h)}}function l(d){d.done?o(d.value):i(d.value).then(s,c)}l((n=n.apply(t,e||[])).next())})};const px=(t,e)=>fx(void 0,void 0,void 0,function*(){const r=yield t.initialize(e),n={modules:r};return window.Fusion=n,r.event.dispatchEvent("onFrameworkLoaded",{detail:n}),n}),A3=T.createContext(null),mx=A3.Provider;var vx=globalThis&&globalThis.__awaiter||function(t,e,r,n){function i(o){return o instanceof r?o:new r(function(a){a(o)})}return new(r||(r=Promise))(function(o,a){function s(d){try{l(n.next(d))}catch(h){a(h)}}function c(d){try{l(n.throw(d))}catch(h){a(h)}}function l(d){d.done?o(d.value):i(d.value).then(s,c)}l((n=n.apply(t,e||[])).next())})};const gx=t=>T.lazy(()=>vx(void 0,void 0,void 0,function*(){const e=new ux;yield t(e);const r=yield px(e);return{default:({children:n})=>Q(mx,Object.assign({value:r},{children:n}))}})),m0=()=>{let t=T.useContext(A3);return t||console.warn("could not locate fusion in context!"),t??(t=window.Fusion),t||console.error("Could not load framework, might not be initiated?"),t},yx=t=>{const e=T.useMemo(()=>gx(t.configure),[t.configure]);return Q(T.Suspense,Object.assign({fallback:t.fallback},{children:Q(e,{children:t.children})}))};function ke(){return ke=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},ke.apply(this,arguments)}function w2(t){return w2=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},w2(t)}function Mh(t){return t&&w2(t)==="object"&&t.constructor===Object}function T3(t,e){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{clone:!0},n=r.clone?ke({},t):t;return Mh(t)&&Mh(e)&&Object.keys(e).forEach(function(i){i!=="__proto__"&&(Mh(e[i])&&i in t?n[i]=T3(t[i],e[i],r):n[i]=e[i])}),n}var _x=typeof Symbol=="function"&&Symbol.for;const I3=_x?Symbol.for("mui.nested"):"__THEME_NESTED__";var bx=["checked","disabled","error","focused","focusVisible","required","expanded","selected"];function wx(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},e=t.disableGlobal,r=e===void 0?!1:e,n=t.productionPrefix,i=n===void 0?"jss":n,o=t.seed,a=o===void 0?"":o,s=a===""?"":"".concat(a,"-"),c=0,l=function(){return c+=1,c};return function(d,h){var u=h.options.name;if(u&&u.indexOf("Mui")===0&&!h.options.link&&!r){if(bx.indexOf(d.key)!==-1)return"Mui-".concat(d.key);var f="".concat(s).concat(u,"-").concat(d.key);return!h.options.theme[I3]||a!==""?f:"".concat(f,"-").concat(l())}return"".concat(s).concat(i).concat(l())}}var $m=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ic=(typeof window>"u"?"undefined":$m(window))==="object"&&(typeof document>"u"?"undefined":$m(document))==="object"&&document.nodeType===9;function jm(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function M3(t,e,r){return e&&jm(t.prototype,e),r&&jm(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function x2(t,e){return x2=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},x2(t,e)}function P3(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,x2(t,e)}function Bm(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function R3(t,e){if(t==null)return{};var r={},n=Object.keys(t),i,o;for(o=0;o<n.length;o++)i=n[o],!(e.indexOf(i)>=0)&&(r[i]=t[i]);return r}var xx={}.constructor;function E2(t){if(t==null||typeof t!="object")return t;if(Array.isArray(t))return t.map(E2);if(t.constructor!==xx)return t;var e={};for(var r in t)e[r]=E2(t[r]);return e}function v0(t,e,r){t===void 0&&(t="unnamed");var n=r.jss,i=E2(e),o=n.plugins.onCreateRule(t,i,r);return o||(t[0],null)}var qm=function(e,r){for(var n="",i=0;i<e.length&&e[i]!=="!important";i++)n&&(n+=r),n+=e[i];return n},go=function(e){if(!Array.isArray(e))return e;var r="";if(Array.isArray(e[0]))for(var n=0;n<e.length&&e[n]!=="!important";n++)r&&(r+=", "),r+=qm(e[n]," ");else r=qm(e,", ");return e[e.length-1]==="!important"&&(r+=" !important"),r};function Ba(t){return t&&t.format===!1?{linebreak:"",space:""}:{linebreak:`
|
|
15
|
+
Error Description: `+c.message)),[2,null];case 4:return n||(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."),n=t.createCloudDiscoveryMetadataFromHost(this.hostnameAndPort)),[2,n]}})})},t.prototype.getCloudDiscoveryMetadataFromHarcodedValues=function(){return this.canonicalAuthority in sm?sm[this.canonicalAuthority]:null},t.prototype.isInKnownAuthorities=function(){var e=this,r=this.authorityOptions.knownAuthorities.filter(function(n){return be.getDomainFromUrl(n).toLowerCase()===e.hostnameAndPort});return r.length>0},t.generateAuthority=function(e,r){var n;if(r&&r.azureCloudInstance!==dc.None){var i=r.tenant?r.tenant:_.DEFAULT_COMMON_TENANT;n=r.azureCloudInstance+"/"+i+"/"}return n||e},t.createCloudDiscoveryMetadataFromHost=function(e){return{preferred_network:e,preferred_cache:e,aliases:[e]}},t.getCloudDiscoveryMetadataFromNetworkResponse=function(e,r){for(var n=0;n<e.length;n++){var i=e[n];if(i.aliases.indexOf(r)>-1)return i}return null},t.prototype.getPreferredCache=function(){if(this.discoveryComplete())return this.metadata.preferred_cache;throw j.createEndpointDiscoveryIncompleteError("Discovery incomplete.")},t.prototype.isAlias=function(e){return this.metadata.aliases.indexOf(e)>-1},t.isPublicCloudAuthority=function(e){return _.KNOWN_PUBLIC_CLOUDS.indexOf(e)>=0},t.buildRegionalAuthorityString=function(e,r,n){var i=new be(e);i.validateAsUri();var o=i.getUrlComponents(),a=r+"."+o.HostNameAndPort;this.isPublicCloudAuthority(o.HostNameAndPort)&&(a=r+"."+_.REGIONAL_AUTH_PUBLIC_CLOUD_SUFFIX);var s=be.constructAuthorityUriFromObject(Re(Re({},i.getUrlComponents()),{HostNameAndPort:a})).urlString;return n?s+"?"+n:s},t.replaceWithRegionalInformation=function(e,r){return e.authorization_endpoint=t.buildRegionalAuthorityString(e.authorization_endpoint,r),e.token_endpoint=t.buildRegionalAuthorityString(e.token_endpoint,r,_.REGIONAL_AUTH_NON_MSI_QUERY_STRING),e.end_session_endpoint&&(e.end_session_endpoint=t.buildRegionalAuthorityString(e.end_session_endpoint,r)),e},t}();var Kd=function(){function t(){}return t.createDiscoveredInstance=function(e,r,n,i,o,a){return Z(this,void 0,void 0,function(){var s,c;return ee(this,function(l){switch(l.label){case 0:s=t.createInstance(e,r,n,i,o,a),l.label=1;case 1:return l.trys.push([1,3,,4]),[4,s.resolveEndpointsAsync()];case 2:return l.sent(),[2,s];case 3:throw c=l.sent(),j.createEndpointDiscoveryIncompleteError(c);case 4:return[2]}})})},t.createInstance=function(e,r,n,i,o,a){if(V.isEmpty(e))throw Fe.createUrlEmptyError();return new Gd(e,r,n,i,o,a)},t}();var Wd=function(){function t(){this.failedRequests=[],this.errors=[],this.cacheHits=0}return t.isServerTelemetryEntity=function(e,r){var n=e.indexOf(wt.CACHE_KEY)===0,i=!0;return r&&(i=r.hasOwnProperty("failedRequests")&&r.hasOwnProperty("errors")&&r.hasOwnProperty("cacheHits")),n&&i},t}();var cm=function(){function t(){}return t.isThrottlingEntity=function(e,r){var n=!1;e&&(n=e.indexOf(Fs.THROTTLING_PREFIX)===0);var i=!0;return r&&(i=r.hasOwnProperty("throttleTime")),n&&i},t}();var E_={sendGetRequestAsync:function(){var t="Network interface - sendGetRequestAsync() has not been implemented for the Network interface.";return Promise.reject(W.createUnexpectedError(t))},sendPostRequestAsync:function(){var t="Network interface - sendPostRequestAsync() has not been implemented for the Network interface.";return Promise.reject(W.createUnexpectedError(t))}};var ml={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."}},lm=function(t){br(e,t);function e(r,n){var i=t.call(this,r,n)||this;return i.name="JoseHeaderError",Object.setPrototypeOf(i,e.prototype),i}return e.createMissingKidError=function(){return new e(ml.missingKidError.code,ml.missingKidError.desc)},e.createMissingAlgError=function(){return new e(ml.missingAlgError.code,ml.missingAlgError.desc)},e}(W);var C_=function(){function t(e){this.typ=e.typ,this.alg=e.alg,this.kid=e.kid}return t.getShrHeaderString=function(e){if(!e.kid)throw lm.createMissingKidError();if(!e.alg)throw lm.createMissingAlgError();var r=new t({typ:e.typ||s2.Jwt,kid:e.kid,alg:e.alg});return JSON.stringify(r)},t}();var z_=function(){function t(e,r){this.cacheOutcome=lo.NO_CACHE_HIT,this.cacheManager=r,this.apiId=e.apiId,this.correlationId=e.correlationId,this.wrapperSKU=e.wrapperSKU||_.EMPTY_STRING,this.wrapperVer=e.wrapperVer||_.EMPTY_STRING,this.telemetryCacheKey=wt.CACHE_KEY+Tr.CACHE_KEY_SEPARATOR+e.clientId}return t.prototype.generateCurrentRequestHeaderValue=function(){var e=""+this.apiId+wt.VALUE_SEPARATOR+this.cacheOutcome,r=[this.wrapperSKU,this.wrapperVer].join(wt.VALUE_SEPARATOR),n=this.getRegionDiscoveryFields(),i=[e,n].join(wt.VALUE_SEPARATOR);return[wt.SCHEMA_VERSION,i,r].join(wt.CATEGORY_SEPARATOR)},t.prototype.generateLastRequestHeaderValue=function(){var e=this.getLastRequests(),r=t.maxErrorsToSend(e),n=e.failedRequests.slice(0,2*r).join(wt.VALUE_SEPARATOR),i=e.errors.slice(0,r).join(wt.VALUE_SEPARATOR),o=e.errors.length,a=r<o?wt.OVERFLOW_TRUE:wt.OVERFLOW_FALSE,s=[o,a].join(wt.VALUE_SEPARATOR);return[wt.SCHEMA_VERSION,e.cacheHits,n,i,s].join(wt.CATEGORY_SEPARATOR)},t.prototype.cacheFailedRequest=function(e){var r=this.getLastRequests();r.errors.length>=wt.MAX_CACHED_ERRORS&&(r.failedRequests.shift(),r.failedRequests.shift(),r.errors.shift()),r.failedRequests.push(this.apiId,this.correlationId),V.isEmpty(e.subError)?V.isEmpty(e.errorCode)?!!e&&e.toString()?r.errors.push(e.toString()):r.errors.push(wt.UNKNOWN_ERROR):r.errors.push(e.errorCode):r.errors.push(e.subError),this.cacheManager.setServerTelemetry(this.telemetryCacheKey,r)},t.prototype.incrementCacheHits=function(){var e=this.getLastRequests();return e.cacheHits+=1,this.cacheManager.setServerTelemetry(this.telemetryCacheKey,e),e.cacheHits},t.prototype.getLastRequests=function(){var e=new Wd,r=this.cacheManager.getServerTelemetry(this.telemetryCacheKey);return r||e},t.prototype.clearTelemetryCache=function(){var e=this.getLastRequests(),r=t.maxErrorsToSend(e),n=e.errors.length;if(r===n)this.cacheManager.removeItem(this.telemetryCacheKey);else{var i=new Wd;i.failedRequests=e.failedRequests.slice(r*2),i.errors=e.errors.slice(r),this.cacheManager.setServerTelemetry(this.telemetryCacheKey,i)}},t.maxErrorsToSend=function(e){var r,n=0,i=0,o=e.errors.length;for(r=0;r<o;r++){var a=e.failedRequests[2*r]||_.EMPTY_STRING,s=e.failedRequests[2*r+1]||_.EMPTY_STRING,c=e.errors[r]||_.EMPTY_STRING;if(i+=a.toString().length+s.toString().length+c.length+3,i<wt.MAX_LAST_HEADER_BYTES)n+=1;else break}return n},t.prototype.getRegionDiscoveryFields=function(){var e=[];return e.push(this.regionUsed||_.EMPTY_STRING),e.push(this.regionSource||_.EMPTY_STRING),e.push(this.regionOutcome||_.EMPTY_STRING),e.join(",")},t.prototype.updateRegionDiscoveryMetadata=function(e){this.regionUsed=e.region_used,this.regionSource=e.region_source,this.regionOutcome=e.region_outcome},t.prototype.setCacheOutcome=function(e){this.cacheOutcome=e},t}();var i3=function(){function t(e,r,n,i,o,a){this.authority=r,this.libraryName=i,this.libraryVersion=o,this.applicationTelemetry=a,this.clientId=e,this.logger=n,this.callbacks=new Map,this.eventsByCorrelationId=new Map,this.staticFieldsByCorrelationId=new Map,this.measurementsById=new Map}return t.prototype.startMeasurement=function(e,r){var n=this,i,o,a=r||this.generateId();r||this.logger.info("PerformanceClient: No correlation id provided for "+e+", generating",a),this.logger.trace("PerformanceClient: Performance measurement started for "+e,a);var s=this.startPerformanceMeasuremeant(e,a);s.startMeasurement();var c={eventId:this.generateId(),status:ha.InProgress,authority:this.authority,libraryName:this.libraryName,libraryVersion:this.libraryVersion,clientId:this.clientId,name:e,startTimeMs:Date.now(),correlationId:a};this.cacheEventByCorrelationId(c);var l={appName:(i=this.applicationTelemetry)===null||i===void 0?void 0:i.appName,appVersion:(o=this.applicationTelemetry)===null||o===void 0?void 0:o.appVersion};return this.addStaticFields(l,a),this.cacheMeasurement(c,s),{endMeasurement:function(d){var h=n.endMeasurement(Re(Re({},c),d));return h&&n.cacheEventByCorrelationId(h),h},flushMeasurement:function(){return n.flushMeasurements(c.name,c.correlationId)},discardMeasurement:function(){return n.discardMeasurements(c.correlationId)},addStaticFields:function(d){return n.addStaticFields(d,c.correlationId)},measurement:s,event:c}},t.prototype.endMeasurement=function(e){var r=this.measurementsById.get(e.eventId);if(r){this.measurementsById.delete(e.eventId),r.endMeasurement();var n=r.flushMeasurement();if(n!==null){this.logger.trace("PerformanceClient: Performance measurement ended for "+e.name+": "+n+" ms",e.correlationId);var i=Re(Re({durationMs:Math.round(n)},e),{status:ha.Completed});return i}else this.logger.trace("PerformanceClient: Performance measurement not taken",e.correlationId)}else this.logger.trace("PerformanceClient: Measurement not found for "+e.eventId,e.correlationId);return null},t.prototype.addStaticFields=function(e,r){var n=this.staticFieldsByCorrelationId.get(r);n?(this.logger.trace("PerformanceClient: Updating static fields"),this.staticFieldsByCorrelationId.set(r,Re(Re({},n),e))):(this.logger.trace("PerformanceClient: Adding static fields"),this.staticFieldsByCorrelationId.set(r,e))},t.prototype.cacheEventByCorrelationId=function(e){var r=this.eventsByCorrelationId.get(e.correlationId);r?(this.logger.trace("PerformanceClient: Performance measurement for "+e.name+" added/updated",e.correlationId),r.set(e.eventId,e)):(this.logger.trace("PerformanceClient: Performance measurement for "+e.name+" started",e.correlationId),this.eventsByCorrelationId.set(e.correlationId,new Map().set(e.eventId,e)))},t.prototype.cacheMeasurement=function(e,r){this.measurementsById.set(e.eventId,r)},t.prototype.flushMeasurements=function(e,r){var n=this;this.logger.trace("PerformanceClient: Performance measurements flushed for "+e,r);var i=this.eventsByCorrelationId.get(r);if(i){this.discardMeasurements(r);var o=[];i.forEach(function(u){if(u.name!==e&&u.status!==ha.Completed){n.logger.trace("PerformanceClient: Incomplete submeasurement "+u.name+" found for "+e,r);var f=n.endMeasurement(u);f&&o.push(f)}o.push(u)});var a=o.sort(function(u,f){return u.startTimeMs-f.startTimeMs}),s=a.filter(function(u){return u.name===e&&u.status===ha.Completed});if(s.length>0){s.length>1&&this.logger.verbose("PerformanceClient: Multiple distinct top-level performance events found, using the first",r);var c=s[0];this.logger.verbose("PerformanceClient: Measurement found for "+e,r);var l=a.reduce(function(u,f){if(f.name!==e){n.logger.trace("PerformanceClient: Complete submeasurement found for "+f.name,r);var v=f.name+"DurationMs";u[v]?n.logger.verbose("PerformanceClient: Submeasurement for "+e+" already exists for "+f.name+", ignoring",r):u[v]=f.durationMs}return u},c),d=this.staticFieldsByCorrelationId.get(r),h=Re(Re({},l),d);this.emitEvents([h],l.correlationId)}else this.logger.verbose("PerformanceClient: No completed top-level measurements found for "+e,r)}else this.logger.verbose("PerformanceClient: No measurements found",r)},t.prototype.discardMeasurements=function(e){this.logger.trace("PerformanceClient: Performance measurements discarded",e),this.eventsByCorrelationId.delete(e)},t.prototype.addPerformanceCallback=function(e){var r=this.generateId();return this.callbacks.set(r,e),this.logger.verbose("PerformanceClient: Performance callback registered with id: "+r),r},t.prototype.removePerformanceCallback=function(e){var r=this.callbacks.delete(e);return r?this.logger.verbose("PerformanceClient: Performance callback "+e+" removed."):this.logger.verbose("PerformanceClient: Performance callback "+e+" not removed."),r},t.prototype.emitEvents=function(e,r){var n=this;this.logger.verbose("PerformanceClient: Emitting performance events",r),this.callbacks.forEach(function(i,o){n.logger.trace("PerformanceClient: Emitting event to callback "+o,r),i.apply(null,[e])})},t}();var S_=function(){function t(){}return t.prototype.startMeasurement=function(){},t.prototype.endMeasurement=function(){},t.prototype.flushMeasurement=function(){return null},t}(),k_=function(t){br(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.generateId=function(){return"callback-id"},e.prototype.startPerformanceMeasuremeant=function(){return new S_},e}(i3);var P={pkceNotGenerated:{code:"pkce_not_created",desc:"The PKCE code challenge and verifier could not be generated."},cryptoDoesNotExist:{code:"crypto_nonexistent",desc:"The crypto object or function is not available."},httpMethodNotImplementedError:{code:"http_method_not_implemented",desc:"The HTTP method given has not been implemented in this library."},emptyNavigateUriError:{code:"empty_navigate_uri",desc:"Navigation URI is empty. Please check stack trace for more info."},hashEmptyError:{code:"hash_empty_error",desc:"Hash value cannot be processed because it is empty. Please verify that your redirectUri is not clearing the hash. For more visit: aka.ms/msaljs/browser-errors."},hashDoesNotContainStateError:{code:"no_state_in_hash",desc:"Hash does not contain state. Please verify that the request originated from msal."},hashDoesNotContainKnownPropertiesError:{code:"hash_does_not_contain_known_properties",desc:"Hash does not contain known properites. Please verify that your redirectUri is not changing the hash. For more visit: aka.ms/msaljs/browser-errors."},unableToParseStateError:{code:"unable_to_parse_state",desc:"Unable to parse state. Please verify that the request originated from msal."},stateInteractionTypeMismatchError:{code:"state_interaction_type_mismatch",desc:"Hash contains state but the interaction type does not match the caller."},interactionInProgress:{code:"interaction_in_progress",desc:"Interaction is currently in progress. Please ensure that this interaction has been completed before calling an interactive API. For more visit: aka.ms/msaljs/browser-errors."},popupWindowError:{code:"popup_window_error",desc:"Error opening popup window. This can happen if you are using IE or if popups are blocked in the browser."},emptyWindowError:{code:"empty_window_error",desc:"window.open returned null or undefined window object."},userCancelledError:{code:"user_cancelled",desc:"User cancelled the flow."},monitorPopupTimeoutError:{code:"monitor_window_timeout",desc:"Token acquisition in popup failed due to timeout. For more visit: aka.ms/msaljs/browser-errors."},monitorIframeTimeoutError:{code:"monitor_window_timeout",desc:"Token acquisition in iframe failed due to timeout. For more visit: aka.ms/msaljs/browser-errors."},redirectInIframeError:{code:"redirect_in_iframe",desc:"Redirects are not supported for iframed or brokered applications. Please ensure you are using MSAL.js in a top frame of the window if using the redirect APIs, or use the popup APIs."},blockTokenRequestsInHiddenIframeError:{code:"block_iframe_reload",desc:"Request was blocked inside an iframe because MSAL detected an authentication response. For more visit: aka.ms/msaljs/browser-errors"},blockAcquireTokenInPopupsError:{code:"block_nested_popups",desc:"Request was blocked inside a popup because MSAL detected it was running in a popup."},iframeClosedPrematurelyError:{code:"iframe_closed_prematurely",desc:"The iframe being monitored was closed prematurely."},silentLogoutUnsupportedError:{code:"silent_logout_unsupported",desc:"Silent logout not supported. Please call logoutRedirect or logoutPopup instead."},noAccountError:{code:"no_account_error",desc:"No account object provided to acquireTokenSilent and no active account has been set. Please call setActiveAccount or provide an account on the request."},silentPromptValueError:{code:"silent_prompt_value_error",desc:"The value given for the prompt value is not valid for silent requests - must be set to 'none' or 'no_session'."},noTokenRequestCacheError:{code:"no_token_request_cache_error",desc:"No token request found in cache."},unableToParseTokenRequestCacheError:{code:"unable_to_parse_token_request_cache_error",desc:"The cached token request could not be parsed."},noCachedAuthorityError:{code:"no_cached_authority_error",desc:"No cached authority found."},authRequestNotSet:{code:"auth_request_not_set_error",desc:"Auth Request not set. Please ensure initiateAuthRequest was called from the InteractionHandler"},invalidCacheType:{code:"invalid_cache_type",desc:"Invalid cache type"},notInBrowserEnvironment:{code:"non_browser_environment",desc:"Login and token requests are not supported in non-browser environments."},databaseNotOpen:{code:"database_not_open",desc:"Database is not open!"},noNetworkConnectivity:{code:"no_network_connectivity",desc:"No network connectivity. Check your internet connection."},postRequestFailed:{code:"post_request_failed",desc:"Network request failed: If the browser threw a CORS error, check that the redirectUri is registered in the Azure App Portal as type 'SPA'"},getRequestFailed:{code:"get_request_failed",desc:"Network request failed. Please check the network trace to determine root cause."},failedToParseNetworkResponse:{code:"failed_to_parse_response",desc:"Failed to parse network response. Check network trace."},unableToLoadTokenError:{code:"unable_to_load_token",desc:"Error loading token to cache."},signingKeyNotFoundInStorage:{code:"crypto_key_not_found",desc:"Cryptographic Key or Keypair not found in browser storage."},authCodeRequired:{code:"auth_code_required",desc:"An authorization code must be provided (as the `code` property on the request) to this flow."},authCodeOrNativeAccountRequired:{code:"auth_code_or_nativeAccountId_required",desc:"An authorization code or nativeAccountId must be provided to this flow."},databaseUnavailable:{code:"database_unavailable",desc:"IndexedDB, which is required for persistent cryptographic key storage, is unavailable. This may be caused by browser privacy features which block persistent storage in third-party contexts."},unableToAcquireTokenFromNativePlatform:{code:"unable_to_acquire_token_from_native_platform",desc:"Unable to acquire token from native platform. For a list of possible reasons visit aka.ms/msaljs/browser-errors."},nativeHandshakeTimeout:{code:"native_handshake_timeout",desc:"Timed out while attempting to establish connection to browser extension"},nativeExtensionNotInstalled:{code:"native_extension_not_installed",desc:"Native extension is not installed. If you think this is a mistake call the initialize function."},nativeConnectionNotEstablished:{code:"native_connection_not_established",desc:"Connection to native platform has not been established. Please install a compatible browser extension and run initialize(). For more please visit aka.ms/msaljs/browser-errors."},nativeBrokerCalledBeforeInitialize:{code:"native_broker_called_before_initialize",desc:"You must call and await the initialize function before attempting to call any other MSAL API when native brokering is enabled. For more please visit aka.ms/msaljs/browser-errors."},nativePromptNotSupported:{code:"native_prompt_not_supported",desc:"The provided prompt is not supported by the native platform. This request should be routed to the web based flow."}},D=function(t){It(e,t);function e(r,n){var i=t.call(this,r,n)||this;return Object.setPrototypeOf(i,e.prototype),i.name="BrowserAuthError",i}return e.createPkceNotGeneratedError=function(r){return new e(P.pkceNotGenerated.code,P.pkceNotGenerated.desc+" Detail:"+r)},e.createCryptoNotAvailableError=function(r){return new e(P.cryptoDoesNotExist.code,P.cryptoDoesNotExist.desc+" Detail:"+r)},e.createHttpMethodNotImplementedError=function(r){return new e(P.httpMethodNotImplementedError.code,P.httpMethodNotImplementedError.desc+" Given Method: "+r)},e.createEmptyNavigationUriError=function(){return new e(P.emptyNavigateUriError.code,P.emptyNavigateUriError.desc)},e.createEmptyHashError=function(r){return new e(P.hashEmptyError.code,P.hashEmptyError.desc+" Given Url: "+r)},e.createHashDoesNotContainStateError=function(){return new e(P.hashDoesNotContainStateError.code,P.hashDoesNotContainStateError.desc)},e.createHashDoesNotContainKnownPropertiesError=function(){return new e(P.hashDoesNotContainKnownPropertiesError.code,P.hashDoesNotContainKnownPropertiesError.desc)},e.createUnableToParseStateError=function(){return new e(P.unableToParseStateError.code,P.unableToParseStateError.desc)},e.createStateInteractionTypeMismatchError=function(){return new e(P.stateInteractionTypeMismatchError.code,P.stateInteractionTypeMismatchError.desc)},e.createInteractionInProgressError=function(){return new e(P.interactionInProgress.code,P.interactionInProgress.desc)},e.createPopupWindowError=function(r){var n=P.popupWindowError.desc;return n=V.isEmpty(r)?n:n+" Details: "+r,new e(P.popupWindowError.code,n)},e.createEmptyWindowCreatedError=function(){return new e(P.emptyWindowError.code,P.emptyWindowError.desc)},e.createUserCancelledError=function(){return new e(P.userCancelledError.code,P.userCancelledError.desc)},e.createMonitorPopupTimeoutError=function(){return new e(P.monitorPopupTimeoutError.code,P.monitorPopupTimeoutError.desc)},e.createMonitorIframeTimeoutError=function(){return new e(P.monitorIframeTimeoutError.code,P.monitorIframeTimeoutError.desc)},e.createRedirectInIframeError=function(r){return new e(P.redirectInIframeError.code,P.redirectInIframeError.desc+" (window.parent !== window) => "+r)},e.createBlockReloadInHiddenIframeError=function(){return new e(P.blockTokenRequestsInHiddenIframeError.code,P.blockTokenRequestsInHiddenIframeError.desc)},e.createBlockAcquireTokenInPopupsError=function(){return new e(P.blockAcquireTokenInPopupsError.code,P.blockAcquireTokenInPopupsError.desc)},e.createIframeClosedPrematurelyError=function(){return new e(P.iframeClosedPrematurelyError.code,P.iframeClosedPrematurelyError.desc)},e.createSilentLogoutUnsupportedError=function(){return new e(P.silentLogoutUnsupportedError.code,P.silentLogoutUnsupportedError.desc)},e.createNoAccountError=function(){return new e(P.noAccountError.code,P.noAccountError.desc)},e.createSilentPromptValueError=function(r){return new e(P.silentPromptValueError.code,P.silentPromptValueError.desc+" Given value: "+r)},e.createUnableToParseTokenRequestCacheError=function(){return new e(P.unableToParseTokenRequestCacheError.code,P.unableToParseTokenRequestCacheError.desc)},e.createNoTokenRequestCacheError=function(){return new e(P.noTokenRequestCacheError.code,P.noTokenRequestCacheError.desc)},e.createAuthRequestNotSetError=function(){return new e(P.authRequestNotSet.code,P.authRequestNotSet.desc)},e.createNoCachedAuthorityError=function(){return new e(P.noCachedAuthorityError.code,P.noCachedAuthorityError.desc)},e.createInvalidCacheTypeError=function(){return new e(P.invalidCacheType.code,""+P.invalidCacheType.desc)},e.createNonBrowserEnvironmentError=function(){return new e(P.notInBrowserEnvironment.code,P.notInBrowserEnvironment.desc)},e.createDatabaseNotOpenError=function(){return new e(P.databaseNotOpen.code,P.databaseNotOpen.desc)},e.createNoNetworkConnectivityError=function(){return new e(P.noNetworkConnectivity.code,P.noNetworkConnectivity.desc)},e.createPostRequestFailedError=function(r,n){return new e(P.postRequestFailed.code,P.postRequestFailed.desc+" | Network client threw: "+r+" | Attempted to reach: "+n.split("?")[0])},e.createGetRequestFailedError=function(r,n){return new e(P.getRequestFailed.code,P.getRequestFailed.desc+" | Network client threw: "+r+" | Attempted to reach: "+n.split("?")[0])},e.createFailedToParseNetworkResponseError=function(r){return new e(P.failedToParseNetworkResponse.code,P.failedToParseNetworkResponse.desc+" | Attempted to reach: "+r.split("?")[0])},e.createUnableToLoadTokenError=function(r){return new e(P.unableToLoadTokenError.code,P.unableToLoadTokenError.desc+" | "+r)},e.createSigningKeyNotFoundInStorageError=function(r){return new e(P.signingKeyNotFoundInStorage.code,P.signingKeyNotFoundInStorage.desc+" | No match found for KeyId: "+r)},e.createAuthCodeRequiredError=function(){return new e(P.authCodeRequired.code,P.authCodeRequired.desc)},e.createAuthCodeOrNativeAccountIdRequiredError=function(){return new e(P.authCodeOrNativeAccountRequired.code,P.authCodeOrNativeAccountRequired.desc)},e.createDatabaseUnavailableError=function(){return new e(P.databaseUnavailable.code,P.databaseUnavailable.desc)},e.createUnableToAcquireTokenFromNativePlatformError=function(){return new e(P.unableToAcquireTokenFromNativePlatform.code,P.unableToAcquireTokenFromNativePlatform.desc)},e.createNativeHandshakeTimeoutError=function(){return new e(P.nativeHandshakeTimeout.code,P.nativeHandshakeTimeout.desc)},e.createNativeExtensionNotInstalledError=function(){return new e(P.nativeExtensionNotInstalled.code,P.nativeExtensionNotInstalled.desc)},e.createNativeConnectionNotEstablishedError=function(){return new e(P.nativeConnectionNotEstablished.code,P.nativeConnectionNotEstablished.desc)},e.createNativeBrokerCalledBeforeInitialize=function(){return new e(P.nativeBrokerCalledBeforeInitialize.code,P.nativeBrokerCalledBeforeInitialize.desc)},e.createNativePromptParameterNotSupportedError=function(){return new e(P.nativePromptNotSupported.code,P.nativePromptNotSupported.desc)},e}(W);var rn={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"},vs={CHANNEL_ID:"53ee284d-920a-4b59-9d30-a60315b26836",PREFERRED_EXTENSION_ID:"ppnbnpeolgkicgegkbkbjmhlideopiji",MATS_TELEMETRY:"MATS"},Gn;(function(t){t.HandshakeRequest="Handshake",t.HandshakeResponse="HandshakeResponse",t.GetToken="GetToken",t.Response="Response"})(Gn||(Gn={}));var Ut;(function(t){t.LocalStorage="localStorage",t.SessionStorage="sessionStorage",t.MemoryStorage="memoryStorage"})(Ut||(Ut={}));var _n;(function(t){t.GET="GET",t.POST="POST"})(_n||(_n={}));var ye;(function(t){t.AUTHORITY="authority",t.ACQUIRE_TOKEN_ACCOUNT="acquireToken.account",t.SESSION_STATE="session.state",t.REQUEST_STATE="request.state",t.NONCE_IDTOKEN="nonce.id_token",t.ORIGIN_URI="request.origin",t.RENEW_STATUS="token.renew.status",t.URL_HASH="urlHash",t.REQUEST_PARAMS="request.params",t.SCOPES="scopes",t.INTERACTION_STATUS_KEY="interaction.status",t.CCS_CREDENTIAL="ccs.credential",t.CORRELATION_ID="request.correlationId",t.NATIVE_REQUEST="request.native",t.REDIRECT_CONTEXT="request.redirect.context"})(ye||(ye={}));var ua;(function(t){t.WRAPPER_SKU="wrapper.sku",t.WRAPPER_VER="wrapper.version"})(ua||(ua={}));var He;(function(t){t[t.acquireTokenRedirect=861]="acquireTokenRedirect",t[t.acquireTokenPopup=862]="acquireTokenPopup",t[t.ssoSilent=863]="ssoSilent",t[t.acquireTokenSilent_authCode=864]="acquireTokenSilent_authCode",t[t.handleRedirectPromise=865]="handleRedirectPromise",t[t.acquireTokenByCode=866]="acquireTokenByCode",t[t.acquireTokenSilent_silentFlow=61]="acquireTokenSilent_silentFlow",t[t.logout=961]="logout",t[t.logoutPopup=962]="logoutPopup"})(He||(He={}));var G;(function(t){t.Redirect="redirect",t.Popup="popup",t.Silent="silent",t.None="none"})(G||(G={}));var dm;(function(t){t.Startup="startup",t.Login="login",t.Logout="logout",t.AcquireToken="acquireToken",t.SsoSilent="ssoSilent",t.HandleRedirect="handleRedirect",t.None="none"})(dm||(dm={}));var hm={scopes:Tc},Ra="jwk",um;(function(t){t.React="@azure/msal-react",t.Angular="@azure/msal-angular"})(um||(um={}));var h2="msal.db",A_=1,T_=h2+".keys",fr;(function(t){t[t.Default=0]="Default",t[t.AccessToken=1]="AccessToken",t[t.AccessTokenAndRefreshToken=2]="AccessTokenAndRefreshToken",t[t.RefreshToken=3]="RefreshToken",t[t.RefreshTokenAndNetwork=4]="RefreshTokenAndNetwork",t[t.Skip=5]="Skip"})(fr||(fr={}));var hr={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."}},Yd=function(t){It(e,t);function e(r,n){var i=t.call(this,r,n)||this;return i.name="BrowserConfigurationAuthError",Object.setPrototypeOf(i,e.prototype),i}return e.createRedirectUriEmptyError=function(){return new e(hr.redirectUriNotSet.code,hr.redirectUriNotSet.desc)},e.createPostLogoutRedirectUriEmptyError=function(){return new e(hr.postLogoutUriNotSet.code,hr.postLogoutUriNotSet.desc)},e.createStorageNotSupportedError=function(r){return new e(hr.storageNotSupportedError.code,hr.storageNotSupportedError.desc+" Given Location: "+r)},e.createRedirectCallbacksNotSetError=function(){return new e(hr.noRedirectCallbacksSet.code,hr.noRedirectCallbacksSet.desc)},e.createStubPcaInstanceCalledError=function(){return new e(hr.stubPcaInstanceCalled.code,hr.stubPcaInstanceCalled.desc)},e.createInMemoryRedirectUnavailableError=function(){return new e(hr.inMemRedirectUnavailable.code,hr.inMemRedirectUnavailable.desc)},e.createEntropyNotProvided=function(){return new e(hr.entropyNotProvided.code,hr.entropyNotProvided.desc)},e}(W);var fm=function(){function t(e){this.validateWindowStorage(e),this.windowStorage=window[e]}return t.prototype.validateWindowStorage=function(e){if(e!==Ut.LocalStorage&&e!==Ut.SessionStorage)throw Yd.createStorageNotSupportedError(e);var r=!!window[e];if(!r)throw Yd.createStorageNotSupportedError(e)},t.prototype.getItem=function(e){return this.windowStorage.getItem(e)},t.prototype.setItem=function(e,r){this.windowStorage.setItem(e,r)},t.prototype.removeItem=function(e){this.windowStorage.removeItem(e)},t.prototype.getKeys=function(){return Object.keys(this.windowStorage)},t.prototype.containsKey=function(e){return this.windowStorage.hasOwnProperty(e)},t}();var u2=function(){function t(){this.cache=new Map}return t.prototype.getItem=function(e){return this.cache.get(e)||null},t.prototype.setItem=function(e,r){this.cache.set(e,r)},t.prototype.removeItem=function(e){this.cache.delete(e)},t.prototype.getKeys=function(){var e=[];return this.cache.forEach(function(r,n){e.push(n)}),e},t.prototype.containsKey=function(e){return this.cache.has(e)},t.prototype.clear=function(){this.cache.clear()},t}();var o3=function(){function t(){}return t.extractBrowserRequestState=function(e,r){if(V.isEmpty(r))return null;try{var n=Yn.parseRequestState(e,r);return n.libraryState.meta}catch(i){throw j.createInvalidStateError(r,i)}},t.parseServerResponseFromHash=function(e){if(!e)return{};var r=new be(e);return be.getDeserializedHash(r.getHash())},t}();var f2=function(t){It(e,t);function e(r,n,i,o){var a=t.call(this,r,i)||this;return a.COOKIE_LIFE_MULTIPLIER=24*60*60*1e3,a.cacheConfig=n,a.logger=o,a.internalStorage=new u2,a.browserStorage=a.setupBrowserStorage(a.cacheConfig.cacheLocation),a.temporaryCacheStorage=a.setupTemporaryCacheStorage(a.cacheConfig.cacheLocation),a.migrateCacheEntries(),a}return e.prototype.setupBrowserStorage=function(r){switch(r){case Ut.LocalStorage:case Ut.SessionStorage:try{return new fm(r)}catch(n){this.logger.verbose(n);break}}return this.cacheConfig.cacheLocation=Ut.MemoryStorage,new u2},e.prototype.setupTemporaryCacheStorage=function(r){switch(r){case Ut.LocalStorage:case Ut.SessionStorage:try{return new fm(Ut.SessionStorage)}catch(n){return this.logger.verbose(n),this.internalStorage}case Ut.MemoryStorage:default:return this.internalStorage}},e.prototype.migrateCacheEntries=function(){var r=this,n=_.CACHE_PREFIX+"."+dt.ID_TOKEN,i=_.CACHE_PREFIX+"."+dt.CLIENT_INFO,o=_.CACHE_PREFIX+"."+dt.ERROR,a=_.CACHE_PREFIX+"."+dt.ERROR_DESC,s=this.browserStorage.getItem(n),c=this.browserStorage.getItem(i),l=this.browserStorage.getItem(o),d=this.browserStorage.getItem(a),h=[s,c,l,d],u=[dt.ID_TOKEN,dt.CLIENT_INFO,dt.ERROR,dt.ERROR_DESC];u.forEach(function(f,v){return r.migrateCacheEntry(f,h[v])})},e.prototype.migrateCacheEntry=function(r,n){n&&this.setTemporaryCache(r,n,!0)},e.prototype.validateAndParseJson=function(r){try{var n=JSON.parse(r);return n&&typeof n=="object"?n:null}catch{return null}},e.prototype.getItem=function(r){return this.browserStorage.getItem(r)},e.prototype.setItem=function(r,n){this.browserStorage.setItem(r,n)},e.prototype.getAccount=function(r){var n=this.getItem(r);if(!n)return null;var i=this.validateAndParseJson(n);return!i||!kt.isAccountEntity(i)?null:Jr.toObject(new kt,i)},e.prototype.setAccount=function(r){this.logger.trace("BrowserCacheManager.setAccount called");var n=r.generateAccountKey();this.setItem(n,JSON.stringify(r))},e.prototype.getIdTokenCredential=function(r){var n=this.getItem(r);if(!n)return this.logger.trace("BrowserCacheManager.getIdTokenCredential: called, no cache hit"),null;var i=this.validateAndParseJson(n);return!i||!uc.isIdTokenEntity(i)?(this.logger.trace("BrowserCacheManager.getIdTokenCredential: called, no cache hit"),null):(this.logger.trace("BrowserCacheManager.getIdTokenCredential: cache hit"),Jr.toObject(new uc,i))},e.prototype.setIdTokenCredential=function(r){this.logger.trace("BrowserCacheManager.setIdTokenCredential called");var n=r.generateCredentialKey();this.setItem(n,JSON.stringify(r))},e.prototype.getAccessTokenCredential=function(r){var n=this.getItem(r);if(!n)return this.logger.trace("BrowserCacheManager.getAccessTokenCredential: called, no cache hit"),null;var i=this.validateAndParseJson(n);return!i||!fc.isAccessTokenEntity(i)?(this.logger.trace("BrowserCacheManager.getAccessTokenCredential: called, no cache hit"),null):(this.logger.trace("BrowserCacheManager.getAccessTokenCredential: cache hit"),Jr.toObject(new fc,i))},e.prototype.setAccessTokenCredential=function(r){this.logger.trace("BrowserCacheManager.setAccessTokenCredential called");var n=r.generateCredentialKey();this.setItem(n,JSON.stringify(r))},e.prototype.getRefreshTokenCredential=function(r){var n=this.getItem(r);if(!n)return this.logger.trace("BrowserCacheManager.getRefreshTokenCredential: called, no cache hit"),null;var i=this.validateAndParseJson(n);return!i||!jd.isRefreshTokenEntity(i)?(this.logger.trace("BrowserCacheManager.getRefreshTokenCredential: called, no cache hit"),null):(this.logger.trace("BrowserCacheManager.getRefreshTokenCredential: cache hit"),Jr.toObject(new jd,i))},e.prototype.setRefreshTokenCredential=function(r){this.logger.trace("BrowserCacheManager.setRefreshTokenCredential called");var n=r.generateCredentialKey();this.setItem(n,JSON.stringify(r))},e.prototype.getAppMetadata=function(r){var n=this.getItem(r);if(!n)return this.logger.trace("BrowserCacheManager.getAppMetadata: called, no cache hit"),null;var i=this.validateAndParseJson(n);return!i||!l2.isAppMetadataEntity(r,i)?(this.logger.trace("BrowserCacheManager.getAppMetadata: called, no cache hit"),null):(this.logger.trace("BrowserCacheManager.getAppMetadata: cache hit"),Jr.toObject(new l2,i))},e.prototype.setAppMetadata=function(r){this.logger.trace("BrowserCacheManager.setAppMetadata called");var n=r.generateAppMetadataKey();this.setItem(n,JSON.stringify(r))},e.prototype.getServerTelemetry=function(r){var n=this.getItem(r);if(!n)return this.logger.trace("BrowserCacheManager.getServerTelemetry: called, no cache hit"),null;var i=this.validateAndParseJson(n);return!i||!Wd.isServerTelemetryEntity(r,i)?(this.logger.trace("BrowserCacheManager.getServerTelemetry: called, no cache hit"),null):(this.logger.trace("BrowserCacheManager.getServerTelemetry: cache hit"),Jr.toObject(new Wd,i))},e.prototype.setServerTelemetry=function(r,n){this.logger.trace("BrowserCacheManager.setServerTelemetry called"),this.setItem(r,JSON.stringify(n))},e.prototype.getAuthorityMetadata=function(r){var n=this.internalStorage.getItem(r);if(!n)return this.logger.trace("BrowserCacheManager.getAuthorityMetadata: called, no cache hit"),null;var i=this.validateAndParseJson(n);return i&&d2.isAuthorityMetadataEntity(r,i)?(this.logger.trace("BrowserCacheManager.getAuthorityMetadata: cache hit"),Jr.toObject(new d2,i)):null},e.prototype.getAuthorityMetadataKeys=function(){var r=this,n=this.internalStorage.getKeys();return n.filter(function(i){return r.isAuthorityMetadata(i)})},e.prototype.setWrapperMetadata=function(r,n){this.internalStorage.setItem(ua.WRAPPER_SKU,r),this.internalStorage.setItem(ua.WRAPPER_VER,n)},e.prototype.getWrapperMetadata=function(){var r=this.internalStorage.getItem(ua.WRAPPER_SKU)||_.EMPTY_STRING,n=this.internalStorage.getItem(ua.WRAPPER_VER)||_.EMPTY_STRING;return[r,n]},e.prototype.setAuthorityMetadata=function(r,n){this.logger.trace("BrowserCacheManager.setAuthorityMetadata called"),this.internalStorage.setItem(r,JSON.stringify(n))},e.prototype.getActiveAccount=function(){var r=this.generateCacheKey(dt.ACTIVE_ACCOUNT_FILTERS),n=this.getItem(r);if(!n){this.logger.trace("No active account filters cache schema found, looking for legacy schema");var i=this.generateCacheKey(dt.ACTIVE_ACCOUNT),o=this.getItem(i);if(!o)return this.logger.trace("No active account found"),null;var a=this.getAccountInfoByFilter({localAccountId:o})[0]||null;return a?(this.logger.trace("Legacy active account cache schema found"),this.logger.trace("Adding active account filters cache schema"),this.setActiveAccount(a),a):null}var s=this.validateAndParseJson(n);return s?(this.logger.trace("Active account filters schema found"),this.getAccountInfoByFilter({homeAccountId:s.homeAccountId,localAccountId:s.localAccountId})[0]||null):(this.logger.trace("No active account found"),null)},e.prototype.setActiveAccount=function(r){var n=this.generateCacheKey(dt.ACTIVE_ACCOUNT_FILTERS),i=this.generateCacheKey(dt.ACTIVE_ACCOUNT);if(r){this.logger.verbose("setActiveAccount: Active account set");var o={homeAccountId:r.homeAccountId,localAccountId:r.localAccountId};this.browserStorage.setItem(n,JSON.stringify(o)),this.browserStorage.setItem(i,r.localAccountId)}else this.logger.verbose("setActiveAccount: No account passed, active account not set"),this.browserStorage.removeItem(n),this.browserStorage.removeItem(i)},e.prototype.getAccountInfoByFilter=function(r){var n=this.getAllAccounts();return n.filter(function(i){return!(r.username&&r.username.toLowerCase()!==i.username.toLowerCase()||r.homeAccountId&&r.homeAccountId!==i.homeAccountId||r.localAccountId&&r.localAccountId!==i.localAccountId||r.tenantId&&r.tenantId!==i.tenantId||r.environment&&r.environment!==i.environment)})},e.prototype.getAccountInfoByHints=function(r,n){var i=this.getAllAccounts().filter(function(o){if(n){var a=o.idTokenClaims&&o.idTokenClaims.sid;return n===a}return r?r===o.username:!1});if(i.length===1)return i[0];if(i.length>1)throw j.createMultipleMatchingAccountsInCacheError();return null},e.prototype.getThrottlingCache=function(r){var n=this.getItem(r);if(!n)return this.logger.trace("BrowserCacheManager.getThrottlingCache: called, no cache hit"),null;var i=this.validateAndParseJson(n);return!i||!cm.isThrottlingEntity(r,i)?(this.logger.trace("BrowserCacheManager.getThrottlingCache: called, no cache hit"),null):(this.logger.trace("BrowserCacheManager.getThrottlingCache: cache hit"),Jr.toObject(new cm,i))},e.prototype.setThrottlingCache=function(r,n){this.logger.trace("BrowserCacheManager.setThrottlingCache called"),this.setItem(r,JSON.stringify(n))},e.prototype.getTemporaryCache=function(r,n){var i=n?this.generateCacheKey(r):r;if(this.cacheConfig.storeAuthStateInCookie){var o=this.getItemCookie(i);if(o)return this.logger.trace("BrowserCacheManager.getTemporaryCache: storeAuthStateInCookies set to true, retrieving from cookies"),o}var a=this.temporaryCacheStorage.getItem(i);if(!a){if(this.cacheConfig.cacheLocation===Ut.LocalStorage){var s=this.browserStorage.getItem(i);if(s)return this.logger.trace("BrowserCacheManager.getTemporaryCache: Temporary cache item found in local storage"),s}return this.logger.trace("BrowserCacheManager.getTemporaryCache: No cache item found in local storage"),null}return this.logger.trace("BrowserCacheManager.getTemporaryCache: Temporary cache item returned"),a},e.prototype.setTemporaryCache=function(r,n,i){var o=i?this.generateCacheKey(r):r;this.temporaryCacheStorage.setItem(o,n),this.cacheConfig.storeAuthStateInCookie&&(this.logger.trace("BrowserCacheManager.setTemporaryCache: storeAuthStateInCookie set to true, setting item cookie"),this.setItemCookie(o,n))},e.prototype.removeItem=function(r){return this.browserStorage.removeItem(r),this.temporaryCacheStorage.removeItem(r),this.cacheConfig.storeAuthStateInCookie&&(this.logger.trace("BrowserCacheManager.removeItem: storeAuthStateInCookie is true, clearing item cookie"),this.clearItemCookie(r)),!0},e.prototype.containsKey=function(r){return this.browserStorage.containsKey(r)||this.temporaryCacheStorage.containsKey(r)},e.prototype.getKeys=function(){return e0(this.browserStorage.getKeys(),this.temporaryCacheStorage.getKeys())},e.prototype.clear=function(){return S(this,void 0,void 0,function(){var r=this;return k(this,function(n){switch(n.label){case 0:return[4,this.removeAllAccounts()];case 1:return n.sent(),this.removeAppMetadata(),this.getKeys().forEach(function(i){(r.browserStorage.containsKey(i)||r.temporaryCacheStorage.containsKey(i))&&(i.indexOf(_.CACHE_PREFIX)!==-1||i.indexOf(r.clientId)!==-1)&&r.removeItem(i)}),this.internalStorage.clear(),[2]}})})},e.prototype.setItemCookie=function(r,n,i){var o=encodeURIComponent(r)+"="+encodeURIComponent(n)+";path=/;SameSite=Lax;";if(i){var a=this.getCookieExpirationTime(i);o+="expires="+a+";"}this.cacheConfig.secureCookies&&(o+="Secure;"),document.cookie=o},e.prototype.getItemCookie=function(r){for(var n=encodeURIComponent(r)+"=",i=document.cookie.split(";"),o=0;o<i.length;o++){for(var a=i[o];a.charAt(0)===" ";)a=a.substring(1);if(a.indexOf(n)===0)return decodeURIComponent(a.substring(n.length,a.length))}return _.EMPTY_STRING},e.prototype.clearMsalCookies=function(){var r=this,n=_.CACHE_PREFIX+"."+this.clientId,i=document.cookie.split(";");i.forEach(function(o){for(;o.charAt(0)===" ";)o=o.substring(1);if(o.indexOf(n)===0){var a=o.split("=")[0];r.clearItemCookie(a)}})},e.prototype.clearItemCookie=function(r){this.setItemCookie(r,_.EMPTY_STRING,-1)},e.prototype.getCookieExpirationTime=function(r){var n=new Date,i=new Date(n.getTime()+r*this.COOKIE_LIFE_MULTIPLIER);return i.toUTCString()},e.prototype.getCache=function(){return this.browserStorage},e.prototype.setCache=function(){},e.prototype.generateCacheKey=function(r){var n=this.validateAndParseJson(r);return n?JSON.stringify(r):V.startsWith(r,_.CACHE_PREFIX)||V.startsWith(r,dt.ADAL_ID_TOKEN)?r:_.CACHE_PREFIX+"."+this.clientId+"."+r},e.prototype.generateAuthorityKey=function(r){var n=Yn.parseRequestState(this.cryptoImpl,r).libraryState.id;return this.generateCacheKey(ye.AUTHORITY+"."+n)},e.prototype.generateNonceKey=function(r){var n=Yn.parseRequestState(this.cryptoImpl,r).libraryState.id;return this.generateCacheKey(ye.NONCE_IDTOKEN+"."+n)},e.prototype.generateStateKey=function(r){var n=Yn.parseRequestState(this.cryptoImpl,r).libraryState.id;return this.generateCacheKey(ye.REQUEST_STATE+"."+n)},e.prototype.getCachedAuthority=function(r){var n=this.generateStateKey(r),i=this.getTemporaryCache(n);if(!i)return null;var o=this.generateAuthorityKey(i);return this.getTemporaryCache(o)},e.prototype.updateCacheEntries=function(r,n,i,o,a){this.logger.trace("BrowserCacheManager.updateCacheEntries called");var s=this.generateStateKey(r);this.setTemporaryCache(s,r,!1);var c=this.generateNonceKey(r);this.setTemporaryCache(c,n,!1);var l=this.generateAuthorityKey(r);if(this.setTemporaryCache(l,i,!1),a){var d={credential:a.homeAccountId,type:kr.HOME_ACCOUNT_ID};this.setTemporaryCache(ye.CCS_CREDENTIAL,JSON.stringify(d),!0)}else if(!V.isEmpty(o)){var d={credential:o,type:kr.UPN};this.setTemporaryCache(ye.CCS_CREDENTIAL,JSON.stringify(d),!0)}},e.prototype.resetRequestCache=function(r){var n=this;this.logger.trace("BrowserCacheManager.resetRequestCache called"),V.isEmpty(r)||this.getKeys().forEach(function(i){i.indexOf(r)!==-1&&n.removeItem(i)}),r&&(this.removeItem(this.generateStateKey(r)),this.removeItem(this.generateNonceKey(r)),this.removeItem(this.generateAuthorityKey(r))),this.removeItem(this.generateCacheKey(ye.REQUEST_PARAMS)),this.removeItem(this.generateCacheKey(ye.ORIGIN_URI)),this.removeItem(this.generateCacheKey(ye.URL_HASH)),this.removeItem(this.generateCacheKey(ye.CORRELATION_ID)),this.removeItem(this.generateCacheKey(ye.CCS_CREDENTIAL)),this.removeItem(this.generateCacheKey(ye.NATIVE_REQUEST)),this.setInteractionInProgress(!1)},e.prototype.cleanRequestByState=function(r){if(this.logger.trace("BrowserCacheManager.cleanRequestByState called"),r){var n=this.generateStateKey(r),i=this.temporaryCacheStorage.getItem(n);this.logger.infoPii("BrowserCacheManager.cleanRequestByState: Removing temporary cache items for state: "+i),this.resetRequestCache(i||_.EMPTY_STRING)}this.clearMsalCookies()},e.prototype.cleanRequestByInteractionType=function(r){var n=this;this.logger.trace("BrowserCacheManager.cleanRequestByInteractionType called"),this.getKeys().forEach(function(i){if(i.indexOf(ye.REQUEST_STATE)!==-1){var o=n.temporaryCacheStorage.getItem(i);if(!!o){var a=o3.extractBrowserRequestState(n.cryptoImpl,o);a&&a.interactionType===r&&(n.logger.infoPii("BrowserCacheManager.cleanRequestByInteractionType: Removing temporary cache items for state: "+o),n.resetRequestCache(o))}}}),this.clearMsalCookies(),this.setInteractionInProgress(!1)},e.prototype.cacheCodeRequest=function(r,n){this.logger.trace("BrowserCacheManager.cacheCodeRequest called");var i=n.base64Encode(JSON.stringify(r));this.setTemporaryCache(ye.REQUEST_PARAMS,i,!0)},e.prototype.getCachedRequest=function(r,n){this.logger.trace("BrowserCacheManager.getCachedRequest called");var i=this.getTemporaryCache(ye.REQUEST_PARAMS,!0);if(!i)throw D.createNoTokenRequestCacheError();var o=this.validateAndParseJson(n.base64Decode(i));if(!o)throw D.createUnableToParseTokenRequestCacheError();if(this.removeItem(this.generateCacheKey(ye.REQUEST_PARAMS)),V.isEmpty(o.authority)){var a=this.generateAuthorityKey(r),s=this.getTemporaryCache(a);if(!s)throw D.createNoCachedAuthorityError();o.authority=s}return o},e.prototype.getCachedNativeRequest=function(){this.logger.trace("BrowserCacheManager.getCachedNativeRequest called");var r=this.getTemporaryCache(ye.NATIVE_REQUEST,!0);if(!r)return this.logger.trace("BrowserCacheManager.getCachedNativeRequest: No cached native request found"),null;var n=this.validateAndParseJson(r);return n||(this.logger.error("BrowserCacheManager.getCachedNativeRequest: Unable to parse native request"),null)},e.prototype.isInteractionInProgress=function(r){var n=this.getInteractionInProgress();return r?n===this.clientId:!!n},e.prototype.getInteractionInProgress=function(){var r=_.CACHE_PREFIX+"."+ye.INTERACTION_STATUS_KEY;return this.getTemporaryCache(r,!1)},e.prototype.setInteractionInProgress=function(r){var n=_.CACHE_PREFIX+"."+ye.INTERACTION_STATUS_KEY;if(r){if(this.getInteractionInProgress())throw D.createInteractionInProgressError();this.setTemporaryCache(n,this.clientId,!1)}else!r&&this.getInteractionInProgress()===this.clientId&&this.removeItem(n)},e.prototype.getLegacyLoginHint=function(){var r=this.getTemporaryCache(dt.ADAL_ID_TOKEN);r&&(this.browserStorage.removeItem(dt.ADAL_ID_TOKEN),this.logger.verbose("Cached ADAL id token retrieved."));var n=this.getTemporaryCache(dt.ID_TOKEN,!0);n&&(this.removeItem(this.generateCacheKey(dt.ID_TOKEN)),this.logger.verbose("Cached MSAL.js v1 id token retrieved"));var i=n||r;if(i){var o=new Tn(i,this.cryptoImpl);if(o.claims&&o.claims.preferred_username)return this.logger.verbose("No SSO params used and ADAL/MSAL v1 token retrieved, setting ADAL/MSAL v1 preferred_username as loginHint"),o.claims.preferred_username;if(o.claims&&o.claims.upn)return this.logger.verbose("No SSO params used and ADAL/MSAL v1 token retrieved, setting ADAL/MSAL v1 upn as loginHint"),o.claims.upn;this.logger.verbose("No SSO params used and ADAL/MSAL v1 token retrieved, however, no account hint claim found. Enable preferred_username or upn id token claim to get SSO.")}return null},e.prototype.updateCredentialCacheKey=function(r,n){var i=n.generateCredentialKey();if(r!==i){var o=this.getItem(r);if(o)return this.removeItem(r),this.setItem(i,o),this.logger.verbose("Updated an outdated "+n.credentialType+" cache key"),i;this.logger.error("Attempted to update an outdated "+n.credentialType+" cache key but no item matching the outdated key was found in storage")}return r},e.prototype.getRedirectRequestContext=function(){return this.getTemporaryCache(ye.REDIRECT_CONTEXT,!0)},e.prototype.setRedirectRequestContext=function(r){this.setTemporaryCache(ye.REDIRECT_CONTEXT,r,!0)},e}(Jr),I_=function(t,e){var r={cacheLocation:Ut.MemoryStorage,storeAuthStateInCookie:!1,secureCookies:!1};return new f2(t,r,Fd,e)};var wh="@azure/msal-browser",Us="2.32.1";var M_=function(){function t(){}return t.prototype.sendGetRequestAsync=function(e,r){return S(this,void 0,void 0,function(){var n,i,o;return k(this,function(a){switch(a.label){case 0:return a.trys.push([0,2,,3]),[4,fetch(e,{method:_n.GET,headers:this.getFetchHeaders(r)})];case 1:return n=a.sent(),[3,3];case 2:throw i=a.sent(),window.navigator.onLine?D.createGetRequestFailedError(i,e):D.createNoNetworkConnectivityError();case 3:return a.trys.push([3,5,,6]),o={headers:this.getHeaderDict(n.headers)},[4,n.json()];case 4:return[2,(o.body=a.sent(),o.status=n.status,o)];case 5:throw a.sent(),D.createFailedToParseNetworkResponseError(e);case 6:return[2]}})})},t.prototype.sendPostRequestAsync=function(e,r){return S(this,void 0,void 0,function(){var n,i,o,a;return k(this,function(s){switch(s.label){case 0:n=r&&r.body||_.EMPTY_STRING,s.label=1;case 1:return s.trys.push([1,3,,4]),[4,fetch(e,{method:_n.POST,headers:this.getFetchHeaders(r),body:n})];case 2:return i=s.sent(),[3,4];case 3:throw o=s.sent(),window.navigator.onLine?D.createPostRequestFailedError(o,e):D.createNoNetworkConnectivityError();case 4:return s.trys.push([4,6,,7]),a={headers:this.getHeaderDict(i.headers)},[4,i.json()];case 5:return[2,(a.body=s.sent(),a.status=i.status,a)];case 6:throw s.sent(),D.createFailedToParseNetworkResponseError(e);case 7:return[2]}})})},t.prototype.getFetchHeaders=function(e){var r=new Headers;if(!(e&&e.headers))return r;var n=e.headers;return Object.keys(n).forEach(function(i){r.append(i,n[i])}),r},t.prototype.getHeaderDict=function(e){var r={};return e.forEach(function(n,i){r[i]=n}),r},t}();var P_=function(){function t(){}return t.prototype.sendGetRequestAsync=function(e,r){return S(this,void 0,void 0,function(){return k(this,function(n){return[2,this.sendRequestAsync(e,_n.GET,r)]})})},t.prototype.sendPostRequestAsync=function(e,r){return S(this,void 0,void 0,function(){return k(this,function(n){return[2,this.sendRequestAsync(e,_n.POST,r)]})})},t.prototype.sendRequestAsync=function(e,r,n){var i=this;return new Promise(function(o,a){var s=new XMLHttpRequest;if(s.open(r,e,!0),i.setXhrHeaders(s,n),s.onload=function(){(s.status<200||s.status>=300)&&(r===_n.POST?a(D.createPostRequestFailedError("Failed with status "+s.status,e)):a(D.createGetRequestFailedError("Failed with status "+s.status,e)));try{var c=JSON.parse(s.responseText),l={headers:i.getHeaderDict(s),body:c,status:s.status};o(l)}catch{a(D.createFailedToParseNetworkResponseError(e))}},s.onerror=function(){window.navigator.onLine?r===_n.POST?a(D.createPostRequestFailedError("Failed with status "+s.status,e)):a(D.createGetRequestFailedError("Failed with status "+s.status,e)):a(D.createNoNetworkConnectivityError())},r===_n.POST&&n&&n.body)s.send(n.body);else if(r===_n.GET)s.send();else throw D.createHttpMethodNotImplementedError(r)})},t.prototype.setXhrHeaders=function(e,r){if(r&&r.headers){var n=r.headers;Object.keys(n).forEach(function(i){e.setRequestHeader(i,n[i])})}},t.prototype.getHeaderDict=function(e){var r=e.getAllResponseHeaders(),n=r.trim().split(/[\r\n]+/),i={};return n.forEach(function(o){var a=o.split(": "),s=a.shift(),c=a.join(": ");s&&c&&(i[s]=c)}),i},t}();var Je=function(){function t(){}return t.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)},t.replaceHash=function(e){var r=e.split("#");r.shift(),window.location.hash=r.length>0?r.join("#"):_.EMPTY_STRING},t.isInIframe=function(){return window.parent!==window},t.isInPopup=function(){return typeof window<"u"&&!!window.opener&&window.opener!==window&&typeof window.name=="string"&&window.name.indexOf(rn.POPUP_NAME_PREFIX+".")===0},t.getCurrentUri=function(){return window.location.href.split("?")[0].split("#")[0]},t.getHomepage=function(){var e=new be(window.location.href),r=e.getUrlComponents();return r.Protocol+"//"+r.HostNameAndPort+"/"},t.getBrowserNetworkClient=function(){return window.fetch&&window.Headers?new M_:new P_},t.blockReloadInHiddenIframes=function(){var e=be.hashContainsKnownProperties(window.location.hash);if(e&&t.isInIframe())throw D.createBlockReloadInHiddenIframeError()},t.blockRedirectInIframe=function(e,r){var n=t.isInIframe();if(e===G.Redirect&&n&&!r)throw D.createRedirectInIframeError(n)},t.blockAcquireTokenInPopups=function(){if(t.isInPopup())throw D.createBlockAcquireTokenInPopupsError()},t.blockNonBrowserEnvironment=function(e){if(!e)throw D.createNonBrowserEnvironmentError()},t.blockNativeBrokerCalledBeforeInitialized=function(e,r){if(e&&!r)throw D.createNativeBrokerCalledBeforeInitialize()},t.detectIEOrEdge=function(){var e=window.navigator.userAgent,r=e.indexOf("MSIE "),n=e.indexOf("Trident/"),i=e.indexOf("Edge/"),o=r>0||n>0,a=i>0;return o||a},t}();var a3=function(){function t(e,r,n,i,o,a,s,c,l){this.config=e,this.browserStorage=r,this.browserCrypto=n,this.networkClient=this.config.system.networkClient,this.eventHandler=o,this.navigationClient=a,this.nativeMessageHandler=c,this.correlationId=l||this.browserCrypto.createNewGuid(),this.logger=i.clone(rn.MSAL_SKU,Us,this.correlationId),this.performanceClient=s}return t.prototype.clearCacheOnLogout=function(e){return S(this,void 0,void 0,function(){return k(this,function(r){switch(r.label){case 0:if(!e)return[3,5];kt.accountInfoIsEqual(e,this.browserStorage.getActiveAccount(),!1)&&(this.logger.verbose("Setting active account to null"),this.browserStorage.setActiveAccount(null)),r.label=1;case 1:return r.trys.push([1,3,,4]),[4,this.browserStorage.removeAccount(kt.generateAccountCacheKey(e))];case 2:return r.sent(),this.logger.verbose("Cleared cache items belonging to the account provided in the logout request."),[3,4];case 3:return r.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 r.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 r.sent(),[4,this.browserCrypto.clearKeystore()];case 7:return r.sent(),[3,9];case 8:return r.sent(),this.logger.error("Attempted to clear all MSAL cache items and failed. Local cache unchanged."),[3,9];case 9:return[2]}})})},t.prototype.initializeBaseRequest=function(e){return S(this,void 0,void 0,function(){var r,n,i,o;return k(this,function(a){switch(a.label){case 0:if(this.logger.verbose("Initializing BaseAuthRequest"),r=e.authority||this.config.auth.authority,n=e0(e&&e.scopes||[]),i=K(K({},e),{correlationId:this.correlationId,authority:r,scopes:n}),!i.authenticationScheme)i.authenticationScheme=Se.BEARER,this.logger.verbose(`Authentication Scheme wasn't explicitly set in request, defaulting to "Bearer" request`);else{if(i.authenticationScheme===Se.SSH){if(!e.sshJwk)throw Fe.createMissingSshJwkError();if(!e.sshKid)throw Fe.createMissingSshKidError()}this.logger.verbose('Authentication Scheme set to "'+i.authenticationScheme+'" as configured in Auth request')}return e.claims&&!V.isEmpty(e.claims)?(o=i,[4,this.browserCrypto.hashString(e.claims)]):[3,2];case 1:o.requestedClaimsHash=a.sent(),a.label=2;case 2:return[2,i]}})})},t.prototype.getRedirectUri=function(e){this.logger.verbose("getRedirectUri called");var r=e||this.config.auth.redirectUri||Je.getCurrentUri();return be.getAbsoluteUrl(r,Je.getCurrentUri())},t.prototype.initializeServerTelemetryManager=function(e,r){this.logger.verbose("initializeServerTelemetryManager called");var n={clientId:this.config.auth.clientId,correlationId:this.correlationId,apiId:e,forceRefresh:r||!1,wrapperSKU:this.browserStorage.getWrapperMetadata()[0],wrapperVer:this.browserStorage.getWrapperMetadata()[1]};return new z_(n,this.browserStorage)},t.prototype.getDiscoveredAuthority=function(e){return S(this,void 0,void 0,function(){var r;return k(this,function(n){switch(n.label){case 0:return this.logger.verbose("getDiscoveredAuthority called"),r={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,Kd.createDiscoveredInstance(e,this.config.system.networkClient,this.browserStorage,r,this.logger)]):[3,2];case 1:return[2,n.sent()];case 2:return this.logger.verbose("Creating discovered authority with configured authority"),[4,Kd.createDiscoveredInstance(this.config.auth.authority,this.config.system.networkClient,this.browserStorage,r,this.logger)];case 3:return[2,n.sent()]}})})},t}();var $a=function(t){It(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.initializeAuthorizationCodeRequest=function(r){return S(this,void 0,void 0,function(){var n,i;return k(this,function(o){switch(o.label){case 0:return this.logger.verbose("initializeAuthorizationRequest called",r.correlationId),[4,this.browserCrypto.generatePkceCodes()];case 1:return n=o.sent(),i=K(K({},r),{redirectUri:r.redirectUri,code:_.EMPTY_STRING,codeVerifier:n.verifier}),r.codeChallenge=n.challenge,r.codeChallengeMethod=_.S256_CODE_CHALLENGE_METHOD,[2,i]}})})},e.prototype.initializeLogoutRequest=function(r){this.logger.verbose("initializeLogoutRequest called",r==null?void 0:r.correlationId);var n=K({correlationId:this.correlationId||this.browserCrypto.createNewGuid()},r);if(r)if(r.logoutHint)this.logger.verbose("logoutHint has already been set in logoutRequest");else if(r.account){var i=this.getLogoutHintFromIdTokenClaims(r.account);i&&(this.logger.verbose("Setting logoutHint to login_hint ID Token Claim value for the account provided"),n.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!r||r.postLogoutRedirectUri!==null?r&&r.postLogoutRedirectUri?(this.logger.verbose("Setting postLogoutRedirectUri to uri set on logout request",n.correlationId),n.postLogoutRedirectUri=be.getAbsoluteUrl(r.postLogoutRedirectUri,Je.getCurrentUri())):this.config.auth.postLogoutRedirectUri===null?this.logger.verbose("postLogoutRedirectUri configured as null and no uri set on request, not passing post logout redirect",n.correlationId):this.config.auth.postLogoutRedirectUri?(this.logger.verbose("Setting postLogoutRedirectUri to configured uri",n.correlationId),n.postLogoutRedirectUri=be.getAbsoluteUrl(this.config.auth.postLogoutRedirectUri,Je.getCurrentUri())):(this.logger.verbose("Setting postLogoutRedirectUri to current page",n.correlationId),n.postLogoutRedirectUri=be.getAbsoluteUrl(Je.getCurrentUri(),Je.getCurrentUri())):this.logger.verbose("postLogoutRedirectUri passed as null, not setting post logout redirect uri",n.correlationId),n},e.prototype.getLogoutHintFromIdTokenClaims=function(r){var n=r.idTokenClaims;if(n){if(n.login_hint)return n.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(r,n,i){return S(this,void 0,void 0,function(){var o;return k(this,function(a){switch(a.label){case 0:return[4,this.getClientConfiguration(r,n,i)];case 1:return o=a.sent(),[2,new t3(o)]}})})},e.prototype.getClientConfiguration=function(r,n,i){return S(this,void 0,void 0,function(){var o;return k(this,function(a){switch(a.label){case 0:return this.logger.verbose("getClientConfiguration called",this.correlationId),[4,this.getDiscoveredAuthority(n,i)];case 1:return o=a.sent(),[2,{authOptions:{clientId:this.config.auth.clientId,authority:o,clientCapabilities:this.config.auth.clientCapabilities},systemOptions:{tokenRenewalOffsetSeconds:this.config.system.tokenRenewalOffsetSeconds,preventCorsPreflight:!0},loggerOptions:{loggerCallback:this.config.system.loggerOptions.loggerCallback,piiLoggingEnabled:this.config.system.loggerOptions.piiLoggingEnabled,logLevel:this.config.system.loggerOptions.logLevel,correlationId:this.correlationId},cryptoInterface:this.browserCrypto,networkInterface:this.networkClient,storageInterface:this.browserStorage,serverTelemetryManager:r,libraryInfo:{sku:rn.MSAL_SKU,version:Us,cpu:_.EMPTY_STRING,os:_.EMPTY_STRING},telemetry:this.config.telemetry}]}})})},e.prototype.validateAndExtractStateFromHash=function(r,n,i){if(this.logger.verbose("validateAndExtractStateFromHash called",i),!r.state)throw D.createHashDoesNotContainStateError();var o=o3.extractBrowserRequestState(this.browserCrypto,r.state);if(!o)throw D.createUnableToParseStateError();if(o.interactionType!==n)throw D.createStateInteractionTypeMismatchError();return this.logger.verbose("Returning state from hash",i),r.state},e.prototype.getDiscoveredAuthority=function(r,n){return S(this,void 0,void 0,function(){var i,o,a,s;return k(this,function(c){switch(c.label){case 0:return this.logger.verbose("getDiscoveredAuthority called",this.correlationId),i=this.performanceClient.startMeasurement(pt.StandardInteractionClientGetDiscoveredAuthority,this.correlationId),o={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=r||this.config.auth.authority,s=Gd.generateAuthority(a,n||this.config.auth.azureCloudOptions),this.logger.verbose("Creating discovered authority with configured authority",this.correlationId),[4,Kd.createDiscoveredInstance(s,this.config.system.networkClient,this.browserStorage,o,this.logger).then(function(l){return i.endMeasurement({success:!0}),l}).catch(function(l){throw i.endMeasurement({errorCode:l.errorCode,subErrorCode:l.subError,success:!1}),l})];case 1:return[2,c.sent()]}})})},e.prototype.initializeAuthorizationRequest=function(r,n){return S(this,void 0,void 0,function(){var i,o,a,s,c,l,d;return k(this,function(h){switch(h.label){case 0:return this.logger.verbose("initializeAuthorizationRequest called",this.correlationId),i=this.getRedirectUri(r.redirectUri),o={interactionType:n},a=Yn.setRequestState(this.browserCrypto,r&&r.state||_.EMPTY_STRING,o),c=[{}],[4,this.initializeBaseRequest(r)];case 1:return s=K.apply(void 0,[K.apply(void 0,c.concat([h.sent()])),{redirectUri:i,state:a,nonce:r.nonce||this.browserCrypto.createNewGuid(),responseMode:Od.FRAGMENT}]),l=r.account||this.browserStorage.getActiveAccount(),l&&(this.logger.verbose("Setting validated request account",this.correlationId),this.logger.verbosePii("Setting validated request account: "+l.homeAccountId,this.correlationId),s.account=l),V.isEmpty(s.loginHint)&&!l&&(d=this.browserStorage.getLegacyLoginHint(),d&&(s.loginHint=d)),[2,s]}})})},e}(a3);var n0=function(){function t(e,r,n,i){this.authModule=e,this.browserStorage=r,this.authCodeRequest=n,this.logger=i}return t.prototype.handleCodeResponseFromHash=function(e,r,n,i){return S(this,void 0,void 0,function(){var o,a,s;return k(this,function(c){if(this.logger.verbose("InteractionHandler.handleCodeResponse called"),V.isEmpty(e))throw D.createEmptyHashError(e);if(o=this.browserStorage.generateStateKey(r),a=this.browserStorage.getTemporaryCache(o),!a)throw j.createStateNotFoundError("Cached State");try{s=this.authModule.handleFragmentResponse(e,a)}catch(l){throw l instanceof So&&l.subError===P.userCancelledError.code?D.createUserCancelledError():l}return[2,this.handleCodeResponseFromServer(s,r,n,i)]})})},t.prototype.handleCodeResponseFromServer=function(e,r,n,i,o){return o===void 0&&(o=!0),S(this,void 0,void 0,function(){var a,s,c,l,d,h;return k(this,function(u){switch(u.label){case 0:if(this.logger.trace("InteractionHandler.handleCodeResponseFromServer called"),a=this.browserStorage.generateStateKey(r),s=this.browserStorage.getTemporaryCache(a),!s)throw j.createStateNotFoundError("Cached State");return c=this.browserStorage.generateNonceKey(s),l=this.browserStorage.getTemporaryCache(c),this.authCodeRequest.code=e.code,e.cloud_instance_host_name?[4,this.updateTokenEndpointAuthority(e.cloud_instance_host_name,n,i)]:[3,2];case 1:u.sent(),u.label=2;case 2:return o&&(e.nonce=l||void 0),e.state=s,e.client_info?this.authCodeRequest.clientInfo=e.client_info:(d=this.checkCcsCredentials(),d&&(this.authCodeRequest.ccsCredential=d)),[4,this.authModule.acquireToken(this.authCodeRequest,e)];case 3:return h=u.sent(),this.browserStorage.cleanRequestByState(r),[2,h]}})})},t.prototype.updateTokenEndpointAuthority=function(e,r,n){return S(this,void 0,void 0,function(){var i,o;return k(this,function(a){switch(a.label){case 0:return i="https://"+e+"/"+r.tenant+"/",[4,Kd.createDiscoveredInstance(i,n,this.browserStorage,r.options,this.logger)];case 1:return o=a.sent(),this.authModule.updateAuthority(o),[2]}})})},t.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},t}();var pm=function(t){It(e,t);function e(r,n,i,o,a){var s=t.call(this,r,n,i,o)||this;return s.browserCrypto=a,s}return e.prototype.initiateAuthRequest=function(r,n){return S(this,void 0,void 0,function(){var i,o;return k(this,function(a){switch(a.label){case 0:return this.logger.verbose("RedirectHandler.initiateAuthRequest called"),V.isEmpty(r)?[3,7]:(n.redirectStartPage&&(this.logger.verbose("RedirectHandler.initiateAuthRequest: redirectStartPage set, caching start page"),this.browserStorage.setTemporaryCache(ye.ORIGIN_URI,n.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: "+r),i={apiId:He.acquireTokenRedirect,timeout:n.redirectTimeout,noHistory:!1},typeof n.onRedirectNavigate!="function"?[3,4]:(this.logger.verbose("RedirectHandler.initiateAuthRequest: Invoking onRedirectNavigate callback"),o=n.onRedirectNavigate(r),o===!1?[3,2]:(this.logger.verbose("RedirectHandler.initiateAuthRequest: onRedirectNavigate did not return false, navigating"),[4,n.navigationClient.navigateExternal(r,i)])));case 1:return a.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,n.navigationClient.navigateExternal(r,i)];case 5:return a.sent(),[2];case 6:return[3,8];case 7:throw this.logger.info("RedirectHandler.initiateAuthRequest: Navigate url is empty"),D.createEmptyNavigationUriError();case 8:return[2]}})})},e.prototype.handleCodeResponseFromHash=function(r,n,i,o){return S(this,void 0,void 0,function(){var a,s,c,l,d,h,u;return k(this,function(f){switch(f.label){case 0:if(this.logger.verbose("RedirectHandler.handleCodeResponse called"),V.isEmpty(r))throw D.createEmptyHashError(r);if(this.browserStorage.setInteractionInProgress(!1),a=this.browserStorage.generateStateKey(n),s=this.browserStorage.getTemporaryCache(a),!s)throw j.createStateNotFoundError("Cached State");try{c=this.authModule.handleFragmentResponse(r,s)}catch(v){throw v instanceof So&&v.subError===P.userCancelledError.code?D.createUserCancelledError():v}return l=this.browserStorage.generateNonceKey(s),d=this.browserStorage.getTemporaryCache(l),this.authCodeRequest.code=c.code,c.cloud_instance_host_name?[4,this.updateTokenEndpointAuthority(c.cloud_instance_host_name,i,o)]:[3,2];case 1:f.sent(),f.label=2;case 2:return c.nonce=d||void 0,c.state=s,c.client_info?this.authCodeRequest.clientInfo=c.client_info:(h=this.checkCcsCredentials(),h&&(this.authCodeRequest.ccsCredential=h)),[4,this.authModule.acquireToken(this.authCodeRequest,c)];case 3:return u=f.sent(),this.browserStorage.cleanRequestByState(n),[2,u]}})})},e}(n0);var J;(function(t){t.INITIALIZE_START="msal:initializeStart",t.INITIALIZE_END="msal:initializeEnd",t.ACCOUNT_ADDED="msal:accountAdded",t.ACCOUNT_REMOVED="msal:accountRemoved",t.LOGIN_START="msal:loginStart",t.LOGIN_SUCCESS="msal:loginSuccess",t.LOGIN_FAILURE="msal:loginFailure",t.ACQUIRE_TOKEN_START="msal:acquireTokenStart",t.ACQUIRE_TOKEN_SUCCESS="msal:acquireTokenSuccess",t.ACQUIRE_TOKEN_FAILURE="msal:acquireTokenFailure",t.ACQUIRE_TOKEN_NETWORK_START="msal:acquireTokenFromNetworkStart",t.SSO_SILENT_START="msal:ssoSilentStart",t.SSO_SILENT_SUCCESS="msal:ssoSilentSuccess",t.SSO_SILENT_FAILURE="msal:ssoSilentFailure",t.ACQUIRE_TOKEN_BY_CODE_START="msal:acquireTokenByCodeStart",t.ACQUIRE_TOKEN_BY_CODE_SUCCESS="msal:acquireTokenByCodeSuccess",t.ACQUIRE_TOKEN_BY_CODE_FAILURE="msal:acquireTokenByCodeFailure",t.HANDLE_REDIRECT_START="msal:handleRedirectStart",t.HANDLE_REDIRECT_END="msal:handleRedirectEnd",t.POPUP_OPENED="msal:popupOpened",t.LOGOUT_START="msal:logoutStart",t.LOGOUT_SUCCESS="msal:logoutSuccess",t.LOGOUT_FAILURE="msal:logoutFailure",t.LOGOUT_END="msal:logoutEnd"})(J||(J={}));var gi;(function(t){t.USER_INTERACTION_REQUIRED="USER_INTERACTION_REQUIRED",t.USER_CANCEL="USER_CANCEL",t.NO_NETWORK="NO_NETWORK",t.TRANSIENT_ERROR="TRANSIENT_ERROR",t.PERSISTENT_ERROR="PERSISTENT_ERROR",t.DISABLED="DISABLED",t.ACCOUNT_UNAVAILABLE="ACCOUNT_UNAVAILABLE"})(gi||(gi={}));var ns={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"}},xn=function(t){It(e,t);function e(r,n,i){var o=t.call(this,r,n)||this;return Object.setPrototypeOf(o,e.prototype),o.name="NativeAuthError",o.ext=i,o}return e.prototype.isFatal=function(){if(this.ext&&this.ext.status&&(this.ext.status===gi.PERSISTENT_ERROR||this.ext.status===gi.DISABLED))return!0;switch(this.errorCode){case ns.extensionError.code:return!0;default:return!1}},e.createError=function(r,n,i){if(i&&i.status)switch(i.status){case gi.ACCOUNT_UNAVAILABLE:return an.createNativeAccountUnavailableError();case gi.USER_INTERACTION_REQUIRED:return new an(r,n);case gi.USER_CANCEL:return D.createUserCancelledError();case gi.NO_NETWORK:return D.createNoNetworkConnectivityError()}return new e(r,n,i)},e.createUserSwitchError=function(){return new e(ns.userSwitch.code,ns.userSwitch.desc)},e.createTokensNotFoundInCacheError=function(){return new e(ns.tokensNotFoundInCache.code,ns.tokensNotFoundInCache.desc)},e}(W);var s3=function(t){It(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.acquireToken=function(r){return S(this,void 0,void 0,function(){var n,i,o,a,s;return k(this,function(c){switch(c.label){case 0:return n=this.performanceClient.startMeasurement(pt.SilentCacheClientAcquireToken,r.correlationId),i=this.initializeServerTelemetryManager(He.acquireTokenSilent_silentFlow),[4,this.createSilentFlowClient(i,r.authority,r.azureCloudOptions)];case 1:o=c.sent(),this.logger.verbose("Silent auth client created"),c.label=2;case 2:return c.trys.push([2,4,,5]),[4,o.acquireCachedToken(r)];case 3:return a=c.sent(),n.endMeasurement({success:!0,fromCache:!0}),[2,a];case 4:throw s=c.sent(),s instanceof D&&s.errorCode===P.signingKeyNotFoundInStorage.code&&this.logger.verbose("Signing keypair for bound access token not found. Refreshing bound access token and generating a new crypto keypair."),n.endMeasurement({errorCode:s instanceof W&&s.errorCode||void 0,subErrorCode:s instanceof W&&s.subError||void 0,success:!1}),s;case 5:return[2]}})})},e.prototype.logout=function(){return Promise.reject(D.createSilentLogoutUnsupportedError())},e.prototype.createSilentFlowClient=function(r,n,i){return S(this,void 0,void 0,function(){var o;return k(this,function(a){switch(a.label){case 0:return[4,this.getClientConfiguration(r,n,i)];case 1:return o=a.sent(),[2,new y_(o,this.performanceClient)]}})})},e.prototype.initializeSilentRequest=function(r,n){return S(this,void 0,void 0,function(){var i;return k(this,function(o){switch(o.label){case 0:return i=[K({},r)],[4,this.initializeBaseRequest(r)];case 1:return[2,K.apply(void 0,[K.apply(void 0,i.concat([o.sent()])),{account:n,forceRefresh:r.forceRefresh||!1}])]}})})},e}($a);var xa=function(t){It(e,t);function e(r,n,i,o,a,s,c,l,d,h,u,f){var v=t.call(this,r,n,i,o,a,s,l,d,f)||this;return v.apiId=c,v.accountId=h,v.nativeMessageHandler=d,v.nativeStorageManager=u,v.silentCacheClient=new s3(r,v.nativeStorageManager,i,o,a,s,l,d,f),v}return e.prototype.acquireToken=function(r){return S(this,void 0,void 0,function(){var n,i,o,a,s,c,l;return k(this,function(d){switch(d.label){case 0:return this.logger.trace("NativeInteractionClient - acquireToken called."),n=this.performanceClient.startMeasurement(pt.NativeInteractionClientAcquireToken,r.correlationId),i=Br.nowSeconds(),[4,this.initializeNativeRequest(r)];case 1:o=d.sent(),d.label=2;case 2:return d.trys.push([2,4,,5]),[4,this.acquireTokensFromCache(this.accountId,o)];case 3:return a=d.sent(),n.endMeasurement({success:!0,isNativeBroker:!1,fromCache:!0}),[2,a];case 4:return d.sent(),this.logger.info("MSAL internal Cache does not contain tokens, proceed to make a native call"),[3,5];case 5:return s={method:Gn.GetToken,request:o},[4,this.nativeMessageHandler.sendMessage(s)];case 6:return c=d.sent(),l=this.validateNativeResponse(c),[2,this.handleNativeResponse(l,o,i).then(function(h){return n.endMeasurement({success:!0,isNativeBroker:!0,requestId:h.requestId}),h}).catch(function(h){throw n.endMeasurement({success:!1,errorCode:h.errorCode,subErrorCode:h.subError,isNativeBroker:!0}),h})]}})})},e.prototype.createSilentCacheRequest=function(r,n){return{authority:r.authority,correlationId:this.correlationId,scopes:er.fromString(r.scope).asArray(),account:n,forceRefresh:!1}},e.prototype.acquireTokensFromCache=function(r,n){return S(this,void 0,void 0,function(){var i,o,a,s,c;return k(this,function(l){switch(l.label){case 0:if(i=this.browserStorage.readAccountFromCacheWithNativeAccountId(r),!i)throw j.createNoAccountFoundError();o=i.getAccountInfo(),l.label=1;case 1:return l.trys.push([1,3,,4]),a=this.createSilentCacheRequest(n,o),[4,this.silentCacheClient.acquireToken(a)];case 2:return s=l.sent(),[2,s];case 3:throw c=l.sent(),c;case 4:return[2]}})})},e.prototype.acquireTokenRedirect=function(r){return S(this,void 0,void 0,function(){var n,i,o,a,s,c;return k(this,function(l){switch(l.label){case 0:return this.logger.trace("NativeInteractionClient - acquireTokenRedirect called."),[4,this.initializeNativeRequest(r)];case 1:n=l.sent(),i={method:Gn.GetToken,request:n},l.label=2;case 2:return l.trys.push([2,4,,5]),[4,this.nativeMessageHandler.sendMessage(i)];case 3:return o=l.sent(),this.validateNativeResponse(o),[3,5];case 4:if(a=l.sent(),a instanceof xn&&a.isFatal())throw a;return[3,5];case 5:return this.browserStorage.setTemporaryCache(ye.NATIVE_REQUEST,JSON.stringify(n),!0),s={apiId:He.acquireTokenRedirect,timeout:this.config.system.redirectNavigationTimeout,noHistory:!1},c=this.config.auth.navigateToLoginRequestUrl?window.location.href:this.getRedirectUri(r.redirectUri),[4,this.navigationClient.navigateExternal(c,s)];case 6:return l.sent(),[2]}})})},e.prototype.handleRedirectPromise=function(){return S(this,void 0,void 0,function(){var r,n,i,o,a,s,c,l;return k(this,function(d){switch(d.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(r=this.browserStorage.getCachedNativeRequest(),!r)return this.logger.verbose("NativeInteractionClient - handleRedirectPromise called but there is no cached request, returning null."),[2,null];n=r.prompt,i=tm(r,["prompt"]),n&&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)),o={method:Gn.GetToken,request:i},a=Br.nowSeconds(),d.label=1;case 1:return d.trys.push([1,3,,4]),this.logger.verbose("NativeInteractionClient - handleRedirectPromise sending message to native broker."),[4,this.nativeMessageHandler.sendMessage(o)];case 2:return s=d.sent(),this.validateNativeResponse(s),c=this.handleNativeResponse(s,i,a),this.browserStorage.setInteractionInProgress(!1),[2,c];case 3:throw l=d.sent(),this.browserStorage.setInteractionInProgress(!1),l;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(r,n,i){return S(this,void 0,void 0,function(){var o,a,s,c,l,d,h,u,f,v,g,x,m,p,y,w,A,O,U,N,xe=this;return k(this,function(Y){switch(Y.label){case 0:if(this.logger.trace("NativeInteractionClient - handleNativeResponse called."),o=this.getMATSFromResponse(r),this.performanceClient.addStaticFields({extensionId:this.nativeMessageHandler.getExtensionId(),extensionVersion:this.nativeMessageHandler.getExtensionVersion(),matsBrokerVersion:o?o.broker_version:void 0,matsAccountJoinOnStart:o?o.account_join_on_start:void 0,matsAccountJoinOnEnd:o?o.account_join_on_end:void 0,matsDeviceJoin:o?o.device_join:void 0,matsPromptBehavior:o?o.prompt_behavior:void 0,matsApiErrorCode:o?o.api_error_code:void 0,matsUiVisible:o?o.ui_visible:void 0,matsSilentCode:o?o.silent_code:void 0,matsSilentBiSubCode:o?o.silent_bi_sub_code:void 0,matsSilentMessage:o?o.silent_message:void 0,matsSilentStatus:o?o.silent_status:void 0,matsHttpStatus:o?o.http_status:void 0,matsHttpEventCount:o?o.http_event_count:void 0},this.correlationId),r.account.id!==n.accountId)throw xn.createUserSwitchError();return a=new Tn(r.id_token||_.EMPTY_STRING,this.browserCrypto),[4,this.getDiscoveredAuthority(n.authority)];case 1:switch(s=Y.sent(),c=s.getPreferredCache(),l=kt.generateHomeAccountId(r.client_info||_.EMPTY_STRING,Fr.Default,this.logger,this.browserCrypto,a),d=kt.createAccount(r.client_info,l,a,void 0,void 0,void 0,c,r.account.id),this.browserStorage.setAccount(d),h=r.scope?er.fromString(r.scope):er.fromString(n.scope),u=r.account.properties||{},f=u.UID||a.claims.oid||a.claims.sub||_.EMPTY_STRING,v=u.TenantId||a.claims.tid||_.EMPTY_STRING,x=Se.BEARER,m=n.tokenType,m){case Se.POP:return[3,2]}return[3,4];case 2:if(x=Se.POP,r.shr)return this.logger.trace("handleNativeServerResponse: SHR is enabled in native layer"),g=r.shr,[3,5];if(p=new Pa(this.browserCrypto),y={resourceRequestMethod:n.resourceRequestMethod,resourceRequestUri:n.resourceRequestUri,shrClaims:n.shrClaims,shrNonce:n.shrNonce},!n.keyId)throw j.createKeyIdMissingError();return[4,p.signPopToken(r.access_token,n.keyId,y)];case 3:return g=Y.sent(),[3,5];case 4:g=r.access_token,Y.label=5;case 5:return w={authority:s.canonicalAuthority,uniqueId:f,tenantId:v,scopes:h.asArray(),account:d.getAccountInfo(),idToken:r.id_token,idTokenClaims:a.claims,accessToken:g,fromCache:o?this.isResponseFromCache(o):!1,expiresOn:new Date(Number(i+r.expires_in)*1e3),tokenType:x,correlationId:this.correlationId,state:r.state,fromNativeBroker:!0},A=uc.createIdTokenEntity(l,n.authority,r.id_token||_.EMPTY_STRING,n.clientId,a.claims.tid||_.EMPTY_STRING),this.nativeStorageManager.setIdTokenCredential(A),O=x===Se.POP?_.SHR_NONCE_VALIDITY:(typeof r.expires_in=="string"?parseInt(r.expires_in,10):r.expires_in)||0,U=i+O,N=fc.createAccessTokenEntity(l,n.authority,g,n.clientId,v,h.printScopes(),U,0,this.browserCrypto),this.nativeStorageManager.setAccessTokenCredential(N),this.browserStorage.removeAccountContext(d).catch(function(Xt){xe.logger.error("Error occurred while removing account context from browser storage. "+Xt)}),[2,w]}})})},e.prototype.validateNativeResponse=function(r){if(r.hasOwnProperty("access_token")&&r.hasOwnProperty("id_token")&&r.hasOwnProperty("client_info")&&r.hasOwnProperty("account")&&r.hasOwnProperty("scope")&&r.hasOwnProperty("expires_in"))return r;throw xn.createUnexpectedError("Response missing expected properties.")},e.prototype.getMATSFromResponse=function(r){if(r.properties.MATS)try{return JSON.parse(r.properties.MATS)}catch{this.logger.error("NativeInteractionClient - Error parsing MATS telemetry, returning null instead")}return null},e.prototype.isResponseFromCache=function(r){return typeof r.is_cached>"u"?(this.logger.verbose("NativeInteractionClient - MATS telemetry does not contain field indicating if response was served from cache. Returning false."),!1):!!r.is_cached},e.prototype.initializeNativeRequest=function(r){return S(this,void 0,void 0,function(){var n,i,o,a,s,c,l,d,h,u,f=this;return k(this,function(v){switch(v.label){case 0:return this.logger.trace("NativeInteractionClient - initializeNativeRequest called"),n=r.authority||this.config.auth.authority,i=new be(n),i.validateAsUri(),o=r.scopes,a=tm(r,["scopes"]),s=new er(o||[]),s.appendScopes(Tc),c=function(){switch(f.apiId){case He.ssoSilent:case He.acquireTokenSilent_silentFlow:return f.logger.trace("initializeNativeRequest: silent request sets prompt to none"),jt.NONE}if(!r.prompt){f.logger.trace("initializeNativeRequest: prompt was not provided");return}switch(r.prompt){case jt.NONE:case jt.CONSENT:case jt.LOGIN:return f.logger.trace("initializeNativeRequest: prompt is compatible with native flow"),r.prompt;default:throw f.logger.trace("initializeNativeRequest: prompt = "+r.prompt+" is not compatible with native flow"),D.createNativePromptParameterNotSupportedError()}},l=K(K({},a),{accountId:this.accountId,clientId:this.config.auth.clientId,authority:i.urlString,scope:s.printScopes(),redirectUri:this.getRedirectUri(r.redirectUri),prompt:c(),correlationId:this.correlationId,tokenType:r.authenticationScheme,windowTitleSubstring:document.title,extraParameters:K(K(K({},r.extraQueryParameters),r.tokenQueryParameters),{telemetry:vs.MATS_TELEMETRY}),extendedExpiryToken:!1}),r.authenticationScheme!==Se.POP?[3,2]:(d={resourceRequestUri:r.resourceRequestUri,resourceRequestMethod:r.resourceRequestMethod,shrClaims:r.shrClaims,shrNonce:r.shrNonce},h=new Pa(this.browserCrypto),[4,h.generateCnf(d)]);case 1:u=v.sent(),l.reqCnf=u.reqCnfHash,l.keyId=u.kid,v.label=2;case 2:return[2,l]}})})},e}(a3);var vo=function(){function t(e,r,n){this.logger=e,this.handshakeTimeoutMs=r,this.extensionId=n,this.resolvers=new Map,this.handshakeResolvers=new Map,this.responseId=0,this.messageChannel=new MessageChannel,this.windowListener=this.onWindowMessage.bind(this)}return t.prototype.sendMessage=function(e){return S(this,void 0,void 0,function(){var r,n=this;return k(this,function(i){return this.logger.trace("NativeMessageHandler - sendMessage called."),r={channel:vs.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(r)),this.messageChannel.port1.postMessage(r),[2,new Promise(function(o,a){n.resolvers.set(r.responseId,{resolve:o,reject:a})})]})})},t.createProvider=function(e,r){return S(this,void 0,void 0,function(){var n,i;return k(this,function(o){switch(o.label){case 0:e.trace("NativeMessageHandler - createProvider called."),o.label=1;case 1:return o.trys.push([1,3,,5]),n=new t(e,r,vs.PREFERRED_EXTENSION_ID),[4,n.sendHandshakeRequest()];case 2:return o.sent(),[2,n];case 3:return o.sent(),i=new t(e,r),[4,i.sendHandshakeRequest()];case 4:return o.sent(),[2,i];case 5:return[2]}})})},t.prototype.sendHandshakeRequest=function(){return S(this,void 0,void 0,function(){var e,r=this;return k(this,function(n){return this.logger.trace("NativeMessageHandler - sendHandshakeRequest called."),window.addEventListener("message",this.windowListener,!1),e={channel:vs.CHANNEL_ID,extensionId:this.extensionId,responseId:this.responseId++,body:{method:Gn.HandshakeRequest}},this.messageChannel.port1.onmessage=function(i){r.onChannelMessage(i)},window.postMessage(e,window.origin,[this.messageChannel.port2]),[2,new Promise(function(i,o){r.handshakeResolvers.set(e.responseId,{resolve:i,reject:o}),r.timeoutId=window.setTimeout(function(){window.removeEventListener("message",r.windowListener,!1),r.messageChannel.port1.close(),r.messageChannel.port2.close(),o(D.createNativeHandshakeTimeoutError()),r.handshakeResolvers.delete(e.responseId)},r.handshakeTimeoutMs)})]})})},t.prototype.onWindowMessage=function(e){if(this.logger.trace("NativeMessageHandler - onWindowMessage called"),e.source===window){var r=e.data;if(!(!r.channel||r.channel!==vs.CHANNEL_ID)&&!(r.extensionId&&r.extensionId!==this.extensionId)&&r.body.method===Gn.HandshakeRequest){this.logger.verbose(r.extensionId?"Extension with id: "+r.extensionId+" not installed":"No extension installed"),clearTimeout(this.timeoutId),this.messageChannel.port1.close(),this.messageChannel.port2.close(),window.removeEventListener("message",this.windowListener,!1);var n=this.handshakeResolvers.get(r.responseId);n&&n.reject(D.createNativeExtensionNotInstalledError())}}},t.prototype.onChannelMessage=function(e){this.logger.trace("NativeMessageHandler - onChannelMessage called.");var r=e.data,n=this.resolvers.get(r.responseId),i=this.handshakeResolvers.get(r.responseId);try{var o=r.body.method;if(o===Gn.Response){if(!n)return;var a=r.body.response;if(this.logger.trace("NativeMessageHandler - Received response from browser extension"),this.logger.tracePii("NativeMessageHandler - Received response from browser extension: "+JSON.stringify(a)),a.status!=="Success")n.reject(xn.createError(a.code,a.description,a.ext));else if(a.result)a.result.code&&a.result.description?n.reject(xn.createError(a.result.code,a.result.description,a.result.ext)):n.resolve(a.result);else throw W.createUnexpectedError("Event does not contain result.");this.resolvers.delete(r.responseId)}else if(o===Gn.HandshakeResponse){if(!i)return;clearTimeout(this.timeoutId),window.removeEventListener("message",this.windowListener,!1),this.extensionId=r.extensionId,this.extensionVersion=r.body.version,this.logger.verbose("NativeMessageHandler - Received HandshakeResponse from extension: "+this.extensionId),i.resolve(),this.handshakeResolvers.delete(r.responseId)}}catch(s){this.logger.error("Error parsing response from WAM Extension"),this.logger.errorPii("Error parsing response from WAM Extension: "+s.toString()),this.logger.errorPii("Unable to parse "+e),n?n.reject(s):i&&i.reject(s)}},t.prototype.getExtensionId=function(){return this.extensionId},t.prototype.getExtensionVersion=function(){return this.extensionVersion},t.isNativeAvailable=function(e,r,n,i){if(r.trace("isNativeAvailable called"),!e.system.allowNativeBroker)return r.trace("isNativeAvailable: allowNativeBroker is not enabled, returning false"),!1;if(!n)return r.trace("isNativeAvailable: WAM extension provider is not initialized, returning false"),!1;if(i)switch(i){case Se.BEARER:case Se.POP:return r.trace("isNativeAvailable: authenticationScheme is supported, returning true"),!0;default:return r.trace("isNativeAvailable: authenticationScheme is not supported, returning false"),!1}return!0},t}();var R_=function(t){It(e,t);function e(r,n,i,o,a,s,c,l,d,h){var u=t.call(this,r,n,i,o,a,s,c,d,h)||this;return u.nativeStorage=l,u}return e.prototype.acquireToken=function(r){return S(this,void 0,void 0,function(){var n,i,o,a,s,c,l,d,h,u=this;return k(this,function(f){switch(f.label){case 0:return[4,this.initializeAuthorizationRequest(r,G.Redirect)];case 1:n=f.sent(),this.browserStorage.updateCacheEntries(n.state,n.nonce,n.authority,n.loginHint||_.EMPTY_STRING,n.account||null),i=this.initializeServerTelemetryManager(He.acquireTokenRedirect),o=function(v){v.persisted&&(u.logger.verbose("Page was restored from back/forward cache. Clearing temporary cache."),u.browserStorage.cleanRequestByState(n.state))},f.label=2;case 2:return f.trys.push([2,7,,8]),[4,this.initializeAuthorizationCodeRequest(n)];case 3:return a=f.sent(),[4,this.createAuthCodeClient(i,n.authority,n.azureCloudOptions)];case 4:return s=f.sent(),this.logger.verbose("Auth code client created"),c=new pm(s,this.browserStorage,a,this.logger,this.browserCrypto),[4,s.getAuthCodeUrl(K(K({},n),{nativeBroker:vo.isNativeAvailable(this.config,this.logger,this.nativeMessageHandler,r.authenticationScheme)}))];case 5:return l=f.sent(),d=this.getRedirectStartPage(r.redirectStartPage),this.logger.verbosePii("Redirect start page: "+d),window.addEventListener("pageshow",o),[4,c.initiateAuthRequest(l,{navigationClient:this.navigationClient,redirectTimeout:this.config.system.redirectNavigationTimeout,redirectStartPage:d,onRedirectNavigate:r.onRedirectNavigate})];case 6:return[2,f.sent()];case 7:throw h=f.sent(),h instanceof W&&h.setCorrelationId(this.correlationId),window.removeEventListener("pageshow",o),i.cacheFailedRequest(h),this.browserStorage.cleanRequestByState(n.state),h;case 8:return[2]}})})},e.prototype.handleRedirectPromise=function(r){return S(this,void 0,void 0,function(){var n,i,o,a,s,c,l,d,h,u,f,v;return k(this,function(g){switch(g.label){case 0:n=this.initializeServerTelemetryManager(He.handleRedirectPromise),g.label=1;case 1:if(g.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(r||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(G.Redirect),[2,null];o=void 0;try{a=be.getDeserializedHash(i),o=this.validateAndExtractStateFromHash(a,G.Redirect),this.logger.verbose("State extracted from hash")}catch(x){return this.logger.info("handleRedirectPromise was unable to extract state due to: "+x),this.browserStorage.cleanRequestByInteractionType(G.Redirect),[2,null]}return s=this.browserStorage.getTemporaryCache(ye.ORIGIN_URI,!0)||_.EMPTY_STRING,c=be.removeHashFromUrl(s),l=be.removeHashFromUrl(window.location.href),c===l&&this.config.auth.navigateToLoginRequestUrl?(this.logger.verbose("Current page is loginRequestUrl, handling hash"),[4,this.handleHash(i,o,n)]):[3,3];case 2:return d=g.sent(),s.indexOf("#")>-1&&Je.replaceHash(s),[2,d];case 3:return this.config.auth.navigateToLoginRequestUrl?[3,4]:(this.logger.verbose("NavigateToLoginRequestUrl set to false, handling hash"),[2,this.handleHash(i,o,n)]);case 4:return!Je.isInIframe()||this.config.system.allowRedirectInIframe?(this.browserStorage.setTemporaryCache(ye.URL_HASH,i,!0),h={apiId:He.handleRedirectPromise,timeout:this.config.system.redirectNavigationTimeout,noHistory:!0},u=!0,!s||s==="null"?(f=Je.getHomepage(),this.browserStorage.setTemporaryCache(ye.ORIGIN_URI,f,!0),this.logger.warning("Unable to get valid login request url from cache, redirecting to home page"),[4,this.navigationClient.navigateInternal(f,h)]):[3,6]):[3,9];case 5:return u=g.sent(),[3,8];case 6:return this.logger.verbose("Navigating to loginRequestUrl: "+s),[4,this.navigationClient.navigateInternal(s,h)];case 7:u=g.sent(),g.label=8;case 8:if(!u)return[2,this.handleHash(i,o,n)];g.label=9;case 9:return[2,null];case 10:throw v=g.sent(),v instanceof W&&v.setCorrelationId(this.correlationId),n.cacheFailedRequest(v),this.browserStorage.cleanRequestByInteractionType(G.Redirect),v;case 11:return[2]}})})},e.prototype.getRedirectResponseHash=function(r){this.logger.verbose("getRedirectResponseHash called");var n=be.hashContainsKnownProperties(r);if(n)return Je.clearHash(window),this.logger.verbose("Hash contains known properties, returning response hash"),r;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(r,n,i){return S(this,void 0,void 0,function(){var o,a,s,c,l,d,h,u=this;return k(this,function(f){switch(f.label){case 0:if(o=this.browserStorage.getCachedRequest(n,this.browserCrypto),this.logger.verbose("handleHash called, retrieved cached request"),a=be.getDeserializedHash(r),a.accountId){if(this.logger.verbose("Account id found in hash, calling WAM for token"),!this.nativeMessageHandler)throw D.createNativeConnectionNotEstablishedError();return s=new xa(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,He.acquireTokenPopup,this.performanceClient,this.nativeMessageHandler,a.accountId,this.browserStorage,o.correlationId),c=Yn.parseRequestState(this.browserCrypto,n).userRequestState,[2,s.acquireToken(K(K({},o),{state:c,prompt:void 0})).finally(function(){u.browserStorage.cleanRequestByState(n)})]}if(l=this.browserStorage.getCachedAuthority(n),!l)throw D.createNoCachedAuthorityError();return[4,this.createAuthCodeClient(i,l)];case 1:return d=f.sent(),this.logger.verbose("Auth code client created"),$d.removeThrottle(this.browserStorage,this.config.auth.clientId,o),h=new pm(d,this.browserStorage,o,this.logger,this.browserCrypto),[4,h.handleCodeResponseFromHash(r,n,d.authority,this.networkClient)];case 2:return[2,f.sent()]}})})},e.prototype.logout=function(r){return S(this,void 0,void 0,function(){var n,i,o,a,s,c,l;return k(this,function(d){switch(d.label){case 0:this.logger.verbose("logoutRedirect called"),n=this.initializeLogoutRequest(r),i=this.initializeServerTelemetryManager(He.logout),d.label=1;case 1:return d.trys.push([1,10,,11]),this.eventHandler.emitEvent(J.LOGOUT_START,G.Redirect,r),[4,this.clearCacheOnLogout(n.account)];case 2:return d.sent(),o={apiId:He.logout,timeout:this.config.system.redirectNavigationTimeout,noHistory:!1},[4,this.createAuthCodeClient(i,r&&r.authority)];case 3:return a=d.sent(),this.logger.verbose("Auth code client created"),s=a.getLogoutUri(n),this.eventHandler.emitEvent(J.LOGOUT_SUCCESS,G.Redirect,n),r&&typeof r.onRedirectNavigate=="function"?(c=r.onRedirectNavigate(s),c===!1?[3,5]:(this.logger.verbose("Logout onRedirectNavigate did not return false, navigating"),this.browserStorage.getInteractionInProgress()||this.browserStorage.setInteractionInProgress(!0),[4,this.navigationClient.navigateExternal(s,o)])):[3,7];case 4:return d.sent(),[2];case 5:this.browserStorage.setInteractionInProgress(!1),this.logger.verbose("Logout onRedirectNavigate returned false, stopping navigation"),d.label=6;case 6:return[3,9];case 7:return this.browserStorage.getInteractionInProgress()||this.browserStorage.setInteractionInProgress(!0),[4,this.navigationClient.navigateExternal(s,o)];case 8:return d.sent(),[2];case 9:return[3,11];case 10:throw l=d.sent(),l instanceof W&&l.setCorrelationId(this.correlationId),i.cacheFailedRequest(l),this.eventHandler.emitEvent(J.LOGOUT_FAILURE,G.Redirect,null,l),this.eventHandler.emitEvent(J.LOGOUT_END,G.Redirect),l;case 11:return this.eventHandler.emitEvent(J.LOGOUT_END,G.Redirect),[2]}})})},e.prototype.getRedirectStartPage=function(r){var n=r||window.location.href;return be.getAbsoluteUrl(n,Je.getCurrentUri())},e}($a);var H_=function(t){It(e,t);function e(r,n,i,o,a,s,c,l,d,h){var u=t.call(this,r,n,i,o,a,s,c,d,h)||this;return u.unloadWindow=u.unloadWindow.bind(u),u.nativeStorage=l,u}return e.prototype.acquireToken=function(r){try{var n=this.generatePopupName(r.scopes||Tc,r.authority||this.config.auth.authority),i=r.popupWindowAttributes||{};if(this.config.system.asyncPopups)return this.logger.verbose("asyncPopups set to true, acquiring token"),this.acquireTokenPopupAsync(r,n,i);this.logger.verbose("asyncPopup set to false, opening popup before acquiring token");var o=this.openSizedPopup("about:blank",n,i);return this.acquireTokenPopupAsync(r,n,i,o)}catch(a){return Promise.reject(a)}},e.prototype.logout=function(r){try{this.logger.verbose("logoutPopup called");var n=this.initializeLogoutRequest(r),i=this.generateLogoutPopupName(n),o=r&&r.authority,a=r&&r.mainWindowRedirectUri,s=(r==null?void 0:r.popupWindowAttributes)||{};if(this.config.system.asyncPopups)return this.logger.verbose("asyncPopups set to true"),this.logoutPopupAsync(n,i,s,o,void 0,a);this.logger.verbose("asyncPopup set to false, opening popup");var c=this.openSizedPopup("about:blank",i,s);return this.logoutPopupAsync(n,i,s,o,c,a)}catch(l){return Promise.reject(l)}},e.prototype.acquireTokenPopupAsync=function(r,n,i,o){return S(this,void 0,void 0,function(){var a,s,c,l,d,h,u,f,v,g,x,m,p,y,w,A,O,U=this;return k(this,function(N){switch(N.label){case 0:return this.logger.verbose("acquireTokenPopupAsync called"),a=this.initializeServerTelemetryManager(He.acquireTokenPopup),[4,this.initializeAuthorizationRequest(r,G.Popup)];case 1:s=N.sent(),this.browserStorage.updateCacheEntries(s.state,s.nonce,s.authority,s.loginHint||_.EMPTY_STRING,s.account||null),N.label=2;case 2:return N.trys.push([2,8,,9]),[4,this.initializeAuthorizationCodeRequest(s)];case 3:return c=N.sent(),[4,this.createAuthCodeClient(a,s.authority,s.azureCloudOptions)];case 4:return l=N.sent(),this.logger.verbose("Auth code client created"),d=vo.isNativeAvailable(this.config,this.logger,this.nativeMessageHandler,r.authenticationScheme),h=void 0,d&&(h=this.performanceClient.startMeasurement(pt.FetchAccountIdWithNativeBroker,r.correlationId)),[4,l.getAuthCodeUrl(K(K({},s),{nativeBroker:d}))];case 5:return u=N.sent(),f=new n0(l,this.browserStorage,c,this.logger),v={popup:o,popupName:n,popupWindowAttributes:i},g=this.initiateAuthRequest(u,v),this.eventHandler.emitEvent(J.POPUP_OPENED,G.Popup,{popupWindow:g},null),[4,this.monitorPopupForHash(g)];case 6:if(x=N.sent(),m=be.getDeserializedHash(x),p=this.validateAndExtractStateFromHash(m,G.Popup,s.correlationId),$d.removeThrottle(this.browserStorage,this.config.auth.clientId,c),m.accountId){if(this.logger.verbose("Account id found in hash, calling WAM for token"),h&&h.endMeasurement({success:!0,isNativeBroker:!0}),!this.nativeMessageHandler)throw D.createNativeConnectionNotEstablishedError();return y=new xa(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,He.acquireTokenPopup,this.performanceClient,this.nativeMessageHandler,m.accountId,this.nativeStorage,s.correlationId),w=Yn.parseRequestState(this.browserCrypto,p).userRequestState,[2,y.acquireToken(K(K({},s),{state:w,prompt:void 0})).finally(function(){U.browserStorage.cleanRequestByState(p)})]}return[4,f.handleCodeResponseFromHash(x,p,l.authority,this.networkClient)];case 7:return A=N.sent(),[2,A];case 8:throw O=N.sent(),o&&o.close(),O instanceof W&&O.setCorrelationId(this.correlationId),a.cacheFailedRequest(O),this.browserStorage.cleanRequestByState(s.state),O;case 9:return[2]}})})},e.prototype.logoutPopupAsync=function(r,n,i,o,a,s){return S(this,void 0,void 0,function(){var c,l,d,h,u,f,v;return k(this,function(g){switch(g.label){case 0:this.logger.verbose("logoutPopupAsync called"),this.eventHandler.emitEvent(J.LOGOUT_START,G.Popup,r),c=this.initializeServerTelemetryManager(He.logoutPopup),g.label=1;case 1:return g.trys.push([1,5,,6]),[4,this.clearCacheOnLogout(r.account)];case 2:return g.sent(),[4,this.createAuthCodeClient(c,o)];case 3:return l=g.sent(),this.logger.verbose("Auth code client created"),d=l.getLogoutUri(r),this.eventHandler.emitEvent(J.LOGOUT_SUCCESS,G.Popup,r),h=this.openPopup(d,{popupName:n,popupWindowAttributes:i,popup:a}),this.eventHandler.emitEvent(J.POPUP_OPENED,G.Popup,{popupWindow:h},null),[4,this.waitForLogoutPopup(h)];case 4:return g.sent(),s?(u={apiId:He.logoutPopup,timeout:this.config.system.redirectNavigationTimeout,noHistory:!1},f=be.getAbsoluteUrl(s,Je.getCurrentUri()),this.logger.verbose("Redirecting main window to url specified in the request"),this.logger.verbosePii("Redirecting main window to: "+f),this.navigationClient.navigateInternal(f,u)):this.logger.verbose("No main window navigation requested"),[3,6];case 5:throw v=g.sent(),a&&a.close(),v instanceof W&&v.setCorrelationId(this.correlationId),this.browserStorage.setInteractionInProgress(!1),this.eventHandler.emitEvent(J.LOGOUT_FAILURE,G.Popup,null,v),this.eventHandler.emitEvent(J.LOGOUT_END,G.Popup),c.cacheFailedRequest(v),v;case 6:return this.eventHandler.emitEvent(J.LOGOUT_END,G.Popup),[2]}})})},e.prototype.initiateAuthRequest=function(r,n){if(V.isEmpty(r))throw this.logger.error("Navigate url is empty"),D.createEmptyNavigationUriError();return this.logger.infoPii("Navigate to: "+r),this.openPopup(r,n)},e.prototype.monitorPopupForHash=function(r){var n=this;return new Promise(function(i,o){var a=n.config.system.windowHashTimeout/n.config.system.pollIntervalMilliseconds,s=0;n.logger.verbose("PopupHandler.monitorPopupForHash - polling started");var c=setInterval(function(){if(r.closed){n.logger.error("PopupHandler.monitorPopupForHash - window closed"),n.cleanPopup(),clearInterval(c),o(D.createUserCancelledError());return}var l=_.EMPTY_STRING,d=_.EMPTY_STRING;try{l=r.location.href,d=r.location.hash}catch{}V.isEmpty(l)||l==="about:blank"||(n.logger.verbose("PopupHandler.monitorPopupForHash - popup window is on same origin as caller"),s++,d?(n.logger.verbose("PopupHandler.monitorPopupForHash - found hash in url"),clearInterval(c),n.cleanPopup(r),be.hashContainsKnownProperties(d)?(n.logger.verbose("PopupHandler.monitorPopupForHash - hash contains known properties, returning."),i(d)):(n.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."),n.logger.errorPii("PopupHandler.monitorPopupForHash - hash found: "+d),o(D.createHashDoesNotContainKnownPropertiesError()))):s>a&&(n.logger.error("PopupHandler.monitorPopupForHash - unable to find hash in url, timing out"),clearInterval(c),o(D.createMonitorPopupTimeoutError())))},n.config.system.pollIntervalMilliseconds)})},e.prototype.waitForLogoutPopup=function(r){var n=this;return new Promise(function(i){n.logger.verbose("PopupHandler.waitForLogoutPopup - polling started");var o=setInterval(function(){r.closed&&(n.logger.error("PopupHandler.waitForLogoutPopup - window closed"),n.cleanPopup(),clearInterval(o),i());var a=_.EMPTY_STRING;try{a=r.location.href}catch{}V.isEmpty(a)||a==="about:blank"||(n.logger.verbose("PopupHandler.waitForLogoutPopup - popup window is on same origin as caller, closing."),clearInterval(o),n.cleanPopup(r),i())},n.config.system.pollIntervalMilliseconds)})},e.prototype.openPopup=function(r,n){try{var i=void 0;if(n.popup?(i=n.popup,this.logger.verbosePii("Navigating popup window to: "+r),i.location.assign(r)):typeof n.popup>"u"&&(this.logger.verbosePii("Opening popup window to: "+r),i=this.openSizedPopup(r,n.popupName,n.popupWindowAttributes)),!i)throw D.createEmptyWindowCreatedError();return i.focus&&i.focus(),this.currentWindow=i,window.addEventListener("beforeunload",this.unloadWindow),i}catch(o){throw this.logger.error("error opening popup "+o.message),this.browserStorage.setInteractionInProgress(!1),D.createPopupWindowError(o.toString())}},e.prototype.openSizedPopup=function(r,n,i){var o,a,s,c,l=window.screenLeft?window.screenLeft:window.screenX,d=window.screenTop?window.screenTop:window.screenY,h=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,u=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight,f=(o=i.popupSize)===null||o===void 0?void 0:o.width,v=(a=i.popupSize)===null||a===void 0?void 0:a.height,g=(s=i.popupPosition)===null||s===void 0?void 0:s.top,x=(c=i.popupPosition)===null||c===void 0?void 0:c.left;return(!f||f<0||f>h)&&(this.logger.verbose("Default popup window width used. Window width not configured or invalid."),f=rn.POPUP_WIDTH),(!v||v<0||v>u)&&(this.logger.verbose("Default popup window height used. Window height not configured or invalid."),v=rn.POPUP_HEIGHT),(!g||g<0||g>u)&&(this.logger.verbose("Default popup window top position used. Window top not configured or invalid."),g=Math.max(0,u/2-rn.POPUP_HEIGHT/2+d)),(!x||x<0||x>h)&&(this.logger.verbose("Default popup window left position used. Window left not configured or invalid."),x=Math.max(0,h/2-rn.POPUP_WIDTH/2+l)),window.open(r,n,"width="+f+", height="+v+", top="+g+", left="+x+", scrollbars=yes")},e.prototype.unloadWindow=function(r){this.browserStorage.cleanRequestByInteractionType(G.Popup),this.currentWindow&&this.currentWindow.close(),r.preventDefault()},e.prototype.cleanPopup=function(r){r&&r.close(),window.removeEventListener("beforeunload",this.unloadWindow),this.browserStorage.setInteractionInProgress(!1)},e.prototype.generatePopupName=function(r,n){return rn.POPUP_NAME_PREFIX+"."+this.config.auth.clientId+"."+r.join("-")+"."+n+"."+this.correlationId},e.prototype.generateLogoutPopupName=function(r){var n=r.account&&r.account.homeAccountId;return rn.POPUP_NAME_PREFIX+"."+this.config.auth.clientId+"."+n+"."+this.correlationId},e}($a);var L_=function(){function t(){}return t.prototype.navigateInternal=function(e,r){return t.defaultNavigateWindow(e,r)},t.prototype.navigateExternal=function(e,r){return t.defaultNavigateWindow(e,r)},t.defaultNavigateWindow=function(e,r){return r.noHistory?window.location.replace(e):window.location.assign(e),new Promise(function(n){setTimeout(function(){n(!0)},r.timeout)})},t}();var O_=6e4,p2=6e3,D_=3e4,N_=2e3;function V_(t,e){var r=t.auth,n=t.cache,i=t.system,o=t.telemetry,a={clientId:_.EMPTY_STRING,authority:""+_.DEFAULT_AUTHORITY,knownAuthorities:[],cloudDiscoveryMetadata:_.EMPTY_STRING,authorityMetadata:_.EMPTY_STRING,redirectUri:_.EMPTY_STRING,postLogoutRedirectUri:_.EMPTY_STRING,navigateToLoginRequestUrl:!0,clientCapabilities:[],protocolMode:qd.AAD,azureCloudOptions:{azureCloudInstance:dc.None,tenant:_.EMPTY_STRING},skipAuthorityMetadataCache:!1},s={cacheLocation:Ut.SessionStorage,storeAuthStateInCookie:!1,secureCookies:!1},c={loggerCallback:function(){},logLevel:tt.Info,piiLoggingEnabled:!1},l=K(K({},e3),{loggerOptions:c,networkClient:e?Je.getBrowserNetworkClient():E_,navigationClient:new L_,loadFrameTimeout:0,windowHashTimeout:(i==null?void 0:i.loadFrameTimeout)||O_,iframeHashTimeout:(i==null?void 0:i.loadFrameTimeout)||p2,navigateFrameWait:e&&Je.detectIEOrEdge()?500:0,redirectNavigationTimeout:D_,asyncPopups:!1,allowRedirectInIframe:!1,allowNativeBroker:!1,nativeBrokerHandshakeTimeout:(i==null?void 0:i.nativeBrokerHandshakeTimeout)||N_,pollIntervalMilliseconds:rn.DEFAULT_POLL_INTERVAL_MS,cryptoOptions:{useMsrCrypto:!1,entropy:void 0}}),d={application:{appName:_.EMPTY_STRING,appVersion:_.EMPTY_STRING}},h={auth:K(K({},a),r),cache:K(K({},s),n),system:K(K({},l),i),telemetry:K(K({},d),o)};return h}var c3=function(t){It(e,t);function e(r,n,i,o,a){var s=t.call(this,r,n,i,o)||this;return s.navigateFrameWait=a.navigateFrameWait,s.pollIntervalMilliseconds=a.pollIntervalMilliseconds,s}return e.prototype.initiateAuthRequest=function(r){return S(this,void 0,void 0,function(){var n;return k(this,function(i){switch(i.label){case 0:if(V.isEmpty(r))throw this.logger.info("Navigate url is empty"),D.createEmptyNavigationUriError();return this.navigateFrameWait?[4,this.loadFrame(r)]:[3,2];case 1:return n=i.sent(),[3,3];case 2:n=this.loadFrameSync(r),i.label=3;case 3:return[2,n]}})})},e.prototype.monitorIframeForHash=function(r,n){var i=this;return new Promise(function(o,a){n<p2&&i.logger.warning("system.loadFrameTimeout or system.iframeHashTimeout set to lower ("+n+"ms) than the default ("+p2+"ms). This may result in timeouts.");var s=window.performance.now(),c=s+n,l=setInterval(function(){if(window.performance.now()>c){i.removeHiddenIframe(r),clearInterval(l),a(D.createMonitorIframeTimeoutError());return}var d=_.EMPTY_STRING,h=r.contentWindow;try{d=h?h.location.href:_.EMPTY_STRING}catch{}if(!V.isEmpty(d)){var u=h?h.location.hash:_.EMPTY_STRING;if(be.hashContainsKnownProperties(u)){i.removeHiddenIframe(r),clearInterval(l),o(u);return}}},i.pollIntervalMilliseconds)})},e.prototype.loadFrame=function(r){var n=this;return new Promise(function(i,o){var a=n.createHiddenIframe();setTimeout(function(){if(!a){o("Unable to load iframe");return}a.src=r,i(a)},n.navigateFrameWait)})},e.prototype.loadFrameSync=function(r){var n=this.createHiddenIframe();return n.src=r,n},e.prototype.createHiddenIframe=function(){var r=document.createElement("iframe");return r.style.visibility="hidden",r.style.position="absolute",r.style.width=r.style.height="0",r.style.border="0",r.setAttribute("sandbox","allow-scripts allow-same-origin allow-forms"),document.getElementsByTagName("body")[0].appendChild(r),r},e.prototype.removeHiddenIframe=function(r){document.body===r.parentNode&&document.body.removeChild(r)},e}(n0);var F_=function(t){It(e,t);function e(r,n,i,o,a,s,c,l,d,h,u){var f=t.call(this,r,n,i,o,a,s,l,h,u)||this;return f.apiId=c,f.nativeStorage=d,f}return e.prototype.acquireToken=function(r){return S(this,void 0,void 0,function(){var n,i,o,a,s;return k(this,function(c){switch(c.label){case 0:if(this.logger.verbose("acquireTokenByIframe called"),n=this.performanceClient.startMeasurement(pt.SilentIframeClientAcquireToken,r.correlationId),V.isEmpty(r.loginHint)&&V.isEmpty(r.sid)&&(!r.account||V.isEmpty(r.account.username))&&this.logger.warning("No user hint provided. The authorization server may need more information to complete this request."),r.prompt&&r.prompt!==jt.NONE&&r.prompt!==jt.NO_SESSION)throw n.endMeasurement({success:!1}),D.createSilentPromptValueError(r.prompt);return[4,this.initializeAuthorizationRequest(K(K({},r),{prompt:r.prompt||jt.NONE}),G.Silent)];case 1:i=c.sent(),this.browserStorage.updateCacheEntries(i.state,i.nonce,i.authority,i.loginHint||_.EMPTY_STRING,i.account||null),o=this.initializeServerTelemetryManager(this.apiId),c.label=2;case 2:return c.trys.push([2,5,,6]),[4,this.createAuthCodeClient(o,i.authority,i.azureCloudOptions)];case 3:return a=c.sent(),this.logger.verbose("Auth code client created"),[4,this.silentTokenHelper(a,i).then(function(l){return n.endMeasurement({success:!0,fromCache:!1,requestId:l.requestId}),l})];case 4:return[2,c.sent()];case 5:throw s=c.sent(),s instanceof W&&s.setCorrelationId(this.correlationId),o.cacheFailedRequest(s),this.browserStorage.cleanRequestByState(i.state),n.endMeasurement({errorCode:s instanceof W&&s.errorCode||void 0,subErrorCode:s instanceof W&&s.subError||void 0,success:!1}),s;case 6:return[2]}})})},e.prototype.logout=function(){return Promise.reject(D.createSilentLogoutUnsupportedError())},e.prototype.silentTokenHelper=function(r,n){return S(this,void 0,void 0,function(){var i,o,a,s,c,l,d,h,u,f=this;return k(this,function(v){switch(v.label){case 0:return[4,this.initializeAuthorizationCodeRequest(n)];case 1:return i=v.sent(),[4,r.getAuthCodeUrl(K(K({},n),{nativeBroker:vo.isNativeAvailable(this.config,this.logger,this.nativeMessageHandler,n.authenticationScheme)}))];case 2:return o=v.sent(),a=new c3(r,this.browserStorage,i,this.logger,this.config.system),[4,a.initiateAuthRequest(o)];case 3:return s=v.sent(),[4,a.monitorIframeForHash(s,this.config.system.iframeHashTimeout)];case 4:if(c=v.sent(),l=be.getDeserializedHash(c),d=this.validateAndExtractStateFromHash(l,G.Silent,i.correlationId),l.accountId){if(this.logger.verbose("Account id found in hash, calling WAM for token"),!this.nativeMessageHandler)throw D.createNativeConnectionNotEstablishedError();return h=new xa(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,this.apiId,this.performanceClient,this.nativeMessageHandler,l.accountId,this.browserStorage,this.correlationId),u=Yn.parseRequestState(this.browserCrypto,d).userRequestState,[2,h.acquireToken(K(K({},n),{state:u,prompt:n.prompt||jt.NONE})).finally(function(){f.browserStorage.cleanRequestByState(d)})]}return[2,a.handleCodeResponseFromHash(c,d,r.authority,this.networkClient)]}})})},e}($a);var U_=function(t){It(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.acquireToken=function(r){return S(this,void 0,void 0,function(){var n,i,o,a,s,c=this;return k(this,function(l){switch(l.label){case 0:return i=[K({},r)],[4,this.initializeBaseRequest(r)];case 1:return n=K.apply(void 0,i.concat([l.sent()])),o=this.performanceClient.startMeasurement(pt.SilentRefreshClientAcquireToken,n.correlationId),a=this.initializeServerTelemetryManager(He.acquireTokenSilent_silentFlow),[4,this.createRefreshTokenClient(a,n.authority,n.azureCloudOptions)];case 2:return s=l.sent(),this.logger.verbose("Refresh token client created"),[2,s.acquireTokenByRefreshToken(n).then(function(d){return o.endMeasurement({success:!0,fromCache:d.fromCache,requestId:d.requestId}),d}).catch(function(d){throw d instanceof W&&d.setCorrelationId(c.correlationId),a.cacheFailedRequest(d),o.endMeasurement({errorCode:d.errorCode,subErrorCode:d.subError,success:!1}),d})]}})})},e.prototype.logout=function(){return Promise.reject(D.createSilentLogoutUnsupportedError())},e.prototype.createRefreshTokenClient=function(r,n,i){return S(this,void 0,void 0,function(){var o;return k(this,function(a){switch(a.label){case 0:return[4,this.getClientConfiguration(r,n,i)];case 1:return o=a.sent(),[2,new r3(o,this.performanceClient)]}})})},e}($a);var $_=function(){function t(e,r){this.eventCallbacks=new Map,this.logger=e,this.browserCrypto=r,this.listeningToStorageEvents=!1,this.handleAccountCacheChange=this.handleAccountCacheChange.bind(this)}return t.prototype.addEventCallback=function(e){if(typeof window<"u"){var r=this.browserCrypto.createNewGuid();return this.eventCallbacks.set(r,e),this.logger.verbose("Event callback registered with id: "+r),r}return null},t.prototype.removeEventCallback=function(e){this.eventCallbacks.delete(e),this.logger.verbose("Event callback "+e+" removed.")},t.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)))},t.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."))},t.prototype.emitEvent=function(e,r,n,i){var o=this;if(typeof window<"u"){var a={eventType:e,interactionType:r||null,payload:n||null,error:i||null,timestamp:Date.now()};this.logger.info("Emitting event: "+e),this.eventCallbacks.forEach(function(s,c){o.logger.verbose("Emitting event to callback "+c+": "+e),s.apply(null,[a])})}},t.prototype.handleAccountCacheChange=function(e){try{var r=e.newValue||e.oldValue;if(!r)return;var n=JSON.parse(r);if(typeof n!="object"||!kt.isAccountEntity(n))return;var i=Jr.toObject(new kt,n),o=i.getAccountInfo();!e.oldValue&&e.newValue?(this.logger.info("Account was added to cache in a different window"),this.emitEvent(J.ACCOUNT_ADDED,void 0,o)):!e.newValue&&e.oldValue&&(this.logger.info("Account was removed from cache in a different window"),this.emitEvent(J.ACCOUNT_REMOVED,void 0,o))}catch{return}},t}();var Nt=function(){function t(){}return t.decimalToHex=function(e){for(var r=e.toString(16);r.length<2;)r="0"+r;return r},t}();var l3=function(){function t(e){this.cryptoObj=e}return t.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,Nt.decimalToHex(e[0])+Nt.decimalToHex(e[1])+Nt.decimalToHex(e[2])+Nt.decimalToHex(e[3])+"-"+Nt.decimalToHex(e[4])+Nt.decimalToHex(e[5])+"-"+Nt.decimalToHex(e[6])+Nt.decimalToHex(e[7])+"-"+Nt.decimalToHex(e[8])+Nt.decimalToHex(e[9])+"-"+Nt.decimalToHex(e[10])+Nt.decimalToHex(e[11])+Nt.decimalToHex(e[12])+Nt.decimalToHex(e[13])+Nt.decimalToHex(e[14])+Nt.decimalToHex(e[15])}catch{for(var r="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx",n="0123456789abcdef",i=0,o=_.EMPTY_STRING,a=0;a<36;a++)r[a]!=="-"&&r[a]!=="4"&&(i=Math.random()*16|0),r[a]==="x"?o+=n[i]:r[a]==="y"?(i&=3,i|=8,o+=n[i]):o+=r[a];return o}},t.prototype.isGuid=function(e){var r=/^[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 r.test(e)},t}();var Qn=function(){function t(){}return t.stringToUtf8Arr=function(e){for(var r,n=0,i=e.length,o=0;o<i;o++)r=e.charCodeAt(o),n+=r<128?1:r<2048?2:r<65536?3:r<2097152?4:r<67108864?5:6;for(var a=new Uint8Array(n),s=0,c=0;s<n;c++)r=e.charCodeAt(c),r<128?a[s++]=r:r<2048?(a[s++]=192+(r>>>6),a[s++]=128+(r&63)):r<65536?(a[s++]=224+(r>>>12),a[s++]=128+(r>>>6&63),a[s++]=128+(r&63)):r<2097152?(a[s++]=240+(r>>>18),a[s++]=128+(r>>>12&63),a[s++]=128+(r>>>6&63),a[s++]=128+(r&63)):r<67108864?(a[s++]=248+(r>>>24),a[s++]=128+(r>>>18&63),a[s++]=128+(r>>>12&63),a[s++]=128+(r>>>6&63),a[s++]=128+(r&63)):(a[s++]=252+(r>>>30),a[s++]=128+(r>>>24&63),a[s++]=128+(r>>>18&63),a[s++]=128+(r>>>12&63),a[s++]=128+(r>>>6&63),a[s++]=128+(r&63));return a},t.stringToArrayBuffer=function(e){for(var r=new ArrayBuffer(e.length),n=new Uint8Array(r),i=0;i<e.length;i++)n[i]=e.charCodeAt(i);return r},t.utf8ArrToString=function(e){for(var r=_.EMPTY_STRING,n=void 0,i=e.length,o=0;o<i;o++)n=e[o],r+=String.fromCharCode(n>251&&n<254&&o+5<i?(n-252)*1073741824+(e[++o]-128<<24)+(e[++o]-128<<18)+(e[++o]-128<<12)+(e[++o]-128<<6)+e[++o]-128:n>247&&n<252&&o+4<i?(n-248<<24)+(e[++o]-128<<18)+(e[++o]-128<<12)+(e[++o]-128<<6)+e[++o]-128:n>239&&n<248&&o+3<i?(n-240<<18)+(e[++o]-128<<12)+(e[++o]-128<<6)+e[++o]-128:n>223&&n<240&&o+2<i?(n-224<<12)+(e[++o]-128<<6)+e[++o]-128:n>191&&n<224&&o+1<i?(n-192<<6)+e[++o]-128:n);return r},t.getSortedObjectString=function(e){return JSON.stringify(e,Object.keys(e).sort())},t}();var d3=function(){function t(){}return t.prototype.urlEncode=function(e){return encodeURIComponent(this.encode(e).replace(/=/g,_.EMPTY_STRING).replace(/\+/g,"-").replace(/\//g,"_"))},t.prototype.urlEncodeArr=function(e){return this.base64EncArr(e).replace(/=/g,_.EMPTY_STRING).replace(/\+/g,"-").replace(/\//g,"_")},t.prototype.encode=function(e){var r=Qn.stringToUtf8Arr(e);return this.base64EncArr(r)},t.prototype.base64EncArr=function(e){for(var r=(3-e.length%3)%3,n=_.EMPTY_STRING,i=void 0,o=e.length,a=0,s=0;s<o;s++)i=s%3,a|=e[s]<<(16>>>i&24),(i===2||e.length-s===1)&&(n+=String.fromCharCode(this.uint6ToB64(a>>>18&63),this.uint6ToB64(a>>>12&63),this.uint6ToB64(a>>>6&63),this.uint6ToB64(a&63)),a=0);return r===0?n:n.substring(0,n.length-r)+(r===1?"=":"==")},t.prototype.uint6ToB64=function(e){return e<26?e+65:e<52?e+71:e<62?e-4:e===62?43:e===63?47:65},t}();var j_=function(){function t(){}return t.prototype.decode=function(e){var r=e.replace(/-/g,"+").replace(/_/g,"/");switch(r.length%4){case 0:break;case 2:r+="==";break;case 3:r+="=";break;default:throw new Error("Invalid base64 string")}var n=this.base64DecToArr(r);return Qn.utf8ArrToString(n)},t.prototype.base64DecToArr=function(e,r){for(var n=e.replace(/[^A-Za-z0-9\+\/]/g,_.EMPTY_STRING),i=n.length,o=r?Math.ceil((i*3+1>>>2)/r)*r:i*3+1>>>2,a=new Uint8Array(o),s=void 0,c=void 0,l=0,d=0,h=0;h<i;h++)if(c=h&3,l|=this.b64ToUint6(n.charCodeAt(h))<<18-6*c,c===3||i-h===1){for(s=0;s<3&&d<o;s++,d++)a[d]=l>>>(16>>>s&24)&255;l=0}return a},t.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},t}();var B_=32,q_=function(){function t(e){this.base64Encode=new d3,this.cryptoObj=e}return t.prototype.generateCodes=function(){return S(this,void 0,void 0,function(){var e,r;return k(this,function(n){switch(n.label){case 0:return e=this.generateCodeVerifier(),[4,this.generateCodeChallengeFromVerifier(e)];case 1:return r=n.sent(),[2,{verifier:e,challenge:r}]}})})},t.prototype.generateCodeVerifier=function(){try{var e=new Uint8Array(B_);this.cryptoObj.getRandomValues(e);var r=this.base64Encode.urlEncodeArr(e);return r}catch(n){throw D.createPkceNotGeneratedError(n)}},t.prototype.generateCodeChallengeFromVerifier=function(e){return S(this,void 0,void 0,function(){var r,n;return k(this,function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),[4,this.cryptoObj.sha256Digest(e)];case 1:return r=i.sent(),[2,this.base64Encode.urlEncodeArr(new Uint8Array(r))];case 2:throw n=i.sent(),D.createPkceNotGeneratedError(n);case 3:return[2]}})})},t}();var G_=function(){function t(){}return t.prototype.getRandomValues=function(e){return window.crypto.getRandomValues(e)},t.prototype.generateKey=function(e,r,n){return S(this,void 0,void 0,function(){return k(this,function(i){return[2,window.crypto.subtle.generateKey(e,r,n)]})})},t.prototype.exportKey=function(e){return S(this,void 0,void 0,function(){return k(this,function(r){return[2,window.crypto.subtle.exportKey(Ra,e)]})})},t.prototype.importKey=function(e,r,n,i){return S(this,void 0,void 0,function(){return k(this,function(o){return[2,window.crypto.subtle.importKey(Ra,e,r,n,i)]})})},t.prototype.sign=function(e,r,n){return S(this,void 0,void 0,function(){return k(this,function(i){return[2,window.crypto.subtle.sign(e,r,n)]})})},t.prototype.digest=function(e,r){return S(this,void 0,void 0,function(){return k(this,function(n){return[2,window.crypto.subtle.digest(e,r)]})})},t}();var K_=function(){function t(){}return t.prototype.initPrng=function(e){return window.msrCrypto.initPrng(e0(e))},t.prototype.getRandomValues=function(e){return window.msrCrypto.getRandomValues(e)},t.prototype.generateKey=function(e,r,n){return S(this,void 0,void 0,function(){return k(this,function(i){return[2,window.msrCrypto.subtle.generateKey(e,r,n)]})})},t.prototype.exportKey=function(e){return S(this,void 0,void 0,function(){return k(this,function(r){return[2,window.msrCrypto.subtle.exportKey(Ra,e)]})})},t.prototype.importKey=function(e,r,n,i){return S(this,void 0,void 0,function(){return k(this,function(o){return[2,window.msrCrypto.subtle.importKey(Ra,e,r,n,i)]})})},t.prototype.sign=function(e,r,n){return S(this,void 0,void 0,function(){return k(this,function(i){return[2,window.msrCrypto.subtle.sign(e,r,n)]})})},t.prototype.digest=function(e,r){return S(this,void 0,void 0,function(){return k(this,function(n){return[2,window.msrCrypto.subtle.digest(e,r)]})})},t}();var W_=function(){function t(){}return t.prototype.getRandomValues=function(e){return window.msCrypto.getRandomValues(e)},t.prototype.generateKey=function(e,r,n){return S(this,void 0,void 0,function(){return k(this,function(i){return[2,new Promise(function(o,a){var s=window.msCrypto.subtle.generateKey(e,r,n);s.addEventListener("complete",function(c){o(c.target.result)}),s.addEventListener("error",function(c){a(c)})})]})})},t.prototype.exportKey=function(e){return S(this,void 0,void 0,function(){return k(this,function(r){return[2,new Promise(function(n,i){var o=window.msCrypto.subtle.exportKey(Ra,e);o.addEventListener("complete",function(a){var s=a.target.result,c=Qn.utf8ArrToString(new Uint8Array(s)).replace(/\r/g,_.EMPTY_STRING).replace(/\n/g,_.EMPTY_STRING).replace(/\t/g,_.EMPTY_STRING).split(" ").join(_.EMPTY_STRING).replace("\0",_.EMPTY_STRING);try{n(JSON.parse(c))}catch(l){i(l)}}),o.addEventListener("error",function(a){i(a)})})]})})},t.prototype.importKey=function(e,r,n,i){return S(this,void 0,void 0,function(){var o,a;return k(this,function(s){return o=Qn.getSortedObjectString(e),a=Qn.stringToArrayBuffer(o),[2,new Promise(function(c,l){var d=window.msCrypto.subtle.importKey(Ra,a,r,n,i);d.addEventListener("complete",function(h){c(h.target.result)}),d.addEventListener("error",function(h){l(h)})})]})})},t.prototype.sign=function(e,r,n){return S(this,void 0,void 0,function(){return k(this,function(i){return[2,new Promise(function(o,a){var s=window.msCrypto.subtle.sign(e,r,n);s.addEventListener("complete",function(c){o(c.target.result)}),s.addEventListener("error",function(c){a(c)})})]})})},t.prototype.digest=function(e,r){return S(this,void 0,void 0,function(){return k(this,function(n){return[2,new Promise(function(i,o){var a=window.msCrypto.subtle.digest(e,r.buffer);a.addEventListener("complete",function(s){i(s.target.result)}),a.addEventListener("error",function(s){o(s)})})]})})},t}();var Y_="RSASSA-PKCS1-v1_5",mm="SHA-256",Q_=2048,X_=new Uint8Array([1,0,1]),h3=function(){function t(e,r){var n,i;if(this.logger=e,this.cryptoOptions=r,this.hasBrowserCrypto())this.logger.verbose("BrowserCrypto: modern crypto interface available"),this.subtleCrypto=new G_;else if(this.hasIECrypto())this.logger.verbose("BrowserCrypto: MS crypto interface available"),this.subtleCrypto=new W_;else if(this.hasMsrCrypto()&&((n=this.cryptoOptions)===null||n===void 0?void 0:n.useMsrCrypto))this.logger.verbose("BrowserCrypto: MSR crypto interface available"),this.subtleCrypto=new K_;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."),D.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."),Yd.createEntropyNotProvided();this.logger.verbose("BrowserCrypto: Entropy provided"),this.subtleCrypto.initPrng(this.cryptoOptions.entropy)}this.keygenAlgorithmOptions={name:Y_,hash:mm,modulusLength:Q_,publicExponent:X_}}return t.prototype.hasIECrypto=function(){return"msCrypto"in window},t.prototype.hasBrowserCrypto=function(){return"crypto"in window},t.prototype.hasMsrCrypto=function(){return"msrCrypto"in window},t.prototype.sha256Digest=function(e){return S(this,void 0,void 0,function(){var r;return k(this,function(n){return r=Qn.stringToUtf8Arr(e),[2,this.subtleCrypto.digest({name:mm},r)]})})},t.prototype.getRandomValues=function(e){return this.subtleCrypto.getRandomValues(e)},t.prototype.generateKeyPair=function(e,r){return S(this,void 0,void 0,function(){return k(this,function(n){return[2,this.subtleCrypto.generateKey(this.keygenAlgorithmOptions,e,r)]})})},t.prototype.exportJwk=function(e){return S(this,void 0,void 0,function(){return k(this,function(r){return[2,this.subtleCrypto.exportKey(e)]})})},t.prototype.importJwk=function(e,r,n){return S(this,void 0,void 0,function(){return k(this,function(i){return[2,this.subtleCrypto.importKey(e,this.keygenAlgorithmOptions,r,n)]})})},t.prototype.sign=function(e,r){return S(this,void 0,void 0,function(){return k(this,function(n){return[2,this.subtleCrypto.sign(this.keygenAlgorithmOptions,e,r)]})})},t}();var J_=function(){function t(){this.dbName=h2,this.version=A_,this.tableName=T_,this.dbOpen=!1}return t.prototype.open=function(){return S(this,void 0,void 0,function(){var e=this;return k(this,function(r){return[2,new Promise(function(n,i){var o=window.indexedDB.open(e.dbName,e.version);o.addEventListener("upgradeneeded",function(a){var s=a;s.target.result.createObjectStore(e.tableName)}),o.addEventListener("success",function(a){var s=a;e.db=s.target.result,e.dbOpen=!0,n()}),o.addEventListener("error",function(){return i(D.createDatabaseUnavailableError())})})]})})},t.prototype.closeConnection=function(){var e=this.db;e&&this.dbOpen&&(e.close(),this.dbOpen=!1)},t.prototype.validateDbIsOpen=function(){return S(this,void 0,void 0,function(){return k(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]}})})},t.prototype.getItem=function(e){return S(this,void 0,void 0,function(){var r=this;return k(this,function(n){switch(n.label){case 0:return[4,this.validateDbIsOpen()];case 1:return n.sent(),[2,new Promise(function(i,o){if(!r.db)return o(D.createDatabaseNotOpenError());var a=r.db.transaction([r.tableName],"readonly"),s=a.objectStore(r.tableName),c=s.get(e);c.addEventListener("success",function(l){var d=l;r.closeConnection(),i(d.target.result)}),c.addEventListener("error",function(l){r.closeConnection(),o(l)})})]}})})},t.prototype.setItem=function(e,r){return S(this,void 0,void 0,function(){var n=this;return k(this,function(i){switch(i.label){case 0:return[4,this.validateDbIsOpen()];case 1:return i.sent(),[2,new Promise(function(o,a){if(!n.db)return a(D.createDatabaseNotOpenError());var s=n.db.transaction([n.tableName],"readwrite"),c=s.objectStore(n.tableName),l=c.put(r,e);l.addEventListener("success",function(){n.closeConnection(),o()}),l.addEventListener("error",function(d){n.closeConnection(),a(d)})})]}})})},t.prototype.removeItem=function(e){return S(this,void 0,void 0,function(){var r=this;return k(this,function(n){switch(n.label){case 0:return[4,this.validateDbIsOpen()];case 1:return n.sent(),[2,new Promise(function(i,o){if(!r.db)return o(D.createDatabaseNotOpenError());var a=r.db.transaction([r.tableName],"readwrite"),s=a.objectStore(r.tableName),c=s.delete(e);c.addEventListener("success",function(){r.closeConnection(),i()}),c.addEventListener("error",function(l){r.closeConnection(),o(l)})})]}})})},t.prototype.getKeys=function(){return S(this,void 0,void 0,function(){var e=this;return k(this,function(r){switch(r.label){case 0:return[4,this.validateDbIsOpen()];case 1:return r.sent(),[2,new Promise(function(n,i){if(!e.db)return i(D.createDatabaseNotOpenError());var o=e.db.transaction([e.tableName],"readonly"),a=o.objectStore(e.tableName),s=a.getAllKeys();s.addEventListener("success",function(c){var l=c;e.closeConnection(),n(l.target.result)}),s.addEventListener("error",function(c){e.closeConnection(),i(c)})})]}})})},t.prototype.containsKey=function(e){return S(this,void 0,void 0,function(){var r=this;return k(this,function(n){switch(n.label){case 0:return[4,this.validateDbIsOpen()];case 1:return n.sent(),[2,new Promise(function(i,o){if(!r.db)return o(D.createDatabaseNotOpenError());var a=r.db.transaction([r.tableName],"readonly"),s=a.objectStore(r.tableName),c=s.count(e);c.addEventListener("success",function(l){var d=l;r.closeConnection(),i(d.target.result===1)}),c.addEventListener("error",function(l){r.closeConnection(),o(l)})})]}})})},t.prototype.deleteDatabase=function(){return S(this,void 0,void 0,function(){return k(this,function(e){return this.db&&this.dbOpen&&this.closeConnection(),[2,new Promise(function(r,n){var i=window.indexedDB.deleteDatabase(h2);i.addEventListener("success",function(){return r(!0)}),i.addEventListener("blocked",function(){return r(!0)}),i.addEventListener("error",function(){return n(!1)})})]})})},t}();var vm=function(){function t(e,r){this.inMemoryCache=new u2,this.indexedDBCache=new J_,this.logger=e,this.storeName=r}return t.prototype.handleDatabaseAccessError=function(e){if(e instanceof D&&e.errorCode===P.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},t.prototype.getItem=function(e){return S(this,void 0,void 0,function(){var r,n;return k(this,function(i){switch(i.label){case 0:if(r=this.inMemoryCache.getItem(e),r)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 n=i.sent(),this.handleDatabaseAccessError(n),[3,4];case 4:return[2,r]}})})},t.prototype.setItem=function(e,r){return S(this,void 0,void 0,function(){var n;return k(this,function(i){switch(i.label){case 0:this.inMemoryCache.setItem(e,r),i.label=1;case 1:return i.trys.push([1,3,,4]),[4,this.indexedDBCache.setItem(e,r)];case 2:return i.sent(),[3,4];case 3:return n=i.sent(),this.handleDatabaseAccessError(n),[3,4];case 4:return[2]}})})},t.prototype.removeItem=function(e){return S(this,void 0,void 0,function(){var r;return k(this,function(n){switch(n.label){case 0:this.inMemoryCache.removeItem(e),n.label=1;case 1:return n.trys.push([1,3,,4]),[4,this.indexedDBCache.removeItem(e)];case 2:return n.sent(),[3,4];case 3:return r=n.sent(),this.handleDatabaseAccessError(r),[3,4];case 4:return[2]}})})},t.prototype.getKeys=function(){return S(this,void 0,void 0,function(){var e,r;return k(this,function(n){switch(n.label){case 0:if(e=this.inMemoryCache.getKeys(),e.length!==0)return[3,4];n.label=1;case 1:return n.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,n.sent()];case 3:return r=n.sent(),this.handleDatabaseAccessError(r),[3,4];case 4:return[2,e]}})})},t.prototype.containsKey=function(e){return S(this,void 0,void 0,function(){var r,n;return k(this,function(i){switch(i.label){case 0:if(r=this.inMemoryCache.containsKey(e),r)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 n=i.sent(),this.handleDatabaseAccessError(n),[3,4];case 4:return[2,r]}})})},t.prototype.clearInMemory=function(){this.logger.verbose("Deleting in-memory keystore "+this.storeName),this.inMemoryCache.clear(),this.logger.verbose("In-memory keystore "+this.storeName+" deleted")},t.prototype.clearPersistent=function(){return S(this,void 0,void 0,function(){var e,r;return k(this,function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),this.logger.verbose("Deleting persistent keystore"),[4,this.indexedDBCache.deleteDatabase()];case 1:return e=n.sent(),e&&this.logger.verbose("Persistent keystore deleted"),[2,e];case 2:return r=n.sent(),this.handleDatabaseAccessError(r),[2,!1];case 3:return[2]}})})},t}();var Qd;(function(t){t.asymmetricKeys="asymmetricKeys",t.symmetricKeys="symmetricKeys"})(Qd||(Qd={}));var Z_=function(){function t(e){this.logger=e,this.asymmetricKeys=new vm(this.logger,Qd.asymmetricKeys),this.symmetricKeys=new vm(this.logger,Qd.symmetricKeys)}return t.prototype.clear=function(){return S(this,void 0,void 0,function(){var e;return k(this,function(r){switch(r.label){case 0:this.asymmetricKeys.clearInMemory(),this.symmetricKeys.clearInMemory(),r.label=1;case 1:return r.trys.push([1,3,,4]),[4,this.asymmetricKeys.clearPersistent()];case 2:return r.sent(),[2,!0];case 3:return e=r.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]}})})},t}();var eb=function(){function t(e,r,n){this.logger=e,this.browserCrypto=new h3(this.logger,n),this.b64Encode=new d3,this.b64Decode=new j_,this.guidGenerator=new l3(this.browserCrypto),this.pkceGenerator=new q_(this.browserCrypto),this.cache=new Z_(this.logger),this.performanceClient=r}return t.prototype.createNewGuid=function(){return this.guidGenerator.generateGuid()},t.prototype.base64Encode=function(e){return this.b64Encode.encode(e)},t.prototype.base64Decode=function(e){return this.b64Decode.decode(e)},t.prototype.generatePkceCodes=function(){return S(this,void 0,void 0,function(){return k(this,function(e){return[2,this.pkceGenerator.generateCodes()]})})},t.prototype.getPublicKeyThumbprint=function(e){var r;return S(this,void 0,void 0,function(){var n,i,o,a,s,c,l,d;return k(this,function(h){switch(h.label){case 0:return n=(r=this.performanceClient)===null||r===void 0?void 0:r.startMeasurement(pt.CryptoOptsGetPublicKeyThumbprint,e.correlationId),[4,this.browserCrypto.generateKeyPair(t.EXTRACTABLE,t.POP_KEY_USAGES)];case 1:return i=h.sent(),[4,this.browserCrypto.exportJwk(i.publicKey)];case 2:return o=h.sent(),a={e:o.e,kty:o.kty,n:o.n},s=Qn.getSortedObjectString(a),[4,this.hashString(s)];case 3:return c=h.sent(),[4,this.browserCrypto.exportJwk(i.privateKey)];case 4:return l=h.sent(),[4,this.browserCrypto.importJwk(l,!1,["sign"])];case 5:return d=h.sent(),[4,this.cache.asymmetricKeys.setItem(c,{privateKey:d,publicKey:i.publicKey,requestMethod:e.resourceRequestMethod,requestUri:e.resourceRequestUri})];case 6:return h.sent(),n&&n.endMeasurement({success:!0}),[2,c]}})})},t.prototype.removeTokenBindingKey=function(e){return S(this,void 0,void 0,function(){var r;return k(this,function(n){switch(n.label){case 0:return[4,this.cache.asymmetricKeys.removeItem(e)];case 1:return n.sent(),[4,this.cache.asymmetricKeys.containsKey(e)];case 2:return r=n.sent(),[2,!r]}})})},t.prototype.clearKeystore=function(){return S(this,void 0,void 0,function(){return k(this,function(e){switch(e.label){case 0:return[4,this.cache.clear()];case 1:return[2,e.sent()]}})})},t.prototype.signJwt=function(e,r,n){var i;return S(this,void 0,void 0,function(){var o,a,s,c,l,d,h,u,f,v,g,x,m;return k(this,function(p){switch(p.label){case 0:return o=(i=this.performanceClient)===null||i===void 0?void 0:i.startMeasurement(pt.CryptoOptsSignJwt,n),[4,this.cache.asymmetricKeys.getItem(r)];case 1:if(a=p.sent(),!a)throw D.createSigningKeyNotFoundInStorageError(r);return[4,this.browserCrypto.exportJwk(a.publicKey)];case 2:return s=p.sent(),c=Qn.getSortedObjectString(s),l=this.b64Encode.urlEncode(JSON.stringify({kid:r})),d=C_.getShrHeaderString({kid:l,alg:s.alg}),h=this.b64Encode.urlEncode(d),e.cnf={jwk:JSON.parse(c)},u=this.b64Encode.urlEncode(JSON.stringify(e)),f=h+"."+u,v=Qn.stringToArrayBuffer(f),[4,this.browserCrypto.sign(a.privateKey,v)];case 3:return g=p.sent(),x=this.b64Encode.urlEncodeArr(new Uint8Array(g)),m=f+"."+x,o&&o.endMeasurement({success:!0}),[2,m]}})})},t.prototype.hashString=function(e){return S(this,void 0,void 0,function(){var r,n;return k(this,function(i){switch(i.label){case 0:return[4,this.browserCrypto.sha256Digest(e)];case 1:return r=i.sent(),n=new Uint8Array(r),[2,this.b64Encode.urlEncodeArr(n)]}})})},t.POP_KEY_USAGES=["sign","verify"],t.EXTRACTABLE=!0,t}();var tb=function(){function t(e,r,n,i){this.isBrowserEnvironment=typeof window<"u",this.config=e,this.storage=r,this.logger=n,this.cryptoObj=i}return t.prototype.loadExternalTokens=function(e,r,n){if(this.logger.info("TokenCache - loadExternalTokens called"),!r.id_token)throw D.createUnableToLoadTokenError("Please ensure server response includes id token.");var i=new Tn(r.id_token,this.cryptoObj),o,a;if(e.account){var s=this.loadAccount(i,e.account.environment,void 0,void 0,e.account.homeAccountId);o=new Bl(s,this.loadIdToken(i,s.homeAccountId,e.account.environment,e.account.tenantId),this.loadAccessToken(e,r,s.homeAccountId,e.account.environment,e.account.tenantId,n),this.loadRefreshToken(e,r,s.homeAccountId,e.account.environment))}else if(e.authority){var c=Gd.generateAuthority(e.authority,e.azureCloudOptions),l={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(a=new Gd(c,this.config.system.networkClient,this.storage,l,this.logger),n.clientInfo){this.logger.trace("TokenCache - homeAccountId from options");var s=this.loadAccount(i,a.hostnameAndPort,n.clientInfo,a.authorityType);o=new Bl(s,this.loadIdToken(i,s.homeAccountId,a.hostnameAndPort,a.tenant),this.loadAccessToken(e,r,s.homeAccountId,a.hostnameAndPort,a.tenant,n),this.loadRefreshToken(e,r,s.homeAccountId,a.hostnameAndPort))}else if(r.client_info){this.logger.trace("TokenCache - homeAccountId from response");var s=this.loadAccount(i,a.hostnameAndPort,r.client_info,a.authorityType);o=new Bl(s,this.loadIdToken(i,s.homeAccountId,a.hostnameAndPort,a.tenant),this.loadAccessToken(e,r,s.homeAccountId,a.hostnameAndPort,a.tenant,n),this.loadRefreshToken(e,r,s.homeAccountId,a.hostnameAndPort))}else throw D.createUnableToLoadTokenError("Please provide clientInfo in the response or options.")}else throw D.createUnableToLoadTokenError("Please provide a request with an account or a request with authority.");return this.generateAuthenticationResult(e,i,o,a)},t.prototype.loadAccount=function(e,r,n,i,o){var a;if(o?a=o:i!==void 0&&n&&(a=kt.generateHomeAccountId(n,i,this.logger,this.cryptoObj,e)),!a)throw D.createUnableToLoadTokenError("Unexpected missing homeAccountId");var s=n?kt.createAccount(n,a,e,void 0,void 0,void 0,r):kt.createGenericAccount(a,e,void 0,void 0,void 0,r);if(this.isBrowserEnvironment)return this.logger.verbose("TokenCache - loading account"),this.storage.setAccount(s),s;throw D.createUnableToLoadTokenError("loadExternalTokens is designed to work in browser environments only.")},t.prototype.loadIdToken=function(e,r,n,i){var o=uc.createIdTokenEntity(r,n,e.rawToken,this.config.auth.clientId,i);if(this.isBrowserEnvironment)return this.logger.verbose("TokenCache - loading id token"),this.storage.setIdTokenCredential(o),o;throw D.createUnableToLoadTokenError("loadExternalTokens is designed to work in browser environments only.")},t.prototype.loadAccessToken=function(e,r,n,i,o,a){if(!r.access_token)return this.logger.verbose("TokenCache - No access token provided for caching"),null;if(!r.expires_in)throw D.createUnableToLoadTokenError("Please ensure server response includes expires_in value.");if(!a.extendedExpiresOn)throw D.createUnableToLoadTokenError("Please provide an extendedExpiresOn value in the options.");var s=new er(e.scopes).printScopes(),c=a.expiresOn||r.expires_in+new Date().getTime()/1e3,l=a.extendedExpiresOn,d=fc.createAccessTokenEntity(n,i,r.access_token,this.config.auth.clientId,o,s,c,l,this.cryptoObj);if(this.isBrowserEnvironment)return this.logger.verbose("TokenCache - loading access token"),this.storage.setAccessTokenCredential(d),d;throw D.createUnableToLoadTokenError("loadExternalTokens is designed to work in browser environments only.")},t.prototype.loadRefreshToken=function(e,r,n,i){if(!r.refresh_token)return this.logger.verbose("TokenCache - No refresh token provided for caching"),null;var o=jd.createRefreshTokenEntity(n,i,r.refresh_token,this.config.auth.clientId);if(this.isBrowserEnvironment)return this.logger.verbose("TokenCache - loading refresh token"),this.storage.setRefreshTokenCredential(o),o;throw D.createUnableToLoadTokenError("loadExternalTokens is designed to work in browser environments only.")},t.prototype.generateAuthenticationResult=function(e,r,n,i){var o,a,s,c=_.EMPTY_STRING,l=[],d=null,h;n!=null&&n.accessToken&&(c=n.accessToken.secret,l=er.fromString(n.accessToken.target).asArray(),d=new Date(Number(n.accessToken.expiresOn)*1e3),h=new Date(Number(n.accessToken.extendedExpiresOn)*1e3));var u=(r==null?void 0:r.claims.oid)||(r==null?void 0:r.claims.sub)||_.EMPTY_STRING,f=(r==null?void 0:r.claims.tid)||_.EMPTY_STRING;return{authority:i?i.canonicalAuthority:_.EMPTY_STRING,uniqueId:u,tenantId:f,scopes:l,account:n!=null&&n.account?n.account.getAccountInfo():null,idToken:r?r.rawToken:_.EMPTY_STRING,idTokenClaims:r?r.claims:{},accessToken:c,fromCache:!0,expiresOn:d,correlationId:e.correlationId||_.EMPTY_STRING,requestId:_.EMPTY_STRING,extExpiresOn:h,familyId:_.EMPTY_STRING,tokenType:((o=n==null?void 0:n.accessToken)===null||o===void 0?void 0:o.tokenType)||_.EMPTY_STRING,state:_.EMPTY_STRING,cloudGraphHostName:((a=n==null?void 0:n.account)===null||a===void 0?void 0:a.cloudGraphHostName)||_.EMPTY_STRING,msGraphHost:((s=n==null?void 0:n.account)===null||s===void 0?void 0:s.msGraphHost)||_.EMPTY_STRING,code:void 0,fromNativeBroker:!1}},t}();var rb=function(t){It(e,t);function e(r){var n=t.call(this,r)||this;return n.includeRedirectUri=!1,n}return e}(t3);var nb=function(t){It(e,t);function e(r,n,i,o,a,s,c,l,d,h){var u=t.call(this,r,n,i,o,a,s,l,d,h)||this;return u.apiId=c,u}return e.prototype.acquireToken=function(r){return S(this,void 0,void 0,function(){var n,i,o,a,s,c,l;return k(this,function(d){switch(d.label){case 0:if(this.logger.trace("SilentAuthCodeClient.acquireToken called"),!r.code)throw D.createAuthCodeRequiredError();return[4,this.initializeAuthorizationRequest(r,G.Silent)];case 1:n=d.sent(),this.browserStorage.updateCacheEntries(n.state,n.nonce,n.authority,n.loginHint||_.EMPTY_STRING,n.account||null),i=this.initializeServerTelemetryManager(this.apiId),d.label=2;case 2:return d.trys.push([2,4,,5]),o=K(K({},n),{code:r.code}),[4,this.getClientConfiguration(i,n.authority)];case 3:return a=d.sent(),s=new rb(a),this.logger.verbose("Auth code client created"),c=new c3(s,this.browserStorage,o,this.logger,this.config.system),[2,c.handleCodeResponseFromServer({code:r.code,msgraph_host:r.msGraphHost,cloud_graph_host_name:r.cloudGraphHostName,cloud_instance_host_name:r.cloudInstanceHostName},n.state,s.authority,this.networkClient,!1)];case 4:throw l=d.sent(),l instanceof W&&l.setCorrelationId(this.correlationId),i.cacheFailedRequest(l),this.browserStorage.cleanRequestByState(n.state),l;case 5:return[2]}})})},e.prototype.logout=function(){return Promise.reject(D.createSilentLogoutUnsupportedError())},e}($a);var ib=function(){function t(e,r){this.correlationId=r,this.measureName="msal.measure."+e+"."+this.correlationId,this.startMark="msal.start."+e+"."+this.correlationId,this.endMark="msal.end."+e+"."+this.correlationId}return t.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"},t.prototype.startMeasurement=function(){if(t.supportsBrowserPerformance())try{window.performance.mark(this.startMark)}catch{}},t.prototype.endMeasurement=function(){if(t.supportsBrowserPerformance())try{window.performance.mark(this.endMark),window.performance.measure(this.measureName,this.startMark,this.endMark)}catch{}},t.prototype.flushMeasurement=function(){if(t.supportsBrowserPerformance())try{var e=window.performance.getEntriesByName(this.measureName,"measure");if(e.length>0){var r=e[0].duration;return window.performance.clearMeasures(this.measureName),window.performance.clearMarks(this.startMark),window.performance.clearMarks(this.endMark),r}}catch{}return null},t}();var ob=function(t){It(e,t);function e(r,n,i,o,a,s,c){var l=t.call(this,r,n,i,o,a,s)||this;return l.browserCrypto=new h3(l.logger,c),l.guidGenerator=new l3(l.browserCrypto),l}return e.prototype.startPerformanceMeasuremeant=function(r,n){return new ib(r,n)},e.prototype.generateId=function(){return this.guidGenerator.generateGuid()},e.prototype.getPageVisibility=function(){var r;return((r=document.visibilityState)===null||r===void 0?void 0:r.toString())||null},e.prototype.startMeasurement=function(r,n){var i=this,o=this.getPageVisibility(),a=t.prototype.startMeasurement.call(this,r,n);return K(K({},a),{endMeasurement:function(s){return a.endMeasurement(K({startPageVisibility:o,endPageVisibility:i.getPageVisibility()},s))}})},e}(i3);var ab=function(){function t(e){this.isBrowserEnvironment=typeof window<"u",this.config=V_(e,this.isBrowserEnvironment),this.initialized=!1,this.logger=new t0(this.config.system.loggerOptions,wh,Us),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 ob(this.config.auth.clientId,this.config.auth.authority,this.logger,wh,Us,this.config.telemetry.application,this.config.system.cryptoOptions):new k_(this.config.auth.clientId,this.config.auth.authority,this.logger,wh,Us,this.config.telemetry.application),this.browserCrypto=this.isBrowserEnvironment?new eb(this.logger,this.performanceClient,this.config.system.cryptoOptions):Fd,this.eventHandler=new $_(this.logger,this.browserCrypto),this.browserStorage=this.isBrowserEnvironment?new f2(this.config.auth.clientId,this.config.cache,this.browserCrypto,this.logger):I_(this.config.auth.clientId,this.logger);var r={cacheLocation:Ut.MemoryStorage,storeAuthStateInCookie:!1,secureCookies:!1};this.nativeInternalStorage=new f2(this.config.auth.clientId,r,this.browserCrypto,this.logger),this.tokenCache=new tb(this.config,this.browserStorage,this.logger,this.browserCrypto)}return t.prototype.initialize=function(){return S(this,void 0,void 0,function(){var e,r;return k(this,function(n){switch(n.label){case 0:if(this.logger.trace("initialize called"),this.initialized)return this.logger.info("initialize has already been called, exiting early."),[2];if(this.eventHandler.emitEvent(J.INITIALIZE_START),!this.config.system.allowNativeBroker)return[3,4];n.label=1;case 1:return n.trys.push([1,3,,4]),e=this,[4,vo.createProvider(this.logger,this.config.system.nativeBrokerHandshakeTimeout)];case 2:return e.nativeExtensionProvider=n.sent(),[3,4];case 3:return r=n.sent(),this.logger.verbose(r),[3,4];case 4:return this.initialized=!0,this.eventHandler.emitEvent(J.INITIALIZE_END),[2]}})})},t.prototype.handleRedirectPromise=function(e){return S(this,void 0,void 0,function(){var r,n,i,o,a,s,c,l,d=this;return k(this,function(h){return this.logger.verbose("handleRedirectPromise called"),Je.blockNativeBrokerCalledBeforeInitialized(this.config.system.allowNativeBroker,this.initialized),r=this.getAllAccounts(),this.isBrowserEnvironment?(n=e||_.EMPTY_STRING,i=this.redirectResponse.get(n),typeof i>"u"?(this.eventHandler.emitEvent(J.HANDLE_REDIRECT_START,G.Redirect),this.logger.verbose("handleRedirectPromise has been called for the first time, storing the promise"),o=this.browserStorage.getCachedNativeRequest(),a=void 0,o&&vo.isNativeAvailable(this.config,this.logger,this.nativeExtensionProvider)&&this.nativeExtensionProvider&&!e?(this.logger.trace("handleRedirectPromise - acquiring token from native platform"),s=new xa(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,He.handleRedirectPromise,this.performanceClient,this.nativeExtensionProvider,o.accountId,this.nativeInternalStorage,o.correlationId),a=s.handleRedirectPromise()):(this.logger.trace("handleRedirectPromise - acquiring token from web flow"),c=this.browserStorage.getTemporaryCache(ye.CORRELATION_ID,!0)||_.EMPTY_STRING,l=this.createRedirectClient(c),a=l.handleRedirectPromise(e)),i=a.then(function(u){if(u){var f=r.length<d.getAllAccounts().length;f?(d.eventHandler.emitEvent(J.LOGIN_SUCCESS,G.Redirect,u),d.logger.verbose("handleRedirectResponse returned result, login success")):(d.eventHandler.emitEvent(J.ACQUIRE_TOKEN_SUCCESS,G.Redirect,u),d.logger.verbose("handleRedirectResponse returned result, acquire token success"))}return d.eventHandler.emitEvent(J.HANDLE_REDIRECT_END,G.Redirect),u}).catch(function(u){throw r.length>0?d.eventHandler.emitEvent(J.ACQUIRE_TOKEN_FAILURE,G.Redirect,null,u):d.eventHandler.emitEvent(J.LOGIN_FAILURE,G.Redirect,null,u),d.eventHandler.emitEvent(J.HANDLE_REDIRECT_END,G.Redirect),u}),this.redirectResponse.set(n,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])})})},t.prototype.acquireTokenRedirect=function(e){return S(this,void 0,void 0,function(){var r,n,i,o,a,s=this;return k(this,function(c){return r=this.getRequestCorrelationId(e),this.logger.verbose("acquireTokenRedirect called",r),this.preflightBrowserEnvironmentCheck(G.Redirect),n=this.getAllAccounts().length>0,n?this.eventHandler.emitEvent(J.ACQUIRE_TOKEN_START,G.Redirect,e):this.eventHandler.emitEvent(J.LOGIN_START,G.Redirect,e),this.nativeExtensionProvider&&this.canUseNative(e)?(o=new xa(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,He.acquireTokenRedirect,this.performanceClient,this.nativeExtensionProvider,this.getNativeAccountId(e),this.nativeInternalStorage,e.correlationId),i=o.acquireTokenRedirect(e).catch(function(l){if(l instanceof xn&&l.isFatal()){s.nativeExtensionProvider=void 0;var d=s.createRedirectClient(e.correlationId);return d.acquireToken(e)}else if(l instanceof an){s.logger.verbose("acquireTokenRedirect - Resolving interaction required error thrown by native broker by falling back to web flow");var d=s.createRedirectClient(e.correlationId);return d.acquireToken(e)}throw s.browserStorage.setInteractionInProgress(!1),l})):(a=this.createRedirectClient(e.correlationId),i=a.acquireToken(e)),[2,i.catch(function(l){throw n?s.eventHandler.emitEvent(J.ACQUIRE_TOKEN_FAILURE,G.Redirect,null,l):s.eventHandler.emitEvent(J.LOGIN_FAILURE,G.Redirect,null,l),l})]})})},t.prototype.acquireTokenPopup=function(e){var r=this,n=this.getRequestCorrelationId(e),i=this.performanceClient.startMeasurement(pt.AcquireTokenPopup,n);try{this.logger.verbose("acquireTokenPopup called",n),this.preflightBrowserEnvironmentCheck(G.Popup)}catch(c){return Promise.reject(c)}var o=this.getAllAccounts();o.length>0?this.eventHandler.emitEvent(J.ACQUIRE_TOKEN_START,G.Popup,e):this.eventHandler.emitEvent(J.LOGIN_START,G.Popup,e);var a;if(this.canUseNative(e))a=this.acquireTokenNative(e,He.acquireTokenPopup).then(function(c){return r.browserStorage.setInteractionInProgress(!1),i.endMeasurement({success:!0,isNativeBroker:!0,requestId:c.requestId}),i.flushMeasurement(),c}).catch(function(c){if(c instanceof xn&&c.isFatal()){r.nativeExtensionProvider=void 0;var l=r.createPopupClient(e.correlationId);return l.acquireToken(e)}else if(c instanceof an){r.logger.verbose("acquireTokenPopup - Resolving interaction required error thrown by native broker by falling back to web flow");var l=r.createPopupClient(e.correlationId);return l.acquireToken(e)}throw r.browserStorage.setInteractionInProgress(!1),c});else{var s=this.createPopupClient(e.correlationId);a=s.acquireToken(e)}return a.then(function(c){var l=o.length<r.getAllAccounts().length;return l?r.eventHandler.emitEvent(J.LOGIN_SUCCESS,G.Popup,c):r.eventHandler.emitEvent(J.ACQUIRE_TOKEN_SUCCESS,G.Popup,c),i.addStaticFields({accessTokenSize:c.accessToken.length,idTokenSize:c.idToken.length}),i.endMeasurement({success:!0,requestId:c.requestId}),i.flushMeasurement(),c}).catch(function(c){return o.length>0?r.eventHandler.emitEvent(J.ACQUIRE_TOKEN_FAILURE,G.Popup,null,c):r.eventHandler.emitEvent(J.LOGIN_FAILURE,G.Popup,null,c),i.endMeasurement({errorCode:c.errorCode,subErrorCode:c.subError,success:!1}),i.flushMeasurement(),Promise.reject(c)})},t.prototype.ssoSilent=function(e){return S(this,void 0,void 0,function(){var r,n,i,o,a,s=this;return k(this,function(c){return r=this.getRequestCorrelationId(e),n=K(K({},e),{prompt:e.prompt,correlationId:r}),this.preflightBrowserEnvironmentCheck(G.Silent),i=this.performanceClient.startMeasurement(pt.SsoSilent,r),this.logger.verbose("ssoSilent called",r),this.eventHandler.emitEvent(J.SSO_SILENT_START,G.Silent,n),this.canUseNative(n)?o=this.acquireTokenNative(n,He.ssoSilent).catch(function(l){if(l instanceof xn&&l.isFatal()){s.nativeExtensionProvider=void 0;var d=s.createSilentIframeClient(n.correlationId);return d.acquireToken(n)}throw l}):(a=this.createSilentIframeClient(n.correlationId),o=a.acquireToken(n)),[2,o.then(function(l){return s.eventHandler.emitEvent(J.SSO_SILENT_SUCCESS,G.Silent,l),i.addStaticFields({accessTokenSize:l.accessToken.length,idTokenSize:l.idToken.length}),i.endMeasurement({success:!0,isNativeBroker:l.fromNativeBroker,requestId:l.requestId}),i.flushMeasurement(),l}).catch(function(l){throw s.eventHandler.emitEvent(J.SSO_SILENT_FAILURE,G.Silent,null,l),i.endMeasurement({errorCode:l.errorCode,subErrorCode:l.subError,success:!1}),i.flushMeasurement(),l})]})})},t.prototype.acquireTokenByCode=function(e){return S(this,void 0,void 0,function(){var r,n,i,o,a=this;return k(this,function(s){r=this.getRequestCorrelationId(e),this.preflightBrowserEnvironmentCheck(G.Silent),this.logger.trace("acquireTokenByCode called",r),this.eventHandler.emitEvent(J.ACQUIRE_TOKEN_BY_CODE_START,G.Silent,e),n=this.performanceClient.startMeasurement(pt.AcquireTokenByCode,e.correlationId);try{if(e.code)return i=e.code,o=this.hybridAuthCodeResponses.get(i),o?(this.logger.verbose("Existing acquireTokenByCode request found",e.correlationId),n.endMeasurement({success:!0}),n.discardMeasurement()):(this.logger.verbose("Initiating new acquireTokenByCode request",r),o=this.acquireTokenByCodeAsync(K(K({},e),{correlationId:r})).then(function(c){return a.eventHandler.emitEvent(J.ACQUIRE_TOKEN_BY_CODE_SUCCESS,G.Silent,c),a.hybridAuthCodeResponses.delete(i),n.addStaticFields({accessTokenSize:c.accessToken.length,idTokenSize:c.idToken.length}),n.endMeasurement({success:!0,isNativeBroker:c.fromNativeBroker,requestId:c.requestId}),n.flushMeasurement(),c}).catch(function(c){throw a.hybridAuthCodeResponses.delete(i),a.eventHandler.emitEvent(J.ACQUIRE_TOKEN_BY_CODE_FAILURE,G.Silent,null,c),n.endMeasurement({errorCode:c.errorCode,subErrorCode:c.subError,success:!1}),n.flushMeasurement(),c}),this.hybridAuthCodeResponses.set(i,o)),[2,o];if(e.nativeAccountId){if(this.canUseNative(e,e.nativeAccountId))return[2,this.acquireTokenNative(e,He.acquireTokenByCode,e.nativeAccountId).catch(function(c){throw c instanceof xn&&c.isFatal()&&(a.nativeExtensionProvider=void 0),c})];throw D.createUnableToAcquireTokenFromNativePlatformError()}else throw D.createAuthCodeOrNativeAccountIdRequiredError()}catch(c){throw this.eventHandler.emitEvent(J.ACQUIRE_TOKEN_BY_CODE_FAILURE,G.Silent,null,c),n.endMeasurement({errorCode:c instanceof W&&c.errorCode||void 0,subErrorCode:c instanceof W&&c.subError||void 0,success:!1}),c}return[2]})})},t.prototype.acquireTokenByCodeAsync=function(e){return S(this,void 0,void 0,function(){var r,n;return k(this,function(i){switch(i.label){case 0:return this.logger.trace("acquireTokenByCodeAsync called",e.correlationId),r=this.createSilentAuthCodeClient(e.correlationId),[4,r.acquireToken(e)];case 1:return n=i.sent(),[2,n]}})})},t.prototype.acquireTokenFromCache=function(e,r,n){return S(this,void 0,void 0,function(){return k(this,function(i){switch(n.cacheLookupPolicy){case fr.Default:case fr.AccessToken:case fr.AccessTokenAndRefreshToken:return[2,e.acquireToken(r)];default:throw j.createRefreshRequiredError()}return[2]})})},t.prototype.acquireTokenByRefreshToken=function(e,r){return S(this,void 0,void 0,function(){var n;return k(this,function(i){switch(r.cacheLookupPolicy){case fr.Default:case fr.AccessTokenAndRefreshToken:case fr.RefreshToken:case fr.RefreshTokenAndNetwork:return n=this.createSilentRefreshClient(e.correlationId),[2,n.acquireToken(e)];default:throw j.createRefreshRequiredError()}return[2]})})},t.prototype.acquireTokenBySilentIframe=function(e){return S(this,void 0,void 0,function(){var r;return k(this,function(n){return r=this.createSilentIframeClient(e.correlationId),[2,r.acquireToken(e)]})})},t.prototype.logout=function(e){return S(this,void 0,void 0,function(){var r;return k(this,function(n){return r=this.getRequestCorrelationId(e),this.logger.warning("logout API is deprecated and will be removed in msal-browser v3.0.0. Use logoutRedirect instead.",r),[2,this.logoutRedirect(K({correlationId:r},e))]})})},t.prototype.logoutRedirect=function(e){return S(this,void 0,void 0,function(){var r,n;return k(this,function(i){return r=this.getRequestCorrelationId(e),this.preflightBrowserEnvironmentCheck(G.Redirect),n=this.createRedirectClient(r),[2,n.logout(e)]})})},t.prototype.logoutPopup=function(e){try{var r=this.getRequestCorrelationId(e);this.preflightBrowserEnvironmentCheck(G.Popup);var n=this.createPopupClient(r);return n.logout(e)}catch(i){return Promise.reject(i)}},t.prototype.getAllAccounts=function(){return this.logger.verbose("getAllAccounts called"),this.isBrowserEnvironment?this.browserStorage.getAllAccounts():[]},t.prototype.getAccountByUsername=function(e){var r=this.getAllAccounts();return!V.isEmpty(e)&&r&&r.length?(this.logger.verbose("Account matching username found, returning"),this.logger.verbosePii("Returning signed-in accounts matching username: "+e),r.filter(function(n){return n.username.toLowerCase()===e.toLowerCase()})[0]||null):(this.logger.verbose("getAccountByUsername: No matching account found, returning null"),null)},t.prototype.getAccountByHomeId=function(e){var r=this.getAllAccounts();return!V.isEmpty(e)&&r&&r.length?(this.logger.verbose("Account matching homeAccountId found, returning"),this.logger.verbosePii("Returning signed-in accounts matching homeAccountId: "+e),r.filter(function(n){return n.homeAccountId===e})[0]||null):(this.logger.verbose("getAccountByHomeId: No matching account found, returning null"),null)},t.prototype.getAccountByLocalId=function(e){var r=this.getAllAccounts();return!V.isEmpty(e)&&r&&r.length?(this.logger.verbose("Account matching localAccountId found, returning"),this.logger.verbosePii("Returning signed-in accounts matching localAccountId: "+e),r.filter(function(n){return n.localAccountId===e})[0]||null):(this.logger.verbose("getAccountByLocalId: No matching account found, returning null"),null)},t.prototype.setActiveAccount=function(e){this.browserStorage.setActiveAccount(e)},t.prototype.getActiveAccount=function(){return this.browserStorage.getActiveAccount()},t.prototype.preflightBrowserEnvironmentCheck=function(e,r){if(r===void 0&&(r=!0),this.logger.verbose("preflightBrowserEnvironmentCheck started"),Je.blockNonBrowserEnvironment(this.isBrowserEnvironment),Je.blockRedirectInIframe(e,this.config.system.allowRedirectInIframe),Je.blockReloadInHiddenIframes(),Je.blockAcquireTokenInPopups(),Je.blockNativeBrokerCalledBeforeInitialized(this.config.system.allowNativeBroker,this.initialized),e===G.Redirect&&this.config.cache.cacheLocation===Ut.MemoryStorage&&!this.config.cache.storeAuthStateInCookie)throw Yd.createInMemoryRedirectUnavailableError();(e===G.Redirect||e===G.Popup)&&this.preflightInteractiveRequest(r)},t.prototype.preflightInteractiveRequest=function(e){this.logger.verbose("preflightInteractiveRequest called, validating app environment"),Je.blockReloadInHiddenIframes(),e&&this.browserStorage.setInteractionInProgress(!0)},t.prototype.acquireTokenNative=function(e,r,n){return S(this,void 0,void 0,function(){var i;return k(this,function(o){if(this.logger.trace("acquireTokenNative called"),!this.nativeExtensionProvider)throw D.createNativeConnectionNotEstablishedError();return i=new xa(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,r,this.performanceClient,this.nativeExtensionProvider,n||this.getNativeAccountId(e),this.nativeInternalStorage,e.correlationId),[2,i.acquireToken(e)]})})},t.prototype.canUseNative=function(e,r){if(this.logger.trace("canUseNative called"),!vo.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 jt.NONE:case jt.CONSENT:case jt.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!r&&!this.getNativeAccountId(e)?(this.logger.trace("canUseNative: nativeAccountId is not available, returning false"),!1):!0},t.prototype.getNativeAccountId=function(e){var r=e.account||this.browserStorage.getAccountInfoByHints(e.loginHint,e.sid)||this.getActiveAccount();return r&&r.nativeAccountId||""},t.prototype.createPopupClient=function(e){return new H_(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,this.performanceClient,this.nativeInternalStorage,this.nativeExtensionProvider,e)},t.prototype.createRedirectClient=function(e){return new R_(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,this.performanceClient,this.nativeInternalStorage,this.nativeExtensionProvider,e)},t.prototype.createSilentIframeClient=function(e){return new F_(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,He.ssoSilent,this.performanceClient,this.nativeInternalStorage,this.nativeExtensionProvider,e)},t.prototype.createSilentCacheClient=function(e){return new s3(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,this.performanceClient,this.nativeExtensionProvider,e)},t.prototype.createSilentRefreshClient=function(e){return new U_(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,this.performanceClient,this.nativeExtensionProvider,e)},t.prototype.createSilentAuthCodeClient=function(e){return new nb(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,He.acquireTokenByCode,this.performanceClient,this.nativeExtensionProvider,e)},t.prototype.addEventCallback=function(e){return this.eventHandler.addEventCallback(e)},t.prototype.removeEventCallback=function(e){this.eventHandler.removeEventCallback(e)},t.prototype.addPerformanceCallback=function(e){return this.performanceClient.addPerformanceCallback(e)},t.prototype.removePerformanceCallback=function(e){return this.performanceClient.removePerformanceCallback(e)},t.prototype.enableAccountStorageEvents=function(){this.eventHandler.enableAccountStorageEvents()},t.prototype.disableAccountStorageEvents=function(){this.eventHandler.disableAccountStorageEvents()},t.prototype.getTokenCache=function(){return this.tokenCache},t.prototype.getLogger=function(){return this.logger},t.prototype.setLogger=function(e){this.logger=e},t.prototype.initializeWrapperLibrary=function(e,r){this.browserStorage.setWrapperMetadata(e,r)},t.prototype.setNavigationClient=function(e){this.navigationClient=e},t.prototype.getConfiguration=function(){return this.config},t.prototype.getRequestCorrelationId=function(e){return e!=null&&e.correlationId?e.correlationId:this.isBrowserEnvironment?this.browserCrypto.createNewGuid():_.EMPTY_STRING},t}();var sb=function(t){It(e,t);function e(r){var n=t.call(this,r)||this;return n.activeSilentTokenRequests=new Map,n}return e.prototype.loginRedirect=function(r){return S(this,void 0,void 0,function(){var n;return k(this,function(i){return n=this.getRequestCorrelationId(r),this.logger.verbose("loginRedirect called",n),[2,this.acquireTokenRedirect(K({correlationId:n},r||hm))]})})},e.prototype.loginPopup=function(r){var n=this.getRequestCorrelationId(r);return this.logger.verbose("loginPopup called",n),this.acquireTokenPopup(K({correlationId:n},r||hm))},e.prototype.acquireTokenSilent=function(r){return S(this,void 0,void 0,function(){var n,i,o,a,s,c,l,d=this;return k(this,function(h){if(n=this.getRequestCorrelationId(r),i=this.performanceClient.startMeasurement(pt.AcquireTokenSilent,n),i.addStaticFields({cacheLookupPolicy:r.cacheLookupPolicy}),this.preflightBrowserEnvironmentCheck(G.Silent),this.logger.verbose("acquireTokenSilent called",n),o=r.account||this.getActiveAccount(),!o)throw D.createNoAccountError();return a={clientId:this.config.auth.clientId,authority:r.authority||_.EMPTY_STRING,scopes:r.scopes,homeAccountIdentifier:o.homeAccountId,claims:r.claims,authenticationScheme:r.authenticationScheme,resourceRequestMethod:r.resourceRequestMethod,resourceRequestUri:r.resourceRequestUri,shrClaims:r.shrClaims,sshKid:r.sshKid},s=JSON.stringify(a),c=this.activeSilentTokenRequests.get(s),typeof c>"u"?(this.logger.verbose("acquireTokenSilent called for the first time, storing active request",n),l=this.acquireTokenSilentAsync(K(K({},r),{correlationId:n}),o).then(function(u){return d.activeSilentTokenRequests.delete(s),i.addStaticFields({accessTokenSize:u.accessToken.length,idTokenSize:u.idToken.length}),i.endMeasurement({success:!0,fromCache:u.fromCache,isNativeBroker:u.fromNativeBroker,requestId:u.requestId}),i.flushMeasurement(),u}).catch(function(u){throw d.activeSilentTokenRequests.delete(s),i.endMeasurement({errorCode:u.errorCode,subErrorCode:u.subError,success:!1}),i.flushMeasurement(),u}),this.activeSilentTokenRequests.set(s,l),[2,l]):(this.logger.verbose("acquireTokenSilent has been called previously, returning the result from the first call",n),i.endMeasurement({success:!0}),i.discardMeasurement(),[2,c])})})},e.prototype.acquireTokenSilentAsync=function(r,n){return S(this,void 0,void 0,function(){var i,o,a,s,c,l,d=this;return k(this,function(h){switch(h.label){case 0:return this.eventHandler.emitEvent(J.ACQUIRE_TOKEN_START,G.Silent,r),i=this.performanceClient.startMeasurement(pt.AcquireTokenSilentAsync,r.correlationId),vo.isNativeAvailable(this.config,this.logger,this.nativeExtensionProvider,r.authenticationScheme)&&n.nativeAccountId?(this.logger.verbose("acquireTokenSilent - attempting to acquire token from native platform"),a=K(K({},r),{account:n}),o=this.acquireTokenNative(a,He.acquireTokenSilent_silentFlow).catch(function(u){return S(d,void 0,void 0,function(){var f;return k(this,function(v){if(u instanceof xn&&u.isFatal())return this.logger.verbose("acquireTokenSilent - native platform unavailable, falling back to web flow"),this.nativeExtensionProvider=void 0,f=this.createSilentIframeClient(r.correlationId),[2,f.acquireToken(r)];throw u})})}),[3,3]):[3,1];case 1:return this.logger.verbose("acquireTokenSilent - attempting to acquire token from web flow"),s=this.createSilentCacheClient(r.correlationId),[4,s.initializeSilentRequest(r,n)];case 2:c=h.sent(),l=K(K({},r),{cacheLookupPolicy:r.cacheLookupPolicy||fr.Default}),o=this.acquireTokenFromCache(s,c,l).catch(function(u){if(l.cacheLookupPolicy===fr.AccessToken)throw u;return Je.blockReloadInHiddenIframes(),d.eventHandler.emitEvent(J.ACQUIRE_TOKEN_NETWORK_START,G.Silent,c),d.acquireTokenByRefreshToken(c,l).catch(function(f){var v=f instanceof So,g=f instanceof an,x=f.errorCode===rn.INVALID_GRANT_ERROR;if((!v||!x||g||l.cacheLookupPolicy===fr.AccessTokenAndRefreshToken||l.cacheLookupPolicy===fr.RefreshToken)&&l.cacheLookupPolicy!==fr.Skip)throw f;return d.logger.verbose("Refresh token expired/invalid or CacheLookupPolicy is set to Skip, attempting acquire token by iframe.",r.correlationId),d.acquireTokenBySilentIframe(c)})}),h.label=3;case 3:return[2,o.then(function(u){return d.eventHandler.emitEvent(J.ACQUIRE_TOKEN_SUCCESS,G.Silent,u),i.endMeasurement({success:!0,fromCache:u.fromCache,isNativeBroker:u.fromNativeBroker,requestId:u.requestId}),u}).catch(function(u){throw d.eventHandler.emitEvent(J.ACQUIRE_TOKEN_FAILURE,G.Silent,null,u),i.endMeasurement({errorCode:u.errorCode,subErrorCode:u.subError,success:!1}),u})]}})})},e}(ab);const gm="redirect";var ym=globalThis&&globalThis.__awaiter||function(t,e,r,n){function i(o){return o instanceof r?o:new r(function(a){a(o)})}return new(r||(r=Promise))(function(o,a){function s(d){try{l(n.next(d))}catch(h){a(h)}}function c(d){try{l(n.throw(d))}catch(h){a(h)}}function l(d){d.done?o(d.value):i(d.value).then(s,c)}l((n=n.apply(t,e||[])).next())})};class cb extends sb{get account(){return this.getAllAccounts().find(n=>{var i;return((i=n.idTokenClaims)===null||i===void 0?void 0:i.aud)===this.clientId})}get hasValidClaims(){var e;const r=(e=this.account)===null||e===void 0?void 0:e.idTokenClaims;if(r){const n=Math.ceil(Date.now()/1e3);return r.exp>n}return!1}get clientId(){var e;return(e=this.config.auth)===null||e===void 0?void 0:e.clientId}get requestOrigin(){return this.browserStorage.getTemporaryCache("request.origin",!0)}constructor(e,r){super(r),this.tenantId=e}login(e,r=gm,n=!0){var i;return ym(this,void 0,void 0,function*(){const o=(e==null?void 0:e.loginHint)||((i=this.account)===null||i===void 0?void 0:i.username),a=(e==null?void 0:e.scopes)||[],s=Object.assign(Object.assign({},e),{loginHint:o,scopes:a});if(o&&n){this.logger.verbose("Attempting to login in silently");try{return yield this.ssoSilent(s)}catch{this.logger.verbose("Silent login attempt failed")}}switch(this.logger.verbose(`Attempting to login in by [${r}]`),r){case"popup":return this.loginPopup(s);case"redirect":return this.loginRedirect(s)}})}acquireToken(e={scopes:[]},r=gm,n=!0){return ym(this,void 0,void 0,function*(){const i=yield this.account;if(n&&i){this.logger.verbose("Attempting to acquire token in silently");try{return yield this.acquireTokenSilent(Object.assign({account:i},e))}catch{this.logger.info("Expected to navigate away from the current page but timeout occurred.")}}switch(this.logger.verbose(`Attempting to acquire token by [${r}]`),r){case"popup":return this.acquireTokenPopup(e);case"redirect":return this.acquireTokenRedirect(e)}})}}const lb=(t,e=window.location.origin)=>{t=t.match(/^http[s]?/)?t:e+t;const{origin:r,pathname:n}=new URL(t);return r+n.replace(/([^:]\/)\/+/g,"$1")},db=(t,e,r,n,i)=>{const o=Object.assign({clientId:e,redirectUri:lb(r||""),navigateToLoginRequestUrl:!1,authority:`https://login.microsoftonline.com/${t}`},n==null?void 0:n.auth),a=Object.assign({cacheLocation:"localStorage"},n==null?void 0:n.cache),s=n==null?void 0:n.system;return new(i||cb)(t,{auth:o,cache:a,system:s})};class u3 extends t0{constructor(e){super({logLevel:e,loggerCallback:(...r)=>this.loggerCallback(...r)}),this.getLogType=r=>{switch(r){case tt.Error:return"error";case tt.Warning:return"warn";case tt.Info:return"info";case tt.Verbose:default:return"debug"}}}loggerCallback(e,r,n){console[this.getLogType(e)]("%c FUSION::MSAL %c %s","border: 1px solid;","border: none;",r)}}var xh=globalThis&&globalThis.__awaiter||function(t,e,r,n){function i(o){return o instanceof r?o:new r(function(a){a(o)})}return new(r||(r=Promise))(function(o,a){function s(d){try{l(n.next(d))}catch(h){a(h)}}function c(d){try{l(n.throw(d))}catch(h){a(h)}}function l(d){d.done?o(d.value):i(d.value).then(s,c)}l((n=n.apply(t,e||[])).next())})};const hb="default";class ub{get defaultClient(){return this.getClient(hb)}get defaultAccount(){return this.defaultClient.account}get defaultConfig(){return this._config.defaultConfig}constructor(e){this._config=e,this._clients={}}getClient(e){return this._clients[e]||(this._clients[e]=this.createClient(e)),this._clients[e]}createClient(e){const r=e?this._config.getClientConfig(e):this._config.defaultConfig;if(!r)throw Error("Could not find any config");const n=db(r.tenantId,r.clientId,r.redirectUri,r.config);return n.setLogger(new u3(0)),n}handleRedirect(){return xh(this,void 0,void 0,function*(){const{redirectUri:e}=this.defaultConfig||{};if(window.location.pathname===e){const r=this.defaultClient,n=r.getLogger(),{requestOrigin:i}=r;yield r.handleRedirectPromise(),i===e?(n.warning(`detected callback loop from url ${e}, redirecting to root`),window.location.replace("/")):window.location.replace(i||"/")}return null})}acquireToken(e){return this.defaultClient.acquireToken(e)}acquireAccessToken(e){return xh(this,void 0,void 0,function*(){const r=yield this.acquireToken(e);return r?r.accessToken:void 0})}login(){return xh(this,void 0,void 0,function*(){yield this.defaultClient.login()})}}var fb=globalThis&&globalThis.__awaiter||function(t,e,r,n){function i(o){return o instanceof r?o:new r(function(a){a(o)})}return new(r||(r=Promise))(function(o,a){function s(d){try{l(n.next(d))}catch(h){a(h)}}function c(d){try{l(n.throw(d))}catch(h){a(h)}}function l(d){d.done?o(d.value):i(d.value).then(s,c)}l((n=n.apply(t,e||[])).next())})};const f3={name:"auth",configure:t=>{var e;const r=new t_;return!((e=t==null?void 0:t.auth)===null||e===void 0)&&e.defaultConfig&&r.configureDefault(t.auth.defaultConfig),r},initialize:({config:t})=>fb(void 0,void 0,void 0,function*(){const e=new ub(t);return t.requiresAuth&&(yield e.handleRedirect(),e.defaultAccount||(yield e.login())),e})},pb=(t,e)=>({module:f3,configure:r=>{r.configureDefault(t),(e==null?void 0:e.requiresAuth)!==void 0&&(r.requiresAuth=e==null?void 0:e.requiresAuth);const{clients:n}=e??{};n&&Object.entries(n).forEach(([i,o])=>r.configureClient(i,o))}});var p3=globalThis&&globalThis.__awaiter||function(t,e,r,n){function i(o){return o instanceof r?o:new r(function(a){a(o)})}return new(r||(r=Promise))(function(o,a){function s(d){try{l(n.next(d))}catch(h){a(h)}}function c(d){try{l(n.throw(d))}catch(h){a(h)}}function l(d){d.done?o(d.value):i(d.value).then(s,c)}l((n=n.apply(t,e||[])).next())})};const mb=t=>{var e;return{id:t.id,isChildType:t.isChildType,parentTypeIds:(e=t.parentTypeIds)!==null&&e!==void 0?e:[]}},m3=t=>{var e,r,n,i;return{id:t.id,externalId:(e=t.externalId)!==null&&e!==void 0?e:void 0,isActive:t.isActive,isDeleted:t.isDeleted,created:new Date(t.created),source:(r=t.source)!==null&&r!==void 0?r:void 0,title:(n=t.title)!==null&&n!==void 0?n:void 0,type:mb(t.type),value:(i=t.value)!==null&&i!==void 0?i:{}}},vb=t=>p3(void 0,void 0,void 0,function*(){const e=yield t.json();return m3(e)}),gb=t=>p3(void 0,void 0,void 0,function*(){return(yield t.json()).map(m3)});var yb=globalThis&&globalThis.__classPrivateFieldSet||function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},_b=globalThis&&globalThis.__classPrivateFieldGet||function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},ql;class bb{constructor(e,r={}){this.config=r,ql.set(this,void 0),yb(this,ql,e,"f")}requireInstance(e){return _b(this,ql,"f").requireInstance(e)}setContextType(e){this.config.contextType=e}setContextFilter(e){this.config.contextFilter=e}setContextParameterFn(e){this.config.contextParameterFn=e}setContextClient(e,r=1*60*1e3){this.config.client={get:typeof e.get=="function"?{key:({id:n})=>n,client:{fn:e.get},expire:r}:e.get,query:typeof e.query=="function"?{key:n=>JSON.stringify(n),client:{fn:e.query},expire:r}:e.query}}}ql=new WeakMap;var vl=globalThis&&globalThis.__awaiter||function(t,e,r,n){function i(o){return o instanceof r?o:new r(function(a){a(o)})}return new(r||(r=Promise))(function(o,a){function s(d){try{l(n.next(d))}catch(h){a(h)}}function c(d){try{l(n.throw(d))}catch(h){a(h)}}function l(d){d.done?o(d.value):i(d.value).then(s,c)}l((n=n.apply(t,e||[])).next())})},_m=globalThis&&globalThis.__classPrivateFieldGet||function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},Gl;class wb{constructor(){this.defaultExpireTime=1*60*1e3,Gl.set(this,[])}addConfigBuilder(e){_m(this,Gl,"f").push(e)}_getServiceProvider(e){var r;return vl(this,void 0,void 0,function*(){if(e.hasModule("services"))return e.requireInstance("services");{const n=(r=e.ref)===null||r===void 0?void 0:r.services;if(n)return n;throw Error("no service services provider configures [ServicesModule]")}})}createConfig(e){var r;return vl(this,void 0,void 0,function*(){const n=yield _m(this,Gl,"f").reduce((i,o)=>vl(this,void 0,void 0,function*(){const a=new bb(e,yield i);return yield Promise.resolve(o(a)),Object.assign(i,a.config)}),Promise.resolve({}));return(r=n.client)!==null&&r!==void 0||(n.client=yield(()=>vl(this,void 0,void 0,function*(){const o=yield(yield this._getServiceProvider(e)).createContextClient("json$");return{get:{client:{fn:a=>o.get("v1",a,{selector:vb})},key:({id:a})=>a,expire:this.defaultExpireTime},query:{client:{fn:a=>o.query("v1",{query:a},{selector:gb})},key:a=>JSON.stringify(a),expire:this.defaultExpireTime}}}))()),n})}}Gl=new WeakMap;var bm;(function(t){t.IDLE="idle",t.ACTIVE="active",t.FAILED="failed",t.CANCELED="canceled"})(bm||(bm={}));const xb=t=>e=>e.pipe(Bn(t)),Eb=t=>t.pipe(Ge(e=>e.value));var gl,Cb=new Uint8Array(16);function zb(){if(!gl&&(gl=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||typeof msCrypto<"u"&&typeof msCrypto.getRandomValues=="function"&&msCrypto.getRandomValues.bind(msCrypto),!gl))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return gl(Cb)}const Sb=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;function v3(t){return typeof t=="string"&&Sb.test(t)}var xt=[];for(var Eh=0;Eh<256;++Eh)xt.push((Eh+256).toString(16).substr(1));function g3(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,r=(xt[t[e+0]]+xt[t[e+1]]+xt[t[e+2]]+xt[t[e+3]]+"-"+xt[t[e+4]]+xt[t[e+5]]+"-"+xt[t[e+6]]+xt[t[e+7]]+"-"+xt[t[e+8]]+xt[t[e+9]]+"-"+xt[t[e+10]]+xt[t[e+11]]+xt[t[e+12]]+xt[t[e+13]]+xt[t[e+14]]+xt[t[e+15]]).toLowerCase();if(!v3(r))throw TypeError("Stringified UUID is invalid");return r}function kb(t){if(!v3(t))throw TypeError("Invalid UUID");var e,r=new Uint8Array(16);return r[0]=(e=parseInt(t.slice(0,8),16))>>>24,r[1]=e>>>16&255,r[2]=e>>>8&255,r[3]=e&255,r[4]=(e=parseInt(t.slice(9,13),16))>>>8,r[5]=e&255,r[6]=(e=parseInt(t.slice(14,18),16))>>>8,r[7]=e&255,r[8]=(e=parseInt(t.slice(19,23),16))>>>8,r[9]=e&255,r[10]=(e=parseInt(t.slice(24,36),16))/1099511627776&255,r[11]=e/4294967296&255,r[12]=e>>>24&255,r[13]=e>>>16&255,r[14]=e>>>8&255,r[15]=e&255,r}function Ab(t){t=unescape(encodeURIComponent(t));for(var e=[],r=0;r<t.length;++r)e.push(t.charCodeAt(r));return e}var Tb="6ba7b810-9dad-11d1-80b4-00c04fd430c8",Ib="6ba7b811-9dad-11d1-80b4-00c04fd430c8";function Mb(t,e,r){function n(i,o,a,s){if(typeof i=="string"&&(i=Ab(i)),typeof o=="string"&&(o=kb(o)),o.length!==16)throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");var c=new Uint8Array(16+i.length);if(c.set(o),c.set(i,o.length),c=r(c),c[6]=c[6]&15|e,c[8]=c[8]&63|128,a){s=s||0;for(var l=0;l<16;++l)a[s+l]=c[l];return a}return g3(c)}try{n.name=t}catch{}return n.DNS=Tb,n.URL=Ib,n}function y3(t,e,r){t=t||{};var n=t.random||(t.rng||zb)();if(n[6]=n[6]&15|64,n[8]=n[8]&63|128,e){r=r||0;for(var i=0;i<16;++i)e[r+i]=n[i];return e}return g3(n)}function Pb(t,e,r,n){switch(t){case 0:return e&r^~e&n;case 1:return e^r^n;case 2:return e&r^e&n^r&n;case 3:return e^r^n}}function Ch(t,e){return t<<e|t>>>32-e}function Rb(t){var e=[1518500249,1859775393,2400959708,3395469782],r=[1732584193,4023233417,2562383102,271733878,3285377520];if(typeof t=="string"){var n=unescape(encodeURIComponent(t));t=[];for(var i=0;i<n.length;++i)t.push(n.charCodeAt(i))}else Array.isArray(t)||(t=Array.prototype.slice.call(t));t.push(128);for(var o=t.length/4+2,a=Math.ceil(o/16),s=new Array(a),c=0;c<a;++c){for(var l=new Uint32Array(16),d=0;d<16;++d)l[d]=t[c*64+d*4]<<24|t[c*64+d*4+1]<<16|t[c*64+d*4+2]<<8|t[c*64+d*4+3];s[c]=l}s[a-1][14]=(t.length-1)*8/Math.pow(2,32),s[a-1][14]=Math.floor(s[a-1][14]),s[a-1][15]=(t.length-1)*8&4294967295;for(var h=0;h<a;++h){for(var u=new Uint32Array(80),f=0;f<16;++f)u[f]=s[h][f];for(var v=16;v<80;++v)u[v]=Ch(u[v-3]^u[v-8]^u[v-14]^u[v-16],1);for(var g=r[0],x=r[1],m=r[2],p=r[3],y=r[4],w=0;w<80;++w){var A=Math.floor(w/20),O=Ch(g,5)+Pb(A,x,m,p)+y+e[A]+u[w]>>>0;y=p,p=m,m=Ch(x,30)>>>0,x=g,g=O}r[0]=r[0]+g>>>0,r[1]=r[1]+x>>>0,r[2]=r[2]+m>>>0,r[3]=r[3]+p>>>0,r[4]=r[4]+y>>>0}return[r[0]>>24&255,r[0]>>16&255,r[0]>>8&255,r[0]&255,r[1]>>24&255,r[1]>>16&255,r[1]>>8&255,r[1]&255,r[2]>>24&255,r[2]>>16&255,r[2]>>8&255,r[2]&255,r[3]>>24&255,r[3]>>16&255,r[3]>>8&255,r[3]&255,r[4]>>24&255,r[4]>>16&255,r[4]>>8&255,r[4]&255]}var Hb=Mb("v5",80,Rb);const Lb=Hb;class m2 extends Error{constructor(e,r){super(r.message,{cause:r.cause}),this.type=e,this.request=r.request}}const _3=(...t)=>Kt(e=>t.includes(e.type));var Vt=globalThis&&globalThis.__classPrivateFieldGet||function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},Ob=globalThis&&globalThis.__classPrivateFieldSet||function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},gn,Qr;class i0 extends Pe{get action$(){return Vt(this,gn,"f").asObservable()}get value(){return Vt(this,Qr,"f").value}get closed(){return Vt(this,Qr,"f").closed||Vt(this,gn,"f").closed}constructor(e,r){super(i=>Vt(this,Qr,"f").subscribe(i)),gn.set(this,new Wn),Qr.set(this,void 0);const n="getInitialState"in e?e.getInitialState():r;Ob(this,Qr,new C1(n),"f"),Vt(this,gn,"f").pipe(Kg(e,n),Gg()).subscribe(Vt(this,Qr,"f")),this.reset=()=>Vt(this,Qr,"f").next(n)}next(e){Vt(this,gn,"f").next(e)}addEffect(e,r){const n=typeof e=="string"?this.action$.pipe(_3(e)):this.action$,i=r||e;return n.pipe(zo(o=>nr(new Promise((a,s)=>{try{a(i(o,this.value))}catch(c){s(c)}})).pipe(Kr(a=>(console.warn("unhandled effect",a),Li)))),Kt(o=>!!o),Hd(Rd)).subscribe(Vt(this,gn,"f"))}addEpic(e){return this.addFlow(e)}addFlow(e){const r=e(this.action$,this);if(!r)throw new TypeError(`addEpic: one of the provided effects "${e.name||"<anonymous>"}" does not return a stream. Double check you're not missing a return statement!`);return r.pipe(Kr(n=>(console.trace("unhandled exception, epic closed!",n),Li)),Hd(Rd)).subscribe(Vt(this,gn,"f"))}unsubscribe(){Vt(this,gn,"f").unsubscribe(),Vt(this,Qr,"f").unsubscribe()}complete(){Vt(this,gn,"f").complete(),Vt(this,Qr,"f").complete()}asObservable(){return Vt(this,Qr,"f").asObservable()}}gn=new WeakMap,Qr=new WeakMap;function St(t,e){function r(...n){if(e){const i=e(...n);if(!i)throw new Error("prepareAction did not return an object");return Object.assign(Object.assign({type:t,payload:i.payload},"meta"in i&&{meta:i.meta}),"error"in i&&{error:i.error})}return{type:t,payload:n[0]}}return r.toString=()=>`${t}`,r.type=t,r.match=n=>n.type===t,r}const Kl="::",o0=t=>new RegExp(`${Kl}\\${t}$`),wm=t=>t.type.replace(o0("\\w+$"),"");function yl(t,e,r,n){const i=St([t,"request"].join(Kl),e);return r&&Object.assign(i,{success:St([t,"success"].join(Kl),r)}),n&&Object.assign(i,{failure:St([t,"failure"].join(Kl),n)}),i}const Db=t=>!!t.type.match(/::request$/),Nb=t=>!!t.type.match(o0("success")),Vb=t=>!!t.type.match(o0("failure")),Fb=t=>Nb(t)||Vb(t);function zr(t){for(var e=arguments.length,r=Array(e>1?e-1:0),n=1;n<e;n++)r[n-1]=arguments[n];throw Error("[Immer] minified error nr: "+t+(r.length?" "+r.map(function(i){return"'"+i+"'"}).join(","):"")+". Find the full error at: https://bit.ly/3cXEKWf")}function Di(t){return!!t&&!!t[we]}function hn(t){var e;return!!t&&(function(r){if(!r||typeof r!="object")return!1;var n=Object.getPrototypeOf(r);if(n===null)return!0;var i=Object.hasOwnProperty.call(n,"constructor")&&n.constructor;return i===Object||typeof i=="function"&&Function.toString.call(i)===Qb}(t)||Array.isArray(t)||!!t[Tm]||!!(!((e=t.constructor)===null||e===void 0)&&e[Tm])||a0(t)||s0(t))}function xm(t){return Di(t)||zr(23,t),t[we].t}function Ha(t,e,r){r===void 0&&(r=!1),ja(t)===0?(r?Object.keys:u0)(t).forEach(function(n){r&&typeof n=="symbol"||e(n,t[n],t)}):t.forEach(function(n,i){return e(i,n,t)})}function ja(t){var e=t[we];return e?e.i>3?e.i-4:e.i:Array.isArray(t)?1:a0(t)?2:s0(t)?3:0}function v2(t,e){return ja(t)===2?t.has(e):Object.prototype.hasOwnProperty.call(t,e)}function Ub(t,e){return ja(t)===2?t.get(e):t[e]}function b3(t,e,r){var n=ja(t);n===2?t.set(e,r):n===3?(t.delete(e),t.add(r)):t[e]=r}function $b(t,e){return t===e?t!==0||1/t==1/e:t!=t&&e!=e}function a0(t){return Wb&&t instanceof Map}function s0(t){return Yb&&t instanceof Set}function gt(t){return t.o||t.t}function c0(t){if(Array.isArray(t))return Array.prototype.slice.call(t);var e=Xb(t);delete e[we];for(var r=u0(e),n=0;n<r.length;n++){var i=r[n],o=e[i];o.writable===!1&&(o.writable=!0,o.configurable=!0),(o.get||o.set)&&(e[i]={configurable:!0,writable:!0,enumerable:o.enumerable,value:t[i]})}return Object.create(Object.getPrototypeOf(t),e)}function l0(t,e){return e===void 0&&(e=!1),d0(t)||Di(t)||!hn(t)||(ja(t)>1&&(t.set=t.add=t.clear=t.delete=jb),Object.freeze(t),e&&Ha(t,function(r,n){return l0(n,!0)},!0)),t}function jb(){zr(2)}function d0(t){return t==null||typeof t!="object"||Object.isFrozen(t)}function kn(t){var e=y2[t];return e||zr(18,t),e}function Bb(t,e){y2[t]||(y2[t]=e)}function Xd(){return mc}function zh(t,e){e&&(kn("Patches"),t.u=[],t.s=[],t.v=e)}function Jd(t){g2(t),t.p.forEach(qb),t.p=null}function g2(t){t===mc&&(mc=t.l)}function Em(t){return mc={p:[],l:mc,h:t,m:!0,_:0}}function qb(t){var e=t[we];e.i===0||e.i===1?e.j():e.O=!0}function Sh(t,e){e._=e.p.length;var r=e.p[0],n=t!==void 0&&t!==r;return e.h.g||kn("ES5").S(e,t,n),n?(r[we].P&&(Jd(e),zr(4)),hn(t)&&(t=Zd(e,t),e.l||e1(e,t)),e.u&&kn("Patches").M(r[we].t,t,e.u,e.s)):t=Zd(e,r,[]),Jd(e),e.u&&e.v(e.u,e.s),t!==w3?t:void 0}function Zd(t,e,r){if(d0(e))return e;var n=e[we];if(!n)return Ha(e,function(o,a){return Cm(t,n,e,o,a,r)},!0),e;if(n.A!==t)return e;if(!n.P)return e1(t,n.t,!0),n.t;if(!n.I){n.I=!0,n.A._--;var i=n.i===4||n.i===5?n.o=c0(n.k):n.o;Ha(n.i===3?new Set(i):i,function(o,a){return Cm(t,n,i,o,a,r)}),e1(t,i,!1),r&&t.u&&kn("Patches").N(n,r,t.u,t.s)}return n.o}function Cm(t,e,r,n,i,o){if(Di(i)){var a=Zd(t,i,o&&e&&e.i!==3&&!v2(e.R,n)?o.concat(n):void 0);if(b3(r,n,a),!Di(a))return;t.m=!1}if(hn(i)&&!d0(i)){if(!t.h.D&&t._<1)return;Zd(t,i),e&&e.A.l||e1(t,i)}}function e1(t,e,r){r===void 0&&(r=!1),t.h.D&&t.m&&l0(e,r)}function kh(t,e){var r=t[we];return(r?gt(r):t)[e]}function zm(t,e){if(e in t)for(var r=Object.getPrototypeOf(t);r;){var n=Object.getOwnPropertyDescriptor(r,e);if(n)return n;r=Object.getPrototypeOf(r)}}function Un(t){t.P||(t.P=!0,t.l&&Un(t.l))}function Ah(t){t.o||(t.o=c0(t.t))}function pc(t,e,r){var n=a0(e)?kn("MapSet").F(e,r):s0(e)?kn("MapSet").T(e,r):t.g?function(i,o){var a=Array.isArray(i),s={i:a?1:0,A:o?o.A:Xd(),P:!1,I:!1,R:{},l:o,t:i,k:null,o:null,j:null,C:!1},c=s,l=_2;a&&(c=[s],l=gs);var d=Proxy.revocable(c,l),h=d.revoke,u=d.proxy;return s.k=u,s.j=h,u}(e,r):kn("ES5").J(e,r);return(r?r.A:Xd()).p.push(n),n}function Gb(t){return Di(t)||zr(22,t),function e(r){if(!hn(r))return r;var n,i=r[we],o=ja(r);if(i){if(!i.P&&(i.i<4||!kn("ES5").K(i)))return i.t;i.I=!0,n=Sm(r,o),i.I=!1}else n=Sm(r,o);return Ha(n,function(a,s){i&&Ub(i.t,a)===s||b3(n,a,e(s))}),o===3?new Set(n):n}(t)}function Sm(t,e){switch(e){case 2:return new Map(t);case 3:return Array.from(t)}return c0(t)}function Kb(){function t(s,c){function l(){this.constructor=s}i(s,c),s.prototype=(l.prototype=c.prototype,new l)}function e(s){s.o||(s.R=new Map,s.o=new Map(s.t))}function r(s){s.o||(s.o=new Set,s.t.forEach(function(c){if(hn(c)){var l=pc(s.A.h,c,s);s.p.set(c,l),s.o.add(l)}else s.o.add(c)}))}function n(s){s.O&&zr(3,JSON.stringify(gt(s)))}var i=function(s,c){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(l,d){l.__proto__=d}||function(l,d){for(var h in d)d.hasOwnProperty(h)&&(l[h]=d[h])})(s,c)},o=function(){function s(l,d){return this[we]={i:2,l:d,A:d?d.A:Xd(),P:!1,I:!1,o:void 0,R:void 0,t:l,k:this,C:!1,O:!1},this}t(s,Map);var c=s.prototype;return Object.defineProperty(c,"size",{get:function(){return gt(this[we]).size}}),c.has=function(l){return gt(this[we]).has(l)},c.set=function(l,d){var h=this[we];return n(h),gt(h).has(l)&>(h).get(l)===d||(e(h),Un(h),h.R.set(l,!0),h.o.set(l,d),h.R.set(l,!0)),this},c.delete=function(l){if(!this.has(l))return!1;var d=this[we];return n(d),e(d),Un(d),d.t.has(l)?d.R.set(l,!1):d.R.delete(l),d.o.delete(l),!0},c.clear=function(){var l=this[we];n(l),gt(l).size&&(e(l),Un(l),l.R=new Map,Ha(l.t,function(d){l.R.set(d,!1)}),l.o.clear())},c.forEach=function(l,d){var h=this;gt(this[we]).forEach(function(u,f){l.call(d,h.get(f),f,h)})},c.get=function(l){var d=this[we];n(d);var h=gt(d).get(l);if(d.I||!hn(h)||h!==d.t.get(l))return h;var u=pc(d.A.h,h,d);return e(d),d.o.set(l,u),u},c.keys=function(){return gt(this[we]).keys()},c.values=function(){var l,d=this,h=this.keys();return(l={})[_l]=function(){return d.values()},l.next=function(){var u=h.next();return u.done?u:{done:!1,value:d.get(u.value)}},l},c.entries=function(){var l,d=this,h=this.keys();return(l={})[_l]=function(){return d.entries()},l.next=function(){var u=h.next();if(u.done)return u;var f=d.get(u.value);return{done:!1,value:[u.value,f]}},l},c[_l]=function(){return this.entries()},s}(),a=function(){function s(l,d){return this[we]={i:3,l:d,A:d?d.A:Xd(),P:!1,I:!1,o:void 0,t:l,k:this,p:new Map,O:!1,C:!1},this}t(s,Set);var c=s.prototype;return Object.defineProperty(c,"size",{get:function(){return gt(this[we]).size}}),c.has=function(l){var d=this[we];return n(d),d.o?!!d.o.has(l)||!(!d.p.has(l)||!d.o.has(d.p.get(l))):d.t.has(l)},c.add=function(l){var d=this[we];return n(d),this.has(l)||(r(d),Un(d),d.o.add(l)),this},c.delete=function(l){if(!this.has(l))return!1;var d=this[we];return n(d),r(d),Un(d),d.o.delete(l)||!!d.p.has(l)&&d.o.delete(d.p.get(l))},c.clear=function(){var l=this[we];n(l),gt(l).size&&(r(l),Un(l),l.o.clear())},c.values=function(){var l=this[we];return n(l),r(l),l.o.values()},c.entries=function(){var l=this[we];return n(l),r(l),l.o.entries()},c.keys=function(){return this.values()},c[_l]=function(){return this.values()},c.forEach=function(l,d){for(var h=this.values(),u=h.next();!u.done;)l.call(d,u.value,u.value,this),u=h.next()},s}();Bb("MapSet",{F:function(s,c){return new o(s,c)},T:function(s,c){return new a(s,c)}})}var km,mc,h0=typeof Symbol<"u"&&typeof Symbol("x")=="symbol",Wb=typeof Map<"u",Yb=typeof Set<"u",Am=typeof Proxy<"u"&&Proxy.revocable!==void 0&&typeof Reflect<"u",w3=h0?Symbol.for("immer-nothing"):((km={})["immer-nothing"]=!0,km),Tm=h0?Symbol.for("immer-draftable"):"__$immer_draftable",we=h0?Symbol.for("immer-state"):"__$immer_state",_l=typeof Symbol<"u"&&Symbol.iterator||"@@iterator",Qb=""+Object.prototype.constructor,u0=typeof Reflect<"u"&&Reflect.ownKeys?Reflect.ownKeys:Object.getOwnPropertySymbols!==void 0?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:Object.getOwnPropertyNames,Xb=Object.getOwnPropertyDescriptors||function(t){var e={};return u0(t).forEach(function(r){e[r]=Object.getOwnPropertyDescriptor(t,r)}),e},y2={},_2={get:function(t,e){if(e===we)return t;var r=gt(t);if(!v2(r,e))return function(i,o,a){var s,c=zm(o,a);return c?"value"in c?c.value:(s=c.get)===null||s===void 0?void 0:s.call(i.k):void 0}(t,r,e);var n=r[e];return t.I||!hn(n)?n:n===kh(t.t,e)?(Ah(t),t.o[e]=pc(t.A.h,n,t)):n},has:function(t,e){return e in gt(t)},ownKeys:function(t){return Reflect.ownKeys(gt(t))},set:function(t,e,r){var n=zm(gt(t),e);if(n!=null&&n.set)return n.set.call(t.k,r),!0;if(!t.P){var i=kh(gt(t),e),o=i==null?void 0:i[we];if(o&&o.t===r)return t.o[e]=r,t.R[e]=!1,!0;if($b(r,i)&&(r!==void 0||v2(t.t,e)))return!0;Ah(t),Un(t)}return t.o[e]===r&&(r!==void 0||e in t.o)||Number.isNaN(r)&&Number.isNaN(t.o[e])||(t.o[e]=r,t.R[e]=!0),!0},deleteProperty:function(t,e){return kh(t.t,e)!==void 0||e in t.t?(t.R[e]=!1,Ah(t),Un(t)):delete t.R[e],t.o&&delete t.o[e],!0},getOwnPropertyDescriptor:function(t,e){var r=gt(t),n=Reflect.getOwnPropertyDescriptor(r,e);return n&&{writable:!0,configurable:t.i!==1||e!=="length",enumerable:n.enumerable,value:r[e]}},defineProperty:function(){zr(11)},getPrototypeOf:function(t){return Object.getPrototypeOf(t.t)},setPrototypeOf:function(){zr(12)}},gs={};Ha(_2,function(t,e){gs[t]=function(){return arguments[0]=arguments[0][0],e.apply(this,arguments)}}),gs.deleteProperty=function(t,e){return gs.set.call(this,t,e,void 0)},gs.set=function(t,e,r){return _2.set.call(this,t[0],e,r,t[0])};var Jb=function(){function t(r){var n=this;this.g=Am,this.D=!0,this.produce=function(i,o,a){if(typeof i=="function"&&typeof o!="function"){var s=o;o=i;var c=n;return function(g){var x=this;g===void 0&&(g=s);for(var m=arguments.length,p=Array(m>1?m-1:0),y=1;y<m;y++)p[y-1]=arguments[y];return c.produce(g,function(w){var A;return(A=o).call.apply(A,[x,w].concat(p))})}}var l;if(typeof o!="function"&&zr(6),a!==void 0&&typeof a!="function"&&zr(7),hn(i)){var d=Em(n),h=pc(n,i,void 0),u=!0;try{l=o(h),u=!1}finally{u?Jd(d):g2(d)}return typeof Promise<"u"&&l instanceof Promise?l.then(function(g){return zh(d,a),Sh(g,d)},function(g){throw Jd(d),g}):(zh(d,a),Sh(l,d))}if(!i||typeof i!="object"){if((l=o(i))===void 0&&(l=i),l===w3&&(l=void 0),n.D&&l0(l,!0),a){var f=[],v=[];kn("Patches").M(i,l,f,v),a(f,v)}return l}zr(21,i)},this.produceWithPatches=function(i,o){if(typeof i=="function")return function(l){for(var d=arguments.length,h=Array(d>1?d-1:0),u=1;u<d;u++)h[u-1]=arguments[u];return n.produceWithPatches(l,function(f){return i.apply(void 0,[f].concat(h))})};var a,s,c=n.produce(i,o,function(l,d){a=l,s=d});return typeof Promise<"u"&&c instanceof Promise?c.then(function(l){return[l,a,s]}):[c,a,s]},typeof(r==null?void 0:r.useProxies)=="boolean"&&this.setUseProxies(r.useProxies),typeof(r==null?void 0:r.autoFreeze)=="boolean"&&this.setAutoFreeze(r.autoFreeze)}var e=t.prototype;return e.createDraft=function(r){hn(r)||zr(8),Di(r)&&(r=Gb(r));var n=Em(this),i=pc(this,r,void 0);return i[we].C=!0,g2(n),i},e.finishDraft=function(r,n){var i=r&&r[we],o=i.A;return zh(o,n),Sh(void 0,o)},e.setAutoFreeze=function(r){this.D=r},e.setUseProxies=function(r){r&&!Am&&zr(20),this.g=r},e.applyPatches=function(r,n){var i;for(i=n.length-1;i>=0;i--){var o=n[i];if(o.path.length===0&&o.op==="replace"){r=o.value;break}}i>-1&&(n=n.slice(i+1));var a=kn("Patches").$;return Di(r)?a(r,n):this.produce(r,function(s){return a(s,n)})},t}(),Mr=new Jb,x3=Mr.produce;Mr.produceWithPatches.bind(Mr);Mr.setAutoFreeze.bind(Mr);Mr.setUseProxies.bind(Mr);Mr.applyPatches.bind(Mr);Mr.createDraft.bind(Mr);Mr.finishDraft.bind(Mr);function Im(t){return hn(t)?x3(t,()=>{}):t}function Zb(t){return typeof t=="function"}function f0(t,e){const[r,n,i]=ew(e);let o;if(Zb(t))o=()=>Im(t());else{const s=Im(t);o=()=>s}function a(s=o(),c){let l=[r[c.type],...n.filter(({matcher:d})=>d(c)).map(({reducer:d})=>d)];return l.filter(d=>!!d).length===0&&(l=[i]),l.reduce((d,h)=>{if(h)if(Di(d)){const f=h(d,c);return f===void 0?d:f}else{if(hn(d))return x3(d,u=>h(u,c));{const u=h(d,c);if(u===void 0){if(d===null)return d;throw Error("A case reducer on a non-draftable value must not return undefined")}return u}}return d},s)}return a.getInitialState=o,a}function ew(t){const e={},r=[];let n;const i={addCase(o,a){const s=typeof o=="string"?o:o.type;if(s in e)throw new Error("addCase cannot be called with two reducers for the same action type");return e[s]=a,i},addMatcher(o,a){return r.push({matcher:o,reducer:a}),i},addDefaultCase(o){return n=o,i}};return t(i),[e,r,n]}const tw=()=>({request:St("client/request",(e,r)=>{var n,i,o,a;return r??(r={}),(n=r.transaction)!==null&&n!==void 0||(r.transaction=y3()),(i=r.created)!==null&&i!==void 0||(r.created=Date.now()),(o=r.controller)!==null&&o!==void 0||(r.controller=new AbortController),(a=r.task)!==null&&a!==void 0||(r.task=new Ag),{payload:e,meta:r}}),retry:St("client/retry",e=>({payload:e})),success:St("client/success",(e,r)=>({payload:e,meta:r})),cancel:St("client/cancel",e=>({payload:e})),failure:St("client/failure",(e,r)=>({payload:e,meta:r})),error:St("client/error",(e,r)=>({payload:e,meta:r}))}),at=tw(),E3=t=>e=>e.pipe(Kt(at.request.match),zo(r=>{const{meta:{controller:n,transaction:i}}=r;return new Pe(o=>{if(n.signal.aborted)return o.next(at.cancel({transaction:i,reason:`request [${i}] was aborted!`})),o.complete();o.add(e.pipe(Kt(at.cancel.match)).subscribe(a=>{a.payload.transaction===i&&(n.signal.aborted||n.abort(),o.complete())})),o.add(e2(n.signal,"abort").subscribe(()=>{o.next(at.cancel({transaction:i,reason:`request [${i}] was aborted!`})),o.complete()})),o.add(nr(t(r)).subscribe({next:a=>o.next(a),error:a=>o.next(at.error(a,{request:r})),complete:()=>o.complete()}))})})),rw=t=>(t=Object.assign({},{count:0,delay:0},t),(e,r)=>e.pipe(E3(n=>e.pipe(Kt(at.failure.match),Kt(i=>i.meta.request===n),Yg(r),Bn(([i,o])=>{var a,s;const{transaction:c}=n.meta,l=o[c];if(!l)return Li;const d=(s=(a=l.retry)===null||a===void 0?void 0:a.length)!==null&&s!==void 0?s:0,h=Object.assign({},t,n.meta.retry);if(d>=h.count)throw h.count?Error("maximum retries executed!",{cause:i.payload}):i.payload;return(typeof h.delay=="function"?nr(h.delay(i.payload.cause)).pipe(Kr(f=>{throw Error("failed to resolve delay",{cause:f})})):Sy(h.delay)).pipe(Ge(()=>at.retry(n)))}))))),nw=t=>e=>e.pipe(E3(r=>nr(t(r.payload,r.meta.controller.signal)).pipe(Ge(n=>at.success(n,{request:r})),Kr(n=>Oi(at.failure(Error(`failed to execute request for transaction ${r.meta.transaction}`,{cause:n}),{request:r})))))),iw=t=>t.pipe(Kt(at.retry.match),Ge(e=>e.payload)),C3=()=>Kt(t=>t.status==="complete"),ow=(t={})=>f0(t,e=>e.addCase(at.request,(r,n)=>{const{transaction:i,task:o,ref:a,created:s}=n.meta;r[i]={transaction:i,task:o,ref:a,created:s}}).addCase(at.success,(r,n)=>{const{request:i}=n.meta,{transaction:o,ref:a}=i.meta,s=r[o];if(s){const c={status:"complete",transaction:o,ref:a,value:n.payload,args:i.payload,created:s.created,completed:Date.now()};s.task.next(c),s.task.complete()}delete r[o]}).addCase(at.retry,(r,n)=>{var i;const{transaction:o}=n.payload.meta,a=r[o];a&&((i=a.retry)!==null&&i!==void 0||(a.retry=[]),a.retry.push(Date.now()))}).addCase(at.cancel,(r,n)=>{const{transaction:i,reason:o}=n.payload;if(r[i]){const a=Object.assign({},xm(r[i]));a.task.error(new m2("abort",{request:a,message:o??"request was canceled"})),delete r[i]}}).addCase(at.failure,(r,n)=>{var i;const{payload:o,meta:a}=n,{transaction:s}=a.request.meta,c=r[s];c&&((i=c.errors)!==null&&i!==void 0||(c.errors=[]),c.errors.push(o))}).addCase(at.error,(r,n)=>{const{payload:i,meta:o}=n,{transaction:a}=o.request.meta;if(r[a]){const s=Object.assign({},xm(r[a]));s.task.error(new m2("error",{request:s,message:`failed to process task [${a}]`,cause:i.cause})),delete r[a]}}));var aw=globalThis&&globalThis.__awaiter||function(t,e,r,n){function i(o){return o instanceof r?o:new r(function(a){a(o)})}return new(r||(r=Promise))(function(o,a){function s(d){try{l(n.next(d))}catch(h){a(h)}}function c(d){try{l(n.throw(d))}catch(h){a(h)}}function l(d){d.done?o(d.value):i(d.value).then(s,c)}l((n=n.apply(t,e||[])).next())})},et=globalThis&&globalThis.__classPrivateFieldGet||function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},Mm=globalThis&&globalThis.__classPrivateFieldSet||function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},ot,to;class Pm extends Pe{get closed(){return et(this,ot,"f").closed}get state$(){return et(this,ot,"f")}get action$(){return et(this,ot,"f").action$}get success$(){return this.action$.pipe(Kt(at.success.match),Ge(({payload:e})=>e))}get error$(){return this.action$.pipe(_3("client/error"),Yg(et(this,ot,"f")),Ge(([e,r])=>{const{payload:n,meta:i}=e,{transaction:o}=i.request.meta,a=r[e.meta.request.meta.transaction];return new m2("error",{request:a,message:`failed to process task [${o}]`,cause:n})}))}constructor(e,r){super(o=>et(this,ot,"f").subscribe(o)),ot.set(this,void 0),to.set(this,void 0);const n={};Mm(this,ot,new i0(ow(n)),"f"),Mm(this,to,new un(()=>et(this,ot,"f").complete()),"f"),et(this,to,"f").add(et(this,ot,"f").addFlow(nw(e))),et(this,to,"f").add(et(this,ot,"f").addFlow(iw));const i=Object.assign({count:0,delay:0},r==null?void 0:r.retry);et(this,to,"f").add(et(this,ot,"f").addFlow(rw(i)))}next(e,r){const n=at.request(e,r);return et(this,ot,"f").next(n),n.meta}nextAsync(e,r){return aw(this,void 0,void 0,function*(){return on(this.next(e,r).task.pipe(C3()))})}getTaskByTransaction(e){const r=et(this,ot,"f").value[e];return r&&r.task}getTaskByRef(e){const r=Object.values(et(this,ot,"f").value).find(n=>n.ref===e);return r&&r.task}cancel(e,r){if(e&&et(this,ot,"f").value[e])r??(r=`[${e}]: transaction canceled`),et(this,ot,"f").next(at.cancel({transaction:e,reason:r}));else for(const n of Object.keys(et(this,ot,"f").value))this.cancel(n,`[${e}]: all transactions canceled`)}on(e,r){return et(this,ot,"f").addEffect(at[e].type,n=>{r(n,this)})}complete(){et(this,to,"f").unsubscribe()}asObservable(){return et(this,ot,"f").asObservable()}}ot=new WeakMap,to=new WeakMap;function sw(){return{set:St("cache/set",(t,e)=>({payload:{key:t,entry:e}})),remove:St("cache/remove",t=>({payload:t})),invalidate:St("cache/invalidate",t=>({payload:t})),trim:St("cache/trim",t=>({payload:t}))}}const No=sw(),cw=(t,e)=>{var r,n;return((r=e.updated)!==null&&r!==void 0?r:0)-((n=t.updated)!==null&&n!==void 0?n:0)};function lw(t,e={}){return f0(e,r=>r.addCase(t.set,(n,i)=>{var o;const{key:a,entry:s}=i.payload,c=n[a];c?(c.updated=Date.now(),(o=c.updates)!==null&&o!==void 0||(c.updates=0),c.updates++):n[a]=Object.assign(Object.assign({},s),{created:Date.now()})}).addCase(t.remove,(n,i)=>{delete n[i.payload]}).addCase(t.invalidate,(n,i)=>{const o=n[i.payload];o&&delete o.updated}).addCase(t.trim,(n,i)=>{var o,a;const{payload:s}=i,c=(o=s.sort)!==null&&o!==void 0?o:cw,l=Object.keys(n),d=Object.entries(n).filter(([h,u])=>!s.validate||s.validate(u)).sort((h,u)=>c(h[1],u[1])).slice(0,(a=s.size)!==null&&a!==void 0?a:Number.MAX_SAFE_INTEGER).map(([h])=>h);if(l.length!==d.length)for(const h of l){const u=d.indexOf(h);u!==-1?d.splice(u,1):delete n[h]}}))}var vn=globalThis&&globalThis.__classPrivateFieldGet||function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},dw=globalThis&&globalThis.__classPrivateFieldSet||function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},Er;class Rm{get state$(){return vn(this,Er,"f").asObservable()}constructor(e){Er.set(this,void 0);const{trimming:r,initial:n}=e;dw(this,Er,new i0(lw(No,n)),"f"),r&&vn(this,Er,"f").addEffect("cache/set",()=>vn(this,Er,"f").next(No.trim(r)))}setItem(...e){vn(this,Er,"f").next(No.set(...e))}getItem(e){return vn(this,Er,"f").value[e]}removeItem(e){vn(this,Er,"f").next(No.remove(e))}invalidate(e){vn(this,Er,"f").next(No.invalidate(e))}trim(e){vn(this,Er,"f").next(No.trim(e))}reset(){vn(this,Er,"f").reset()}complete(){vn(this,Er,"f").complete()}}Er=new WeakMap;var De=globalThis&&globalThis.__classPrivateFieldGet||function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},Vo=globalThis&&globalThis.__classPrivateFieldSet||function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},hw=globalThis&&globalThis.__rest||function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(t);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(t,n[i])&&(r[n[i]]=t[n[i]]);return r},ro,Xr,di,qo,Go,Wl,b2;const uw=(t=0)=>e=>{var r;return((r=e.updated)!==null&&r!==void 0?r:0)+t>Date.now()};class nn{get client(){return De(this,Xr,"f")}get cache(){return De(this,di,"f")}constructor(e){var r,n;ro.set(this,new un),Xr.set(this,void 0),di.set(this,void 0),qo.set(this,new Wn),Go.set(this,void 0),Wl.set(this,void 0),b2.set(this,y3()),Vo(this,Go,o=>Lb(e.key(o),De(this,b2,"f")),"f"),Vo(this,Wl,(r=e==null?void 0:e.validate)!==null&&r!==void 0?r:uw(e==null?void 0:e.expire),"f"),e.client instanceof Pm?Vo(this,Xr,e.client,"f"):(Vo(this,Xr,new Pm(e.client.fn,e.client.options),"f"),De(this,ro,"f").add(()=>De(this,Xr,"f").complete())),e.cache instanceof Rm?Vo(this,di,e.cache,"f"):(Vo(this,di,new Rm(e.cache||{}),"f"),De(this,ro,"f").add(()=>De(this,di,"f").complete()));const i=(n=e.queueOperator)!==null&&n!==void 0?n:xb;De(this,ro,"f").add(()=>De(this,qo,"f").complete()),De(this,ro,"f").add(De(this,qo,"f").pipe(i(({args:o,options:a})=>new Pe(s=>{const{task:c,transaction:l}=De(this,Xr,"f").next(o,a);s.add(c.pipe(Kr(()=>Li)).subscribe(s)),s.add(()=>{setTimeout(()=>De(this,Xr,"f").cancel(l))})})),C3(),Wg(()=>!De(this,Xr,"f").closed)).subscribe(o=>{const{args:a,value:s,transaction:c,ref:l}=o,d=l??De(this,Go,"f").call(this,a);De(this,di,"f").setItem(d,{value:s,args:a,transaction:c})}))}next(e,r){De(this,qo,"f").next({args:e,options:r})}query(e,r){var n;const i=De(this,Go,"f").call(this,e);return(n=De(this,Xr,"f").getTaskByRef(i))!==null&&n!==void 0?n:this._createTask(i,e,r)}queryAsync(e,r){const n=r||{},{awaitResolve:i}=n,o=hw(n,["awaitResolve"]);return(i?po:on)(this._query(e,o))}complete(){De(this,ro,"f").unsubscribe()}_query(e,r){var n;const i=De(this,Go,"f").call(this,e);return(n=De(this,Xr,"f").getTaskByRef(i))!==null&&n!==void 0?n:this._createTask(i,e,r)}_createTask(e,r,n){var i;const o=new Ag,a=De(this,di,"f").getItem(e);if(a){const{value:l,args:d,created:h,updated:u,updates:f,transaction:v}=a,g={status:"cache",value:l,args:d,created:h,updated:u,updates:f,transaction:v};o.next(g)}const s=((i=n==null?void 0:n.cache)===null||i===void 0?void 0:i.validate)||De(this,Wl,"f");return a&&s(a,r)?o.complete():De(this,qo,"f").next({args:r,options:{ref:e,task:o}}),o.asObservable()}}ro=new WeakMap,Xr=new WeakMap,di=new WeakMap,qo=new WeakMap,Go=new WeakMap,Wl=new WeakMap,b2=new WeakMap;nn.extractQueryValue=Eb;var si=globalThis&&globalThis.__classPrivateFieldGet||function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},Hm=globalThis&&globalThis.__classPrivateFieldSet||function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},ys,On;class fw extends Pe{get currentContext(){return si(this,On,"f").value}get currentContext$(){return si(this,On,"f").asObservable()}get client(){return si(this,ys,"f")}constructor(e){super(r=>si(this,On,"f").subscribe(r)),ys.set(this,void 0),On.set(this,void 0),Hm(this,ys,new nn(e),"f"),Hm(this,On,new C1(void 0),"f")}setCurrentContext(e){typeof e=="string"?this.resolveContext(e).pipe(Kr(()=>Li)).subscribe(r=>si(this,On,"f").next(r)):e!==si(this,On,"f").value&&si(this,On,"f").next(e)}resolveContext(e){return si(this,ys,"f").query({id:e}).pipe(Ge(r=>r.value))}}ys=new WeakMap,On=new WeakMap;var bt=globalThis&&globalThis.__classPrivateFieldGet||function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},Fo=globalThis&&globalThis.__classPrivateFieldSet||function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},Dn,Yl,_s,Ko,Ql,bs,Xl;class pw{get contextClient(){return bt(this,Dn,"f")}get queryClient(){return bt(this,Yl,"f")}get currentContext$(){return bt(this,Dn,"f").currentContext$}get currentContext(){return bt(this,Dn,"f").currentContext}set currentContext(e){bt(this,_s,"f")?bt(this,_s,"f").dispatchEvent("onCurrentContextChange",{source:this,canBubble:!0,cancelable:!0,detail:{context:e}}).then(r=>{r.canceled||bt(this,Dn,"f").setCurrentContext(e)}):bt(this,Dn,"f").setCurrentContext(e)}constructor(e){var r;Dn.set(this,void 0),Yl.set(this,void 0),_s.set(this,void 0),Ko.set(this,new un),Ql.set(this,void 0),bs.set(this,void 0),Xl.set(this,void 0);const{config:n,event:i,parentContext:o}=e;Fo(this,Ql,n.contextType,"f"),Fo(this,bs,n.contextFilter,"f"),Fo(this,Dn,new fw(n.client.get),"f"),Fo(this,Yl,new nn(n.client.query),"f"),Fo(this,Xl,(r=n.contextParameterFn)!==null&&r!==void 0?r:a=>({search:a.search,filter:{type:a.type}}),"f"),i&&(Fo(this,_s,i,"f"),bt(this,Ko,"f").add(bt(this,Dn,"f").currentContext$.pipe(t2()).subscribe(([a,s])=>{i.dispatchEvent("onCurrentContextChanged",{source:this,canBubble:!0,detail:{previous:a,next:s}})})),bt(this,Ko,"f").add(i.addEventListener("onCurrentContextChanged",a=>{a.source!==this&&(this.currentContext=a.detail.next)}))),o&&bt(this,Ko,"f").add(o.contextClient.currentContext$.subscribe(a=>this.currentContext=a))}queryContext(e){const r=this.queryClient.query(bt(this,Xl,"f").call(this,{search:e,type:bt(this,Ql,"f")})).pipe(Ge(n=>n.value));return bt(this,bs,"f")?r.pipe(Ge(bt(this,bs,"f"))):r}queryContextAsync(e){return po(this.queryContext(e))}clearCurrentContext(){this.currentContext=void 0}dispose(){bt(this,Ko,"f").unsubscribe()}}Dn=new WeakMap,Yl=new WeakMap,_s=new WeakMap,Ko=new WeakMap,Ql=new WeakMap,bs=new WeakMap,Xl=new WeakMap;var mw=globalThis&&globalThis.__awaiter||function(t,e,r,n){function i(o){return o instanceof r?o:new r(function(a){a(o)})}return new(r||(r=Promise))(function(o,a){function s(d){try{l(n.next(d))}catch(h){a(h)}}function c(d){try{l(n.throw(d))}catch(h){a(h)}}function l(d){d.done?o(d.value):i(d.value).then(s,c)}l((n=n.apply(t,e||[])).next())})};const vw="context",gw={name:vw,configure:()=>new wb,initialize:t=>mw(void 0,void 0,void 0,function*(){var e;const r=yield t.config.createConfig(t),n=t.hasModule("event")?yield t.requireInstance("event"):void 0,i=(e=t.ref)===null||e===void 0?void 0:e.context;return new pw({config:r,event:n,parentContext:i})}),dispose:t=>{t.instance.dispose()}};var Lm=globalThis&&globalThis.__awaiter||function(t,e,r,n){function i(o){return o instanceof r?o:new r(function(a){a(o)})}return new(r||(r=Promise))(function(o,a){function s(d){try{l(n.next(d))}catch(h){a(h)}}function c(d){try{l(n.throw(d))}catch(h){a(h)}}function l(d){d.done?o(d.value):i(d.value).then(s,c)}l((n=n.apply(t,e||[])).next())})};class yw{constructor(e){this.clientKey=e.clientKey,this.endpoint=e.endpoint,this.clientCtor=e.clientCtor}createHttpClientClient(e){return Lm(this,void 0,void 0,function*(){if(!this.clientKey)throw Error("no http client for service discovery is provided!");return e.createClient(this.clientKey)})}createClient(e){return Lm(this,void 0,void 0,function*(){if(!this.endpoint)throw Error("no endpoint defined!");return new this.clientCtor({http:e,endpoint:this.endpoint})})}}var Th=globalThis&&globalThis.__awaiter||function(t,e,r,n){function i(o){return o instanceof r?o:new r(function(a){a(o)})}return new(r||(r=Promise))(function(o,a){function s(d){try{l(n.next(d))}catch(h){a(h)}}function c(d){try{l(n.throw(d))}catch(h){a(h)}}function l(d){d.done?o(d.value):i(d.value).then(s,c)}l((n=n.apply(t,e||[])).next())})};class _w{constructor(e,r){this._client=e,this._http=r}get environment(){return this._client.environment}resolveService(e){return Th(this,void 0,void 0,function*(){return this._client.resolveService(e)})}createClient(e,r){return Th(this,void 0,void 0,function*(){const n=yield this.resolveService(e);if(!n)throw Error(`Could not load configuration of service [${e}]`);return this._http.createClient(Object.assign(Object.assign({},r),{baseUri:n.uri,defaultScopes:n.defaultScopes}))})}configureClient(e,r){return Th(this,void 0,void 0,function*(){const{key:n,alias:i}=typeof e=="string"?{key:e,alias:e}:e,{uri:o,defaultScopes:a}=yield this.resolveService(n);r.addConfig(Jg(i,{baseUri:o,defaultScopes:a}))})}}var Om=globalThis&&globalThis.__awaiter||function(t,e,r,n){function i(o){return o instanceof r?o:new r(function(a){a(o)})}return new(r||(r=Promise))(function(o,a){function s(d){try{l(n.next(d))}catch(h){a(h)}}function c(d){try{l(n.throw(d))}catch(h){a(h)}}function l(d){d.done?o(d.value):i(d.value).then(s,c)}l((n=n.apply(t,e||[])).next())})},bw=globalThis&&globalThis.__classPrivateFieldGet||function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},ww=globalThis&&globalThis.__classPrivateFieldSet||function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},Jl;class xw{get environment(){return on(nn.extractQueryValue(bw(this,Jl,"f").query(void 0,{cache:{suppressInvalid:!0}})))}constructor({http:e,endpoint:r}){Jl.set(this,void 0),this.http=e,this.endpoint=r,ww(this,Jl,new nn({client:{fn:()=>e.fetch$(r,{selector:this.selector.bind(this)})},key:()=>"services",expire:5*60*1e3}),"f")}selector(e){return Om(this,void 0,void 0,function*(){const r=yield e.json(),n=r.services.reduce((i,o)=>Object.assign(i,{[o.key]:{clientId:r.clientId,uri:o.uri,defaultScopes:[r.clientId+"/.default"]}}),{});return Object.assign(Object.assign({},r),{services:n})})}resolveService(e){return Om(this,void 0,void 0,function*(){try{const{services:r}=yield this.environment;return r[e]}catch(r){throw console.error(r),r}})}}Jl=new WeakMap;const Ew="serviceDiscovery";var Cw=globalThis&&globalThis.__awaiter||function(t,e,r,n){function i(o){return o instanceof r?o:new r(function(a){a(o)})}return new(r||(r=Promise))(function(o,a){function s(d){try{l(n.next(d))}catch(h){a(h)}}function c(d){try{l(n.throw(d))}catch(h){a(h)}}function l(d){d.done?o(d.value):i(d.value).then(s,c)}l((n=n.apply(t,e||[])).next())})};const zw={name:Ew,configure:()=>new yw({clientCtor:xw,clientKey:"service_discovery",endpoint:"/_discovery/environments/current"}),initialize:({config:t,requireInstance:e})=>Cw(void 0,void 0,void 0,function*(){const r=yield e("http"),n=yield t.createHttpClientClient(r),i=yield t.createClient(n);return new _w(i,r)})};class Sw{}class z3 extends Error{constructor(e,r){super(`unsupported version ${e}`,{cause:r}),this.version=e}}const kw=(t,e)=>{var r;const n=(r=Xn[t])!==null&&r!==void 0?r:t;switch(n){case Xn.v2:throw new z3(t);case Xn.v1:default:{const{id:i}=e,o=new URLSearchParams;return o.append("api-version",n),`/contexts/${i}/?${String(o)}`}}},Aw=(t,e,r)=>[kw(t,e),r],Tw=(t,e,r="json")=>(n,i)=>t[r](...Aw(e,n,i));var Iw=["eq","ne","gt","ge","lt","le"],bl=["and","or","not"],Mw=["any","all"],Pw=["startswith","endswith","contains"],Rw=["expand","levels","select","skip","top","count","orderby","filter"],Dm=/\((.*)\)/,Nm=/(?!indexof)\((\w+)\)/,Vm;(function(t){t.sum="sum",t.min="min",t.max="max",t.average="average",t.countdistinct="countdistinct"})(Vm||(Vm={}));var Hn="";function Hw(t){var e=t===void 0?{}:t,r=e.select,n=e.search,i=e.skiptoken,o=e.format,a=e.top,s=e.skip,c=e.filter,l=e.transform,d=e.orderBy,h=e.key,u=e.count,f=e.expand,v=e.action,g=e.func,x="",m=[],p={};if(h!=null&&(x+="(".concat(En(h,m),")")),(c||typeof u=="object")&&(p.$filter=vc(typeof u=="object"?u:c,m)),l&&(p.$apply=S3(l)),f&&(p.$expand=Zl(f)),d&&(p.$orderby=p0(d)),u&&(typeof u=="boolean"?p.$count=!0:x+="/$count"),typeof a=="number"&&(p.$top=a),typeof s=="number"&&(p.$skip=s),v&&(x+="/".concat(v)),g){if(typeof g=="string")x+="/".concat(g);else if(typeof g=="object"){var y=Object.keys(g)[0],w=En(g[y],m);x+="/".concat(y),w!==""&&(x+="(".concat(w,")"))}}return m.length>0&&Object.assign(p,m.reduce(function(A,O){var U;return Object.assign(A,(U={},U["@".concat(O.name)]=En(O.value),U))},{})),Vw(x,lt({$select:r,$search:n,$skiptoken:i,$format:o},p))}function Ih(t,e,r){return r===void 0&&(r=[]),"".concat(t," eq ").concat(En(e,r))}function vc(t,e,r){return t===void 0&&(t={}),e===void 0&&(e=[]),r===void 0&&(r=""),(Array.isArray(t)?t:[t]).reduce(function(o,a){if(a){var s=n(a,e,r);s&&o.push(s)}return o},[]).join(" and ");function n(o,a,s){o===void 0&&(o={}),a===void 0&&(a=[]),s===void 0&&(s="");var c="";if(typeof o=="string")c=o;else if(o&&typeof o=="object"){var l=Object.keys(o).reduce(function(d,h){var u=o[h];if(u===void 0)return d;var f="";if(s?h===Hn?f=s:Nm.test(h)?f=h.replace(Nm,function(p,y){return y.trim()===Hn?"(".concat(s,")"):"(".concat(s,"/").concat(y.trim(),")")}):Dm.test(h)?f=h.replace(Dm,function(p,y){return y.trim()===Hn?"(".concat(s,")"):"(".concat(s,"/").concat(y.trim(),")")}):f="".concat(s,"/").concat(h):f=h,h===Hn&&Array.isArray(u))return d.concat(u.map(function(p){return Ih(f,p)}));if(["number","string","boolean"].indexOf(typeof u)!==-1||u instanceof Date||u===null)d.push(Ih(f,u,a));else if(Array.isArray(u)){var v=h,g=u.map(function(p){return vc(p,a,s)}).filter(function(p){return p}).map(function(p){return bl.indexOf(v)!==-1?"(".concat(p,")"):p});g.length&&(bl.indexOf(v)!==-1?g.length&&(v==="not"?d.push(Fm(g)):d.push("(".concat(g.join(" ".concat(v," ")),")"))):d.push(g.join(" ".concat(v," "))))}else if(bl.indexOf(f)!==-1){var x=f,g=Object.keys(u).map(function(y){var w;return n((w={},w[y]=u[y],w))});g.length&&(x==="not"?d.push(Fm(g)):d.push("(".concat(g.join(" ".concat(x," ")),")")))}else if(typeof u=="object")if("type"in u)d.push(Ih(f,u,a));else{var m=Object.keys(u);m.forEach(function(p){if(u[p]!==void 0)if(Iw.indexOf(p)!==-1)d.push("".concat(f," ").concat(p," ").concat(En(u[p],a)));else if(bl.indexOf(p)!==-1)Array.isArray(u[p])?d.push(u[p].map(function(O){return"("+n(O,a,f)+")"}).join(" ".concat(p," "))):d.push("("+n(u[p],a,f)+")");else if(Mw.indexOf(p)!==-1){var y=i(h.toLowerCase(),u[p],p,f);y&&d.push(y)}else if(p==="has")d.push("".concat(f," ").concat(p," ").concat(En(u[p],a)));else if(p==="in"){var w=Array.isArray(u[p])?u[p]:u[p].value.map(function(O){return{type:u[p].type,value:O}});d.push(f+" in ("+w.map(function(O){return En(O,a)}).join(",")+")")}else if(Pw.indexOf(p)!==-1)d.push("".concat(p,"(").concat(f,",").concat(En(u[p],a),")"));else{var A=n(u,a,f);A&&d.push(A)}})}else throw new Error("Unexpected value type: ".concat(u));return d},[]);c=l.join(" and ")}return c}function i(o,a,s,c){var l="";if(typeof a=="string"||a instanceof String)l=Lw(o,a,s,c);else if(a){var d=Array.isArray(a)?a.reduce(function(u,f){return f.hasOwnProperty(Hn)?(u.hasOwnProperty(Hn)||(u[Hn]=[]),u[Hn].push(f[Hn]),u):lt(lt({},u),f)},{}):a,h=n(d,e,o);l="".concat(c,"/").concat(s,"(").concat(h?"".concat(o,":").concat(h):"",")")}return l}}function Lw(t,e,r,n){var i="",o=r=="all"?"ne":"eq";return i="".concat(n,"/").concat(r,"(").concat(t,": ").concat(t," ").concat(o," '").concat(e,"')"),i}function Ow(t){return t=t.replace(/%/g,"%25"),t=t.replace(/\+/g,"%2B"),t=t.replace(/\//g,"%2F"),t=t.replace(/\?/g,"%3F"),t=t.replace(/#/g,"%23"),t=t.replace(/&/g,"%26"),t=t.replace(/'/g,"''"),t}function En(t,e){if(typeof t=="string")return"'".concat(Ow(t),"'");if(t instanceof Date)return t.toISOString();if(typeof t=="number")return t;if(Array.isArray(t))return"[".concat(t.map(function(r){return En(r)}).join(","),"]");if(t===null)return t;if(typeof t=="object")switch(t.type){case"raw":case"guid":return t.value;case"duration":return"duration'".concat(t.value,"'");case"binary":return"binary'".concat(t.value,"'");case"alias":return Array.isArray(e)&&e.push(t),"@".concat(t.name);case"json":return escape(JSON.stringify(t.value));case"decimal":return"".concat(t.value,"M");default:return Object.entries(t).filter(function(r){var n=r[1];return n!==void 0}).map(function(r){var n=r[0],i=r[1];return"".concat(n,"=").concat(En(i,e))}).join(",")}return t}function Zl(t){if(typeof t=="number")return t;if(typeof t=="string")return t.indexOf("/")===-1?t:t.split("/").reverse().reduce(function(r,n,i,o){return i===0?"$expand=".concat(n):i===o.length-1?"".concat(n,"(").concat(r,")"):"$expand=".concat(n,"(").concat(r,")")},"");if(Array.isArray(t))return"".concat(t.map(function(r){return Zl(r)}).join(","));if(typeof t=="object"){var e=Object.keys(t);return e.some(function(r){return Rw.indexOf(r.toLowerCase())!==-1})?e.map(function(r){var n;switch(r){case"filter":n=vc(t[r]);break;case"orderBy":n=p0(t[r]);break;case"levels":case"count":case"skip":case"top":n="".concat(t[r]);break;default:n=Zl(t[r])}return"$".concat(r.toLowerCase(),"=").concat(n)}).join(";"):e.map(function(r){var n=Zl(t[r]);return n?"".concat(r,"(").concat(n,")"):r}).join(",")}return""}function S3(t){var e=Array.isArray(t)?t:[t],r=e.reduce(function(n,i){var o=i.aggregate,a=i.filter,s=i.groupBy,c=Eg(i,["aggregate","filter","groupBy"]),l=Object.keys(c);if(l.length)throw new Error("Unsupported transform(s): ".concat(l));if(o&&n.push("aggregate(".concat(Dw(o),")")),a){var d=vc(a);d&&n.push("filter(".concat(vc(d),")"))}return s&&n.push("groupby(".concat(Nw(s),")")),n},[]);return r.join("/")||void 0}function Dw(t){var e=Array.isArray(t)?t:[t];return e.map(function(r){return typeof r=="string"?r:Object.keys(r).map(function(n){var i=r[n];if(!i.with)throw new Error("'with' property required for '".concat(n,"'"));if(!i.as)throw new Error("'as' property required for '".concat(n,"'"));return"".concat(n," with ").concat(i.with," as ").concat(i.as)})}).join(",")}function Nw(t){if(!t.properties)throw new Error("'properties' property required for groupBy");var e="(".concat(t.properties.join(","),")");return t.transform&&(e+=",".concat(S3(t.transform))),e}function p0(t,e){return e===void 0&&(e=""),Array.isArray(t)?t.map(function(r){return Array.isArray(r)&&r.length===2&&["asc","desc"].indexOf(r[1])!==-1?r.join(" "):r}).map(function(r){return"".concat(e).concat(String(r))}).join(","):typeof t=="object"?Object.entries(t).map(function(r){var n=r[0],i=r[1];return p0(i,"".concat(n,"/"))}).map(function(r){return"".concat(e).concat(r)}).join(","):"".concat(e).concat(String(t))}function Vw(t,e){var r=Object.getOwnPropertyNames(e).filter(function(n){return e[n]!==void 0&&e[n]!==""}).map(function(n){return"".concat(n,"=").concat(e[n])});return r.length?"".concat(t,"?").concat(r.join("&")):t}function Fm(t){return"not(".concat(t.join(" and "),")")}const Fw=t=>Object.keys(t).reduce((e,r)=>{var n;switch(r){case"type":return!((n=t[r])===null||n===void 0)&&n.length?Object.assign(Object.assign({},e),{[r]:{in:t[r]}}):e;default:return Object.assign(Object.assign({},e),{[r]:t[r]})}},{}),Uw=t=>Object.keys(t).reduce((e,r)=>{switch(r){case"filter":return Object.assign(Object.assign({},e),{[r]:Fw(t.filter)});default:return Object.assign(Object.assign({},e),{[r]:t[r]})}},{}),$w=t=>typeof t=="string"?t:Hw(Uw(t)),jw=(t,e)=>{var r;const n=(r=Xn[t])!==null&&r!==void 0?r:t;switch(n){case Xn.v2:throw new z3(t);case Xn.v1:default:{const{query:i,includeDeleted:o}=e,a=new URLSearchParams($w(i));return a.append("api-version",n),o&&a.append("includeDeleted","true"),`/contexts/?${String(a)}`}}},Bw=(t,e,r)=>[jw(t,e),r],qw=(t,e,r="json")=>(n,i)=>t[r](...Bw(e,n,i));class Gw{get Version(){return Xn}constructor(e,r){this._client=e,this._method=r}get(e,...r){return Tw(this._client,e,this._method)(...r)}query(e,...r){return qw(this._client,e,this._method)(...r)}}var Xn;(function(t){t.v1="1.0",t.v2="2.0"})(Xn||(Xn={}));const Kw=(t,e)=>{switch(t){case"v1":{const{id:r}=e,n=new URLSearchParams;return n.append("api-version","1.0"),`/bookmarks/${r}/?${String(n)}`}default:{const{id:r}=e,n=new URLSearchParams;return n.append("api-version",t),`/bookmarks/${r}/?${String(n)}`}}},Ww=(t,e,r)=>{const n=Kw(t,e),i=Object.assign({},{method:"Delete"},r);return[n,i]},Yw=(t,e,r="json")=>(n,i)=>t[r](...Ww(e,n,i)),Qw=Yw,Xw=(t,e)=>{switch(t){case"v1":{const{id:r}=e,n=new URLSearchParams;return n.append("api-version","1.0"),`/bookmarks/${r}/?${String(n)}`}default:{const{id:r}=e,n=new URLSearchParams;return n.append("api-version",t),`/bookmarks/${r}/?${String(n)}`}}},Jw=(t,e,r)=>[Xw(t,e),r],Zw=(t,e,r="json")=>(n,i)=>t[r](...Jw(e,n,i)),ex=Zw,tx=(t,e)=>{switch(t){case"v1":{const r=new URLSearchParams;return r.append("api-version","1.0"),`/bookmarks?${String(r)}`}default:{const r=new URLSearchParams;return r.append("api-version",t),`/bookmarks?${String(r)}`}}},rx=(t,e,r)=>{const n=tx(t),i=new Headers;i.append("content-type","application/json");const o=Object.assign({},{method:"post",body:JSON.stringify(e),headers:i},r);return[n,o]},nx=(t,e,r="json")=>(n,i)=>t[r](...rx(e,n,i)),ix=nx;class ox{constructor(e,r){this._client=e,this._method=r}get(e,...r){return ex(this._client,e,this._method)(...r)}post(e,...r){return ix(this._client,e,this._method)(...r)}delete(e,...r){return Qw(this._client,e,this._method)(...r)}}const ax=ox;var Um=globalThis&&globalThis.__awaiter||function(t,e,r,n){function i(o){return o instanceof r?o:new r(function(a){a(o)})}return new(r||(r=Promise))(function(o,a){function s(d){try{l(n.next(d))}catch(h){a(h)}}function c(d){try{l(n.throw(d))}catch(h){a(h)}}function l(d){d.done?o(d.value):i(d.value).then(s,c)}l((n=n.apply(t,e||[])).next())})};class sx{constructor({createClient:e}){this._createClientFn=e}createBookmarksClient(e){return Um(this,void 0,void 0,function*(){const r=yield this._createClientFn("bookmarks");return new ax(r,e)})}createContextClient(e){return Um(this,void 0,void 0,function*(){const r=yield this._createClientFn("context");return new Gw(r,e)})}}var k3=globalThis&&globalThis.__awaiter||function(t,e,r,n){function i(o){return o instanceof r?o:new r(function(a){a(o)})}return new(r||(r=Promise))(function(o,a){function s(d){try{l(n.next(d))}catch(h){a(h)}}function c(d){try{l(n.throw(d))}catch(h){a(h)}}function l(d){d.done?o(d.value):i(d.value).then(s,c)}l((n=n.apply(t,e||[])).next())})};const cx="services",lx=(t,e)=>r=>k3(void 0,void 0,void 0,function*(){if(t.hasClient(r))return t.createClient(r);if(e)return e.createClient(r);throw Error(`failed to create http client for service ${r}`)}),dx={name:cx,configure:()=>new Sw,initialize:({ref:t,config:e,requireInstance:r,hasModule:n})=>k3(void 0,void 0,void 0,function*(){if(!e.createClient){const i=yield r("http"),o=n("serviceDiscovery")?yield r("serviceDiscovery"):t==null?void 0:t.serviceDiscovery;e.createClient=lx(i,o)}if(!e.createClient)throw Error("missing configuration for creating API client");return new sx(e)})},hx=dx;class ux extends Oy{constructor(){super([jy,f3,Zf,zw,hx,gw]),this.logger=new xg("FrameworkConfigurator")}configureHttp(...e){this.addConfig(e_(...e))}configureHttpClient(...e){this.addConfig(Jg(...e))}configureMsal(...e){this.addConfig(pb(...e))}configureServiceDiscovery(e){this.configureHttpClient("service_discovery",e.client)}}var fx=globalThis&&globalThis.__awaiter||function(t,e,r,n){function i(o){return o instanceof r?o:new r(function(a){a(o)})}return new(r||(r=Promise))(function(o,a){function s(d){try{l(n.next(d))}catch(h){a(h)}}function c(d){try{l(n.throw(d))}catch(h){a(h)}}function l(d){d.done?o(d.value):i(d.value).then(s,c)}l((n=n.apply(t,e||[])).next())})};const px=(t,e)=>fx(void 0,void 0,void 0,function*(){const r=yield t.initialize(e),n={modules:r};return window.Fusion=n,r.event.dispatchEvent("onFrameworkLoaded",{detail:n}),n}),A3=T.createContext(null),mx=A3.Provider;var vx=globalThis&&globalThis.__awaiter||function(t,e,r,n){function i(o){return o instanceof r?o:new r(function(a){a(o)})}return new(r||(r=Promise))(function(o,a){function s(d){try{l(n.next(d))}catch(h){a(h)}}function c(d){try{l(n.throw(d))}catch(h){a(h)}}function l(d){d.done?o(d.value):i(d.value).then(s,c)}l((n=n.apply(t,e||[])).next())})};const gx=t=>T.lazy(()=>vx(void 0,void 0,void 0,function*(){const e=new ux;yield t(e);const r=yield px(e);return{default:({children:n})=>Q(mx,Object.assign({value:r},{children:n}))}})),m0=()=>{let t=T.useContext(A3);return t||console.warn("could not locate fusion in context!"),t??(t=window.Fusion),t||console.error("Could not load framework, might not be initiated?"),t},yx=t=>{const e=T.useMemo(()=>gx(t.configure),[t.configure]);return Q(T.Suspense,Object.assign({fallback:t.fallback},{children:Q(e,{children:t.children})}))};function ke(){return ke=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},ke.apply(this,arguments)}function w2(t){return w2=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},w2(t)}function Mh(t){return t&&w2(t)==="object"&&t.constructor===Object}function T3(t,e){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{clone:!0},n=r.clone?ke({},t):t;return Mh(t)&&Mh(e)&&Object.keys(e).forEach(function(i){i!=="__proto__"&&(Mh(e[i])&&i in t?n[i]=T3(t[i],e[i],r):n[i]=e[i])}),n}var _x=typeof Symbol=="function"&&Symbol.for;const I3=_x?Symbol.for("mui.nested"):"__THEME_NESTED__";var bx=["checked","disabled","error","focused","focusVisible","required","expanded","selected"];function wx(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},e=t.disableGlobal,r=e===void 0?!1:e,n=t.productionPrefix,i=n===void 0?"jss":n,o=t.seed,a=o===void 0?"":o,s=a===""?"":"".concat(a,"-"),c=0,l=function(){return c+=1,c};return function(d,h){var u=h.options.name;if(u&&u.indexOf("Mui")===0&&!h.options.link&&!r){if(bx.indexOf(d.key)!==-1)return"Mui-".concat(d.key);var f="".concat(s).concat(u,"-").concat(d.key);return!h.options.theme[I3]||a!==""?f:"".concat(f,"-").concat(l())}return"".concat(s).concat(i).concat(l())}}var $m=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ic=(typeof window>"u"?"undefined":$m(window))==="object"&&(typeof document>"u"?"undefined":$m(document))==="object"&&document.nodeType===9;function jm(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function M3(t,e,r){return e&&jm(t.prototype,e),r&&jm(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function x2(t,e){return x2=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},x2(t,e)}function P3(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,x2(t,e)}function Bm(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function R3(t,e){if(t==null)return{};var r={},n=Object.keys(t),i,o;for(o=0;o<n.length;o++)i=n[o],!(e.indexOf(i)>=0)&&(r[i]=t[i]);return r}var xx={}.constructor;function E2(t){if(t==null||typeof t!="object")return t;if(Array.isArray(t))return t.map(E2);if(t.constructor!==xx)return t;var e={};for(var r in t)e[r]=E2(t[r]);return e}function v0(t,e,r){t===void 0&&(t="unnamed");var n=r.jss,i=E2(e),o=n.plugins.onCreateRule(t,i,r);return o||(t[0],null)}var qm=function(e,r){for(var n="",i=0;i<e.length&&e[i]!=="!important";i++)n&&(n+=r),n+=e[i];return n},go=function(e){if(!Array.isArray(e))return e;var r="";if(Array.isArray(e[0]))for(var n=0;n<e.length&&e[n]!=="!important";n++)r&&(r+=", "),r+=qm(e[n]," ");else r=qm(e,", ");return e[e.length-1]==="!important"&&(r+=" !important"),r};function Ba(t){return t&&t.format===!1?{linebreak:"",space:""}:{linebreak:`
|
|
16
16
|
`,space:" "}}function is(t,e){for(var r="",n=0;n<e;n++)r+=" ";return r+t}function gc(t,e,r){r===void 0&&(r={});var n="";if(!e)return n;var i=r,o=i.indent,a=o===void 0?0:o,s=e.fallbacks;r.format===!1&&(a=-1/0);var c=Ba(r),l=c.linebreak,d=c.space;if(t&&a++,s)if(Array.isArray(s))for(var h=0;h<s.length;h++){var u=s[h];for(var f in u){var v=u[f];v!=null&&(n&&(n+=l),n+=is(f+":"+d+go(v)+";",a))}}else for(var g in s){var x=s[g];x!=null&&(n&&(n+=l),n+=is(g+":"+d+go(x)+";",a))}for(var m in e){var p=e[m];p!=null&&m!=="fallbacks"&&(n&&(n+=l),n+=is(m+":"+d+go(p)+";",a))}return!n&&!r.allowEmpty||!t?n:(a--,n&&(n=""+l+n+l),is(""+t+d+"{"+n,a)+is("}",a))}var Ex=/([[\].#*$><+~=|^:(),"'`\s])/g,Gm=typeof CSS<"u"&&CSS.escape,g0=function(t){return Gm?Gm(t):t.replace(Ex,"\\$1")},H3=function(){function t(r,n,i){this.type="style",this.isProcessed=!1;var o=i.sheet,a=i.Renderer;this.key=r,this.options=i,this.style=n,o?this.renderer=o.renderer:a&&(this.renderer=new a)}var e=t.prototype;return e.prop=function(n,i,o){if(i===void 0)return this.style[n];var a=o?o.force:!1;if(!a&&this.style[n]===i)return this;var s=i;(!o||o.process!==!1)&&(s=this.options.jss.plugins.onChangeValue(i,n,this));var c=s==null||s===!1,l=n in this.style;if(c&&!l&&!a)return this;var d=c&&l;if(d?delete this.style[n]:this.style[n]=s,this.renderable&&this.renderer)return d?this.renderer.removeProperty(this.renderable,n):this.renderer.setProperty(this.renderable,n,s),this;var h=this.options.sheet;return h&&h.attached,this},t}(),C2=function(t){P3(e,t);function e(n,i,o){var a;a=t.call(this,n,i,o)||this;var s=o.selector,c=o.scoped,l=o.sheet,d=o.generateId;return s?a.selectorText=s:c!==!1&&(a.id=d(Bm(Bm(a)),l),a.selectorText="."+g0(a.id)),a}var r=e.prototype;return r.applyTo=function(i){var o=this.renderer;if(o){var a=this.toJSON();for(var s in a)o.setProperty(i,s,a[s])}return this},r.toJSON=function(){var i={};for(var o in this.style){var a=this.style[o];typeof a!="object"?i[o]=a:Array.isArray(a)&&(i[o]=go(a))}return i},r.toString=function(i){var o=this.options.sheet,a=o?o.options.link:!1,s=a?ke({},i,{allowEmpty:!0}):i;return gc(this.selectorText,this.style,s)},M3(e,[{key:"selector",set:function(i){if(i!==this.selectorText){this.selectorText=i;var o=this.renderer,a=this.renderable;if(!(!a||!o)){var s=o.setSelector(a,i);s||o.replaceRule(a,this)}}},get:function(){return this.selectorText}}]),e}(H3),Cx={onCreateRule:function(e,r,n){return e[0]==="@"||n.parent&&n.parent.type==="keyframes"?null:new C2(e,r,n)}},Ph={indent:1,children:!0},zx=/@([\w-]+)/,Sx=function(){function t(r,n,i){this.type="conditional",this.isProcessed=!1,this.key=r;var o=r.match(zx);this.at=o?o[1]:"unknown",this.query=i.name||"@"+this.at,this.options=i,this.rules=new k1(ke({},i,{parent:this}));for(var a in n)this.rules.add(a,n[a]);this.rules.process()}var e=t.prototype;return e.getRule=function(n){return this.rules.get(n)},e.indexOf=function(n){return this.rules.indexOf(n)},e.addRule=function(n,i,o){var a=this.rules.add(n,i,o);return a?(this.options.jss.plugins.onProcessRule(a),a):null},e.replaceRule=function(n,i,o){var a=this.rules.replace(n,i,o);return a&&this.options.jss.plugins.onProcessRule(a),a},e.toString=function(n){n===void 0&&(n=Ph);var i=Ba(n),o=i.linebreak;if(n.indent==null&&(n.indent=Ph.indent),n.children==null&&(n.children=Ph.children),n.children===!1)return this.query+" {}";var a=this.rules.toString(n);return a?this.query+" {"+o+a+o+"}":""},t}(),kx=/@media|@supports\s+/,Ax={onCreateRule:function(e,r,n){return kx.test(e)?new Sx(e,r,n):null}},Rh={indent:1,children:!0},Tx=/@keyframes\s+([\w-]+)/,z2=function(){function t(r,n,i){this.type="keyframes",this.at="@keyframes",this.isProcessed=!1;var o=r.match(Tx);o&&o[1]?this.name=o[1]:this.name="noname",this.key=this.type+"-"+this.name,this.options=i;var a=i.scoped,s=i.sheet,c=i.generateId;this.id=a===!1?this.name:g0(c(this,s)),this.rules=new k1(ke({},i,{parent:this}));for(var l in n)this.rules.add(l,n[l],ke({},i,{parent:this}));this.rules.process()}var e=t.prototype;return e.toString=function(n){n===void 0&&(n=Rh);var i=Ba(n),o=i.linebreak;if(n.indent==null&&(n.indent=Rh.indent),n.children==null&&(n.children=Rh.children),n.children===!1)return this.at+" "+this.id+" {}";var a=this.rules.toString(n);return a&&(a=""+o+a+o),this.at+" "+this.id+" {"+a+"}"},t}(),Ix=/@keyframes\s+/,Mx=/\$([\w-]+)/g,S2=function(e,r){return typeof e=="string"?e.replace(Mx,function(n,i){return i in r?r[i]:n}):e},Km=function(e,r,n){var i=e[r],o=S2(i,n);o!==i&&(e[r]=o)},Px={onCreateRule:function(e,r,n){return typeof e=="string"&&Ix.test(e)?new z2(e,r,n):null},onProcessStyle:function(e,r,n){return r.type!=="style"||!n||("animation-name"in e&&Km(e,"animation-name",n.keyframes),"animation"in e&&Km(e,"animation",n.keyframes)),e},onChangeValue:function(e,r,n){var i=n.options.sheet;if(!i)return e;switch(r){case"animation":return S2(e,i.keyframes);case"animation-name":return S2(e,i.keyframes);default:return e}}},Rx=function(t){P3(e,t);function e(){return t.apply(this,arguments)||this}var r=e.prototype;return r.toString=function(i){var o=this.options.sheet,a=o?o.options.link:!1,s=a?ke({},i,{allowEmpty:!0}):i;return gc(this.key,this.style,s)},e}(H3),Hx={onCreateRule:function(e,r,n){return n.parent&&n.parent.type==="keyframes"?new Rx(e,r,n):null}},Lx=function(){function t(r,n,i){this.type="font-face",this.at="@font-face",this.isProcessed=!1,this.key=r,this.style=n,this.options=i}var e=t.prototype;return e.toString=function(n){var i=Ba(n),o=i.linebreak;if(Array.isArray(this.style)){for(var a="",s=0;s<this.style.length;s++)a+=gc(this.at,this.style[s]),this.style[s+1]&&(a+=o);return a}return gc(this.at,this.style,n)},t}(),Ox=/@font-face/,Dx={onCreateRule:function(e,r,n){return Ox.test(e)?new Lx(e,r,n):null}},Nx=function(){function t(r,n,i){this.type="viewport",this.at="@viewport",this.isProcessed=!1,this.key=r,this.style=n,this.options=i}var e=t.prototype;return e.toString=function(n){return gc(this.key,this.style,n)},t}(),Vx={onCreateRule:function(e,r,n){return e==="@viewport"||e==="@-ms-viewport"?new Nx(e,r,n):null}},Fx=function(){function t(r,n,i){this.type="simple",this.isProcessed=!1,this.key=r,this.value=n,this.options=i}var e=t.prototype;return e.toString=function(n){if(Array.isArray(this.value)){for(var i="",o=0;o<this.value.length;o++)i+=this.key+" "+this.value[o]+";",this.value[o+1]&&(i+=`
|
|
17
17
|
`);return i}return this.key+" "+this.value+";"},t}(),Ux={"@charset":!0,"@import":!0,"@namespace":!0},$x={onCreateRule:function(e,r,n){return e in Ux?new Fx(e,r,n):null}},Wm=[Cx,Ax,Px,Hx,Dx,Vx,$x],jx={process:!0},Ym={force:!0,process:!0},k1=function(){function t(r){this.map={},this.raw={},this.index=[],this.counter=0,this.options=r,this.classes=r.classes,this.keyframes=r.keyframes}var e=t.prototype;return e.add=function(n,i,o){var a=this.options,s=a.parent,c=a.sheet,l=a.jss,d=a.Renderer,h=a.generateId,u=a.scoped,f=ke({classes:this.classes,parent:s,sheet:c,jss:l,Renderer:d,generateId:h,scoped:u,name:n,keyframes:this.keyframes,selector:void 0},o),v=n;n in this.raw&&(v=n+"-d"+this.counter++),this.raw[v]=i,v in this.classes&&(f.selector="."+g0(this.classes[v]));var g=v0(v,i,f);if(!g)return null;this.register(g);var x=f.index===void 0?this.index.length:f.index;return this.index.splice(x,0,g),g},e.replace=function(n,i,o){var a=this.get(n),s=this.index.indexOf(a);a&&this.remove(a);var c=o;return s!==-1&&(c=ke({},o,{index:s})),this.add(n,i,c)},e.get=function(n){return this.map[n]},e.remove=function(n){this.unregister(n),delete this.raw[n.key],this.index.splice(this.index.indexOf(n),1)},e.indexOf=function(n){return this.index.indexOf(n)},e.process=function(){var n=this.options.jss.plugins;this.index.slice(0).forEach(n.onProcessRule,n)},e.register=function(n){this.map[n.key]=n,n instanceof C2?(this.map[n.selector]=n,n.id&&(this.classes[n.key]=n.id)):n instanceof z2&&this.keyframes&&(this.keyframes[n.name]=n.id)},e.unregister=function(n){delete this.map[n.key],n instanceof C2?(delete this.map[n.selector],delete this.classes[n.key]):n instanceof z2&&delete this.keyframes[n.name]},e.update=function(){var n,i,o;if(typeof(arguments.length<=0?void 0:arguments[0])=="string"?(n=arguments.length<=0?void 0:arguments[0],i=arguments.length<=1?void 0:arguments[1],o=arguments.length<=2?void 0:arguments[2]):(i=arguments.length<=0?void 0:arguments[0],o=arguments.length<=1?void 0:arguments[1],n=null),n)this.updateOne(this.get(n),i,o);else for(var a=0;a<this.index.length;a++)this.updateOne(this.index[a],i,o)},e.updateOne=function(n,i,o){o===void 0&&(o=jx);var a=this.options,s=a.jss.plugins,c=a.sheet;if(n.rules instanceof t){n.rules.update(i,o);return}var l=n.style;if(s.onUpdate(i,n,c,o),o.process&&l&&l!==n.style){s.onProcessStyle(n.style,n,c);for(var d in n.style){var h=n.style[d],u=l[d];h!==u&&n.prop(d,h,Ym)}for(var f in l){var v=n.style[f],g=l[f];v==null&&v!==g&&n.prop(f,null,Ym)}}},e.toString=function(n){for(var i="",o=this.options.sheet,a=o?o.options.link:!1,s=Ba(n),c=s.linebreak,l=0;l<this.index.length;l++){var d=this.index[l],h=d.toString(n);!h&&!a||(i&&(i+=c),i+=h)}return i},t}(),L3=function(){function t(r,n){this.attached=!1,this.deployed=!1,this.classes={},this.keyframes={},this.options=ke({},n,{sheet:this,parent:this,classes:this.classes,keyframes:this.keyframes}),n.Renderer&&(this.renderer=new n.Renderer(this)),this.rules=new k1(this.options);for(var i in r)this.rules.add(i,r[i]);this.rules.process()}var e=t.prototype;return e.attach=function(){return this.attached?this:(this.renderer&&this.renderer.attach(),this.attached=!0,this.deployed||this.deploy(),this)},e.detach=function(){return this.attached?(this.renderer&&this.renderer.detach(),this.attached=!1,this):this},e.addRule=function(n,i,o){var a=this.queue;this.attached&&!a&&(this.queue=[]);var s=this.rules.add(n,i,o);return s?(this.options.jss.plugins.onProcessRule(s),this.attached?(this.deployed&&(a?a.push(s):(this.insertRule(s),this.queue&&(this.queue.forEach(this.insertRule,this),this.queue=void 0))),s):(this.deployed=!1,s)):null},e.replaceRule=function(n,i,o){var a=this.rules.get(n);if(!a)return this.addRule(n,i,o);var s=this.rules.replace(n,i,o);return s&&this.options.jss.plugins.onProcessRule(s),this.attached?(this.deployed&&this.renderer&&(s?a.renderable&&this.renderer.replaceRule(a.renderable,s):this.renderer.deleteRule(a)),s):(this.deployed=!1,s)},e.insertRule=function(n){this.renderer&&this.renderer.insertRule(n)},e.addRules=function(n,i){var o=[];for(var a in n){var s=this.addRule(a,n[a],i);s&&o.push(s)}return o},e.getRule=function(n){return this.rules.get(n)},e.deleteRule=function(n){var i=typeof n=="object"?n:this.rules.get(n);return!i||this.attached&&!i.renderable?!1:(this.rules.remove(i),this.attached&&i.renderable&&this.renderer?this.renderer.deleteRule(i.renderable):!0)},e.indexOf=function(n){return this.rules.indexOf(n)},e.deploy=function(){return this.renderer&&this.renderer.deploy(),this.deployed=!0,this},e.update=function(){var n;return(n=this.rules).update.apply(n,arguments),this},e.updateOne=function(n,i,o){return this.rules.updateOne(n,i,o),this},e.toString=function(n){return this.rules.toString(n)},t}(),Bx=function(){function t(){this.plugins={internal:[],external:[]},this.registry={}}var e=t.prototype;return e.onCreateRule=function(n,i,o){for(var a=0;a<this.registry.onCreateRule.length;a++){var s=this.registry.onCreateRule[a](n,i,o);if(s)return s}return null},e.onProcessRule=function(n){if(!n.isProcessed){for(var i=n.options.sheet,o=0;o<this.registry.onProcessRule.length;o++)this.registry.onProcessRule[o](n,i);n.style&&this.onProcessStyle(n.style,n,i),n.isProcessed=!0}},e.onProcessStyle=function(n,i,o){for(var a=0;a<this.registry.onProcessStyle.length;a++)i.style=this.registry.onProcessStyle[a](i.style,i,o)},e.onProcessSheet=function(n){for(var i=0;i<this.registry.onProcessSheet.length;i++)this.registry.onProcessSheet[i](n)},e.onUpdate=function(n,i,o,a){for(var s=0;s<this.registry.onUpdate.length;s++)this.registry.onUpdate[s](n,i,o,a)},e.onChangeValue=function(n,i,o){for(var a=n,s=0;s<this.registry.onChangeValue.length;s++)a=this.registry.onChangeValue[s](a,i,o);return a},e.use=function(n,i){i===void 0&&(i={queue:"external"});var o=this.plugins[i.queue];o.indexOf(n)===-1&&(o.push(n),this.registry=[].concat(this.plugins.external,this.plugins.internal).reduce(function(a,s){for(var c in s)c in a&&a[c].push(s[c]);return a},{onCreateRule:[],onProcessRule:[],onProcessStyle:[],onProcessSheet:[],onChangeValue:[],onUpdate:[]}))},t}(),qx=function(){function t(){this.registry=[]}var e=t.prototype;return e.add=function(n){var i=this.registry,o=n.options.index;if(i.indexOf(n)===-1){if(i.length===0||o>=this.index){i.push(n);return}for(var a=0;a<i.length;a++)if(i[a].options.index>o){i.splice(a,0,n);return}}},e.reset=function(){this.registry=[]},e.remove=function(n){var i=this.registry.indexOf(n);this.registry.splice(i,1)},e.toString=function(n){for(var i=n===void 0?{}:n,o=i.attached,a=R3(i,["attached"]),s=Ba(a),c=s.linebreak,l="",d=0;d<this.registry.length;d++){var h=this.registry[d];o!=null&&h.attached!==o||(l&&(l+=c),l+=h.toString(a))}return l},M3(t,[{key:"index",get:function(){return this.registry.length===0?0:this.registry[this.registry.length-1].options.index}}]),t}(),$s=new qx,k2=typeof globalThis<"u"?globalThis:typeof window<"u"&&window.Math===Math?window:typeof self<"u"&&self.Math===Math?self:Function("return this")(),A2="2f1acc6c3a606b082e5eef5e54414ffb";k2[A2]==null&&(k2[A2]=0);var Qm=k2[A2]++,Xm=function(e){e===void 0&&(e={});var r=0,n=function(o,a){r+=1;var s="",c="";return a&&(a.options.classNamePrefix&&(c=a.options.classNamePrefix),a.options.jss.id!=null&&(s=String(a.options.jss.id))),e.minify?""+(c||"c")+Qm+s+r:c+o.key+"-"+Qm+(s?"-"+s:"")+"-"+r};return n},O3=function(e){var r;return function(){return r||(r=e()),r}},Gx=function(e,r){try{return e.attributeStyleMap?e.attributeStyleMap.get(r):e.style.getPropertyValue(r)}catch{return""}},Kx=function(e,r,n){try{var i=n;if(Array.isArray(n)&&(i=go(n)),e.attributeStyleMap)e.attributeStyleMap.set(r,i);else{var o=i?i.indexOf("!important"):-1,a=o>-1?i.substr(0,o-1):i;e.style.setProperty(r,a,o>-1?"important":"")}}catch{return!1}return!0},Wx=function(e,r){try{e.attributeStyleMap?e.attributeStyleMap.delete(r):e.style.removeProperty(r)}catch{}},Yx=function(e,r){return e.selectorText=r,e.selectorText===r},D3=O3(function(){return document.querySelector("head")});function Qx(t,e){for(var r=0;r<t.length;r++){var n=t[r];if(n.attached&&n.options.index>e.index&&n.options.insertionPoint===e.insertionPoint)return n}return null}function Xx(t,e){for(var r=t.length-1;r>=0;r--){var n=t[r];if(n.attached&&n.options.insertionPoint===e.insertionPoint)return n}return null}function Jx(t){for(var e=D3(),r=0;r<e.childNodes.length;r++){var n=e.childNodes[r];if(n.nodeType===8&&n.nodeValue.trim()===t)return n}return null}function Zx(t){var e=$s.registry;if(e.length>0){var r=Qx(e,t);if(r&&r.renderer)return{parent:r.renderer.element.parentNode,node:r.renderer.element};if(r=Xx(e,t),r&&r.renderer)return{parent:r.renderer.element.parentNode,node:r.renderer.element.nextSibling}}var n=t.insertionPoint;if(n&&typeof n=="string"){var i=Jx(n);if(i)return{parent:i.parentNode,node:i.nextSibling}}return!1}function eE(t,e){var r=e.insertionPoint,n=Zx(e);if(n!==!1&&n.parent){n.parent.insertBefore(t,n.node);return}if(r&&typeof r.nodeType=="number"){var i=r,o=i.parentNode;o&&o.insertBefore(t,i.nextSibling);return}D3().appendChild(t)}var tE=O3(function(){var t=document.querySelector('meta[property="csp-nonce"]');return t?t.getAttribute("content"):null}),Jm=function(e,r,n){try{"insertRule"in e?e.insertRule(r,n):"appendRule"in e&&e.appendRule(r)}catch{return!1}return e.cssRules[n]},Zm=function(e,r){var n=e.cssRules.length;return r===void 0||r>n?n:r},rE=function(){var e=document.createElement("style");return e.textContent=`
|
|
18
18
|
`,e},nE=function(){function t(r){this.getPropertyValue=Gx,this.setProperty=Kx,this.removeProperty=Wx,this.setSelector=Yx,this.hasInsertedRules=!1,this.cssRules=[],r&&$s.add(r),this.sheet=r;var n=this.sheet?this.sheet.options:{},i=n.media,o=n.meta,a=n.element;this.element=a||rE(),this.element.setAttribute("data-jss",""),i&&this.element.setAttribute("media",i),o&&this.element.setAttribute("data-meta",o);var s=tE();s&&this.element.setAttribute("nonce",s)}var e=t.prototype;return e.attach=function(){if(!(this.element.parentNode||!this.sheet)){eE(this.element,this.sheet.options);var n=Boolean(this.sheet&&this.sheet.deployed);this.hasInsertedRules&&n&&(this.hasInsertedRules=!1,this.deploy())}},e.detach=function(){if(!!this.sheet){var n=this.element.parentNode;n&&n.removeChild(this.element),this.sheet.options.link&&(this.cssRules=[],this.element.textContent=`
|
|
@@ -289,7 +289,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
289
289
|
class="progress">
|
|
290
290
|
</circle>
|
|
291
291
|
</svg>
|
|
292
|
-
`}}b([E({type:String,reflect:!0})],Lc.prototype,"size",void 0);b([E({type:String,reflect:!0})],Lc.prototype,"color",void 0);Lc.styles=Iz;const p6="fwc-circular-progress";let Cv=class extends Lc{};Cv=b([Yt(p6)],Cv);const m6=To(Rc,u6);To(Lc,p6);To(Hc,f6);var Mz=globalThis&&globalThis.__classPrivateFieldSet||function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},Pz=globalThis&&globalThis.__classPrivateFieldGet||function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},td;class Rz{constructor(e,r={}){this.config=r,td.set(this,void 0),Mz(this,td,e,"f")}requireInstance(e){return Pz(this,td,"f").requireInstance(e)}setAppClient(e,r=1*60*1e3){this.config.client={getAppManifest:typeof e.getAppManifest=="function"?{key:({appKey:n})=>n,client:{fn:e.getAppManifest},expire:r}:e.getAppManifest,getAppManifests:typeof e.getAppManifests=="function"?{key:()=>"app_manifests",client:{fn:e.getAppManifests},expire:r}:e.getAppManifests,getAppConfig:typeof e.getAppConfig=="function"?{key:n=>JSON.stringify(n),client:{fn:e.getAppConfig},expire:r}:e.getAppConfig}}}td=new WeakMap;const Hz=()=>({setManifest:St("set_manifest",t=>({payload:t,meta:{created:Date.now()}})),fetchManifest:yl("fetch_manifest",t=>({payload:t}),t=>({payload:t}),t=>({payload:t})),setConfig:St("set_config",t=>({payload:t})),fetchConfig:yl("fetch_config",t=>({payload:t}),t=>({payload:t}),t=>({payload:t})),setModule:St("set_module",t=>({payload:t})),importApp:yl("import_app",t=>({payload:t}),t=>({payload:t}),t=>({payload:t})),setInstance:St("set_instance",t=>({payload:t})),initialize:yl("initialize_app",()=>({payload:null}),()=>({payload:null}),t=>({payload:t}))}),ze=Hz();Kb();const Lz=t=>f0(Object.assign(Object.assign({},t),{status:new Set}),e=>e.addCase(ze.setManifest,(r,n)=>{r.manifest=n.payload}).addCase(ze.setConfig,(r,n)=>{r.config=n.payload}).addCase(ze.setModule,(r,n)=>{r.modules=n.payload}).addCase(ze.setInstance,(r,n)=>{r.instance=n.payload}).addMatcher(Db,(r,n)=>{r.status.add(wm(n))}).addMatcher(Fb,(r,n)=>{r.status.delete(wm(n))})),Oz="modulepreload",Dz=function(t){return"/"+t},zv={},v6=function(e,r,n){if(!r||r.length===0)return e();const i=document.getElementsByTagName("link");return Promise.all(r.map(o=>{if(o=Dz(o),o in zv)return;zv[o]=!0;const a=o.endsWith(".css"),s=a?'[rel="stylesheet"]':"";if(!!n)for(let d=i.length-1;d>=0;d--){const h=i[d];if(h.href===o&&(!a||h.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${o}"]${s}`))return;const l=document.createElement("link");if(l.rel=a?"stylesheet":Oz,a||(l.as="script",l.crossOrigin=""),l.href=o,document.head.appendChild(l),a)return new Promise((d,h)=>{l.addEventListener("load",d),l.addEventListener("error",()=>h(new Error(`Unable to preload CSS for ${o}`)))})})).then(()=>e())},Nz=t=>e=>e.pipe(Kt(ze.fetchManifest.match),Bn(({payload:r})=>{const n=nr(t.getAppManifest(r)).pipe(Kt(i=>!!i),Ge(ze.setManifest));return qg(n,n.pipe(Jf(),Ge(({payload:i})=>ze.fetchManifest.success(i)))).pipe(Kr(i=>Oi(ze.fetchManifest.failure(i))))})),Vz=t=>e=>e.pipe(Kt(ze.fetchConfig.match),Bn(({payload:r})=>{const n=nr(t.getAppConfig(r)).pipe(Ge(ze.setConfig));return qg(n,n.pipe(Jf(),Ge(({payload:i})=>ze.fetchConfig.success(i)))).pipe(Kr(i=>Oi(ze.fetchConfig.failure(i))))})),Fz=()=>t=>t.pipe(Kt(ze.importApp.match),Bn(({payload:e})=>nr(v6(()=>import(e),[])).pipe(Ge(ze.importApp.success),Kr(r=>Oi(ze.importApp.failure(r)))))),Uz=(t,e)=>{const r=Lz(t),n=new i0(r);return n.addFlow(Nz(e)),n.addFlow(Vz(e)),n.addFlow(Fz()),n};var $z=globalThis&&globalThis.__awaiter||function(t,e,r,n){function i(o){return o instanceof r?o:new r(function(a){a(o)})}return new(r||(r=Promise))(function(o,a){function s(d){try{l(n.next(d))}catch(h){a(h)}}function c(d){try{l(n.throw(d))}catch(h){a(h)}}function l(d){d.done?o(d.value):i(d.value).then(s,c)}l((n=n.apply(t,e||[])).next())})},le=globalThis&&globalThis.__classPrivateFieldGet||function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},jz=globalThis&&globalThis.__classPrivateFieldSet||function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},H2,oe,g6;function Es(){return Kt(t=>t!=null)}class Bz{get manifest$(){return le(this,oe,"f").pipe(Ge(({manifest:e})=>e),Es())}get config$(){return le(this,oe,"f").pipe(Ge(({config:e})=>e),Es())}get modules$(){return le(this,oe,"f").pipe(Ge(({modules:e})=>e),Es())}get instance$(){return le(this,oe,"f").pipe(Ge(({instance:e})=>e),Es())}get state(){return le(this,oe,"f").value}get appKey(){return le(this,oe,"f").value.appKey}get manifest(){return on(this.manifest$)}get config(){return on(this.config$)}get instance(){return le(this,oe,"f").value.instance}constructor(e,r){H2.add(this),oe.set(this,void 0),jz(this,oe,Uz(e,r.provider),"f");const{appKey:n}=e,{event:i}=r;i&&le(this,H2,"m",g6).call(this,i);const o=new un;i&&(o.add(()=>{i.dispatchEvent("onAppDispose",{detail:{appKey:n}})}),o.add(i.addEventListener("onAppModulesLoaded",a=>{a.detail.appKey===n&&le(this,oe,"f").next(ze.setInstance(a.detail.modules))}))),this.dispose=()=>{o==null||o.unsubscribe(),le(this,oe,"f").value.instance&&le(this,oe,"f").value.instance.dispose(),le(this,oe,"f").complete()}}initialize(){return new Pe(e=>{le(this,oe,"f").next(ze.initialize()),e.add(gy([this.getManifest(),this.getAppModule(),this.getConfig()]).subscribe({next:([r,n,i])=>e.next({manifest:r,script:n,config:i}),error:r=>{e.error(r),le(this,oe,"f").next(ze.initialize.failure(r))},complete:()=>{le(this,oe,"f").next(ze.initialize.success()),e.complete()}}))})}loadConfig(){le(this,oe,"f").next(ze.fetchConfig(this.appKey))}loadManifest(){le(this,oe,"f").next(ze.fetchManifest(this.appKey))}loadAppModule(e=!0){return $z(this,void 0,void 0,function*(){const r=yield this.getManifestAsync(e);le(this,oe,"f").next(ze.importApp(r.entry))})}getConfig(e=!1){return new Pe(r=>{if(le(this,oe,"f").value.config&&(r.next(le(this,oe,"f").value.config),!e))return r.complete();r.add(le(this,oe,"f").addEffect("set_config",({payload:n})=>{r.next(n)})),r.add(le(this,oe,"f").addEffect("fetch_config::success",({payload:n})=>{r.next(n),r.complete()})),r.add(le(this,oe,"f").addEffect("fetch_config::failure",({payload:n})=>{r.error(Error("failed to load application config",{cause:n}))})),this.loadConfig()})}getConfigAsync(e=!0){return(e?on:po)(this.getConfig(!e))}getManifest(e=!1){return new Pe(r=>{if(le(this,oe,"f").value.manifest&&(r.next(le(this,oe,"f").value.manifest),!e))return r.complete();r.add(le(this,oe,"f").addEffect("set_manifest",({payload:n})=>{r.next(n)})),r.add(le(this,oe,"f").addEffect("fetch_manifest::success",({payload:n})=>{r.next(n),r.complete()})),r.add(le(this,oe,"f").addEffect("fetch_manifest::failure",({payload:n})=>{r.error(Error("failed to load application manifest",{cause:n}))})),this.loadManifest()})}getManifestAsync(e=!0){return(e?on:po)(this.getManifest(!e))}getAppModule(e=!1){return new Pe(r=>{if(le(this,oe,"f").value.modules&&(r.next(le(this,oe,"f").value.modules),!e))return r.complete();r.add(le(this,oe,"f").addEffect("set_module",({payload:n})=>{r.next(n)})),r.add(le(this,oe,"f").addEffect("import_app::success",({payload:n})=>{r.next(n),r.complete()})),r.add(le(this,oe,"f").addEffect("import_app::failure",({payload:n})=>{r.error(Error("failed to load application modules from script",{cause:n}))})),r.add(this.getManifest().subscribe(n=>Oi(le(this,oe,"f").next(ze.importApp(n.entry)))))})}getAppModuleAsync(e=!0){return(e?on:po)(this.getAppModule(!e))}}oe=new WeakMap,H2=new WeakSet,g6=function(e){const{appKey:r}=this;le(this,oe,"f").addEffect(ze.fetchManifest.success.type,n=>{e.dispatchEvent("onAppManifestLoaded",{detail:{appKey:r,manifest:n.payload},source:this})}),le(this,oe,"f").addEffect(ze.fetchConfig.success.type,n=>{e.dispatchEvent("onAppConfigLoaded",{detail:{appKey:r,manifest:n.payload},source:this})}),le(this,oe,"f").addEffect(ze.importApp.success.type,n=>{e.dispatchEvent("onAppScriptLoaded",{detail:{appKey:r,manifest:n.payload},source:this})}),le(this,oe,"f").addEffect(ze.initialize.type,()=>{e.dispatchEvent("onAppInitialize",{detail:{appKey:r},source:this})}),le(this,oe,"f").addEffect(ze.initialize.success.type,()=>{e.dispatchEvent("onAppInitialized",{detail:{appKey:r},source:this})}),le(this,oe,"f").addEffect(ze.initialize.failure.type,({payload:n})=>{e.dispatchEvent("onAppInitializeFailed",{detail:{appKey:r,error:n},source:this})})};class Pi extends Error{static fromHttpResponse(e,r){switch(e.status){case 401:return new Pi("unauthorized","failed to load application manifest, request not authorized",r);case 404:return new Pi("not_found","application manifest not found",r)}return new Pi("unknown",`failed to load application manifest, status code ${e.status}`,r)}constructor(e,r,n){super(r,n),this.type=e}}class yo extends Error{static fromHttpResponse(e,r){switch(e.status){case 401:return new yo("unauthorized","failed to load application config, request not authorized",r);case 404:return new yo("not_found","application config not found",r)}return new yo("unknown",`failed to load application config, status code ${e.status}`,r)}constructor(e,r,n){super(r,n),this.type=e}}var Ft=globalThis&&globalThis.__classPrivateFieldGet||function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},xl=globalThis&&globalThis.__classPrivateFieldSet||function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},Cs,zs,ui,fi,rd;class qz{static compareAppManifest(e,r){return JSON.stringify(e)===JSON.stringify(r)}get current(){return Ft(this,ui,"f").value}get current$(){return Ft(this,ui,"f").pipe(Gg((e,r)=>e&&r?e.appKey===r.appKey:e===r))}constructor(e){Cs.set(this,void 0),zs.set(this,void 0),ui.set(this,void 0),fi.set(this,new un),rd.set(this,void 0);const{event:r,config:n}=e;xl(this,rd,r,"f"),xl(this,ui,new C1(void 0),"f"),this.appClient=new nn(n.client.getAppManifest),xl(this,Cs,new nn(n.client.getAppManifests),"f"),xl(this,zs,new nn(n.client.getAppConfig),"f"),Ft(this,fi,"f").add(()=>this.appClient.complete()),Ft(this,fi,"f").add(()=>Ft(this,Cs,"f").complete()),Ft(this,fi,"f").add(()=>Ft(this,zs,"f").complete()),Ft(this,fi,"f").add(this.current$.pipe(t2(),Wg(()=>!!r)).subscribe(([i,o])=>{r==null||r.dispatchEvent("onCurrentAppChanged",{source:this,detail:{previous:i,next:o}})})),Ft(this,fi,"f").add(Ft(this,ui,"f").pipe(t2(),Ge(([i])=>i),Es()).subscribe(i=>i.dispose()))}getAppManifest(e){return nn.extractQueryValue(this.appClient.query({appKey:e}).pipe(Kr(r=>{const{cause:n}=r;throw n instanceof Pi?n:n instanceof n2?Pi.fromHttpResponse(n.response,{cause:n}):new Pi("unknown","failed to load manifest",{cause:n})})))}getAllAppManifests(){return nn.extractQueryValue(Ft(this,Cs,"f").query())}getAppConfig(e,r){return nn.extractQueryValue(Ft(this,zs,"f").query({appKey:e,tag:r}).pipe(Kr(n=>{const{cause:i}=n;throw i instanceof yo?i:i instanceof n2?yo.fromHttpResponse(i.response,{cause:i}):new yo("unknown","failed to load config",{cause:i})})))}setCurrentApp(e){const r=typeof e=="string"?this.createApp({appKey:e}):e;Ft(this,ui,"f").next(r)}clearCurrentApp(){Ft(this,ui,"f").next(null)}createApp(e){return new Bz(e,{provider:this,event:Ft(this,rd,"f")})}dispose(){Ft(this,fi,"f").unsubscribe()}}Cs=new WeakMap,zs=new WeakMap,ui=new WeakMap,fi=new WeakMap,rd=new WeakMap;var Gz=globalThis&&globalThis.__awaiter||function(t,e,r,n){function i(o){return o instanceof r?o:new r(function(a){a(o)})}return new(r||(r=Promise))(function(o,a){function s(d){try{l(n.next(d))}catch(h){a(h)}}function c(d){try{l(n.throw(d))}catch(h){a(h)}}function l(d){d.done?o(d.value):i(d.value).then(s,c)}l((n=n.apply(t,e||[])).next())})};const L2="app",Kz={name:L2,configure:()=>new Wz,initialize:t=>Gz(void 0,void 0,void 0,function*(){const e=yield t.config.createConfig(t),r=yield t.requireInstance("event").catch(()=>{});return new qz({config:e,event:r})}),dispose:t=>{t.instance.dispose()}};var El=globalThis&&globalThis.__awaiter||function(t,e,r,n){function i(o){return o instanceof r?o:new r(function(a){a(o)})}return new(r||(r=Promise))(function(o,a){function s(d){try{l(n.next(d))}catch(h){a(h)}}function c(d){try{l(n.throw(d))}catch(h){a(h)}}function l(d){d.done?o(d.value):i(d.value).then(s,c)}l((n=n.apply(t,e||[])).next())})},Sv=globalThis&&globalThis.__classPrivateFieldGet||function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},nd;class Wz{constructor(){this.defaultExpireTime=1*60*1e3,nd.set(this,[])}addConfigBuilder(e){Sv(this,nd,"f").push(e)}_createHttpClient(e){return El(this,void 0,void 0,function*(){const r=yield e.requireInstance("http");if(r.hasClient(L2))return r.createClient(L2);{const n=yield e.requireInstance("serviceDiscovery");try{return yield n.createClient("app")}catch{return yield n.createClient("portal")}}})}createConfig(e){var r;return El(this,void 0,void 0,function*(){const n=yield Sv(this,nd,"f").reduce((i,o)=>El(this,void 0,void 0,function*(){const a=new Rz(e,yield i);return yield Promise.resolve(o(a)),Object.assign(i,a.config)}),Promise.resolve({}));return(r=n.client)!==null&&r!==void 0||(n.client=yield(()=>El(this,void 0,void 0,function*(){const i=yield this._createHttpClient(e);return{getAppManifest:{client:{fn:({appKey:o})=>i.json$(`/api/apps/${o}`)},key:({appKey:o})=>o,expire:this.defaultExpireTime},getAppManifests:{client:{fn:()=>i.json$("/api/apps")},key:()=>"manifests",expire:this.defaultExpireTime},getAppConfig:{client:{fn:({appKey:o,tag:a})=>i.json$(`/api/apps/${o}/config${a?`?tag=${a}`:""}`)},key:o=>JSON.stringify(o),expire:this.defaultExpireTime}}}))()),n})}}nd=new WeakMap;const Yz=(t,e)=>{t.addConfig({module:Kz,configure:r=>{e&&r.addConfigBuilder(e)}})},Qz=async t=>{t.logger.level=4,t.configureServiceDiscovery({client:{baseUri:import.meta.url,defaultScopes:["5a842df8-3238-415d-b168-9f16a6a6031b/.default"]}}),t.configureMsal({tenantId:"3aa4a235-b6e2-48d5-9195-7fcf05b459b0",clientId:"9b707e3a-3e90-41ed-a47e-652a1e3b53d0",redirectUri:"/authentication/login-callback"},{requiresAuth:!0}),Yz(t),t.onConfigured(()=>{console.log("framework config done")}),t.onInitialized(async e=>{e.auth.defaultClient.setLogger(new u3(0)),console.debug("📒 subscribing to all events"),e.event.subscribe(r=>console.debug(`🔔🌍 [${r.type}]`,r))})};function rt(){return rt=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},rt.apply(this,arguments)}var ht;(function(t){t.Pop="POP",t.Push="PUSH",t.Replace="REPLACE"})(ht||(ht={}));const kv="popstate";function Xz(t){t===void 0&&(t={});function e(n,i){let{pathname:o,search:a,hash:s}=n.location;return wc("",{pathname:o,search:a,hash:s},i.state&&i.state.usr||null,i.state&&i.state.key||"default")}function r(n,i){return typeof i=="string"?i:Vi(i)}return Zz(e,r,null,t)}function fe(t,e){if(t===!1||t===null||typeof t>"u")throw new Error(e)}function Jz(){return Math.random().toString(36).substr(2,8)}function Av(t){return{usr:t.state,key:t.key}}function wc(t,e,r,n){return r===void 0&&(r=null),rt({pathname:typeof t=="string"?t:t.pathname,search:"",hash:""},typeof e=="string"?ii(e):e,{state:r,key:e&&e.key||n||Jz()})}function Vi(t){let{pathname:e="/",search:r="",hash:n=""}=t;return r&&r!=="?"&&(e+=r.charAt(0)==="?"?r:"?"+r),n&&n!=="#"&&(e+=n.charAt(0)==="#"?n:"#"+n),e}function ii(t){let e={};if(t){let r=t.indexOf("#");r>=0&&(e.hash=t.substr(r),t=t.substr(0,r));let n=t.indexOf("?");n>=0&&(e.search=t.substr(n),t=t.substr(0,n)),t&&(e.pathname=t)}return e}function xc(t){let e=typeof window<"u"&&typeof window.location<"u"&&window.location.origin!=="null"?window.location.origin:window.location.href,r=typeof t=="string"?t:Vi(t);return fe(e,"No window.location.(origin|href) available to create URL for href: "+r),new URL(r,e)}function Zz(t,e,r,n){n===void 0&&(n={});let{window:i=document.defaultView,v5Compat:o=!1}=n,a=i.history,s=ht.Pop,c=null;function l(){s=ht.Pop,c&&c({action:s,location:u.location})}function d(f,v){s=ht.Push;let g=wc(u.location,f,v);r&&r(g,f);let x=Av(g),m=u.createHref(g);try{a.pushState(x,"",m)}catch{i.location.assign(m)}o&&c&&c({action:s,location:u.location})}function h(f,v){s=ht.Replace;let g=wc(u.location,f,v);r&&r(g,f);let x=Av(g),m=u.createHref(g);a.replaceState(x,"",m),o&&c&&c({action:s,location:u.location})}let u={get action(){return s},get location(){return t(i,a)},listen(f){if(c)throw new Error("A history only accepts one active listener");return i.addEventListener(kv,l),c=f,()=>{i.removeEventListener(kv,l),c=null}},createHref(f){return e(i,f)},encodeLocation(f){let v=xc(typeof f=="string"?f:Vi(f));return{pathname:v.pathname,search:v.search,hash:v.hash}},push:d,replace:h,go(f){return a.go(f)}};return u}var zt;(function(t){t.data="data",t.deferred="deferred",t.redirect="redirect",t.error="error"})(zt||(zt={}));function eS(t){return t.index===!0}function y6(t,e,r){return e===void 0&&(e=[]),r===void 0&&(r=new Set),t.map((n,i)=>{let o=[...e,i],a=typeof n.id=="string"?n.id:o.join("-");return fe(n.index!==!0||!n.children,"Cannot specify children on an index route"),fe(!r.has(a),'Found a route id collision on id "'+a+`". Route id's must be globally unique within Data Router usages`),r.add(a),eS(n)?rt({},n,{id:a}):rt({},n,{id:a,children:n.children?y6(n.children,o,r):void 0})})}function Ss(t,e,r){r===void 0&&(r="/");let n=typeof e=="string"?ii(e):e,i=b6(n.pathname||"/",r);if(i==null)return null;let o=_6(t);tS(o);let a=null;for(let s=0;a==null&&s<o.length;++s)a=dS(o[s],fS(i));return a}function _6(t,e,r,n){return e===void 0&&(e=[]),r===void 0&&(r=[]),n===void 0&&(n=""),t.forEach((i,o)=>{let a={relativePath:i.path||"",caseSensitive:i.caseSensitive===!0,childrenIndex:o,route:i};a.relativePath.startsWith("/")&&(fe(a.relativePath.startsWith(n),'Absolute route path "'+a.relativePath+'" nested under path '+('"'+n+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),a.relativePath=a.relativePath.slice(n.length));let s=_o([n,a.relativePath]),c=r.concat(a);i.children&&i.children.length>0&&(fe(i.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+s+'".')),_6(i.children,e,c,s)),!(i.path==null&&!i.index)&&e.push({path:s,score:cS(s,i.index),routesMeta:c})}),e}function tS(t){t.sort((e,r)=>e.score!==r.score?r.score-e.score:lS(e.routesMeta.map(n=>n.childrenIndex),r.routesMeta.map(n=>n.childrenIndex)))}const rS=/^:\w+$/,nS=3,iS=2,oS=1,aS=10,sS=-2,Tv=t=>t==="*";function cS(t,e){let r=t.split("/"),n=r.length;return r.some(Tv)&&(n+=sS),e&&(n+=iS),r.filter(i=>!Tv(i)).reduce((i,o)=>i+(rS.test(o)?nS:o===""?oS:aS),n)}function lS(t,e){return t.length===e.length&&t.slice(0,-1).every((n,i)=>n===e[i])?t[t.length-1]-e[e.length-1]:0}function dS(t,e){let{routesMeta:r}=t,n={},i="/",o=[];for(let a=0;a<r.length;++a){let s=r[a],c=a===r.length-1,l=i==="/"?e:e.slice(i.length)||"/",d=hS({path:s.relativePath,caseSensitive:s.caseSensitive,end:c},l);if(!d)return null;Object.assign(n,d.params);let h=s.route;o.push({params:n,pathname:_o([i,d.pathname]),pathnameBase:yS(_o([i,d.pathnameBase])),route:h}),d.pathnameBase!=="/"&&(i=_o([i,d.pathnameBase]))}return o}function hS(t,e){typeof t=="string"&&(t={path:t,caseSensitive:!1,end:!0});let[r,n]=uS(t.path,t.caseSensitive,t.end),i=e.match(r);if(!i)return null;let o=i[0],a=o.replace(/(.)\/+$/,"$1"),s=i.slice(1);return{params:n.reduce((l,d,h)=>{if(d==="*"){let u=s[h]||"";a=o.slice(0,o.length-u.length).replace(/(.)\/+$/,"$1")}return l[d]=pS(s[h]||"",d),l},{}),pathname:o,pathnameBase:a,pattern:t}}function uS(t,e,r){e===void 0&&(e=!1),r===void 0&&(r=!0),E0(t==="*"||!t.endsWith("*")||t.endsWith("/*"),'Route path "'+t+'" will be treated as if it were '+('"'+t.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+t.replace(/\*$/,"/*")+'".'));let n=[],i="^"+t.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^$?{}|()[\]]/g,"\\$&").replace(/:(\w+)/g,(a,s)=>(n.push(s),"([^\\/]+)"));return t.endsWith("*")?(n.push("*"),i+=t==="*"||t==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):r?i+="\\/*$":t!==""&&t!=="/"&&(i+="(?:(?=\\/|$))"),[new RegExp(i,e?void 0:"i"),n]}function fS(t){try{return decodeURI(t)}catch(e){return E0(!1,'The URL path "'+t+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+e+").")),t}}function pS(t,e){try{return decodeURIComponent(t)}catch(r){return E0(!1,'The value for the URL param "'+e+'" will not be decoded because'+(' the string "'+t+'" is a malformed URL segment. This is probably')+(" due to a bad percent encoding ("+r+").")),t}}function b6(t,e){if(e==="/")return t;if(!t.toLowerCase().startsWith(e.toLowerCase()))return null;let r=e.endsWith("/")?e.length-1:e.length,n=t.charAt(r);return n&&n!=="/"?null:t.slice(r)||"/"}function E0(t,e){if(!t){typeof console<"u"&&console.warn(e);try{throw new Error(e)}catch{}}}function mS(t,e){e===void 0&&(e="/");let{pathname:r,search:n="",hash:i=""}=typeof t=="string"?ii(t):t;return{pathname:r?r.startsWith("/")?r:vS(r,e):e,search:_S(n),hash:bS(i)}}function vS(t,e){let r=e.replace(/\/+$/,"").split("/");return t.split("/").forEach(i=>{i===".."?r.length>1&&r.pop():i!=="."&&r.push(i)}),r.length>1?r.join("/"):"/"}function Wh(t,e,r,n){return"Cannot include a '"+t+"' character in a manually specified "+("`to."+e+"` field ["+JSON.stringify(n)+"]. Please separate it out to the ")+("`to."+r+"` field. Alternatively you may provide the full path as ")+'a string in <Link to="..."> and the router will parse it for you.'}function w6(t){return t.filter((e,r)=>r===0||e.route.path&&e.route.path.length>0)}function gS(t,e,r,n){n===void 0&&(n=!1);let i;typeof t=="string"?i=ii(t):(i=rt({},t),fe(!i.pathname||!i.pathname.includes("?"),Wh("?","pathname","search",i)),fe(!i.pathname||!i.pathname.includes("#"),Wh("#","pathname","hash",i)),fe(!i.search||!i.search.includes("#"),Wh("#","search","hash",i)));let o=t===""||i.pathname==="",a=o?"/":i.pathname,s;if(n||a==null)s=r;else{let h=e.length-1;if(a.startsWith("..")){let u=a.split("/");for(;u[0]==="..";)u.shift(),h-=1;i.pathname=u.join("/")}s=h>=0?e[h]:"/"}let c=mS(i,s),l=a&&a!=="/"&&a.endsWith("/"),d=(o||a===".")&&r.endsWith("/");return!c.pathname.endsWith("/")&&(l||d)&&(c.pathname+="/"),c}const _o=t=>t.join("/").replace(/\/\/+/g,"/"),yS=t=>t.replace(/\/+$/,"").replace(/^\/*/,"/"),_S=t=>!t||t==="?"?"":t.startsWith("?")?t:"?"+t,bS=t=>!t||t==="#"?"":t.startsWith("#")?t:"#"+t;class Iv extends Error{}class wS{constructor(e){this.pendingKeys=new Set,this.subscriber=void 0,fe(e&&typeof e=="object"&&!Array.isArray(e),"defer() only accepts plain objects");let r;this.abortPromise=new Promise((i,o)=>r=o),this.controller=new AbortController;let n=()=>r(new Iv("Deferred data aborted"));this.unlistenAbortSignal=()=>this.controller.signal.removeEventListener("abort",n),this.controller.signal.addEventListener("abort",n),this.data=Object.entries(e).reduce((i,o)=>{let[a,s]=o;return Object.assign(i,{[a]:this.trackPromise(a,s)})},{})}trackPromise(e,r){if(!(r instanceof Promise))return r;this.pendingKeys.add(e);let n=Promise.race([r,this.abortPromise]).then(i=>this.onSettle(n,e,null,i),i=>this.onSettle(n,e,i));return n.catch(()=>{}),Object.defineProperty(n,"_tracked",{get:()=>!0}),n}onSettle(e,r,n,i){if(this.controller.signal.aborted&&n instanceof Iv)return this.unlistenAbortSignal(),Object.defineProperty(e,"_error",{get:()=>n}),Promise.reject(n);this.pendingKeys.delete(r),this.done&&this.unlistenAbortSignal();const o=this.subscriber;return n?(Object.defineProperty(e,"_error",{get:()=>n}),o&&o(!1),Promise.reject(n)):(Object.defineProperty(e,"_data",{get:()=>i}),o&&o(!1),i)}subscribe(e){this.subscriber=e}cancel(){this.controller.abort(),this.pendingKeys.forEach((r,n)=>this.pendingKeys.delete(n));let e=this.subscriber;e&&e(!0)}async resolveData(e){let r=!1;if(!this.done){let n=()=>this.cancel();e.addEventListener("abort",n),r=await new Promise(i=>{this.subscribe(o=>{e.removeEventListener("abort",n),(o||this.done)&&i(o)})})}return r}get done(){return this.pendingKeys.size===0}get unwrappedData(){return fe(this.data!==null&&this.done,"Can only unwrap data on initialized and settled deferreds"),Object.entries(this.data).reduce((e,r)=>{let[n,i]=r;return Object.assign(e,{[n]:ES(i)})},{})}}function xS(t){return t instanceof Promise&&t._tracked===!0}function ES(t){if(!xS(t))return t;if(t._error)throw t._error;return t._data}class H1{constructor(e,r,n,i){i===void 0&&(i=!1),this.status=e,this.statusText=r||"",this.internal=i,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}}function x6(t){return t instanceof H1}const E6=["post","put","patch","delete"],CS=new Set(E6),zS=["get",...E6],SS=new Set(zS),kS=new Set([301,302,303,307,308]),AS=new Set([307,308]),Yh={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0},TS={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0},IS=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",MS=!IS;function PS(t){fe(t.routes.length>0,"You must provide a non-empty routes array to createRouter");let e=y6(t.routes),r=null,n=new Set,i=null,o=null,a=null,s=!1,c=Ss(e,t.history.location,t.basename),l=null;if(c==null){let z=oo(404,{pathname:t.history.location.pathname}),{matches:I,route:F}=Lv(e);c=I,l={[F.id]:z}}let d=!c.some(z=>z.route.loader)||t.hydrationData!=null,h,u={historyAction:t.history.action,location:t.history.location,matches:c,initialized:d,navigation:Yh,restoreScrollPosition:null,preventScrollReset:!1,revalidation:"idle",loaderData:t.hydrationData&&t.hydrationData.loaderData||{},actionData:t.hydrationData&&t.hydrationData.actionData||null,errors:t.hydrationData&&t.hydrationData.errors||l,fetchers:new Map},f=ht.Pop,v=!1,g,x=!1,m=!1,p=[],y=[],w=new Map,A=0,O=-1,U=new Map,N=new Set,xe=new Map,Y=new Map;function Xt(){return r=t.history.listen(z=>{let{action:I,location:F}=z;return $(I,F)}),u.initialized||$(ht.Pop,u.location),h}function qi(){r&&r(),n.clear(),g&&g.abort(),u.fetchers.forEach((z,I)=>j1(I))}function Gi(z){return n.add(z),()=>n.delete(z)}function Lt(z){u=rt({},u,z),n.forEach(I=>I(u))}function Ki(z,I){var F;let X=u.actionData!=null&&u.navigation.formMethod!=null&&u.navigation.state==="loading"&&((F=u.navigation.formAction)==null?void 0:F.split("?")[0])===z.pathname,te=I.loaderData?{loaderData:Qh(u.loaderData,I.loaderData,I.matches||[])}:{};Lt(rt({},X?{}:{actionData:null},I,te,{historyAction:f,location:z,initialized:!0,navigation:Yh,revalidation:"idle",restoreScrollPosition:u.navigation.formData?!1:P0(z,I.matches||u.matches),preventScrollReset:v})),x||f===ht.Pop||(f===ht.Push?t.history.push(z,z.state):f===ht.Replace&&t.history.replace(z,z.state)),f=ht.Pop,v=!1,x=!1,m=!1,p=[],y=[]}async function Ka(z,I){if(typeof z=="number"){t.history.go(z);return}let{path:F,submission:X,error:te}=Mv(z,I),he=wc(u.location,F,I&&I.state);he=rt({},he,t.history.encodeLocation(he));let ge=(I&&I.replace)===!0||X!=null?ht.Replace:ht.Push,Ee=I&&"preventScrollReset"in I?I.preventScrollReset===!0:void 0;return await $(ge,he,{submission:X,pendingError:te,preventScrollReset:Ee,replace:I&&I.replace})}function Wa(){if(oi(),Lt({revalidation:"loading"}),u.navigation.state!=="submitting"){if(u.navigation.state==="idle"){$(u.historyAction,u.location,{startUninterruptedRevalidation:!0});return}$(f||u.historyAction,u.navigation.location,{overrideNavigation:u.navigation})}}async function $(z,I,F){g&&g.abort(),g=null,f=z,x=(F&&F.startUninterruptedRevalidation)===!0,K6(u.location,u.matches),v=(F&&F.preventScrollReset)===!0;let X=F&&F.overrideNavigation,te=Ss(e,I,t.basename);if(!te){let cr=oo(404,{pathname:I.pathname}),{matches:Po,route:Pn}=Lv(e);B1(),Ki(I,{matches:Po,loaderData:{},errors:{[Pn.id]:cr}});return}if(DS(u.location,I)){Ki(I,{matches:te});return}g=new AbortController;let he=cs(I,g.signal,F&&F.submission),ge,Ee;if(F&&F.pendingError)Ee={[pa(te).route.id]:F.pendingError};else if(F&&F.submission){let cr=await ie(he,I,F.submission,te,{replace:F.replace});if(cr.shortCircuited)return;ge=cr.pendingActionData,Ee=cr.pendingActionError,X=rt({state:"loading",location:I},F.submission),he=new Request(he.url,{signal:he.signal})}let{shortCircuited:Ie,loaderData:Ce,errors:Oe}=await ce(he,I,te,X,F&&F.submission,F&&F.replace,ge,Ee);Ie||(g=null,Ki(I,{matches:te,loaderData:Ce,errors:Oe}))}async function ie(z,I,F,X,te){oi();let he=rt({state:"submitting",location:I},F);Lt({navigation:he});let ge,Ee=Vv(X,I);if(!Ee.route.action)ge={type:zt.error,error:oo(405,{method:z.method,pathname:I.pathname,routeId:Ee.route.id})};else if(ge=await ss("action",z,Ee,X,h.basename),z.signal.aborted)return{shortCircuited:!0};if(Ca(ge))return await Mn(u,ge,te&&te.replace===!0),{shortCircuited:!0};if(Bs(ge)){let Ie=pa(X,Ee.route.id);return(te&&te.replace)!==!0&&(f=ht.Push),{pendingActionError:{[Ie.route.id]:ge.error}}}if(ho(ge))throw new Error("defer() is not supported in actions");return{pendingActionData:{[Ee.route.id]:ge.data}}}async function ce(z,I,F,X,te,he,ge,Ee){let Ie=X;Ie||(Ie={state:"loading",location:I,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0});let[Ce,Oe]=Pv(u,F,te,I,m,p,y,ge,Ee,xe);if(B1(lr=>!(F&&F.some(dr=>dr.route.id===lr))||Ce&&Ce.some(dr=>dr.route.id===lr)),Ce.length===0&&Oe.length===0)return Ki(I,{matches:F,loaderData:Qh(u.loaderData,{},F),errors:Ee||null,actionData:ge||null}),{shortCircuited:!0};x||(Oe.forEach(lr=>{let[dr]=lr,Lo=u.fetchers.get(dr),Kc={state:"loading",data:Lo&&Lo.data,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0};u.fetchers.set(dr,Kc)}),Lt(rt({navigation:Ie,actionData:ge||u.actionData||null},Oe.length>0?{fetchers:new Map(u.fetchers)}:{}))),O=++A,Oe.forEach(lr=>{let[dr]=lr;return w.set(dr,g)});let{results:cr,loaderResults:Po,fetcherResults:Pn}=await fn(u.matches,F,Ce,Oe,z);if(z.signal.aborted)return{shortCircuited:!0};Oe.forEach(lr=>{let[dr]=lr;return w.delete(dr)});let Ro=Ov(cr);if(Ro)return await Mn(u,Ro,he),{shortCircuited:!0};let{loaderData:q1,errors:Gc}=Hv(u,F,Ce,Po,Ee,Oe,Pn,Y);Y.forEach((lr,dr)=>{lr.subscribe(Lo=>{(Lo||lr.done)&&Y.delete(dr)})}),q6();let Ho=M0(O);return rt({loaderData:q1,errors:Gc},Ho||Oe.length>0?{fetchers:new Map(u.fetchers)}:{})}function $e(z){return u.fetchers.get(z)||TS}function it(z,I,F,X){if(MS)throw new Error("router.fetch() was called during the server render, but it shouldn't be. You are likely calling a useFetcher() method in the body of your component. Try moving it to a useEffect or a callback.");w.has(z)&&qc(z);let te=Ss(e,F,t.basename);if(!te){$1(z,I,oo(404,{pathname:F}));return}let{path:he,submission:ge}=Mv(F,X,!0),Ee=Vv(te,he);if(ge){Mo(z,I,he,Ee,te,ge);return}xe.set(z,[he,Ee,te]),In(z,I,he,Ee,te)}async function Mo(z,I,F,X,te,he){if(oi(),xe.delete(z),!X.route.action){let Rn=oo(405,{method:he.formMethod,pathname:F,routeId:I});$1(z,I,Rn);return}let ge=u.fetchers.get(z),Ee=rt({state:"submitting"},he,{data:ge&&ge.data});u.fetchers.set(z,Ee),Lt({fetchers:new Map(u.fetchers)});let Ie=new AbortController,Ce=cs(F,Ie.signal,he);w.set(z,Ie);let Oe=await ss("action",Ce,X,te,h.basename);if(Ce.signal.aborted){w.get(z)===Ie&&w.delete(z);return}if(Ca(Oe)){w.delete(z),N.add(z);let Rn=rt({state:"loading"},he,{data:void 0});return u.fetchers.set(z,Rn),Lt({fetchers:new Map(u.fetchers)}),Mn(u,Oe)}if(Bs(Oe)){$1(z,I,Oe.error);return}ho(Oe)&&fe(!1,"defer() is not supported in actions");let cr=u.navigation.location||u.location,Po=cs(cr,Ie.signal),Pn=u.navigation.state!=="idle"?Ss(e,u.navigation.location,t.basename):u.matches;fe(Pn,"Didn't find any matches after fetcher action");let Ro=++A;U.set(z,Ro);let q1=rt({state:"loading",data:Oe.data},he);u.fetchers.set(z,q1);let[Gc,Ho]=Pv(u,Pn,he,cr,m,p,y,{[X.route.id]:Oe.data},void 0,xe);Ho.filter(Rn=>{let[Wi]=Rn;return Wi!==z}).forEach(Rn=>{let[Wi]=Rn,L0=u.fetchers.get(Wi),Q6={state:"loading",data:L0&&L0.data,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0};u.fetchers.set(Wi,Q6),w.set(Wi,Ie)}),Lt({fetchers:new Map(u.fetchers)});let{results:lr,loaderResults:dr,fetcherResults:Lo}=await fn(u.matches,Pn,Gc,Ho,Po);if(Ie.signal.aborted)return;U.delete(z),w.delete(z),Ho.forEach(Rn=>{let[Wi]=Rn;return w.delete(Wi)});let Kc=Ov(lr);if(Kc)return Mn(u,Kc);let{loaderData:R0,errors:H0}=Hv(u,u.matches,Gc,dr,void 0,Ho,Lo,Y),W6={state:"idle",data:Oe.data,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0};u.fetchers.set(z,W6);let Y6=M0(Ro);u.navigation.state==="loading"&&Ro>O?(fe(f,"Expected pending action"),g&&g.abort(),Ki(u.navigation.location,{matches:Pn,loaderData:R0,errors:H0,fetchers:new Map(u.fetchers)})):(Lt(rt({errors:H0,loaderData:Qh(u.loaderData,R0,Pn)},Y6?{fetchers:new Map(u.fetchers)}:{})),m=!1)}async function In(z,I,F,X,te){let he=u.fetchers.get(z),ge={state:"loading",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,data:he&&he.data};u.fetchers.set(z,ge),Lt({fetchers:new Map(u.fetchers)});let Ee=new AbortController,Ie=cs(F,Ee.signal);w.set(z,Ee);let Ce=await ss("loader",Ie,X,te,h.basename);if(ho(Ce)&&(Ce=await A6(Ce,Ie.signal,!0)||Ce),w.get(z)===Ee&&w.delete(z),Ie.signal.aborted)return;if(Ca(Ce)){await Mn(u,Ce);return}if(Bs(Ce)){let cr=pa(u.matches,I);u.fetchers.delete(z),Lt({fetchers:new Map(u.fetchers),errors:{[cr.route.id]:Ce.error}});return}fe(!ho(Ce),"Unhandled fetcher deferred data");let Oe={state:"idle",data:Ce.data,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0};u.fetchers.set(z,Oe),Lt({fetchers:new Map(u.fetchers)})}async function Mn(z,I,F){var X;I.revalidate&&(m=!0);let te=wc(z.location,I.location);if(fe(te,"Expected a location on the redirect navigation"),typeof((X=window)==null?void 0:X.location)<"u"){let Oe=xc(I.location).origin;if(window.location.origin!==Oe){F?window.location.replace(I.location):window.location.assign(I.location);return}}g=null;let he=F===!0?ht.Replace:ht.Push,{formMethod:ge,formAction:Ee,formEncType:Ie,formData:Ce}=z.navigation;AS.has(I.status)&&ge&&k6(ge)&&Ie&&Ce?await $(he,te,{submission:{formMethod:ge,formAction:I.location,formEncType:Ie,formData:Ce}}):await $(he,te,{overrideNavigation:{state:"loading",location:te,formMethod:ge||void 0,formAction:Ee||void 0,formEncType:Ie||void 0,formData:Ce||void 0}})}async function fn(z,I,F,X,te){let he=await Promise.all([...F.map(Ie=>ss("loader",te,Ie,I,h.basename)),...X.map(Ie=>{let[,Ce,Oe,cr]=Ie;return ss("loader",cs(Ce,te.signal),Oe,cr,h.basename)})]),ge=he.slice(0,F.length),Ee=he.slice(F.length);return await Promise.all([Dv(z,F,ge,te.signal,!1,u.loaderData),Dv(z,X.map(Ie=>{let[,,Ce]=Ie;return Ce}),Ee,te.signal,!0)]),{results:he,loaderResults:ge,fetcherResults:Ee}}function oi(){m=!0,p.push(...B1()),xe.forEach((z,I)=>{w.has(I)&&(y.push(I),qc(I))})}function $1(z,I,F){let X=pa(u.matches,I);j1(z),Lt({errors:{[X.route.id]:F},fetchers:new Map(u.fetchers)})}function j1(z){w.has(z)&&qc(z),xe.delete(z),U.delete(z),N.delete(z),u.fetchers.delete(z)}function qc(z){let I=w.get(z);fe(I,"Expected fetch controller: "+z),I.abort(),w.delete(z)}function I0(z){for(let I of z){let X={state:"idle",data:$e(I).data,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0};u.fetchers.set(I,X)}}function q6(){let z=[];for(let I of N){let F=u.fetchers.get(I);fe(F,"Expected fetcher: "+I),F.state==="loading"&&(N.delete(I),z.push(I))}I0(z)}function M0(z){let I=[];for(let[F,X]of U)if(X<z){let te=u.fetchers.get(F);fe(te,"Expected fetcher: "+F),te.state==="loading"&&(qc(F),U.delete(F),I.push(F))}return I0(I),I.length>0}function B1(z){let I=[];return Y.forEach((F,X)=>{(!z||z(X))&&(F.cancel(),I.push(X),Y.delete(X))}),I}function G6(z,I,F){if(i=z,a=I,o=F||(X=>X.key),!s&&u.navigation===Yh){s=!0;let X=P0(u.location,u.matches);X!=null&&Lt({restoreScrollPosition:X})}return()=>{i=null,a=null,o=null}}function K6(z,I){if(i&&o&&a){let F=I.map(te=>Nv(te,u.loaderData)),X=o(z,F)||z.key;i[X]=a()}}function P0(z,I){if(i&&o&&a){let F=I.map(he=>Nv(he,u.loaderData)),X=o(z,F)||z.key,te=i[X];if(typeof te=="number")return te}return null}return h={get basename(){return t.basename},get state(){return u},get routes(){return e},initialize:Xt,subscribe:Gi,enableScrollRestoration:G6,navigate:Ka,fetch:it,revalidate:Wa,createHref:z=>t.history.createHref(z),encodeLocation:z=>t.history.encodeLocation(z),getFetcher:$e,deleteFetcher:j1,dispose:qi,_internalFetchControllers:w,_internalActiveDeferreds:Y},h}function RS(t){return t!=null&&"formData"in t}function Mv(t,e,r){r===void 0&&(r=!1);let n=typeof t=="string"?t:Vi(t);if(!e||!RS(e))return{path:n};if(e.formMethod&&!VS(e.formMethod))return{path:n,error:oo(405,{method:e.formMethod})};if(e.formMethod&&k6(e.formMethod))return{path:n,submission:{formMethod:e.formMethod,formAction:S6(n),formEncType:e&&e.formEncType||"application/x-www-form-urlencoded",formData:e.formData}};let i=ii(n);try{let o=z6(e.formData);r&&i.search&&T6(i.search)&&o.append("index",""),i.search="?"+o}catch{return{path:n,error:oo(400)}}return{path:Vi(i)}}function HS(t,e){let r=t;if(e){let n=t.findIndex(i=>i.route.id===e);n>=0&&(r=t.slice(0,n))}return r}function Pv(t,e,r,n,i,o,a,s,c,l){let d=c?Object.values(c)[0]:s?Object.values(s)[0]:null,h=c?Object.keys(c)[0]:void 0,f=HS(e,h).filter((g,x)=>g.route.loader!=null&&(LS(t.loaderData,t.matches[x],g)||o.some(m=>m===g.route.id)||Rv(t.location,t.matches[x],r,n,g,i,d))),v=[];return l&&l.forEach((g,x)=>{let[m,p,y]=g;a.includes(x)?v.push([x,m,p,y]):i&&Rv(m,p,r,m,p,i,d)&&v.push([x,m,p,y])}),[f,v]}function LS(t,e,r){let n=!e||r.route.id!==e.route.id,i=t[r.route.id]===void 0;return n||i}function C6(t,e){let r=t.route.path;return t.pathname!==e.pathname||r&&r.endsWith("*")&&t.params["*"]!==e.params["*"]}function Rv(t,e,r,n,i,o,a){let s=xc(t),c=e.params,l=xc(n),d=i.params,h=C6(e,i)||s.toString()===l.toString()||s.search!==l.search||o;if(i.route.shouldRevalidate){let u=i.route.shouldRevalidate(rt({currentUrl:s,currentParams:c,nextUrl:l,nextParams:d},r,{actionResult:a,defaultShouldRevalidate:h}));if(typeof u=="boolean")return u}return h}async function ss(t,e,r,n,i,o,a,s){i===void 0&&(i="/"),o===void 0&&(o=!1),a===void 0&&(a=!1);let c,l,d,h=new Promise((f,v)=>d=v),u=()=>d();e.signal.addEventListener("abort",u);try{let f=r.route[t];fe(f,"Could not find the "+t+' to run on the "'+r.route.id+'" route'),l=await Promise.race([f({request:e,params:r.params,context:s}),h]),fe(l!==void 0,"You defined "+(t==="action"?"an action":"a loader")+" for route "+('"'+r.route.id+"\" but didn't return anything from your `"+t+"` ")+"function. Please return a value or `null`.")}catch(f){c=zt.error,l=f}finally{e.signal.removeEventListener("abort",u)}if(NS(l)){let f=l.status;if(kS.has(f)){let x=l.headers.get("Location");if(fe(x,"Redirects returned/thrown from loaders/actions must have a Location header"),!(/^[a-z+]+:\/\//i.test(x)||x.startsWith("//"))){let p=n.slice(0,n.indexOf(r)+1),y=w6(p).map(A=>A.pathnameBase),w=gS(x,y,new URL(e.url).pathname);if(fe(Vi(w),"Unable to resolve redirect location: "+x),i){let A=w.pathname;w.pathname=A==="/"?i:_o([i,A])}x=Vi(w)}if(o)throw l.headers.set("Location",x),l;return{type:zt.redirect,status:f,location:x,revalidate:l.headers.get("X-Remix-Revalidate")!==null}}if(a)throw{type:c||zt.data,response:l};let v,g=l.headers.get("Content-Type");return g&&g.startsWith("application/json")?v=await l.json():v=await l.text(),c===zt.error?{type:c,error:new H1(f,l.statusText,v),headers:l.headers}:{type:zt.data,data:v,statusCode:l.status,headers:l.headers}}return c===zt.error?{type:c,error:l}:l instanceof wS?{type:zt.deferred,deferredData:l}:{type:zt.data,data:l}}function cs(t,e,r){let n=xc(S6(t)).toString(),i={signal:e};if(r){let{formMethod:o,formEncType:a,formData:s}=r;i.method=o.toUpperCase(),i.body=a==="application/x-www-form-urlencoded"?z6(s):s}return new Request(n,i)}function z6(t){let e=new URLSearchParams;for(let[r,n]of t.entries())fe(typeof n=="string",'File inputs are not supported with encType "application/x-www-form-urlencoded", please use "multipart/form-data" instead.'),e.append(r,n);return e}function OS(t,e,r,n,i){let o={},a=null,s,c=!1,l={};return r.forEach((d,h)=>{let u=e[h].route.id;if(fe(!Ca(d),"Cannot handle redirect results in processLoaderData"),Bs(d)){let f=pa(t,u),v=d.error;n&&(v=Object.values(n)[0],n=void 0),a=Object.assign(a||{},{[f.route.id]:v}),c||(c=!0,s=x6(d.error)?d.error.status:500),d.headers&&(l[u]=d.headers)}else ho(d)?(i&&i.set(u,d.deferredData),o[u]=d.deferredData.data):(o[u]=d.data,d.statusCode!=null&&d.statusCode!==200&&!c&&(s=d.statusCode),d.headers&&(l[u]=d.headers))}),n&&(a=n),{loaderData:o,errors:a,statusCode:s||200,loaderHeaders:l}}function Hv(t,e,r,n,i,o,a,s){let{loaderData:c,errors:l}=OS(e,r,n,i,s);for(let d=0;d<o.length;d++){let[h,,u]=o[d];fe(a!==void 0&&a[d]!==void 0,"Did not find corresponding fetcher result");let f=a[d];if(Bs(f)){let v=pa(t.matches,u.route.id);l&&l[v.route.id]||(l=rt({},l,{[v.route.id]:f.error})),t.fetchers.delete(h)}else{if(Ca(f))throw new Error("Unhandled fetcher revalidation redirect");if(ho(f))throw new Error("Unhandled fetcher deferred data");{let v={state:"idle",data:f.data,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0};t.fetchers.set(h,v)}}}return{loaderData:c,errors:l}}function Qh(t,e,r){let n=rt({},e);return r.forEach(i=>{let o=i.route.id;e[o]===void 0&&t[o]!==void 0&&(n[o]=t[o])}),n}function pa(t,e){return(e?t.slice(0,t.findIndex(n=>n.route.id===e)+1):[...t]).reverse().find(n=>n.route.hasErrorBoundary===!0)||t[0]}function Lv(t){let e=t.find(r=>r.index||!r.path||r.path==="/")||{id:"__shim-error-route__"};return{matches:[{params:{},pathname:"",pathnameBase:"",route:e}],route:e}}function oo(t,e){let{pathname:r,routeId:n,method:i}=e===void 0?{}:e,o="Unknown Server Error",a="Unknown @remix-run/router error";return t===400?(o="Bad Request",i&&r&&n?a="You made a "+i+' request to "'+r+'" but '+('did not provide a `loader` for route "'+n+'", ')+"so there is no way to handle the request.":a="Cannot submit binary form data using GET"):t===403?(o="Forbidden",a='Route "'+n+'" does not match URL "'+r+'"'):t===404?(o="Not Found",a='No route matches URL "'+r+'"'):t===405&&(o="Method Not Allowed",i&&r&&n?a="You made a "+i.toUpperCase()+' request to "'+r+'" but '+('did not provide an `action` for route "'+n+'", ')+"so there is no way to handle the request.":i&&(a='Invalid request method "'+i.toUpperCase()+'"')),new H1(t||500,o,new Error(a),!0)}function Ov(t){for(let e=t.length-1;e>=0;e--){let r=t[e];if(Ca(r))return r}}function S6(t){let e=typeof t=="string"?ii(t):t;return Vi(rt({},e,{hash:""}))}function DS(t,e){return t.pathname===e.pathname&&t.search===e.search&&t.hash!==e.hash}function ho(t){return t.type===zt.deferred}function Bs(t){return t.type===zt.error}function Ca(t){return(t&&t.type)===zt.redirect}function NS(t){return t!=null&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.headers=="object"&&typeof t.body<"u"}function VS(t){return SS.has(t)}function k6(t){return CS.has(t)}async function Dv(t,e,r,n,i,o){for(let a=0;a<r.length;a++){let s=r[a],c=e[a],l=t.find(h=>h.route.id===c.route.id),d=l!=null&&!C6(l,c)&&(o&&o[c.route.id])!==void 0;ho(s)&&(i||d)&&await A6(s,n,i).then(h=>{h&&(r[a]=h||r[a])})}}async function A6(t,e,r){if(r===void 0&&(r=!1),!await t.deferredData.resolveData(e)){if(r)try{return{type:zt.data,data:t.deferredData.unwrappedData}}catch(i){return{type:zt.error,error:i}}return{type:zt.data,data:t.deferredData.data}}}function T6(t){return new URLSearchParams(t).getAll("index").some(e=>e==="")}function Nv(t,e){let{route:r,pathname:n,params:i}=t;return{id:r.id,pathname:n,params:i,data:e[r.id],handle:r.handle}}function Vv(t,e){let r=typeof e=="string"?ii(e).search:e.search;if(t[t.length-1].route.index&&T6(r||""))return t[t.length-1];let n=w6(t);return n[n.length-1]}function i1(){return i1=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},i1.apply(this,arguments)}function FS(t,e){return t===e&&(t!==0||1/t===1/e)||t!==t&&e!==e}const US=typeof Object.is=="function"?Object.is:FS,{useState:$S,useEffect:jS,useLayoutEffect:BS,useDebugValue:qS}=ru;function GS(t,e,r){const n=e(),[{inst:i},o]=$S({inst:{value:n,getSnapshot:e}});return BS(()=>{i.value=n,i.getSnapshot=e,Xh(i)&&o({inst:i})},[t,n,e]),jS(()=>(Xh(i)&&o({inst:i}),t(()=>{Xh(i)&&o({inst:i})})),[t]),qS(n),n}function Xh(t){const e=t.getSnapshot,r=t.value;try{const n=e();return!US(r,n)}catch{return!0}}function KS(t,e,r){return e()}const WS=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",YS=!WS,QS=YS?KS:GS,XS="useSyncExternalStore"in ru?(t=>t.useSyncExternalStore)(ru):QS,JS=T.createContext(null),I6=T.createContext(null),C0=T.createContext(null),M6=T.createContext(null),L1=T.createContext(null),Oc=T.createContext({outlet:null,matches:[]}),P6=T.createContext(null);function z0(){return T.useContext(L1)!=null}function ZS(){return z0()||fe(!1),T.useContext(L1).location}const ek=T.createContext(null);function tk(t){let e=T.useContext(Oc).outlet;return e&&T.createElement(ek.Provider,{value:t},e)}function rk(){let{matches:t}=T.useContext(Oc),e=t[t.length-1];return e?e.params:{}}function nk(t,e){z0()||fe(!1);let{navigator:r}=T.useContext(M6),n=T.useContext(C0),{matches:i}=T.useContext(Oc),o=i[i.length-1],a=o?o.params:{};o&&o.pathname;let s=o?o.pathnameBase:"/";o&&o.route;let c=ZS(),l;if(e){var d;let g=typeof e=="string"?ii(e):e;s==="/"||((d=g.pathname)==null?void 0:d.startsWith(s))||fe(!1),l=g}else l=c;let h=l.pathname||"/",u=s==="/"?h:h.slice(s.length)||"/",f=Ss(t,{pathname:u}),v=sk(f&&f.map(g=>Object.assign({},g,{params:Object.assign({},a,g.params),pathname:_o([s,r.encodeLocation?r.encodeLocation(g.pathname).pathname:g.pathname]),pathnameBase:g.pathnameBase==="/"?s:_o([s,r.encodeLocation?r.encodeLocation(g.pathnameBase).pathname:g.pathnameBase])})),i,n||void 0);return e&&v?T.createElement(L1.Provider,{value:{location:i1({pathname:"/",search:"",hash:"",state:null,key:"default"},l),navigationType:ht.Pop}},v):v}function ik(){let t=lk(),e=x6(t)?t.status+" "+t.statusText:t instanceof Error?t.message:JSON.stringify(t),r=t instanceof Error?t.stack:null,n="rgba(200,200,200, 0.5)",i={padding:"0.5rem",backgroundColor:n},o={padding:"2px 4px",backgroundColor:n};return T.createElement(T.Fragment,null,T.createElement("h2",null,"Unhandled Thrown Error!"),T.createElement("h3",{style:{fontStyle:"italic"}},e),r?T.createElement("pre",{style:i},r):null,T.createElement("p",null,"💿 Hey developer 👋"),T.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",T.createElement("code",{style:o},"errorElement")," props on ",T.createElement("code",{style:o},"<Route>")))}class ok extends T.Component{constructor(e){super(e),this.state={location:e.location,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,r){return r.location!==e.location?{error:e.error,location:e.location}:{error:e.error||r.error,location:r.location}}componentDidCatch(e,r){console.error("React Router caught the following error during render",e,r)}render(){return this.state.error?T.createElement(P6.Provider,{value:this.state.error,children:this.props.component}):this.props.children}}function ak(t){let{routeContext:e,match:r,children:n}=t,i=T.useContext(JS);return i&&r.route.errorElement&&(i._deepestRenderedBoundaryId=r.route.id),T.createElement(Oc.Provider,{value:e},n)}function sk(t,e,r){if(e===void 0&&(e=[]),t==null)if(r!=null&&r.errors)t=r.matches;else return null;let n=t,i=r==null?void 0:r.errors;if(i!=null){let o=n.findIndex(a=>a.route.id&&(i==null?void 0:i[a.route.id]));o>=0||fe(!1),n=n.slice(0,Math.min(n.length,o+1))}return n.reduceRight((o,a,s)=>{let c=a.route.id?i==null?void 0:i[a.route.id]:null,l=r?a.route.errorElement||T.createElement(ik,null):null,d=()=>T.createElement(ak,{match:a,routeContext:{outlet:o,matches:e.concat(n.slice(0,s+1))}},c?l:a.route.element!==void 0?a.route.element:o);return r&&(a.route.errorElement||s===0)?T.createElement(ok,{location:r.location,component:l,error:c,children:d()}):d()},null)}var Fv;(function(t){t.UseRevalidator="useRevalidator"})(Fv||(Fv={}));var O2;(function(t){t.UseLoaderData="useLoaderData",t.UseActionData="useActionData",t.UseRouteError="useRouteError",t.UseNavigation="useNavigation",t.UseRouteLoaderData="useRouteLoaderData",t.UseMatches="useMatches",t.UseRevalidator="useRevalidator"})(O2||(O2={}));function ck(t){let e=T.useContext(C0);return e||fe(!1),e}function lk(){var t;let e=T.useContext(P6),r=ck(O2.UseRouteError),n=T.useContext(Oc),i=n.matches[n.matches.length-1];return e||(n||fe(!1),i.route.id||fe(!1),(t=r.errors)==null?void 0:t[i.route.id])}function dk(t){let{fallbackElement:e,router:r}=t,n=XS(r.subscribe,()=>r.state,()=>r.state),i=T.useMemo(()=>({createHref:r.createHref,encodeLocation:r.encodeLocation,go:a=>r.navigate(a),push:(a,s,c)=>r.navigate(a,{state:s,preventScrollReset:c==null?void 0:c.preventScrollReset}),replace:(a,s,c)=>r.navigate(a,{replace:!0,state:s,preventScrollReset:c==null?void 0:c.preventScrollReset})}),[r]),o=r.basename||"/";return T.createElement(I6.Provider,{value:{router:r,navigator:i,static:!1,basename:o}},T.createElement(C0.Provider,{value:n},T.createElement(fk,{basename:r.basename,location:r.state.location,navigationType:r.state.historyAction,navigator:i},r.state.initialized?T.createElement(pk,null):e)))}function hk(t){return tk(t.context)}function uk(t){fe(!1)}function fk(t){let{basename:e="/",children:r=null,location:n,navigationType:i=ht.Pop,navigator:o,static:a=!1}=t;z0()&&fe(!1);let s=e.replace(/^\/*/,"/"),c=T.useMemo(()=>({basename:s,navigator:o,static:a}),[s,o,a]);typeof n=="string"&&(n=ii(n));let{pathname:l="/",search:d="",hash:h="",state:u=null,key:f="default"}=n,v=T.useMemo(()=>{let g=b6(l,s);return g==null?null:{pathname:g,search:d,hash:h,state:u,key:f}},[s,l,d,h,u,f]);return v==null?null:T.createElement(M6.Provider,{value:c},T.createElement(L1.Provider,{children:r,value:{location:v,navigationType:i}}))}function pk(t){let{children:e,location:r}=t,n=T.useContext(I6),i=n&&!e?n.router.routes:D2(e);return nk(i,r)}var Uv;(function(t){t[t.pending=0]="pending",t[t.success=1]="success",t[t.error=2]="error"})(Uv||(Uv={}));new Promise(()=>{});function D2(t,e){e===void 0&&(e=[]);let r=[];return T.Children.forEach(t,(n,i)=>{if(!T.isValidElement(n))return;if(n.type===T.Fragment){r.push.apply(r,D2(n.props.children,e));return}n.type!==uk&&fe(!1),!n.props.index||!n.props.children||fe(!1);let o=[...e,i],a={id:n.props.id||o.join("-"),caseSensitive:n.props.caseSensitive,element:n.props.element,index:n.props.index,path:n.props.path,loader:n.props.loader,action:n.props.action,errorElement:n.props.errorElement,hasErrorBoundary:n.props.errorElement!=null,shouldRevalidate:n.props.shouldRevalidate,handle:n.props.handle};n.props.children&&(a.children=D2(n.props.children,o)),r.push(a)}),r}function R6(t){return t.map(e=>{let r=i1({},e);return r.hasErrorBoundary==null&&(r.hasErrorBoundary=r.errorElement!=null),r.children&&(r.children=R6(r.children)),r})}function N2(){return N2=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},N2.apply(this,arguments)}function mk(t,e){return PS({basename:e==null?void 0:e.basename,history:Xz({window:e==null?void 0:e.window}),hydrationData:(e==null?void 0:e.hydrationData)||vk(),routes:R6(t)}).initialize()}function vk(){var t;let e=(t=window)==null?void 0:t.__staticRouterHydrationData;return e&&e.errors&&(e=N2({},e,{errors:gk(e.errors)})),e}function gk(t){if(!t)return null;let e=Object.entries(t),r={};for(let[n,i]of e)i&&i.__type==="RouteErrorResponse"?r[n]=new H1(i.status,i.statusText,i.data,i.internal===!0):r[n]=i;return r}var $v;(function(t){t.UseScrollRestoration="useScrollRestoration",t.UseSubmitImpl="useSubmitImpl",t.UseFetcher="useFetcher"})($v||($v={}));var jv;(function(t){t.UseFetchers="useFetchers",t.UseScrollRestoration="useScrollRestoration"})(jv||(jv={}));const yk=(t,e,r)=>{T.useEffect(()=>{const n=t.subscribe(e);return n.add(r),()=>n.unsubscribe()},[t,e])},_k=(t,e,r)=>{T.useLayoutEffect(()=>{const n=t.subscribe(e);return n.add(r),()=>n.unsubscribe()},[t,e])};function S0(t,e){e??(e=t.value);const[r,n]=T.useState(e);return _k(t,n),r}const V2=({error:t})=>wn(x8,{children:[wn("div",{style:{marginTop:20,border:"1px solid"},children:[Q("h4",{style:{backgroundColor:"rgb(153, 0, 37)",color:"white",padding:10,margin:0},children:t.message}),Q("section",{style:{padding:10},children:t.stack&&Q("pre",{children:t.stack})})]}),t.cause&&Q(V2,{error:t.cause})]}),bk=t=>{const{appKey:e}=t,r=m0(),n=T.useRef(null),i=T.useRef(document.createElement("div")),[o,a]=T.useState(!1),[s,c]=T.useState(),l=S0(r.modules.app.current$);return T.useEffect(()=>{r.modules.app.setCurrentApp(e)},[e]),T.useEffect(()=>{a(!0),c(void 0);const d=new un;return d.add(l==null?void 0:l.initialize().subscribe({next:({manifest:h,script:u,config:f})=>{const[v]=window.location.pathname.match(/\/?apps\/[a-z|-]+(\/)?/g)??[""];i.current=document.createElement("div");const g=u.renderApp??u.default;d.add(g(i.current,{fusion:r,env:{basename:v,config:f,manifest:h}}))},complete:()=>{a(!1)},error:h=>{c(h)}})),()=>d.unsubscribe()},[l,i]),T.useEffect(()=>{const d=n.current,h=i.current;if(!!(h&&d))return d.appendChild(h),()=>{try{d.removeChild(h)}catch(u){console.error(u)}}},[n.current,i.current]),s?s.cause instanceof Pi?wn("div",{children:[Q("h2",{children:"🔥 Failed to load application manifest 🤬"}),Q("h3",{children:s.cause.type}),Q(V2,{error:s}),";"]}):wn("div",{children:[Q("h2",{children:"🔥 Failed to load application 🤬"}),Q(V2,{error:s}),";"]}):o?Q(m6,{text:"Loading Application"}):Q("section",{ref:n})},wk=()=>{const t=m0().modules.app;if(!t)throw Error("Current framework does not have AppModule configured");return{currentApp:S0(t.current$),setCurrentApp:T.useMemo(()=>t.setCurrentApp.bind(t),[t]),clearCurrentApp:T.useMemo(()=>t.clearCurrentApp.bind(t),[t])}};class Na extends CustomEvent{constructor(e){super(Na.eventName,e)}}Na.eventName="fwc-searchabledropdown-controller-connect";class H6 extends qt{constructor(){super(...arguments),this.resolverCallbacks=[]}createRenderRoot(){return this}connectResolver(e){this.resolverCallbacks.forEach(r=>{r(e)})}removeResolver(){this.resolverCallbacks.forEach(e=>{e()})}connectedCallback(){super.connectedCallback(),this.addEventListener(Na.eventName,this.handleElementConnect)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener(Na.eventName,this.handleElementConnect)}handleElementConnect(e){const{disconnectedCallback:r,updateResolver:n}=e.detail;r(()=>{this.resolverCallbacks.filter(i=>i!==n)}),this.resolverCallbacks.push(n),e.preventDefault(),e.stopPropagation()}}const xk=Symbol();class Ek{constructor(e,r,n){this.i=0,this.status=0,this.autoRun=!0,this.o=e,this.o.addController(this);const i=typeof r=="object"?r:{task:r,args:n};this.t=i.task,this.h=i.args,this.l=i.onComplete,this.u=i.onError,i.autoRun!==void 0&&(this.autoRun=i.autoRun),this.taskComplete=new Promise((o,a)=>{this.v=o,this._=a})}hostUpdated(){this.performTask()}async performTask(){var e;const r=(e=this.h)===null||e===void 0?void 0:e.call(this);this.shouldRun(r)&&this.run(r)}shouldRun(e){return this.autoRun&&this.m(e)}async run(e){var r,n,i;let o,a;e!=null||(e=(r=this.h)===null||r===void 0?void 0:r.call(this)),this.status!==2&&this.status!==3||(this.taskComplete=new Promise((c,l)=>{this.v=c,this._=l})),this.status=1,this.o.requestUpdate();const s=++this.i;try{o=await this.t(e)}catch(c){a=c}if(this.i===s){if(o===xk)this.status=0;else{if(a===void 0){try{(n=this.l)===null||n===void 0||n.call(this,o)}catch{}this.status=2,this.v(o)}else{try{(i=this.u)===null||i===void 0||i.call(this,a)}catch{}this.status=3,this._(a)}this.T=o,this.k=a}this.o.requestUpdate()}}get value(){return this.T}get error(){return this.k}render(e){var r,n,i,o;switch(this.status){case 0:return(r=e.initial)===null||r===void 0?void 0:r.call(e);case 1:return(n=e.pending)===null||n===void 0?void 0:n.call(e);case 2:return(i=e.complete)===null||i===void 0?void 0:i.call(e,this.value);case 3:return(o=e.error)===null||o===void 0?void 0:o.call(e,this.error);default:this.status}}m(e){const r=this.p;return this.p=e,Array.isArray(e)&&Array.isArray(r)?e.length===r.length&&e.some((n,i)=>x0(n,r[i])):e!==r}}class O1 extends CustomEvent{constructor(e){super(O1.eventName,e)}}O1.eventName="select";var ks,Qe,id,As;class Ck{constructor(e){this._isOpen=!1,this._listItems=[],this._selectedItems=[],ks.set(this,void 0),Qe.set(this,void 0),id.set(this,""),As.set(this,[]),this.updateResolver=r=>{this.resolver=r,r!=null&&r.initialResult&&(hl(this,As,r.initialResult,"f"),this.task.run()),r!=null&&r.closeHandler&&hl(this,ks,r.closeHandler,"f"),je(this,Qe,"f").requestUpdate()},this._handleWindowClick=r=>{!r.target||r.target.nodeName!==je(this,Qe,"f").nodeName&&(this.isOpen=!1)},this.closeClick=r=>{je(this,Qe,"f").value="";const n=je(this,Qe,"f").renderRoot.querySelector("fwc-textinput");n&&(n.value=""),this.isOpen=!1,je(this,ks,"f")&&je(this,ks,"f").call(this,r)},hl(this,Qe,e,"f"),je(this,Qe,"f").addController(this),this.handleSelect=this.handleSelect.bind(this),this.handleKeyup=this.handleKeyup.bind(this),this.task=new Ek(je(this,Qe,"f"),([r])=>x1(this,void 0,void 0,function*(){var n;if(!(!((n=this.resolver)===null||n===void 0)&&n.searchQuery))return[];let i;return r?i=yield this.resolver.searchQuery(r):je(this,As,"f").length?i=je(this,As,"f"):i=[{id:"initial",title:je(this,Qe,"f").initialText,isDisabled:!0}],this.result=this.mutateResult(i),this.result}),()=>[je(this,id,"f")])}hostConnected(){const e=new Na({detail:{disconnectedCallback:r=>{this.disconnectProvider=r},updateResolver:this.updateResolver},bubbles:!0,composed:!0,cancelable:!1});je(this,Qe,"f").dispatchEvent(e),window.addEventListener("click",this._handleWindowClick)}hostDisconnected(){this.disconnectProvider&&this.disconnectProvider(),window.removeEventListener("click",this._handleWindowClick)}mutateResult(e){var r;if(this._selectedItems.length&&e)for(let n=0;n<e.length;n++){const i=e[n];if(i.type==="section"&&((r=i.children)===null||r===void 0?void 0:r.length))for(let o=0;o<i.children.length;o++){const a=i.children[o];this._selectedItems.find(s=>s.id===a.id)?a.isSelected=!0:a.isSelected=!1}else this._selectedItems.find(o=>o.id===i.id)?i.isSelected=!0:i.isSelected=!1}return e}handleSelect(e){if(e.stopPropagation(),this.result&&this._listItems){const r=this._listItems[e.detail.index];let n;for(const i of this.result)if(i.id===r)n=i;else if(i.children)for(const o of i.children)o.id===r&&(n=o);if(!(n!=null&&n.id))throw new Error("SearchableDropdownController could not find match in result provided by resolver.");je(this,Qe,"f").multiple?this._selectedItems.find(i=>i.id===(n==null?void 0:n.id))?(n.isSelected=!1,this._selectedItems=this._selectedItems.filter(i=>i.id!==(n==null?void 0:n.id)),je(this,Qe,"f").value=""):(n.isSelected=!0,this._selectedItems.push(n),je(this,Qe,"f").value=(n==null?void 0:n.title)||""):(this._selectedItems=[n],je(this,Qe,"f").value=(n==null?void 0:n.title)||"")}else this._selectedItems=[],je(this,Qe,"f").value="";je(this,Qe,"f").dispatchEvent(new O1({detail:{selected:this._selectedItems},bubbles:!0})),this.task.run(),je(this,Qe,"f").requestUpdate()}set isOpen(e){this._isOpen=e,je(this,Qe,"f").trailingIcon=e?"close":"",this._selectedItems&&this.task.run(),je(this,Qe,"f").requestUpdate()}get isOpen(){return this._isOpen}handleKeyup(e){var r,n;const i=e.target;if(e.key==="ArrowDown"){this._isOpen&&((r=this.result)===null||r===void 0?void 0:r.length)&&((n=je(this,Qe,"f").renderRoot.querySelector("fwc-list"))===null||n===void 0||n.focus());return}this.timer&&clearTimeout(this.timer),this.timer=setTimeout(()=>{hl(this,id,i.value.trim().toLowerCase(),"f"),je(this,Qe,"f").requestUpdate()},250)}}ks=new WeakMap,Qe=new WeakMap,id=new WeakMap,As=new WeakMap;const zk="fwc-searchable-dropdown-provider";let Bv=class extends H6{};Bv=b([Yt(zk)],Bv);const ve=t=>t??st;const Vr={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},Dc=t=>(...e)=>({_$litDirective$:t,values:e});let Nc=class{constructor(e){}get _$AU(){return this._$AM._$AU}_$AT(e,r,n){this._$Ct=e,this._$AM=r,this._$Ci=n}_$AS(e,r){return this.update(e,r)}update(e,r){return this.render(...r)}};const Bt=Dc(class extends Nc{constructor(t){var e;if(super(t),t.type!==Vr.ATTRIBUTE||t.name!=="class"||((e=t.strings)===null||e===void 0?void 0:e.length)>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(t){return" "+Object.keys(t).filter(e=>t[e]).join(" ")+" "}update(t,[e]){var r,n;if(this.nt===void 0){this.nt=new Set,t.strings!==void 0&&(this.st=new Set(t.strings.join(" ").split(/\s/).filter(o=>o!=="")));for(const o in e)e[o]&&!(!((r=this.st)===null||r===void 0)&&r.has(o))&&this.nt.add(o);return this.render(e)}const i=t.element.classList;this.nt.forEach(o=>{o in e||(i.remove(o),this.nt.delete(o))});for(const o in e){const a=!!e[o];a===this.nt.has(o)||((n=this.st)===null||n===void 0?void 0:n.has(o))||(a?(i.add(o),this.nt.add(o)):(i.remove(o),this.nt.delete(o)))}return $r}});let Cl;const Sk=new Uint8Array(16);function kk(){if(!Cl&&(Cl=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Cl))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Cl(Sk)}const Et=[];for(let t=0;t<256;++t)Et.push((t+256).toString(16).slice(1));function Ak(t,e=0){return(Et[t[e+0]]+Et[t[e+1]]+Et[t[e+2]]+Et[t[e+3]]+"-"+Et[t[e+4]]+Et[t[e+5]]+"-"+Et[t[e+6]]+Et[t[e+7]]+"-"+Et[t[e+8]]+Et[t[e+9]]+"-"+Et[t[e+10]]+Et[t[e+11]]+Et[t[e+12]]+Et[t[e+13]]+Et[t[e+14]]+Et[t[e+15]]).toLowerCase()}const Tk=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),qv={randomUUID:Tk};function Gv(t,e,r){if(qv.randomUUID&&!e&&!t)return qv.randomUUID();t=t||{};const n=t.random||(t.rng||kk)();if(n[6]=n[6]&15|64,n[8]=n[8]&63|128,e){r=r||0;for(let i=0;i<16;++i)e[r+i]=n[i];return e}return Ak(n)}function Ik(t,e){var r=t.matches||t.webkitMatchesSelector||t.msMatchesSelector;return r.call(t,e)}const Mk=t=>t.nodeType===Node.ELEMENT_NODE;function L6(t){return{addClass:e=>{t.classList.add(e)},removeClass:e=>{t.classList.remove(e)},hasClass:e=>t.classList.contains(e)}}const O6=()=>{},Pk={get passive(){return!1}};document.addEventListener("x",O6,Pk);document.removeEventListener("x",O6);const D6=(t=window.document)=>{let e=t.activeElement;const r=[];if(!e)return r;for(;e&&(r.push(e),e.shadowRoot);)e=e.shadowRoot.activeElement;return r},Rk=t=>{const e=D6();if(!e.length)return!1;const r=e[e.length-1],n=new Event("check-if-focused",{bubbles:!0,composed:!0});let i=[];const o=a=>{i=a.composedPath()};return document.body.addEventListener("check-if-focused",o),r.dispatchEvent(n),document.body.removeEventListener("check-if-focused",o),i.indexOf(t)!==-1};class D1 extends qt{click(){if(this.mdcRoot){this.mdcRoot.focus(),this.mdcRoot.click();return}super.click()}createFoundation(){this.mdcFoundation!==void 0&&this.mdcFoundation.destroy(),this.mdcFoundationClass&&(this.mdcFoundation=new this.mdcFoundationClass(this.createAdapter()),this.mdcFoundation.init())}firstUpdated(){this.createFoundation()}}var Io=function(){function t(e){e===void 0&&(e={}),this.adapter=e}return Object.defineProperty(t,"cssClasses",{get:function(){return{}},enumerable:!1,configurable:!0}),Object.defineProperty(t,"strings",{get:function(){return{}},enumerable:!1,configurable:!0}),Object.defineProperty(t,"numbers",{get:function(){return{}},enumerable:!1,configurable:!0}),Object.defineProperty(t,"defaultAdapter",{get:function(){return{}},enumerable:!1,configurable:!0}),t.prototype.init=function(){},t.prototype.destroy=function(){},t}();var Hk={BG_FOCUSED:"mdc-ripple-upgraded--background-focused",FG_ACTIVATION:"mdc-ripple-upgraded--foreground-activation",FG_DEACTIVATION:"mdc-ripple-upgraded--foreground-deactivation",ROOT:"mdc-ripple-upgraded",UNBOUNDED:"mdc-ripple-upgraded--unbounded"},Lk={VAR_FG_SCALE:"--mdc-ripple-fg-scale",VAR_FG_SIZE:"--mdc-ripple-fg-size",VAR_FG_TRANSLATE_END:"--mdc-ripple-fg-translate-end",VAR_FG_TRANSLATE_START:"--mdc-ripple-fg-translate-start",VAR_LEFT:"--mdc-ripple-left",VAR_TOP:"--mdc-ripple-top"},Kv={DEACTIVATION_TIMEOUT_MS:225,FG_DEACTIVATION_MS:150,INITIAL_ORIGIN_SCALE:.6,PADDING:10,TAP_DELAY_MS:300};function Ok(t,e,r){if(!t)return{x:0,y:0};var n=e.x,i=e.y,o=n+r.left,a=i+r.top,s,c;if(t.type==="touchstart"){var l=t;s=l.changedTouches[0].pageX-o,c=l.changedTouches[0].pageY-a}else{var d=t;s=d.pageX-o,c=d.pageY-a}return{x:s,y:c}}var Wv=["touchstart","pointerdown","mousedown","keydown"],Yv=["touchend","pointerup","mouseup","contextmenu"],zl=[],Dk=function(t){Wt(e,t);function e(r){var n=t.call(this,lt(lt({},e.defaultAdapter),r))||this;return n.activationAnimationHasEnded=!1,n.activationTimer=0,n.fgDeactivationRemovalTimer=0,n.fgScale="0",n.frame={width:0,height:0},n.initialSize=0,n.layoutFrame=0,n.maxRadius=0,n.unboundedCoords={left:0,top:0},n.activationState=n.defaultActivationState(),n.activationTimerCallback=function(){n.activationAnimationHasEnded=!0,n.runDeactivationUXLogicIfReady()},n.activateHandler=function(i){n.activateImpl(i)},n.deactivateHandler=function(){n.deactivateImpl()},n.focusHandler=function(){n.handleFocus()},n.blurHandler=function(){n.handleBlur()},n.resizeHandler=function(){n.layout()},n}return Object.defineProperty(e,"cssClasses",{get:function(){return Hk},enumerable:!1,configurable:!0}),Object.defineProperty(e,"strings",{get:function(){return Lk},enumerable:!1,configurable:!0}),Object.defineProperty(e,"numbers",{get:function(){return Kv},enumerable:!1,configurable:!0}),Object.defineProperty(e,"defaultAdapter",{get:function(){return{addClass:function(){},browserSupportsCssVars:function(){return!0},computeBoundingRect:function(){return{top:0,right:0,bottom:0,left:0,width:0,height:0}},containsEventTarget:function(){return!0},deregisterDocumentInteractionHandler:function(){},deregisterInteractionHandler:function(){},deregisterResizeHandler:function(){},getWindowPageOffset:function(){return{x:0,y:0}},isSurfaceActive:function(){return!0},isSurfaceDisabled:function(){return!0},isUnbounded:function(){return!0},registerDocumentInteractionHandler:function(){},registerInteractionHandler:function(){},registerResizeHandler:function(){},removeClass:function(){},updateCssVariable:function(){}}},enumerable:!1,configurable:!0}),e.prototype.init=function(){var r=this,n=this.supportsPressRipple();if(this.registerRootHandlers(n),n){var i=e.cssClasses,o=i.ROOT,a=i.UNBOUNDED;requestAnimationFrame(function(){r.adapter.addClass(o),r.adapter.isUnbounded()&&(r.adapter.addClass(a),r.layoutInternal())})}},e.prototype.destroy=function(){var r=this;if(this.supportsPressRipple()){this.activationTimer&&(clearTimeout(this.activationTimer),this.activationTimer=0,this.adapter.removeClass(e.cssClasses.FG_ACTIVATION)),this.fgDeactivationRemovalTimer&&(clearTimeout(this.fgDeactivationRemovalTimer),this.fgDeactivationRemovalTimer=0,this.adapter.removeClass(e.cssClasses.FG_DEACTIVATION));var n=e.cssClasses,i=n.ROOT,o=n.UNBOUNDED;requestAnimationFrame(function(){r.adapter.removeClass(i),r.adapter.removeClass(o),r.removeCssVars()})}this.deregisterRootHandlers(),this.deregisterDeactivationHandlers()},e.prototype.activate=function(r){this.activateImpl(r)},e.prototype.deactivate=function(){this.deactivateImpl()},e.prototype.layout=function(){var r=this;this.layoutFrame&&cancelAnimationFrame(this.layoutFrame),this.layoutFrame=requestAnimationFrame(function(){r.layoutInternal(),r.layoutFrame=0})},e.prototype.setUnbounded=function(r){var n=e.cssClasses.UNBOUNDED;r?this.adapter.addClass(n):this.adapter.removeClass(n)},e.prototype.handleFocus=function(){var r=this;requestAnimationFrame(function(){return r.adapter.addClass(e.cssClasses.BG_FOCUSED)})},e.prototype.handleBlur=function(){var r=this;requestAnimationFrame(function(){return r.adapter.removeClass(e.cssClasses.BG_FOCUSED)})},e.prototype.supportsPressRipple=function(){return this.adapter.browserSupportsCssVars()},e.prototype.defaultActivationState=function(){return{activationEvent:void 0,hasDeactivationUXRun:!1,isActivated:!1,isProgrammatic:!1,wasActivatedByPointer:!1,wasElementMadeActive:!1}},e.prototype.registerRootHandlers=function(r){var n,i;if(r){try{for(var o=tr(Wv),a=o.next();!a.done;a=o.next()){var s=a.value;this.adapter.registerInteractionHandler(s,this.activateHandler)}}catch(c){n={error:c}}finally{try{a&&!a.done&&(i=o.return)&&i.call(o)}finally{if(n)throw n.error}}this.adapter.isUnbounded()&&this.adapter.registerResizeHandler(this.resizeHandler)}this.adapter.registerInteractionHandler("focus",this.focusHandler),this.adapter.registerInteractionHandler("blur",this.blurHandler)},e.prototype.registerDeactivationHandlers=function(r){var n,i;if(r.type==="keydown")this.adapter.registerInteractionHandler("keyup",this.deactivateHandler);else try{for(var o=tr(Yv),a=o.next();!a.done;a=o.next()){var s=a.value;this.adapter.registerDocumentInteractionHandler(s,this.deactivateHandler)}}catch(c){n={error:c}}finally{try{a&&!a.done&&(i=o.return)&&i.call(o)}finally{if(n)throw n.error}}},e.prototype.deregisterRootHandlers=function(){var r,n;try{for(var i=tr(Wv),o=i.next();!o.done;o=i.next()){var a=o.value;this.adapter.deregisterInteractionHandler(a,this.activateHandler)}}catch(s){r={error:s}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}this.adapter.deregisterInteractionHandler("focus",this.focusHandler),this.adapter.deregisterInteractionHandler("blur",this.blurHandler),this.adapter.isUnbounded()&&this.adapter.deregisterResizeHandler(this.resizeHandler)},e.prototype.deregisterDeactivationHandlers=function(){var r,n;this.adapter.deregisterInteractionHandler("keyup",this.deactivateHandler);try{for(var i=tr(Yv),o=i.next();!o.done;o=i.next()){var a=o.value;this.adapter.deregisterDocumentInteractionHandler(a,this.deactivateHandler)}}catch(s){r={error:s}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}},e.prototype.removeCssVars=function(){var r=this,n=e.strings,i=Object.keys(n);i.forEach(function(o){o.indexOf("VAR_")===0&&r.adapter.updateCssVariable(n[o],null)})},e.prototype.activateImpl=function(r){var n=this;if(!this.adapter.isSurfaceDisabled()){var i=this.activationState;if(!i.isActivated){var o=this.previousActivationEvent,a=o&&r!==void 0&&o.type!==r.type;if(!a){i.isActivated=!0,i.isProgrammatic=r===void 0,i.activationEvent=r,i.wasActivatedByPointer=i.isProgrammatic?!1:r!==void 0&&(r.type==="mousedown"||r.type==="touchstart"||r.type==="pointerdown");var s=r!==void 0&&zl.length>0&&zl.some(function(c){return n.adapter.containsEventTarget(c)});if(s){this.resetActivationState();return}r!==void 0&&(zl.push(r.target),this.registerDeactivationHandlers(r)),i.wasElementMadeActive=this.checkElementMadeActive(r),i.wasElementMadeActive&&this.animateActivation(),requestAnimationFrame(function(){zl=[],!i.wasElementMadeActive&&r!==void 0&&(r.key===" "||r.keyCode===32)&&(i.wasElementMadeActive=n.checkElementMadeActive(r),i.wasElementMadeActive&&n.animateActivation()),i.wasElementMadeActive||(n.activationState=n.defaultActivationState())})}}}},e.prototype.checkElementMadeActive=function(r){return r!==void 0&&r.type==="keydown"?this.adapter.isSurfaceActive():!0},e.prototype.animateActivation=function(){var r=this,n=e.strings,i=n.VAR_FG_TRANSLATE_START,o=n.VAR_FG_TRANSLATE_END,a=e.cssClasses,s=a.FG_DEACTIVATION,c=a.FG_ACTIVATION,l=e.numbers.DEACTIVATION_TIMEOUT_MS;this.layoutInternal();var d="",h="";if(!this.adapter.isUnbounded()){var u=this.getFgTranslationCoordinates(),f=u.startPoint,v=u.endPoint;d=f.x+"px, "+f.y+"px",h=v.x+"px, "+v.y+"px"}this.adapter.updateCssVariable(i,d),this.adapter.updateCssVariable(o,h),clearTimeout(this.activationTimer),clearTimeout(this.fgDeactivationRemovalTimer),this.rmBoundedActivationClasses(),this.adapter.removeClass(s),this.adapter.computeBoundingRect(),this.adapter.addClass(c),this.activationTimer=setTimeout(function(){r.activationTimerCallback()},l)},e.prototype.getFgTranslationCoordinates=function(){var r=this.activationState,n=r.activationEvent,i=r.wasActivatedByPointer,o;i?o=Ok(n,this.adapter.getWindowPageOffset(),this.adapter.computeBoundingRect()):o={x:this.frame.width/2,y:this.frame.height/2},o={x:o.x-this.initialSize/2,y:o.y-this.initialSize/2};var a={x:this.frame.width/2-this.initialSize/2,y:this.frame.height/2-this.initialSize/2};return{startPoint:o,endPoint:a}},e.prototype.runDeactivationUXLogicIfReady=function(){var r=this,n=e.cssClasses.FG_DEACTIVATION,i=this.activationState,o=i.hasDeactivationUXRun,a=i.isActivated,s=o||!a;s&&this.activationAnimationHasEnded&&(this.rmBoundedActivationClasses(),this.adapter.addClass(n),this.fgDeactivationRemovalTimer=setTimeout(function(){r.adapter.removeClass(n)},Kv.FG_DEACTIVATION_MS))},e.prototype.rmBoundedActivationClasses=function(){var r=e.cssClasses.FG_ACTIVATION;this.adapter.removeClass(r),this.activationAnimationHasEnded=!1,this.adapter.computeBoundingRect()},e.prototype.resetActivationState=function(){var r=this;this.previousActivationEvent=this.activationState.activationEvent,this.activationState=this.defaultActivationState(),setTimeout(function(){return r.previousActivationEvent=void 0},e.numbers.TAP_DELAY_MS)},e.prototype.deactivateImpl=function(){var r=this,n=this.activationState;if(!!n.isActivated){var i=lt({},n);n.isProgrammatic?(requestAnimationFrame(function(){r.animateDeactivation(i)}),this.resetActivationState()):(this.deregisterDeactivationHandlers(),requestAnimationFrame(function(){r.activationState.hasDeactivationUXRun=!0,r.animateDeactivation(i),r.resetActivationState()}))}},e.prototype.animateDeactivation=function(r){var n=r.wasActivatedByPointer,i=r.wasElementMadeActive;(n||i)&&this.runDeactivationUXLogicIfReady()},e.prototype.layoutInternal=function(){var r=this;this.frame=this.adapter.computeBoundingRect();var n=Math.max(this.frame.height,this.frame.width),i=function(){var a=Math.sqrt(Math.pow(r.frame.width,2)+Math.pow(r.frame.height,2));return a+e.numbers.PADDING};this.maxRadius=this.adapter.isUnbounded()?n:i();var o=Math.floor(n*e.numbers.INITIAL_ORIGIN_SCALE);this.adapter.isUnbounded()&&o%2!==0?this.initialSize=o-1:this.initialSize=o,this.fgScale=""+this.maxRadius/this.initialSize,this.updateLayoutCssVars()},e.prototype.updateLayoutCssVars=function(){var r=e.strings,n=r.VAR_FG_SIZE,i=r.VAR_LEFT,o=r.VAR_TOP,a=r.VAR_FG_SCALE;this.adapter.updateCssVariable(n,this.initialSize+"px"),this.adapter.updateCssVariable(a,this.fgScale),this.adapter.isUnbounded()&&(this.unboundedCoords={left:Math.round(this.frame.width/2-this.initialSize/2),top:Math.round(this.frame.height/2-this.initialSize/2)},this.adapter.updateCssVariable(i,this.unboundedCoords.left+"px"),this.adapter.updateCssVariable(o,this.unboundedCoords.top+"px"))},e}(Io);const Nk=Dk;const Vk=Dc(class extends Nc{constructor(t){var e;if(super(t),t.type!==Vr.ATTRIBUTE||t.name!=="style"||((e=t.strings)===null||e===void 0?void 0:e.length)>2)throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.")}render(t){return Object.keys(t).reduce((e,r)=>{const n=t[r];return n==null?e:e+`${r=r.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,"-$&").toLowerCase()}:${n};`},"")}update(t,[e]){const{style:r}=t.element;if(this.vt===void 0){this.vt=new Set;for(const n in e)this.vt.add(n);return this.render(e)}this.vt.forEach(n=>{e[n]==null&&(this.vt.delete(n),n.includes("-")?r.removeProperty(n):r[n]="")});for(const n in e){const i=e[n];i!=null&&(this.vt.add(n),n.includes("-")?r.setProperty(n,i):r[n]=i)}return $r}});class vt extends D1{constructor(){super(...arguments),this.primary=!1,this.accent=!1,this.unbounded=!1,this.disabled=!1,this.activated=!1,this.selected=!1,this.internalUseStateLayerCustomProperties=!1,this.hovering=!1,this.bgFocused=!1,this.fgActivation=!1,this.fgDeactivation=!1,this.fgScale="",this.fgSize="",this.translateStart="",this.translateEnd="",this.leftPos="",this.topPos="",this.mdcFoundationClass=Nk}get isActive(){return Ik(this.parentElement||this,":active")}createAdapter(){return{browserSupportsCssVars:()=>!0,isUnbounded:()=>this.unbounded,isSurfaceActive:()=>this.isActive,isSurfaceDisabled:()=>this.disabled,addClass:e=>{switch(e){case"mdc-ripple-upgraded--background-focused":this.bgFocused=!0;break;case"mdc-ripple-upgraded--foreground-activation":this.fgActivation=!0;break;case"mdc-ripple-upgraded--foreground-deactivation":this.fgDeactivation=!0;break}},removeClass:e=>{switch(e){case"mdc-ripple-upgraded--background-focused":this.bgFocused=!1;break;case"mdc-ripple-upgraded--foreground-activation":this.fgActivation=!1;break;case"mdc-ripple-upgraded--foreground-deactivation":this.fgDeactivation=!1;break}},containsEventTarget:()=>!0,registerInteractionHandler:()=>{},deregisterInteractionHandler:()=>{},registerDocumentInteractionHandler:()=>{},deregisterDocumentInteractionHandler:()=>{},registerResizeHandler:()=>{},deregisterResizeHandler:()=>{},updateCssVariable:(e,r)=>{switch(e){case"--mdc-ripple-fg-scale":this.fgScale=r;break;case"--mdc-ripple-fg-size":this.fgSize=r;break;case"--mdc-ripple-fg-translate-end":this.translateEnd=r;break;case"--mdc-ripple-fg-translate-start":this.translateStart=r;break;case"--mdc-ripple-left":this.leftPos=r;break;case"--mdc-ripple-top":this.topPos=r;break}},computeBoundingRect:()=>(this.parentElement||this).getBoundingClientRect(),getWindowPageOffset:()=>({x:window.pageXOffset,y:window.pageYOffset})}}startPress(e){this.waitForFoundation(()=>{this.mdcFoundation.activate(e)})}endPress(){this.waitForFoundation(()=>{this.mdcFoundation.deactivate()})}startFocus(){this.waitForFoundation(()=>{this.mdcFoundation.handleFocus()})}endFocus(){this.waitForFoundation(()=>{this.mdcFoundation.handleBlur()})}startHover(){this.hovering=!0}endHover(){this.hovering=!1}waitForFoundation(e){this.mdcFoundation?e():this.updateComplete.then(e)}update(e){e.has("disabled")&&this.disabled&&this.endHover(),super.update(e)}render(){const e=this.activated&&(this.primary||!this.accent),r=this.selected&&(this.primary||!this.accent),n={"mdc-ripple-surface--accent":this.accent,"mdc-ripple-surface--primary--activated":e,"mdc-ripple-surface--accent--activated":this.accent&&this.activated,"mdc-ripple-surface--primary--selected":r,"mdc-ripple-surface--accent--selected":this.accent&&this.selected,"mdc-ripple-surface--disabled":this.disabled,"mdc-ripple-surface--hover":this.hovering,"mdc-ripple-surface--primary":this.primary,"mdc-ripple-surface--selected":this.selected,"mdc-ripple-upgraded--background-focused":this.bgFocused,"mdc-ripple-upgraded--foreground-activation":this.fgActivation,"mdc-ripple-upgraded--foreground-deactivation":this.fgDeactivation,"mdc-ripple-upgraded--unbounded":this.unbounded,"mdc-ripple-surface--internal-use-state-layer-custom-properties":this.internalUseStateLayerCustomProperties};return q`
|
|
292
|
+
`}}b([E({type:String,reflect:!0})],Lc.prototype,"size",void 0);b([E({type:String,reflect:!0})],Lc.prototype,"color",void 0);Lc.styles=Iz;const p6="fwc-circular-progress";let Cv=class extends Lc{};Cv=b([Yt(p6)],Cv);const m6=To(Rc,u6);To(Lc,p6);To(Hc,f6);var Mz=globalThis&&globalThis.__classPrivateFieldSet||function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},Pz=globalThis&&globalThis.__classPrivateFieldGet||function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},td;class Rz{constructor(e,r={}){this.config=r,td.set(this,void 0),Mz(this,td,e,"f")}requireInstance(e){return Pz(this,td,"f").requireInstance(e)}setAppClient(e,r=1*60*1e3){this.config.client={getAppManifest:typeof e.getAppManifest=="function"?{key:({appKey:n})=>n,client:{fn:e.getAppManifest},expire:r}:e.getAppManifest,getAppManifests:typeof e.getAppManifests=="function"?{key:()=>"app_manifests",client:{fn:e.getAppManifests},expire:r}:e.getAppManifests,getAppConfig:typeof e.getAppConfig=="function"?{key:n=>JSON.stringify(n),client:{fn:e.getAppConfig},expire:r}:e.getAppConfig}}}td=new WeakMap;const Hz=()=>({setManifest:St("set_manifest",t=>({payload:t,meta:{created:Date.now()}})),fetchManifest:yl("fetch_manifest",t=>({payload:t}),t=>({payload:t}),t=>({payload:t})),setConfig:St("set_config",t=>({payload:t})),fetchConfig:yl("fetch_config",t=>({payload:t}),t=>({payload:t}),t=>({payload:t})),setModule:St("set_module",t=>({payload:t})),importApp:yl("import_app",t=>({payload:t}),t=>({payload:t}),t=>({payload:t})),setInstance:St("set_instance",t=>({payload:t})),initialize:yl("initialize_app",()=>({payload:null}),()=>({payload:null}),t=>({payload:t}))}),ze=Hz();Kb();const Lz=t=>f0(Object.assign(Object.assign({},t),{status:new Set}),e=>e.addCase(ze.setManifest,(r,n)=>{r.manifest=n.payload}).addCase(ze.setConfig,(r,n)=>{r.config=n.payload}).addCase(ze.setModule,(r,n)=>{r.modules=n.payload}).addCase(ze.setInstance,(r,n)=>{r.instance=n.payload}).addMatcher(Db,(r,n)=>{r.status.add(wm(n))}).addMatcher(Fb,(r,n)=>{r.status.delete(wm(n))})),Oz="modulepreload",Dz=function(t){return"/"+t},zv={},v6=function(e,r,n){if(!r||r.length===0)return e();const i=document.getElementsByTagName("link");return Promise.all(r.map(o=>{if(o=Dz(o),o in zv)return;zv[o]=!0;const a=o.endsWith(".css"),s=a?'[rel="stylesheet"]':"";if(!!n)for(let d=i.length-1;d>=0;d--){const h=i[d];if(h.href===o&&(!a||h.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${o}"]${s}`))return;const l=document.createElement("link");if(l.rel=a?"stylesheet":Oz,a||(l.as="script",l.crossOrigin=""),l.href=o,document.head.appendChild(l),a)return new Promise((d,h)=>{l.addEventListener("load",d),l.addEventListener("error",()=>h(new Error(`Unable to preload CSS for ${o}`)))})})).then(()=>e())},Nz=t=>e=>e.pipe(Kt(ze.fetchManifest.match),Bn(({payload:r})=>{const n=nr(t.getAppManifest(r)).pipe(Kt(i=>!!i),Ge(ze.setManifest));return qg(n,n.pipe(Jf(),Ge(({payload:i})=>ze.fetchManifest.success(i)))).pipe(Kr(i=>Oi(ze.fetchManifest.failure(i))))})),Vz=t=>e=>e.pipe(Kt(ze.fetchConfig.match),Bn(({payload:r})=>{const n=nr(t.getAppConfig(r)).pipe(Ge(ze.setConfig));return qg(n,n.pipe(Jf(),Ge(({payload:i})=>ze.fetchConfig.success(i)))).pipe(Kr(i=>Oi(ze.fetchConfig.failure(i))))})),Fz=()=>t=>t.pipe(Kt(ze.importApp.match),Bn(({payload:e})=>nr(v6(()=>import(e),[])).pipe(Ge(ze.importApp.success),Kr(r=>Oi(ze.importApp.failure(r)))))),Uz=(t,e)=>{const r=Lz(t),n=new i0(r);return n.addFlow(Nz(e)),n.addFlow(Vz(e)),n.addFlow(Fz()),n};var $z=globalThis&&globalThis.__awaiter||function(t,e,r,n){function i(o){return o instanceof r?o:new r(function(a){a(o)})}return new(r||(r=Promise))(function(o,a){function s(d){try{l(n.next(d))}catch(h){a(h)}}function c(d){try{l(n.throw(d))}catch(h){a(h)}}function l(d){d.done?o(d.value):i(d.value).then(s,c)}l((n=n.apply(t,e||[])).next())})},le=globalThis&&globalThis.__classPrivateFieldGet||function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},jz=globalThis&&globalThis.__classPrivateFieldSet||function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},H2,oe,g6;function Es(){return Kt(t=>t!=null)}class Bz{get manifest$(){return le(this,oe,"f").pipe(Ge(({manifest:e})=>e),Es())}get config$(){return le(this,oe,"f").pipe(Ge(({config:e})=>e),Es())}get modules$(){return le(this,oe,"f").pipe(Ge(({modules:e})=>e),Es())}get instance$(){return le(this,oe,"f").pipe(Ge(({instance:e})=>e),Es())}get state(){return le(this,oe,"f").value}get appKey(){return le(this,oe,"f").value.appKey}get manifest(){return this.state.manifest}get manifestAsync(){return on(this.manifest$)}get config(){return this.state.config}get configAsync(){return on(this.config$)}get instance(){return le(this,oe,"f").value.instance}constructor(e,r){H2.add(this),oe.set(this,void 0),jz(this,oe,Uz(e,r.provider),"f");const{appKey:n}=e,{event:i}=r;i&&le(this,H2,"m",g6).call(this,i);const o=new un;i&&(o.add(()=>{i.dispatchEvent("onAppDispose",{detail:{appKey:n}})}),o.add(i.addEventListener("onAppModulesLoaded",a=>{a.detail.appKey===n&&le(this,oe,"f").next(ze.setInstance(a.detail.modules))}))),this.dispose=()=>{o==null||o.unsubscribe(),le(this,oe,"f").value.instance&&le(this,oe,"f").value.instance.dispose(),le(this,oe,"f").complete()}}initialize(){return new Pe(e=>{le(this,oe,"f").next(ze.initialize()),e.add(gy([this.getManifest(),this.getAppModule(),this.getConfig()]).subscribe({next:([r,n,i])=>e.next({manifest:r,script:n,config:i}),error:r=>{e.error(r),le(this,oe,"f").next(ze.initialize.failure(r))},complete:()=>{le(this,oe,"f").next(ze.initialize.success()),e.complete()}}))})}loadConfig(){le(this,oe,"f").next(ze.fetchConfig(this.appKey))}loadManifest(){le(this,oe,"f").next(ze.fetchManifest(this.appKey))}loadAppModule(e=!0){return $z(this,void 0,void 0,function*(){const r=yield this.getManifestAsync(e);le(this,oe,"f").next(ze.importApp(r.entry))})}getConfig(e=!1){return new Pe(r=>{if(le(this,oe,"f").value.config&&(r.next(le(this,oe,"f").value.config),!e))return r.complete();r.add(le(this,oe,"f").addEffect("set_config",({payload:n})=>{r.next(n)})),r.add(le(this,oe,"f").addEffect("fetch_config::success",({payload:n})=>{r.next(n),r.complete()})),r.add(le(this,oe,"f").addEffect("fetch_config::failure",({payload:n})=>{r.error(Error("failed to load application config",{cause:n}))})),this.loadConfig()})}getConfigAsync(e=!0){return(e?on:po)(this.getConfig(!e))}getManifest(e=!1){return new Pe(r=>{if(le(this,oe,"f").value.manifest&&(r.next(le(this,oe,"f").value.manifest),!e))return r.complete();r.add(le(this,oe,"f").addEffect("set_manifest",({payload:n})=>{r.next(n)})),r.add(le(this,oe,"f").addEffect("fetch_manifest::success",({payload:n})=>{r.next(n),r.complete()})),r.add(le(this,oe,"f").addEffect("fetch_manifest::failure",({payload:n})=>{r.error(Error("failed to load application manifest",{cause:n}))})),this.loadManifest()})}getManifestAsync(e=!0){return(e?on:po)(this.getManifest(!e))}getAppModule(e=!1){return new Pe(r=>{if(le(this,oe,"f").value.modules&&(r.next(le(this,oe,"f").value.modules),!e))return r.complete();r.add(le(this,oe,"f").addEffect("set_module",({payload:n})=>{r.next(n)})),r.add(le(this,oe,"f").addEffect("import_app::success",({payload:n})=>{r.next(n),r.complete()})),r.add(le(this,oe,"f").addEffect("import_app::failure",({payload:n})=>{r.error(Error("failed to load application modules from script",{cause:n}))})),r.add(this.getManifest().subscribe(n=>Oi(le(this,oe,"f").next(ze.importApp(n.entry)))))})}getAppModuleAsync(e=!0){return(e?on:po)(this.getAppModule(!e))}}oe=new WeakMap,H2=new WeakSet,g6=function(e){const{appKey:r}=this;le(this,oe,"f").addEffect(ze.fetchManifest.success.type,n=>{e.dispatchEvent("onAppManifestLoaded",{detail:{appKey:r,manifest:n.payload},source:this})}),le(this,oe,"f").addEffect(ze.fetchConfig.success.type,n=>{e.dispatchEvent("onAppConfigLoaded",{detail:{appKey:r,manifest:n.payload},source:this})}),le(this,oe,"f").addEffect(ze.importApp.success.type,n=>{e.dispatchEvent("onAppScriptLoaded",{detail:{appKey:r,manifest:n.payload},source:this})}),le(this,oe,"f").addEffect(ze.initialize.type,()=>{e.dispatchEvent("onAppInitialize",{detail:{appKey:r},source:this})}),le(this,oe,"f").addEffect(ze.initialize.success.type,()=>{e.dispatchEvent("onAppInitialized",{detail:{appKey:r},source:this})}),le(this,oe,"f").addEffect(ze.initialize.failure.type,({payload:n})=>{e.dispatchEvent("onAppInitializeFailed",{detail:{appKey:r,error:n},source:this})})};class Pi extends Error{static fromHttpResponse(e,r){switch(e.status){case 401:return new Pi("unauthorized","failed to load application manifest, request not authorized",r);case 404:return new Pi("not_found","application manifest not found",r)}return new Pi("unknown",`failed to load application manifest, status code ${e.status}`,r)}constructor(e,r,n){super(r,n),this.type=e}}class yo extends Error{static fromHttpResponse(e,r){switch(e.status){case 401:return new yo("unauthorized","failed to load application config, request not authorized",r);case 404:return new yo("not_found","application config not found",r)}return new yo("unknown",`failed to load application config, status code ${e.status}`,r)}constructor(e,r,n){super(r,n),this.type=e}}var Ft=globalThis&&globalThis.__classPrivateFieldGet||function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},xl=globalThis&&globalThis.__classPrivateFieldSet||function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},Cs,zs,ui,fi,rd;class qz{static compareAppManifest(e,r){return JSON.stringify(e)===JSON.stringify(r)}get current(){return Ft(this,ui,"f").value}get current$(){return Ft(this,ui,"f").pipe(Gg((e,r)=>e&&r?e.appKey===r.appKey:e===r))}constructor(e){Cs.set(this,void 0),zs.set(this,void 0),ui.set(this,void 0),fi.set(this,new un),rd.set(this,void 0);const{event:r,config:n}=e;xl(this,rd,r,"f"),xl(this,ui,new C1(void 0),"f"),this.appClient=new nn(n.client.getAppManifest),xl(this,Cs,new nn(n.client.getAppManifests),"f"),xl(this,zs,new nn(n.client.getAppConfig),"f"),Ft(this,fi,"f").add(()=>this.appClient.complete()),Ft(this,fi,"f").add(()=>Ft(this,Cs,"f").complete()),Ft(this,fi,"f").add(()=>Ft(this,zs,"f").complete()),Ft(this,fi,"f").add(this.current$.pipe(t2(),Wg(()=>!!r)).subscribe(([i,o])=>{r==null||r.dispatchEvent("onCurrentAppChanged",{source:this,detail:{previous:i,next:o}})})),Ft(this,fi,"f").add(Ft(this,ui,"f").pipe(t2(),Ge(([i])=>i),Es()).subscribe(i=>i.dispose()))}getAppManifest(e){return nn.extractQueryValue(this.appClient.query({appKey:e}).pipe(Kr(r=>{const{cause:n}=r;throw n instanceof Pi?n:n instanceof n2?Pi.fromHttpResponse(n.response,{cause:n}):new Pi("unknown","failed to load manifest",{cause:n})})))}getAllAppManifests(){return nn.extractQueryValue(Ft(this,Cs,"f").query())}getAppConfig(e,r){return nn.extractQueryValue(Ft(this,zs,"f").query({appKey:e,tag:r}).pipe(Kr(n=>{const{cause:i}=n;throw i instanceof yo?i:i instanceof n2?yo.fromHttpResponse(i.response,{cause:i}):new yo("unknown","failed to load config",{cause:i})})))}setCurrentApp(e){const r=typeof e=="string"?this.createApp({appKey:e}):e;Ft(this,ui,"f").next(r)}clearCurrentApp(){Ft(this,ui,"f").next(null)}createApp(e){return new Bz(e,{provider:this,event:Ft(this,rd,"f")})}dispose(){Ft(this,fi,"f").unsubscribe()}}Cs=new WeakMap,zs=new WeakMap,ui=new WeakMap,fi=new WeakMap,rd=new WeakMap;var Gz=globalThis&&globalThis.__awaiter||function(t,e,r,n){function i(o){return o instanceof r?o:new r(function(a){a(o)})}return new(r||(r=Promise))(function(o,a){function s(d){try{l(n.next(d))}catch(h){a(h)}}function c(d){try{l(n.throw(d))}catch(h){a(h)}}function l(d){d.done?o(d.value):i(d.value).then(s,c)}l((n=n.apply(t,e||[])).next())})};const L2="app",Kz={name:L2,configure:()=>new Wz,initialize:t=>Gz(void 0,void 0,void 0,function*(){const e=yield t.config.createConfig(t),r=yield t.requireInstance("event").catch(()=>{});return new qz({config:e,event:r})}),dispose:t=>{t.instance.dispose()}};var El=globalThis&&globalThis.__awaiter||function(t,e,r,n){function i(o){return o instanceof r?o:new r(function(a){a(o)})}return new(r||(r=Promise))(function(o,a){function s(d){try{l(n.next(d))}catch(h){a(h)}}function c(d){try{l(n.throw(d))}catch(h){a(h)}}function l(d){d.done?o(d.value):i(d.value).then(s,c)}l((n=n.apply(t,e||[])).next())})},Sv=globalThis&&globalThis.__classPrivateFieldGet||function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},nd;class Wz{constructor(){this.defaultExpireTime=1*60*1e3,nd.set(this,[])}addConfigBuilder(e){Sv(this,nd,"f").push(e)}_createHttpClient(e){return El(this,void 0,void 0,function*(){const r=yield e.requireInstance("http");if(r.hasClient(L2))return r.createClient(L2);{const n=yield e.requireInstance("serviceDiscovery");try{return yield n.createClient("app")}catch{return yield n.createClient("portal")}}})}createConfig(e){var r;return El(this,void 0,void 0,function*(){const n=yield Sv(this,nd,"f").reduce((i,o)=>El(this,void 0,void 0,function*(){const a=new Rz(e,yield i);return yield Promise.resolve(o(a)),Object.assign(i,a.config)}),Promise.resolve({}));return(r=n.client)!==null&&r!==void 0||(n.client=yield(()=>El(this,void 0,void 0,function*(){const i=yield this._createHttpClient(e);return{getAppManifest:{client:{fn:({appKey:o})=>i.json$(`/api/apps/${o}`)},key:({appKey:o})=>o,expire:this.defaultExpireTime},getAppManifests:{client:{fn:()=>i.json$("/api/apps")},key:()=>"manifests",expire:this.defaultExpireTime},getAppConfig:{client:{fn:({appKey:o,tag:a})=>i.json$(`/api/apps/${o}/config${a?`?tag=${a}`:""}`)},key:o=>JSON.stringify(o),expire:this.defaultExpireTime}}}))()),n})}}nd=new WeakMap;const Yz=(t,e)=>{t.addConfig({module:Kz,configure:r=>{e&&r.addConfigBuilder(e)}})},Qz=async t=>{t.logger.level=4,t.configureServiceDiscovery({client:{baseUri:import.meta.url,defaultScopes:["5a842df8-3238-415d-b168-9f16a6a6031b/.default"]}}),t.configureMsal({tenantId:"3aa4a235-b6e2-48d5-9195-7fcf05b459b0",clientId:"9b707e3a-3e90-41ed-a47e-652a1e3b53d0",redirectUri:"/authentication/login-callback"},{requiresAuth:!0}),Yz(t),t.onConfigured(()=>{console.log("framework config done")}),t.onInitialized(async e=>{e.auth.defaultClient.setLogger(new u3(0)),console.debug("📒 subscribing to all events"),e.event.subscribe(r=>console.debug(`🔔🌍 [${r.type}]`,r))})};function rt(){return rt=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},rt.apply(this,arguments)}var ht;(function(t){t.Pop="POP",t.Push="PUSH",t.Replace="REPLACE"})(ht||(ht={}));const kv="popstate";function Xz(t){t===void 0&&(t={});function e(n,i){let{pathname:o,search:a,hash:s}=n.location;return wc("",{pathname:o,search:a,hash:s},i.state&&i.state.usr||null,i.state&&i.state.key||"default")}function r(n,i){return typeof i=="string"?i:Vi(i)}return Zz(e,r,null,t)}function fe(t,e){if(t===!1||t===null||typeof t>"u")throw new Error(e)}function Jz(){return Math.random().toString(36).substr(2,8)}function Av(t){return{usr:t.state,key:t.key}}function wc(t,e,r,n){return r===void 0&&(r=null),rt({pathname:typeof t=="string"?t:t.pathname,search:"",hash:""},typeof e=="string"?ii(e):e,{state:r,key:e&&e.key||n||Jz()})}function Vi(t){let{pathname:e="/",search:r="",hash:n=""}=t;return r&&r!=="?"&&(e+=r.charAt(0)==="?"?r:"?"+r),n&&n!=="#"&&(e+=n.charAt(0)==="#"?n:"#"+n),e}function ii(t){let e={};if(t){let r=t.indexOf("#");r>=0&&(e.hash=t.substr(r),t=t.substr(0,r));let n=t.indexOf("?");n>=0&&(e.search=t.substr(n),t=t.substr(0,n)),t&&(e.pathname=t)}return e}function xc(t){let e=typeof window<"u"&&typeof window.location<"u"&&window.location.origin!=="null"?window.location.origin:window.location.href,r=typeof t=="string"?t:Vi(t);return fe(e,"No window.location.(origin|href) available to create URL for href: "+r),new URL(r,e)}function Zz(t,e,r,n){n===void 0&&(n={});let{window:i=document.defaultView,v5Compat:o=!1}=n,a=i.history,s=ht.Pop,c=null;function l(){s=ht.Pop,c&&c({action:s,location:u.location})}function d(f,v){s=ht.Push;let g=wc(u.location,f,v);r&&r(g,f);let x=Av(g),m=u.createHref(g);try{a.pushState(x,"",m)}catch{i.location.assign(m)}o&&c&&c({action:s,location:u.location})}function h(f,v){s=ht.Replace;let g=wc(u.location,f,v);r&&r(g,f);let x=Av(g),m=u.createHref(g);a.replaceState(x,"",m),o&&c&&c({action:s,location:u.location})}let u={get action(){return s},get location(){return t(i,a)},listen(f){if(c)throw new Error("A history only accepts one active listener");return i.addEventListener(kv,l),c=f,()=>{i.removeEventListener(kv,l),c=null}},createHref(f){return e(i,f)},encodeLocation(f){let v=xc(typeof f=="string"?f:Vi(f));return{pathname:v.pathname,search:v.search,hash:v.hash}},push:d,replace:h,go(f){return a.go(f)}};return u}var zt;(function(t){t.data="data",t.deferred="deferred",t.redirect="redirect",t.error="error"})(zt||(zt={}));function eS(t){return t.index===!0}function y6(t,e,r){return e===void 0&&(e=[]),r===void 0&&(r=new Set),t.map((n,i)=>{let o=[...e,i],a=typeof n.id=="string"?n.id:o.join("-");return fe(n.index!==!0||!n.children,"Cannot specify children on an index route"),fe(!r.has(a),'Found a route id collision on id "'+a+`". Route id's must be globally unique within Data Router usages`),r.add(a),eS(n)?rt({},n,{id:a}):rt({},n,{id:a,children:n.children?y6(n.children,o,r):void 0})})}function Ss(t,e,r){r===void 0&&(r="/");let n=typeof e=="string"?ii(e):e,i=b6(n.pathname||"/",r);if(i==null)return null;let o=_6(t);tS(o);let a=null;for(let s=0;a==null&&s<o.length;++s)a=dS(o[s],fS(i));return a}function _6(t,e,r,n){return e===void 0&&(e=[]),r===void 0&&(r=[]),n===void 0&&(n=""),t.forEach((i,o)=>{let a={relativePath:i.path||"",caseSensitive:i.caseSensitive===!0,childrenIndex:o,route:i};a.relativePath.startsWith("/")&&(fe(a.relativePath.startsWith(n),'Absolute route path "'+a.relativePath+'" nested under path '+('"'+n+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),a.relativePath=a.relativePath.slice(n.length));let s=_o([n,a.relativePath]),c=r.concat(a);i.children&&i.children.length>0&&(fe(i.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+s+'".')),_6(i.children,e,c,s)),!(i.path==null&&!i.index)&&e.push({path:s,score:cS(s,i.index),routesMeta:c})}),e}function tS(t){t.sort((e,r)=>e.score!==r.score?r.score-e.score:lS(e.routesMeta.map(n=>n.childrenIndex),r.routesMeta.map(n=>n.childrenIndex)))}const rS=/^:\w+$/,nS=3,iS=2,oS=1,aS=10,sS=-2,Tv=t=>t==="*";function cS(t,e){let r=t.split("/"),n=r.length;return r.some(Tv)&&(n+=sS),e&&(n+=iS),r.filter(i=>!Tv(i)).reduce((i,o)=>i+(rS.test(o)?nS:o===""?oS:aS),n)}function lS(t,e){return t.length===e.length&&t.slice(0,-1).every((n,i)=>n===e[i])?t[t.length-1]-e[e.length-1]:0}function dS(t,e){let{routesMeta:r}=t,n={},i="/",o=[];for(let a=0;a<r.length;++a){let s=r[a],c=a===r.length-1,l=i==="/"?e:e.slice(i.length)||"/",d=hS({path:s.relativePath,caseSensitive:s.caseSensitive,end:c},l);if(!d)return null;Object.assign(n,d.params);let h=s.route;o.push({params:n,pathname:_o([i,d.pathname]),pathnameBase:yS(_o([i,d.pathnameBase])),route:h}),d.pathnameBase!=="/"&&(i=_o([i,d.pathnameBase]))}return o}function hS(t,e){typeof t=="string"&&(t={path:t,caseSensitive:!1,end:!0});let[r,n]=uS(t.path,t.caseSensitive,t.end),i=e.match(r);if(!i)return null;let o=i[0],a=o.replace(/(.)\/+$/,"$1"),s=i.slice(1);return{params:n.reduce((l,d,h)=>{if(d==="*"){let u=s[h]||"";a=o.slice(0,o.length-u.length).replace(/(.)\/+$/,"$1")}return l[d]=pS(s[h]||"",d),l},{}),pathname:o,pathnameBase:a,pattern:t}}function uS(t,e,r){e===void 0&&(e=!1),r===void 0&&(r=!0),E0(t==="*"||!t.endsWith("*")||t.endsWith("/*"),'Route path "'+t+'" will be treated as if it were '+('"'+t.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+t.replace(/\*$/,"/*")+'".'));let n=[],i="^"+t.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^$?{}|()[\]]/g,"\\$&").replace(/:(\w+)/g,(a,s)=>(n.push(s),"([^\\/]+)"));return t.endsWith("*")?(n.push("*"),i+=t==="*"||t==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):r?i+="\\/*$":t!==""&&t!=="/"&&(i+="(?:(?=\\/|$))"),[new RegExp(i,e?void 0:"i"),n]}function fS(t){try{return decodeURI(t)}catch(e){return E0(!1,'The URL path "'+t+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+e+").")),t}}function pS(t,e){try{return decodeURIComponent(t)}catch(r){return E0(!1,'The value for the URL param "'+e+'" will not be decoded because'+(' the string "'+t+'" is a malformed URL segment. This is probably')+(" due to a bad percent encoding ("+r+").")),t}}function b6(t,e){if(e==="/")return t;if(!t.toLowerCase().startsWith(e.toLowerCase()))return null;let r=e.endsWith("/")?e.length-1:e.length,n=t.charAt(r);return n&&n!=="/"?null:t.slice(r)||"/"}function E0(t,e){if(!t){typeof console<"u"&&console.warn(e);try{throw new Error(e)}catch{}}}function mS(t,e){e===void 0&&(e="/");let{pathname:r,search:n="",hash:i=""}=typeof t=="string"?ii(t):t;return{pathname:r?r.startsWith("/")?r:vS(r,e):e,search:_S(n),hash:bS(i)}}function vS(t,e){let r=e.replace(/\/+$/,"").split("/");return t.split("/").forEach(i=>{i===".."?r.length>1&&r.pop():i!=="."&&r.push(i)}),r.length>1?r.join("/"):"/"}function Wh(t,e,r,n){return"Cannot include a '"+t+"' character in a manually specified "+("`to."+e+"` field ["+JSON.stringify(n)+"]. Please separate it out to the ")+("`to."+r+"` field. Alternatively you may provide the full path as ")+'a string in <Link to="..."> and the router will parse it for you.'}function w6(t){return t.filter((e,r)=>r===0||e.route.path&&e.route.path.length>0)}function gS(t,e,r,n){n===void 0&&(n=!1);let i;typeof t=="string"?i=ii(t):(i=rt({},t),fe(!i.pathname||!i.pathname.includes("?"),Wh("?","pathname","search",i)),fe(!i.pathname||!i.pathname.includes("#"),Wh("#","pathname","hash",i)),fe(!i.search||!i.search.includes("#"),Wh("#","search","hash",i)));let o=t===""||i.pathname==="",a=o?"/":i.pathname,s;if(n||a==null)s=r;else{let h=e.length-1;if(a.startsWith("..")){let u=a.split("/");for(;u[0]==="..";)u.shift(),h-=1;i.pathname=u.join("/")}s=h>=0?e[h]:"/"}let c=mS(i,s),l=a&&a!=="/"&&a.endsWith("/"),d=(o||a===".")&&r.endsWith("/");return!c.pathname.endsWith("/")&&(l||d)&&(c.pathname+="/"),c}const _o=t=>t.join("/").replace(/\/\/+/g,"/"),yS=t=>t.replace(/\/+$/,"").replace(/^\/*/,"/"),_S=t=>!t||t==="?"?"":t.startsWith("?")?t:"?"+t,bS=t=>!t||t==="#"?"":t.startsWith("#")?t:"#"+t;class Iv extends Error{}class wS{constructor(e){this.pendingKeys=new Set,this.subscriber=void 0,fe(e&&typeof e=="object"&&!Array.isArray(e),"defer() only accepts plain objects");let r;this.abortPromise=new Promise((i,o)=>r=o),this.controller=new AbortController;let n=()=>r(new Iv("Deferred data aborted"));this.unlistenAbortSignal=()=>this.controller.signal.removeEventListener("abort",n),this.controller.signal.addEventListener("abort",n),this.data=Object.entries(e).reduce((i,o)=>{let[a,s]=o;return Object.assign(i,{[a]:this.trackPromise(a,s)})},{})}trackPromise(e,r){if(!(r instanceof Promise))return r;this.pendingKeys.add(e);let n=Promise.race([r,this.abortPromise]).then(i=>this.onSettle(n,e,null,i),i=>this.onSettle(n,e,i));return n.catch(()=>{}),Object.defineProperty(n,"_tracked",{get:()=>!0}),n}onSettle(e,r,n,i){if(this.controller.signal.aborted&&n instanceof Iv)return this.unlistenAbortSignal(),Object.defineProperty(e,"_error",{get:()=>n}),Promise.reject(n);this.pendingKeys.delete(r),this.done&&this.unlistenAbortSignal();const o=this.subscriber;return n?(Object.defineProperty(e,"_error",{get:()=>n}),o&&o(!1),Promise.reject(n)):(Object.defineProperty(e,"_data",{get:()=>i}),o&&o(!1),i)}subscribe(e){this.subscriber=e}cancel(){this.controller.abort(),this.pendingKeys.forEach((r,n)=>this.pendingKeys.delete(n));let e=this.subscriber;e&&e(!0)}async resolveData(e){let r=!1;if(!this.done){let n=()=>this.cancel();e.addEventListener("abort",n),r=await new Promise(i=>{this.subscribe(o=>{e.removeEventListener("abort",n),(o||this.done)&&i(o)})})}return r}get done(){return this.pendingKeys.size===0}get unwrappedData(){return fe(this.data!==null&&this.done,"Can only unwrap data on initialized and settled deferreds"),Object.entries(this.data).reduce((e,r)=>{let[n,i]=r;return Object.assign(e,{[n]:ES(i)})},{})}}function xS(t){return t instanceof Promise&&t._tracked===!0}function ES(t){if(!xS(t))return t;if(t._error)throw t._error;return t._data}class H1{constructor(e,r,n,i){i===void 0&&(i=!1),this.status=e,this.statusText=r||"",this.internal=i,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}}function x6(t){return t instanceof H1}const E6=["post","put","patch","delete"],CS=new Set(E6),zS=["get",...E6],SS=new Set(zS),kS=new Set([301,302,303,307,308]),AS=new Set([307,308]),Yh={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0},TS={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0},IS=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",MS=!IS;function PS(t){fe(t.routes.length>0,"You must provide a non-empty routes array to createRouter");let e=y6(t.routes),r=null,n=new Set,i=null,o=null,a=null,s=!1,c=Ss(e,t.history.location,t.basename),l=null;if(c==null){let z=oo(404,{pathname:t.history.location.pathname}),{matches:I,route:F}=Lv(e);c=I,l={[F.id]:z}}let d=!c.some(z=>z.route.loader)||t.hydrationData!=null,h,u={historyAction:t.history.action,location:t.history.location,matches:c,initialized:d,navigation:Yh,restoreScrollPosition:null,preventScrollReset:!1,revalidation:"idle",loaderData:t.hydrationData&&t.hydrationData.loaderData||{},actionData:t.hydrationData&&t.hydrationData.actionData||null,errors:t.hydrationData&&t.hydrationData.errors||l,fetchers:new Map},f=ht.Pop,v=!1,g,x=!1,m=!1,p=[],y=[],w=new Map,A=0,O=-1,U=new Map,N=new Set,xe=new Map,Y=new Map;function Xt(){return r=t.history.listen(z=>{let{action:I,location:F}=z;return $(I,F)}),u.initialized||$(ht.Pop,u.location),h}function qi(){r&&r(),n.clear(),g&&g.abort(),u.fetchers.forEach((z,I)=>j1(I))}function Gi(z){return n.add(z),()=>n.delete(z)}function Lt(z){u=rt({},u,z),n.forEach(I=>I(u))}function Ki(z,I){var F;let X=u.actionData!=null&&u.navigation.formMethod!=null&&u.navigation.state==="loading"&&((F=u.navigation.formAction)==null?void 0:F.split("?")[0])===z.pathname,te=I.loaderData?{loaderData:Qh(u.loaderData,I.loaderData,I.matches||[])}:{};Lt(rt({},X?{}:{actionData:null},I,te,{historyAction:f,location:z,initialized:!0,navigation:Yh,revalidation:"idle",restoreScrollPosition:u.navigation.formData?!1:P0(z,I.matches||u.matches),preventScrollReset:v})),x||f===ht.Pop||(f===ht.Push?t.history.push(z,z.state):f===ht.Replace&&t.history.replace(z,z.state)),f=ht.Pop,v=!1,x=!1,m=!1,p=[],y=[]}async function Ka(z,I){if(typeof z=="number"){t.history.go(z);return}let{path:F,submission:X,error:te}=Mv(z,I),he=wc(u.location,F,I&&I.state);he=rt({},he,t.history.encodeLocation(he));let ge=(I&&I.replace)===!0||X!=null?ht.Replace:ht.Push,Ee=I&&"preventScrollReset"in I?I.preventScrollReset===!0:void 0;return await $(ge,he,{submission:X,pendingError:te,preventScrollReset:Ee,replace:I&&I.replace})}function Wa(){if(oi(),Lt({revalidation:"loading"}),u.navigation.state!=="submitting"){if(u.navigation.state==="idle"){$(u.historyAction,u.location,{startUninterruptedRevalidation:!0});return}$(f||u.historyAction,u.navigation.location,{overrideNavigation:u.navigation})}}async function $(z,I,F){g&&g.abort(),g=null,f=z,x=(F&&F.startUninterruptedRevalidation)===!0,K6(u.location,u.matches),v=(F&&F.preventScrollReset)===!0;let X=F&&F.overrideNavigation,te=Ss(e,I,t.basename);if(!te){let cr=oo(404,{pathname:I.pathname}),{matches:Po,route:Pn}=Lv(e);B1(),Ki(I,{matches:Po,loaderData:{},errors:{[Pn.id]:cr}});return}if(DS(u.location,I)){Ki(I,{matches:te});return}g=new AbortController;let he=cs(I,g.signal,F&&F.submission),ge,Ee;if(F&&F.pendingError)Ee={[pa(te).route.id]:F.pendingError};else if(F&&F.submission){let cr=await ie(he,I,F.submission,te,{replace:F.replace});if(cr.shortCircuited)return;ge=cr.pendingActionData,Ee=cr.pendingActionError,X=rt({state:"loading",location:I},F.submission),he=new Request(he.url,{signal:he.signal})}let{shortCircuited:Ie,loaderData:Ce,errors:Oe}=await ce(he,I,te,X,F&&F.submission,F&&F.replace,ge,Ee);Ie||(g=null,Ki(I,{matches:te,loaderData:Ce,errors:Oe}))}async function ie(z,I,F,X,te){oi();let he=rt({state:"submitting",location:I},F);Lt({navigation:he});let ge,Ee=Vv(X,I);if(!Ee.route.action)ge={type:zt.error,error:oo(405,{method:z.method,pathname:I.pathname,routeId:Ee.route.id})};else if(ge=await ss("action",z,Ee,X,h.basename),z.signal.aborted)return{shortCircuited:!0};if(Ca(ge))return await Mn(u,ge,te&&te.replace===!0),{shortCircuited:!0};if(Bs(ge)){let Ie=pa(X,Ee.route.id);return(te&&te.replace)!==!0&&(f=ht.Push),{pendingActionError:{[Ie.route.id]:ge.error}}}if(ho(ge))throw new Error("defer() is not supported in actions");return{pendingActionData:{[Ee.route.id]:ge.data}}}async function ce(z,I,F,X,te,he,ge,Ee){let Ie=X;Ie||(Ie={state:"loading",location:I,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0});let[Ce,Oe]=Pv(u,F,te,I,m,p,y,ge,Ee,xe);if(B1(lr=>!(F&&F.some(dr=>dr.route.id===lr))||Ce&&Ce.some(dr=>dr.route.id===lr)),Ce.length===0&&Oe.length===0)return Ki(I,{matches:F,loaderData:Qh(u.loaderData,{},F),errors:Ee||null,actionData:ge||null}),{shortCircuited:!0};x||(Oe.forEach(lr=>{let[dr]=lr,Lo=u.fetchers.get(dr),Kc={state:"loading",data:Lo&&Lo.data,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0};u.fetchers.set(dr,Kc)}),Lt(rt({navigation:Ie,actionData:ge||u.actionData||null},Oe.length>0?{fetchers:new Map(u.fetchers)}:{}))),O=++A,Oe.forEach(lr=>{let[dr]=lr;return w.set(dr,g)});let{results:cr,loaderResults:Po,fetcherResults:Pn}=await fn(u.matches,F,Ce,Oe,z);if(z.signal.aborted)return{shortCircuited:!0};Oe.forEach(lr=>{let[dr]=lr;return w.delete(dr)});let Ro=Ov(cr);if(Ro)return await Mn(u,Ro,he),{shortCircuited:!0};let{loaderData:q1,errors:Gc}=Hv(u,F,Ce,Po,Ee,Oe,Pn,Y);Y.forEach((lr,dr)=>{lr.subscribe(Lo=>{(Lo||lr.done)&&Y.delete(dr)})}),q6();let Ho=M0(O);return rt({loaderData:q1,errors:Gc},Ho||Oe.length>0?{fetchers:new Map(u.fetchers)}:{})}function $e(z){return u.fetchers.get(z)||TS}function it(z,I,F,X){if(MS)throw new Error("router.fetch() was called during the server render, but it shouldn't be. You are likely calling a useFetcher() method in the body of your component. Try moving it to a useEffect or a callback.");w.has(z)&&qc(z);let te=Ss(e,F,t.basename);if(!te){$1(z,I,oo(404,{pathname:F}));return}let{path:he,submission:ge}=Mv(F,X,!0),Ee=Vv(te,he);if(ge){Mo(z,I,he,Ee,te,ge);return}xe.set(z,[he,Ee,te]),In(z,I,he,Ee,te)}async function Mo(z,I,F,X,te,he){if(oi(),xe.delete(z),!X.route.action){let Rn=oo(405,{method:he.formMethod,pathname:F,routeId:I});$1(z,I,Rn);return}let ge=u.fetchers.get(z),Ee=rt({state:"submitting"},he,{data:ge&&ge.data});u.fetchers.set(z,Ee),Lt({fetchers:new Map(u.fetchers)});let Ie=new AbortController,Ce=cs(F,Ie.signal,he);w.set(z,Ie);let Oe=await ss("action",Ce,X,te,h.basename);if(Ce.signal.aborted){w.get(z)===Ie&&w.delete(z);return}if(Ca(Oe)){w.delete(z),N.add(z);let Rn=rt({state:"loading"},he,{data:void 0});return u.fetchers.set(z,Rn),Lt({fetchers:new Map(u.fetchers)}),Mn(u,Oe)}if(Bs(Oe)){$1(z,I,Oe.error);return}ho(Oe)&&fe(!1,"defer() is not supported in actions");let cr=u.navigation.location||u.location,Po=cs(cr,Ie.signal),Pn=u.navigation.state!=="idle"?Ss(e,u.navigation.location,t.basename):u.matches;fe(Pn,"Didn't find any matches after fetcher action");let Ro=++A;U.set(z,Ro);let q1=rt({state:"loading",data:Oe.data},he);u.fetchers.set(z,q1);let[Gc,Ho]=Pv(u,Pn,he,cr,m,p,y,{[X.route.id]:Oe.data},void 0,xe);Ho.filter(Rn=>{let[Wi]=Rn;return Wi!==z}).forEach(Rn=>{let[Wi]=Rn,L0=u.fetchers.get(Wi),Q6={state:"loading",data:L0&&L0.data,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0};u.fetchers.set(Wi,Q6),w.set(Wi,Ie)}),Lt({fetchers:new Map(u.fetchers)});let{results:lr,loaderResults:dr,fetcherResults:Lo}=await fn(u.matches,Pn,Gc,Ho,Po);if(Ie.signal.aborted)return;U.delete(z),w.delete(z),Ho.forEach(Rn=>{let[Wi]=Rn;return w.delete(Wi)});let Kc=Ov(lr);if(Kc)return Mn(u,Kc);let{loaderData:R0,errors:H0}=Hv(u,u.matches,Gc,dr,void 0,Ho,Lo,Y),W6={state:"idle",data:Oe.data,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0};u.fetchers.set(z,W6);let Y6=M0(Ro);u.navigation.state==="loading"&&Ro>O?(fe(f,"Expected pending action"),g&&g.abort(),Ki(u.navigation.location,{matches:Pn,loaderData:R0,errors:H0,fetchers:new Map(u.fetchers)})):(Lt(rt({errors:H0,loaderData:Qh(u.loaderData,R0,Pn)},Y6?{fetchers:new Map(u.fetchers)}:{})),m=!1)}async function In(z,I,F,X,te){let he=u.fetchers.get(z),ge={state:"loading",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,data:he&&he.data};u.fetchers.set(z,ge),Lt({fetchers:new Map(u.fetchers)});let Ee=new AbortController,Ie=cs(F,Ee.signal);w.set(z,Ee);let Ce=await ss("loader",Ie,X,te,h.basename);if(ho(Ce)&&(Ce=await A6(Ce,Ie.signal,!0)||Ce),w.get(z)===Ee&&w.delete(z),Ie.signal.aborted)return;if(Ca(Ce)){await Mn(u,Ce);return}if(Bs(Ce)){let cr=pa(u.matches,I);u.fetchers.delete(z),Lt({fetchers:new Map(u.fetchers),errors:{[cr.route.id]:Ce.error}});return}fe(!ho(Ce),"Unhandled fetcher deferred data");let Oe={state:"idle",data:Ce.data,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0};u.fetchers.set(z,Oe),Lt({fetchers:new Map(u.fetchers)})}async function Mn(z,I,F){var X;I.revalidate&&(m=!0);let te=wc(z.location,I.location);if(fe(te,"Expected a location on the redirect navigation"),typeof((X=window)==null?void 0:X.location)<"u"){let Oe=xc(I.location).origin;if(window.location.origin!==Oe){F?window.location.replace(I.location):window.location.assign(I.location);return}}g=null;let he=F===!0?ht.Replace:ht.Push,{formMethod:ge,formAction:Ee,formEncType:Ie,formData:Ce}=z.navigation;AS.has(I.status)&&ge&&k6(ge)&&Ie&&Ce?await $(he,te,{submission:{formMethod:ge,formAction:I.location,formEncType:Ie,formData:Ce}}):await $(he,te,{overrideNavigation:{state:"loading",location:te,formMethod:ge||void 0,formAction:Ee||void 0,formEncType:Ie||void 0,formData:Ce||void 0}})}async function fn(z,I,F,X,te){let he=await Promise.all([...F.map(Ie=>ss("loader",te,Ie,I,h.basename)),...X.map(Ie=>{let[,Ce,Oe,cr]=Ie;return ss("loader",cs(Ce,te.signal),Oe,cr,h.basename)})]),ge=he.slice(0,F.length),Ee=he.slice(F.length);return await Promise.all([Dv(z,F,ge,te.signal,!1,u.loaderData),Dv(z,X.map(Ie=>{let[,,Ce]=Ie;return Ce}),Ee,te.signal,!0)]),{results:he,loaderResults:ge,fetcherResults:Ee}}function oi(){m=!0,p.push(...B1()),xe.forEach((z,I)=>{w.has(I)&&(y.push(I),qc(I))})}function $1(z,I,F){let X=pa(u.matches,I);j1(z),Lt({errors:{[X.route.id]:F},fetchers:new Map(u.fetchers)})}function j1(z){w.has(z)&&qc(z),xe.delete(z),U.delete(z),N.delete(z),u.fetchers.delete(z)}function qc(z){let I=w.get(z);fe(I,"Expected fetch controller: "+z),I.abort(),w.delete(z)}function I0(z){for(let I of z){let X={state:"idle",data:$e(I).data,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0};u.fetchers.set(I,X)}}function q6(){let z=[];for(let I of N){let F=u.fetchers.get(I);fe(F,"Expected fetcher: "+I),F.state==="loading"&&(N.delete(I),z.push(I))}I0(z)}function M0(z){let I=[];for(let[F,X]of U)if(X<z){let te=u.fetchers.get(F);fe(te,"Expected fetcher: "+F),te.state==="loading"&&(qc(F),U.delete(F),I.push(F))}return I0(I),I.length>0}function B1(z){let I=[];return Y.forEach((F,X)=>{(!z||z(X))&&(F.cancel(),I.push(X),Y.delete(X))}),I}function G6(z,I,F){if(i=z,a=I,o=F||(X=>X.key),!s&&u.navigation===Yh){s=!0;let X=P0(u.location,u.matches);X!=null&&Lt({restoreScrollPosition:X})}return()=>{i=null,a=null,o=null}}function K6(z,I){if(i&&o&&a){let F=I.map(te=>Nv(te,u.loaderData)),X=o(z,F)||z.key;i[X]=a()}}function P0(z,I){if(i&&o&&a){let F=I.map(he=>Nv(he,u.loaderData)),X=o(z,F)||z.key,te=i[X];if(typeof te=="number")return te}return null}return h={get basename(){return t.basename},get state(){return u},get routes(){return e},initialize:Xt,subscribe:Gi,enableScrollRestoration:G6,navigate:Ka,fetch:it,revalidate:Wa,createHref:z=>t.history.createHref(z),encodeLocation:z=>t.history.encodeLocation(z),getFetcher:$e,deleteFetcher:j1,dispose:qi,_internalFetchControllers:w,_internalActiveDeferreds:Y},h}function RS(t){return t!=null&&"formData"in t}function Mv(t,e,r){r===void 0&&(r=!1);let n=typeof t=="string"?t:Vi(t);if(!e||!RS(e))return{path:n};if(e.formMethod&&!VS(e.formMethod))return{path:n,error:oo(405,{method:e.formMethod})};if(e.formMethod&&k6(e.formMethod))return{path:n,submission:{formMethod:e.formMethod,formAction:S6(n),formEncType:e&&e.formEncType||"application/x-www-form-urlencoded",formData:e.formData}};let i=ii(n);try{let o=z6(e.formData);r&&i.search&&T6(i.search)&&o.append("index",""),i.search="?"+o}catch{return{path:n,error:oo(400)}}return{path:Vi(i)}}function HS(t,e){let r=t;if(e){let n=t.findIndex(i=>i.route.id===e);n>=0&&(r=t.slice(0,n))}return r}function Pv(t,e,r,n,i,o,a,s,c,l){let d=c?Object.values(c)[0]:s?Object.values(s)[0]:null,h=c?Object.keys(c)[0]:void 0,f=HS(e,h).filter((g,x)=>g.route.loader!=null&&(LS(t.loaderData,t.matches[x],g)||o.some(m=>m===g.route.id)||Rv(t.location,t.matches[x],r,n,g,i,d))),v=[];return l&&l.forEach((g,x)=>{let[m,p,y]=g;a.includes(x)?v.push([x,m,p,y]):i&&Rv(m,p,r,m,p,i,d)&&v.push([x,m,p,y])}),[f,v]}function LS(t,e,r){let n=!e||r.route.id!==e.route.id,i=t[r.route.id]===void 0;return n||i}function C6(t,e){let r=t.route.path;return t.pathname!==e.pathname||r&&r.endsWith("*")&&t.params["*"]!==e.params["*"]}function Rv(t,e,r,n,i,o,a){let s=xc(t),c=e.params,l=xc(n),d=i.params,h=C6(e,i)||s.toString()===l.toString()||s.search!==l.search||o;if(i.route.shouldRevalidate){let u=i.route.shouldRevalidate(rt({currentUrl:s,currentParams:c,nextUrl:l,nextParams:d},r,{actionResult:a,defaultShouldRevalidate:h}));if(typeof u=="boolean")return u}return h}async function ss(t,e,r,n,i,o,a,s){i===void 0&&(i="/"),o===void 0&&(o=!1),a===void 0&&(a=!1);let c,l,d,h=new Promise((f,v)=>d=v),u=()=>d();e.signal.addEventListener("abort",u);try{let f=r.route[t];fe(f,"Could not find the "+t+' to run on the "'+r.route.id+'" route'),l=await Promise.race([f({request:e,params:r.params,context:s}),h]),fe(l!==void 0,"You defined "+(t==="action"?"an action":"a loader")+" for route "+('"'+r.route.id+"\" but didn't return anything from your `"+t+"` ")+"function. Please return a value or `null`.")}catch(f){c=zt.error,l=f}finally{e.signal.removeEventListener("abort",u)}if(NS(l)){let f=l.status;if(kS.has(f)){let x=l.headers.get("Location");if(fe(x,"Redirects returned/thrown from loaders/actions must have a Location header"),!(/^[a-z+]+:\/\//i.test(x)||x.startsWith("//"))){let p=n.slice(0,n.indexOf(r)+1),y=w6(p).map(A=>A.pathnameBase),w=gS(x,y,new URL(e.url).pathname);if(fe(Vi(w),"Unable to resolve redirect location: "+x),i){let A=w.pathname;w.pathname=A==="/"?i:_o([i,A])}x=Vi(w)}if(o)throw l.headers.set("Location",x),l;return{type:zt.redirect,status:f,location:x,revalidate:l.headers.get("X-Remix-Revalidate")!==null}}if(a)throw{type:c||zt.data,response:l};let v,g=l.headers.get("Content-Type");return g&&g.startsWith("application/json")?v=await l.json():v=await l.text(),c===zt.error?{type:c,error:new H1(f,l.statusText,v),headers:l.headers}:{type:zt.data,data:v,statusCode:l.status,headers:l.headers}}return c===zt.error?{type:c,error:l}:l instanceof wS?{type:zt.deferred,deferredData:l}:{type:zt.data,data:l}}function cs(t,e,r){let n=xc(S6(t)).toString(),i={signal:e};if(r){let{formMethod:o,formEncType:a,formData:s}=r;i.method=o.toUpperCase(),i.body=a==="application/x-www-form-urlencoded"?z6(s):s}return new Request(n,i)}function z6(t){let e=new URLSearchParams;for(let[r,n]of t.entries())fe(typeof n=="string",'File inputs are not supported with encType "application/x-www-form-urlencoded", please use "multipart/form-data" instead.'),e.append(r,n);return e}function OS(t,e,r,n,i){let o={},a=null,s,c=!1,l={};return r.forEach((d,h)=>{let u=e[h].route.id;if(fe(!Ca(d),"Cannot handle redirect results in processLoaderData"),Bs(d)){let f=pa(t,u),v=d.error;n&&(v=Object.values(n)[0],n=void 0),a=Object.assign(a||{},{[f.route.id]:v}),c||(c=!0,s=x6(d.error)?d.error.status:500),d.headers&&(l[u]=d.headers)}else ho(d)?(i&&i.set(u,d.deferredData),o[u]=d.deferredData.data):(o[u]=d.data,d.statusCode!=null&&d.statusCode!==200&&!c&&(s=d.statusCode),d.headers&&(l[u]=d.headers))}),n&&(a=n),{loaderData:o,errors:a,statusCode:s||200,loaderHeaders:l}}function Hv(t,e,r,n,i,o,a,s){let{loaderData:c,errors:l}=OS(e,r,n,i,s);for(let d=0;d<o.length;d++){let[h,,u]=o[d];fe(a!==void 0&&a[d]!==void 0,"Did not find corresponding fetcher result");let f=a[d];if(Bs(f)){let v=pa(t.matches,u.route.id);l&&l[v.route.id]||(l=rt({},l,{[v.route.id]:f.error})),t.fetchers.delete(h)}else{if(Ca(f))throw new Error("Unhandled fetcher revalidation redirect");if(ho(f))throw new Error("Unhandled fetcher deferred data");{let v={state:"idle",data:f.data,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0};t.fetchers.set(h,v)}}}return{loaderData:c,errors:l}}function Qh(t,e,r){let n=rt({},e);return r.forEach(i=>{let o=i.route.id;e[o]===void 0&&t[o]!==void 0&&(n[o]=t[o])}),n}function pa(t,e){return(e?t.slice(0,t.findIndex(n=>n.route.id===e)+1):[...t]).reverse().find(n=>n.route.hasErrorBoundary===!0)||t[0]}function Lv(t){let e=t.find(r=>r.index||!r.path||r.path==="/")||{id:"__shim-error-route__"};return{matches:[{params:{},pathname:"",pathnameBase:"",route:e}],route:e}}function oo(t,e){let{pathname:r,routeId:n,method:i}=e===void 0?{}:e,o="Unknown Server Error",a="Unknown @remix-run/router error";return t===400?(o="Bad Request",i&&r&&n?a="You made a "+i+' request to "'+r+'" but '+('did not provide a `loader` for route "'+n+'", ')+"so there is no way to handle the request.":a="Cannot submit binary form data using GET"):t===403?(o="Forbidden",a='Route "'+n+'" does not match URL "'+r+'"'):t===404?(o="Not Found",a='No route matches URL "'+r+'"'):t===405&&(o="Method Not Allowed",i&&r&&n?a="You made a "+i.toUpperCase()+' request to "'+r+'" but '+('did not provide an `action` for route "'+n+'", ')+"so there is no way to handle the request.":i&&(a='Invalid request method "'+i.toUpperCase()+'"')),new H1(t||500,o,new Error(a),!0)}function Ov(t){for(let e=t.length-1;e>=0;e--){let r=t[e];if(Ca(r))return r}}function S6(t){let e=typeof t=="string"?ii(t):t;return Vi(rt({},e,{hash:""}))}function DS(t,e){return t.pathname===e.pathname&&t.search===e.search&&t.hash!==e.hash}function ho(t){return t.type===zt.deferred}function Bs(t){return t.type===zt.error}function Ca(t){return(t&&t.type)===zt.redirect}function NS(t){return t!=null&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.headers=="object"&&typeof t.body<"u"}function VS(t){return SS.has(t)}function k6(t){return CS.has(t)}async function Dv(t,e,r,n,i,o){for(let a=0;a<r.length;a++){let s=r[a],c=e[a],l=t.find(h=>h.route.id===c.route.id),d=l!=null&&!C6(l,c)&&(o&&o[c.route.id])!==void 0;ho(s)&&(i||d)&&await A6(s,n,i).then(h=>{h&&(r[a]=h||r[a])})}}async function A6(t,e,r){if(r===void 0&&(r=!1),!await t.deferredData.resolveData(e)){if(r)try{return{type:zt.data,data:t.deferredData.unwrappedData}}catch(i){return{type:zt.error,error:i}}return{type:zt.data,data:t.deferredData.data}}}function T6(t){return new URLSearchParams(t).getAll("index").some(e=>e==="")}function Nv(t,e){let{route:r,pathname:n,params:i}=t;return{id:r.id,pathname:n,params:i,data:e[r.id],handle:r.handle}}function Vv(t,e){let r=typeof e=="string"?ii(e).search:e.search;if(t[t.length-1].route.index&&T6(r||""))return t[t.length-1];let n=w6(t);return n[n.length-1]}function i1(){return i1=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},i1.apply(this,arguments)}function FS(t,e){return t===e&&(t!==0||1/t===1/e)||t!==t&&e!==e}const US=typeof Object.is=="function"?Object.is:FS,{useState:$S,useEffect:jS,useLayoutEffect:BS,useDebugValue:qS}=ru;function GS(t,e,r){const n=e(),[{inst:i},o]=$S({inst:{value:n,getSnapshot:e}});return BS(()=>{i.value=n,i.getSnapshot=e,Xh(i)&&o({inst:i})},[t,n,e]),jS(()=>(Xh(i)&&o({inst:i}),t(()=>{Xh(i)&&o({inst:i})})),[t]),qS(n),n}function Xh(t){const e=t.getSnapshot,r=t.value;try{const n=e();return!US(r,n)}catch{return!0}}function KS(t,e,r){return e()}const WS=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",YS=!WS,QS=YS?KS:GS,XS="useSyncExternalStore"in ru?(t=>t.useSyncExternalStore)(ru):QS,JS=T.createContext(null),I6=T.createContext(null),C0=T.createContext(null),M6=T.createContext(null),L1=T.createContext(null),Oc=T.createContext({outlet:null,matches:[]}),P6=T.createContext(null);function z0(){return T.useContext(L1)!=null}function ZS(){return z0()||fe(!1),T.useContext(L1).location}const ek=T.createContext(null);function tk(t){let e=T.useContext(Oc).outlet;return e&&T.createElement(ek.Provider,{value:t},e)}function rk(){let{matches:t}=T.useContext(Oc),e=t[t.length-1];return e?e.params:{}}function nk(t,e){z0()||fe(!1);let{navigator:r}=T.useContext(M6),n=T.useContext(C0),{matches:i}=T.useContext(Oc),o=i[i.length-1],a=o?o.params:{};o&&o.pathname;let s=o?o.pathnameBase:"/";o&&o.route;let c=ZS(),l;if(e){var d;let g=typeof e=="string"?ii(e):e;s==="/"||((d=g.pathname)==null?void 0:d.startsWith(s))||fe(!1),l=g}else l=c;let h=l.pathname||"/",u=s==="/"?h:h.slice(s.length)||"/",f=Ss(t,{pathname:u}),v=sk(f&&f.map(g=>Object.assign({},g,{params:Object.assign({},a,g.params),pathname:_o([s,r.encodeLocation?r.encodeLocation(g.pathname).pathname:g.pathname]),pathnameBase:g.pathnameBase==="/"?s:_o([s,r.encodeLocation?r.encodeLocation(g.pathnameBase).pathname:g.pathnameBase])})),i,n||void 0);return e&&v?T.createElement(L1.Provider,{value:{location:i1({pathname:"/",search:"",hash:"",state:null,key:"default"},l),navigationType:ht.Pop}},v):v}function ik(){let t=lk(),e=x6(t)?t.status+" "+t.statusText:t instanceof Error?t.message:JSON.stringify(t),r=t instanceof Error?t.stack:null,n="rgba(200,200,200, 0.5)",i={padding:"0.5rem",backgroundColor:n},o={padding:"2px 4px",backgroundColor:n};return T.createElement(T.Fragment,null,T.createElement("h2",null,"Unhandled Thrown Error!"),T.createElement("h3",{style:{fontStyle:"italic"}},e),r?T.createElement("pre",{style:i},r):null,T.createElement("p",null,"💿 Hey developer 👋"),T.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",T.createElement("code",{style:o},"errorElement")," props on ",T.createElement("code",{style:o},"<Route>")))}class ok extends T.Component{constructor(e){super(e),this.state={location:e.location,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,r){return r.location!==e.location?{error:e.error,location:e.location}:{error:e.error||r.error,location:r.location}}componentDidCatch(e,r){console.error("React Router caught the following error during render",e,r)}render(){return this.state.error?T.createElement(P6.Provider,{value:this.state.error,children:this.props.component}):this.props.children}}function ak(t){let{routeContext:e,match:r,children:n}=t,i=T.useContext(JS);return i&&r.route.errorElement&&(i._deepestRenderedBoundaryId=r.route.id),T.createElement(Oc.Provider,{value:e},n)}function sk(t,e,r){if(e===void 0&&(e=[]),t==null)if(r!=null&&r.errors)t=r.matches;else return null;let n=t,i=r==null?void 0:r.errors;if(i!=null){let o=n.findIndex(a=>a.route.id&&(i==null?void 0:i[a.route.id]));o>=0||fe(!1),n=n.slice(0,Math.min(n.length,o+1))}return n.reduceRight((o,a,s)=>{let c=a.route.id?i==null?void 0:i[a.route.id]:null,l=r?a.route.errorElement||T.createElement(ik,null):null,d=()=>T.createElement(ak,{match:a,routeContext:{outlet:o,matches:e.concat(n.slice(0,s+1))}},c?l:a.route.element!==void 0?a.route.element:o);return r&&(a.route.errorElement||s===0)?T.createElement(ok,{location:r.location,component:l,error:c,children:d()}):d()},null)}var Fv;(function(t){t.UseRevalidator="useRevalidator"})(Fv||(Fv={}));var O2;(function(t){t.UseLoaderData="useLoaderData",t.UseActionData="useActionData",t.UseRouteError="useRouteError",t.UseNavigation="useNavigation",t.UseRouteLoaderData="useRouteLoaderData",t.UseMatches="useMatches",t.UseRevalidator="useRevalidator"})(O2||(O2={}));function ck(t){let e=T.useContext(C0);return e||fe(!1),e}function lk(){var t;let e=T.useContext(P6),r=ck(O2.UseRouteError),n=T.useContext(Oc),i=n.matches[n.matches.length-1];return e||(n||fe(!1),i.route.id||fe(!1),(t=r.errors)==null?void 0:t[i.route.id])}function dk(t){let{fallbackElement:e,router:r}=t,n=XS(r.subscribe,()=>r.state,()=>r.state),i=T.useMemo(()=>({createHref:r.createHref,encodeLocation:r.encodeLocation,go:a=>r.navigate(a),push:(a,s,c)=>r.navigate(a,{state:s,preventScrollReset:c==null?void 0:c.preventScrollReset}),replace:(a,s,c)=>r.navigate(a,{replace:!0,state:s,preventScrollReset:c==null?void 0:c.preventScrollReset})}),[r]),o=r.basename||"/";return T.createElement(I6.Provider,{value:{router:r,navigator:i,static:!1,basename:o}},T.createElement(C0.Provider,{value:n},T.createElement(fk,{basename:r.basename,location:r.state.location,navigationType:r.state.historyAction,navigator:i},r.state.initialized?T.createElement(pk,null):e)))}function hk(t){return tk(t.context)}function uk(t){fe(!1)}function fk(t){let{basename:e="/",children:r=null,location:n,navigationType:i=ht.Pop,navigator:o,static:a=!1}=t;z0()&&fe(!1);let s=e.replace(/^\/*/,"/"),c=T.useMemo(()=>({basename:s,navigator:o,static:a}),[s,o,a]);typeof n=="string"&&(n=ii(n));let{pathname:l="/",search:d="",hash:h="",state:u=null,key:f="default"}=n,v=T.useMemo(()=>{let g=b6(l,s);return g==null?null:{pathname:g,search:d,hash:h,state:u,key:f}},[s,l,d,h,u,f]);return v==null?null:T.createElement(M6.Provider,{value:c},T.createElement(L1.Provider,{children:r,value:{location:v,navigationType:i}}))}function pk(t){let{children:e,location:r}=t,n=T.useContext(I6),i=n&&!e?n.router.routes:D2(e);return nk(i,r)}var Uv;(function(t){t[t.pending=0]="pending",t[t.success=1]="success",t[t.error=2]="error"})(Uv||(Uv={}));new Promise(()=>{});function D2(t,e){e===void 0&&(e=[]);let r=[];return T.Children.forEach(t,(n,i)=>{if(!T.isValidElement(n))return;if(n.type===T.Fragment){r.push.apply(r,D2(n.props.children,e));return}n.type!==uk&&fe(!1),!n.props.index||!n.props.children||fe(!1);let o=[...e,i],a={id:n.props.id||o.join("-"),caseSensitive:n.props.caseSensitive,element:n.props.element,index:n.props.index,path:n.props.path,loader:n.props.loader,action:n.props.action,errorElement:n.props.errorElement,hasErrorBoundary:n.props.errorElement!=null,shouldRevalidate:n.props.shouldRevalidate,handle:n.props.handle};n.props.children&&(a.children=D2(n.props.children,o)),r.push(a)}),r}function R6(t){return t.map(e=>{let r=i1({},e);return r.hasErrorBoundary==null&&(r.hasErrorBoundary=r.errorElement!=null),r.children&&(r.children=R6(r.children)),r})}function N2(){return N2=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},N2.apply(this,arguments)}function mk(t,e){return PS({basename:e==null?void 0:e.basename,history:Xz({window:e==null?void 0:e.window}),hydrationData:(e==null?void 0:e.hydrationData)||vk(),routes:R6(t)}).initialize()}function vk(){var t;let e=(t=window)==null?void 0:t.__staticRouterHydrationData;return e&&e.errors&&(e=N2({},e,{errors:gk(e.errors)})),e}function gk(t){if(!t)return null;let e=Object.entries(t),r={};for(let[n,i]of e)i&&i.__type==="RouteErrorResponse"?r[n]=new H1(i.status,i.statusText,i.data,i.internal===!0):r[n]=i;return r}var $v;(function(t){t.UseScrollRestoration="useScrollRestoration",t.UseSubmitImpl="useSubmitImpl",t.UseFetcher="useFetcher"})($v||($v={}));var jv;(function(t){t.UseFetchers="useFetchers",t.UseScrollRestoration="useScrollRestoration"})(jv||(jv={}));const yk=(t,e,r)=>{T.useEffect(()=>{const n=t.subscribe(e);return n.add(r),()=>n.unsubscribe()},[t,e])},_k=(t,e,r)=>{T.useLayoutEffect(()=>{const n=t.subscribe(e);return n.add(r),()=>n.unsubscribe()},[t,e])};function S0(t,e){e??(e=t.value);const[r,n]=T.useState(e);return _k(t,n),r}const V2=({error:t})=>wn(x8,{children:[wn("div",{style:{marginTop:20,border:"1px solid"},children:[Q("h4",{style:{backgroundColor:"rgb(153, 0, 37)",color:"white",padding:10,margin:0},children:t.message}),Q("section",{style:{padding:10},children:t.stack&&Q("pre",{children:t.stack})})]}),t.cause&&Q(V2,{error:t.cause})]}),bk=t=>{const{appKey:e}=t,r=m0(),n=T.useRef(null),i=T.useRef(document.createElement("div")),[o,a]=T.useState(!1),[s,c]=T.useState(),l=S0(r.modules.app.current$);return T.useEffect(()=>{r.modules.app.setCurrentApp(e)},[e]),T.useEffect(()=>{a(!0),c(void 0);const d=new un;return d.add(l==null?void 0:l.initialize().subscribe({next:({manifest:h,script:u,config:f})=>{const[v]=window.location.pathname.match(/\/?apps\/[a-z|-]+(\/)?/g)??[""];i.current=document.createElement("div");const g=u.renderApp??u.default;d.add(g(i.current,{fusion:r,env:{basename:v,config:f,manifest:h}}))},complete:()=>{a(!1)},error:h=>{c(h)}})),()=>d.unsubscribe()},[l,i]),T.useEffect(()=>{const d=n.current,h=i.current;if(!!(h&&d))return d.appendChild(h),()=>{try{d.removeChild(h)}catch(u){console.error(u)}}},[n.current,i.current]),s?s.cause instanceof Pi?wn("div",{children:[Q("h2",{children:"🔥 Failed to load application manifest 🤬"}),Q("h3",{children:s.cause.type}),Q(V2,{error:s}),";"]}):wn("div",{children:[Q("h2",{children:"🔥 Failed to load application 🤬"}),Q(V2,{error:s}),";"]}):o?Q(m6,{text:"Loading Application"}):Q("section",{ref:n})},wk=()=>{const t=m0().modules.app;if(!t)throw Error("Current framework does not have AppModule configured");return{currentApp:S0(t.current$),setCurrentApp:T.useMemo(()=>t.setCurrentApp.bind(t),[t]),clearCurrentApp:T.useMemo(()=>t.clearCurrentApp.bind(t),[t])}};class Na extends CustomEvent{constructor(e){super(Na.eventName,e)}}Na.eventName="fwc-searchabledropdown-controller-connect";class H6 extends qt{constructor(){super(...arguments),this.resolverCallbacks=[]}createRenderRoot(){return this}connectResolver(e){this.resolverCallbacks.forEach(r=>{r(e)})}removeResolver(){this.resolverCallbacks.forEach(e=>{e()})}connectedCallback(){super.connectedCallback(),this.addEventListener(Na.eventName,this.handleElementConnect)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener(Na.eventName,this.handleElementConnect)}handleElementConnect(e){const{disconnectedCallback:r,updateResolver:n}=e.detail;r(()=>{this.resolverCallbacks.filter(i=>i!==n)}),this.resolverCallbacks.push(n),e.preventDefault(),e.stopPropagation()}}const xk=Symbol();class Ek{constructor(e,r,n){this.i=0,this.status=0,this.autoRun=!0,this.o=e,this.o.addController(this);const i=typeof r=="object"?r:{task:r,args:n};this.t=i.task,this.h=i.args,this.l=i.onComplete,this.u=i.onError,i.autoRun!==void 0&&(this.autoRun=i.autoRun),this.taskComplete=new Promise((o,a)=>{this.v=o,this._=a})}hostUpdated(){this.performTask()}async performTask(){var e;const r=(e=this.h)===null||e===void 0?void 0:e.call(this);this.shouldRun(r)&&this.run(r)}shouldRun(e){return this.autoRun&&this.m(e)}async run(e){var r,n,i;let o,a;e!=null||(e=(r=this.h)===null||r===void 0?void 0:r.call(this)),this.status!==2&&this.status!==3||(this.taskComplete=new Promise((c,l)=>{this.v=c,this._=l})),this.status=1,this.o.requestUpdate();const s=++this.i;try{o=await this.t(e)}catch(c){a=c}if(this.i===s){if(o===xk)this.status=0;else{if(a===void 0){try{(n=this.l)===null||n===void 0||n.call(this,o)}catch{}this.status=2,this.v(o)}else{try{(i=this.u)===null||i===void 0||i.call(this,a)}catch{}this.status=3,this._(a)}this.T=o,this.k=a}this.o.requestUpdate()}}get value(){return this.T}get error(){return this.k}render(e){var r,n,i,o;switch(this.status){case 0:return(r=e.initial)===null||r===void 0?void 0:r.call(e);case 1:return(n=e.pending)===null||n===void 0?void 0:n.call(e);case 2:return(i=e.complete)===null||i===void 0?void 0:i.call(e,this.value);case 3:return(o=e.error)===null||o===void 0?void 0:o.call(e,this.error);default:this.status}}m(e){const r=this.p;return this.p=e,Array.isArray(e)&&Array.isArray(r)?e.length===r.length&&e.some((n,i)=>x0(n,r[i])):e!==r}}class O1 extends CustomEvent{constructor(e){super(O1.eventName,e)}}O1.eventName="select";var ks,Qe,id,As;class Ck{constructor(e){this._isOpen=!1,this._listItems=[],this._selectedItems=[],ks.set(this,void 0),Qe.set(this,void 0),id.set(this,""),As.set(this,[]),this.updateResolver=r=>{this.resolver=r,r!=null&&r.initialResult&&(hl(this,As,r.initialResult,"f"),this.task.run()),r!=null&&r.closeHandler&&hl(this,ks,r.closeHandler,"f"),je(this,Qe,"f").requestUpdate()},this._handleWindowClick=r=>{!r.target||r.target.nodeName!==je(this,Qe,"f").nodeName&&(this.isOpen=!1)},this.closeClick=r=>{je(this,Qe,"f").value="";const n=je(this,Qe,"f").renderRoot.querySelector("fwc-textinput");n&&(n.value=""),this.isOpen=!1,je(this,ks,"f")&&je(this,ks,"f").call(this,r)},hl(this,Qe,e,"f"),je(this,Qe,"f").addController(this),this.handleSelect=this.handleSelect.bind(this),this.handleKeyup=this.handleKeyup.bind(this),this.task=new Ek(je(this,Qe,"f"),([r])=>x1(this,void 0,void 0,function*(){var n;if(!(!((n=this.resolver)===null||n===void 0)&&n.searchQuery))return[];let i;return r?i=yield this.resolver.searchQuery(r):je(this,As,"f").length?i=je(this,As,"f"):i=[{id:"initial",title:je(this,Qe,"f").initialText,isDisabled:!0}],this.result=this.mutateResult(i),this.result}),()=>[je(this,id,"f")])}hostConnected(){const e=new Na({detail:{disconnectedCallback:r=>{this.disconnectProvider=r},updateResolver:this.updateResolver},bubbles:!0,composed:!0,cancelable:!1});je(this,Qe,"f").dispatchEvent(e),window.addEventListener("click",this._handleWindowClick)}hostDisconnected(){this.disconnectProvider&&this.disconnectProvider(),window.removeEventListener("click",this._handleWindowClick)}mutateResult(e){var r;if(this._selectedItems.length&&e)for(let n=0;n<e.length;n++){const i=e[n];if(i.type==="section"&&((r=i.children)===null||r===void 0?void 0:r.length))for(let o=0;o<i.children.length;o++){const a=i.children[o];this._selectedItems.find(s=>s.id===a.id)?a.isSelected=!0:a.isSelected=!1}else this._selectedItems.find(o=>o.id===i.id)?i.isSelected=!0:i.isSelected=!1}return e}handleSelect(e){if(e.stopPropagation(),this.result&&this._listItems){const r=this._listItems[e.detail.index];let n;for(const i of this.result)if(i.id===r)n=i;else if(i.children)for(const o of i.children)o.id===r&&(n=o);if(!(n!=null&&n.id))throw new Error("SearchableDropdownController could not find match in result provided by resolver.");je(this,Qe,"f").multiple?this._selectedItems.find(i=>i.id===(n==null?void 0:n.id))?(n.isSelected=!1,this._selectedItems=this._selectedItems.filter(i=>i.id!==(n==null?void 0:n.id)),je(this,Qe,"f").value=""):(n.isSelected=!0,this._selectedItems.push(n),je(this,Qe,"f").value=(n==null?void 0:n.title)||""):(this._selectedItems=[n],je(this,Qe,"f").value=(n==null?void 0:n.title)||"")}else this._selectedItems=[],je(this,Qe,"f").value="";je(this,Qe,"f").dispatchEvent(new O1({detail:{selected:this._selectedItems},bubbles:!0})),this.task.run(),je(this,Qe,"f").requestUpdate()}set isOpen(e){this._isOpen=e,je(this,Qe,"f").trailingIcon=e?"close":"",this._selectedItems&&this.task.run(),je(this,Qe,"f").requestUpdate()}get isOpen(){return this._isOpen}handleKeyup(e){var r,n;const i=e.target;if(e.key==="ArrowDown"){this._isOpen&&((r=this.result)===null||r===void 0?void 0:r.length)&&((n=je(this,Qe,"f").renderRoot.querySelector("fwc-list"))===null||n===void 0||n.focus());return}this.timer&&clearTimeout(this.timer),this.timer=setTimeout(()=>{hl(this,id,i.value.trim().toLowerCase(),"f"),je(this,Qe,"f").requestUpdate()},250)}}ks=new WeakMap,Qe=new WeakMap,id=new WeakMap,As=new WeakMap;const zk="fwc-searchable-dropdown-provider";let Bv=class extends H6{};Bv=b([Yt(zk)],Bv);const ve=t=>t??st;const Vr={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},Dc=t=>(...e)=>({_$litDirective$:t,values:e});let Nc=class{constructor(e){}get _$AU(){return this._$AM._$AU}_$AT(e,r,n){this._$Ct=e,this._$AM=r,this._$Ci=n}_$AS(e,r){return this.update(e,r)}update(e,r){return this.render(...r)}};const Bt=Dc(class extends Nc{constructor(t){var e;if(super(t),t.type!==Vr.ATTRIBUTE||t.name!=="class"||((e=t.strings)===null||e===void 0?void 0:e.length)>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(t){return" "+Object.keys(t).filter(e=>t[e]).join(" ")+" "}update(t,[e]){var r,n;if(this.nt===void 0){this.nt=new Set,t.strings!==void 0&&(this.st=new Set(t.strings.join(" ").split(/\s/).filter(o=>o!=="")));for(const o in e)e[o]&&!(!((r=this.st)===null||r===void 0)&&r.has(o))&&this.nt.add(o);return this.render(e)}const i=t.element.classList;this.nt.forEach(o=>{o in e||(i.remove(o),this.nt.delete(o))});for(const o in e){const a=!!e[o];a===this.nt.has(o)||((n=this.st)===null||n===void 0?void 0:n.has(o))||(a?(i.add(o),this.nt.add(o)):(i.remove(o),this.nt.delete(o)))}return $r}});let Cl;const Sk=new Uint8Array(16);function kk(){if(!Cl&&(Cl=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Cl))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Cl(Sk)}const Et=[];for(let t=0;t<256;++t)Et.push((t+256).toString(16).slice(1));function Ak(t,e=0){return(Et[t[e+0]]+Et[t[e+1]]+Et[t[e+2]]+Et[t[e+3]]+"-"+Et[t[e+4]]+Et[t[e+5]]+"-"+Et[t[e+6]]+Et[t[e+7]]+"-"+Et[t[e+8]]+Et[t[e+9]]+"-"+Et[t[e+10]]+Et[t[e+11]]+Et[t[e+12]]+Et[t[e+13]]+Et[t[e+14]]+Et[t[e+15]]).toLowerCase()}const Tk=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),qv={randomUUID:Tk};function Gv(t,e,r){if(qv.randomUUID&&!e&&!t)return qv.randomUUID();t=t||{};const n=t.random||(t.rng||kk)();if(n[6]=n[6]&15|64,n[8]=n[8]&63|128,e){r=r||0;for(let i=0;i<16;++i)e[r+i]=n[i];return e}return Ak(n)}function Ik(t,e){var r=t.matches||t.webkitMatchesSelector||t.msMatchesSelector;return r.call(t,e)}const Mk=t=>t.nodeType===Node.ELEMENT_NODE;function L6(t){return{addClass:e=>{t.classList.add(e)},removeClass:e=>{t.classList.remove(e)},hasClass:e=>t.classList.contains(e)}}const O6=()=>{},Pk={get passive(){return!1}};document.addEventListener("x",O6,Pk);document.removeEventListener("x",O6);const D6=(t=window.document)=>{let e=t.activeElement;const r=[];if(!e)return r;for(;e&&(r.push(e),e.shadowRoot);)e=e.shadowRoot.activeElement;return r},Rk=t=>{const e=D6();if(!e.length)return!1;const r=e[e.length-1],n=new Event("check-if-focused",{bubbles:!0,composed:!0});let i=[];const o=a=>{i=a.composedPath()};return document.body.addEventListener("check-if-focused",o),r.dispatchEvent(n),document.body.removeEventListener("check-if-focused",o),i.indexOf(t)!==-1};class D1 extends qt{click(){if(this.mdcRoot){this.mdcRoot.focus(),this.mdcRoot.click();return}super.click()}createFoundation(){this.mdcFoundation!==void 0&&this.mdcFoundation.destroy(),this.mdcFoundationClass&&(this.mdcFoundation=new this.mdcFoundationClass(this.createAdapter()),this.mdcFoundation.init())}firstUpdated(){this.createFoundation()}}var Io=function(){function t(e){e===void 0&&(e={}),this.adapter=e}return Object.defineProperty(t,"cssClasses",{get:function(){return{}},enumerable:!1,configurable:!0}),Object.defineProperty(t,"strings",{get:function(){return{}},enumerable:!1,configurable:!0}),Object.defineProperty(t,"numbers",{get:function(){return{}},enumerable:!1,configurable:!0}),Object.defineProperty(t,"defaultAdapter",{get:function(){return{}},enumerable:!1,configurable:!0}),t.prototype.init=function(){},t.prototype.destroy=function(){},t}();var Hk={BG_FOCUSED:"mdc-ripple-upgraded--background-focused",FG_ACTIVATION:"mdc-ripple-upgraded--foreground-activation",FG_DEACTIVATION:"mdc-ripple-upgraded--foreground-deactivation",ROOT:"mdc-ripple-upgraded",UNBOUNDED:"mdc-ripple-upgraded--unbounded"},Lk={VAR_FG_SCALE:"--mdc-ripple-fg-scale",VAR_FG_SIZE:"--mdc-ripple-fg-size",VAR_FG_TRANSLATE_END:"--mdc-ripple-fg-translate-end",VAR_FG_TRANSLATE_START:"--mdc-ripple-fg-translate-start",VAR_LEFT:"--mdc-ripple-left",VAR_TOP:"--mdc-ripple-top"},Kv={DEACTIVATION_TIMEOUT_MS:225,FG_DEACTIVATION_MS:150,INITIAL_ORIGIN_SCALE:.6,PADDING:10,TAP_DELAY_MS:300};function Ok(t,e,r){if(!t)return{x:0,y:0};var n=e.x,i=e.y,o=n+r.left,a=i+r.top,s,c;if(t.type==="touchstart"){var l=t;s=l.changedTouches[0].pageX-o,c=l.changedTouches[0].pageY-a}else{var d=t;s=d.pageX-o,c=d.pageY-a}return{x:s,y:c}}var Wv=["touchstart","pointerdown","mousedown","keydown"],Yv=["touchend","pointerup","mouseup","contextmenu"],zl=[],Dk=function(t){Wt(e,t);function e(r){var n=t.call(this,lt(lt({},e.defaultAdapter),r))||this;return n.activationAnimationHasEnded=!1,n.activationTimer=0,n.fgDeactivationRemovalTimer=0,n.fgScale="0",n.frame={width:0,height:0},n.initialSize=0,n.layoutFrame=0,n.maxRadius=0,n.unboundedCoords={left:0,top:0},n.activationState=n.defaultActivationState(),n.activationTimerCallback=function(){n.activationAnimationHasEnded=!0,n.runDeactivationUXLogicIfReady()},n.activateHandler=function(i){n.activateImpl(i)},n.deactivateHandler=function(){n.deactivateImpl()},n.focusHandler=function(){n.handleFocus()},n.blurHandler=function(){n.handleBlur()},n.resizeHandler=function(){n.layout()},n}return Object.defineProperty(e,"cssClasses",{get:function(){return Hk},enumerable:!1,configurable:!0}),Object.defineProperty(e,"strings",{get:function(){return Lk},enumerable:!1,configurable:!0}),Object.defineProperty(e,"numbers",{get:function(){return Kv},enumerable:!1,configurable:!0}),Object.defineProperty(e,"defaultAdapter",{get:function(){return{addClass:function(){},browserSupportsCssVars:function(){return!0},computeBoundingRect:function(){return{top:0,right:0,bottom:0,left:0,width:0,height:0}},containsEventTarget:function(){return!0},deregisterDocumentInteractionHandler:function(){},deregisterInteractionHandler:function(){},deregisterResizeHandler:function(){},getWindowPageOffset:function(){return{x:0,y:0}},isSurfaceActive:function(){return!0},isSurfaceDisabled:function(){return!0},isUnbounded:function(){return!0},registerDocumentInteractionHandler:function(){},registerInteractionHandler:function(){},registerResizeHandler:function(){},removeClass:function(){},updateCssVariable:function(){}}},enumerable:!1,configurable:!0}),e.prototype.init=function(){var r=this,n=this.supportsPressRipple();if(this.registerRootHandlers(n),n){var i=e.cssClasses,o=i.ROOT,a=i.UNBOUNDED;requestAnimationFrame(function(){r.adapter.addClass(o),r.adapter.isUnbounded()&&(r.adapter.addClass(a),r.layoutInternal())})}},e.prototype.destroy=function(){var r=this;if(this.supportsPressRipple()){this.activationTimer&&(clearTimeout(this.activationTimer),this.activationTimer=0,this.adapter.removeClass(e.cssClasses.FG_ACTIVATION)),this.fgDeactivationRemovalTimer&&(clearTimeout(this.fgDeactivationRemovalTimer),this.fgDeactivationRemovalTimer=0,this.adapter.removeClass(e.cssClasses.FG_DEACTIVATION));var n=e.cssClasses,i=n.ROOT,o=n.UNBOUNDED;requestAnimationFrame(function(){r.adapter.removeClass(i),r.adapter.removeClass(o),r.removeCssVars()})}this.deregisterRootHandlers(),this.deregisterDeactivationHandlers()},e.prototype.activate=function(r){this.activateImpl(r)},e.prototype.deactivate=function(){this.deactivateImpl()},e.prototype.layout=function(){var r=this;this.layoutFrame&&cancelAnimationFrame(this.layoutFrame),this.layoutFrame=requestAnimationFrame(function(){r.layoutInternal(),r.layoutFrame=0})},e.prototype.setUnbounded=function(r){var n=e.cssClasses.UNBOUNDED;r?this.adapter.addClass(n):this.adapter.removeClass(n)},e.prototype.handleFocus=function(){var r=this;requestAnimationFrame(function(){return r.adapter.addClass(e.cssClasses.BG_FOCUSED)})},e.prototype.handleBlur=function(){var r=this;requestAnimationFrame(function(){return r.adapter.removeClass(e.cssClasses.BG_FOCUSED)})},e.prototype.supportsPressRipple=function(){return this.adapter.browserSupportsCssVars()},e.prototype.defaultActivationState=function(){return{activationEvent:void 0,hasDeactivationUXRun:!1,isActivated:!1,isProgrammatic:!1,wasActivatedByPointer:!1,wasElementMadeActive:!1}},e.prototype.registerRootHandlers=function(r){var n,i;if(r){try{for(var o=tr(Wv),a=o.next();!a.done;a=o.next()){var s=a.value;this.adapter.registerInteractionHandler(s,this.activateHandler)}}catch(c){n={error:c}}finally{try{a&&!a.done&&(i=o.return)&&i.call(o)}finally{if(n)throw n.error}}this.adapter.isUnbounded()&&this.adapter.registerResizeHandler(this.resizeHandler)}this.adapter.registerInteractionHandler("focus",this.focusHandler),this.adapter.registerInteractionHandler("blur",this.blurHandler)},e.prototype.registerDeactivationHandlers=function(r){var n,i;if(r.type==="keydown")this.adapter.registerInteractionHandler("keyup",this.deactivateHandler);else try{for(var o=tr(Yv),a=o.next();!a.done;a=o.next()){var s=a.value;this.adapter.registerDocumentInteractionHandler(s,this.deactivateHandler)}}catch(c){n={error:c}}finally{try{a&&!a.done&&(i=o.return)&&i.call(o)}finally{if(n)throw n.error}}},e.prototype.deregisterRootHandlers=function(){var r,n;try{for(var i=tr(Wv),o=i.next();!o.done;o=i.next()){var a=o.value;this.adapter.deregisterInteractionHandler(a,this.activateHandler)}}catch(s){r={error:s}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}this.adapter.deregisterInteractionHandler("focus",this.focusHandler),this.adapter.deregisterInteractionHandler("blur",this.blurHandler),this.adapter.isUnbounded()&&this.adapter.deregisterResizeHandler(this.resizeHandler)},e.prototype.deregisterDeactivationHandlers=function(){var r,n;this.adapter.deregisterInteractionHandler("keyup",this.deactivateHandler);try{for(var i=tr(Yv),o=i.next();!o.done;o=i.next()){var a=o.value;this.adapter.deregisterDocumentInteractionHandler(a,this.deactivateHandler)}}catch(s){r={error:s}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}},e.prototype.removeCssVars=function(){var r=this,n=e.strings,i=Object.keys(n);i.forEach(function(o){o.indexOf("VAR_")===0&&r.adapter.updateCssVariable(n[o],null)})},e.prototype.activateImpl=function(r){var n=this;if(!this.adapter.isSurfaceDisabled()){var i=this.activationState;if(!i.isActivated){var o=this.previousActivationEvent,a=o&&r!==void 0&&o.type!==r.type;if(!a){i.isActivated=!0,i.isProgrammatic=r===void 0,i.activationEvent=r,i.wasActivatedByPointer=i.isProgrammatic?!1:r!==void 0&&(r.type==="mousedown"||r.type==="touchstart"||r.type==="pointerdown");var s=r!==void 0&&zl.length>0&&zl.some(function(c){return n.adapter.containsEventTarget(c)});if(s){this.resetActivationState();return}r!==void 0&&(zl.push(r.target),this.registerDeactivationHandlers(r)),i.wasElementMadeActive=this.checkElementMadeActive(r),i.wasElementMadeActive&&this.animateActivation(),requestAnimationFrame(function(){zl=[],!i.wasElementMadeActive&&r!==void 0&&(r.key===" "||r.keyCode===32)&&(i.wasElementMadeActive=n.checkElementMadeActive(r),i.wasElementMadeActive&&n.animateActivation()),i.wasElementMadeActive||(n.activationState=n.defaultActivationState())})}}}},e.prototype.checkElementMadeActive=function(r){return r!==void 0&&r.type==="keydown"?this.adapter.isSurfaceActive():!0},e.prototype.animateActivation=function(){var r=this,n=e.strings,i=n.VAR_FG_TRANSLATE_START,o=n.VAR_FG_TRANSLATE_END,a=e.cssClasses,s=a.FG_DEACTIVATION,c=a.FG_ACTIVATION,l=e.numbers.DEACTIVATION_TIMEOUT_MS;this.layoutInternal();var d="",h="";if(!this.adapter.isUnbounded()){var u=this.getFgTranslationCoordinates(),f=u.startPoint,v=u.endPoint;d=f.x+"px, "+f.y+"px",h=v.x+"px, "+v.y+"px"}this.adapter.updateCssVariable(i,d),this.adapter.updateCssVariable(o,h),clearTimeout(this.activationTimer),clearTimeout(this.fgDeactivationRemovalTimer),this.rmBoundedActivationClasses(),this.adapter.removeClass(s),this.adapter.computeBoundingRect(),this.adapter.addClass(c),this.activationTimer=setTimeout(function(){r.activationTimerCallback()},l)},e.prototype.getFgTranslationCoordinates=function(){var r=this.activationState,n=r.activationEvent,i=r.wasActivatedByPointer,o;i?o=Ok(n,this.adapter.getWindowPageOffset(),this.adapter.computeBoundingRect()):o={x:this.frame.width/2,y:this.frame.height/2},o={x:o.x-this.initialSize/2,y:o.y-this.initialSize/2};var a={x:this.frame.width/2-this.initialSize/2,y:this.frame.height/2-this.initialSize/2};return{startPoint:o,endPoint:a}},e.prototype.runDeactivationUXLogicIfReady=function(){var r=this,n=e.cssClasses.FG_DEACTIVATION,i=this.activationState,o=i.hasDeactivationUXRun,a=i.isActivated,s=o||!a;s&&this.activationAnimationHasEnded&&(this.rmBoundedActivationClasses(),this.adapter.addClass(n),this.fgDeactivationRemovalTimer=setTimeout(function(){r.adapter.removeClass(n)},Kv.FG_DEACTIVATION_MS))},e.prototype.rmBoundedActivationClasses=function(){var r=e.cssClasses.FG_ACTIVATION;this.adapter.removeClass(r),this.activationAnimationHasEnded=!1,this.adapter.computeBoundingRect()},e.prototype.resetActivationState=function(){var r=this;this.previousActivationEvent=this.activationState.activationEvent,this.activationState=this.defaultActivationState(),setTimeout(function(){return r.previousActivationEvent=void 0},e.numbers.TAP_DELAY_MS)},e.prototype.deactivateImpl=function(){var r=this,n=this.activationState;if(!!n.isActivated){var i=lt({},n);n.isProgrammatic?(requestAnimationFrame(function(){r.animateDeactivation(i)}),this.resetActivationState()):(this.deregisterDeactivationHandlers(),requestAnimationFrame(function(){r.activationState.hasDeactivationUXRun=!0,r.animateDeactivation(i),r.resetActivationState()}))}},e.prototype.animateDeactivation=function(r){var n=r.wasActivatedByPointer,i=r.wasElementMadeActive;(n||i)&&this.runDeactivationUXLogicIfReady()},e.prototype.layoutInternal=function(){var r=this;this.frame=this.adapter.computeBoundingRect();var n=Math.max(this.frame.height,this.frame.width),i=function(){var a=Math.sqrt(Math.pow(r.frame.width,2)+Math.pow(r.frame.height,2));return a+e.numbers.PADDING};this.maxRadius=this.adapter.isUnbounded()?n:i();var o=Math.floor(n*e.numbers.INITIAL_ORIGIN_SCALE);this.adapter.isUnbounded()&&o%2!==0?this.initialSize=o-1:this.initialSize=o,this.fgScale=""+this.maxRadius/this.initialSize,this.updateLayoutCssVars()},e.prototype.updateLayoutCssVars=function(){var r=e.strings,n=r.VAR_FG_SIZE,i=r.VAR_LEFT,o=r.VAR_TOP,a=r.VAR_FG_SCALE;this.adapter.updateCssVariable(n,this.initialSize+"px"),this.adapter.updateCssVariable(a,this.fgScale),this.adapter.isUnbounded()&&(this.unboundedCoords={left:Math.round(this.frame.width/2-this.initialSize/2),top:Math.round(this.frame.height/2-this.initialSize/2)},this.adapter.updateCssVariable(i,this.unboundedCoords.left+"px"),this.adapter.updateCssVariable(o,this.unboundedCoords.top+"px"))},e}(Io);const Nk=Dk;const Vk=Dc(class extends Nc{constructor(t){var e;if(super(t),t.type!==Vr.ATTRIBUTE||t.name!=="style"||((e=t.strings)===null||e===void 0?void 0:e.length)>2)throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.")}render(t){return Object.keys(t).reduce((e,r)=>{const n=t[r];return n==null?e:e+`${r=r.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,"-$&").toLowerCase()}:${n};`},"")}update(t,[e]){const{style:r}=t.element;if(this.vt===void 0){this.vt=new Set;for(const n in e)this.vt.add(n);return this.render(e)}this.vt.forEach(n=>{e[n]==null&&(this.vt.delete(n),n.includes("-")?r.removeProperty(n):r[n]="")});for(const n in e){const i=e[n];i!=null&&(this.vt.add(n),n.includes("-")?r.setProperty(n,i):r[n]=i)}return $r}});class vt extends D1{constructor(){super(...arguments),this.primary=!1,this.accent=!1,this.unbounded=!1,this.disabled=!1,this.activated=!1,this.selected=!1,this.internalUseStateLayerCustomProperties=!1,this.hovering=!1,this.bgFocused=!1,this.fgActivation=!1,this.fgDeactivation=!1,this.fgScale="",this.fgSize="",this.translateStart="",this.translateEnd="",this.leftPos="",this.topPos="",this.mdcFoundationClass=Nk}get isActive(){return Ik(this.parentElement||this,":active")}createAdapter(){return{browserSupportsCssVars:()=>!0,isUnbounded:()=>this.unbounded,isSurfaceActive:()=>this.isActive,isSurfaceDisabled:()=>this.disabled,addClass:e=>{switch(e){case"mdc-ripple-upgraded--background-focused":this.bgFocused=!0;break;case"mdc-ripple-upgraded--foreground-activation":this.fgActivation=!0;break;case"mdc-ripple-upgraded--foreground-deactivation":this.fgDeactivation=!0;break}},removeClass:e=>{switch(e){case"mdc-ripple-upgraded--background-focused":this.bgFocused=!1;break;case"mdc-ripple-upgraded--foreground-activation":this.fgActivation=!1;break;case"mdc-ripple-upgraded--foreground-deactivation":this.fgDeactivation=!1;break}},containsEventTarget:()=>!0,registerInteractionHandler:()=>{},deregisterInteractionHandler:()=>{},registerDocumentInteractionHandler:()=>{},deregisterDocumentInteractionHandler:()=>{},registerResizeHandler:()=>{},deregisterResizeHandler:()=>{},updateCssVariable:(e,r)=>{switch(e){case"--mdc-ripple-fg-scale":this.fgScale=r;break;case"--mdc-ripple-fg-size":this.fgSize=r;break;case"--mdc-ripple-fg-translate-end":this.translateEnd=r;break;case"--mdc-ripple-fg-translate-start":this.translateStart=r;break;case"--mdc-ripple-left":this.leftPos=r;break;case"--mdc-ripple-top":this.topPos=r;break}},computeBoundingRect:()=>(this.parentElement||this).getBoundingClientRect(),getWindowPageOffset:()=>({x:window.pageXOffset,y:window.pageYOffset})}}startPress(e){this.waitForFoundation(()=>{this.mdcFoundation.activate(e)})}endPress(){this.waitForFoundation(()=>{this.mdcFoundation.deactivate()})}startFocus(){this.waitForFoundation(()=>{this.mdcFoundation.handleFocus()})}endFocus(){this.waitForFoundation(()=>{this.mdcFoundation.handleBlur()})}startHover(){this.hovering=!0}endHover(){this.hovering=!1}waitForFoundation(e){this.mdcFoundation?e():this.updateComplete.then(e)}update(e){e.has("disabled")&&this.disabled&&this.endHover(),super.update(e)}render(){const e=this.activated&&(this.primary||!this.accent),r=this.selected&&(this.primary||!this.accent),n={"mdc-ripple-surface--accent":this.accent,"mdc-ripple-surface--primary--activated":e,"mdc-ripple-surface--accent--activated":this.accent&&this.activated,"mdc-ripple-surface--primary--selected":r,"mdc-ripple-surface--accent--selected":this.accent&&this.selected,"mdc-ripple-surface--disabled":this.disabled,"mdc-ripple-surface--hover":this.hovering,"mdc-ripple-surface--primary":this.primary,"mdc-ripple-surface--selected":this.selected,"mdc-ripple-upgraded--background-focused":this.bgFocused,"mdc-ripple-upgraded--foreground-activation":this.fgActivation,"mdc-ripple-upgraded--foreground-deactivation":this.fgDeactivation,"mdc-ripple-upgraded--unbounded":this.unbounded,"mdc-ripple-surface--internal-use-state-layer-custom-properties":this.internalUseStateLayerCustomProperties};return q`
|
|
293
293
|
<div class="mdc-ripple-surface mdc-ripple-upgraded ${Bt(n)}"
|
|
294
294
|
style="${Vk({"--mdc-ripple-fg-scale":this.fgScale,"--mdc-ripple-fg-size":this.fgSize,"--mdc-ripple-fg-translate-end":this.translateEnd,"--mdc-ripple-fg-translate-start":this.translateStart,"--mdc-ripple-left":this.leftPos,"--mdc-ripple-top":this.topPos})}"></div>`}}b([Qt(".mdc-ripple-surface")],vt.prototype,"mdcRoot",void 0);b([E({type:Boolean})],vt.prototype,"primary",void 0);b([E({type:Boolean})],vt.prototype,"accent",void 0);b([E({type:Boolean})],vt.prototype,"unbounded",void 0);b([E({type:Boolean})],vt.prototype,"disabled",void 0);b([E({type:Boolean})],vt.prototype,"activated",void 0);b([E({type:Boolean})],vt.prototype,"selected",void 0);b([E({type:Boolean})],vt.prototype,"internalUseStateLayerCustomProperties",void 0);b([Ye()],vt.prototype,"hovering",void 0);b([Ye()],vt.prototype,"bgFocused",void 0);b([Ye()],vt.prototype,"fgActivation",void 0);b([Ye()],vt.prototype,"fgDeactivation",void 0);b([Ye()],vt.prototype,"fgScale",void 0);b([Ye()],vt.prototype,"fgSize",void 0);b([Ye()],vt.prototype,"translateStart",void 0);b([Ye()],vt.prototype,"translateEnd",void 0);b([Ye()],vt.prototype,"leftPos",void 0);b([Ye()],vt.prototype,"topPos",void 0);const Fk=ue`.mdc-ripple-surface{--mdc-ripple-fg-size: 0;--mdc-ripple-left: 0;--mdc-ripple-top: 0;--mdc-ripple-fg-scale: 1;--mdc-ripple-fg-translate-end: 0;--mdc-ripple-fg-translate-start: 0;-webkit-tap-highlight-color:rgba(0,0,0,0);will-change:transform,opacity;position:relative;outline:none;overflow:hidden}.mdc-ripple-surface::before,.mdc-ripple-surface::after{position:absolute;border-radius:50%;opacity:0;pointer-events:none;content:""}.mdc-ripple-surface::before{transition:opacity 15ms linear,background-color 15ms linear;z-index:1;z-index:var(--mdc-ripple-z-index, 1)}.mdc-ripple-surface::after{z-index:0;z-index:var(--mdc-ripple-z-index, 0)}.mdc-ripple-surface.mdc-ripple-upgraded::before{transform:scale(var(--mdc-ripple-fg-scale, 1))}.mdc-ripple-surface.mdc-ripple-upgraded::after{top:0;left:0;transform:scale(0);transform-origin:center center}.mdc-ripple-surface.mdc-ripple-upgraded--unbounded::after{top:var(--mdc-ripple-top, 0);left:var(--mdc-ripple-left, 0)}.mdc-ripple-surface.mdc-ripple-upgraded--foreground-activation::after{animation:mdc-ripple-fg-radius-in 225ms forwards,mdc-ripple-fg-opacity-in 75ms forwards}.mdc-ripple-surface.mdc-ripple-upgraded--foreground-deactivation::after{animation:mdc-ripple-fg-opacity-out 150ms;transform:translate(var(--mdc-ripple-fg-translate-end, 0)) scale(var(--mdc-ripple-fg-scale, 1))}.mdc-ripple-surface::before,.mdc-ripple-surface::after{top:calc(50% - 100%);left:calc(50% - 100%);width:200%;height:200%}.mdc-ripple-surface.mdc-ripple-upgraded::after{width:var(--mdc-ripple-fg-size, 100%);height:var(--mdc-ripple-fg-size, 100%)}.mdc-ripple-surface[data-mdc-ripple-is-unbounded],.mdc-ripple-upgraded--unbounded{overflow:visible}.mdc-ripple-surface[data-mdc-ripple-is-unbounded]::before,.mdc-ripple-surface[data-mdc-ripple-is-unbounded]::after,.mdc-ripple-upgraded--unbounded::before,.mdc-ripple-upgraded--unbounded::after{top:calc(50% - 50%);left:calc(50% - 50%);width:100%;height:100%}.mdc-ripple-surface[data-mdc-ripple-is-unbounded].mdc-ripple-upgraded::before,.mdc-ripple-surface[data-mdc-ripple-is-unbounded].mdc-ripple-upgraded::after,.mdc-ripple-upgraded--unbounded.mdc-ripple-upgraded::before,.mdc-ripple-upgraded--unbounded.mdc-ripple-upgraded::after{top:var(--mdc-ripple-top, calc(50% - 50%));left:var(--mdc-ripple-left, calc(50% - 50%));width:var(--mdc-ripple-fg-size, 100%);height:var(--mdc-ripple-fg-size, 100%)}.mdc-ripple-surface[data-mdc-ripple-is-unbounded].mdc-ripple-upgraded::after,.mdc-ripple-upgraded--unbounded.mdc-ripple-upgraded::after{width:var(--mdc-ripple-fg-size, 100%);height:var(--mdc-ripple-fg-size, 100%)}.mdc-ripple-surface::before,.mdc-ripple-surface::after{background-color:#000;background-color:var(--mdc-ripple-color, #000)}.mdc-ripple-surface:hover::before,.mdc-ripple-surface.mdc-ripple-surface--hover::before{opacity:0.04;opacity:var(--mdc-ripple-hover-opacity, 0.04)}.mdc-ripple-surface.mdc-ripple-upgraded--background-focused::before,.mdc-ripple-surface:not(.mdc-ripple-upgraded):focus::before{transition-duration:75ms;opacity:0.12;opacity:var(--mdc-ripple-focus-opacity, 0.12)}.mdc-ripple-surface:not(.mdc-ripple-upgraded)::after{transition:opacity 150ms linear}.mdc-ripple-surface:not(.mdc-ripple-upgraded):active::after{transition-duration:75ms;opacity:0.12;opacity:var(--mdc-ripple-press-opacity, 0.12)}.mdc-ripple-surface.mdc-ripple-upgraded{--mdc-ripple-fg-opacity:var(--mdc-ripple-press-opacity, 0.12)}@keyframes mdc-ripple-fg-radius-in{from{animation-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transform:translate(var(--mdc-ripple-fg-translate-start, 0)) scale(1)}to{transform:translate(var(--mdc-ripple-fg-translate-end, 0)) scale(var(--mdc-ripple-fg-scale, 1))}}@keyframes mdc-ripple-fg-opacity-in{from{animation-timing-function:linear;opacity:0}to{opacity:var(--mdc-ripple-fg-opacity, 0)}}@keyframes mdc-ripple-fg-opacity-out{from{animation-timing-function:linear;opacity:var(--mdc-ripple-fg-opacity, 0)}to{opacity:0}}:host{position:absolute;top:0;left:0;width:100%;height:100%;pointer-events:none;display:block}:host .mdc-ripple-surface{position:absolute;top:0;left:0;width:100%;height:100%;pointer-events:none;will-change:unset}.mdc-ripple-surface--primary::before,.mdc-ripple-surface--primary::after{background-color:#6200ee;background-color:var(--mdc-ripple-color, var(--mdc-theme-primary, #6200ee))}.mdc-ripple-surface--primary:hover::before,.mdc-ripple-surface--primary.mdc-ripple-surface--hover::before{opacity:0.04;opacity:var(--mdc-ripple-hover-opacity, 0.04)}.mdc-ripple-surface--primary.mdc-ripple-upgraded--background-focused::before,.mdc-ripple-surface--primary:not(.mdc-ripple-upgraded):focus::before{transition-duration:75ms;opacity:0.12;opacity:var(--mdc-ripple-focus-opacity, 0.12)}.mdc-ripple-surface--primary:not(.mdc-ripple-upgraded)::after{transition:opacity 150ms linear}.mdc-ripple-surface--primary:not(.mdc-ripple-upgraded):active::after{transition-duration:75ms;opacity:0.12;opacity:var(--mdc-ripple-press-opacity, 0.12)}.mdc-ripple-surface--primary.mdc-ripple-upgraded{--mdc-ripple-fg-opacity:var(--mdc-ripple-press-opacity, 0.12)}.mdc-ripple-surface--primary--activated::before{opacity:0.12;opacity:var(--mdc-ripple-activated-opacity, 0.12)}.mdc-ripple-surface--primary--activated::before,.mdc-ripple-surface--primary--activated::after{background-color:#6200ee;background-color:var(--mdc-ripple-color, var(--mdc-theme-primary, #6200ee))}.mdc-ripple-surface--primary--activated:hover::before,.mdc-ripple-surface--primary--activated.mdc-ripple-surface--hover::before{opacity:0.16;opacity:var(--mdc-ripple-hover-opacity, 0.16)}.mdc-ripple-surface--primary--activated.mdc-ripple-upgraded--background-focused::before,.mdc-ripple-surface--primary--activated:not(.mdc-ripple-upgraded):focus::before{transition-duration:75ms;opacity:0.24;opacity:var(--mdc-ripple-focus-opacity, 0.24)}.mdc-ripple-surface--primary--activated:not(.mdc-ripple-upgraded)::after{transition:opacity 150ms linear}.mdc-ripple-surface--primary--activated:not(.mdc-ripple-upgraded):active::after{transition-duration:75ms;opacity:0.24;opacity:var(--mdc-ripple-press-opacity, 0.24)}.mdc-ripple-surface--primary--activated.mdc-ripple-upgraded{--mdc-ripple-fg-opacity:var(--mdc-ripple-press-opacity, 0.24)}.mdc-ripple-surface--primary--selected::before{opacity:0.08;opacity:var(--mdc-ripple-selected-opacity, 0.08)}.mdc-ripple-surface--primary--selected::before,.mdc-ripple-surface--primary--selected::after{background-color:#6200ee;background-color:var(--mdc-ripple-color, var(--mdc-theme-primary, #6200ee))}.mdc-ripple-surface--primary--selected:hover::before,.mdc-ripple-surface--primary--selected.mdc-ripple-surface--hover::before{opacity:0.12;opacity:var(--mdc-ripple-hover-opacity, 0.12)}.mdc-ripple-surface--primary--selected.mdc-ripple-upgraded--background-focused::before,.mdc-ripple-surface--primary--selected:not(.mdc-ripple-upgraded):focus::before{transition-duration:75ms;opacity:0.2;opacity:var(--mdc-ripple-focus-opacity, 0.2)}.mdc-ripple-surface--primary--selected:not(.mdc-ripple-upgraded)::after{transition:opacity 150ms linear}.mdc-ripple-surface--primary--selected:not(.mdc-ripple-upgraded):active::after{transition-duration:75ms;opacity:0.2;opacity:var(--mdc-ripple-press-opacity, 0.2)}.mdc-ripple-surface--primary--selected.mdc-ripple-upgraded{--mdc-ripple-fg-opacity:var(--mdc-ripple-press-opacity, 0.2)}.mdc-ripple-surface--accent::before,.mdc-ripple-surface--accent::after{background-color:#018786;background-color:var(--mdc-ripple-color, var(--mdc-theme-secondary, #018786))}.mdc-ripple-surface--accent:hover::before,.mdc-ripple-surface--accent.mdc-ripple-surface--hover::before{opacity:0.04;opacity:var(--mdc-ripple-hover-opacity, 0.04)}.mdc-ripple-surface--accent.mdc-ripple-upgraded--background-focused::before,.mdc-ripple-surface--accent:not(.mdc-ripple-upgraded):focus::before{transition-duration:75ms;opacity:0.12;opacity:var(--mdc-ripple-focus-opacity, 0.12)}.mdc-ripple-surface--accent:not(.mdc-ripple-upgraded)::after{transition:opacity 150ms linear}.mdc-ripple-surface--accent:not(.mdc-ripple-upgraded):active::after{transition-duration:75ms;opacity:0.12;opacity:var(--mdc-ripple-press-opacity, 0.12)}.mdc-ripple-surface--accent.mdc-ripple-upgraded{--mdc-ripple-fg-opacity:var(--mdc-ripple-press-opacity, 0.12)}.mdc-ripple-surface--accent--activated::before{opacity:0.12;opacity:var(--mdc-ripple-activated-opacity, 0.12)}.mdc-ripple-surface--accent--activated::before,.mdc-ripple-surface--accent--activated::after{background-color:#018786;background-color:var(--mdc-ripple-color, var(--mdc-theme-secondary, #018786))}.mdc-ripple-surface--accent--activated:hover::before,.mdc-ripple-surface--accent--activated.mdc-ripple-surface--hover::before{opacity:0.16;opacity:var(--mdc-ripple-hover-opacity, 0.16)}.mdc-ripple-surface--accent--activated.mdc-ripple-upgraded--background-focused::before,.mdc-ripple-surface--accent--activated:not(.mdc-ripple-upgraded):focus::before{transition-duration:75ms;opacity:0.24;opacity:var(--mdc-ripple-focus-opacity, 0.24)}.mdc-ripple-surface--accent--activated:not(.mdc-ripple-upgraded)::after{transition:opacity 150ms linear}.mdc-ripple-surface--accent--activated:not(.mdc-ripple-upgraded):active::after{transition-duration:75ms;opacity:0.24;opacity:var(--mdc-ripple-press-opacity, 0.24)}.mdc-ripple-surface--accent--activated.mdc-ripple-upgraded{--mdc-ripple-fg-opacity:var(--mdc-ripple-press-opacity, 0.24)}.mdc-ripple-surface--accent--selected::before{opacity:0.08;opacity:var(--mdc-ripple-selected-opacity, 0.08)}.mdc-ripple-surface--accent--selected::before,.mdc-ripple-surface--accent--selected::after{background-color:#018786;background-color:var(--mdc-ripple-color, var(--mdc-theme-secondary, #018786))}.mdc-ripple-surface--accent--selected:hover::before,.mdc-ripple-surface--accent--selected.mdc-ripple-surface--hover::before{opacity:0.12;opacity:var(--mdc-ripple-hover-opacity, 0.12)}.mdc-ripple-surface--accent--selected.mdc-ripple-upgraded--background-focused::before,.mdc-ripple-surface--accent--selected:not(.mdc-ripple-upgraded):focus::before{transition-duration:75ms;opacity:0.2;opacity:var(--mdc-ripple-focus-opacity, 0.2)}.mdc-ripple-surface--accent--selected:not(.mdc-ripple-upgraded)::after{transition:opacity 150ms linear}.mdc-ripple-surface--accent--selected:not(.mdc-ripple-upgraded):active::after{transition-duration:75ms;opacity:0.2;opacity:var(--mdc-ripple-press-opacity, 0.2)}.mdc-ripple-surface--accent--selected.mdc-ripple-upgraded{--mdc-ripple-fg-opacity:var(--mdc-ripple-press-opacity, 0.2)}.mdc-ripple-surface--disabled{opacity:0}.mdc-ripple-surface--internal-use-state-layer-custom-properties::before,.mdc-ripple-surface--internal-use-state-layer-custom-properties::after{background-color:#000;background-color:var(--mdc-ripple-hover-state-layer-color, #000)}.mdc-ripple-surface--internal-use-state-layer-custom-properties:hover::before,.mdc-ripple-surface--internal-use-state-layer-custom-properties.mdc-ripple-surface--hover::before{opacity:0.04;opacity:var(--mdc-ripple-hover-state-layer-opacity, 0.04)}.mdc-ripple-surface--internal-use-state-layer-custom-properties.mdc-ripple-upgraded--background-focused::before,.mdc-ripple-surface--internal-use-state-layer-custom-properties:not(.mdc-ripple-upgraded):focus::before{transition-duration:75ms;opacity:0.12;opacity:var(--mdc-ripple-focus-state-layer-opacity, 0.12)}.mdc-ripple-surface--internal-use-state-layer-custom-properties:not(.mdc-ripple-upgraded)::after{transition:opacity 150ms linear}.mdc-ripple-surface--internal-use-state-layer-custom-properties:not(.mdc-ripple-upgraded):active::after{transition-duration:75ms;opacity:0.12;opacity:var(--mdc-ripple-pressed-state-layer-opacity, 0.12)}.mdc-ripple-surface--internal-use-state-layer-custom-properties.mdc-ripple-upgraded{--mdc-ripple-fg-opacity:var(--mdc-ripple-pressed-state-layer-opacity, 0.12)}`;let F2=class extends vt{};F2.styles=[Fk];F2=b([M1("mwc-ripple")],F2);const Wr=t=>(e,r)=>{if(e.constructor._observers){if(!e.constructor.hasOwnProperty("_observers")){const n=e.constructor._observers;e.constructor._observers=new Map,n.forEach((i,o)=>e.constructor._observers.set(o,i))}}else{e.constructor._observers=new Map;const n=e.updated;e.updated=function(i){n.call(this,i),i.forEach((o,a)=>{const c=this.constructor._observers.get(a);c!==void 0&&c.call(this,this[a],o)})}}e.constructor._observers.set(r,t)};class N1{constructor(e){this.startPress=r=>{e().then(n=>{n&&n.startPress(r)})},this.endPress=()=>{e().then(r=>{r&&r.endPress()})},this.startFocus=()=>{e().then(r=>{r&&r.startFocus()})},this.endFocus=()=>{e().then(r=>{r&&r.endFocus()})},this.startHover=()=>{e().then(r=>{r&&r.startHover()})},this.endHover=()=>{e().then(r=>{r&&r.endHover()})}}}class Mt extends qt{constructor(){super(...arguments),this.value="",this.group=null,this.tabindex=-1,this.disabled=!1,this.twoline=!1,this.activated=!1,this.graphic=null,this.multipleGraphics=!1,this.hasMeta=!1,this.noninteractive=!1,this.selected=!1,this.shouldRenderRipple=!1,this._managingList=null,this.boundOnClick=this.onClick.bind(this),this._firstChanged=!0,this._skipPropRequest=!1,this.rippleHandlers=new N1(()=>(this.shouldRenderRipple=!0,this.ripple)),this.listeners=[{target:this,eventNames:["click"],cb:()=>{this.onClick()}},{target:this,eventNames:["mouseenter"],cb:this.rippleHandlers.startHover},{target:this,eventNames:["mouseleave"],cb:this.rippleHandlers.endHover},{target:this,eventNames:["focus"],cb:this.rippleHandlers.startFocus},{target:this,eventNames:["blur"],cb:this.rippleHandlers.endFocus},{target:this,eventNames:["mousedown","touchstart"],cb:e=>{const r=e.type;this.onDown(r==="mousedown"?"mouseup":"touchend",e)}}]}get text(){const e=this.textContent;return e?e.trim():""}render(){const e=this.renderText(),r=this.graphic?this.renderGraphic():q``,n=this.hasMeta?this.renderMeta():q``;return q`
|
|
295
295
|
${this.renderRipple()}
|