"use strict";(self.webpackChunk_1js_files_in_taskbar=self.webpackChunk_1js_files_in_taskbar||[]).push([[2008],{22008:(e,t,r)=>{r.d(t,{vq:()=>$i});var n,o=r(18087);!function(e){e[e.Error=0]="Error",e[e.Warning=1]="Warning",e[e.Info=2]="Info",e[e.Verbose=3]="Verbose",e[e.Trace=4]="Trace"}(n||(n={}));class i{constructor(e,t,r){this.level=n.Info;const a=e||i.createDefaultLoggerOptions();this.localCallback=a.loggerCallback||(()=>{}),this.piiLoggingEnabled=a.piiLoggingEnabled||!1,this.level="number"==typeof a.logLevel?a.logLevel:n.Info,this.correlationId=a.correlationId||o.YM.EMPTY_STRING,this.packageName=t||o.YM.EMPTY_STRING,this.packageVersion=r||o.YM.EMPTY_STRING}static createDefaultLoggerOptions(){return{loggerCallback:()=>{},piiLoggingEnabled:!1,logLevel:n.Info}}clone(e,t,r){return new i({loggerCallback:this.localCallback,piiLoggingEnabled:this.piiLoggingEnabled,logLevel:this.level,correlationId:r||this.correlationId},e,t)}logMessage(e,t){if(t.logLevel>this.level||!this.piiLoggingEnabled&&t.containsPii)return;const r=`${`[${(new Date).toUTCString()}] : [${t.correlationId||this.correlationId||""}]`} : ${this.packageName}@${this.packageVersion} : ${n[t.logLevel]} - ${e}`;this.executeCallback(t.logLevel,r,t.containsPii||!1)}executeCallback(e,t,r){this.localCallback&&this.localCallback(e,t,r)}error(e,t){this.logMessage(e,{logLevel:n.Error,containsPii:!1,correlationId:t||o.YM.EMPTY_STRING})}errorPii(e,t){this.logMessage(e,{logLevel:n.Error,containsPii:!0,correlationId:t||o.YM.EMPTY_STRING})}warning(e,t){this.logMessage(e,{logLevel:n.Warning,containsPii:!1,correlationId:t||o.YM.EMPTY_STRING})}warningPii(e,t){this.logMessage(e,{logLevel:n.Warning,containsPii:!0,correlationId:t||o.YM.EMPTY_STRING})}info(e,t){this.logMessage(e,{logLevel:n.Info,containsPii:!1,correlationId:t||o.YM.EMPTY_STRING})}infoPii(e,t){this.logMessage(e,{logLevel:n.Info,containsPii:!0,correlationId:t||o.YM.EMPTY_STRING})}verbose(e,t){this.logMessage(e,{logLevel:n.Verbose,containsPii:!1,correlationId:t||o.YM.EMPTY_STRING})}verbosePii(e,t){this.logMessage(e,{logLevel:n.Verbose,containsPii:!0,correlationId:t||o.YM.EMPTY_STRING})}trace(e,t){this.logMessage(e,{logLevel:n.Trace,containsPii:!1,correlationId:t||o.YM.EMPTY_STRING})}tracePii(e,t){this.logMessage(e,{logLevel:n.Trace,containsPii:!0,correlationId:t||o.YM.EMPTY_STRING})}isPiiLoggingEnabled(){return this.piiLoggingEnabled||!1}}
/*! @azure/msal-common v14.15.0 2024-09-20 */
const a="AAD",s="OIDC",c="none";var h=r(32041);
/*! @azure/msal-common v14.15.0 2024-09-20 */
const l="client_info_decoding_error",d="client_info_empty_error",u="token_parsing_error",g="null_or_empty_token",p="endpoints_resolution_error",m="network_error",C="openid_config_error",f="hash_not_deserialized",y="invalid_state",T="state_mismatch",I="state_not_found",v="nonce_mismatch",A="auth_time_not_found",w="max_age_transpired",E="multiple_matching_tokens",k="multiple_matching_accounts",R="multiple_matching_appMetadata",S="request_cannot_be_made",_="cannot_remove_empty_scope",b="cannot_append_scopeset",M="empty_input_scopeset",O="device_code_polling_cancelled",P="device_code_expired",N="device_code_unknown_error",q="no_account_in_silent_request",L="invalid_cache_record",U="invalid_cache_environment",H="no_account_found",D="no_crypto_object",B="unexpected_credential_type",F="invalid_assertion",x="invalid_client_credential",K="token_refresh_required",G="user_timeout_reached",Y="token_claims_cnf_required_for_signedjwt",z="authorization_code_missing_from_server_response",$="binding_key_not_removed",W="end_session_endpoint_not_supported",Q="key_id_missing",V="no_network_connectivity",j="user_canceled",J="missing_tenant_id_error",X="method_not_implemented",Z="nested_app_auth_bridge_disabled",ee={[l]:"The client info could not be parsed/decoded correctly",[d]:"The client info was empty",[u]:"Token cannot be parsed",[g]:"The token is null or empty",[p]:"Endpoints cannot be resolved",[m]:"Network request failed",[C]:"Could not retrieve endpoints. Check your authority and verify the .well-known/openid-configuration endpoint returns the required endpoints.",[f]:"The hash parameters could not be deserialized",[y]:"State was not the expected format",[T]:"State mismatch error",[I]:"State not found",[v]:"Nonce mismatch error",[A]:"Max Age was requested and the ID token is missing the auth_time variable. auth_time is an optional claim and is not enabled by default - it must be enabled. See https://aka.ms/msaljs/optional-claims for more information.",[w]:"Max Age is set to 0, or too much time has elapsed since the last end-user authentication.",[E]:"The cache contains multiple tokens satisfying the requirements. Call AcquireToken again providing more requirements such as authority or account.",[k]:"The cache contains multiple accounts satisfying the given parameters. Please pass more info to obtain the correct account",[R]:"The cache contains multiple appMetadata satisfying the given parameters. Please pass more info to obtain the correct appMetadata",[S]:"Token request cannot be made without authorization code or refresh token.",[_]:"Cannot remove null or empty scope from ScopeSet",[b]:"Cannot append ScopeSet",[M]:"Empty input ScopeSet cannot be processed",[O]:"Caller has cancelled token endpoint polling during device code flow by setting DeviceCodeRequest.cancel = true.",[P]:"Device code is expired.",[N]:"Device code stopped polling for unknown reasons.",[q]:"Please pass an account object, silent flow is not supported without account information",[L]:"Cache record object was null or undefined.",[U]:"Invalid environment when attempting to create cache entry",[H]:"No account found in cache for given key.",[D]:"No crypto object detected.",[B]:"Unexpected credential type.",[F]:"Client assertion must meet requirements described in https://tools.ietf.org/html/rfc7515",[x]:"Client credential (secret, certificate, or assertion) must not be empty when creating a confidential client. An application should at most have one credential",[K]:"Cannot return token from cache because it must be refreshed. This may be due to one of the following reasons: forceRefresh parameter is set to true, claims have been requested, there is no cached access token or it is expired.",[G]:"User defined timeout for device code polling reached",[Y]:"Cannot generate a POP jwt if the token_claims are not populated",[z]:"Server response does not contain an authorization code to proceed",[$]:"Could not remove the credential's binding key from storage.",[W]:"The provided authority does not support logout",[Q]:"A keyId value is missing from the requested bound token's cache record and is required to match the token to it's stored binding key.",[V]:"No network connectivity. Check your internet connection.",[j]:"User cancelled the flow.",[J]:"A tenant id - not common, organizations, or consumers - must be specified when using the client_credentials flow.",[X]:"This method has not been implemented",[Z]:"The nested app auth bridge is disabled"};class te extends h.lR{constructor(e,t){super(e,t?`${ee[e]}: ${t}`:ee[e]),this.name="ClientAuthError",Object.setPrototypeOf(this,te.prototype)}}function re(e,t){return new te(e,t)}
/*! @azure/msal-common v14.15.0 2024-09-20 */
const ne={createNewGuid:()=>{throw re(X)},base64Decode:()=>{throw re(X)},base64Encode:()=>{throw re(X)},base64UrlEncode:()=>{throw re(X)},encodeKid:()=>{throw re(X)},async getPublicKeyThumbprint(){throw re(X)},async removeTokenBindingKey(){throw re(X)},async clearKeystore(){throw re(X)},async signJwt(){throw re(X)},async hashString(){throw re(X)}},oe="@azure/msal-common",ie="14.15.0";
/*! @azure/msal-common v14.15.0 2024-09-20 */
function ae(e,t){const r=function(e){if(!e)throw re(g);const t=/^([^\.\s]*)\.([^\.\s]+)\.([^\.\s]*)$/.exec(e);if(!t||t.length<4)throw re(u);return t[2]}(e);try{const e=t(r);return JSON.parse(e)}catch(e){throw re(u)}}function se(e,t){if(0===t||Date.now()-3e5>e+t)throw re(w)}
/*! @azure/msal-common v14.15.0 2024-09-20 */
function ce(){return Math.round((new Date).getTime()/1e3)}function he(e,t){const r=Number(e)||0;return ce()+t>r}
/*! @azure/msal-common v14.15.0 2024-09-20 */
function le(e){return[ye(e),Te(e),Ie(e),ve(e),Ae(e)].join(o.LR.CACHE_KEY_SEPARATOR).toLowerCase()}function de(e,t,r,n,i){return{credentialType:o.aG.ID_TOKEN,homeAccountId:e,environment:t,clientId:n,secret:r,realm:i}}function ue(e,t,r,n,i,a,s,c,h,l,d,u,g,p,m){const C={homeAccountId:e,credentialType:o.aG.ACCESS_TOKEN,secret:r,cachedAt:ce().toString(),expiresOn:s.toString(),extendedExpiresOn:c.toString(),environment:t,clientId:n,realm:i,target:a,tokenType:d||o.IO.BEARER};if(u&&(C.userAssertionHash=u),l&&(C.refreshOn=l.toString()),p&&(C.requestedClaims=p,C.requestedClaimsHash=m),C.tokenType?.toLowerCase()!==o.IO.BEARER.toLowerCase())switch(C.credentialType=o.aG.ACCESS_TOKEN_WITH_AUTH_SCHEME,C.tokenType){case o.IO.POP:const e=ae(r,h);if(!e?.cnf?.kid)throw re(Y);C.keyId=e.cnf.kid;break;case o.IO.SSH:C.keyId=g}return C}function ge(e,t,r,n,i,a,s){const c={credentialType:o.aG.REFRESH_TOKEN,homeAccountId:e,environment:t,clientId:n,secret:r};return a&&(c.userAssertionHash=a),i&&(c.familyId=i),s&&(c.expiresOn=s.toString()),c}function pe(e){return e.hasOwnProperty("homeAccountId")&&e.hasOwnProperty("environment")&&e.hasOwnProperty("credentialType")&&e.hasOwnProperty("clientId")&&e.hasOwnProperty("secret")}function me(e){return!!e&&(pe(e)&&e.hasOwnProperty("realm")&&e.hasOwnProperty("target")&&(e.credentialType===o.aG.ACCESS_TOKEN||e.credentialType===o.aG.ACCESS_TOKEN_WITH_AUTH_SCHEME))}function Ce(e){return!!e&&(pe(e)&&e.hasOwnProperty("realm")&&e.credentialType===o.aG.ID_TOKEN)}function fe(e){return!!e&&(pe(e)&&e.credentialType===o.aG.REFRESH_TOKEN)}function ye(e){return[e.homeAccountId,e.environment].join(o.LR.CACHE_KEY_SEPARATOR).toLowerCase()}function Te(e){const t=e.credentialType===o.aG.REFRESH_TOKEN&&e.familyId||e.clientId;return[e.credentialType,t,e.realm||""].join(o.LR.CACHE_KEY_SEPARATOR).toLowerCase()}function Ie(e){return(e.target||"").toLowerCase()}function ve(e){return(e.requestedClaimsHash||"").toLowerCase()}function Ae(e){return e.tokenType&&e.tokenType.toLowerCase()!==o.IO.BEARER.toLowerCase()?e.tokenType.toLowerCase():""}function we(){return ce()+o.u0.REFRESH_TIME_SECONDS}function Ee(e,t,r){e.authorization_endpoint=t.authorization_endpoint,e.token_endpoint=t.token_endpoint,e.end_session_endpoint=t.end_session_endpoint,e.issuer=t.issuer,e.endpointsFromNetwork=r,e.jwks_uri=t.jwks_uri}function ke(e,t,r){e.aliases=t.aliases,e.preferred_cache=t.preferred_cache,e.preferred_network=t.preferred_network,e.aliasesFromNetwork=r}function Re(e){return e.expiresAt<=ce()}
/*! @azure/msal-common v14.15.0 2024-09-20 */
const Se="redirect_uri_empty",_e="claims_request_parsing_error",be="authority_uri_insecure",Me="url_parse_error",Oe="empty_url_error",Pe="empty_input_scopes_error",Ne="invalid_prompt_value",qe="invalid_claims",Le="token_request_empty",Ue="logout_request_empty",He="invalid_code_challenge_method",De="pkce_params_missing",Be="invalid_cloud_discovery_metadata",Fe="invalid_authority_metadata",xe="untrusted_authority",Ke="missing_ssh_jwk",Ge="missing_ssh_kid",Ye="missing_nonce_authentication_header",ze="invalid_authentication_header",$e="cannot_set_OIDCOptions",We="cannot_allow_native_broker",Qe="authority_mismatch",Ve={[Se]:"A redirect URI is required for all calls, and none has been set.",[_e]:"Could not parse the given claims request object.",[be]:"Authority URIs must use https.  Please see here for valid authority configuration options: https://docs.microsoft.com/en-us/azure/active-directory/develop/msal-js-initializing-client-applications#configuration-options",[Me]:"URL could not be parsed into appropriate segments.",[Oe]:"URL was empty or null.",[Pe]:"Scopes cannot be passed as null, undefined or empty array because they are required to obtain an access token.",[Ne]:"Please see here for valid configuration options: https://azuread.github.io/microsoft-authentication-library-for-js/ref/modules/_azure_msal_common.html#commonauthorizationurlrequest",[qe]:"Given claims parameter must be a stringified JSON object.",[Le]:"Token request was empty and not found in cache.",[Ue]:"The logout request was null or undefined.",[He]:'code_challenge_method passed is invalid. Valid values are "plain" and "S256".',[De]:"Both params: code_challenge and code_challenge_method are to be passed if to be sent in the request",[Be]:"Invalid cloudDiscoveryMetadata provided. Must be a stringified JSON object containing tenant_discovery_endpoint and metadata fields",[Fe]:"Invalid authorityMetadata provided. Must by a stringified JSON object containing authorization_endpoint, token_endpoint, issuer fields.",[xe]:"The provided authority is not a trusted authority. Please include this authority in the knownAuthorities config parameter.",[Ke]:"Missing sshJwk in SSH certificate request. A stringified JSON Web Key is required when using the SSH authentication scheme.",[Ge]:"Missing sshKid in SSH certificate request. A string that uniquely identifies the public SSH key is required when using the SSH authentication scheme.",[Ye]:"Unable to find an authentication header containing server nonce. Either the Authentication-Info or WWW-Authenticate headers must be present in order to obtain a server nonce.",[ze]:"Invalid authentication header provided",[$e]:"Cannot set OIDCOptions parameter. Please change the protocol mode to OIDC or use a non-Microsoft authority.",[We]:"Cannot set allowNativeBroker parameter to true when not in AAD protocol mode.",[Qe]:"Authority mismatch error. Authority provided in login request or PublicClientApplication config does not match the environment of the provided account. Please use a matching account or make an interactive request to login to this authority."};class je extends h.lR{constructor(e){super(e,Ve[e]),this.name="ClientConfigurationError",Object.setPrototypeOf(this,je.prototype)}}function Je(e){return new je(e)}
/*! @azure/msal-common v14.15.0 2024-09-20 */
class Xe{static isEmptyObj(e){if(e)try{const t=JSON.parse(e);return 0===Object.keys(t).length}catch(e){}return!0}static startsWith(e,t){return 0===e.indexOf(t)}static endsWith(e,t){return e.length>=t.length&&e.lastIndexOf(t)===e.length-t.length}static queryStringToObject(e){const t={},r=e.split("&"),n=e=>decodeURIComponent(e.replace(/\+/g," "));return r.forEach((e=>{if(e.trim()){const[r,o]=e.split(/=(.+)/g,2);r&&o&&(t[n(r)]=n(o))}})),t}static trimArrayEntries(e){return e.map((e=>e.trim()))}static removeEmptyStringsFromArray(e){return e.filter((e=>!!e))}static jsonParseHelper(e){try{return JSON.parse(e)}catch(e){return null}}static matchPattern(e,t){return new RegExp(e.replace(/\\/g,"\\\\").replace(/\*/g,"[^ ]*").replace(/\?/g,"\\?")).test(t)}}
/*! @azure/msal-common v14.15.0 2024-09-20 */
class Ze{constructor(e){const t=e?Xe.trimArrayEntries([...e]):[],r=t?Xe.removeEmptyStringsFromArray(t):[];this.validateInputScopes(r),this.scopes=new Set,r.forEach((e=>this.scopes.add(e)))}static fromString(e){const t=(e||o.YM.EMPTY_STRING).split(" ");return new Ze(t)}static createSearchScopes(e){const t=new Ze(e);return t.containsOnlyOIDCScopes()?t.removeScope(o.YM.OFFLINE_ACCESS_SCOPE):t.removeOIDCScopes(),t}validateInputScopes(e){if(!e||e.length<1)throw Je(Pe)}containsScope(e){const t=this.printScopesLowerCase().split(" "),r=new Ze(t);return!!e&&r.scopes.has(e.toLowerCase())}containsScopeSet(e){return!(!e||e.scopes.size<=0)&&(this.scopes.size>=e.scopes.size&&e.asArray().every((e=>this.containsScope(e))))}containsOnlyOIDCScopes(){let e=0;return o._A.forEach((t=>{this.containsScope(t)&&(e+=1)})),this.scopes.size===e}appendScope(e){e&&this.scopes.add(e.trim())}appendScopes(e){try{e.forEach((e=>this.appendScope(e)))}catch(e){throw re(b)}}removeScope(e){if(!e)throw re(_);this.scopes.delete(e.trim())}removeOIDCScopes(){o._A.forEach((e=>{this.scopes.delete(e)}))}unionScopeSets(e){if(!e)throw re(M);const t=new Set;return e.scopes.forEach((e=>t.add(e.toLowerCase()))),this.scopes.forEach((e=>t.add(e.toLowerCase()))),t}intersectingScopeSets(e){if(!e)throw re(M);e.containsOnlyOIDCScopes()||e.removeOIDCScopes();const t=this.unionScopeSets(e),r=e.getScopeCount(),n=this.getScopeCount();return t.size<n+r}getScopeCount(){return this.scopes.size}asArray(){const e=[];return this.scopes.forEach((t=>e.push(t))),e}printScopes(){if(this.scopes){return this.asArray().join(" ")}return o.YM.EMPTY_STRING}printScopesLowerCase(){return this.printScopes().toLowerCase()}}
/*! @azure/msal-common v14.15.0 2024-09-20 */
function et(e,t){if(!e)throw re(d);try{const r=t(e);return JSON.parse(r)}catch(e){throw re(l)}}function tt(e){if(!e)throw re(l);const t=e.split(o.LR.CLIENT_INFO_SEPARATOR,2);return{uid:t[0],utid:t.length<2?o.YM.EMPTY_STRING:t[1]}}
/*! @azure/msal-common v14.15.0 2024-09-20 */
function rt(e,t){return!!e&&!!t&&e===t.split(".")[1]}function nt(e,t,r,n){if(n){const{oid:t,sub:r,tid:o,name:i,tfp:a,acr:s}=n,c=o||a||s||"";return{tenantId:c,localAccountId:t||r||"",name:i,isHomeTenant:rt(c,e)}}return{tenantId:r,localAccountId:t,isHomeTenant:rt(r,e)}}function ot(e,t,r,n){let o=e;if(t){const{isHomeTenant:r,...n}=t;o={...e,...n}}if(r){const{isHomeTenant:t,...i}=nt(e.homeAccountId,e.localAccountId,e.tenantId,r);return o={...o,...i,idTokenClaims:r,idToken:n},o}return o}
/*! @azure/msal-common v14.15.0 2024-09-20 */
const it=0,at=1,st=2,ct=3;
/*! @azure/msal-common v14.15.0 2024-09-20 */
function ht(e){if(e){return e.tid||e.tfp||e.acr||null}return null}
/*! @azure/msal-common v14.15.0 2024-09-20 */
class lt{generateAccountId(){return[this.homeAccountId,this.environment].join(o.LR.CACHE_KEY_SEPARATOR).toLowerCase()}generateAccountKey(){return lt.generateAccountCacheKey({homeAccountId:this.homeAccountId,environment:this.environment,tenantId:this.realm,username:this.username,localAccountId:this.localAccountId})}getAccountInfo(){return{homeAccountId:this.homeAccountId,environment:this.environment,tenantId:this.realm,username:this.username,localAccountId:this.localAccountId,name:this.name,nativeAccountId:this.nativeAccountId,authorityType:this.authorityType,tenantProfiles:new Map((this.tenantProfiles||[]).map((e=>[e.tenantId,e])))}}isSingleTenant(){return!this.tenantProfiles}static generateAccountCacheKey(e){const t=e.homeAccountId.split(".")[1];return[e.homeAccountId,e.environment||"",t||e.tenantId||""].join(o.LR.CACHE_KEY_SEPARATOR).toLowerCase()}static createAccount(e,t,r){const n=new lt;let i;t.authorityType===at?n.authorityType=o.Qd.ADFS_ACCOUNT_TYPE:t.protocolMode===a?n.authorityType=o.Qd.MSSTS_ACCOUNT_TYPE:n.authorityType=o.Qd.GENERIC_ACCOUNT_TYPE,e.clientInfo&&r&&(i=et(e.clientInfo,r)),n.clientInfo=e.clientInfo,n.homeAccountId=e.homeAccountId,n.nativeAccountId=e.nativeAccountId;const s=e.environment||t&&t.getPreferredCache();if(!s)throw re(U);n.environment=s,n.realm=i?.utid||ht(e.idTokenClaims)||"",n.localAccountId=i?.uid||e.idTokenClaims?.oid||e.idTokenClaims?.sub||"";const c=e.idTokenClaims?.preferred_username||e.idTokenClaims?.upn,h=e.idTokenClaims?.emails?e.idTokenClaims.emails[0]:null;if(n.username=c||h||"",n.name=e.idTokenClaims?.name||"",n.cloudGraphHostName=e.cloudGraphHostName,n.msGraphHost=e.msGraphHost,e.tenantProfiles)n.tenantProfiles=e.tenantProfiles;else{const t=nt(e.homeAccountId,n.localAccountId,n.realm,e.idTokenClaims);n.tenantProfiles=[t]}return n}static createFromAccountInfo(e,t,r){const n=new lt;return n.authorityType=e.authorityType||o.Qd.GENERIC_ACCOUNT_TYPE,n.homeAccountId=e.homeAccountId,n.localAccountId=e.localAccountId,n.nativeAccountId=e.nativeAccountId,n.realm=e.tenantId,n.environment=e.environment,n.username=e.username,n.name=e.name,n.cloudGraphHostName=t,n.msGraphHost=r,n.tenantProfiles=Array.from(e.tenantProfiles?.values()||[]),n}static generateHomeAccountId(e,t,r,n,o){if(t!==at&&t!==st){if(e)try{const t=et(e,n.base64Decode);if(t.uid&&t.utid)return`${t.uid}.${t.utid}`}catch(e){}r.warning("No client info in response")}return o?.sub||""}static isAccountEntity(e){return!!e&&(e.hasOwnProperty("homeAccountId")&&e.hasOwnProperty("environment")&&e.hasOwnProperty("realm")&&e.hasOwnProperty("localAccountId")&&e.hasOwnProperty("username")&&e.hasOwnProperty("authorityType"))}static accountInfoIsEqual(e,t,r){if(!e||!t)return!1;let n=!0;if(r){const r=e.idTokenClaims||{},o=t.idTokenClaims||{};n=r.iat===o.iat&&r.nonce===o.nonce}return e.homeAccountId===t.homeAccountId&&e.localAccountId===t.localAccountId&&e.username===t.username&&e.tenantId===t.tenantId&&e.environment===t.environment&&e.nativeAccountId===t.nativeAccountId&&n}}
/*! @azure/msal-common v14.15.0 2024-09-20 */
function dt(e){return e.startsWith("#/")?e.substring(2):e.startsWith("#")||e.startsWith("?")?e.substring(1):e}function ut(e){if(!e||e.indexOf("=")<0)return null;try{const t=dt(e),r=Object.fromEntries(new URLSearchParams(t));if(r.code||r.error||r.error_description||r.state)return r}catch(e){throw re(f)}return null}
/*! @azure/msal-common v14.15.0 2024-09-20 */
class gt{get urlString(){return this._urlString}constructor(e){if(this._urlString=e,!this._urlString)throw Je(Oe);e.includes("#")||(this._urlString=gt.canonicalizeUri(e))}static canonicalizeUri(e){if(e){let t=e.toLowerCase();return Xe.endsWith(t,"?")?t=t.slice(0,-1):Xe.endsWith(t,"?/")&&(t=t.slice(0,-2)),Xe.endsWith(t,"/")||(t+="/"),t}return e}validateAsUri(){let e;try{e=this.getUrlComponents()}catch(e){throw Je(Me)}if(!e.HostNameAndPort||!e.PathSegments)throw Je(Me);if(!e.Protocol||"https:"!==e.Protocol.toLowerCase())throw Je(be)}static appendQueryString(e,t){return t?e.indexOf("?")<0?`${e}?${t}`:`${e}&${t}`:e}static removeHashFromUrl(e){return gt.canonicalizeUri(e.split("#")[0])}replaceTenantPath(e){const t=this.getUrlComponents(),r=t.PathSegments;return!e||0===r.length||r[0]!==o.v2.COMMON&&r[0]!==o.v2.ORGANIZATIONS||(r[0]=e),gt.constructAuthorityUriFromObject(t)}getUrlComponents(){const e=RegExp("^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\\?([^#]*))?(#(.*))?"),t=this.urlString.match(e);if(!t)throw Je(Me);const r={Protocol:t[1],HostNameAndPort:t[4],AbsolutePath:t[5],QueryString:t[7]};let n=r.AbsolutePath.split("/");return n=n.filter((e=>e&&e.length>0)),r.PathSegments=n,r.QueryString&&r.QueryString.endsWith("/")&&(r.QueryString=r.QueryString.substring(0,r.QueryString.length-1)),r}static getDomainFromUrl(e){const t=RegExp("^([^:/?#]+://)?([^/?#]*)"),r=e.match(t);if(!r)throw Je(Me);return r[2]}static getAbsoluteUrl(e,t){if(e[0]===o.YM.FORWARD_SLASH){const r=new gt(t).getUrlComponents();return r.Protocol+"//"+r.HostNameAndPort+e}return e}static constructAuthorityUriFromObject(e){return new gt(e.Protocol+"//"+e.HostNameAndPort+"/"+e.PathSegments.join("/"))}static hashContainsKnownProperties(e){return!!ut(e)}}
/*! @azure/msal-common v14.15.0 2024-09-20 */
const pt={"login.microsoftonline.com":{token_endpoint:"https://login.microsoftonline.com/{tenantid}/oauth2/v2.0/token",jwks_uri:"https://login.microsoftonline.com/{tenantid}/discovery/v2.0/keys",issuer:"https://login.microsoftonline.com/{tenantid}/v2.0",authorization_endpoint:"https://login.microsoftonline.com/{tenantid}/oauth2/v2.0/authorize",end_session_endpoint:"https://login.microsoftonline.com/{tenantid}/oauth2/v2.0/logout"},"login.chinacloudapi.cn":{token_endpoint:"https://login.chinacloudapi.cn/{tenantid}/oauth2/v2.0/token",jwks_uri:"https://login.chinacloudapi.cn/{tenantid}/discovery/v2.0/keys",issuer:"https://login.partner.microsoftonline.cn/{tenantid}/v2.0",authorization_endpoint:"https://login.chinacloudapi.cn/{tenantid}/oauth2/v2.0/authorize",end_session_endpoint:"https://login.chinacloudapi.cn/{tenantid}/oauth2/v2.0/logout"},"login.microsoftonline.us":{token_endpoint:"https://login.microsoftonline.us/{tenantid}/oauth2/v2.0/token",jwks_uri:"https://login.microsoftonline.us/{tenantid}/discovery/v2.0/keys",issuer:"https://login.microsoftonline.us/{tenantid}/v2.0",authorization_endpoint:"https://login.microsoftonline.us/{tenantid}/oauth2/v2.0/authorize",end_session_endpoint:"https://login.microsoftonline.us/{tenantid}/oauth2/v2.0/logout"}},mt={tenant_discovery_endpoint:"https://{canonicalAuthority}/v2.0/.well-known/openid-configuration",metadata:[{preferred_network:"login.microsoftonline.com",preferred_cache:"login.windows.net",aliases:["login.microsoftonline.com","login.windows.net","login.microsoft.com","sts.windows.net"]},{preferred_network:"login.partner.microsoftonline.cn",preferred_cache:"login.partner.microsoftonline.cn",aliases:["login.partner.microsoftonline.cn","login.chinacloudapi.cn"]},{preferred_network:"login.microsoftonline.de",preferred_cache:"login.microsoftonline.de",aliases:["login.microsoftonline.de"]},{preferred_network:"login.microsoftonline.us",preferred_cache:"login.microsoftonline.us",aliases:["login.microsoftonline.us","login.usgovcloudapi.net"]},{preferred_network:"login-us.microsoftonline.com",preferred_cache:"login-us.microsoftonline.com",aliases:["login-us.microsoftonline.com"]}]},Ct=new Set;function ft(e,t,r,n){if(n?.trace(`getAliasesFromMetadata called with source: ${r}`),e&&t){const o=yt(t,e);if(o)return n?.trace(`getAliasesFromMetadata: found cloud discovery metadata in ${r}, returning aliases`),o.aliases;n?.trace(`getAliasesFromMetadata: did not find cloud discovery metadata in ${r}`)}return null}function yt(e,t){for(let r=0;r<e.length;r++){const n=e[r];if(n.aliases.includes(t))return n}return null}mt.metadata.forEach((e=>{e.aliases.forEach((e=>{Ct.add(e)}))}));
/*! @azure/msal-common v14.15.0 2024-09-20 */
const Tt="cache_quota_exceeded",It="cache_error_unknown",vt={[Tt]:"Exceeded cache storage capacity.",[It]:"Unexpected error occurred when using cache storage."};class At extends Error{constructor(e,t){const r=t||(vt[e]?vt[e]:vt[It]);super(`${e}: ${r}`),Object.setPrototypeOf(this,At.prototype),this.name="CacheError",this.errorCode=e,this.errorMessage=r}}
/*! @azure/msal-common v14.15.0 2024-09-20 */
class wt{constructor(e,t,r,n){this.clientId=e,this.cryptoImpl=t,this.commonLogger=r.clone(oe,ie),this.staticAuthorityOptions=n}getAllAccounts(e){return this.buildTenantProfiles(this.getAccountsFilteredBy(e||{}),e)}getAccountInfoFilteredBy(e){const t=this.getAllAccounts(e);if(t.length>1){return t.sort((e=>e.idTokenClaims?-1:1))[0]}return 1===t.length?t[0]:null}getBaseAccountInfo(e){const t=this.getAccountsFilteredBy(e);return t.length>0?t[0].getAccountInfo():null}buildTenantProfiles(e,t){return e.flatMap((e=>this.getTenantProfilesFromAccountEntity(e,t?.tenantId,t)))}getTenantedAccountInfoByFilter(e,t,r,n){let o,i=null;if(n&&!this.tenantProfileMatchesFilter(r,n))return null;const a=this.getIdToken(e,t,r.tenantId);return a&&(o=ae(a.secret,this.cryptoImpl.base64Decode),!this.idTokenClaimsMatchTenantProfileFilter(o,n))?null:(i=ot(e,r,o,a?.secret),i)}getTenantProfilesFromAccountEntity(e,t,r){const n=e.getAccountInfo();let o=n.tenantProfiles||new Map;const i=this.getTokenKeys();if(t){const e=o.get(t);if(!e)return[];o=new Map([[t,e]])}const a=[];return o.forEach((e=>{const t=this.getTenantedAccountInfoByFilter(n,i,e,r);t&&a.push(t)})),a}tenantProfileMatchesFilter(e,t){return!(t.localAccountId&&!this.matchLocalAccountIdFromTenantProfile(e,t.localAccountId))&&((!t.name||e.name===t.name)&&(void 0===t.isHomeTenant||e.isHomeTenant===t.isHomeTenant))}idTokenClaimsMatchTenantProfileFilter(e,t){if(t){if(t.localAccountId&&!this.matchLocalAccountIdFromTokenClaims(e,t.localAccountId))return!1;if(t.loginHint&&!this.matchLoginHintFromTokenClaims(e,t.loginHint))return!1;if(t.username&&!this.matchUsername(e.preferred_username,t.username))return!1;if(t.name&&!this.matchName(e,t.name))return!1;if(t.sid&&!this.matchSid(e,t.sid))return!1}return!0}async saveCacheRecord(e,t,r){if(!e)throw re(L);try{e.account&&this.setAccount(e.account),e.idToken&&!1!==t?.idToken&&this.setIdTokenCredential(e.idToken),e.accessToken&&!1!==t?.accessToken&&await this.saveAccessToken(e.accessToken),e.refreshToken&&!1!==t?.refreshToken&&this.setRefreshTokenCredential(e.refreshToken),e.appMetadata&&this.setAppMetadata(e.appMetadata)}catch(e){throw this.commonLogger?.error("CacheManager.saveCacheRecord: failed"),e instanceof Error?(this.commonLogger?.errorPii(`CacheManager.saveCacheRecord: ${e.message}`,r),"QuotaExceededError"===e.name||"NS_ERROR_DOM_QUOTA_REACHED"===e.name||e.message.includes("exceeded the quota")?(this.commonLogger?.error("CacheManager.saveCacheRecord: exceeded storage quota",r),new At(Tt)):new At(e.name,e.message)):(this.commonLogger?.errorPii(`CacheManager.saveCacheRecord: ${e}`,r),new At(It))}}async saveAccessToken(e){const t={clientId:e.clientId,credentialType:e.credentialType,environment:e.environment,homeAccountId:e.homeAccountId,realm:e.realm,tokenType:e.tokenType,requestedClaimsHash:e.requestedClaimsHash},r=this.getTokenKeys(),n=Ze.fromString(e.target),o=[];r.accessToken.forEach((e=>{if(!this.accessTokenKeyMatchesFilter(e,t,!1))return;const r=this.getAccessTokenCredential(e);if(r&&this.credentialMatchesFilter(r,t)){Ze.fromString(r.target).intersectingScopeSets(n)&&o.push(this.removeAccessToken(e))}})),await Promise.all(o),this.setAccessTokenCredential(e)}getAccountsFilteredBy(e){const t=this.getAccountKeys(),r=[];return t.forEach((t=>{if(!this.isAccountKey(t,e.homeAccountId))return;const n=this.getAccount(t,this.commonLogger);if(!n)return;if(e.homeAccountId&&!this.matchHomeAccountId(n,e.homeAccountId))return;if(e.username&&!this.matchUsername(n.username,e.username))return;if(e.environment&&!this.matchEnvironment(n,e.environment))return;if(e.realm&&!this.matchRealm(n,e.realm))return;if(e.nativeAccountId&&!this.matchNativeAccountId(n,e.nativeAccountId))return;if(e.authorityType&&!this.matchAuthorityType(n,e.authorityType))return;const o={localAccountId:e?.localAccountId,name:e?.name},i=n.tenantProfiles?.filter((e=>this.tenantProfileMatchesFilter(e,o)));i&&0===i.length||r.push(n)})),r}isAccountKey(e,t,r){return!(e.split(o.LR.CACHE_KEY_SEPARATOR).length<3)&&(!(t&&!e.toLowerCase().includes(t.toLowerCase()))&&!(r&&!e.toLowerCase().includes(r.toLowerCase())))}isCredentialKey(e){if(e.split(o.LR.CACHE_KEY_SEPARATOR).length<6)return!1;const t=e.toLowerCase();if(-1===t.indexOf(o.aG.ID_TOKEN.toLowerCase())&&-1===t.indexOf(o.aG.ACCESS_TOKEN.toLowerCase())&&-1===t.indexOf(o.aG.ACCESS_TOKEN_WITH_AUTH_SCHEME.toLowerCase())&&-1===t.indexOf(o.aG.REFRESH_TOKEN.toLowerCase()))return!1;if(t.indexOf(o.aG.REFRESH_TOKEN.toLowerCase())>-1){const e=`${o.aG.REFRESH_TOKEN}${o.LR.CACHE_KEY_SEPARATOR}${this.clientId}${o.LR.CACHE_KEY_SEPARATOR}`,r=`${o.aG.REFRESH_TOKEN}${o.LR.CACHE_KEY_SEPARATOR}${o.hB}${o.LR.CACHE_KEY_SEPARATOR}`;if(-1===t.indexOf(e.toLowerCase())&&-1===t.indexOf(r.toLowerCase()))return!1}else if(-1===t.indexOf(this.clientId.toLowerCase()))return!1;return!0}credentialMatchesFilter(e,t){if(t.clientId&&!this.matchClientId(e,t.clientId))return!1;if(t.userAssertionHash&&!this.matchUserAssertionHash(e,t.userAssertionHash))return!1;if("string"==typeof t.homeAccountId&&!this.matchHomeAccountId(e,t.homeAccountId))return!1;if(t.environment&&!this.matchEnvironment(e,t.environment))return!1;if(t.realm&&!this.matchRealm(e,t.realm))return!1;if(t.credentialType&&!this.matchCredentialType(e,t.credentialType))return!1;if(t.familyId&&!this.matchFamilyId(e,t.familyId))return!1;if(t.target&&!this.matchTarget(e,t.target))return!1;if((t.requestedClaimsHash||e.requestedClaimsHash)&&e.requestedClaimsHash!==t.requestedClaimsHash)return!1;if(e.credentialType===o.aG.ACCESS_TOKEN_WITH_AUTH_SCHEME){if(t.tokenType&&!this.matchTokenType(e,t.tokenType))return!1;if(t.tokenType===o.IO.SSH&&t.keyId&&!this.matchKeyId(e,t.keyId))return!1}return!0}getAppMetadataFilteredBy(e){const t=this.getKeys(),r={};return t.forEach((t=>{if(!this.isAppMetadata(t))return;const n=this.getAppMetadata(t);n&&(e.environment&&!this.matchEnvironment(n,e.environment)||e.clientId&&!this.matchClientId(n,e.clientId)||(r[t]=n))})),r}getAuthorityMetadataByAlias(e){const t=this.getAuthorityMetadataKeys();let r=null;return t.forEach((t=>{if(!this.isAuthorityMetadata(t)||-1===t.indexOf(this.clientId))return;const n=this.getAuthorityMetadata(t);n&&-1!==n.aliases.indexOf(e)&&(r=n)})),r}async removeAllAccounts(){const e=this.getAccountKeys(),t=[];e.forEach((e=>{t.push(this.removeAccount(e))})),await Promise.all(t)}async removeAccount(e){const t=this.getAccount(e,this.commonLogger);t&&(await this.removeAccountContext(t),this.removeItem(e))}async removeAccountContext(e){const t=this.getTokenKeys(),r=e.generateAccountId(),n=[];t.idToken.forEach((e=>{0===e.indexOf(r)&&this.removeIdToken(e)})),t.accessToken.forEach((e=>{0===e.indexOf(r)&&n.push(this.removeAccessToken(e))})),t.refreshToken.forEach((e=>{0===e.indexOf(r)&&this.removeRefreshToken(e)})),await Promise.all(n)}updateOutdatedCachedAccount(e,t,r){if(t&&t.isSingleTenant()){this.commonLogger?.verbose("updateOutdatedCachedAccount: Found a single-tenant (outdated) account entity in the cache, migrating to multi-tenant account entity");const n=this.getAccountKeys().filter((e=>e.startsWith(t.homeAccountId))),o=[];n.forEach((e=>{const t=this.getCachedAccountEntity(e);t&&o.push(t)}));const i=o.find((e=>rt(e.realm,e.homeAccountId)))||o[0];i.tenantProfiles=o.map((e=>({tenantId:e.realm,localAccountId:e.localAccountId,name:e.name,isHomeTenant:rt(e.realm,e.homeAccountId)})));const a=wt.toObject(new lt,{...i}),s=a.generateAccountKey();return n.forEach((t=>{t!==s&&this.removeOutdatedAccount(e)})),this.setAccount(a),r?.verbose("Updated an outdated account entity in the cache"),a}return t}async removeAccessToken(e){const t=this.getAccessTokenCredential(e);if(t){if(t.credentialType.toLowerCase()===o.aG.ACCESS_TOKEN_WITH_AUTH_SCHEME.toLowerCase()&&t.tokenType===o.IO.POP){const e=t.keyId;if(e)try{await this.cryptoImpl.removeTokenBindingKey(e)}catch(e){throw re($)}}return this.removeItem(e)}}removeAppMetadata(){return this.getKeys().forEach((e=>{this.isAppMetadata(e)&&this.removeItem(e)})),!0}readAccountFromCache(e){const t=lt.generateAccountCacheKey(e);return this.getAccount(t,this.commonLogger)}getIdToken(e,t,r,n,i){this.commonLogger.trace("CacheManager - getIdToken called");const a={homeAccountId:e.homeAccountId,environment:e.environment,credentialType:o.aG.ID_TOKEN,clientId:this.clientId,realm:r},s=this.getIdTokensByFilter(a,t),c=s.size;if(c<1)return this.commonLogger.info("CacheManager:getIdToken - No token found"),null;if(c>1){let t=s;if(!r){const r=new Map;s.forEach(((t,n)=>{t.realm===e.tenantId&&r.set(n,t)}));const n=r.size;if(n<1)return this.commonLogger.info("CacheManager:getIdToken - Multiple ID tokens found for account but none match account entity tenant id, returning first result"),s.values().next().value;if(1===n)return this.commonLogger.info("CacheManager:getIdToken - Multiple ID tokens found for account, defaulting to home tenant profile"),r.values().next().value;t=r}return this.commonLogger.info("CacheManager:getIdToken - Multiple matching ID tokens found, clearing them"),t.forEach(((e,t)=>{this.removeIdToken(t)})),n&&i&&n.addFields({multiMatchedID:s.size},i),null}return this.commonLogger.info("CacheManager:getIdToken - Returning ID token"),s.values().next().value}getIdTokensByFilter(e,t){const r=t&&t.idToken||this.getTokenKeys().idToken,n=new Map;return r.forEach((t=>{if(!this.idTokenKeyMatchesFilter(t,{clientId:this.clientId,...e}))return;const r=this.getIdTokenCredential(t);r&&this.credentialMatchesFilter(r,e)&&n.set(t,r)})),n}idTokenKeyMatchesFilter(e,t){const r=e.toLowerCase();return(!t.clientId||-1!==r.indexOf(t.clientId.toLowerCase()))&&(!t.homeAccountId||-1!==r.indexOf(t.homeAccountId.toLowerCase()))}removeIdToken(e){this.removeItem(e)}removeRefreshToken(e){this.removeItem(e)}getAccessToken(e,t,r,n,i,a){this.commonLogger.trace("CacheManager - getAccessToken called");const s=Ze.createSearchScopes(t.scopes),c=t.authenticationScheme||o.IO.BEARER,h=c&&c.toLowerCase()!==o.IO.BEARER.toLowerCase()?o.aG.ACCESS_TOKEN_WITH_AUTH_SCHEME:o.aG.ACCESS_TOKEN,l={homeAccountId:e.homeAccountId,environment:e.environment,credentialType:h,clientId:this.clientId,realm:n||e.tenantId,target:s,tokenType:c,keyId:t.sshKid,requestedClaimsHash:t.requestedClaimsHash},d=r&&r.accessToken||this.getTokenKeys().accessToken,u=[];d.forEach((e=>{if(this.accessTokenKeyMatchesFilter(e,l,!0)){const t=this.getAccessTokenCredential(e);t&&this.credentialMatchesFilter(t,l)&&u.push(t)}}));const g=u.length;return g<1?(this.commonLogger.info("CacheManager:getAccessToken - No token found"),null):g>1?(this.commonLogger.info("CacheManager:getAccessToken - Multiple access tokens found, clearing them"),u.forEach((e=>{this.removeAccessToken(le(e))})),i&&a&&i.addFields({multiMatchedAT:u.length},a),null):(this.commonLogger.info("CacheManager:getAccessToken - Returning access token"),u[0])}accessTokenKeyMatchesFilter(e,t,r){const n=e.toLowerCase();if(t.clientId&&-1===n.indexOf(t.clientId.toLowerCase()))return!1;if(t.homeAccountId&&-1===n.indexOf(t.homeAccountId.toLowerCase()))return!1;if(t.realm&&-1===n.indexOf(t.realm.toLowerCase()))return!1;if(t.requestedClaimsHash&&-1===n.indexOf(t.requestedClaimsHash.toLowerCase()))return!1;if(t.target){const e=t.target.asArray();for(let t=0;t<e.length;t++){if(r&&!n.includes(e[t].toLowerCase()))return!1;if(!r&&n.includes(e[t].toLowerCase()))return!0}}return!0}getAccessTokensByFilter(e){const t=this.getTokenKeys(),r=[];return t.accessToken.forEach((t=>{if(!this.accessTokenKeyMatchesFilter(t,e,!0))return;const n=this.getAccessTokenCredential(t);n&&this.credentialMatchesFilter(n,e)&&r.push(n)})),r}getRefreshToken(e,t,r,n,i){this.commonLogger.trace("CacheManager - getRefreshToken called");const a=t?o.hB:void 0,s={homeAccountId:e.homeAccountId,environment:e.environment,credentialType:o.aG.REFRESH_TOKEN,clientId:this.clientId,familyId:a},c=r&&r.refreshToken||this.getTokenKeys().refreshToken,h=[];c.forEach((e=>{if(this.refreshTokenKeyMatchesFilter(e,s)){const t=this.getRefreshTokenCredential(e);t&&this.credentialMatchesFilter(t,s)&&h.push(t)}}));const l=h.length;return l<1?(this.commonLogger.info("CacheManager:getRefreshToken - No refresh token found."),null):(l>1&&n&&i&&n.addFields({multiMatchedRT:l},i),this.commonLogger.info("CacheManager:getRefreshToken - returning refresh token"),h[0])}refreshTokenKeyMatchesFilter(e,t){const r=e.toLowerCase();return(!t.familyId||-1!==r.indexOf(t.familyId.toLowerCase()))&&(!(!t.familyId&&t.clientId&&-1===r.indexOf(t.clientId.toLowerCase()))&&(!t.homeAccountId||-1!==r.indexOf(t.homeAccountId.toLowerCase())))}readAppMetadataFromCache(e){const t={environment:e,clientId:this.clientId},r=this.getAppMetadataFilteredBy(t),n=Object.keys(r).map((e=>r[e])),o=n.length;if(o<1)return null;if(o>1)throw re(R);return n[0]}isAppMetadataFOCI(e){const t=this.readAppMetadataFromCache(e);return!(!t||t.familyId!==o.hB)}matchHomeAccountId(e,t){return!("string"!=typeof e.homeAccountId||t!==e.homeAccountId)}matchLocalAccountIdFromTokenClaims(e,t){return t===(e.oid||e.sub)}matchLocalAccountIdFromTenantProfile(e,t){return e.localAccountId===t}matchName(e,t){return!(t.toLowerCase()!==e.name?.toLowerCase())}matchUsername(e,t){return!(!e||"string"!=typeof e||t?.toLowerCase()!==e.toLowerCase())}matchUserAssertionHash(e,t){return!(!e.userAssertionHash||t!==e.userAssertionHash)}matchEnvironment(e,t){if(this.staticAuthorityOptions){const r=function(e,t){let r;const n=e.canonicalAuthority;if(n){const i=new gt(n).getUrlComponents().HostNameAndPort;r=ft(i,e.cloudDiscoveryMetadata?.metadata,o.E_.CONFIG,t)||ft(i,mt.metadata,o.E_.HARDCODED_VALUES,t)||e.knownAuthorities}return r||[]}(this.staticAuthorityOptions,this.commonLogger);if(r.includes(t)&&r.includes(e.environment))return!0}const r=this.getAuthorityMetadataByAlias(t);return!!(r&&r.aliases.indexOf(e.environment)>-1)}matchCredentialType(e,t){return e.credentialType&&t.toLowerCase()===e.credentialType.toLowerCase()}matchClientId(e,t){return!(!e.clientId||t!==e.clientId)}matchFamilyId(e,t){return!(!e.familyId||t!==e.familyId)}matchRealm(e,t){return!(e.realm?.toLowerCase()!==t.toLowerCase())}matchNativeAccountId(e,t){return!(!e.nativeAccountId||t!==e.nativeAccountId)}matchLoginHintFromTokenClaims(e,t){return e.login_hint===t||(e.preferred_username===t||e.upn===t)}matchSid(e,t){return e.sid===t}matchAuthorityType(e,t){return!(!e.authorityType||t.toLowerCase()!==e.authorityType.toLowerCase())}matchTarget(e,t){if(e.credentialType!==o.aG.ACCESS_TOKEN&&e.credentialType!==o.aG.ACCESS_TOKEN_WITH_AUTH_SCHEME||!e.target)return!1;return Ze.fromString(e.target).containsScopeSet(t)}matchTokenType(e,t){return!(!e.tokenType||e.tokenType!==t)}matchKeyId(e,t){return!(!e.keyId||e.keyId!==t)}isAppMetadata(e){return-1!==e.indexOf(o.GU)}isAuthorityMetadata(e){return-1!==e.indexOf(o.u0.CACHE_KEY)}generateAuthorityMetadataCacheKey(e){return`${o.u0.CACHE_KEY}-${this.clientId}-${e}`}static toObject(e,t){for(const r in t)e[r]=t[r];return e}}class Et extends wt{setAccount(){throw re(X)}getAccount(){throw re(X)}getCachedAccountEntity(){throw re(X)}setIdTokenCredential(){throw re(X)}getIdTokenCredential(){throw re(X)}setAccessTokenCredential(){throw re(X)}getAccessTokenCredential(){throw re(X)}setRefreshTokenCredential(){throw re(X)}getRefreshTokenCredential(){throw re(X)}setAppMetadata(){throw re(X)}getAppMetadata(){throw re(X)}setServerTelemetry(){throw re(X)}getServerTelemetry(){throw re(X)}setAuthorityMetadata(){throw re(X)}getAuthorityMetadata(){throw re(X)}getAuthorityMetadataKeys(){throw re(X)}setThrottlingCache(){throw re(X)}getThrottlingCache(){throw re(X)}removeItem(){throw re(X)}getKeys(){throw re(X)}getAccountKeys(){throw re(X)}getTokenKeys(){throw re(X)}async clear(){throw re(X)}updateCredentialCacheKey(){throw re(X)}removeOutdatedAccount(){throw re(X)}}
/*! @azure/msal-common v14.15.0 2024-09-20 */
const kt={tokenRenewalOffsetSeconds:o.F0,preventCorsPreflight:!1},Rt={loggerCallback:()=>{},piiLoggingEnabled:!1,logLevel:n.Info,correlationId:o.YM.EMPTY_STRING},St={claimsBasedCachingEnabled:!1},_t={async sendGetRequestAsync(){throw re(X)},async sendPostRequestAsync(){throw re(X)}},bt={sku:o.YM.SKU,version:ie,cpu:o.YM.EMPTY_STRING,os:o.YM.EMPTY_STRING},Mt={clientSecret:o.YM.EMPTY_STRING,clientAssertion:void 0},Ot={azureCloudInstance:c,tenant:`${o.YM.DEFAULT_COMMON_TENANT}`},Pt={application:{appName:"",appVersion:""}};function Nt(e){return e.authOptions.authority.options.protocolMode===s}
/*! @azure/msal-common v14.15.0 2024-09-20 */
const qt={sendGetRequestAsync:()=>Promise.reject(re(X)),sendPostRequestAsync:()=>Promise.reject(re(X))},Lt={AcquireTokenByCode:"acquireTokenByCode",AcquireTokenByRefreshToken:"acquireTokenByRefreshToken",AcquireTokenSilent:"acquireTokenSilent",AcquireTokenSilentAsync:"acquireTokenSilentAsync",AcquireTokenPopup:"acquireTokenPopup",AcquireTokenPreRedirect:"acquireTokenPreRedirect",AcquireTokenRedirect:"acquireTokenRedirect",CryptoOptsGetPublicKeyThumbprint:"cryptoOptsGetPublicKeyThumbprint",CryptoOptsSignJwt:"cryptoOptsSignJwt",SilentCacheClientAcquireToken:"silentCacheClientAcquireToken",SilentIframeClientAcquireToken:"silentIframeClientAcquireToken",AwaitConcurrentIframe:"awaitConcurrentIframe",SilentRefreshClientAcquireToken:"silentRefreshClientAcquireToken",SsoSilent:"ssoSilent",StandardInteractionClientGetDiscoveredAuthority:"standardInteractionClientGetDiscoveredAuthority",FetchAccountIdWithNativeBroker:"fetchAccountIdWithNativeBroker",NativeInteractionClientAcquireToken:"nativeInteractionClientAcquireToken",BaseClientCreateTokenRequestHeaders:"baseClientCreateTokenRequestHeaders",RefreshTokenClientExecutePostToTokenEndpoint:"refreshTokenClientExecutePostToTokenEndpoint",AuthorizationCodeClientExecutePostToTokenEndpoint:"authorizationCodeClientExecutePostToTokenEndpoint",BrokerHandhshake:"brokerHandshake",AcquireTokenByRefreshTokenInBroker:"acquireTokenByRefreshTokenInBroker",AcquireTokenByBroker:"acquireTokenByBroker",RefreshTokenClientExecuteTokenRequest:"refreshTokenClientExecuteTokenRequest",RefreshTokenClientAcquireToken:"refreshTokenClientAcquireToken",RefreshTokenClientAcquireTokenWithCachedRefreshToken:"refreshTokenClientAcquireTokenWithCachedRefreshToken",RefreshTokenClientAcquireTokenByRefreshToken:"refreshTokenClientAcquireTokenByRefreshToken",RefreshTokenClientCreateTokenRequestBody:"refreshTokenClientCreateTokenRequestBody",AcquireTokenFromCache:"acquireTokenFromCache",SilentFlowClientAcquireCachedToken:"silentFlowClientAcquireCachedToken",SilentFlowClientGenerateResultFromCacheRecord:"silentFlowClientGenerateResultFromCacheRecord",AcquireTokenBySilentIframe:"acquireTokenBySilentIframe",InitializeBaseRequest:"initializeBaseRequest",InitializeSilentRequest:"initializeSilentRequest",InitializeClientApplication:"initializeClientApplication",SilentIframeClientTokenHelper:"silentIframeClientTokenHelper",SilentHandlerInitiateAuthRequest:"silentHandlerInitiateAuthRequest",SilentHandlerMonitorIframeForHash:"silentHandlerMonitorIframeForHash",SilentHandlerLoadFrame:"silentHandlerLoadFrame",SilentHandlerLoadFrameSync:"silentHandlerLoadFrameSync",StandardInteractionClientCreateAuthCodeClient:"standardInteractionClientCreateAuthCodeClient",StandardInteractionClientGetClientConfiguration:"standardInteractionClientGetClientConfiguration",StandardInteractionClientInitializeAuthorizationRequest:"standardInteractionClientInitializeAuthorizationRequest",StandardInteractionClientInitializeAuthorizationCodeRequest:"standardInteractionClientInitializeAuthorizationCodeRequest",GetAuthCodeUrl:"getAuthCodeUrl",HandleCodeResponseFromServer:"handleCodeResponseFromServer",HandleCodeResponse:"handleCodeResponse",UpdateTokenEndpointAuthority:"updateTokenEndpointAuthority",AuthClientAcquireToken:"authClientAcquireToken",AuthClientExecuteTokenRequest:"authClientExecuteTokenRequest",AuthClientCreateTokenRequestBody:"authClientCreateTokenRequestBody",AuthClientCreateQueryString:"authClientCreateQueryString",PopTokenGenerateCnf:"popTokenGenerateCnf",PopTokenGenerateKid:"popTokenGenerateKid",HandleServerTokenResponse:"handleServerTokenResponse",DeserializeResponse:"deserializeResponse",AuthorityFactoryCreateDiscoveredInstance:"authorityFactoryCreateDiscoveredInstance",AuthorityResolveEndpointsAsync:"authorityResolveEndpointsAsync",AuthorityResolveEndpointsFromLocalSources:"authorityResolveEndpointsFromLocalSources",AuthorityGetCloudDiscoveryMetadataFromNetwork:"authorityGetCloudDiscoveryMetadataFromNetwork",AuthorityUpdateCloudDiscoveryMetadata:"authorityUpdateCloudDiscoveryMetadata",AuthorityGetEndpointMetadataFromNetwork:"authorityGetEndpointMetadataFromNetwork",AuthorityUpdateEndpointMetadata:"authorityUpdateEndpointMetadata",AuthorityUpdateMetadataWithRegionalInformation:"authorityUpdateMetadataWithRegionalInformation",RegionDiscoveryDetectRegion:"regionDiscoveryDetectRegion",RegionDiscoveryGetRegionFromIMDS:"regionDiscoveryGetRegionFromIMDS",RegionDiscoveryGetCurrentVersion:"regionDiscoveryGetCurrentVersion",AcquireTokenByCodeAsync:"acquireTokenByCodeAsync",GetEndpointMetadataFromNetwork:"getEndpointMetadataFromNetwork",GetCloudDiscoveryMetadataFromNetworkMeasurement:"getCloudDiscoveryMetadataFromNetworkMeasurement",HandleRedirectPromiseMeasurement:"handleRedirectPromise",HandleNativeRedirectPromiseMeasurement:"handleNativeRedirectPromise",UpdateCloudDiscoveryMetadataMeasurement:"updateCloudDiscoveryMetadataMeasurement",UsernamePasswordClientAcquireToken:"usernamePasswordClientAcquireToken",NativeMessageHandlerHandshake:"nativeMessageHandlerHandshake",NativeGenerateAuthResult:"nativeGenerateAuthResult",RemoveHiddenIframe:"removeHiddenIframe",ClearTokensAndKeysWithClaims:"clearTokensAndKeysWithClaims",CacheManagerGetRefreshToken:"cacheManagerGetRefreshToken",GeneratePkceCodes:"generatePkceCodes",GenerateCodeVerifier:"generateCodeVerifier",GenerateCodeChallengeFromVerifier:"generateCodeChallengeFromVerifier",Sha256Digest:"sha256Digest",GetRandomValues:"getRandomValues"},Ut=(new Map([[Lt.AcquireTokenByCode,"ATByCode"],[Lt.AcquireTokenByRefreshToken,"ATByRT"],[Lt.AcquireTokenSilent,"ATS"],[Lt.AcquireTokenSilentAsync,"ATSAsync"],[Lt.AcquireTokenPopup,"ATPopup"],[Lt.AcquireTokenRedirect,"ATRedirect"],[Lt.CryptoOptsGetPublicKeyThumbprint,"CryptoGetPKThumb"],[Lt.CryptoOptsSignJwt,"CryptoSignJwt"],[Lt.SilentCacheClientAcquireToken,"SltCacheClientAT"],[Lt.SilentIframeClientAcquireToken,"SltIframeClientAT"],[Lt.SilentRefreshClientAcquireToken,"SltRClientAT"],[Lt.SsoSilent,"SsoSlt"],[Lt.StandardInteractionClientGetDiscoveredAuthority,"StdIntClientGetDiscAuth"],[Lt.FetchAccountIdWithNativeBroker,"FetchAccIdWithNtvBroker"],[Lt.NativeInteractionClientAcquireToken,"NtvIntClientAT"],[Lt.BaseClientCreateTokenRequestHeaders,"BaseClientCreateTReqHead"],[Lt.RefreshTokenClientExecutePostToTokenEndpoint,"RTClientExecPost"],[Lt.AuthorizationCodeClientExecutePostToTokenEndpoint,"AuthCodeClientExecPost"],[Lt.BrokerHandhshake,"BrokerHandshake"],[Lt.AcquireTokenByRefreshTokenInBroker,"ATByRTInBroker"],[Lt.AcquireTokenByBroker,"ATByBroker"],[Lt.RefreshTokenClientExecuteTokenRequest,"RTClientExecTReq"],[Lt.RefreshTokenClientAcquireToken,"RTClientAT"],[Lt.RefreshTokenClientAcquireTokenWithCachedRefreshToken,"RTClientATWithCachedRT"],[Lt.RefreshTokenClientAcquireTokenByRefreshToken,"RTClientATByRT"],[Lt.RefreshTokenClientCreateTokenRequestBody,"RTClientCreateTReqBody"],[Lt.AcquireTokenFromCache,"ATFromCache"],[Lt.SilentFlowClientAcquireCachedToken,"SltFlowClientATCached"],[Lt.SilentFlowClientGenerateResultFromCacheRecord,"SltFlowClientGenResFromCache"],[Lt.AcquireTokenBySilentIframe,"ATBySltIframe"],[Lt.InitializeBaseRequest,"InitBaseReq"],[Lt.InitializeSilentRequest,"InitSltReq"],[Lt.InitializeClientApplication,"InitClientApplication"],[Lt.SilentIframeClientTokenHelper,"SIClientTHelper"],[Lt.SilentHandlerInitiateAuthRequest,"SHandlerInitAuthReq"],[Lt.SilentHandlerMonitorIframeForHash,"SltHandlerMonitorIframeForHash"],[Lt.SilentHandlerLoadFrame,"SHandlerLoadFrame"],[Lt.SilentHandlerLoadFrameSync,"SHandlerLoadFrameSync"],[Lt.StandardInteractionClientCreateAuthCodeClient,"StdIntClientCreateAuthCodeClient"],[Lt.StandardInteractionClientGetClientConfiguration,"StdIntClientGetClientConf"],[Lt.StandardInteractionClientInitializeAuthorizationRequest,"StdIntClientInitAuthReq"],[Lt.StandardInteractionClientInitializeAuthorizationCodeRequest,"StdIntClientInitAuthCodeReq"],[Lt.GetAuthCodeUrl,"GetAuthCodeUrl"],[Lt.HandleCodeResponseFromServer,"HandleCodeResFromServer"],[Lt.HandleCodeResponse,"HandleCodeResp"],[Lt.UpdateTokenEndpointAuthority,"UpdTEndpointAuth"],[Lt.AuthClientAcquireToken,"AuthClientAT"],[Lt.AuthClientExecuteTokenRequest,"AuthClientExecTReq"],[Lt.AuthClientCreateTokenRequestBody,"AuthClientCreateTReqBody"],[Lt.AuthClientCreateQueryString,"AuthClientCreateQueryStr"],[Lt.PopTokenGenerateCnf,"PopTGenCnf"],[Lt.PopTokenGenerateKid,"PopTGenKid"],[Lt.HandleServerTokenResponse,"HandleServerTRes"],[Lt.DeserializeResponse,"DeserializeRes"],[Lt.AuthorityFactoryCreateDiscoveredInstance,"AuthFactCreateDiscInst"],[Lt.AuthorityResolveEndpointsAsync,"AuthResolveEndpointsAsync"],[Lt.AuthorityResolveEndpointsFromLocalSources,"AuthResolveEndpointsFromLocal"],[Lt.AuthorityGetCloudDiscoveryMetadataFromNetwork,"AuthGetCDMetaFromNet"],[Lt.AuthorityUpdateCloudDiscoveryMetadata,"AuthUpdCDMeta"],[Lt.AuthorityGetEndpointMetadataFromNetwork,"AuthUpdCDMetaFromNet"],[Lt.AuthorityUpdateEndpointMetadata,"AuthUpdEndpointMeta"],[Lt.AuthorityUpdateMetadataWithRegionalInformation,"AuthUpdMetaWithRegInfo"],[Lt.RegionDiscoveryDetectRegion,"RegDiscDetectReg"],[Lt.RegionDiscoveryGetRegionFromIMDS,"RegDiscGetRegFromIMDS"],[Lt.RegionDiscoveryGetCurrentVersion,"RegDiscGetCurrentVer"],[Lt.AcquireTokenByCodeAsync,"ATByCodeAsync"],[Lt.GetEndpointMetadataFromNetwork,"GetEndpointMetaFromNet"],[Lt.GetCloudDiscoveryMetadataFromNetworkMeasurement,"GetCDMetaFromNet"],[Lt.HandleRedirectPromiseMeasurement,"HandleRedirectPromise"],[Lt.HandleNativeRedirectPromiseMeasurement,"HandleNtvRedirectPromise"],[Lt.UpdateCloudDiscoveryMetadataMeasurement,"UpdateCDMeta"],[Lt.UsernamePasswordClientAcquireToken,"UserPassClientAT"],[Lt.NativeMessageHandlerHandshake,"NtvMsgHandlerHandshake"],[Lt.NativeGenerateAuthResult,"NtvGenAuthRes"],[Lt.RemoveHiddenIframe,"RemoveHiddenIframe"],[Lt.ClearTokensAndKeysWithClaims,"ClearTAndKeysWithClaims"],[Lt.CacheManagerGetRefreshToken,"CacheManagerGetRT"],[Lt.GeneratePkceCodes,"GenPkceCodes"],[Lt.GenerateCodeVerifier,"GenCodeVerifier"],[Lt.GenerateCodeChallengeFromVerifier,"GenCodeChallengeFromVerifier"],[Lt.Sha256Digest,"Sha256Digest"],[Lt.GetRandomValues,"GetRandomValues"]]),1);new Set(["accessTokenSize","durationMs","idTokenSize","matsSilentStatus","matsHttpStatus","refreshTokenSize","queuedTimeMs","startTimeMs","status","multiMatchedAT","multiMatchedID","multiMatchedRT"]);
/*! @azure/msal-common v14.15.0 2024-09-20 */
class Ht{startMeasurement(){}endMeasurement(){}flushMeasurement(){return null}}class Dt{generateId(){return"callback-id"}startMeasurement(e,t){return{end:()=>null,discard:()=>{},add:()=>{},increment:()=>{},event:{eventId:this.generateId(),status:Ut,authority:"",libraryName:"",libraryVersion:"",clientId:"",name:e,startTimeMs:Date.now(),correlationId:t||""},measurement:new Ht}}startPerformanceMeasurement(){return new Ht}calculateQueuedTime(){return 0}addQueueMeasurement(){}setPreQueueTime(){}endMeasurement(){return null}discardMeasurements(){}removePerformanceCallback(){return!0}addPerformanceCallback(){return""}emitEvents(){}addFields(){}incrementFields(){}cacheEventByCorrelationId(){}}
/*! @azure/msal-browser v3.26.1 2024-10-08 */
const Bt={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"},Ft="53ee284d-920a-4b59-9d30-a60315b26836",xt="ppnbnpeolgkicgegkbkbjmhlideopiji",Kt="MATS",Gt="Handshake",Yt="HandshakeResponse",zt="GetToken",$t="Response",Wt="localStorage",Qt="sessionStorage",Vt="memoryStorage",jt="GET",Jt="POST",Xt="authority",Zt="request.state",er="nonce.id_token",tr="request.origin",rr="urlHash",nr="request.params",or="interaction.status",ir="ccs.credential",ar="request.correlationId",sr="request.native",cr="msal.account.keys",hr="msal.token.keys",lr="wrapper.sku",dr="wrapper.version",ur=861,gr=862,pr=863,mr=865,Cr=866,fr=61,yr=961,Tr=962;var Ir;!function(e){e.Redirect="redirect",e.Popup="popup",e.Silent="silent",e.None="none"}(Ir||(Ir={}));const vr={scopes:o.aZ},Ar="msal.db",wr=`${Ar}.keys`,Er=0,kr=1,Rr=2,Sr=3,_r=4,br=5,Mr=[Er,br,_r];
/*! @azure/msal-browser v3.26.1 2024-10-08 */
class Or{navigateInternal(e,t){return Or.defaultNavigateWindow(e,t)}navigateExternal(e,t){return Or.defaultNavigateWindow(e,t)}static defaultNavigateWindow(e,t){return t.noHistory?window.location.replace(e):window.location.assign(e),new Promise((e=>{setTimeout((()=>{e(!0)}),t.timeout)}))}}
/*! @azure/msal-browser v3.26.1 2024-10-08 */
const Pr="pkce_not_created",Nr="crypto_nonexistent",qr="empty_navigate_uri",Lr="hash_empty_error",Ur="no_state_in_hash",Hr="hash_does_not_contain_known_properties",Dr="unable_to_parse_state",Br="state_interaction_type_mismatch",Fr="interaction_in_progress",xr="popup_window_error",Kr="empty_window_error",Gr="user_cancelled",Yr="monitor_popup_timeout",zr="monitor_window_timeout",$r="redirect_in_iframe",Wr="block_iframe_reload",Qr="block_nested_popups",Vr="iframe_closed_prematurely",jr="silent_logout_unsupported",Jr="no_account_error",Xr="silent_prompt_value_error",Zr="no_token_request_cache_error",en="unable_to_parse_token_request_cache_error",tn="no_cached_authority_error",rn="auth_request_not_set_error",nn="invalid_cache_type",on="non_browser_environment",an="database_not_open",sn="no_network_connectivity",cn="post_request_failed",hn="get_request_failed",ln="failed_to_parse_response",dn="unable_to_load_token",un="crypto_key_not_found",gn="auth_code_required",pn="auth_code_or_nativeAccountId_required",mn="spa_code_and_nativeAccountId_present",Cn="database_unavailable",fn="unable_to_acquire_token_from_native_platform",yn="native_handshake_timeout",Tn="native_extension_not_installed",In="native_connection_not_established",vn="uninitialized_public_client_application",An="native_prompt_not_supported",wn="invalid_base64_string",En="invalid_pop_token_request",kn="For more visit: aka.ms/msaljs/browser-errors",Rn={[Pr]:"The PKCE code challenge and verifier could not be generated.",[Nr]:"The crypto object or function is not available.",[qr]:"Navigation URI is empty. Please check stack trace for more info.",[Lr]:`Hash value cannot be processed because it is empty. Please verify that your redirectUri is not clearing the hash. ${kn}`,[Ur]:"Hash does not contain state. Please verify that the request originated from msal.",[Hr]:`Hash does not contain known properites. Please verify that your redirectUri is not changing the hash.  ${kn}`,[Dr]:"Unable to parse state. Please verify that the request originated from msal.",[Br]:"Hash contains state but the interaction type does not match the caller.",[Fr]:`Interaction is currently in progress. Please ensure that this interaction has been completed before calling an interactive API.   ${kn}`,[xr]:"Error opening popup window. This can happen if you are using IE or if popups are blocked in the browser.",[Kr]:"window.open returned null or undefined window object.",[Gr]:"User cancelled the flow.",[Yr]:`Token acquisition in popup failed due to timeout.  ${kn}`,[zr]:`Token acquisition in iframe failed due to timeout.  ${kn}`,[$r]:"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.",[Wr]:`Request was blocked inside an iframe because MSAL detected an authentication response.  ${kn}`,[Qr]:"Request was blocked inside a popup because MSAL detected it was running in a popup.",[Vr]:"The iframe being monitored was closed prematurely.",[jr]:"Silent logout not supported. Please call logoutRedirect or logoutPopup instead.",[Jr]:"No account object provided to acquireTokenSilent and no active account has been set. Please call setActiveAccount or provide an account on the request.",[Xr]:"The value given for the prompt value is not valid for silent requests - must be set to 'none' or 'no_session'.",[Zr]:"No token request found in cache.",[en]:"The cached token request could not be parsed.",[tn]:"No cached authority found.",[rn]:"Auth Request not set. Please ensure initiateAuthRequest was called from the InteractionHandler",[nn]:"Invalid cache type",[on]:"Login and token requests are not supported in non-browser environments.",[an]:"Database is not open!",[sn]:"No network connectivity. Check your internet connection.",[cn]:"Network request failed: If the browser threw a CORS error, check that the redirectUri is registered in the Azure App Portal as type 'SPA'",[hn]:"Network request failed. Please check the network trace to determine root cause.",[ln]:"Failed to parse network response. Check network trace.",[dn]:"Error loading token to cache.",[un]:"Cryptographic Key or Keypair not found in browser storage.",[gn]:"An authorization code must be provided (as the `code` property on the request) to this flow.",[pn]:"An authorization code or nativeAccountId must be provided to this flow.",[mn]:"Request cannot contain both spa code and native account id.",[Cn]:"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.",[fn]:`Unable to acquire token from native platform.  ${kn}`,[yn]:"Timed out while attempting to establish connection to browser extension",[Tn]:"Native extension is not installed. If you think this is a mistake call the initialize function.",[In]:`Connection to native platform has not been established. Please install a compatible browser extension and run initialize().  ${kn}`,[vn]:`You must call and await the initialize function before attempting to call any other MSAL API.  ${kn}`,[An]:"The provided prompt is not supported by the native platform. This request should be routed to the web based flow.",[wn]:"Invalid base64 encoded string.",[En]:"Invalid PoP token request. The request should not have both a popKid value and signPopToken set to true."};class Sn extends h.lR{constructor(e){super(e,Rn[e]),Object.setPrototypeOf(this,Sn.prototype),this.name="BrowserAuthError"}}function _n(e){return new Sn(e)}
/*! @azure/msal-browser v3.26.1 2024-10-08 */
class bn{async sendGetRequestAsync(e,t){let r;try{r=await fetch(e,{method:jt,headers:this.getFetchHeaders(t)})}catch(e){throw window.navigator.onLine?_n(hn):_n(sn)}try{return{headers:this.getHeaderDict(r.headers),body:await r.json(),status:r.status}}catch(e){throw _n(ln)}}async sendPostRequestAsync(e,t){const r=t&&t.body||o.YM.EMPTY_STRING;let n;try{n=await fetch(e,{method:Jt,headers:this.getFetchHeaders(t),body:r})}catch(e){throw window.navigator.onLine?_n(cn):_n(sn)}try{return{headers:this.getHeaderDict(n.headers),body:await n.json(),status:n.status}}catch(e){throw _n(ln)}}getFetchHeaders(e){const t=new Headers;if(!e||!e.headers)return t;const r=e.headers;return Object.keys(r).forEach((e=>{t.append(e,r[e])})),t}getHeaderDict(e){const t={};return e.forEach(((e,r)=>{t[r]=e})),t}}
/*! @azure/msal-browser v3.26.1 2024-10-08 */
const Mn=1e4;
/*! @azure/msal-browser v3.26.1 2024-10-08 */
const On="3.26.1";
/*! @azure/msal-browser v3.26.1 2024-10-08 */
class Pn{static loggerCallback(e,t){switch(e){case n.Error:return void console.error(t);case n.Info:return;case n.Verbose:return void console.debug(t);case n.Warning:return void console.warn(t);default:return}}constructor(e){let t;this.browserEnvironment="undefined"!=typeof window,this.config=function({auth:e,cache:t,system:r,telemetry:h},l){const d={clientId:o.YM.EMPTY_STRING,authority:`${o.YM.DEFAULT_AUTHORITY}`,knownAuthorities:[],cloudDiscoveryMetadata:o.YM.EMPTY_STRING,authorityMetadata:o.YM.EMPTY_STRING,redirectUri:o.YM.EMPTY_STRING,postLogoutRedirectUri:o.YM.EMPTY_STRING,navigateToLoginRequestUrl:!0,clientCapabilities:[],protocolMode:a,OIDCOptions:{serverResponseType:o.zL.FRAGMENT,defaultScopes:[o.YM.OPENID_SCOPE,o.YM.PROFILE_SCOPE,o.YM.OFFLINE_ACCESS_SCOPE]},azureCloudOptions:{azureCloudInstance:c,tenant:o.YM.EMPTY_STRING},skipAuthorityMetadataCache:!1,supportsNestedAppAuth:!1,instanceAware:!1},u={cacheLocation:Qt,temporaryCacheLocation:Qt,storeAuthStateInCookie:!1,secureCookies:!1,cacheMigrationEnabled:!(!t||t.cacheLocation!==Wt),claimsBasedCachingEnabled:!1},g={loggerCallback:()=>{},logLevel:n.Info,piiLoggingEnabled:!1},p={...{...kt,loggerOptions:g,networkClient:l?new bn:qt,navigationClient:new Or,loadFrameTimeout:0,windowHashTimeout:r?.loadFrameTimeout||6e4,iframeHashTimeout:r?.loadFrameTimeout||Mn,navigateFrameWait:0,redirectNavigationTimeout:3e4,asyncPopups:!1,allowRedirectInIframe:!1,allowNativeBroker:!1,nativeBrokerHandshakeTimeout:r?.nativeBrokerHandshakeTimeout||2e3,pollIntervalMilliseconds:Bt.DEFAULT_POLL_INTERVAL_MS},...r,loggerOptions:r?.loggerOptions||g},m={application:{appName:o.YM.EMPTY_STRING,appVersion:o.YM.EMPTY_STRING},client:new Dt};e?.protocolMode!==s&&e?.OIDCOptions&&new i(p.loggerOptions).warning(JSON.stringify(Je($e)));if(e?.protocolMode&&e.protocolMode!==a&&p?.allowNativeBroker)throw Je(We);return{auth:{...d,...e,OIDCOptions:{...d.OIDCOptions,...e?.OIDCOptions}},cache:{...u,...t},system:p,telemetry:{...m,...h}}}(e,this.browserEnvironment);try{t=window[Qt]}catch(e){}const r=t?.getItem("msal.browser.log.level"),h=t?.getItem("msal.browser.log.pii")?.toLowerCase(),l="true"===h||"false"!==h&&void 0,d={...this.config.system.loggerOptions},u=r&&Object.keys(n).includes(r)?n[r]:void 0;u&&(d.loggerCallback=Pn.loggerCallback,d.logLevel=u),void 0!==l&&(d.piiLoggingEnabled=l),this.logger=new i(d,"@azure/msal-browser",On),this.available=!1}getConfig(){return this.config}getLogger(){return this.logger}isAvailable(){return this.available}isBrowserEnvironment(){return this.browserEnvironment}}
/*! @azure/msal-browser v3.26.1 2024-10-08 */
class Nn extends Pn{getModuleName(){return Nn.MODULE_NAME}getId(){return Nn.ID}async initialize(){return this.available="undefined"!=typeof window,this.available}}Nn.MODULE_NAME="",Nn.ID="StandardOperatingContext";
/*! @azure/msal-common v14.15.0 2024-09-20 */
const qn="missing_kid_error",Ln="missing_alg_error",Un={[qn]:"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.",[Ln]:"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."};class Hn extends h.lR{constructor(e,t){super(e,t),this.name="JoseHeaderError",Object.setPrototypeOf(this,Hn.prototype)}}function Dn(e){return new Hn(e,Un[e])}
/*! @azure/msal-common v14.15.0 2024-09-20 */
class Bn{constructor(e){this.typ=e.typ,this.alg=e.alg,this.kid=e.kid}static getShrHeaderString(e){if(!e.kid)throw Dn(qn);if(!e.alg)throw Dn(Ln);const t=new Bn({typ:e.typ||o.Lz.Pop,kid:e.kid,alg:e.alg});return JSON.stringify(t)}}
/*! @azure/msal-browser v3.26.1 2024-10-08 */
function Fn(e){return encodeURIComponent(Kn(e).replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_"))}function xn(e){return Gn(e).replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function Kn(e){return Gn((new TextEncoder).encode(e))}function Gn(e){const t=Array.from(e,(e=>String.fromCodePoint(e))).join("");return btoa(t)}
/*! @azure/msal-browser v3.26.1 2024-10-08 */
function Yn(e){return(new TextDecoder).decode(function(e){let t=e.replace(/-/g,"+").replace(/_/g,"/");switch(t.length%4){case 0:break;case 2:t+="==";break;case 3:t+="=";break;default:throw _n(wn)}const r=atob(t);return Uint8Array.from(r,(e=>e.codePointAt(0)||0))}(e))}
/*! @azure/msal-browser v3.26.1 2024-10-08 */
const zn="SHA-256",$n=new Uint8Array([1,0,1]),Wn="0123456789abcdef",Qn=new Uint32Array(1),Vn={name:"RSASSA-PKCS1-v1_5",hash:zn,modulusLength:2048,publicExponent:$n};async function jn(e,t,r){t?.addQueueMeasurement(Lt.Sha256Digest,r);const n=(new TextEncoder).encode(e);return window.crypto.subtle.digest(zn,n)}function Jn(e){return window.crypto.getRandomValues(e)}function Xn(){return window.crypto.getRandomValues(Qn),Qn[0]}function Zn(){const e=Date.now(),t=1024*Xn()+(1023&Xn()),r=new Uint8Array(16),n=Math.trunc(t/2**30),o=t&2**30-1,i=Xn();r[0]=e/2**40,r[1]=e/2**32,r[2]=e/2**24,r[3]=e/65536,r[4]=e/256,r[5]=e,r[6]=112|n>>>8,r[7]=n,r[8]=128|o>>>24,r[9]=o>>>16,r[10]=o>>>8,r[11]=o,r[12]=i>>>24,r[13]=i>>>16,r[14]=i>>>8,r[15]=i;let a="";for(let e=0;e<r.length;e++)a+=Wn.charAt(r[e]>>>4),a+=Wn.charAt(15&r[e]),3!==e&&5!==e&&7!==e&&9!==e||(a+="-");return a}async function eo(e){return window.crypto.subtle.exportKey("jwk",e)}async function to(e){const t=await jn(e);return xn(new Uint8Array(t))}
/*! @azure/msal-browser v3.26.1 2024-10-08 */
class ro{constructor(){this.dbName=Ar,this.version=1,this.tableName=wr,this.dbOpen=!1}async open(){return new Promise(((e,t)=>{const r=window.indexedDB.open(this.dbName,this.version);r.addEventListener("upgradeneeded",(e=>{e.target.result.createObjectStore(this.tableName)})),r.addEventListener("success",(t=>{const r=t;this.db=r.target.result,this.dbOpen=!0,e()})),r.addEventListener("error",(()=>t(_n(Cn))))}))}closeConnection(){const e=this.db;e&&this.dbOpen&&(e.close(),this.dbOpen=!1)}async validateDbIsOpen(){if(!this.dbOpen)return this.open()}async getItem(e){return await this.validateDbIsOpen(),new Promise(((t,r)=>{if(!this.db)return r(_n(an));const n=this.db.transaction([this.tableName],"readonly").objectStore(this.tableName).get(e);n.addEventListener("success",(e=>{const r=e;this.closeConnection(),t(r.target.result)})),n.addEventListener("error",(e=>{this.closeConnection(),r(e)}))}))}async setItem(e,t){return await this.validateDbIsOpen(),new Promise(((r,n)=>{if(!this.db)return n(_n(an));const o=this.db.transaction([this.tableName],"readwrite").objectStore(this.tableName).put(t,e);o.addEventListener("success",(()=>{this.closeConnection(),r()})),o.addEventListener("error",(e=>{this.closeConnection(),n(e)}))}))}async removeItem(e){return await this.validateDbIsOpen(),new Promise(((t,r)=>{if(!this.db)return r(_n(an));const n=this.db.transaction([this.tableName],"readwrite").objectStore(this.tableName).delete(e);n.addEventListener("success",(()=>{this.closeConnection(),t()})),n.addEventListener("error",(e=>{this.closeConnection(),r(e)}))}))}async getKeys(){return await this.validateDbIsOpen(),new Promise(((e,t)=>{if(!this.db)return t(_n(an));const r=this.db.transaction([this.tableName],"readonly").objectStore(this.tableName).getAllKeys();r.addEventListener("success",(t=>{const r=t;this.closeConnection(),e(r.target.result)})),r.addEventListener("error",(e=>{this.closeConnection(),t(e)}))}))}async containsKey(e){return await this.validateDbIsOpen(),new Promise(((t,r)=>{if(!this.db)return r(_n(an));const n=this.db.transaction([this.tableName],"readonly").objectStore(this.tableName).count(e);n.addEventListener("success",(e=>{const r=e;this.closeConnection(),t(1===r.target.result)})),n.addEventListener("error",(e=>{this.closeConnection(),r(e)}))}))}async deleteDatabase(){return this.db&&this.dbOpen&&this.closeConnection(),new Promise(((e,t)=>{const r=window.indexedDB.deleteDatabase(Ar),n=setTimeout((()=>t(!1)),200);r.addEventListener("success",(()=>(clearTimeout(n),e(!0)))),r.addEventListener("blocked",(()=>(clearTimeout(n),e(!0)))),r.addEventListener("error",(()=>(clearTimeout(n),t(!1))))}))}}
/*! @azure/msal-browser v3.26.1 2024-10-08 */
class no{constructor(){this.cache=new Map}getItem(e){return this.cache.get(e)||null}setItem(e,t){this.cache.set(e,t)}removeItem(e){this.cache.delete(e)}getKeys(){const e=[];return this.cache.forEach(((t,r)=>{e.push(r)})),e}containsKey(e){return this.cache.has(e)}clear(){this.cache.clear()}}
/*! @azure/msal-browser v3.26.1 2024-10-08 */
class oo{constructor(e){this.inMemoryCache=new no,this.indexedDBCache=new ro,this.logger=e}handleDatabaseAccessError(e){if(!(e instanceof Sn&&e.errorCode===Cn))throw e;this.logger.error("Could not access persistent storage. This may be caused by browser privacy features which block persistent storage in third-party contexts.")}async getItem(e){const t=this.inMemoryCache.getItem(e);if(!t)try{return this.logger.verbose("Queried item not found in in-memory cache, now querying persistent storage."),await this.indexedDBCache.getItem(e)}catch(e){this.handleDatabaseAccessError(e)}return t}async setItem(e,t){this.inMemoryCache.setItem(e,t);try{await this.indexedDBCache.setItem(e,t)}catch(e){this.handleDatabaseAccessError(e)}}async removeItem(e){this.inMemoryCache.removeItem(e);try{await this.indexedDBCache.removeItem(e)}catch(e){this.handleDatabaseAccessError(e)}}async getKeys(){const e=this.inMemoryCache.getKeys();if(0===e.length)try{return this.logger.verbose("In-memory cache is empty, now querying persistent storage."),await this.indexedDBCache.getKeys()}catch(e){this.handleDatabaseAccessError(e)}return e}async containsKey(e){const t=this.inMemoryCache.containsKey(e);if(!t)try{return this.logger.verbose("Key not found in in-memory cache, now querying persistent storage."),await this.indexedDBCache.containsKey(e)}catch(e){this.handleDatabaseAccessError(e)}return t}clearInMemory(){this.logger.verbose("Deleting in-memory keystore"),this.inMemoryCache.clear(),this.logger.verbose("In-memory keystore deleted")}async clearPersistent(){try{this.logger.verbose("Deleting persistent keystore");const e=await this.indexedDBCache.deleteDatabase();return e&&this.logger.verbose("Persistent keystore deleted"),e}catch(e){return this.handleDatabaseAccessError(e),!1}}}
/*! @azure/msal-browser v3.26.1 2024-10-08 */
class io{constructor(e,t){this.logger=e,function(e){if(!("crypto"in window))throw e.error("BrowserCrypto: crypto interface is unavailable"),_n(Nr);e.verbose("BrowserCrypto: modern crypto interface available")}(e),this.cache=new oo(this.logger),this.performanceClient=t}createNewGuid(){return Zn()}base64Encode(e){return Kn(e)}base64Decode(e){return Yn(e)}base64UrlEncode(e){return Fn(e)}encodeKid(e){return this.base64UrlEncode(JSON.stringify({kid:e}))}async getPublicKeyThumbprint(e){const t=this.performanceClient?.startMeasurement(Lt.CryptoOptsGetPublicKeyThumbprint,e.correlationId),r=await async function(e,t){return window.crypto.subtle.generateKey(Vn,e,t)}(io.EXTRACTABLE,io.POP_KEY_USAGES),n=await eo(r.publicKey),o=ao({e:n.e,kty:n.kty,n:n.n}),i=await this.hashString(o),a=await eo(r.privateKey),s=await async function(e,t,r){return window.crypto.subtle.importKey("jwk",e,Vn,t,r)}(a,!1,["sign"]);return await this.cache.setItem(i,{privateKey:s,publicKey:r.publicKey,requestMethod:e.resourceRequestMethod,requestUri:e.resourceRequestUri}),t&&t.end({success:!0}),i}async removeTokenBindingKey(e){await this.cache.removeItem(e);return!await this.cache.containsKey(e)}async clearKeystore(){this.cache.clearInMemory();try{return await this.cache.clearPersistent(),!0}catch(e){return e instanceof Error?this.logger.error(`Clearing keystore failed with error: ${e.message}`):this.logger.error("Clearing keystore failed with unknown error"),!1}}async signJwt(e,t,r,n){const o=this.performanceClient?.startMeasurement(Lt.CryptoOptsSignJwt,n),i=await this.cache.getItem(t);if(!i)throw _n(un);const a=await eo(i.publicKey),s=ao(a),c=Fn(JSON.stringify({kid:t})),h=Fn(Bn.getShrHeaderString({...r?.header,alg:a.alg,kid:c}));e.cnf={jwk:JSON.parse(s)};const l=`${h}.${Fn(JSON.stringify(e))}`,d=(new TextEncoder).encode(l),u=await async function(e,t){return window.crypto.subtle.sign(Vn,e,t)}(i.privateKey,d),g=`${l}.${xn(new Uint8Array(u))}`;return o&&o.end({success:!0}),g}async hashString(e){return to(e)}}function ao(e){return JSON.stringify(e,Object.keys(e).sort())}io.POP_KEY_USAGES=["sign","verify"],io.EXTRACTABLE=!0;
/*! @azure/msal-common v14.15.0 2024-09-20 */
const so=(e,t,r,n,o)=>(...i)=>{r.trace(`Executing function ${t}`);const a=n?.startMeasurement(t,o);if(o){const e=t+"CallCount";n?.incrementFields({[e]:1},o)}try{const n=e(...i);return a?.end({success:!0}),r.trace(`Returning result from ${t}`),n}catch(e){r.trace(`Error occurred in ${t}`);try{r.trace(JSON.stringify(e))}catch(e){r.trace("Unable to print error message.")}throw a?.end({success:!1},e),e}},co=(e,t,r,n,o)=>(...i)=>{r.trace(`Executing function ${t}`);const a=n?.startMeasurement(t,o);if(o){const e=t+"CallCount";n?.incrementFields({[e]:1},o)}return n?.setPreQueueTime(t,o),e(...i).then((e=>(r.trace(`Returning result from ${t}`),a?.end({success:!0}),e))).catch((e=>{r.trace(`Error occurred in ${t}`);try{r.trace(JSON.stringify(e))}catch(e){r.trace("Unable to print error message.")}throw a?.end({success:!1},e),e}))};
/*! @azure/msal-common v14.15.0 2024-09-20 */
class ho{constructor(e,t,r,n){this.networkInterface=e,this.logger=t,this.performanceClient=r,this.correlationId=n}async detectRegion(e,t){this.performanceClient?.addQueueMeasurement(Lt.RegionDiscoveryDetectRegion,this.correlationId);let r=e;if(r)t.region_source=o.jZ.ENVIRONMENT_VARIABLE;else{const e=ho.IMDS_OPTIONS;try{const n=await co(this.getRegionFromIMDS.bind(this),Lt.RegionDiscoveryGetRegionFromIMDS,this.logger,this.performanceClient,this.correlationId)(o.YM.IMDS_VERSION,e);if(n.status===o.Kk.httpSuccess&&(r=n.body,t.region_source=o.jZ.IMDS),n.status===o.Kk.httpBadRequest){const n=await co(this.getCurrentVersion.bind(this),Lt.RegionDiscoveryGetCurrentVersion,this.logger,this.performanceClient,this.correlationId)(e);if(!n)return t.region_source=o.jZ.FAILED_AUTO_DETECTION,null;const i=await co(this.getRegionFromIMDS.bind(this),Lt.RegionDiscoveryGetRegionFromIMDS,this.logger,this.performanceClient,this.correlationId)(n,e);i.status===o.Kk.httpSuccess&&(r=i.body,t.region_source=o.jZ.IMDS)}}catch(e){return t.region_source=o.jZ.FAILED_AUTO_DETECTION,null}}return r||(t.region_source=o.jZ.FAILED_AUTO_DETECTION),r||null}async getRegionFromIMDS(e,t){return this.performanceClient?.addQueueMeasurement(Lt.RegionDiscoveryGetRegionFromIMDS,this.correlationId),this.networkInterface.sendGetRequestAsync(`${o.YM.IMDS_ENDPOINT}?api-version=${e}&format=text`,t,o.YM.IMDS_TIMEOUT)}async getCurrentVersion(e){this.performanceClient?.addQueueMeasurement(Lt.RegionDiscoveryGetCurrentVersion,this.correlationId);try{const t=await this.networkInterface.sendGetRequestAsync(`${o.YM.IMDS_ENDPOINT}?format=json`,e);return t.status===o.Kk.httpBadRequest&&t.body&&t.body["newest-versions"]&&t.body["newest-versions"].length>0?t.body["newest-versions"][0]:null}catch(e){return null}}}ho.IMDS_OPTIONS={headers:{Metadata:"true"}};
/*! @azure/msal-common v14.15.0 2024-09-20 */
class lo{constructor(e,t,r,n,o,i,a,s){this.canonicalAuthority=e,this._canonicalAuthority.validateAsUri(),this.networkInterface=t,this.cacheManager=r,this.authorityOptions=n,this.regionDiscoveryMetadata={region_used:void 0,region_source:void 0,region_outcome:void 0},this.logger=o,this.performanceClient=a,this.correlationId=i,this.managedIdentity=s||!1,this.regionDiscovery=new ho(t,this.logger,this.performanceClient,this.correlationId)}getAuthorityType(e){if(e.HostNameAndPort.endsWith(o.YM.CIAM_AUTH_URL))return ct;const t=e.PathSegments;if(t.length)switch(t[0].toLowerCase()){case o.YM.ADFS:return at;case o.YM.DSTS:return st}return it}get authorityType(){return this.getAuthorityType(this.canonicalAuthorityUrlComponents)}get protocolMode(){return this.authorityOptions.protocolMode}get options(){return this.authorityOptions}get canonicalAuthority(){return this._canonicalAuthority.urlString}set canonicalAuthority(e){this._canonicalAuthority=new gt(e),this._canonicalAuthority.validateAsUri(),this._canonicalAuthorityUrlComponents=null}get canonicalAuthorityUrlComponents(){return this._canonicalAuthorityUrlComponents||(this._canonicalAuthorityUrlComponents=this._canonicalAuthority.getUrlComponents()),this._canonicalAuthorityUrlComponents}get hostnameAndPort(){return this.canonicalAuthorityUrlComponents.HostNameAndPort.toLowerCase()}get tenant(){return this.canonicalAuthorityUrlComponents.PathSegments[0]}get authorizationEndpoint(){if(this.discoveryComplete())return this.replacePath(this.metadata.authorization_endpoint);throw re(p)}get tokenEndpoint(){if(this.discoveryComplete())return this.replacePath(this.metadata.token_endpoint);throw re(p)}get deviceCodeEndpoint(){if(this.discoveryComplete())return this.replacePath(this.metadata.token_endpoint.replace("/token","/devicecode"));throw re(p)}get endSessionEndpoint(){if(this.discoveryComplete()){if(!this.metadata.end_session_endpoint)throw re(W);return this.replacePath(this.metadata.end_session_endpoint)}throw re(p)}get selfSignedJwtAudience(){if(this.discoveryComplete())return this.replacePath(this.metadata.issuer);throw re(p)}get jwksUri(){if(this.discoveryComplete())return this.replacePath(this.metadata.jwks_uri);throw re(p)}canReplaceTenant(e){return 1===e.PathSegments.length&&!lo.reservedTenantDomains.has(e.PathSegments[0])&&this.getAuthorityType(e)===it&&this.protocolMode===a}replaceTenant(e){return e.replace(/{tenant}|{tenantid}/g,this.tenant)}replacePath(e){let t=e;const r=new gt(this.metadata.canonical_authority).getUrlComponents(),n=r.PathSegments;return this.canonicalAuthorityUrlComponents.PathSegments.forEach(((e,o)=>{let i=n[o];if(0===o&&this.canReplaceTenant(r)){const e=new gt(this.metadata.authorization_endpoint).getUrlComponents().PathSegments[0];i!==e&&(this.logger.verbose(`Replacing tenant domain name ${i} with id ${e}`),i=e)}e!==i&&(t=t.replace(`/${i}/`,`/${e}/`))})),this.replaceTenant(t)}get defaultOpenIdConfigurationEndpoint(){const e=this.hostnameAndPort;return this.canonicalAuthority.endsWith("v2.0/")||this.authorityType===at||this.protocolMode!==a&&!this.isAliasOfKnownMicrosoftAuthority(e)?`${this.canonicalAuthority}.well-known/openid-configuration`:`${this.canonicalAuthority}v2.0/.well-known/openid-configuration`}discoveryComplete(){return!!this.metadata}async resolveEndpointsAsync(){this.performanceClient?.addQueueMeasurement(Lt.AuthorityResolveEndpointsAsync,this.correlationId);const e=this.getCurrentMetadataEntity(),t=await co(this.updateCloudDiscoveryMetadata.bind(this),Lt.AuthorityUpdateCloudDiscoveryMetadata,this.logger,this.performanceClient,this.correlationId)(e);this.canonicalAuthority=this.canonicalAuthority.replace(this.hostnameAndPort,e.preferred_network);const r=await co(this.updateEndpointMetadata.bind(this),Lt.AuthorityUpdateEndpointMetadata,this.logger,this.performanceClient,this.correlationId)(e);this.updateCachedMetadata(e,t,{source:r}),this.performanceClient?.addFields({cloudDiscoverySource:t,authorityEndpointSource:r},this.correlationId)}getCurrentMetadataEntity(){let e=this.cacheManager.getAuthorityMetadataByAlias(this.hostnameAndPort);return e||(e={aliases:[],preferred_cache:this.hostnameAndPort,preferred_network:this.hostnameAndPort,canonical_authority:this.canonicalAuthority,authorization_endpoint:"",token_endpoint:"",end_session_endpoint:"",issuer:"",aliasesFromNetwork:!1,endpointsFromNetwork:!1,expiresAt:we(),jwks_uri:""}),e}updateCachedMetadata(e,t,r){t!==o.E_.CACHE&&r?.source!==o.E_.CACHE&&(e.expiresAt=we(),e.canonical_authority=this.canonicalAuthority);const n=this.cacheManager.generateAuthorityMetadataCacheKey(e.preferred_cache);this.cacheManager.setAuthorityMetadata(n,e),this.metadata=e}async updateEndpointMetadata(e){this.performanceClient?.addQueueMeasurement(Lt.AuthorityUpdateEndpointMetadata,this.correlationId);const t=this.updateEndpointMetadataFromLocalSources(e);if(t){if(t.source===o.E_.HARDCODED_VALUES&&this.authorityOptions.azureRegionConfiguration?.azureRegion&&t.metadata){Ee(e,await co(this.updateMetadataWithRegionalInformation.bind(this),Lt.AuthorityUpdateMetadataWithRegionalInformation,this.logger,this.performanceClient,this.correlationId)(t.metadata),!1),e.canonical_authority=this.canonicalAuthority}return t.source}let r=await co(this.getEndpointMetadataFromNetwork.bind(this),Lt.AuthorityGetEndpointMetadataFromNetwork,this.logger,this.performanceClient,this.correlationId)();if(r)return this.authorityOptions.azureRegionConfiguration?.azureRegion&&(r=await co(this.updateMetadataWithRegionalInformation.bind(this),Lt.AuthorityUpdateMetadataWithRegionalInformation,this.logger,this.performanceClient,this.correlationId)(r)),Ee(e,r,!0),o.E_.NETWORK;throw re(C,this.defaultOpenIdConfigurationEndpoint)}updateEndpointMetadataFromLocalSources(e){this.logger.verbose("Attempting to get endpoint metadata from authority configuration");const t=this.getEndpointMetadataFromConfig();if(t)return this.logger.verbose("Found endpoint metadata in authority configuration"),Ee(e,t,!1),{source:o.E_.CONFIG};if(this.logger.verbose("Did not find endpoint metadata in the config... Attempting to get endpoint metadata from the hardcoded values."),this.authorityOptions.skipAuthorityMetadataCache)this.logger.verbose("Skipping hardcoded metadata cache since skipAuthorityMetadataCache is set to true. Attempting to get endpoint metadata from the network metadata cache.");else{const t=this.getEndpointMetadataFromHardcodedValues();if(t)return Ee(e,t,!1),{source:o.E_.HARDCODED_VALUES,metadata:t};this.logger.verbose("Did not find endpoint metadata in hardcoded values... Attempting to get endpoint metadata from the network metadata cache.")}const r=Re(e);return this.isAuthoritySameType(e)&&e.endpointsFromNetwork&&!r?(this.logger.verbose("Found endpoint metadata in the cache."),{source:o.E_.CACHE}):(r&&this.logger.verbose("The metadata entity is expired."),null)}isAuthoritySameType(e){return new gt(e.canonical_authority).getUrlComponents().PathSegments.length===this.canonicalAuthorityUrlComponents.PathSegments.length}getEndpointMetadataFromConfig(){if(this.authorityOptions.authorityMetadata)try{return JSON.parse(this.authorityOptions.authorityMetadata)}catch(e){throw Je(Fe)}return null}async getEndpointMetadataFromNetwork(){this.performanceClient?.addQueueMeasurement(Lt.AuthorityGetEndpointMetadataFromNetwork,this.correlationId);const e={},t=this.defaultOpenIdConfigurationEndpoint;this.logger.verbose(`Authority.getEndpointMetadataFromNetwork: attempting to retrieve OAuth endpoints from ${t}`);try{const r=await this.networkInterface.sendGetRequestAsync(t,e),n=
/*! @azure/msal-common v14.15.0 2024-09-20 */
function(e){return e.hasOwnProperty("authorization_endpoint")&&e.hasOwnProperty("token_endpoint")&&e.hasOwnProperty("issuer")&&e.hasOwnProperty("jwks_uri")}(r.body);return n?r.body:(this.logger.verbose("Authority.getEndpointMetadataFromNetwork: could not parse response as OpenID configuration"),null)}catch(e){return this.logger.verbose(`Authority.getEndpointMetadataFromNetwork: ${e}`),null}}getEndpointMetadataFromHardcodedValues(){return this.hostnameAndPort in pt?pt[this.hostnameAndPort]:null}async updateMetadataWithRegionalInformation(e){this.performanceClient?.addQueueMeasurement(Lt.AuthorityUpdateMetadataWithRegionalInformation,this.correlationId);const t=this.authorityOptions.azureRegionConfiguration?.azureRegion;if(t){if(t!==o.YM.AZURE_REGION_AUTO_DISCOVER_FLAG)return this.regionDiscoveryMetadata.region_outcome=o._2.CONFIGURED_NO_AUTO_DETECTION,this.regionDiscoveryMetadata.region_used=t,lo.replaceWithRegionalInformation(e,t);const r=await co(this.regionDiscovery.detectRegion.bind(this.regionDiscovery),Lt.RegionDiscoveryDetectRegion,this.logger,this.performanceClient,this.correlationId)(this.authorityOptions.azureRegionConfiguration?.environmentRegion,this.regionDiscoveryMetadata);if(r)return this.regionDiscoveryMetadata.region_outcome=o._2.AUTO_DETECTION_REQUESTED_SUCCESSFUL,this.regionDiscoveryMetadata.region_used=r,lo.replaceWithRegionalInformation(e,r);this.regionDiscoveryMetadata.region_outcome=o._2.AUTO_DETECTION_REQUESTED_FAILED}return e}async updateCloudDiscoveryMetadata(e){this.performanceClient?.addQueueMeasurement(Lt.AuthorityUpdateCloudDiscoveryMetadata,this.correlationId);const t=this.updateCloudDiscoveryMetadataFromLocalSources(e);if(t)return t;const r=await co(this.getCloudDiscoveryMetadataFromNetwork.bind(this),Lt.AuthorityGetCloudDiscoveryMetadataFromNetwork,this.logger,this.performanceClient,this.correlationId)();if(r)return ke(e,r,!0),o.E_.NETWORK;throw Je(xe)}updateCloudDiscoveryMetadataFromLocalSources(e){this.logger.verbose("Attempting to get cloud discovery metadata  from authority configuration"),this.logger.verbosePii(`Known Authorities: ${this.authorityOptions.knownAuthorities||o.YM.NOT_APPLICABLE}`),this.logger.verbosePii(`Authority Metadata: ${this.authorityOptions.authorityMetadata||o.YM.NOT_APPLICABLE}`),this.logger.verbosePii(`Canonical Authority: ${e.canonical_authority||o.YM.NOT_APPLICABLE}`);const t=this.getCloudDiscoveryMetadataFromConfig();if(t)return this.logger.verbose("Found cloud discovery metadata in authority configuration"),ke(e,t,!1),o.E_.CONFIG;if(this.logger.verbose("Did not find cloud discovery metadata in the config... Attempting to get cloud discovery metadata from the hardcoded values."),this.options.skipAuthorityMetadataCache)this.logger.verbose("Skipping hardcoded cloud discovery metadata cache since skipAuthorityMetadataCache is set to true. Attempting to get cloud discovery metadata from the network metadata cache.");else{const t=(r=this.hostnameAndPort,yt(mt.metadata,r));if(t)return this.logger.verbose("Found cloud discovery metadata from hardcoded values."),ke(e,t,!1),o.E_.HARDCODED_VALUES;this.logger.verbose("Did not find cloud discovery metadata in hardcoded values... Attempting to get cloud discovery metadata from the network metadata cache.")}var r;const n=Re(e);return this.isAuthoritySameType(e)&&e.aliasesFromNetwork&&!n?(this.logger.verbose("Found cloud discovery metadata in the cache."),o.E_.CACHE):(n&&this.logger.verbose("The metadata entity is expired."),null)}getCloudDiscoveryMetadataFromConfig(){if(this.authorityType===ct)return this.logger.verbose("CIAM authorities do not support cloud discovery metadata, generate the aliases from authority host."),lo.createCloudDiscoveryMetadataFromHost(this.hostnameAndPort);if(this.authorityOptions.cloudDiscoveryMetadata){this.logger.verbose("The cloud discovery metadata has been provided as a network response, in the config.");try{this.logger.verbose("Attempting to parse the cloud discovery metadata.");const e=yt(JSON.parse(this.authorityOptions.cloudDiscoveryMetadata).metadata,this.hostnameAndPort);if(this.logger.verbose("Parsed the cloud discovery metadata."),e)return this.logger.verbose("There is returnable metadata attached to the parsed cloud discovery metadata."),e;this.logger.verbose("There is no metadata attached to the parsed cloud discovery metadata.")}catch(e){throw this.logger.verbose("Unable to parse the cloud discovery metadata. Throwing Invalid Cloud Discovery Metadata Error."),Je(Be)}}return this.isInKnownAuthorities()?(this.logger.verbose("The host is included in knownAuthorities. Creating new cloud discovery metadata from the host."),lo.createCloudDiscoveryMetadataFromHost(this.hostnameAndPort)):null}async getCloudDiscoveryMetadataFromNetwork(){this.performanceClient?.addQueueMeasurement(Lt.AuthorityGetCloudDiscoveryMetadataFromNetwork,this.correlationId);const e=`${o.YM.AAD_INSTANCE_DISCOVERY_ENDPT}${this.canonicalAuthority}oauth2/v2.0/authorize`,t={};let r=null;try{const n=await this.networkInterface.sendGetRequestAsync(e,t);let i,a;if(
/*! @azure/msal-common v14.15.0 2024-09-20 */
function(e){return e.hasOwnProperty("tenant_discovery_endpoint")&&e.hasOwnProperty("metadata")}(n.body))i=n.body,a=i.metadata,this.logger.verbosePii(`tenant_discovery_endpoint is: ${i.tenant_discovery_endpoint}`);else{if(!
/*! @azure/msal-common v14.15.0 2024-09-20 */
function(e){return e.hasOwnProperty("error")&&e.hasOwnProperty("error_description")}(n.body))return this.logger.error("AAD did not return a CloudInstanceDiscoveryResponse or CloudInstanceDiscoveryErrorResponse"),null;if(this.logger.warning(`A CloudInstanceDiscoveryErrorResponse was returned. The cloud instance discovery network request's status code is: ${n.status}`),i=n.body,i.error===o.YM.INVALID_INSTANCE)return this.logger.error("The CloudInstanceDiscoveryErrorResponse error is invalid_instance."),null;this.logger.warning(`The CloudInstanceDiscoveryErrorResponse error is ${i.error}`),this.logger.warning(`The CloudInstanceDiscoveryErrorResponse error description is ${i.error_description}`),this.logger.warning("Setting the value of the CloudInstanceDiscoveryMetadata (returned from the network) to []"),a=[]}this.logger.verbose("Attempting to find a match between the developer's authority and the CloudInstanceDiscoveryMetadata returned from the network request."),r=yt(a,this.hostnameAndPort)}catch(e){if(e instanceof h.lR)this.logger.error(`There was a network error while attempting to get the cloud discovery instance metadata.\nError: ${e.errorCode}\nError Description: ${e.errorMessage}`);else{const t=e;this.logger.error(`A non-MSALJS error was thrown while attempting to get the cloud instance discovery metadata.\nError: ${t.name}\nError Description: ${t.message}`)}return null}return r||(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."),r=lo.createCloudDiscoveryMetadataFromHost(this.hostnameAndPort)),r}isInKnownAuthorities(){return this.authorityOptions.knownAuthorities.filter((e=>e&&gt.getDomainFromUrl(e).toLowerCase()===this.hostnameAndPort)).length>0}static generateAuthority(e,t){let r;if(t&&t.azureCloudInstance!==c){const e=t.tenant?t.tenant:o.YM.DEFAULT_COMMON_TENANT;r=`${t.azureCloudInstance}/${e}/`}return r||e}static createCloudDiscoveryMetadataFromHost(e){return{preferred_network:e,preferred_cache:e,aliases:[e]}}getPreferredCache(){if(this.managedIdentity)return o.YM.DEFAULT_AUTHORITY_HOST;if(this.discoveryComplete())return this.metadata.preferred_cache;throw re(p)}isAlias(e){return this.metadata.aliases.indexOf(e)>-1}isAliasOfKnownMicrosoftAuthority(e){return Ct.has(e)}static isPublicCloudAuthority(e){return o.YM.KNOWN_PUBLIC_CLOUDS.indexOf(e)>=0}static buildRegionalAuthorityString(e,t,r){const n=new gt(e);n.validateAsUri();const i=n.getUrlComponents();let a=`${t}.${i.HostNameAndPort}`;this.isPublicCloudAuthority(i.HostNameAndPort)&&(a=`${t}.${o.YM.REGIONAL_AUTH_PUBLIC_CLOUD_SUFFIX}`);const s=gt.constructAuthorityUriFromObject({...n.getUrlComponents(),HostNameAndPort:a}).urlString;return r?`${s}?${r}`:s}static replaceWithRegionalInformation(e,t){const r={...e};return r.authorization_endpoint=lo.buildRegionalAuthorityString(r.authorization_endpoint,t),r.token_endpoint=lo.buildRegionalAuthorityString(r.token_endpoint,t),r.end_session_endpoint&&(r.end_session_endpoint=lo.buildRegionalAuthorityString(r.end_session_endpoint,t)),r}static transformCIAMAuthority(e){let t=e;const r=new gt(e).getUrlComponents();if(0===r.PathSegments.length&&r.HostNameAndPort.endsWith(o.YM.CIAM_AUTH_URL)){t=`${t}${r.HostNameAndPort.split(".")[0]}${o.YM.AAD_TENANT_DOMAIN_SUFFIX}`}return t}}function uo(e){return e.endsWith(o.YM.FORWARD_SLASH)?e:`${e}${o.YM.FORWARD_SLASH}`}lo.reservedTenantDomains=new Set(["{tenant}","{tenantid}",o.v2.COMMON,o.v2.CONSUMERS,o.v2.ORGANIZATIONS]);var go=r(48686),po=r(7936);
/*! @azure/msal-common v14.15.0 2024-09-20 */
class mo{static setRequestState(e,t,r){const n=mo.generateLibraryState(e,r);return t?`${n}${o.YM.RESOURCE_DELIM}${t}`:n}static generateLibraryState(e,t){if(!e)throw re(D);const r={id:e.createNewGuid()};t&&(r.meta=t);const n=JSON.stringify(r);return e.base64Encode(n)}static parseRequestState(e,t){if(!e)throw re(D);if(!t)throw re(y);try{const r=t.split(o.YM.RESOURCE_DELIM),n=r[0],i=r.length>1?r.slice(1).join(o.YM.RESOURCE_DELIM):o.YM.EMPTY_STRING,a=e.base64Decode(n),s=JSON.parse(a);return{userRequestState:i||o.YM.EMPTY_STRING,libraryState:s}}catch(e){throw re(y)}}}
/*! @azure/msal-common v14.15.0 2024-09-20 */
const Co="home_account_id",fo="UPN",yo="storage_not_supported",To="stubbed_public_client_application_called",Io="in_mem_redirect_unavailable",vo={[yo]:"Given storage configuration option was not supported.",[To]:"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",[Io]:"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."};vo[yo],vo[To],vo[Io];class Ao extends h.lR{constructor(e,t){super(e,t),this.name="BrowserConfigurationAuthError",Object.setPrototypeOf(this,Ao.prototype)}}function wo(e){return new Ao(e,vo[e])}
/*! @azure/msal-browser v3.26.1 2024-10-08 */
class Eo{constructor(e){this.validateWindowStorage(e),this.windowStorage=window[e]}validateWindowStorage(e){if(e!==Wt&&e!==Qt||!window[e])throw wo(yo)}getItem(e){return this.windowStorage.getItem(e)}setItem(e,t){this.windowStorage.setItem(e,t)}removeItem(e){this.windowStorage.removeItem(e)}getKeys(){return Object.keys(this.windowStorage)}containsKey(e){return this.windowStorage.hasOwnProperty(e)}}
/*! @azure/msal-browser v3.26.1 2024-10-08 */
function ko(e,t){if(!t)return null;try{return mo.parseRequestState(e,t).libraryState.meta}catch(e){throw re(y)}}
/*! @azure/msal-browser v3.26.1 2024-10-08 */
class Ro extends wt{constructor(e,t,r,n,o,i){super(e,r,n,o),this.COOKIE_LIFE_MULTIPLIER=864e5,this.cacheConfig=t,this.logger=n,this.internalStorage=new no,this.browserStorage=this.setupBrowserStorage(this.cacheConfig.cacheLocation),this.temporaryCacheStorage=this.setupTemporaryCacheStorage(this.cacheConfig.temporaryCacheLocation,this.cacheConfig.cacheLocation),t.cacheMigrationEnabled&&(this.migrateCacheEntries(),this.createKeyMaps()),this.performanceClient=i}setupBrowserStorage(e){switch(e){case Wt:case Qt:try{return new Eo(e)}catch(e){this.logger.verbose(e);break}}return this.cacheConfig.cacheLocation=Vt,new no}setupTemporaryCacheStorage(e,t){switch(t){case Wt:case Qt:try{return new Eo(e||Qt)}catch(e){return this.logger.verbose(e),this.internalStorage}default:return this.internalStorage}}migrateCacheEntries(){const e=`${o.YM.CACHE_PREFIX}.${o.Gd.ID_TOKEN}`,t=`${o.YM.CACHE_PREFIX}.${o.Gd.CLIENT_INFO}`,r=`${o.YM.CACHE_PREFIX}.${o.Gd.ERROR}`,n=`${o.YM.CACHE_PREFIX}.${o.Gd.ERROR_DESC}`,i=[this.browserStorage.getItem(e),this.browserStorage.getItem(t),this.browserStorage.getItem(r),this.browserStorage.getItem(n)];[o.Gd.ID_TOKEN,o.Gd.CLIENT_INFO,o.Gd.ERROR,o.Gd.ERROR_DESC].forEach(((e,t)=>{const r=i[t];r&&this.setTemporaryCache(e,r,!0)}))}createKeyMaps(){this.logger.trace("BrowserCacheManager - createKeyMaps called.");const e=this.getItem(cr),t=this.getItem(`${hr}.${this.clientId}`);if(e&&t)return void this.logger.verbose("BrowserCacheManager:createKeyMaps - account and token key maps already exist, skipping migration.");this.browserStorage.getKeys().forEach((e=>{if(this.isCredentialKey(e)){const t=this.getItem(e);if(t){const r=this.validateAndParseJson(t);if(r&&r.hasOwnProperty("credentialType"))switch(r.credentialType){case o.aG.ID_TOKEN:if(Ce(r)){this.logger.trace("BrowserCacheManager:createKeyMaps - idToken found, saving key to token key map"),this.logger.tracePii(`BrowserCacheManager:createKeyMaps - idToken with key: ${e} found, saving key to token key map`);const t=r,n=this.updateCredentialCacheKey(e,t);return void this.addTokenKey(n,o.aG.ID_TOKEN)}this.logger.trace("BrowserCacheManager:createKeyMaps - key found matching idToken schema with value containing idToken credentialType field but value failed IdTokenEntity validation, skipping."),this.logger.tracePii(`BrowserCacheManager:createKeyMaps - failed idToken validation on key: ${e}`);break;case o.aG.ACCESS_TOKEN:case o.aG.ACCESS_TOKEN_WITH_AUTH_SCHEME:if(me(r)){this.logger.trace("BrowserCacheManager:createKeyMaps - accessToken found, saving key to token key map"),this.logger.tracePii(`BrowserCacheManager:createKeyMaps - accessToken with key: ${e} found, saving key to token key map`);const t=r,n=this.updateCredentialCacheKey(e,t);return void this.addTokenKey(n,o.aG.ACCESS_TOKEN)}this.logger.trace("BrowserCacheManager:createKeyMaps - key found matching accessToken schema with value containing accessToken credentialType field but value failed AccessTokenEntity validation, skipping."),this.logger.tracePii(`BrowserCacheManager:createKeyMaps - failed accessToken validation on key: ${e}`);break;case o.aG.REFRESH_TOKEN:if(fe(r)){this.logger.trace("BrowserCacheManager:createKeyMaps - refreshToken found, saving key to token key map"),this.logger.tracePii(`BrowserCacheManager:createKeyMaps - refreshToken with key: ${e} found, saving key to token key map`);const t=r,n=this.updateCredentialCacheKey(e,t);return void this.addTokenKey(n,o.aG.REFRESH_TOKEN)}this.logger.trace("BrowserCacheManager:createKeyMaps - key found matching refreshToken schema with value containing refreshToken credentialType field but value failed RefreshTokenEntity validation, skipping."),this.logger.tracePii(`BrowserCacheManager:createKeyMaps - failed refreshToken validation on key: ${e}`)}}}if(this.isAccountKey(e)){const t=this.getItem(e);if(t){const r=this.validateAndParseJson(t);r&&lt.isAccountEntity(r)&&(this.logger.trace("BrowserCacheManager:createKeyMaps - account found, saving key to account key map"),this.logger.tracePii(`BrowserCacheManager:createKeyMaps - account with key: ${e} found, saving key to account key map`),this.addAccountKeyToMap(e))}}}))}validateAndParseJson(e){try{const t=JSON.parse(e);return t&&"object"==typeof t?t:null}catch(e){return null}}getItem(e){return this.browserStorage.getItem(e)}setItem(e,t){this.browserStorage.setItem(e,t)}getAccount(e,t){this.logger.trace("BrowserCacheManager.getAccount called");const r=this.getCachedAccountEntity(e);return this.updateOutdatedCachedAccount(e,r,t)}getCachedAccountEntity(e){const t=this.getItem(e);if(!t)return this.removeAccountKeyFromMap(e),null;const r=this.validateAndParseJson(t);return r&&lt.isAccountEntity(r)?wt.toObject(new lt,r):(this.removeAccountKeyFromMap(e),null)}setAccount(e){this.logger.trace("BrowserCacheManager.setAccount called");const t=e.generateAccountKey();this.setItem(t,JSON.stringify(e)),this.addAccountKeyToMap(t)}getAccountKeys(){this.logger.trace("BrowserCacheManager.getAccountKeys called");const e=this.getItem(cr);return e?JSON.parse(e):(this.logger.verbose("BrowserCacheManager.getAccountKeys - No account keys found"),[])}addAccountKeyToMap(e){this.logger.trace("BrowserCacheManager.addAccountKeyToMap called"),this.logger.tracePii(`BrowserCacheManager.addAccountKeyToMap called with key: ${e}`);const t=this.getAccountKeys();-1===t.indexOf(e)?(t.push(e),this.setItem(cr,JSON.stringify(t)),this.logger.verbose("BrowserCacheManager.addAccountKeyToMap account key added")):this.logger.verbose("BrowserCacheManager.addAccountKeyToMap account key already exists in map")}removeAccountKeyFromMap(e){this.logger.trace("BrowserCacheManager.removeAccountKeyFromMap called"),this.logger.tracePii(`BrowserCacheManager.removeAccountKeyFromMap called with key: ${e}`);const t=this.getAccountKeys(),r=t.indexOf(e);r>-1?(t.splice(r,1),this.setItem(cr,JSON.stringify(t)),this.logger.trace("BrowserCacheManager.removeAccountKeyFromMap account key removed")):this.logger.trace("BrowserCacheManager.removeAccountKeyFromMap key not found in existing map")}async removeAccount(e){super.removeAccount(e),this.removeAccountKeyFromMap(e)}removeOutdatedAccount(e){this.removeItem(e),this.removeAccountKeyFromMap(e)}removeIdToken(e){super.removeIdToken(e),this.removeTokenKey(e,o.aG.ID_TOKEN)}async removeAccessToken(e){super.removeAccessToken(e),this.removeTokenKey(e,o.aG.ACCESS_TOKEN)}removeRefreshToken(e){super.removeRefreshToken(e),this.removeTokenKey(e,o.aG.REFRESH_TOKEN)}getTokenKeys(){this.logger.trace("BrowserCacheManager.getTokenKeys called");const e=this.getItem(`${hr}.${this.clientId}`);if(e){const t=this.validateAndParseJson(e);if(t&&t.hasOwnProperty("idToken")&&t.hasOwnProperty("accessToken")&&t.hasOwnProperty("refreshToken"))return t;this.logger.error("BrowserCacheManager.getTokenKeys - Token keys found but in an unknown format. Returning empty key map.")}else this.logger.verbose("BrowserCacheManager.getTokenKeys - No token keys found");return{idToken:[],accessToken:[],refreshToken:[]}}addTokenKey(e,t){this.logger.trace("BrowserCacheManager addTokenKey called");const r=this.getTokenKeys();switch(t){case o.aG.ID_TOKEN:-1===r.idToken.indexOf(e)&&(this.logger.info("BrowserCacheManager: addTokenKey - idToken added to map"),r.idToken.push(e));break;case o.aG.ACCESS_TOKEN:-1===r.accessToken.indexOf(e)&&(this.logger.info("BrowserCacheManager: addTokenKey - accessToken added to map"),r.accessToken.push(e));break;case o.aG.REFRESH_TOKEN:-1===r.refreshToken.indexOf(e)&&(this.logger.info("BrowserCacheManager: addTokenKey - refreshToken added to map"),r.refreshToken.push(e));break;default:throw this.logger.error(`BrowserCacheManager:addTokenKey - CredentialType provided invalid. CredentialType: ${t}`),re(B)}this.setItem(`${hr}.${this.clientId}`,JSON.stringify(r))}removeTokenKey(e,t){this.logger.trace("BrowserCacheManager removeTokenKey called");const r=this.getTokenKeys();switch(t){case o.aG.ID_TOKEN:this.logger.infoPii(`BrowserCacheManager: removeTokenKey - attempting to remove idToken with key: ${e} from map`);const n=r.idToken.indexOf(e);n>-1?(this.logger.info("BrowserCacheManager: removeTokenKey - idToken removed from map"),r.idToken.splice(n,1)):this.logger.info("BrowserCacheManager: removeTokenKey - idToken does not exist in map. Either it was previously removed or it was never added.");break;case o.aG.ACCESS_TOKEN:this.logger.infoPii(`BrowserCacheManager: removeTokenKey - attempting to remove accessToken with key: ${e} from map`);const i=r.accessToken.indexOf(e);i>-1?(this.logger.info("BrowserCacheManager: removeTokenKey - accessToken removed from map"),r.accessToken.splice(i,1)):this.logger.info("BrowserCacheManager: removeTokenKey - accessToken does not exist in map. Either it was previously removed or it was never added.");break;case o.aG.REFRESH_TOKEN:this.logger.infoPii(`BrowserCacheManager: removeTokenKey - attempting to remove refreshToken with key: ${e} from map`);const a=r.refreshToken.indexOf(e);a>-1?(this.logger.info("BrowserCacheManager: removeTokenKey - refreshToken removed from map"),r.refreshToken.splice(a,1)):this.logger.info("BrowserCacheManager: removeTokenKey - refreshToken does not exist in map. Either it was previously removed or it was never added.");break;default:throw this.logger.error(`BrowserCacheManager:removeTokenKey - CredentialType provided invalid. CredentialType: ${t}`),re(B)}this.setItem(`${hr}.${this.clientId}`,JSON.stringify(r))}getIdTokenCredential(e){const t=this.getItem(e);if(!t)return this.logger.trace("BrowserCacheManager.getIdTokenCredential: called, no cache hit"),this.removeTokenKey(e,o.aG.ID_TOKEN),null;const r=this.validateAndParseJson(t);return r&&Ce(r)?(this.logger.trace("BrowserCacheManager.getIdTokenCredential: cache hit"),r):(this.logger.trace("BrowserCacheManager.getIdTokenCredential: called, no cache hit"),this.removeTokenKey(e,o.aG.ID_TOKEN),null)}setIdTokenCredential(e){this.logger.trace("BrowserCacheManager.setIdTokenCredential called");const t=le(e);this.setItem(t,JSON.stringify(e)),this.addTokenKey(t,o.aG.ID_TOKEN)}getAccessTokenCredential(e){const t=this.getItem(e);if(!t)return this.logger.trace("BrowserCacheManager.getAccessTokenCredential: called, no cache hit"),this.removeTokenKey(e,o.aG.ACCESS_TOKEN),null;const r=this.validateAndParseJson(t);return r&&me(r)?(this.logger.trace("BrowserCacheManager.getAccessTokenCredential: cache hit"),r):(this.logger.trace("BrowserCacheManager.getAccessTokenCredential: called, no cache hit"),this.removeTokenKey(e,o.aG.ACCESS_TOKEN),null)}setAccessTokenCredential(e){this.logger.trace("BrowserCacheManager.setAccessTokenCredential called");const t=le(e);this.setItem(t,JSON.stringify(e)),this.addTokenKey(t,o.aG.ACCESS_TOKEN)}getRefreshTokenCredential(e){const t=this.getItem(e);if(!t)return this.logger.trace("BrowserCacheManager.getRefreshTokenCredential: called, no cache hit"),this.removeTokenKey(e,o.aG.REFRESH_TOKEN),null;const r=this.validateAndParseJson(t);return r&&fe(r)?(this.logger.trace("BrowserCacheManager.getRefreshTokenCredential: cache hit"),r):(this.logger.trace("BrowserCacheManager.getRefreshTokenCredential: called, no cache hit"),this.removeTokenKey(e,o.aG.REFRESH_TOKEN),null)}setRefreshTokenCredential(e){this.logger.trace("BrowserCacheManager.setRefreshTokenCredential called");const t=le(e);this.setItem(t,JSON.stringify(e)),this.addTokenKey(t,o.aG.REFRESH_TOKEN)}getAppMetadata(e){const t=this.getItem(e);if(!t)return this.logger.trace("BrowserCacheManager.getAppMetadata: called, no cache hit"),null;const r=this.validateAndParseJson(t);return r&&(n=e,(i=r)&&0===n.indexOf(o.GU)&&i.hasOwnProperty("clientId")&&i.hasOwnProperty("environment"))?(this.logger.trace("BrowserCacheManager.getAppMetadata: cache hit"),r):(this.logger.trace("BrowserCacheManager.getAppMetadata: called, no cache hit"),null);var n,i}setAppMetadata(e){this.logger.trace("BrowserCacheManager.setAppMetadata called");const t=function({environment:e,clientId:t}){return[o.GU,e,t].join(o.LR.CACHE_KEY_SEPARATOR).toLowerCase()}(e);this.setItem(t,JSON.stringify(e))}getServerTelemetry(e){const t=this.getItem(e);if(!t)return this.logger.trace("BrowserCacheManager.getServerTelemetry: called, no cache hit"),null;const r=this.validateAndParseJson(t);return r&&function(e,t){const r=0===e.indexOf(o.gT.CACHE_KEY);let n=!0;return t&&(n=t.hasOwnProperty("failedRequests")&&t.hasOwnProperty("errors")&&t.hasOwnProperty("cacheHits")),r&&n}(e,r)?(this.logger.trace("BrowserCacheManager.getServerTelemetry: cache hit"),r):(this.logger.trace("BrowserCacheManager.getServerTelemetry: called, no cache hit"),null)}setServerTelemetry(e,t){this.logger.trace("BrowserCacheManager.setServerTelemetry called"),this.setItem(e,JSON.stringify(t))}getAuthorityMetadata(e){const t=this.internalStorage.getItem(e);if(!t)return this.logger.trace("BrowserCacheManager.getAuthorityMetadata: called, no cache hit"),null;const r=this.validateAndParseJson(t);return r&&function(e,t){return!!t&&0===e.indexOf(o.u0.CACHE_KEY)&&t.hasOwnProperty("aliases")&&t.hasOwnProperty("preferred_cache")&&t.hasOwnProperty("preferred_network")&&t.hasOwnProperty("canonical_authority")&&t.hasOwnProperty("authorization_endpoint")&&t.hasOwnProperty("token_endpoint")&&t.hasOwnProperty("issuer")&&t.hasOwnProperty("aliasesFromNetwork")&&t.hasOwnProperty("endpointsFromNetwork")&&t.hasOwnProperty("expiresAt")&&t.hasOwnProperty("jwks_uri")}(e,r)?(this.logger.trace("BrowserCacheManager.getAuthorityMetadata: cache hit"),r):null}getAuthorityMetadataKeys(){return this.internalStorage.getKeys().filter((e=>this.isAuthorityMetadata(e)))}setWrapperMetadata(e,t){this.internalStorage.setItem(lr,e),this.internalStorage.setItem(dr,t)}getWrapperMetadata(){return[this.internalStorage.getItem(lr)||o.YM.EMPTY_STRING,this.internalStorage.getItem(dr)||o.YM.EMPTY_STRING]}setAuthorityMetadata(e,t){this.logger.trace("BrowserCacheManager.setAuthorityMetadata called"),this.internalStorage.setItem(e,JSON.stringify(t))}getActiveAccount(){const e=this.generateCacheKey(o.Gd.ACTIVE_ACCOUNT_FILTERS),t=this.getItem(e);if(!t){this.logger.trace("BrowserCacheManager.getActiveAccount: No active account filters cache schema found, looking for legacy schema");const e=this.generateCacheKey(o.Gd.ACTIVE_ACCOUNT),t=this.getItem(e);if(!t)return this.logger.trace("BrowserCacheManager.getActiveAccount: No active account found"),null;const r=this.getAccountInfoFilteredBy({localAccountId:t});return r?(this.logger.trace("BrowserCacheManager.getActiveAccount: Legacy active account cache schema found"),this.logger.trace("BrowserCacheManager.getActiveAccount: Adding active account filters cache schema"),this.setActiveAccount(r),r):null}const r=this.validateAndParseJson(t);return r?(this.logger.trace("BrowserCacheManager.getActiveAccount: Active account filters schema found"),this.getAccountInfoFilteredBy({homeAccountId:r.homeAccountId,localAccountId:r.localAccountId,tenantId:r.tenantId})):(this.logger.trace("BrowserCacheManager.getActiveAccount: No active account found"),null)}setActiveAccount(e){const t=this.generateCacheKey(o.Gd.ACTIVE_ACCOUNT_FILTERS),r=this.generateCacheKey(o.Gd.ACTIVE_ACCOUNT);if(e){this.logger.verbose("setActiveAccount: Active account set");const n={homeAccountId:e.homeAccountId,localAccountId:e.localAccountId,tenantId:e.tenantId};this.browserStorage.setItem(t,JSON.stringify(n)),this.browserStorage.setItem(r,e.localAccountId)}else this.logger.verbose("setActiveAccount: No account passed, active account not set"),this.browserStorage.removeItem(t),this.browserStorage.removeItem(r)}getThrottlingCache(e){const t=this.getItem(e);if(!t)return this.logger.trace("BrowserCacheManager.getThrottlingCache: called, no cache hit"),null;const r=this.validateAndParseJson(t);return r&&function(e,t){let r=!1;e&&(r=0===e.indexOf(o.Xw.THROTTLING_PREFIX));let n=!0;return t&&(n=t.hasOwnProperty("throttleTime")),r&&n}(e,r)?(this.logger.trace("BrowserCacheManager.getThrottlingCache: cache hit"),r):(this.logger.trace("BrowserCacheManager.getThrottlingCache: called, no cache hit"),null)}setThrottlingCache(e,t){this.logger.trace("BrowserCacheManager.setThrottlingCache called"),this.setItem(e,JSON.stringify(t))}getTemporaryCache(e,t){const r=t?this.generateCacheKey(e):e;if(this.cacheConfig.storeAuthStateInCookie){const e=this.getItemCookie(r);if(e)return this.logger.trace("BrowserCacheManager.getTemporaryCache: storeAuthStateInCookies set to true, retrieving from cookies"),e}const n=this.temporaryCacheStorage.getItem(r);if(!n){if(this.cacheConfig.cacheLocation===Wt){const e=this.browserStorage.getItem(r);if(e)return this.logger.trace("BrowserCacheManager.getTemporaryCache: Temporary cache item found in local storage"),e}return this.logger.trace("BrowserCacheManager.getTemporaryCache: No cache item found in local storage"),null}return this.logger.trace("BrowserCacheManager.getTemporaryCache: Temporary cache item returned"),n}setTemporaryCache(e,t,r){const n=r?this.generateCacheKey(e):e;this.temporaryCacheStorage.setItem(n,t),this.cacheConfig.storeAuthStateInCookie&&(this.logger.trace("BrowserCacheManager.setTemporaryCache: storeAuthStateInCookie set to true, setting item cookie"),this.setItemCookie(n,t))}removeItem(e){this.browserStorage.removeItem(e)}removeTemporaryItem(e){this.temporaryCacheStorage.removeItem(e),this.cacheConfig.storeAuthStateInCookie&&(this.logger.trace("BrowserCacheManager.removeItem: storeAuthStateInCookie is true, clearing item cookie"),this.clearItemCookie(e))}getKeys(){return this.browserStorage.getKeys()}async clear(){await this.removeAllAccounts(),this.removeAppMetadata(),this.temporaryCacheStorage.getKeys().forEach((e=>{-1===e.indexOf(o.YM.CACHE_PREFIX)&&-1===e.indexOf(this.clientId)||this.removeTemporaryItem(e)})),this.browserStorage.getKeys().forEach((e=>{-1===e.indexOf(o.YM.CACHE_PREFIX)&&-1===e.indexOf(this.clientId)||this.browserStorage.removeItem(e)})),this.internalStorage.clear()}async clearTokensAndKeysWithClaims(e,t){e.addQueueMeasurement(Lt.ClearTokensAndKeysWithClaims,t);const r=this.getTokenKeys(),n=[];r.accessToken.forEach((e=>{const t=this.getAccessTokenCredential(e);t?.requestedClaimsHash&&e.includes(t.requestedClaimsHash.toLowerCase())&&n.push(this.removeAccessToken(e))})),await Promise.all(n),n.length>0&&this.logger.warning(`${n.length} access tokens with claims in the cache keys have been removed from the cache.`)}setItemCookie(e,t,r){let n=`${encodeURIComponent(e)}=${encodeURIComponent(t)};path=/;SameSite=Lax;`;if(r){n+=`expires=${this.getCookieExpirationTime(r)};`}this.cacheConfig.secureCookies&&(n+="Secure;"),document.cookie=n}getItemCookie(e){const t=`${encodeURIComponent(e)}=`,r=document.cookie.split(";");for(let e=0;e<r.length;e++){let n=r[e];for(;" "===n.charAt(0);)n=n.substring(1);if(0===n.indexOf(t))return decodeURIComponent(n.substring(t.length,n.length))}return o.YM.EMPTY_STRING}clearMsalCookies(){const e=`${o.YM.CACHE_PREFIX}.${this.clientId}`;document.cookie.split(";").forEach((t=>{for(;" "===t.charAt(0);)t=t.substring(1);if(0===t.indexOf(e)){const e=t.split("=")[0];this.clearItemCookie(e)}}))}clearItemCookie(e){this.setItemCookie(e,o.YM.EMPTY_STRING,-1)}getCookieExpirationTime(e){const t=new Date;return new Date(t.getTime()+e*this.COOKIE_LIFE_MULTIPLIER).toUTCString()}generateCacheKey(e){return this.validateAndParseJson(e)?JSON.stringify(e):Xe.startsWith(e,o.YM.CACHE_PREFIX)||Xe.startsWith(e,o.Gd.ADAL_ID_TOKEN)?e:`${o.YM.CACHE_PREFIX}.${this.clientId}.${e}`}generateAuthorityKey(e){const{libraryState:{id:t}}=mo.parseRequestState(this.cryptoImpl,e);return this.generateCacheKey(`${Xt}.${t}`)}generateNonceKey(e){const{libraryState:{id:t}}=mo.parseRequestState(this.cryptoImpl,e);return this.generateCacheKey(`${er}.${t}`)}generateStateKey(e){const{libraryState:{id:t}}=mo.parseRequestState(this.cryptoImpl,e);return this.generateCacheKey(`${Zt}.${t}`)}getCachedAuthority(e){const t=this.generateStateKey(e),r=this.getTemporaryCache(t);if(!r)return null;const n=this.generateAuthorityKey(r);return this.getTemporaryCache(n)}updateCacheEntries(e,t,r,n,o){this.logger.trace("BrowserCacheManager.updateCacheEntries called");const i=this.generateStateKey(e);this.setTemporaryCache(i,e,!1);const a=this.generateNonceKey(e);this.setTemporaryCache(a,t,!1);const s=this.generateAuthorityKey(e);if(this.setTemporaryCache(s,r,!1),o){const e={credential:o.homeAccountId,type:Co};this.setTemporaryCache(ir,JSON.stringify(e),!0)}else if(n){const e={credential:n,type:fo};this.setTemporaryCache(ir,JSON.stringify(e),!0)}}resetRequestCache(e){this.logger.trace("BrowserCacheManager.resetRequestCache called"),e&&(this.temporaryCacheStorage.getKeys().forEach((t=>{-1!==t.indexOf(e)&&this.removeTemporaryItem(t)})),this.removeTemporaryItem(this.generateStateKey(e)),this.removeTemporaryItem(this.generateNonceKey(e)),this.removeTemporaryItem(this.generateAuthorityKey(e))),this.removeTemporaryItem(this.generateCacheKey(nr)),this.removeTemporaryItem(this.generateCacheKey(tr)),this.removeTemporaryItem(this.generateCacheKey(rr)),this.removeTemporaryItem(this.generateCacheKey(ar)),this.removeTemporaryItem(this.generateCacheKey(ir)),this.removeTemporaryItem(this.generateCacheKey(sr)),this.setInteractionInProgress(!1)}cleanRequestByState(e){if(this.logger.trace("BrowserCacheManager.cleanRequestByState called"),e){const t=this.generateStateKey(e),r=this.temporaryCacheStorage.getItem(t);this.logger.infoPii(`BrowserCacheManager.cleanRequestByState: Removing temporary cache items for state: ${r}`),this.resetRequestCache(r||o.YM.EMPTY_STRING)}this.clearMsalCookies()}cleanRequestByInteractionType(e){this.logger.trace("BrowserCacheManager.cleanRequestByInteractionType called"),this.temporaryCacheStorage.getKeys().forEach((t=>{if(-1===t.indexOf(Zt))return;const r=this.temporaryCacheStorage.getItem(t);if(!r)return;const n=ko(this.cryptoImpl,r);n&&n.interactionType===e&&(this.logger.infoPii(`BrowserCacheManager.cleanRequestByInteractionType: Removing temporary cache items for state: ${r}`),this.resetRequestCache(r))})),this.clearMsalCookies(),this.setInteractionInProgress(!1)}cacheCodeRequest(e){this.logger.trace("BrowserCacheManager.cacheCodeRequest called");const t=Kn(JSON.stringify(e));this.setTemporaryCache(nr,t,!0)}getCachedRequest(e){this.logger.trace("BrowserCacheManager.getCachedRequest called");const t=this.getTemporaryCache(nr,!0);if(!t)throw _n(Zr);let r;try{r=JSON.parse(Yn(t))}catch(e){throw this.logger.errorPii(`Attempted to parse: ${t}`),this.logger.error(`Parsing cached token request threw with error: ${e}`),_n(en)}if(this.removeTemporaryItem(this.generateCacheKey(nr)),!r.authority){const t=this.generateAuthorityKey(e),n=this.getTemporaryCache(t);if(!n)throw _n(tn);r.authority=n}return r}getCachedNativeRequest(){this.logger.trace("BrowserCacheManager.getCachedNativeRequest called");const e=this.getTemporaryCache(sr,!0);if(!e)return this.logger.trace("BrowserCacheManager.getCachedNativeRequest: No cached native request found"),null;const t=this.validateAndParseJson(e);return t||(this.logger.error("BrowserCacheManager.getCachedNativeRequest: Unable to parse native request"),null)}isInteractionInProgress(e){const t=this.getInteractionInProgress();return e?t===this.clientId:!!t}getInteractionInProgress(){const e=`${o.YM.CACHE_PREFIX}.${or}`;return this.getTemporaryCache(e,!1)}setInteractionInProgress(e){const t=`${o.YM.CACHE_PREFIX}.${or}`;if(e){if(this.getInteractionInProgress())throw _n(Fr);this.setTemporaryCache(t,this.clientId,!1)}else e||this.getInteractionInProgress()!==this.clientId||this.removeTemporaryItem(t)}getLegacyLoginHint(){const e=this.getTemporaryCache(o.Gd.ADAL_ID_TOKEN);e&&(this.browserStorage.removeItem(o.Gd.ADAL_ID_TOKEN),this.logger.verbose("Cached ADAL id token retrieved."));const t=this.getTemporaryCache(o.Gd.ID_TOKEN,!0);t&&(this.browserStorage.removeItem(this.generateCacheKey(o.Gd.ID_TOKEN)),this.logger.verbose("Cached MSAL.js v1 id token retrieved"));const r=t||e;if(r){const e=ae(r,Yn);if(e.preferred_username)return this.logger.verbose("No SSO params used and ADAL/MSAL v1 token retrieved, setting ADAL/MSAL v1 preferred_username as loginHint"),e.preferred_username;if(e.upn)return this.logger.verbose("No SSO params used and ADAL/MSAL v1 token retrieved, setting ADAL/MSAL v1 upn as loginHint"),e.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}updateCredentialCacheKey(e,t){const r=le(t);if(e!==r){const n=this.getItem(e);if(n)return this.browserStorage.removeItem(e),this.setItem(r,n),this.logger.verbose(`Updated an outdated ${t.credentialType} cache key`),r;this.logger.error(`Attempted to update an outdated ${t.credentialType} cache key but no item matching the outdated key was found in storage`)}return e}async hydrateCache(e,t){const r=de(e.account?.homeAccountId,e.account?.environment,e.idToken,this.clientId,e.tenantId);let n;t.claims&&(n=await this.cryptoImpl.hashString(t.claims));const o={idToken:r,accessToken:ue(e.account?.homeAccountId,e.account.environment,e.accessToken,this.clientId,e.tenantId,e.scopes.join(" "),e.expiresOn?e.expiresOn.getTime()/1e3:0,e.extExpiresOn?e.extExpiresOn.getTime()/1e3:0,Yn,void 0,e.tokenType,void 0,t.sshKid,t.claims,n)};return this.saveCacheRecord(o)}async saveCacheRecord(e,t,r){try{await super.saveCacheRecord(e,t,r)}catch(e){if(e instanceof At&&this.performanceClient&&r)try{const e=this.getTokenKeys();this.performanceClient.addFields({cacheRtCount:e.refreshToken.length,cacheIdCount:e.idToken.length,cacheAtCount:e.accessToken.length},r)}catch(e){}throw e}}}function So(){return window.parent!==window}function _o(){return window.location.href.split("?")[0].split("#")[0]}function bo(){if("undefined"!=typeof window&&window.opener&&window.opener!==window&&"string"==typeof window.name&&0===window.name.indexOf(`${Bt.POPUP_NAME_PREFIX}.`))throw _n(Qr)}function Mo(){if("undefined"==typeof window)throw _n(on)}function Oo(e){if(!e)throw _n(vn)}function Po(e){Mo(),function(){if(gt.hashContainsKnownProperties(window.location.hash)&&So())throw _n(Wr)}(),bo(),Oo(e)}function No(e,t){if(Po(e),function(e){if(So()&&!e)throw _n($r)}(t.system.allowRedirectInIframe),t.cache.cacheLocation===Vt&&!t.cache.storeAuthStateInCookie)throw wo(Io)}function qo(e){const t=document.createElement("link");t.rel="preconnect",t.href=new URL(e).origin,t.crossOrigin="anonymous",document.head.appendChild(t),window.setTimeout((()=>{try{document.head.removeChild(t)}catch{}}),1e4)}var Lo=r(29701);
/*! @azure/msal-browser v3.26.1 2024-10-08 */
class Uo{constructor(e){this.eventCallbacks=new Map,this.logger=e||new i({})}addEventCallback(e,t,r){if("undefined"!=typeof window){const n=r||Zn();return this.eventCallbacks.has(n)?(this.logger.error(`Event callback with id: ${n} is already registered. Please provide a unique id or remove the existing callback and try again.`),null):(this.eventCallbacks.set(n,[e,t||[]]),this.logger.verbose(`Event callback registered with id: ${n}`),n)}return null}removeEventCallback(e){this.eventCallbacks.delete(e),this.logger.verbose(`Event callback ${e} removed.`)}emitEvent(e,t,r,n){if("undefined"!=typeof window){const o={eventType:e,interactionType:t||null,payload:r||null,error:n||null,timestamp:Date.now()};this.eventCallbacks.forEach((([t,r],n)=>{(0===r.length||r.includes(e))&&(this.logger.verbose(`Emitting event to callback ${n}: ${e}`),t.apply(null,[o]))}))}}}
/*! @azure/msal-common v14.15.0 2024-09-20 */
class Ho extends h.lR{constructor(e,t,r,n,o){super(e,t,r),this.name="ServerError",this.errorNo=n,this.status=o,Object.setPrototypeOf(this,Ho.prototype)}}
/*! @azure/msal-common v14.15.0 2024-09-20 */
class Do{static generateThrottlingStorageKey(e){return`${o.Xw.THROTTLING_PREFIX}.${JSON.stringify(e)}`}static preProcess(e,t){const r=Do.generateThrottlingStorageKey(t),n=e.getThrottlingCache(r);if(n){if(n.throttleTime<Date.now())return void e.removeItem(r);throw new Ho(n.errorCodes?.join(" ")||o.YM.EMPTY_STRING,n.errorMessage,n.subError)}}static postProcess(e,t,r){if(Do.checkResponseStatus(r)||Do.checkResponseForRetryAfter(r)){const n={throttleTime:Do.calculateThrottleTime(parseInt(r.headers[o.OK.RETRY_AFTER])),error:r.body.error,errorCodes:r.body.error_codes,errorMessage:r.body.error_description,subError:r.body.suberror};e.setThrottlingCache(Do.generateThrottlingStorageKey(t),n)}}static checkResponseStatus(e){return 429===e.status||e.status>=500&&e.status<600}static checkResponseForRetryAfter(e){return!!e.headers&&(e.headers.hasOwnProperty(o.OK.RETRY_AFTER)&&(e.status<200||e.status>=300))}static calculateThrottleTime(e){const t=e<=0?0:e,r=Date.now()/1e3;return Math.floor(1e3*Math.min(r+(t||o.Xw.DEFAULT_THROTTLE_TIME_SECONDS),r+o.Xw.DEFAULT_MAX_THROTTLE_TIME_SECONDS))}static removeThrottle(e,t,r,n){const o={clientId:t,authority:r.authority,scopes:r.scopes,homeAccountIdentifier:n,claims:r.claims,authenticationScheme:r.authenticationScheme,resourceRequestMethod:r.resourceRequestMethod,resourceRequestUri:r.resourceRequestUri,shrClaims:r.shrClaims,sshKid:r.sshKid},i=this.generateThrottlingStorageKey(o);e.removeItem(i)}}
/*! @azure/msal-common v14.15.0 2024-09-20 */
class Bo{constructor(e,t){this.networkClient=e,this.cacheManager=t}async sendPostRequest(e,t,r){let n;Do.preProcess(this.cacheManager,e);try{n=await this.networkClient.sendPostRequestAsync(t,r)}catch(e){throw e instanceof h.lR?e:re(m)}return Do.postProcess(this.cacheManager,e,n),n}}
/*! @azure/msal-common v14.15.0 2024-09-20 */
const Fo="client_id",xo="response_type",Ko="token_type",Go="req_cnf",Yo="return_spa_code",zo="x-client-xtra-sku";
/*! @azure/msal-common v14.15.0 2024-09-20 */
class $o{static validateRedirectUri(e){if(!e)throw Je(Se)}static validatePrompt(e){const t=[];for(const e in o._M)t.push(o._M[e]);if(t.indexOf(e)<0)throw Je(Ne)}static validateClaims(e){try{JSON.parse(e)}catch(e){throw Je(qe)}}static validateCodeChallengeParams(e,t){if(!e||!t)throw Je(De);this.validateCodeChallengeMethod(t)}static validateCodeChallengeMethod(e){if([o.iF.PLAIN,o.iF.S256].indexOf(e)<0)throw Je(He)}}
/*! @azure/msal-common v14.15.0 2024-09-20 */
class Wo{constructor(){this.parameters=new Map}addResponseTypeCode(){this.parameters.set(xo,encodeURIComponent(o.YM.CODE_RESPONSE_TYPE))}addResponseTypeForTokenAndIdToken(){this.parameters.set(xo,encodeURIComponent(`${o.YM.TOKEN_RESPONSE_TYPE} ${o.YM.ID_TOKEN_RESPONSE_TYPE}`))}addResponseMode(e){this.parameters.set("response_mode",encodeURIComponent(e||o.p.QUERY))}addNativeBroker(){this.parameters.set("nativebroker",encodeURIComponent("1"))}addScopes(e,t=!0,r=o.aZ){!t||r.includes("openid")||e.includes("openid")||r.push("openid");const n=t?[...e||[],...r]:e||[],i=new Ze(n);this.parameters.set("scope",encodeURIComponent(i.printScopes()))}addClientId(e){this.parameters.set(Fo,encodeURIComponent(e))}addRedirectUri(e){$o.validateRedirectUri(e),this.parameters.set("redirect_uri",encodeURIComponent(e))}addPostLogoutRedirectUri(e){$o.validateRedirectUri(e),this.parameters.set("post_logout_redirect_uri",encodeURIComponent(e))}addIdTokenHint(e){this.parameters.set("id_token_hint",encodeURIComponent(e))}addDomainHint(e){this.parameters.set("domain_hint",encodeURIComponent(e))}addLoginHint(e){this.parameters.set("login_hint",encodeURIComponent(e))}addCcsUpn(e){this.parameters.set(o.OK.CCS_HEADER,encodeURIComponent(`UPN:${e}`))}addCcsOid(e){this.parameters.set(o.OK.CCS_HEADER,encodeURIComponent(`Oid:${e.uid}@${e.utid}`))}addSid(e){this.parameters.set("sid",encodeURIComponent(e))}addClaims(e,t){const r=this.addClientCapabilitiesToClaims(e,t);$o.validateClaims(r),this.parameters.set("claims",encodeURIComponent(r))}addCorrelationId(e){this.parameters.set("client-request-id",encodeURIComponent(e))}addLibraryInfo(e){this.parameters.set("x-client-SKU",e.sku),this.parameters.set("x-client-VER",e.version),e.os&&this.parameters.set("x-client-OS",e.os),e.cpu&&this.parameters.set("x-client-CPU",e.cpu)}addApplicationTelemetry(e){e?.appName&&this.parameters.set("x-app-name",e.appName),e?.appVersion&&this.parameters.set("x-app-ver",e.appVersion)}addPrompt(e){$o.validatePrompt(e),this.parameters.set("prompt",encodeURIComponent(e))}addState(e){e&&this.parameters.set("state",encodeURIComponent(e))}addNonce(e){this.parameters.set("nonce",encodeURIComponent(e))}addCodeChallengeParams(e,t){if($o.validateCodeChallengeParams(e,t),!e||!t)throw Je(De);this.parameters.set("code_challenge",encodeURIComponent(e)),this.parameters.set("code_challenge_method",encodeURIComponent(t))}addAuthorizationCode(e){this.parameters.set("code",encodeURIComponent(e))}addDeviceCode(e){this.parameters.set("device_code",encodeURIComponent(e))}addRefreshToken(e){this.parameters.set("refresh_token",encodeURIComponent(e))}addCodeVerifier(e){this.parameters.set("code_verifier",encodeURIComponent(e))}addClientSecret(e){this.parameters.set("client_secret",encodeURIComponent(e))}addClientAssertion(e){e&&this.parameters.set("client_assertion",encodeURIComponent(e))}addClientAssertionType(e){e&&this.parameters.set("client_assertion_type",encodeURIComponent(e))}addOboAssertion(e){this.parameters.set("assertion",encodeURIComponent(e))}addRequestTokenUse(e){this.parameters.set("requested_token_use",encodeURIComponent(e))}addGrantType(e){this.parameters.set("grant_type",encodeURIComponent(e))}addClientInfo(){this.parameters.set(o.JR,"1")}addExtraQueryParameters(e){Object.entries(e).forEach((([e,t])=>{!this.parameters.has(e)&&t&&this.parameters.set(e,t)}))}addClientCapabilitiesToClaims(e,t){let r;if(e)try{r=JSON.parse(e)}catch(e){throw Je(qe)}else r={};return t&&t.length>0&&(r.hasOwnProperty(o.Fq.ACCESS_TOKEN)||(r[o.Fq.ACCESS_TOKEN]={}),r[o.Fq.ACCESS_TOKEN][o.Fq.XMS_CC]={values:t}),JSON.stringify(r)}addUsername(e){this.parameters.set(o.Tq.username,encodeURIComponent(e))}addPassword(e){this.parameters.set(o.Tq.password,encodeURIComponent(e))}addPopToken(e){e&&(this.parameters.set(Ko,o.IO.POP),this.parameters.set(Go,encodeURIComponent(e)))}addSshJwk(e){e&&(this.parameters.set(Ko,o.IO.SSH),this.parameters.set(Go,encodeURIComponent(e)))}addServerTelemetry(e){this.parameters.set("x-client-current-telemetry",e.generateCurrentRequestHeaderValue()),this.parameters.set("x-client-last-telemetry",e.generateLastRequestHeaderValue())}addThrottling(){this.parameters.set("x-ms-lib-capability",o.Xw.X_MS_LIB_CAPABILITY_VALUE)}addLogoutHint(e){this.parameters.set("logout_hint",encodeURIComponent(e))}createQueryString(){const e=new Array;return this.parameters.forEach(((t,r)=>{e.push(`${r}=${t}`)})),e.join("&")}}
/*! @azure/msal-common v14.15.0 2024-09-20 */
async function Qo(e,t,r,n,o,i,a){a?.addQueueMeasurement(Lt.AuthorityFactoryCreateDiscoveredInstance,i);const s=lo.transformCIAMAuthority(uo(e)),c=new lo(s,t,r,n,o,i,a);try{return await co(c.resolveEndpointsAsync.bind(c),Lt.AuthorityResolveEndpointsAsync,o,a,i)(),c}catch(e){throw re(p)}}
/*! @azure/msal-common v14.15.0 2024-09-20 */
class Vo{constructor(e,t){this.config=function({authOptions:e,systemOptions:t,loggerOptions:r,cacheOptions:n,storageInterface:o,networkInterface:a,cryptoInterface:s,clientCredentials:c,libraryInfo:h,telemetry:l,serverTelemetryManager:d,persistencePlugin:u,serializableCache:g}){const p={...Rt,...r};return{authOptions:(m=e,{clientCapabilities:[],azureCloudOptions:Ot,skipAuthorityMetadataCache:!1,instanceAware:!1,...m}),systemOptions:{...kt,...t},loggerOptions:p,cacheOptions:{...St,...n},storageInterface:o||new Et(e.clientId,ne,new i(p)),networkInterface:a||_t,cryptoInterface:s||ne,clientCredentials:c||Mt,libraryInfo:{...bt,...h},telemetry:{...Pt,...l},serverTelemetryManager:d||null,persistencePlugin:u||null,serializableCache:g||null};var m}(e),this.logger=new i(this.config.loggerOptions,oe,ie),this.cryptoUtils=this.config.cryptoInterface,this.cacheManager=this.config.storageInterface,this.networkClient=this.config.networkInterface,this.networkManager=new Bo(this.networkClient,this.cacheManager),this.serverTelemetryManager=this.config.serverTelemetryManager,this.authority=this.config.authOptions.authority,this.performanceClient=t}createTokenRequestHeaders(e){const t={};if(t[o.OK.CONTENT_TYPE]=o.YM.URL_FORM_CONTENT_TYPE,!this.config.systemOptions.preventCorsPreflight&&e)switch(e.type){case Co:try{const r=tt(e.credential);t[o.OK.CCS_HEADER]=`Oid:${r.uid}@${r.utid}`}catch(e){this.logger.verbose("Could not parse home account ID for CCS Header: "+e)}break;case fo:t[o.OK.CCS_HEADER]=`UPN: ${e.credential}`}return t}async executePostToTokenEndpoint(e,t,r,n,i,a){a&&this.performanceClient?.addQueueMeasurement(a,i);const s=await this.networkManager.sendPostRequest(n,e,{body:t,headers:r});return this.performanceClient?.addFields({refreshTokenSize:s.body.refresh_token?.length||0,httpVerToken:s.headers?.[o.OK.X_MS_HTTP_VERSION]||""},i),this.config.serverTelemetryManager&&s.status<500&&429!==s.status&&this.config.serverTelemetryManager.clearTelemetryCache(),s}async updateAuthority(e,t){this.performanceClient?.addQueueMeasurement(Lt.UpdateTokenEndpointAuthority,t);const r=`https://${e}/${this.authority.tenant}/`,n=await Qo(r,this.networkClient,this.cacheManager,this.authority.options,this.logger,t,this.performanceClient);this.authority=n}createTokenQueryParameters(e){const t=new Wo;return e.tokenQueryParameters&&t.addExtraQueryParameters(e.tokenQueryParameters),t.createQueryString()}}
/*! @azure/msal-common v14.15.0 2024-09-20 */
const jo="sw";class Jo{constructor(e,t){this.cryptoUtils=e,this.performanceClient=t}async generateCnf(e,t){this.performanceClient?.addQueueMeasurement(Lt.PopTokenGenerateCnf,e.correlationId);const r=await co(this.generateKid.bind(this),Lt.PopTokenGenerateCnf,t,this.performanceClient,e.correlationId)(e),n=this.cryptoUtils.base64UrlEncode(JSON.stringify(r));return{kid:r.kid,reqCnfString:n}}async generateKid(e){this.performanceClient?.addQueueMeasurement(Lt.PopTokenGenerateKid,e.correlationId);return{kid:await this.cryptoUtils.getPublicKeyThumbprint(e),xms_ksl:jo}}async signPopToken(e,t,r){return this.signPayload(e,t,r)}async signPayload(e,t,r,n){const{resourceRequestMethod:o,resourceRequestUri:i,shrClaims:a,shrNonce:s,shrOptions:c}=r,h=i?new gt(i):void 0,l=h?.getUrlComponents();return this.cryptoUtils.signJwt({at:e,ts:ce(),m:o?.toUpperCase(),u:l?.HostNameAndPort,nonce:s||this.cryptoUtils.createNewGuid(),p:l?.AbsolutePath,q:l?.QueryString?[[],l.QueryString]:void 0,client_claims:a||void 0,...n},t,c,r.correlationId)}}
/*! @azure/msal-common v14.15.0 2024-09-20 */
class Xo{constructor(e,t){this.cache=e,this.hasChanged=t}get cacheHasChanged(){return this.hasChanged}get tokenCache(){return this.cache}}class Zo{constructor(e,t,r,n,o,i,a){this.clientId=e,this.cacheStorage=t,this.cryptoObj=r,this.logger=n,this.serializableCache=o,this.persistencePlugin=i,this.performanceClient=a}validateServerAuthorizationCodeResponse(e,t){if(!e.state||!t)throw e.state?re(I,"Cached State"):re(I,"Server State");let r,n;try{r=decodeURIComponent(e.state)}catch(t){throw re(y,e.state)}try{n=decodeURIComponent(t)}catch(t){throw re(y,e.state)}if(r!==n)throw re(T);if(e.error||e.error_description||e.suberror){const t=
/*! @azure/msal-common v14.15.0 2024-09-20 */
function(e){const t="code=",r=e.error_uri?.lastIndexOf(t);return r&&r>=0?e.error_uri?.substring(r+5):void 0}(e);if((0,go.a)(e.error,e.error_description,e.suberror))throw new go.CB(e.error||"",e.error_description,e.suberror,e.timestamp||"",e.trace_id||"",e.correlation_id||"",e.claims||"",t);throw new Ho(e.error||"",e.error_description,e.suberror,t)}}validateTokenResponse(e,t){if(e.error||e.error_description||e.suberror){const r=`Error(s): ${e.error_codes||o.YM.NOT_AVAILABLE} - Timestamp: ${e.timestamp||o.YM.NOT_AVAILABLE} - Description: ${e.error_description||o.YM.NOT_AVAILABLE} - Correlation ID: ${e.correlation_id||o.YM.NOT_AVAILABLE} - Trace ID: ${e.trace_id||o.YM.NOT_AVAILABLE}`,n=e.error_codes?.length?e.error_codes[0]:void 0,i=new Ho(e.error,r,e.suberror,n,e.status);if(t&&e.status&&e.status>=o.t3.SERVER_ERROR_RANGE_START&&e.status<=o.t3.SERVER_ERROR_RANGE_END)return void this.logger.warning(`executeTokenRequest:validateTokenResponse - AAD is currently unavailable and the access token is unable to be refreshed.\n${i}`);if(t&&e.status&&e.status>=o.t3.CLIENT_ERROR_RANGE_START&&e.status<=o.t3.CLIENT_ERROR_RANGE_END)return void this.logger.warning(`executeTokenRequest:validateTokenResponse - AAD is currently available but is unable to refresh the access token.\n${i}`);if((0,go.a)(e.error,e.error_description,e.suberror))throw new go.CB(e.error,e.error_description,e.suberror,e.timestamp||o.YM.EMPTY_STRING,e.trace_id||o.YM.EMPTY_STRING,e.correlation_id||o.YM.EMPTY_STRING,e.claims||o.YM.EMPTY_STRING,n);throw i}}async handleServerTokenResponse(e,t,r,n,i,a,s,c,h){let l,d;if(this.performanceClient?.addQueueMeasurement(Lt.HandleServerTokenResponse,e.correlation_id),e.id_token){if(l=ae(e.id_token||o.YM.EMPTY_STRING,this.cryptoObj.base64Decode),i&&i.nonce&&l.nonce!==i.nonce)throw re(v);if(n.maxAge||0===n.maxAge){const e=l.auth_time;if(!e)throw re(A);se(e,n.maxAge)}}this.homeAccountIdentifier=lt.generateHomeAccountId(e.client_info||o.YM.EMPTY_STRING,t.authorityType,this.logger,this.cryptoObj,l),i&&i.state&&(d=mo.parseRequestState(this.cryptoObj,i.state)),e.key_id=e.key_id||n.sshKid||void 0;const u=this.generateCacheRecord(e,t,r,n,l,a,i);let g;try{if(this.persistencePlugin&&this.serializableCache&&(this.logger.verbose("Persistence enabled, calling beforeCacheAccess"),g=new Xo(this.serializableCache,!0),await this.persistencePlugin.beforeCacheAccess(g)),s&&!c&&u.account){const e=u.account.generateAccountKey();if(!this.cacheStorage.getAccount(e,this.logger))return this.logger.warning("Account used to refresh tokens not in persistence, refreshed tokens will not be stored in the cache"),await Zo.generateAuthenticationResult(this.cryptoObj,t,u,!1,n,l,d,void 0,h)}await this.cacheStorage.saveCacheRecord(u,n.storeInCache,n.correlationId)}finally{this.persistencePlugin&&this.serializableCache&&g&&(this.logger.verbose("Persistence enabled, calling afterCacheAccess"),await this.persistencePlugin.afterCacheAccess(g))}return Zo.generateAuthenticationResult(this.cryptoObj,t,u,!1,n,l,d,e,h)}generateCacheRecord(e,t,r,n,o,i,a){const s=t.getPreferredCache();if(!s)throw re(U);const c=ht(o);let h,l;e.id_token&&o&&(h=de(this.homeAccountIdentifier,s,e.id_token,this.clientId,c||""),l=ei(this.cacheStorage,t,this.homeAccountIdentifier,this.cryptoObj.base64Decode,o,e.client_info,s,c,a,void 0,this.logger));let d=null;if(e.access_token){const o=e.scope?Ze.fromString(e.scope):new Ze(n.scopes||[]),a=("string"==typeof e.expires_in?parseInt(e.expires_in,10):e.expires_in)||0,h=("string"==typeof e.ext_expires_in?parseInt(e.ext_expires_in,10):e.ext_expires_in)||0,l=("string"==typeof e.refresh_in?parseInt(e.refresh_in,10):e.refresh_in)||void 0,u=r+a,g=u+h,p=l&&l>0?r+l:void 0;d=ue(this.homeAccountIdentifier,s,e.access_token,this.clientId,c||t.tenant||"",o.printScopes(),u,g,this.cryptoObj.base64Decode,p,e.token_type,i,e.key_id,n.claims,n.requestedClaimsHash)}let u=null;if(e.refresh_token){let t;if(e.refresh_token_expires_in){t=r+("string"==typeof e.refresh_token_expires_in?parseInt(e.refresh_token_expires_in,10):e.refresh_token_expires_in)}u=ge(this.homeAccountIdentifier,s,e.refresh_token,this.clientId,e.foci,i,t)}let g=null;return e.foci&&(g={clientId:this.clientId,environment:s,familyId:e.foci}),{account:l,idToken:h,accessToken:d,refreshToken:u,appMetadata:g}}static async generateAuthenticationResult(e,t,r,n,i,a,s,c,h){let l,d,u=o.YM.EMPTY_STRING,g=[],p=null,m=o.YM.EMPTY_STRING;if(r.accessToken){if(r.accessToken.tokenType!==o.IO.POP||i.popKid)u=r.accessToken.secret;else{const t=new Jo(e),{secret:n,keyId:o}=r.accessToken;if(!o)throw re(Q);u=await t.signPopToken(n,o,i)}g=Ze.fromString(r.accessToken.target).asArray(),p=new Date(1e3*Number(r.accessToken.expiresOn)),l=new Date(1e3*Number(r.accessToken.extendedExpiresOn)),r.accessToken.refreshOn&&(d=new Date(1e3*Number(r.accessToken.refreshOn)))}r.appMetadata&&(m=r.appMetadata.familyId===o.hB?o.hB:"");const C=a?.oid||a?.sub||"",f=a?.tid||"";c?.spa_accountid&&r.account&&(r.account.nativeAccountId=c?.spa_accountid);const y=r.account?ot(r.account.getAccountInfo(),void 0,a,r.idToken?.secret):null;return{authority:t.canonicalAuthority,uniqueId:C,tenantId:f,scopes:g,account:y,idToken:r?.idToken?.secret||"",idTokenClaims:a||{},accessToken:u,fromCache:n,expiresOn:p,extExpiresOn:l,refreshOn:d,correlationId:i.correlationId,requestId:h||o.YM.EMPTY_STRING,familyId:m,tokenType:r.accessToken?.tokenType||o.YM.EMPTY_STRING,state:s?s.userRequestState:o.YM.EMPTY_STRING,cloudGraphHostName:r.account?.cloudGraphHostName||o.YM.EMPTY_STRING,msGraphHost:r.account?.msGraphHost||o.YM.EMPTY_STRING,code:c?.spa_code,fromNativeBroker:!1}}}function ei(e,t,r,n,o,i,a,s,c,h,l){l?.verbose("setCachedAccount called");const d=e.getAccountKeys().find((e=>e.startsWith(r)));let u=null;d&&(u=e.getAccount(d,l));const g=u||lt.createAccount({homeAccountId:r,idTokenClaims:o,clientInfo:i,environment:a,cloudGraphHostName:c?.cloud_graph_host_name,msGraphHost:c?.msgraph_host,nativeAccountId:h},t,n),p=g.tenantProfiles||[],m=s||g.realm;if(m&&!p.find((e=>e.tenantId===m))){const e=nt(r,g.localAccountId,m,o);p.push(e)}return g.tenantProfiles=p,g}
/*! @azure/msal-common v14.15.0 2024-09-20 */
async function ti(e,t,r){if("string"==typeof e)return e;return e({clientId:t,tokenEndpoint:r})}
/*! @azure/msal-common v14.15.0 2024-09-20 */
class ri extends Vo{constructor(e,t){super(e,t),this.includeRedirectUri=!0,this.oidcDefaultScopes=this.config.authOptions.authority.options.OIDCOptions?.defaultScopes}async getAuthCodeUrl(e){this.performanceClient?.addQueueMeasurement(Lt.GetAuthCodeUrl,e.correlationId);const t=await co(this.createAuthCodeUrlQueryString.bind(this),Lt.AuthClientCreateQueryString,this.logger,this.performanceClient,e.correlationId)(e);return gt.appendQueryString(this.authority.authorizationEndpoint,t)}async acquireToken(e,t){if(this.performanceClient?.addQueueMeasurement(Lt.AuthClientAcquireToken,e.correlationId),!e.code)throw re(S);const r=ce(),n=await co(this.executeTokenRequest.bind(this),Lt.AuthClientExecuteTokenRequest,this.logger,this.performanceClient,e.correlationId)(this.authority,e),i=n.headers?.[o.OK.X_MS_REQUEST_ID],a=new Zo(this.config.authOptions.clientId,this.cacheManager,this.cryptoUtils,this.logger,this.config.serializableCache,this.config.persistencePlugin,this.performanceClient);return a.validateTokenResponse(n.body),co(a.handleServerTokenResponse.bind(a),Lt.HandleServerTokenResponse,this.logger,this.performanceClient,e.correlationId)(n.body,this.authority,r,e,t,void 0,void 0,void 0,i)}handleFragmentResponse(e,t){if(new Zo(this.config.authOptions.clientId,this.cacheManager,this.cryptoUtils,this.logger,null,null).validateServerAuthorizationCodeResponse(e,t),!e.code)throw re(z);return e}getLogoutUri(e){if(!e)throw Je(Ue);const t=this.createLogoutUrlQueryString(e);return gt.appendQueryString(this.authority.endSessionEndpoint,t)}async executeTokenRequest(e,t){this.performanceClient?.addQueueMeasurement(Lt.AuthClientExecuteTokenRequest,t.correlationId);const r=this.createTokenQueryParameters(t),n=gt.appendQueryString(e.tokenEndpoint,r),i=await co(this.createTokenRequestBody.bind(this),Lt.AuthClientCreateTokenRequestBody,this.logger,this.performanceClient,t.correlationId)(t);let a;if(t.clientInfo)try{const e=et(t.clientInfo,this.cryptoUtils.base64Decode);a={credential:`${e.uid}${o.LR.CLIENT_INFO_SEPARATOR}${e.utid}`,type:Co}}catch(e){this.logger.verbose("Could not parse client info for CCS Header: "+e)}const s=this.createTokenRequestHeaders(a||t.ccsCredential),c={clientId:t.tokenBodyParameters?.clientId||this.config.authOptions.clientId,authority:e.canonicalAuthority,scopes:t.scopes,claims:t.claims,authenticationScheme:t.authenticationScheme,resourceRequestMethod:t.resourceRequestMethod,resourceRequestUri:t.resourceRequestUri,shrClaims:t.shrClaims,sshKid:t.sshKid};return co(this.executePostToTokenEndpoint.bind(this),Lt.AuthorizationCodeClientExecutePostToTokenEndpoint,this.logger,this.performanceClient,t.correlationId)(n,i,s,c,t.correlationId,Lt.AuthorizationCodeClientExecutePostToTokenEndpoint)}async createTokenRequestBody(e){this.performanceClient?.addQueueMeasurement(Lt.AuthClientCreateTokenRequestBody,e.correlationId);const t=new Wo;if(t.addClientId(e.tokenBodyParameters?.[Fo]||this.config.authOptions.clientId),this.includeRedirectUri?t.addRedirectUri(e.redirectUri):$o.validateRedirectUri(e.redirectUri),t.addScopes(e.scopes,!0,this.oidcDefaultScopes),t.addAuthorizationCode(e.code),t.addLibraryInfo(this.config.libraryInfo),t.addApplicationTelemetry(this.config.telemetry.application),t.addThrottling(),this.serverTelemetryManager&&!Nt(this.config)&&t.addServerTelemetry(this.serverTelemetryManager),e.codeVerifier&&t.addCodeVerifier(e.codeVerifier),this.config.clientCredentials.clientSecret&&t.addClientSecret(this.config.clientCredentials.clientSecret),this.config.clientCredentials.clientAssertion){const r=this.config.clientCredentials.clientAssertion;t.addClientAssertion(await ti(r.assertion,this.config.authOptions.clientId,e.resourceRequestUri)),t.addClientAssertionType(r.assertionType)}if(t.addGrantType(o.$x.AUTHORIZATION_CODE_GRANT),t.addClientInfo(),e.authenticationScheme===o.IO.POP){const r=new Jo(this.cryptoUtils,this.performanceClient);let n;if(e.popKid)n=this.cryptoUtils.encodeKid(e.popKid);else{n=(await co(r.generateCnf.bind(r),Lt.PopTokenGenerateCnf,this.logger,this.performanceClient,e.correlationId)(e,this.logger)).reqCnfString}t.addPopToken(n)}else if(e.authenticationScheme===o.IO.SSH){if(!e.sshJwk)throw Je(Ke);t.addSshJwk(e.sshJwk)}const r=e.correlationId||this.config.cryptoInterface.createNewGuid();let n;if(t.addCorrelationId(r),(!Xe.isEmptyObj(e.claims)||this.config.authOptions.clientCapabilities&&this.config.authOptions.clientCapabilities.length>0)&&t.addClaims(e.claims,this.config.authOptions.clientCapabilities),e.clientInfo)try{const t=et(e.clientInfo,this.cryptoUtils.base64Decode);n={credential:`${t.uid}${o.LR.CLIENT_INFO_SEPARATOR}${t.utid}`,type:Co}}catch(e){this.logger.verbose("Could not parse client info for CCS Header: "+e)}else n=e.ccsCredential;if(this.config.systemOptions.preventCorsPreflight&&n)switch(n.type){case Co:try{const e=tt(n.credential);t.addCcsOid(e)}catch(e){this.logger.verbose("Could not parse home account ID for CCS Header: "+e)}break;case fo:t.addCcsUpn(n.credential)}return e.tokenBodyParameters&&t.addExtraQueryParameters(e.tokenBodyParameters),!e.enableSpaAuthorizationCode||e.tokenBodyParameters&&e.tokenBodyParameters[Yo]||t.addExtraQueryParameters({[Yo]:"1"}),t.createQueryString()}async createAuthCodeUrlQueryString(e){this.performanceClient?.addQueueMeasurement(Lt.AuthClientCreateQueryString,e.correlationId);const t=new Wo;t.addClientId(e.extraQueryParameters?.[Fo]||this.config.authOptions.clientId);const r=[...e.scopes||[],...e.extraScopesToConsent||[]];t.addScopes(r,!0,this.oidcDefaultScopes),t.addRedirectUri(e.redirectUri);const n=e.correlationId||this.config.cryptoInterface.createNewGuid();if(t.addCorrelationId(n),t.addResponseMode(e.responseMode),t.addResponseTypeCode(),t.addLibraryInfo(this.config.libraryInfo),Nt(this.config)||t.addApplicationTelemetry(this.config.telemetry.application),t.addClientInfo(),e.codeChallenge&&e.codeChallengeMethod&&t.addCodeChallengeParams(e.codeChallenge,e.codeChallengeMethod),e.prompt&&t.addPrompt(e.prompt),e.domainHint&&t.addDomainHint(e.domainHint),e.prompt!==o._M.SELECT_ACCOUNT)if(e.sid&&e.prompt===o._M.NONE)this.logger.verbose("createAuthCodeUrlQueryString: Prompt is none, adding sid from request"),t.addSid(e.sid);else if(e.account){const r=this.extractAccountSid(e.account);let n=this.extractLoginHint(e.account);if(n&&e.domainHint&&(this.logger.warning('AuthorizationCodeClient.createAuthCodeUrlQueryString: "domainHint" param is set, skipping opaque "login_hint" claim. Please consider not passing domainHint'),n=null),n){this.logger.verbose("createAuthCodeUrlQueryString: login_hint claim present on account"),t.addLoginHint(n);try{const r=tt(e.account.homeAccountId);t.addCcsOid(r)}catch(e){this.logger.verbose("createAuthCodeUrlQueryString: Could not parse home account ID for CCS Header")}}else if(r&&e.prompt===o._M.NONE){this.logger.verbose("createAuthCodeUrlQueryString: Prompt is none, adding sid from account"),t.addSid(r);try{const r=tt(e.account.homeAccountId);t.addCcsOid(r)}catch(e){this.logger.verbose("createAuthCodeUrlQueryString: Could not parse home account ID for CCS Header")}}else if(e.loginHint)this.logger.verbose("createAuthCodeUrlQueryString: Adding login_hint from request"),t.addLoginHint(e.loginHint),t.addCcsUpn(e.loginHint);else if(e.account.username){this.logger.verbose("createAuthCodeUrlQueryString: Adding login_hint from account"),t.addLoginHint(e.account.username);try{const r=tt(e.account.homeAccountId);t.addCcsOid(r)}catch(e){this.logger.verbose("createAuthCodeUrlQueryString: Could not parse home account ID for CCS Header")}}}else e.loginHint&&(this.logger.verbose("createAuthCodeUrlQueryString: No account, adding login_hint from request"),t.addLoginHint(e.loginHint),t.addCcsUpn(e.loginHint));else this.logger.verbose("createAuthCodeUrlQueryString: Prompt is select_account, ignoring account hints");if(e.nonce&&t.addNonce(e.nonce),e.state&&t.addState(e.state),(e.claims||this.config.authOptions.clientCapabilities&&this.config.authOptions.clientCapabilities.length>0)&&t.addClaims(e.claims,this.config.authOptions.clientCapabilities),this.addExtraQueryParams(e,t),e.nativeBroker&&(t.addNativeBroker(),e.authenticationScheme===o.IO.POP)){const r=new Jo(this.cryptoUtils);let n;if(e.popKid)n=this.cryptoUtils.encodeKid(e.popKid);else{n=(await co(r.generateCnf.bind(r),Lt.PopTokenGenerateCnf,this.logger,this.performanceClient,e.correlationId)(e,this.logger)).reqCnfString}t.addPopToken(n)}return t.createQueryString()}createLogoutUrlQueryString(e){const t=new Wo;return e.postLogoutRedirectUri&&t.addPostLogoutRedirectUri(e.postLogoutRedirectUri),e.correlationId&&t.addCorrelationId(e.correlationId),e.idTokenHint&&t.addIdTokenHint(e.idTokenHint),e.state&&t.addState(e.state),e.logoutHint&&t.addLogoutHint(e.logoutHint),this.addExtraQueryParams(e,t),t.createQueryString()}addExtraQueryParams(e,t){!(e.extraQueryParameters&&e.extraQueryParameters.hasOwnProperty("instance_aware"))&&this.config.authOptions.instanceAware&&(e.extraQueryParameters=e.extraQueryParameters||{},e.extraQueryParameters.instance_aware="true"),e.extraQueryParameters&&t.addExtraQueryParameters(e.extraQueryParameters)}extractAccountSid(e){return e.idTokenClaims?.sid||null}extractLoginHint(e){return e.idTokenClaims?.login_hint||null}}
/*! @azure/msal-common v14.15.0 2024-09-20 */
const ni="|";function oi(e){const{skus:t,libraryName:r,libraryVersion:n,extensionName:o,extensionVersion:i}=e,a=new Map([[0,[r,n]],[2,[o,i]]]);let s=[];if(t?.length){if(s=t.split(","),s.length<4)return t}else s=Array.from({length:4},(()=>ni));return a.forEach(((e,t)=>{2===e.length&&e[0]?.length&&e[1]?.length&&function(e){const{skuArr:t,index:r,skuName:n,skuVersion:o}=e;if(r>=t.length)return;t[r]=[n,o].join(ni)}({skuArr:s,index:t,skuName:e[0],skuVersion:e[1]})})),s.join(",")}class ii{constructor(e,t){this.cacheOutcome=o.Rv.NOT_APPLICABLE,this.cacheManager=t,this.apiId=e.apiId,this.correlationId=e.correlationId,this.wrapperSKU=e.wrapperSKU||o.YM.EMPTY_STRING,this.wrapperVer=e.wrapperVer||o.YM.EMPTY_STRING,this.telemetryCacheKey=o.gT.CACHE_KEY+o.LR.CACHE_KEY_SEPARATOR+e.clientId}generateCurrentRequestHeaderValue(){const e=`${this.apiId}${o.gT.VALUE_SEPARATOR}${this.cacheOutcome}`,t=[this.wrapperSKU,this.wrapperVer],r=this.getNativeBrokerErrorCode();r?.length&&t.push(`broker_error=${r}`);const n=t.join(o.gT.VALUE_SEPARATOR),i=[e,this.getRegionDiscoveryFields()].join(o.gT.VALUE_SEPARATOR);return[o.gT.SCHEMA_VERSION,i,n].join(o.gT.CATEGORY_SEPARATOR)}generateLastRequestHeaderValue(){const e=this.getLastRequests(),t=ii.maxErrorsToSend(e),r=e.failedRequests.slice(0,2*t).join(o.gT.VALUE_SEPARATOR),n=e.errors.slice(0,t).join(o.gT.VALUE_SEPARATOR),i=e.errors.length,a=[i,t<i?o.gT.OVERFLOW_TRUE:o.gT.OVERFLOW_FALSE].join(o.gT.VALUE_SEPARATOR);return[o.gT.SCHEMA_VERSION,e.cacheHits,r,n,a].join(o.gT.CATEGORY_SEPARATOR)}cacheFailedRequest(e){const t=this.getLastRequests();t.errors.length>=o.gT.MAX_CACHED_ERRORS&&(t.failedRequests.shift(),t.failedRequests.shift(),t.errors.shift()),t.failedRequests.push(this.apiId,this.correlationId),e instanceof Error&&e&&e.toString()?e instanceof h.lR?e.subError?t.errors.push(e.subError):e.errorCode?t.errors.push(e.errorCode):t.errors.push(e.toString()):t.errors.push(e.toString()):t.errors.push(o.gT.UNKNOWN_ERROR),this.cacheManager.setServerTelemetry(this.telemetryCacheKey,t)}incrementCacheHits(){const e=this.getLastRequests();return e.cacheHits+=1,this.cacheManager.setServerTelemetry(this.telemetryCacheKey,e),e.cacheHits}getLastRequests(){return this.cacheManager.getServerTelemetry(this.telemetryCacheKey)||{failedRequests:[],errors:[],cacheHits:0}}clearTelemetryCache(){const e=this.getLastRequests(),t=ii.maxErrorsToSend(e);if(t===e.errors.length)this.cacheManager.removeItem(this.telemetryCacheKey);else{const r={failedRequests:e.failedRequests.slice(2*t),errors:e.errors.slice(t),cacheHits:0};this.cacheManager.setServerTelemetry(this.telemetryCacheKey,r)}}static maxErrorsToSend(e){let t,r=0,n=0;const i=e.errors.length;for(t=0;t<i;t++){const i=e.failedRequests[2*t]||o.YM.EMPTY_STRING,a=e.failedRequests[2*t+1]||o.YM.EMPTY_STRING,s=e.errors[t]||o.YM.EMPTY_STRING;if(n+=i.toString().length+a.toString().length+s.length+3,!(n<o.gT.MAX_LAST_HEADER_BYTES))break;r+=1}return r}getRegionDiscoveryFields(){const e=[];return e.push(this.regionUsed||o.YM.EMPTY_STRING),e.push(this.regionSource||o.YM.EMPTY_STRING),e.push(this.regionOutcome||o.YM.EMPTY_STRING),e.join(",")}updateRegionDiscoveryMetadata(e){this.regionUsed=e.region_used,this.regionSource=e.region_source,this.regionOutcome=e.region_outcome}setCacheOutcome(e){this.cacheOutcome=e}setNativeBrokerErrorCode(e){const t=this.getLastRequests();t.nativeBrokerErrorCode=e,this.cacheManager.setServerTelemetry(this.telemetryCacheKey,t)}getNativeBrokerErrorCode(){return this.getLastRequests().nativeBrokerErrorCode}clearNativeBrokerErrorCode(){const e=this.getLastRequests();delete e.nativeBrokerErrorCode,this.cacheManager.setServerTelemetry(this.telemetryCacheKey,e)}static makeExtraSkuString(e){return oi(e)}}
/*! @azure/msal-browser v3.26.1 2024-10-08 */
class ai{constructor(e,t,r,n,o,i,a,s,c){this.config=e,this.browserStorage=t,this.browserCrypto=r,this.networkClient=this.config.system.networkClient,this.eventHandler=o,this.navigationClient=i,this.nativeMessageHandler=s,this.correlationId=c||Zn(),this.logger=n.clone(Bt.MSAL_SKU,On,this.correlationId),this.performanceClient=a}async clearCacheOnLogout(e){if(e){lt.accountInfoIsEqual(e,this.browserStorage.getActiveAccount(),!1)&&(this.logger.verbose("Setting active account to null"),this.browserStorage.setActiveAccount(null));try{await this.browserStorage.removeAccount(lt.generateAccountCacheKey(e)),this.logger.verbose("Cleared cache items belonging to the account provided in the logout request.")}catch(e){this.logger.error("Account provided in logout request was not found. Local cache unchanged.")}}else try{this.logger.verbose("No account provided in logout request, clearing all cache items.",this.correlationId),await this.browserStorage.clear(),await this.browserCrypto.clearKeystore()}catch(e){this.logger.error("Attempted to clear all MSAL cache items and failed. Local cache unchanged.")}}getRedirectUri(e){this.logger.verbose("getRedirectUri called");const t=e||this.config.auth.redirectUri||_o();return gt.getAbsoluteUrl(t,_o())}initializeServerTelemetryManager(e,t){this.logger.verbose("initializeServerTelemetryManager called");const r={clientId:this.config.auth.clientId,correlationId:this.correlationId,apiId:e,forceRefresh:t||!1,wrapperSKU:this.browserStorage.getWrapperMetadata()[0],wrapperVer:this.browserStorage.getWrapperMetadata()[1]};return new ii(r,this.browserStorage)}async getDiscoveredAuthority(e){const{account:t}=e,r=e.requestExtraQueryParameters&&e.requestExtraQueryParameters.hasOwnProperty("instance_aware")?e.requestExtraQueryParameters.instance_aware:void 0;this.performanceClient.addQueueMeasurement(Lt.StandardInteractionClientGetDiscoveredAuthority,this.correlationId);const n={protocolMode:this.config.auth.protocolMode,OIDCOptions:this.config.auth.OIDCOptions,knownAuthorities:this.config.auth.knownAuthorities,cloudDiscoveryMetadata:this.config.auth.cloudDiscoveryMetadata,authorityMetadata:this.config.auth.authorityMetadata,skipAuthorityMetadataCache:this.config.auth.skipAuthorityMetadataCache},o=e.requestAuthority||this.config.auth.authority,i=r?.length?"true"===r:this.config.auth.instanceAware,a=t&&i?this.config.auth.authority.replace(gt.getDomainFromUrl(o),t.environment):o,s=lo.generateAuthority(a,e.requestAzureCloudOptions||this.config.auth.azureCloudOptions),c=await co(Qo,Lt.AuthorityFactoryCreateDiscoveredInstance,this.logger,this.performanceClient,this.correlationId)(s,this.config.system.networkClient,this.browserStorage,n,this.logger,this.correlationId,this.performanceClient);if(t&&!c.isAlias(t.environment))throw Je(Qe);return c}}
/*! @azure/msal-browser v3.26.1 2024-10-08 */
const si=32;async function ci(e,t,r){e.addQueueMeasurement(Lt.GeneratePkceCodes,r);const n=so(hi,Lt.GenerateCodeVerifier,t,e,r)(e,t,r);return{verifier:n,challenge:await co(li,Lt.GenerateCodeChallengeFromVerifier,t,e,r)(n,e,t,r)}}function hi(e,t,r){try{const n=new Uint8Array(si);so(Jn,Lt.GetRandomValues,t,e,r)(n);return xn(n)}catch(e){throw _n(Pr)}}async function li(e,t,r,n){t.addQueueMeasurement(Lt.GenerateCodeChallengeFromVerifier,n);try{const o=await co(jn,Lt.Sha256Digest,r,t,n)(e,t,n);return xn(new Uint8Array(o))}catch(e){throw _n(Pr)}}
/*! @azure/msal-browser v3.26.1 2024-10-08 */
async function di(e,t,r,n){r.addQueueMeasurement(Lt.InitializeBaseRequest,e.correlationId);const i=e.authority||t.auth.authority,a=[...e&&e.scopes||[]],s={...e,correlationId:e.correlationId,authority:i,scopes:a};if(s.authenticationScheme){if(s.authenticationScheme===o.IO.SSH){if(!e.sshJwk)throw Je(Ke);if(!e.sshKid)throw Je(Ge)}n.verbose(`Authentication Scheme set to "${s.authenticationScheme}" as configured in Auth request`)}else s.authenticationScheme=o.IO.BEARER,n.verbose('Authentication Scheme wasn\'t explicitly set in request, defaulting to "Bearer" request');return t.cache.claimsBasedCachingEnabled&&e.claims&&!Xe.isEmptyObj(e.claims)&&(s.requestedClaimsHash=await to(e.claims)),s}async function ui(e,t,r,n,o){n.addQueueMeasurement(Lt.InitializeSilentRequest,e.correlationId);const i=await co(di,Lt.InitializeBaseRequest,o,n,e.correlationId)(e,r,n,o);return{...e,...i,account:t,forceRefresh:e.forceRefresh||!1}}
/*! @azure/msal-browser v3.26.1 2024-10-08 */
class gi extends ai{async initializeAuthorizationCodeRequest(e){this.performanceClient.addQueueMeasurement(Lt.StandardInteractionClientInitializeAuthorizationCodeRequest,this.correlationId);const t=await co(ci,Lt.GeneratePkceCodes,this.logger,this.performanceClient,this.correlationId)(this.performanceClient,this.logger,this.correlationId),r={...e,redirectUri:e.redirectUri,code:o.YM.EMPTY_STRING,codeVerifier:t.verifier};return e.codeChallenge=t.challenge,e.codeChallengeMethod=o.YM.S256_CODE_CHALLENGE_METHOD,r}initializeLogoutRequest(e){this.logger.verbose("initializeLogoutRequest called",e?.correlationId);const t={correlationId:this.correlationId||Zn(),...e};if(e)if(e.logoutHint)this.logger.verbose("logoutHint has already been set in logoutRequest");else if(e.account){const r=this.getLogoutHintFromIdTokenClaims(e.account);r&&(this.logger.verbose("Setting logoutHint to login_hint ID Token Claim value for the account provided"),t.logoutHint=r)}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 e&&null===e.postLogoutRedirectUri?this.logger.verbose("postLogoutRedirectUri passed as null, not setting post logout redirect uri",t.correlationId):e&&e.postLogoutRedirectUri?(this.logger.verbose("Setting postLogoutRedirectUri to uri set on logout request",t.correlationId),t.postLogoutRedirectUri=gt.getAbsoluteUrl(e.postLogoutRedirectUri,_o())):null===this.config.auth.postLogoutRedirectUri?this.logger.verbose("postLogoutRedirectUri configured as null and no uri set on request, not passing post logout redirect",t.correlationId):this.config.auth.postLogoutRedirectUri?(this.logger.verbose("Setting postLogoutRedirectUri to configured uri",t.correlationId),t.postLogoutRedirectUri=gt.getAbsoluteUrl(this.config.auth.postLogoutRedirectUri,_o())):(this.logger.verbose("Setting postLogoutRedirectUri to current page",t.correlationId),t.postLogoutRedirectUri=gt.getAbsoluteUrl(_o(),_o())),t}getLogoutHintFromIdTokenClaims(e){const t=e.idTokenClaims;if(t){if(t.login_hint)return t.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}async createAuthCodeClient(e){this.performanceClient.addQueueMeasurement(Lt.StandardInteractionClientCreateAuthCodeClient,this.correlationId);const t=await co(this.getClientConfiguration.bind(this),Lt.StandardInteractionClientGetClientConfiguration,this.logger,this.performanceClient,this.correlationId)(e);return new ri(t,this.performanceClient)}async getClientConfiguration(e){const{serverTelemetryManager:t,requestAuthority:r,requestAzureCloudOptions:n,requestExtraQueryParameters:i,account:a}=e;this.performanceClient.addQueueMeasurement(Lt.StandardInteractionClientGetClientConfiguration,this.correlationId);const s=await co(this.getDiscoveredAuthority.bind(this),Lt.StandardInteractionClientGetDiscoveredAuthority,this.logger,this.performanceClient,this.correlationId)({requestAuthority:r,requestAzureCloudOptions:n,requestExtraQueryParameters:i,account:a}),c=this.config.system.loggerOptions;return{authOptions:{clientId:this.config.auth.clientId,authority:s,clientCapabilities:this.config.auth.clientCapabilities},systemOptions:{tokenRenewalOffsetSeconds:this.config.system.tokenRenewalOffsetSeconds,preventCorsPreflight:!0},loggerOptions:{loggerCallback:c.loggerCallback,piiLoggingEnabled:c.piiLoggingEnabled,logLevel:c.logLevel,correlationId:this.correlationId},cacheOptions:{claimsBasedCachingEnabled:this.config.cache.claimsBasedCachingEnabled},cryptoInterface:this.browserCrypto,networkInterface:this.networkClient,storageInterface:this.browserStorage,serverTelemetryManager:t,libraryInfo:{sku:Bt.MSAL_SKU,version:On,cpu:o.YM.EMPTY_STRING,os:o.YM.EMPTY_STRING},telemetry:this.config.telemetry}}async initializeAuthorizationRequest(e,t){this.performanceClient.addQueueMeasurement(Lt.StandardInteractionClientInitializeAuthorizationRequest,this.correlationId);const r=this.getRedirectUri(e.redirectUri),n={interactionType:t},i=mo.setRequestState(this.browserCrypto,e&&e.state||o.YM.EMPTY_STRING,n),a={...await co(di,Lt.InitializeBaseRequest,this.logger,this.performanceClient,this.correlationId)({...e,correlationId:this.correlationId},this.config,this.performanceClient,this.logger),redirectUri:r,state:i,nonce:e.nonce||Zn(),responseMode:this.config.auth.OIDCOptions.serverResponseType},s=e.account||this.browserStorage.getActiveAccount();if(s&&(this.logger.verbose("Setting validated request account",this.correlationId),this.logger.verbosePii(`Setting validated request account: ${s.homeAccountId}`,this.correlationId),a.account=s),!a.loginHint&&!s){const e=this.browserStorage.getLegacyLoginHint();e&&(a.loginHint=e)}return a}}var pi=r(56297);
/*! @azure/msal-browser v3.26.1 2024-10-08 */
const mi="user_switch",Ci={[mi]:"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."};class fi extends h.lR{constructor(e,t,r){super(e,t),Object.setPrototypeOf(this,fi.prototype),this.name="NativeAuthError",this.ext=r}}function yi(e){return!(!e.ext||!e.ext.status||"PERSISTENT_ERROR"!==e.ext.status&&"DISABLED"!==e.ext.status)||(!(!e.ext||!e.ext.error||-2147186943!==e.ext.error)||"ContentError"===e.errorCode)}function Ti(e,t,r){if(r&&r.status)switch(r.status){case"ACCOUNT_UNAVAILABLE":return(0,go.IE)(po.B);case"USER_INTERACTION_REQUIRED":return new go.CB(e,t);case"USER_CANCEL":return _n(Gr);case"NO_NETWORK":return _n(sn)}return new fi(e,Ci[e]||t,r)}class Ii extends Vo{constructor(e,t){super(e,t)}async acquireToken(e){this.performanceClient?.addQueueMeasurement(Lt.RefreshTokenClientAcquireToken,e.correlationId);const t=ce(),r=await co(this.executeTokenRequest.bind(this),Lt.RefreshTokenClientExecuteTokenRequest,this.logger,this.performanceClient,e.correlationId)(e,this.authority),n=r.headers?.[o.OK.X_MS_REQUEST_ID],i=new Zo(this.config.authOptions.clientId,this.cacheManager,this.cryptoUtils,this.logger,this.config.serializableCache,this.config.persistencePlugin);return i.validateTokenResponse(r.body),co(i.handleServerTokenResponse.bind(i),Lt.HandleServerTokenResponse,this.logger,this.performanceClient,e.correlationId)(r.body,this.authority,t,e,void 0,void 0,!0,e.forceCache,n)}async acquireTokenByRefreshToken(e){if(!e)throw Je(Le);if(this.performanceClient?.addQueueMeasurement(Lt.RefreshTokenClientAcquireTokenByRefreshToken,e.correlationId),!e.account)throw re(q);if(this.cacheManager.isAppMetadataFOCI(e.account.environment))try{return await co(this.acquireTokenWithCachedRefreshToken.bind(this),Lt.RefreshTokenClientAcquireTokenWithCachedRefreshToken,this.logger,this.performanceClient,e.correlationId)(e,!0)}catch(t){const r=t instanceof go.CB&&t.errorCode===po.oF,n=t instanceof Ho&&t.errorCode===o.I.INVALID_GRANT_ERROR&&t.subError===o.I.CLIENT_MISMATCH_ERROR;if(r||n)return co(this.acquireTokenWithCachedRefreshToken.bind(this),Lt.RefreshTokenClientAcquireTokenWithCachedRefreshToken,this.logger,this.performanceClient,e.correlationId)(e,!1);throw t}return co(this.acquireTokenWithCachedRefreshToken.bind(this),Lt.RefreshTokenClientAcquireTokenWithCachedRefreshToken,this.logger,this.performanceClient,e.correlationId)(e,!1)}async acquireTokenWithCachedRefreshToken(e,t){this.performanceClient?.addQueueMeasurement(Lt.RefreshTokenClientAcquireTokenWithCachedRefreshToken,e.correlationId);const r=so(this.cacheManager.getRefreshToken.bind(this.cacheManager),Lt.CacheManagerGetRefreshToken,this.logger,this.performanceClient,e.correlationId)(e.account,t,void 0,this.performanceClient,e.correlationId);if(!r)throw(0,go.IE)(po.oF);if(r.expiresOn&&he(r.expiresOn,e.refreshTokenExpirationOffsetSeconds||300))throw(0,go.IE)(po.AG);const n={...e,refreshToken:r.secret,authenticationScheme:e.authenticationScheme||o.IO.BEARER,ccsCredential:{credential:e.account.homeAccountId,type:Co}};try{return await co(this.acquireToken.bind(this),Lt.RefreshTokenClientAcquireToken,this.logger,this.performanceClient,e.correlationId)(n)}catch(e){if(e instanceof go.CB&&e.subError===po.j9){this.logger.verbose("acquireTokenWithRefreshToken: bad refresh token, removing from cache");const e=le(r);this.cacheManager.removeRefreshToken(e)}throw e}}async executeTokenRequest(e,t){this.performanceClient?.addQueueMeasurement(Lt.RefreshTokenClientExecuteTokenRequest,e.correlationId);const r=this.createTokenQueryParameters(e),n=gt.appendQueryString(t.tokenEndpoint,r),o=await co(this.createTokenRequestBody.bind(this),Lt.RefreshTokenClientCreateTokenRequestBody,this.logger,this.performanceClient,e.correlationId)(e),i=this.createTokenRequestHeaders(e.ccsCredential),a={clientId:e.tokenBodyParameters?.clientId||this.config.authOptions.clientId,authority:t.canonicalAuthority,scopes:e.scopes,claims:e.claims,authenticationScheme:e.authenticationScheme,resourceRequestMethod:e.resourceRequestMethod,resourceRequestUri:e.resourceRequestUri,shrClaims:e.shrClaims,sshKid:e.sshKid};return co(this.executePostToTokenEndpoint.bind(this),Lt.RefreshTokenClientExecutePostToTokenEndpoint,this.logger,this.performanceClient,e.correlationId)(n,o,i,a,e.correlationId,Lt.RefreshTokenClientExecutePostToTokenEndpoint)}async createTokenRequestBody(e){this.performanceClient?.addQueueMeasurement(Lt.RefreshTokenClientCreateTokenRequestBody,e.correlationId);const t=e.correlationId,r=new Wo;if(r.addClientId(e.tokenBodyParameters?.[Fo]||this.config.authOptions.clientId),e.redirectUri&&r.addRedirectUri(e.redirectUri),r.addScopes(e.scopes,!0,this.config.authOptions.authority.options.OIDCOptions?.defaultScopes),r.addGrantType(o.$x.REFRESH_TOKEN_GRANT),r.addClientInfo(),r.addLibraryInfo(this.config.libraryInfo),r.addApplicationTelemetry(this.config.telemetry.application),r.addThrottling(),this.serverTelemetryManager&&!Nt(this.config)&&r.addServerTelemetry(this.serverTelemetryManager),r.addCorrelationId(t),r.addRefreshToken(e.refreshToken),this.config.clientCredentials.clientSecret&&r.addClientSecret(this.config.clientCredentials.clientSecret),this.config.clientCredentials.clientAssertion){const t=this.config.clientCredentials.clientAssertion;r.addClientAssertion(await ti(t.assertion,this.config.authOptions.clientId,e.resourceRequestUri)),r.addClientAssertionType(t.assertionType)}if(e.authenticationScheme===o.IO.POP){const t=new Jo(this.cryptoUtils,this.performanceClient);let n;if(e.popKid)n=this.cryptoUtils.encodeKid(e.popKid);else{n=(await co(t.generateCnf.bind(t),Lt.PopTokenGenerateCnf,this.logger,this.performanceClient,e.correlationId)(e,this.logger)).reqCnfString}r.addPopToken(n)}else if(e.authenticationScheme===o.IO.SSH){if(!e.sshJwk)throw Je(Ke);r.addSshJwk(e.sshJwk)}if((!Xe.isEmptyObj(e.claims)||this.config.authOptions.clientCapabilities&&this.config.authOptions.clientCapabilities.length>0)&&r.addClaims(e.claims,this.config.authOptions.clientCapabilities),this.config.systemOptions.preventCorsPreflight&&e.ccsCredential)switch(e.ccsCredential.type){case Co:try{const t=tt(e.ccsCredential.credential);r.addCcsOid(t)}catch(e){this.logger.verbose("Could not parse home account ID for CCS Header: "+e)}break;case fo:r.addCcsUpn(e.ccsCredential.credential)}return e.tokenBodyParameters&&r.addExtraQueryParameters(e.tokenBodyParameters),r.createQueryString()}}
/*! @azure/msal-common v14.15.0 2024-09-20 */
class vi extends Vo{constructor(e,t){super(e,t)}async acquireToken(e){try{const[t,r]=await this.acquireCachedToken({...e,scopes:e.scopes?.length?e.scopes:[...o.aZ]});if(r===o.Rv.PROACTIVELY_REFRESHED){this.logger.info("SilentFlowClient:acquireCachedToken - Cached access token's refreshOn property has been exceeded'. It's not expired, but must be refreshed.");new Ii(this.config,this.performanceClient).acquireTokenByRefreshToken(e).catch((()=>{}))}return t}catch(t){if(t instanceof te&&t.errorCode===K){return new Ii(this.config,this.performanceClient).acquireTokenByRefreshToken(e)}throw t}}async acquireCachedToken(e){this.performanceClient?.addQueueMeasurement(Lt.SilentFlowClientAcquireCachedToken,e.correlationId);let t=o.Rv.NOT_APPLICABLE;if(e.forceRefresh||!this.config.cacheOptions.claimsBasedCachingEnabled&&!Xe.isEmptyObj(e.claims))throw this.setCacheOutcome(o.Rv.FORCE_REFRESH_OR_CLAIMS,e.correlationId),re(K);if(!e.account)throw re(q);const r=e.account.tenantId||function(e){const t=new gt(e).getUrlComponents(),r=t.PathSegments.slice(-1)[0]?.toLowerCase();switch(r){case o.v2.COMMON:case o.v2.ORGANIZATIONS:case o.v2.CONSUMERS:return;default:return r}}(e.authority),n=this.cacheManager.getTokenKeys(),i=this.cacheManager.getAccessToken(e.account,e,n,r,this.performanceClient,e.correlationId);if(!i)throw this.setCacheOutcome(o.Rv.NO_CACHED_ACCESS_TOKEN,e.correlationId),re(K);if(a=i.cachedAt,Number(a)>ce()||he(i.expiresOn,this.config.systemOptions.tokenRenewalOffsetSeconds))throw this.setCacheOutcome(o.Rv.CACHED_ACCESS_TOKEN_EXPIRED,e.correlationId),re(K);var a;i.refreshOn&&he(i.refreshOn,0)&&(t=o.Rv.PROACTIVELY_REFRESHED);const s=e.authority||this.authority.getPreferredCache(),c={account:this.cacheManager.readAccountFromCache(e.account),accessToken:i,idToken:this.cacheManager.getIdToken(e.account,n,r,this.performanceClient,e.correlationId),refreshToken:null,appMetadata:this.cacheManager.readAppMetadataFromCache(s)};return this.setCacheOutcome(t,e.correlationId),this.config.serverTelemetryManager&&this.config.serverTelemetryManager.incrementCacheHits(),[await co(this.generateResultFromCacheRecord.bind(this),Lt.SilentFlowClientGenerateResultFromCacheRecord,this.logger,this.performanceClient,e.correlationId)(c,e),t]}setCacheOutcome(e,t){this.serverTelemetryManager?.setCacheOutcome(e),this.performanceClient?.addFields({cacheOutcome:e},t),e!==o.Rv.NOT_APPLICABLE&&this.logger.info(`Token refresh is required due to cache outcome: ${e}`)}async generateResultFromCacheRecord(e,t){let r;if(this.performanceClient?.addQueueMeasurement(Lt.SilentFlowClientGenerateResultFromCacheRecord,t.correlationId),e.idToken&&(r=ae(e.idToken.secret,this.config.cryptoInterface.base64Decode)),t.maxAge||0===t.maxAge){const e=r?.auth_time;if(!e)throw re(A);se(e,t.maxAge)}return Zo.generateAuthenticationResult(this.cryptoUtils,this.authority,e,!0,t,r)}}
/*! @azure/msal-browser v3.26.1 2024-10-08 */
class Ai extends gi{async acquireToken(e){this.performanceClient.addQueueMeasurement(Lt.SilentCacheClientAcquireToken,e.correlationId);const t=this.initializeServerTelemetryManager(fr),r=await co(this.getClientConfiguration.bind(this),Lt.StandardInteractionClientGetClientConfiguration,this.logger,this.performanceClient,this.correlationId)({serverTelemetryManager:t,requestAuthority:e.authority,requestAzureCloudOptions:e.azureCloudOptions,account:e.account}),n=new vi(r,this.performanceClient);this.logger.verbose("Silent auth client created");try{const t=(await co(n.acquireCachedToken.bind(n),Lt.SilentFlowClientAcquireCachedToken,this.logger,this.performanceClient,e.correlationId)(e))[0];return this.performanceClient.addFields({fromCache:!0},e.correlationId),t}catch(e){throw e instanceof Sn&&e.errorCode===un&&this.logger.verbose("Signing keypair for bound access token not found. Refreshing bound access token and generating a new crypto keypair."),e}}logout(e){this.logger.verbose("logoutRedirect called");const t=this.initializeLogoutRequest(e);return this.clearCacheOnLogout(t?.account)}}
/*! @azure/msal-browser v3.26.1 2024-10-08 */
const wi="brk_client_id",Ei="brk_redirect_uri";class ki extends ai{constructor(e,t,r,n,o,i,a,s,c,h,l,d){super(e,t,r,n,o,i,s,c,d),this.apiId=a,this.accountId=h,this.nativeMessageHandler=c,this.nativeStorageManager=l,this.silentCacheClient=new Ai(e,this.nativeStorageManager,r,n,o,i,s,c,d),this.serverTelemetryManager=this.initializeServerTelemetryManager(this.apiId);const u=this.nativeMessageHandler.getExtensionId()===xt?"chrome":this.nativeMessageHandler.getExtensionId()?.length?"unknown":void 0;this.skus=ii.makeExtraSkuString({libraryName:Bt.MSAL_SKU,libraryVersion:On,extensionName:u,extensionVersion:this.nativeMessageHandler.getExtensionVersion()})}addRequestSKUs(e){e.extraParameters={...e.extraParameters,[zo]:this.skus}}async acquireToken(e){this.performanceClient.addQueueMeasurement(Lt.NativeInteractionClientAcquireToken,e.correlationId),this.logger.trace("NativeInteractionClient - acquireToken called.");const t=this.performanceClient.startMeasurement(Lt.NativeInteractionClientAcquireToken,e.correlationId),r=ce();try{const n=await this.initializeNativeRequest(e);try{const e=await this.acquireTokensFromCache(this.accountId,n);return t.end({success:!0,isNativeBroker:!1,fromCache:!0}),e}catch(e){this.logger.info("MSAL internal Cache does not contain tokens, proceed to make a native call")}const{...o}=n,i={method:zt,request:o},a=await this.nativeMessageHandler.sendMessage(i),s=this.validateNativeResponse(a);return await this.handleNativeResponse(s,n,r).then((e=>(t.end({success:!0,isNativeBroker:!0,requestId:e.requestId}),this.serverTelemetryManager.clearNativeBrokerErrorCode(),e))).catch((e=>{throw t.end({success:!1,errorCode:e.errorCode,subErrorCode:e.subError,isNativeBroker:!0}),e}))}catch(e){throw e instanceof fi&&this.serverTelemetryManager.setNativeBrokerErrorCode(e.errorCode),e}}createSilentCacheRequest(e,t){return{authority:e.authority,correlationId:this.correlationId,scopes:Ze.fromString(e.scope).asArray(),account:t,forceRefresh:!1}}async acquireTokensFromCache(e,t){if(!e)throw this.logger.warning("NativeInteractionClient:acquireTokensFromCache - No nativeAccountId provided"),re(H);const r=this.browserStorage.getBaseAccountInfo({nativeAccountId:e});if(!r)throw re(H);try{const e=this.createSilentCacheRequest(t,r),n=await this.silentCacheClient.acquireToken(e),o={...r,idTokenClaims:n?.idTokenClaims,idToken:n?.idToken};return{...n,account:o}}catch(e){throw e}}async acquireTokenRedirect(e,t){this.logger.trace("NativeInteractionClient - acquireTokenRedirect called.");const{...r}=e;delete r.onRedirectNavigate;const n=await this.initializeNativeRequest(r),o={method:zt,request:n};try{const e=await this.nativeMessageHandler.sendMessage(o);this.validateNativeResponse(e)}catch(e){if(e instanceof fi&&(this.serverTelemetryManager.setNativeBrokerErrorCode(e.errorCode),yi(e)))throw e}this.browserStorage.setTemporaryCache(sr,JSON.stringify(n),!0);const i={apiId:ur,timeout:this.config.system.redirectNavigationTimeout,noHistory:!1},a=this.config.auth.navigateToLoginRequestUrl?window.location.href:this.getRedirectUri(e.redirectUri);t.end({success:!0}),await this.navigationClient.navigateExternal(a,i)}async handleRedirectPromise(e,t){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."),null;const r=this.browserStorage.getCachedNativeRequest();if(!r)return this.logger.verbose("NativeInteractionClient - handleRedirectPromise called but there is no cached request, returning null."),e&&t&&e?.addFields({errorCode:"no_cached_request"},t),null;const{prompt:n,...o}=r;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(sr));const i={method:zt,request:o},a=ce();try{this.logger.verbose("NativeInteractionClient - handleRedirectPromise sending message to native broker.");const e=await this.nativeMessageHandler.sendMessage(i);this.validateNativeResponse(e);const t=this.handleNativeResponse(e,o,a);this.browserStorage.setInteractionInProgress(!1);const r=await t;return this.serverTelemetryManager.clearNativeBrokerErrorCode(),r}catch(e){throw this.browserStorage.setInteractionInProgress(!1),e}}logout(){return this.logger.trace("NativeInteractionClient - logout called."),Promise.reject("Logout not implemented yet")}async handleNativeResponse(e,t,r){this.logger.trace("NativeInteractionClient - handleNativeResponse called.");const n=ae(e.id_token,Yn),o=this.createHomeAccountIdentifier(e,n),i=this.browserStorage.getAccountInfoFilteredBy({nativeAccountId:t.accountId})?.homeAccountId;if(o!==i&&e.account.id!==t.accountId)throw Ti(mi);const a=await this.getDiscoveredAuthority({requestAuthority:t.authority}),s=ei(this.browserStorage,a,o,Yn,n,e.client_info,void 0,n.tid,void 0,e.account.id,this.logger),c=await this.generateAuthenticationResult(e,t,n,s,a.canonicalAuthority,r);return this.cacheAccount(s),this.cacheNativeTokens(e,t,o,n,e.access_token,c.tenantId,r),c}createHomeAccountIdentifier(e,t){return lt.generateHomeAccountId(e.client_info||o.YM.EMPTY_STRING,it,this.logger,this.browserCrypto,t)}generateScopes(e,t){return e.scope?Ze.fromString(e.scope):Ze.fromString(t.scope)}async generatePopAccessToken(e,t){if(t.tokenType===o.IO.POP&&t.signPopToken){if(e.shr)return this.logger.trace("handleNativeServerResponse: SHR is enabled in native layer"),e.shr;const r=new Jo(this.browserCrypto),n={resourceRequestMethod:t.resourceRequestMethod,resourceRequestUri:t.resourceRequestUri,shrClaims:t.shrClaims,shrNonce:t.shrNonce};if(!t.keyId)throw re(Q);return r.signPopToken(e.access_token,t.keyId,n)}return e.access_token}async generateAuthenticationResult(e,t,r,n,i,a){const s=this.addTelemetryFromNativeResponse(e),c=e.scope?Ze.fromString(e.scope):Ze.fromString(t.scope),h=e.account.properties||{},l=h.UID||r.oid||r.sub||o.YM.EMPTY_STRING,d=h.TenantId||r.tid||o.YM.EMPTY_STRING,u=ot(n.getAccountInfo(),void 0,r,e.id_token);u.nativeAccountId!==e.account.id&&(u.nativeAccountId=e.account.id);const g=await this.generatePopAccessToken(e,t),p=t.tokenType===o.IO.POP?o.IO.POP:o.IO.BEARER;return{authority:i,uniqueId:l,tenantId:d,scopes:c.asArray(),account:u,idToken:e.id_token,idTokenClaims:r,accessToken:g,fromCache:!!s&&this.isResponseFromCache(s),expiresOn:new Date(1e3*Number(a+e.expires_in)),tokenType:p,correlationId:this.correlationId,state:e.state,fromNativeBroker:!0}}cacheAccount(e){this.browserStorage.setAccount(e),this.browserStorage.removeAccountContext(e).catch((e=>{this.logger.error(`Error occurred while removing account context from browser storage. ${e}`)}))}cacheNativeTokens(e,t,r,n,i,a,s){const c=de(r,t.authority,e.id_token||"",t.clientId,n.tid||""),h=s+(t.tokenType===o.IO.POP?o.YM.SHR_NONCE_VALIDITY:("string"==typeof e.expires_in?parseInt(e.expires_in,10):e.expires_in)||0),l=this.generateScopes(e,t),d={idToken:c,accessToken:ue(r,t.authority,i,t.clientId,n.tid||a,l.printScopes(),h,0,Yn,void 0,t.tokenType,void 0,t.keyId)};this.nativeStorageManager.saveCacheRecord(d,t.storeInCache)}addTelemetryFromNativeResponse(e){const t=this.getMATSFromResponse(e);return t?(this.performanceClient.addFields({extensionId:this.nativeMessageHandler.getExtensionId(),extensionVersion:this.nativeMessageHandler.getExtensionVersion(),matsBrokerVersion:t.broker_version,matsAccountJoinOnStart:t.account_join_on_start,matsAccountJoinOnEnd:t.account_join_on_end,matsDeviceJoin:t.device_join,matsPromptBehavior:t.prompt_behavior,matsApiErrorCode:t.api_error_code,matsUiVisible:t.ui_visible,matsSilentCode:t.silent_code,matsSilentBiSubCode:t.silent_bi_sub_code,matsSilentMessage:t.silent_message,matsSilentStatus:t.silent_status,matsHttpStatus:t.http_status,matsHttpEventCount:t.http_event_count},this.correlationId),t):null}validateNativeResponse(e){if(e.hasOwnProperty("access_token")&&e.hasOwnProperty("id_token")&&e.hasOwnProperty("client_info")&&e.hasOwnProperty("account")&&e.hasOwnProperty("scope")&&e.hasOwnProperty("expires_in"))return e;throw(0,h.pz)(pi.W,"Response missing expected properties.")}getMATSFromResponse(e){if(e.properties.MATS)try{return JSON.parse(e.properties.MATS)}catch(e){this.logger.error("NativeInteractionClient - Error parsing MATS telemetry, returning null instead")}return null}isResponseFromCache(e){return void 0===e.is_cached?(this.logger.verbose("NativeInteractionClient - MATS telemetry does not contain field indicating if response was served from cache. Returning false."),!1):!!e.is_cached}async initializeNativeRequest(e){this.logger.trace("NativeInteractionClient - initializeNativeRequest called");const t=e.authority||this.config.auth.authority;e.account&&await this.getDiscoveredAuthority({requestAuthority:t,requestAzureCloudOptions:e.azureCloudOptions,account:e.account});const r=new gt(t);r.validateAsUri();const{scopes:n,...i}=e,a=new Ze(n||[]);a.appendScopes(o.aZ);const s={...i,accountId:this.accountId,clientId:this.config.auth.clientId,authority:r.urlString,scope:a.printScopes(),redirectUri:this.getRedirectUri(e.redirectUri),prompt:(()=>{switch(this.apiId){case pr:case fr:return this.logger.trace("initializeNativeRequest: silent request sets prompt to none"),o._M.NONE}if(e.prompt)switch(e.prompt){case o._M.NONE:case o._M.CONSENT:case o._M.LOGIN:return this.logger.trace("initializeNativeRequest: prompt is compatible with native flow"),e.prompt;default:throw this.logger.trace(`initializeNativeRequest: prompt = ${e.prompt} is not compatible with native flow`),_n(An)}else this.logger.trace("initializeNativeRequest: prompt was not provided")})(),correlationId:this.correlationId,tokenType:e.authenticationScheme,windowTitleSubstring:document.title,extraParameters:{...e.extraQueryParameters,...e.tokenQueryParameters},extendedExpiryToken:!1,keyId:e.popKid};if(s.signPopToken&&e.popKid)throw _n(En);if(this.handleExtraBrokerParams(s),s.extraParameters=s.extraParameters||{},s.extraParameters.telemetry=Kt,e.authenticationScheme===o.IO.POP){const t={resourceRequestUri:e.resourceRequestUri,resourceRequestMethod:e.resourceRequestMethod,shrClaims:e.shrClaims,shrNonce:e.shrNonce},r=new Jo(this.browserCrypto);let n;if(s.keyId)n=this.browserCrypto.base64UrlEncode(JSON.stringify({kid:s.keyId})),s.signPopToken=!1;else{const o=await co(r.generateCnf.bind(r),Lt.PopTokenGenerateCnf,this.logger,this.performanceClient,e.correlationId)(t,this.logger);n=o.reqCnfString,s.keyId=o.kid,s.signPopToken=!0}s.reqCnf=n}return this.addRequestSKUs(s),s}handleExtraBrokerParams(e){if(e.extraParameters&&e.extraParameters.hasOwnProperty(wi)&&e.extraParameters.hasOwnProperty(Ei)&&e.extraParameters.hasOwnProperty(Fo)){const t=e.extraParameters[Fo],r=e.redirectUri,n=e.extraParameters[Ei];e.extraParameters={child_client_id:t,child_redirect_uri:r},e.redirectUri=n}}}
/*! @azure/msal-browser v3.26.1 2024-10-08 */
class Ri{constructor(e,t,r,n){this.logger=e,this.handshakeTimeoutMs=t,this.extensionId=n,this.resolvers=new Map,this.handshakeResolvers=new Map,this.messageChannel=new MessageChannel,this.windowListener=this.onWindowMessage.bind(this),this.performanceClient=r,this.handshakeEvent=r.startMeasurement(Lt.NativeMessageHandlerHandshake)}async sendMessage(e){this.logger.trace("NativeMessageHandler - sendMessage called.");const t={channel:Ft,extensionId:this.extensionId,responseId:Zn(),body:e};return this.logger.trace("NativeMessageHandler - Sending request to browser extension"),this.logger.tracePii(`NativeMessageHandler - Sending request to browser extension: ${JSON.stringify(t)}`),this.messageChannel.port1.postMessage(t),new Promise(((e,r)=>{this.resolvers.set(t.responseId,{resolve:e,reject:r})}))}static async createProvider(e,t,r){e.trace("NativeMessageHandler - createProvider called.");try{const n=new Ri(e,t,r,xt);return await n.sendHandshakeRequest(),n}catch(n){const o=new Ri(e,t,r);return await o.sendHandshakeRequest(),o}}async sendHandshakeRequest(){this.logger.trace("NativeMessageHandler - sendHandshakeRequest called."),window.addEventListener("message",this.windowListener,!1);const e={channel:Ft,extensionId:this.extensionId,responseId:Zn(),body:{method:Gt}};return this.handshakeEvent.add({extensionId:this.extensionId,extensionHandshakeTimeoutMs:this.handshakeTimeoutMs}),this.messageChannel.port1.onmessage=e=>{this.onChannelMessage(e)},window.postMessage(e,window.origin,[this.messageChannel.port2]),new Promise(((t,r)=>{this.handshakeResolvers.set(e.responseId,{resolve:t,reject:r}),this.timeoutId=window.setTimeout((()=>{window.removeEventListener("message",this.windowListener,!1),this.messageChannel.port1.close(),this.messageChannel.port2.close(),this.handshakeEvent.end({extensionHandshakeTimedOut:!0,success:!1}),r(_n(yn)),this.handshakeResolvers.delete(e.responseId)}),this.handshakeTimeoutMs)}))}onWindowMessage(e){if(this.logger.trace("NativeMessageHandler - onWindowMessage called"),e.source!==window)return;const t=e.data;if(t.channel&&t.channel===Ft&&(!t.extensionId||t.extensionId===this.extensionId)&&t.body.method===Gt){const e=this.handshakeResolvers.get(t.responseId);if(!e)return void this.logger.trace(`NativeMessageHandler.onWindowMessage - resolver can't be found for request ${t.responseId}`);this.logger.verbose(t.extensionId?`Extension with id: ${t.extensionId} not installed`:"No extension installed"),clearTimeout(this.timeoutId),this.messageChannel.port1.close(),this.messageChannel.port2.close(),window.removeEventListener("message",this.windowListener,!1),this.handshakeEvent.end({success:!1,extensionInstalled:!1}),e.reject(_n(Tn))}}onChannelMessage(e){this.logger.trace("NativeMessageHandler - onChannelMessage called.");const t=e.data,r=this.resolvers.get(t.responseId),n=this.handshakeResolvers.get(t.responseId);try{const e=t.body.method;if(e===$t){if(!r)return;const e=t.body.response;if(this.logger.trace("NativeMessageHandler - Received response from browser extension"),this.logger.tracePii(`NativeMessageHandler - Received response from browser extension: ${JSON.stringify(e)}`),"Success"!==e.status)r.reject(Ti(e.code,e.description,e.ext));else{if(!e.result)throw(0,h.pz)(pi.W,"Event does not contain result.");e.result.code&&e.result.description?r.reject(Ti(e.result.code,e.result.description,e.result.ext)):r.resolve(e.result)}this.resolvers.delete(t.responseId)}else if(e===Yt){if(!n)return void this.logger.trace(`NativeMessageHandler.onChannelMessage - resolver can't be found for request ${t.responseId}`);clearTimeout(this.timeoutId),window.removeEventListener("message",this.windowListener,!1),this.extensionId=t.extensionId,this.extensionVersion=t.body.version,this.logger.verbose(`NativeMessageHandler - Received HandshakeResponse from extension: ${this.extensionId}`),this.handshakeEvent.end({extensionInstalled:!0,success:!0}),n.resolve(),this.handshakeResolvers.delete(t.responseId)}}catch(t){this.logger.error("Error parsing response from WAM Extension"),this.logger.errorPii(`Error parsing response from WAM Extension: ${t}`),this.logger.errorPii(`Unable to parse ${e}`),r?r.reject(t):n&&n.reject(t)}}getExtensionId(){return this.extensionId}getExtensionVersion(){return this.extensionVersion}static isNativeAvailable(e,t,r,n){if(t.trace("isNativeAvailable called"),!e.system.allowNativeBroker)return t.trace("isNativeAvailable: allowNativeBroker is not enabled, returning false"),!1;if(!r)return t.trace("isNativeAvailable: WAM extension provider is not initialized, returning false"),!1;if(n)switch(n){case o.IO.BEARER:case o.IO.POP:return t.trace("isNativeAvailable: authenticationScheme is supported, returning true"),!0;default:return t.trace("isNativeAvailable: authenticationScheme is not supported, returning false"),!1}return!0}}
/*! @azure/msal-browser v3.26.1 2024-10-08 */
class Si{constructor(e,t,r,n,o){this.authModule=e,this.browserStorage=t,this.authCodeRequest=r,this.logger=n,this.performanceClient=o}async handleCodeResponse(e,t){let r;this.performanceClient.addQueueMeasurement(Lt.HandleCodeResponse,t.correlationId);try{r=this.authModule.handleFragmentResponse(e,t.state)}catch(e){throw e instanceof Ho&&e.subError===Gr?_n(Gr):e}return co(this.handleCodeResponseFromServer.bind(this),Lt.HandleCodeResponseFromServer,this.logger,this.performanceClient,t.correlationId)(r,t)}async handleCodeResponseFromServer(e,t,r=!0){if(this.performanceClient.addQueueMeasurement(Lt.HandleCodeResponseFromServer,t.correlationId),this.logger.trace("InteractionHandler.handleCodeResponseFromServer called"),this.authCodeRequest.code=e.code,e.cloud_instance_host_name&&await co(this.authModule.updateAuthority.bind(this.authModule),Lt.UpdateTokenEndpointAuthority,this.logger,this.performanceClient,t.correlationId)(e.cloud_instance_host_name,t.correlationId),r&&(e.nonce=t.nonce||void 0),e.state=t.state,e.client_info)this.authCodeRequest.clientInfo=e.client_info;else{const e=this.createCcsCredentials(t);e&&(this.authCodeRequest.ccsCredential=e)}return await co(this.authModule.acquireToken.bind(this.authModule),Lt.AuthClientAcquireToken,this.logger,this.performanceClient,t.correlationId)(this.authCodeRequest,e)}createCcsCredentials(e){return e.account?{credential:e.account.homeAccountId,type:Co}:e.loginHint?{credential:e.loginHint,type:fo}:null}}
/*! @azure/msal-browser v3.26.1 2024-10-08 */
function _i(e,t,r){const n=ut(e);if(!n)throw dt(e)?(r.error(`A ${t} is present in the iframe but it does not contain known properties. It's likely that the ${t} has been replaced by code running on the redirectUri page.`),r.errorPii(`The ${t} detected is: ${e}`),_n(Hr)):(r.error(`The request has returned to the redirectUri but a ${t} is not present. It's likely that the ${t} has been removed or the page has been redirected by code running on the redirectUri page.`),_n(Lr));return n}
/*! @azure/msal-browser v3.26.1 2024-10-08 */
class bi extends gi{constructor(e,t,r,n,o,i,a,s,c,h){super(e,t,r,n,o,i,a,c,h),this.unloadWindow=this.unloadWindow.bind(this),this.nativeStorage=s}acquireToken(e){try{const t={popupName:this.generatePopupName(e.scopes||o.aZ,e.authority||this.config.auth.authority),popupWindowAttributes:e.popupWindowAttributes||{},popupWindowParent:e.popupWindowParent??window};return this.config.system.asyncPopups?(this.logger.verbose("asyncPopups set to true, acquiring token"),this.acquireTokenPopupAsync(e,t)):(this.logger.verbose("asyncPopup set to false, opening popup before acquiring token"),t.popup=this.openSizedPopup("about:blank",t),this.acquireTokenPopupAsync(e,t))}catch(e){return Promise.reject(e)}}logout(e){try{this.logger.verbose("logoutPopup called");const t=this.initializeLogoutRequest(e),r={popupName:this.generateLogoutPopupName(t),popupWindowAttributes:e?.popupWindowAttributes||{},popupWindowParent:e?.popupWindowParent??window},n=e&&e.authority,o=e&&e.mainWindowRedirectUri;return this.config.system.asyncPopups?(this.logger.verbose("asyncPopups set to true"),this.logoutPopupAsync(t,r,n,o)):(this.logger.verbose("asyncPopup set to false, opening popup"),r.popup=this.openSizedPopup("about:blank",r),this.logoutPopupAsync(t,r,n,o))}catch(e){return Promise.reject(e)}}async acquireTokenPopupAsync(e,t){this.logger.verbose("acquireTokenPopupAsync called");const r=this.initializeServerTelemetryManager(gr),n=await co(this.initializeAuthorizationRequest.bind(this),Lt.StandardInteractionClientInitializeAuthorizationRequest,this.logger,this.performanceClient,this.correlationId)(e,Ir.Popup);qo(n.authority);try{const o=await co(this.initializeAuthorizationCodeRequest.bind(this),Lt.StandardInteractionClientInitializeAuthorizationCodeRequest,this.logger,this.performanceClient,this.correlationId)(n),i=await co(this.createAuthCodeClient.bind(this),Lt.StandardInteractionClientCreateAuthCodeClient,this.logger,this.performanceClient,this.correlationId)({serverTelemetryManager:r,requestAuthority:n.authority,requestAzureCloudOptions:n.azureCloudOptions,requestExtraQueryParameters:n.extraQueryParameters,account:n.account}),a=Ri.isNativeAvailable(this.config,this.logger,this.nativeMessageHandler,e.authenticationScheme);let s;a&&(s=this.performanceClient.startMeasurement(Lt.FetchAccountIdWithNativeBroker,e.correlationId));const c=await i.getAuthCodeUrl({...n,nativeBroker:a}),h=new Si(i,this.browserStorage,o,this.logger,this.performanceClient),l=this.initiateAuthRequest(c,t);this.eventHandler.emitEvent(Lo.B.POPUP_OPENED,Ir.Popup,{popupWindow:l},null);const d=await this.monitorPopupForHash(l,t.popupWindowParent),u=so(_i,Lt.DeserializeResponse,this.logger,this.performanceClient,this.correlationId)(d,this.config.auth.OIDCOptions.serverResponseType,this.logger);if(Do.removeThrottle(this.browserStorage,this.config.auth.clientId,o),u.accountId){if(this.logger.verbose("Account id found in hash, calling WAM for token"),s&&s.end({success:!0,isNativeBroker:!0}),!this.nativeMessageHandler)throw _n(In);const e=new ki(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,gr,this.performanceClient,this.nativeMessageHandler,u.accountId,this.nativeStorage,n.correlationId),{userRequestState:t}=mo.parseRequestState(this.browserCrypto,n.state);return await e.acquireToken({...n,state:t,prompt:void 0})}return await h.handleCodeResponse(u,n)}catch(e){throw t.popup?.close(),e instanceof h.lR&&(e.setCorrelationId(this.correlationId),r.cacheFailedRequest(e)),e}}async logoutPopupAsync(e,t,r,n){this.logger.verbose("logoutPopupAsync called"),this.eventHandler.emitEvent(Lo.B.LOGOUT_START,Ir.Popup,e);const o=this.initializeServerTelemetryManager(Tr);try{await this.clearCacheOnLogout(e.account);const i=await co(this.createAuthCodeClient.bind(this),Lt.StandardInteractionClientCreateAuthCodeClient,this.logger,this.performanceClient,this.correlationId)({serverTelemetryManager:o,requestAuthority:r,account:e.account||void 0});try{i.authority.endSessionEndpoint}catch{if(e.account?.homeAccountId&&e.postLogoutRedirectUri&&i.authority.protocolMode===s){if(this.browserStorage.removeAccount(e.account?.homeAccountId),this.eventHandler.emitEvent(Lo.B.LOGOUT_SUCCESS,Ir.Popup,e),n){const e={apiId:Tr,timeout:this.config.system.redirectNavigationTimeout,noHistory:!1},t=gt.getAbsoluteUrl(n,_o());await this.navigationClient.navigateInternal(t,e)}return void t.popup?.close()}}const a=i.getLogoutUri(e);this.eventHandler.emitEvent(Lo.B.LOGOUT_SUCCESS,Ir.Popup,e);const c=this.openPopup(a,t);if(this.eventHandler.emitEvent(Lo.B.POPUP_OPENED,Ir.Popup,{popupWindow:c},null),await this.monitorPopupForHash(c,t.popupWindowParent).catch((()=>{})),n){const e={apiId:Tr,timeout:this.config.system.redirectNavigationTimeout,noHistory:!1},t=gt.getAbsoluteUrl(n,_o());this.logger.verbose("Redirecting main window to url specified in the request"),this.logger.verbosePii(`Redirecting main window to: ${t}`),await this.navigationClient.navigateInternal(t,e)}else this.logger.verbose("No main window navigation requested")}catch(e){throw t.popup?.close(),e instanceof h.lR&&(e.setCorrelationId(this.correlationId),o.cacheFailedRequest(e)),this.browserStorage.setInteractionInProgress(!1),this.eventHandler.emitEvent(Lo.B.LOGOUT_FAILURE,Ir.Popup,null,e),this.eventHandler.emitEvent(Lo.B.LOGOUT_END,Ir.Popup),e}this.eventHandler.emitEvent(Lo.B.LOGOUT_END,Ir.Popup)}initiateAuthRequest(e,t){if(e)return this.logger.infoPii(`Navigate to: ${e}`),this.openPopup(e,t);throw this.logger.error("Navigate url is empty"),_n(qr)}monitorPopupForHash(e,t){return new Promise(((t,r)=>{this.logger.verbose("PopupHandler.monitorPopupForHash - polling started");const n=setInterval((()=>{if(e.closed)return this.logger.error("PopupHandler.monitorPopupForHash - window closed"),clearInterval(n),void r(_n(Gr));let i="";try{i=e.location.href}catch(e){}if(!i||"about:blank"===i)return;clearInterval(n);let a="";const s=this.config.auth.OIDCOptions.serverResponseType;e&&(a=s===o.zL.QUERY?e.location.search:e.location.hash),this.logger.verbose("PopupHandler.monitorPopupForHash - popup window is on same origin as caller"),t(a)}),this.config.system.pollIntervalMilliseconds)})).finally((()=>{this.cleanPopup(e,t)}))}openPopup(e,t){try{let r;if(t.popup?(r=t.popup,this.logger.verbosePii(`Navigating popup window to: ${e}`),r.location.assign(e)):void 0===t.popup&&(this.logger.verbosePii(`Opening popup window to: ${e}`),r=this.openSizedPopup(e,t)),!r)throw _n(Kr);return r.focus&&r.focus(),this.currentWindow=r,t.popupWindowParent.addEventListener("beforeunload",this.unloadWindow),r}catch(e){throw this.logger.error("error opening popup "+e.message),this.browserStorage.setInteractionInProgress(!1),_n(xr)}}openSizedPopup(e,{popupName:t,popupWindowAttributes:r,popupWindowParent:n}){const o=n.screenLeft?n.screenLeft:n.screenX,i=n.screenTop?n.screenTop:n.screenY,a=n.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,s=n.innerHeight||document.documentElement.clientHeight||document.body.clientHeight;let c=r.popupSize?.width,h=r.popupSize?.height,l=r.popupPosition?.top,d=r.popupPosition?.left;return(!c||c<0||c>a)&&(this.logger.verbose("Default popup window width used. Window width not configured or invalid."),c=Bt.POPUP_WIDTH),(!h||h<0||h>s)&&(this.logger.verbose("Default popup window height used. Window height not configured or invalid."),h=Bt.POPUP_HEIGHT),(!l||l<0||l>s)&&(this.logger.verbose("Default popup window top position used. Window top not configured or invalid."),l=Math.max(0,s/2-Bt.POPUP_HEIGHT/2+i)),(!d||d<0||d>a)&&(this.logger.verbose("Default popup window left position used. Window left not configured or invalid."),d=Math.max(0,a/2-Bt.POPUP_WIDTH/2+o)),n.open(e,t,`width=${c}, height=${h}, top=${l}, left=${d}, scrollbars=yes`)}unloadWindow(e){this.browserStorage.cleanRequestByInteractionType(Ir.Popup),this.currentWindow&&this.currentWindow.close(),e.preventDefault()}cleanPopup(e,t){e.close(),t.removeEventListener("beforeunload",this.unloadWindow),this.browserStorage.setInteractionInProgress(!1)}generatePopupName(e,t){return`${Bt.POPUP_NAME_PREFIX}.${this.config.auth.clientId}.${e.join("-")}.${t}.${this.correlationId}`}generateLogoutPopupName(e){const t=e.account&&e.account.homeAccountId;return`${Bt.POPUP_NAME_PREFIX}.${this.config.auth.clientId}.${t}.${this.correlationId}`}}
/*! @azure/msal-browser v3.26.1 2024-10-08 */
class Mi{constructor(e,t,r,n,o){this.authModule=e,this.browserStorage=t,this.authCodeRequest=r,this.logger=n,this.performanceClient=o}async initiateAuthRequest(e,t){if(this.logger.verbose("RedirectHandler.initiateAuthRequest called"),e){t.redirectStartPage&&(this.logger.verbose("RedirectHandler.initiateAuthRequest: redirectStartPage set, caching start page"),this.browserStorage.setTemporaryCache(tr,t.redirectStartPage,!0)),this.browserStorage.setTemporaryCache(ar,this.authCodeRequest.correlationId,!0),this.browserStorage.cacheCodeRequest(this.authCodeRequest),this.logger.infoPii(`RedirectHandler.initiateAuthRequest: Navigate to: ${e}`);const r={apiId:ur,timeout:t.redirectTimeout,noHistory:!1};if("function"==typeof t.onRedirectNavigate){this.logger.verbose("RedirectHandler.initiateAuthRequest: Invoking onRedirectNavigate callback");return!1!==t.onRedirectNavigate(e)?(this.logger.verbose("RedirectHandler.initiateAuthRequest: onRedirectNavigate did not return false, navigating"),void await t.navigationClient.navigateExternal(e,r)):void this.logger.verbose("RedirectHandler.initiateAuthRequest: onRedirectNavigate returned false, stopping navigation")}return this.logger.verbose("RedirectHandler.initiateAuthRequest: Navigating window to navigate url"),void await t.navigationClient.navigateExternal(e,r)}throw this.logger.info("RedirectHandler.initiateAuthRequest: Navigate url is empty"),_n(qr)}async handleCodeResponse(e,t){this.logger.verbose("RedirectHandler.handleCodeResponse called"),this.browserStorage.setInteractionInProgress(!1);const r=this.browserStorage.generateStateKey(t),n=this.browserStorage.getTemporaryCache(r);if(!n)throw re(I,"Cached State");let o;try{o=this.authModule.handleFragmentResponse(e,n)}catch(e){throw e instanceof Ho&&e.subError===Gr?_n(Gr):e}const i=this.browserStorage.generateNonceKey(n),a=this.browserStorage.getTemporaryCache(i);if(this.authCodeRequest.code=o.code,o.cloud_instance_host_name&&await co(this.authModule.updateAuthority.bind(this.authModule),Lt.UpdateTokenEndpointAuthority,this.logger,this.performanceClient,this.authCodeRequest.correlationId)(o.cloud_instance_host_name,this.authCodeRequest.correlationId),o.nonce=a||void 0,o.state=n,o.client_info)this.authCodeRequest.clientInfo=o.client_info;else{const e=this.checkCcsCredentials();e&&(this.authCodeRequest.ccsCredential=e)}const s=await this.authModule.acquireToken(this.authCodeRequest,o);return this.browserStorage.cleanRequestByState(t),s}checkCcsCredentials(){const e=this.browserStorage.getTemporaryCache(ir,!0);if(e)try{return JSON.parse(e)}catch(t){this.authModule.logger.error("Cache credential could not be parsed"),this.authModule.logger.errorPii(`Cache credential could not be parsed: ${e}`)}return null}}class Oi extends gi{constructor(e,t,r,n,o,i,a,s,c,h){super(e,t,r,n,o,i,a,c,h),this.nativeStorage=s}async acquireToken(e){const t=await co(this.initializeAuthorizationRequest.bind(this),Lt.StandardInteractionClientInitializeAuthorizationRequest,this.logger,this.performanceClient,this.correlationId)(e,Ir.Redirect);this.browserStorage.updateCacheEntries(t.state,t.nonce,t.authority,t.loginHint||"",t.account||null);const r=this.initializeServerTelemetryManager(ur),n=e=>{e.persisted&&(this.logger.verbose("Page was restored from back/forward cache. Clearing temporary cache."),this.browserStorage.cleanRequestByState(t.state),this.eventHandler.emitEvent(Lo.B.RESTORE_FROM_BFCACHE,Ir.Redirect))};try{const o=await co(this.initializeAuthorizationCodeRequest.bind(this),Lt.StandardInteractionClientInitializeAuthorizationCodeRequest,this.logger,this.performanceClient,this.correlationId)(t),i=await co(this.createAuthCodeClient.bind(this),Lt.StandardInteractionClientCreateAuthCodeClient,this.logger,this.performanceClient,this.correlationId)({serverTelemetryManager:r,requestAuthority:t.authority,requestAzureCloudOptions:t.azureCloudOptions,requestExtraQueryParameters:t.extraQueryParameters,account:t.account}),a=new Mi(i,this.browserStorage,o,this.logger,this.performanceClient),s=await i.getAuthCodeUrl({...t,nativeBroker:Ri.isNativeAvailable(this.config,this.logger,this.nativeMessageHandler,e.authenticationScheme)}),c=this.getRedirectStartPage(e.redirectStartPage);return this.logger.verbosePii(`Redirect start page: ${c}`),window.addEventListener("pageshow",n),await a.initiateAuthRequest(s,{navigationClient:this.navigationClient,redirectTimeout:this.config.system.redirectNavigationTimeout,redirectStartPage:c,onRedirectNavigate:e.onRedirectNavigate||this.config.auth.onRedirectNavigate})}catch(e){throw e instanceof h.lR&&(e.setCorrelationId(this.correlationId),r.cacheFailedRequest(e)),window.removeEventListener("pageshow",n),this.browserStorage.cleanRequestByState(t.state),e}}async handleRedirectPromise(e="",t){const r=this.initializeServerTelemetryManager(mr);try{if(!this.browserStorage.isInteractionInProgress(!0))return this.logger.info("handleRedirectPromise called but there is no interaction in progress, returning null."),null;const[n,i]=this.getRedirectResponse(e||"");if(!n)return this.logger.info("handleRedirectPromise did not detect a response as a result of a redirect. Cleaning temporary cache."),this.browserStorage.cleanRequestByInteractionType(Ir.Redirect),"back_forward"!==
/*! @azure/msal-browser v3.26.1 2024-10-08 */
function(){if("undefined"==typeof window||void 0===window.performance||"function"!=typeof window.performance.getEntriesByType)return;const e=window.performance.getEntriesByType("navigation"),t=e.length?e[0]:void 0;return t?.type}()?t.event.errorCode="no_server_response":this.logger.verbose("Back navigation event detected. Muting no_server_response error"),null;const a=this.browserStorage.getTemporaryCache(tr,!0)||o.YM.EMPTY_STRING,s=gt.removeHashFromUrl(a);if(s===gt.removeHashFromUrl(window.location.href)&&this.config.auth.navigateToLoginRequestUrl){this.logger.verbose("Current page is loginRequestUrl, handling response"),a.indexOf("#")>-1&&function(e){const t=e.split("#");t.shift(),window.location.hash=t.length>0?t.join("#"):""}(a);return await this.handleResponse(n,r)}if(!this.config.auth.navigateToLoginRequestUrl)return this.logger.verbose("NavigateToLoginRequestUrl set to false, handling response"),await this.handleResponse(n,r);if(!So()||this.config.system.allowRedirectInIframe){this.browserStorage.setTemporaryCache(rr,i,!0);const e={apiId:mr,timeout:this.config.system.redirectNavigationTimeout,noHistory:!0};let t=!0;if(a&&"null"!==a)this.logger.verbose(`Navigating to loginRequestUrl: ${a}`),t=await this.navigationClient.navigateInternal(a,e);else{const r=function(){const e=new gt(window.location.href).getUrlComponents();return`${e.Protocol}//${e.HostNameAndPort}/`}();this.browserStorage.setTemporaryCache(tr,r,!0),this.logger.warning("Unable to get valid login request url from cache, redirecting to home page"),t=await this.navigationClient.navigateInternal(r,e)}if(!t)return await this.handleResponse(n,r)}return null}catch(e){throw e instanceof h.lR&&(e.setCorrelationId(this.correlationId),r.cacheFailedRequest(e)),this.browserStorage.cleanRequestByInteractionType(Ir.Redirect),e}}getRedirectResponse(e){this.logger.verbose("getRedirectResponseHash called");let t=e;t||(t=this.config.auth.OIDCOptions.serverResponseType===o.zL.QUERY?window.location.search:window.location.hash);let r=ut(t);if(r){try{!function(e,t,r){if(!e.state)throw _n(Ur);const n=ko(t,e.state);if(!n)throw _n(Dr);if(n.interactionType!==r)throw _n(Br)}(r,this.browserCrypto,Ir.Redirect)}catch(e){return e instanceof h.lR&&this.logger.error(`Interaction type validation failed due to ${e.errorCode}: ${e.errorMessage}`),[null,""]}return(n=window).location.hash="","function"==typeof n.history.replaceState&&n.history.replaceState(null,"",`${n.location.origin}${n.location.pathname}${n.location.search}`),this.logger.verbose("Hash contains known properties, returning response hash"),[r,t]}
/*! @azure/msal-browser v3.26.1 2024-10-08 */
var n;const i=this.browserStorage.getTemporaryCache(rr,!0);return this.browserStorage.removeItem(this.browserStorage.generateCacheKey(rr)),i&&(r=ut(i),r)?(this.logger.verbose("Hash does not contain known properties, returning cached hash"),[r,i]):[null,""]}async handleResponse(e,t){const r=e.state;if(!r)throw _n(Ur);const n=this.browserStorage.getCachedRequest(r);if(this.logger.verbose("handleResponse called, retrieved cached request"),e.accountId){if(this.logger.verbose("Account id found in hash, calling WAM for token"),!this.nativeMessageHandler)throw _n(In);const t=new ki(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,gr,this.performanceClient,this.nativeMessageHandler,e.accountId,this.nativeStorage,n.correlationId),{userRequestState:o}=mo.parseRequestState(this.browserCrypto,r);return t.acquireToken({...n,state:o,prompt:void 0}).finally((()=>{this.browserStorage.cleanRequestByState(r)}))}const o=this.browserStorage.getCachedAuthority(r);if(!o)throw _n(tn);const i=await co(this.createAuthCodeClient.bind(this),Lt.StandardInteractionClientCreateAuthCodeClient,this.logger,this.performanceClient,this.correlationId)({serverTelemetryManager:t,requestAuthority:o});Do.removeThrottle(this.browserStorage,this.config.auth.clientId,n);return new Mi(i,this.browserStorage,n,this.logger,this.performanceClient).handleCodeResponse(e,r)}async logout(e){this.logger.verbose("logoutRedirect called");const t=this.initializeLogoutRequest(e),r=this.initializeServerTelemetryManager(yr);try{this.eventHandler.emitEvent(Lo.B.LOGOUT_START,Ir.Redirect,e),await this.clearCacheOnLogout(t.account);const n={apiId:yr,timeout:this.config.system.redirectNavigationTimeout,noHistory:!1},o=await co(this.createAuthCodeClient.bind(this),Lt.StandardInteractionClientCreateAuthCodeClient,this.logger,this.performanceClient,this.correlationId)({serverTelemetryManager:r,requestAuthority:e&&e.authority,requestExtraQueryParameters:e?.extraQueryParameters,account:e&&e.account||void 0});if(o.authority.protocolMode===s)try{o.authority.endSessionEndpoint}catch{if(t.account?.homeAccountId)return this.browserStorage.removeAccount(t.account?.homeAccountId),void this.eventHandler.emitEvent(Lo.B.LOGOUT_SUCCESS,Ir.Redirect,t)}const i=o.getLogoutUri(t);if(this.eventHandler.emitEvent(Lo.B.LOGOUT_SUCCESS,Ir.Redirect,t),!e||"function"!=typeof e.onRedirectNavigate)return this.browserStorage.getInteractionInProgress()||this.browserStorage.setInteractionInProgress(!0),void await this.navigationClient.navigateExternal(i,n);if(!1!==e.onRedirectNavigate(i))return this.logger.verbose("Logout onRedirectNavigate did not return false, navigating"),this.browserStorage.getInteractionInProgress()||this.browserStorage.setInteractionInProgress(!0),void await this.navigationClient.navigateExternal(i,n);this.browserStorage.setInteractionInProgress(!1),this.logger.verbose("Logout onRedirectNavigate returned false, stopping navigation")}catch(e){throw e instanceof h.lR&&(e.setCorrelationId(this.correlationId),r.cacheFailedRequest(e)),this.eventHandler.emitEvent(Lo.B.LOGOUT_FAILURE,Ir.Redirect,null,e),this.eventHandler.emitEvent(Lo.B.LOGOUT_END,Ir.Redirect),e}this.eventHandler.emitEvent(Lo.B.LOGOUT_END,Ir.Redirect)}getRedirectStartPage(e){const t=e||window.location.href;return gt.getAbsoluteUrl(t,_o())}}
/*! @azure/msal-browser v3.26.1 2024-10-08 */
async function Pi(e,t,r,n,o){if(t.addQueueMeasurement(Lt.SilentHandlerInitiateAuthRequest,n),!e)throw r.info("Navigate url is empty"),_n(qr);return o?co(qi,Lt.SilentHandlerLoadFrame,r,t,n)(e,o,t,n):so(Li,Lt.SilentHandlerLoadFrameSync,r,t,n)(e)}async function Ni(e,t,r,n,i,a,s){return n.addQueueMeasurement(Lt.SilentHandlerMonitorIframeForHash,a),new Promise(((n,a)=>{t<Mn&&i.warning(`system.loadFrameTimeout or system.iframeHashTimeout set to lower (${t}ms) than the default (10000ms). This may result in timeouts.`);const c=window.setTimeout((()=>{window.clearInterval(h),a(_n(zr))}),t),h=window.setInterval((()=>{let t="";const r=e.contentWindow;try{t=r?r.location.href:""}catch(e){}if(!t||"about:blank"===t)return;let i="";r&&(i=s===o.zL.QUERY?r.location.search:r.location.hash),window.clearTimeout(c),window.clearInterval(h),n(i)}),r)})).finally((()=>{so(Hi,Lt.RemoveHiddenIframe,i,n,a)(e)}))}function qi(e,t,r,n){return r.addQueueMeasurement(Lt.SilentHandlerLoadFrame,n),new Promise(((r,n)=>{const o=Ui();window.setTimeout((()=>{o?(o.src=e,r(o)):n("Unable to load iframe")}),t)}))}function Li(e){const t=Ui();return t.src=e,t}function Ui(){const e=document.createElement("iframe");return e.className="msalSilentIframe",e.style.visibility="hidden",e.style.position="absolute",e.style.width=e.style.height="0",e.style.border="0",e.setAttribute("sandbox","allow-scripts allow-same-origin allow-forms"),document.body.appendChild(e),e}function Hi(e){document.body===e.parentNode&&document.body.removeChild(e)}
/*! @azure/msal-browser v3.26.1 2024-10-08 */
class Di extends gi{constructor(e,t,r,n,o,i,a,s,c,h,l){super(e,t,r,n,o,i,s,h,l),this.apiId=a,this.nativeStorage=c}async acquireToken(e){this.performanceClient.addQueueMeasurement(Lt.SilentIframeClientAcquireToken,e.correlationId),e.loginHint||e.sid||e.account&&e.account.username||this.logger.warning("No user hint provided. The authorization server may need more information to complete this request.");const t={...e};t.prompt?t.prompt!==o._M.NONE&&t.prompt!==o._M.NO_SESSION&&(this.logger.warning(`SilentIframeClient. Replacing invalid prompt ${t.prompt} with ${o._M.NONE}`),t.prompt=o._M.NONE):t.prompt=o._M.NONE;const r=await co(this.initializeAuthorizationRequest.bind(this),Lt.StandardInteractionClientInitializeAuthorizationRequest,this.logger,this.performanceClient,e.correlationId)(t,Ir.Silent);qo(r.authority);const n=this.initializeServerTelemetryManager(this.apiId);let i;try{return i=await co(this.createAuthCodeClient.bind(this),Lt.StandardInteractionClientCreateAuthCodeClient,this.logger,this.performanceClient,e.correlationId)({serverTelemetryManager:n,requestAuthority:r.authority,requestAzureCloudOptions:r.azureCloudOptions,requestExtraQueryParameters:r.extraQueryParameters,account:r.account}),await co(this.silentTokenHelper.bind(this),Lt.SilentIframeClientTokenHelper,this.logger,this.performanceClient,e.correlationId)(i,r)}catch(r){if(r instanceof h.lR&&(r.setCorrelationId(this.correlationId),n.cacheFailedRequest(r)),!(i&&r instanceof h.lR&&r.errorCode===Bt.INVALID_GRANT_ERROR))throw r;this.performanceClient.addFields({retryError:r.errorCode},this.correlationId);const o=await co(this.initializeAuthorizationRequest.bind(this),Lt.StandardInteractionClientInitializeAuthorizationRequest,this.logger,this.performanceClient,e.correlationId)(t,Ir.Silent);return await co(this.silentTokenHelper.bind(this),Lt.SilentIframeClientTokenHelper,this.logger,this.performanceClient,this.correlationId)(i,o)}}logout(){return Promise.reject(_n(jr))}async silentTokenHelper(e,t){const r=t.correlationId;this.performanceClient.addQueueMeasurement(Lt.SilentIframeClientTokenHelper,r);const n=await co(this.initializeAuthorizationCodeRequest.bind(this),Lt.StandardInteractionClientInitializeAuthorizationCodeRequest,this.logger,this.performanceClient,r)(t),i=await co(e.getAuthCodeUrl.bind(e),Lt.GetAuthCodeUrl,this.logger,this.performanceClient,r)({...t,nativeBroker:Ri.isNativeAvailable(this.config,this.logger,this.nativeMessageHandler,t.authenticationScheme)}),a=new Si(e,this.browserStorage,n,this.logger,this.performanceClient),s=await co(Pi,Lt.SilentHandlerInitiateAuthRequest,this.logger,this.performanceClient,r)(i,this.performanceClient,this.logger,r,this.config.system.navigateFrameWait),c=this.config.auth.OIDCOptions.serverResponseType,h=await co(Ni,Lt.SilentHandlerMonitorIframeForHash,this.logger,this.performanceClient,r)(s,this.config.system.iframeHashTimeout,this.config.system.pollIntervalMilliseconds,this.performanceClient,this.logger,r,c),l=so(_i,Lt.DeserializeResponse,this.logger,this.performanceClient,this.correlationId)(h,c,this.logger);if(l.accountId){if(this.logger.verbose("Account id found in hash, calling WAM for token"),!this.nativeMessageHandler)throw _n(In);const e=new ki(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,this.apiId,this.performanceClient,this.nativeMessageHandler,l.accountId,this.browserStorage,r),{userRequestState:n}=mo.parseRequestState(this.browserCrypto,t.state);return co(e.acquireToken.bind(e),Lt.NativeInteractionClientAcquireToken,this.logger,this.performanceClient,r)({...t,state:n,prompt:t.prompt||o._M.NONE})}return co(a.handleCodeResponse.bind(a),Lt.HandleCodeResponse,this.logger,this.performanceClient,r)(l,t)}}
/*! @azure/msal-browser v3.26.1 2024-10-08 */
class Bi extends gi{async acquireToken(e){this.performanceClient.addQueueMeasurement(Lt.SilentRefreshClientAcquireToken,e.correlationId);const t=await co(di,Lt.InitializeBaseRequest,this.logger,this.performanceClient,e.correlationId)(e,this.config,this.performanceClient,this.logger),r={...e,...t};e.redirectUri&&(r.redirectUri=this.getRedirectUri(e.redirectUri));const n=this.initializeServerTelemetryManager(fr),o=await this.createRefreshTokenClient({serverTelemetryManager:n,authorityUrl:r.authority,azureCloudOptions:r.azureCloudOptions,account:r.account});return co(o.acquireTokenByRefreshToken.bind(o),Lt.RefreshTokenClientAcquireTokenByRefreshToken,this.logger,this.performanceClient,e.correlationId)(r).catch((e=>{throw e.setCorrelationId(this.correlationId),n.cacheFailedRequest(e),e}))}logout(){return Promise.reject(_n(jr))}async createRefreshTokenClient(e){const t=await co(this.getClientConfiguration.bind(this),Lt.StandardInteractionClientGetClientConfiguration,this.logger,this.performanceClient,this.correlationId)({serverTelemetryManager:e.serverTelemetryManager,requestAuthority:e.authorityUrl,requestAzureCloudOptions:e.azureCloudOptions,requestExtraQueryParameters:e.extraQueryParameters,account:e.account});return new Ii(t,this.performanceClient)}}
/*! @azure/msal-browser v3.26.1 2024-10-08 */
class Fi{constructor(e,t,r,n){this.isBrowserEnvironment="undefined"!=typeof window,this.config=e,this.storage=t,this.logger=r,this.cryptoObj=n}loadExternalTokens(e,t,r){if(!this.isBrowserEnvironment)throw _n(on);const n=t.id_token?ae(t.id_token,Yn):void 0,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},i=e.authority?new lo(lo.generateAuthority(e.authority,e.azureCloudOptions),this.config.system.networkClient,this.storage,o,this.logger,e.correlationId||Zn()):void 0,a=this.loadAccount(e,r.clientInfo||t.client_info||"",n,i),s=this.loadIdToken(t,a.homeAccountId,a.environment,a.realm),c=this.loadAccessToken(e,t,a.homeAccountId,a.environment,a.realm,r),h=this.loadRefreshToken(t,a.homeAccountId,a.environment);return this.generateAuthenticationResult(e,{account:a,idToken:s,accessToken:c,refreshToken:h},n,i)}loadAccount(e,t,r,n){if(this.logger.verbose("TokenCache - loading account"),e.account){const t=lt.createFromAccountInfo(e.account);return this.storage.setAccount(t),t}if(!n||!t&&!r)throw this.logger.error("TokenCache - if an account is not provided on the request, authority and either clientInfo or idToken must be provided instead."),_n(dn);const o=lt.generateHomeAccountId(t,n.authorityType,this.logger,this.cryptoObj,r),i=r?.tid,a=ei(this.storage,n,o,Yn,r,t,n.hostnameAndPort,i,void 0,void 0,this.logger);return this.storage.setAccount(a),a}loadIdToken(e,t,r,n){if(!e.id_token)return this.logger.verbose("TokenCache - no id token found in response"),null;this.logger.verbose("TokenCache - loading id token");const o=de(t,r,e.id_token,this.config.auth.clientId,n);return this.storage.setIdTokenCredential(o),o}loadAccessToken(e,t,r,n,o,i){if(!t.access_token)return this.logger.verbose("TokenCache - no access token found in response"),null;if(!t.expires_in)return this.logger.error("TokenCache - no expiration set on the access token. Cannot add it to the cache."),null;if(!(t.scope||e.scopes&&e.scopes.length))return this.logger.error("TokenCache - scopes not specified in the request or response. Cannot add token to the cache."),null;this.logger.verbose("TokenCache - loading access token");const a=t.scope?Ze.fromString(t.scope):new Ze(e.scopes),s=i.expiresOn||t.expires_in+(new Date).getTime()/1e3,c=i.extendedExpiresOn||(t.ext_expires_in||t.expires_in)+(new Date).getTime()/1e3,h=ue(r,n,t.access_token,this.config.auth.clientId,o,a.printScopes(),s,c,Yn);return this.storage.setAccessTokenCredential(h),h}loadRefreshToken(e,t,r){if(!e.refresh_token)return this.logger.verbose("TokenCache - no refresh token found in response"),null;this.logger.verbose("TokenCache - loading refresh token");const n=ge(t,r,e.refresh_token,this.config.auth.clientId,e.foci,void 0,e.refresh_token_expires_in);return this.storage.setRefreshTokenCredential(n),n}generateAuthenticationResult(e,t,r,n){let o,i="",a=[],s=null;t?.accessToken&&(i=t.accessToken.secret,a=Ze.fromString(t.accessToken.target).asArray(),s=new Date(1e3*Number(t.accessToken.expiresOn)),o=new Date(1e3*Number(t.accessToken.extendedExpiresOn)));const c=t.account;return{authority:n?n.canonicalAuthority:"",uniqueId:t.account.localAccountId,tenantId:t.account.realm,scopes:a,account:c.getAccountInfo(),idToken:t.idToken?.secret||"",idTokenClaims:r||{},accessToken:i,fromCache:!0,expiresOn:s,correlationId:e.correlationId||"",requestId:"",extExpiresOn:o,familyId:t.refreshToken?.familyId||"",tokenType:t?.accessToken?.tokenType||"",state:e.state||"",cloudGraphHostName:c.cloudGraphHostName||"",msGraphHost:c.msGraphHost||"",fromNativeBroker:!1}}}
/*! @azure/msal-browser v3.26.1 2024-10-08 */
class xi extends ri{constructor(e){super(e),this.includeRedirectUri=!1}}
/*! @azure/msal-browser v3.26.1 2024-10-08 */
class Ki extends gi{constructor(e,t,r,n,o,i,a,s,c,h){super(e,t,r,n,o,i,s,c,h),this.apiId=a}async acquireToken(e){if(!e.code)throw _n(gn);const t=await co(this.initializeAuthorizationRequest.bind(this),Lt.StandardInteractionClientInitializeAuthorizationRequest,this.logger,this.performanceClient,e.correlationId)(e,Ir.Silent),r=this.initializeServerTelemetryManager(this.apiId);try{const n={...t,code:e.code},o=await co(this.getClientConfiguration.bind(this),Lt.StandardInteractionClientGetClientConfiguration,this.logger,this.performanceClient,e.correlationId)({serverTelemetryManager:r,requestAuthority:t.authority,requestAzureCloudOptions:t.azureCloudOptions,requestExtraQueryParameters:t.extraQueryParameters,account:t.account}),i=new xi(o);this.logger.verbose("Auth code client created");const a=new Si(i,this.browserStorage,n,this.logger,this.performanceClient);return await co(a.handleCodeResponseFromServer.bind(a),Lt.HandleCodeResponseFromServer,this.logger,this.performanceClient,e.correlationId)({code:e.code,msgraph_host:e.msGraphHost,cloud_graph_host_name:e.cloudGraphHostName,cloud_instance_host_name:e.cloudInstanceHostName},t,!1)}catch(e){throw e instanceof h.lR&&(e.setCorrelationId(this.correlationId),r.cacheFailedRequest(e)),e}}logout(){return Promise.reject(_n(jr))}}
/*! @azure/msal-browser v3.26.1 2024-10-08 */
function Gi(e){const t=e?.idTokenClaims;return t?.tfp||t?.acr?"B2C":t?.tid?"9188040d-6c67-4c5b-b112-36a304b66dad"===t?.tid?"MSA":"AAD":void 0}function Yi(e,t){try{Po(e)}catch(e){throw t.end({success:!1},e),e}}class zi{constructor(e){var t,r;this.operatingContext=e,this.isBrowserEnvironment=this.operatingContext.isBrowserEnvironment(),this.config=e.getConfig(),this.initialized=!1,this.logger=this.operatingContext.getLogger(),this.networkClient=this.config.system.networkClient,this.navigationClient=this.config.system.navigationClient,this.redirectResponse=new Map,this.hybridAuthCodeResponses=new Map,this.performanceClient=this.config.telemetry.client,this.browserCrypto=this.isBrowserEnvironment?new io(this.logger,this.performanceClient):ne,this.eventHandler=new Uo(this.logger),this.browserStorage=this.isBrowserEnvironment?new Ro(this.config.auth.clientId,this.config.cache,this.browserCrypto,this.logger,function(e){const t=e.cloudDiscoveryMetadata;let r;if(t)try{r=JSON.parse(t)}catch(e){throw Je(Be)}return{canonicalAuthority:e.authority?uo(e.authority):void 0,knownAuthorities:e.knownAuthorities,cloudDiscoveryMetadata:r}}(this.config.auth),this.performanceClient):(t=this.config.auth.clientId,r=this.logger,new Ro(t,{cacheLocation:Vt,temporaryCacheLocation:Vt,storeAuthStateInCookie:!1,secureCookies:!1,cacheMigrationEnabled:!1,claimsBasedCachingEnabled:!1},ne,r));const n={cacheLocation:Vt,temporaryCacheLocation:Vt,storeAuthStateInCookie:!1,secureCookies:!1,cacheMigrationEnabled:!1,claimsBasedCachingEnabled:!1};this.nativeInternalStorage=new Ro(this.config.auth.clientId,n,this.browserCrypto,this.logger,void 0,this.performanceClient),this.tokenCache=new Fi(this.config,this.browserStorage,this.logger,this.browserCrypto),this.activeSilentTokenRequests=new Map,this.trackPageVisibility=this.trackPageVisibility.bind(this),this.trackPageVisibilityWithMeasurement=this.trackPageVisibilityWithMeasurement.bind(this),this.listeningToStorageEvents=!1,this.handleAccountCacheChange=this.handleAccountCacheChange.bind(this)}static async createController(e,t){const r=new zi(e);return await r.initialize(t),r}trackPageVisibility(e){e&&(this.logger.info("Perf: Visibility change detected"),this.performanceClient.incrementFields({visibilityChangeCount:1},e))}async initialize(e){if(this.logger.trace("initialize called"),this.initialized)return void this.logger.info("initialize has already been called, exiting early.");if(!this.isBrowserEnvironment)return this.logger.info("in non-browser environment, exiting early."),this.initialized=!0,void this.eventHandler.emitEvent(Lo.B.INITIALIZE_END);const t=e?.correlationId||this.getRequestCorrelationId(),r=this.config.system.allowNativeBroker,n=this.performanceClient.startMeasurement(Lt.InitializeClientApplication,t);if(this.eventHandler.emitEvent(Lo.B.INITIALIZE_START),r)try{this.nativeExtensionProvider=await Ri.createProvider(this.logger,this.config.system.nativeBrokerHandshakeTimeout,this.performanceClient)}catch(e){this.logger.verbose(e)}this.config.cache.claimsBasedCachingEnabled||(this.logger.verbose("Claims-based caching is disabled. Clearing the previous cache with claims"),await co(this.browserStorage.clearTokensAndKeysWithClaims.bind(this.browserStorage),Lt.ClearTokensAndKeysWithClaims,this.logger,this.performanceClient,t)(this.performanceClient,t)),this.initialized=!0,this.eventHandler.emitEvent(Lo.B.INITIALIZE_END),n.end({allowNativeBroker:r,success:!0})}async handleRedirectPromise(e){if(this.logger.verbose("handleRedirectPromise called"),Oo(this.initialized),this.isBrowserEnvironment){const t=e||"";let r=this.redirectResponse.get(t);return void 0===r?(r=this.handleRedirectPromiseInternal(e),this.redirectResponse.set(t,r),this.logger.verbose("handleRedirectPromise has been called for the first time, storing the promise")):this.logger.verbose("handleRedirectPromise has been called previously, returning the result from the first call"),r}return this.logger.verbose("handleRedirectPromise returns null, not browser environment"),null}async handleRedirectPromiseInternal(e){const t=this.getAllAccounts(),r=this.browserStorage.getCachedNativeRequest(),n=r&&Ri.isNativeAvailable(this.config,this.logger,this.nativeExtensionProvider)&&this.nativeExtensionProvider&&!e,o=n?r?.correlationId:this.browserStorage.getTemporaryCache(ar,!0)||"",i=this.performanceClient.startMeasurement(Lt.AcquireTokenRedirect,o);let a;if(this.eventHandler.emitEvent(Lo.B.HANDLE_REDIRECT_START,Ir.Redirect),n&&this.nativeExtensionProvider){this.logger.trace("handleRedirectPromise - acquiring token from native platform");const e=new ki(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,mr,this.performanceClient,this.nativeExtensionProvider,r.accountId,this.nativeInternalStorage,r.correlationId);a=co(e.handleRedirectPromise.bind(e),Lt.HandleNativeRedirectPromiseMeasurement,this.logger,this.performanceClient,i.event.correlationId)(this.performanceClient,i.event.correlationId)}else{this.logger.trace("handleRedirectPromise - acquiring token from web flow");const t=this.createRedirectClient(o);a=co(t.handleRedirectPromise.bind(t),Lt.HandleRedirectPromiseMeasurement,this.logger,this.performanceClient,i.event.correlationId)(e,i)}return a.then((e=>{if(e){t.length<this.getAllAccounts().length?(this.eventHandler.emitEvent(Lo.B.LOGIN_SUCCESS,Ir.Redirect,e),this.logger.verbose("handleRedirectResponse returned result, login success")):(this.eventHandler.emitEvent(Lo.B.ACQUIRE_TOKEN_SUCCESS,Ir.Redirect,e),this.logger.verbose("handleRedirectResponse returned result, acquire token success")),i.end({success:!0,accountType:Gi(e.account)})}else i.event.errorCode?i.end({success:!1}):i.discard();return this.eventHandler.emitEvent(Lo.B.HANDLE_REDIRECT_END,Ir.Redirect),e})).catch((e=>{const r=e;throw t.length>0?this.eventHandler.emitEvent(Lo.B.ACQUIRE_TOKEN_FAILURE,Ir.Redirect,null,r):this.eventHandler.emitEvent(Lo.B.LOGIN_FAILURE,Ir.Redirect,null,r),this.eventHandler.emitEvent(Lo.B.HANDLE_REDIRECT_END,Ir.Redirect),i.end({success:!1},r),e}))}async acquireTokenRedirect(e){const t=this.getRequestCorrelationId(e);this.logger.verbose("acquireTokenRedirect called",t);const r=this.performanceClient.startMeasurement(Lt.AcquireTokenPreRedirect,t);r.add({accountType:Gi(e.account),scenarioId:e.scenarioId});const n=e.onRedirectNavigate;if(n)e.onRedirectNavigate=e=>{const t="function"==typeof n?n(e):void 0;return!1!==t?r.end({success:!0}):r.discard(),t};else{const e=this.config.auth.onRedirectNavigate;this.config.auth.onRedirectNavigate=t=>{const n="function"==typeof e?e(t):void 0;return!1!==n?r.end({success:!0}):r.discard(),n}}const o=this.getAllAccounts().length>0;try{let n;if(No(this.initialized,this.config),this.browserStorage.setInteractionInProgress(!0),o?this.eventHandler.emitEvent(Lo.B.ACQUIRE_TOKEN_START,Ir.Redirect,e):this.eventHandler.emitEvent(Lo.B.LOGIN_START,Ir.Redirect,e),this.nativeExtensionProvider&&this.canUseNative(e)){n=new ki(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,ur,this.performanceClient,this.nativeExtensionProvider,this.getNativeAccountId(e),this.nativeInternalStorage,t).acquireTokenRedirect(e,r).catch((r=>{if(r instanceof fi&&yi(r)){this.nativeExtensionProvider=void 0;return this.createRedirectClient(t).acquireToken(e)}if(r instanceof go.CB){this.logger.verbose("acquireTokenRedirect - Resolving interaction required error thrown by native broker by falling back to web flow");return this.createRedirectClient(t).acquireToken(e)}throw this.browserStorage.setInteractionInProgress(!1),r}))}else{n=this.createRedirectClient(t).acquireToken(e)}return await n}catch(e){throw r.end({success:!1},e),o?this.eventHandler.emitEvent(Lo.B.ACQUIRE_TOKEN_FAILURE,Ir.Redirect,null,e):this.eventHandler.emitEvent(Lo.B.LOGIN_FAILURE,Ir.Redirect,null,e),e}}acquireTokenPopup(e){const t=this.getRequestCorrelationId(e),r=this.performanceClient.startMeasurement(Lt.AcquireTokenPopup,t);r.add({scenarioId:e.scenarioId,accountType:Gi(e.account)});try{this.logger.verbose("acquireTokenPopup called",t),Yi(this.initialized,r),this.browserStorage.setInteractionInProgress(!0)}catch(e){return Promise.reject(e)}const n=this.getAllAccounts();let o;if(n.length>0?this.eventHandler.emitEvent(Lo.B.ACQUIRE_TOKEN_START,Ir.Popup,e):this.eventHandler.emitEvent(Lo.B.LOGIN_START,Ir.Popup,e),this.canUseNative(e))o=this.acquireTokenNative({...e,correlationId:t},gr).then((e=>(this.browserStorage.setInteractionInProgress(!1),r.end({success:!0,isNativeBroker:!0,requestId:e.requestId,accountType:Gi(e.account)}),e))).catch((r=>{if(r instanceof fi&&yi(r)){this.nativeExtensionProvider=void 0;return this.createPopupClient(t).acquireToken(e)}if(r instanceof go.CB){this.logger.verbose("acquireTokenPopup - Resolving interaction required error thrown by native broker by falling back to web flow");return this.createPopupClient(t).acquireToken(e)}throw this.browserStorage.setInteractionInProgress(!1),r}));else{o=this.createPopupClient(t).acquireToken(e)}return o.then((e=>(n.length<this.getAllAccounts().length?this.eventHandler.emitEvent(Lo.B.LOGIN_SUCCESS,Ir.Popup,e):this.eventHandler.emitEvent(Lo.B.ACQUIRE_TOKEN_SUCCESS,Ir.Popup,e),r.end({success:!0,requestId:e.requestId,accessTokenSize:e.accessToken.length,idTokenSize:e.idToken.length,accountType:Gi(e.account)}),e))).catch((e=>(n.length>0?this.eventHandler.emitEvent(Lo.B.ACQUIRE_TOKEN_FAILURE,Ir.Popup,null,e):this.eventHandler.emitEvent(Lo.B.LOGIN_FAILURE,Ir.Popup,null,e),r.end({success:!1},e),Promise.reject(e))))}trackPageVisibilityWithMeasurement(){const e=this.ssoSilentMeasurement||this.acquireTokenByCodeAsyncMeasurement;e&&(this.logger.info("Perf: Visibility change detected in ",e.event.name),e.increment({visibilityChangeCount:1}))}async ssoSilent(e){const t=this.getRequestCorrelationId(e),r={...e,prompt:e.prompt,correlationId:t};let n;if(this.ssoSilentMeasurement=this.performanceClient.startMeasurement(Lt.SsoSilent,t),this.ssoSilentMeasurement?.add({scenarioId:e.scenarioId,accountType:Gi(e.account)}),Yi(this.initialized,this.ssoSilentMeasurement),this.ssoSilentMeasurement?.increment({visibilityChangeCount:0}),document.addEventListener("visibilitychange",this.trackPageVisibilityWithMeasurement),this.logger.verbose("ssoSilent called",t),this.eventHandler.emitEvent(Lo.B.SSO_SILENT_START,Ir.Silent,r),this.canUseNative(r))n=this.acquireTokenNative(r,pr).catch((e=>{if(e instanceof fi&&yi(e)){this.nativeExtensionProvider=void 0;return this.createSilentIframeClient(r.correlationId).acquireToken(r)}throw e}));else{n=this.createSilentIframeClient(r.correlationId).acquireToken(r)}return n.then((e=>(this.eventHandler.emitEvent(Lo.B.SSO_SILENT_SUCCESS,Ir.Silent,e),this.ssoSilentMeasurement?.end({success:!0,isNativeBroker:e.fromNativeBroker,requestId:e.requestId,accessTokenSize:e.accessToken.length,idTokenSize:e.idToken.length,accountType:Gi(e.account)}),e))).catch((e=>{throw this.eventHandler.emitEvent(Lo.B.SSO_SILENT_FAILURE,Ir.Silent,null,e),this.ssoSilentMeasurement?.end({success:!1},e),e})).finally((()=>{document.removeEventListener("visibilitychange",this.trackPageVisibilityWithMeasurement)}))}async acquireTokenByCode(e){const t=this.getRequestCorrelationId(e);this.logger.trace("acquireTokenByCode called",t);const r=this.performanceClient.startMeasurement(Lt.AcquireTokenByCode,t);Yi(this.initialized,r),this.eventHandler.emitEvent(Lo.B.ACQUIRE_TOKEN_BY_CODE_START,Ir.Silent,e),r.add({scenarioId:e.scenarioId});try{if(e.code&&e.nativeAccountId)throw _n(mn);if(e.code){const n=e.code;let o=this.hybridAuthCodeResponses.get(n);return o?(this.logger.verbose("Existing acquireTokenByCode request found",t),r.discard()):(this.logger.verbose("Initiating new acquireTokenByCode request",t),o=this.acquireTokenByCodeAsync({...e,correlationId:t}).then((e=>(this.eventHandler.emitEvent(Lo.B.ACQUIRE_TOKEN_BY_CODE_SUCCESS,Ir.Silent,e),this.hybridAuthCodeResponses.delete(n),r.end({success:!0,isNativeBroker:e.fromNativeBroker,requestId:e.requestId,accessTokenSize:e.accessToken.length,idTokenSize:e.idToken.length,accountType:Gi(e.account)}),e))).catch((e=>{throw this.hybridAuthCodeResponses.delete(n),this.eventHandler.emitEvent(Lo.B.ACQUIRE_TOKEN_BY_CODE_FAILURE,Ir.Silent,null,e),r.end({success:!1},e),e})),this.hybridAuthCodeResponses.set(n,o)),await o}if(e.nativeAccountId){if(this.canUseNative(e,e.nativeAccountId)){const n=await this.acquireTokenNative({...e,correlationId:t},Cr,e.nativeAccountId).catch((e=>{throw e instanceof fi&&yi(e)&&(this.nativeExtensionProvider=void 0),e}));return r.end({accountType:Gi(n.account),success:!0}),n}throw _n(fn)}throw _n(pn)}catch(e){throw this.eventHandler.emitEvent(Lo.B.ACQUIRE_TOKEN_BY_CODE_FAILURE,Ir.Silent,null,e),r.end({success:!1},e),e}}async acquireTokenByCodeAsync(e){this.logger.trace("acquireTokenByCodeAsync called",e.correlationId),this.acquireTokenByCodeAsyncMeasurement=this.performanceClient.startMeasurement(Lt.AcquireTokenByCodeAsync,e.correlationId),this.acquireTokenByCodeAsyncMeasurement?.increment({visibilityChangeCount:0}),document.addEventListener("visibilitychange",this.trackPageVisibilityWithMeasurement);const t=this.createSilentAuthCodeClient(e.correlationId);return await t.acquireToken(e).then((e=>(this.acquireTokenByCodeAsyncMeasurement?.end({success:!0,fromCache:e.fromCache,isNativeBroker:e.fromNativeBroker,requestId:e.requestId}),e))).catch((e=>{throw this.acquireTokenByCodeAsyncMeasurement?.end({success:!1},e),e})).finally((()=>{document.removeEventListener("visibilitychange",this.trackPageVisibilityWithMeasurement)}))}async acquireTokenFromCache(e,t){switch(this.performanceClient.addQueueMeasurement(Lt.AcquireTokenFromCache,e.correlationId),t){case Er:case kr:case Rr:const t=this.createSilentCacheClient(e.correlationId);return co(t.acquireToken.bind(t),Lt.SilentCacheClientAcquireToken,this.logger,this.performanceClient,e.correlationId)(e);default:throw re(K)}}async acquireTokenByRefreshToken(e,t){switch(this.performanceClient.addQueueMeasurement(Lt.AcquireTokenByRefreshToken,e.correlationId),t){case Er:case Rr:case Sr:case _r:const t=this.createSilentRefreshClient(e.correlationId);return co(t.acquireToken.bind(t),Lt.SilentRefreshClientAcquireToken,this.logger,this.performanceClient,e.correlationId)(e);default:throw re(K)}}async acquireTokenBySilentIframe(e){this.performanceClient.addQueueMeasurement(Lt.AcquireTokenBySilentIframe,e.correlationId);const t=this.createSilentIframeClient(e.correlationId);return co(t.acquireToken.bind(t),Lt.SilentIframeClientAcquireToken,this.logger,this.performanceClient,e.correlationId)(e)}async logout(e){const t=this.getRequestCorrelationId(e);return this.logger.warning("logout API is deprecated and will be removed in msal-browser v3.0.0. Use logoutRedirect instead.",t),this.logoutRedirect({correlationId:t,...e})}async logoutRedirect(e){const t=this.getRequestCorrelationId(e);No(this.initialized,this.config),this.browserStorage.setInteractionInProgress(!0);return this.createRedirectClient(t).logout(e)}logoutPopup(e){try{const t=this.getRequestCorrelationId(e);Po(this.initialized),this.browserStorage.setInteractionInProgress(!0);return this.createPopupClient(t).logout(e)}catch(e){return Promise.reject(e)}}async clearCache(e){if(!this.isBrowserEnvironment)return void this.logger.info("in non-browser environment, returning early.");const t=this.getRequestCorrelationId(e);return this.createSilentCacheClient(t).logout(e)}getAllAccounts(e){
/*! @azure/msal-browser v3.26.1 2024-10-08 */
return function(e,t,r,n){return e.verbose("getAllAccounts called"),r?t.getAllAccounts(n):[]}(this.logger,this.browserStorage,this.isBrowserEnvironment,e)}getAccount(e){return function(e,t,r){if(t.trace("getAccount called"),0===Object.keys(e).length)return t.warning("getAccount: No accountFilter provided"),null;const n=r.getAccountInfoFilteredBy(e);return n?(t.verbose("getAccount: Account matching provided filter found, returning"),n):(t.verbose("getAccount: No matching account found, returning null"),null)}(e,this.logger,this.browserStorage)}getAccountByUsername(e){return function(e,t,r){if(t.trace("getAccountByUsername called"),!e)return t.warning("getAccountByUsername: No username provided"),null;const n=r.getAccountInfoFilteredBy({username:e});return n?(t.verbose("getAccountByUsername: Account matching username found, returning"),t.verbosePii(`getAccountByUsername: Returning signed-in accounts matching username: ${e}`),n):(t.verbose("getAccountByUsername: No matching account found, returning null"),null)}(e,this.logger,this.browserStorage)}getAccountByHomeId(e){return function(e,t,r){if(t.trace("getAccountByHomeId called"),!e)return t.warning("getAccountByHomeId: No homeAccountId provided"),null;const n=r.getAccountInfoFilteredBy({homeAccountId:e});return n?(t.verbose("getAccountByHomeId: Account matching homeAccountId found, returning"),t.verbosePii(`getAccountByHomeId: Returning signed-in accounts matching homeAccountId: ${e}`),n):(t.verbose("getAccountByHomeId: No matching account found, returning null"),null)}(e,this.logger,this.browserStorage)}getAccountByLocalId(e){return function(e,t,r){if(t.trace("getAccountByLocalId called"),!e)return t.warning("getAccountByLocalId: No localAccountId provided"),null;const n=r.getAccountInfoFilteredBy({localAccountId:e});return n?(t.verbose("getAccountByLocalId: Account matching localAccountId found, returning"),t.verbosePii(`getAccountByLocalId: Returning signed-in accounts matching localAccountId: ${e}`),n):(t.verbose("getAccountByLocalId: No matching account found, returning null"),null)}(e,this.logger,this.browserStorage)}setActiveAccount(e){!function(e,t){t.setActiveAccount(e)}(e,this.browserStorage)}getActiveAccount(){return this.browserStorage.getActiveAccount()}async hydrateCache(e,t){this.logger.verbose("hydrateCache called");const r=lt.createFromAccountInfo(e.account,e.cloudGraphHostName,e.msGraphHost);return this.browserStorage.setAccount(r),e.fromNativeBroker?(this.logger.verbose("Response was from native broker, storing in-memory"),this.nativeInternalStorage.hydrateCache(e,t)):this.browserStorage.hydrateCache(e,t)}async acquireTokenNative(e,t,r){if(this.logger.trace("acquireTokenNative called"),!this.nativeExtensionProvider)throw _n(In);return new ki(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,t,this.performanceClient,this.nativeExtensionProvider,r||this.getNativeAccountId(e),this.nativeInternalStorage,e.correlationId).acquireToken(e)}canUseNative(e,t){if(this.logger.trace("canUseNative called"),!Ri.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 o._M.NONE:case o._M.CONSENT:case o._M.LOGIN:this.logger.trace("canUseNative: prompt is compatible with native flow");break;default:return this.logger.trace(`canUseNative: prompt = ${e.prompt} is not compatible with native flow, returning false`),!1}return!(!t&&!this.getNativeAccountId(e))||(this.logger.trace("canUseNative: nativeAccountId is not available, returning false"),!1)}getNativeAccountId(e){const t=e.account||this.getAccount({loginHint:e.loginHint,sid:e.sid})||this.getActiveAccount();return t&&t.nativeAccountId||""}createPopupClient(e){return new bi(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,this.performanceClient,this.nativeInternalStorage,this.nativeExtensionProvider,e)}createRedirectClient(e){return new Oi(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,this.performanceClient,this.nativeInternalStorage,this.nativeExtensionProvider,e)}createSilentIframeClient(e){return new Di(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,pr,this.performanceClient,this.nativeInternalStorage,this.nativeExtensionProvider,e)}createSilentCacheClient(e){return new Ai(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,this.performanceClient,this.nativeExtensionProvider,e)}createSilentRefreshClient(e){return new Bi(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,this.performanceClient,this.nativeExtensionProvider,e)}createSilentAuthCodeClient(e){return new Ki(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,Cr,this.performanceClient,this.nativeExtensionProvider,e)}addEventCallback(e,t){return this.eventHandler.addEventCallback(e,t)}removeEventCallback(e){this.eventHandler.removeEventCallback(e)}addPerformanceCallback(e){return Mo(),this.performanceClient.addPerformanceCallback(e)}removePerformanceCallback(e){return this.performanceClient.removePerformanceCallback(e)}enableAccountStorageEvents(){"undefined"!=typeof window&&(this.listeningToStorageEvents?this.logger.verbose("Account storage listener already registered."):(this.logger.verbose("Adding account storage listener."),this.listeningToStorageEvents=!0,window.addEventListener("storage",this.handleAccountCacheChange)))}disableAccountStorageEvents(){"undefined"!=typeof window&&(this.listeningToStorageEvents?(this.logger.verbose("Removing account storage listener."),window.removeEventListener("storage",this.handleAccountCacheChange),this.listeningToStorageEvents=!1):this.logger.verbose("No account storage listener registered."))}handleAccountCacheChange(e){try{e.key?.includes(o.Gd.ACTIVE_ACCOUNT_FILTERS)&&this.eventHandler.emitEvent(Lo.B.ACTIVE_ACCOUNT_CHANGED);const t=e.newValue||e.oldValue;if(!t)return;const r=JSON.parse(t);if("object"!=typeof r||!lt.isAccountEntity(r))return;const n=wt.toObject(new lt,r).getAccountInfo();!e.oldValue&&e.newValue?(this.logger.info("Account was added to cache in a different window"),this.eventHandler.emitEvent(Lo.B.ACCOUNT_ADDED,void 0,n)):!e.newValue&&e.oldValue&&(this.logger.info("Account was removed from cache in a different window"),this.eventHandler.emitEvent(Lo.B.ACCOUNT_REMOVED,void 0,n))}catch(e){return}}getTokenCache(){return this.tokenCache}getLogger(){return this.logger}setLogger(e){this.logger=e}initializeWrapperLibrary(e,t){this.browserStorage.setWrapperMetadata(e,t)}setNavigationClient(e){this.navigationClient=e}getConfiguration(){return this.config}getPerformanceClient(){return this.performanceClient}isBrowserEnv(){return this.isBrowserEnvironment}getRequestCorrelationId(e){return e?.correlationId?e.correlationId:this.isBrowserEnvironment?Zn():o.YM.EMPTY_STRING}async loginRedirect(e){const t=this.getRequestCorrelationId(e);return this.logger.verbose("loginRedirect called",t),this.acquireTokenRedirect({correlationId:t,...e||vr})}loginPopup(e){const t=this.getRequestCorrelationId(e);return this.logger.verbose("loginPopup called",t),this.acquireTokenPopup({correlationId:t,...e||vr})}async acquireTokenSilent(e){const t=this.getRequestCorrelationId(e),r=this.performanceClient.startMeasurement(Lt.AcquireTokenSilent,t);r.add({cacheLookupPolicy:e.cacheLookupPolicy,scenarioId:e.scenarioId}),Yi(this.initialized,r),this.logger.verbose("acquireTokenSilent called",t);const n=e.account||this.getActiveAccount();if(!n)throw _n(Jr);r.add({accountType:Gi(n)});const i={clientId:this.config.auth.clientId,authority:e.authority||o.YM.EMPTY_STRING,scopes:e.scopes,homeAccountIdentifier:n.homeAccountId,claims:e.claims,authenticationScheme:e.authenticationScheme,resourceRequestMethod:e.resourceRequestMethod,resourceRequestUri:e.resourceRequestUri,shrClaims:e.shrClaims,sshKid:e.sshKid,shrOptions:e.shrOptions},a=JSON.stringify(i),s=this.activeSilentTokenRequests.get(a);if(void 0===s){this.logger.verbose("acquireTokenSilent called for the first time, storing active request",t);const o=co(this.acquireTokenSilentAsync.bind(this),Lt.AcquireTokenSilentAsync,this.logger,this.performanceClient,t)({...e,correlationId:t},n).then((t=>(this.activeSilentTokenRequests.delete(a),r.end({success:!0,fromCache:t.fromCache,isNativeBroker:t.fromNativeBroker,cacheLookupPolicy:e.cacheLookupPolicy,requestId:t.requestId,accessTokenSize:t.accessToken.length,idTokenSize:t.idToken.length}),t))).catch((e=>{throw this.activeSilentTokenRequests.delete(a),r.end({success:!1},e),e}));return this.activeSilentTokenRequests.set(a,o),{...await o,state:e.state}}return this.logger.verbose("acquireTokenSilent has been called previously, returning the result from the first call",t),r.discard(),{...await s,state:e.state}}async acquireTokenSilentAsync(e,t){const r=()=>this.trackPageVisibility(e.correlationId);this.performanceClient.addQueueMeasurement(Lt.AcquireTokenSilentAsync,e.correlationId),this.eventHandler.emitEvent(Lo.B.ACQUIRE_TOKEN_START,Ir.Silent,e),e.correlationId&&this.performanceClient.incrementFields({visibilityChangeCount:0},e.correlationId),document.addEventListener("visibilitychange",r);const n=await co(ui,Lt.InitializeSilentRequest,this.logger,this.performanceClient,e.correlationId)(e,t,this.config,this.performanceClient,this.logger),o=e.cacheLookupPolicy||Er;return this.acquireTokenSilentNoIframe(n,o).catch((async e=>{const t=function(e,t){const r=!(e instanceof go.CB&&e.subError!==po.j9),n=e.errorCode===Bt.INVALID_GRANT_ERROR||e.errorCode===K,o=r&&n||e.errorCode===po.oF||e.errorCode===po.AG,i=Mr.includes(t);return o&&i}(e,o);if(t){if(this.activeIframeRequest){if(o!==br){const[t,r]=this.activeIframeRequest;this.logger.verbose(`Iframe request is already in progress, awaiting resolution for request with correlationId: ${r}`,n.correlationId);const i=this.performanceClient.startMeasurement(Lt.AwaitConcurrentIframe,n.correlationId);i.add({awaitIframeCorrelationId:r});const a=await t;if(i.end({success:a}),a)return this.logger.verbose(`Parallel iframe request with correlationId: ${r} succeeded. Retrying cache and/or RT redemption`,n.correlationId),this.acquireTokenSilentNoIframe(n,o);throw this.logger.info(`Iframe request with correlationId: ${r} failed. Interaction is required.`),e}return this.logger.warning("Another iframe request is currently in progress and CacheLookupPolicy is set to Skip. This may result in degraded performance and/or reliability for both calls. Please consider changing the CacheLookupPolicy to take advantage of request queuing and token cache.",n.correlationId),co(this.acquireTokenBySilentIframe.bind(this),Lt.AcquireTokenBySilentIframe,this.logger,this.performanceClient,n.correlationId)(n)}{let e;return this.activeIframeRequest=[new Promise((t=>{e=t})),n.correlationId],this.logger.verbose("Refresh token expired/invalid or CacheLookupPolicy is set to Skip, attempting acquire token by iframe.",n.correlationId),co(this.acquireTokenBySilentIframe.bind(this),Lt.AcquireTokenBySilentIframe,this.logger,this.performanceClient,n.correlationId)(n).then((t=>(e(!0),t))).catch((t=>{throw e(!1),t})).finally((()=>{this.activeIframeRequest=void 0}))}}throw e})).then((t=>(this.eventHandler.emitEvent(Lo.B.ACQUIRE_TOKEN_SUCCESS,Ir.Silent,t),e.correlationId&&this.performanceClient.addFields({fromCache:t.fromCache,isNativeBroker:t.fromNativeBroker,requestId:t.requestId},e.correlationId),t))).catch((e=>{throw this.eventHandler.emitEvent(Lo.B.ACQUIRE_TOKEN_FAILURE,Ir.Silent,null,e),e})).finally((()=>{document.removeEventListener("visibilitychange",r)}))}async acquireTokenSilentNoIframe(e,t){return Ri.isNativeAvailable(this.config,this.logger,this.nativeExtensionProvider,e.authenticationScheme)&&e.account.nativeAccountId?(this.logger.verbose("acquireTokenSilent - attempting to acquire token from native platform"),this.acquireTokenNative(e,fr).catch((async e=>{if(e instanceof fi&&yi(e))throw this.logger.verbose("acquireTokenSilent - native platform unavailable, falling back to web flow"),this.nativeExtensionProvider=void 0,re(K);throw e}))):(this.logger.verbose("acquireTokenSilent - attempting to acquire token from web flow"),co(this.acquireTokenFromCache.bind(this),Lt.AcquireTokenFromCache,this.logger,this.performanceClient,e.correlationId)(e,t).catch((r=>{if(t===kr)throw r;return this.eventHandler.emitEvent(Lo.B.ACQUIRE_TOKEN_NETWORK_START,Ir.Silent,e),co(this.acquireTokenByRefreshToken.bind(this),Lt.AcquireTokenByRefreshToken,this.logger,this.performanceClient,e.correlationId)(e,t)})))}}
/*! @azure/msal-browser v3.26.1 2024-10-08 */
class $i{static async createPublicClientApplication(e){const t=
/*! @azure/msal-browser v3.26.1 2024-10-08 */await async function(e,t){const r=new Nn(e);return await r.initialize(),zi.createController(r,t)}(e);return new $i(e,t)}constructor(e,t){this.controller=t||new zi(new Nn(e))}async initialize(e){return this.controller.initialize(e)}async acquireTokenPopup(e){return this.controller.acquireTokenPopup(e)}acquireTokenRedirect(e){return this.controller.acquireTokenRedirect(e)}acquireTokenSilent(e){return this.controller.acquireTokenSilent(e)}acquireTokenByCode(e){return this.controller.acquireTokenByCode(e)}addEventCallback(e,t){return this.controller.addEventCallback(e,t)}removeEventCallback(e){return this.controller.removeEventCallback(e)}addPerformanceCallback(e){return this.controller.addPerformanceCallback(e)}removePerformanceCallback(e){return this.controller.removePerformanceCallback(e)}enableAccountStorageEvents(){this.controller.enableAccountStorageEvents()}disableAccountStorageEvents(){this.controller.disableAccountStorageEvents()}getAccount(e){return this.controller.getAccount(e)}getAccountByHomeId(e){return this.controller.getAccountByHomeId(e)}getAccountByLocalId(e){return this.controller.getAccountByLocalId(e)}getAccountByUsername(e){return this.controller.getAccountByUsername(e)}getAllAccounts(e){return this.controller.getAllAccounts(e)}handleRedirectPromise(e){return this.controller.handleRedirectPromise(e)}loginPopup(e){return this.controller.loginPopup(e)}loginRedirect(e){return this.controller.loginRedirect(e)}logout(e){return this.controller.logout(e)}logoutRedirect(e){return this.controller.logoutRedirect(e)}logoutPopup(e){return this.controller.logoutPopup(e)}ssoSilent(e){return this.controller.ssoSilent(e)}getTokenCache(){return this.controller.getTokenCache()}getLogger(){return this.controller.getLogger()}setLogger(e){this.controller.setLogger(e)}setActiveAccount(e){this.controller.setActiveAccount(e)}getActiveAccount(){return this.controller.getActiveAccount()}initializeWrapperLibrary(e,t){return this.controller.initializeWrapperLibrary(e,t)}setNavigationClient(e){this.controller.setNavigationClient(e)}getConfiguration(){return this.controller.getConfiguration()}async hydrateCache(e,t){return this.controller.hydrateCache(e,t)}clearCache(e){return this.controller.clearCache(e)}}},29701:(e,t,r)=>{r.d(t,{B:()=>n});
/*! @azure/msal-browser v3.26.1 2024-10-08 */
const n={INITIALIZE_START:"msal:initializeStart",INITIALIZE_END:"msal:initializeEnd",ACCOUNT_ADDED:"msal:accountAdded",ACCOUNT_REMOVED:"msal:accountRemoved",ACTIVE_ACCOUNT_CHANGED:"msal:activeAccountChanged",LOGIN_START:"msal:loginStart",LOGIN_SUCCESS:"msal:loginSuccess",LOGIN_FAILURE:"msal:loginFailure",ACQUIRE_TOKEN_START:"msal:acquireTokenStart",ACQUIRE_TOKEN_SUCCESS:"msal:acquireTokenSuccess",ACQUIRE_TOKEN_FAILURE:"msal:acquireTokenFailure",ACQUIRE_TOKEN_NETWORK_START:"msal:acquireTokenFromNetworkStart",SSO_SILENT_START:"msal:ssoSilentStart",SSO_SILENT_SUCCESS:"msal:ssoSilentSuccess",SSO_SILENT_FAILURE:"msal:ssoSilentFailure",ACQUIRE_TOKEN_BY_CODE_START:"msal:acquireTokenByCodeStart",ACQUIRE_TOKEN_BY_CODE_SUCCESS:"msal:acquireTokenByCodeSuccess",ACQUIRE_TOKEN_BY_CODE_FAILURE:"msal:acquireTokenByCodeFailure",HANDLE_REDIRECT_START:"msal:handleRedirectStart",HANDLE_REDIRECT_END:"msal:handleRedirectEnd",POPUP_OPENED:"msal:popupOpened",LOGOUT_START:"msal:logoutStart",LOGOUT_SUCCESS:"msal:logoutSuccess",LOGOUT_FAILURE:"msal:logoutFailure",LOGOUT_END:"msal:logoutEnd",RESTORE_FROM_BFCACHE:"msal:restoreFromBFCache"}},32041:(e,t,r)=>{r.d(t,{lR:()=>a,pz:()=>s});var n=r(18087),o=r(56297);
/*! @azure/msal-common v14.15.0 2024-09-20 */
const i={[o.W]:"Unexpected error in authentication.",[o.z]:"Post request failed from the network, could be a 4xx/5xx or a network unavailability. Please check the exact error code for details."};o.W,i[o.W],o.z,i[o.z];class a extends Error{constructor(e,t,r){super(t?`${e}: ${t}`:e),Object.setPrototypeOf(this,a.prototype),this.errorCode=e||n.YM.EMPTY_STRING,this.errorMessage=t||n.YM.EMPTY_STRING,this.subError=r||n.YM.EMPTY_STRING,this.name="AuthError"}setCorrelationId(e){this.correlationId=e}}function s(e,t){return new a(e,t?`${i[e]} ${t}`:i[e])}},56297:(e,t,r)=>{r.d(t,{W:()=>n,z:()=>o});
/*! @azure/msal-common v14.15.0 2024-09-20 */
const n="unexpected_error",o="post_request_failed"},48686:(e,t,r)=>{r.d(t,{CB:()=>h,IE:()=>d,a:()=>l});var n=r(18087),o=r(32041),i=r(7936);
/*! @azure/msal-common v14.15.0 2024-09-20 */
const a=[i.mP,i.CY,i.Zv,i.j9],s=["message_only","additional_action","basic_action","user_password_expired","consent_required","bad_token"],c={[i.oF]:"No refresh token found in the cache. Please sign-in.",[i.B]:"The requested account is not available in the native broker. It may have been deleted or logged out. Please sign-in again using an interactive API.",[i.AG]:"Refresh token has expired.",[i.j9]:"Identity provider returned bad_token due to an expired or invalid refresh token. Please invoke an interactive API to resolve."};i.oF,c[i.oF],i.B,c[i.B],i.j9,c[i.j9];class h extends o.lR{constructor(e,t,r,o,i,a,s,c){super(e,t,r),Object.setPrototypeOf(this,h.prototype),this.timestamp=o||n.YM.EMPTY_STRING,this.traceId=i||n.YM.EMPTY_STRING,this.correlationId=a||n.YM.EMPTY_STRING,this.claims=s||n.YM.EMPTY_STRING,this.name="InteractionRequiredAuthError",this.errorNo=c}}function l(e,t,r){const n=!!e&&a.indexOf(e)>-1,o=!!r&&s.indexOf(r)>-1,i=!!t&&a.some((e=>t.indexOf(e)>-1));return n||i||o}function d(e){return new h(e,c[e])}},7936:(e,t,r)=>{r.d(t,{AG:()=>i,B:()=>o,CY:()=>s,Zv:()=>c,j9:()=>h,mP:()=>a,oF:()=>n});
/*! @azure/msal-common v14.15.0 2024-09-20 */
const n="no_tokens_found",o="native_account_unavailable",i="refresh_token_expired",a="interaction_required",s="consent_required",c="login_required",h="bad_token"},18087:(e,t,r)=>{r.d(t,{$x:()=>m,E_:()=>w,F0:()=>q,Fq:()=>l,GU:()=>T,Gd:()=>c,I:()=>S,IO:()=>k,JR:()=>I,Kk:()=>b,LR:()=>f,Lz:()=>N,OK:()=>s,Qd:()=>C,Rv:()=>P,Tq:()=>_,Xw:()=>R,YM:()=>n,_2:()=>O,_A:()=>a,_M:()=>d,aG:()=>y,aZ:()=>i,gT:()=>E,hB:()=>v,iF:()=>u,jZ:()=>M,p:()=>p,t3:()=>o,u0:()=>A,v2:()=>h,zL:()=>g});
/*! @azure/msal-common v14.15.0 2024-09-20 */
const n={LIBRARY_NAME:"MSAL.JS",SKU:"msal.js.common",CACHE_PREFIX:"msal",DEFAULT_AUTHORITY:"https://login.microsoftonline.com/common/",DEFAULT_AUTHORITY_HOST:"login.microsoftonline.com",DEFAULT_COMMON_TENANT:"common",ADFS:"adfs",DSTS:"dstsv2",AAD_INSTANCE_DISCOVERY_ENDPT:"https://login.microsoftonline.com/common/discovery/instance?api-version=1.1&authorization_endpoint=",CIAM_AUTH_URL:".ciamlogin.com",AAD_TENANT_DOMAIN_SUFFIX:".onmicrosoft.com",RESOURCE_DELIM:"|",NO_ACCOUNT:"NO_ACCOUNT",CLAIMS:"claims",CONSUMER_UTID:"9188040d-6c67-4c5b-b112-36a304b66dad",OPENID_SCOPE:"openid",PROFILE_SCOPE:"profile",OFFLINE_ACCESS_SCOPE:"offline_access",EMAIL_SCOPE:"email",CODE_RESPONSE_TYPE:"code",CODE_GRANT_TYPE:"authorization_code",RT_GRANT_TYPE:"refresh_token",FRAGMENT_RESPONSE_MODE:"fragment",S256_CODE_CHALLENGE_METHOD:"S256",URL_FORM_CONTENT_TYPE:"application/x-www-form-urlencoded;charset=utf-8",AUTHORIZATION_PENDING:"authorization_pending",NOT_DEFINED:"not_defined",EMPTY_STRING:"",NOT_APPLICABLE:"N/A",NOT_AVAILABLE:"Not Available",FORWARD_SLASH:"/",IMDS_ENDPOINT:"http://169.254.169.254/metadata/instance/compute/location",IMDS_VERSION:"2020-06-01",IMDS_TIMEOUT:2e3,AZURE_REGION_AUTO_DISCOVER_FLAG:"TryAutoDetect",REGIONAL_AUTH_PUBLIC_CLOUD_SUFFIX:"login.microsoft.com",KNOWN_PUBLIC_CLOUDS:["login.microsoftonline.com","login.windows.net","login.microsoft.com","sts.windows.net"],TOKEN_RESPONSE_TYPE:"token",ID_TOKEN_RESPONSE_TYPE:"id_token",SHR_NONCE_VALIDITY:240,INVALID_INSTANCE:"invalid_instance"},o={SUCCESS:200,SUCCESS_RANGE_START:200,SUCCESS_RANGE_END:299,REDIRECT:302,CLIENT_ERROR:400,CLIENT_ERROR_RANGE_START:400,BAD_REQUEST:400,UNAUTHORIZED:401,NOT_FOUND:404,REQUEST_TIMEOUT:408,TOO_MANY_REQUESTS:429,CLIENT_ERROR_RANGE_END:499,SERVER_ERROR:500,SERVER_ERROR_RANGE_START:500,SERVICE_UNAVAILABLE:503,GATEWAY_TIMEOUT:504,SERVER_ERROR_RANGE_END:599,MULTI_SIDED_ERROR:600},i=[n.OPENID_SCOPE,n.PROFILE_SCOPE,n.OFFLINE_ACCESS_SCOPE],a=[...i,n.EMAIL_SCOPE],s={CONTENT_TYPE:"Content-Type",RETRY_AFTER:"Retry-After",CCS_HEADER:"X-AnchorMailbox",WWWAuthenticate:"WWW-Authenticate",AuthenticationInfo:"Authentication-Info",X_MS_REQUEST_ID:"x-ms-request-id",X_MS_HTTP_VERSION:"x-ms-httpver"},c={ID_TOKEN:"idtoken",CLIENT_INFO:"client.info",ADAL_ID_TOKEN:"adal.idtoken",ERROR:"error",ERROR_DESC:"error.description",ACTIVE_ACCOUNT:"active-account",ACTIVE_ACCOUNT_FILTERS:"active-account-filters"},h={COMMON:"common",ORGANIZATIONS:"organizations",CONSUMERS:"consumers"},l={ACCESS_TOKEN:"access_token",XMS_CC:"xms_cc"},d={LOGIN:"login",SELECT_ACCOUNT:"select_account",CONSENT:"consent",NONE:"none",CREATE:"create",NO_SESSION:"no_session"},u={PLAIN:"plain",S256:"S256"},g={QUERY:"query",FRAGMENT:"fragment"},p={...g,FORM_POST:"form_post"},m={IMPLICIT_GRANT:"implicit",AUTHORIZATION_CODE_GRANT:"authorization_code",CLIENT_CREDENTIALS_GRANT:"client_credentials",RESOURCE_OWNER_PASSWORD_GRANT:"password",REFRESH_TOKEN_GRANT:"refresh_token",DEVICE_CODE_GRANT:"device_code",JWT_BEARER:"urn:ietf:params:oauth:grant-type:jwt-bearer"},C={MSSTS_ACCOUNT_TYPE:"MSSTS",ADFS_ACCOUNT_TYPE:"ADFS",MSAV1_ACCOUNT_TYPE:"MSA",GENERIC_ACCOUNT_TYPE:"Generic"},f={CACHE_KEY_SEPARATOR:"-",CLIENT_INFO_SEPARATOR:"."},y={ID_TOKEN:"IdToken",ACCESS_TOKEN:"AccessToken",ACCESS_TOKEN_WITH_AUTH_SCHEME:"AccessToken_With_AuthScheme",REFRESH_TOKEN:"RefreshToken"},T="appmetadata",I="client_info",v="1",A={CACHE_KEY:"authority-metadata",REFRESH_TIME_SECONDS:86400},w={CONFIG:"config",CACHE:"cache",NETWORK:"network",HARDCODED_VALUES:"hardcoded_values"},E={SCHEMA_VERSION:5,MAX_CUR_HEADER_BYTES:80,MAX_LAST_HEADER_BYTES:330,MAX_CACHED_ERRORS:50,CACHE_KEY:"server-telemetry",CATEGORY_SEPARATOR:"|",VALUE_SEPARATOR:",",OVERFLOW_TRUE:"1",OVERFLOW_FALSE:"0",UNKNOWN_ERROR:"unknown_error"},k={BEARER:"Bearer",POP:"pop",SSH:"ssh-cert"},R={DEFAULT_THROTTLE_TIME_SECONDS:60,DEFAULT_MAX_THROTTLE_TIME_SECONDS:3600,THROTTLING_PREFIX:"throttling",X_MS_LIB_CAPABILITY_VALUE:"retry-after, h429"},S={INVALID_GRANT_ERROR:"invalid_grant",CLIENT_MISMATCH_ERROR:"client_mismatch"},_={username:"username",password:"password"},b={httpSuccess:200,httpBadRequest:400},M={FAILED_AUTO_DETECTION:"1",INTERNAL_CACHE:"2",ENVIRONMENT_VARIABLE:"3",IMDS:"4"},O={CONFIGURED_MATCHES_DETECTED:"1",CONFIGURED_NO_AUTO_DETECTION:"2",CONFIGURED_NOT_DETECTED:"3",AUTO_DETECTION_REQUESTED_SUCCESSFUL:"4",AUTO_DETECTION_REQUESTED_FAILED:"5"},P={NOT_APPLICABLE:"0",FORCE_REFRESH_OR_CLAIMS:"1",NO_CACHED_ACCESS_TOKEN:"2",CACHED_ACCESS_TOKEN_EXPIRED:"3",PROACTIVELY_REFRESHED:"4"},N={Jwt:"JWT",Jwk:"JWK",Pop:"pop"},q=300}}]);