@touchtech/web-auth 0.1.0 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/Protected/Protected.d.ts +7 -0
- package/dist/components/Protected/index.d.ts +1 -0
- package/dist/components/index.d.ts +1 -1
- package/dist/contexts/ProtectedRouteContext.d.ts +2 -2
- package/dist/index.js +1 -1
- package/package.json +9 -7
- package/dist/components/ProtectedRoute/ProtectedRoute.d.ts +0 -7
- package/dist/components/ProtectedRoute/index.d.ts +0 -1
- /package/dist/components/{ProtectedRoute/__tests__/protectedRoute.test.d.ts → Protected/__tests__/Protected.test.d.ts} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as Protected } from "./Protected";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from "./
|
|
1
|
+
export * from "./Protected";
|
|
@@ -10,6 +10,6 @@ declare type ProviderValue = {
|
|
|
10
10
|
privilege: string;
|
|
11
11
|
unauthorizedPath: string;
|
|
12
12
|
};
|
|
13
|
-
export declare const
|
|
14
|
-
export declare const
|
|
13
|
+
export declare const ProtectedContentContext: React.Context<ProviderValue>;
|
|
14
|
+
export declare const ProtectedContentProvider: ({ children, tenantId, privilege, unauthorizedPath, }: Props) => JSX.Element;
|
|
15
15
|
export {};
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(()=>{var e={438:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AuthorizationRequest=void 0;var n=r(537),o=r(96),i=function(){function e(t,r,o){void 0===r&&(r=new n.DefaultCrypto),void 0===o&&(o=!0),this.crypto=r,this.usePkce=o,this.clientId=t.client_id,this.redirectUri=t.redirect_uri,this.scope=t.scope,this.responseType=t.response_type||e.RESPONSE_TYPE_CODE,this.state=t.state||function(e){return e.generateRandom(10)}(r),this.extras=t.extras,this.internal=t.internal}return e.prototype.setupCodeVerifier=function(){var e=this;if(this.usePkce){var t=this.crypto.generateRandom(128);return this.crypto.deriveChallenge(t).catch((function(e){o.log("Unable to generate PKCE challenge. Not using PKCE",e)})).then((function(r){r&&(e.internal=e.internal||{},e.internal.code_verifier=t,e.extras=e.extras||{},e.extras.code_challenge=r,e.extras.code_challenge_method="S256")}))}return Promise.resolve()},e.prototype.toJson=function(){var e=this;return this.setupCodeVerifier().then((function(){return{response_type:e.responseType,client_id:e.clientId,redirect_uri:e.redirectUri,scope:e.scope,state:e.state,extras:e.extras,internal:e.internal}}))},e.RESPONSE_TYPE_TOKEN="token",e.RESPONSE_TYPE_CODE="code",e}();t.AuthorizationRequest=i},394:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AuthorizationRequestHandler=t.BUILT_IN_PARAMETERS=t.AuthorizationNotifier=void 0;var n=r(96),o=function(){function e(){this.listener=null}return e.prototype.setAuthorizationListener=function(e){this.listener=e},e.prototype.onAuthorizationComplete=function(e,t,r){this.listener&&this.listener(e,t,r)},e}();t.AuthorizationNotifier=o,t.BUILT_IN_PARAMETERS=["redirect_uri","client_id","response_type","state","scope"];var i=function(){function e(e,t){this.utils=e,this.crypto=t,this.notifier=null}return e.prototype.buildRequestUrl=function(e,r){var n={redirect_uri:r.redirectUri,client_id:r.clientId,response_type:r.responseType,state:r.state,scope:r.scope};if(r.extras)for(var o in r.extras)r.extras.hasOwnProperty(o)&&t.BUILT_IN_PARAMETERS.indexOf(o)<0&&(n[o]=r.extras[o]);var i=this.utils.stringify(n);return e.authorizationEndpoint+"?"+i},e.prototype.completeAuthorizationRequestIfPossible=function(){var e=this;return n.log("Checking to see if there is an authorization response to be delivered."),this.notifier||n.log("Notifier is not present on AuthorizationRequest handler.\n No delivery of result will be possible"),this.completeAuthorizationRequest().then((function(t){t||n.log("No result is available yet."),t&&e.notifier&&e.notifier.onAuthorizationComplete(t.request,t.response,t.error)}))},e.prototype.setAuthorizationNotifier=function(e){return this.notifier=e,this},e}();t.AuthorizationRequestHandler=i},208:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AuthorizationError=t.AuthorizationResponse=void 0;var r=function(){function e(e){this.code=e.code,this.state=e.state}return e.prototype.toJson=function(){return{code:this.code,state:this.state}},e}();t.AuthorizationResponse=r;var n=function(){function e(e){this.error=e.error,this.errorDescription=e.error_description,this.errorUri=e.error_uri,this.state=e.state}return e.prototype.toJson=function(){return{error:this.error,error_description:this.errorDescription,error_uri:this.errorUri,state:this.state}},e}();t.AuthorizationError=n},373:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AuthorizationServiceConfiguration=void 0;var n=r(157),o=function(){function e(e){this.authorizationEndpoint=e.authorization_endpoint,this.tokenEndpoint=e.token_endpoint,this.revocationEndpoint=e.revocation_endpoint,this.userInfoEndpoint=e.userinfo_endpoint,this.endSessionEndpoint=e.end_session_endpoint}return e.prototype.toJson=function(){return{authorization_endpoint:this.authorizationEndpoint,token_endpoint:this.tokenEndpoint,revocation_endpoint:this.revocationEndpoint,end_session_endpoint:this.endSessionEndpoint,userinfo_endpoint:this.userInfoEndpoint}},e.fetchFromIssuer=function(t,r){var o=t+"/.well-known/openid-configuration";return(r||new n.JQueryRequestor).xhr({url:o,dataType:"json",method:"GET"}).then((function(t){return new e(t)}))},e}();t.AuthorizationServiceConfiguration=o},537:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DefaultCrypto=t.textEncodeLite=t.urlSafe=t.bufferToString=void 0;var n=r(742),o=r(3),i="undefined"!=typeof window&&!!window.crypto,s=i&&!!window.crypto.subtle,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";function u(e){for(var t=[],r=0;r<e.byteLength;r+=1){var n=e[r]%a.length;t.push(a[n])}return t.join("")}function c(e){return n.fromByteArray(new Uint8Array(e)).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function l(e){for(var t=new ArrayBuffer(e.length),r=new Uint8Array(t),n=0;n<e.length;n++)r[n]=e.charCodeAt(n);return r}t.bufferToString=u,t.urlSafe=c,t.textEncodeLite=l;var p=function(){function e(){}return e.prototype.generateRandom=function(e){var t=new Uint8Array(e);if(i)window.crypto.getRandomValues(t);else for(var r=0;r<e;r+=1)t[r]=Math.random()*a.length|0;return u(t)},e.prototype.deriveChallenge=function(e){return e.length<43||e.length>128?Promise.reject(new o.AppAuthError("Invalid code length.")):s?new Promise((function(t,r){crypto.subtle.digest("SHA-256",l(e)).then((function(e){return t(c(new Uint8Array(e)))}),(function(e){return r(e)}))})):Promise.reject(new o.AppAuthError("window.crypto.subtle is unavailable."))},e}();t.DefaultCrypto=p},3:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AppAuthError=void 0;t.AppAuthError=function(e,t){this.message=e,this.extras=t}},577:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.IS_PROFILE=t.IS_LOG=void 0,t.IS_LOG=!0,t.IS_PROFILE=!1},865:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),o=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),o(r(438),t),o(r(394),t),o(r(208),t),o(r(373),t),o(r(537),t),o(r(3),t),o(r(577),t),o(r(96),t),o(r(629),t),o(r(417),t),o(r(33),t),o(r(480),t),o(r(892),t),o(r(551),t),o(r(298),t),o(r(53),t),o(r(157),t)},96:function(e,t,r){"use strict";var n=this&&this.__spreadArray||function(e,t){for(var r=0,n=t.length,o=e.length;r<n;r++,o++)e[o]=t[r];return e};Object.defineProperty(t,"__esModule",{value:!0}),t.profile=t.log=void 0;var o=r(577);function i(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];if(o.IS_LOG){var i=t?t.length:0;i>0?console.log.apply(console,n([e],t)):console.log(e)}}t.log=i;var s="undefined"!=typeof window&&!!window.performance&&!!console.profile;t.profile=function(e,t,r){return o.IS_PROFILE?function(e,t,r){var o=r.value,a=o.name;return a||(a="anonymous function"),r.value=s?function(e){console.profile(a);var t=window.performance.now(),r=o.call.apply(o,n([this||window],e)),i=window.performance.now()-t;return console.log(a+" took "+i+" ms"),console.profileEnd(),r}:function(e){i("Profile start "+a);var t=Date.now(),r=o.call.apply(o,n([this||window],e)),s=Date.now()-t;return i("Profile end "+a+" took "+s+" ms."),r},r}(0,0,r):r}},629:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BasicQueryStringUtils=void 0;var r=function(){function e(){}return e.prototype.parse=function(e,t){return t?this.parseQueryString(e.hash):this.parseQueryString(e.search)},e.prototype.parseQueryString=function(e){for(var t={},r=(e=e.trim().replace(/^(\?|#|&)/,"")).split("&"),n=0;n<r.length;n+=1){var o=r[n].split("=");if(o.length>=2){var i=decodeURIComponent(o.shift()),s=o.length>0?o.join("="):null;s&&(t[i]=decodeURIComponent(s))}}return t},e.prototype.stringify=function(e){var t=[];for(var r in e)e.hasOwnProperty(r)&&e[r]&&t.push(encodeURIComponent(r)+"="+encodeURIComponent(e[r]));return t.join("&")},e}();t.BasicQueryStringUtils=r},417:function(e,t,r){"use strict";var n,o=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.RedirectRequestHandler=void 0;var i=r(438),s=r(394),a=r(208),u=r(537),c=r(96),l=r(629),p=r(480),f=function(e){return e+"_appauth_authorization_request"},h=function(e){return e+"_appauth_authorization_service_configuration"},y="appauth_current_authorization_request",d=function(e){function t(t,r,n,o){void 0===t&&(t=new p.LocalStorageBackend),void 0===r&&(r=new l.BasicQueryStringUtils),void 0===n&&(n=window.location),void 0===o&&(o=new u.DefaultCrypto);var i=e.call(this,r,o)||this;return i.storageBackend=t,i.locationLike=n,i}return o(t,e),t.prototype.performAuthorizationRequest=function(e,t){var r=this,n=this.crypto.generateRandom(10);Promise.all([this.storageBackend.setItem(y,n),t.toJson().then((function(e){return r.storageBackend.setItem(f(n),JSON.stringify(e))})),this.storageBackend.setItem(h(n),JSON.stringify(e.toJson()))]).then((function(){var n=r.buildRequestUrl(e,t);c.log("Making a request to ",t,n),r.locationLike.assign(n)}))},t.prototype.completeAuthorizationRequest=function(){var e=this;return this.storageBackend.getItem(y).then((function(t){return t?e.storageBackend.getItem(f(t)).then((function(e){return JSON.parse(e)})).then((function(e){return new i.AuthorizationRequest(e)})).then((function(r){var n=""+e.locationLike.origin+e.locationLike.pathname,o=e.utils.parse(e.locationLike,!0),i=o.state,s=o.code,u=o.error;c.log("Potential authorization request ",n,o,i,s,u);var l=i===r.state,p=null,d=null;if(l){if(u){var v=o.error_uri,m=o.error_description;d=new a.AuthorizationError({error:u,error_description:m,error_uri:v,state:i})}else p=new a.AuthorizationResponse({code:s,state:i});return Promise.all([e.storageBackend.removeItem(y),e.storageBackend.removeItem(f(t)),e.storageBackend.removeItem(h(t))]).then((function(){return c.log("Delivering authorization response"),{request:r,response:p,error:d}}))}return c.log("Mismatched request (state and request_uri) dont match."),Promise.resolve(null)})):null}))},t}(s.AuthorizationRequestHandler);t.RedirectRequestHandler=d},33:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.RevokeTokenRequest=void 0;var r=function(){function e(e){this.token=e.token,this.tokenTypeHint=e.token_type_hint,this.clientId=e.client_id,this.clientSecret=e.client_secret}return e.prototype.toJson=function(){var e={token:this.token};return this.tokenTypeHint&&(e.token_type_hint=this.tokenTypeHint),this.clientId&&(e.client_id=this.clientId),this.clientSecret&&(e.client_secret=this.clientSecret),e},e.prototype.toStringMap=function(){return this.toJson()},e}();t.RevokeTokenRequest=r},480:function(e,t){"use strict";var r,n=this&&this.__extends||(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},r(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0}),t.LocalStorageBackend=t.StorageBackend=void 0;var o=function(){};t.StorageBackend=o;var i=function(e){function t(t){var r=e.call(this)||this;return r.storage=t||window.localStorage,r}return n(t,e),t.prototype.getItem=function(e){var t=this;return new Promise((function(r,n){r(t.storage.getItem(e)||null)}))},t.prototype.removeItem=function(e){var t=this;return new Promise((function(r,n){t.storage.removeItem(e),r()}))},t.prototype.clear=function(){var e=this;return new Promise((function(t,r){e.storage.clear(),t()}))},t.prototype.setItem=function(e,t){var r=this;return new Promise((function(n,o){r.storage.setItem(e,t),n()}))},t}(o);t.LocalStorageBackend=i},892:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TokenRequest=t.GRANT_TYPE_REFRESH_TOKEN=t.GRANT_TYPE_AUTHORIZATION_CODE=void 0,t.GRANT_TYPE_AUTHORIZATION_CODE="authorization_code",t.GRANT_TYPE_REFRESH_TOKEN="refresh_token";var r=function(){function e(e){this.clientId=e.client_id,this.redirectUri=e.redirect_uri,this.grantType=e.grant_type,this.code=e.code,this.refreshToken=e.refresh_token,this.extras=e.extras}return e.prototype.toJson=function(){return{grant_type:this.grantType,code:this.code,refresh_token:this.refreshToken,redirect_uri:this.redirectUri,client_id:this.clientId,extras:this.extras}},e.prototype.toStringMap=function(){var e={grant_type:this.grantType,client_id:this.clientId,redirect_uri:this.redirectUri};if(this.code&&(e.code=this.code),this.refreshToken&&(e.refresh_token=this.refreshToken),this.extras)for(var t in this.extras)this.extras.hasOwnProperty(t)&&!e.hasOwnProperty(t)&&(e[t]=this.extras[t]);return e},e}();t.TokenRequest=r},551:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BaseTokenRequestHandler=void 0;var n=r(3),o=r(629),i=r(298),s=r(157),a=function(){function e(e,t){void 0===e&&(e=new s.JQueryRequestor),void 0===t&&(t=new o.BasicQueryStringUtils),this.requestor=e,this.utils=t}return e.prototype.isTokenResponse=function(e){return void 0===e.error},e.prototype.performRevokeTokenRequest=function(e,t){return this.requestor.xhr({url:e.revocationEndpoint,method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},data:this.utils.stringify(t.toStringMap())}).then((function(e){return!0}))},e.prototype.performTokenRequest=function(e,t){var r=this;return this.requestor.xhr({url:e.tokenEndpoint,method:"POST",dataType:"json",headers:{"Content-Type":"application/x-www-form-urlencoded"},data:this.utils.stringify(t.toStringMap())}).then((function(e){return r.isTokenResponse(e)?new i.TokenResponse(e):Promise.reject(new n.AppAuthError(e.error,new i.TokenError(e)))}))},e}();t.BaseTokenRequestHandler=a},298:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TokenError=t.TokenResponse=t.nowInSeconds=void 0,t.nowInSeconds=function(){return Math.round((new Date).getTime()/1e3)};var r=function(){function e(e){this.accessToken=e.access_token,this.tokenType=e.token_type||"bearer",e.expires_in&&(this.expiresIn=parseInt(e.expires_in,10)),this.refreshToken=e.refresh_token,this.scope=e.scope,this.idToken=e.id_token,this.issuedAt=e.issued_at||t.nowInSeconds()}return e.prototype.toJson=function(){var e;return{access_token:this.accessToken,id_token:this.idToken,refresh_token:this.refreshToken,scope:this.scope,token_type:this.tokenType,issued_at:this.issuedAt,expires_in:null===(e=this.expiresIn)||void 0===e?void 0:e.toString()}},e.prototype.isValid=function(e){return void 0===e&&(e=-600),!this.expiresIn||t.nowInSeconds()<this.issuedAt+this.expiresIn+e},e}();t.TokenResponse=r;var n=function(){function e(e){this.error=e.error,this.errorDescription=e.error_description,this.errorUri=e.error_uri}return e.prototype.toJson=function(){return{error:this.error,error_description:this.errorDescription,error_uri:this.errorUri}},e}();t.TokenError=n},53:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},157:function(e,t,r){"use strict";var n,o=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.TestRequestor=t.FetchRequestor=t.JQueryRequestor=t.Requestor=void 0;var i=r(3),s=function(){};t.Requestor=s;var a=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return o(t,e),t.prototype.xhr=function(e){var t=$.ajax(e);return new Promise((function(e,r){t.then((function(t,r,n){e(t)}),(function(e,t,n){r(new i.AppAuthError(n))}))}))},t}(s);t.JQueryRequestor=a;var u=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return o(t,e),t.prototype.xhr=function(e){if(!e.url)return Promise.reject(new i.AppAuthError("A URL must be provided."));var t=new URL(e.url),r={};if(r.method=e.method,r.mode="cors",e.data&&(e.method&&"POST"===e.method.toUpperCase()?r.body=e.data:new URLSearchParams(e.data).forEach((function(e,r){t.searchParams.append(r,e)}))),r.headers={},e.headers)for(var n in e.headers)e.headers.hasOwnProperty(n)&&(r.headers[n]=e.headers[n]);var o=e.dataType&&"json"===e.dataType.toLowerCase();return o&&(r.headers.Accept="application/json, text/javascript, */*; q=0.01"),fetch(t.toString(),r).then((function(e){if(e.status>=200&&e.status<300){var t=e.headers.get("content-type");return o||t&&-1!==t.indexOf("application/json")?e.json():e.text()}return Promise.reject(new i.AppAuthError(e.status.toString(),e.statusText))}))},t}(s);t.FetchRequestor=u;var c=function(e){function t(t){var r=e.call(this)||this;return r.promise=t,r}return o(t,e),t.prototype.xhr=function(e){return this.promise},t}(s);t.TestRequestor=c},742:(e,t)=>{"use strict";t.byteLength=function(e){var t=u(e),r=t[0],n=t[1];return 3*(r+n)/4-n},t.toByteArray=function(e){var t,r,i=u(e),s=i[0],a=i[1],c=new o(function(e,t,r){return 3*(t+r)/4-r}(0,s,a)),l=0,p=a>0?s-4:s;for(r=0;r<p;r+=4)t=n[e.charCodeAt(r)]<<18|n[e.charCodeAt(r+1)]<<12|n[e.charCodeAt(r+2)]<<6|n[e.charCodeAt(r+3)],c[l++]=t>>16&255,c[l++]=t>>8&255,c[l++]=255&t;return 2===a&&(t=n[e.charCodeAt(r)]<<2|n[e.charCodeAt(r+1)]>>4,c[l++]=255&t),1===a&&(t=n[e.charCodeAt(r)]<<10|n[e.charCodeAt(r+1)]<<4|n[e.charCodeAt(r+2)]>>2,c[l++]=t>>8&255,c[l++]=255&t),c},t.fromByteArray=function(e){for(var t,n=e.length,o=n%3,i=[],s=16383,a=0,u=n-o;a<u;a+=s)i.push(c(e,a,a+s>u?u:a+s));return 1===o?(t=e[n-1],i.push(r[t>>2]+r[t<<4&63]+"==")):2===o&&(t=(e[n-2]<<8)+e[n-1],i.push(r[t>>10]+r[t>>4&63]+r[t<<2&63]+"=")),i.join("")};for(var r=[],n=[],o="undefined"!=typeof Uint8Array?Uint8Array:Array,i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0,a=i.length;s<a;++s)r[s]=i[s],n[i.charCodeAt(s)]=s;function u(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");return-1===r&&(r=t),[r,r===t?0:4-r%4]}function c(e,t,n){for(var o,i,s=[],a=t;a<n;a+=3)o=(e[a]<<16&16711680)+(e[a+1]<<8&65280)+(255&e[a+2]),s.push(r[(i=o)>>18&63]+r[i>>12&63]+r[i>>6&63]+r[63&i]);return s.join("")}n["-".charCodeAt(0)]=62,n["_".charCodeAt(0)]=63},924:(e,t,r)=>{"use strict";var n=r(210),o=r(559),i=o(n("String.prototype.indexOf"));e.exports=function(e,t){var r=n(e,!!t);return"function"==typeof r&&i(e,".prototype.")>-1?o(r):r}},559:(e,t,r)=>{"use strict";var n=r(612),o=r(210),i=o("%Function.prototype.apply%"),s=o("%Function.prototype.call%"),a=o("%Reflect.apply%",!0)||n.call(s,i),u=o("%Object.getOwnPropertyDescriptor%",!0),c=o("%Object.defineProperty%",!0),l=o("%Math.max%");if(c)try{c({},"a",{value:1})}catch(e){c=null}e.exports=function(e){var t=a(n,s,arguments);if(u&&c){var r=u(t,"length");r.configurable&&c(t,"length",{value:1+l(0,e.length-(arguments.length-1))})}return t};var p=function(){return a(n,i,arguments)};c?c(e.exports,"apply",{value:p}):e.exports.apply=p},729:e=>{"use strict";var t=Object.prototype.hasOwnProperty,r="~";function n(){}function o(e,t,r){this.fn=e,this.context=t,this.once=r||!1}function i(e,t,n,i,s){if("function"!=typeof n)throw new TypeError("The listener must be a function");var a=new o(n,i||e,s),u=r?r+t:t;return e._events[u]?e._events[u].fn?e._events[u]=[e._events[u],a]:e._events[u].push(a):(e._events[u]=a,e._eventsCount++),e}function s(e,t){0==--e._eventsCount?e._events=new n:delete e._events[t]}function a(){this._events=new n,this._eventsCount=0}Object.create&&(n.prototype=Object.create(null),(new n).__proto__||(r=!1)),a.prototype.eventNames=function(){var e,n,o=[];if(0===this._eventsCount)return o;for(n in e=this._events)t.call(e,n)&&o.push(r?n.slice(1):n);return Object.getOwnPropertySymbols?o.concat(Object.getOwnPropertySymbols(e)):o},a.prototype.listeners=function(e){var t=r?r+e:e,n=this._events[t];if(!n)return[];if(n.fn)return[n.fn];for(var o=0,i=n.length,s=new Array(i);o<i;o++)s[o]=n[o].fn;return s},a.prototype.listenerCount=function(e){var t=r?r+e:e,n=this._events[t];return n?n.fn?1:n.length:0},a.prototype.emit=function(e,t,n,o,i,s){var a=r?r+e:e;if(!this._events[a])return!1;var u,c,l=this._events[a],p=arguments.length;if(l.fn){switch(l.once&&this.removeListener(e,l.fn,void 0,!0),p){case 1:return l.fn.call(l.context),!0;case 2:return l.fn.call(l.context,t),!0;case 3:return l.fn.call(l.context,t,n),!0;case 4:return l.fn.call(l.context,t,n,o),!0;case 5:return l.fn.call(l.context,t,n,o,i),!0;case 6:return l.fn.call(l.context,t,n,o,i,s),!0}for(c=1,u=new Array(p-1);c<p;c++)u[c-1]=arguments[c];l.fn.apply(l.context,u)}else{var f,h=l.length;for(c=0;c<h;c++)switch(l[c].once&&this.removeListener(e,l[c].fn,void 0,!0),p){case 1:l[c].fn.call(l[c].context);break;case 2:l[c].fn.call(l[c].context,t);break;case 3:l[c].fn.call(l[c].context,t,n);break;case 4:l[c].fn.call(l[c].context,t,n,o);break;default:if(!u)for(f=1,u=new Array(p-1);f<p;f++)u[f-1]=arguments[f];l[c].fn.apply(l[c].context,u)}}return!0},a.prototype.on=function(e,t,r){return i(this,e,t,r,!1)},a.prototype.once=function(e,t,r){return i(this,e,t,r,!0)},a.prototype.removeListener=function(e,t,n,o){var i=r?r+e:e;if(!this._events[i])return this;if(!t)return s(this,i),this;var a=this._events[i];if(a.fn)a.fn!==t||o&&!a.once||n&&a.context!==n||s(this,i);else{for(var u=0,c=[],l=a.length;u<l;u++)(a[u].fn!==t||o&&!a[u].once||n&&a[u].context!==n)&&c.push(a[u]);c.length?this._events[i]=1===c.length?c[0]:c:s(this,i)}return this},a.prototype.removeAllListeners=function(e){var t;return e?(t=r?r+e:e,this._events[t]&&s(this,t)):(this._events=new n,this._eventsCount=0),this},a.prototype.off=a.prototype.removeListener,a.prototype.addListener=a.prototype.on,a.prefixed=r,a.EventEmitter=a,e.exports=a},187:e=>{"use strict";var t,r="object"==typeof Reflect?Reflect:null,n=r&&"function"==typeof r.apply?r.apply:function(e,t,r){return Function.prototype.apply.call(e,t,r)};t=r&&"function"==typeof r.ownKeys?r.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var o=Number.isNaN||function(e){return e!=e};function i(){i.init.call(this)}e.exports=i,e.exports.once=function(e,t){return new Promise((function(r,n){function o(r){e.removeListener(t,i),n(r)}function i(){"function"==typeof e.removeListener&&e.removeListener("error",o),r([].slice.call(arguments))}d(e,t,i,{once:!0}),"error"!==t&&function(e,t,r){"function"==typeof e.on&&d(e,"error",t,{once:!0})}(e,o)}))},i.EventEmitter=i,i.prototype._events=void 0,i.prototype._eventsCount=0,i.prototype._maxListeners=void 0;var s=10;function a(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function u(e){return void 0===e._maxListeners?i.defaultMaxListeners:e._maxListeners}function c(e,t,r,n){var o,i,s,c;if(a(r),void 0===(i=e._events)?(i=e._events=Object.create(null),e._eventsCount=0):(void 0!==i.newListener&&(e.emit("newListener",t,r.listener?r.listener:r),i=e._events),s=i[t]),void 0===s)s=i[t]=r,++e._eventsCount;else if("function"==typeof s?s=i[t]=n?[r,s]:[s,r]:n?s.unshift(r):s.push(r),(o=u(e))>0&&s.length>o&&!s.warned){s.warned=!0;var l=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");l.name="MaxListenersExceededWarning",l.emitter=e,l.type=t,l.count=s.length,c=l,console&&console.warn&&console.warn(c)}return e}function l(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function p(e,t,r){var n={fired:!1,wrapFn:void 0,target:e,type:t,listener:r},o=l.bind(n);return o.listener=r,n.wrapFn=o,o}function f(e,t,r){var n=e._events;if(void 0===n)return[];var o=n[t];return void 0===o?[]:"function"==typeof o?r?[o.listener||o]:[o]:r?function(e){for(var t=new Array(e.length),r=0;r<t.length;++r)t[r]=e[r].listener||e[r];return t}(o):y(o,o.length)}function h(e){var t=this._events;if(void 0!==t){var r=t[e];if("function"==typeof r)return 1;if(void 0!==r)return r.length}return 0}function y(e,t){for(var r=new Array(t),n=0;n<t;++n)r[n]=e[n];return r}function d(e,t,r,n){if("function"==typeof e.on)n.once?e.once(t,r):e.on(t,r);else{if("function"!=typeof e.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof e);e.addEventListener(t,(function o(i){n.once&&e.removeEventListener(t,o),r(i)}))}}Object.defineProperty(i,"defaultMaxListeners",{enumerable:!0,get:function(){return s},set:function(e){if("number"!=typeof e||e<0||o(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");s=e}}),i.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},i.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||o(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this},i.prototype.getMaxListeners=function(){return u(this)},i.prototype.emit=function(e){for(var t=[],r=1;r<arguments.length;r++)t.push(arguments[r]);var o="error"===e,i=this._events;if(void 0!==i)o=o&&void 0===i.error;else if(!o)return!1;if(o){var s;if(t.length>0&&(s=t[0]),s instanceof Error)throw s;var a=new Error("Unhandled error."+(s?" ("+s.message+")":""));throw a.context=s,a}var u=i[e];if(void 0===u)return!1;if("function"==typeof u)n(u,this,t);else{var c=u.length,l=y(u,c);for(r=0;r<c;++r)n(l[r],this,t)}return!0},i.prototype.addListener=function(e,t){return c(this,e,t,!1)},i.prototype.on=i.prototype.addListener,i.prototype.prependListener=function(e,t){return c(this,e,t,!0)},i.prototype.once=function(e,t){return a(t),this.on(e,p(this,e,t)),this},i.prototype.prependOnceListener=function(e,t){return a(t),this.prependListener(e,p(this,e,t)),this},i.prototype.removeListener=function(e,t){var r,n,o,i,s;if(a(t),void 0===(n=this._events))return this;if(void 0===(r=n[e]))return this;if(r===t||r.listener===t)0==--this._eventsCount?this._events=Object.create(null):(delete n[e],n.removeListener&&this.emit("removeListener",e,r.listener||t));else if("function"!=typeof r){for(o=-1,i=r.length-1;i>=0;i--)if(r[i]===t||r[i].listener===t){s=r[i].listener,o=i;break}if(o<0)return this;0===o?r.shift():function(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}(r,o),1===r.length&&(n[e]=r[0]),void 0!==n.removeListener&&this.emit("removeListener",e,s||t)}return this},i.prototype.off=i.prototype.removeListener,i.prototype.removeAllListeners=function(e){var t,r,n;if(void 0===(r=this._events))return this;if(void 0===r.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==r[e]&&(0==--this._eventsCount?this._events=Object.create(null):delete r[e]),this;if(0===arguments.length){var o,i=Object.keys(r);for(n=0;n<i.length;++n)"removeListener"!==(o=i[n])&&this.removeAllListeners(o);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(t=r[e]))this.removeListener(e,t);else if(void 0!==t)for(n=t.length-1;n>=0;n--)this.removeListener(e,t[n]);return this},i.prototype.listeners=function(e){return f(this,e,!0)},i.prototype.rawListeners=function(e){return f(this,e,!1)},i.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):h.call(e,t)},i.prototype.listenerCount=h,i.prototype.eventNames=function(){return this._eventsCount>0?t(this._events):[]}},648:e=>{"use strict";var t="Function.prototype.bind called on incompatible ",r=Array.prototype.slice,n=Object.prototype.toString,o="[object Function]";e.exports=function(e){var i=this;if("function"!=typeof i||n.call(i)!==o)throw new TypeError(t+i);for(var s,a=r.call(arguments,1),u=function(){if(this instanceof s){var t=i.apply(this,a.concat(r.call(arguments)));return Object(t)===t?t:this}return i.apply(e,a.concat(r.call(arguments)))},c=Math.max(0,i.length-a.length),l=[],p=0;p<c;p++)l.push("$"+p);if(s=Function("binder","return function ("+l.join(",")+"){ return binder.apply(this,arguments); }")(u),i.prototype){var f=function(){};f.prototype=i.prototype,s.prototype=new f,f.prototype=null}return s}},612:(e,t,r)=>{"use strict";var n=r(648);e.exports=Function.prototype.bind||n},210:(e,t,r)=>{"use strict";var n,o=SyntaxError,i=Function,s=TypeError,a=function(e){try{return i('"use strict"; return ('+e+").constructor;")()}catch(e){}},u=Object.getOwnPropertyDescriptor;if(u)try{u({},"")}catch(e){u=null}var c=function(){throw new s},l=u?function(){try{return c}catch(e){try{return u(arguments,"callee").get}catch(e){return c}}}():c,p=r(405)(),f=Object.getPrototypeOf||function(e){return e.__proto__},h={},y="undefined"==typeof Uint8Array?n:f(Uint8Array),d={"%AggregateError%":"undefined"==typeof AggregateError?n:AggregateError,"%Array%":Array,"%ArrayBuffer%":"undefined"==typeof ArrayBuffer?n:ArrayBuffer,"%ArrayIteratorPrototype%":p?f([][Symbol.iterator]()):n,"%AsyncFromSyncIteratorPrototype%":n,"%AsyncFunction%":h,"%AsyncGenerator%":h,"%AsyncGeneratorFunction%":h,"%AsyncIteratorPrototype%":h,"%Atomics%":"undefined"==typeof Atomics?n:Atomics,"%BigInt%":"undefined"==typeof BigInt?n:BigInt,"%Boolean%":Boolean,"%DataView%":"undefined"==typeof DataView?n:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":"undefined"==typeof Float32Array?n:Float32Array,"%Float64Array%":"undefined"==typeof Float64Array?n:Float64Array,"%FinalizationRegistry%":"undefined"==typeof FinalizationRegistry?n:FinalizationRegistry,"%Function%":i,"%GeneratorFunction%":h,"%Int8Array%":"undefined"==typeof Int8Array?n:Int8Array,"%Int16Array%":"undefined"==typeof Int16Array?n:Int16Array,"%Int32Array%":"undefined"==typeof Int32Array?n:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":p?f(f([][Symbol.iterator]())):n,"%JSON%":"object"==typeof JSON?JSON:n,"%Map%":"undefined"==typeof Map?n:Map,"%MapIteratorPrototype%":"undefined"!=typeof Map&&p?f((new Map)[Symbol.iterator]()):n,"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":"undefined"==typeof Promise?n:Promise,"%Proxy%":"undefined"==typeof Proxy?n:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":"undefined"==typeof Reflect?n:Reflect,"%RegExp%":RegExp,"%Set%":"undefined"==typeof Set?n:Set,"%SetIteratorPrototype%":"undefined"!=typeof Set&&p?f((new Set)[Symbol.iterator]()):n,"%SharedArrayBuffer%":"undefined"==typeof SharedArrayBuffer?n:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":p?f(""[Symbol.iterator]()):n,"%Symbol%":p?Symbol:n,"%SyntaxError%":o,"%ThrowTypeError%":l,"%TypedArray%":y,"%TypeError%":s,"%Uint8Array%":"undefined"==typeof Uint8Array?n:Uint8Array,"%Uint8ClampedArray%":"undefined"==typeof Uint8ClampedArray?n:Uint8ClampedArray,"%Uint16Array%":"undefined"==typeof Uint16Array?n:Uint16Array,"%Uint32Array%":"undefined"==typeof Uint32Array?n:Uint32Array,"%URIError%":URIError,"%WeakMap%":"undefined"==typeof WeakMap?n:WeakMap,"%WeakRef%":"undefined"==typeof WeakRef?n:WeakRef,"%WeakSet%":"undefined"==typeof WeakSet?n:WeakSet},v=function e(t){var r;if("%AsyncFunction%"===t)r=a("async function () {}");else if("%GeneratorFunction%"===t)r=a("function* () {}");else if("%AsyncGeneratorFunction%"===t)r=a("async function* () {}");else if("%AsyncGenerator%"===t){var n=e("%AsyncGeneratorFunction%");n&&(r=n.prototype)}else if("%AsyncIteratorPrototype%"===t){var o=e("%AsyncGenerator%");o&&(r=f(o.prototype))}return d[t]=r,r},m={"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},g=r(612),_=r(642),b=g.call(Function.call,Array.prototype.concat),w=g.call(Function.apply,Array.prototype.splice),A=g.call(Function.call,String.prototype.replace),S=g.call(Function.call,String.prototype.slice),E=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,O=/\\(\\)?/g,P=function(e){var t=S(e,0,1),r=S(e,-1);if("%"===t&&"%"!==r)throw new o("invalid intrinsic syntax, expected closing `%`");if("%"===r&&"%"!==t)throw new o("invalid intrinsic syntax, expected opening `%`");var n=[];return A(e,E,(function(e,t,r,o){n[n.length]=r?A(o,O,"$1"):t||e})),n},T=function(e,t){var r,n=e;if(_(m,n)&&(n="%"+(r=m[n])[0]+"%"),_(d,n)){var i=d[n];if(i===h&&(i=v(n)),void 0===i&&!t)throw new s("intrinsic "+e+" exists, but is not available. Please file an issue!");return{alias:r,name:n,value:i}}throw new o("intrinsic "+e+" does not exist!")};e.exports=function(e,t){if("string"!=typeof e||0===e.length)throw new s("intrinsic name must be a non-empty string");if(arguments.length>1&&"boolean"!=typeof t)throw new s('"allowMissing" argument must be a boolean');var r=P(e),n=r.length>0?r[0]:"",i=T("%"+n+"%",t),a=i.name,c=i.value,l=!1,p=i.alias;p&&(n=p[0],w(r,b([0,1],p)));for(var f=1,h=!0;f<r.length;f+=1){var y=r[f],v=S(y,0,1),m=S(y,-1);if(('"'===v||"'"===v||"`"===v||'"'===m||"'"===m||"`"===m)&&v!==m)throw new o("property names with quotes must have matching quotes");if("constructor"!==y&&h||(l=!0),_(d,a="%"+(n+="."+y)+"%"))c=d[a];else if(null!=c){if(!(y in c)){if(!t)throw new s("base intrinsic for "+e+" exists, but the property is not available.");return}if(u&&f+1>=r.length){var g=u(c,y);c=(h=!!g)&&"get"in g&&!("originalValue"in g.get)?g.get:c[y]}else h=_(c,y),c=c[y];h&&!l&&(d[a]=c)}}return c}},405:(e,t,r)=>{"use strict";var n="undefined"!=typeof Symbol&&Symbol,o=r(419);e.exports=function(){return"function"==typeof n&&"function"==typeof Symbol&&"symbol"==typeof n("foo")&&"symbol"==typeof Symbol("bar")&&o()}},419:e=>{"use strict";e.exports=function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var e={},t=Symbol("test"),r=Object(t);if("string"==typeof t)return!1;if("[object Symbol]"!==Object.prototype.toString.call(t))return!1;if("[object Symbol]"!==Object.prototype.toString.call(r))return!1;for(t in e[t]=42,e)return!1;if("function"==typeof Object.keys&&0!==Object.keys(e).length)return!1;if("function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(e).length)return!1;var n=Object.getOwnPropertySymbols(e);if(1!==n.length||n[0]!==t)return!1;if(!Object.prototype.propertyIsEnumerable.call(e,t))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var o=Object.getOwnPropertyDescriptor(e,t);if(42!==o.value||!0!==o.enumerable)return!1}return!0}},642:(e,t,r)=>{"use strict";var n=r(612);e.exports=n.call(Function.call,Object.prototype.hasOwnProperty)},301:(e,t,r)=>{r(147),e.exports=self.fetch.bind(self)},588:(e,t,r)=>{r(301);const{default:n}=r(860),o=r(693);function i(e,t=[],r="info",o={}){if(!e)throw new TypeError("Invalid URL");this.url=e,this.tags=t,this.level=r,this.maxRetries=o.maxRetries||5,this.concurrency=o.concurrency||25,this.maxMessagesPerSecond=o.maxMessagesPerSecond||10,this.muteConsole=!0===o.muteConsole||!1,this.queue=new n({concurrency:this.concurrency,intervalCap:this.maxMessagesPerSecond,interval:1e3})}i.prototype._sendEvent=function(e){return fetch(this.url,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})},i.prototype.log=function(e,t,r){const n={level:e,fields:r,message:t};if(n["@timestamp"]=(new Date).toISOString(),n["@tags"]=this.tags,"undefined"!=typeof navigator&&(n.navigator={cookieEnabled:navigator.cookieEnabled,geoLocation:navigator.geolocation,language:navigator.language,languages:navigator.languages,online:navigator.onLine,userAgent:navigator.userAgent,platform:navigator.platform,vendor:navigator.vendor}),"undefined"!=typeof location&&(n.location={search:location.search,pathname:location.pathname,hostname:location.hostname,protocol:location.protocol,port:location.port,hash:location.hash,href:location.href}),this.queue.add((()=>o((()=>this._sendEvent(n)),{retries:this.maxRetries}).catch((e=>{console.warn(`Could not send message to Logstash - [${e.message}]`)})))),this.muteConsole)return;const i=r?` - ${JSON.stringify(r)}`:"";switch(e){case"error":console.error(`${t}${i}`);break;case"warn":console.warn(`${t}${i}`);break;default:console.info(`${t}${i}`)}},i.prototype.debug=function(e,t){this.log("debug",e,t)},i.prototype.info=function(e,t){this.log("info",e,t)},i.prototype.warn=function(e,t){this.log("warn",e,t)},i.prototype.error=function(e,t){e instanceof Error?this.log("error",e.message,Object.assign({stack:e.stack},t)):this.log("error",e,t)},e.exports=function(e,t,r,n){return new i(e,t,r,n)}},631:(e,t,r)=>{var n="function"==typeof Map&&Map.prototype,o=Object.getOwnPropertyDescriptor&&n?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,i=n&&o&&"function"==typeof o.get?o.get:null,s=n&&Map.prototype.forEach,a="function"==typeof Set&&Set.prototype,u=Object.getOwnPropertyDescriptor&&a?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,c=a&&u&&"function"==typeof u.get?u.get:null,l=a&&Set.prototype.forEach,p="function"==typeof WeakMap&&WeakMap.prototype?WeakMap.prototype.has:null,f="function"==typeof WeakSet&&WeakSet.prototype?WeakSet.prototype.has:null,h="function"==typeof WeakRef&&WeakRef.prototype?WeakRef.prototype.deref:null,y=Boolean.prototype.valueOf,d=Object.prototype.toString,v=Function.prototype.toString,m=String.prototype.match,g=String.prototype.slice,_=String.prototype.replace,b=String.prototype.toUpperCase,w=String.prototype.toLowerCase,A=RegExp.prototype.test,S=Array.prototype.concat,E=Array.prototype.join,O=Array.prototype.slice,P=Math.floor,T="function"==typeof BigInt?BigInt.prototype.valueOf:null,x=Object.getOwnPropertySymbols,R="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?Symbol.prototype.toString:null,I="function"==typeof Symbol&&"object"==typeof Symbol.iterator,j="function"==typeof Symbol&&Symbol.toStringTag&&(Symbol.toStringTag,1)?Symbol.toStringTag:null,k=Object.prototype.propertyIsEnumerable,C=("function"==typeof Reflect?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(e){return e.__proto__}:null);function N(e,t){if(e===1/0||e===-1/0||e!=e||e&&e>-1e3&&e<1e3||A.call(/e/,t))return t;var r=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if("number"==typeof e){var n=e<0?-P(-e):P(e);if(n!==e){var o=String(n),i=g.call(t,o.length+1);return _.call(o,r,"$&_")+"."+_.call(_.call(i,/([0-9]{3})/g,"$&_"),/_$/,"")}}return _.call(t,r,"$&_")}var L=r(654).custom,U=L&&F(L)?L:null;function q(e,t,r){var n="double"===(r.quoteStyle||t)?'"':"'";return n+e+n}function M(e){return _.call(String(e),/"/g,""")}function B(e){return!("[object Array]"!==H(e)||j&&"object"==typeof e&&j in e)}function F(e){if(I)return e&&"object"==typeof e&&e instanceof Symbol;if("symbol"==typeof e)return!0;if(!e||"object"!=typeof e||!R)return!1;try{return R.call(e),!0}catch(e){}return!1}e.exports=function e(t,r,n,o){var a=r||{};if(D(a,"quoteStyle")&&"single"!==a.quoteStyle&&"double"!==a.quoteStyle)throw new TypeError('option "quoteStyle" must be "single" or "double"');if(D(a,"maxStringLength")&&("number"==typeof a.maxStringLength?a.maxStringLength<0&&a.maxStringLength!==1/0:null!==a.maxStringLength))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var u=!D(a,"customInspect")||a.customInspect;if("boolean"!=typeof u&&"symbol"!==u)throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(D(a,"indent")&&null!==a.indent&&"\t"!==a.indent&&!(parseInt(a.indent,10)===a.indent&&a.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(D(a,"numericSeparator")&&"boolean"!=typeof a.numericSeparator)throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var d=a.numericSeparator;if(void 0===t)return"undefined";if(null===t)return"null";if("boolean"==typeof t)return t?"true":"false";if("string"==typeof t)return G(t,a);if("number"==typeof t){if(0===t)return 1/0/t>0?"0":"-0";var b=String(t);return d?N(t,b):b}if("bigint"==typeof t){var A=String(t)+"n";return d?N(t,A):A}var P=void 0===a.depth?5:a.depth;if(void 0===n&&(n=0),n>=P&&P>0&&"object"==typeof t)return B(t)?"[Array]":"[Object]";var x,L=function(e,t){var r;if("\t"===e.indent)r="\t";else{if(!("number"==typeof e.indent&&e.indent>0))return null;r=E.call(Array(e.indent+1)," ")}return{base:r,prev:E.call(Array(t+1),r)}}(a,n);if(void 0===o)o=[];else if($(o,t)>=0)return"[Circular]";function z(t,r,i){if(r&&(o=O.call(o)).push(r),i){var s={depth:a.depth};return D(a,"quoteStyle")&&(s.quoteStyle=a.quoteStyle),e(t,s,n+1,o)}return e(t,a,n+1,o)}if("function"==typeof t){var J=function(e){if(e.name)return e.name;var t=m.call(v.call(e),/^function\s*([\w$]+)/);return t?t[1]:null}(t),Z=Y(t,z);return"[Function"+(J?": "+J:" (anonymous)")+"]"+(Z.length>0?" { "+E.call(Z,", ")+" }":"")}if(F(t)){var X=I?_.call(String(t),/^(Symbol\(.*\))_[^)]*$/,"$1"):R.call(t);return"object"!=typeof t||I?X:W(X)}if((x=t)&&"object"==typeof x&&("undefined"!=typeof HTMLElement&&x instanceof HTMLElement||"string"==typeof x.nodeName&&"function"==typeof x.getAttribute)){for(var ee="<"+w.call(String(t.nodeName)),te=t.attributes||[],re=0;re<te.length;re++)ee+=" "+te[re].name+"="+q(M(te[re].value),"double",a);return ee+=">",t.childNodes&&t.childNodes.length&&(ee+="..."),ee+"</"+w.call(String(t.nodeName))+">"}if(B(t)){if(0===t.length)return"[]";var ne=Y(t,z);return L&&!function(e){for(var t=0;t<e.length;t++)if($(e[t],"\n")>=0)return!1;return!0}(ne)?"["+K(ne,L)+"]":"[ "+E.call(ne,", ")+" ]"}if(function(e){return!("[object Error]"!==H(e)||j&&"object"==typeof e&&j in e)}(t)){var oe=Y(t,z);return"cause"in t&&!k.call(t,"cause")?"{ ["+String(t)+"] "+E.call(S.call("[cause]: "+z(t.cause),oe),", ")+" }":0===oe.length?"["+String(t)+"]":"{ ["+String(t)+"] "+E.call(oe,", ")+" }"}if("object"==typeof t&&u){if(U&&"function"==typeof t[U])return t[U]();if("symbol"!==u&&"function"==typeof t.inspect)return t.inspect()}if(function(e){if(!i||!e||"object"!=typeof e)return!1;try{i.call(e);try{c.call(e)}catch(e){return!0}return e instanceof Map}catch(e){}return!1}(t)){var ie=[];return s.call(t,(function(e,r){ie.push(z(r,t,!0)+" => "+z(e,t))})),Q("Map",i.call(t),ie,L)}if(function(e){if(!c||!e||"object"!=typeof e)return!1;try{c.call(e);try{i.call(e)}catch(e){return!0}return e instanceof Set}catch(e){}return!1}(t)){var se=[];return l.call(t,(function(e){se.push(z(e,t))})),Q("Set",c.call(t),se,L)}if(function(e){if(!p||!e||"object"!=typeof e)return!1;try{p.call(e,p);try{f.call(e,f)}catch(e){return!0}return e instanceof WeakMap}catch(e){}return!1}(t))return V("WeakMap");if(function(e){if(!f||!e||"object"!=typeof e)return!1;try{f.call(e,f);try{p.call(e,p)}catch(e){return!0}return e instanceof WeakSet}catch(e){}return!1}(t))return V("WeakSet");if(function(e){if(!h||!e||"object"!=typeof e)return!1;try{return h.call(e),!0}catch(e){}return!1}(t))return V("WeakRef");if(function(e){return!("[object Number]"!==H(e)||j&&"object"==typeof e&&j in e)}(t))return W(z(Number(t)));if(function(e){if(!e||"object"!=typeof e||!T)return!1;try{return T.call(e),!0}catch(e){}return!1}(t))return W(z(T.call(t)));if(function(e){return!("[object Boolean]"!==H(e)||j&&"object"==typeof e&&j in e)}(t))return W(y.call(t));if(function(e){return!("[object String]"!==H(e)||j&&"object"==typeof e&&j in e)}(t))return W(z(String(t)));if(!function(e){return!("[object Date]"!==H(e)||j&&"object"==typeof e&&j in e)}(t)&&!function(e){return!("[object RegExp]"!==H(e)||j&&"object"==typeof e&&j in e)}(t)){var ae=Y(t,z),ue=C?C(t)===Object.prototype:t instanceof Object||t.constructor===Object,ce=t instanceof Object?"":"null prototype",le=!ue&&j&&Object(t)===t&&j in t?g.call(H(t),8,-1):ce?"Object":"",pe=(ue||"function"!=typeof t.constructor?"":t.constructor.name?t.constructor.name+" ":"")+(le||ce?"["+E.call(S.call([],le||[],ce||[]),": ")+"] ":"");return 0===ae.length?pe+"{}":L?pe+"{"+K(ae,L)+"}":pe+"{ "+E.call(ae,", ")+" }"}return String(t)};var z=Object.prototype.hasOwnProperty||function(e){return e in this};function D(e,t){return z.call(e,t)}function H(e){return d.call(e)}function $(e,t){if(e.indexOf)return e.indexOf(t);for(var r=0,n=e.length;r<n;r++)if(e[r]===t)return r;return-1}function G(e,t){if(e.length>t.maxStringLength){var r=e.length-t.maxStringLength,n="... "+r+" more character"+(r>1?"s":"");return G(g.call(e,0,t.maxStringLength),t)+n}return q(_.call(_.call(e,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,J),"single",t)}function J(e){var t=e.charCodeAt(0),r={8:"b",9:"t",10:"n",12:"f",13:"r"}[t];return r?"\\"+r:"\\x"+(t<16?"0":"")+b.call(t.toString(16))}function W(e){return"Object("+e+")"}function V(e){return e+" { ? }"}function Q(e,t,r,n){return e+" ("+t+") {"+(n?K(r,n):E.call(r,", "))+"}"}function K(e,t){if(0===e.length)return"";var r="\n"+t.prev+t.base;return r+E.call(e,","+r)+"\n"+t.prev}function Y(e,t){var r=B(e),n=[];if(r){n.length=e.length;for(var o=0;o<e.length;o++)n[o]=D(e,o)?t(e[o],e):""}var i,s="function"==typeof x?x(e):[];if(I){i={};for(var a=0;a<s.length;a++)i["$"+s[a]]=s[a]}for(var u in e)D(e,u)&&(r&&String(Number(u))===u&&u<e.length||I&&i["$"+u]instanceof Symbol||(A.call(/[^\w$]/,u)?n.push(t(u,e)+": "+t(e[u],e)):n.push(u+": "+t(e[u],e))));if("function"==typeof x)for(var c=0;c<s.length;c++)k.call(e,s[c])&&n.push("["+t(s[c])+"]: "+t(e[s[c]],e));return n}},345:e=>{"use strict";e.exports=(e,t)=>(t=t||(()=>{}),e.then((e=>new Promise((e=>{e(t())})).then((()=>e))),(e=>new Promise((e=>{e(t())})).then((()=>{throw e})))))},860:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(729),o=r(40),i=r(506),s=()=>{},a=new o.TimeoutError;t.default=class extends n{constructor(e){var t,r,n,o;if(super(),this._intervalCount=0,this._intervalEnd=0,this._pendingCount=0,this._resolveEmpty=s,this._resolveIdle=s,!("number"==typeof(e=Object.assign({carryoverConcurrencyCount:!1,intervalCap:1/0,interval:0,concurrency:1/0,autoStart:!0,queueClass:i.default},e)).intervalCap&&e.intervalCap>=1))throw new TypeError(`Expected \`intervalCap\` to be a number from 1 and up, got \`${null!==(r=null===(t=e.intervalCap)||void 0===t?void 0:t.toString())&&void 0!==r?r:""}\` (${typeof e.intervalCap})`);if(void 0===e.interval||!(Number.isFinite(e.interval)&&e.interval>=0))throw new TypeError(`Expected \`interval\` to be a finite number >= 0, got \`${null!==(o=null===(n=e.interval)||void 0===n?void 0:n.toString())&&void 0!==o?o:""}\` (${typeof e.interval})`);this._carryoverConcurrencyCount=e.carryoverConcurrencyCount,this._isIntervalIgnored=e.intervalCap===1/0||0===e.interval,this._intervalCap=e.intervalCap,this._interval=e.interval,this._queue=new e.queueClass,this._queueClass=e.queueClass,this.concurrency=e.concurrency,this._timeout=e.timeout,this._throwOnTimeout=!0===e.throwOnTimeout,this._isPaused=!1===e.autoStart}get _doesIntervalAllowAnother(){return this._isIntervalIgnored||this._intervalCount<this._intervalCap}get _doesConcurrentAllowAnother(){return this._pendingCount<this._concurrency}_next(){this._pendingCount--,this._tryToStartAnother(),this.emit("next")}_resolvePromises(){this._resolveEmpty(),this._resolveEmpty=s,0===this._pendingCount&&(this._resolveIdle(),this._resolveIdle=s,this.emit("idle"))}_onResumeInterval(){this._onInterval(),this._initializeIntervalIfNeeded(),this._timeoutId=void 0}_isIntervalPaused(){const e=Date.now();if(void 0===this._intervalId){const t=this._intervalEnd-e;if(!(t<0))return void 0===this._timeoutId&&(this._timeoutId=setTimeout((()=>{this._onResumeInterval()}),t)),!0;this._intervalCount=this._carryoverConcurrencyCount?this._pendingCount:0}return!1}_tryToStartAnother(){if(0===this._queue.size)return this._intervalId&&clearInterval(this._intervalId),this._intervalId=void 0,this._resolvePromises(),!1;if(!this._isPaused){const e=!this._isIntervalPaused();if(this._doesIntervalAllowAnother&&this._doesConcurrentAllowAnother){const t=this._queue.dequeue();return!!t&&(this.emit("active"),t(),e&&this._initializeIntervalIfNeeded(),!0)}}return!1}_initializeIntervalIfNeeded(){this._isIntervalIgnored||void 0!==this._intervalId||(this._intervalId=setInterval((()=>{this._onInterval()}),this._interval),this._intervalEnd=Date.now()+this._interval)}_onInterval(){0===this._intervalCount&&0===this._pendingCount&&this._intervalId&&(clearInterval(this._intervalId),this._intervalId=void 0),this._intervalCount=this._carryoverConcurrencyCount?this._pendingCount:0,this._processQueue()}_processQueue(){for(;this._tryToStartAnother(););}get concurrency(){return this._concurrency}set concurrency(e){if(!("number"==typeof e&&e>=1))throw new TypeError(`Expected \`concurrency\` to be a number from 1 and up, got \`${e}\` (${typeof e})`);this._concurrency=e,this._processQueue()}async add(e,t={}){return new Promise(((r,n)=>{this._queue.enqueue((async()=>{this._pendingCount++,this._intervalCount++;try{const i=void 0===this._timeout&&void 0===t.timeout?e():o.default(Promise.resolve(e()),void 0===t.timeout?this._timeout:t.timeout,(()=>{(void 0===t.throwOnTimeout?this._throwOnTimeout:t.throwOnTimeout)&&n(a)}));r(await i)}catch(e){n(e)}this._next()}),t),this._tryToStartAnother(),this.emit("add")}))}async addAll(e,t){return Promise.all(e.map((async e=>this.add(e,t))))}start(){return this._isPaused?(this._isPaused=!1,this._processQueue(),this):this}pause(){this._isPaused=!0}clear(){this._queue=new this._queueClass}async onEmpty(){if(0!==this._queue.size)return new Promise((e=>{const t=this._resolveEmpty;this._resolveEmpty=()=>{t(),e()}}))}async onIdle(){if(0!==this._pendingCount||0!==this._queue.size)return new Promise((e=>{const t=this._resolveIdle;this._resolveIdle=()=>{t(),e()}}))}get size(){return this._queue.size}sizeBy(e){return this._queue.filter(e).length}get pending(){return this._pendingCount}get isPaused(){return this._isPaused}get timeout(){return this._timeout}set timeout(e){this._timeout=e}}},489:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t,r){let n=0,o=e.length;for(;o>0;){const i=o/2|0;let s=n+i;r(e[s],t)<=0?(n=++s,o-=i+1):o=i}return n}},506:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(489);t.default=class{constructor(){this._queue=[]}enqueue(e,t){const r={priority:(t=Object.assign({priority:0},t)).priority,run:e};if(this.size&&this._queue[this.size-1].priority>=t.priority)return void this._queue.push(r);const o=n.default(this._queue,r,((e,t)=>t.priority-e.priority));this._queue.splice(o,0,r)}dequeue(){const e=this._queue.shift();return null==e?void 0:e.run}filter(e){return this._queue.filter((t=>t.priority===e.priority)).map((e=>e.run))}get size(){return this._queue.length}}},693:(e,t,r)=>{"use strict";const n=r(353),o=["Failed to fetch","NetworkError when attempting to fetch resource.","The Internet connection appears to be offline.","Network request failed"];class i extends Error{constructor(e){super(),e instanceof Error?(this.originalError=e,({message:e}=e)):(this.originalError=new Error(e),this.originalError.stack=this.stack),this.name="AbortError",this.message=e}}const s=(e,t)=>new Promise(((r,s)=>{t={onFailedAttempt:()=>{},retries:10,...t};const a=n.operation(t);a.attempt((async n=>{try{r(await e(n))}catch(e){if(!(e instanceof Error))return void s(new TypeError(`Non-error was thrown: "${e}". You should only throw errors.`));if(e instanceof i)a.stop(),s(e.originalError);else if(e instanceof TypeError&&(u=e.message,!o.includes(u)))a.stop(),s(e);else{((e,t,r)=>{const n=r.retries-(t-1);e.attemptNumber=t,e.retriesLeft=n})(e,n,t);try{await t.onFailedAttempt(e)}catch(e){return void s(e)}a.retry(e)||s(a.mainError())}}var u}))}));e.exports=s,e.exports.default=s,e.exports.AbortError=i},40:(e,t,r)=>{"use strict";const n=r(345);class o extends Error{constructor(e){super(e),this.name="TimeoutError"}}const i=(e,t,r)=>new Promise(((i,s)=>{if("number"!=typeof t||t<0)throw new TypeError("Expected `milliseconds` to be a positive number");if(t===1/0)return void i(e);const a=setTimeout((()=>{if("function"==typeof r){try{i(r())}catch(e){s(e)}return}const n=r instanceof Error?r:new o("string"==typeof r?r:`Promise timed out after ${t} milliseconds`);"function"==typeof e.cancel&&e.cancel(),s(n)}),t);n(e.then(i,s),(()=>{clearTimeout(a)}))}));e.exports=i,e.exports.default=i,e.exports.TimeoutError=o},798:e=>{"use strict";var t=String.prototype.replace,r=/%20/g,n="RFC3986";e.exports={default:n,formatters:{RFC1738:function(e){return t.call(e,r,"+")},RFC3986:function(e){return String(e)}},RFC1738:"RFC1738",RFC3986:n}},129:(e,t,r)=>{"use strict";var n=r(261),o=r(235),i=r(798);e.exports={formats:i,parse:o,stringify:n}},235:(e,t,r)=>{"use strict";var n=r(769),o=Object.prototype.hasOwnProperty,i=Array.isArray,s={allowDots:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decoder:n.decode,delimiter:"&",depth:5,ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictNullHandling:!1},a=function(e){return e.replace(/&#(\d+);/g,(function(e,t){return String.fromCharCode(parseInt(t,10))}))},u=function(e,t){return e&&"string"==typeof e&&t.comma&&e.indexOf(",")>-1?e.split(","):e},c=function(e,t,r,n){if(e){var i=r.allowDots?e.replace(/\.([^.[]+)/g,"[$1]"):e,s=/(\[[^[\]]*])/g,a=r.depth>0&&/(\[[^[\]]*])/.exec(i),c=a?i.slice(0,a.index):i,l=[];if(c){if(!r.plainObjects&&o.call(Object.prototype,c)&&!r.allowPrototypes)return;l.push(c)}for(var p=0;r.depth>0&&null!==(a=s.exec(i))&&p<r.depth;){if(p+=1,!r.plainObjects&&o.call(Object.prototype,a[1].slice(1,-1))&&!r.allowPrototypes)return;l.push(a[1])}return a&&l.push("["+i.slice(a.index)+"]"),function(e,t,r,n){for(var o=n?t:u(t,r),i=e.length-1;i>=0;--i){var s,a=e[i];if("[]"===a&&r.parseArrays)s=[].concat(o);else{s=r.plainObjects?Object.create(null):{};var c="["===a.charAt(0)&&"]"===a.charAt(a.length-1)?a.slice(1,-1):a,l=parseInt(c,10);r.parseArrays||""!==c?!isNaN(l)&&a!==c&&String(l)===c&&l>=0&&r.parseArrays&&l<=r.arrayLimit?(s=[])[l]=o:"__proto__"!==c&&(s[c]=o):s={0:o}}o=s}return o}(l,t,r,n)}};e.exports=function(e,t){var r=function(e){if(!e)return s;if(null!==e.decoder&&void 0!==e.decoder&&"function"!=typeof e.decoder)throw new TypeError("Decoder has to be a function.");if(void 0!==e.charset&&"utf-8"!==e.charset&&"iso-8859-1"!==e.charset)throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var t=void 0===e.charset?s.charset:e.charset;return{allowDots:void 0===e.allowDots?s.allowDots:!!e.allowDots,allowPrototypes:"boolean"==typeof e.allowPrototypes?e.allowPrototypes:s.allowPrototypes,allowSparse:"boolean"==typeof e.allowSparse?e.allowSparse:s.allowSparse,arrayLimit:"number"==typeof e.arrayLimit?e.arrayLimit:s.arrayLimit,charset:t,charsetSentinel:"boolean"==typeof e.charsetSentinel?e.charsetSentinel:s.charsetSentinel,comma:"boolean"==typeof e.comma?e.comma:s.comma,decoder:"function"==typeof e.decoder?e.decoder:s.decoder,delimiter:"string"==typeof e.delimiter||n.isRegExp(e.delimiter)?e.delimiter:s.delimiter,depth:"number"==typeof e.depth||!1===e.depth?+e.depth:s.depth,ignoreQueryPrefix:!0===e.ignoreQueryPrefix,interpretNumericEntities:"boolean"==typeof e.interpretNumericEntities?e.interpretNumericEntities:s.interpretNumericEntities,parameterLimit:"number"==typeof e.parameterLimit?e.parameterLimit:s.parameterLimit,parseArrays:!1!==e.parseArrays,plainObjects:"boolean"==typeof e.plainObjects?e.plainObjects:s.plainObjects,strictNullHandling:"boolean"==typeof e.strictNullHandling?e.strictNullHandling:s.strictNullHandling}}(t);if(""===e||null==e)return r.plainObjects?Object.create(null):{};for(var l="string"==typeof e?function(e,t){var r,c={},l=t.ignoreQueryPrefix?e.replace(/^\?/,""):e,p=t.parameterLimit===1/0?void 0:t.parameterLimit,f=l.split(t.delimiter,p),h=-1,y=t.charset;if(t.charsetSentinel)for(r=0;r<f.length;++r)0===f[r].indexOf("utf8=")&&("utf8=%E2%9C%93"===f[r]?y="utf-8":"utf8=%26%2310003%3B"===f[r]&&(y="iso-8859-1"),h=r,r=f.length);for(r=0;r<f.length;++r)if(r!==h){var d,v,m=f[r],g=m.indexOf("]="),_=-1===g?m.indexOf("="):g+1;-1===_?(d=t.decoder(m,s.decoder,y,"key"),v=t.strictNullHandling?null:""):(d=t.decoder(m.slice(0,_),s.decoder,y,"key"),v=n.maybeMap(u(m.slice(_+1),t),(function(e){return t.decoder(e,s.decoder,y,"value")}))),v&&t.interpretNumericEntities&&"iso-8859-1"===y&&(v=a(v)),m.indexOf("[]=")>-1&&(v=i(v)?[v]:v),o.call(c,d)?c[d]=n.combine(c[d],v):c[d]=v}return c}(e,r):e,p=r.plainObjects?Object.create(null):{},f=Object.keys(l),h=0;h<f.length;++h){var y=f[h],d=c(y,l[y],r,"string"==typeof e);p=n.merge(p,d,r)}return!0===r.allowSparse?p:n.compact(p)}},261:(e,t,r)=>{"use strict";var n=r(478),o=r(769),i=r(798),s=Object.prototype.hasOwnProperty,a={brackets:function(e){return e+"[]"},comma:"comma",indices:function(e,t){return e+"["+t+"]"},repeat:function(e){return e}},u=Array.isArray,c=String.prototype.split,l=Array.prototype.push,p=function(e,t){l.apply(e,u(t)?t:[t])},f=Date.prototype.toISOString,h=i.default,y={addQueryPrefix:!1,allowDots:!1,charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encoder:o.encode,encodeValuesOnly:!1,format:h,formatter:i.formatters[h],indices:!1,serializeDate:function(e){return f.call(e)},skipNulls:!1,strictNullHandling:!1},d={},v=function e(t,r,i,s,a,l,f,h,v,m,g,_,b,w,A){for(var S,E=t,O=A,P=0,T=!1;void 0!==(O=O.get(d))&&!T;){var x=O.get(t);if(P+=1,void 0!==x){if(x===P)throw new RangeError("Cyclic object value");T=!0}void 0===O.get(d)&&(P=0)}if("function"==typeof f?E=f(r,E):E instanceof Date?E=m(E):"comma"===i&&u(E)&&(E=o.maybeMap(E,(function(e){return e instanceof Date?m(e):e}))),null===E){if(s)return l&&!b?l(r,y.encoder,w,"key",g):r;E=""}if("string"==typeof(S=E)||"number"==typeof S||"boolean"==typeof S||"symbol"==typeof S||"bigint"==typeof S||o.isBuffer(E)){if(l){var R=b?r:l(r,y.encoder,w,"key",g);if("comma"===i&&b){for(var I=c.call(String(E),","),j="",k=0;k<I.length;++k)j+=(0===k?"":",")+_(l(I[k],y.encoder,w,"value",g));return[_(R)+"="+j]}return[_(R)+"="+_(l(E,y.encoder,w,"value",g))]}return[_(r)+"="+_(String(E))]}var C,N=[];if(void 0===E)return N;if("comma"===i&&u(E))C=[{value:E.length>0?E.join(",")||null:void 0}];else if(u(f))C=f;else{var L=Object.keys(E);C=h?L.sort(h):L}for(var U=0;U<C.length;++U){var q=C[U],M="object"==typeof q&&void 0!==q.value?q.value:E[q];if(!a||null!==M){var B=u(E)?"function"==typeof i?i(r,q):r:r+(v?"."+q:"["+q+"]");A.set(t,P);var F=n();F.set(d,A),p(N,e(M,B,i,s,a,l,f,h,v,m,g,_,b,w,F))}}return N};e.exports=function(e,t){var r,o=e,c=function(e){if(!e)return y;if(null!==e.encoder&&void 0!==e.encoder&&"function"!=typeof e.encoder)throw new TypeError("Encoder has to be a function.");var t=e.charset||y.charset;if(void 0!==e.charset&&"utf-8"!==e.charset&&"iso-8859-1"!==e.charset)throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var r=i.default;if(void 0!==e.format){if(!s.call(i.formatters,e.format))throw new TypeError("Unknown format option provided.");r=e.format}var n=i.formatters[r],o=y.filter;return("function"==typeof e.filter||u(e.filter))&&(o=e.filter),{addQueryPrefix:"boolean"==typeof e.addQueryPrefix?e.addQueryPrefix:y.addQueryPrefix,allowDots:void 0===e.allowDots?y.allowDots:!!e.allowDots,charset:t,charsetSentinel:"boolean"==typeof e.charsetSentinel?e.charsetSentinel:y.charsetSentinel,delimiter:void 0===e.delimiter?y.delimiter:e.delimiter,encode:"boolean"==typeof e.encode?e.encode:y.encode,encoder:"function"==typeof e.encoder?e.encoder:y.encoder,encodeValuesOnly:"boolean"==typeof e.encodeValuesOnly?e.encodeValuesOnly:y.encodeValuesOnly,filter:o,format:r,formatter:n,serializeDate:"function"==typeof e.serializeDate?e.serializeDate:y.serializeDate,skipNulls:"boolean"==typeof e.skipNulls?e.skipNulls:y.skipNulls,sort:"function"==typeof e.sort?e.sort:null,strictNullHandling:"boolean"==typeof e.strictNullHandling?e.strictNullHandling:y.strictNullHandling}}(t);"function"==typeof c.filter?o=(0,c.filter)("",o):u(c.filter)&&(r=c.filter);var l,f=[];if("object"!=typeof o||null===o)return"";l=t&&t.arrayFormat in a?t.arrayFormat:t&&"indices"in t?t.indices?"indices":"repeat":"indices";var h=a[l];r||(r=Object.keys(o)),c.sort&&r.sort(c.sort);for(var d=n(),m=0;m<r.length;++m){var g=r[m];c.skipNulls&&null===o[g]||p(f,v(o[g],g,h,c.strictNullHandling,c.skipNulls,c.encode?c.encoder:null,c.filter,c.sort,c.allowDots,c.serializeDate,c.format,c.formatter,c.encodeValuesOnly,c.charset,d))}var _=f.join(c.delimiter),b=!0===c.addQueryPrefix?"?":"";return c.charsetSentinel&&("iso-8859-1"===c.charset?b+="utf8=%26%2310003%3B&":b+="utf8=%E2%9C%93&"),_.length>0?b+_:""}},769:(e,t,r)=>{"use strict";var n=r(798),o=Object.prototype.hasOwnProperty,i=Array.isArray,s=function(){for(var e=[],t=0;t<256;++t)e.push("%"+((t<16?"0":"")+t.toString(16)).toUpperCase());return e}(),a=function(e,t){for(var r=t&&t.plainObjects?Object.create(null):{},n=0;n<e.length;++n)void 0!==e[n]&&(r[n]=e[n]);return r};e.exports={arrayToObject:a,assign:function(e,t){return Object.keys(t).reduce((function(e,r){return e[r]=t[r],e}),e)},combine:function(e,t){return[].concat(e,t)},compact:function(e){for(var t=[{obj:{o:e},prop:"o"}],r=[],n=0;n<t.length;++n)for(var o=t[n],s=o.obj[o.prop],a=Object.keys(s),u=0;u<a.length;++u){var c=a[u],l=s[c];"object"==typeof l&&null!==l&&-1===r.indexOf(l)&&(t.push({obj:s,prop:c}),r.push(l))}return function(e){for(;e.length>1;){var t=e.pop(),r=t.obj[t.prop];if(i(r)){for(var n=[],o=0;o<r.length;++o)void 0!==r[o]&&n.push(r[o]);t.obj[t.prop]=n}}}(t),e},decode:function(e,t,r){var n=e.replace(/\+/g," ");if("iso-8859-1"===r)return n.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(n)}catch(e){return n}},encode:function(e,t,r,o,i){if(0===e.length)return e;var a=e;if("symbol"==typeof e?a=Symbol.prototype.toString.call(e):"string"!=typeof e&&(a=String(e)),"iso-8859-1"===r)return escape(a).replace(/%u[0-9a-f]{4}/gi,(function(e){return"%26%23"+parseInt(e.slice(2),16)+"%3B"}));for(var u="",c=0;c<a.length;++c){var l=a.charCodeAt(c);45===l||46===l||95===l||126===l||l>=48&&l<=57||l>=65&&l<=90||l>=97&&l<=122||i===n.RFC1738&&(40===l||41===l)?u+=a.charAt(c):l<128?u+=s[l]:l<2048?u+=s[192|l>>6]+s[128|63&l]:l<55296||l>=57344?u+=s[224|l>>12]+s[128|l>>6&63]+s[128|63&l]:(c+=1,l=65536+((1023&l)<<10|1023&a.charCodeAt(c)),u+=s[240|l>>18]+s[128|l>>12&63]+s[128|l>>6&63]+s[128|63&l])}return u},isBuffer:function(e){return!(!e||"object"!=typeof e||!(e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer(e)))},isRegExp:function(e){return"[object RegExp]"===Object.prototype.toString.call(e)},maybeMap:function(e,t){if(i(e)){for(var r=[],n=0;n<e.length;n+=1)r.push(t(e[n]));return r}return t(e)},merge:function e(t,r,n){if(!r)return t;if("object"!=typeof r){if(i(t))t.push(r);else{if(!t||"object"!=typeof t)return[t,r];(n&&(n.plainObjects||n.allowPrototypes)||!o.call(Object.prototype,r))&&(t[r]=!0)}return t}if(!t||"object"!=typeof t)return[t].concat(r);var s=t;return i(t)&&!i(r)&&(s=a(t,n)),i(t)&&i(r)?(r.forEach((function(r,i){if(o.call(t,i)){var s=t[i];s&&"object"==typeof s&&r&&"object"==typeof r?t[i]=e(s,r,n):t.push(r)}else t[i]=r})),t):Object.keys(r).reduce((function(t,i){var s=r[i];return o.call(t,i)?t[i]=e(t[i],s,n):t[i]=s,t}),s)}}},353:(e,t,r)=>{e.exports=r(846)},846:(e,t,r)=>{var n=r(960);t.operation=function(e){var r=t.timeouts(e);return new n(r,{forever:e&&(e.forever||e.retries===1/0),unref:e&&e.unref,maxRetryTime:e&&e.maxRetryTime})},t.timeouts=function(e){if(e instanceof Array)return[].concat(e);var t={retries:10,factor:2,minTimeout:1e3,maxTimeout:1/0,randomize:!1};for(var r in e)t[r]=e[r];if(t.minTimeout>t.maxTimeout)throw new Error("minTimeout is greater than maxTimeout");for(var n=[],o=0;o<t.retries;o++)n.push(this.createTimeout(o,t));return e&&e.forever&&!n.length&&n.push(this.createTimeout(o,t)),n.sort((function(e,t){return e-t})),n},t.createTimeout=function(e,t){var r=t.randomize?Math.random()+1:1,n=Math.round(r*Math.max(t.minTimeout,1)*Math.pow(t.factor,e));return Math.min(n,t.maxTimeout)},t.wrap=function(e,r,n){if(r instanceof Array&&(n=r,r=null),!n)for(var o in n=[],e)"function"==typeof e[o]&&n.push(o);for(var i=0;i<n.length;i++){var s=n[i],a=e[s];e[s]=function(n){var o=t.operation(r),i=Array.prototype.slice.call(arguments,1),s=i.pop();i.push((function(e){o.retry(e)||(e&&(arguments[0]=o.mainError()),s.apply(this,arguments))})),o.attempt((function(){n.apply(e,i)}))}.bind(e,a),e[s].options=r}}},960:e=>{function t(e,t){"boolean"==typeof t&&(t={forever:t}),this._originalTimeouts=JSON.parse(JSON.stringify(e)),this._timeouts=e,this._options=t||{},this._maxRetryTime=t&&t.maxRetryTime||1/0,this._fn=null,this._errors=[],this._attempts=1,this._operationTimeout=null,this._operationTimeoutCb=null,this._timeout=null,this._operationStart=null,this._timer=null,this._options.forever&&(this._cachedTimeouts=this._timeouts.slice(0))}e.exports=t,t.prototype.reset=function(){this._attempts=1,this._timeouts=this._originalTimeouts.slice(0)},t.prototype.stop=function(){this._timeout&&clearTimeout(this._timeout),this._timer&&clearTimeout(this._timer),this._timeouts=[],this._cachedTimeouts=null},t.prototype.retry=function(e){if(this._timeout&&clearTimeout(this._timeout),!e)return!1;var t=(new Date).getTime();if(e&&t-this._operationStart>=this._maxRetryTime)return this._errors.push(e),this._errors.unshift(new Error("RetryOperation timeout occurred")),!1;this._errors.push(e);var r=this._timeouts.shift();if(void 0===r){if(!this._cachedTimeouts)return!1;this._errors.splice(0,this._errors.length-1),r=this._cachedTimeouts.slice(-1)}var n=this;return this._timer=setTimeout((function(){n._attempts++,n._operationTimeoutCb&&(n._timeout=setTimeout((function(){n._operationTimeoutCb(n._attempts)}),n._operationTimeout),n._options.unref&&n._timeout.unref()),n._fn(n._attempts)}),r),this._options.unref&&this._timer.unref(),!0},t.prototype.attempt=function(e,t){this._fn=e,t&&(t.timeout&&(this._operationTimeout=t.timeout),t.cb&&(this._operationTimeoutCb=t.cb));var r=this;this._operationTimeoutCb&&(this._timeout=setTimeout((function(){r._operationTimeoutCb()}),r._operationTimeout)),this._operationStart=(new Date).getTime(),this._fn(this._attempts)},t.prototype.try=function(e){console.log("Using RetryOperation.try() is deprecated"),this.attempt(e)},t.prototype.start=function(e){console.log("Using RetryOperation.start() is deprecated"),this.attempt(e)},t.prototype.start=t.prototype.try,t.prototype.errors=function(){return this._errors},t.prototype.attempts=function(){return this._attempts},t.prototype.mainError=function(){if(0===this._errors.length)return null;for(var e={},t=null,r=0,n=0;n<this._errors.length;n++){var o=this._errors[n],i=o.message,s=(e[i]||0)+1;e[i]=s,s>=r&&(t=o,r=s)}return t}},478:(e,t,r)=>{"use strict";var n=r(210),o=r(924),i=r(631),s=n("%TypeError%"),a=n("%WeakMap%",!0),u=n("%Map%",!0),c=o("WeakMap.prototype.get",!0),l=o("WeakMap.prototype.set",!0),p=o("WeakMap.prototype.has",!0),f=o("Map.prototype.get",!0),h=o("Map.prototype.set",!0),y=o("Map.prototype.has",!0),d=function(e,t){for(var r,n=e;null!==(r=n.next);n=r)if(r.key===t)return n.next=r.next,r.next=e.next,e.next=r,r};e.exports=function(){var e,t,r,n={assert:function(e){if(!n.has(e))throw new s("Side channel does not contain "+i(e))},get:function(n){if(a&&n&&("object"==typeof n||"function"==typeof n)){if(e)return c(e,n)}else if(u){if(t)return f(t,n)}else if(r)return function(e,t){var r=d(e,t);return r&&r.value}(r,n)},has:function(n){if(a&&n&&("object"==typeof n||"function"==typeof n)){if(e)return p(e,n)}else if(u){if(t)return y(t,n)}else if(r)return function(e,t){return!!d(e,t)}(r,n);return!1},set:function(n,o){a&&n&&("object"==typeof n||"function"==typeof n)?(e||(e=new a),l(e,n,o)):u?(t||(t=new u),h(t,n,o)):(r||(r={key:{},next:null}),function(e,t,r){var n=d(e,t);n?n.value=r:e.next={key:t,next:e.next,value:r}}(r,n,o))}};return n}},147:(e,t,r)=>{"use strict";r.r(t),r.d(t,{Headers:()=>y,Request:()=>w,Response:()=>S,DOMException:()=>O,fetch:()=>P});var n="undefined"!=typeof globalThis&&globalThis||"undefined"!=typeof self&&self||void 0!==n&&n,o="URLSearchParams"in n,i="Symbol"in n&&"iterator"in Symbol,s="FileReader"in n&&"Blob"in n&&function(){try{return new Blob,!0}catch(e){return!1}}(),a="FormData"in n,u="ArrayBuffer"in n;if(u)var c=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],l=ArrayBuffer.isView||function(e){return e&&c.indexOf(Object.prototype.toString.call(e))>-1};function p(e){if("string"!=typeof e&&(e=String(e)),/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(e)||""===e)throw new TypeError('Invalid character in header field name: "'+e+'"');return e.toLowerCase()}function f(e){return"string"!=typeof e&&(e=String(e)),e}function h(e){var t={next:function(){var t=e.shift();return{done:void 0===t,value:t}}};return i&&(t[Symbol.iterator]=function(){return t}),t}function y(e){this.map={},e instanceof y?e.forEach((function(e,t){this.append(t,e)}),this):Array.isArray(e)?e.forEach((function(e){this.append(e[0],e[1])}),this):e&&Object.getOwnPropertyNames(e).forEach((function(t){this.append(t,e[t])}),this)}function d(e){if(e.bodyUsed)return Promise.reject(new TypeError("Already read"));e.bodyUsed=!0}function v(e){return new Promise((function(t,r){e.onload=function(){t(e.result)},e.onerror=function(){r(e.error)}}))}function m(e){var t=new FileReader,r=v(t);return t.readAsArrayBuffer(e),r}function g(e){if(e.slice)return e.slice(0);var t=new Uint8Array(e.byteLength);return t.set(new Uint8Array(e)),t.buffer}function _(){return this.bodyUsed=!1,this._initBody=function(e){var t;this.bodyUsed=this.bodyUsed,this._bodyInit=e,e?"string"==typeof e?this._bodyText=e:s&&Blob.prototype.isPrototypeOf(e)?this._bodyBlob=e:a&&FormData.prototype.isPrototypeOf(e)?this._bodyFormData=e:o&&URLSearchParams.prototype.isPrototypeOf(e)?this._bodyText=e.toString():u&&s&&(t=e)&&DataView.prototype.isPrototypeOf(t)?(this._bodyArrayBuffer=g(e.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):u&&(ArrayBuffer.prototype.isPrototypeOf(e)||l(e))?this._bodyArrayBuffer=g(e):this._bodyText=e=Object.prototype.toString.call(e):this._bodyText="",this.headers.get("content-type")||("string"==typeof e?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):o&&URLSearchParams.prototype.isPrototypeOf(e)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},s&&(this.blob=function(){var e=d(this);if(e)return e;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?d(this)||(ArrayBuffer.isView(this._bodyArrayBuffer)?Promise.resolve(this._bodyArrayBuffer.buffer.slice(this._bodyArrayBuffer.byteOffset,this._bodyArrayBuffer.byteOffset+this._bodyArrayBuffer.byteLength)):Promise.resolve(this._bodyArrayBuffer)):this.blob().then(m)}),this.text=function(){var e,t,r,n=d(this);if(n)return n;if(this._bodyBlob)return e=this._bodyBlob,r=v(t=new FileReader),t.readAsText(e),r;if(this._bodyArrayBuffer)return Promise.resolve(function(e){for(var t=new Uint8Array(e),r=new Array(t.length),n=0;n<t.length;n++)r[n]=String.fromCharCode(t[n]);return r.join("")}(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},a&&(this.formData=function(){return this.text().then(A)}),this.json=function(){return this.text().then(JSON.parse)},this}y.prototype.append=function(e,t){e=p(e),t=f(t);var r=this.map[e];this.map[e]=r?r+", "+t:t},y.prototype.delete=function(e){delete this.map[p(e)]},y.prototype.get=function(e){return e=p(e),this.has(e)?this.map[e]:null},y.prototype.has=function(e){return this.map.hasOwnProperty(p(e))},y.prototype.set=function(e,t){this.map[p(e)]=f(t)},y.prototype.forEach=function(e,t){for(var r in this.map)this.map.hasOwnProperty(r)&&e.call(t,this.map[r],r,this)},y.prototype.keys=function(){var e=[];return this.forEach((function(t,r){e.push(r)})),h(e)},y.prototype.values=function(){var e=[];return this.forEach((function(t){e.push(t)})),h(e)},y.prototype.entries=function(){var e=[];return this.forEach((function(t,r){e.push([r,t])})),h(e)},i&&(y.prototype[Symbol.iterator]=y.prototype.entries);var b=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function w(e,t){if(!(this instanceof w))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');var r,n,o=(t=t||{}).body;if(e instanceof w){if(e.bodyUsed)throw new TypeError("Already read");this.url=e.url,this.credentials=e.credentials,t.headers||(this.headers=new y(e.headers)),this.method=e.method,this.mode=e.mode,this.signal=e.signal,o||null==e._bodyInit||(o=e._bodyInit,e.bodyUsed=!0)}else this.url=String(e);if(this.credentials=t.credentials||this.credentials||"same-origin",!t.headers&&this.headers||(this.headers=new y(t.headers)),this.method=(n=(r=t.method||this.method||"GET").toUpperCase(),b.indexOf(n)>-1?n:r),this.mode=t.mode||this.mode||null,this.signal=t.signal||this.signal,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&o)throw new TypeError("Body not allowed for GET or HEAD requests");if(this._initBody(o),!("GET"!==this.method&&"HEAD"!==this.method||"no-store"!==t.cache&&"no-cache"!==t.cache)){var i=/([?&])_=[^&]*/;i.test(this.url)?this.url=this.url.replace(i,"$1_="+(new Date).getTime()):this.url+=(/\?/.test(this.url)?"&":"?")+"_="+(new Date).getTime()}}function A(e){var t=new FormData;return e.trim().split("&").forEach((function(e){if(e){var r=e.split("="),n=r.shift().replace(/\+/g," "),o=r.join("=").replace(/\+/g," ");t.append(decodeURIComponent(n),decodeURIComponent(o))}})),t}function S(e,t){if(!(this instanceof S))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');t||(t={}),this.type="default",this.status=void 0===t.status?200:t.status,this.ok=this.status>=200&&this.status<300,this.statusText=void 0===t.statusText?"":""+t.statusText,this.headers=new y(t.headers),this.url=t.url||"",this._initBody(e)}w.prototype.clone=function(){return new w(this,{body:this._bodyInit})},_.call(w.prototype),_.call(S.prototype),S.prototype.clone=function(){return new S(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new y(this.headers),url:this.url})},S.error=function(){var e=new S(null,{status:0,statusText:""});return e.type="error",e};var E=[301,302,303,307,308];S.redirect=function(e,t){if(-1===E.indexOf(t))throw new RangeError("Invalid status code");return new S(null,{status:t,headers:{location:e}})};var O=n.DOMException;try{new O}catch(e){(O=function(e,t){this.message=e,this.name=t;var r=Error(e);this.stack=r.stack}).prototype=Object.create(Error.prototype),O.prototype.constructor=O}function P(e,t){return new Promise((function(r,o){var i=new w(e,t);if(i.signal&&i.signal.aborted)return o(new O("Aborted","AbortError"));var a=new XMLHttpRequest;function c(){a.abort()}a.onload=function(){var e,t,n={status:a.status,statusText:a.statusText,headers:(e=a.getAllResponseHeaders()||"",t=new y,e.replace(/\r?\n[\t ]+/g," ").split("\r").map((function(e){return 0===e.indexOf("\n")?e.substr(1,e.length):e})).forEach((function(e){var r=e.split(":"),n=r.shift().trim();if(n){var o=r.join(":").trim();t.append(n,o)}})),t)};n.url="responseURL"in a?a.responseURL:n.headers.get("X-Request-URL");var o="response"in a?a.response:a.responseText;setTimeout((function(){r(new S(o,n))}),0)},a.onerror=function(){setTimeout((function(){o(new TypeError("Network request failed"))}),0)},a.ontimeout=function(){setTimeout((function(){o(new TypeError("Network request failed"))}),0)},a.onabort=function(){setTimeout((function(){o(new O("Aborted","AbortError"))}),0)},a.open(i.method,function(e){try{return""===e&&n.location.href?n.location.href:e}catch(t){return e}}(i.url),!0),"include"===i.credentials?a.withCredentials=!0:"omit"===i.credentials&&(a.withCredentials=!1),"responseType"in a&&(s?a.responseType="blob":u&&i.headers.get("Content-Type")&&-1!==i.headers.get("Content-Type").indexOf("application/octet-stream")&&(a.responseType="arraybuffer")),!t||"object"!=typeof t.headers||t.headers instanceof y?i.headers.forEach((function(e,t){a.setRequestHeader(t,e)})):Object.getOwnPropertyNames(t.headers).forEach((function(e){a.setRequestHeader(e,f(t.headers[e]))})),i.signal&&(i.signal.addEventListener("abort",c),a.onreadystatechange=function(){4===a.readyState&&i.signal.removeEventListener("abort",c)}),a.send(void 0===i._bodyInit?null:i._bodyInit)}))}P.polyfill=!0,n.fetch||(n.fetch=P,n.Headers=y,n.Request=w,n.Response=S)},654:()=>{}},t={};function r(n){var o=t[n];if(void 0!==o)return o.exports;var i=t[n]={exports:{}};return e[n].call(i.exports,i,i.exports,r),i.exports}r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var n={};(()=>{"use strict";r.r(n),r.d(n,{AuthComponent:()=>v,AuthContext:()=>c,AuthFlow:()=>U,AuthProvider:()=>l,AuthService:()=>M,Privileges:()=>s,ProtectedRoute:()=>h,ProtectedRouteContext:()=>p,ProtectedRouteProvider:()=>f,TenantIds:()=>a,getIdentityProviderFromHostname:()=>i,userHasAccess:()=>u});const e=require("react");var t=r.n(e);const o=require("react-router-dom");function i(e){var t;return null!==(t={"bestseller.digitalvenue.dev":"bestseller","bestseller.digitalvenue.app":"bestseller","bestseller.digitalvenue.training":"bestseller","bestseller.localhost":"bestseller"}[e])&&void 0!==t?t:"touchtech"}class s{}s.UNIVERSAL="universal",s.SHOWROOM_APP="showroom-app",s.MARKETING_ENGINE_APP="marketing-engine-app",s.USER_MANAGEMENT_APP="user-management-app";class a{}function u(e,t,r){if(e)for(const n of e.roles)if(n===`${t}:${r}`||n===`${t}:${s.UNIVERSAL}`||n===`${a.UNIVERSAL}:${r}`||n===`${a.UNIVERSAL}:${s.UNIVERSAL}`)return!0;return!1}a.UNIVERSAL="10000001-c001-0001-0001-000000000000";const c=t().createContext(null),l=({children:r,authService:n,onError:o,onUserIdentified:i})=>{const[s,a]=(0,e.useState)(null);(0,e.useEffect)((()=>{function e(){const e=n.user;e&&(a(e),i(e))}e();const t=()=>{e()};return n.on("userChanged",t).on("error",o),()=>{n.off("userChanged",t).off("error",o)}}),[a,i,n,o]);const u=(0,e.useMemo)((()=>({user:s,authService:n})),[n,s]);return t().createElement(c.Provider,{value:u},r)},p=t().createContext(null),f=({children:r,tenantId:n,privilege:o,unauthorizedPath:i})=>{const s=(0,e.useMemo)((()=>({tenantId:n,privilege:o,unauthorizedPath:i})),[i,o,n]);return t().createElement(p.Provider,{value:s},r)},h=function({skipAuthorization:r,children:n}){const{user:i,authService:s}=(0,e.useContext)(c),{tenantId:a,privilege:l,unauthorizedPath:f}=(0,e.useContext)(p);return i?r||u(i,a,l)?n:t().createElement(o.Navigate,{to:f}):(s.signIn(),null)};var y=r(129),d=r.n(y);const v=function({basename:t}){const r=(0,o.useNavigate)(),n=(0,o.useLocation)(),{authService:i,user:s}=(0,e.useContext)(c);return(0,e.useEffect)((()=>{if(s){const{state:e}=d().parse(n.search,{ignoreQueryPrefix:!0});if(null!=e&&e.startsWith(t)){const n=e.substring(t.length);r(n)}else r("/")}}),[t,r,n.search,s]),(0,e.useEffect)((()=>{i.completeSignInIfPossible()}),[i]),null};function m(e,t,r,n){return new(r||(r=Promise))((function(o,i){function s(e){try{u(n.next(e))}catch(e){i(e)}}function a(e){try{u(n.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))}var g=r(588),_=r.n(g);function b(){let e=window.sessionStorage.getItem("clientId");return e||(e=((e=21)=>{let t="",r=crypto.getRandomValues(new Uint8Array(e));for(;e--;){let n=63&r[e];t+=n<36?n.toString(36):n<62?(n-26).toString(36).toUpperCase():n<63?"_":"-"}return t})(),window.sessionStorage.setItem("clientId",e),e)}class w{constructor(e,t){const r="development"===t?"debug":"info",n=["app",t,`clientId-${b()}`];this._logstash=_()(e,n,r)}static get instance(){if(!w.s_instance)throw new Error("Logger has not been initialized");return w.s_instance}static initialize(e,t){if(w.s_instance)throw new Error("Logger has already been initialized");w.s_instance=new w(e,t)}debug(e,t){this._logstash.debug(e,t)}info(e,t){this._logstash.info(e,t)}warn(e,t){this._logstash.warn(e,t)}error(e,t){this._logstash.error(e,t)}}var A=r(187),S=r.n(A);function E(e){this.message=e}E.prototype=new Error,E.prototype.name="InvalidCharacterError";var O="undefined"!=typeof window&&window.atob&&window.atob.bind(window)||function(e){var t=String(e).replace(/=+$/,"");if(t.length%4==1)throw new E("'atob' failed: The string to be decoded is not correctly encoded.");for(var r,n,o=0,i=0,s="";n=t.charAt(i++);~n&&(r=o%4?64*r+n:n,o++%4)?s+=String.fromCharCode(255&r>>(-2*o&6)):0)n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(n);return s};function P(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"Illegal base64url string!"}try{return function(e){return decodeURIComponent(O(e).replace(/(.)/g,(function(e,t){var r=t.charCodeAt(0).toString(16).toUpperCase();return r.length<2&&(r="0"+r),"%"+r})))}(t)}catch(e){return O(t)}}function T(e){this.message=e}T.prototype=new Error,T.prototype.name="InvalidTokenError";var x=r(438),R=r(394),I=r(373),j=r(892),k=r(551),C=r(298),N=r(865);class L extends N.BasicQueryStringUtils{parse(e){return super.parse(e,!1)}}class U extends A.EventEmitter{constructor(e){super(),this._configuration=e,this._notifier=new R.AuthorizationNotifier,this._authorizationHandler=new N.RedirectRequestHandler(new N.LocalStorageBackend,new L),this._tokenHandler=new k.BaseTokenRequestHandler(U.s_requestor),this._authorizationHandler.setAuthorizationNotifier(this._notifier),this._notifier.setAuthorizationListener(this.authorizationListener.bind(this))}initialize(){this.loadState()}authorizationListener(e,t,r){return m(this,void 0,void 0,(function*(){if(console.debug("Authorization request complete",e,t,r),t){let r;e.internal&&e.internal.code_verifier&&(r=e.internal.code_verifier),yield this.makeTokenRequest(t.code,r),this.emit("tokenResponse")}}))}signIn(e,t=!1){return m(this,void 0,void 0,(function*(){this.isSignedIn()?t&&(this.signOutCore(),yield this.makeAuthorizationRequest(e)):yield this.makeAuthorizationRequest(e)}))}completeSignInIfPossible(){return m(this,void 0,void 0,(function*(){yield this._authorizationHandler.completeAuthorizationRequestIfPossible()}))}isSignedIn(){return!!this._tokenResponse&&this._tokenResponse.isValid()}getAccessToken(){return m(this,void 0,void 0,(function*(){if(this._tokenResponse&&this._tokenResponse.isValid())return this._tokenResponse.accessToken;if(this._refreshTokenPromise)return yield this._refreshTokenPromise;{if(!this._tokenResponse)return null;let e;try{this._refreshTokenPromise=this.refreshToken(),e=yield this._refreshTokenPromise}finally{this._refreshTokenPromise=void 0}return e}}))}signOut(){return m(this,void 0,void 0,(function*(){const e=this._tokenResponse.idToken;this.signOutCore();const t=yield this.ensureServiceConfiguration(),r=this._configuration.postLogoutRedirectUri,n=`${t.endSessionEndpoint}?id_token_hint=${e}&post_logout_redirect_uri=${r}`;console.debug(`[AuthFlow] Signing out using post_logout_redirect_uri '${r}' (full endSession URL: '${n}') ...`),window.location.assign(n)}))}signOutCore(){this._tokenResponse=void 0,window.sessionStorage.removeItem(U.TOKEN_RESPONSE_KEY)}makeAuthorizationRequest(e){return m(this,void 0,void 0,(function*(){const t={idp:e},r=new x.AuthorizationRequest({client_id:this._configuration.clientId,redirect_uri:this._configuration.redirectUri,scope:this._configuration.scope,response_type:x.AuthorizationRequest.RESPONSE_TYPE_CODE,state:`${window.location.pathname}${window.location.search}`,extras:t});this._authorizationHandler.performAuthorizationRequest(yield this.ensureServiceConfiguration(),r)}))}ensureServiceConfiguration(){return m(this,void 0,void 0,(function*(){if(!this._serviceConfiguration){const e=yield I.AuthorizationServiceConfiguration.fetchFromIssuer(this._configuration.openIdIssuerUrl,U.s_requestor);this._serviceConfiguration=e}return this._serviceConfiguration}))}saveState(){window.sessionStorage.setItem(U.TOKEN_RESPONSE_KEY,JSON.stringify(this._tokenResponse.toJson()))}loadState(){const e=window.sessionStorage.getItem(U.TOKEN_RESPONSE_KEY);if(null!=e){const t=JSON.parse(e),r=new C.TokenResponse(t);this._tokenResponse=r,this.emit("tokenResponse")}}makeTokenRequest(e,t){return m(this,void 0,void 0,(function*(){const r={};t&&(r.code_verifier=t);const n=new j.TokenRequest({code:e,extras:r,client_id:this._configuration.clientId,redirect_uri:this._configuration.redirectUri,grant_type:j.GRANT_TYPE_AUTHORIZATION_CODE,refresh_token:void 0}),o=yield this._tokenHandler.performTokenRequest(yield this.ensureServiceConfiguration(),n);this._tokenResponse=o,this.saveState()}))}refreshToken(){return m(this,void 0,void 0,(function*(){console.debug("Refreshing token ...");const e=this._tokenResponse.refreshToken;this._tokenResponse=void 0,window.sessionStorage.removeItem(U.TOKEN_RESPONSE_KEY);const t=new j.TokenRequest({client_id:this._configuration.clientId,redirect_uri:this._configuration.redirectUri,grant_type:j.GRANT_TYPE_REFRESH_TOKEN,refresh_token:e,code:void 0,extras:void 0}),r=yield this._tokenHandler.performTokenRequest(yield this.ensureServiceConfiguration(),t);return this._tokenResponse=r,this.saveState(),console.debug("Refreshed token --\x3e",r),r.accessToken}))}}U.TOKEN_RESPONSE_KEY="AuthFlow:tokenResponse",U.s_requestor=new N.FetchRequestor;class q{}q.EMAIL="email",q.GIVEN_NAME="given_name",q.FAMILY_NAME="family_name",q.ROLE="http://schemas.microsoft.com/ws/2008/06/identity/claims/role";class M extends(S()){constructor(e){super(),this._auth=new U(e),this._auth.on("tokenResponse",this.handleTokenResponse.bind(this)),this._auth.initialize()}static get instance(){if(!M.s_instance)throw new Error("AuthService has not been initialized");return M.s_instance}static initialize(e){if(M.s_instance)throw new Error("AuthService has already been initialized");M.s_instance=new M(e)}setUser(e){this._user!==e&&(this._user=e,this.emit("userChanged"))}handleTokenResponse(){return m(this,void 0,void 0,(function*(){try{this.setUser(yield this.getUser())}catch(e){this.emit("error",e)}}))}getUser(){return m(this,void 0,void 0,(function*(){const e=function(e,t){if("string"!=typeof e)throw new T("Invalid token specified");var r=!0===(t=t||{}).header?0:1;try{return JSON.parse(P(e.split(".")[r]))}catch(e){throw new T("Invalid token specified: "+e.message)}}(yield this.getAccessToken()),t=e[q.EMAIL],r=e[q.GIVEN_NAME],n=e[q.FAMILY_NAME],o=e[q.ROLE];return{email:t,firstName:r,lastName:n,roles:Array.isArray(o)?o:[o]}}))}get user(){return this._user}signIn(e=!1){return m(this,void 0,void 0,(function*(){try{const t=i(window.location.hostname);console.debug(`[AuthService] Using identity provider '${t}' ...`),yield this._auth.signIn(t,e)}catch(e){this.emit("error",e)}}))}completeSignInIfPossible(){return m(this,void 0,void 0,(function*(){try{yield this._auth.completeSignInIfPossible()}catch(e){this.emit("error",e)}}))}getAccessToken(){return m(this,void 0,void 0,(function*(){try{return yield this._auth.getAccessToken()}catch(e){return w.instance.error(e.message,e),this.emit("error",e),null}}))}signOut(){return m(this,void 0,void 0,(function*(){try{yield this._auth.signOut()}catch(e){this.emit("error",e)}}))}}})();var o=exports;for(var i in n)o[i]=n[i];n.__esModule&&Object.defineProperty(o,"__esModule",{value:!0})})();
|
|
1
|
+
(()=>{var e={438:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AuthorizationRequest=void 0;var n=r(537),o=r(96),i=function(){function e(t,r,o){void 0===r&&(r=new n.DefaultCrypto),void 0===o&&(o=!0),this.crypto=r,this.usePkce=o,this.clientId=t.client_id,this.redirectUri=t.redirect_uri,this.scope=t.scope,this.responseType=t.response_type||e.RESPONSE_TYPE_CODE,this.state=t.state||function(e){return e.generateRandom(10)}(r),this.extras=t.extras,this.internal=t.internal}return e.prototype.setupCodeVerifier=function(){var e=this;if(this.usePkce){var t=this.crypto.generateRandom(128);return this.crypto.deriveChallenge(t).catch((function(e){o.log("Unable to generate PKCE challenge. Not using PKCE",e)})).then((function(r){r&&(e.internal=e.internal||{},e.internal.code_verifier=t,e.extras=e.extras||{},e.extras.code_challenge=r,e.extras.code_challenge_method="S256")}))}return Promise.resolve()},e.prototype.toJson=function(){var e=this;return this.setupCodeVerifier().then((function(){return{response_type:e.responseType,client_id:e.clientId,redirect_uri:e.redirectUri,scope:e.scope,state:e.state,extras:e.extras,internal:e.internal}}))},e.RESPONSE_TYPE_TOKEN="token",e.RESPONSE_TYPE_CODE="code",e}();t.AuthorizationRequest=i},394:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AuthorizationRequestHandler=t.BUILT_IN_PARAMETERS=t.AuthorizationNotifier=void 0;var n=r(96),o=function(){function e(){this.listener=null}return e.prototype.setAuthorizationListener=function(e){this.listener=e},e.prototype.onAuthorizationComplete=function(e,t,r){this.listener&&this.listener(e,t,r)},e}();t.AuthorizationNotifier=o,t.BUILT_IN_PARAMETERS=["redirect_uri","client_id","response_type","state","scope"];var i=function(){function e(e,t){this.utils=e,this.crypto=t,this.notifier=null}return e.prototype.buildRequestUrl=function(e,r){var n={redirect_uri:r.redirectUri,client_id:r.clientId,response_type:r.responseType,state:r.state,scope:r.scope};if(r.extras)for(var o in r.extras)r.extras.hasOwnProperty(o)&&t.BUILT_IN_PARAMETERS.indexOf(o)<0&&(n[o]=r.extras[o]);var i=this.utils.stringify(n);return e.authorizationEndpoint+"?"+i},e.prototype.completeAuthorizationRequestIfPossible=function(){var e=this;return n.log("Checking to see if there is an authorization response to be delivered."),this.notifier||n.log("Notifier is not present on AuthorizationRequest handler.\n No delivery of result will be possible"),this.completeAuthorizationRequest().then((function(t){t||n.log("No result is available yet."),t&&e.notifier&&e.notifier.onAuthorizationComplete(t.request,t.response,t.error)}))},e.prototype.setAuthorizationNotifier=function(e){return this.notifier=e,this},e}();t.AuthorizationRequestHandler=i},208:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AuthorizationError=t.AuthorizationResponse=void 0;var r=function(){function e(e){this.code=e.code,this.state=e.state}return e.prototype.toJson=function(){return{code:this.code,state:this.state}},e}();t.AuthorizationResponse=r;var n=function(){function e(e){this.error=e.error,this.errorDescription=e.error_description,this.errorUri=e.error_uri,this.state=e.state}return e.prototype.toJson=function(){return{error:this.error,error_description:this.errorDescription,error_uri:this.errorUri,state:this.state}},e}();t.AuthorizationError=n},373:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AuthorizationServiceConfiguration=void 0;var n=r(157),o=function(){function e(e){this.authorizationEndpoint=e.authorization_endpoint,this.tokenEndpoint=e.token_endpoint,this.revocationEndpoint=e.revocation_endpoint,this.userInfoEndpoint=e.userinfo_endpoint,this.endSessionEndpoint=e.end_session_endpoint}return e.prototype.toJson=function(){return{authorization_endpoint:this.authorizationEndpoint,token_endpoint:this.tokenEndpoint,revocation_endpoint:this.revocationEndpoint,end_session_endpoint:this.endSessionEndpoint,userinfo_endpoint:this.userInfoEndpoint}},e.fetchFromIssuer=function(t,r){var o=t+"/.well-known/openid-configuration";return(r||new n.JQueryRequestor).xhr({url:o,dataType:"json",method:"GET"}).then((function(t){return new e(t)}))},e}();t.AuthorizationServiceConfiguration=o},537:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DefaultCrypto=t.textEncodeLite=t.urlSafe=t.bufferToString=void 0;var n=r(742),o=r(3),i="undefined"!=typeof window&&!!window.crypto,s=i&&!!window.crypto.subtle,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";function u(e){for(var t=[],r=0;r<e.byteLength;r+=1){var n=e[r]%a.length;t.push(a[n])}return t.join("")}function c(e){return n.fromByteArray(new Uint8Array(e)).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function l(e){for(var t=new ArrayBuffer(e.length),r=new Uint8Array(t),n=0;n<e.length;n++)r[n]=e.charCodeAt(n);return r}t.bufferToString=u,t.urlSafe=c,t.textEncodeLite=l;var p=function(){function e(){}return e.prototype.generateRandom=function(e){var t=new Uint8Array(e);if(i)window.crypto.getRandomValues(t);else for(var r=0;r<e;r+=1)t[r]=Math.random()*a.length|0;return u(t)},e.prototype.deriveChallenge=function(e){return e.length<43||e.length>128?Promise.reject(new o.AppAuthError("Invalid code length.")):s?new Promise((function(t,r){crypto.subtle.digest("SHA-256",l(e)).then((function(e){return t(c(new Uint8Array(e)))}),(function(e){return r(e)}))})):Promise.reject(new o.AppAuthError("window.crypto.subtle is unavailable."))},e}();t.DefaultCrypto=p},3:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AppAuthError=void 0;t.AppAuthError=function(e,t){this.message=e,this.extras=t}},577:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.IS_PROFILE=t.IS_LOG=void 0,t.IS_LOG=!0,t.IS_PROFILE=!1},865:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),o=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),o(r(438),t),o(r(394),t),o(r(208),t),o(r(373),t),o(r(537),t),o(r(3),t),o(r(577),t),o(r(96),t),o(r(629),t),o(r(417),t),o(r(33),t),o(r(480),t),o(r(892),t),o(r(551),t),o(r(298),t),o(r(53),t),o(r(157),t)},96:function(e,t,r){"use strict";var n=this&&this.__spreadArray||function(e,t){for(var r=0,n=t.length,o=e.length;r<n;r++,o++)e[o]=t[r];return e};Object.defineProperty(t,"__esModule",{value:!0}),t.profile=t.log=void 0;var o=r(577);function i(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];if(o.IS_LOG){var i=t?t.length:0;i>0?console.log.apply(console,n([e],t)):console.log(e)}}t.log=i;var s="undefined"!=typeof window&&!!window.performance&&!!console.profile;t.profile=function(e,t,r){return o.IS_PROFILE?function(e,t,r){var o=r.value,a=o.name;return a||(a="anonymous function"),r.value=s?function(e){console.profile(a);var t=window.performance.now(),r=o.call.apply(o,n([this||window],e)),i=window.performance.now()-t;return console.log(a+" took "+i+" ms"),console.profileEnd(),r}:function(e){i("Profile start "+a);var t=Date.now(),r=o.call.apply(o,n([this||window],e)),s=Date.now()-t;return i("Profile end "+a+" took "+s+" ms."),r},r}(0,0,r):r}},629:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BasicQueryStringUtils=void 0;var r=function(){function e(){}return e.prototype.parse=function(e,t){return t?this.parseQueryString(e.hash):this.parseQueryString(e.search)},e.prototype.parseQueryString=function(e){for(var t={},r=(e=e.trim().replace(/^(\?|#|&)/,"")).split("&"),n=0;n<r.length;n+=1){var o=r[n].split("=");if(o.length>=2){var i=decodeURIComponent(o.shift()),s=o.length>0?o.join("="):null;s&&(t[i]=decodeURIComponent(s))}}return t},e.prototype.stringify=function(e){var t=[];for(var r in e)e.hasOwnProperty(r)&&e[r]&&t.push(encodeURIComponent(r)+"="+encodeURIComponent(e[r]));return t.join("&")},e}();t.BasicQueryStringUtils=r},417:function(e,t,r){"use strict";var n,o=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.RedirectRequestHandler=void 0;var i=r(438),s=r(394),a=r(208),u=r(537),c=r(96),l=r(629),p=r(480),f=function(e){return e+"_appauth_authorization_request"},h=function(e){return e+"_appauth_authorization_service_configuration"},y="appauth_current_authorization_request",d=function(e){function t(t,r,n,o){void 0===t&&(t=new p.LocalStorageBackend),void 0===r&&(r=new l.BasicQueryStringUtils),void 0===n&&(n=window.location),void 0===o&&(o=new u.DefaultCrypto);var i=e.call(this,r,o)||this;return i.storageBackend=t,i.locationLike=n,i}return o(t,e),t.prototype.performAuthorizationRequest=function(e,t){var r=this,n=this.crypto.generateRandom(10);Promise.all([this.storageBackend.setItem(y,n),t.toJson().then((function(e){return r.storageBackend.setItem(f(n),JSON.stringify(e))})),this.storageBackend.setItem(h(n),JSON.stringify(e.toJson()))]).then((function(){var n=r.buildRequestUrl(e,t);c.log("Making a request to ",t,n),r.locationLike.assign(n)}))},t.prototype.completeAuthorizationRequest=function(){var e=this;return this.storageBackend.getItem(y).then((function(t){return t?e.storageBackend.getItem(f(t)).then((function(e){return JSON.parse(e)})).then((function(e){return new i.AuthorizationRequest(e)})).then((function(r){var n=""+e.locationLike.origin+e.locationLike.pathname,o=e.utils.parse(e.locationLike,!0),i=o.state,s=o.code,u=o.error;c.log("Potential authorization request ",n,o,i,s,u);var l=i===r.state,p=null,d=null;if(l){if(u){var v=o.error_uri,m=o.error_description;d=new a.AuthorizationError({error:u,error_description:m,error_uri:v,state:i})}else p=new a.AuthorizationResponse({code:s,state:i});return Promise.all([e.storageBackend.removeItem(y),e.storageBackend.removeItem(f(t)),e.storageBackend.removeItem(h(t))]).then((function(){return c.log("Delivering authorization response"),{request:r,response:p,error:d}}))}return c.log("Mismatched request (state and request_uri) dont match."),Promise.resolve(null)})):null}))},t}(s.AuthorizationRequestHandler);t.RedirectRequestHandler=d},33:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.RevokeTokenRequest=void 0;var r=function(){function e(e){this.token=e.token,this.tokenTypeHint=e.token_type_hint,this.clientId=e.client_id,this.clientSecret=e.client_secret}return e.prototype.toJson=function(){var e={token:this.token};return this.tokenTypeHint&&(e.token_type_hint=this.tokenTypeHint),this.clientId&&(e.client_id=this.clientId),this.clientSecret&&(e.client_secret=this.clientSecret),e},e.prototype.toStringMap=function(){return this.toJson()},e}();t.RevokeTokenRequest=r},480:function(e,t){"use strict";var r,n=this&&this.__extends||(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},r(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0}),t.LocalStorageBackend=t.StorageBackend=void 0;var o=function(){};t.StorageBackend=o;var i=function(e){function t(t){var r=e.call(this)||this;return r.storage=t||window.localStorage,r}return n(t,e),t.prototype.getItem=function(e){var t=this;return new Promise((function(r,n){r(t.storage.getItem(e)||null)}))},t.prototype.removeItem=function(e){var t=this;return new Promise((function(r,n){t.storage.removeItem(e),r()}))},t.prototype.clear=function(){var e=this;return new Promise((function(t,r){e.storage.clear(),t()}))},t.prototype.setItem=function(e,t){var r=this;return new Promise((function(n,o){r.storage.setItem(e,t),n()}))},t}(o);t.LocalStorageBackend=i},892:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TokenRequest=t.GRANT_TYPE_REFRESH_TOKEN=t.GRANT_TYPE_AUTHORIZATION_CODE=void 0,t.GRANT_TYPE_AUTHORIZATION_CODE="authorization_code",t.GRANT_TYPE_REFRESH_TOKEN="refresh_token";var r=function(){function e(e){this.clientId=e.client_id,this.redirectUri=e.redirect_uri,this.grantType=e.grant_type,this.code=e.code,this.refreshToken=e.refresh_token,this.extras=e.extras}return e.prototype.toJson=function(){return{grant_type:this.grantType,code:this.code,refresh_token:this.refreshToken,redirect_uri:this.redirectUri,client_id:this.clientId,extras:this.extras}},e.prototype.toStringMap=function(){var e={grant_type:this.grantType,client_id:this.clientId,redirect_uri:this.redirectUri};if(this.code&&(e.code=this.code),this.refreshToken&&(e.refresh_token=this.refreshToken),this.extras)for(var t in this.extras)this.extras.hasOwnProperty(t)&&!e.hasOwnProperty(t)&&(e[t]=this.extras[t]);return e},e}();t.TokenRequest=r},551:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BaseTokenRequestHandler=void 0;var n=r(3),o=r(629),i=r(298),s=r(157),a=function(){function e(e,t){void 0===e&&(e=new s.JQueryRequestor),void 0===t&&(t=new o.BasicQueryStringUtils),this.requestor=e,this.utils=t}return e.prototype.isTokenResponse=function(e){return void 0===e.error},e.prototype.performRevokeTokenRequest=function(e,t){return this.requestor.xhr({url:e.revocationEndpoint,method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},data:this.utils.stringify(t.toStringMap())}).then((function(e){return!0}))},e.prototype.performTokenRequest=function(e,t){var r=this;return this.requestor.xhr({url:e.tokenEndpoint,method:"POST",dataType:"json",headers:{"Content-Type":"application/x-www-form-urlencoded"},data:this.utils.stringify(t.toStringMap())}).then((function(e){return r.isTokenResponse(e)?new i.TokenResponse(e):Promise.reject(new n.AppAuthError(e.error,new i.TokenError(e)))}))},e}();t.BaseTokenRequestHandler=a},298:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TokenError=t.TokenResponse=t.nowInSeconds=void 0,t.nowInSeconds=function(){return Math.round((new Date).getTime()/1e3)};var r=function(){function e(e){this.accessToken=e.access_token,this.tokenType=e.token_type||"bearer",e.expires_in&&(this.expiresIn=parseInt(e.expires_in,10)),this.refreshToken=e.refresh_token,this.scope=e.scope,this.idToken=e.id_token,this.issuedAt=e.issued_at||t.nowInSeconds()}return e.prototype.toJson=function(){var e;return{access_token:this.accessToken,id_token:this.idToken,refresh_token:this.refreshToken,scope:this.scope,token_type:this.tokenType,issued_at:this.issuedAt,expires_in:null===(e=this.expiresIn)||void 0===e?void 0:e.toString()}},e.prototype.isValid=function(e){return void 0===e&&(e=-600),!this.expiresIn||t.nowInSeconds()<this.issuedAt+this.expiresIn+e},e}();t.TokenResponse=r;var n=function(){function e(e){this.error=e.error,this.errorDescription=e.error_description,this.errorUri=e.error_uri}return e.prototype.toJson=function(){return{error:this.error,error_description:this.errorDescription,error_uri:this.errorUri}},e}();t.TokenError=n},53:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},157:function(e,t,r){"use strict";var n,o=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.TestRequestor=t.FetchRequestor=t.JQueryRequestor=t.Requestor=void 0;var i=r(3),s=function(){};t.Requestor=s;var a=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return o(t,e),t.prototype.xhr=function(e){var t=$.ajax(e);return new Promise((function(e,r){t.then((function(t,r,n){e(t)}),(function(e,t,n){r(new i.AppAuthError(n))}))}))},t}(s);t.JQueryRequestor=a;var u=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return o(t,e),t.prototype.xhr=function(e){if(!e.url)return Promise.reject(new i.AppAuthError("A URL must be provided."));var t=new URL(e.url),r={};if(r.method=e.method,r.mode="cors",e.data&&(e.method&&"POST"===e.method.toUpperCase()?r.body=e.data:new URLSearchParams(e.data).forEach((function(e,r){t.searchParams.append(r,e)}))),r.headers={},e.headers)for(var n in e.headers)e.headers.hasOwnProperty(n)&&(r.headers[n]=e.headers[n]);var o=e.dataType&&"json"===e.dataType.toLowerCase();return o&&(r.headers.Accept="application/json, text/javascript, */*; q=0.01"),fetch(t.toString(),r).then((function(e){if(e.status>=200&&e.status<300){var t=e.headers.get("content-type");return o||t&&-1!==t.indexOf("application/json")?e.json():e.text()}return Promise.reject(new i.AppAuthError(e.status.toString(),e.statusText))}))},t}(s);t.FetchRequestor=u;var c=function(e){function t(t){var r=e.call(this)||this;return r.promise=t,r}return o(t,e),t.prototype.xhr=function(e){return this.promise},t}(s);t.TestRequestor=c},742:(e,t)=>{"use strict";t.byteLength=function(e){var t=u(e),r=t[0],n=t[1];return 3*(r+n)/4-n},t.toByteArray=function(e){var t,r,i=u(e),s=i[0],a=i[1],c=new o(function(e,t,r){return 3*(t+r)/4-r}(0,s,a)),l=0,p=a>0?s-4:s;for(r=0;r<p;r+=4)t=n[e.charCodeAt(r)]<<18|n[e.charCodeAt(r+1)]<<12|n[e.charCodeAt(r+2)]<<6|n[e.charCodeAt(r+3)],c[l++]=t>>16&255,c[l++]=t>>8&255,c[l++]=255&t;return 2===a&&(t=n[e.charCodeAt(r)]<<2|n[e.charCodeAt(r+1)]>>4,c[l++]=255&t),1===a&&(t=n[e.charCodeAt(r)]<<10|n[e.charCodeAt(r+1)]<<4|n[e.charCodeAt(r+2)]>>2,c[l++]=t>>8&255,c[l++]=255&t),c},t.fromByteArray=function(e){for(var t,n=e.length,o=n%3,i=[],s=16383,a=0,u=n-o;a<u;a+=s)i.push(c(e,a,a+s>u?u:a+s));return 1===o?(t=e[n-1],i.push(r[t>>2]+r[t<<4&63]+"==")):2===o&&(t=(e[n-2]<<8)+e[n-1],i.push(r[t>>10]+r[t>>4&63]+r[t<<2&63]+"=")),i.join("")};for(var r=[],n=[],o="undefined"!=typeof Uint8Array?Uint8Array:Array,i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0,a=i.length;s<a;++s)r[s]=i[s],n[i.charCodeAt(s)]=s;function u(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");return-1===r&&(r=t),[r,r===t?0:4-r%4]}function c(e,t,n){for(var o,i,s=[],a=t;a<n;a+=3)o=(e[a]<<16&16711680)+(e[a+1]<<8&65280)+(255&e[a+2]),s.push(r[(i=o)>>18&63]+r[i>>12&63]+r[i>>6&63]+r[63&i]);return s.join("")}n["-".charCodeAt(0)]=62,n["_".charCodeAt(0)]=63},924:(e,t,r)=>{"use strict";var n=r(210),o=r(559),i=o(n("String.prototype.indexOf"));e.exports=function(e,t){var r=n(e,!!t);return"function"==typeof r&&i(e,".prototype.")>-1?o(r):r}},559:(e,t,r)=>{"use strict";var n=r(612),o=r(210),i=o("%Function.prototype.apply%"),s=o("%Function.prototype.call%"),a=o("%Reflect.apply%",!0)||n.call(s,i),u=o("%Object.getOwnPropertyDescriptor%",!0),c=o("%Object.defineProperty%",!0),l=o("%Math.max%");if(c)try{c({},"a",{value:1})}catch(e){c=null}e.exports=function(e){var t=a(n,s,arguments);if(u&&c){var r=u(t,"length");r.configurable&&c(t,"length",{value:1+l(0,e.length-(arguments.length-1))})}return t};var p=function(){return a(n,i,arguments)};c?c(e.exports,"apply",{value:p}):e.exports.apply=p},729:e=>{"use strict";var t=Object.prototype.hasOwnProperty,r="~";function n(){}function o(e,t,r){this.fn=e,this.context=t,this.once=r||!1}function i(e,t,n,i,s){if("function"!=typeof n)throw new TypeError("The listener must be a function");var a=new o(n,i||e,s),u=r?r+t:t;return e._events[u]?e._events[u].fn?e._events[u]=[e._events[u],a]:e._events[u].push(a):(e._events[u]=a,e._eventsCount++),e}function s(e,t){0==--e._eventsCount?e._events=new n:delete e._events[t]}function a(){this._events=new n,this._eventsCount=0}Object.create&&(n.prototype=Object.create(null),(new n).__proto__||(r=!1)),a.prototype.eventNames=function(){var e,n,o=[];if(0===this._eventsCount)return o;for(n in e=this._events)t.call(e,n)&&o.push(r?n.slice(1):n);return Object.getOwnPropertySymbols?o.concat(Object.getOwnPropertySymbols(e)):o},a.prototype.listeners=function(e){var t=r?r+e:e,n=this._events[t];if(!n)return[];if(n.fn)return[n.fn];for(var o=0,i=n.length,s=new Array(i);o<i;o++)s[o]=n[o].fn;return s},a.prototype.listenerCount=function(e){var t=r?r+e:e,n=this._events[t];return n?n.fn?1:n.length:0},a.prototype.emit=function(e,t,n,o,i,s){var a=r?r+e:e;if(!this._events[a])return!1;var u,c,l=this._events[a],p=arguments.length;if(l.fn){switch(l.once&&this.removeListener(e,l.fn,void 0,!0),p){case 1:return l.fn.call(l.context),!0;case 2:return l.fn.call(l.context,t),!0;case 3:return l.fn.call(l.context,t,n),!0;case 4:return l.fn.call(l.context,t,n,o),!0;case 5:return l.fn.call(l.context,t,n,o,i),!0;case 6:return l.fn.call(l.context,t,n,o,i,s),!0}for(c=1,u=new Array(p-1);c<p;c++)u[c-1]=arguments[c];l.fn.apply(l.context,u)}else{var f,h=l.length;for(c=0;c<h;c++)switch(l[c].once&&this.removeListener(e,l[c].fn,void 0,!0),p){case 1:l[c].fn.call(l[c].context);break;case 2:l[c].fn.call(l[c].context,t);break;case 3:l[c].fn.call(l[c].context,t,n);break;case 4:l[c].fn.call(l[c].context,t,n,o);break;default:if(!u)for(f=1,u=new Array(p-1);f<p;f++)u[f-1]=arguments[f];l[c].fn.apply(l[c].context,u)}}return!0},a.prototype.on=function(e,t,r){return i(this,e,t,r,!1)},a.prototype.once=function(e,t,r){return i(this,e,t,r,!0)},a.prototype.removeListener=function(e,t,n,o){var i=r?r+e:e;if(!this._events[i])return this;if(!t)return s(this,i),this;var a=this._events[i];if(a.fn)a.fn!==t||o&&!a.once||n&&a.context!==n||s(this,i);else{for(var u=0,c=[],l=a.length;u<l;u++)(a[u].fn!==t||o&&!a[u].once||n&&a[u].context!==n)&&c.push(a[u]);c.length?this._events[i]=1===c.length?c[0]:c:s(this,i)}return this},a.prototype.removeAllListeners=function(e){var t;return e?(t=r?r+e:e,this._events[t]&&s(this,t)):(this._events=new n,this._eventsCount=0),this},a.prototype.off=a.prototype.removeListener,a.prototype.addListener=a.prototype.on,a.prefixed=r,a.EventEmitter=a,e.exports=a},187:e=>{"use strict";var t,r="object"==typeof Reflect?Reflect:null,n=r&&"function"==typeof r.apply?r.apply:function(e,t,r){return Function.prototype.apply.call(e,t,r)};t=r&&"function"==typeof r.ownKeys?r.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var o=Number.isNaN||function(e){return e!=e};function i(){i.init.call(this)}e.exports=i,e.exports.once=function(e,t){return new Promise((function(r,n){function o(r){e.removeListener(t,i),n(r)}function i(){"function"==typeof e.removeListener&&e.removeListener("error",o),r([].slice.call(arguments))}d(e,t,i,{once:!0}),"error"!==t&&function(e,t,r){"function"==typeof e.on&&d(e,"error",t,{once:!0})}(e,o)}))},i.EventEmitter=i,i.prototype._events=void 0,i.prototype._eventsCount=0,i.prototype._maxListeners=void 0;var s=10;function a(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function u(e){return void 0===e._maxListeners?i.defaultMaxListeners:e._maxListeners}function c(e,t,r,n){var o,i,s,c;if(a(r),void 0===(i=e._events)?(i=e._events=Object.create(null),e._eventsCount=0):(void 0!==i.newListener&&(e.emit("newListener",t,r.listener?r.listener:r),i=e._events),s=i[t]),void 0===s)s=i[t]=r,++e._eventsCount;else if("function"==typeof s?s=i[t]=n?[r,s]:[s,r]:n?s.unshift(r):s.push(r),(o=u(e))>0&&s.length>o&&!s.warned){s.warned=!0;var l=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");l.name="MaxListenersExceededWarning",l.emitter=e,l.type=t,l.count=s.length,c=l,console&&console.warn&&console.warn(c)}return e}function l(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function p(e,t,r){var n={fired:!1,wrapFn:void 0,target:e,type:t,listener:r},o=l.bind(n);return o.listener=r,n.wrapFn=o,o}function f(e,t,r){var n=e._events;if(void 0===n)return[];var o=n[t];return void 0===o?[]:"function"==typeof o?r?[o.listener||o]:[o]:r?function(e){for(var t=new Array(e.length),r=0;r<t.length;++r)t[r]=e[r].listener||e[r];return t}(o):y(o,o.length)}function h(e){var t=this._events;if(void 0!==t){var r=t[e];if("function"==typeof r)return 1;if(void 0!==r)return r.length}return 0}function y(e,t){for(var r=new Array(t),n=0;n<t;++n)r[n]=e[n];return r}function d(e,t,r,n){if("function"==typeof e.on)n.once?e.once(t,r):e.on(t,r);else{if("function"!=typeof e.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof e);e.addEventListener(t,(function o(i){n.once&&e.removeEventListener(t,o),r(i)}))}}Object.defineProperty(i,"defaultMaxListeners",{enumerable:!0,get:function(){return s},set:function(e){if("number"!=typeof e||e<0||o(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");s=e}}),i.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},i.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||o(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this},i.prototype.getMaxListeners=function(){return u(this)},i.prototype.emit=function(e){for(var t=[],r=1;r<arguments.length;r++)t.push(arguments[r]);var o="error"===e,i=this._events;if(void 0!==i)o=o&&void 0===i.error;else if(!o)return!1;if(o){var s;if(t.length>0&&(s=t[0]),s instanceof Error)throw s;var a=new Error("Unhandled error."+(s?" ("+s.message+")":""));throw a.context=s,a}var u=i[e];if(void 0===u)return!1;if("function"==typeof u)n(u,this,t);else{var c=u.length,l=y(u,c);for(r=0;r<c;++r)n(l[r],this,t)}return!0},i.prototype.addListener=function(e,t){return c(this,e,t,!1)},i.prototype.on=i.prototype.addListener,i.prototype.prependListener=function(e,t){return c(this,e,t,!0)},i.prototype.once=function(e,t){return a(t),this.on(e,p(this,e,t)),this},i.prototype.prependOnceListener=function(e,t){return a(t),this.prependListener(e,p(this,e,t)),this},i.prototype.removeListener=function(e,t){var r,n,o,i,s;if(a(t),void 0===(n=this._events))return this;if(void 0===(r=n[e]))return this;if(r===t||r.listener===t)0==--this._eventsCount?this._events=Object.create(null):(delete n[e],n.removeListener&&this.emit("removeListener",e,r.listener||t));else if("function"!=typeof r){for(o=-1,i=r.length-1;i>=0;i--)if(r[i]===t||r[i].listener===t){s=r[i].listener,o=i;break}if(o<0)return this;0===o?r.shift():function(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}(r,o),1===r.length&&(n[e]=r[0]),void 0!==n.removeListener&&this.emit("removeListener",e,s||t)}return this},i.prototype.off=i.prototype.removeListener,i.prototype.removeAllListeners=function(e){var t,r,n;if(void 0===(r=this._events))return this;if(void 0===r.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==r[e]&&(0==--this._eventsCount?this._events=Object.create(null):delete r[e]),this;if(0===arguments.length){var o,i=Object.keys(r);for(n=0;n<i.length;++n)"removeListener"!==(o=i[n])&&this.removeAllListeners(o);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(t=r[e]))this.removeListener(e,t);else if(void 0!==t)for(n=t.length-1;n>=0;n--)this.removeListener(e,t[n]);return this},i.prototype.listeners=function(e){return f(this,e,!0)},i.prototype.rawListeners=function(e){return f(this,e,!1)},i.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):h.call(e,t)},i.prototype.listenerCount=h,i.prototype.eventNames=function(){return this._eventsCount>0?t(this._events):[]}},648:e=>{"use strict";var t="Function.prototype.bind called on incompatible ",r=Array.prototype.slice,n=Object.prototype.toString,o="[object Function]";e.exports=function(e){var i=this;if("function"!=typeof i||n.call(i)!==o)throw new TypeError(t+i);for(var s,a=r.call(arguments,1),u=function(){if(this instanceof s){var t=i.apply(this,a.concat(r.call(arguments)));return Object(t)===t?t:this}return i.apply(e,a.concat(r.call(arguments)))},c=Math.max(0,i.length-a.length),l=[],p=0;p<c;p++)l.push("$"+p);if(s=Function("binder","return function ("+l.join(",")+"){ return binder.apply(this,arguments); }")(u),i.prototype){var f=function(){};f.prototype=i.prototype,s.prototype=new f,f.prototype=null}return s}},612:(e,t,r)=>{"use strict";var n=r(648);e.exports=Function.prototype.bind||n},210:(e,t,r)=>{"use strict";var n,o=SyntaxError,i=Function,s=TypeError,a=function(e){try{return i('"use strict"; return ('+e+").constructor;")()}catch(e){}},u=Object.getOwnPropertyDescriptor;if(u)try{u({},"")}catch(e){u=null}var c=function(){throw new s},l=u?function(){try{return c}catch(e){try{return u(arguments,"callee").get}catch(e){return c}}}():c,p=r(405)(),f=Object.getPrototypeOf||function(e){return e.__proto__},h={},y="undefined"==typeof Uint8Array?n:f(Uint8Array),d={"%AggregateError%":"undefined"==typeof AggregateError?n:AggregateError,"%Array%":Array,"%ArrayBuffer%":"undefined"==typeof ArrayBuffer?n:ArrayBuffer,"%ArrayIteratorPrototype%":p?f([][Symbol.iterator]()):n,"%AsyncFromSyncIteratorPrototype%":n,"%AsyncFunction%":h,"%AsyncGenerator%":h,"%AsyncGeneratorFunction%":h,"%AsyncIteratorPrototype%":h,"%Atomics%":"undefined"==typeof Atomics?n:Atomics,"%BigInt%":"undefined"==typeof BigInt?n:BigInt,"%Boolean%":Boolean,"%DataView%":"undefined"==typeof DataView?n:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":"undefined"==typeof Float32Array?n:Float32Array,"%Float64Array%":"undefined"==typeof Float64Array?n:Float64Array,"%FinalizationRegistry%":"undefined"==typeof FinalizationRegistry?n:FinalizationRegistry,"%Function%":i,"%GeneratorFunction%":h,"%Int8Array%":"undefined"==typeof Int8Array?n:Int8Array,"%Int16Array%":"undefined"==typeof Int16Array?n:Int16Array,"%Int32Array%":"undefined"==typeof Int32Array?n:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":p?f(f([][Symbol.iterator]())):n,"%JSON%":"object"==typeof JSON?JSON:n,"%Map%":"undefined"==typeof Map?n:Map,"%MapIteratorPrototype%":"undefined"!=typeof Map&&p?f((new Map)[Symbol.iterator]()):n,"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":"undefined"==typeof Promise?n:Promise,"%Proxy%":"undefined"==typeof Proxy?n:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":"undefined"==typeof Reflect?n:Reflect,"%RegExp%":RegExp,"%Set%":"undefined"==typeof Set?n:Set,"%SetIteratorPrototype%":"undefined"!=typeof Set&&p?f((new Set)[Symbol.iterator]()):n,"%SharedArrayBuffer%":"undefined"==typeof SharedArrayBuffer?n:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":p?f(""[Symbol.iterator]()):n,"%Symbol%":p?Symbol:n,"%SyntaxError%":o,"%ThrowTypeError%":l,"%TypedArray%":y,"%TypeError%":s,"%Uint8Array%":"undefined"==typeof Uint8Array?n:Uint8Array,"%Uint8ClampedArray%":"undefined"==typeof Uint8ClampedArray?n:Uint8ClampedArray,"%Uint16Array%":"undefined"==typeof Uint16Array?n:Uint16Array,"%Uint32Array%":"undefined"==typeof Uint32Array?n:Uint32Array,"%URIError%":URIError,"%WeakMap%":"undefined"==typeof WeakMap?n:WeakMap,"%WeakRef%":"undefined"==typeof WeakRef?n:WeakRef,"%WeakSet%":"undefined"==typeof WeakSet?n:WeakSet},v=function e(t){var r;if("%AsyncFunction%"===t)r=a("async function () {}");else if("%GeneratorFunction%"===t)r=a("function* () {}");else if("%AsyncGeneratorFunction%"===t)r=a("async function* () {}");else if("%AsyncGenerator%"===t){var n=e("%AsyncGeneratorFunction%");n&&(r=n.prototype)}else if("%AsyncIteratorPrototype%"===t){var o=e("%AsyncGenerator%");o&&(r=f(o.prototype))}return d[t]=r,r},m={"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},g=r(612),_=r(642),b=g.call(Function.call,Array.prototype.concat),w=g.call(Function.apply,Array.prototype.splice),A=g.call(Function.call,String.prototype.replace),S=g.call(Function.call,String.prototype.slice),E=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,O=/\\(\\)?/g,P=function(e){var t=S(e,0,1),r=S(e,-1);if("%"===t&&"%"!==r)throw new o("invalid intrinsic syntax, expected closing `%`");if("%"===r&&"%"!==t)throw new o("invalid intrinsic syntax, expected opening `%`");var n=[];return A(e,E,(function(e,t,r,o){n[n.length]=r?A(o,O,"$1"):t||e})),n},T=function(e,t){var r,n=e;if(_(m,n)&&(n="%"+(r=m[n])[0]+"%"),_(d,n)){var i=d[n];if(i===h&&(i=v(n)),void 0===i&&!t)throw new s("intrinsic "+e+" exists, but is not available. Please file an issue!");return{alias:r,name:n,value:i}}throw new o("intrinsic "+e+" does not exist!")};e.exports=function(e,t){if("string"!=typeof e||0===e.length)throw new s("intrinsic name must be a non-empty string");if(arguments.length>1&&"boolean"!=typeof t)throw new s('"allowMissing" argument must be a boolean');var r=P(e),n=r.length>0?r[0]:"",i=T("%"+n+"%",t),a=i.name,c=i.value,l=!1,p=i.alias;p&&(n=p[0],w(r,b([0,1],p)));for(var f=1,h=!0;f<r.length;f+=1){var y=r[f],v=S(y,0,1),m=S(y,-1);if(('"'===v||"'"===v||"`"===v||'"'===m||"'"===m||"`"===m)&&v!==m)throw new o("property names with quotes must have matching quotes");if("constructor"!==y&&h||(l=!0),_(d,a="%"+(n+="."+y)+"%"))c=d[a];else if(null!=c){if(!(y in c)){if(!t)throw new s("base intrinsic for "+e+" exists, but the property is not available.");return}if(u&&f+1>=r.length){var g=u(c,y);c=(h=!!g)&&"get"in g&&!("originalValue"in g.get)?g.get:c[y]}else h=_(c,y),c=c[y];h&&!l&&(d[a]=c)}}return c}},405:(e,t,r)=>{"use strict";var n="undefined"!=typeof Symbol&&Symbol,o=r(419);e.exports=function(){return"function"==typeof n&&"function"==typeof Symbol&&"symbol"==typeof n("foo")&&"symbol"==typeof Symbol("bar")&&o()}},419:e=>{"use strict";e.exports=function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var e={},t=Symbol("test"),r=Object(t);if("string"==typeof t)return!1;if("[object Symbol]"!==Object.prototype.toString.call(t))return!1;if("[object Symbol]"!==Object.prototype.toString.call(r))return!1;for(t in e[t]=42,e)return!1;if("function"==typeof Object.keys&&0!==Object.keys(e).length)return!1;if("function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(e).length)return!1;var n=Object.getOwnPropertySymbols(e);if(1!==n.length||n[0]!==t)return!1;if(!Object.prototype.propertyIsEnumerable.call(e,t))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var o=Object.getOwnPropertyDescriptor(e,t);if(42!==o.value||!0!==o.enumerable)return!1}return!0}},642:(e,t,r)=>{"use strict";var n=r(612);e.exports=n.call(Function.call,Object.prototype.hasOwnProperty)},301:(e,t,r)=>{r(147),e.exports=self.fetch.bind(self)},588:(e,t,r)=>{r(301);const{default:n}=r(860),o=r(693);function i(e,t=[],r="info",o={}){if(!e)throw new TypeError("Invalid URL");this.url=e,this.tags=t,this.level=r,this.maxRetries=o.maxRetries||5,this.concurrency=o.concurrency||25,this.maxMessagesPerSecond=o.maxMessagesPerSecond||10,this.muteConsole=!0===o.muteConsole||!1,this.queue=new n({concurrency:this.concurrency,intervalCap:this.maxMessagesPerSecond,interval:1e3})}i.prototype._sendEvent=function(e){return fetch(this.url,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})},i.prototype.log=function(e,t,r){const n={level:e,fields:r,message:t};if(n["@timestamp"]=(new Date).toISOString(),n["@tags"]=this.tags,"undefined"!=typeof navigator&&(n.navigator={cookieEnabled:navigator.cookieEnabled,geoLocation:navigator.geolocation,language:navigator.language,languages:navigator.languages,online:navigator.onLine,userAgent:navigator.userAgent,platform:navigator.platform,vendor:navigator.vendor}),"undefined"!=typeof location&&(n.location={search:location.search,pathname:location.pathname,hostname:location.hostname,protocol:location.protocol,port:location.port,hash:location.hash,href:location.href}),this.queue.add((()=>o((()=>this._sendEvent(n)),{retries:this.maxRetries}).catch((e=>{console.warn(`Could not send message to Logstash - [${e.message}]`)})))),this.muteConsole)return;const i=r?` - ${JSON.stringify(r)}`:"";switch(e){case"error":console.error(`${t}${i}`);break;case"warn":console.warn(`${t}${i}`);break;default:console.info(`${t}${i}`)}},i.prototype.debug=function(e,t){this.log("debug",e,t)},i.prototype.info=function(e,t){this.log("info",e,t)},i.prototype.warn=function(e,t){this.log("warn",e,t)},i.prototype.error=function(e,t){e instanceof Error?this.log("error",e.message,Object.assign({stack:e.stack},t)):this.log("error",e,t)},e.exports=function(e,t,r,n){return new i(e,t,r,n)}},631:(e,t,r)=>{var n="function"==typeof Map&&Map.prototype,o=Object.getOwnPropertyDescriptor&&n?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,i=n&&o&&"function"==typeof o.get?o.get:null,s=n&&Map.prototype.forEach,a="function"==typeof Set&&Set.prototype,u=Object.getOwnPropertyDescriptor&&a?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,c=a&&u&&"function"==typeof u.get?u.get:null,l=a&&Set.prototype.forEach,p="function"==typeof WeakMap&&WeakMap.prototype?WeakMap.prototype.has:null,f="function"==typeof WeakSet&&WeakSet.prototype?WeakSet.prototype.has:null,h="function"==typeof WeakRef&&WeakRef.prototype?WeakRef.prototype.deref:null,y=Boolean.prototype.valueOf,d=Object.prototype.toString,v=Function.prototype.toString,m=String.prototype.match,g=String.prototype.slice,_=String.prototype.replace,b=String.prototype.toUpperCase,w=String.prototype.toLowerCase,A=RegExp.prototype.test,S=Array.prototype.concat,E=Array.prototype.join,O=Array.prototype.slice,P=Math.floor,T="function"==typeof BigInt?BigInt.prototype.valueOf:null,x=Object.getOwnPropertySymbols,R="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?Symbol.prototype.toString:null,I="function"==typeof Symbol&&"object"==typeof Symbol.iterator,j="function"==typeof Symbol&&Symbol.toStringTag&&(Symbol.toStringTag,1)?Symbol.toStringTag:null,k=Object.prototype.propertyIsEnumerable,C=("function"==typeof Reflect?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(e){return e.__proto__}:null);function N(e,t){if(e===1/0||e===-1/0||e!=e||e&&e>-1e3&&e<1e3||A.call(/e/,t))return t;var r=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if("number"==typeof e){var n=e<0?-P(-e):P(e);if(n!==e){var o=String(n),i=g.call(t,o.length+1);return _.call(o,r,"$&_")+"."+_.call(_.call(i,/([0-9]{3})/g,"$&_"),/_$/,"")}}return _.call(t,r,"$&_")}var L=r(654).custom,U=L&&F(L)?L:null;function q(e,t,r){var n="double"===(r.quoteStyle||t)?'"':"'";return n+e+n}function M(e){return _.call(String(e),/"/g,""")}function B(e){return!("[object Array]"!==H(e)||j&&"object"==typeof e&&j in e)}function F(e){if(I)return e&&"object"==typeof e&&e instanceof Symbol;if("symbol"==typeof e)return!0;if(!e||"object"!=typeof e||!R)return!1;try{return R.call(e),!0}catch(e){}return!1}e.exports=function e(t,r,n,o){var a=r||{};if(D(a,"quoteStyle")&&"single"!==a.quoteStyle&&"double"!==a.quoteStyle)throw new TypeError('option "quoteStyle" must be "single" or "double"');if(D(a,"maxStringLength")&&("number"==typeof a.maxStringLength?a.maxStringLength<0&&a.maxStringLength!==1/0:null!==a.maxStringLength))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var u=!D(a,"customInspect")||a.customInspect;if("boolean"!=typeof u&&"symbol"!==u)throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(D(a,"indent")&&null!==a.indent&&"\t"!==a.indent&&!(parseInt(a.indent,10)===a.indent&&a.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(D(a,"numericSeparator")&&"boolean"!=typeof a.numericSeparator)throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var d=a.numericSeparator;if(void 0===t)return"undefined";if(null===t)return"null";if("boolean"==typeof t)return t?"true":"false";if("string"==typeof t)return G(t,a);if("number"==typeof t){if(0===t)return 1/0/t>0?"0":"-0";var b=String(t);return d?N(t,b):b}if("bigint"==typeof t){var A=String(t)+"n";return d?N(t,A):A}var P=void 0===a.depth?5:a.depth;if(void 0===n&&(n=0),n>=P&&P>0&&"object"==typeof t)return B(t)?"[Array]":"[Object]";var x,L=function(e,t){var r;if("\t"===e.indent)r="\t";else{if(!("number"==typeof e.indent&&e.indent>0))return null;r=E.call(Array(e.indent+1)," ")}return{base:r,prev:E.call(Array(t+1),r)}}(a,n);if(void 0===o)o=[];else if($(o,t)>=0)return"[Circular]";function z(t,r,i){if(r&&(o=O.call(o)).push(r),i){var s={depth:a.depth};return D(a,"quoteStyle")&&(s.quoteStyle=a.quoteStyle),e(t,s,n+1,o)}return e(t,a,n+1,o)}if("function"==typeof t){var J=function(e){if(e.name)return e.name;var t=m.call(v.call(e),/^function\s*([\w$]+)/);return t?t[1]:null}(t),Z=Y(t,z);return"[Function"+(J?": "+J:" (anonymous)")+"]"+(Z.length>0?" { "+E.call(Z,", ")+" }":"")}if(F(t)){var X=I?_.call(String(t),/^(Symbol\(.*\))_[^)]*$/,"$1"):R.call(t);return"object"!=typeof t||I?X:W(X)}if((x=t)&&"object"==typeof x&&("undefined"!=typeof HTMLElement&&x instanceof HTMLElement||"string"==typeof x.nodeName&&"function"==typeof x.getAttribute)){for(var ee="<"+w.call(String(t.nodeName)),te=t.attributes||[],re=0;re<te.length;re++)ee+=" "+te[re].name+"="+q(M(te[re].value),"double",a);return ee+=">",t.childNodes&&t.childNodes.length&&(ee+="..."),ee+"</"+w.call(String(t.nodeName))+">"}if(B(t)){if(0===t.length)return"[]";var ne=Y(t,z);return L&&!function(e){for(var t=0;t<e.length;t++)if($(e[t],"\n")>=0)return!1;return!0}(ne)?"["+K(ne,L)+"]":"[ "+E.call(ne,", ")+" ]"}if(function(e){return!("[object Error]"!==H(e)||j&&"object"==typeof e&&j in e)}(t)){var oe=Y(t,z);return"cause"in t&&!k.call(t,"cause")?"{ ["+String(t)+"] "+E.call(S.call("[cause]: "+z(t.cause),oe),", ")+" }":0===oe.length?"["+String(t)+"]":"{ ["+String(t)+"] "+E.call(oe,", ")+" }"}if("object"==typeof t&&u){if(U&&"function"==typeof t[U])return t[U]();if("symbol"!==u&&"function"==typeof t.inspect)return t.inspect()}if(function(e){if(!i||!e||"object"!=typeof e)return!1;try{i.call(e);try{c.call(e)}catch(e){return!0}return e instanceof Map}catch(e){}return!1}(t)){var ie=[];return s.call(t,(function(e,r){ie.push(z(r,t,!0)+" => "+z(e,t))})),Q("Map",i.call(t),ie,L)}if(function(e){if(!c||!e||"object"!=typeof e)return!1;try{c.call(e);try{i.call(e)}catch(e){return!0}return e instanceof Set}catch(e){}return!1}(t)){var se=[];return l.call(t,(function(e){se.push(z(e,t))})),Q("Set",c.call(t),se,L)}if(function(e){if(!p||!e||"object"!=typeof e)return!1;try{p.call(e,p);try{f.call(e,f)}catch(e){return!0}return e instanceof WeakMap}catch(e){}return!1}(t))return V("WeakMap");if(function(e){if(!f||!e||"object"!=typeof e)return!1;try{f.call(e,f);try{p.call(e,p)}catch(e){return!0}return e instanceof WeakSet}catch(e){}return!1}(t))return V("WeakSet");if(function(e){if(!h||!e||"object"!=typeof e)return!1;try{return h.call(e),!0}catch(e){}return!1}(t))return V("WeakRef");if(function(e){return!("[object Number]"!==H(e)||j&&"object"==typeof e&&j in e)}(t))return W(z(Number(t)));if(function(e){if(!e||"object"!=typeof e||!T)return!1;try{return T.call(e),!0}catch(e){}return!1}(t))return W(z(T.call(t)));if(function(e){return!("[object Boolean]"!==H(e)||j&&"object"==typeof e&&j in e)}(t))return W(y.call(t));if(function(e){return!("[object String]"!==H(e)||j&&"object"==typeof e&&j in e)}(t))return W(z(String(t)));if(!function(e){return!("[object Date]"!==H(e)||j&&"object"==typeof e&&j in e)}(t)&&!function(e){return!("[object RegExp]"!==H(e)||j&&"object"==typeof e&&j in e)}(t)){var ae=Y(t,z),ue=C?C(t)===Object.prototype:t instanceof Object||t.constructor===Object,ce=t instanceof Object?"":"null prototype",le=!ue&&j&&Object(t)===t&&j in t?g.call(H(t),8,-1):ce?"Object":"",pe=(ue||"function"!=typeof t.constructor?"":t.constructor.name?t.constructor.name+" ":"")+(le||ce?"["+E.call(S.call([],le||[],ce||[]),": ")+"] ":"");return 0===ae.length?pe+"{}":L?pe+"{"+K(ae,L)+"}":pe+"{ "+E.call(ae,", ")+" }"}return String(t)};var z=Object.prototype.hasOwnProperty||function(e){return e in this};function D(e,t){return z.call(e,t)}function H(e){return d.call(e)}function $(e,t){if(e.indexOf)return e.indexOf(t);for(var r=0,n=e.length;r<n;r++)if(e[r]===t)return r;return-1}function G(e,t){if(e.length>t.maxStringLength){var r=e.length-t.maxStringLength,n="... "+r+" more character"+(r>1?"s":"");return G(g.call(e,0,t.maxStringLength),t)+n}return q(_.call(_.call(e,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,J),"single",t)}function J(e){var t=e.charCodeAt(0),r={8:"b",9:"t",10:"n",12:"f",13:"r"}[t];return r?"\\"+r:"\\x"+(t<16?"0":"")+b.call(t.toString(16))}function W(e){return"Object("+e+")"}function V(e){return e+" { ? }"}function Q(e,t,r,n){return e+" ("+t+") {"+(n?K(r,n):E.call(r,", "))+"}"}function K(e,t){if(0===e.length)return"";var r="\n"+t.prev+t.base;return r+E.call(e,","+r)+"\n"+t.prev}function Y(e,t){var r=B(e),n=[];if(r){n.length=e.length;for(var o=0;o<e.length;o++)n[o]=D(e,o)?t(e[o],e):""}var i,s="function"==typeof x?x(e):[];if(I){i={};for(var a=0;a<s.length;a++)i["$"+s[a]]=s[a]}for(var u in e)D(e,u)&&(r&&String(Number(u))===u&&u<e.length||I&&i["$"+u]instanceof Symbol||(A.call(/[^\w$]/,u)?n.push(t(u,e)+": "+t(e[u],e)):n.push(u+": "+t(e[u],e))));if("function"==typeof x)for(var c=0;c<s.length;c++)k.call(e,s[c])&&n.push("["+t(s[c])+"]: "+t(e[s[c]],e));return n}},345:e=>{"use strict";e.exports=(e,t)=>(t=t||(()=>{}),e.then((e=>new Promise((e=>{e(t())})).then((()=>e))),(e=>new Promise((e=>{e(t())})).then((()=>{throw e})))))},860:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(729),o=r(40),i=r(506),s=()=>{},a=new o.TimeoutError;t.default=class extends n{constructor(e){var t,r,n,o;if(super(),this._intervalCount=0,this._intervalEnd=0,this._pendingCount=0,this._resolveEmpty=s,this._resolveIdle=s,!("number"==typeof(e=Object.assign({carryoverConcurrencyCount:!1,intervalCap:1/0,interval:0,concurrency:1/0,autoStart:!0,queueClass:i.default},e)).intervalCap&&e.intervalCap>=1))throw new TypeError(`Expected \`intervalCap\` to be a number from 1 and up, got \`${null!==(r=null===(t=e.intervalCap)||void 0===t?void 0:t.toString())&&void 0!==r?r:""}\` (${typeof e.intervalCap})`);if(void 0===e.interval||!(Number.isFinite(e.interval)&&e.interval>=0))throw new TypeError(`Expected \`interval\` to be a finite number >= 0, got \`${null!==(o=null===(n=e.interval)||void 0===n?void 0:n.toString())&&void 0!==o?o:""}\` (${typeof e.interval})`);this._carryoverConcurrencyCount=e.carryoverConcurrencyCount,this._isIntervalIgnored=e.intervalCap===1/0||0===e.interval,this._intervalCap=e.intervalCap,this._interval=e.interval,this._queue=new e.queueClass,this._queueClass=e.queueClass,this.concurrency=e.concurrency,this._timeout=e.timeout,this._throwOnTimeout=!0===e.throwOnTimeout,this._isPaused=!1===e.autoStart}get _doesIntervalAllowAnother(){return this._isIntervalIgnored||this._intervalCount<this._intervalCap}get _doesConcurrentAllowAnother(){return this._pendingCount<this._concurrency}_next(){this._pendingCount--,this._tryToStartAnother(),this.emit("next")}_resolvePromises(){this._resolveEmpty(),this._resolveEmpty=s,0===this._pendingCount&&(this._resolveIdle(),this._resolveIdle=s,this.emit("idle"))}_onResumeInterval(){this._onInterval(),this._initializeIntervalIfNeeded(),this._timeoutId=void 0}_isIntervalPaused(){const e=Date.now();if(void 0===this._intervalId){const t=this._intervalEnd-e;if(!(t<0))return void 0===this._timeoutId&&(this._timeoutId=setTimeout((()=>{this._onResumeInterval()}),t)),!0;this._intervalCount=this._carryoverConcurrencyCount?this._pendingCount:0}return!1}_tryToStartAnother(){if(0===this._queue.size)return this._intervalId&&clearInterval(this._intervalId),this._intervalId=void 0,this._resolvePromises(),!1;if(!this._isPaused){const e=!this._isIntervalPaused();if(this._doesIntervalAllowAnother&&this._doesConcurrentAllowAnother){const t=this._queue.dequeue();return!!t&&(this.emit("active"),t(),e&&this._initializeIntervalIfNeeded(),!0)}}return!1}_initializeIntervalIfNeeded(){this._isIntervalIgnored||void 0!==this._intervalId||(this._intervalId=setInterval((()=>{this._onInterval()}),this._interval),this._intervalEnd=Date.now()+this._interval)}_onInterval(){0===this._intervalCount&&0===this._pendingCount&&this._intervalId&&(clearInterval(this._intervalId),this._intervalId=void 0),this._intervalCount=this._carryoverConcurrencyCount?this._pendingCount:0,this._processQueue()}_processQueue(){for(;this._tryToStartAnother(););}get concurrency(){return this._concurrency}set concurrency(e){if(!("number"==typeof e&&e>=1))throw new TypeError(`Expected \`concurrency\` to be a number from 1 and up, got \`${e}\` (${typeof e})`);this._concurrency=e,this._processQueue()}async add(e,t={}){return new Promise(((r,n)=>{this._queue.enqueue((async()=>{this._pendingCount++,this._intervalCount++;try{const i=void 0===this._timeout&&void 0===t.timeout?e():o.default(Promise.resolve(e()),void 0===t.timeout?this._timeout:t.timeout,(()=>{(void 0===t.throwOnTimeout?this._throwOnTimeout:t.throwOnTimeout)&&n(a)}));r(await i)}catch(e){n(e)}this._next()}),t),this._tryToStartAnother(),this.emit("add")}))}async addAll(e,t){return Promise.all(e.map((async e=>this.add(e,t))))}start(){return this._isPaused?(this._isPaused=!1,this._processQueue(),this):this}pause(){this._isPaused=!0}clear(){this._queue=new this._queueClass}async onEmpty(){if(0!==this._queue.size)return new Promise((e=>{const t=this._resolveEmpty;this._resolveEmpty=()=>{t(),e()}}))}async onIdle(){if(0!==this._pendingCount||0!==this._queue.size)return new Promise((e=>{const t=this._resolveIdle;this._resolveIdle=()=>{t(),e()}}))}get size(){return this._queue.size}sizeBy(e){return this._queue.filter(e).length}get pending(){return this._pendingCount}get isPaused(){return this._isPaused}get timeout(){return this._timeout}set timeout(e){this._timeout=e}}},489:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t,r){let n=0,o=e.length;for(;o>0;){const i=o/2|0;let s=n+i;r(e[s],t)<=0?(n=++s,o-=i+1):o=i}return n}},506:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(489);t.default=class{constructor(){this._queue=[]}enqueue(e,t){const r={priority:(t=Object.assign({priority:0},t)).priority,run:e};if(this.size&&this._queue[this.size-1].priority>=t.priority)return void this._queue.push(r);const o=n.default(this._queue,r,((e,t)=>t.priority-e.priority));this._queue.splice(o,0,r)}dequeue(){const e=this._queue.shift();return null==e?void 0:e.run}filter(e){return this._queue.filter((t=>t.priority===e.priority)).map((e=>e.run))}get size(){return this._queue.length}}},693:(e,t,r)=>{"use strict";const n=r(353),o=["Failed to fetch","NetworkError when attempting to fetch resource.","The Internet connection appears to be offline.","Network request failed"];class i extends Error{constructor(e){super(),e instanceof Error?(this.originalError=e,({message:e}=e)):(this.originalError=new Error(e),this.originalError.stack=this.stack),this.name="AbortError",this.message=e}}const s=(e,t)=>new Promise(((r,s)=>{t={onFailedAttempt:()=>{},retries:10,...t};const a=n.operation(t);a.attempt((async n=>{try{r(await e(n))}catch(e){if(!(e instanceof Error))return void s(new TypeError(`Non-error was thrown: "${e}". You should only throw errors.`));if(e instanceof i)a.stop(),s(e.originalError);else if(e instanceof TypeError&&(u=e.message,!o.includes(u)))a.stop(),s(e);else{((e,t,r)=>{const n=r.retries-(t-1);e.attemptNumber=t,e.retriesLeft=n})(e,n,t);try{await t.onFailedAttempt(e)}catch(e){return void s(e)}a.retry(e)||s(a.mainError())}}var u}))}));e.exports=s,e.exports.default=s,e.exports.AbortError=i},40:(e,t,r)=>{"use strict";const n=r(345);class o extends Error{constructor(e){super(e),this.name="TimeoutError"}}const i=(e,t,r)=>new Promise(((i,s)=>{if("number"!=typeof t||t<0)throw new TypeError("Expected `milliseconds` to be a positive number");if(t===1/0)return void i(e);const a=setTimeout((()=>{if("function"==typeof r){try{i(r())}catch(e){s(e)}return}const n=r instanceof Error?r:new o("string"==typeof r?r:`Promise timed out after ${t} milliseconds`);"function"==typeof e.cancel&&e.cancel(),s(n)}),t);n(e.then(i,s),(()=>{clearTimeout(a)}))}));e.exports=i,e.exports.default=i,e.exports.TimeoutError=o},798:e=>{"use strict";var t=String.prototype.replace,r=/%20/g,n="RFC3986";e.exports={default:n,formatters:{RFC1738:function(e){return t.call(e,r,"+")},RFC3986:function(e){return String(e)}},RFC1738:"RFC1738",RFC3986:n}},129:(e,t,r)=>{"use strict";var n=r(261),o=r(235),i=r(798);e.exports={formats:i,parse:o,stringify:n}},235:(e,t,r)=>{"use strict";var n=r(769),o=Object.prototype.hasOwnProperty,i=Array.isArray,s={allowDots:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decoder:n.decode,delimiter:"&",depth:5,ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictNullHandling:!1},a=function(e){return e.replace(/&#(\d+);/g,(function(e,t){return String.fromCharCode(parseInt(t,10))}))},u=function(e,t){return e&&"string"==typeof e&&t.comma&&e.indexOf(",")>-1?e.split(","):e},c=function(e,t,r,n){if(e){var i=r.allowDots?e.replace(/\.([^.[]+)/g,"[$1]"):e,s=/(\[[^[\]]*])/g,a=r.depth>0&&/(\[[^[\]]*])/.exec(i),c=a?i.slice(0,a.index):i,l=[];if(c){if(!r.plainObjects&&o.call(Object.prototype,c)&&!r.allowPrototypes)return;l.push(c)}for(var p=0;r.depth>0&&null!==(a=s.exec(i))&&p<r.depth;){if(p+=1,!r.plainObjects&&o.call(Object.prototype,a[1].slice(1,-1))&&!r.allowPrototypes)return;l.push(a[1])}return a&&l.push("["+i.slice(a.index)+"]"),function(e,t,r,n){for(var o=n?t:u(t,r),i=e.length-1;i>=0;--i){var s,a=e[i];if("[]"===a&&r.parseArrays)s=[].concat(o);else{s=r.plainObjects?Object.create(null):{};var c="["===a.charAt(0)&&"]"===a.charAt(a.length-1)?a.slice(1,-1):a,l=parseInt(c,10);r.parseArrays||""!==c?!isNaN(l)&&a!==c&&String(l)===c&&l>=0&&r.parseArrays&&l<=r.arrayLimit?(s=[])[l]=o:"__proto__"!==c&&(s[c]=o):s={0:o}}o=s}return o}(l,t,r,n)}};e.exports=function(e,t){var r=function(e){if(!e)return s;if(null!==e.decoder&&void 0!==e.decoder&&"function"!=typeof e.decoder)throw new TypeError("Decoder has to be a function.");if(void 0!==e.charset&&"utf-8"!==e.charset&&"iso-8859-1"!==e.charset)throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var t=void 0===e.charset?s.charset:e.charset;return{allowDots:void 0===e.allowDots?s.allowDots:!!e.allowDots,allowPrototypes:"boolean"==typeof e.allowPrototypes?e.allowPrototypes:s.allowPrototypes,allowSparse:"boolean"==typeof e.allowSparse?e.allowSparse:s.allowSparse,arrayLimit:"number"==typeof e.arrayLimit?e.arrayLimit:s.arrayLimit,charset:t,charsetSentinel:"boolean"==typeof e.charsetSentinel?e.charsetSentinel:s.charsetSentinel,comma:"boolean"==typeof e.comma?e.comma:s.comma,decoder:"function"==typeof e.decoder?e.decoder:s.decoder,delimiter:"string"==typeof e.delimiter||n.isRegExp(e.delimiter)?e.delimiter:s.delimiter,depth:"number"==typeof e.depth||!1===e.depth?+e.depth:s.depth,ignoreQueryPrefix:!0===e.ignoreQueryPrefix,interpretNumericEntities:"boolean"==typeof e.interpretNumericEntities?e.interpretNumericEntities:s.interpretNumericEntities,parameterLimit:"number"==typeof e.parameterLimit?e.parameterLimit:s.parameterLimit,parseArrays:!1!==e.parseArrays,plainObjects:"boolean"==typeof e.plainObjects?e.plainObjects:s.plainObjects,strictNullHandling:"boolean"==typeof e.strictNullHandling?e.strictNullHandling:s.strictNullHandling}}(t);if(""===e||null==e)return r.plainObjects?Object.create(null):{};for(var l="string"==typeof e?function(e,t){var r,c={},l=t.ignoreQueryPrefix?e.replace(/^\?/,""):e,p=t.parameterLimit===1/0?void 0:t.parameterLimit,f=l.split(t.delimiter,p),h=-1,y=t.charset;if(t.charsetSentinel)for(r=0;r<f.length;++r)0===f[r].indexOf("utf8=")&&("utf8=%E2%9C%93"===f[r]?y="utf-8":"utf8=%26%2310003%3B"===f[r]&&(y="iso-8859-1"),h=r,r=f.length);for(r=0;r<f.length;++r)if(r!==h){var d,v,m=f[r],g=m.indexOf("]="),_=-1===g?m.indexOf("="):g+1;-1===_?(d=t.decoder(m,s.decoder,y,"key"),v=t.strictNullHandling?null:""):(d=t.decoder(m.slice(0,_),s.decoder,y,"key"),v=n.maybeMap(u(m.slice(_+1),t),(function(e){return t.decoder(e,s.decoder,y,"value")}))),v&&t.interpretNumericEntities&&"iso-8859-1"===y&&(v=a(v)),m.indexOf("[]=")>-1&&(v=i(v)?[v]:v),o.call(c,d)?c[d]=n.combine(c[d],v):c[d]=v}return c}(e,r):e,p=r.plainObjects?Object.create(null):{},f=Object.keys(l),h=0;h<f.length;++h){var y=f[h],d=c(y,l[y],r,"string"==typeof e);p=n.merge(p,d,r)}return!0===r.allowSparse?p:n.compact(p)}},261:(e,t,r)=>{"use strict";var n=r(478),o=r(769),i=r(798),s=Object.prototype.hasOwnProperty,a={brackets:function(e){return e+"[]"},comma:"comma",indices:function(e,t){return e+"["+t+"]"},repeat:function(e){return e}},u=Array.isArray,c=String.prototype.split,l=Array.prototype.push,p=function(e,t){l.apply(e,u(t)?t:[t])},f=Date.prototype.toISOString,h=i.default,y={addQueryPrefix:!1,allowDots:!1,charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encoder:o.encode,encodeValuesOnly:!1,format:h,formatter:i.formatters[h],indices:!1,serializeDate:function(e){return f.call(e)},skipNulls:!1,strictNullHandling:!1},d={},v=function e(t,r,i,s,a,l,f,h,v,m,g,_,b,w,A){for(var S,E=t,O=A,P=0,T=!1;void 0!==(O=O.get(d))&&!T;){var x=O.get(t);if(P+=1,void 0!==x){if(x===P)throw new RangeError("Cyclic object value");T=!0}void 0===O.get(d)&&(P=0)}if("function"==typeof f?E=f(r,E):E instanceof Date?E=m(E):"comma"===i&&u(E)&&(E=o.maybeMap(E,(function(e){return e instanceof Date?m(e):e}))),null===E){if(s)return l&&!b?l(r,y.encoder,w,"key",g):r;E=""}if("string"==typeof(S=E)||"number"==typeof S||"boolean"==typeof S||"symbol"==typeof S||"bigint"==typeof S||o.isBuffer(E)){if(l){var R=b?r:l(r,y.encoder,w,"key",g);if("comma"===i&&b){for(var I=c.call(String(E),","),j="",k=0;k<I.length;++k)j+=(0===k?"":",")+_(l(I[k],y.encoder,w,"value",g));return[_(R)+"="+j]}return[_(R)+"="+_(l(E,y.encoder,w,"value",g))]}return[_(r)+"="+_(String(E))]}var C,N=[];if(void 0===E)return N;if("comma"===i&&u(E))C=[{value:E.length>0?E.join(",")||null:void 0}];else if(u(f))C=f;else{var L=Object.keys(E);C=h?L.sort(h):L}for(var U=0;U<C.length;++U){var q=C[U],M="object"==typeof q&&void 0!==q.value?q.value:E[q];if(!a||null!==M){var B=u(E)?"function"==typeof i?i(r,q):r:r+(v?"."+q:"["+q+"]");A.set(t,P);var F=n();F.set(d,A),p(N,e(M,B,i,s,a,l,f,h,v,m,g,_,b,w,F))}}return N};e.exports=function(e,t){var r,o=e,c=function(e){if(!e)return y;if(null!==e.encoder&&void 0!==e.encoder&&"function"!=typeof e.encoder)throw new TypeError("Encoder has to be a function.");var t=e.charset||y.charset;if(void 0!==e.charset&&"utf-8"!==e.charset&&"iso-8859-1"!==e.charset)throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var r=i.default;if(void 0!==e.format){if(!s.call(i.formatters,e.format))throw new TypeError("Unknown format option provided.");r=e.format}var n=i.formatters[r],o=y.filter;return("function"==typeof e.filter||u(e.filter))&&(o=e.filter),{addQueryPrefix:"boolean"==typeof e.addQueryPrefix?e.addQueryPrefix:y.addQueryPrefix,allowDots:void 0===e.allowDots?y.allowDots:!!e.allowDots,charset:t,charsetSentinel:"boolean"==typeof e.charsetSentinel?e.charsetSentinel:y.charsetSentinel,delimiter:void 0===e.delimiter?y.delimiter:e.delimiter,encode:"boolean"==typeof e.encode?e.encode:y.encode,encoder:"function"==typeof e.encoder?e.encoder:y.encoder,encodeValuesOnly:"boolean"==typeof e.encodeValuesOnly?e.encodeValuesOnly:y.encodeValuesOnly,filter:o,format:r,formatter:n,serializeDate:"function"==typeof e.serializeDate?e.serializeDate:y.serializeDate,skipNulls:"boolean"==typeof e.skipNulls?e.skipNulls:y.skipNulls,sort:"function"==typeof e.sort?e.sort:null,strictNullHandling:"boolean"==typeof e.strictNullHandling?e.strictNullHandling:y.strictNullHandling}}(t);"function"==typeof c.filter?o=(0,c.filter)("",o):u(c.filter)&&(r=c.filter);var l,f=[];if("object"!=typeof o||null===o)return"";l=t&&t.arrayFormat in a?t.arrayFormat:t&&"indices"in t?t.indices?"indices":"repeat":"indices";var h=a[l];r||(r=Object.keys(o)),c.sort&&r.sort(c.sort);for(var d=n(),m=0;m<r.length;++m){var g=r[m];c.skipNulls&&null===o[g]||p(f,v(o[g],g,h,c.strictNullHandling,c.skipNulls,c.encode?c.encoder:null,c.filter,c.sort,c.allowDots,c.serializeDate,c.format,c.formatter,c.encodeValuesOnly,c.charset,d))}var _=f.join(c.delimiter),b=!0===c.addQueryPrefix?"?":"";return c.charsetSentinel&&("iso-8859-1"===c.charset?b+="utf8=%26%2310003%3B&":b+="utf8=%E2%9C%93&"),_.length>0?b+_:""}},769:(e,t,r)=>{"use strict";var n=r(798),o=Object.prototype.hasOwnProperty,i=Array.isArray,s=function(){for(var e=[],t=0;t<256;++t)e.push("%"+((t<16?"0":"")+t.toString(16)).toUpperCase());return e}(),a=function(e,t){for(var r=t&&t.plainObjects?Object.create(null):{},n=0;n<e.length;++n)void 0!==e[n]&&(r[n]=e[n]);return r};e.exports={arrayToObject:a,assign:function(e,t){return Object.keys(t).reduce((function(e,r){return e[r]=t[r],e}),e)},combine:function(e,t){return[].concat(e,t)},compact:function(e){for(var t=[{obj:{o:e},prop:"o"}],r=[],n=0;n<t.length;++n)for(var o=t[n],s=o.obj[o.prop],a=Object.keys(s),u=0;u<a.length;++u){var c=a[u],l=s[c];"object"==typeof l&&null!==l&&-1===r.indexOf(l)&&(t.push({obj:s,prop:c}),r.push(l))}return function(e){for(;e.length>1;){var t=e.pop(),r=t.obj[t.prop];if(i(r)){for(var n=[],o=0;o<r.length;++o)void 0!==r[o]&&n.push(r[o]);t.obj[t.prop]=n}}}(t),e},decode:function(e,t,r){var n=e.replace(/\+/g," ");if("iso-8859-1"===r)return n.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(n)}catch(e){return n}},encode:function(e,t,r,o,i){if(0===e.length)return e;var a=e;if("symbol"==typeof e?a=Symbol.prototype.toString.call(e):"string"!=typeof e&&(a=String(e)),"iso-8859-1"===r)return escape(a).replace(/%u[0-9a-f]{4}/gi,(function(e){return"%26%23"+parseInt(e.slice(2),16)+"%3B"}));for(var u="",c=0;c<a.length;++c){var l=a.charCodeAt(c);45===l||46===l||95===l||126===l||l>=48&&l<=57||l>=65&&l<=90||l>=97&&l<=122||i===n.RFC1738&&(40===l||41===l)?u+=a.charAt(c):l<128?u+=s[l]:l<2048?u+=s[192|l>>6]+s[128|63&l]:l<55296||l>=57344?u+=s[224|l>>12]+s[128|l>>6&63]+s[128|63&l]:(c+=1,l=65536+((1023&l)<<10|1023&a.charCodeAt(c)),u+=s[240|l>>18]+s[128|l>>12&63]+s[128|l>>6&63]+s[128|63&l])}return u},isBuffer:function(e){return!(!e||"object"!=typeof e||!(e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer(e)))},isRegExp:function(e){return"[object RegExp]"===Object.prototype.toString.call(e)},maybeMap:function(e,t){if(i(e)){for(var r=[],n=0;n<e.length;n+=1)r.push(t(e[n]));return r}return t(e)},merge:function e(t,r,n){if(!r)return t;if("object"!=typeof r){if(i(t))t.push(r);else{if(!t||"object"!=typeof t)return[t,r];(n&&(n.plainObjects||n.allowPrototypes)||!o.call(Object.prototype,r))&&(t[r]=!0)}return t}if(!t||"object"!=typeof t)return[t].concat(r);var s=t;return i(t)&&!i(r)&&(s=a(t,n)),i(t)&&i(r)?(r.forEach((function(r,i){if(o.call(t,i)){var s=t[i];s&&"object"==typeof s&&r&&"object"==typeof r?t[i]=e(s,r,n):t.push(r)}else t[i]=r})),t):Object.keys(r).reduce((function(t,i){var s=r[i];return o.call(t,i)?t[i]=e(t[i],s,n):t[i]=s,t}),s)}}},353:(e,t,r)=>{e.exports=r(846)},846:(e,t,r)=>{var n=r(960);t.operation=function(e){var r=t.timeouts(e);return new n(r,{forever:e&&(e.forever||e.retries===1/0),unref:e&&e.unref,maxRetryTime:e&&e.maxRetryTime})},t.timeouts=function(e){if(e instanceof Array)return[].concat(e);var t={retries:10,factor:2,minTimeout:1e3,maxTimeout:1/0,randomize:!1};for(var r in e)t[r]=e[r];if(t.minTimeout>t.maxTimeout)throw new Error("minTimeout is greater than maxTimeout");for(var n=[],o=0;o<t.retries;o++)n.push(this.createTimeout(o,t));return e&&e.forever&&!n.length&&n.push(this.createTimeout(o,t)),n.sort((function(e,t){return e-t})),n},t.createTimeout=function(e,t){var r=t.randomize?Math.random()+1:1,n=Math.round(r*Math.max(t.minTimeout,1)*Math.pow(t.factor,e));return Math.min(n,t.maxTimeout)},t.wrap=function(e,r,n){if(r instanceof Array&&(n=r,r=null),!n)for(var o in n=[],e)"function"==typeof e[o]&&n.push(o);for(var i=0;i<n.length;i++){var s=n[i],a=e[s];e[s]=function(n){var o=t.operation(r),i=Array.prototype.slice.call(arguments,1),s=i.pop();i.push((function(e){o.retry(e)||(e&&(arguments[0]=o.mainError()),s.apply(this,arguments))})),o.attempt((function(){n.apply(e,i)}))}.bind(e,a),e[s].options=r}}},960:e=>{function t(e,t){"boolean"==typeof t&&(t={forever:t}),this._originalTimeouts=JSON.parse(JSON.stringify(e)),this._timeouts=e,this._options=t||{},this._maxRetryTime=t&&t.maxRetryTime||1/0,this._fn=null,this._errors=[],this._attempts=1,this._operationTimeout=null,this._operationTimeoutCb=null,this._timeout=null,this._operationStart=null,this._timer=null,this._options.forever&&(this._cachedTimeouts=this._timeouts.slice(0))}e.exports=t,t.prototype.reset=function(){this._attempts=1,this._timeouts=this._originalTimeouts.slice(0)},t.prototype.stop=function(){this._timeout&&clearTimeout(this._timeout),this._timer&&clearTimeout(this._timer),this._timeouts=[],this._cachedTimeouts=null},t.prototype.retry=function(e){if(this._timeout&&clearTimeout(this._timeout),!e)return!1;var t=(new Date).getTime();if(e&&t-this._operationStart>=this._maxRetryTime)return this._errors.push(e),this._errors.unshift(new Error("RetryOperation timeout occurred")),!1;this._errors.push(e);var r=this._timeouts.shift();if(void 0===r){if(!this._cachedTimeouts)return!1;this._errors.splice(0,this._errors.length-1),r=this._cachedTimeouts.slice(-1)}var n=this;return this._timer=setTimeout((function(){n._attempts++,n._operationTimeoutCb&&(n._timeout=setTimeout((function(){n._operationTimeoutCb(n._attempts)}),n._operationTimeout),n._options.unref&&n._timeout.unref()),n._fn(n._attempts)}),r),this._options.unref&&this._timer.unref(),!0},t.prototype.attempt=function(e,t){this._fn=e,t&&(t.timeout&&(this._operationTimeout=t.timeout),t.cb&&(this._operationTimeoutCb=t.cb));var r=this;this._operationTimeoutCb&&(this._timeout=setTimeout((function(){r._operationTimeoutCb()}),r._operationTimeout)),this._operationStart=(new Date).getTime(),this._fn(this._attempts)},t.prototype.try=function(e){console.log("Using RetryOperation.try() is deprecated"),this.attempt(e)},t.prototype.start=function(e){console.log("Using RetryOperation.start() is deprecated"),this.attempt(e)},t.prototype.start=t.prototype.try,t.prototype.errors=function(){return this._errors},t.prototype.attempts=function(){return this._attempts},t.prototype.mainError=function(){if(0===this._errors.length)return null;for(var e={},t=null,r=0,n=0;n<this._errors.length;n++){var o=this._errors[n],i=o.message,s=(e[i]||0)+1;e[i]=s,s>=r&&(t=o,r=s)}return t}},478:(e,t,r)=>{"use strict";var n=r(210),o=r(924),i=r(631),s=n("%TypeError%"),a=n("%WeakMap%",!0),u=n("%Map%",!0),c=o("WeakMap.prototype.get",!0),l=o("WeakMap.prototype.set",!0),p=o("WeakMap.prototype.has",!0),f=o("Map.prototype.get",!0),h=o("Map.prototype.set",!0),y=o("Map.prototype.has",!0),d=function(e,t){for(var r,n=e;null!==(r=n.next);n=r)if(r.key===t)return n.next=r.next,r.next=e.next,e.next=r,r};e.exports=function(){var e,t,r,n={assert:function(e){if(!n.has(e))throw new s("Side channel does not contain "+i(e))},get:function(n){if(a&&n&&("object"==typeof n||"function"==typeof n)){if(e)return c(e,n)}else if(u){if(t)return f(t,n)}else if(r)return function(e,t){var r=d(e,t);return r&&r.value}(r,n)},has:function(n){if(a&&n&&("object"==typeof n||"function"==typeof n)){if(e)return p(e,n)}else if(u){if(t)return y(t,n)}else if(r)return function(e,t){return!!d(e,t)}(r,n);return!1},set:function(n,o){a&&n&&("object"==typeof n||"function"==typeof n)?(e||(e=new a),l(e,n,o)):u?(t||(t=new u),h(t,n,o)):(r||(r={key:{},next:null}),function(e,t,r){var n=d(e,t);n?n.value=r:e.next={key:t,next:e.next,value:r}}(r,n,o))}};return n}},147:(e,t,r)=>{"use strict";r.r(t),r.d(t,{Headers:()=>y,Request:()=>w,Response:()=>S,DOMException:()=>O,fetch:()=>P});var n="undefined"!=typeof globalThis&&globalThis||"undefined"!=typeof self&&self||void 0!==n&&n,o="URLSearchParams"in n,i="Symbol"in n&&"iterator"in Symbol,s="FileReader"in n&&"Blob"in n&&function(){try{return new Blob,!0}catch(e){return!1}}(),a="FormData"in n,u="ArrayBuffer"in n;if(u)var c=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],l=ArrayBuffer.isView||function(e){return e&&c.indexOf(Object.prototype.toString.call(e))>-1};function p(e){if("string"!=typeof e&&(e=String(e)),/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(e)||""===e)throw new TypeError('Invalid character in header field name: "'+e+'"');return e.toLowerCase()}function f(e){return"string"!=typeof e&&(e=String(e)),e}function h(e){var t={next:function(){var t=e.shift();return{done:void 0===t,value:t}}};return i&&(t[Symbol.iterator]=function(){return t}),t}function y(e){this.map={},e instanceof y?e.forEach((function(e,t){this.append(t,e)}),this):Array.isArray(e)?e.forEach((function(e){this.append(e[0],e[1])}),this):e&&Object.getOwnPropertyNames(e).forEach((function(t){this.append(t,e[t])}),this)}function d(e){if(e.bodyUsed)return Promise.reject(new TypeError("Already read"));e.bodyUsed=!0}function v(e){return new Promise((function(t,r){e.onload=function(){t(e.result)},e.onerror=function(){r(e.error)}}))}function m(e){var t=new FileReader,r=v(t);return t.readAsArrayBuffer(e),r}function g(e){if(e.slice)return e.slice(0);var t=new Uint8Array(e.byteLength);return t.set(new Uint8Array(e)),t.buffer}function _(){return this.bodyUsed=!1,this._initBody=function(e){var t;this.bodyUsed=this.bodyUsed,this._bodyInit=e,e?"string"==typeof e?this._bodyText=e:s&&Blob.prototype.isPrototypeOf(e)?this._bodyBlob=e:a&&FormData.prototype.isPrototypeOf(e)?this._bodyFormData=e:o&&URLSearchParams.prototype.isPrototypeOf(e)?this._bodyText=e.toString():u&&s&&(t=e)&&DataView.prototype.isPrototypeOf(t)?(this._bodyArrayBuffer=g(e.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):u&&(ArrayBuffer.prototype.isPrototypeOf(e)||l(e))?this._bodyArrayBuffer=g(e):this._bodyText=e=Object.prototype.toString.call(e):this._bodyText="",this.headers.get("content-type")||("string"==typeof e?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):o&&URLSearchParams.prototype.isPrototypeOf(e)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},s&&(this.blob=function(){var e=d(this);if(e)return e;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?d(this)||(ArrayBuffer.isView(this._bodyArrayBuffer)?Promise.resolve(this._bodyArrayBuffer.buffer.slice(this._bodyArrayBuffer.byteOffset,this._bodyArrayBuffer.byteOffset+this._bodyArrayBuffer.byteLength)):Promise.resolve(this._bodyArrayBuffer)):this.blob().then(m)}),this.text=function(){var e,t,r,n=d(this);if(n)return n;if(this._bodyBlob)return e=this._bodyBlob,r=v(t=new FileReader),t.readAsText(e),r;if(this._bodyArrayBuffer)return Promise.resolve(function(e){for(var t=new Uint8Array(e),r=new Array(t.length),n=0;n<t.length;n++)r[n]=String.fromCharCode(t[n]);return r.join("")}(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},a&&(this.formData=function(){return this.text().then(A)}),this.json=function(){return this.text().then(JSON.parse)},this}y.prototype.append=function(e,t){e=p(e),t=f(t);var r=this.map[e];this.map[e]=r?r+", "+t:t},y.prototype.delete=function(e){delete this.map[p(e)]},y.prototype.get=function(e){return e=p(e),this.has(e)?this.map[e]:null},y.prototype.has=function(e){return this.map.hasOwnProperty(p(e))},y.prototype.set=function(e,t){this.map[p(e)]=f(t)},y.prototype.forEach=function(e,t){for(var r in this.map)this.map.hasOwnProperty(r)&&e.call(t,this.map[r],r,this)},y.prototype.keys=function(){var e=[];return this.forEach((function(t,r){e.push(r)})),h(e)},y.prototype.values=function(){var e=[];return this.forEach((function(t){e.push(t)})),h(e)},y.prototype.entries=function(){var e=[];return this.forEach((function(t,r){e.push([r,t])})),h(e)},i&&(y.prototype[Symbol.iterator]=y.prototype.entries);var b=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function w(e,t){if(!(this instanceof w))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');var r,n,o=(t=t||{}).body;if(e instanceof w){if(e.bodyUsed)throw new TypeError("Already read");this.url=e.url,this.credentials=e.credentials,t.headers||(this.headers=new y(e.headers)),this.method=e.method,this.mode=e.mode,this.signal=e.signal,o||null==e._bodyInit||(o=e._bodyInit,e.bodyUsed=!0)}else this.url=String(e);if(this.credentials=t.credentials||this.credentials||"same-origin",!t.headers&&this.headers||(this.headers=new y(t.headers)),this.method=(n=(r=t.method||this.method||"GET").toUpperCase(),b.indexOf(n)>-1?n:r),this.mode=t.mode||this.mode||null,this.signal=t.signal||this.signal,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&o)throw new TypeError("Body not allowed for GET or HEAD requests");if(this._initBody(o),!("GET"!==this.method&&"HEAD"!==this.method||"no-store"!==t.cache&&"no-cache"!==t.cache)){var i=/([?&])_=[^&]*/;i.test(this.url)?this.url=this.url.replace(i,"$1_="+(new Date).getTime()):this.url+=(/\?/.test(this.url)?"&":"?")+"_="+(new Date).getTime()}}function A(e){var t=new FormData;return e.trim().split("&").forEach((function(e){if(e){var r=e.split("="),n=r.shift().replace(/\+/g," "),o=r.join("=").replace(/\+/g," ");t.append(decodeURIComponent(n),decodeURIComponent(o))}})),t}function S(e,t){if(!(this instanceof S))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');t||(t={}),this.type="default",this.status=void 0===t.status?200:t.status,this.ok=this.status>=200&&this.status<300,this.statusText=void 0===t.statusText?"":""+t.statusText,this.headers=new y(t.headers),this.url=t.url||"",this._initBody(e)}w.prototype.clone=function(){return new w(this,{body:this._bodyInit})},_.call(w.prototype),_.call(S.prototype),S.prototype.clone=function(){return new S(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new y(this.headers),url:this.url})},S.error=function(){var e=new S(null,{status:0,statusText:""});return e.type="error",e};var E=[301,302,303,307,308];S.redirect=function(e,t){if(-1===E.indexOf(t))throw new RangeError("Invalid status code");return new S(null,{status:t,headers:{location:e}})};var O=n.DOMException;try{new O}catch(e){(O=function(e,t){this.message=e,this.name=t;var r=Error(e);this.stack=r.stack}).prototype=Object.create(Error.prototype),O.prototype.constructor=O}function P(e,t){return new Promise((function(r,o){var i=new w(e,t);if(i.signal&&i.signal.aborted)return o(new O("Aborted","AbortError"));var a=new XMLHttpRequest;function c(){a.abort()}a.onload=function(){var e,t,n={status:a.status,statusText:a.statusText,headers:(e=a.getAllResponseHeaders()||"",t=new y,e.replace(/\r?\n[\t ]+/g," ").split("\r").map((function(e){return 0===e.indexOf("\n")?e.substr(1,e.length):e})).forEach((function(e){var r=e.split(":"),n=r.shift().trim();if(n){var o=r.join(":").trim();t.append(n,o)}})),t)};n.url="responseURL"in a?a.responseURL:n.headers.get("X-Request-URL");var o="response"in a?a.response:a.responseText;setTimeout((function(){r(new S(o,n))}),0)},a.onerror=function(){setTimeout((function(){o(new TypeError("Network request failed"))}),0)},a.ontimeout=function(){setTimeout((function(){o(new TypeError("Network request failed"))}),0)},a.onabort=function(){setTimeout((function(){o(new O("Aborted","AbortError"))}),0)},a.open(i.method,function(e){try{return""===e&&n.location.href?n.location.href:e}catch(t){return e}}(i.url),!0),"include"===i.credentials?a.withCredentials=!0:"omit"===i.credentials&&(a.withCredentials=!1),"responseType"in a&&(s?a.responseType="blob":u&&i.headers.get("Content-Type")&&-1!==i.headers.get("Content-Type").indexOf("application/octet-stream")&&(a.responseType="arraybuffer")),!t||"object"!=typeof t.headers||t.headers instanceof y?i.headers.forEach((function(e,t){a.setRequestHeader(t,e)})):Object.getOwnPropertyNames(t.headers).forEach((function(e){a.setRequestHeader(e,f(t.headers[e]))})),i.signal&&(i.signal.addEventListener("abort",c),a.onreadystatechange=function(){4===a.readyState&&i.signal.removeEventListener("abort",c)}),a.send(void 0===i._bodyInit?null:i._bodyInit)}))}P.polyfill=!0,n.fetch||(n.fetch=P,n.Headers=y,n.Request=w,n.Response=S)},654:()=>{}},t={};function r(n){var o=t[n];if(void 0!==o)return o.exports;var i=t[n]={exports:{}};return e[n].call(i.exports,i,i.exports,r),i.exports}r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var n={};(()=>{"use strict";r.r(n),r.d(n,{AuthComponent:()=>v,AuthContext:()=>c,AuthFlow:()=>U,AuthProvider:()=>l,AuthService:()=>M,Privileges:()=>s,Protected:()=>h,ProtectedContentContext:()=>p,ProtectedContentProvider:()=>f,TenantIds:()=>a,getIdentityProviderFromHostname:()=>i,userHasAccess:()=>u});const e=require("react");var t=r.n(e);const o=require("react-router-dom");function i(e){var t;return null!==(t={"bestseller.digitalvenue.dev":"bestseller","bestseller.digitalvenue.app":"bestseller","bestseller.digitalvenue.training":"bestseller","bestseller.localhost":"bestseller"}[e])&&void 0!==t?t:"touchtech"}class s{}s.UNIVERSAL="universal",s.SHOWROOM_APP="showroom-app",s.MARKETING_ENGINE_APP="marketing-engine-app",s.USER_MANAGEMENT_APP="user-management-app";class a{}function u(e,t,r){if(e)for(const n of e.roles)if(n===`${t}:${r}`||n===`${t}:${s.UNIVERSAL}`||n===`${a.UNIVERSAL}:${r}`||n===`${a.UNIVERSAL}:${s.UNIVERSAL}`)return!0;return!1}a.UNIVERSAL="10000001-c001-0001-0001-000000000000";const c=t().createContext(null),l=({children:r,authService:n,onError:o,onUserIdentified:i})=>{const[s,a]=(0,e.useState)(null);(0,e.useEffect)((()=>{function e(){const e=n.user;e&&(a(e),i(e))}e();const t=()=>{e()};return n.on("userChanged",t).on("error",o),()=>{n.off("userChanged",t).off("error",o)}}),[a,i,n,o]);const u=(0,e.useMemo)((()=>({user:s,authService:n})),[n,s]);return t().createElement(c.Provider,{value:u},r)},p=t().createContext(null),f=({children:r,tenantId:n,privilege:o,unauthorizedPath:i})=>{const s=(0,e.useMemo)((()=>({tenantId:n,privilege:o,unauthorizedPath:i})),[i,o,n]);return t().createElement(p.Provider,{value:s},r)},h=function({skipAuthorization:r,children:n}){const{user:i,authService:s}=(0,e.useContext)(c),{tenantId:a,privilege:l,unauthorizedPath:f}=(0,e.useContext)(p);return i?r||u(i,a,l)?n:t().createElement(o.Navigate,{to:f}):(s.signIn(),null)};var y=r(129),d=r.n(y);const v=function({basename:t}){const r=(0,o.useNavigate)(),n=(0,o.useLocation)(),{authService:i,user:s}=(0,e.useContext)(c);return(0,e.useEffect)((()=>{if(s){const{state:e}=d().parse(n.search,{ignoreQueryPrefix:!0});if(null!=e&&e.startsWith(t)){const n=e.substring(t.length);r(n)}else r("/")}}),[t,r,n.search,s]),(0,e.useEffect)((()=>{i.completeSignInIfPossible()}),[i]),null};function m(e,t,r,n){return new(r||(r=Promise))((function(o,i){function s(e){try{u(n.next(e))}catch(e){i(e)}}function a(e){try{u(n.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))}Object.create,Object.create;var g=r(588),_=r.n(g);function b(){let e=window.sessionStorage.getItem("clientId");return e||(e=((e=21)=>{let t="",r=crypto.getRandomValues(new Uint8Array(e));for(;e--;){let n=63&r[e];t+=n<36?n.toString(36):n<62?(n-26).toString(36).toUpperCase():n<63?"_":"-"}return t})(),window.sessionStorage.setItem("clientId",e),e)}class w{constructor(e,t){const r="development"===t?"debug":"info",n=["app",t,`clientId-${b()}`];this._logstash=_()(e,n,r)}static get instance(){if(!w.s_instance)throw new Error("Logger has not been initialized");return w.s_instance}static initialize(e,t){if(w.s_instance)throw new Error("Logger has already been initialized");w.s_instance=new w(e,t)}debug(e,t){this._logstash.debug(e,t)}info(e,t){this._logstash.info(e,t)}warn(e,t){this._logstash.warn(e,t)}error(e,t){this._logstash.error(e,t)}}var A=r(187),S=r.n(A);function E(e){this.message=e}E.prototype=new Error,E.prototype.name="InvalidCharacterError";var O="undefined"!=typeof window&&window.atob&&window.atob.bind(window)||function(e){var t=String(e).replace(/=+$/,"");if(t.length%4==1)throw new E("'atob' failed: The string to be decoded is not correctly encoded.");for(var r,n,o=0,i=0,s="";n=t.charAt(i++);~n&&(r=o%4?64*r+n:n,o++%4)?s+=String.fromCharCode(255&r>>(-2*o&6)):0)n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(n);return s};function P(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"Illegal base64url string!"}try{return function(e){return decodeURIComponent(O(e).replace(/(.)/g,(function(e,t){var r=t.charCodeAt(0).toString(16).toUpperCase();return r.length<2&&(r="0"+r),"%"+r})))}(t)}catch(e){return O(t)}}function T(e){this.message=e}T.prototype=new Error,T.prototype.name="InvalidTokenError";var x=r(438),R=r(394),I=r(373),j=r(892),k=r(551),C=r(298),N=r(865);class L extends N.BasicQueryStringUtils{parse(e){return super.parse(e,!1)}}class U extends A.EventEmitter{constructor(e){super(),this._configuration=e,this._notifier=new R.AuthorizationNotifier,this._authorizationHandler=new N.RedirectRequestHandler(new N.LocalStorageBackend,new L),this._tokenHandler=new k.BaseTokenRequestHandler(U.s_requestor),this._authorizationHandler.setAuthorizationNotifier(this._notifier),this._notifier.setAuthorizationListener(this.authorizationListener.bind(this))}initialize(){this.loadState()}authorizationListener(e,t,r){return m(this,void 0,void 0,(function*(){if(console.debug("Authorization request complete",e,t,r),t){let r;e.internal&&e.internal.code_verifier&&(r=e.internal.code_verifier),yield this.makeTokenRequest(t.code,r),this.emit("tokenResponse")}}))}signIn(e,t=!1){return m(this,void 0,void 0,(function*(){this.isSignedIn()?t&&(this.signOutCore(),yield this.makeAuthorizationRequest(e)):yield this.makeAuthorizationRequest(e)}))}completeSignInIfPossible(){return m(this,void 0,void 0,(function*(){yield this._authorizationHandler.completeAuthorizationRequestIfPossible()}))}isSignedIn(){return!!this._tokenResponse&&this._tokenResponse.isValid()}getAccessToken(){return m(this,void 0,void 0,(function*(){if(this._tokenResponse&&this._tokenResponse.isValid())return this._tokenResponse.accessToken;if(this._refreshTokenPromise)return yield this._refreshTokenPromise;{if(!this._tokenResponse)return null;let e;try{this._refreshTokenPromise=this.refreshToken(),e=yield this._refreshTokenPromise}finally{this._refreshTokenPromise=void 0}return e}}))}signOut(){return m(this,void 0,void 0,(function*(){const e=this._tokenResponse.idToken;this.signOutCore();const t=yield this.ensureServiceConfiguration(),r=this._configuration.postLogoutRedirectUri,n=`${t.endSessionEndpoint}?id_token_hint=${e}&post_logout_redirect_uri=${r}`;console.debug(`[AuthFlow] Signing out using post_logout_redirect_uri '${r}' (full endSession URL: '${n}') ...`),window.location.assign(n)}))}signOutCore(){this._tokenResponse=void 0,window.sessionStorage.removeItem(U.TOKEN_RESPONSE_KEY)}makeAuthorizationRequest(e){return m(this,void 0,void 0,(function*(){const t={idp:e},r=new x.AuthorizationRequest({client_id:this._configuration.clientId,redirect_uri:this._configuration.redirectUri,scope:this._configuration.scope,response_type:x.AuthorizationRequest.RESPONSE_TYPE_CODE,state:`${window.location.pathname}${window.location.search}`,extras:t});this._authorizationHandler.performAuthorizationRequest(yield this.ensureServiceConfiguration(),r)}))}ensureServiceConfiguration(){return m(this,void 0,void 0,(function*(){if(!this._serviceConfiguration){const e=yield I.AuthorizationServiceConfiguration.fetchFromIssuer(this._configuration.openIdIssuerUrl,U.s_requestor);this._serviceConfiguration=e}return this._serviceConfiguration}))}saveState(){window.sessionStorage.setItem(U.TOKEN_RESPONSE_KEY,JSON.stringify(this._tokenResponse.toJson()))}loadState(){const e=window.sessionStorage.getItem(U.TOKEN_RESPONSE_KEY);if(null!=e){const t=JSON.parse(e),r=new C.TokenResponse(t);this._tokenResponse=r,this.emit("tokenResponse")}}makeTokenRequest(e,t){return m(this,void 0,void 0,(function*(){const r={};t&&(r.code_verifier=t);const n=new j.TokenRequest({code:e,extras:r,client_id:this._configuration.clientId,redirect_uri:this._configuration.redirectUri,grant_type:j.GRANT_TYPE_AUTHORIZATION_CODE,refresh_token:void 0}),o=yield this._tokenHandler.performTokenRequest(yield this.ensureServiceConfiguration(),n);this._tokenResponse=o,this.saveState()}))}refreshToken(){return m(this,void 0,void 0,(function*(){console.debug("Refreshing token ...");const e=this._tokenResponse.refreshToken;this._tokenResponse=void 0,window.sessionStorage.removeItem(U.TOKEN_RESPONSE_KEY);const t=new j.TokenRequest({client_id:this._configuration.clientId,redirect_uri:this._configuration.redirectUri,grant_type:j.GRANT_TYPE_REFRESH_TOKEN,refresh_token:e,code:void 0,extras:void 0}),r=yield this._tokenHandler.performTokenRequest(yield this.ensureServiceConfiguration(),t);return this._tokenResponse=r,this.saveState(),console.debug("Refreshed token --\x3e",r),r.accessToken}))}}U.TOKEN_RESPONSE_KEY="AuthFlow:tokenResponse",U.s_requestor=new N.FetchRequestor;class q{}q.EMAIL="email",q.GIVEN_NAME="given_name",q.FAMILY_NAME="family_name",q.ROLE="http://schemas.microsoft.com/ws/2008/06/identity/claims/role";class M extends(S()){constructor(e){super(),this._auth=new U(e),this._auth.on("tokenResponse",this.handleTokenResponse.bind(this)),this._auth.initialize()}static get instance(){if(!M.s_instance)throw new Error("AuthService has not been initialized");return M.s_instance}static initialize(e){if(M.s_instance)throw new Error("AuthService has already been initialized");M.s_instance=new M(e)}setUser(e){this._user!==e&&(this._user=e,this.emit("userChanged"))}handleTokenResponse(){return m(this,void 0,void 0,(function*(){try{this.setUser(yield this.getUser())}catch(e){this.emit("error",e)}}))}getUser(){return m(this,void 0,void 0,(function*(){const e=function(e,t){if("string"!=typeof e)throw new T("Invalid token specified");var r=!0===(t=t||{}).header?0:1;try{return JSON.parse(P(e.split(".")[r]))}catch(e){throw new T("Invalid token specified: "+e.message)}}(yield this.getAccessToken()),t=e[q.EMAIL],r=e[q.GIVEN_NAME],n=e[q.FAMILY_NAME],o=e[q.ROLE];return{email:t,firstName:r,lastName:n,roles:Array.isArray(o)?o:[o]}}))}get user(){return this._user}signIn(e=!1){return m(this,void 0,void 0,(function*(){try{const t=i(window.location.hostname);console.debug(`[AuthService] Using identity provider '${t}' ...`),yield this._auth.signIn(t,e)}catch(e){this.emit("error",e)}}))}completeSignInIfPossible(){return m(this,void 0,void 0,(function*(){try{yield this._auth.completeSignInIfPossible()}catch(e){this.emit("error",e)}}))}getAccessToken(){return m(this,void 0,void 0,(function*(){try{return yield this._auth.getAccessToken()}catch(e){return w.instance.error(e.message,e),this.emit("error",e),null}}))}signOut(){return m(this,void 0,void 0,(function*(){try{yield this._auth.signOut()}catch(e){this.emit("error",e)}}))}}})();var o=exports;for(var i in n)o[i]=n[i];n.__esModule&&Object.defineProperty(o,"__esModule",{value:!0})})();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@touchtech/web-auth",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"description": "DSR Auth",
|
|
5
5
|
"source": "index.ts",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -13,11 +13,13 @@
|
|
|
13
13
|
"dev": "webpack watch",
|
|
14
14
|
"lint": "eslint --ext .jsx,.js,.tsx,.ts src/",
|
|
15
15
|
"check": "npm run lint && npm run test",
|
|
16
|
+
"precommit": "lint-staged",
|
|
16
17
|
"prepublishOnly": "npm run check && npm run build",
|
|
17
18
|
"prepublish": "npm run build",
|
|
18
19
|
"test": "jest --passWithNoTests",
|
|
19
20
|
"format": "npm run tool-prettier --list-different \"**/*.{css,html,js,ts,tsx,json}\"",
|
|
20
|
-
"tool-prettier": "prettier --ignore-path .gitignore"
|
|
21
|
+
"tool-prettier": "prettier --ignore-path .gitignore",
|
|
22
|
+
"prepare": "husky install"
|
|
21
23
|
},
|
|
22
24
|
"repository": {
|
|
23
25
|
"type": "git",
|
|
@@ -33,8 +35,8 @@
|
|
|
33
35
|
},
|
|
34
36
|
"homepage": "https://github.com/TouchtechAB/web-auth#readme",
|
|
35
37
|
"peerDependencies": {
|
|
36
|
-
"
|
|
37
|
-
"
|
|
38
|
+
"@touchtech/web-logging": "^0.0.6",
|
|
39
|
+
"react-router-dom": "^6.2.1"
|
|
38
40
|
},
|
|
39
41
|
"devDependencies": {
|
|
40
42
|
"@testing-library/jest-dom": "^5.14.1",
|
|
@@ -54,8 +56,10 @@
|
|
|
54
56
|
"eslint-plugin-prettier": "^4.0.0",
|
|
55
57
|
"eslint-plugin-react": "^7.24.0",
|
|
56
58
|
"eslint-plugin-react-hooks": "^4.2.0",
|
|
59
|
+
"husky": "^7.0.4",
|
|
57
60
|
"identity-obj-proxy": "^3.0.0",
|
|
58
61
|
"jest": "^27.0.6",
|
|
62
|
+
"lint-staged": "^12.3.1",
|
|
59
63
|
"prettier": "^2.3.2",
|
|
60
64
|
"react": "^17.0.2",
|
|
61
65
|
"react-dom": "^17.0.2",
|
|
@@ -67,11 +71,9 @@
|
|
|
67
71
|
},
|
|
68
72
|
"dependencies": {
|
|
69
73
|
"@openid/appauth": "^1.3.1",
|
|
70
|
-
"@touchtech/web-logging": "^0.0.6",
|
|
71
74
|
"jwt-decode": "^3.1.2",
|
|
72
75
|
"qs": "^6.10.1",
|
|
73
76
|
"react": "^17.0.2",
|
|
74
|
-
"react-dom": "^17.0.2"
|
|
75
|
-
"react-router-dom": "^6.2.1"
|
|
77
|
+
"react-dom": "^17.0.2"
|
|
76
78
|
}
|
|
77
79
|
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
declare type ProtectedRouteProps = {
|
|
3
|
-
skipAuthorization?: boolean;
|
|
4
|
-
children: React.ReactElement;
|
|
5
|
-
};
|
|
6
|
-
declare function ProtectedRoute({ skipAuthorization, children }: ProtectedRouteProps): JSX.Element;
|
|
7
|
-
export default ProtectedRoute;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default as ProtectedRoute } from "./ProtectedRoute";
|