msal
Version:
Microsoft Authentication Library for js
17 lines (15 loc) • 130 kB
JavaScript
/*! msal v1.4.4 2020-11-11 */
"use strict";!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("Msal",[],t):"object"==typeof exports?exports.Msal=t():e.Msal=t()}(window,function(){return o={},n.m=r=[function(e,t,r){
/*! *****************************************************************************
Copyright (c) Microsoft Corporation. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
this file except in compliance with the License. You may obtain a copy of the
License at http://www.apache.org/licenses/LICENSE-2.0
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
MERCHANTABLITY OR NON-INFRINGEMENT.
See the Apache Version 2.0 License for specific language governing permissions
and limitations under the License.
***************************************************************************** */
Object.defineProperty(t,"__esModule",{value:!0});var o=function(e,t){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)};function i(e){var t="function"==typeof Symbol&&e[Symbol.iterator],r=0;return t?t.call(e):{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}}}function n(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var o,n,i=r.call(e),a=[];try{for(;(void 0===t||0<t--)&&!(o=i.next()).done;)a.push(o.value)}catch(e){n={error:e}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}return a}function h(e){return this instanceof h?(this.v=e,this):new h(e)}t.__extends=function(e,t){function r(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)},t.__assign=function(){return t.__assign=Object.assign||function(e){for(var t,r=1,o=arguments.length;r<o;r++)for(var n in t=arguments[r])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e},t.__assign.apply(this,arguments)},t.__rest=function(e,t){var r={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(r[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(o=Object.getOwnPropertySymbols(e);n<o.length;n++)t.indexOf(o[n])<0&&Object.prototype.propertyIsEnumerable.call(e,o[n])&&(r[o[n]]=e[o[n]])}return r},t.__decorate=function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;0<=s;s--)(n=e[s])&&(a=(i<3?n(a):3<i?n(t,r,a):n(t,r))||a);return 3<i&&a&&Object.defineProperty(t,r,a),a},t.__param=function(r,o){return function(e,t){o(e,t,r)}},t.__metadata=function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},t.__awaiter=function(i,a,s,c){return new(s=s||Promise)(function(e,t){function r(e){try{n(c.next(e))}catch(e){t(e)}}function o(e){try{n(c.throw(e))}catch(e){t(e)}}function n(t){t.done?e(t.value):new s(function(e){e(t.value)}).then(r,o)}n((c=c.apply(i,a||[])).next())})},t.__generator=function(r,o){var n,i,a,e,s={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]};return e={next:t(0),throw:t(1),return:t(2)},"function"==typeof Symbol&&(e[Symbol.iterator]=function(){return this}),e;function t(t){return function(e){return function(t){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,i&&(a=2&t[0]?i.return:t[0]?i.throw||((a=i.return)&&a.call(i),0):i.next)&&!(a=a.call(i,t[1])).done)return a;switch(i=0,a&&(t=[2&t[0],a.value]),t[0]){case 0:case 1:a=t;break;case 4:return s.label++,{value:t[1],done:!1};case 5:s.label++,i=t[1],t=[0];continue;case 7:t=s.ops.pop(),s.trys.pop();continue;default:if(!(a=0<(a=s.trys).length&&a[a.length-1])&&(6===t[0]||2===t[0])){s=0;continue}if(3===t[0]&&(!a||t[1]>a[0]&&t[1]<a[3])){s.label=t[1];break}if(6===t[0]&&s.label<a[1]){s.label=a[1],a=t;break}if(a&&s.label<a[2]){s.label=a[2],s.ops.push(t);break}a[2]&&s.ops.pop(),s.trys.pop();continue}t=o.call(r,s)}catch(e){t=[6,e],i=0}finally{n=a=0}if(5&t[0])throw t[1];return{value:t[0]?t[1]:void 0,done:!0}}([t,e])}}},t.__exportStar=function(e,t){for(var r in e)t.hasOwnProperty(r)||(t[r]=e[r])},t.__values=i,t.__read=n,t.__spread=function(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(n(arguments[t]));return e},t.__spreadArrays=function(){for(var e=0,t=0,r=arguments.length;t<r;t++)e+=arguments[t].length;var o=Array(e),n=0;for(t=0;t<r;t++)for(var i=arguments[t],a=0,s=i.length;a<s;a++,n++)o[n]=i[a];return o},t.__await=h,t.__asyncGenerator=function(e,t,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n,i=r.apply(e,t||[]),a=[];return n={},o("next"),o("throw"),o("return"),n[Symbol.asyncIterator]=function(){return this},n;function o(o){i[o]&&(n[o]=function(r){return new Promise(function(e,t){1<a.push([o,r,e,t])||s(o,r)})})}function s(e,t){try{!function(e){e.value instanceof h?Promise.resolve(e.value.v).then(c,u):l(a[0][2],e)}(i[e](t))}catch(e){l(a[0][3],e)}}function c(e){s("next",e)}function u(e){s("throw",e)}function l(e,t){e(t),a.shift(),a.length&&s(a[0][0],a[0][1])}},t.__asyncDelegator=function(o){var e,n;return e={},t("next"),t("throw",function(e){throw e}),t("return"),e[Symbol.iterator]=function(){return this},e;function t(t,r){e[t]=o[t]?function(e){return(n=!n)?{value:h(o[t](e)),done:"return"===t}:r?r(e):e}:r}},t.__asyncValues=function(n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e,t=n[Symbol.asyncIterator];return t?t.call(n):(n=i(n),e={},r("next"),r("throw"),r("return"),e[Symbol.asyncIterator]=function(){return this},e);function r(o){e[o]=n[o]&&function(r){return new Promise(function(e,t){(function(t,e,r,o){Promise.resolve(o).then(function(e){t({value:e,done:r})},e)})(e,t,(r=n[o](r)).done,r.value)})}}},t.__makeTemplateObject=function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e},t.__importStar=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t},t.__importDefault=function(e){return e&&e.__esModule?e:{default:e}}},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var o,n,i,a,s,c,u=(Object.defineProperty(l,"libraryName",{get:function(){return"Msal.js"},enumerable:!0,configurable:!0}),Object.defineProperty(l,"claims",{get:function(){return"claims"},enumerable:!0,configurable:!0}),Object.defineProperty(l,"clientId",{get:function(){return"clientId"},enumerable:!0,configurable:!0}),Object.defineProperty(l,"adalIdToken",{get:function(){return"adal.idtoken"},enumerable:!0,configurable:!0}),Object.defineProperty(l,"cachePrefix",{get:function(){return"msal"},enumerable:!0,configurable:!0}),Object.defineProperty(l,"scopes",{get:function(){return"scopes"},enumerable:!0,configurable:!0}),Object.defineProperty(l,"no_account",{get:function(){return"NO_ACCOUNT"},enumerable:!0,configurable:!0}),Object.defineProperty(l,"upn",{get:function(){return"upn"},enumerable:!0,configurable:!0}),Object.defineProperty(l,"domain_hint",{get:function(){return"domain_hint"},enumerable:!0,configurable:!0}),Object.defineProperty(l,"prompt_select_account",{get:function(){return"&prompt=select_account"},enumerable:!0,configurable:!0}),Object.defineProperty(l,"prompt_none",{get:function(){return"&prompt=none"},enumerable:!0,configurable:!0}),Object.defineProperty(l,"prompt",{get:function(){return"prompt"},enumerable:!0,configurable:!0}),Object.defineProperty(l,"response_mode_fragment",{get:function(){return"&response_mode=fragment"},enumerable:!0,configurable:!0}),Object.defineProperty(l,"resourceDelimiter",{get:function(){return"|"},enumerable:!0,configurable:!0}),Object.defineProperty(l,"cacheDelimiter",{get:function(){return"."},enumerable:!0,configurable:!0}),Object.defineProperty(l,"popUpWidth",{get:function(){return this._popUpWidth},set:function(e){this._popUpWidth=e},enumerable:!0,configurable:!0}),Object.defineProperty(l,"popUpHeight",{get:function(){return this._popUpHeight},set:function(e){this._popUpHeight=e},enumerable:!0,configurable:!0}),Object.defineProperty(l,"login",{get:function(){return"LOGIN"},enumerable:!0,configurable:!0}),Object.defineProperty(l,"renewToken",{get:function(){return"RENEW_TOKEN"},enumerable:!0,configurable:!0}),Object.defineProperty(l,"unknown",{get:function(){return"UNKNOWN"},enumerable:!0,configurable:!0}),Object.defineProperty(l,"ADFS",{get:function(){return"adfs"},enumerable:!0,configurable:!0}),Object.defineProperty(l,"homeAccountIdentifier",{get:function(){return"homeAccountIdentifier"},enumerable:!0,configurable:!0}),Object.defineProperty(l,"common",{get:function(){return"common"},enumerable:!0,configurable:!0}),Object.defineProperty(l,"openidScope",{get:function(){return"openid"},enumerable:!0,configurable:!0}),Object.defineProperty(l,"profileScope",{get:function(){return"profile"},enumerable:!0,configurable:!0}),Object.defineProperty(l,"oidcScopes",{get:function(){return[this.openidScope,this.profileScope]},enumerable:!0,configurable:!0}),Object.defineProperty(l,"interactionTypeRedirect",{get:function(){return"redirectInteraction"},enumerable:!0,configurable:!0}),Object.defineProperty(l,"interactionTypePopup",{get:function(){return"popupInteraction"},enumerable:!0,configurable:!0}),Object.defineProperty(l,"interactionTypeSilent",{get:function(){return"silentInteraction"},enumerable:!0,configurable:!0}),Object.defineProperty(l,"inProgress",{get:function(){return"inProgress"},enumerable:!0,configurable:!0}),l._popUpWidth=483,l._popUpHeight=600,l);function l(){}t.Constants=u,(o=t.ServerHashParamKeys||(t.ServerHashParamKeys={})).SCOPE="scope",o.STATE="state",o.ERROR="error",o.ERROR_DESCRIPTION="error_description",o.ACCESS_TOKEN="access_token",o.ID_TOKEN="id_token",o.EXPIRES_IN="expires_in",o.SESSION_STATE="session_state",o.CLIENT_INFO="client_info",t.ResponseTypes={id_token:"id_token",token:"token",id_token_token:"id_token token"},(n=t.TemporaryCacheKeys||(t.TemporaryCacheKeys={})).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",(i=t.PersistentCacheKeys||(t.PersistentCacheKeys={})).IDTOKEN="idtoken",i.CLIENT_INFO="client.info",(a=t.ErrorCacheKeys||(t.ErrorCacheKeys={})).LOGIN_ERROR="login.error",a.ERROR="error",a.ERROR_DESC="error.description",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",(c=s=t.SSOTypes||(t.SSOTypes={})).ACCOUNT="account",c.SID="sid",c.LOGIN_HINT="login_hint",c.ORGANIZATIONS="organizations",c.ID_TOKEN="id_token",c.ACCOUNT_ID="accountIdentifier",c.HOMEACCOUNT_ID="homeAccountIdentifier",t.BlacklistedEQParams=[s.SID,s.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"},t.libraryVersion=function(){return"1.4.4"}},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var o=(n.isEmpty=function(e){return void 0===e||!e||0===e.length},n.validateAndParseJsonCacheKey=function(e){try{var t=JSON.parse(e);return t&&"object"==typeof t?t:null}catch(e){return null}},n);function n(){}t.StringUtils=o},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var o=(s.createNewGuid=function(){var e=window.crypto;if(e&&e.getRandomValues){var t=new Uint8Array(16);return e.getRandomValues(t),t[6]|=64,t[6]&=79,t[8]|=128,t[8]&=191,s.decimalToHex(t[0])+s.decimalToHex(t[1])+s.decimalToHex(t[2])+s.decimalToHex(t[3])+"-"+s.decimalToHex(t[4])+s.decimalToHex(t[5])+"-"+s.decimalToHex(t[6])+s.decimalToHex(t[7])+"-"+s.decimalToHex(t[8])+s.decimalToHex(t[9])+"-"+s.decimalToHex(t[10])+s.decimalToHex(t[11])+s.decimalToHex(t[12])+s.decimalToHex(t[13])+s.decimalToHex(t[14])+s.decimalToHex(t[15])}for(var r="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx",o="0123456789abcdef",n=0,i="",a=0;a<36;a++)"-"!==r[a]&&"4"!==r[a]&&(n=16*Math.random()|0),"x"===r[a]?i+=o[n]:"y"===r[a]?(n&=3,i+=o[n|=8]):i+=r[a];return i},s.isGuid=function(e){return/^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(e)},s.decimalToHex=function(e){for(var t=e.toString(16);t.length<2;)t="0"+t;return t},s.base64Encode=function(e){return btoa(encodeURIComponent(e).replace(/%([0-9A-F]{2})/g,function(e,t){return String.fromCharCode(Number("0x"+t))}))},s.base64Decode=function(e){var t=e.replace(/-/g,"+").replace(/_/g,"/");switch(t.length%4){case 0:break;case 2:t+="==";break;case 3:t+="=";break;default:throw new Error("Invalid base64 string")}return decodeURIComponent(atob(t).split("").map(function(e){return"%"+("00"+e.charCodeAt(0).toString(16)).slice(-2)}).join(""))},s.deserialize=function(e){function t(e){return decodeURIComponent(e.replace(o," "))}var r,o=/\+/g,n=/([^&=]+)=([^&]*)/g,i={};for(r=n.exec(e);r;)i[t(r[1])]=t(r[2]),r=n.exec(e);return i},s);function s(){}t.CryptoUtils=o},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var i=r(1),o=r(7),n=r(2),a=r(3),s=(c.createNavigateUrl=function(e){var t=this.createNavigationUrlString(e),r=e.authorityInstance.AuthorizationEndpoint;return r.indexOf("?")<0?r+="?":r+="&",""+r+t.join("&")},c.createNavigationUrlString=function(e){var t=o.ScopeSet.appendDefaultScopes(e.scopes),r=[];return r.push("response_type="+e.responseType),r.push("scope="+encodeURIComponent(o.ScopeSet.parseScope(t))),r.push("client_id="+encodeURIComponent(e.clientId)),r.push("redirect_uri="+encodeURIComponent(e.redirectUri)),r.push("state="+encodeURIComponent(e.state)),r.push("nonce="+encodeURIComponent(e.nonce)),r.push("client_info=1"),r.push("x-client-SKU="+e.xClientSku),r.push("x-client-Ver="+e.xClientVer),e.promptValue&&r.push("prompt="+encodeURIComponent(e.promptValue)),e.claimsValue&&r.push("claims="+encodeURIComponent(e.claimsValue)),e.queryParameters&&r.push(e.queryParameters),e.extraQueryParameters&&r.push(e.extraQueryParameters),r.push("client-request-id="+encodeURIComponent(e.correlationId)),r},c.getCurrentUrl=function(){return window.location.href.split("?")[0].split("#")[0]},c.removeHashFromUrl=function(e){return e.split("#")[0]},c.replaceTenantPath=function(e,t){var r=e.toLowerCase(),o=this.GetUrlComponents(r),n=o.PathSegments;return!t||0===n.length||n[0]!==i.Constants.common&&n[0]!==i.SSOTypes.ORGANIZATIONS||(n[0]=t),this.constructAuthorityUriFromObject(o,n)},c.constructAuthorityUriFromObject=function(e,t){return this.CanonicalizeUri(e.Protocol+"//"+e.HostNameAndPort+"/"+t.join("/"))},c.isCommonAuthority=function(e){var t=this.CanonicalizeUri(e),r=this.GetUrlComponents(t).PathSegments;return 0!==r.length&&r[0]===i.Constants.common},c.isOrganizationsAuthority=function(e){var t=this.CanonicalizeUri(e),r=this.GetUrlComponents(t).PathSegments;return 0!==r.length&&r[0]===i.SSOTypes.ORGANIZATIONS},c.GetUrlComponents=function(e){if(!e)throw"Url required";var t=RegExp("^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\\?([^#]*))?(#(.*))?"),r=e.match(t);if(!r||r.length<6)throw"Valid url required";var o={Protocol:r[1],HostNameAndPort:r[4],AbsolutePath:r[5]},n=o.AbsolutePath.split("/");return n=n.filter(function(e){return e&&0<e.length}),o.PathSegments=n,r[6]&&(o.Search=r[6]),r[8]&&(o.Hash=r[8]),o},c.CanonicalizeUri=function(e){return(e=e&&e.toLowerCase())&&!c.endsWith(e,"/")&&(e+="/"),e},c.endsWith=function(e,t){return!(!e||!t)&&-1!==e.indexOf(t,e.length-t.length)},c.urlRemoveQueryStringParameter=function(e,t){if(n.StringUtils.isEmpty(e))return e;var r=new RegExp("(\\&"+t+"=)[^&]+");return e=e.replace(r,""),r=new RegExp("("+t+"=)[^&]+&"),e=e.replace(r,""),r=new RegExp("("+t+"=)[^&]+"),e=e.replace(r,"")},c.getHashFromUrl=function(e){var t=e.indexOf("#"),r=e.indexOf("#/");return-1<r?e.substring(r+2):-1<t?e.substring(t+1):e},c.urlContainsHash=function(e){var t=c.deserializeHash(e);return t.hasOwnProperty(i.ServerHashParamKeys.ERROR_DESCRIPTION)||t.hasOwnProperty(i.ServerHashParamKeys.ERROR)||t.hasOwnProperty(i.ServerHashParamKeys.ACCESS_TOKEN)||t.hasOwnProperty(i.ServerHashParamKeys.ID_TOKEN)},c.deserializeHash=function(e){var t=c.getHashFromUrl(e);return a.CryptoUtils.deserialize(t)},c.getHostFromUri=function(e){var t=String(e).replace(/^(https?:)\/\//,"");return t=t.split("/")[0]},c);function c(){}t.UrlUtils=s},function(e,i,t){Object.defineProperty(i,"__esModule",{value:!0});var r=t(0),o=t(6);i.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."}};var n,a=(n=o.ClientAuthError,r.__extends(s,n),s.createNoSetConfigurationError=function(){return new s(i.ClientConfigurationErrorMessage.configurationNotSet.code,""+i.ClientConfigurationErrorMessage.configurationNotSet.desc)},s.createStorageNotSupportedError=function(e){return new s(i.ClientConfigurationErrorMessage.storageNotSupported.code,i.ClientConfigurationErrorMessage.storageNotSupported.desc+" Given location: "+e)},s.createRedirectCallbacksNotSetError=function(){return new s(i.ClientConfigurationErrorMessage.noRedirectCallbacksSet.code,i.ClientConfigurationErrorMessage.noRedirectCallbacksSet.desc)},s.createInvalidCallbackObjectError=function(e){return new s(i.ClientConfigurationErrorMessage.invalidCallbackObject.code,i.ClientConfigurationErrorMessage.invalidCallbackObject.desc+" Given value for callback function: "+e)},s.createEmptyScopesArrayError=function(e){return new s(i.ClientConfigurationErrorMessage.emptyScopes.code,i.ClientConfigurationErrorMessage.emptyScopes.desc+" Given value: "+e+".")},s.createScopesNonArrayError=function(e){return new s(i.ClientConfigurationErrorMessage.nonArrayScopes.code,i.ClientConfigurationErrorMessage.nonArrayScopes.desc+" Given value: "+e+".")},s.createScopesRequiredError=function(e){return new s(i.ClientConfigurationErrorMessage.scopesRequired.code,i.ClientConfigurationErrorMessage.scopesRequired.desc+" Given value: "+e)},s.createInvalidPromptError=function(e){return new s(i.ClientConfigurationErrorMessage.invalidPrompt.code,i.ClientConfigurationErrorMessage.invalidPrompt.desc+" Given value: "+e)},s.createClaimsRequestParsingError=function(e){return new s(i.ClientConfigurationErrorMessage.claimsRequestParsingError.code,i.ClientConfigurationErrorMessage.claimsRequestParsingError.desc+" Given value: "+e)},s.createEmptyRequestError=function(){var e=i.ClientConfigurationErrorMessage.emptyRequestError;return new s(e.code,e.desc)},s.createInvalidCorrelationIdError=function(){return new s(i.ClientConfigurationErrorMessage.invalidCorrelationIdError.code,i.ClientConfigurationErrorMessage.invalidCorrelationIdError.desc)},s.createKnownAuthoritiesNotSetError=function(){return new s(i.ClientConfigurationErrorMessage.b2cKnownAuthoritiesNotSet.code,i.ClientConfigurationErrorMessage.b2cKnownAuthoritiesNotSet.desc)},s.createInvalidAuthorityTypeError=function(){return new s(i.ClientConfigurationErrorMessage.invalidAuthorityType.code,i.ClientConfigurationErrorMessage.invalidAuthorityType.desc)},s.createUntrustedAuthorityError=function(e){return new s(i.ClientConfigurationErrorMessage.untrustedAuthority.code,i.ClientConfigurationErrorMessage.untrustedAuthority.desc+" Provided Authority: "+e)},s.createTelemetryConfigError=function(r){var e=i.ClientConfigurationErrorMessage.telemetryConfigError,t=e.code,o=e.desc,n={applicationName:"string",applicationVersion:"string",telemetryEmitter:"function"};return new s(t,o+" mising values: "+Object.keys(n).reduce(function(e,t){return r[t]?e:e.concat([t+" ("+n[t]+")"])},[]).join(","))},s.createSsoSilentError=function(){return new s(i.ClientConfigurationErrorMessage.ssoSilentError.code,i.ClientConfigurationErrorMessage.ssoSilentError.desc)},s.createInvalidAuthorityMetadataError=function(){return new s(i.ClientConfigurationErrorMessage.invalidAuthorityMetadataError.code,i.ClientConfigurationErrorMessage.invalidAuthorityMetadataError.desc)},s);function s(e,t){var r=n.call(this,e,t)||this;return r.name="ClientConfigurationError",Object.setPrototypeOf(r,s.prototype),r}i.ClientConfigurationError=a},function(e,r,t){Object.defineProperty(r,"__esModule",{value:!0});var o=t(0),n=t(8),i=t(2);r.ClientAuthErrorMessage={multipleCacheAuthorities:{code:"multiple_authorities",desc:"Multiple authorities found in the cache. Pass authority in the API overload."},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"}};var a,s=(a=n.AuthError,o.__extends(c,a),c.createEndpointResolutionError=function(e){var t=r.ClientAuthErrorMessage.endpointResolutionError.desc;return e&&!i.StringUtils.isEmpty(e)&&(t+=" Details: "+e),new c(r.ClientAuthErrorMessage.endpointResolutionError.code,t)},c.createMultipleAuthoritiesInCacheError=function(e){return new c(r.ClientAuthErrorMessage.multipleCacheAuthorities.code,"Cache error for scope "+e+": "+r.ClientAuthErrorMessage.multipleCacheAuthorities.desc+".")},c.createPopupWindowError=function(e){var t=r.ClientAuthErrorMessage.popUpWindowError.desc;return e&&!i.StringUtils.isEmpty(e)&&(t+=" Details: "+e),new c(r.ClientAuthErrorMessage.popUpWindowError.code,t)},c.createTokenRenewalTimeoutError=function(){return new c(r.ClientAuthErrorMessage.tokenRenewalError.code,r.ClientAuthErrorMessage.tokenRenewalError.desc)},c.createInvalidIdTokenError=function(e){return new c(r.ClientAuthErrorMessage.invalidIdToken.code,r.ClientAuthErrorMessage.invalidIdToken.desc+" Given token: "+e)},c.createInvalidStateError=function(e,t){return new c(r.ClientAuthErrorMessage.invalidStateError.code,r.ClientAuthErrorMessage.invalidStateError.desc+" "+e+", state expected : "+t+".")},c.createNonceMismatchError=function(e,t){return new c(r.ClientAuthErrorMessage.nonceMismatchError.code,r.ClientAuthErrorMessage.nonceMismatchError.desc+" "+e+", nonce expected : "+t+".")},c.createLoginInProgressError=function(){return new c(r.ClientAuthErrorMessage.loginProgressError.code,r.ClientAuthErrorMessage.loginProgressError.desc)},c.createAcquireTokenInProgressError=function(){return new c(r.ClientAuthErrorMessage.acquireTokenProgressError.code,r.ClientAuthErrorMessage.acquireTokenProgressError.desc)},c.createUserCancelledError=function(){return new c(r.ClientAuthErrorMessage.userCancelledError.code,r.ClientAuthErrorMessage.userCancelledError.desc)},c.createErrorInCallbackFunction=function(e){return new c(r.ClientAuthErrorMessage.callbackError.code,r.ClientAuthErrorMessage.callbackError.desc+" "+e+".")},c.createUserLoginRequiredError=function(){return new c(r.ClientAuthErrorMessage.userLoginRequiredError.code,r.ClientAuthErrorMessage.userLoginRequiredError.desc)},c.createUserDoesNotExistError=function(){return new c(r.ClientAuthErrorMessage.userDoesNotExistError.code,r.ClientAuthErrorMessage.userDoesNotExistError.desc)},c.createClientInfoDecodingError=function(e){return new c(r.ClientAuthErrorMessage.clientInfoDecodingError.code,r.ClientAuthErrorMessage.clientInfoDecodingError.desc+" Failed with error: "+e)},c.createClientInfoNotPopulatedError=function(e){return new c(r.ClientAuthErrorMessage.clientInfoNotPopulatedError.code,r.ClientAuthErrorMessage.clientInfoNotPopulatedError.desc+" Failed with error: "+e)},c.createIdTokenNullOrEmptyError=function(e){return new c(r.ClientAuthErrorMessage.nullOrEmptyIdToken.code,r.ClientAuthErrorMessage.nullOrEmptyIdToken.desc+" Raw ID Token Value: "+e)},c.createIdTokenParsingError=function(e){return new c(r.ClientAuthErrorMessage.idTokenNotParsed.code,r.ClientAuthErrorMessage.idTokenNotParsed.desc+" Failed with error: "+e)},c.createTokenEncodingError=function(e){return new c(r.ClientAuthErrorMessage.tokenEncodingError.code,r.ClientAuthErrorMessage.tokenEncodingError.desc+" Attempted to decode: "+e)},c.createInvalidInteractionTypeError=function(){return new c(r.ClientAuthErrorMessage.invalidInteractionType.code,r.ClientAuthErrorMessage.invalidInteractionType.desc)},c.createCacheParseError=function(e){var t="invalid key: "+e+", "+r.ClientAuthErrorMessage.cacheParseError.desc;return new c(r.ClientAuthErrorMessage.cacheParseError.code,t)},c.createBlockTokenRequestsInHiddenIframeError=function(){return new c(r.ClientAuthErrorMessage.blockTokenRequestsInHiddenIframe.code,r.ClientAuthErrorMessage.blockTokenRequestsInHiddenIframe.desc)},c);function c(e,t){var r=a.call(this,e,t)||this;return r.name="ClientAuthError",Object.setPrototypeOf(r,c.prototype),r}r.ClientAuthError=s},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var o=r(5),n=r(1),i=(a.isIntersectingScopes=function(e,t){for(var r=this.trimAndConvertArrayToLowerCase(e.slice()),o=this.trimAndConvertArrayToLowerCase(t.slice()),n=0;n<o.length;n++)if(-1<r.indexOf(o[n].toLowerCase()))return!0;return!1},a.containsScope=function(e,t){var r=this.trimAndConvertArrayToLowerCase(e.slice());return this.trimAndConvertArrayToLowerCase(t.slice()).every(function(e){return 0<=r.indexOf(e.toString().toLowerCase())})},a.trimAndConvertToLowerCase=function(e){return e.trim().toLowerCase()},a.trimAndConvertArrayToLowerCase=function(e){var t=this;return e.map(function(e){return t.trimAndConvertToLowerCase(e)})},a.trimScopes=function(e){return e.map(function(e){return e.trim()})},a.removeElement=function(e,t){var r=this.trimAndConvertToLowerCase(t);return e.filter(function(e){return e!==r})},a.parseScope=function(e){var t="";if(e)for(var r=0;r<e.length;++r)t+=r!==e.length-1?e[r]+" ":e[r];return t},a.validateInputScope=function(e,t){if(e){if(!Array.isArray(e))throw o.ClientConfigurationError.createScopesNonArrayError(e);if(e.length<1&&t)throw o.ClientConfigurationError.createEmptyScopesArrayError(e.toString())}else if(t)throw o.ClientConfigurationError.createScopesRequiredError(e)},a.getScopeFromState=function(e){if(e){var t=e.indexOf(n.Constants.resourceDelimiter);if(-1<t&&t+1<e.length)return e.substring(t+1)}return""},a.appendScopes=function(e,t){if(e){var r=t?this.trimAndConvertArrayToLowerCase(t.slice()):null,o=this.trimAndConvertArrayToLowerCase(e.slice());return r?o.concat(r):o}return null},a.onlyContainsOidcScopes=function(e){var t=e.length,r=0;return-1<e.indexOf(n.Constants.openidScope)&&(r+=1),-1<e.indexOf(n.Constants.profileScope)&&(r+=1),0<t&&t===r},a.containsAnyOidcScopes=function(e){var t=-1<e.indexOf(n.Constants.openidScope),r=-1<e.indexOf(n.Constants.profileScope);return t||r},a.onlyContainsClientId=function(e,t){return!!e&&-1<e.indexOf(t)&&1===e.length},a.appendDefaultScopes=function(e){var t=e;return-1===t.indexOf(n.Constants.openidScope)&&t.push(n.Constants.openidScope),-1===t.indexOf(n.Constants.profileScope)&&t.push(n.Constants.profileScope),t},a.removeDefaultScopes=function(e){return e.filter(function(e){return e!==n.Constants.openidScope&&e!==n.Constants.profileScope})},a.translateClientIdIfSingleScope=function(e,t){return this.onlyContainsClientId(e,t)?n.Constants.oidcScopes:e},a);function a(){}t.ScopeSet=i},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var o=r(0);t.AuthErrorMessage={unexpectedError:{code:"unexpected_error",desc:"Unexpected error in authentication."},noWindowObjectError:{code:"no_window_object",desc:"No window object available. Details:"}};var n,i=(n=Error,o.__extends(a,n),a.createUnexpectedError=function(e){return new a(t.AuthErrorMessage.unexpectedError.code,t.AuthErrorMessage.unexpectedError.desc+": "+e)},a.createNoWindowObjectError=function(e){return new a(t.AuthErrorMessage.noWindowObjectError.code,t.AuthErrorMessage.noWindowObjectError.desc+" "+e)},a);function a(e,t){var r=n.call(this,t)||this;return Object.setPrototypeOf(r,a.prototype),r.errorCode=e,r.errorMessage=t,r.name="AuthError",r}t.AuthError=i},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var o,n,a=r(0),s=r(5),c=r(18),i=r(4),u=r(19),l=r(1);(n=o=t.AuthorityType||(t.AuthorityType={}))[n.Default=0]="Default",n[n.Adfs=1]="Adfs";var h=(d.isAdfs=function(e){var t=i.UrlUtils.GetUrlComponents(e).PathSegments;return t.length&&t[0].toLowerCase()===l.Constants.ADFS},Object.defineProperty(d.prototype,"AuthorityType",{get:function(){return d.isAdfs(this.canonicalAuthority)?o.Adfs:o.Default},enumerable:!0,configurable:!0}),Object.defineProperty(d.prototype,"Tenant",{get:function(){return this.CanonicalAuthorityUrlComponents.PathSegments[0]},enumerable:!0,configurable:!0}),Object.defineProperty(d.prototype,"AuthorizationEndpoint",{get:function(){return this.validateResolved(),this.tenantDiscoveryResponse.AuthorizationEndpoint.replace(/{tenant}|{tenantid}/g,this.Tenant)},enumerable:!0,configurable:!0}),Object.defineProperty(d.prototype,"EndSessionEndpoint",{get:function(){return this.validateResolved(),this.tenantDiscoveryResponse.EndSessionEndpoint.replace(/{tenant}|{tenantid}/g,this.Tenant)},enumerable:!0,configurable:!0}),Object.defineProperty(d.prototype,"SelfSignedJwtAudience",{get:function(){return this.validateResolved(),this.tenantDiscoveryResponse.Issuer.replace(/{tenant}|{tenantid}/g,this.Tenant)},enumerable:!0,configurable:!0}),d.prototype.validateResolved=function(){if(!this.hasCachedMetadata())throw"Please call ResolveEndpointsAsync first"},Object.defineProperty(d.prototype,"CanonicalAuthority",{get:function(){return this.canonicalAuthority},set:function(e){this.canonicalAuthority=i.UrlUtils.CanonicalizeUri(e),this.canonicalAuthorityUrlComponents=null},enumerable:!0,configurable:!0}),Object.defineProperty(d.prototype,"CanonicalAuthorityUrlComponents",{get:function(){return this.canonicalAuthorityUrlComponents||(this.canonicalAuthorityUrlComponents=i.UrlUtils.GetUrlComponents(this.CanonicalAuthority)),this.canonicalAuthorityUrlComponents},enumerable:!0,configurable:!0}),Object.defineProperty(d.prototype,"DefaultOpenIdConfigurationEndpoint",{get:function(){return this.AuthorityType===o.Adfs?""+this.CanonicalAuthority+l.WELL_KNOWN_SUFFIX:this.CanonicalAuthority+"v2.0/"+l.WELL_KNOWN_SUFFIX},enumerable:!0,configurable:!0}),d.prototype.validateAsUri=function(){var e;try{e=this.CanonicalAuthorityUrlComponents}catch(e){throw s.ClientConfigurationErrorMessage.invalidAuthorityType}if(!e.Protocol||"https:"!==e.Protocol.toLowerCase())throw s.ClientConfigurationErrorMessage.authorityUriInsecure;if(!e.PathSegments||e.PathSegments.length<1)throw s.ClientConfigurationErrorMessage.authorityUriInvalidPath},d.prototype.DiscoverEndpoints=function(e,t,r){var o=new c.XhrClient,n=l.NetworkRequestType.GET,i=t.createAndStartHttpEvent(r,n,e,"openIdConfigurationEndpoint");return o.sendRequestAsync(e,n,!0).then(function(e){return i.httpResponseStatus=e.statusCode,t.stopEvent(i),{AuthorizationEndpoint:e.body.authorization_endpoint,EndSessionEndpoint:e.body.end_session_endpoint,Issuer:e.body.issuer}}).catch(function(e){throw i.serverErrorCode=e,t.stopEvent(i),e})},d.prototype.resolveEndpointsAsync=function(n,i){return a.__awaiter(this,void 0,Promise,function(){var t,r,o;return a.__generator(this,function(e){switch(e.label){case 0:return this.IsValidationEnabled?(t=this.canonicalAuthorityUrlComponents.HostNameAndPort,0!==u.TrustedAuthority.getTrustedHostList().length?[3,2]:[4,u.TrustedAuthority.setTrustedAuthoritiesFromNetwork(this.canonicalAuthority,n,i)]):[3,3];case 1:e.sent(),e.label=2;case 2:if(!u.TrustedAuthority.IsInTrustedHostList(t))throw s.ClientConfigurationError.createUntrustedAuthorityError(t);e.label=3;case 3:return r=this.GetOpenIdConfigurationEndpoint(),[4,(o=this).DiscoverEndpoints(r,n,i)];case 4:return o.tenantDiscoveryResponse=e.sent(),[2,this.tenantDiscoveryResponse]}})})},d.prototype.hasCachedMetadata=function(){return!!(this.tenantDiscoveryResponse&&this.tenantDiscoveryResponse.AuthorizationEndpoint&&this.tenantDiscoveryResponse.EndSessionEndpoint&&this.tenantDiscoveryResponse.Issuer)},d.prototype.GetOpenIdConfigurationEndpoint=function(){return this.DefaultOpenIdConfigurationEndpoint},d);function d(e,t,r){this.IsValidationEnabled=t,this.CanonicalAuthority=e,this.validateAsUri(),this.tenantDiscoveryResponse=r}t.Authority=h},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var o=(n.parseExpiresIn=function(e){return e=e||"3599",parseInt(e,10)},n.now=function(){return Math.round((new Date).getTime()/1e3)},n.relativeNowMs=function(){return window.performance.now()},n);function n(){}t.TimeUtils=o},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!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>"},function(e,o,t){Object.defineProperty(o,"__esModule",{value:!0});var n=t(11),r=t(3),i=t(4),a=t(9);o.scrubTenantFromUri=function(e){var t=i.UrlUtils.GetUrlComponents(e);if(a.Authority.isAdfs(e))return e;var r=t.PathSegments;if(r&&2<=r.length){var o="tfp"===r[1]?2:1;o<r.length&&(r[o]=n.TENANT_PLACEHOLDER)}return t.Protocol+"//"+t.HostNameAndPort+"/"+r.join("/")},o.hashPersonalIdentifier=function(e){return r.CryptoUtils.base64Encode(e)},o.prependEventNamePrefix=function(e){return""+n.EVENT_NAME_PREFIX+(e||"")},o.supportsBrowserPerformance=function(){return!!("undefined"!=typeof window&&"performance"in window&&window.performance.mark&&window.performance.measure)},o.endBrowserPerformanceMeasurement=function(e,t,r){o.supportsBrowserPerformance()&&(window.performance.mark(r),window.performance.measure(e,t,r),window.performance.clearMeasures(e),window.performance.clearMarks(t),window.performance.clearMarks(r))},o.startBrowserPerformanceMeasurement=function(e){o.supportsBrowserPerformance()&&window.performance.mark(e)}},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var c,o,i=r(2),a=r(1);(o=c=t.LogLevel||(t.LogLevel={}))[o.Error=0]="Error",o[o.Warning=1]="Warning",o[o.Info=2]="Info",o[o.Verbose=3]="Verbose";var n=(s.prototype.logMessage=function(e,t,r){if(!(e>this.level||!this.piiLoggingEnabled&&r)){var o,n=(new Date).toUTCString();o=i.StringUtils.isEmpty(this.correlationId)?n+":"+a.libraryVersion()+"-"+c[e]+(r?"-pii":"")+" "+t:n+":"+this.correlationId+"-"+a.libraryVersion()+"-"+c[e]+(r?"-pii":"")+" "+t,this.executeCallback(e,o,r)}},s.prototype.executeCallback=function(e,t,r){this.localCallback&&this.localCallback(e,t,r)},s.prototype.error=function(e){this.logMessage(c.Error,e,!1)},s.prototype.errorPii=function(e){this.logMessage(c.Error,e,!0)},s.prototype.warning=function(e){this.logMessage(c.Warning,e,!1)},s.prototype.warningPii=function(e){this.logMessage(c.Warning,e,!0)},s.prototype.info=function(e){this.logMessage(c.Info,e,!1)},s.prototype.infoPii=function(e){this.logMessage(c.Info,e,!0)},s.prototype.verbose=function(e){this.logMessage(c.Verbose,e,!1)},s.prototype.verbosePii=function(e){this.logMessage(c.Verbose,e,!0)},s.prototype.isPiiLoggingEnabled=function(){return this.piiLoggingEnabled},s);function s(e,t){void 0===t&&(t={}),this.level=c.Info;var r=t.correlationId,o=void 0===r?"":r,n=t.level,i=void 0===n?c.Info:n,a=t.piiLoggingEnabled,s=void 0!==a&&a;this.localCallback=e,this.correlationId=o,this.level=i,this.piiLoggingEnabled=s}t.Logger=n},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var o=r(0),n=r(8);t.ServerErrorMessage={serverUnavailable:{code:"server_unavailable",desc:"Server is temporarily unavailable."},unknownServerError:{code:"unknown_server_error"}};var i,a=(i=n.AuthError,o.__extends(s,i),s.createServerUnavailableError=function(){return new s(t.ServerErrorMessage.serverUnavailable.code,t.ServerErrorMessage.serverUnavailable.desc)},s.createUnknownServerError=function(e){return new s(t.ServerErrorMessage.unknownServerError.code,e)},s);function s(e,t){var r=i.call(this,e,t)||this;return r.name="ServerError",Object.setPrototypeOf(r,s.prototype),r}t.ServerError=a},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var o=r(0),n=r(11),i=r(12),a=r(3),s=(c.prototype.setElapsedTime=function(e){this.event[i.prependEventNamePrefix(n.ELAPSED_TIME_KEY)]=e},c.prototype.stop=function(){this.setElapsedTime(+Date.now()-+this.startTimestamp),i.endBrowserPerformanceMeasurement(this.displayName,this.perfStartMark,this.perfEndMark)},c.prototype.start=function(){this.startTimestamp=Date.now(),this.event[i.prependEventNamePrefix(n.START_TIME_KEY)]=this.startTimestamp,i.startBrowserPerformanceMeasurement(this.perfStartMark)},Object.defineProperty(c.prototype,"telemetryCorrelationId",{get:function(){return this.event[""+n.TELEMETRY_BLOB_EVENT_NAMES.MsalCorrelationIdConstStrKey]},set:function(e){this.event[""+n.TELEMETRY_BLOB_EVENT_NAMES.MsalCorrelationIdConstStrKey]=e},enumerable:!0,configurable:!0}),Object.defineProperty(c.prototype,"eventName",{get:function(){return this.event[i.prependEventNamePrefix(n.EVENT_NAME_KEY)]},enumerable:!0,configurable:!0}),c.prototype.get=function(){return o.__assign({},this.event,{eventId:this.eventId})},Object.defineProperty(c.prototype,"key",{get:function(){return this.telemetryCorrelationId+"_"+this.eventId+"-"+this.eventName},enumerable:!0,configurable:!0}),Object.defineProperty(c.prototype,"displayName",{get:function(){return"Msal-"+this.label+"-"+this.telemetryCorrelationId},enumerable:!0,configurable:!0}),Object.defineProperty(c.prototype,"perfStartMark",{get:function(){return"start-"+this.key},enumerable:!0,configurable:!0}),Object.defineProperty(c.prototype,"perfEndMark",{get:function(){return"end-"+this.key},enumerable:!0,configurable:!0}),c);function c(e,t,r){var o;this.eventId=a.CryptoUtils.createNewGuid(),this.label=r,this.event=((o={})[i.prependEventNamePrefix(n.EVENT_NAME_KEY)]=e,o[i.prependEventNamePrefix(n.ELAPSED_TIME_KEY)]=-1,o[""+n.TELEMETRY_BLOB_EVENT_NAMES.MsalCorrelationIdConstStrKey]=t,o)}t.default=s},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var m=r(0),s=r(30),c=r(31),v=r(17),C=r(9),T=r(32),S=r(33),I=r(34),b=r(22),y=r(7),_=r(2),E=r(23),A=r(20),p=r(10),w=r(4),P=r(21),k=r(37),R=r(38),o=r(24),a=r(5),O=r(8),N=r(6),U=r(14),M=r(25),K=r(26),u=m.__importDefault(r(39)),l=r(27),x=r(1),h=r(3),n=r(19),d=r(42),i=(Object.defineProperty(g.prototype,"authority",{get:function(){return this.authorityInstance.CanonicalAuthority},set:function(e){this.authorityInstance=R.AuthorityFactory.CreateInstance(e,this.config.auth.validateAuthority)},enumerable:!0,configurable:!0}),g.prototype.getAuthorityInstance=function(){return this.authorityInstance},g.prototype.handleRedirectCallback=function(e,t){if(!e)throw a.ClientConfigurationError.createInvalidCallbackObjectError(e);t?(this.tokenReceivedCallback=e,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=e,this.redirectError?this.authErrorHandler(x.Constants.interactionTypeRedirect,this.redirectError,this.redirectResponse):this.redirectResponse&&this.authResponseHandler(x.Constants.interactionTypeRedirect,this.redirectResponse)},g.prototype.urlContainsHash=function(e){return this.logger.verbose("UrlContainsHash has been called"),w.UrlUtils.urlContainsHash(e)},g.prototype.authResponseHandler=function(e,t,r){if(this.logger.verbose("AuthResponseHandler has been called"),e===x.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(e!==x.Constants.interactionTypePopup)throw N.ClientAuthError.createInvalidInteractionTypeError();this.logger.verbose("Interaction type is popup, resolving"),r(t)}},g.prototype.authErrorHandler=function(e,t,r,o){if(this.logger.verbose("AuthErrorHandler has been called"),this.cacheStorage.removeItem(x.TemporaryCacheKeys.INTERACTION_STATUS),e===x.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,r.accountState);else{if(!this.authResponseCallback)throw this.logger.verbose("handleRedirectCallback has not been called and no callbacks are registered, throwing error"),t;this.logger.verbose("One callback was provided to handleRedirectCallback, calling authResponseCallback with error"),this.authResponseCallback(t,r)}else{if(e!==x.Constants.interactionTypePopup)throw N.ClientAuthError.createInvalidInteractionTypeError();this.logger.verbose("Interaction type is popup, rejecting"),o(t)}},g.prototype.loginRedirect=function(e){this.logger.verbose("LoginRedirect has been called");var t=P.RequestUtils.validateRequest(e,!0,this.clientId,x.Constants.interactionTypeRedirect);this.acquireTokenInteractive(x.Constants.interactionTypeRedirect,!0,t,null,null)},g.prototype.acquireTokenRedirect=function(e){this.logger.verbose("AcquireTokenRedirect has been called");var t=P.RequestUtils.validateRequest(e,!1,this.clientId,x.Constants.interactionTypeRedirect);this.acquireTokenInteractive(x.Constants.interactionTypeRedirect,!1,t,null,null)},g.prototype.loginPopup=function(e){var r=this;this.logger.verbose("LoginPopup has been called");var o=P.RequestUtils.validateRequest(e,!0,this.clientId,x.Constants.interactionTypePopup),t=this.telemetryManager.createAndStartApiEvent(o.correlationId,l.API_EVENT_IDENTIFIER.LoginPopup);return new Promise(function(e,t){r.acquireTokenInteractive(x.Constants.interactionTypePopup,!0,o,e,t)}).then(function(e){return r.logger.verbose("Successfully logged in"),r.telemetryManager.stopAndFlushApiEvent(o.correlationId,t,!0),e}).catch(function(e){throw r.cacheStorage.resetTempCacheItems(o.state),r.telemetryManager.stopAndFlushApiEvent(o.correlationId,t,!1,e.errorCode),e})},g.prototype.acquireTokenPopup=function(e){var r=this;this.logger.verbose("AcquireTokenPopup has been called");var o=P.RequestUtils.validateRequest(e,!1,this.clientId,x.Constants.interactionTypePopup),t=this.telemetryManager.createAndStartApiEvent(o.correlationId,l.API_EVENT_IDENTIFIER.AcquireTokenPopup);return new Promise(function(e,t){r.acquireTokenInteractive(x.Constants.interactionTypePopup,!1,o,e,t)}).then(function(e){return r.logger.verbose("Successfully acquired token"),r.telemetryManager.stopAndFlushApiEvent(o.correlationId,t,!0),e}).catch(function(e){throw r.cacheStorage.resetTempCacheItems(o.state),r.telemetryManager.stopAndFlushApiEvent(o.correlationId,t,!1,e.errorCode),e})},g.prototype.acquireTokenInteractive=function(t,r,o,n,i){var a=this;this.logger.verbose("AcquireTokenInteractive has been called"),E.WindowUtils.blockReloadInHiddenIframes();var e,s=this.cacheStorage.getItem(x.TemporaryCacheKeys.INTERACTION_STATUS);if(t===x.Constants.interactionTypeRedirect&&this.cacheStorage.setItem(x.TemporaryCacheKeys.REDIRECT_REQUEST,""+x.Constants.inProgress+x.Constants.resourceDelimiter+o.state),s===x.Constants.inProgress){var c=r?N.ClientAuthError.createLoginInProgressError():N.ClientAuthError.createAcquireTokenInProgressError(),u=K.buildResponseStateOnly(this.getAccountState(o.state));return this.cacheStorage.resetTempCacheItems(o.state),void this.authErrorHandler(t,c,u,i)}if(o&&o.account&&!r?(e=o.account,this.logger.verbose("Account set from request")):(e=this.getAccount(),this.logger.verbose("Account set from MSAL Cache")),e||v.ServerRequestParameters.isSSOParam(o))this.logger.verbose("User session exists, login not required"),this.acquireTokenHelper(e,t,r,o,n,i);else{if(!r)return this.logger.verbose("AcquireToken call, no context or account given"),this.l