"use strict";(function(n,t){typeof exports=="object"&&typeof module=="object"?module.exports=t():typeof define=="function"&&define.amd?define("Msal",[],t):typeof exports=="object"?exports.Msal=t():n.Msal=t()})(self,function(){return function(){function n(i){var f=t[i],u;return f!==undefined?f.exports:(u=t[i]={exports:{}},r[i](u,u.exports,n),u.exports)}var r={795:function(n,t){function e(n,t){function i(){this.constructor=n}r(n,t);n.prototype=t===null?Object.create(t):(i.prototype=t.prototype,new i)}function o(n,t){var u={},r;for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&t.indexOf(i)<0&&(u[i]=n[i]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(r=0,i=Object.getOwnPropertySymbols(n);r<i.length;r++)t.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(n,i[r])&&(u[i[r]]=n[i[r]]);return u}function s(n,t,i,r){var f=arguments.length,u=f<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,i):r,e,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")u=Reflect.decorate(n,t,i,r);else for(o=n.length-1;o>=0;o--)(e=n[o])&&(u=(f<3?e(u):f>3?e(t,i,u):e(t,i))||u);return f>3&&u&&Object.defineProperty(t,i,u),u}function h(n,t){return function(i,r){t(i,r,n)}}function c(n,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(n,t)}function l(n,t,i,r){function u(n){return n instanceof i?n:new i(function(t){t(n)})}return new(i||(i=Promise))(function(i,f){function o(n){try{e(r.next(n))}catch(t){f(t)}}function s(n){try{e(r["throw"](n))}catch(t){f(t)}}function e(n){n.done?i(n.value):u(n.value).then(o,s)}e((r=r.apply(n,t||[])).next())})}function a(n,t){function o(n){return function(t){return s([n,t])}}function s(e){if(f)throw new TypeError("Generator is already executing.");while(r)try{if(f=1,u&&(i=e[0]&2?u["return"]:e[0]?u["throw"]||((i=u["return"])&&i.call(u),0):u.next)&&!(i=i.call(u,e[1])).done)return i;(u=0,i)&&(e=[e[0]&2,i.value]);switch(e[0]){case 0:case 1:i=e;break;case 4:return r.label++,{value:e[1],done:!1};case 5:r.label++;u=e[1];e=[0];continue;case 7:e=r.ops.pop();r.trys.pop();continue;default:if(!(i=r.trys,i=i.length>0&&i[i.length-1])&&(e[0]===6||e[0]===2)){r=0;continue}if(e[0]===3&&(!i||e[1]>i[0]&&e[1]<i[3])){r.label=e[1];break}if(e[0]===6&&r.label<i[1]){r.label=i[1];i=e;break}if(i&&r.label<i[2]){r.label=i[2];r.ops.push(e);break}i[2]&&r.ops.pop();r.trys.pop();continue}e=t.call(n,r)}catch(o){e=[6,o];u=0}finally{f=i=0}if(e[0]&5)throw e[1];return{value:e[0]?e[1]:void 0,done:!0}}var r={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},f,u,i,e;return e={next:o(0),"throw":o(1),"return":o(2)},typeof Symbol=="function"&&(e[Symbol.iterator]=function(){return this}),e}function v(n,t,i,r){r===undefined&&(r=i);n[r]=t[i]}function y(n,t){for(var i in n)i==="default"||t.hasOwnProperty(i)||(t[i]=n[i])}function u(n){var t=typeof Symbol=="function"&&Symbol.iterator,i=t&&n[t],r=0;if(i)return i.call(n);if(n&&typeof n.length=="number")return{next:function(){return n&&r>=n.length&&(n=void 0),{value:n&&n[r++],done:!n}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.");}function f(n,t){var i=typeof Symbol=="function"&&n[Symbol.iterator],r,u,f,e;if(!i)return n;r=i.call(n);f=[];try{while((t===void 0||t-->0)&&!(u=r.next()).done)f.push(u.value)}catch(o){e={error:o}}finally{try{u&&!u.done&&(i=r["return"])&&i.call(r)}finally{if(e)throw e.error;}}return f}function p(){for(var n=[],t=0;t<arguments.length;t++)n=n.concat(f(arguments[t]));return n}function w(){for(var i=0,n=0,r=arguments.length;n<r;n++)i+=arguments[n].length;for(var u=Array(i),f=0,n=0;n<r;n++)for(var e=arguments[n],t=0,o=e.length;t<o;t++,f++)u[f]=e[t];return u}function i(n){return this instanceof i?(this.v=n,this):new i(n)}function b(n,t,r){function o(n){s[n]&&(f[n]=function(t){return new Promise(function(i,r){u.push([n,t,i,r])>1||e(n,t)})})}function e(n,t){try{c(s[n](t))}catch(i){h(u[0][3],i)}}function c(n){n.value instanceof i?Promise.resolve(n.value.v).then(l,a):h(u[0][2],n)}function l(n){e("next",n)}function a(n){e("throw",n)}function h(n,t){(n(t),u.shift(),u.length)&&e(u[0][0],u[0][1])}if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var s=r.apply(n,t||[]),f,u=[];return f={},o("next"),o("throw"),o("return"),f[Symbol.asyncIterator]=function(){return this},f}function k(n){function r(r,f){t[r]=n[r]?function(t){return(u=!u)?{value:i(n[r](t)),done:r==="return"}:f?f(t):t}:f}var t,u;return t={},r("next"),r("throw",function(n){throw n;}),r("return"),t[Symbol.iterator]=function(){return this},t}function d(n){function i(i){t[i]=n[i]&&function(t){return new Promise(function(r,u){t=n[i](t);f(r,u,t.done,t.value)})}}function f(n,t,i,r){Promise.resolve(r).then(function(t){n({value:t,done:i})},t)}if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r=n[Symbol.asyncIterator],t;return r?r.call(n):(n=typeof u=="function"?u(n):n[Symbol.iterator](),t={},i("next"),i("throw"),i("return"),t[Symbol.asyncIterator]=function(){return this},t)}function g(n,t){return Object.defineProperty?Object.defineProperty(n,"raw",{value:t}):n.raw=t,n}function nt(n){var t,i;if(n&&n.__esModule)return n;if(t={},n!=null)for(i in n)Object.hasOwnProperty.call(n,i)&&(t[i]=n[i]);return t.default=n,t}function tt(n){return n&&n.__esModule?n:{"default":n}}function it(n,t){if(!t.has(n))throw new TypeError("attempted to get private field on non-instance");return t.get(n)}function rt(n,t,i){if(!t.has(n))throw new TypeError("attempted to set private field on non-instance");return t.set(n,i),i}Object.defineProperty(t,"__esModule",{value:!0});t.__classPrivateFieldSet=t.__classPrivateFieldGet=t.__importDefault=t.__importStar=t.__makeTemplateObject=t.__asyncValues=t.__asyncDelegator=t.__asyncGenerator=t.__await=t.__spreadArrays=t.__spread=t.__read=t.__values=t.__exportStar=t.__createBinding=t.__generator=t.__awaiter=t.__metadata=t.__param=t.__decorate=t.__rest=t.__assign=t.__extends=void 0;var r=function(n,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,t){n.__proto__=t}||function(n,t){for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i])},r(n,t)};t.__extends=e;t.__assign=function(){return t.__assign=Object.assign||function(n){for(var t,r,i=1,u=arguments.length;i<u;i++){t=arguments[i];for(r in t)Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r])}return n},t.__assign.apply(this,arguments)};t.__rest=o;t.__decorate=s;t.__param=h;t.__metadata=c;t.__awaiter=l;t.__generator=a;t.__createBinding=v;t.__exportStar=y;t.__values=u;t.__read=f;t.__spread=p;t.__spreadArrays=w;t.__await=i;t.__asyncGenerator=b;t.__asyncDelegator=k;t.__asyncValues=d;t.__makeTemplateObject=g;t.__importStar=nt;t.__importDefault=tt;t.__classPrivateFieldGet=it;t.__classPrivateFieldSet=rt},630:function(n,t,i){Object.defineProperty(t,"__esModule",{value:!0});t.Account=void 0;var r=i(453),u=i(454),f=function(){function n(n,t,i,r,u,f,e){this.accountIdentifier=n;this.homeAccountIdentifier=t;this.userName=i;this.name=r;this.idToken=u;this.idTokenClaims=u;this.sid=f;this.environment=e}return n.createAccount=function(t,i){var s=t.objectId||t.subject,f=i?i.uid:"",e=i?i.utid:"",o;return u.StringUtils.isEmpty(f)||(o=u.StringUtils.isEmpty(e)?r.CryptoUtils.base64Encode(f):r.CryptoUtils.base64Encode(f)+"."+r.CryptoUtils.base64Encode(e)),new n(s,o,t.preferredName,t.name,t.claims,t.sid,t.issuer)},n.compareAccounts=function(n,t){return!n||!t?!1:n.homeAccountIdentifier&&t.homeAccountIdentifier&&n.homeAccountIdentifier===t.homeAccountIdentifier?!0:!1},n}();t.Account=f},681:function(n,t){function i(n){return{uniqueId:"",tenantId:"",tokenType:"",idToken:null,idTokenClaims:null,accessToken:"",scopes:null,expiresOn:null,account:null,accountState:n,fromCache:!1}}Object.defineProperty(t,"__esModule",{value:!0});t.buildResponseStateOnly=void 0;t.buildResponseStateOnly=i},733:function(n,t,i){function u(n){if(n.claimsRequest)try{JSON.parse(n.claimsRequest)}catch(t){throw r.ClientConfigurationError.createClaimsRequestParsingError(t);}}Object.defineProperty(t,"__esModule",{value:!0});t.validateClaimsRequest=void 0;var r=i(550);t.validateClaimsRequest=u},271:function(n,t,i){Object.defineProperty(t,"__esModule",{value:!0});t.ClientInfo=void 0;var r=i(453),f=i(356),u=i(454),e=function(){function n(t,i){if(!t||u.StringUtils.isEmpty(t)){this.uid="";this.utid="";return}try{var o=r.CryptoUtils.base64Decode(t),e=JSON.parse(o);e&&(e.hasOwnProperty("uid")&&(this.uid=i?n.stripPolicyFromUid(e.uid,i):e.uid),e.hasOwnProperty("utid")&&(this.utid=e.utid))}catch(s){throw f.ClientAuthError.createClientInfoDecodingError(s);}}return Object.defineProperty(n.prototype,"uid",{get:function(){return this._uid?this._uid:""},set:function(n){this._uid=n},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"utid",{get:function(){return this._utid?this._utid:""},set:function(n){this._utid=n},enumerable:!1,configurable:!0}),n.createClientInfoFromIdToken=function(t,i){var u={uid:t.subject,utid:""};return new n(r.CryptoUtils.base64Encode(JSON.stringify(u)),i)},n.stripPolicyFromUid=function(n,t){var i=n.split("-"),r=t.split("/").reverse(),f="";return(u.StringUtils.isEmpty(r[0])?r.length>1&&(f=r[1]):f=r[0],i[i.length-1]===f)?i.slice(0,i.length-1).join("-"):n},n.prototype.encodeClientInfo=function(){var n=JSON.stringify({uid:this.uid,utid:this.utid});return r.CryptoUtils.base64Encode(n)},n}();t.ClientInfo=e},875:function(n,t,i){function c(n){var f=n.auth,t=n.cache,c=t===void 0?{}:t,i=n.system,l=i===void 0?{}:i,u=n.framework,a=u===void 0?{}:u;return{auth:r.__assign(r.__assign({},e),f),cache:r.__assign(r.__assign({},o),c),system:r.__assign(r.__assign({},s),l),framework:r.__assign(r.__assign({},h),a)}}Object.defineProperty(t,"__esModule",{value:!0});t.buildConfiguration=void 0;var r=i(795),f=i(89),u=i(741),e={clientId:"",authority:null,validateAuthority:!0,authorityMetadata:"",knownAuthorities:[],redirectUri:function(){return u.UrlUtils.getCurrentUrl()},postLogoutRedirectUri:function(){return u.UrlUtils.getCurrentUrl()},navigateToLoginRequestUrl:!0},o={cacheLocation:"sessionStorage",storeAuthStateInCookie:!1},s={logger:new f.Logger(null),loadFrameTimeout:6e3,tokenRenewalOffsetSeconds:300,navigateFrameWait:500},h={isAngular:!1,unprotectedResources:[],protectedResourceMap:new Map};t.buildConfiguration=c},881:function(n,t,i){Object.defineProperty(t,"__esModule",{value:!0});t.IdToken=void 0;var r=i(356),u=i(94),f=i(454),e=function(){function n(n){if(f.StringUtils.isEmpty(n))throw r.ClientAuthError.createIdTokenNullOrEmptyError(n);try{this.rawIdToken=n;this.claims=u.TokenUtils.extractIdToken(n);this.claims&&(this.claims.hasOwnProperty("iss")&&(this.issuer=this.claims.iss),this.claims.hasOwnProperty("oid")&&(this.objectId=this.claims.oid),this.claims.hasOwnProperty("sub")&&(this.subject=this.claims.sub),this.claims.hasOwnProperty("tid")&&(this.tenantId=this.claims.tid),this.claims.hasOwnProperty("ver")&&(this.version=this.claims.ver),this.claims.hasOwnProperty("preferred_username")?this.preferredName=this.claims.preferred_username:this.claims.hasOwnProperty("upn")&&(this.preferredName=this.claims.upn),this.claims.hasOwnProperty("name")&&(this.name=this.claims.name),this.claims.hasOwnProperty("nonce")&&(this.nonce=this.claims.nonce),this.claims.hasOwnProperty("exp")&&(this.expiration=this.claims.exp),this.claims.hasOwnProperty("home_oid")&&(this.homeObjectId=this.claims.home_oid),this.claims.hasOwnProperty("sid")&&(this.sid=this.claims.sid),this.claims.hasOwnProperty("cloud_instance_host_name")&&(this.cloudInstance=this.claims.cloud_instance_host_name))}catch(t){throw r.ClientAuthError.createIdTokenParsingError(t);}}return n}();t.IdToken=e},89:function(n,t,i){var f,u,r,e;Object.defineProperty(t,"__esModule",{value:!0});t.Logger=t.LogLevel=void 0;f=i(454);u=i(700),function(n){n[n.Error=0]="Error";n[n.Warning=1]="Warning";n[n.Info=2]="Info";n[n.Verbose=3]="Verbose"}(r=t.LogLevel||(t.LogLevel={}));e=function(){function n(n,t){t===void 0&&(t={});this.level=r.Info;var i=t.correlationId,e=i===void 0?"":i,u=t.level,o=u===void 0?r.Info:u,f=t.piiLoggingEnabled,s=f===void 0?!1:f;this.localCallback=n;this.correlationId=e;this.level=o;this.piiLoggingEnabled=s}return n.prototype.logMessage=function(n,t,i){if(!(n>this.level)&&(this.piiLoggingEnabled||!i)){var e=(new Date).toUTCString(),o;o=f.StringUtils.isEmpty(this.correlationId)?e+":"+u.version+"-"+r[n]+(i?"-pii":"")+" "+t:e+":"+this.correlationId+"-"+u.version+"-"+r[n]+(i?"-pii":"")+" "+t;this.executeCallback(n,o,i)}},n.prototype.executeCallback=function(n,t,i){this.localCallback&&this.localCallback(n,t,i)},n.prototype.error=function(n){this.logMessage(r.Error,n,!1)},n.prototype.errorPii=function(n){this.logMessage(r.Error,n,!0)},n.prototype.warning=function(n){this.logMessage(r.Warning,n,!1)},n.prototype.warningPii=function(n){this.logMessage(r.Warning,n,!0)},n.prototype.info=function(n){this.logMessage(r.Info,n,!1)},n.prototype.infoPii=function(n){this.logMessage(r.Info,n,!0)},n.prototype.verbose=function(n){this.logMessage(r.Verbose,n,!1)},n.prototype.verbosePii=function(n){this.logMessage(r.Verbose,n,!0)},n.prototype.isPiiLoggingEnabled=function(){return this.piiLoggingEnabled},n}();t.Logger=e},55:function(n,t,i){Object.defineProperty(t,"__esModule",{value:!0});t.ScopeSet=void 0;var u=i(795),f=i(550),r=i(91),e=function(){function n(){}return n.isIntersectingScopes=function(n,t){for(var f=this.trimAndConvertArrayToLowerCase(u.__spreadArrays(n)),r=this.trimAndConvertArrayToLowerCase(u.__spreadArrays(t)),i=0;i<r.length;i++)if(f.indexOf(r[i].toLowerCase())>-1)return!0;return!1},n.containsScope=function(n,t){var i=this.trimAndConvertArrayToLowerCase(u.__spreadArrays(n)),r=this.trimAndConvertArrayToLowerCase(u.__spreadArrays(t));return r.every(function(n){return i.indexOf(n.toString().toLowerCase())>=0})},n.trimAndConvertToLowerCase=function(n){return n.trim().toLowerCase()},n.trimAndConvertArrayToLowerCase=function(n){var t=this;return n.map(function(n){return t.trimAndConvertToLowerCase(n)})},n.trimScopes=function(n){return n.map(function(n){return n.trim()})},n.removeElement=function(n,t){var i=this.trimAndConvertToLowerCase(t);return n.filter(function(n){return n!==i})},n.parseScope=function(n){var i="",t;if(n)for(t=0;t<n.length;++t)i+=t!==n.length-1?n[t]+" ":n[t];return i},n.validateInputScope=function(n,t){if(!n)if(t)throw f.ClientConfigurationError.createScopesRequiredError(n);else return;if(!Array.isArray(n))throw f.ClientConfigurationError.createScopesNonArrayError(n);if(n.length<1&&t)throw f.ClientConfigurationError.createEmptyScopesArrayError(n.toString());},n.getScopeFromState=function(n){if(n){var t=n.indexOf(r.Constants.resourceDelimiter);if(t>-1&&t+1<n.length)return n.substring(t+1)}return""},n.appendScopes=function(n,t){if(n){var i=t?this.trimAndConvertArrayToLowerCase(u.__spreadArrays(t)):null,r=this.trimAndConvertArrayToLowerCase(u.__spreadArrays(n));return i?u.__spreadArrays(r,i):r}return null},n.onlyContainsOidcScopes=function(n){var i=n.length,t=0;return n.indexOf(r.Constants.openidScope)>-1&&(t+=1),n.indexOf(r.Constants.profileScope)>-1&&(t+=1),i>0&&i===t},n.containsAnyOidcScopes=function(n){var t=n.indexOf(r.Constants.openidScope)>-1,i=n.indexOf(r.Constants.profileScope)>-1;return t||i},n.onlyContainsClientId=function(n,t){return!!n&&n.indexOf(t)>-1&&n.length===1},n.appendDefaultScopes=function(n){var t=n;return t.indexOf(r.Constants.openidScope)===-1&&t.push(r.Constants.openidScope),t.indexOf(r.Constants.profileScope)===-1&&t.push(r.Constants.profileScope),t},n.removeDefaultScopes=function(n){return n.filter(function(n){return n!==r.Constants.openidScope&&n!==r.Constants.profileScope})},n.translateClientIdIfSingleScope=function(n,t){return this.onlyContainsClientId(n,t)?r.Constants.oidcScopes:n},n}();t.ScopeSet=e},436:function(n,t,i){Object.defineProperty(t,"__esModule",{value:!0});t.ServerRequestParameters=void 0;var f=i(795),e=i(453),r=i(91),u=i(55),o=i(700),s=function(){function n(n,t,i,s,h,c,l){this.authorityInstance=n;this.clientId=t;this.nonce=e.CryptoUtils.createNewGuid();this.scopes=h?f.__spreadArrays(h):r.Constants.oidcScopes;this.scopes=u.ScopeSet.trimScopes(this.scopes);this.state=c;this.correlationId=l;this.xClientSku="MSAL.JS";this.xClientVer=o.version;this.responseType=i;this.redirectUri=s}return Object.defineProperty(n.prototype,"authority",{get:function(){return this.authorityInstance?this.authorityInstance.CanonicalAuthority:null},enumerable:!1,configurable:!0}),n.prototype.populateQueryParams=function(t,i,r,u){var f={},e;i&&(i.prompt&&(this.promptValue=i.prompt),i.claimsRequest&&(this.claimsValue=i.claimsRequest),n.isSSOParam(i)&&(f=this.constructUnifiedCacheQueryParameter(i,null)));r&&(f=this.constructUnifiedCacheQueryParameter(null,r));f=this.addHintParameters(t,f);e=i?i.extraQueryParameters:null;this.queryParameters=n.generateQueryParametersString(f);this.extraQueryParameters=n.generateQueryParametersString(e,u)},n.prototype.constructUnifiedCacheQueryParameter=function(n,t){var e,i,u,f;return n?n.account?(f=n.account,((e=f.idTokenClaims)===null||e===void 0?void 0:e.login_hint)?(i=r.SSOTypes.LOGIN_HINT,u=f.idTokenClaims.login_hint):f.sid?(i=r.SSOTypes.SID,u=f.sid):f.userName&&(i=r.SSOTypes.LOGIN_HINT,u=f.userName)):n.sid?(i=r.SSOTypes.SID,u=n.sid):n.loginHint&&(i=r.SSOTypes.LOGIN_HINT,u=n.loginHint):t&&t.hasOwnProperty(r.Constants.upn)&&(i=r.SSOTypes.ID_TOKEN,u=t.upn),this.addSSOParameter(i,u)},n.prototype.addHintParameters=function(n,t){var u,f,i=t;return n&&(i[r.SSOTypes.SID]||i[r.SSOTypes.LOGIN_HINT]||(((u=n.idTokenClaims)===null||u===void 0?void 0:u.login_hint)?i=this.addSSOParameter(r.SSOTypes.LOGIN_HINT,(f=n.idTokenClaims)===null||f===void 0?void 0:f.login_hint,i):n.sid&&this.promptValue===r.PromptState.NONE?i=this.addSSOParameter(r.SSOTypes.SID,n.sid,i):n.userName&&(i=this.addSSOParameter(r.SSOTypes.LOGIN_HINT,n.userName,i)))),i},n.prototype.addSSOParameter=function(n,t,i){var u=i||{};if(!t)return u;switch(n){case r.SSOTypes.SID:u[r.SSOTypes.SID]=t;break;case r.SSOTypes.ID_TOKEN:u[r.SSOTypes.LOGIN_HINT]=t;break;case r.SSOTypes.LOGIN_HINT:u[r.SSOTypes.LOGIN_HINT]=t}return u},n.generateQueryParametersString=function(n,t){var i=null;return n&&Object.keys(n).forEach(function(u){u===r.Constants.domain_hint&&(t||n[r.SSOTypes.SID])||(i?i+="&"+u+"="+encodeURIComponent(n[u]):i=u+"="+encodeURIComponent(n[u]))}),i},n.isSSOParam=function(n){return!!(n&&(n.account||n.sid||n.loginHint))},n.determineResponseType=function(n,t){return u.ScopeSet.onlyContainsOidcScopes(t)?r.ResponseTypes.id_token:n?this.responseTypeForMatchingAccounts(t):r.ResponseTypes.id_token_token},n.responseTypeForMatchingAccounts=function(n){return u.ScopeSet.containsAnyOidcScopes(n)?r.ResponseTypes.id_token_token:r.ResponseTypes.token},n}();t.ServerRequestParameters=s},463:function(n,t,i){Object.defineProperty(t,"__esModule",{value:!0});t.UserAgentApplication=void 0;var s=i(795),et=i(29),ot=i(192),a=i(436),rt=i(660),v=i(271),y=i(881),u=i(226),p=i(630),ut=i(55),h=i(454),o=i(758),g=i(94),st=i(78),f=i(741),l=i(52),nt=i(756),c=i(951),ht=i(875),b=i(550),w=i(986),e=i(356),ct=i(447),tt=i(961),k=i(681),ft=s.__importDefault(i(478)),d=i(663),r=i(91),lt=i(453),at=i(405),it=i(49),vt="https://login.microsoftonline.com/common",yt=function(){function n(n){var t,i,e;this.authResponseCallback=null;this.tokenReceivedCallback=null;this.errorReceivedCallback=null;this.config=ht.buildConfiguration(n);this.logger=this.config.system.logger;this.clientId=this.config.auth.clientId;this.inCookie=this.config.cache.storeAuthStateInCookie;this.telemetryManager=this.getTelemetryManagerFromConfig(this.config.system.telemetry,this.clientId);at.TrustedAuthority.setTrustedAuthoritiesFromConfig(this.config.auth.validateAuthority,this.config.auth.knownAuthorities);c.AuthorityFactory.saveMetadataFromConfig(this.config.auth.authority,this.config.auth.authorityMetadata);this.authority=this.config.auth.authority||vt;this.cacheStorage=new u.AuthCache(this.clientId,this.config.cache.cacheLocation,this.inCookie);window.activeRenewals||(window.activeRenewals={});window.renewStates||(window.renewStates=[]);window.callbackMappedToRenewStates||(window.callbackMappedToRenewStates={});window.promiseMappedToRenewStates||(window.promiseMappedToRenewStates={});window.msal=this;t=window.location.hash;i=f.UrlUtils.urlContainsHash(t);o.WindowUtils.checkIfBackButtonIsPressed(this.cacheStorage);i&&this.cacheStorage.isInteractionInProgress(!0)&&(e=this.getResponseState(t),e.method===r.Constants.interactionTypeRedirect&&this.handleRedirectAuthenticationResponse(t))}return Object.defineProperty(n.prototype,"authority",{get:function(){return this.authorityInstance.CanonicalAuthority},set:function(n){this.authorityInstance=c.AuthorityFactory.CreateInstance(n,this.config.auth.validateAuthority)},enumerable:!1,configurable:!0}),n.prototype.getAuthorityInstance=function(){return this.authorityInstance},n.prototype.handleRedirectCallback=function(n,t){if(!n)throw b.ClientConfigurationError.createInvalidCallbackObjectError(n);t?(this.tokenReceivedCallback=n,this.errorReceivedCallback=t,this.logger.warning("This overload for callback is deprecated - please change the format of the callbacks to a single callback as shown: (err: AuthError, response: AuthResponse).")):this.authResponseCallback=n;this.redirectError?this.authErrorHandler(r.Constants.interactionTypeRedirect,this.redirectError,this.redirectResponse):this.redirectResponse&&this.authResponseHandler(r.Constants.interactionTypeRedirect,this.redirectResponse)},n.prototype.urlContainsHash=function(n){return this.logger.verbose("UrlContainsHash has been called"),f.UrlUtils.urlContainsHash(n)},n.prototype.authResponseHandler=function(n,t,i){if(this.logger.verbose("AuthResponseHandler has been called"),this.cacheStorage.setInteractionInProgress(!1),n===r.Constants.interactionTypeRedirect)this.logger.verbose("Interaction type is redirect"),this.errorReceivedCallback?(this.logger.verbose("Two callbacks were provided to handleRedirectCallback, calling success callback with response"),this.tokenReceivedCallback(t)):this.authResponseCallback&&(this.logger.verbose("One callback was provided to handleRedirectCallback, calling authResponseCallback with response"),this.authResponseCallback(null,t));else if(n===r.Constants.interactionTypePopup)this.logger.verbose("Interaction type is popup, resolving"),i(t);else throw e.ClientAuthError.createInvalidInteractionTypeError();},n.prototype.authErrorHandler=function(n,t,i,u){if(this.logger.verbose("AuthErrorHandler has been called"),this.cacheStorage.setInteractionInProgress(!1),n===r.Constants.interactionTypeRedirect)if(this.logger.verbose("Interaction type is redirect"),this.errorReceivedCallback)this.logger.verbose("Two callbacks were provided to handleRedirectCallback, calling error callback"),this.errorReceivedCallback(t,i.accountState);else if(this.authResponseCallback)this.logger.verbose("One callback was provided to handleRedirectCallback, calling authResponseCallback with error"),this.authResponseCallback(t,i);else{this.logger.verbose("handleRedirectCallback has not been called and no callbacks are registered, throwing error");throw t;}else if(n===r.Constants.interactionTypePopup)this.logger.verbose("Interaction type is popup, rejecting"),u(t);else throw e.ClientAuthError.createInvalidInteractionTypeError();},n.prototype.loginRedirect=function(n){this.logger.verbose("LoginRedirect has been called");var t=l.RequestUtils.validateRequest(n,!0,this.clientId,r.Constants.interactionTypeRedirect);this.acquireTokenInteractive(r.Constants.interactionTypeRedirect,!0,t,null,null)},n.prototype.acquireTokenRedirect=function(n){this.logger.verbose("AcquireTokenRedirect has been called");var t=l.RequestUtils.validateRequest(n,!1,this.clientId,r.Constants.interactionTypeRedirect);this.acquireTokenInteractive(r.Constants.interactionTypeRedirect,!1,t,null,null)},n.prototype.loginPopup=function(n){var i=this,t,u;return this.logger.verbose("LoginPopup has been called"),t=l.RequestUtils.validateRequest(n,!0,this.clientId,r.Constants.interactionTypePopup),u=this.telemetryManager.createAndStartApiEvent(t.correlationId,d.API_EVENT_IDENTIFIER.LoginPopup),new Promise(function(n,u){i.acquireTokenInteractive(r.Constants.interactionTypePopup,!0,t,n,u)}).then(function(n){return i.logger.verbose("Successfully logged in"),i.telemetryManager.stopAndFlushApiEvent(t.correlationId,u,!0),n}).catch(function(n){i.cacheStorage.resetTempCacheItems(t.state);i.telemetryManager.stopAndFlushApiEvent(t.correlationId,u,!1,n.errorCode);throw n;})},n.prototype.acquireTokenPopup=function(n){var i=this,t,u;return this.logger.verbose("AcquireTokenPopup has been called"),t=l.RequestUtils.validateRequest(n,!1,this.clientId,r.Constants.interactionTypePopup),u=this.telemetryManager.createAndStartApiEvent(t.correlationId,d.API_EVENT_IDENTIFIER.AcquireTokenPopup),new Promise(function(n,u){i.acquireTokenInteractive(r.Constants.interactionTypePopup,!1,t,n,u)}).then(function(n){return i.logger.verbose("Successfully acquired token"),i.telemetryManager.stopAndFlushApiEvent(t.correlationId,u,!0),n}).catch(function(n){i.cacheStorage.resetTempCacheItems(t.state);i.telemetryManager.stopAndFlushApiEvent(t.correlationId,u,!1,n.errorCode);throw n;})},n.prototype.acquireTokenInteractive=function(n,t,i,u,f){var s=this,l,c,v,y,h;this.logger.verbose("AcquireTokenInteractive has been called");o.WindowUtils.blockReloadInHiddenIframes();try{this.cacheStorage.setInteractionInProgress(!0)}catch(p){l=t?e.ClientAuthError.createLoginInProgressError():e.ClientAuthError.createAcquireTokenInProgressError();h=k.buildResponseStateOnly(this.getAccountState(i.state));this.cacheStorage.resetTempCacheItems(i.state);this.authErrorHandler(n,l,h,f);return}if(n===r.Constants.interactionTypeRedirect&&this.cacheStorage.setItem(r.TemporaryCacheKeys.REDIRECT_REQUEST,""+r.Constants.inProgress+r.Constants.resourceDelimiter+i.state),i&&i.account&&!t?(c=i.account,this.logger.verbose("Account set from request")):(c=this.getAccount(),this.logger.verbose("Account set from MSAL Cache")),c||a.ServerRequestParameters.isSSOParam(i))this.logger.verbose("User session exists, login not required"),this.acquireTokenHelper(c,n,t,i,u,f);else if(t)v=this.extractADALIdToken(),v&&!i.scopes?(this.logger.info("ADAL's idToken exists. Extracting login information from ADAL's idToken"),y=this.buildIDTokenRequest(i),this.silentLogin=!0,this.acquireTokenSilent(y).then(function(t){s.silentLogin=!1;s.logger.info("Unified cache call is successful");s.authResponseHandler(n,t,u);return},function(r){s.silentLogin=!1;s.logger.error("Error occurred during unified cache ATS: "+r);s.acquireTokenHelper(null,n,t,i,u,f)})):(this.logger.verbose("Login call but no token found, proceed to login"),this.acquireTokenHelper(null,n,t,i,u,f));else{this.logger.verbose("AcquireToken call, no context or account given");this.logger.info("User login is required");h=k.buildResponseStateOnly(this.getAccountState(i.state));this.cacheStorage.resetTempCacheItems(i.state);this.authErrorHandler(n,e.ClientAuthError.createUserLoginRequiredError(),h,f);return}},n.prototype.acquireTokenHelper=function(n,t,i,h,l,v){return s.__awaiter(this,void 0,Promise,function(){var g,y,b,p,it,rt,w,nt,d,ut,tt;return s.__generator(this,function(s){switch(s.label){case 0:this.logger.verbose("AcquireTokenHelper has been called");this.logger.verbose("Interaction type: "+t+". isLoginCall: "+i);g=h.scopes?h.scopes.join(" ").toLowerCase():r.Constants.oidcScopes.join(" ");this.logger.verbosePii("Request signature: "+g);b=h&&h.authority?c.AuthorityFactory.CreateInstance(h.authority,this.config.auth.validateAuthority,h.authorityMetadata):this.authorityInstance;s.label=1;case 1:return(s.trys.push([1,11,,12]),!!b.hasCachedMetadata())?[3,3]:(this.logger.verbose("No cached metadata for authority"),[4,c.AuthorityFactory.saveMetadataFromNetwork(b,this.telemetryManager,h.correlationId)]);case 2:return s.sent(),[3,4];case 3:this.logger.verbose("Cached metadata found for authority");s.label=4;case 4:if(it=i?r.ResponseTypes.id_token:this.getTokenType(n,h.scopes),rt=h.redirectStartPage||window.location.href,y=new a.ServerRequestParameters(b,this.clientId,it,this.getRedirectUri(h&&h.redirectUri),h.scopes,h.state,h.correlationId),this.logger.verbose("Finished building server authentication request"),this.updateCacheEntries(y,n,i,rt),this.logger.verbose("Updating cache entries"),y.populateQueryParams(n,h),this.logger.verbose("Query parameters populated from account"),w=f.UrlUtils.createNavigateUrl(y)+r.Constants.response_mode_fragment,t===r.Constants.interactionTypeRedirect)i?this.logger.verbose("Interaction type redirect but login call is true. State not cached"):(this.cacheStorage.setItem(u.AuthCache.generateTemporaryCacheKey(r.TemporaryCacheKeys.STATE_ACQ_TOKEN,h.state),y.state,this.inCookie),this.logger.verbose("State cached for redirect"),this.logger.verbosePii("State cached: "+y.state));else if(t===r.Constants.interactionTypePopup)window.renewStates.push(y.state),window.requestType=i?r.Constants.login:r.Constants.renewToken,this.logger.verbose("State saved to window"),this.logger.verbosePii("State saved: "+y.state),this.registerCallback(y.state,g,l,v);else{this.logger.verbose("Invalid interaction error. State not cached");throw e.ClientAuthError.createInvalidInteractionTypeError();}if(!(t===r.Constants.interactionTypePopup))return[3,9];this.logger.verbose("Interaction type is popup. Generating popup window");try{p=this.openPopup(w,"msal",r.Constants.popUpWidth,r.Constants.popUpHeight);o.WindowUtils.trackPopup(p)}catch(ft){if(this.logger.info(e.ClientAuthErrorMessage.popUpWindowError.code+":"+e.ClientAuthErrorMessage.popUpWindowError.desc),this.cacheStorage.setItem(r.ErrorCacheKeys.ERROR,e.ClientAuthErrorMessage.popUpWindowError.code),this.cacheStorage.setItem(r.ErrorCacheKeys.ERROR_DESC,e.ClientAuthErrorMessage.popUpWindowError.desc),v)return v(e.ClientAuthError.createPopupWindowError()),[2]}if(!p)return[3,8];s.label=5;case 5:return s.trys.push([5,7,,8]),[4,o.WindowUtils.monitorPopupForHash(p,this.config.system.loadFrameTimeout,w,this.logger)];case 6:return nt=s.sent(),this.handleAuthenticationResponse(nt),this.cacheStorage.setInteractionInProgress(!1),this.logger.info("Closing popup window"),this.config.framework.isAngular&&this.broadcast("msal:popUpHashChanged",nt),o.WindowUtils.closePopups(),[3,8];case 7:return d=s.sent(),v&&v(d),this.config.framework.isAngular?this.broadcast("msal:popUpClosed",d.errorCode+r.Constants.resourceDelimiter+d.errorMessage):(this.cacheStorage.setInteractionInProgress(!1),p.close()),[3,8];case 8:return[3,10];case 9:h.onRedirectNavigate?(this.logger.verbose("Invoking onRedirectNavigate callback"),ut=h.onRedirectNavigate(w),ut!==!1?(this.logger.verbose("onRedirectNavigate did not return false, navigating"),this.navigateWindow(w)):this.logger.verbose("onRedirectNavigate returned false, stopping navigation")):(this.logger.verbose("Navigating window to urlNavigate"),this.navigateWindow(w));s.label=10;case 10:return[3,12];case 11:return tt=s.sent(),this.logger.error(tt),this.cacheStorage.resetTempCacheItems(h.state),this.authErrorHandler(t,e.ClientAuthError.createEndpointResolutionError(tt.toString),k.buildResponseStateOnly(h.state),v),p&&p.close(),[3,12];case 12:return[2]}})})},n.prototype.ssoSilent=function(n){if(this.logger.verbose("ssoSilent has been called"),!n)throw b.ClientConfigurationError.createEmptyRequestError();if(!n.sid&&!n.loginHint)throw b.ClientConfigurationError.createSsoSilentError();return this.acquireTokenSilent(s.__assign(s.__assign({},n),{scopes:r.Constants.oidcScopes}))},n.prototype.acquireTokenSilent=function(n){var i=this;this.logger.verbose("AcquireTokenSilent has been called");var t=l.RequestUtils.validateRequest(n,!1,this.clientId,r.Constants.interactionTypeSilent),f=this.telemetryManager.createAndStartApiEvent(t.correlationId,d.API_EVENT_IDENTIFIER.AcquireTokenSilent),u=l.RequestUtils.createRequestSignature(t);return new Promise(function(n,f){return s.__awaiter(i,void 0,void 0,function(){var nt,l,p,b,i,tt,k,v,w,y,d;return s.__generator(this,function(s){switch(s.label){case 0:if(o.WindowUtils.blockReloadInHiddenIframes(),nt=t.scopes.join(" ").toLowerCase(),this.logger.verbosePii("Serialized scopes: "+nt),t.account?(l=t.account,this.logger.verbose("Account set from request")):(l=this.getAccount(),this.logger.verbose("Account set from MSAL Cache")),p=this.cacheStorage.getItem(r.Constants.adalIdToken),!l&&!(t.sid||t.loginHint)&&h.StringUtils.isEmpty(p))return this.logger.info("User login is required"),[2,f(e.ClientAuthError.createUserLoginRequiredError())];if(b=this.getTokenType(l,t.scopes),this.logger.verbose("Response type: "+b),i=new a.ServerRequestParameters(c.AuthorityFactory.CreateInstance(t.authority,this.config.auth.validateAuthority,t.authorityMetadata),this.clientId,b,this.getRedirectUri(t.redirectUri),t.scopes,t.state,t.correlationId),this.logger.verbose("Finished building server authentication request"),a.ServerRequestParameters.isSSOParam(t)||l?(i.populateQueryParams(l,t,null,!0),this.logger.verbose("Query parameters populated from existing SSO or account")):l||h.StringUtils.isEmpty(p)?this.logger.verbose("No additional query parameters added"):(tt=g.TokenUtils.extractIdToken(p),this.logger.verbose("ADAL's idToken exists. Extracting login information from ADAL's idToken to populate query parameters"),i.populateQueryParams(l,null,tt,!0)),k=t.claimsRequest||i.claimsValue,!k&&!t.forceRefresh)try{w=this.getCachedToken(i,l)}catch(it){v=it}return w?(this.logger.verbose("Token found in cache lookup"),this.logger.verbosePii("Scopes found: "+JSON.stringify(w.scopes)),n(w),[2,null]):[3,1];case 1:return v?(this.logger.infoPii(v.errorCode+":"+v.errorMessage),f(v),[2,null]):[3,2];case 2:y=void 0;y=k?"Skipped cache lookup since claims were given":t.forceRefresh?"Skipped cache lookup since request.forceRefresh option was set to true":"No valid token found in cache lookup";this.logger.verbose(y);i.authorityInstance||(i.authorityInstance=t.authority?c.AuthorityFactory.CreateInstance(t.authority,this.config.auth.validateAuthority,t.authorityMetadata):this.authorityInstance);this.logger.verbosePii("Authority instance: "+i.authority);s.label=3;case 3:return(s.trys.push([3,7,,8]),!!i.authorityInstance.hasCachedMetadata())?[3,5]:(this.logger.verbose("No cached metadata for authority"),[4,c.AuthorityFactory.saveMetadataFromNetwork(i.authorityInstance,this.telemetryManager,t.correlationId)]);case 4:return s.sent(),this.logger.verbose("Authority has been updated with endpoint discovery response"),[3,6];case 5:this.logger.verbose("Cached metadata found for authority");s.label=6;case 6:return window.activeRenewals[u]?(this.logger.verbose("Renewing token in progress. Registering callback"),this.registerCallback(window.activeRenewals[u],u,n,f)):t.scopes&&ut.ScopeSet.onlyContainsOidcScopes(t.scopes)?(this.logger.verbose("OpenID Connect scopes only, renewing idToken"),this.silentLogin=!0,this.renewIdToken(u,n,f,l,i)):(this.logger.verbose("Renewing access token"),this.renewToken(u,n,f,l,i)),[3,8];case 7:return d=s.sent(),this.logger.error(d),f(e.ClientAuthError.createEndpointResolutionError(d.toString())),[2,null];case 8:return[2]}})})}).then(function(n){return i.logger.verbose("Successfully acquired token"),i.telemetryManager.stopAndFlushApiEvent(t.correlationId,f,!0),n}).catch(function(n){i.cacheStorage.resetTempCacheItems(t.state);i.telemetryManager.stopAndFlushApiEvent(t.correlationId,f,!1,n.errorCode);throw n;})},n.prototype.openPopup=function(n,t,i,r){this.logger.verbose("OpenPopup has been called");try{var f=window.screenLeft?window.screenLeft:window.screenX,o=window.screenTop?window.screenTop:window.screenY,s=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,h=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight,c=s/2-i/2+f,l=h/2-r/2+o,u=window.open(n,t,"width="+i+", height="+r+", top="+l+", left="+c+", scrollbars=yes");if(!u)throw e.ClientAuthError.createPopupWindowError();return u.focus&&u.focus(),u}catch(a){this.cacheStorage.setInteractionInProgress(!1);throw e.ClientAuthError.createPopupWindowError(a.toString());}},n.prototype.loadIframeTimeout=function(n,t,i){return s.__awaiter(this,void 0,Promise,function(){var f,e,h,c,l;return s.__generator(this,function(s){switch(s.label){case 0:return(f=window.activeRenewals[i],this.logger.verbosePii("Set loading state to pending for: "+i+":"+f),this.cacheStorage.setItem(u.AuthCache.generateTemporaryCacheKey(r.TemporaryCacheKeys.RENEW_STATUS,f),r.Constants.inProgress),!this.config.system.navigateFrameWait)?[3,2]:[4,o.WindowUtils.loadFrame(n,t,this.config.system.navigateFrameWait,this.logger)];case 1:return h=s.sent(),[3,3];case 2:h=o.WindowUtils.loadFrameSync(n,t,this.logger);s.label=3;case 3:e=h;s.label=4;case 4:return s.trys.push([4,6,,7]),[4,o.WindowUtils.monitorIframeForHash(e.contentWindow,this.config.system.loadFrameTimeout,n,this.logger)];case 5:return c=s.sent(),c&&this.handleAuthenticationResponse(c),[3,7];case 6:l=s.sent();this.cacheStorage.getItem(u.AuthCache.generateTemporaryCacheKey(r.TemporaryCacheKeys.RENEW_STATUS,f))===r.Constants.inProgress&&(this.logger.verbose("Loading frame has timed out after: "+this.config.system.loadFrameTimeout/1e3+" seconds for scope/authority "+i+":"+f),f&&window.callbackMappedToRenewStates[f]&&window.callbackMappedToRenewStates[f](null,l),this.cacheStorage.removeItem(u.AuthCache.generateTemporaryCacheKey(r.TemporaryCacheKeys.RENEW_STATUS,f)));o.WindowUtils.removeHiddenIframe(e);throw l;case 7:return o.WindowUtils.removeHiddenIframe(e),[2]}})})},n.prototype.navigateWindow=function(n,t){if(n&&!h.StringUtils.isEmpty(n)){var i=t?t:window,r=t?"Navigated Popup window to:"+n:"Navigate to:"+n;this.logger.infoPii(r);i.location.assign(n)}else{this.logger.info("Navigate url is empty");throw w.AuthError.createUnexpectedError("Navigate url is empty");}},n.prototype.registerCallback=function(n,t,i,r){var u=this;window.activeRenewals[t]=n;window.promiseMappedToRenewStates[n]||(window.promiseMappedToRenewStates[n]=[]);window.promiseMappedToRenewStates[n].push({resolve:i,reject:r});window.callbackMappedToRenewStates[n]||(window.callbackMappedToRenewStates[n]=function(i,r){delete window.activeRenewals[t];for(var f=0;f<window.promiseMappedToRenewStates[n].length;++f)try{if(r)window.promiseMappedToRenewStates[n][f].reject(r);else if(i)window.promiseMappedToRenewStates[n][f].resolve(i);else{u.cacheStorage.resetTempCacheItems(n);throw w.AuthError.createUnexpectedError("Error and response are both null");}}catch(e){u.logger.warning(e)}delete window.promiseMappedToRenewStates[n];delete window.callbackMappedToRenewStates[n]})},n.prototype.logout=function(n){this.logger.verbose("Logout has been called");this.logoutAsync(n)},n.prototype.logoutAsync=function(n){return s.__awaiter(this,void 0,Promise,function(){var t,u,f,i,r,e;return s.__generator(this,function(o){switch(o.label){case 0:t=n||lt.CryptoUtils.createNewGuid();u=this.telemetryManager.createAndStartApiEvent(t,d.API_EVENT_IDENTIFIER.Logout);this.clearCache();this.account=null;o.label=1;case 1:return(o.trys.push([1,5,,6]),!!this.authorityInstance.hasCachedMetadata())?[3,3]:(this.logger.verbose("No cached metadata for authority"),[4,c.AuthorityFactory.saveMetadataFromNetwork(this.authorityInstance,this.telemetryManager,n)]);case 2:return o.sent(),[3,4];case 3:this.logger.verbose("Cached metadata found for authority");o.label=4;case 4:return f="client-request-id="+t,i=void 0,this.getPostLogoutRedirectUri()?(i="&post_logout_redirect_uri="+encodeURIComponent(this.getPostLogoutRedirectUri()),this.logger.verbose("redirectUri found and set")):(i="",this.logger.verbose("No redirectUri set for app. postLogoutQueryParam is empty")),r=void 0,this.authorityInstance.EndSessionEndpoint?(r=this.authorityInstance.EndSessionEndpoint+"?"+f+i,this.logger.verbose("EndSessionEndpoint found and urlNavigate set"),this.logger.verbosePii("urlNavigate set to: "+this.authorityInstance.EndSessionEndpoint)):(r=this.authority+"oauth2/v2.0/logout?"+f+i,this.logger.verbose("No endpoint, urlNavigate set to default")),this.telemetryManager.stopAndFlushApiEvent(t,u,!0),this.logger.verbose("Navigating window to urlNavigate"),this.navigateWindow(r),[3,6];case 5:return e=o.sent(),this.telemetryManager.stopAndFlushApiEvent(t,u,!1,e.errorCode),[3,6];case 6:return[2]}})})},n.prototype.clearCache=function(){var t,n;for(this.logger.verbose("Clearing cache"),window.renewStates=[],t=this.cacheStorage.getAllTokens(r.Constants.clientId,r.Constants.homeAccountIdentifier),n=0;n<t.length;n++)this.cacheStorage.removeItem(JSON.stringify(t[n].key));this.cacheStorage.resetCacheItems();this.cacheStorage.clearMsalCookie();this.logger.verbose("Cache cleared")},n.prototype.clearCacheForScope=function(n){var u,t,i;for(this.logger.verbose("Clearing access token from cache"),u=this.cacheStorage.getAllAccessTokens(r.Constants.clientId,r.Constants.homeAccountIdentifier),t=0;t<u.length;t++)i=u[t],i.value.accessToken===n&&(this.cacheStorage.removeItem(JSON.stringify(i.key)),this.logger.verbosePii("Access token removed: "+i.key))},n.prototype.isCallback=function(n){return this.logger.info("isCallback will be deprecated in favor of urlContainsHash in MSAL.js v2.0."),this.logger.verbose("isCallback has been called"),f.UrlUtils.urlContainsHash(n)},n.prototype.processCallBack=function(n,t,i){var u,f,o,h;this.logger.info("ProcessCallBack has been called. Processing callback from redirect response");u=t;u||(this.logger.verbose("StateInfo is null, getting stateInfo from hash"),u=this.getResponseState(n));try{f=this.saveTokenFromHash(n,u)}catch(s){o=s}try{if(this.cacheStorage.clearMsalCookie(u.state),h=this.getAccountState(u.state),f){if(u.requestType===r.Constants.renewToken||f.accessToken?(window.parent!==window?this.logger.verbose("Window is in iframe, acquiring token silently"):this.logger.verbose("Acquiring token interactive in progress"),this.logger.verbose("Response tokenType set to "+r.ServerHashParamKeys.ACCESS_TOKEN),f.tokenType=r.ServerHashParamKeys.ACCESS_TOKEN):u.requestType===r.Constants.login&&(this.logger.verbose("Response tokenType set to "+r.ServerHashParamKeys.ID_TOKEN),f.tokenType=r.ServerHashParamKeys.ID_TOKEN),!i){this.logger.verbose("Setting redirectResponse");this.redirectResponse=f;return}}else if(!i){this.logger.verbose("Response is null, setting redirectResponse with state");this.redirectResponse=k.buildResponseStateOnly(h);this.redirectError=o;this.cacheStorage.resetTempCacheItems(u.state);return}this.logger.verbose("Calling callback provided to processCallback");i(f,o)}catch(s){this.logger.error("Error occurred in token received callback function: "+s);throw e.ClientAuthError.createErrorInCallbackFunction(s.toString());}},n.prototype.handleAuthenticationResponse=function(n){var t,i,r;this.logger.verbose("HandleAuthenticationResponse has been called");t=n||window.location.hash;i=this.getResponseState(t);this.logger.verbose("Obtained state from response");r=window.callbackMappedToRenewStates[i.state];this.processCallBack(t,i,r)},n.prototype.handleRedirectAuthenticationResponse=function(n){var e,t,s,i,h;if(this.logger.info("Returned from redirect url"),this.logger.verbose("HandleRedirectAuthenticationResponse has been called"),o.WindowUtils.clearUrlFragment(window),this.logger.verbose("Window.location.hash cleared"),e=this.getResponseState(n),this.config.auth.navigateToLoginRequestUrl&&window.parent===window)if(this.logger.verbose("Window.parent is equal to window, not in popup or iframe. Navigation to login request url after login turned on"),t=this.cacheStorage.getItem(u.AuthCache.generateTemporaryCacheKey(r.TemporaryCacheKeys.LOGIN_REQUEST,e.state),this.inCookie),t&&t!=="null"){if(this.logger.verbose("Valid login request url obtained from cache"),s=f.UrlUtils.removeHashFromUrl(window.location.href),i=f.UrlUtils.removeHashFromUrl(t),s!==i){this.logger.verbose("Current url is not login request url, navigating");this.logger.verbosePii("CurrentUrl: "+s+", finalRedirectUrl: "+i);window.location.assign(""+i+n);return}this.logger.verbose("Current url matches login request url");h=f.UrlUtils.GetUrlComponents(t);h.Hash&&(this.logger.verbose("Login request url contains hash, resetting non-msal hash"),window.location.hash=h.Hash)}else{this.logger.error("Unable to get valid login request url from cache, redirecting to home page");window.location.assign("/");return}else this.config.auth.navigateToLoginRequestUrl||this.logger.verbose("Default navigation to start page after login turned off");this.processCallBack(n,e,null)},n.prototype.getResponseState=function(n){var i,t,o,s,e;if(this.logger.verbose("GetResponseState has been called"),i=f.UrlUtils.deserializeHash(n),!i)throw w.AuthError.createUnexpectedError("Hash was not parsed correctly.");if(i.hasOwnProperty(r.ServerHashParamKeys.STATE))this.logger.verbose("Hash contains state. Creating stateInfo object"),o=l.RequestUtils.parseLibraryState(i.state),t={requestType:r.Constants.unknown,state:i.state,timestamp:o.ts,method:o.method,stateMatch:!1};else throw w.AuthError.createUnexpectedError("Hash does not contain state.");if(t.state===this.cacheStorage.getItem(u.AuthCache.generateTemporaryCacheKey(r.TemporaryCacheKeys.STATE_LOGIN,t.state),this.inCookie)||t.state===this.silentAuthenticationState)return this.logger.verbose("State matches cached state, setting requestType to login"),t.requestType=r.Constants.login,t.stateMatch=!0,t;if(t.state===this.cacheStorage.getItem(u.AuthCache.generateTemporaryCacheKey(r.TemporaryCacheKeys.STATE_ACQ_TOKEN,t.state),this.inCookie))return this.logger.verbose("State matches cached state, setting requestType to renewToken"),t.requestType=r.Constants.renewToken,t.stateMatch=!0,t;if(!t.stateMatch){for(this.logger.verbose("State does not match cached state, setting requestType to type from window"),t.requestType=window.requestType,s=window.renewStates,e=0;e<s.length;e++)if(s[e]===t.state){this.logger.verbose("Matching state found for request");t.stateMatch=!0;break}t.stateMatch||this.logger.verbose("Matching state not found for request")}return t},n.prototype.getCachedToken=function(n,t){this.logger.verbose("GetCachedToken has been called");var i=n.scopes,r=this.getCachedIdToken(n,t),u=this.getCachedAccessToken(n,t,i),f=this.getAccountState(n.state);return nt.ResponseUtils.buildAuthResponse(r,u,n,t,i,f)},n.prototype.getTokenCacheItemByAuthority=function(n,t,i,r){var e=this,u;return u=f.UrlUtils.isCommonAuthority(n)||f.UrlUtils.isOrganizationsAuthority(n)||f.UrlUtils.isConsumersAuthority(n)?it.AuthCacheUtils.filterTokenCacheItemsByDomain(t,f.UrlUtils.GetUrlComponents(n).HostNameAndPort):it.AuthCacheUtils.filterTokenCacheItemsByAuthority(t,n),u.length===1?u[0]:u.length>1?(this.logger.warning("Multiple matching tokens found. Cleaning cache and requesting a new token."),u.forEach(function(n){e.cacheStorage.removeItem(JSON.stringify(n.key))}),null):(this.logger.verbose("No matching tokens of type "+r+" found"),null)},n.prototype.getCachedIdToken=function(n,t){var f,u;this.logger.verbose("Getting all cached tokens of type ID Token");var e=this.cacheStorage.getAllIdTokens(this.clientId,t?t.homeAccountIdentifier:null),o=n.authority||this.authority,i=this.getTokenCacheItemByAuthority(o,e,null,r.ServerHashParamKeys.ID_TOKEN);return i?(this.logger.verbose("Evaluating ID token found"),f=this.evaluateTokenExpiration(i),f?(this.logger.verbose("ID token expiration is within offset, using ID token found in cache"),u=i.value,u?this.logger.verbose("ID Token found in cache is valid and unexpired"):this.logger.verbose("ID Token found in cache is invalid"),u?new y.IdToken(u.idToken):null):(this.logger.verbose("Cached ID token is expired, removing from cache"),this.cacheStorage.removeItem(JSON.stringify(i.key)),null)):(this.logger.verbose("No tokens found"),null)},n.prototype.getCachedAccessToken=function(n,t,i){var e,f,o,s;this.logger.verbose("Getting all cached tokens of type Access Token");var h=this.cacheStorage.getAllAccessTokens(this.clientId,t?t.homeAccountIdentifier:null),l=it.AuthCacheUtils.filterTokenCacheItemsByScope(h,i),a=n.authority||this.authority,u=this.getTokenCacheItemByAuthority(a,l,i,r.ServerHashParamKeys.ACCESS_TOKEN);if(u){if(n.authorityInstance=c.AuthorityFactory.CreateInstance(u.key.authority,this.config.auth.validateAuthority),this.logger.verbose("Evaluating access token found"),e=this.evaluateTokenExpiration(u),e){if(this.logger.verbose("Access token expiration is within offset, using access token found in cache"),f=t||this.getAccount(),!f)throw w.AuthError.createUnexpectedError("Account should not be null here.");return o=this.getAccountState(n.state),s={uniqueId:"",tenantId:"",tokenType:r.ServerHashParamKeys.ACCESS_TOKEN,idToken:null,idTokenClaims:null,accessToken:u.value.accessToken,scopes:u.key.scopes.split(" "),expiresOn:new Date(Number(u.value.expiresIn)*1e3),account:f,accountState:o,fromCache:!0},s}return this.logger.verbose("Access token expired, removing from cache"),this.cacheStorage.removeItem(JSON.stringify(u.key)),null}return this.logger.verbose("No matching token found when filtering by scope and authority"),null},n.prototype.evaluateTokenExpiration=function(n){var t=Number(n.value.expiresIn);return g.TokenUtils.validateExpirationIsWithinOffset(t,this.config.system.tokenRenewalOffsetSeconds)},n.prototype.extractADALIdToken=function(){this.logger.verbose("ExtractADALIdToken has been called");var n=this.cacheStorage.getItem(r.Constants.adalIdToken);return h.StringUtils.isEmpty(n)?null:g.TokenUtils.extractIdToken(n)},n.prototype.renewToken=function(n,t,i,u,e){var s,h;this.logger.verbose("RenewToken has been called");this.logger.verbosePii("RenewToken scope and authority: "+n);s=o.WindowUtils.generateFrameName(r.FramePrefix.TOKEN_FRAME,n);o.WindowUtils.addHiddenIFrame(s,this.logger);this.updateCacheEntries(e,u,!1);this.logger.verbosePii("RenewToken expected state: "+e.state);h=f.UrlUtils.urlRemoveQueryStringParameter(f.UrlUtils.createNavigateUrl(e),r.Constants.prompt)+r.Constants.prompt_none+r.Constants.response_mode_fragment;window.renewStates.push(e.state);window.requestType=r.Constants.renewToken;this.logger.verbose("Set window.renewState and requestType");this.registerCallback(e.state,n,t,i);this.logger.infoPii("Navigate to: "+h);this.loadIframeTimeout(h,s,n).catch(function(n){return i(n)})},n.prototype.renewIdToken=function(n,t,i,u,e){var s,h;this.logger.info("RenewIdToken has been called");s=o.WindowUtils.generateFrameName(r.FramePrefix.ID_TOKEN_FRAME,n);o.WindowUtils.addHiddenIFrame(s,this.logger);this.updateCacheEntries(e,u,!1);this.logger.verbose("RenewIdToken expected state: "+e.state);h=f.UrlUtils.urlRemoveQueryStringParameter(f.UrlUtils.createNavigateUrl(e),r.Constants.prompt)+r.Constants.prompt_none+r.Constants.response_mode_fragment;this.silentLogin?(this.logger.verbose("Silent login is true, set silentAuthenticationState"),window.requestType=r.Constants.login,this.silentAuthenticationState=e.state):(this.logger.verbose("Not silent login, set window.renewState and requestType"),window.requestType=r.Constants.renewToken,window.renewStates.push(e.state));this.registerCallback(e.state,n,t,i);this.logger.infoPii('Navigate to:" '+h);this.loadIframeTimeout(h,s,n).catch(function(n){return i(n)})},n.prototype.saveToken=function(n,t,i,r,u){var f=new et.AccessTokenKey(t,this.clientId,i,r.uid,r.utid),e=new ot.AccessTokenValue(n.accessToken,n.idToken.rawIdToken,u.toString(),r.encodeClientInfo());return this.cacheStorage.setItem(JSON.stringify(f),JSON.stringify(e)),u?(this.logger.verbose("New expiration set for token"),n.expiresOn=new Date(u*1e3)):this.logger.error("Could not parse expiresIn parameter for access token"),n},n.prototype.saveIdToken=function(n,t,i,u,f){var e,h,o;return this.logger.verbose("SaveIdToken has been called"),e=s.__assign({},n),e.scopes=r.Constants.oidcScopes,e.accessToken=i[r.ServerHashParamKeys.ID_TOKEN],o=Number(f.expiration),this.logger.verbose("Saving ID token to cache"),this.saveToken(e,t,h,u,o)},n.prototype.saveAccessToken=function(n,t,i,u){var f,e,v;this.logger.verbose("SaveAccessToken has been called");var o=s.__assign({},n),h=i[r.ServerHashParamKeys.SCOPE],c=h.split(" "),a=this.cacheStorage.getAllAccessTokens(this.clientId,t);for(this.logger.verbose("Retrieving all access tokens from cache and removing duplicates"),f=0;f<a.length;f++)e=a[f],e.key.homeAccountIdentifier===n.account.homeAccountIdentifier&&(v=e.key.scopes.split(" "),ut.ScopeSet.isIntersectingScopes(v,c)&&this.cacheStorage.removeItem(JSON.stringify(e.key)));o.accessToken=i[r.ServerHashParamKeys.ACCESS_TOKEN];o.scopes=c;var y=st.TimeUtils.parseExpiresIn(i[r.ServerHashParamKeys.EXPIRES_IN]),p=l.RequestUtils.parseLibraryState(i[r.ServerHashParamKeys.STATE]),w=p.ts+y;return this.logger.verbose("Saving access token to cache"),this.saveToken(o,t,h,u,w)},n.prototype.saveTokenFromHash=function(n,t){var g,it,st,ht,c,ut,lt,et,ft,a,d,ot;this.logger.verbose("SaveTokenFromHash has been called");this.logger.info("State status: "+t.stateMatch+"; Request type: "+t.requestType);var o={uniqueId:"",tenantId:"",tokenType:"",idToken:null,idTokenClaims:null,accessToken:null,scopes:[],expiresOn:null,account:null,accountState:"",fromCache:!1},l,i=f.UrlUtils.deserializeHash(n),b="",k="",s=null;if(i.hasOwnProperty(r.ServerHashParamKeys.ERROR_DESCRIPTION)||i.hasOwnProperty(r.ServerHashParamKeys.ERROR)?(this.logger.verbose("Server returned an error"),this.logger.infoPii("Error : "+i[r.ServerHashParamKeys.ERROR]+"; Error description: "+i[r.ServerHashParamKeys.ERROR_DESCRIPTION]),this.cacheStorage.setItem(r.ErrorCacheKeys.ERROR,i[r.ServerHashParamKeys.ERROR]),this.cacheStorage.setItem(r.ErrorCacheKeys.ERROR_DESC,i[r.ServerHashParamKeys.ERROR_DESCRIPTION]),t.requestType===r.Constants.login&&(this.logger.verbose("RequestType is login, caching login error, generating authorityKey"),this.cacheStorage.setItem(r.ErrorCacheKeys.LOGIN_ERROR,i[r.ServerHashParamKeys.ERROR_DESCRIPTION]+":"+i[r.ServerHashParamKeys.ERROR]),b=u.AuthCache.generateAuthorityKey(t.state)),t.requestType===r.Constants.renewToken&&(this.logger.verbose("RequestType is renewToken, generating acquireTokenAccountKey"),b=u.AuthCache.generateAuthorityKey(t.state),g=this.getAccount(),it=void 0,g&&!h.StringUtils.isEmpty(g.homeAccountIdentifier)?(it=g.homeAccountIdentifier,this.logger.verbose("AccountId is set")):(it=r.Constants.no_account,this.logger.verbose("AccountId is set as no_account")),k=u.AuthCache.generateAcquireTokenAccountKey(it,t.state)),st=i[r.ServerHashParamKeys.ERROR],ht=i[r.ServerHashParamKeys.ERROR_DESCRIPTION],l=tt.InteractionRequiredAuthError.isInteractionRequiredError(st)||tt.InteractionRequiredAuthError.isInteractionRequiredError(ht)?new tt.InteractionRequiredAuthError(i[r.ServerHashParamKeys.ERROR],i[r.ServerHashParamKeys.ERROR_DESCRIPTION]):new ct.ServerError(i[r.ServerHashParamKeys.ERROR],i[r.ServerHashParamKeys.ERROR_DESCRIPTION])):(this.logger.verbose("Server returns success"),t.stateMatch?(this.logger.info("State is right"),i.hasOwnProperty(r.ServerHashParamKeys.SESSION_STATE)&&(this.logger.verbose("Fragment has session state, caching"),this.cacheStorage.setItem(u.AuthCache.generateTemporaryCacheKey(r.TemporaryCacheKeys.SESSION_STATE,t.state),i[r.ServerHashParamKeys.SESSION_STATE])),o.accountState=this.getAccountState(t.state),c=void 0,i.hasOwnProperty(r.ServerHashParamKeys.ACCESS_TOKEN)&&(this.logger.info("Fragment has access token"),o.accessToken=i[r.ServerHashParamKeys.ACCESS_TOKEN],i.hasOwnProperty(r.ServerHashParamKeys.SCOPE)&&(o.scopes=i[r.ServerHashParamKeys.SCOPE].split(" ")),i.hasOwnProperty(r.ServerHashParamKeys.ID_TOKEN)?(this.logger.verbose("Fragment has id_token"),s=new y.IdToken(i[r.ServerHashParamKeys.ID_TOKEN])):(this.logger.verbose("No idToken on fragment, getting idToken from cache"),s=new y.IdToken(this.cacheStorage.getItem(r.PersistentCacheKeys.IDTOKEN))),o=nt.ResponseUtils.setResponseIdToken(o,s),a=this.populateAuthority(t.state,this.inCookie,this.cacheStorage,s),this.logger.verbose("Got authority from cache"),i.hasOwnProperty(r.ServerHashParamKeys.CLIENT_INFO)?(this.logger.verbose("Fragment has clientInfo"),c=new v.ClientInfo(i[r.ServerHashParamKeys.CLIENT_INFO],a)):this.authorityInstance.AuthorityType===rt.AuthorityType.Adfs?c=v.ClientInfo.createClientInfoFromIdToken(s,a):this.logger.warning("ClientInfo not received in the response from AAD"),o.account=p.Account.createAccount(s,c),this.logger.verbose("Account object created from response"),ut=void 0,o.account&&!h.StringUtils.isEmpty(o.account.homeAccountIdentifier)?(this.logger.verbose("AccountKey set"),ut=o.account.homeAccountIdentifier):(this.logger.verbose("AccountKey set as no_account"),ut=r.Constants.no_account),k=u.AuthCache.generateAcquireTokenAccountKey(ut,t.state),lt=u.AuthCache.generateAcquireTokenAccountKey(r.Constants.no_account,t.state),this.logger.verbose("AcquireTokenAccountKey generated"),et=this.cacheStorage.getItem(k),ft=void 0,h.StringUtils.isEmpty(et)?h.StringUtils.isEmpty(this.cacheStorage.getItem(lt))||(this.logger.verbose("No acquireToken account retrieved from cache"),o=this.saveAccessToken(o,a,i,c)):(ft=JSON.parse(et),this.logger.verbose("AcquireToken request account retrieved from cache"),o.account&&ft&&p.Account.compareAccounts(o.account,ft)?(o=this.saveAccessToken(o,a,i,c),this.logger.info("The user object received in the response is the same as the one passed in the acquireToken request")):this.logger.warning("The account object created from the response is not the same as the one passed in the acquireToken request"))),i.hasOwnProperty(r.ServerHashParamKeys.ID_TOKEN)&&(this.logger.info("Fragment has idToken"),s=new y.IdToken(i[r.ServerHashParamKeys.ID_TOKEN]),a=this.populateAuthority(t.state,this.inCookie,this.cacheStorage,s),o=nt.ResponseUtils.setResponseIdToken(o,s),i.hasOwnProperty(r.ServerHashParamKeys.CLIENT_INFO)?(this.logger.verbose("Fragment has clientInfo"),c=new v.ClientInfo(i[r.ServerHashParamKeys.CLIENT_INFO],a)):this.authorityInstance.AuthorityType===rt.AuthorityType.Adfs?c=v.ClientInfo.createClientInfoFromIdToken(s,a):this.logger.warning("ClientInfo not received in the response from AAD"),this.account=p.Account.createAccount(s,c),o.account=this.account,this.logger.verbose("Account object created from response"),s&&s.nonce?(this.logger.verbose("IdToken has nonce"),d=this.cacheStorage.getItem(u.AuthCache.generateTemporaryCacheKey(r.TemporaryCacheKeys.NONCE_IDTOKEN,t.state),this.inCookie),s.nonce!==d?(this.account=null,this.cacheStorage.setItem(r.ErrorCacheKeys.LOGIN_ERROR,"Nonce Mismatch. Expected Nonce: "+d+",Actual Nonce: "+s.nonce),this.logger.error("Nonce Mismatch. Expected Nonce: "+d+", Actual Nonce: "+s.nonce),l=e.ClientAuthError.createNonceMismatchError(d,s.nonce)):(this.logger.verbose("Nonce matches, saving idToken to cache"),this.cacheStorage.setItem(r.PersistentCacheKeys.IDTOKEN,i[r.ServerHashParamKeys.ID_TOKEN],this.inCookie),this.cacheStorage.setItem(r.PersistentCacheKeys.CLIENT_INFO,c.encodeClientInfo(),this.inCookie),this.saveIdToken(o,a,i,c,s))):(this.logger.verbose("No idToken or no nonce. Cache key for Authority set as state"),b=t.state,k=t.state,this.logger.error("Invalid id_token received in the response"),l=e.ClientAuthError.createInvalidIdTokenError(s),this.cacheStorage.setItem(r.ErrorCacheKeys.ERROR,l.errorCode),this.cacheStorage.setItem(r.ErrorCacheKeys.ERROR_DESC,l.errorMessage)))):(this.logger.verbose("State mismatch"),b=t.state,k=t.state,ot=this.cacheStorage.getItem(u.AuthCache.generateTemporaryCacheKey(r.TemporaryCacheKeys.STATE_LOGIN,t.state),this.inCookie),this.logger.error("State Mismatch. Expected State: "+ot+", Actual State: "+t.state),l=e.ClientAuthError.createInvalidStateError(t.state,ot),this.cacheStorage.setItem(r.ErrorCacheKeys.ERROR,l.errorCode),this.cacheStorage.setItem(r.ErrorCacheKeys.ERROR_DESC,l.errorMessage))),this.cacheStorage.removeItem(u.AuthCache.generateTemporaryCacheKey(r.TemporaryCacheKeys.RENEW_STATUS,t.state)),this.cacheStorage.resetTempCacheItems(t.state),this.logger.verbose("Status set to complete, temporary cache cleared"),this.inCookie&&(this.logger.verbose("InCookie is true, setting authorityKey in cookie"),this.cacheStorage.setItemCookie(b,"",-1),this.cacheStorage.clearMsalCookie(t.state)),l)throw l;if(!o)throw w.AuthError.createUnexpectedError("Response is null");return o},n.prototype.populateAuthority=function(n,t,i,r){this.logger.verbose("PopulateAuthority has been called");var o=u.AuthCache.generateAuthorityKey(n),e=i.getItem(o,t);return h.StringUtils.isEmpty(e)?e:f.UrlUtils.replaceTenantPath(e,r.tenantId)},n.prototype.getAccount=function(){var n,t,i,u;return this.account?this.account:(n=this.cacheStorage.getItem(r.PersistentCacheKeys.IDTOKEN,this.inCookie),t=this.cacheStorage.getItem(r.PersistentCacheKeys.CLIENT_INFO,this.inCookie),!h.StringUtils.isEmpty(n)&&!h.StringUtils.isEmpty(t))?(i=new y.IdToken(n),u=new v.ClientInfo(t,""),this.account=p.Account.createAccount(i,u),this.account):null},n.prototype.getAccountState=function(n){if(n){var t=n.indexOf(r.Constants.resourceDelimiter);if(t>-1&&t+1<n.length)return n.substring(t+1)}return n},n.prototype.getAllAccounts=function(){for(var i=[],t=this.cacheStorage.getAllAccessTokens(r.Constants.clientId,r.Constants.homeAccountIdentifier),n=0;n<t.length;n++){var u=new y.IdToken(t[n].value.idToken),f=new v.ClientInfo(t[n].value.homeAccountIdentifier,""),e=p.Account.createAccount(u,f);i.push(e)}return this.getUniqueAccounts(i)},n.prototype.getUniqueAccounts=function(n){var i,r,t;if(!n||n.length<=1)return n;for(i=[],r=[],t=0;t<n.length;++t)n[t].homeAccountIdentifier&&i.indexOf(n[t].homeAccountIdentifier)===-1&&(i.push(n[t].homeAccountIdentifier),r.push(n[t]));return r},n.prototype.broadcast=function(n,t){var i=new CustomEvent(n,{detail:t});window.dispatchEvent(i)},n.prototype.getCachedTokenInternal=function(n,t,i,r){var u=t||this.getAccount();if(!u)return null;var f=this.authorityInstance?this.authorityInstance:c.AuthorityFactory.CreateInstance(this.authority,this.config.auth.validateAuthority),e=this.getTokenType(u,n),o=new a.ServerRequestParameters(f,this.clientId,e,this.getRedirectUri(),n,i,r);return this.getCachedToken(o,t)},n.prototype.getScopesForEndpoint=function(n){var t,i,r,u;if(this.config.framework.unprotectedResources.length>0)for(t=0;t<this.config.framework.unprotectedResources.length;t++)if(n.indexOf(this.config.framework.unprotectedResources[t])>-1)return null;if(this.config.framework.protectedResourceMap.size>0)for(i=0,r=Array.from(this.config.framework.protectedResourceMap.keys());i<r.length;i++)if(u=r[i],n.indexOf(u)>-1)return this.config.framework.protectedResourceMap.get(u);if(n.indexOf("http://")>-1||n.indexOf("https://")>-1){if(f.UrlUtils.getHostFromUri(n)===f.UrlUtils.getHostFromUri(this.getRedirectUri()))return new Array(this.clientId)}else return new Array(this.clientId);return null},n.prototype.getLoginInProgress=function(){return this.cacheStorage.isInteractionInProgress(!0)},n.prototype.setInteractionInProgress=function(n){this.cacheStorage.setInteractionInProgress(n)},n.prototype.setloginInProgress=function(n){this.setInteractionInProgress(n)},n.prototype.getAcquireTokenInProgress=function(){return this.cacheStorage.isInteractionInProgress(!0)},n.prototype.setAcquireTokenInProgress=function(n){this.setInteractionInProgress(n)},n.prototype.getLogger=function(){return this.logger},n.prototype.setLogger=function(n){this.logger=n},n.prototype.getRedirectUri=function(n){return n?n:typeof this.config.auth.redirectUri=="function"?this.config.auth.redirectUri():this.config.auth.redirectUri},n.prototype.getPostLogoutRedirectUri=function(){return typeof this.config.auth.postLogoutRedirectUri=="function"?this.config.auth.postLogoutRedirectUri():this.config.auth.postLogoutRedirectUri},n.prototype.getCurrentConfiguration=function(){if(!this.config)throw b.ClientConfigurationError.createNoSetConfigurationError();return this.config},n.prototype.getTokenType=function(n,t){var i=p.Account.compareAccounts(n,this.getAccount());return a.ServerRequestParameters.determineResponseType(i,t)},n.prototype.setAccountCache=function(n,t){var i=n?this.getAccountId(n):r.Constants.no_account,f=u.AuthCache.generateAcquireTokenAccountKey(i,t);this.cacheStorage.setItem(f,JSON.stringify(n))},n.prototype.setAuthorityCache=function(n,t){var i=u.AuthCache.generateAuthorityKey(n);this.cacheStorage.setItem(i,f.UrlUtils.CanonicalizeUri(t),this.inCookie)},n.prototype.updateCacheEntries=function(n,t,i,f){f&&this.cacheStorage.setItem(u.AuthCache.generateTemporaryCacheKey(r.TemporaryCacheKeys.LOGIN_REQUEST,n.state),f,this.inCookie);i?this.cacheStorage.setItem(u.AuthCache.generateTemporaryCacheKey(r.TemporaryCacheKeys.STATE_LOGIN,n.state),n.state,this.inCookie):this.setAccountCache(t,n.state);this.setAuthorityCache(n.state,n.authority);this.cacheStorage.setItem(u.AuthCache.generateTemporaryCacheKey(r.TemporaryCacheKeys.NONCE_IDTOKEN,n.state),n.nonce,this.inCookie)},n.prototype.getAccountId=function(n){return h.StringUtils.isEmpty(n.homeAccountIdentifier)?r.Constants.no_account:n.homeAccountIdentifier},n.prototype.buildIDTokenRequest=function(n){return{scopes:r.Constants.oidcScopes,authority:this.authority,account:this.getAccount(),extraQueryParameters:n.extraQueryParameters,correlationId:n.correlationId}},n.prototype.getTelemetryManagerFromConfig=function(n,t){var f,e;if(!n)return ft.default.getTelemetrymanagerStub(t,this.logger);var i=n.applicationName,r=n.applicationVersion,u=n.telemetryEmitter;if(!i||!r||!u)throw b.ClientConfigurationError.createTelemetryConfigError(n);return f={applicationName:i,applicationVersion:r},e={platform:f,clientId:t},new ft.default(e,u,this.logger)},n}();t.UserAgentApplication=yt},767:function(n,t,i){Object.defineProperty(t,"__esModule",{value:!0});t.XhrClient=void 0;var r=i(91),u=function(){function n(){}return n.prototype.sendRequestAsync=function(n,t,i){var u=this;return new Promise(function(f,e){var o=new XMLHttpRequest;if(o.open(t,n,!0),i,o.onload=function(){var n,t;(o.status<200||o.status>=300)&&e(u.handleError(o.responseText));try{n=JSON.parse(o.responseText)}catch(i){e(u.handleError(o.responseText))}t={statusCode:o.status,body:n};f(t)},o.onerror=function(){e(o.status)},t===r.NetworkRequestType.GET)o.send();else throw"not implemented";})},n.prototype.handleError=function(n){var t;try{if(t=JSON.parse(n),t.error)return t.error;throw n;}catch(i){return n}},n}();t.XhrClient=u},660:function(n,t,i){var h;Object.defineProperty(t,"__esModule",{value:!0});t.Authority=t.AuthorityType=void 0;var s=i(795),r=i(550),c=i(767),e=i(741),o=i(405),u=i(91),f;(function(n){n[n.Default=0]="Default";n[n.Adfs=1]="Adfs"})(f=t.AuthorityType||(t.AuthorityType={}));h=function(){function n(n,t,i){this.IsValidationEnabled=t;this.CanonicalAuthority=n;this.validateAsUri();this.tenantDiscoveryResponse=i}return n.isAdfs=function(n){var i=e.UrlUtils.GetUrlComponents(n),t=i.PathSegments;return t.length&&t[0].toLowerCase()===u.Constants.ADFS},Object.defineProperty(n.prototype,"AuthorityType",{get:function(){return n.isAdfs(this.canonicalAuthority)?f.Adfs:f.Default},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"Tenant",{get:function(){return this.CanonicalAuthorityUrlComponents.PathSegments[0]},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"AuthorizationEndpoint",{get:function(){return this.validateResolved(),this.tenantDiscoveryResponse.AuthorizationEndpoint.replace(/{tenant}|{tenantid}/g,this.Tenant)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"EndSessionEndpoint",{get:function(){return this.validateResolved(),this.tenantDiscoveryResponse.EndSessionEndpoint.replace(/{tenant}|{tenantid}/g,this.Tenant)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"SelfSignedJwtAudience",{get:function(){return this.validateResolved(),this.tenantDiscoveryResponse.Issuer.replace(/{tenant}|{tenantid}/g,this.Tenant)},enumerable:!1,configurable:!0}),n.prototype.validateResolved=function(){if(!this.hasCachedMetadata())throw"Please call ResolveEndpointsAsync first";},Object.defineProperty(n.prototype,"CanonicalAuthority",{get:function(){return this.canonicalAuthority},set:function(n){this.canonicalAuthority=e.UrlUtils.CanonicalizeUri(n);this.canonicalAuthorityUrlComponents=null},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"CanonicalAuthorityUrlComponents",{get:function(){return this.canonicalAuthorityUrlComponents||(this.canonicalAuthorityUrlComponents=e.UrlUtils.GetUrlComponents(this.CanonicalAuthority)),this.canonicalAuthorityUrlComponents},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"DefaultOpenIdConfigurationEndpoint",{get:function(){return this.AuthorityType===f.Adfs?""+this.CanonicalAuthority+u.WELL_KNOWN_SUFFIX:this.CanonicalAuthority+"v2.0/"+u.WELL_KNOWN_SUFFIX},enumerable:!1,configurable:!0}),n.prototype.validateAsUri=function(){var n;try{n=this.CanonicalAuthorityUrlComponents}catch(t){throw r.ClientConfigurationErrorMessage.invalidAuthorityType;}if(!n.Protocol||n.Protocol.toLowerCase()!=="https:")throw r.ClientConfigurationErrorMessage.authorityUriInsecure;if(!n.PathSegments||n.PathSegments.length<1)throw r.ClientConfigurationErrorMessage.authorityUriInvalidPath;},n.prototype.DiscoverEndpoints=function(n,t,i){var e=new c.XhrClient,f=u.NetworkRequestType.GET,r=t.createAndStartHttpEvent(i,f,n,"openIdConfigurationEndpoint");return e.sendRequestAsync(n,f,!0).then(function(n){return r.httpResponseStatus=n.statusCode,t.stopEvent(r),{AuthorizationEndpoint:n.body.authorization_endpoint,EndSessionEndpoint:n.body.end_session_endpoint,Issuer:n.body.issuer}}).catch(function(n){r.serverErrorCode=n;t.stopEvent(r);throw n;})},n.prototype.resolveEndpointsAsync=function(n,t){return s.__awaiter(this,void 0,Promise,function(){var i,u,f;return s.__generator(this,function(e){switch(e.label){case 0:return this.IsValidationEnabled?(i=this.canonicalAuthorityUrlComponents.HostNameAndPort,!(o.TrustedAuthority.getTrustedHostList().length===0))?[3,2]:[4,o.TrustedAuthority.setTrustedAuthoritiesFromNetwork(this.canonicalAuthority,n,t)]:[3,3];case 1:e.sent();e.label=2;case 2:if(!o.TrustedAuthority.IsInTrustedHostList(i))throw r.ClientConfigurationError.createUntrustedAuthorityError(i);e.label=3;case 3:return u=this.GetOpenIdConfigurationEndpoint(),f=this,[4,this.DiscoverEndpoints(u,n,t)];case 4:return f.tenantDiscoveryResponse=e.sent(),[2,this.tenantDiscoveryResponse]}})})},n.prototype.hasCachedMetadata=function(){return!!(this.tenantDiscoveryResponse&&this.tenantDiscoveryResponse.AuthorizationEndpoint&&this.tenantDiscoveryResponse.EndSessionEndpoint&&this.tenantDiscoveryResponse.Issuer)},n.prototype.GetOpenIdConfigurationEndpoint=function(){return this.DefaultOpenIdConfigurationEndpoint},n}();t.Authority=h},951:function(n,t,i){Object.defineProperty(t,"__esModule",{value:!0});t.AuthorityFactory=void 0;var r=i(795),f=i(660),e=i(454),u=i(550),o=function(){function n(){}return n.saveMetadataFromNetwork=function(n,t,i){return r.__awaiter(this,void 0,Promise,function(){var u;return r.__generator(this,function(r){switch(r.label){case 0:return[4,n.resolveEndpointsAsync(t,i)];case 1:return u=r.sent(),this.metadataMap.set(n.CanonicalAuthority,u),[2,u]}})})},n.getMetadata=function(n){return this.metadataMap.get(n)},n.saveMetadataFromConfig=function(n,t){try{if(t){var i=JSON.parse(t);if(!i.authorization_endpoint||!i.end_session_endpoint||!i.issuer)throw u.ClientConfigurationError.createInvalidAuthorityMetadataError();this.metadataMap.set(n,{AuthorizationEndpoint:i.authorization_endpoint,EndSessionEndpoint:i.end_session_endpoint,Issuer:i.issuer})}}catch(r){throw u.ClientConfigurationError.createInvalidAuthorityMetadataError();}},n.CreateInstance=function(n,t,i){return e.StringUtils.isEmpty(n)?null:(i&&this.saveMetadataFromConfig(n,i),new f.Authority(n,t,this.metadataMap.get(n)))},n.metadataMap=new Map,n}();t.AuthorityFactory=o},405:function(n,t,i){Object.defineProperty(t,"__esModule",{value:!0});t.TrustedAuthority=void 0;var r=i(795),f=i(767),u=i(91),e=i(741),o=function(){function n(){}return n.setTrustedAuthoritiesFromConfig=function(t,i){t&&!this.getTrustedHostList().length&&i.forEach(function(t){n.TrustedHostList.push(t.toLowerCase())})},n.getAliases=function(n,t,i){return r.__awaiter(this,void 0,Promise,function(){var h,o,s,e;return r.__generator(this,function(){return h=new f.XhrClient,o=u.NetworkRequestType.GET,s=""+u.AAD_INSTANCE_DISCOVERY_ENDPOINT+n+"oauth2/v2.0/authorize",e=t.createAndStartHttpEvent(i,o,s,"getAliases"),[2,h.sendRequestAsync(s,o,!0).then(function(n){return e.httpResponseStatus=n.statusCode,t.stopEvent(e),n.body.metadata}).catch(function(n){e.serverErrorCode=n;t.stopEvent(e);throw n;})]})})},n.setTrustedAuthoritiesFromNetwork=function(t,i,u){return r.__awaiter(this,void 0,Promise,function(){var o,f;return r.__generator(this,function(r){switch(r.label){case 0:return[4,this.getAliases(t,i,u)];case 1:return o=r.sent(),o.forEach(function(t){var i=t.aliases;i.forEach(function(t){n.TrustedHostList.push(t.toLowerCase())})}),f=e.UrlUtils.GetUrlComponents(t).HostNameAndPort,n.getTrustedHostList().length&&!n.IsInTrustedHostList(f)&&n.TrustedHostList.push(f.toLowerCase()),[2]}})})},n.getTrustedHostList=function(){return this.TrustedHostList},n.IsInTrustedHostList=function(n){return this.TrustedHostList.indexOf(n.toLowerCase())>-1},n.TrustedHostList=[],n}();t.TrustedAuthority=o},644:function(n,t){Object.defineProperty(t,"__esModule",{value:!0});t.AccessTokenCacheItem=void 0;var i=function(){function n(n,t){this.key=n;this.value=t}return n}();t.AccessTokenCacheItem=i},29:function(n,t,i){Object.defineProperty(t,"__esModule",{value:!0});t.AccessTokenKey=void 0;var r=i(453),u=i(741),f=function(){function n(n,t,i,f,e){this.authority=u.UrlUtils.CanonicalizeUri(n);this.clientId=t;this.scopes=i;this.homeAccountIdentifier=r.CryptoUtils.base64Encode(f)+"."+r.CryptoUtils.base64Encode(e)}return n}();t.AccessTokenKey=f},192:function(n,t){Object.defineProperty(t,"__esModule",{value:!0});t.AccessTokenValue=void 0;var i=function(){function n(n,t,i,r){this.accessToken=n;this.idToken=t;this.expiresIn=i;this.homeAccountIdentifier=r}return n}();t.AccessTokenValue=i},226:function(n,t,i){Object.defineProperty(t,"__esModule",{value:!0});t.AuthCache=void 0;var f=i(795),r=i(91),o=i(644),e=i(96),u=i(52),s=i(454),h=i(881),c=i(356),l=function(n){function t(t,i,u){var f=n.call(this,i)||this;return f.temporaryCache=new e.BrowserStorage(r.SESSION_STORAGE),f.clientId=t,f.rollbackEnabled=!0,f.migrateCacheEntries(u),f}return f.__extends(t,n),t.prototype.migrateCacheEntries=function(t){var f=this,e=r.Constants.cachePrefix+"."+r.PersistentCacheKeys.IDTOKEN,o=r.Constants.cachePrefix+"."+r.PersistentCacheKeys.CLIENT_INFO,s=r.Constants.cachePrefix+"."+r.ErrorCacheKeys.ERROR,c=r.Constants.cachePrefix+"."+r.ErrorCacheKeys.ERROR_DESC,u=n.prototype.getItem.call(this,e),i;if(u)try{i=new h.IdToken(u)}catch(w){return}if(i&&i.claims&&i.claims.aud===this.clientId){var l=n.prototype.getItem.call(this,o),a=n.prototype.getItem.call(this,s),v=n.prototype.getItem.call(this,c),y=[u,l,a,v],p=[r.PersistentCacheKeys.IDTOKEN,r.PersistentCacheKeys.CLIENT_INFO,r.ErrorCacheKeys.ERROR,r.ErrorCacheKeys.ERROR_DESC];p.forEach(function(n,i){return f.duplicateCacheEntry(n,y[i],t)})}},t.prototype.duplicateCacheEntry=function(n,t,i){t&&this.setItem(n,t,i)},t.prototype.generateCacheKey=function(n,t){try{return JSON.parse(n),n}catch(i){return n.indexOf(""+r.Constants.cachePrefix)===0||n.indexOf(r.Constants.adalIdToken)===0?n:t?r.Constants.cachePrefix+"."+this.clientId+"."+n:r.Constants.cachePrefix+"."+n}},t.prototype.matchKeyForType=function(n,t,i,u){var e=s.StringUtils.validateAndParseJsonCacheKey(n),o,f;if(!e)return null;o=n.match(t)&&n.match(i);f=!1;switch(u){case r.ServerHashParamKeys.ACCESS_TOKEN:f=!!n.match(r.Constants.scopes);break;case r.ServerHashParamKeys.ID_TOKEN:f=!n.match(r.Constants.scopes)}return o&&f?e:null},t.prototype.setItem=function(t,i,r){n.prototype.setItem.call(this,this.generateCacheKey(t,!0),i,r);this.rollbackEnabled&&!r&&n.prototype.setItem.call(this,this.generateCacheKey(t,!1),i,r)},t.prototype.getItem=function(t,i){return n.prototype.getItem.call(this,this.generateCacheKey(t,!0),i)},t.prototype.removeItem=function(t){this.temporaryCache.removeItem(this.generateCacheKey(t,!0));n.prototype.removeItem.call(this,this.generateCacheKey(t,!0));this.rollbackEnabled&&n.prototype.removeItem.call(this,this.generateCacheKey(t,!1))},t.prototype.setTemporaryItem=function(n,t,i){this.temporaryCache.setItem(this.generateCacheKey(n,!0),t,i)},t.prototype.getTemporaryItem=function(n,t){return this.temporaryCache.getItem(this.generateCacheKey(n,!0),t)},t.prototype.resetCacheItems=function(){var i=window[this.cacheLocation];for(var t in i)i.hasOwnProperty(t)&&t.indexOf(r.Constants.cachePrefix)!==-1&&n.prototype.removeItem.call(this,t)},t.prototype.resetTempCacheItems=function(t){var i=this,f=t&&u.RequestUtils.parseLibraryState(t).id,e=this.tokenRenewalInProgress(t),o=window[this.cacheLocation];f&&!e&&Object.keys(o).forEach(function(t){t.indexOf(f)!==-1&&(i.removeItem(t),n.prototype.clearItemCookie.call(i,t))});this.setInteractionInProgress(!1);this.removeItem(r.TemporaryCacheKeys.REDIRECT_REQUEST)},t.prototype.setItemCookie=function(t,i,r){n.prototype.setItemCookie.call(this,this.generateCacheKey(t,!0),i,r);this.rollbackEnabled&&n.prototype.setItemCookie.call(this,this.generateCacheKey(t,!1),i,r)},t.prototype.clearItemCookie=function(t){n.prototype.clearItemCookie.call(this,this.generateCacheKey(t,!0));this.rollbackEnabled&&n.prototype.clearItemCookie.call(this,this.generateCacheKey(t,!1))},t.prototype.getItemCookie=function(t){return n.prototype.getItemCookie.call(this,this.generateCacheKey(t,!0))},t.prototype.getAllTokensByType=function(n,t,i){var r=this;return Object.keys(window[this.cacheLocation]).reduce(function(u,f){var s=r.matchKeyForType(f,n,t,i),e,h;if(s&&(e=r.getItem(f),e))try{return h=new o.AccessTokenCacheItem(s,JSON.parse(e)),u.concat([h])}catch(c){return u}return u},[])},t.prototype.getAllAccessTokens=function(n,t){return this.getAllTokensByType(n,t,r.ServerHashParamKeys.ACCESS_TOKEN)},t.prototype.getAllIdTokens=function(n,t){return this.getAllTokensByType(n,t,r.ServerHashParamKeys.ID_TOKEN)},t.prototype.getAllTokens=function(n,t){var i=this.getAllAccessTokens(n,t),r=this.getAllIdTokens(n,t);return f.__spreadArrays(i,r)},t.prototype.isInteractionInProgress=function(n){var t=this.getInteractionInProgress();return n?t===this.clientId:!!t},t.prototype.getInteractionInProgress=function(){return this.getTemporaryItem(this.generateCacheKey(r.TemporaryCacheKeys.INTERACTION_STATUS,!1))},t.prototype.setInteractionInProgress=function(n){if(n)if(this.isInteractionInProgress(!1))throw c.ClientAuthError.createAcquireTokenInProgressError();else this.setTemporaryItem(this.generateCacheKey(r.TemporaryCacheKeys.INTERACTION_STATUS,!1),this.clientId);else!n&&this.isInteractionInProgress(!0)&&this.removeItem(this.generateCacheKey(r.TemporaryCacheKeys.INTERACTION_STATUS,!1))},t.prototype.tokenRenewalInProgress=function(n){var i=this.getItem(t.generateTemporaryCacheKey(r.TemporaryCacheKeys.RENEW_STATUS,n));return!!(i&&i===r.Constants.inProgress)},t.prototype.clearMsalCookie=function(i){var f=this,u;i?(this.clearItemCookie(t.generateTemporaryCacheKey(r.TemporaryCacheKeys.NONCE_IDTOKEN,i)),this.clearItemCookie(t.generateTemporaryCacheKey(r.TemporaryCacheKeys.STATE_LOGIN,i)),this.clearItemCookie(t.generateTemporaryCacheKey(r.TemporaryCacheKeys.LOGIN_REQUEST,i)),this.clearItemCookie(t.generateTemporaryCacheKey(r.TemporaryCacheKeys.STATE_ACQ_TOKEN,i))):(u=document.cookie.split(";"),u.forEach(function(t){var i=t.trim().split("=")[0];i.indexOf(r.Constants.cachePrefix)>-1&&n.prototype.clearItemCookie.call(f,i)}))},t.generateAcquireTokenAccountKey=function(n,t){var i=u.RequestUtils.parseLibraryState(t).id;return""+r.TemporaryCacheKeys.ACQUIRE_TOKEN_ACCOUNT+r.Constants.resourceDelimiter+n+r.Constants.resourceDelimiter+i},t.generateAuthorityKey=function(n){return t.generateTemporaryCacheKey(r.TemporaryCacheKeys.AUTHORITY,n)},t.generateTemporaryCacheKey=function(n,t){var i=u.RequestUtils.parseLibraryState(t).id;return""+n+r.Constants.resourceDelimiter+i},t}(e.BrowserStorage);t.AuthCache=l},96:function(n,t,i){Object.defineProperty(t,"__esModule",{value:!0});t.BrowserStorage=void 0;var r=i(550),u=i(986),f=function(){function n(n){if(!window)throw u.AuthError.createNoWindowObjectError("Browser storage class could not find window object");var t=typeof window[n]!="undefined"&&window[n]!==null;if(!t)throw r.ClientConfigurationError.createStorageNotSupportedError(n);this.cacheLocation=n}return n.prototype.setItem=function(n,t,i){window[this.cacheLocation].setItem(n,t);i&&this.setItemCookie(n,t)},n.prototype.getItem=function(n,t){return t&&this.getItemCookie(n)?this.getItemCookie(n):window[this.cacheLocation].getItem(n)},n.prototype.removeItem=function(n){return window[this.cacheLocation].removeItem(n)},n.prototype.clear=function(){return window[this.cacheLocation].clear()},n.prototype.setItemCookie=function(n,t,i){var r=encodeURIComponent(n)+"="+encodeURIComponent(t)+";path=/;",u;i&&(u=this.getCookieExpirationTime(i),r+="expires="+u+";");document.cookie=r},n.prototype.getItemCookie=function(n){for(var t,r=encodeURIComponent(n)+"=",u=document.cookie.split(";"),i=0;i<u.length;i++){for(t=u[i];t.charAt(0)===" ";)t=t.substring(1);if(t.indexOf(r)===0)return decodeURIComponent(t.substring(r.length,t.length))}return""},n.prototype.clearItemCookie=function(n){this.setItemCookie(n,"",-1)},n.prototype.getCookieExpirationTime=function(n){var t=new Date,i=new Date(t.getTime()+n*864e5);return i.toUTCString()},n}();t.BrowserStorage=f},986:function(n,t,i){var r,u;Object.defineProperty(t,"__esModule",{value:!0});t.AuthError=t.AuthErrorMessage=void 0;r=i(795);t.AuthErrorMessage={unexpectedError:{code:"unexpected_error",desc:"Unexpected error in authentication."},noWindowObjectError:{code:"no_window_object",desc:"No window object available. Details:"}};u=function(n){function i(t,r){var u=n.call(this,r)||this;return Object.setPrototypeOf(u,i.prototype),u.errorCode=t,u.errorMessage=r,u.name="AuthError",u}return r.__extends(i,n),i.createUnexpectedError=function(n){return new i(t.AuthErrorMessage.unexpectedError.code,t.AuthErrorMessage.unexpectedError.desc+": "+n)},i.createNoWindowObjectError=function(n){return new i(t.AuthErrorMessage.noWindowObjectError.code,t.AuthErrorMessage.noWindowObjectError.desc+" "+n)},i}(Error);t.AuthError=u},356:function(n,t,i){var u;Object.defineProperty(t,"__esModule",{value:!0});t.ClientAuthError=t.ClientAuthErrorMessage=void 0;var f=i(795),e=i(986),r=i(454);t.ClientAuthErrorMessage={endpointResolutionError:{code:"endpoints_resolution_error",desc:"Error: could not resolve endpoints. Please check network and try again."},popUpWindowError:{code:"popup_window_error",desc:"Error opening popup window. This can happen if you are using IE or if popups are blocked in the browser."},tokenRenewalError:{code:"token_renewal_error",desc:"Token renewal operation failed due to timeout."},invalidIdToken:{code:"invalid_id_token",desc:"Invalid ID token format."},invalidStateError:{code:"invalid_state_error",desc:"Invalid state."},nonceMismatchError:{code:"nonce_mismatch_error",desc:"Nonce is not matching, Nonce received: "},loginProgressError:{code:"login_progress_error",desc:"Login_In_Progress: Error during login call - login is already in progress."},acquireTokenProgressError:{code:"acquiretoken_progress_error",desc:"AcquireToken_In_Progress: Error during login call - login is already in progress."},userCancelledError:{code:"user_cancelled",desc:"User cancelled the flow."},callbackError:{code:"callback_error",desc:"Error occurred in token received callback function."},userLoginRequiredError:{code:"user_login_error",desc:"User login is required. For silent calls, request must contain either sid or login_hint"},userDoesNotExistError:{code:"user_non_existent",desc:"User object does not exist. Please call a login API."},clientInfoDecodingError:{code:"client_info_decoding_error",desc:"The client info could not be parsed/decoded correctly. Please review the trace to determine the root cause."},clientInfoNotPopulatedError:{code:"client_info_not_populated_error",desc:"The service did not populate client_info in the response, Please verify with the service team"},nullOrEmptyIdToken:{code:"null_or_empty_id_token",desc:"The idToken is null or empty. Please review the trace to determine the root cause."},idTokenNotParsed:{code:"id_token_parsing_error",desc:"ID token cannot be parsed. Please review stack trace to determine root cause."},tokenEncodingError:{code:"token_encoding_error",desc:"The token to be decoded is not encoded correctly."},invalidInteractionType:{code:"invalid_interaction_type",desc:"The interaction type passed to the handler was incorrect or unknown"},cacheParseError:{code:"cannot_parse_cache",desc:"The cached token key is not a valid JSON and cannot be parsed"},blockTokenRequestsInHiddenIframe:{code:"block_token_requests",desc:"Token calls are blocked in hidden iframes"}};u=function(n){function i(t,r){var u=n.call(this,t,r)||this;return u.name="ClientAuthError",Object.setPrototypeOf(u,i.prototype),u}return f.__extends(i,n),i.createEndpointResolutionError=function(n){var u=t.ClientAuthErrorMessage.endpointResolutionError.desc;return n&&!r.StringUtils.isEmpty(n)&&(u+=" Details: "+n),new i(t.ClientAuthErrorMessage.endpointResolutionError.code,u)},i.createPopupWindowError=function(n){var u=t.ClientAuthErrorMessage.popUpWindowError.desc;return n&&!r.StringUtils.isEmpty(n)&&(u+=" Details: "+n),new i(t.ClientAuthErrorMessage.popUpWindowError.code,u)},i.createTokenRenewalTimeoutError=function(){return new i(t.ClientAuthErrorMessage.tokenRenewalError.code,t.ClientAuthErrorMessage.tokenRenewalError.desc)},i.createInvalidIdTokenError=function(n){return new i(t.ClientAuthErrorMessage.invalidIdToken.code,t.ClientAuthErrorMessage.invalidIdToken.desc+" Given token: "+n)},i.createInvalidStateError=function(n,r){return new i(t.ClientAuthErrorMessage.invalidStateError.code,t.ClientAuthErrorMessage.invalidStateError.desc+" "+n+", state expected : "+r+".")},i.createNonceMismatchError=function(n,r){return new i(t.ClientAuthErrorMessage.nonceMismatchError.code,t.ClientAuthErrorMessage.nonceMismatchError.desc+" "+n+", nonce expected : "+r+".")},i.createLoginInProgressError=function(){return new i(t.ClientAuthErrorMessage.loginProgressError.code,t.ClientAuthErrorMessage.loginProgressError.desc)},i.createAcquireTokenInProgressError=function(){return new i(t.ClientAuthErrorMessage.acquireTokenProgressError.code,t.ClientAuthErrorMessage.acquireTokenProgressError.desc)},i.createUserCancelledError=function(){return new i(t.ClientAuthErrorMessage.userCancelledError.code,t.ClientAuthErrorMessage.userCancelledError.desc)},i.createErrorInCallbackFunction=function(n){return new i(t.ClientAuthErrorMessage.callbackError.code,t.ClientAuthErrorMessage.callbackError.desc+" "+n+".")},i.createUserLoginRequiredError=function(){return new i(t.ClientAuthErrorMessage.userLoginRequiredError.code,t.ClientAuthErrorMessage.userLoginRequiredError.desc)},i.createUserDoesNotExistError=function(){return new i(t.ClientAuthErrorMessage.userDoesNotExistError.code,t.ClientAuthErrorMessage.userDoesNotExistError.desc)},i.createClientInfoDecodingError=function(n){return new i(t.ClientAuthErrorMessage.clientInfoDecodingError.code,t.ClientAuthErrorMessage.clientInfoDecodingError.desc+" Failed with error: "+n)},i.createClientInfoNotPopulatedError=function(n){return new i(t.ClientAuthErrorMessage.clientInfoNotPopulatedError.code,t.ClientAuthErrorMessage.clientInfoNotPopulatedError.desc+" Failed with error: "+n)},i.createIdTokenNullOrEmptyError=function(n){return new i(t.ClientAuthErrorMessage.nullOrEmptyIdToken.code,t.ClientAuthErrorMessage.nullOrEmptyIdToken.desc+" Raw ID Token Value: "+n)},i.createIdTokenParsingError=function(n){return new i(t.ClientAuthErrorMessage.idTokenNotParsed.code,t.ClientAuthErrorMessage.idTokenNotParsed.desc+" Failed with error: "+n)},i.createTokenEncodingError=function(n){return new i(t.ClientAuthErrorMessage.tokenEncodingError.code,t.ClientAuthErrorMessage.tokenEncodingError.desc+" Attempted to decode: "+n)},i.createInvalidInteractionTypeError=function(){return new i(t.ClientAuthErrorMessage.invalidInteractionType.code,t.ClientAuthErrorMessage.invalidInteractionType.desc)},i.createCacheParseError=function(n){var r="invalid key: "+n+", "+t.ClientAuthErrorMessage.cacheParseError.desc;return new i(t.ClientAuthErrorMessage.cacheParseError.code,r)},i.createBlockTokenRequestsInHiddenIframeError=function(){return new i(t.ClientAuthErrorMessage.blockTokenRequestsInHiddenIframe.code,t.ClientAuthErrorMessage.blockTokenRequestsInHiddenIframe.desc)},i}(e.AuthError);t.ClientAuthError=u},550:function(n,t,i){var r,u,f;Object.defineProperty(t,"__esModule",{value:!0});t.ClientConfigurationError=t.ClientConfigurationErrorMessage=void 0;r=i(795);u=i(356);t.ClientConfigurationErrorMessage={configurationNotSet:{code:"no_config_set",desc:"Configuration has not been set. Please call the UserAgentApplication constructor with a valid Configuration object."},storageNotSupported:{code:"storage_not_supported",desc:"The value for the cacheLocation is not supported."},noRedirectCallbacksSet:{code:"no_redirect_callbacks",desc:"No redirect callbacks have been set. Please call handleRedirectCallback() with the appropriate function arguments before continuing. More information is available here: https://github.com/AzureAD/microsoft-authentication-library-for-js/wiki/MSAL-basics."},invalidCallbackObject:{code:"invalid_callback_object",desc:"The object passed for the callback was invalid. More information is available here: https://github.com/AzureAD/microsoft-authentication-library-for-js/wiki/MSAL-basics."},scopesRequired:{code:"scopes_required",desc:"Scopes are required to obtain an access token."},emptyScopes:{code:"empty_input_scopes_error",desc:"Scopes cannot be passed as empty array."},nonArrayScopes:{code:"nonarray_input_scopes_error",desc:"Scopes cannot be passed as non-array."},invalidPrompt:{code:"invalid_prompt_value",desc:"Supported prompt values are 'login', 'select_account', 'consent' and 'none'"},invalidAuthorityType:{code:"invalid_authority_type",desc:"The given authority is not a valid type of authority supported by MSAL. Please see here for valid authorities: <insert URL here>."},authorityUriInsecure:{code:"authority_uri_insecure",desc:"Authority URIs must use https."},authorityUriInvalidPath:{code:"authority_uri_invalid_path",desc:"Given authority URI is invalid."},unsupportedAuthorityValidation:{code:"unsupported_authority_validation",desc:"The authority validation is not supported for this authority type."},untrustedAuthority:{code:"untrusted_authority",desc:"The provided authority is not a trusted authority. Please include this authority in the knownAuthorities config parameter or set validateAuthority=false."},b2cAuthorityUriInvalidPath:{code:"b2c_authority_uri_invalid_path",desc:"The given URI for the B2C authority is invalid."},b2cKnownAuthoritiesNotSet:{code:"b2c_known_authorities_not_set",desc:"Must set known authorities when validateAuthority is set to True and using B2C"},claimsRequestParsingError:{code:"claims_request_parsing_error",desc:"Could not parse the given claims request object."},emptyRequestError:{code:"empty_request_error",desc:"Request object is required."},invalidCorrelationIdError:{code:"invalid_guid_sent_as_correlationId",desc:"Please set the correlationId as a valid guid"},telemetryConfigError:{code:"telemetry_config_error",desc:"Telemetry config is not configured with required values"},ssoSilentError:{code:"sso_silent_error",desc:"request must contain either sid or login_hint"},invalidAuthorityMetadataError:{code:"authority_metadata_error",desc:"Invalid authorityMetadata. Must be a JSON object containing authorization_endpoint, end_session_endpoint, and issuer fields."}};f=function(n){function i(t,r){var u=n.call(this,t,r)||this;return u.name="ClientConfigurationError",Object.setPrototypeOf(u,i.prototype),u}return r.__extends(i,n),i.createNoSetConfigurationError=function(){return new i(t.ClientConfigurationErrorMessage.configurationNotSet.code,""+t.ClientConfigurationErrorMessage.configurationNotSet.desc)},i.createStorageNotSupportedError=function(n){return new i(t.ClientConfigurationErrorMessage.storageNotSupported.code,t.ClientConfigurationErrorMessage.storageNotSupported.desc+" Given location: "+n)},i.createRedirectCallbacksNotSetError=function(){return new i(t.ClientConfigurationErrorMessage.noRedirectCallbacksSet.code,t.ClientConfigurationErrorMessage.noRedirectCallbacksSet.desc)},i.createInvalidCallbackObjectError=function(n){return new i(t.ClientConfigurationErrorMessage.invalidCallbackObject.code,t.ClientConfigurationErrorMessage.invalidCallbackObject.desc+" Given value for callback function: "+n)},i.createEmptyScopesArrayError=function(n){return new i(t.ClientConfigurationErrorMessage.emptyScopes.code,t.ClientConfigurationErrorMessage.emptyScopes.desc+" Given value: "+n+".")},i.createScopesNonArrayError=function(n){return new i(t.ClientConfigurationErrorMessage.nonArrayScopes.code,t.ClientConfigurationErrorMessage.nonArrayScopes.desc+" Given value: "+n+".")},i.createScopesRequiredError=function(n){return new i(t.ClientConfigurationErrorMessage.scopesRequired.code,t.ClientConfigurationErrorMessage.scopesRequired.desc+" Given value: "+n)},i.createInvalidPromptError=function(n){return new i(t.ClientConfigurationErrorMessage.invalidPrompt.code,t.ClientConfigurationErrorMessage.invalidPrompt.desc+" Given value: "+n)},i.createClaimsRequestParsingError=function(n){return new i(t.ClientConfigurationErrorMessage.claimsRequestParsingError.code,t.ClientConfigurationErrorMessage.claimsRequestParsingError.desc+" Given value: "+n)},i.createEmptyRequestError=function(){var n=t.ClientConfigurationErrorMessage.emptyRequestError,r=n.code,u=n.desc;return new i(r,u)},i.createInvalidCorrelationIdError=function(){return new i(t.ClientConfigurationErrorMessage.invalidCorrelationIdError.code,t.ClientConfigurationErrorMessage.invalidCorrelationIdError.desc)},i.createKnownAuthoritiesNotSetError=function(){return new i(t.ClientConfigurationErrorMessage.b2cKnownAuthoritiesNotSet.code,t.ClientConfigurationErrorMessage.b2cKnownAuthoritiesNotSet.desc)},i.createInvalidAuthorityTypeError=function(){return new i(t.ClientConfigurationErrorMessage.invalidAuthorityType.code,t.ClientConfigurationErrorMessage.invalidAuthorityType.desc)},i.createUntrustedAuthorityError=function(n){return new i(t.ClientConfigurationErrorMessage.untrustedAuthority.code,t.ClientConfigurationErrorMessage.untrustedAuthority.desc+" Provided Authority: "+n)},i.createTelemetryConfigError=function(n){var r=t.ClientConfigurationErrorMessage.telemetryConfigError,f=r.code,e=r.desc,u={applicationName:"string",applicationVersion:"string",telemetryEmitter:"function"},o=Object.keys(u).reduce(function(t,i){return n[i]?t:t.concat([i+" ("+u[i]+")"])},[]);return new i(f,e+" mising values: "+o.join(","))},i.createSsoSilentError=function(){return new i(t.ClientConfigurationErrorMessage.ssoSilentError.code,t.ClientConfigurationErrorMessage.ssoSilentError.desc)},i.createInvalidAuthorityMetadataError=function(){return new i(t.ClientConfigurationErrorMessage.invalidAuthorityMetadataError.code,t.ClientConfigurationErrorMessage.invalidAuthorityMetadataError.desc)},i}(u.ClientAuthError);t.ClientConfigurationError=f},961:function(n,t,i){var r,u,f;Object.defineProperty(t,"__esModule",{value:!0});t.InteractionRequiredAuthError=t.InteractionRequiredAuthErrorMessage=void 0;r=i(795);u=i(447);t.InteractionRequiredAuthErrorMessage={interactionRequired:{code:"interaction_required"},consentRequired:{code:"consent_required"},loginRequired:{code:"login_required"}};f=function(n){function i(t,r){var u=n.call(this,t,r)||this;return u.name="InteractionRequiredAuthError",Object.setPrototypeOf(u,i.prototype),u}return r.__extends(i,n),i.isInteractionRequiredError=function(n){var i=[t.InteractionRequiredAuthErrorMessage.interactionRequired.code,t.InteractionRequiredAuthErrorMessage.consentRequired.code,t.InteractionRequiredAuthErrorMessage.loginRequired.code];return n&&i.indexOf(n)>-1},i.createLoginRequiredAuthError=function(n){return new i(t.InteractionRequiredAuthErrorMessage.loginRequired.code,n)},i.createInteractionRequiredAuthError=function(n){return new i(t.InteractionRequiredAuthErrorMessage.interactionRequired.code,n)},i.createConsentRequiredAuthError=function(n){return new i(t.InteractionRequiredAuthErrorMessage.consentRequired.code,n)},i}(u.ServerError);t.InteractionRequiredAuthError=f},447:function(n,t,i){var r,u,f;Object.defineProperty(t,"__esModule",{value:!0});t.ServerError=t.ServerErrorMessage=void 0;r=i(795);u=i(986);t.ServerErrorMessage={serverUnavailable:{code:"server_unavailable",desc:"Server is temporarily unavailable."},unknownServerError:{code:"unknown_server_error"}};f=function(n){function i(t,r){var u=n.call(this,t,r)||this;return u.name="ServerError",Object.setPrototypeOf(u,i.prototype),u}return r.__extends(i,n),i.createServerUnavailableError=function(){return new i(t.ServerErrorMessage.serverUnavailable.code,t.ServerErrorMessage.serverUnavailable.desc)},i.createUnknownServerError=function(n){return new i(t.ServerErrorMessage.unknownServerError.code,n)},i}(u.AuthError);t.ServerError=f},700:function(n,t){Object.defineProperty(t,"__esModule",{value:!0});t.version=t.name=void 0;t.name="msal";t.version="1.4.17"},663:function(n,t,i){var u,f,e,h,c;Object.defineProperty(t,"__esModule",{value:!0});t.API_EVENT_IDENTIFIER=t.API_CODE=t.EVENT_KEYS=void 0;var o=i(795),l=o.__importDefault(i(336)),s=i(810),r=i(847);t.EVENT_KEYS={AUTHORITY:r.prependEventNamePrefix("authority"),AUTHORITY_TYPE:r.prependEventNamePrefix("authority_type"),PROMPT:r.prependEventNamePrefix("ui_behavior"),TENANT_ID:r.prependEventNamePrefix("tenant_id"),USER_ID:r.prependEventNamePrefix("user_id"),WAS_SUCESSFUL:r.prependEventNamePrefix("was_successful"),API_ERROR_CODE:r.prependEventNamePrefix("api_error_code"),LOGIN_HINT:r.prependEventNamePrefix("login_hint")},function(n){n[n.AcquireTokenRedirect=2001]="AcquireTokenRedirect";n[n.AcquireTokenSilent=2002]="AcquireTokenSilent";n[n.AcquireTokenPopup=2003]="AcquireTokenPopup";n[n.LoginRedirect=2004]="LoginRedirect";n[n.LoginPopup=2005]="LoginPopup";n[n.Logout=2006]="Logout"}(f=t.API_CODE||(t.API_CODE={})),function(n){n.AcquireTokenRedirect="AcquireTokenRedirect";n.AcquireTokenSilent="AcquireTokenSilent";n.AcquireTokenPopup="AcquireTokenPopup";n.LoginRedirect="LoginRedirect";n.LoginPopup="LoginPopup";n.Logout="Logout"}(e=t.API_EVENT_IDENTIFIER||(t.API_EVENT_IDENTIFIER={}));h=(u={},u[e.AcquireTokenSilent]=f.AcquireTokenSilent,u[e.AcquireTokenPopup]=f.AcquireTokenPopup,u[e.AcquireTokenRedirect]=f.AcquireTokenRedirect,u[e.LoginPopup]=f.LoginPopup,u[e.LoginRedirect]=f.LoginRedirect,u[e.Logout]=f.Logout,u);c=function(n){function i(t,i,u){var f=n.call(this,r.prependEventNamePrefix("api_event"),t,u)||this;return u&&(f.apiCode=h[u],f.apiEventIdentifier=u),f.piiEnabled=i,f}return o.__extends(i,n),Object.defineProperty(i.prototype,"apiEventIdentifier",{set:function(n){this.event[s.TELEMETRY_BLOB_EVENT_NAMES.ApiTelemIdConstStrKey]=n},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"apiCode",{set:function(n){this.event[s.TELEMETRY_BLOB_EVENT_NAMES.ApiIdConstStrKey]=n},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"authority",{set:function(n){this.event[t.EVENT_KEYS.AUTHORITY]=r.scrubTenantFromUri(n).toLowerCase()},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"apiErrorCode",{set:function(n){this.event[t.EVENT_KEYS.API_ERROR_CODE]=n},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"tenantId",{set:function(n){this.event[t.EVENT_KEYS.TENANT_ID]=this.piiEnabled&&n?r.hashPersonalIdentifier(n):null},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"accountId",{set:function(n){this.event[t.EVENT_KEYS.USER_ID]=this.piiEnabled&&n?r.hashPersonalIdentifier(n):null},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"wasSuccessful",{get:function(){return this.event[t.EVENT_KEYS.WAS_SUCESSFUL]===!0},set:function(n){this.event[t.EVENT_KEYS.WAS_SUCESSFUL]=n},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"loginHint",{set:function(n){this.event[t.EVENT_KEYS.LOGIN_HINT]=this.piiEnabled&&n?r.hashPersonalIdentifier(n):null},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"authorityType",{set:function(n){this.event[t.EVENT_KEYS.AUTHORITY_TYPE]=n.toLowerCase()},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"promptType",{set:function(n){this.event[t.EVENT_KEYS.PROMPT]=n.toLowerCase()},enumerable:!1,configurable:!0}),i}(l.default);t["default"]=c},868:function(n,t,i){Object.defineProperty(t,"__esModule",{value:!0});var f=i(795),u=i(810),e=f.__importDefault(i(336)),r=i(847),o=function(n){function t(t,i,f,e){var o=n.call(this,r.prependEventNamePrefix("default_event"),i,"DefaultEvent")||this;return o.event[r.prependEventNamePrefix("client_id")]=f,o.event[r.prependEventNamePrefix("sdk_plaform")]=t.sdk,o.event[r.prependEventNamePrefix("sdk_version")]=t.sdkVersion,o.event[r.prependEventNamePrefix("application_name")]=t.applicationName,o.event[r.prependEventNamePrefix("application_version")]=t.applicationVersion,o.event[r.prependEventNamePrefix("effective_connection_speed")]=t.networkInformation&&t.networkInformation.connectionSpeed,o.event[""+u.TELEMETRY_BLOB_EVENT_NAMES.UiEventCountTelemetryBatchKey]=o.getEventCount(r.prependEventNamePrefix("ui_event"),e),o.event[""+u.TELEMETRY_BLOB_EVENT_NAMES.HttpEventCountTelemetryBatchKey]=o.getEventCount(r.prependEventNamePrefix("http_event"),e),o.event[""+u.TELEMETRY_BLOB_EVENT_NAMES.CacheEventCountConstStrKey]=o.getEventCount(r.prependEventNamePrefix("cache_event"),e),o}return f.__extends(t,n),t.prototype.getEventCount=function(n,t){return t[n]?t[n]:0},t}(e.default);t["default"]=o},140:function(n,t,i){var f;Object.defineProperty(t,"__esModule",{value:!0});t.EVENT_KEYS=void 0;var u=i(795),e=u.__importDefault(i(336)),r=i(847),o=i(436);t.EVENT_KEYS={HTTP_PATH:r.prependEventNamePrefix("http_path"),USER_AGENT:r.prependEventNamePrefix("user_agent"),QUERY_PARAMETERS:r.prependEventNamePrefix("query_parameters"),API_VERSION:r.prependEventNamePrefix("api_version"),RESPONSE_CODE:r.prependEventNamePrefix("response_code"),O_AUTH_ERROR_CODE:r.prependEventNamePrefix("oauth_error_code"),HTTP_METHOD:r.prependEventNamePrefix("http_method"),REQUEST_ID_HEADER:r.prependEventNamePrefix("request_id_header"),SPE_INFO:r.prependEventNamePrefix("spe_info"),SERVER_ERROR_CODE:r.prependEventNamePrefix("server_error_code"),SERVER_SUB_ERROR_CODE:r.prependEventNamePrefix("server_sub_error_code"),URL:r.prependEventNamePrefix("url")};f=function(n){function i(t,i){return n.call(this,r.prependEventNamePrefix("http_event"),t,i)||this}return u.__extends(i,n),Object.defineProperty(i.prototype,"url",{set:function(n){var i=r.scrubTenantFromUri(n);this.event[t.EVENT_KEYS.URL]=i&&i.toLowerCase()},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"httpPath",{set:function(n){this.event[t.EVENT_KEYS.HTTP_PATH]=r.scrubTenantFromUri(n).toLowerCase()},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"userAgent",{set:function(n){this.event[t.EVENT_KEYS.USER_AGENT]=n},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"queryParams",{set:function(n){this.event[t.EVENT_KEYS.QUERY_PARAMETERS]=o.ServerRequestParameters.generateQueryParametersString(n)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"apiVersion",{set:function(n){this.event[t.EVENT_KEYS.API_VERSION]=n.toLowerCase()},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"httpResponseStatus",{set:function(n){this.event[t.EVENT_KEYS.RESPONSE_CODE]=n},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"oAuthErrorCode",{set:function(n){this.event[t.EVENT_KEYS.O_AUTH_ERROR_CODE]=n},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"httpMethod",{set:function(n){this.event[t.EVENT_KEYS.HTTP_METHOD]=n},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"requestIdHeader",{set:function(n){this.event[t.EVENT_KEYS.REQUEST_ID_HEADER]=n},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"speInfo",{set:function(n){this.event[t.EVENT_KEYS.SPE_INFO]=n},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"serverErrorCode",{set:function(n){this.event[t.EVENT_KEYS.SERVER_ERROR_CODE]=n},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"serverSubErrorCode",{set:function(n){this.event[t.EVENT_KEYS.SERVER_SUB_ERROR_CODE]=n},enumerable:!1,configurable:!0}),i}(e.default);t["default"]=f},810:function(n,t){Object.defineProperty(t,"__esModule",{value:!0});t.TENANT_PLACEHOLDER=t.TELEMETRY_BLOB_EVENT_NAMES=t.ELAPSED_TIME_KEY=t.START_TIME_KEY=t.EVENT_NAME_KEY=t.EVENT_NAME_PREFIX=void 0;t.EVENT_NAME_PREFIX="msal.";t.EVENT_NAME_KEY="event_name";t.START_TIME_KEY="start_time";t.ELAPSED_TIME_KEY="elapsed_time";t.TELEMETRY_BLOB_EVENT_NAMES={MsalCorrelationIdConstStrKey:"Microsoft.MSAL.correlation_id",ApiTelemIdConstStrKey:"msal.api_telem_id",ApiIdConstStrKey:"msal.api_id",BrokerAppConstStrKey:"Microsoft_MSAL_broker_app",CacheEventCountConstStrKey:"Microsoft_MSAL_cache_event_count",HttpEventCountTelemetryBatchKey:"Microsoft_MSAL_http_event_count",IdpConstStrKey:"Microsoft_MSAL_idp",IsSilentTelemetryBatchKey:"",IsSuccessfulConstStrKey:"Microsoft_MSAL_is_successful",ResponseTimeConstStrKey:"Microsoft_MSAL_response_time",TenantIdConstStrKey:"Microsoft_MSAL_tenant_id",UiEventCountTelemetryBatchKey:"Microsoft_MSAL_ui_event_count"};t.TENANT_PLACEHOLDER="<tenant>"},336:function(n,t,i){Object.defineProperty(t,"__esModule",{value:!0});var f=i(795),r=i(810),u=i(847),e=i(453),o=function(){function n(n,t,i){var f;this.eventId=e.CryptoUtils.createNewGuid();this.label=i;this.event=(f={},f[u.prependEventNamePrefix(r.EVENT_NAME_KEY)]=n,f[u.prependEventNamePrefix(r.ELAPSED_TIME_KEY)]=-1,f[""+r.TELEMETRY_BLOB_EVENT_NAMES.MsalCorrelationIdConstStrKey]=t,f)}return n.prototype.setElapsedTime=function(n){this.event[u.prependEventNamePrefix(r.ELAPSED_TIME_KEY)]=n},n.prototype.stop=function(){this.setElapsedTime(+Date.now()-+this.startTimestamp);u.endBrowserPerformanceMeasurement(this.displayName,this.perfStartMark,this.perfEndMark)},n.prototype.start=function(){this.startTimestamp=Date.now();this.event[u.prependEventNamePrefix(r.START_TIME_KEY)]=this.startTimestamp;u.startBrowserPerformanceMeasurement(this.perfStartMark)},Object.defineProperty(n.prototype,"telemetryCorrelationId",{get:function(){return this.event[""+r.TELEMETRY_BLOB_EVENT_NAMES.MsalCorrelationIdConstStrKey]},set:function(n){this.event[""+r.TELEMETRY_BLOB_EVENT_NAMES.MsalCorrelationIdConstStrKey]=n},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"eventName",{get:function(){return this.event[u.prependEventNamePrefix(r.EVENT_NAME_KEY)]},enumerable:!1,configurable:!0}),n.prototype.get=function(){return f.__assign(f.__assign({},this.event),{eventId:this.eventId})},Object.defineProperty(n.prototype,"key",{get:function(){return this.telemetryCorrelationId+"_"+this.eventId+"-"+this.eventName},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"displayName",{get:function(){return"Msal-"+this.label+"-"+this.telemetryCorrelationId},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"perfStartMark",{get:function(){return"start-"+this.key},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"perfEndMark",{get:function(){return"end-"+this.key},enumerable:!1,configurable:!0}),n}();t["default"]=o},478:function(n,t,i){Object.defineProperty(t,"__esModule",{value:!0});var r=i(795),u=r.__importDefault(i(868)),f=i(91),e=r.__importDefault(i(663)),o=r.__importDefault(i(140)),s=i(700),h=function(){function n(n,t,i){this.completedEvents={};this.inProgressEvents={};this.eventCountByCorrelationId={};this.onlySendFailureTelemetry=!1;this.telemetryPlatform=r.__assign({sdk:f.Constants.libraryName,sdkVersion:s.version,networkInformation:{connectionSpeed:typeof navigator!="undefined"&&navigator.connection&&navigator.connection.effectiveType}},n.platform);this.clientId=n.clientId;this.onlySendFailureTelemetry=n.onlySendFailureTelemetry;this.telemetryEmitter=t;this.logger=i}return n.getTelemetrymanagerStub=function(n,t){var i=function(){},r={platform:{applicationName:"UnSetStub",applicationVersion:"0.0"},clientId:n};return new this(r,i,t)},n.prototype.startEvent=function(n){(this.logger.verbose("Telemetry Event started: "+n.key),this.telemetryEmitter)&&(n.start(),this.inProgressEvents[n.key]=n)},n.prototype.stopEvent=function(n){if(this.logger.verbose("Telemetry Event stopped: "+n.key),this.telemetryEmitter&&this.inProgressEvents[n.key]){n.stop();this.incrementEventCount(n);var t=this.completedEvents[n.telemetryCorrelationId];this.completedEvents[n.telemetryCorrelationId]=r.__spreadArrays(t||[],[n]);delete this.inProgressEvents[n.key]}},n.prototype.flush=function(n){var s=this,i,t,f,e,o;(this.logger.verbose("Flushing telemetry events: "+n),this.telemetryEmitter&&this.completedEvents[n])&&(i=this.getOrphanedEvents(n),i.forEach(function(n){return s.incrementEventCount(n)}),t=r.__spreadArrays(this.completedEvents[n],i),delete this.completedEvents[n],f=this.eventCountByCorrelationId[n],delete this.eventCountByCorrelationId[n],t&&t.length)&&(e=new u.default(this.telemetryPlatform,n,this.clientId,f),o=r.__spreadArrays(t,[e]),this.telemetryEmitter(o.map(function(n){return n.get()})))},n.prototype.createAndStartApiEvent=function(n,t){var i=new e.default(n,this.logger.isPiiLoggingEnabled(),t);return this.startEvent(i),i},n.prototype.stopAndFlushApiEvent=function(n,t,i,r){t.wasSuccessful=i;r&&(t.apiErrorCode=r);this.stopEvent(t);this.flush(n)},n.prototype.createAndStartHttpEvent=function(n,t,i,r){var u=new o.default(n,r);return u.url=i,u.httpMethod=t,this.startEvent(u),u},n.prototype.incrementEventCount=function(n){var r,t=n.eventName,i=this.eventCountByCorrelationId[n.telemetryCorrelationId];i?i[t]=i[t]?i[t]+1:1:this.eventCountByCorrelationId[n.telemetryCorrelationId]=(r={},r[t]=1,r)},n.prototype.getOrphanedEvents=function(n){var t=this;return Object.keys(this.inProgressEvents).reduce(function(i,u){if(u.indexOf(n)!==-1){var f=t.inProgressEvents[u];return delete t.inProgressEvents[u],r.__spreadArrays(i,[f])}return i},[])},n}();t["default"]=h},847:function(n,t,i){Object.defineProperty(t,"__esModule",{value:!0});t.startBrowserPerformanceMeasurement=t.endBrowserPerformanceMeasurement=t.supportsBrowserPerformance=t.prependEventNamePrefix=t.hashPersonalIdentifier=t.scrubTenantFromUri=void 0;var r=i(810),u=i(453),f=i(741),e=i(660);t.scrubTenantFromUri=function(n){var i=f.UrlUtils.GetUrlComponents(n),t,u;return e.Authority.isAdfs(n)?n:(t=i.PathSegments,t&&t.length>=2&&(u=t[1]==="tfp"?2:1,u<t.length&&(t[u]=r.TENANT_PLACEHOLDER)),i.Protocol+"//"+i.HostNameAndPort+"/"+t.join("/"))};t.hashPersonalIdentifier=function(n){return u.CryptoUtils.base64Encode(n)};t.prependEventNamePrefix=function(n){return""+r.EVENT_NAME_PREFIX+(n||"")};t.supportsBrowserPerformance=function(){return!!(typeof window!="undefined"&&"performance"in window&&window.performance.mark&&window.performance.measure)};t.endBrowserPerformanceMeasurement=function(n,i,r){t.supportsBrowserPerformance()&&(window.performance.mark(r),window.performance.measure(n,i,r),window.performance.clearMeasures(n),window.performance.clearMarks(i),window.performance.clearMarks(r))};t.startBrowserPerformanceMeasurement=function(n){t.supportsBrowserPerformance()&&window.performance.mark(n)}},49:function(n,t,i){Object.defineProperty(t,"__esModule",{value:!0});t.AuthCacheUtils=void 0;var r=i(55),u=i(741),f=function(){function n(){}return n.filterTokenCacheItemsByScope=function(n,t){return n.filter(function(n){var i=n.key.scopes.split(" "),u=r.ScopeSet.removeDefaultScopes(t);return u.length===0?r.ScopeSet.containsScope(i,t):r.ScopeSet.containsScope(i,u)})},n.filterTokenCacheItemsByAuthority=function(n,t){return n.filter(function(n){return u.UrlUtils.CanonicalizeUri(n.key.authority)===t})},n.filterTokenCacheItemsByDomain=function(n,t){return n.filter(function(n){var i=u.UrlUtils.GetUrlComponents(n.key.authority).HostNameAndPort;return i===t})},n}();t.AuthCacheUtils=f},91:function(n,t){var r,u,f,e,o,i;Object.defineProperty(t,"__esModule",{value:!0});t.FramePrefix=t.PromptState=t.NetworkRequestType=t.BlacklistedEQParams=t.SSOTypes=t.WELL_KNOWN_SUFFIX=t.AAD_INSTANCE_DISCOVERY_ENDPOINT=t.DEFAULT_AUTHORITY=t.ErrorCacheKeys=t.PersistentCacheKeys=t.TemporaryCacheKeys=t.ResponseTypes=t.ServerHashParamKeys=t.SESSION_STORAGE=t.Constants=void 0;r=function(){function n(){}return Object.defineProperty(n,"libraryName",{get:function(){return"Msal.js"},enumerable:!1,configurable:!0}),Object.defineProperty(n,"claims",{get:function(){return"claims"},enumerable:!1,configurable:!0}),Object.defineProperty(n,"clientId",{get:function(){return"clientId"},enumerable:!1,configurable:!0}),Object.defineProperty(n,"adalIdToken",{get:function(){return"adal.idtoken"},enumerable:!1,configurable:!0}),Object.defineProperty(n,"cachePrefix",{get:function(){return"msal"},enumerable:!1,configurable:!0}),Object.defineProperty(n,"scopes",{get:function(){return"scopes"},enumerable:!1,configurable:!0}),Object.defineProperty(n,"no_account",{get:function(){return"NO_ACCOUNT"},enumerable:!1,configurable:!0}),Object.defineProperty(n,"upn",{get:function(){return"upn"},enumerable:!1,configurable:!0}),Object.defineProperty(n,"domain_hint",{get:function(){return"domain_hint"},enumerable:!1,configurable:!0}),Object.defineProperty(n,"prompt_select_account",{get:function(){return"&prompt=select_account"},enumerable:!1,configurable:!0}),Object.defineProperty(n,"prompt_none",{get:function(){return"&prompt=none"},enumerable:!1,configurable:!0}),Object.defineProperty(n,"prompt",{get:function(){return"prompt"},enumerable:!1,configurable:!0}),Object.defineProperty(n,"response_mode_fragment",{get:function(){return"&response_mode=fragment"},enumerable:!1,configurable:!0}),Object.defineProperty(n,"resourceDelimiter",{get:function(){return"|"},enumerable:!1,configurable:!0}),Object.defineProperty(n,"cacheDelimiter",{get:function(){return"."},enumerable:!1,configurable:!0}),Object.defineProperty(n,"popUpWidth",{get:function(){return this._popUpWidth},set:function(n){this._popUpWidth=n},enumerable:!1,configurable:!0}),Object.defineProperty(n,"popUpHeight",{get:function(){return this._popUpHeight},set:function(n){this._popUpHeight=n},enumerable:!1,configurable:!0}),Object.defineProperty(n,"login",{get:function(){return"LOGIN"},enumerable:!1,configurable:!0}),Object.defineProperty(n,"renewToken",{get:function(){return"RENEW_TOKEN"},enumerable:!1,configurable:!0}),Object.defineProperty(n,"unknown",{get:function(){return"UNKNOWN"},enumerable:!1,configurable:!0}),Object.defineProperty(n,"ADFS",{get:function(){return"adfs"},enumerable:!1,configurable:!0}),Object.defineProperty(n,"homeAccountIdentifier",{get:function(){return"homeAccountIdentifier"},enumerable:!1,configurable:!0}),Object.defineProperty(n,"common",{get:function(){return"common"},enumerable:!1,configurable:!0}),Object.defineProperty(n,"openidScope",{get:function(){return"openid"},enumerable:!1,configurable:!0}),Object.defineProperty(n,"profileScope",{get:function(){return"profile"},enumerable:!1,configurable:!0}),Object.defineProperty(n,"oidcScopes",{get:function(){return[this.openidScope,this.profileScope]},enumerable:!1,configurable:!0}),Object.defineProperty(n,"interactionTypeRedirect",{get:function(){return"redirectInteraction"},enumerable:!1,configurable:!0}),Object.defineProperty(n,"interactionTypePopup",{get:function(){return"popupInteraction"},enumerable:!1,configurable:!0}),Object.defineProperty(n,"interactionTypeSilent",{get:function(){return"silentInteraction"},enumerable:!1,configurable:!0}),Object.defineProperty(n,"inProgress",{get:function(){return"inProgress"},enumerable:!1,configurable:!0}),n._popUpWidth=483,n._popUpHeight=600,n}();t.Constants=r;t.SESSION_STORAGE="sessionStorage",function(n){n.SCOPE="scope";n.STATE="state";n.ERROR="error";n.ERROR_DESCRIPTION="error_description";n.ACCESS_TOKEN="access_token";n.ID_TOKEN="id_token";n.EXPIRES_IN="expires_in";n.SESSION_STATE="session_state";n.CLIENT_INFO="client_info"}(u=t.ServerHashParamKeys||(t.ServerHashParamKeys={}));t.ResponseTypes={id_token:"id_token",token:"token",id_token_token:"id_token token"},function(n){n.AUTHORITY="authority";n.ACQUIRE_TOKEN_ACCOUNT="acquireTokenAccount";n.SESSION_STATE="session.state";n.STATE_LOGIN="state.login";n.STATE_ACQ_TOKEN="state.acquireToken";n.STATE_RENEW="state.renew";n.NONCE_IDTOKEN="nonce.idtoken";n.LOGIN_REQUEST="login.request";n.RENEW_STATUS="token.renew.status";n.URL_HASH="urlHash";n.INTERACTION_STATUS="interaction.status";n.REDIRECT_REQUEST="redirect_request"}(f=t.TemporaryCacheKeys||(t.TemporaryCacheKeys={})),function(n){n.IDTOKEN="idtoken";n.CLIENT_INFO="client.info"}(e=t.PersistentCacheKeys||(t.PersistentCacheKeys={})),function(n){n.LOGIN_ERROR="login.error";n.ERROR="error";n.ERROR_DESC="error.description"}(o=t.ErrorCacheKeys||(t.ErrorCacheKeys={}));t.DEFAULT_AUTHORITY="https://login.microsoftonline.com/common/";t.AAD_INSTANCE_DISCOVERY_ENDPOINT=t.DEFAULT_AUTHORITY+"/discovery/instance?api-version=1.1&authorization_endpoint=";t.WELL_KNOWN_SUFFIX=".well-known/openid-configuration",function(n){n.ACCOUNT="account";n.SID="sid";n.LOGIN_HINT="login_hint";n.ORGANIZATIONS="organizations";n.CONSUMERS="consumers";n.ID_TOKEN="id_token";n.ACCOUNT_ID="accountIdentifier";n.HOMEACCOUNT_ID="homeAccountIdentifier"}(i=t.SSOTypes||(t.SSOTypes={}));t.BlacklistedEQParams=[i.SID,i.LOGIN_HINT];t.NetworkRequestType={GET:"GET",POST:"POST"};t.PromptState={LOGIN:"login",SELECT_ACCOUNT:"select_account",CONSENT:"consent",NONE:"none"};t.FramePrefix={ID_TOKEN_FRAME:"msalIdTokenFrame",TOKEN_FRAME:"msalRenewFrame"}},453:function(n,t){Object.defineProperty(t,"__esModule",{value:!0});t.CryptoUtils=void 0;var i=function(){function n(){}return n.createNewGuid=function(){var e=window.crypto,t,i;if(e&&e.getRandomValues)return t=new Uint8Array(16),e.getRandomValues(t),t[6]|=64,t[6]&=79,t[8]|=128,t[8]&=191,n.decimalToHex(t[0])+n.decimalToHex(t[1])+n.decimalToHex(t[2])+n.decimalToHex(t[3])+"-"+n.decimalToHex(t[4])+n.decimalToHex(t[5])+"-"+n.decimalToHex(t[6])+n.decimalToHex(t[7])+"-"+n.decimalToHex(t[8])+n.decimalToHex(t[9])+"-"+n.decimalToHex(t[10])+n.decimalToHex(t[11])+n.decimalToHex(t[12])+n.decimalToHex(t[13])+n.decimalToHex(t[14])+n.decimalToHex(t[15]);var r="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx",o="0123456789abcdef",u=0,f="";for(i=0;i<36;i++)r[i]!=="-"&&r[i]!=="4"&&(u=Math.random()*16|0),r[i]==="x"?f+=o[u]:r[i]==="y"?(u&=3,u|=8,f+=o[u]):f+=r[i];return f},n.isGuid=function(n){return/^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(n)},n.decimalToHex=function(n){for(var t=n.toString(16);t.length<2;)t="0"+t;return t},n.base64Encode=function(n){return btoa(encodeURIComponent(n).replace(/%([0-9A-F]{2})/g,function(n,t){return String.fromCharCode(Number("0x"+t))}))},n.base64Decode=function(n){var t=n.replace(/-/g,"+").replace(/_/g,"/");switch(t.length%4){case 0:break;case 2:t+="==";break;case 3:t+="=";break;default:throw new Error("Invalid base64 string");}return decodeURIComponent(atob(t).split("").map(function(n){return"%"+("00"+n.charCodeAt(0).toString(16)).slice(-2)}).join(""))},n.deserialize=function(n){for(var f=/\+/g,i=/([^&=]+)=([^&]*)/g,r=function(n){return decodeURIComponent(n.replace(f," "))},u={},t=i.exec(n);t;)u[r(t[1])]=r(t[2]),t=i.exec(n);return u},n}();t.CryptoUtils=i},52:function(n,t,i){Object.defineProperty(t,"__esModule",{value:!0});t.RequestUtils=void 0;var e=i(795),r=i(91),f=i(550),o=i(55),h=i(454),u=i(453),s=i(78),c=i(356),l=function(){function n(){}return n.validateRequest=function(n,t,i,r){var u,s;if(!t&&!n)throw f.ClientConfigurationError.createEmptyRequestError();n&&(u=t?o.ScopeSet.appendScopes(n.scopes,n.extraScopesToConsent):n.scopes,o.ScopeSet.validateInputScope(u,!t),u=o.ScopeSet.translateClientIdIfSingleScope(u,i),this.validatePromptParameter(n.prompt),s=this.validateEQParameters(n.extraQueryParameters,n.claimsRequest),this.validateClaimsRequest(n.claimsRequest));var h=this.validateAndGenerateState(n&&n.state,r),c=this.validateAndGenerateCorrelationId(n&&n.correlationId);return e.__assign(e.__assign({},n),{extraQueryParameters:s,scopes:u,state:h,correlationId:c})},n.validatePromptParameter=function(n){if(n&&[r.PromptState.LOGIN,r.PromptState.SELECT_ACCOUNT,r.PromptState.CONSENT,r.PromptState.NONE].indexOf(n)<0)throw f.ClientConfigurationError.createInvalidPromptError(n);},n.validateEQParameters=function(n,t){var i=e.__assign({},n);return i?(t&&delete i[r.Constants.claims],r.BlacklistedEQParams.forEach(function(n){i[n]&&delete i[n]}),i):null},n.validateClaimsRequest=function(n){if(n)try{JSON.parse(n)}catch(t){throw f.ClientConfigurationError.createClaimsRequestParsingError(t);}},n.validateAndGenerateState=function(t,i){return h.StringUtils.isEmpty(t)?n.generateLibraryState(i):""+n.generateLibraryState(i)+r.Constants.resourceDelimiter+t},n.generateLibraryState=function(n){var t={id:u.CryptoUtils.createNewGuid(),ts:s.TimeUtils.now(),method:n},i=JSON.stringify(t);return u.CryptoUtils.base64Encode(i)},n.parseLibraryState=function(n){var t=decodeURIComponent(n).split(r.Constants.resourceDelimiter)[0],i,f;if(u.CryptoUtils.isGuid(t))return{id:t,ts:s.TimeUtils.now(),method:r.Constants.interactionTypeRedirect};try{return i=u.CryptoUtils.base64Decode(t),f=JSON.parse(i),f}catch(e){throw c.ClientAuthError.createInvalidStateError(n,null);}},n.validateAndGenerateCorrelationId=function(n){if(n&&!u.CryptoUtils.isGuid(n))throw f.ClientConfigurationError.createInvalidCorrelationIdError();return u.CryptoUtils.isGuid(n)?n:u.CryptoUtils.createNewGuid()},n.createRequestSignature=function(n){return""+n.scopes.join(" ").toLowerCase()+r.Constants.resourceDelimiter+n.authority},n}();t.RequestUtils=l},756:function(n,t,i){Object.defineProperty(t,"__esModule",{value:!0});t.ResponseUtils=void 0;var r=i(795),u=i(91),f=function(){function n(){}return n.setResponseIdToken=function(n,t){if(n){if(!t)return n}else return null;var i=Number(t.expiration);return i&&!n.expiresOn&&(n.expiresOn=new Date(i*1e3)),r.__assign(r.__assign({},n),{idToken:t,idTokenClaims:t.claims,uniqueId:t.objectId||t.subject,tenantId:t.tenantId})},n.buildAuthResponse=function(t,i,f,e,o,s){var h,c;switch(f.responseType){case u.ResponseTypes.id_token:return h=r.__assign(r.__assign({},i),{tokenType:u.ServerHashParamKeys.ID_TOKEN,account:e,scopes:o,accountState:s}),h=n.setResponseIdToken(h,t),h.idToken?h:null;case u.ResponseTypes.id_token_token:return c=n.setResponseIdToken(i,t),c&&c.accessToken&&c.idToken?c:null;case u.ResponseTypes.token:return n.setResponseIdToken(i,t);default:return null}},n}();t.ResponseUtils=f},454:function(n,t){Object.defineProperty(t,"__esModule",{value:!0});t.StringUtils=void 0;var i=function(){function n(){}return n.isEmpty=function(n){return typeof n=="undefined"||!n||0===n.length},n.validateAndParseJsonCacheKey=function(n){try{var t=JSON.parse(n);return t&&typeof t=="object"?t:null}catch(i){return null}},n}();t.StringUtils=i},78:function(n,t){Object.defineProperty(t,"__esModule",{value:!0});t.TimeUtils=void 0;var i=function(){function n(){}return n.parseExpiresIn=function(n){var t=n||"3599";return parseInt(t,10)},n.now=function(){return Math.round((new Date).getTime()/1e3)},n.relativeNowMs=function(){return window.performance.now()},n}();t.TimeUtils=i},94:function(n,t,i){Object.defineProperty(t,"__esModule",{value:!0});t.TokenUtils=void 0;var r=i(453),u=i(454),f=i(78),e=function(){function n(){}return n.decodeJwt=function(n){var i,t;return u.StringUtils.isEmpty(n)?null:(i=/^([^\.\s]*)\.([^\.\s]+)\.([^\.\s]*)$/,t=i.exec(n),!t||t.length<4)?null:{header:t[1],JWSPayload:t[2],JWSSig:t[3]}},n.validateExpirationIsWithinOffset=function(n,t){var i=t||300;return n&&n>f.TimeUtils.now()+i},n.extractIdToken=function(n){var i=this.decodeJwt(n),u,t;if(!i)return null;try{return(u=i.JWSPayload,t=r.CryptoUtils.base64Decode(u),!t)?null:JSON.parse(t)}catch(f){}return null},n}();t.TokenUtils=e},741:function(n,t,i){Object.defineProperty(t,"__esModule",{value:!0});t.UrlUtils=void 0;var r=i(91),u=i(55),f=i(454),e=i(453),o=function(){function n(){}return n.createNavigateUrl=function(n){var i=this.createNavigationUrlString(n),t=n.authorityInstance.AuthorizationEndpoint;return t+=t.indexOf("?")<0?"?":"&",""+t+i.join("&")},n.createNavigationUrlString=function(n){var i=u.ScopeSet.appendDefaultScopes(n.scopes),t=[];return t.push("response_type="+n.responseType),t.push("scope="+encodeURIComponent(u.ScopeSet.parseScope(i))),t.push("client_id="+encodeURIComponent(n.clientId)),t.push("redirect_uri="+encodeURIComponent(n.redirectUri)),t.push("state="+encodeURIComponent(n.state)),t.push("nonce="+encodeURIComponent(n.nonce)),t.push("client_info=1"),t.push("x-client-SKU="+n.xClientSku),t.push("x-client-Ver="+n.xClientVer),n.promptValue&&t.push("prompt="+encodeURIComponent(n.promptValue)),n.claimsValue&&t.push("claims="+encodeURIComponent(n.claimsValue)),n.queryParameters&&t.push(n.queryParameters),n.extraQueryParameters&&t.push(n.extraQueryParameters),t.push("client-request-id="+encodeURIComponent(n.correlationId)),t},n.getCurrentUrl=function(){return window.location.href.split("?")[0].split("#")[0]},n.removeHashFromUrl=function(n){return n.split("#")[0]},n.replaceTenantPath=function(n,t){var f=n.toLowerCase(),u=this.GetUrlComponents(f),i=u.PathSegments;return t&&i.length!==0&&(i[0]===r.Constants.common||i[0]===r.SSOTypes.ORGANIZATIONS||i[0]===r.SSOTypes.CONSUMERS)&&(i[0]=t),this.constructAuthorityUriFromObject(u,i)},n.constructAuthorityUriFromObject=function(n,t){return this.CanonicalizeUri(n.Protocol+"//"+n.HostNameAndPort+"/"+t.join("/"))},n.isCommonAuthority=function(n){var i=this.CanonicalizeUri(n),t=this.GetUrlComponents(i).PathSegments;return t.length!==0&&t[0]===r.Constants.common},n.isOrganizationsAuthority=function(n){var i=this.CanonicalizeUri(n),t=this.GetUrlComponents(i).PathSegments;return t.length!==0&&t[0]===r.SSOTypes.ORGANIZATIONS},n.isConsumersAuthority=function(n){var i=this.CanonicalizeUri(n),t=this.GetUrlComponents(i).PathSegments;return t.length!==0&&t[0]===r.SSOTypes.CONSUMERS},n.GetUrlComponents=function(n){var u,t,i,r;if(!n)throw"Url required";if(u=RegExp("^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\\?([^#]*))?(#(.*))?"),t=n.match(u),!t||t.length<6)throw"Valid url required";return i={Protocol:t[1],HostNameAndPort:t[4],AbsolutePath:t[5]},r=i.AbsolutePath.split("/"),r=r.filter(function(n){return n&&n.length>0}),i.PathSegments=r,t[6]&&(i.Search=t[6]),t[8]&&(i.Hash=t[8]),i},n.CanonicalizeUri=function(t){if(t){var i=t.toLowerCase();return n.endsWith(i,"/")||(i+="/"),i}return t},n.endsWith=function(n,t){return!n||!t?!1:n.indexOf(t,n.length-t.length)!==-1},n.urlRemoveQueryStringParameter=function(n,t){if(f.StringUtils.isEmpty(n))return n;var r=n,i=new RegExp("(\\&"+t+"=)[^&]+");return r=n.replace(i,""),i=new RegExp("("+t+"=)[^&]+&"),r=n.replace(i,""),i=new RegExp("("+t+"=)[^&]+"),n.replace(i,"")},n.getHashFromUrl=function(n){var t=n.indexOf("#"),i=n.indexOf("#/");return i>-1?n.substring(i+2):t>-1?n.substring(t+1):n},n.urlContainsHash=function(t){var i=n.deserializeHash(t);return i.hasOwnProperty(r.ServerHashParamKeys.ERROR_DESCRIPTION)||i.hasOwnProperty(r.ServerHashParamKeys.ERROR)||i.hasOwnProperty(r.ServerHashParamKeys.ACCESS_TOKEN)||i.hasOwnProperty(r.ServerHashParamKeys.ID_TOKEN)},n.deserializeHash=function(t){var i=n.getHashFromUrl(t);return e.CryptoUtils.deserialize(i)},n.getHostFromUri=function(n){var t=String(n).replace(/^(https?:)\/\//,"");return t.split("/")[0]},n}();t.UrlUtils=o},758:function(n,t,i){Object.defineProperty(t,"__esModule",{value:!0});t.WindowUtils=void 0;var r=i(356),u=i(741),f=i(91),e=i(78),o=function(){function n(){}return n.isInIframe=function(){return window.parent!==window},n.isInPopup=function(){return!!(window.opener&&window.opener!==window)},n.generateFrameName=function(n,t){return""+n+f.Constants.resourceDelimiter+t},n.monitorIframeForHash=function(t,i,f,o){return new Promise(function(s,h){var l=e.TimeUtils.relativeNowMs(),a=l+i,c;o.verbose("monitorWindowForIframe polling started");c=setInterval(function(){if(e.TimeUtils.relativeNowMs()>a){o.error("monitorIframeForHash unable to find hash in url, timing out");o.errorPii("monitorIframeForHash polling timed out for url: "+f);clearInterval(c);h(r.ClientAuthError.createTokenRenewalTimeoutError());return}var n;try{n=t.location.href}catch(i){}n&&u.UrlUtils.urlContainsHash(n)&&(o.verbose("monitorIframeForHash found url in hash"),clearInterval(c),s(t.location.hash))},n.POLLING_INTERVAL_MS)})},n.monitorPopupForHash=function(t,i,f,e){return new Promise(function(o,s){var l=i/n.POLLING_INTERVAL_MS,c=0,h;e.verbose("monitorWindowForHash polling started");h=setInterval(function(){var i,a;if(t.closed){e.error("monitorWindowForHash window closed");clearInterval(h);s(r.ClientAuthError.createUserCancelledError());return}try{i=t.location.href}catch(v){}i&&i!=="about:blank"&&(c++,i&&u.UrlUtils.urlContainsHash(i)?(e.verbose("monitorPopupForHash found url in hash"),clearInterval(h),a=t.location.hash,n.clearUrlFragment(t),o(a)):c>l&&(e.error("monitorPopupForHash unable to find hash in url, timing out"),e.errorPii("monitorPopupForHash polling timed out for url: "+f),clearInterval(h),s(r.ClientAuthError.createTokenRenewalTimeoutError())))},n.POLLING_INTERVAL_MS)})},n.loadFrame=function(n,t,i,r){var u=this;return r.infoPii("LoadFrame: "+t),new Promise(function(f,e){setTimeout(function(){var i=u.loadFrameSync(n,t,r);if(!i){e("Unable to load iframe with name: "+t);return}f(i)},i)})},n.loadFrameSync=function(t,i,r){var u=n.addHiddenIFrame(i,r);if(u)(u.src===""||u.src==="about:blank")&&(u.src=t,r.infoPii("Frame Name : "+i+" Navigated to: "+t));else return null;return u},n.addHiddenIFrame=function(n,t){var r,i;return typeof n=="undefined"?null:(t.info("Add msal iframe to document"),t.infoPii("Add msal frame to document:"+n),r=document.getElementById(n),r?t.verbose("Add msal iframe already exists"):(t.verbose("Add msal iframe does not exist"),i=document.createElement("iframe"),i.setAttribute("id",n),i.setAttribute("aria-hidden","true"),i.style.visibility="hidden",i.style.position="absolute",i.style.width=i.style.height="0",i.style.border="0",i.setAttribute("sandbox","allow-scripts allow-same-origin allow-forms"),r=document.getElementsByTagName("body")[0].appendChild(i)),r)},n.removeHiddenIframe=function(n){document.body===n.parentNode&&document.body.removeChild(n)},n.getIframeWithHash=function(n){var t=document.getElementsByTagName("iframe"),i=Array.apply(null,Array(t.length)).map(function(n,i){return t.item(i)});return i.filter(function(t){try{return t.contentWindow.location.hash===n}catch(i){return!1}})[0]},n.getPopups=function(){return window.openedWindows||(window.openedWindows=[]),window.openedWindows},n.getPopUpWithHash=function(t){return n.getPopups().filter(function(n){try{return n.location.hash===t}catch(i){return!1}})[0]},n.trackPopup=function(t){n.getPopups().push(t)},n.closePopups=function(){n.getPopups().forEach(function(n){return n.close()})},n.blockReloadInHiddenIframes=function(){if(u.UrlUtils.urlContainsHash(window.location.hash)&&n.isInIframe())throw r.ClientAuthError.createBlockTokenRequestsInHiddenIframeError();},n.checkIfBackButtonIsPressed=function(n){var i=n.getItem(f.TemporaryCacheKeys.REDIRECT_REQUEST),t,r;i&&!u.UrlUtils.urlContainsHash(window.location.hash)&&(t=i.split(f.Constants.resourceDelimiter),t.shift(),r=t.length>0?t.join(f.Constants.resourceDelimiter):null,n.resetTempCacheItems(r))},n.clearUrlFragment=function(n){n.location.hash="";typeof n.history.replaceState=="function"&&n.history.replaceState(null,null,""+n.location.pathname+n.location.search)},n.POLLING_INTERVAL_MS=50,n}();t.WindowUtils=o}},t={},i={};return!function(){var t=i,r,e,o,s,u,h,c,f,l,a,v,y,p,w,b,k,d,g,nt;Object.defineProperty(t,"__esModule",{value:!0});r=n(463);Object.defineProperty(t,"UserAgentApplication",{enumerable:!0,get:function(){return r.UserAgentApplication}});Object.defineProperty(t,"authResponseCallback",{enumerable:!0,get:function(){return r.authResponseCallback}});Object.defineProperty(t,"errorReceivedCallback",{enumerable:!0,get:function(){return r.errorReceivedCallback}});Object.defineProperty(t,"tokenReceivedCallback",{enumerable:!0,get:function(){return r.tokenReceivedCallback}});e=n(89);Object.defineProperty(t,"Logger",{enumerable:!0,get:function(){return e.Logger}});o=n(89);Object.defineProperty(t,"LogLevel",{enumerable:!0,get:function(){return o.LogLevel}});s=n(630);Object.defineProperty(t,"Account",{enumerable:!0,get:function(){return s.Account}});u=n(91);Object.defineProperty(t,"Constants",{enumerable:!0,get:function(){return u.Constants}});Object.defineProperty(t,"ServerHashParamKeys",{enumerable:!0,get:function(){return u.ServerHashParamKeys}});h=n(660);Object.defineProperty(t,"Authority",{enumerable:!0,get:function(){return h.Authority}});c=n(463);Object.defineProperty(t,"CacheResult",{enumerable:!0,get:function(){return c.CacheResult}});f=n(875);Object.defineProperty(t,"CacheLocation",{enumerable:!0,get:function(){return f.CacheLocation}});Object.defineProperty(t,"Configuration",{enumerable:!0,get:function(){return f.Configuration}});l=n(733);Object.defineProperty(t,"AuthenticationParameters",{enumerable:!0,get:function(){return l.AuthenticationParameters}});a=n(681);Object.defineProperty(t,"AuthResponse",{enumerable:!0,get:function(){return a.AuthResponse}});v=n(453);Object.defineProperty(t,"CryptoUtils",{enumerable:!0,get:function(){return v.CryptoUtils}});y=n(741);Object.defineProperty(t,"UrlUtils",{enumerable:!0,get:function(){return y.UrlUtils}});p=n(758);Object.defineProperty(t,"WindowUtils",{enumerable:!0,get:function(){return p.WindowUtils}});w=n(986);Object.defineProperty(t,"AuthError",{enumerable:!0,get:function(){return w.AuthError}});b=n(356);Object.defineProperty(t,"ClientAuthError",{enumerable:!0,get:function(){return b.ClientAuthError}});k=n(447);Object.defineProperty(t,"ServerError",{enumerable:!0,get:function(){return k.ServerError}});d=n(550);Object.defineProperty(t,"ClientConfigurationError",{enumerable:!0,get:function(){return d.ClientConfigurationError}});g=n(961);Object.defineProperty(t,"InteractionRequiredAuthError",{enumerable:!0,get:function(){return g.InteractionRequiredAuthError}});nt=n(700);Object.defineProperty(t,"version",{enumerable:!0,get:function(){return nt.version}})}(),i}()})