diff --git a/dist/index.js b/dist/index.js
index 5562d0e716ee0512c54759d0293aee48d3810c2f..11764344100930797bc921405a206fa7e60087bc 100644
--- a/dist/index.js
+++ b/dist/index.js
@@ -1,2 +1,2 @@
 /*! For license information please see index.js.LICENSE.txt */
-(()=>{var t={65591:(t,e,r)=>{"use strict";r.r(e),r.d(e,{CordovaIFrameNavigator:()=>i.CordovaIFrameNavigator,CordovaPopupNavigator:()=>i.CordovaPopupNavigator,InMemoryWebStorage:()=>i.InMemoryWebStorage,Log:()=>i.Log,OidcClient:()=>i.OidcClient,SessionMonitor:()=>i.SessionMonitor,User:()=>i.User,UserManager:()=>i.UserManager,Version:()=>i.Version,WebStorageStateStore:()=>i.WebStorageStateStore,clearOidcPersistentStorage:()=>M,createDpopHeader:()=>y,decodeJwt:()=>d,generateJwkForDpop:()=>v,generateJwkRsa:()=>b,getBearerToken:()=>_,getDpopToken:()=>S,privateJwkToPublicJwk:()=>p,registerClient:()=>c,removeOidcQueryParam:()=>E,signJwt:()=>l,validateIdToken:()=>f});var i=r(64671),n=r(80835),o=r(21217),s=r(49704),a=r.n(s),u=r(72045);const h=(t,e={})=>{const{sorted:r,skipIndex:i,ignorenull:n,skipBracket:o,useDot:s,whitespace:a="+"}=e,u=t=>String(t).replace(/[^ !'()~*]/gu,encodeURIComponent).replace(/ /g,a).replace(/[!'()~*]/g,(t=>`%${t.charCodeAt().toString(16).slice(-2).toUpperCase()}`)),h=(t,e=Object.keys(t))=>r?e.sort():e,c=t=>t.filter((t=>t)).join("&"),f=(t,e,r=typeof e,a=null)=>(e===a?a=n?a:u(t)+"="+a:/string|number|boolean/.test(r)?a=u(t)+"="+u(e):Array.isArray(e)?a=((t,e,r=(o?"":"[]"))=>e.length?c(e.map(((e,n)=>f(i?t+r:t+"["+n+"]",e)))):u(t+r))(t,e):e instanceof Set?a=((t,e)=>c(Array.from(e).map((e=>f(t,e)))))(t,e):"object"===r&&(a=((t,e)=>c(h(e).map((r=>f(s?`${t}.${r}`:`${t}[${r}]`,e[r])))))(t,e)),a);return t&&c(h(t).map((e=>f(e,t[e]))))};async function c(t,e){var r;if(!e.registrationEndpoint)throw new Error("Dynamic Registration could not be completed because the issuer has no registration endpoint.");if(!Array.isArray(e.idTokenSigningAlgValuesSupported))throw new Error("The OIDC issuer discovery profile is missing the 'id_token_signing_alg_values_supported' value, which is mandatory.");const i=(0,n.determineSigningAlg)(e.idTokenSigningAlgValuesSupported,n.PREFERRED_SIGNING_ALG),o={client_name:t.clientName,application_type:"web",redirect_uris:[null===(r=t.redirectUrl)||void 0===r?void 0:r.toString()],subject_type:"pairwise",token_endpoint_auth_method:"client_secret_basic",id_token_signed_response_alg:i},s={"Content-Type":"application/json"};t.registrationAccessToken&&(s.Authorization=`Bearer ${t.registrationAccessToken}`);const a=await fetch(e.registrationEndpoint.toString(),{method:"POST",headers:s,body:JSON.stringify(o)});if(a.ok){const e=await a.json();return function(t,e){if(void 0===t.client_id)throw new Error(`Dynamic client registration failed: no client_id has been found on ${JSON.stringify(t)}`);if(e.redirectUrl&&(void 0===t.redirect_uris||t.redirect_uris[0]!==e.redirectUrl.toString()))throw new Error(`Dynamic client registration failed: the returned redirect URIs ${JSON.stringify(t.redirect_uris)} don't match the provided ${JSON.stringify([e.redirectUrl.toString()])}`)}(e,t),{clientId:e.client_id,clientSecret:e.client_secret,idTokenSignedResponseAlg:e.id_token_signed_response_alg}}throw 400===a.status&&function(t,e){var r,i,n,o;if("invalid_redirect_uri"===t.error)throw new Error(`Dynamic client registration failed: the provided redirect uri [${null===(r=e.redirectUrl)||void 0===r?void 0:r.toString()}] is invalid - ${null!==(i=t.error_description)&&void 0!==i?i:""}`);if("invalid_client_metadata"===t.error)throw new Error(`Dynamic client registration failed: the provided client metadata ${JSON.stringify(e)} is invalid - ${null!==(n=t.error_description)&&void 0!==n?n:""}`);throw new Error(`Dynamic client registration failed: ${t.error} - ${null!==(o=t.error_description)&&void 0!==o?o:""}`)}(await a.json(),t),new Error(`Dynamic client registration failed: the server returned ${a.status} ${a.statusText} - ${await a.text()}`)}async function f(t,e,r,i){const n=e.keys[0],s=await o.JWK.asKey(n);try{a().verify(t,s.toPEM(!1),{issuer:r,audience:i,algorithms:["ES256","RS256"]})}catch(t){return!1}return!0}async function l(t,e,r){const i=(await o.JWK.asKey(e)).toPEM(!0);return a().sign(t,i,r)}async function d(t,e,r){if(e){const i=(await o.JWK.asKey(e)).toPEM(!1);return a().verify(t,i,r)}return a().decode(t)}async function p(t){return await o.JWK.asKey(t,"public")}function g(t){const e=new URL(t);return e.hash="",e.username="",e.password="",e.toString()}async function y(t,e,r){return l({htu:g(t),htm:e.toUpperCase(),jti:(0,u.Z)()},r,{header:{jwk:await p(r),typ:"dpop+jwt"},algorithm:"ES256"})}async function m(t,e,r){return(await o.JWK.createKey(t,e,r)).toJSON(!0)}async function v(){return m("EC","P-256",{alg:"ES256"})}async function b(){return m("RSA")}async function w(t){const e=await d(t);if((void 0===(r=e).sub||"string"!=typeof r.sub||void 0===r.iss||"string"!=typeof r.iss||r.webid)&&"string"!=typeof r.webid)throw new Error(`Invalid ID token: ${JSON.stringify(e)} is missing 'sub' or 'iss' claims`);var r;if(e.webid)return e.webid;try{new URL(e.sub)}catch(t){throw new Error(`Cannot extract WebID from ID token: the ID token returned by [${e.iss}] has no 'webid' claim, nor an IRI-like 'sub' claim: [${e.sub}]. Attempting to construct a URL from the 'sub' claim threw: ${t}`)}return e.sub}async function _(t){let e;try{e=await new i.OidcClient({response_mode:"query",loadUserInfo:!1}).processSigninResponse(t)}catch(e){throw new Error(`Problem handling Auth Code Grant (Flow) redirect - URL [${t}]: ${e}`)}const r=await w(e.id_token);return{accessToken:e.access_token,idToken:e.id_token,webId:r,refreshToken:e.refresh_token}}async function S(t,e,r){return async function(t,e,r,i){!function(t,e){if(e.grantType&&(!t.grantTypesSupported||!t.grantTypesSupported.includes(e.grantType)))throw new Error(`The issuer [${t.issuer}] does not support the [${e.grantType}] grant`);if(!t.tokenEndpoint)throw new Error(`This issuer [${t.issuer}] does not have a token endpoint`)}(t,r);const n={"content-type":"application/x-www-form-urlencoded"};let o;i&&(o=await v(),n.DPoP=await y(t.tokenEndpoint,"POST",o)),e.clientSecret&&(n.Authorization=`Basic ${btoa(`${e.clientId}:${e.clientSecret}`)}`);const s={method:"POST",headers:n,body:h({grant_type:r.grantType,redirect_uri:r.redirectUrl,code:r.code,code_verifier:r.codeVerifier,client_id:e.clientId})},a=function(t,e){if(void 0!==(r=t).error&&"string"==typeof r.error)throw new Error(`Token endpoint returned error [${t.error}]${function(t){return void 0!==t.error_description&&"string"==typeof t.error_description}(t)?`: ${t.error_description}`:""}${function(t){return void 0!==t.error_uri&&"string"==typeof t.error_uri}(t)?` (see ${t.error_uri})`:""}`);var r;if(!function(t){return void 0!==t.access_token&&"string"==typeof t.access_token}(t))throw new Error(`Invalid token endpoint response (missing the field 'access_token'): ${JSON.stringify(t)}`);if(!function(t){return void 0!==t.id_token&&"string"==typeof t.id_token}(t))throw new Error(`Invalid token endpoint response (missing the field 'id_token'): ${JSON.stringify(t)}.`);if(!function(t){return void 0!==t.token_type&&"string"==typeof t.token_type}(t))throw new Error(`Invalid token endpoint response (missing the field 'token_type'): ${JSON.stringify(t)}`);if(!function(t){return void 0===t.expires_in||"number"==typeof t.expires_in}(t))throw new Error(`Invalid token endpoint response (invalid field 'expires_in'): ${JSON.stringify(t)}`);if(!e&&"bearer"!==t.token_type.toLowerCase())throw new Error(`Invalid token endpoint response: requested a [Bearer] token, but got a 'token_type' value of [${t.token_type}].`);return t}(await(await fetch(t.tokenEndpoint,s)).json(),i),u=await w(a.id_token);return{accessToken:a.access_token,idToken:a.id_token,refreshToken:(c=a,void 0!==c.refresh_token&&"string"==typeof c.refresh_token?a.refresh_token:void 0),webId:u,dpopJwk:o,expiresIn:a.expires_in};var c}(t,e,r,!0)}function E(t){const e=new URL(t);return e.searchParams.delete("code"),e.searchParams.delete("state"),e.hash="",e.toString()}async function M(){const t=new i.OidcClient({response_mode:"query"});await t.clearStaleState(new i.WebStorageStateStore({}));const e=window.localStorage,r=[];for(let t=0;t<=e.length;t+=1){const i=e.key(t);i&&(i.match(/^oidc\..+$/)||i.match(/^solidClientAuthenticationUser:.+$/))&&r.push(i)}r.forEach((t=>e.removeItem(t)))}},70143:function(t,e,r){"use strict";var i=this&&this.__decorate||function(t,e,r,i){var n,o=arguments.length,s=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,r):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,r,i);else for(var a=t.length-1;a>=0;a--)(n=t[a])&&(s=(o<3?n(s):o>3?n(e,r,s):n(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},n=this&&this.__metadata||function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},o=this&&this.__param||function(t,e){return function(r,i){e(r,i,t)}};Object.defineProperty(e,"__esModule",{value:!0}),r(28660);const s=r(62899),a=r(65591),u=r(33783),h=r(94377),c=(t,e)=>window.fetch(t,e);let f=class{constructor(t,e,r,i,n){this.loginHandler=t,this.redirectHandler=e,this.logoutHandler=r,this.sessionInfoManager=i,this.issuerConfigFetcher=n,this.login=async t=>{var e,r;await this.sessionInfoManager.clear(t.sessionId);const i=a.removeOidcQueryParam(null!==(e=t.redirectUrl)&&void 0!==e?e:window.location.href);await this.loginHandler.handle({...t,redirectUrl:i,clientName:null!==(r=t.clientName)&&void 0!==r?r:t.clientId})},this.fetch=c,this.logout=async t=>{await this.logoutHandler.handle(t),this.fetch=c},this.getSessionInfo=async t=>this.sessionInfoManager.get(t),this.getAllSessionInfo=async()=>this.sessionInfoManager.getAll(),this.validateCurrentSession=async()=>{const t=window.localStorage.getItem(u.KEY_CURRENT_SESSION);if(null===t)return null;const e=await this.sessionInfoManager.get(t);if(void 0===e||void 0===e.idToken||void 0===e.clientAppId||void 0===e.issuer)return null;const r=await this.issuerConfigFetcher.fetchConfig(e.issuer);try{const t=await h.getJwks(r);if(await a.validateIdToken(e.idToken,t,e.issuer,e.clientAppId))return e}catch(t){}return null},this.handleIncomingRedirect=async t=>{const e=await this.redirectHandler.handle(t);this.fetch=e.fetch;const r=new URL(t);return r.searchParams.delete("state"),r.searchParams.delete("code"),r.searchParams.delete("id_token"),r.searchParams.delete("access_token"),window.history.replaceState(null,"",r.toString()),{isLoggedIn:e.isLoggedIn,webId:e.webId,sessionId:e.sessionId,expirationDate:e.expirationDate}}}};f=i([s.injectable(),o(0,s.inject("browser:loginHandler")),o(1,s.inject("browser:redirectHandler")),o(2,s.inject("browser:logoutHandler")),o(3,s.inject("browser:sessionInfoManager")),o(4,s.inject("browser:issuerConfigFetcher")),n("design:paramtypes",[Object,Object,Object,Object,Object])],f),e.default=f},83598:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Session=e.silentlyAuthenticate=void 0;const i=r(17187),n=r(78410),o=r(93537),s=r(33783),a=r(2464);async function u(t,e,r={inIframe:!1}){var i;const n=await e.validateCurrentSession();return null!==n&&(window.localStorage.setItem(s.KEY_CURRENT_URL,window.location.href),await e.login({sessionId:t,prompt:"none",oidcIssuer:n.issuer,redirectUrl:n.redirectUrl,clientId:n.clientAppId,clientSecret:n.clientAppSecret,tokenType:null!==(i=n.tokenType)&&void 0!==i?i:"DPoP",inIframe:r.inIframe}),!0)}function h(t){return!!(null==t?void 0:t.isLoggedIn)}e.silentlyAuthenticate=u;class c extends i.EventEmitter{constructor(t={},e){super(),this.tokenRequestInProgress=!1,this.tmpFetchWithCookies=!1,this.login=async t=>{var e;return await this.clientAuthentication.login({sessionId:this.info.sessionId,...t,tokenType:null!==(e=t.tokenType)&&void 0!==e?e:"DPoP"}),new Promise((()=>{}))},this.fetch=async(t,e)=>this.clientAuthentication.fetch(t,{...e,credentials:this.tmpFetchWithCookies?"include":null==e?void 0:e.credentials}),this.logout=async()=>{await this.clientAuthentication.logout(this.info.sessionId),this.info.isLoggedIn=!1,this.tmpFetchWithCookies=!1,this.emit("logout")},this.handleIncomingRedirect=async(t={})=>{var e;if(this.info.isLoggedIn)return this.info;if(this.tokenRequestInProgress)return;const r="string"==typeof t?{url:t}:t,i=null!==(e=r.url)&&void 0!==e?e:window.location.href;if(null!==window.frameElement)return void a.postRedirectUrlToParent(i);!0!==r.useEssSession||!0===r.restorePreviousSession?window.localStorage.setItem("tmp-resource-server-session-enabled","false"):window.localStorage.setItem("tmp-resource-server-session-enabled","true");const n=window.localStorage.getItem("tmp-resource-server-session-info");if("string"==typeof n&&!0!==r.restorePreviousSession&&!0===r.useEssSession){const t=JSON.parse(n);if(function(t){var e;const r=Object.keys(null!==(e=t.sessions)&&void 0!==e?e:{});return"string"==typeof t.webId&&r.length>0&&"number"==typeof t.sessions[r[0]].expiration}(t)){const e=Object.keys(t.sessions),r=new URL(t.webId).hostname,i=e.find((t=>new URL(t).hostname===r)),n=null!=i?i:e[0];if(t.sessions[n].expiration-Date.now()>3e5)return this.info.isLoggedIn=!0,this.info.webId=t.webId,this.tmpFetchWithCookies=!0,this.info}}this.tokenRequestInProgress=!0;const o=await this.clientAuthentication.handleIncomingRedirect(i);if(h(o)){this.setSessionInfo(o);const t=window.localStorage.getItem(s.KEY_CURRENT_URL);null===t?this.emit("login"):(window.localStorage.removeItem(s.KEY_CURRENT_URL),this.emit("sessionRestore",t))}else if(!0===r.restorePreviousSession){const t=window.localStorage.getItem(s.KEY_CURRENT_SESSION);if(null!==t&&await u(t,this.clientAuthentication))return new Promise((()=>{}))}return this.tokenRequestInProgress=!1,o},t.clientAuthentication?this.clientAuthentication=t.clientAuthentication:t.secureStorage&&t.insecureStorage?this.clientAuthentication=o.getClientAuthenticationWithDependencies({secureStorage:t.secureStorage,insecureStorage:t.insecureStorage}):this.clientAuthentication=o.getClientAuthenticationWithDependencies({}),t.sessionInfo?this.info={sessionId:t.sessionInfo.sessionId,isLoggedIn:!1,webId:t.sessionInfo.webId}:this.info={sessionId:null!=e?e:n.v4(),isLoggedIn:!1},a.setupIframeListener((async t=>{const e=await this.clientAuthentication.handleIncomingRedirect(t);h(e)&&this.setSessionInfo(e)})),this.on("tokenRenewal",(()=>u(this.info.sessionId,this.clientAuthentication,{inIframe:!0})))}onLogin(t){this.on("login",t)}onLogout(t){this.on("logout",t)}onSessionRestore(t){this.on("sessionRestore",t)}setSessionInfo(t){this.info.isLoggedIn=t.isLoggedIn,this.info.webId=t.webId,this.info.sessionId=t.sessionId,this.info.expirationDate=t.expirationDate,"number"==typeof t.expirationDate&&setTimeout((async()=>{await this.logout()}),t.expirationDate-Date.now())}}e.Session=c},24429:function(t,e,r){"use strict";var i=this&&this.__decorate||function(t,e,r,i){var n,o=arguments.length,s=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,r):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,r,i);else for(var a=t.length-1;a>=0;a--)(n=t[a])&&(s=(o<3?n(s):o>3?n(e,r,s):n(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},n=this&&this.__metadata||function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};Object.defineProperty(e,"__esModule",{value:!0}),e.SessionManager=void 0;const o=r(17187),s=r(62899),a=r(83598),u=r(93537);let h=class extends o.EventEmitter{constructor(t={}){super(),this.sessionRecords={},this.isInitialized=!1,this.handledIncomingRedirect=!1,this.clientAuthn=u.getClientAuthenticationWithDependencies({secureStorage:t.secureStorage,insecureStorage:t.insecureStorage})}async init(){this.isInitialized||(await this.handleIncomingRedirect(window.location.href),this.isInitialized=!0)}addNewSessionRecord(t){const e=()=>{this.emit("sessionLogout",t)};return t.onLogout(e),this.sessionRecords[t.info.sessionId]={session:t,logoutCallback:e},t}getSessionFromCurrentSessionInfo(t){const e=this.sessionRecords[t.sessionId];return e?(e.session.info.webId=t.webId,e.session.info.isLoggedIn=t.isLoggedIn,e.session):this.addNewSessionRecord(new a.Session({clientAuthentication:this.clientAuthn,sessionInfo:t}))}async getSessions(){return await this.init(),(await this.clientAuthn.getAllSessionInfo()).map((t=>this.getSessionFromCurrentSessionInfo(t)))}async getSession(t){let e;if(await this.init(),t){const r=await this.clientAuthn.getSessionInfo(t);e=r?this.getSessionFromCurrentSessionInfo(r):this.addNewSessionRecord(new a.Session({clientAuthentication:this.clientAuthn},t))}else e=this.addNewSessionRecord(new a.Session({clientAuthentication:this.clientAuthn}));return e}async hasSession(t){return await this.init(),void 0!==await this.clientAuthn.getSessionInfo(t)}onSessionLogin(t){this.on("sessionLogin",t)}onSessionLogout(t){this.on("sessionLogout",t)}detachSession(t){const e=this.sessionRecords[t];e&&(e.session.removeListener("onLogout",e.logoutCallback),delete this.sessionRecords[t])}async handleIncomingRedirect(t){const e=await this.clientAuthn.handleIncomingRedirect(t);if(e){const t=this.getSessionFromCurrentSessionInfo(e);return this.emit("sessionLogin",t),t.emit("login"),t}}};h=i([s.injectable(),n("design:paramtypes",[Object])],h),e.SessionManager=h},83502:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.buildDpopFetch=e.buildBearerFetch=void 0;const i=r(65591);async function n(t,e,r,n){var o;return{...n,headers:{...null==n?void 0:n.headers,Authorization:`DPoP ${e}`,DPoP:await i.createDpopHeader(t,null!==(o=null==n?void 0:n.method)&&void 0!==o?o:"get",r)},credentials:"include"}}e.buildBearerFetch=function(t,e){return(e,r)=>fetch(e,{...r,credentials:"include",headers:{...null==r?void 0:r.headers,Authorization:`Bearer ${t}`}})},e.buildDpopFetch=async function(t,e,r){return async(e,i)=>{const o=await fetch(e,await n(e.toString(),t,r,i)),s=!o.ok&&(a=o.status,![401,403].includes(a));var a;const u=o.url!==e;return o.ok||s||!u?o:fetch(o.url,await n(o.url,t,r,i))}}},33783:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.KEY_CURRENT_URL=e.KEY_CURRENT_SESSION=void 0;const i=r(80835);e.KEY_CURRENT_SESSION=`${i.SOLID_CLIENT_AUTHN_KEY_PREFIX}currentSession`,e.KEY_CURRENT_URL=`${i.SOLID_CLIENT_AUTHN_KEY_PREFIX}currentUrl`},37814:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.onSessionRestore=e.onLogout=e.onLogin=e.handleIncomingRedirect=e.logout=e.login=e.fetch=e.getDefaultSession=void 0;const i=r(83598);let n;function o(){return void 0===n&&(n=new i.Session),n}e.getDefaultSession=o,e.fetch=(...t)=>o().fetch(...t),e.login=(...t)=>o().login(...t),e.logout=(...t)=>o().logout(...t),e.handleIncomingRedirect=(...t)=>o().handleIncomingRedirect(...t),e.onLogin=(...t)=>o().onLogin(...t),e.onLogout=(...t)=>o().onLogout(...t),e.onSessionRestore=(...t)=>o().onSessionRestore(...t)},93537:function(t,e,r){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.getClientAuthenticationWithDependencies=void 0,r(28660);const n=r(62899),o=r(80835),s=i(r(20437)),a=i(r(70143)),u=i(r(62018)),h=i(r(2258)),c=i(r(10496)),f=i(r(21590)),l=i(r(34656)),d=i(r(30189)),p=i(r(73064)),g=i(r(87564)),y=i(r(94377)),m=r(35220),v=i(r(72186)),b=r(63624),w=r(4520),_=i(r(55912)),S=i(r(55394)),E=i(r(62536)),M=i(r(27826)),A=r(24429),C=i(r(27570)),k=n.container;k.register("browser:storageUtility",{useClass:s.default}),k.register("browser:sessionInfoManager",{useClass:b.SessionInfoManager}),k.register("browser:sessionManager",{useClass:A.SessionManager}),k.register("browser:loginHandler",{useClass:C.default}),k.register("browser:loginHandlers",{useClass:u.default}),k.register("browser:oidcHandler",{useClass:h.default}),k.register("browser:oidcHandlers",{useClass:g.default}),k.register("browser:oidcHandlers",{useClass:c.default}),k.register("browser:oidcHandlers",{useClass:f.default}),k.register("browser:oidcHandlers",{useClass:l.default}),k.register("browser:oidcHandlers",{useClass:d.default}),k.register("browser:oidcHandlers",{useClass:p.default}),k.register("browser:redirector",{useClass:E.default}),k.register("browser:clientRegistrar",{useClass:M.default}),k.register("browser:redirectHandler",{useClass:_.default}),k.register("browser:redirectHandlers",{useClass:w.AuthCodeRedirectHandler}),k.register("browser:redirectHandlers",{useClass:m.FallbackRedirectHandler}),k.register("browser:issuerConfigFetcher",{useClass:y.default}),k.register("browser:logoutHandler",{useClass:v.default}),e.getClientAuthenticationWithDependencies=function(t){const e=t.secureStorage||new o.InMemoryStorage,r=t.insecureStorage||new S.default,i=k.createChildContainer();return i.register("browser:secureStorage",{useValue:e}),i.register("browser:insecureStorage",{useValue:r}),i.resolve(a.default)}},2464:(t,e)=>{"use strict";let r;function i(){return void 0===r&&(r=window.document.createElement("iframe"),r.setAttribute("hidden","true"),r.setAttribute("sandbox","allow-scripts allow-same-origin")),r}Object.defineProperty(e,"__esModule",{value:!0}),e.postRedirectUrlToParent=e.setupIframeListener=e.redirectInIframe=void 0,e.redirectInIframe=function(t){const e=i();window.document.body.appendChild(e),e.src=t},e.setupIframeListener=function(t){"undefined"!=typeof window&&window.addEventListener("message",(async e=>{const r=i();e.origin===window.location.origin&&e.source===r.contentWindow&&"string"==typeof e.data.redirectUrl&&await t(e.data.redirectUrl),window.document.body.contains(r)&&window.document.body.removeChild(r)}))},e.postRedirectUrlToParent=function(t){window.top.postMessage({redirectUrl:t},window.location.origin)}},94305:function(t,e,r){"use strict";var i=this&&this.__createBinding||(Object.create?function(t,e,r,i){void 0===i&&(i=r),Object.defineProperty(t,i,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,i){void 0===i&&(i=r),t[i]=e[r]}),n=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||i(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),e.InMemoryStorage=e.ConfigurationError=e.NotImplementedError=e.getClientAuthenticationWithDependencies=e.SessionManager=e.Session=void 0;var o=r(83598);Object.defineProperty(e,"Session",{enumerable:!0,get:function(){return o.Session}});var s=r(24429);Object.defineProperty(e,"SessionManager",{enumerable:!0,get:function(){return s.SessionManager}});var a=r(93537);Object.defineProperty(e,"getClientAuthenticationWithDependencies",{enumerable:!0,get:function(){return a.getClientAuthenticationWithDependencies}}),n(r(37814),e);var u=r(80835);Object.defineProperty(e,"NotImplementedError",{enumerable:!0,get:function(){return u.NotImplementedError}}),Object.defineProperty(e,"ConfigurationError",{enumerable:!0,get:function(){return u.ConfigurationError}}),Object.defineProperty(e,"InMemoryStorage",{enumerable:!0,get:function(){return u.InMemoryStorage}})},27570:function(t,e,r){"use strict";var i=this&&this.__decorate||function(t,e,r,i){var n,o=arguments.length,s=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,r):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,r,i);else for(var a=t.length-1;a>=0;a--)(n=t[a])&&(s=(o<3?n(s):o>3?n(e,r,s):n(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},n=this&&this.__metadata||function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},o=this&&this.__param||function(t,e){return function(r,i){e(r,i,t)}};Object.defineProperty(e,"__esModule",{value:!0});const s=r(62899),a=r(80835);let u=class extends a.AggregateHandler{constructor(t){super(t)}};u=i([s.injectable(),o(0,s.injectAll("browser:loginHandlers")),n("design:paramtypes",[Array])],u),e.default=u},2258:function(t,e,r){"use strict";var i=this&&this.__decorate||function(t,e,r,i){var n,o=arguments.length,s=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,r):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,r,i);else for(var a=t.length-1;a>=0;a--)(n=t[a])&&(s=(o<3?n(s):o>3?n(e,r,s):n(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},n=this&&this.__metadata||function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},o=this&&this.__param||function(t,e){return function(r,i){e(r,i,t)}};Object.defineProperty(e,"__esModule",{value:!0});const s=r(62899),a=r(80835);let u=class extends a.AggregateHandler{constructor(t){super(t)}};u=i([s.injectable(),o(0,s.injectAll("browser:oidcHandlers")),n("design:paramtypes",[Array])],u),e.default=u},27826:function(t,e,r){"use strict";var i=this&&this.__decorate||function(t,e,r,i){var n,o=arguments.length,s=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,r):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,r,i);else for(var a=t.length-1;a>=0;a--)(n=t[a])&&(s=(o<3?n(s):o>3?n(e,r,s):n(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},n=this&&this.__metadata||function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},o=this&&this.__param||function(t,e){return function(r,i){e(r,i,t)}};Object.defineProperty(e,"__esModule",{value:!0});const s=r(62899),a=r(65591);let u=class{constructor(t){this.storageUtility=t}async getClient(t,e){var r;const[i,n]=await Promise.all([this.storageUtility.getForUser(t.sessionId,"clientId",{secure:!1}),this.storageUtility.getForUser(t.sessionId,"clientSecret",{secure:!1})]);if(i)return{clientId:i,clientSecret:n};const o={...t};o.registrationAccessToken=null!==(r=o.registrationAccessToken)&&void 0!==r?r:await this.storageUtility.getForUser(t.sessionId,"registrationAccessToken");try{const t=await a.registerClient(o,e),r={clientId:t.clientId};return t.clientSecret&&(r.clientSecret=t.clientSecret),t.idTokenSignedResponseAlg&&(r.idTokenSignedResponseAlg=t.idTokenSignedResponseAlg),await this.storageUtility.setForUser(o.sessionId,r,{secure:!1}),t}catch(t){throw new Error(`Client registration failed: [${t.toString()}]`)}}};u=i([s.injectable(),o(0,s.inject("browser:storageUtility")),n("design:paramtypes",[Object])],u),e.default=u},94377:function(t,e,r){"use strict";var i,n=this&&this.__decorate||function(t,e,r,i){var n,o=arguments.length,s=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,r):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,r,i);else for(var a=t.length-1;a>=0;a--)(n=t[a])&&(s=(o<3?n(s):o>3?n(e,r,s):n(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},o=this&&this.__metadata||function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},s=this&&this.__param||function(t,e){return function(r,i){e(r,i,t)}};Object.defineProperty(e,"__esModule",{value:!0}),e.getJwks=e.WELL_KNOWN_OPENID_CONFIG=void 0;const a=r(80835),u=r(62899),h=r(37226);e.WELL_KNOWN_OPENID_CONFIG=".well-known/openid-configuration";const c={issuer:{toKey:"issuer",convertToUrl:!0},authorization_endpoint:{toKey:"authorizationEndpoint",convertToUrl:!0},token_endpoint:{toKey:"tokenEndpoint",convertToUrl:!0},userinfo_endpoint:{toKey:"userinfoEndpoint",convertToUrl:!0},jwks_uri:{toKey:"jwksUri",convertToUrl:!0},registration_endpoint:{toKey:"registrationEndpoint",convertToUrl:!0},scopes_supported:{toKey:"scopesSupported"},response_types_supported:{toKey:"responseTypesSupported"},response_modes_supported:{toKey:"responseModesSupported"},grant_types_supported:{toKey:"grantTypesSupported"},acr_values_supported:{toKey:"acrValuesSupported"},subject_types_supported:{toKey:"subjectTypesSupported"},id_token_signing_alg_values_supported:{toKey:"idTokenSigningAlgValuesSupported"},id_token_encryption_alg_values_supported:{toKey:"idTokenEncryptionAlgValuesSupported"},id_token_encryption_enc_values_supported:{toKey:"idTokenEncryptionEncValuesSupported"},userinfo_signing_alg_values_supported:{toKey:"userinfoSigningAlgValuesSupported"},userinfo_encryption_alg_values_supported:{toKey:"userinfoEncryptionAlgValuesSupported"},userinfo_encryption_enc_values_supported:{toKey:"userinfoEncryptionEncValuesSupported"},request_object_signing_alg_values_supported:{toKey:"requestObjectSigningAlgValuesSupported"},request_object_encryption_alg_values_supported:{toKey:"requestObjectEncryptionAlgValuesSupported"},request_object_encryption_enc_values_supported:{toKey:"requestObjectEncryptionEncValuesSupported"},token_endpoint_auth_methods_supported:{toKey:"tokenEndpointAuthMethodsSupported"},token_endpoint_auth_signing_alg_values_supported:{toKey:"tokenEndpointAuthSigningAlgValuesSupported"},display_values_supported:{toKey:"displayValuesSupported"},claim_types_supported:{toKey:"claimTypesSupported"},claims_supported:{toKey:"claimsSupported"},service_documentation:{toKey:"serviceDocumentation"},claims_locales_supported:{toKey:"claimsLocalesSupported"},ui_locales_supported:{toKey:"uiLocalesSupported"},claims_parameter_supported:{toKey:"claimsParameterSupported"},request_parameter_supported:{toKey:"requestParameterSupported"},request_uri_parameter_supported:{toKey:"requestUriParameterSupported"},require_request_uri_registration:{toKey:"requireRequestUriRegistration"},op_policy_uri:{toKey:"opPolicyUri",convertToUrl:!0},op_tos_uri:{toKey:"opTosUri",convertToUrl:!0},solid_oidc_supported:{toKey:"solidOidcSupported"}};e.getJwks=async function(t){return(await fetch(t.jwksUri)).json()};let f=i=class{constructor(t){this.storageUtility=t}static getLocalStorageKey(t){return`issuerConfig:${t}`}async fetchConfig(t){let r;const n=h.appendToUrlPathname(t,e.WELL_KNOWN_OPENID_CONFIG),o=await window.fetch(n);try{r=function(t){const e={};return Object.keys(t).forEach((r=>{c[r]&&(e[c[r].toKey]=t[r])})),e}(await o.json())}catch(e){throw new a.ConfigurationError(`[${t.toString()}] has an invalid configuration: ${e.message}`)}return await this.storageUtility.set(i.getLocalStorageKey(t),JSON.stringify(r)),r}};f=i=n([u.injectable(),s(0,u.inject("browser:storageUtility")),o("design:paramtypes",[Object])],f),e.default=f},62018:function(t,e,r){"use strict";var i=this&&this.__decorate||function(t,e,r,i){var n,o=arguments.length,s=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,r):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,r,i);else for(var a=t.length-1;a>=0;a--)(n=t[a])&&(s=(o<3?n(s):o>3?n(e,r,s):n(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},n=this&&this.__metadata||function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},o=this&&this.__param||function(t,e){return function(r,i){e(r,i,t)}};Object.defineProperty(e,"__esModule",{value:!0});const s=r(62899),a=r(80835);function u(t){return"string"==typeof t.oidcIssuer}function h(t){return"string"==typeof t.redirectUrl}let c=class{constructor(t,e,r,i){this.storageUtility=t,this.oidcHandler=e,this.issuerConfigFetcher=r,this.clientRegistrar=i}async canHandle(t){return u(t)&&h(t)}async handle(t){if(!u(t))throw new a.ConfigurationError(`OidcLoginHandler requires an OIDC issuer: missing property 'oidcIssuer' in ${JSON.stringify(t)}`);if(!h(t))throw new a.ConfigurationError(`OidcLoginHandler requires a redirect URL: missing property 'redirectUrl' in ${JSON.stringify(t)}`);const e=await this.issuerConfigFetcher.fetchConfig(t.oidcIssuer),r=await a.handleRegistration(t,e,this.storageUtility,this.clientRegistrar),i={issuer:e.issuer,dpop:"dpop"===t.tokenType.toLowerCase(),...t,issuerConfiguration:e,client:r};return this.oidcHandler.handle(i)}};c=i([s.injectable(),o(0,s.inject("browser:storageUtility")),o(1,s.inject("browser:oidcHandler")),o(2,s.inject("browser:issuerConfigFetcher")),o(3,s.inject("browser:clientRegistrar")),n("design:paramtypes",[Object,Object,Object,Object])],c),e.default=c},62536:function(t,e,r){"use strict";var i=this&&this.__decorate||function(t,e,r,i){var n,o=arguments.length,s=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,r):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,r,i);else for(var a=t.length-1;a>=0;a--)(n=t[a])&&(s=(o<3?n(s):o>3?n(e,r,s):n(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s};Object.defineProperty(e,"__esModule",{value:!0});const n=r(62899),o=r(2464);let s=class{redirect(t,e){e&&e.handleRedirect?e.handleRedirect(t):e&&e.redirectByReplacingState?window.history.replaceState({},"",t):(null==e?void 0:e.redirectInIframe)?o.redirectInIframe(t):window.location.href=t}};s=i([n.injectable()],s),e.default=s},10496:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});const i=r(80835);e.default=class{async canHandle(t){return!1}async handle(t){throw new i.NotImplementedError("AuthorizationCodeOidcHandler handle")}}},21590:function(t,e,r){"use strict";var i=this&&this.__decorate||function(t,e,r,i){var n,o=arguments.length,s=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,r):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,r,i);else for(var a=t.length-1;a>=0;a--)(n=t[a])&&(s=(o<3?n(s):o>3?n(e,r,s):n(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},n=this&&this.__metadata||function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},o=this&&this.__param||function(t,e){return function(r,i){e(r,i,t)}};Object.defineProperty(e,"__esModule",{value:!0});const s=r(62899),a=r(65591);let u=class{constructor(t,e){this.storageUtility=t,this.redirector=e}async canHandle(t){return!!(t.issuerConfiguration.grantTypesSupported&&t.issuerConfiguration.grantTypesSupported.indexOf("authorization_code")>-1)}async handle(t){const e={authority:t.issuer.toString(),client_id:t.client.clientId,client_secret:t.client.clientSecret,redirect_uri:t.redirectUrl.toString(),post_logout_redirect_uri:t.redirectUrl.toString(),response_type:"code",scope:"openid webid",filterProtocolClaims:!0,loadUserInfo:!1,code_verifier:!0,prompt:t.prompt},r=new a.OidcClient(e),{redirector:i}=this,n=this.storageUtility;try{const e=await r.createSigninRequest();await Promise.all([n.setForUser(e.state._id,{sessionId:t.sessionId}),n.setForUser(t.sessionId,{codeVerifier:e.state._code_verifier,issuer:t.issuer.toString(),redirectUrl:t.redirectUrl,dpop:t.dpop?"true":"false"})]),i.redirect(e.url.toString(),{handleRedirect:t.handleRedirect,redirectInIframe:t.inIframe})}catch(t){console.error(t)}}};u=i([s.injectable(),o(0,s.inject("browser:storageUtility")),o(1,s.inject("browser:redirector")),n("design:paramtypes",[Object,Object])],u),e.default=u},34656:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});const i=r(80835);e.default=class{async canHandle(t){return!1}async handle(t){throw new i.NotImplementedError("ClientCredentialsOidcHandler handle")}}},30189:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});const i=r(80835);e.default=class{async canHandle(t){return!1}async handle(t){throw new i.NotImplementedError("PrimaryDeviceOidcHandler handle")}}},87564:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});const i=r(80835);e.default=class{async canHandle(t){return!1}async handle(t){throw new i.NotImplementedError("RefreshTokenOidcHandler handle")}}},73064:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});const i=r(80835);e.default=class{async canHandle(t){return!1}async handle(t){throw new i.NotImplementedError("SecondaryDeviceOidcHandler handle")}}},55912:function(t,e,r){"use strict";var i=this&&this.__decorate||function(t,e,r,i){var n,o=arguments.length,s=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,r):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,r,i);else for(var a=t.length-1;a>=0;a--)(n=t[a])&&(s=(o<3?n(s):o>3?n(e,r,s):n(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},n=this&&this.__metadata||function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},o=this&&this.__param||function(t,e){return function(r,i){e(r,i,t)}};Object.defineProperty(e,"__esModule",{value:!0});const s=r(62899),a=r(80835);let u=class extends a.AggregateHandler{constructor(t){super(t)}};u=i([s.injectable(),o(0,s.injectAll("browser:redirectHandlers")),n("design:paramtypes",[Array])],u),e.default=u},4520:function(t,e,r){"use strict";var i=this&&this.__decorate||function(t,e,r,i){var n,o=arguments.length,s=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,r):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,r,i);else for(var a=t.length-1;a>=0;a--)(n=t[a])&&(s=(o<3?n(s):o>3?n(e,r,s):n(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},n=this&&this.__metadata||function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},o=this&&this.__param||function(t,e){return function(r,i){e(r,i,t)}};Object.defineProperty(e,"__esModule",{value:!0}),e.AuthCodeRedirectHandler=e.DEFAULT_LIFESPAN=void 0;const s=r(62899),a=r(65591),u=r(83502),h=r(33783),c=r(94377);e.DEFAULT_LIFESPAN=18e5;let f=class{constructor(t,e,r,i){this.storageUtility=t,this.sessionInfoManager=e,this.issuerConfigFetcher=r,this.clientRegistrar=i}async canHandle(t){try{const e=new URL(t);return null!==e.searchParams.get("code")&&null!==e.searchParams.get("state")}catch(e){throw new Error(`[${t}] is not a valid URL, and cannot be used as a redirect URL: ${e.toString()}`)}}async handle(t){if(!await this.canHandle(t))throw new Error(`AuthCodeRedirectHandler cannot handle [${t}]: it is missing one of [code, state].`);const r=new URL(t),i=r.searchParams.get("state"),n=await this.storageUtility.getForUser(i,"sessionId",{errorIfNull:!0}),o="true"===await this.storageUtility.getForUser(n,"dpop"),s=await this.storageUtility.getForUser(n,"issuer",{errorIfNull:!0});window.localStorage.setItem(h.KEY_CURRENT_SESSION,n);const f=await this.issuerConfigFetcher.fetchConfig(s),l=await this.clientRegistrar.getClient({sessionId:n},f);let d,p;const g=Date.now();if(o){const t=await this.storageUtility.getForUser(n,"codeVerifier",{errorIfNull:!0}),e=await this.storageUtility.getForUser(n,"redirectUrl",{errorIfNull:!0});d=await a.getDpopToken(f,l,{grantType:"authorization_code",code:r.searchParams.get("code"),codeVerifier:t,redirectUrl:e}),p=await u.buildDpopFetch(d.accessToken,d.refreshToken,d.dpopJwk)}else d=await a.getBearerToken(r.toString()),p=u.buildBearerFetch(d.accessToken,d.refreshToken);if(!await async function(t,e,r,i){const n=await c.getJwks(t);return a.validateIdToken(i,n,r,e.clientId)}(f,l,s,d.idToken))throw new Error(`Invalid ID token [${d.idToken}]. Possible issues are bad signature, or mismatching audience (expected [${l.clientId}])`);await this.storageUtility.setForUser(n,{refreshToken:"<Refresh token that *is* coming back in the redirect URL is not yet being parsed and provided by oidc-client-js in it's response object>",webId:d.webId,isLoggedIn:"true"},{secure:!0}),r.searchParams.delete("code"),await this.storageUtility.setForUser(n,{redirectUrl:r.toString(),idToken:d.idToken},{secure:!1}),"false"===window.localStorage.getItem("tmp-resource-server-session-enabled")||await async function(t,r,i){const n=new URL(t).origin;await r(t);try{if(200===(await r(`${n}/session`)).status)return void await i.storeResourceServerSessionInfo(t,n,Date.now()+e.DEFAULT_LIFESPAN);await i.clearResourceServerSessionInfo(n)}catch(t){await i.clearResourceServerSessionInfo(n)}}(d.webId,p,this.storageUtility);const y=await this.sessionInfoManager.get(n);if(!y)throw new Error(`Could not retrieve session: [${n}].`);return Object.assign(y,{fetch:p,expirationDate:"number"==typeof d.expiresIn?g+1e3*d.expiresIn:null})}};f=i([s.injectable(),o(0,s.inject("browser:storageUtility")),o(1,s.inject("browser:sessionInfoManager")),o(2,s.inject("browser:issuerConfigFetcher")),o(3,s.inject("browser:clientRegistrar")),n("design:paramtypes",[Object,Object,Object,Object])],f),e.AuthCodeRedirectHandler=f},35220:function(t,e,r){"use strict";var i=this&&this.__decorate||function(t,e,r,i){var n,o=arguments.length,s=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,r):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,r,i);else for(var a=t.length-1;a>=0;a--)(n=t[a])&&(s=(o<3?n(s):o>3?n(e,r,s):n(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s};Object.defineProperty(e,"__esModule",{value:!0}),e.FallbackRedirectHandler=void 0;const n=r(62899),o=r(63624);let s=class{async canHandle(t){try{return new URL(t),!0}catch(e){throw new Error(`[${t}] is not a valid URL, and cannot be used as a redirect URL: ${e.toString()}`)}}async handle(t){return o.getUnauthenticatedSession()}};s=i([n.injectable()],s),e.FallbackRedirectHandler=s},72186:function(t,e,r){"use strict";var i=this&&this.__decorate||function(t,e,r,i){var n,o=arguments.length,s=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,r):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,r,i);else for(var a=t.length-1;a>=0;a--)(n=t[a])&&(s=(o<3?n(s):o>3?n(e,r,s):n(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},n=this&&this.__metadata||function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},o=this&&this.__param||function(t,e){return function(r,i){e(r,i,t)}};Object.defineProperty(e,"__esModule",{value:!0});const s=r(62899);let a=class{constructor(t){this.sessionInfoManager=t}async canHandle(){return!0}async handle(t){await this.sessionInfoManager.clear(t)}};a=i([s.injectable(),o(0,s.inject("browser:sessionInfoManager")),n("design:paramtypes",[Object])],a),e.default=a},63624:function(t,e,r){"use strict";var i=this&&this.__decorate||function(t,e,r,i){var n,o=arguments.length,s=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,r):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,r,i);else for(var a=t.length-1;a>=0;a--)(n=t[a])&&(s=(o<3?n(s):o>3?n(e,r,s):n(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},n=this&&this.__metadata||function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},o=this&&this.__param||function(t,e){return function(r,i){e(r,i,t)}};Object.defineProperty(e,"__esModule",{value:!0}),e.SessionInfoManager=e.clear=e.getUnauthenticatedSession=void 0;const s=r(62899),a=r(80835),u=r(78410),h=r(65591);async function c(t,e){const r=await e.get("tmp-resource-server-session-info"),i=JSON.parse(null!=r?r:"{}"),{webId:n}=i;if(void 0!==n){const t=new URL(n).origin;await e.clearResourceServerSessionInfo(t)}await Promise.all([e.deleteAllUserData(t,{secure:!1}),e.deleteAllUserData(t,{secure:!0}),e.delete("clientKey",{secure:!1})]),await h.clearOidcPersistentStorage()}e.getUnauthenticatedSession=function(){return{isLoggedIn:!1,sessionId:u.v4(),fetch}},e.clear=c;let f=class{constructor(t){this.storageUtility=t}update(t,e){throw new Error("Not Implemented")}async get(t){var e;const r=await this.storageUtility.getForUser(t,"isLoggedIn",{secure:!0}),i=await this.storageUtility.getForUser(t,"webId",{secure:!0}),n=await this.storageUtility.getForUser(t,"clientId",{secure:!1}),o=await this.storageUtility.getForUser(t,"clientSecret",{secure:!1}),s=await this.storageUtility.getForUser(t,"idToken",{secure:!1}),u=await this.storageUtility.getForUser(t,"redirectUrl",{secure:!1}),h=await this.storageUtility.getForUser(t,"refreshToken",{secure:!0}),c=await this.storageUtility.getForUser(t,"issuer",{secure:!1}),f=null!==(e=await this.storageUtility.getForUser(t,"tokenType",{secure:!1}))&&void 0!==e?e:"DPoP";if(!a.isSupportedTokenType(f))throw new Error(`Tokens of type [${f}] are not supported.`);if(void 0!==n||void 0!==s||void 0!==r||void 0!==i||void 0!==h)return{sessionId:t,webId:i,isLoggedIn:"true"===r,redirectUrl:u,idToken:s,refreshToken:h,issuer:c,clientAppId:n,clientAppSecret:o,tokenType:f}}async getAll(){throw new Error("Not implemented")}async clear(t){return c(t,this.storageUtility)}async register(t){throw new Error("Not implemented")}async getRegisteredSessionIdAll(){throw new Error("Not implemented")}async clearAll(){throw new Error("Not implemented")}};f=i([s.injectable(),o(0,s.inject("browser:storageUtility")),n("design:paramtypes",[Object])],f),e.SessionInfoManager=f},55394:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=class{get storage(){return window.localStorage}async get(t){return this.storage.getItem(t)||void 0}async set(t,e){this.storage.setItem(t,e)}async delete(t){this.storage.removeItem(t)}}},20437:function(t,e,r){"use strict";var i=this&&this.__decorate||function(t,e,r,i){var n,o=arguments.length,s=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,r):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,r,i);else for(var a=t.length-1;a>=0;a--)(n=t[a])&&(s=(o<3?n(s):o>3?n(e,r,s):n(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},n=this&&this.__metadata||function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},o=this&&this.__param||function(t,e){return function(r,i){e(r,i,t)}};Object.defineProperty(e,"__esModule",{value:!0});const s=r(62899),a=r(80835);let u=class extends a.StorageUtility{constructor(t,e){super(t,e)}};u=i([s.injectable(),o(0,s.inject("browser:secureStorage")),o(1,s.inject("browser:insecureStorage")),n("design:paramtypes",[Object,Object])],u),e.default=u},37226:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.appendToUrlPathname=void 0,e.appendToUrlPathname=function(t,e){const r=new URL(t),i=r.pathname;return r.pathname=`${i}${i.endsWith("/")?"":"/"}${e.startsWith("/")?e.substring(1):e}`,r.toString()}},34672:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.PREFERRED_SIGNING_ALG=e.SOLID_CLIENT_AUTHN_KEY_PREFIX=void 0,e.SOLID_CLIENT_AUTHN_KEY_PREFIX="solidClientAuthn:",e.PREFERRED_SIGNING_ALG=["ES256","RS256"]},17117:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});class r extends Error{constructor(t){super(t)}}e.default=r},32029:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});class r extends Error{constructor(t,e,i=!0){super("string"==typeof t?r.substituteParams(t,e):r.appendErrorIri(r.lookupErrorIri(t,e),t,i))}httpResponse(t,e=!0){return this.message=r.appendHttpResponseDetails(this.message,t,e),this.httpErrorResponse=t,this}hasHttpResponse(){return void 0!==this.httpErrorResponse}getHttpResponse(){return this.httpErrorResponse}getHttpStatusCode(){if(void 0===this.httpErrorResponse)throw new r("This InruptError was not provided with a HTTP response - so we can't get its HTTP Status Code.");return this.httpErrorResponse.status}getHttpStatusText(){if(void 0===this.httpErrorResponse)throw new r("This InruptError was not provided with a HTTP response - so we can't get its HTTP Status Text!");return this.httpErrorResponse.statusText}static determineIfVocabTerm(t){return void 0!==t.strict}static lookupErrorIri(t,e){if(r.determineIfVocabTerm(t)){const r=void 0===e?t.message:t.messageParams(...e);return void 0===r?`Looked up error message IRI [${t.value}], but found no message value.`:r}return`Error message looked up at: [${t.value}]${void 0===e?"":`, with params [${e.toString()}]`}`}static appendHttpResponseDetails(t,e,r){return r&&void 0!==e?`${t} HTTP details: status code [${e.status}], status text [${e.statusText}].`:t}static appendErrorIri(t,e,r){return r?`${t} Error IRI: [${e.value}].`:t}static substituteParams(t,e){let r=t;if(void 0!==e){const i=t.split("{{").length-1;if(i!==e.length)throw new Error(`Setting parameters on message [${t}], but it requires [${i}] params and we received [${e.length}].`);for(let t=0;t<e.length;t+=1){const i=`{{${t}}}`;r=r.replace(i,e[t])}}return r}}e.default=r},47073:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});class r extends Error{constructor(t){super(`[${t}] is not implemented`)}}e.default=r},80835:function(t,e,r){"use strict";var i=this&&this.__createBinding||(Object.create?function(t,e,r,i){void 0===i&&(i=r),Object.defineProperty(t,i,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,i){void 0===i&&(i=r),t[i]=e[r]}),n=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||i(e,t,r)},o=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.StorageUtilityGetResponse=e.StorageUtilityMock=e.mockStorageUtility=e.mockStorage=e.NotImplementedError=e.ConfigurationError=e.InMemoryStorage=e.getSessionIdFromOauthState=e.saveSessionInfoToStorage=e.loadOidcContextFromStorage=e.StorageUtility=e.determineSigningAlg=e.handleRegistration=e.USER_SESSION_PREFIX=e.isSupportedTokenType=e.AggregateHandler=void 0,n(r(34672),e);var s=r(95024);Object.defineProperty(e,"AggregateHandler",{enumerable:!0,get:function(){return o(s).default}});var a=r(31168);Object.defineProperty(e,"isSupportedTokenType",{enumerable:!0,get:function(){return a.isSupportedTokenType}});var u=r(81645);Object.defineProperty(e,"USER_SESSION_PREFIX",{enumerable:!0,get:function(){return u.USER_SESSION_PREFIX}});var h=r(74725);Object.defineProperty(e,"handleRegistration",{enumerable:!0,get:function(){return h.handleRegistration}}),Object.defineProperty(e,"determineSigningAlg",{enumerable:!0,get:function(){return h.determineSigningAlg}});var c=r(4574);Object.defineProperty(e,"StorageUtility",{enumerable:!0,get:function(){return o(c).default}}),Object.defineProperty(e,"loadOidcContextFromStorage",{enumerable:!0,get:function(){return c.loadOidcContextFromStorage}}),Object.defineProperty(e,"saveSessionInfoToStorage",{enumerable:!0,get:function(){return c.saveSessionInfoToStorage}}),Object.defineProperty(e,"getSessionIdFromOauthState",{enumerable:!0,get:function(){return c.getSessionIdFromOauthState}});var f=r(12244);Object.defineProperty(e,"InMemoryStorage",{enumerable:!0,get:function(){return o(f).default}});var l=r(17117);Object.defineProperty(e,"ConfigurationError",{enumerable:!0,get:function(){return o(l).default}});var d=r(47073);Object.defineProperty(e,"NotImplementedError",{enumerable:!0,get:function(){return o(d).default}});var p=r(77478);Object.defineProperty(e,"mockStorage",{enumerable:!0,get:function(){return p.mockStorage}}),Object.defineProperty(e,"mockStorageUtility",{enumerable:!0,get:function(){return p.mockStorageUtility}}),Object.defineProperty(e,"StorageUtilityMock",{enumerable:!0,get:function(){return p.StorageUtilityMock}}),Object.defineProperty(e,"StorageUtilityGetResponse",{enumerable:!0,get:function(){return p.StorageUtilityGetResponse}})},74725:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.handleRegistration=e.determineSigningAlg=void 0,e.determineSigningAlg=function(t,e){var r;return null!==(r=e.find((e=>t.includes(e))))&&void 0!==r?r:null},e.handleRegistration=async function(t,e,r,i){return void 0===t.clientId||"https://solidproject.org/TR/solid-oidc"!==e.solidOidcSupported&&function(t){try{return new URL(t),!0}catch(t){return!1}}(t.clientId)?i.getClient({sessionId:t.sessionId,clientName:t.clientName,redirectUrl:t.redirectUrl},e):(await r.setForUser(t.sessionId,{clientId:t.clientId}),t.clientSecret&&await r.setForUser(t.sessionId,{clientSecret:t.clientSecret}),t.clientName&&await r.setForUser(t.sessionId,{clientName:t.clientName}),{clientId:t.clientId,clientSecret:t.clientSecret,clientName:t.clientName})}},31168:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.isSupportedTokenType=void 0,e.isSupportedTokenType=function(t){return"string"==typeof t&&["DPoP","Bearer"].includes(t)}},81645:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.USER_SESSION_PREFIX=void 0,e.USER_SESSION_PREFIX="solidClientAuthenticationUser"},12244:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=class{constructor(){this.map={}}async get(t){return this.map[t]||void 0}async set(t,e){this.map[t]=e}async delete(t){delete this.map[t]}}},4574:function(t,e,r){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.saveSessionInfoToStorage=e.loadOidcContextFromStorage=e.getSessionIdFromOauthState=void 0;const n=i(r(32029));e.getSessionIdFromOauthState=async function(t,e){return t.getForUser(e,"sessionId")},e.loadOidcContextFromStorage=async function(t,e,r){try{const[i,n,o,s]=await Promise.all([e.getForUser(t,"issuer",{errorIfNull:!0}),e.getForUser(t,"codeVerifier"),e.getForUser(t,"redirectUrl"),e.getForUser(t,"dpop",{errorIfNull:!0})]);return{codeVerifier:n,redirectUrl:o,issuerConfig:await r.fetchConfig(i),dpop:"true"===s}}catch(e){throw new Error(`Failed to retrieve OIDC context from storage associated with session [${t}]: ${e.toString()}`)}},e.saveSessionInfoToStorage=async function(t,e,r,i,n,o,s){void 0!==o&&await t.setForUser(e,{refreshToken:o},{secure:s}),void 0!==r&&await t.setForUser(e,{idToken:r},{secure:s}),void 0!==i&&await t.setForUser(e,{webId:i},{secure:s}),void 0!==n&&await t.setForUser(e,{isLoggedIn:n},{secure:s})},e.default=class{constructor(t,e){this.secureStorage=t,this.insecureStorage=e,this.RESOURCE_SERVER_SESSION_INFORMATION_KEY="tmp-resource-server-session-info"}getKey(t){return`solidClientAuthenticationUser:${t}`}async getUserData(t,e){const r=await(e?this.secureStorage:this.insecureStorage).get(this.getKey(t));if(void 0===r)return{};try{return JSON.parse(r)}catch(i){throw new n.default(`Data for user [${t}] in [${e?"secure":"unsecure"}] storage is corrupted - expected valid JSON, but got: ${r}`)}}async setUserData(t,e,r){await(r?this.secureStorage:this.insecureStorage).set(this.getKey(t),JSON.stringify(e))}async get(t,e){const r=await((null==e?void 0:e.secure)?this.secureStorage:this.insecureStorage).get(t);if(void 0===r&&(null==e?void 0:e.errorIfNull))throw new n.default(`[${t}] is not stored`);return r}async set(t,e,r){return((null==r?void 0:r.secure)?this.secureStorage:this.insecureStorage).set(t,e)}async delete(t,e){return((null==e?void 0:e.secure)?this.secureStorage:this.insecureStorage).delete(t)}async getForUser(t,e,r){const i=await this.getUserData(t,null==r?void 0:r.secure);let o;if(i&&i[e]||(o=void 0),o=i[e],void 0===o&&(null==r?void 0:r.errorIfNull))throw new n.default(`Field [${e}] for user [${t}] is not stored`);return o||void 0}async setForUser(t,e,r){let i;try{i=await this.getUserData(t,null==r?void 0:r.secure)}catch(t){i={}}await this.setUserData(t,{...i,...e},null==r?void 0:r.secure)}async deleteForUser(t,e,r){const i=await this.getUserData(t,null==r?void 0:r.secure);delete i[e],await this.setUserData(t,i,null==r?void 0:r.secure)}async deleteAllUserData(t,e){await((null==e?void 0:e.secure)?this.secureStorage:this.insecureStorage).delete(this.getKey(t))}async storeResourceServerSessionInfo(t,e,r){var i;const n=JSON.parse(null!==(i=await this.insecureStorage.get(this.RESOURCE_SERVER_SESSION_INFORMATION_KEY))&&void 0!==i?i:"{}");n.webId!==t&&(n.sessions={}),n.webId=t,n.sessions[e]={expiration:r},await this.insecureStorage.set(this.RESOURCE_SERVER_SESSION_INFORMATION_KEY,JSON.stringify(n))}async clearResourceServerSessionInfo(t){var e;const r=JSON.parse(null!==(e=await this.insecureStorage.get(this.RESOURCE_SERVER_SESSION_INFORMATION_KEY))&&void 0!==e?e:"{}");void 0!==r.sessions&&(delete r.sessions[t],0===Object.keys(r.sessions).length?await this.insecureStorage.set(this.RESOURCE_SERVER_SESSION_INFORMATION_KEY,"{}"):await this.insecureStorage.set(this.RESOURCE_SERVER_SESSION_INFORMATION_KEY,JSON.stringify(r)))}}},77478:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.mockStorageUtility=e.mockStorage=e.StorageUtilityMock=e.StorageUtilityGetResponse=void 0;const i=r(80835);e.StorageUtilityGetResponse="getResponse",e.StorageUtilityMock={get:async(t,r)=>e.StorageUtilityGetResponse,set:async(t,e)=>{},delete:async t=>{},getForUser:async(t,r,i)=>e.StorageUtilityGetResponse,setForUser:async(t,e,r)=>{},deleteForUser:async(t,e,r)=>{},deleteAllUserData:async(t,e)=>{},storeResourceServerSessionInfo:async(t,e,r)=>{},clearResourceServerSessionInfo:async t=>{}},e.mockStorage=t=>{const e=t;return{get:async t=>{if(void 0!==e[t])return"string"==typeof e[t]?e[t]:JSON.stringify(e[t])},set:async(t,r)=>{e[t]=r},delete:async t=>{delete e[t]}}},e.mockStorageUtility=(t,r=!1)=>r?new i.StorageUtility(e.mockStorage(t),e.mockStorage({})):new i.StorageUtility(e.mockStorage({}),e.mockStorage(t))},95024:function(t,e,r){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});const n=i(r(32029));e.default=class{constructor(t){this.handleables=t}async getProperHandler(t){const e=await Promise.all(this.handleables.map((e=>e.canHandle(...t))));for(let t=0;t<e.length;t+=1)if(e[t])return this.handleables[t];return null}async canHandle(...t){return null!==await this.getProperHandler(t)}async handle(...t){const e=await this.getProperHandler(t);if(e)return e.handle(...t);throw new n.default(`[${this.constructor.name}] cannot find a suitable handler for: ${t.map((t=>{try{return JSON.stringify(t)}catch(e){return t.toString()}})).join(", ")}`)}}},2190:t=>{t.exports=function(t,r,i){if(t.filter)return t.filter(r,i);if(null==t)throw new TypeError;if("function"!=typeof r)throw new TypeError;for(var n=[],o=0;o<t.length;o++)if(e.call(t,o)){var s=t[o];r.call(i,s,o,t)&&n.push(s)}return n};var e=Object.prototype.hasOwnProperty},39809:(t,e,r)=>{"use strict";const i=e;i.bignum=r(4590),i.define=r(22500).define,i.base=r(71979),i.constants=r(36826),i.decoders=r(78307),i.encoders=r(56579)},22500:(t,e,r)=>{"use strict";const i=r(56579),n=r(78307),o=r(35717);function s(t,e){this.name=t,this.body=e,this.decoders={},this.encoders={}}e.define=function(t,e){return new s(t,e)},s.prototype._createNamed=function(t){const e=this.name;function r(t){this._initNamed(t,e)}return o(r,t),r.prototype._initNamed=function(e,r){t.call(this,e,r)},new r(this)},s.prototype._getDecoder=function(t){return t=t||"der",this.decoders.hasOwnProperty(t)||(this.decoders[t]=this._createNamed(n[t])),this.decoders[t]},s.prototype.decode=function(t,e,r){return this._getDecoder(e).decode(t,r)},s.prototype._getEncoder=function(t){return t=t||"der",this.encoders.hasOwnProperty(t)||(this.encoders[t]=this._createNamed(i[t])),this.encoders[t]},s.prototype.encode=function(t,e,r){return this._getEncoder(e).encode(t,r)}},36625:(t,e,r)=>{"use strict";const i=r(35717),n=r(98465).b,o=r(2399).Buffer;function s(t,e){n.call(this,e),o.isBuffer(t)?(this.base=t,this.offset=0,this.length=t.length):this.error("Input not Buffer")}function a(t,e){if(Array.isArray(t))this.length=0,this.value=t.map((function(t){return a.isEncoderBuffer(t)||(t=new a(t,e)),this.length+=t.length,t}),this);else if("number"==typeof t){if(!(0<=t&&t<=255))return e.error("non-byte EncoderBuffer value");this.value=t,this.length=1}else if("string"==typeof t)this.value=t,this.length=o.byteLength(t);else{if(!o.isBuffer(t))return e.error("Unsupported type: "+typeof t);this.value=t,this.length=t.length}}i(s,n),e.C=s,s.isDecoderBuffer=function(t){return t instanceof s||"object"==typeof t&&o.isBuffer(t.base)&&"DecoderBuffer"===t.constructor.name&&"number"==typeof t.offset&&"number"==typeof t.length&&"function"==typeof t.save&&"function"==typeof t.restore&&"function"==typeof t.isEmpty&&"function"==typeof t.readUInt8&&"function"==typeof t.skip&&"function"==typeof t.raw},s.prototype.save=function(){return{offset:this.offset,reporter:n.prototype.save.call(this)}},s.prototype.restore=function(t){const e=new s(this.base);return e.offset=t.offset,e.length=this.offset,this.offset=t.offset,n.prototype.restore.call(this,t.reporter),e},s.prototype.isEmpty=function(){return this.offset===this.length},s.prototype.readUInt8=function(t){return this.offset+1<=this.length?this.base.readUInt8(this.offset++,!0):this.error(t||"DecoderBuffer overrun")},s.prototype.skip=function(t,e){if(!(this.offset+t<=this.length))return this.error(e||"DecoderBuffer overrun");const r=new s(this.base);return r._reporterState=this._reporterState,r.offset=this.offset,r.length=this.offset+t,this.offset+=t,r},s.prototype.raw=function(t){return this.base.slice(t?t.offset:this.offset,this.length)},e.R=a,a.isEncoderBuffer=function(t){return t instanceof a||"object"==typeof t&&"EncoderBuffer"===t.constructor.name&&"number"==typeof t.length&&"function"==typeof t.join},a.prototype.join=function(t,e){return t||(t=o.alloc(this.length)),e||(e=0),0===this.length||(Array.isArray(this.value)?this.value.forEach((function(r){r.join(t,e),e+=r.length})):("number"==typeof this.value?t[e]=this.value:"string"==typeof this.value?t.write(this.value,e):o.isBuffer(this.value)&&this.value.copy(t,e),e+=this.length)),t}},71979:(t,e,r)=>{"use strict";const i=e;i.Reporter=r(98465).b,i.DecoderBuffer=r(36625).C,i.EncoderBuffer=r(36625).R,i.Node=r(41949)},41949:(t,e,r)=>{"use strict";const i=r(98465).b,n=r(36625).R,o=r(36625).C,s=r(79746),a=["seq","seqof","set","setof","objid","bool","gentime","utctime","null_","enum","int","objDesc","bitstr","bmpstr","charstr","genstr","graphstr","ia5str","iso646str","numstr","octstr","printstr","t61str","unistr","utf8str","videostr"],u=["key","obj","use","optional","explicit","implicit","def","choice","any","contains"].concat(a);function h(t,e,r){const i={};this._baseState=i,i.name=r,i.enc=t,i.parent=e||null,i.children=null,i.tag=null,i.args=null,i.reverseArgs=null,i.choice=null,i.optional=!1,i.any=!1,i.obj=!1,i.use=null,i.useDecoder=null,i.key=null,i.default=null,i.explicit=null,i.implicit=null,i.contains=null,i.parent||(i.children=[],this._wrap())}t.exports=h;const c=["enc","parent","children","tag","args","reverseArgs","choice","optional","any","obj","use","alteredUse","key","default","explicit","implicit","contains"];h.prototype.clone=function(){const t=this._baseState,e={};c.forEach((function(r){e[r]=t[r]}));const r=new this.constructor(e.parent);return r._baseState=e,r},h.prototype._wrap=function(){const t=this._baseState;u.forEach((function(e){this[e]=function(){const r=new this.constructor(this);return t.children.push(r),r[e].apply(r,arguments)}}),this)},h.prototype._init=function(t){const e=this._baseState;s(null===e.parent),t.call(this),e.children=e.children.filter((function(t){return t._baseState.parent===this}),this),s.equal(e.children.length,1,"Root node can have only one child")},h.prototype._useArgs=function(t){const e=this._baseState,r=t.filter((function(t){return t instanceof this.constructor}),this);t=t.filter((function(t){return!(t instanceof this.constructor)}),this),0!==r.length&&(s(null===e.children),e.children=r,r.forEach((function(t){t._baseState.parent=this}),this)),0!==t.length&&(s(null===e.args),e.args=t,e.reverseArgs=t.map((function(t){if("object"!=typeof t||t.constructor!==Object)return t;const e={};return Object.keys(t).forEach((function(r){r==(0|r)&&(r|=0);const i=t[r];e[i]=r})),e})))},["_peekTag","_decodeTag","_use","_decodeStr","_decodeObjid","_decodeTime","_decodeNull","_decodeInt","_decodeBool","_decodeList","_encodeComposite","_encodeStr","_encodeObjid","_encodeTime","_encodeNull","_encodeInt","_encodeBool"].forEach((function(t){h.prototype[t]=function(){const e=this._baseState;throw new Error(t+" not implemented for encoding: "+e.enc)}})),a.forEach((function(t){h.prototype[t]=function(){const e=this._baseState,r=Array.prototype.slice.call(arguments);return s(null===e.tag),e.tag=t,this._useArgs(r),this}})),h.prototype.use=function(t){s(t);const e=this._baseState;return s(null===e.use),e.use=t,this},h.prototype.optional=function(){return this._baseState.optional=!0,this},h.prototype.def=function(t){const e=this._baseState;return s(null===e.default),e.default=t,e.optional=!0,this},h.prototype.explicit=function(t){const e=this._baseState;return s(null===e.explicit&&null===e.implicit),e.explicit=t,this},h.prototype.implicit=function(t){const e=this._baseState;return s(null===e.explicit&&null===e.implicit),e.implicit=t,this},h.prototype.obj=function(){const t=this._baseState,e=Array.prototype.slice.call(arguments);return t.obj=!0,0!==e.length&&this._useArgs(e),this},h.prototype.key=function(t){const e=this._baseState;return s(null===e.key),e.key=t,this},h.prototype.any=function(){return this._baseState.any=!0,this},h.prototype.choice=function(t){const e=this._baseState;return s(null===e.choice),e.choice=t,this._useArgs(Object.keys(t).map((function(e){return t[e]}))),this},h.prototype.contains=function(t){const e=this._baseState;return s(null===e.use),e.contains=t,this},h.prototype._decode=function(t,e){const r=this._baseState;if(null===r.parent)return t.wrapResult(r.children[0]._decode(t,e));let i,n=r.default,s=!0,a=null;if(null!==r.key&&(a=t.enterKey(r.key)),r.optional){let i=null;if(null!==r.explicit?i=r.explicit:null!==r.implicit?i=r.implicit:null!==r.tag&&(i=r.tag),null!==i||r.any){if(s=this._peekTag(t,i,r.any),t.isError(s))return s}else{const i=t.save();try{null===r.choice?this._decodeGeneric(r.tag,t,e):this._decodeChoice(t,e),s=!0}catch(t){s=!1}t.restore(i)}}if(r.obj&&s&&(i=t.enterObject()),s){if(null!==r.explicit){const e=this._decodeTag(t,r.explicit);if(t.isError(e))return e;t=e}const i=t.offset;if(null===r.use&&null===r.choice){let e;r.any&&(e=t.save());const i=this._decodeTag(t,null!==r.implicit?r.implicit:r.tag,r.any);if(t.isError(i))return i;r.any?n=t.raw(e):t=i}if(e&&e.track&&null!==r.tag&&e.track(t.path(),i,t.length,"tagged"),e&&e.track&&null!==r.tag&&e.track(t.path(),t.offset,t.length,"content"),r.any||(n=null===r.choice?this._decodeGeneric(r.tag,t,e):this._decodeChoice(t,e)),t.isError(n))return n;if(r.any||null!==r.choice||null===r.children||r.children.forEach((function(r){r._decode(t,e)})),r.contains&&("octstr"===r.tag||"bitstr"===r.tag)){const i=new o(n);n=this._getUse(r.contains,t._reporterState.obj)._decode(i,e)}}return r.obj&&s&&(n=t.leaveObject(i)),null===r.key||null===n&&!0!==s?null!==a&&t.exitKey(a):t.leaveKey(a,r.key,n),n},h.prototype._decodeGeneric=function(t,e,r){const i=this._baseState;return"seq"===t||"set"===t?null:"seqof"===t||"setof"===t?this._decodeList(e,t,i.args[0],r):/str$/.test(t)?this._decodeStr(e,t,r):"objid"===t&&i.args?this._decodeObjid(e,i.args[0],i.args[1],r):"objid"===t?this._decodeObjid(e,null,null,r):"gentime"===t||"utctime"===t?this._decodeTime(e,t,r):"null_"===t?this._decodeNull(e,r):"bool"===t?this._decodeBool(e,r):"objDesc"===t?this._decodeStr(e,t,r):"int"===t||"enum"===t?this._decodeInt(e,i.args&&i.args[0],r):null!==i.use?this._getUse(i.use,e._reporterState.obj)._decode(e,r):e.error("unknown tag: "+t)},h.prototype._getUse=function(t,e){const r=this._baseState;return r.useDecoder=this._use(t,e),s(null===r.useDecoder._baseState.parent),r.useDecoder=r.useDecoder._baseState.children[0],r.implicit!==r.useDecoder._baseState.implicit&&(r.useDecoder=r.useDecoder.clone(),r.useDecoder._baseState.implicit=r.implicit),r.useDecoder},h.prototype._decodeChoice=function(t,e){const r=this._baseState;let i=null,n=!1;return Object.keys(r.choice).some((function(o){const s=t.save(),a=r.choice[o];try{const r=a._decode(t,e);if(t.isError(r))return!1;i={type:o,value:r},n=!0}catch(e){return t.restore(s),!1}return!0}),this),n?i:t.error("Choice not matched")},h.prototype._createEncoderBuffer=function(t){return new n(t,this.reporter)},h.prototype._encode=function(t,e,r){const i=this._baseState;if(null!==i.default&&i.default===t)return;const n=this._encodeValue(t,e,r);return void 0===n||this._skipDefault(n,e,r)?void 0:n},h.prototype._encodeValue=function(t,e,r){const n=this._baseState;if(null===n.parent)return n.children[0]._encode(t,e||new i);let o=null;if(this.reporter=e,n.optional&&void 0===t){if(null===n.default)return;t=n.default}let s=null,a=!1;if(n.any)o=this._createEncoderBuffer(t);else if(n.choice)o=this._encodeChoice(t,e);else if(n.contains)s=this._getUse(n.contains,r)._encode(t,e),a=!0;else if(n.children)s=n.children.map((function(r){if("null_"===r._baseState.tag)return r._encode(null,e,t);if(null===r._baseState.key)return e.error("Child should have a key");const i=e.enterKey(r._baseState.key);if("object"!=typeof t)return e.error("Child expected, but input is not object");const n=r._encode(t[r._baseState.key],e,t);return e.leaveKey(i),n}),this).filter((function(t){return t})),s=this._createEncoderBuffer(s);else if("seqof"===n.tag||"setof"===n.tag){if(!n.args||1!==n.args.length)return e.error("Too many args for : "+n.tag);if(!Array.isArray(t))return e.error("seqof/setof, but data is not Array");const r=this.clone();r._baseState.implicit=null,s=this._createEncoderBuffer(t.map((function(r){const i=this._baseState;return this._getUse(i.args[0],t)._encode(r,e)}),r))}else null!==n.use?o=this._getUse(n.use,r)._encode(t,e):(s=this._encodePrimitive(n.tag,t),a=!0);if(!n.any&&null===n.choice){const t=null!==n.implicit?n.implicit:n.tag,r=null===n.implicit?"universal":"context";null===t?null===n.use&&e.error("Tag could be omitted only for .use()"):null===n.use&&(o=this._encodeComposite(t,a,r,s))}return null!==n.explicit&&(o=this._encodeComposite(n.explicit,!1,"context",o)),o},h.prototype._encodeChoice=function(t,e){const r=this._baseState,i=r.choice[t.type];return i||s(!1,t.type+" not found in "+JSON.stringify(Object.keys(r.choice))),i._encode(t.value,e)},h.prototype._encodePrimitive=function(t,e){const r=this._baseState;if(/str$/.test(t))return this._encodeStr(e,t);if("objid"===t&&r.args)return this._encodeObjid(e,r.reverseArgs[0],r.args[1]);if("objid"===t)return this._encodeObjid(e,null,null);if("gentime"===t||"utctime"===t)return this._encodeTime(e,t);if("null_"===t)return this._encodeNull();if("int"===t||"enum"===t)return this._encodeInt(e,r.args&&r.reverseArgs[0]);if("bool"===t)return this._encodeBool(e);if("objDesc"===t)return this._encodeStr(e,t);throw new Error("Unsupported tag: "+t)},h.prototype._isNumstr=function(t){return/^[0-9 ]*$/.test(t)},h.prototype._isPrintstr=function(t){return/^[A-Za-z0-9 '()+,-./:=?]*$/.test(t)}},98465:(t,e,r)=>{"use strict";const i=r(35717);function n(t){this._reporterState={obj:null,path:[],options:t||{},errors:[]}}function o(t,e){this.path=t,this.rethrow(e)}e.b=n,n.prototype.isError=function(t){return t instanceof o},n.prototype.save=function(){const t=this._reporterState;return{obj:t.obj,pathLen:t.path.length}},n.prototype.restore=function(t){const e=this._reporterState;e.obj=t.obj,e.path=e.path.slice(0,t.pathLen)},n.prototype.enterKey=function(t){return this._reporterState.path.push(t)},n.prototype.exitKey=function(t){const e=this._reporterState;e.path=e.path.slice(0,t-1)},n.prototype.leaveKey=function(t,e,r){const i=this._reporterState;this.exitKey(t),null!==i.obj&&(i.obj[e]=r)},n.prototype.path=function(){return this._reporterState.path.join("/")},n.prototype.enterObject=function(){const t=this._reporterState,e=t.obj;return t.obj={},e},n.prototype.leaveObject=function(t){const e=this._reporterState,r=e.obj;return e.obj=t,r},n.prototype.error=function(t){let e;const r=this._reporterState,i=t instanceof o;if(e=i?t:new o(r.path.map((function(t){return"["+JSON.stringify(t)+"]"})).join(""),t.message||t,t.stack),!r.options.partial)throw e;return i||r.errors.push(e),e},n.prototype.wrapResult=function(t){const e=this._reporterState;return e.options.partial?{result:this.isError(t)?null:t,errors:e.errors}:t},i(o,Error),o.prototype.rethrow=function(t){if(this.message=t+" at: "+(this.path||"(shallow)"),Error.captureStackTrace&&Error.captureStackTrace(this,o),!this.stack)try{throw new Error(this.message)}catch(t){this.stack=t.stack}return this}},70160:(t,e)=>{"use strict";function r(t){const e={};return Object.keys(t).forEach((function(r){(0|r)==r&&(r|=0);const i=t[r];e[i]=r})),e}e.tagClass={0:"universal",1:"application",2:"context",3:"private"},e.tagClassByName=r(e.tagClass),e.tag={0:"end",1:"bool",2:"int",3:"bitstr",4:"octstr",5:"null_",6:"objid",7:"objDesc",8:"external",9:"real",10:"enum",11:"embed",12:"utf8str",13:"relativeOid",16:"seq",17:"set",18:"numstr",19:"printstr",20:"t61str",21:"videostr",22:"ia5str",23:"utctime",24:"gentime",25:"graphstr",26:"iso646str",27:"genstr",28:"unistr",29:"charstr",30:"bmpstr"},e.tagByName=r(e.tag)},36826:(t,e,r)=>{"use strict";const i=e;i._reverse=function(t){const e={};return Object.keys(t).forEach((function(r){(0|r)==r&&(r|=0);const i=t[r];e[i]=r})),e},i.der=r(70160)},41671:(t,e,r)=>{"use strict";const i=r(35717),n=r(4590),o=r(36625).C,s=r(41949),a=r(70160);function u(t){this.enc="der",this.name=t.name,this.entity=t,this.tree=new h,this.tree._init(t.body)}function h(t){s.call(this,"der",t)}function c(t,e){let r=t.readUInt8(e);if(t.isError(r))return r;const i=a.tagClass[r>>6],n=0==(32&r);if(31==(31&r)){let i=r;for(r=0;128==(128&i);){if(i=t.readUInt8(e),t.isError(i))return i;r<<=7,r|=127&i}}else r&=31;return{cls:i,primitive:n,tag:r,tagStr:a.tag[r]}}function f(t,e,r){let i=t.readUInt8(r);if(t.isError(i))return i;if(!e&&128===i)return null;if(0==(128&i))return i;const n=127&i;if(n>4)return t.error("length octect is too long");i=0;for(let e=0;e<n;e++){i<<=8;const e=t.readUInt8(r);if(t.isError(e))return e;i|=e}return i}t.exports=u,u.prototype.decode=function(t,e){return o.isDecoderBuffer(t)||(t=new o(t,e)),this.tree._decode(t,e)},i(h,s),h.prototype._peekTag=function(t,e,r){if(t.isEmpty())return!1;const i=t.save(),n=c(t,'Failed to peek tag: "'+e+'"');return t.isError(n)?n:(t.restore(i),n.tag===e||n.tagStr===e||n.tagStr+"of"===e||r)},h.prototype._decodeTag=function(t,e,r){const i=c(t,'Failed to decode tag of "'+e+'"');if(t.isError(i))return i;let n=f(t,i.primitive,'Failed to get length of "'+e+'"');if(t.isError(n))return n;if(!r&&i.tag!==e&&i.tagStr!==e&&i.tagStr+"of"!==e)return t.error('Failed to match tag: "'+e+'"');if(i.primitive||null!==n)return t.skip(n,'Failed to match body of: "'+e+'"');const o=t.save(),s=this._skipUntilEnd(t,'Failed to skip indefinite length body: "'+this.tag+'"');return t.isError(s)?s:(n=t.offset-o.offset,t.restore(o),t.skip(n,'Failed to match body of: "'+e+'"'))},h.prototype._skipUntilEnd=function(t,e){for(;;){const r=c(t,e);if(t.isError(r))return r;const i=f(t,r.primitive,e);if(t.isError(i))return i;let n;if(n=r.primitive||null!==i?t.skip(i):this._skipUntilEnd(t,e),t.isError(n))return n;if("end"===r.tagStr)break}},h.prototype._decodeList=function(t,e,r,i){const n=[];for(;!t.isEmpty();){const e=this._peekTag(t,"end");if(t.isError(e))return e;const o=r.decode(t,"der",i);if(t.isError(o)&&e)break;n.push(o)}return n},h.prototype._decodeStr=function(t,e){if("bitstr"===e){const e=t.readUInt8();return t.isError(e)?e:{unused:e,data:t.raw()}}if("bmpstr"===e){const e=t.raw();if(e.length%2==1)return t.error("Decoding of string type: bmpstr length mismatch");let r="";for(let t=0;t<e.length/2;t++)r+=String.fromCharCode(e.readUInt16BE(2*t));return r}if("numstr"===e){const e=t.raw().toString("ascii");return this._isNumstr(e)?e:t.error("Decoding of string type: numstr unsupported characters")}if("octstr"===e)return t.raw();if("objDesc"===e)return t.raw();if("printstr"===e){const e=t.raw().toString("ascii");return this._isPrintstr(e)?e:t.error("Decoding of string type: printstr unsupported characters")}return/str$/.test(e)?t.raw().toString():t.error("Decoding of string type: "+e+" unsupported")},h.prototype._decodeObjid=function(t,e,r){let i;const n=[];let o=0,s=0;for(;!t.isEmpty();)s=t.readUInt8(),o<<=7,o|=127&s,0==(128&s)&&(n.push(o),o=0);128&s&&n.push(o);const a=n[0]/40|0,u=n[0]%40;if(i=r?n:[a,u].concat(n.slice(1)),e){let t=e[i.join(" ")];void 0===t&&(t=e[i.join(".")]),void 0!==t&&(i=t)}return i},h.prototype._decodeTime=function(t,e){const r=t.raw().toString();let i,n,o,s,a,u;if("gentime"===e)i=0|r.slice(0,4),n=0|r.slice(4,6),o=0|r.slice(6,8),s=0|r.slice(8,10),a=0|r.slice(10,12),u=0|r.slice(12,14);else{if("utctime"!==e)return t.error("Decoding "+e+" time is not supported yet");i=0|r.slice(0,2),n=0|r.slice(2,4),o=0|r.slice(4,6),s=0|r.slice(6,8),a=0|r.slice(8,10),u=0|r.slice(10,12),i=i<70?2e3+i:1900+i}return Date.UTC(i,n-1,o,s,a,u,0)},h.prototype._decodeNull=function(){return null},h.prototype._decodeBool=function(t){const e=t.readUInt8();return t.isError(e)?e:0!==e},h.prototype._decodeInt=function(t,e){const r=t.raw();let i=new n(r);return e&&(i=e[i.toString(10)]||i),i},h.prototype._use=function(t,e){return"function"==typeof t&&(t=t(e)),t._getDecoder("der").tree}},78307:(t,e,r)=>{"use strict";const i=e;i.der=r(41671),i.pem=r(59631)},59631:(t,e,r)=>{"use strict";const i=r(35717),n=r(2399).Buffer,o=r(41671);function s(t){o.call(this,t),this.enc="pem"}i(s,o),t.exports=s,s.prototype.decode=function(t,e){const r=t.toString().split(/[\r\n]+/g),i=e.label.toUpperCase(),s=/^-----(BEGIN|END) ([^-]+)-----$/;let a=-1,u=-1;for(let t=0;t<r.length;t++){const e=r[t].match(s);if(null!==e&&e[2]===i){if(-1!==a){if("END"!==e[1])break;u=t;break}if("BEGIN"!==e[1])break;a=t}}if(-1===a||-1===u)throw new Error("PEM section not found for: "+i);const h=r.slice(a+1,u).join("");h.replace(/[^a-z0-9+/=]+/gi,"");const c=n.from(h,"base64");return o.prototype.decode.call(this,c,e)}},66984:(t,e,r)=>{"use strict";const i=r(35717),n=r(2399).Buffer,o=r(41949),s=r(70160);function a(t){this.enc="der",this.name=t.name,this.entity=t,this.tree=new u,this.tree._init(t.body)}function u(t){o.call(this,"der",t)}function h(t){return t<10?"0"+t:t}t.exports=a,a.prototype.encode=function(t,e){return this.tree._encode(t,e).join()},i(u,o),u.prototype._encodeComposite=function(t,e,r,i){const o=function(t,e,r,i){let n;if("seqof"===t?t="seq":"setof"===t&&(t="set"),s.tagByName.hasOwnProperty(t))n=s.tagByName[t];else{if("number"!=typeof t||(0|t)!==t)return i.error("Unknown tag: "+t);n=t}return n>=31?i.error("Multi-octet tag encoding unsupported"):(e||(n|=32),n|=s.tagClassByName[r||"universal"]<<6,n)}(t,e,r,this.reporter);if(i.length<128){const t=n.alloc(2);return t[0]=o,t[1]=i.length,this._createEncoderBuffer([t,i])}let a=1;for(let t=i.length;t>=256;t>>=8)a++;const u=n.alloc(2+a);u[0]=o,u[1]=128|a;for(let t=1+a,e=i.length;e>0;t--,e>>=8)u[t]=255&e;return this._createEncoderBuffer([u,i])},u.prototype._encodeStr=function(t,e){if("bitstr"===e)return this._createEncoderBuffer([0|t.unused,t.data]);if("bmpstr"===e){const e=n.alloc(2*t.length);for(let r=0;r<t.length;r++)e.writeUInt16BE(t.charCodeAt(r),2*r);return this._createEncoderBuffer(e)}return"numstr"===e?this._isNumstr(t)?this._createEncoderBuffer(t):this.reporter.error("Encoding of string type: numstr supports only digits and space"):"printstr"===e?this._isPrintstr(t)?this._createEncoderBuffer(t):this.reporter.error("Encoding of string type: printstr supports only latin upper and lower case letters, digits, space, apostrophe, left and rigth parenthesis, plus sign, comma, hyphen, dot, slash, colon, equal sign, question mark"):/str$/.test(e)||"objDesc"===e?this._createEncoderBuffer(t):this.reporter.error("Encoding of string type: "+e+" unsupported")},u.prototype._encodeObjid=function(t,e,r){if("string"==typeof t){if(!e)return this.reporter.error("string objid given, but no values map found");if(!e.hasOwnProperty(t))return this.reporter.error("objid not found in values map");t=e[t].split(/[\s.]+/g);for(let e=0;e<t.length;e++)t[e]|=0}else if(Array.isArray(t)){t=t.slice();for(let e=0;e<t.length;e++)t[e]|=0}if(!Array.isArray(t))return this.reporter.error("objid() should be either array or string, got: "+JSON.stringify(t));if(!r){if(t[1]>=40)return this.reporter.error("Second objid identifier OOB");t.splice(0,2,40*t[0]+t[1])}let i=0;for(let e=0;e<t.length;e++){let r=t[e];for(i++;r>=128;r>>=7)i++}const o=n.alloc(i);let s=o.length-1;for(let e=t.length-1;e>=0;e--){let r=t[e];for(o[s--]=127&r;(r>>=7)>0;)o[s--]=128|127&r}return this._createEncoderBuffer(o)},u.prototype._encodeTime=function(t,e){let r;const i=new Date(t);return"gentime"===e?r=[h(i.getUTCFullYear()),h(i.getUTCMonth()+1),h(i.getUTCDate()),h(i.getUTCHours()),h(i.getUTCMinutes()),h(i.getUTCSeconds()),"Z"].join(""):"utctime"===e?r=[h(i.getUTCFullYear()%100),h(i.getUTCMonth()+1),h(i.getUTCDate()),h(i.getUTCHours()),h(i.getUTCMinutes()),h(i.getUTCSeconds()),"Z"].join(""):this.reporter.error("Encoding "+e+" time is not supported yet"),this._encodeStr(r,"octstr")},u.prototype._encodeNull=function(){return this._createEncoderBuffer("")},u.prototype._encodeInt=function(t,e){if("string"==typeof t){if(!e)return this.reporter.error("String int or enum given, but no values map");if(!e.hasOwnProperty(t))return this.reporter.error("Values map doesn't contain: "+JSON.stringify(t));t=e[t]}if("number"!=typeof t&&!n.isBuffer(t)){const e=t.toArray();!t.sign&&128&e[0]&&e.unshift(0),t=n.from(e)}if(n.isBuffer(t)){let e=t.length;0===t.length&&e++;const r=n.alloc(e);return t.copy(r),0===t.length&&(r[0]=0),this._createEncoderBuffer(r)}if(t<128)return this._createEncoderBuffer(t);if(t<256)return this._createEncoderBuffer([0,t]);let r=1;for(let e=t;e>=256;e>>=8)r++;const i=new Array(r);for(let e=i.length-1;e>=0;e--)i[e]=255&t,t>>=8;return 128&i[0]&&i.unshift(0),this._createEncoderBuffer(n.from(i))},u.prototype._encodeBool=function(t){return this._createEncoderBuffer(t?255:0)},u.prototype._use=function(t,e){return"function"==typeof t&&(t=t(e)),t._getEncoder("der").tree},u.prototype._skipDefault=function(t,e,r){const i=this._baseState;let n;if(null===i.default)return!1;const o=t.join();if(void 0===i.defaultBuffer&&(i.defaultBuffer=this._encodeValue(i.default,e,r).join()),o.length!==i.defaultBuffer.length)return!1;for(n=0;n<o.length;n++)if(o[n]!==i.defaultBuffer[n])return!1;return!0}},56579:(t,e,r)=>{"use strict";const i=e;i.der=r(66984),i.pem=r(2883)},2883:(t,e,r)=>{"use strict";const i=r(35717),n=r(66984);function o(t){n.call(this,t),this.enc="pem"}i(o,n),t.exports=o,o.prototype.encode=function(t,e){const r=n.prototype.encode.call(this,t).toString("base64"),i=["-----BEGIN "+e.label+"-----"];for(let t=0;t<r.length;t+=64)i.push(r.slice(t,t+64));return i.push("-----END "+e.label+"-----"),i.join("\n")}},4590:function(t,e,r){!function(t,e){"use strict";function i(t,e){if(!t)throw new Error(e||"Assertion failed")}function n(t,e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}function o(t,e,r){if(o.isBN(t))return t;this.negative=0,this.words=null,this.length=0,this.red=null,null!==t&&("le"!==e&&"be"!==e||(r=e,e=10),this._init(t||0,e||10,r||"be"))}var s;"object"==typeof t?t.exports=o:e.BN=o,o.BN=o,o.wordSize=26;try{s=r(32574).Buffer}catch(t){}function a(t,e,r){for(var i=0,n=Math.min(t.length,r),o=e;o<n;o++){var s=t.charCodeAt(o)-48;i<<=4,i|=s>=49&&s<=54?s-49+10:s>=17&&s<=22?s-17+10:15&s}return i}function u(t,e,r,i){for(var n=0,o=Math.min(t.length,r),s=e;s<o;s++){var a=t.charCodeAt(s)-48;n*=i,n+=a>=49?a-49+10:a>=17?a-17+10:a}return n}o.isBN=function(t){return t instanceof o||null!==t&&"object"==typeof t&&t.constructor.wordSize===o.wordSize&&Array.isArray(t.words)},o.max=function(t,e){return t.cmp(e)>0?t:e},o.min=function(t,e){return t.cmp(e)<0?t:e},o.prototype._init=function(t,e,r){if("number"==typeof t)return this._initNumber(t,e,r);if("object"==typeof t)return this._initArray(t,e,r);"hex"===e&&(e=16),i(e===(0|e)&&e>=2&&e<=36);var n=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&n++,16===e?this._parseHex(t,n):this._parseBase(t,e,n),"-"===t[0]&&(this.negative=1),this.strip(),"le"===r&&this._initArray(this.toArray(),e,r)},o.prototype._initNumber=function(t,e,r){t<0&&(this.negative=1,t=-t),t<67108864?(this.words=[67108863&t],this.length=1):t<4503599627370496?(this.words=[67108863&t,t/67108864&67108863],this.length=2):(i(t<9007199254740992),this.words=[67108863&t,t/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),e,r)},o.prototype._initArray=function(t,e,r){if(i("number"==typeof t.length),t.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(t.length/3),this.words=new Array(this.length);for(var n=0;n<this.length;n++)this.words[n]=0;var o,s,a=0;if("be"===r)for(n=t.length-1,o=0;n>=0;n-=3)s=t[n]|t[n-1]<<8|t[n-2]<<16,this.words[o]|=s<<a&67108863,this.words[o+1]=s>>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);else if("le"===r)for(n=0,o=0;n<t.length;n+=3)s=t[n]|t[n+1]<<8|t[n+2]<<16,this.words[o]|=s<<a&67108863,this.words[o+1]=s>>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);return this.strip()},o.prototype._parseHex=function(t,e){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var r=0;r<this.length;r++)this.words[r]=0;var i,n,o=0;for(r=t.length-6,i=0;r>=e;r-=6)n=a(t,r,r+6),this.words[i]|=n<<o&67108863,this.words[i+1]|=n>>>26-o&4194303,(o+=24)>=26&&(o-=26,i++);r+6!==e&&(n=a(t,e,r+6),this.words[i]|=n<<o&67108863,this.words[i+1]|=n>>>26-o&4194303),this.strip()},o.prototype._parseBase=function(t,e,r){this.words=[0],this.length=1;for(var i=0,n=1;n<=67108863;n*=e)i++;i--,n=n/e|0;for(var o=t.length-r,s=o%i,a=Math.min(o,o-s)+r,h=0,c=r;c<a;c+=i)h=u(t,c,c+i,e),this.imuln(n),this.words[0]+h<67108864?this.words[0]+=h:this._iaddn(h);if(0!==s){var f=1;for(h=u(t,c,t.length,e),c=0;c<s;c++)f*=e;this.imuln(f),this.words[0]+h<67108864?this.words[0]+=h:this._iaddn(h)}},o.prototype.copy=function(t){t.words=new Array(this.length);for(var e=0;e<this.length;e++)t.words[e]=this.words[e];t.length=this.length,t.negative=this.negative,t.red=this.red},o.prototype.clone=function(){var t=new o(null);return this.copy(t),t},o.prototype._expand=function(t){for(;this.length<t;)this.words[this.length++]=0;return this},o.prototype.strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},o.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},o.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var h=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],c=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],f=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function l(t,e,r){r.negative=e.negative^t.negative;var i=t.length+e.length|0;r.length=i,i=i-1|0;var n=0|t.words[0],o=0|e.words[0],s=n*o,a=67108863&s,u=s/67108864|0;r.words[0]=a;for(var h=1;h<i;h++){for(var c=u>>>26,f=67108863&u,l=Math.min(h,e.length-1),d=Math.max(0,h-t.length+1);d<=l;d++){var p=h-d|0;c+=(s=(n=0|t.words[p])*(o=0|e.words[d])+f)/67108864|0,f=67108863&s}r.words[h]=0|f,u=0|c}return 0!==u?r.words[h]=0|u:r.length--,r.strip()}o.prototype.toString=function(t,e){var r;if(e=0|e||1,16===(t=t||10)||"hex"===t){r="";for(var n=0,o=0,s=0;s<this.length;s++){var a=this.words[s],u=(16777215&(a<<n|o)).toString(16);r=0!=(o=a>>>24-n&16777215)||s!==this.length-1?h[6-u.length]+u+r:u+r,(n+=2)>=26&&(n-=26,s--)}for(0!==o&&(r=o.toString(16)+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(t===(0|t)&&t>=2&&t<=36){var l=c[t],d=f[t];r="";var p=this.clone();for(p.negative=0;!p.isZero();){var g=p.modn(d).toString(t);r=(p=p.idivn(d)).isZero()?g+r:h[l-g.length]+g+r}for(this.isZero()&&(r="0"+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}i(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:this.length>2&&i(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},o.prototype.toJSON=function(){return this.toString(16)},o.prototype.toBuffer=function(t,e){return i(void 0!==s),this.toArrayLike(s,t,e)},o.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)},o.prototype.toArrayLike=function(t,e,r){var n=this.byteLength(),o=r||Math.max(1,n);i(n<=o,"byte array longer than desired length"),i(o>0,"Requested array length <= 0"),this.strip();var s,a,u="le"===e,h=new t(o),c=this.clone();if(u){for(a=0;!c.isZero();a++)s=c.andln(255),c.iushrn(8),h[a]=s;for(;a<o;a++)h[a]=0}else{for(a=0;a<o-n;a++)h[a]=0;for(a=0;!c.isZero();a++)s=c.andln(255),c.iushrn(8),h[o-a-1]=s}return h},Math.clz32?o.prototype._countBits=function(t){return 32-Math.clz32(t)}:o.prototype._countBits=function(t){var e=t,r=0;return e>=4096&&(r+=13,e>>>=13),e>=64&&(r+=7,e>>>=7),e>=8&&(r+=4,e>>>=4),e>=2&&(r+=2,e>>>=2),r+e},o.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,r=0;return 0==(8191&e)&&(r+=13,e>>>=13),0==(127&e)&&(r+=7,e>>>=7),0==(15&e)&&(r+=4,e>>>=4),0==(3&e)&&(r+=2,e>>>=2),0==(1&e)&&r++,r},o.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;e<this.length;e++){var r=this._zeroBits(this.words[e]);if(t+=r,26!==r)break}return t},o.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},o.prototype.toTwos=function(t){return 0!==this.negative?this.abs().inotn(t).iaddn(1):this.clone()},o.prototype.fromTwos=function(t){return this.testn(t-1)?this.notn(t).iaddn(1).ineg():this.clone()},o.prototype.isNeg=function(){return 0!==this.negative},o.prototype.neg=function(){return this.clone().ineg()},o.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},o.prototype.iuor=function(t){for(;this.length<t.length;)this.words[this.length++]=0;for(var e=0;e<t.length;e++)this.words[e]=this.words[e]|t.words[e];return this.strip()},o.prototype.ior=function(t){return i(0==(this.negative|t.negative)),this.iuor(t)},o.prototype.or=function(t){return this.length>t.length?this.clone().ior(t):t.clone().ior(this)},o.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},o.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var r=0;r<e.length;r++)this.words[r]=this.words[r]&t.words[r];return this.length=e.length,this.strip()},o.prototype.iand=function(t){return i(0==(this.negative|t.negative)),this.iuand(t)},o.prototype.and=function(t){return this.length>t.length?this.clone().iand(t):t.clone().iand(this)},o.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},o.prototype.iuxor=function(t){var e,r;this.length>t.length?(e=this,r=t):(e=t,r=this);for(var i=0;i<r.length;i++)this.words[i]=e.words[i]^r.words[i];if(this!==e)for(;i<e.length;i++)this.words[i]=e.words[i];return this.length=e.length,this.strip()},o.prototype.ixor=function(t){return i(0==(this.negative|t.negative)),this.iuxor(t)},o.prototype.xor=function(t){return this.length>t.length?this.clone().ixor(t):t.clone().ixor(this)},o.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},o.prototype.inotn=function(t){i("number"==typeof t&&t>=0);var e=0|Math.ceil(t/26),r=t%26;this._expand(e),r>0&&e--;for(var n=0;n<e;n++)this.words[n]=67108863&~this.words[n];return r>0&&(this.words[n]=~this.words[n]&67108863>>26-r),this.strip()},o.prototype.notn=function(t){return this.clone().inotn(t)},o.prototype.setn=function(t,e){i("number"==typeof t&&t>=0);var r=t/26|0,n=t%26;return this._expand(r+1),this.words[r]=e?this.words[r]|1<<n:this.words[r]&~(1<<n),this.strip()},o.prototype.iadd=function(t){var e,r,i;if(0!==this.negative&&0===t.negative)return this.negative=0,e=this.isub(t),this.negative^=1,this._normSign();if(0===this.negative&&0!==t.negative)return t.negative=0,e=this.isub(t),t.negative=1,e._normSign();this.length>t.length?(r=this,i=t):(r=t,i=this);for(var n=0,o=0;o<i.length;o++)e=(0|r.words[o])+(0|i.words[o])+n,this.words[o]=67108863&e,n=e>>>26;for(;0!==n&&o<r.length;o++)e=(0|r.words[o])+n,this.words[o]=67108863&e,n=e>>>26;if(this.length=r.length,0!==n)this.words[this.length]=n,this.length++;else if(r!==this)for(;o<r.length;o++)this.words[o]=r.words[o];return this},o.prototype.add=function(t){var e;return 0!==t.negative&&0===this.negative?(t.negative=0,e=this.sub(t),t.negative^=1,e):0===t.negative&&0!==this.negative?(this.negative=0,e=t.sub(this),this.negative=1,e):this.length>t.length?this.clone().iadd(t):t.clone().iadd(this)},o.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e=this.iadd(t);return t.negative=1,e._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var r,i,n=this.cmp(t);if(0===n)return this.negative=0,this.length=1,this.words[0]=0,this;n>0?(r=this,i=t):(r=t,i=this);for(var o=0,s=0;s<i.length;s++)o=(e=(0|r.words[s])-(0|i.words[s])+o)>>26,this.words[s]=67108863&e;for(;0!==o&&s<r.length;s++)o=(e=(0|r.words[s])+o)>>26,this.words[s]=67108863&e;if(0===o&&s<r.length&&r!==this)for(;s<r.length;s++)this.words[s]=r.words[s];return this.length=Math.max(this.length,s),r!==this&&(this.negative=1),this.strip()},o.prototype.sub=function(t){return this.clone().isub(t)};var d=function(t,e,r){var i,n,o,s=t.words,a=e.words,u=r.words,h=0,c=0|s[0],f=8191&c,l=c>>>13,d=0|s[1],p=8191&d,g=d>>>13,y=0|s[2],m=8191&y,v=y>>>13,b=0|s[3],w=8191&b,_=b>>>13,S=0|s[4],E=8191&S,M=S>>>13,A=0|s[5],C=8191&A,k=A>>>13,I=0|s[6],T=8191&I,R=I>>>13,B=0|s[7],x=8191&B,F=B>>>13,P=0|s[8],N=8191&P,O=P>>>13,L=0|s[9],U=8191&L,j=L>>>13,D=0|a[0],K=8191&D,V=D>>>13,H=0|a[1],q=8191&H,z=H>>>13,W=0|a[2],G=8191&W,J=W>>>13,Z=0|a[3],$=8191&Z,Y=Z>>>13,Q=0|a[4],X=8191&Q,tt=Q>>>13,et=0|a[5],rt=8191&et,it=et>>>13,nt=0|a[6],ot=8191&nt,st=nt>>>13,at=0|a[7],ut=8191&at,ht=at>>>13,ct=0|a[8],ft=8191&ct,lt=ct>>>13,dt=0|a[9],pt=8191&dt,gt=dt>>>13;r.negative=t.negative^e.negative,r.length=19;var yt=(h+(i=Math.imul(f,K))|0)+((8191&(n=(n=Math.imul(f,V))+Math.imul(l,K)|0))<<13)|0;h=((o=Math.imul(l,V))+(n>>>13)|0)+(yt>>>26)|0,yt&=67108863,i=Math.imul(p,K),n=(n=Math.imul(p,V))+Math.imul(g,K)|0,o=Math.imul(g,V);var mt=(h+(i=i+Math.imul(f,q)|0)|0)+((8191&(n=(n=n+Math.imul(f,z)|0)+Math.imul(l,q)|0))<<13)|0;h=((o=o+Math.imul(l,z)|0)+(n>>>13)|0)+(mt>>>26)|0,mt&=67108863,i=Math.imul(m,K),n=(n=Math.imul(m,V))+Math.imul(v,K)|0,o=Math.imul(v,V),i=i+Math.imul(p,q)|0,n=(n=n+Math.imul(p,z)|0)+Math.imul(g,q)|0,o=o+Math.imul(g,z)|0;var vt=(h+(i=i+Math.imul(f,G)|0)|0)+((8191&(n=(n=n+Math.imul(f,J)|0)+Math.imul(l,G)|0))<<13)|0;h=((o=o+Math.imul(l,J)|0)+(n>>>13)|0)+(vt>>>26)|0,vt&=67108863,i=Math.imul(w,K),n=(n=Math.imul(w,V))+Math.imul(_,K)|0,o=Math.imul(_,V),i=i+Math.imul(m,q)|0,n=(n=n+Math.imul(m,z)|0)+Math.imul(v,q)|0,o=o+Math.imul(v,z)|0,i=i+Math.imul(p,G)|0,n=(n=n+Math.imul(p,J)|0)+Math.imul(g,G)|0,o=o+Math.imul(g,J)|0;var bt=(h+(i=i+Math.imul(f,$)|0)|0)+((8191&(n=(n=n+Math.imul(f,Y)|0)+Math.imul(l,$)|0))<<13)|0;h=((o=o+Math.imul(l,Y)|0)+(n>>>13)|0)+(bt>>>26)|0,bt&=67108863,i=Math.imul(E,K),n=(n=Math.imul(E,V))+Math.imul(M,K)|0,o=Math.imul(M,V),i=i+Math.imul(w,q)|0,n=(n=n+Math.imul(w,z)|0)+Math.imul(_,q)|0,o=o+Math.imul(_,z)|0,i=i+Math.imul(m,G)|0,n=(n=n+Math.imul(m,J)|0)+Math.imul(v,G)|0,o=o+Math.imul(v,J)|0,i=i+Math.imul(p,$)|0,n=(n=n+Math.imul(p,Y)|0)+Math.imul(g,$)|0,o=o+Math.imul(g,Y)|0;var wt=(h+(i=i+Math.imul(f,X)|0)|0)+((8191&(n=(n=n+Math.imul(f,tt)|0)+Math.imul(l,X)|0))<<13)|0;h=((o=o+Math.imul(l,tt)|0)+(n>>>13)|0)+(wt>>>26)|0,wt&=67108863,i=Math.imul(C,K),n=(n=Math.imul(C,V))+Math.imul(k,K)|0,o=Math.imul(k,V),i=i+Math.imul(E,q)|0,n=(n=n+Math.imul(E,z)|0)+Math.imul(M,q)|0,o=o+Math.imul(M,z)|0,i=i+Math.imul(w,G)|0,n=(n=n+Math.imul(w,J)|0)+Math.imul(_,G)|0,o=o+Math.imul(_,J)|0,i=i+Math.imul(m,$)|0,n=(n=n+Math.imul(m,Y)|0)+Math.imul(v,$)|0,o=o+Math.imul(v,Y)|0,i=i+Math.imul(p,X)|0,n=(n=n+Math.imul(p,tt)|0)+Math.imul(g,X)|0,o=o+Math.imul(g,tt)|0;var _t=(h+(i=i+Math.imul(f,rt)|0)|0)+((8191&(n=(n=n+Math.imul(f,it)|0)+Math.imul(l,rt)|0))<<13)|0;h=((o=o+Math.imul(l,it)|0)+(n>>>13)|0)+(_t>>>26)|0,_t&=67108863,i=Math.imul(T,K),n=(n=Math.imul(T,V))+Math.imul(R,K)|0,o=Math.imul(R,V),i=i+Math.imul(C,q)|0,n=(n=n+Math.imul(C,z)|0)+Math.imul(k,q)|0,o=o+Math.imul(k,z)|0,i=i+Math.imul(E,G)|0,n=(n=n+Math.imul(E,J)|0)+Math.imul(M,G)|0,o=o+Math.imul(M,J)|0,i=i+Math.imul(w,$)|0,n=(n=n+Math.imul(w,Y)|0)+Math.imul(_,$)|0,o=o+Math.imul(_,Y)|0,i=i+Math.imul(m,X)|0,n=(n=n+Math.imul(m,tt)|0)+Math.imul(v,X)|0,o=o+Math.imul(v,tt)|0,i=i+Math.imul(p,rt)|0,n=(n=n+Math.imul(p,it)|0)+Math.imul(g,rt)|0,o=o+Math.imul(g,it)|0;var St=(h+(i=i+Math.imul(f,ot)|0)|0)+((8191&(n=(n=n+Math.imul(f,st)|0)+Math.imul(l,ot)|0))<<13)|0;h=((o=o+Math.imul(l,st)|0)+(n>>>13)|0)+(St>>>26)|0,St&=67108863,i=Math.imul(x,K),n=(n=Math.imul(x,V))+Math.imul(F,K)|0,o=Math.imul(F,V),i=i+Math.imul(T,q)|0,n=(n=n+Math.imul(T,z)|0)+Math.imul(R,q)|0,o=o+Math.imul(R,z)|0,i=i+Math.imul(C,G)|0,n=(n=n+Math.imul(C,J)|0)+Math.imul(k,G)|0,o=o+Math.imul(k,J)|0,i=i+Math.imul(E,$)|0,n=(n=n+Math.imul(E,Y)|0)+Math.imul(M,$)|0,o=o+Math.imul(M,Y)|0,i=i+Math.imul(w,X)|0,n=(n=n+Math.imul(w,tt)|0)+Math.imul(_,X)|0,o=o+Math.imul(_,tt)|0,i=i+Math.imul(m,rt)|0,n=(n=n+Math.imul(m,it)|0)+Math.imul(v,rt)|0,o=o+Math.imul(v,it)|0,i=i+Math.imul(p,ot)|0,n=(n=n+Math.imul(p,st)|0)+Math.imul(g,ot)|0,o=o+Math.imul(g,st)|0;var Et=(h+(i=i+Math.imul(f,ut)|0)|0)+((8191&(n=(n=n+Math.imul(f,ht)|0)+Math.imul(l,ut)|0))<<13)|0;h=((o=o+Math.imul(l,ht)|0)+(n>>>13)|0)+(Et>>>26)|0,Et&=67108863,i=Math.imul(N,K),n=(n=Math.imul(N,V))+Math.imul(O,K)|0,o=Math.imul(O,V),i=i+Math.imul(x,q)|0,n=(n=n+Math.imul(x,z)|0)+Math.imul(F,q)|0,o=o+Math.imul(F,z)|0,i=i+Math.imul(T,G)|0,n=(n=n+Math.imul(T,J)|0)+Math.imul(R,G)|0,o=o+Math.imul(R,J)|0,i=i+Math.imul(C,$)|0,n=(n=n+Math.imul(C,Y)|0)+Math.imul(k,$)|0,o=o+Math.imul(k,Y)|0,i=i+Math.imul(E,X)|0,n=(n=n+Math.imul(E,tt)|0)+Math.imul(M,X)|0,o=o+Math.imul(M,tt)|0,i=i+Math.imul(w,rt)|0,n=(n=n+Math.imul(w,it)|0)+Math.imul(_,rt)|0,o=o+Math.imul(_,it)|0,i=i+Math.imul(m,ot)|0,n=(n=n+Math.imul(m,st)|0)+Math.imul(v,ot)|0,o=o+Math.imul(v,st)|0,i=i+Math.imul(p,ut)|0,n=(n=n+Math.imul(p,ht)|0)+Math.imul(g,ut)|0,o=o+Math.imul(g,ht)|0;var Mt=(h+(i=i+Math.imul(f,ft)|0)|0)+((8191&(n=(n=n+Math.imul(f,lt)|0)+Math.imul(l,ft)|0))<<13)|0;h=((o=o+Math.imul(l,lt)|0)+(n>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,i=Math.imul(U,K),n=(n=Math.imul(U,V))+Math.imul(j,K)|0,o=Math.imul(j,V),i=i+Math.imul(N,q)|0,n=(n=n+Math.imul(N,z)|0)+Math.imul(O,q)|0,o=o+Math.imul(O,z)|0,i=i+Math.imul(x,G)|0,n=(n=n+Math.imul(x,J)|0)+Math.imul(F,G)|0,o=o+Math.imul(F,J)|0,i=i+Math.imul(T,$)|0,n=(n=n+Math.imul(T,Y)|0)+Math.imul(R,$)|0,o=o+Math.imul(R,Y)|0,i=i+Math.imul(C,X)|0,n=(n=n+Math.imul(C,tt)|0)+Math.imul(k,X)|0,o=o+Math.imul(k,tt)|0,i=i+Math.imul(E,rt)|0,n=(n=n+Math.imul(E,it)|0)+Math.imul(M,rt)|0,o=o+Math.imul(M,it)|0,i=i+Math.imul(w,ot)|0,n=(n=n+Math.imul(w,st)|0)+Math.imul(_,ot)|0,o=o+Math.imul(_,st)|0,i=i+Math.imul(m,ut)|0,n=(n=n+Math.imul(m,ht)|0)+Math.imul(v,ut)|0,o=o+Math.imul(v,ht)|0,i=i+Math.imul(p,ft)|0,n=(n=n+Math.imul(p,lt)|0)+Math.imul(g,ft)|0,o=o+Math.imul(g,lt)|0;var At=(h+(i=i+Math.imul(f,pt)|0)|0)+((8191&(n=(n=n+Math.imul(f,gt)|0)+Math.imul(l,pt)|0))<<13)|0;h=((o=o+Math.imul(l,gt)|0)+(n>>>13)|0)+(At>>>26)|0,At&=67108863,i=Math.imul(U,q),n=(n=Math.imul(U,z))+Math.imul(j,q)|0,o=Math.imul(j,z),i=i+Math.imul(N,G)|0,n=(n=n+Math.imul(N,J)|0)+Math.imul(O,G)|0,o=o+Math.imul(O,J)|0,i=i+Math.imul(x,$)|0,n=(n=n+Math.imul(x,Y)|0)+Math.imul(F,$)|0,o=o+Math.imul(F,Y)|0,i=i+Math.imul(T,X)|0,n=(n=n+Math.imul(T,tt)|0)+Math.imul(R,X)|0,o=o+Math.imul(R,tt)|0,i=i+Math.imul(C,rt)|0,n=(n=n+Math.imul(C,it)|0)+Math.imul(k,rt)|0,o=o+Math.imul(k,it)|0,i=i+Math.imul(E,ot)|0,n=(n=n+Math.imul(E,st)|0)+Math.imul(M,ot)|0,o=o+Math.imul(M,st)|0,i=i+Math.imul(w,ut)|0,n=(n=n+Math.imul(w,ht)|0)+Math.imul(_,ut)|0,o=o+Math.imul(_,ht)|0,i=i+Math.imul(m,ft)|0,n=(n=n+Math.imul(m,lt)|0)+Math.imul(v,ft)|0,o=o+Math.imul(v,lt)|0;var Ct=(h+(i=i+Math.imul(p,pt)|0)|0)+((8191&(n=(n=n+Math.imul(p,gt)|0)+Math.imul(g,pt)|0))<<13)|0;h=((o=o+Math.imul(g,gt)|0)+(n>>>13)|0)+(Ct>>>26)|0,Ct&=67108863,i=Math.imul(U,G),n=(n=Math.imul(U,J))+Math.imul(j,G)|0,o=Math.imul(j,J),i=i+Math.imul(N,$)|0,n=(n=n+Math.imul(N,Y)|0)+Math.imul(O,$)|0,o=o+Math.imul(O,Y)|0,i=i+Math.imul(x,X)|0,n=(n=n+Math.imul(x,tt)|0)+Math.imul(F,X)|0,o=o+Math.imul(F,tt)|0,i=i+Math.imul(T,rt)|0,n=(n=n+Math.imul(T,it)|0)+Math.imul(R,rt)|0,o=o+Math.imul(R,it)|0,i=i+Math.imul(C,ot)|0,n=(n=n+Math.imul(C,st)|0)+Math.imul(k,ot)|0,o=o+Math.imul(k,st)|0,i=i+Math.imul(E,ut)|0,n=(n=n+Math.imul(E,ht)|0)+Math.imul(M,ut)|0,o=o+Math.imul(M,ht)|0,i=i+Math.imul(w,ft)|0,n=(n=n+Math.imul(w,lt)|0)+Math.imul(_,ft)|0,o=o+Math.imul(_,lt)|0;var kt=(h+(i=i+Math.imul(m,pt)|0)|0)+((8191&(n=(n=n+Math.imul(m,gt)|0)+Math.imul(v,pt)|0))<<13)|0;h=((o=o+Math.imul(v,gt)|0)+(n>>>13)|0)+(kt>>>26)|0,kt&=67108863,i=Math.imul(U,$),n=(n=Math.imul(U,Y))+Math.imul(j,$)|0,o=Math.imul(j,Y),i=i+Math.imul(N,X)|0,n=(n=n+Math.imul(N,tt)|0)+Math.imul(O,X)|0,o=o+Math.imul(O,tt)|0,i=i+Math.imul(x,rt)|0,n=(n=n+Math.imul(x,it)|0)+Math.imul(F,rt)|0,o=o+Math.imul(F,it)|0,i=i+Math.imul(T,ot)|0,n=(n=n+Math.imul(T,st)|0)+Math.imul(R,ot)|0,o=o+Math.imul(R,st)|0,i=i+Math.imul(C,ut)|0,n=(n=n+Math.imul(C,ht)|0)+Math.imul(k,ut)|0,o=o+Math.imul(k,ht)|0,i=i+Math.imul(E,ft)|0,n=(n=n+Math.imul(E,lt)|0)+Math.imul(M,ft)|0,o=o+Math.imul(M,lt)|0;var It=(h+(i=i+Math.imul(w,pt)|0)|0)+((8191&(n=(n=n+Math.imul(w,gt)|0)+Math.imul(_,pt)|0))<<13)|0;h=((o=o+Math.imul(_,gt)|0)+(n>>>13)|0)+(It>>>26)|0,It&=67108863,i=Math.imul(U,X),n=(n=Math.imul(U,tt))+Math.imul(j,X)|0,o=Math.imul(j,tt),i=i+Math.imul(N,rt)|0,n=(n=n+Math.imul(N,it)|0)+Math.imul(O,rt)|0,o=o+Math.imul(O,it)|0,i=i+Math.imul(x,ot)|0,n=(n=n+Math.imul(x,st)|0)+Math.imul(F,ot)|0,o=o+Math.imul(F,st)|0,i=i+Math.imul(T,ut)|0,n=(n=n+Math.imul(T,ht)|0)+Math.imul(R,ut)|0,o=o+Math.imul(R,ht)|0,i=i+Math.imul(C,ft)|0,n=(n=n+Math.imul(C,lt)|0)+Math.imul(k,ft)|0,o=o+Math.imul(k,lt)|0;var Tt=(h+(i=i+Math.imul(E,pt)|0)|0)+((8191&(n=(n=n+Math.imul(E,gt)|0)+Math.imul(M,pt)|0))<<13)|0;h=((o=o+Math.imul(M,gt)|0)+(n>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,i=Math.imul(U,rt),n=(n=Math.imul(U,it))+Math.imul(j,rt)|0,o=Math.imul(j,it),i=i+Math.imul(N,ot)|0,n=(n=n+Math.imul(N,st)|0)+Math.imul(O,ot)|0,o=o+Math.imul(O,st)|0,i=i+Math.imul(x,ut)|0,n=(n=n+Math.imul(x,ht)|0)+Math.imul(F,ut)|0,o=o+Math.imul(F,ht)|0,i=i+Math.imul(T,ft)|0,n=(n=n+Math.imul(T,lt)|0)+Math.imul(R,ft)|0,o=o+Math.imul(R,lt)|0;var Rt=(h+(i=i+Math.imul(C,pt)|0)|0)+((8191&(n=(n=n+Math.imul(C,gt)|0)+Math.imul(k,pt)|0))<<13)|0;h=((o=o+Math.imul(k,gt)|0)+(n>>>13)|0)+(Rt>>>26)|0,Rt&=67108863,i=Math.imul(U,ot),n=(n=Math.imul(U,st))+Math.imul(j,ot)|0,o=Math.imul(j,st),i=i+Math.imul(N,ut)|0,n=(n=n+Math.imul(N,ht)|0)+Math.imul(O,ut)|0,o=o+Math.imul(O,ht)|0,i=i+Math.imul(x,ft)|0,n=(n=n+Math.imul(x,lt)|0)+Math.imul(F,ft)|0,o=o+Math.imul(F,lt)|0;var Bt=(h+(i=i+Math.imul(T,pt)|0)|0)+((8191&(n=(n=n+Math.imul(T,gt)|0)+Math.imul(R,pt)|0))<<13)|0;h=((o=o+Math.imul(R,gt)|0)+(n>>>13)|0)+(Bt>>>26)|0,Bt&=67108863,i=Math.imul(U,ut),n=(n=Math.imul(U,ht))+Math.imul(j,ut)|0,o=Math.imul(j,ht),i=i+Math.imul(N,ft)|0,n=(n=n+Math.imul(N,lt)|0)+Math.imul(O,ft)|0,o=o+Math.imul(O,lt)|0;var xt=(h+(i=i+Math.imul(x,pt)|0)|0)+((8191&(n=(n=n+Math.imul(x,gt)|0)+Math.imul(F,pt)|0))<<13)|0;h=((o=o+Math.imul(F,gt)|0)+(n>>>13)|0)+(xt>>>26)|0,xt&=67108863,i=Math.imul(U,ft),n=(n=Math.imul(U,lt))+Math.imul(j,ft)|0,o=Math.imul(j,lt);var Ft=(h+(i=i+Math.imul(N,pt)|0)|0)+((8191&(n=(n=n+Math.imul(N,gt)|0)+Math.imul(O,pt)|0))<<13)|0;h=((o=o+Math.imul(O,gt)|0)+(n>>>13)|0)+(Ft>>>26)|0,Ft&=67108863;var Pt=(h+(i=Math.imul(U,pt))|0)+((8191&(n=(n=Math.imul(U,gt))+Math.imul(j,pt)|0))<<13)|0;return h=((o=Math.imul(j,gt))+(n>>>13)|0)+(Pt>>>26)|0,Pt&=67108863,u[0]=yt,u[1]=mt,u[2]=vt,u[3]=bt,u[4]=wt,u[5]=_t,u[6]=St,u[7]=Et,u[8]=Mt,u[9]=At,u[10]=Ct,u[11]=kt,u[12]=It,u[13]=Tt,u[14]=Rt,u[15]=Bt,u[16]=xt,u[17]=Ft,u[18]=Pt,0!==h&&(u[19]=h,r.length++),r};function p(t,e,r){return(new g).mulp(t,e,r)}function g(t,e){this.x=t,this.y=e}Math.imul||(d=l),o.prototype.mulTo=function(t,e){var r=this.length+t.length;return 10===this.length&&10===t.length?d(this,t,e):r<63?l(this,t,e):r<1024?function(t,e,r){r.negative=e.negative^t.negative,r.length=t.length+e.length;for(var i=0,n=0,o=0;o<r.length-1;o++){var s=n;n=0;for(var a=67108863&i,u=Math.min(o,e.length-1),h=Math.max(0,o-t.length+1);h<=u;h++){var c=o-h,f=(0|t.words[c])*(0|e.words[h]),l=67108863&f;a=67108863&(l=l+a|0),n+=(s=(s=s+(f/67108864|0)|0)+(l>>>26)|0)>>>26,s&=67108863}r.words[o]=a,i=s,s=n}return 0!==i?r.words[o]=i:r.length--,r.strip()}(this,t,e):p(this,t,e)},g.prototype.makeRBT=function(t){for(var e=new Array(t),r=o.prototype._countBits(t)-1,i=0;i<t;i++)e[i]=this.revBin(i,r,t);return e},g.prototype.revBin=function(t,e,r){if(0===t||t===r-1)return t;for(var i=0,n=0;n<e;n++)i|=(1&t)<<e-n-1,t>>=1;return i},g.prototype.permute=function(t,e,r,i,n,o){for(var s=0;s<o;s++)i[s]=e[t[s]],n[s]=r[t[s]]},g.prototype.transform=function(t,e,r,i,n,o){this.permute(o,t,e,r,i,n);for(var s=1;s<n;s<<=1)for(var a=s<<1,u=Math.cos(2*Math.PI/a),h=Math.sin(2*Math.PI/a),c=0;c<n;c+=a)for(var f=u,l=h,d=0;d<s;d++){var p=r[c+d],g=i[c+d],y=r[c+d+s],m=i[c+d+s],v=f*y-l*m;m=f*m+l*y,y=v,r[c+d]=p+y,i[c+d]=g+m,r[c+d+s]=p-y,i[c+d+s]=g-m,d!==a&&(v=u*f-h*l,l=u*l+h*f,f=v)}},g.prototype.guessLen13b=function(t,e){var r=1|Math.max(e,t),i=1&r,n=0;for(r=r/2|0;r;r>>>=1)n++;return 1<<n+1+i},g.prototype.conjugate=function(t,e,r){if(!(r<=1))for(var i=0;i<r/2;i++){var n=t[i];t[i]=t[r-i-1],t[r-i-1]=n,n=e[i],e[i]=-e[r-i-1],e[r-i-1]=-n}},g.prototype.normalize13b=function(t,e){for(var r=0,i=0;i<e/2;i++){var n=8192*Math.round(t[2*i+1]/e)+Math.round(t[2*i]/e)+r;t[i]=67108863&n,r=n<67108864?0:n/67108864|0}return t},g.prototype.convert13b=function(t,e,r,n){for(var o=0,s=0;s<e;s++)o+=0|t[s],r[2*s]=8191&o,o>>>=13,r[2*s+1]=8191&o,o>>>=13;for(s=2*e;s<n;++s)r[s]=0;i(0===o),i(0==(-8192&o))},g.prototype.stub=function(t){for(var e=new Array(t),r=0;r<t;r++)e[r]=0;return e},g.prototype.mulp=function(t,e,r){var i=2*this.guessLen13b(t.length,e.length),n=this.makeRBT(i),o=this.stub(i),s=new Array(i),a=new Array(i),u=new Array(i),h=new Array(i),c=new Array(i),f=new Array(i),l=r.words;l.length=i,this.convert13b(t.words,t.length,s,i),this.convert13b(e.words,e.length,h,i),this.transform(s,o,a,u,i,n),this.transform(h,o,c,f,i,n);for(var d=0;d<i;d++){var p=a[d]*c[d]-u[d]*f[d];u[d]=a[d]*f[d]+u[d]*c[d],a[d]=p}return this.conjugate(a,u,i),this.transform(a,u,l,o,i,n),this.conjugate(l,o,i),this.normalize13b(l,i),r.negative=t.negative^e.negative,r.length=t.length+e.length,r.strip()},o.prototype.mul=function(t){var e=new o(null);return e.words=new Array(this.length+t.length),this.mulTo(t,e)},o.prototype.mulf=function(t){var e=new o(null);return e.words=new Array(this.length+t.length),p(this,t,e)},o.prototype.imul=function(t){return this.clone().mulTo(t,this)},o.prototype.imuln=function(t){i("number"==typeof t),i(t<67108864);for(var e=0,r=0;r<this.length;r++){var n=(0|this.words[r])*t,o=(67108863&n)+(67108863&e);e>>=26,e+=n/67108864|0,e+=o>>>26,this.words[r]=67108863&o}return 0!==e&&(this.words[r]=e,this.length++),this},o.prototype.muln=function(t){return this.clone().imuln(t)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(t){var e=function(t){for(var e=new Array(t.bitLength()),r=0;r<e.length;r++){var i=r/26|0,n=r%26;e[r]=(t.words[i]&1<<n)>>>n}return e}(t);if(0===e.length)return new o(1);for(var r=this,i=0;i<e.length&&0===e[i];i++,r=r.sqr());if(++i<e.length)for(var n=r.sqr();i<e.length;i++,n=n.sqr())0!==e[i]&&(r=r.mul(n));return r},o.prototype.iushln=function(t){i("number"==typeof t&&t>=0);var e,r=t%26,n=(t-r)/26,o=67108863>>>26-r<<26-r;if(0!==r){var s=0;for(e=0;e<this.length;e++){var a=this.words[e]&o,u=(0|this.words[e])-a<<r;this.words[e]=u|s,s=a>>>26-r}s&&(this.words[e]=s,this.length++)}if(0!==n){for(e=this.length-1;e>=0;e--)this.words[e+n]=this.words[e];for(e=0;e<n;e++)this.words[e]=0;this.length+=n}return this.strip()},o.prototype.ishln=function(t){return i(0===this.negative),this.iushln(t)},o.prototype.iushrn=function(t,e,r){var n;i("number"==typeof t&&t>=0),n=e?(e-e%26)/26:0;var o=t%26,s=Math.min((t-o)/26,this.length),a=67108863^67108863>>>o<<o,u=r;if(n-=s,n=Math.max(0,n),u){for(var h=0;h<s;h++)u.words[h]=this.words[h];u.length=s}if(0===s);else if(this.length>s)for(this.length-=s,h=0;h<this.length;h++)this.words[h]=this.words[h+s];else this.words[0]=0,this.length=1;var c=0;for(h=this.length-1;h>=0&&(0!==c||h>=n);h--){var f=0|this.words[h];this.words[h]=c<<26-o|f>>>o,c=f&a}return u&&0!==c&&(u.words[u.length++]=c),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},o.prototype.ishrn=function(t,e,r){return i(0===this.negative),this.iushrn(t,e,r)},o.prototype.shln=function(t){return this.clone().ishln(t)},o.prototype.ushln=function(t){return this.clone().iushln(t)},o.prototype.shrn=function(t){return this.clone().ishrn(t)},o.prototype.ushrn=function(t){return this.clone().iushrn(t)},o.prototype.testn=function(t){i("number"==typeof t&&t>=0);var e=t%26,r=(t-e)/26,n=1<<e;return!(this.length<=r||!(this.words[r]&n))},o.prototype.imaskn=function(t){i("number"==typeof t&&t>=0);var e=t%26,r=(t-e)/26;if(i(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==e&&r++,this.length=Math.min(r,this.length),0!==e){var n=67108863^67108863>>>e<<e;this.words[this.length-1]&=n}return this.strip()},o.prototype.maskn=function(t){return this.clone().imaskn(t)},o.prototype.iaddn=function(t){return i("number"==typeof t),i(t<67108864),t<0?this.isubn(-t):0!==this.negative?1===this.length&&(0|this.words[0])<t?(this.words[0]=t-(0|this.words[0]),this.negative=0,this):(this.negative=0,this.isubn(t),this.negative=1,this):this._iaddn(t)},o.prototype._iaddn=function(t){this.words[0]+=t;for(var e=0;e<this.length&&this.words[e]>=67108864;e++)this.words[e]-=67108864,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},o.prototype.isubn=function(t){if(i("number"==typeof t),i(t<67108864),t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var e=0;e<this.length&&this.words[e]<0;e++)this.words[e]+=67108864,this.words[e+1]-=1;return this.strip()},o.prototype.addn=function(t){return this.clone().iaddn(t)},o.prototype.subn=function(t){return this.clone().isubn(t)},o.prototype.iabs=function(){return this.negative=0,this},o.prototype.abs=function(){return this.clone().iabs()},o.prototype._ishlnsubmul=function(t,e,r){var n,o,s=t.length+r;this._expand(s);var a=0;for(n=0;n<t.length;n++){o=(0|this.words[n+r])+a;var u=(0|t.words[n])*e;a=((o-=67108863&u)>>26)-(u/67108864|0),this.words[n+r]=67108863&o}for(;n<this.length-r;n++)a=(o=(0|this.words[n+r])+a)>>26,this.words[n+r]=67108863&o;if(0===a)return this.strip();for(i(-1===a),a=0,n=0;n<this.length;n++)a=(o=-(0|this.words[n])+a)>>26,this.words[n]=67108863&o;return this.negative=1,this.strip()},o.prototype._wordDiv=function(t,e){var r=(this.length,t.length),i=this.clone(),n=t,s=0|n.words[n.length-1];0!=(r=26-this._countBits(s))&&(n=n.ushln(r),i.iushln(r),s=0|n.words[n.length-1]);var a,u=i.length-n.length;if("mod"!==e){(a=new o(null)).length=u+1,a.words=new Array(a.length);for(var h=0;h<a.length;h++)a.words[h]=0}var c=i.clone()._ishlnsubmul(n,1,u);0===c.negative&&(i=c,a&&(a.words[u]=1));for(var f=u-1;f>=0;f--){var l=67108864*(0|i.words[n.length+f])+(0|i.words[n.length+f-1]);for(l=Math.min(l/s|0,67108863),i._ishlnsubmul(n,l,f);0!==i.negative;)l--,i.negative=0,i._ishlnsubmul(n,1,f),i.isZero()||(i.negative^=1);a&&(a.words[f]=l)}return a&&a.strip(),i.strip(),"div"!==e&&0!==r&&i.iushrn(r),{div:a||null,mod:i}},o.prototype.divmod=function(t,e,r){return i(!t.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===t.negative?(a=this.neg().divmod(t,e),"mod"!==e&&(n=a.div.neg()),"div"!==e&&(s=a.mod.neg(),r&&0!==s.negative&&s.iadd(t)),{div:n,mod:s}):0===this.negative&&0!==t.negative?(a=this.divmod(t.neg(),e),"mod"!==e&&(n=a.div.neg()),{div:n,mod:a.mod}):0!=(this.negative&t.negative)?(a=this.neg().divmod(t.neg(),e),"div"!==e&&(s=a.mod.neg(),r&&0!==s.negative&&s.isub(t)),{div:a.div,mod:s}):t.length>this.length||this.cmp(t)<0?{div:new o(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new o(this.modn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new o(this.modn(t.words[0]))}:this._wordDiv(t,e);var n,s,a},o.prototype.div=function(t){return this.divmod(t,"div",!1).div},o.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},o.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},o.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var r=0!==e.div.negative?e.mod.isub(t):e.mod,i=t.ushrn(1),n=t.andln(1),o=r.cmp(i);return o<0||1===n&&0===o?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},o.prototype.modn=function(t){i(t<=67108863);for(var e=(1<<26)%t,r=0,n=this.length-1;n>=0;n--)r=(e*r+(0|this.words[n]))%t;return r},o.prototype.idivn=function(t){i(t<=67108863);for(var e=0,r=this.length-1;r>=0;r--){var n=(0|this.words[r])+67108864*e;this.words[r]=n/t|0,e=n%t}return this.strip()},o.prototype.divn=function(t){return this.clone().idivn(t)},o.prototype.egcd=function(t){i(0===t.negative),i(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var n=new o(1),s=new o(0),a=new o(0),u=new o(1),h=0;e.isEven()&&r.isEven();)e.iushrn(1),r.iushrn(1),++h;for(var c=r.clone(),f=e.clone();!e.isZero();){for(var l=0,d=1;0==(e.words[0]&d)&&l<26;++l,d<<=1);if(l>0)for(e.iushrn(l);l-- >0;)(n.isOdd()||s.isOdd())&&(n.iadd(c),s.isub(f)),n.iushrn(1),s.iushrn(1);for(var p=0,g=1;0==(r.words[0]&g)&&p<26;++p,g<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(a.isOdd()||u.isOdd())&&(a.iadd(c),u.isub(f)),a.iushrn(1),u.iushrn(1);e.cmp(r)>=0?(e.isub(r),n.isub(a),s.isub(u)):(r.isub(e),a.isub(n),u.isub(s))}return{a,b:u,gcd:r.iushln(h)}},o.prototype._invmp=function(t){i(0===t.negative),i(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var n,s=new o(1),a=new o(0),u=r.clone();e.cmpn(1)>0&&r.cmpn(1)>0;){for(var h=0,c=1;0==(e.words[0]&c)&&h<26;++h,c<<=1);if(h>0)for(e.iushrn(h);h-- >0;)s.isOdd()&&s.iadd(u),s.iushrn(1);for(var f=0,l=1;0==(r.words[0]&l)&&f<26;++f,l<<=1);if(f>0)for(r.iushrn(f);f-- >0;)a.isOdd()&&a.iadd(u),a.iushrn(1);e.cmp(r)>=0?(e.isub(r),s.isub(a)):(r.isub(e),a.isub(s))}return(n=0===e.cmpn(1)?s:a).cmpn(0)<0&&n.iadd(t),n},o.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),r=t.clone();e.negative=0,r.negative=0;for(var i=0;e.isEven()&&r.isEven();i++)e.iushrn(1),r.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;r.isEven();)r.iushrn(1);var n=e.cmp(r);if(n<0){var o=e;e=r,r=o}else if(0===n||0===r.cmpn(1))break;e.isub(r)}return r.iushln(i)},o.prototype.invm=function(t){return this.egcd(t).a.umod(t)},o.prototype.isEven=function(){return 0==(1&this.words[0])},o.prototype.isOdd=function(){return 1==(1&this.words[0])},o.prototype.andln=function(t){return this.words[0]&t},o.prototype.bincn=function(t){i("number"==typeof t);var e=t%26,r=(t-e)/26,n=1<<e;if(this.length<=r)return this._expand(r+1),this.words[r]|=n,this;for(var o=n,s=r;0!==o&&s<this.length;s++){var a=0|this.words[s];o=(a+=o)>>>26,a&=67108863,this.words[s]=a}return 0!==o&&(this.words[s]=o,this.length++),this},o.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},o.prototype.cmpn=function(t){var e,r=t<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this.strip(),this.length>1)e=1;else{r&&(t=-t),i(t<=67108863,"Number is too big");var n=0|this.words[0];e=n===t?0:n<t?-1:1}return 0!==this.negative?0|-e:e},o.prototype.cmp=function(t){if(0!==this.negative&&0===t.negative)return-1;if(0===this.negative&&0!==t.negative)return 1;var e=this.ucmp(t);return 0!==this.negative?0|-e:e},o.prototype.ucmp=function(t){if(this.length>t.length)return 1;if(this.length<t.length)return-1;for(var e=0,r=this.length-1;r>=0;r--){var i=0|this.words[r],n=0|t.words[r];if(i!==n){i<n?e=-1:i>n&&(e=1);break}}return e},o.prototype.gtn=function(t){return 1===this.cmpn(t)},o.prototype.gt=function(t){return 1===this.cmp(t)},o.prototype.gten=function(t){return this.cmpn(t)>=0},o.prototype.gte=function(t){return this.cmp(t)>=0},o.prototype.ltn=function(t){return-1===this.cmpn(t)},o.prototype.lt=function(t){return-1===this.cmp(t)},o.prototype.lten=function(t){return this.cmpn(t)<=0},o.prototype.lte=function(t){return this.cmp(t)<=0},o.prototype.eqn=function(t){return 0===this.cmpn(t)},o.prototype.eq=function(t){return 0===this.cmp(t)},o.red=function(t){return new S(t)},o.prototype.toRed=function(t){return i(!this.red,"Already a number in reduction context"),i(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},o.prototype.fromRed=function(){return i(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(t){return this.red=t,this},o.prototype.forceRed=function(t){return i(!this.red,"Already a number in reduction context"),this._forceRed(t)},o.prototype.redAdd=function(t){return i(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},o.prototype.redIAdd=function(t){return i(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},o.prototype.redSub=function(t){return i(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},o.prototype.redISub=function(t){return i(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},o.prototype.redShl=function(t){return i(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},o.prototype.redMul=function(t){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},o.prototype.redIMul=function(t){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},o.prototype.redSqr=function(){return i(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return i(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return i(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return i(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return i(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(t){return i(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var y={k256:null,p224:null,p192:null,p25519:null};function m(t,e){this.name=t,this.p=new o(e,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function v(){m.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function b(){m.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function w(){m.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function _(){m.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function S(t){if("string"==typeof t){var e=o._prime(t);this.m=e.p,this.prime=e}else i(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function E(t){S.call(this,t),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new o(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}m.prototype._tmp=function(){var t=new o(null);return t.words=new Array(Math.ceil(this.n/13)),t},m.prototype.ireduce=function(t){var e,r=t;do{this.split(r,this.tmp),e=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(e>this.n);var i=e<this.n?-1:r.ucmp(this.p);return 0===i?(r.words[0]=0,r.length=1):i>0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},m.prototype.split=function(t,e){t.iushrn(this.n,0,e)},m.prototype.imulK=function(t){return t.imul(this.k)},n(v,m),v.prototype.split=function(t,e){for(var r=4194303,i=Math.min(t.length,9),n=0;n<i;n++)e.words[n]=t.words[n];if(e.length=i,t.length<=9)return t.words[0]=0,void(t.length=1);var o=t.words[9];for(e.words[e.length++]=o&r,n=10;n<t.length;n++){var s=0|t.words[n];t.words[n-10]=(s&r)<<4|o>>>22,o=s}o>>>=22,t.words[n-10]=o,0===o&&t.length>10?t.length-=10:t.length-=9},v.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,r=0;r<t.length;r++){var i=0|t.words[r];e+=977*i,t.words[r]=67108863&e,e=64*i+(e/67108864|0)}return 0===t.words[t.length-1]&&(t.length--,0===t.words[t.length-1]&&t.length--),t},n(b,m),n(w,m),n(_,m),_.prototype.imulK=function(t){for(var e=0,r=0;r<t.length;r++){var i=19*(0|t.words[r])+e,n=67108863&i;i>>>=26,t.words[r]=n,e=i}return 0!==e&&(t.words[t.length++]=e),t},o._prime=function(t){if(y[t])return y[t];var e;if("k256"===t)e=new v;else if("p224"===t)e=new b;else if("p192"===t)e=new w;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new _}return y[t]=e,e},S.prototype._verify1=function(t){i(0===t.negative,"red works only with positives"),i(t.red,"red works only with red numbers")},S.prototype._verify2=function(t,e){i(0==(t.negative|e.negative),"red works only with positives"),i(t.red&&t.red===e.red,"red works only with red numbers")},S.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.umod(this.m)._forceRed(this)},S.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},S.prototype.add=function(t,e){this._verify2(t,e);var r=t.add(e);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},S.prototype.iadd=function(t,e){this._verify2(t,e);var r=t.iadd(e);return r.cmp(this.m)>=0&&r.isub(this.m),r},S.prototype.sub=function(t,e){this._verify2(t,e);var r=t.sub(e);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},S.prototype.isub=function(t,e){this._verify2(t,e);var r=t.isub(e);return r.cmpn(0)<0&&r.iadd(this.m),r},S.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},S.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},S.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},S.prototype.isqr=function(t){return this.imul(t,t.clone())},S.prototype.sqr=function(t){return this.mul(t,t)},S.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(i(e%2==1),3===e){var r=this.m.add(new o(1)).iushrn(2);return this.pow(t,r)}for(var n=this.m.subn(1),s=0;!n.isZero()&&0===n.andln(1);)s++,n.iushrn(1);i(!n.isZero());var a=new o(1).toRed(this),u=a.redNeg(),h=this.m.subn(1).iushrn(1),c=this.m.bitLength();for(c=new o(2*c*c).toRed(this);0!==this.pow(c,h).cmp(u);)c.redIAdd(u);for(var f=this.pow(c,n),l=this.pow(t,n.addn(1).iushrn(1)),d=this.pow(t,n),p=s;0!==d.cmp(a);){for(var g=d,y=0;0!==g.cmp(a);y++)g=g.redSqr();i(y<p);var m=this.pow(f,new o(1).iushln(p-y-1));l=l.redMul(m),f=m.redSqr(),d=d.redMul(f),p=y}return l},S.prototype.invm=function(t){var e=t._invmp(this.m);return 0!==e.negative?(e.negative=0,this.imod(e).redNeg()):this.imod(e)},S.prototype.pow=function(t,e){if(e.isZero())return new o(1).toRed(this);if(0===e.cmpn(1))return t.clone();var r=new Array(16);r[0]=new o(1).toRed(this),r[1]=t;for(var i=2;i<r.length;i++)r[i]=this.mul(r[i-1],t);var n=r[0],s=0,a=0,u=e.bitLength()%26;for(0===u&&(u=26),i=e.length-1;i>=0;i--){for(var h=e.words[i],c=u-1;c>=0;c--){var f=h>>c&1;n!==r[0]&&(n=this.sqr(n)),0!==f||0!==s?(s<<=1,s|=f,(4==++a||0===i&&0===c)&&(n=this.mul(n,r[s]),a=0,s=0)):a=0}u=26}return n},S.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},S.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},o.mont=function(t){return new E(t)},n(E,S),E.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},E.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},E.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var r=t.imul(e),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(i).iushrn(this.shift),o=n;return n.cmp(this.m)>=0?o=n.isub(this.m):n.cmpn(0)<0&&(o=n.iadd(this.m)),o._forceRed(this)},E.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new o(0)._forceRed(this);var r=t.mul(e),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(i).iushrn(this.shift),s=n;return n.cmp(this.m)>=0?s=n.isub(this.m):n.cmpn(0)<0&&(s=n.iadd(this.m)),s._forceRed(this)},E.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(t=r.nmd(t),this)},16314:(t,e,r)=>{"use strict";var i=r(2190);t.exports=function(){return i(["BigInt64Array","BigUint64Array","Float32Array","Float64Array","Int16Array","Int32Array","Int8Array","Uint16Array","Uint32Array","Uint8Array","Uint8ClampedArray"],(function(t){return"function"==typeof r.g[t]}))}},79742:(t,e)=>{"use strict";e.byteLength=function(t){var e=u(t),r=e[0],i=e[1];return 3*(r+i)/4-i},e.toByteArray=function(t){var e,r,o=u(t),s=o[0],a=o[1],h=new n(function(t,e,r){return 3*(e+r)/4-r}(0,s,a)),c=0,f=a>0?s-4:s;for(r=0;r<f;r+=4)e=i[t.charCodeAt(r)]<<18|i[t.charCodeAt(r+1)]<<12|i[t.charCodeAt(r+2)]<<6|i[t.charCodeAt(r+3)],h[c++]=e>>16&255,h[c++]=e>>8&255,h[c++]=255&e;return 2===a&&(e=i[t.charCodeAt(r)]<<2|i[t.charCodeAt(r+1)]>>4,h[c++]=255&e),1===a&&(e=i[t.charCodeAt(r)]<<10|i[t.charCodeAt(r+1)]<<4|i[t.charCodeAt(r+2)]>>2,h[c++]=e>>8&255,h[c++]=255&e),h},e.fromByteArray=function(t){for(var e,i=t.length,n=i%3,o=[],s=16383,a=0,u=i-n;a<u;a+=s)o.push(h(t,a,a+s>u?u:a+s));return 1===n?(e=t[i-1],o.push(r[e>>2]+r[e<<4&63]+"==")):2===n&&(e=(t[i-2]<<8)+t[i-1],o.push(r[e>>10]+r[e>>4&63]+r[e<<2&63]+"=")),o.join("")};for(var r=[],i=[],n="undefined"!=typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0,a=o.length;s<a;++s)r[s]=o[s],i[o.charCodeAt(s)]=s;function u(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");return-1===r&&(r=e),[r,r===e?0:4-r%4]}function h(t,e,i){for(var n,o,s=[],a=e;a<i;a+=3)n=(t[a]<<16&16711680)+(t[a+1]<<8&65280)+(255&t[a+2]),s.push(r[(o=n)>>18&63]+r[o>>12&63]+r[o>>6&63]+r[63&o]);return s.join("")}i["-".charCodeAt(0)]=62,i["_".charCodeAt(0)]=63},82240:(t,e,r)=>{"use strict";var i=r(31518);function n(t,e){return void 0===e&&(e="utf8"),Buffer.isBuffer(t)?s(t.toString("base64")):s(Buffer.from(t,e).toString("base64"))}function o(t){return t=t.toString(),i.default(t).replace(/\-/g,"+").replace(/_/g,"/")}function s(t){return t.replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}var a=n;a.encode=n,a.decode=function(t,e){return void 0===e&&(e="utf8"),Buffer.from(o(t),"base64").toString(e)},a.toBase64=o,a.fromBase64=s,a.toBuffer=function(t){return Buffer.from(o(t),"base64")},e.default=a},31518:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t){var e=t.length,r=e%4;if(!r)return t;var i=e,n=4-r,o=e+n,s=Buffer.alloc(o);for(s.write(t);n--;)s.write("=",i++);return s.toString()}},45772:(t,e,r)=>{t.exports=r(82240).default,t.exports.default=t.exports},13550:function(t,e,r){!function(t,e){"use strict";function i(t,e){if(!t)throw new Error(e||"Assertion failed")}function n(t,e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}function o(t,e,r){if(o.isBN(t))return t;this.negative=0,this.words=null,this.length=0,this.red=null,null!==t&&("le"!==e&&"be"!==e||(r=e,e=10),this._init(t||0,e||10,r||"be"))}var s;"object"==typeof t?t.exports=o:e.BN=o,o.BN=o,o.wordSize=26;try{s=r(32574).Buffer}catch(t){}function a(t,e,r){for(var n=0,o=Math.min(t.length,r),s=0,a=e;a<o;a++){var u,h=t.charCodeAt(a)-48;n<<=4,n|=u=h>=49&&h<=54?h-49+10:h>=17&&h<=22?h-17+10:h,s|=u}return i(!(240&s),"Invalid character in "+t),n}function u(t,e,r,n){for(var o=0,s=0,a=Math.min(t.length,r),u=e;u<a;u++){var h=t.charCodeAt(u)-48;o*=n,s=h>=49?h-49+10:h>=17?h-17+10:h,i(h>=0&&s<n,"Invalid character"),o+=s}return o}function h(t,e){t.words=e.words,t.length=e.length,t.negative=e.negative,t.red=e.red}if(o.isBN=function(t){return t instanceof o||null!==t&&"object"==typeof t&&t.constructor.wordSize===o.wordSize&&Array.isArray(t.words)},o.max=function(t,e){return t.cmp(e)>0?t:e},o.min=function(t,e){return t.cmp(e)<0?t:e},o.prototype._init=function(t,e,r){if("number"==typeof t)return this._initNumber(t,e,r);if("object"==typeof t)return this._initArray(t,e,r);"hex"===e&&(e=16),i(e===(0|e)&&e>=2&&e<=36);var n=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&n++,16===e?this._parseHex(t,n):this._parseBase(t,e,n),"-"===t[0]&&(this.negative=1),this._strip(),"le"===r&&this._initArray(this.toArray(),e,r)},o.prototype._initNumber=function(t,e,r){t<0&&(this.negative=1,t=-t),t<67108864?(this.words=[67108863&t],this.length=1):t<4503599627370496?(this.words=[67108863&t,t/67108864&67108863],this.length=2):(i(t<9007199254740992),this.words=[67108863&t,t/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),e,r)},o.prototype._initArray=function(t,e,r){if(i("number"==typeof t.length),t.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(t.length/3),this.words=new Array(this.length);for(var n=0;n<this.length;n++)this.words[n]=0;var o,s,a=0;if("be"===r)for(n=t.length-1,o=0;n>=0;n-=3)s=t[n]|t[n-1]<<8|t[n-2]<<16,this.words[o]|=s<<a&67108863,this.words[o+1]=s>>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);else if("le"===r)for(n=0,o=0;n<t.length;n+=3)s=t[n]|t[n+1]<<8|t[n+2]<<16,this.words[o]|=s<<a&67108863,this.words[o+1]=s>>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);return this._strip()},o.prototype._parseHex=function(t,e){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var r=0;r<this.length;r++)this.words[r]=0;var i,n,o=0;for(r=t.length-6,i=0;r>=e;r-=6)n=a(t,r,r+6),this.words[i]|=n<<o&67108863,this.words[i+1]|=n>>>26-o&4194303,(o+=24)>=26&&(o-=26,i++);r+6!==e&&(n=a(t,e,r+6),this.words[i]|=n<<o&67108863,this.words[i+1]|=n>>>26-o&4194303),this._strip()},o.prototype._parseBase=function(t,e,r){this.words=[0],this.length=1;for(var i=0,n=1;n<=67108863;n*=e)i++;i--,n=n/e|0;for(var o=t.length-r,s=o%i,a=Math.min(o,o-s)+r,h=0,c=r;c<a;c+=i)h=u(t,c,c+i,e),this.imuln(n),this.words[0]+h<67108864?this.words[0]+=h:this._iaddn(h);if(0!==s){var f=1;for(h=u(t,c,t.length,e),c=0;c<s;c++)f*=e;this.imuln(f),this.words[0]+h<67108864?this.words[0]+=h:this._iaddn(h)}},o.prototype.copy=function(t){t.words=new Array(this.length);for(var e=0;e<this.length;e++)t.words[e]=this.words[e];t.length=this.length,t.negative=this.negative,t.red=this.red},o.prototype._move=function(t){h(t,this)},o.prototype.clone=function(){var t=new o(null);return this.copy(t),t},o.prototype._expand=function(t){for(;this.length<t;)this.words[this.length++]=0;return this},o.prototype._strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},o.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},"undefined"!=typeof Symbol&&"function"==typeof Symbol.for)try{o.prototype[Symbol.for("nodejs.util.inspect.custom")]=c}catch(t){o.prototype.inspect=c}else o.prototype.inspect=c;function c(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"}var f=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],l=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],d=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function p(t,e,r){r.negative=e.negative^t.negative;var i=t.length+e.length|0;r.length=i,i=i-1|0;var n=0|t.words[0],o=0|e.words[0],s=n*o,a=67108863&s,u=s/67108864|0;r.words[0]=a;for(var h=1;h<i;h++){for(var c=u>>>26,f=67108863&u,l=Math.min(h,e.length-1),d=Math.max(0,h-t.length+1);d<=l;d++){var p=h-d|0;c+=(s=(n=0|t.words[p])*(o=0|e.words[d])+f)/67108864|0,f=67108863&s}r.words[h]=0|f,u=0|c}return 0!==u?r.words[h]=0|u:r.length--,r._strip()}o.prototype.toString=function(t,e){var r;if(e=0|e||1,16===(t=t||10)||"hex"===t){r="";for(var n=0,o=0,s=0;s<this.length;s++){var a=this.words[s],u=(16777215&(a<<n|o)).toString(16);r=0!=(o=a>>>24-n&16777215)||s!==this.length-1?f[6-u.length]+u+r:u+r,(n+=2)>=26&&(n-=26,s--)}for(0!==o&&(r=o.toString(16)+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(t===(0|t)&&t>=2&&t<=36){var h=l[t],c=d[t];r="";var p=this.clone();for(p.negative=0;!p.isZero();){var g=p.modrn(c).toString(t);r=(p=p.idivn(c)).isZero()?g+r:f[h-g.length]+g+r}for(this.isZero()&&(r="0"+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}i(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:this.length>2&&i(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},o.prototype.toJSON=function(){return this.toString(16,2)},s&&(o.prototype.toBuffer=function(t,e){return this.toArrayLike(s,t,e)}),o.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)},o.prototype.toArrayLike=function(t,e,r){this._strip();var n=this.byteLength(),o=r||Math.max(1,n);i(n<=o,"byte array longer than desired length"),i(o>0,"Requested array length <= 0");var s=function(t,e){return t.allocUnsafe?t.allocUnsafe(e):new t(e)}(t,o);return this["_toArrayLike"+("le"===e?"LE":"BE")](s,n),s},o.prototype._toArrayLikeLE=function(t,e){for(var r=0,i=0,n=0,o=0;n<this.length;n++){var s=this.words[n]<<o|i;t[r++]=255&s,r<t.length&&(t[r++]=s>>8&255),r<t.length&&(t[r++]=s>>16&255),6===o?(r<t.length&&(t[r++]=s>>24&255),i=0,o=0):(i=s>>>24,o+=2)}if(r<t.length)for(t[r++]=i;r<t.length;)t[r++]=0},o.prototype._toArrayLikeBE=function(t,e){for(var r=t.length-1,i=0,n=0,o=0;n<this.length;n++){var s=this.words[n]<<o|i;t[r--]=255&s,r>=0&&(t[r--]=s>>8&255),r>=0&&(t[r--]=s>>16&255),6===o?(r>=0&&(t[r--]=s>>24&255),i=0,o=0):(i=s>>>24,o+=2)}if(r>=0)for(t[r--]=i;r>=0;)t[r--]=0},Math.clz32?o.prototype._countBits=function(t){return 32-Math.clz32(t)}:o.prototype._countBits=function(t){var e=t,r=0;return e>=4096&&(r+=13,e>>>=13),e>=64&&(r+=7,e>>>=7),e>=8&&(r+=4,e>>>=4),e>=2&&(r+=2,e>>>=2),r+e},o.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,r=0;return 0==(8191&e)&&(r+=13,e>>>=13),0==(127&e)&&(r+=7,e>>>=7),0==(15&e)&&(r+=4,e>>>=4),0==(3&e)&&(r+=2,e>>>=2),0==(1&e)&&r++,r},o.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;e<this.length;e++){var r=this._zeroBits(this.words[e]);if(t+=r,26!==r)break}return t},o.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},o.prototype.toTwos=function(t){return 0!==this.negative?this.abs().inotn(t).iaddn(1):this.clone()},o.prototype.fromTwos=function(t){return this.testn(t-1)?this.notn(t).iaddn(1).ineg():this.clone()},o.prototype.isNeg=function(){return 0!==this.negative},o.prototype.neg=function(){return this.clone().ineg()},o.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},o.prototype.iuor=function(t){for(;this.length<t.length;)this.words[this.length++]=0;for(var e=0;e<t.length;e++)this.words[e]=this.words[e]|t.words[e];return this._strip()},o.prototype.ior=function(t){return i(0==(this.negative|t.negative)),this.iuor(t)},o.prototype.or=function(t){return this.length>t.length?this.clone().ior(t):t.clone().ior(this)},o.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},o.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var r=0;r<e.length;r++)this.words[r]=this.words[r]&t.words[r];return this.length=e.length,this._strip()},o.prototype.iand=function(t){return i(0==(this.negative|t.negative)),this.iuand(t)},o.prototype.and=function(t){return this.length>t.length?this.clone().iand(t):t.clone().iand(this)},o.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},o.prototype.iuxor=function(t){var e,r;this.length>t.length?(e=this,r=t):(e=t,r=this);for(var i=0;i<r.length;i++)this.words[i]=e.words[i]^r.words[i];if(this!==e)for(;i<e.length;i++)this.words[i]=e.words[i];return this.length=e.length,this._strip()},o.prototype.ixor=function(t){return i(0==(this.negative|t.negative)),this.iuxor(t)},o.prototype.xor=function(t){return this.length>t.length?this.clone().ixor(t):t.clone().ixor(this)},o.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},o.prototype.inotn=function(t){i("number"==typeof t&&t>=0);var e=0|Math.ceil(t/26),r=t%26;this._expand(e),r>0&&e--;for(var n=0;n<e;n++)this.words[n]=67108863&~this.words[n];return r>0&&(this.words[n]=~this.words[n]&67108863>>26-r),this._strip()},o.prototype.notn=function(t){return this.clone().inotn(t)},o.prototype.setn=function(t,e){i("number"==typeof t&&t>=0);var r=t/26|0,n=t%26;return this._expand(r+1),this.words[r]=e?this.words[r]|1<<n:this.words[r]&~(1<<n),this._strip()},o.prototype.iadd=function(t){var e,r,i;if(0!==this.negative&&0===t.negative)return this.negative=0,e=this.isub(t),this.negative^=1,this._normSign();if(0===this.negative&&0!==t.negative)return t.negative=0,e=this.isub(t),t.negative=1,e._normSign();this.length>t.length?(r=this,i=t):(r=t,i=this);for(var n=0,o=0;o<i.length;o++)e=(0|r.words[o])+(0|i.words[o])+n,this.words[o]=67108863&e,n=e>>>26;for(;0!==n&&o<r.length;o++)e=(0|r.words[o])+n,this.words[o]=67108863&e,n=e>>>26;if(this.length=r.length,0!==n)this.words[this.length]=n,this.length++;else if(r!==this)for(;o<r.length;o++)this.words[o]=r.words[o];return this},o.prototype.add=function(t){var e;return 0!==t.negative&&0===this.negative?(t.negative=0,e=this.sub(t),t.negative^=1,e):0===t.negative&&0!==this.negative?(this.negative=0,e=t.sub(this),this.negative=1,e):this.length>t.length?this.clone().iadd(t):t.clone().iadd(this)},o.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e=this.iadd(t);return t.negative=1,e._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var r,i,n=this.cmp(t);if(0===n)return this.negative=0,this.length=1,this.words[0]=0,this;n>0?(r=this,i=t):(r=t,i=this);for(var o=0,s=0;s<i.length;s++)o=(e=(0|r.words[s])-(0|i.words[s])+o)>>26,this.words[s]=67108863&e;for(;0!==o&&s<r.length;s++)o=(e=(0|r.words[s])+o)>>26,this.words[s]=67108863&e;if(0===o&&s<r.length&&r!==this)for(;s<r.length;s++)this.words[s]=r.words[s];return this.length=Math.max(this.length,s),r!==this&&(this.negative=1),this._strip()},o.prototype.sub=function(t){return this.clone().isub(t)};var g=function(t,e,r){var i,n,o,s=t.words,a=e.words,u=r.words,h=0,c=0|s[0],f=8191&c,l=c>>>13,d=0|s[1],p=8191&d,g=d>>>13,y=0|s[2],m=8191&y,v=y>>>13,b=0|s[3],w=8191&b,_=b>>>13,S=0|s[4],E=8191&S,M=S>>>13,A=0|s[5],C=8191&A,k=A>>>13,I=0|s[6],T=8191&I,R=I>>>13,B=0|s[7],x=8191&B,F=B>>>13,P=0|s[8],N=8191&P,O=P>>>13,L=0|s[9],U=8191&L,j=L>>>13,D=0|a[0],K=8191&D,V=D>>>13,H=0|a[1],q=8191&H,z=H>>>13,W=0|a[2],G=8191&W,J=W>>>13,Z=0|a[3],$=8191&Z,Y=Z>>>13,Q=0|a[4],X=8191&Q,tt=Q>>>13,et=0|a[5],rt=8191&et,it=et>>>13,nt=0|a[6],ot=8191&nt,st=nt>>>13,at=0|a[7],ut=8191&at,ht=at>>>13,ct=0|a[8],ft=8191&ct,lt=ct>>>13,dt=0|a[9],pt=8191&dt,gt=dt>>>13;r.negative=t.negative^e.negative,r.length=19;var yt=(h+(i=Math.imul(f,K))|0)+((8191&(n=(n=Math.imul(f,V))+Math.imul(l,K)|0))<<13)|0;h=((o=Math.imul(l,V))+(n>>>13)|0)+(yt>>>26)|0,yt&=67108863,i=Math.imul(p,K),n=(n=Math.imul(p,V))+Math.imul(g,K)|0,o=Math.imul(g,V);var mt=(h+(i=i+Math.imul(f,q)|0)|0)+((8191&(n=(n=n+Math.imul(f,z)|0)+Math.imul(l,q)|0))<<13)|0;h=((o=o+Math.imul(l,z)|0)+(n>>>13)|0)+(mt>>>26)|0,mt&=67108863,i=Math.imul(m,K),n=(n=Math.imul(m,V))+Math.imul(v,K)|0,o=Math.imul(v,V),i=i+Math.imul(p,q)|0,n=(n=n+Math.imul(p,z)|0)+Math.imul(g,q)|0,o=o+Math.imul(g,z)|0;var vt=(h+(i=i+Math.imul(f,G)|0)|0)+((8191&(n=(n=n+Math.imul(f,J)|0)+Math.imul(l,G)|0))<<13)|0;h=((o=o+Math.imul(l,J)|0)+(n>>>13)|0)+(vt>>>26)|0,vt&=67108863,i=Math.imul(w,K),n=(n=Math.imul(w,V))+Math.imul(_,K)|0,o=Math.imul(_,V),i=i+Math.imul(m,q)|0,n=(n=n+Math.imul(m,z)|0)+Math.imul(v,q)|0,o=o+Math.imul(v,z)|0,i=i+Math.imul(p,G)|0,n=(n=n+Math.imul(p,J)|0)+Math.imul(g,G)|0,o=o+Math.imul(g,J)|0;var bt=(h+(i=i+Math.imul(f,$)|0)|0)+((8191&(n=(n=n+Math.imul(f,Y)|0)+Math.imul(l,$)|0))<<13)|0;h=((o=o+Math.imul(l,Y)|0)+(n>>>13)|0)+(bt>>>26)|0,bt&=67108863,i=Math.imul(E,K),n=(n=Math.imul(E,V))+Math.imul(M,K)|0,o=Math.imul(M,V),i=i+Math.imul(w,q)|0,n=(n=n+Math.imul(w,z)|0)+Math.imul(_,q)|0,o=o+Math.imul(_,z)|0,i=i+Math.imul(m,G)|0,n=(n=n+Math.imul(m,J)|0)+Math.imul(v,G)|0,o=o+Math.imul(v,J)|0,i=i+Math.imul(p,$)|0,n=(n=n+Math.imul(p,Y)|0)+Math.imul(g,$)|0,o=o+Math.imul(g,Y)|0;var wt=(h+(i=i+Math.imul(f,X)|0)|0)+((8191&(n=(n=n+Math.imul(f,tt)|0)+Math.imul(l,X)|0))<<13)|0;h=((o=o+Math.imul(l,tt)|0)+(n>>>13)|0)+(wt>>>26)|0,wt&=67108863,i=Math.imul(C,K),n=(n=Math.imul(C,V))+Math.imul(k,K)|0,o=Math.imul(k,V),i=i+Math.imul(E,q)|0,n=(n=n+Math.imul(E,z)|0)+Math.imul(M,q)|0,o=o+Math.imul(M,z)|0,i=i+Math.imul(w,G)|0,n=(n=n+Math.imul(w,J)|0)+Math.imul(_,G)|0,o=o+Math.imul(_,J)|0,i=i+Math.imul(m,$)|0,n=(n=n+Math.imul(m,Y)|0)+Math.imul(v,$)|0,o=o+Math.imul(v,Y)|0,i=i+Math.imul(p,X)|0,n=(n=n+Math.imul(p,tt)|0)+Math.imul(g,X)|0,o=o+Math.imul(g,tt)|0;var _t=(h+(i=i+Math.imul(f,rt)|0)|0)+((8191&(n=(n=n+Math.imul(f,it)|0)+Math.imul(l,rt)|0))<<13)|0;h=((o=o+Math.imul(l,it)|0)+(n>>>13)|0)+(_t>>>26)|0,_t&=67108863,i=Math.imul(T,K),n=(n=Math.imul(T,V))+Math.imul(R,K)|0,o=Math.imul(R,V),i=i+Math.imul(C,q)|0,n=(n=n+Math.imul(C,z)|0)+Math.imul(k,q)|0,o=o+Math.imul(k,z)|0,i=i+Math.imul(E,G)|0,n=(n=n+Math.imul(E,J)|0)+Math.imul(M,G)|0,o=o+Math.imul(M,J)|0,i=i+Math.imul(w,$)|0,n=(n=n+Math.imul(w,Y)|0)+Math.imul(_,$)|0,o=o+Math.imul(_,Y)|0,i=i+Math.imul(m,X)|0,n=(n=n+Math.imul(m,tt)|0)+Math.imul(v,X)|0,o=o+Math.imul(v,tt)|0,i=i+Math.imul(p,rt)|0,n=(n=n+Math.imul(p,it)|0)+Math.imul(g,rt)|0,o=o+Math.imul(g,it)|0;var St=(h+(i=i+Math.imul(f,ot)|0)|0)+((8191&(n=(n=n+Math.imul(f,st)|0)+Math.imul(l,ot)|0))<<13)|0;h=((o=o+Math.imul(l,st)|0)+(n>>>13)|0)+(St>>>26)|0,St&=67108863,i=Math.imul(x,K),n=(n=Math.imul(x,V))+Math.imul(F,K)|0,o=Math.imul(F,V),i=i+Math.imul(T,q)|0,n=(n=n+Math.imul(T,z)|0)+Math.imul(R,q)|0,o=o+Math.imul(R,z)|0,i=i+Math.imul(C,G)|0,n=(n=n+Math.imul(C,J)|0)+Math.imul(k,G)|0,o=o+Math.imul(k,J)|0,i=i+Math.imul(E,$)|0,n=(n=n+Math.imul(E,Y)|0)+Math.imul(M,$)|0,o=o+Math.imul(M,Y)|0,i=i+Math.imul(w,X)|0,n=(n=n+Math.imul(w,tt)|0)+Math.imul(_,X)|0,o=o+Math.imul(_,tt)|0,i=i+Math.imul(m,rt)|0,n=(n=n+Math.imul(m,it)|0)+Math.imul(v,rt)|0,o=o+Math.imul(v,it)|0,i=i+Math.imul(p,ot)|0,n=(n=n+Math.imul(p,st)|0)+Math.imul(g,ot)|0,o=o+Math.imul(g,st)|0;var Et=(h+(i=i+Math.imul(f,ut)|0)|0)+((8191&(n=(n=n+Math.imul(f,ht)|0)+Math.imul(l,ut)|0))<<13)|0;h=((o=o+Math.imul(l,ht)|0)+(n>>>13)|0)+(Et>>>26)|0,Et&=67108863,i=Math.imul(N,K),n=(n=Math.imul(N,V))+Math.imul(O,K)|0,o=Math.imul(O,V),i=i+Math.imul(x,q)|0,n=(n=n+Math.imul(x,z)|0)+Math.imul(F,q)|0,o=o+Math.imul(F,z)|0,i=i+Math.imul(T,G)|0,n=(n=n+Math.imul(T,J)|0)+Math.imul(R,G)|0,o=o+Math.imul(R,J)|0,i=i+Math.imul(C,$)|0,n=(n=n+Math.imul(C,Y)|0)+Math.imul(k,$)|0,o=o+Math.imul(k,Y)|0,i=i+Math.imul(E,X)|0,n=(n=n+Math.imul(E,tt)|0)+Math.imul(M,X)|0,o=o+Math.imul(M,tt)|0,i=i+Math.imul(w,rt)|0,n=(n=n+Math.imul(w,it)|0)+Math.imul(_,rt)|0,o=o+Math.imul(_,it)|0,i=i+Math.imul(m,ot)|0,n=(n=n+Math.imul(m,st)|0)+Math.imul(v,ot)|0,o=o+Math.imul(v,st)|0,i=i+Math.imul(p,ut)|0,n=(n=n+Math.imul(p,ht)|0)+Math.imul(g,ut)|0,o=o+Math.imul(g,ht)|0;var Mt=(h+(i=i+Math.imul(f,ft)|0)|0)+((8191&(n=(n=n+Math.imul(f,lt)|0)+Math.imul(l,ft)|0))<<13)|0;h=((o=o+Math.imul(l,lt)|0)+(n>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,i=Math.imul(U,K),n=(n=Math.imul(U,V))+Math.imul(j,K)|0,o=Math.imul(j,V),i=i+Math.imul(N,q)|0,n=(n=n+Math.imul(N,z)|0)+Math.imul(O,q)|0,o=o+Math.imul(O,z)|0,i=i+Math.imul(x,G)|0,n=(n=n+Math.imul(x,J)|0)+Math.imul(F,G)|0,o=o+Math.imul(F,J)|0,i=i+Math.imul(T,$)|0,n=(n=n+Math.imul(T,Y)|0)+Math.imul(R,$)|0,o=o+Math.imul(R,Y)|0,i=i+Math.imul(C,X)|0,n=(n=n+Math.imul(C,tt)|0)+Math.imul(k,X)|0,o=o+Math.imul(k,tt)|0,i=i+Math.imul(E,rt)|0,n=(n=n+Math.imul(E,it)|0)+Math.imul(M,rt)|0,o=o+Math.imul(M,it)|0,i=i+Math.imul(w,ot)|0,n=(n=n+Math.imul(w,st)|0)+Math.imul(_,ot)|0,o=o+Math.imul(_,st)|0,i=i+Math.imul(m,ut)|0,n=(n=n+Math.imul(m,ht)|0)+Math.imul(v,ut)|0,o=o+Math.imul(v,ht)|0,i=i+Math.imul(p,ft)|0,n=(n=n+Math.imul(p,lt)|0)+Math.imul(g,ft)|0,o=o+Math.imul(g,lt)|0;var At=(h+(i=i+Math.imul(f,pt)|0)|0)+((8191&(n=(n=n+Math.imul(f,gt)|0)+Math.imul(l,pt)|0))<<13)|0;h=((o=o+Math.imul(l,gt)|0)+(n>>>13)|0)+(At>>>26)|0,At&=67108863,i=Math.imul(U,q),n=(n=Math.imul(U,z))+Math.imul(j,q)|0,o=Math.imul(j,z),i=i+Math.imul(N,G)|0,n=(n=n+Math.imul(N,J)|0)+Math.imul(O,G)|0,o=o+Math.imul(O,J)|0,i=i+Math.imul(x,$)|0,n=(n=n+Math.imul(x,Y)|0)+Math.imul(F,$)|0,o=o+Math.imul(F,Y)|0,i=i+Math.imul(T,X)|0,n=(n=n+Math.imul(T,tt)|0)+Math.imul(R,X)|0,o=o+Math.imul(R,tt)|0,i=i+Math.imul(C,rt)|0,n=(n=n+Math.imul(C,it)|0)+Math.imul(k,rt)|0,o=o+Math.imul(k,it)|0,i=i+Math.imul(E,ot)|0,n=(n=n+Math.imul(E,st)|0)+Math.imul(M,ot)|0,o=o+Math.imul(M,st)|0,i=i+Math.imul(w,ut)|0,n=(n=n+Math.imul(w,ht)|0)+Math.imul(_,ut)|0,o=o+Math.imul(_,ht)|0,i=i+Math.imul(m,ft)|0,n=(n=n+Math.imul(m,lt)|0)+Math.imul(v,ft)|0,o=o+Math.imul(v,lt)|0;var Ct=(h+(i=i+Math.imul(p,pt)|0)|0)+((8191&(n=(n=n+Math.imul(p,gt)|0)+Math.imul(g,pt)|0))<<13)|0;h=((o=o+Math.imul(g,gt)|0)+(n>>>13)|0)+(Ct>>>26)|0,Ct&=67108863,i=Math.imul(U,G),n=(n=Math.imul(U,J))+Math.imul(j,G)|0,o=Math.imul(j,J),i=i+Math.imul(N,$)|0,n=(n=n+Math.imul(N,Y)|0)+Math.imul(O,$)|0,o=o+Math.imul(O,Y)|0,i=i+Math.imul(x,X)|0,n=(n=n+Math.imul(x,tt)|0)+Math.imul(F,X)|0,o=o+Math.imul(F,tt)|0,i=i+Math.imul(T,rt)|0,n=(n=n+Math.imul(T,it)|0)+Math.imul(R,rt)|0,o=o+Math.imul(R,it)|0,i=i+Math.imul(C,ot)|0,n=(n=n+Math.imul(C,st)|0)+Math.imul(k,ot)|0,o=o+Math.imul(k,st)|0,i=i+Math.imul(E,ut)|0,n=(n=n+Math.imul(E,ht)|0)+Math.imul(M,ut)|0,o=o+Math.imul(M,ht)|0,i=i+Math.imul(w,ft)|0,n=(n=n+Math.imul(w,lt)|0)+Math.imul(_,ft)|0,o=o+Math.imul(_,lt)|0;var kt=(h+(i=i+Math.imul(m,pt)|0)|0)+((8191&(n=(n=n+Math.imul(m,gt)|0)+Math.imul(v,pt)|0))<<13)|0;h=((o=o+Math.imul(v,gt)|0)+(n>>>13)|0)+(kt>>>26)|0,kt&=67108863,i=Math.imul(U,$),n=(n=Math.imul(U,Y))+Math.imul(j,$)|0,o=Math.imul(j,Y),i=i+Math.imul(N,X)|0,n=(n=n+Math.imul(N,tt)|0)+Math.imul(O,X)|0,o=o+Math.imul(O,tt)|0,i=i+Math.imul(x,rt)|0,n=(n=n+Math.imul(x,it)|0)+Math.imul(F,rt)|0,o=o+Math.imul(F,it)|0,i=i+Math.imul(T,ot)|0,n=(n=n+Math.imul(T,st)|0)+Math.imul(R,ot)|0,o=o+Math.imul(R,st)|0,i=i+Math.imul(C,ut)|0,n=(n=n+Math.imul(C,ht)|0)+Math.imul(k,ut)|0,o=o+Math.imul(k,ht)|0,i=i+Math.imul(E,ft)|0,n=(n=n+Math.imul(E,lt)|0)+Math.imul(M,ft)|0,o=o+Math.imul(M,lt)|0;var It=(h+(i=i+Math.imul(w,pt)|0)|0)+((8191&(n=(n=n+Math.imul(w,gt)|0)+Math.imul(_,pt)|0))<<13)|0;h=((o=o+Math.imul(_,gt)|0)+(n>>>13)|0)+(It>>>26)|0,It&=67108863,i=Math.imul(U,X),n=(n=Math.imul(U,tt))+Math.imul(j,X)|0,o=Math.imul(j,tt),i=i+Math.imul(N,rt)|0,n=(n=n+Math.imul(N,it)|0)+Math.imul(O,rt)|0,o=o+Math.imul(O,it)|0,i=i+Math.imul(x,ot)|0,n=(n=n+Math.imul(x,st)|0)+Math.imul(F,ot)|0,o=o+Math.imul(F,st)|0,i=i+Math.imul(T,ut)|0,n=(n=n+Math.imul(T,ht)|0)+Math.imul(R,ut)|0,o=o+Math.imul(R,ht)|0,i=i+Math.imul(C,ft)|0,n=(n=n+Math.imul(C,lt)|0)+Math.imul(k,ft)|0,o=o+Math.imul(k,lt)|0;var Tt=(h+(i=i+Math.imul(E,pt)|0)|0)+((8191&(n=(n=n+Math.imul(E,gt)|0)+Math.imul(M,pt)|0))<<13)|0;h=((o=o+Math.imul(M,gt)|0)+(n>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,i=Math.imul(U,rt),n=(n=Math.imul(U,it))+Math.imul(j,rt)|0,o=Math.imul(j,it),i=i+Math.imul(N,ot)|0,n=(n=n+Math.imul(N,st)|0)+Math.imul(O,ot)|0,o=o+Math.imul(O,st)|0,i=i+Math.imul(x,ut)|0,n=(n=n+Math.imul(x,ht)|0)+Math.imul(F,ut)|0,o=o+Math.imul(F,ht)|0,i=i+Math.imul(T,ft)|0,n=(n=n+Math.imul(T,lt)|0)+Math.imul(R,ft)|0,o=o+Math.imul(R,lt)|0;var Rt=(h+(i=i+Math.imul(C,pt)|0)|0)+((8191&(n=(n=n+Math.imul(C,gt)|0)+Math.imul(k,pt)|0))<<13)|0;h=((o=o+Math.imul(k,gt)|0)+(n>>>13)|0)+(Rt>>>26)|0,Rt&=67108863,i=Math.imul(U,ot),n=(n=Math.imul(U,st))+Math.imul(j,ot)|0,o=Math.imul(j,st),i=i+Math.imul(N,ut)|0,n=(n=n+Math.imul(N,ht)|0)+Math.imul(O,ut)|0,o=o+Math.imul(O,ht)|0,i=i+Math.imul(x,ft)|0,n=(n=n+Math.imul(x,lt)|0)+Math.imul(F,ft)|0,o=o+Math.imul(F,lt)|0;var Bt=(h+(i=i+Math.imul(T,pt)|0)|0)+((8191&(n=(n=n+Math.imul(T,gt)|0)+Math.imul(R,pt)|0))<<13)|0;h=((o=o+Math.imul(R,gt)|0)+(n>>>13)|0)+(Bt>>>26)|0,Bt&=67108863,i=Math.imul(U,ut),n=(n=Math.imul(U,ht))+Math.imul(j,ut)|0,o=Math.imul(j,ht),i=i+Math.imul(N,ft)|0,n=(n=n+Math.imul(N,lt)|0)+Math.imul(O,ft)|0,o=o+Math.imul(O,lt)|0;var xt=(h+(i=i+Math.imul(x,pt)|0)|0)+((8191&(n=(n=n+Math.imul(x,gt)|0)+Math.imul(F,pt)|0))<<13)|0;h=((o=o+Math.imul(F,gt)|0)+(n>>>13)|0)+(xt>>>26)|0,xt&=67108863,i=Math.imul(U,ft),n=(n=Math.imul(U,lt))+Math.imul(j,ft)|0,o=Math.imul(j,lt);var Ft=(h+(i=i+Math.imul(N,pt)|0)|0)+((8191&(n=(n=n+Math.imul(N,gt)|0)+Math.imul(O,pt)|0))<<13)|0;h=((o=o+Math.imul(O,gt)|0)+(n>>>13)|0)+(Ft>>>26)|0,Ft&=67108863;var Pt=(h+(i=Math.imul(U,pt))|0)+((8191&(n=(n=Math.imul(U,gt))+Math.imul(j,pt)|0))<<13)|0;return h=((o=Math.imul(j,gt))+(n>>>13)|0)+(Pt>>>26)|0,Pt&=67108863,u[0]=yt,u[1]=mt,u[2]=vt,u[3]=bt,u[4]=wt,u[5]=_t,u[6]=St,u[7]=Et,u[8]=Mt,u[9]=At,u[10]=Ct,u[11]=kt,u[12]=It,u[13]=Tt,u[14]=Rt,u[15]=Bt,u[16]=xt,u[17]=Ft,u[18]=Pt,0!==h&&(u[19]=h,r.length++),r};function y(t,e,r){r.negative=e.negative^t.negative,r.length=t.length+e.length;for(var i=0,n=0,o=0;o<r.length-1;o++){var s=n;n=0;for(var a=67108863&i,u=Math.min(o,e.length-1),h=Math.max(0,o-t.length+1);h<=u;h++){var c=o-h,f=(0|t.words[c])*(0|e.words[h]),l=67108863&f;a=67108863&(l=l+a|0),n+=(s=(s=s+(f/67108864|0)|0)+(l>>>26)|0)>>>26,s&=67108863}r.words[o]=a,i=s,s=n}return 0!==i?r.words[o]=i:r.length--,r._strip()}function m(t,e,r){return y(t,e,r)}function v(t,e){this.x=t,this.y=e}Math.imul||(g=p),o.prototype.mulTo=function(t,e){var r=this.length+t.length;return 10===this.length&&10===t.length?g(this,t,e):r<63?p(this,t,e):r<1024?y(this,t,e):m(this,t,e)},v.prototype.makeRBT=function(t){for(var e=new Array(t),r=o.prototype._countBits(t)-1,i=0;i<t;i++)e[i]=this.revBin(i,r,t);return e},v.prototype.revBin=function(t,e,r){if(0===t||t===r-1)return t;for(var i=0,n=0;n<e;n++)i|=(1&t)<<e-n-1,t>>=1;return i},v.prototype.permute=function(t,e,r,i,n,o){for(var s=0;s<o;s++)i[s]=e[t[s]],n[s]=r[t[s]]},v.prototype.transform=function(t,e,r,i,n,o){this.permute(o,t,e,r,i,n);for(var s=1;s<n;s<<=1)for(var a=s<<1,u=Math.cos(2*Math.PI/a),h=Math.sin(2*Math.PI/a),c=0;c<n;c+=a)for(var f=u,l=h,d=0;d<s;d++){var p=r[c+d],g=i[c+d],y=r[c+d+s],m=i[c+d+s],v=f*y-l*m;m=f*m+l*y,y=v,r[c+d]=p+y,i[c+d]=g+m,r[c+d+s]=p-y,i[c+d+s]=g-m,d!==a&&(v=u*f-h*l,l=u*l+h*f,f=v)}},v.prototype.guessLen13b=function(t,e){var r=1|Math.max(e,t),i=1&r,n=0;for(r=r/2|0;r;r>>>=1)n++;return 1<<n+1+i},v.prototype.conjugate=function(t,e,r){if(!(r<=1))for(var i=0;i<r/2;i++){var n=t[i];t[i]=t[r-i-1],t[r-i-1]=n,n=e[i],e[i]=-e[r-i-1],e[r-i-1]=-n}},v.prototype.normalize13b=function(t,e){for(var r=0,i=0;i<e/2;i++){var n=8192*Math.round(t[2*i+1]/e)+Math.round(t[2*i]/e)+r;t[i]=67108863&n,r=n<67108864?0:n/67108864|0}return t},v.prototype.convert13b=function(t,e,r,n){for(var o=0,s=0;s<e;s++)o+=0|t[s],r[2*s]=8191&o,o>>>=13,r[2*s+1]=8191&o,o>>>=13;for(s=2*e;s<n;++s)r[s]=0;i(0===o),i(0==(-8192&o))},v.prototype.stub=function(t){for(var e=new Array(t),r=0;r<t;r++)e[r]=0;return e},v.prototype.mulp=function(t,e,r){var i=2*this.guessLen13b(t.length,e.length),n=this.makeRBT(i),o=this.stub(i),s=new Array(i),a=new Array(i),u=new Array(i),h=new Array(i),c=new Array(i),f=new Array(i),l=r.words;l.length=i,this.convert13b(t.words,t.length,s,i),this.convert13b(e.words,e.length,h,i),this.transform(s,o,a,u,i,n),this.transform(h,o,c,f,i,n);for(var d=0;d<i;d++){var p=a[d]*c[d]-u[d]*f[d];u[d]=a[d]*f[d]+u[d]*c[d],a[d]=p}return this.conjugate(a,u,i),this.transform(a,u,l,o,i,n),this.conjugate(l,o,i),this.normalize13b(l,i),r.negative=t.negative^e.negative,r.length=t.length+e.length,r._strip()},o.prototype.mul=function(t){var e=new o(null);return e.words=new Array(this.length+t.length),this.mulTo(t,e)},o.prototype.mulf=function(t){var e=new o(null);return e.words=new Array(this.length+t.length),m(this,t,e)},o.prototype.imul=function(t){return this.clone().mulTo(t,this)},o.prototype.imuln=function(t){var e=t<0;e&&(t=-t),i("number"==typeof t),i(t<67108864);for(var r=0,n=0;n<this.length;n++){var o=(0|this.words[n])*t,s=(67108863&o)+(67108863&r);r>>=26,r+=o/67108864|0,r+=s>>>26,this.words[n]=67108863&s}return 0!==r&&(this.words[n]=r,this.length++),e?this.ineg():this},o.prototype.muln=function(t){return this.clone().imuln(t)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(t){var e=function(t){for(var e=new Array(t.bitLength()),r=0;r<e.length;r++){var i=r/26|0,n=r%26;e[r]=t.words[i]>>>n&1}return e}(t);if(0===e.length)return new o(1);for(var r=this,i=0;i<e.length&&0===e[i];i++,r=r.sqr());if(++i<e.length)for(var n=r.sqr();i<e.length;i++,n=n.sqr())0!==e[i]&&(r=r.mul(n));return r},o.prototype.iushln=function(t){i("number"==typeof t&&t>=0);var e,r=t%26,n=(t-r)/26,o=67108863>>>26-r<<26-r;if(0!==r){var s=0;for(e=0;e<this.length;e++){var a=this.words[e]&o,u=(0|this.words[e])-a<<r;this.words[e]=u|s,s=a>>>26-r}s&&(this.words[e]=s,this.length++)}if(0!==n){for(e=this.length-1;e>=0;e--)this.words[e+n]=this.words[e];for(e=0;e<n;e++)this.words[e]=0;this.length+=n}return this._strip()},o.prototype.ishln=function(t){return i(0===this.negative),this.iushln(t)},o.prototype.iushrn=function(t,e,r){var n;i("number"==typeof t&&t>=0),n=e?(e-e%26)/26:0;var o=t%26,s=Math.min((t-o)/26,this.length),a=67108863^67108863>>>o<<o,u=r;if(n-=s,n=Math.max(0,n),u){for(var h=0;h<s;h++)u.words[h]=this.words[h];u.length=s}if(0===s);else if(this.length>s)for(this.length-=s,h=0;h<this.length;h++)this.words[h]=this.words[h+s];else this.words[0]=0,this.length=1;var c=0;for(h=this.length-1;h>=0&&(0!==c||h>=n);h--){var f=0|this.words[h];this.words[h]=c<<26-o|f>>>o,c=f&a}return u&&0!==c&&(u.words[u.length++]=c),0===this.length&&(this.words[0]=0,this.length=1),this._strip()},o.prototype.ishrn=function(t,e,r){return i(0===this.negative),this.iushrn(t,e,r)},o.prototype.shln=function(t){return this.clone().ishln(t)},o.prototype.ushln=function(t){return this.clone().iushln(t)},o.prototype.shrn=function(t){return this.clone().ishrn(t)},o.prototype.ushrn=function(t){return this.clone().iushrn(t)},o.prototype.testn=function(t){i("number"==typeof t&&t>=0);var e=t%26,r=(t-e)/26,n=1<<e;return!(this.length<=r||!(this.words[r]&n))},o.prototype.imaskn=function(t){i("number"==typeof t&&t>=0);var e=t%26,r=(t-e)/26;if(i(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==e&&r++,this.length=Math.min(r,this.length),0!==e){var n=67108863^67108863>>>e<<e;this.words[this.length-1]&=n}return this._strip()},o.prototype.maskn=function(t){return this.clone().imaskn(t)},o.prototype.iaddn=function(t){return i("number"==typeof t),i(t<67108864),t<0?this.isubn(-t):0!==this.negative?1===this.length&&(0|this.words[0])<=t?(this.words[0]=t-(0|this.words[0]),this.negative=0,this):(this.negative=0,this.isubn(t),this.negative=1,this):this._iaddn(t)},o.prototype._iaddn=function(t){this.words[0]+=t;for(var e=0;e<this.length&&this.words[e]>=67108864;e++)this.words[e]-=67108864,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},o.prototype.isubn=function(t){if(i("number"==typeof t),i(t<67108864),t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var e=0;e<this.length&&this.words[e]<0;e++)this.words[e]+=67108864,this.words[e+1]-=1;return this._strip()},o.prototype.addn=function(t){return this.clone().iaddn(t)},o.prototype.subn=function(t){return this.clone().isubn(t)},o.prototype.iabs=function(){return this.negative=0,this},o.prototype.abs=function(){return this.clone().iabs()},o.prototype._ishlnsubmul=function(t,e,r){var n,o,s=t.length+r;this._expand(s);var a=0;for(n=0;n<t.length;n++){o=(0|this.words[n+r])+a;var u=(0|t.words[n])*e;a=((o-=67108863&u)>>26)-(u/67108864|0),this.words[n+r]=67108863&o}for(;n<this.length-r;n++)a=(o=(0|this.words[n+r])+a)>>26,this.words[n+r]=67108863&o;if(0===a)return this._strip();for(i(-1===a),a=0,n=0;n<this.length;n++)a=(o=-(0|this.words[n])+a)>>26,this.words[n]=67108863&o;return this.negative=1,this._strip()},o.prototype._wordDiv=function(t,e){var r=(this.length,t.length),i=this.clone(),n=t,s=0|n.words[n.length-1];0!=(r=26-this._countBits(s))&&(n=n.ushln(r),i.iushln(r),s=0|n.words[n.length-1]);var a,u=i.length-n.length;if("mod"!==e){(a=new o(null)).length=u+1,a.words=new Array(a.length);for(var h=0;h<a.length;h++)a.words[h]=0}var c=i.clone()._ishlnsubmul(n,1,u);0===c.negative&&(i=c,a&&(a.words[u]=1));for(var f=u-1;f>=0;f--){var l=67108864*(0|i.words[n.length+f])+(0|i.words[n.length+f-1]);for(l=Math.min(l/s|0,67108863),i._ishlnsubmul(n,l,f);0!==i.negative;)l--,i.negative=0,i._ishlnsubmul(n,1,f),i.isZero()||(i.negative^=1);a&&(a.words[f]=l)}return a&&a._strip(),i._strip(),"div"!==e&&0!==r&&i.iushrn(r),{div:a||null,mod:i}},o.prototype.divmod=function(t,e,r){return i(!t.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===t.negative?(a=this.neg().divmod(t,e),"mod"!==e&&(n=a.div.neg()),"div"!==e&&(s=a.mod.neg(),r&&0!==s.negative&&s.iadd(t)),{div:n,mod:s}):0===this.negative&&0!==t.negative?(a=this.divmod(t.neg(),e),"mod"!==e&&(n=a.div.neg()),{div:n,mod:a.mod}):0!=(this.negative&t.negative)?(a=this.neg().divmod(t.neg(),e),"div"!==e&&(s=a.mod.neg(),r&&0!==s.negative&&s.isub(t)),{div:a.div,mod:s}):t.length>this.length||this.cmp(t)<0?{div:new o(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new o(this.modrn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new o(this.modrn(t.words[0]))}:this._wordDiv(t,e);var n,s,a},o.prototype.div=function(t){return this.divmod(t,"div",!1).div},o.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},o.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},o.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var r=0!==e.div.negative?e.mod.isub(t):e.mod,i=t.ushrn(1),n=t.andln(1),o=r.cmp(i);return o<0||1===n&&0===o?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},o.prototype.modrn=function(t){var e=t<0;e&&(t=-t),i(t<=67108863);for(var r=(1<<26)%t,n=0,o=this.length-1;o>=0;o--)n=(r*n+(0|this.words[o]))%t;return e?-n:n},o.prototype.modn=function(t){return this.modrn(t)},o.prototype.idivn=function(t){var e=t<0;e&&(t=-t),i(t<=67108863);for(var r=0,n=this.length-1;n>=0;n--){var o=(0|this.words[n])+67108864*r;this.words[n]=o/t|0,r=o%t}return this._strip(),e?this.ineg():this},o.prototype.divn=function(t){return this.clone().idivn(t)},o.prototype.egcd=function(t){i(0===t.negative),i(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var n=new o(1),s=new o(0),a=new o(0),u=new o(1),h=0;e.isEven()&&r.isEven();)e.iushrn(1),r.iushrn(1),++h;for(var c=r.clone(),f=e.clone();!e.isZero();){for(var l=0,d=1;0==(e.words[0]&d)&&l<26;++l,d<<=1);if(l>0)for(e.iushrn(l);l-- >0;)(n.isOdd()||s.isOdd())&&(n.iadd(c),s.isub(f)),n.iushrn(1),s.iushrn(1);for(var p=0,g=1;0==(r.words[0]&g)&&p<26;++p,g<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(a.isOdd()||u.isOdd())&&(a.iadd(c),u.isub(f)),a.iushrn(1),u.iushrn(1);e.cmp(r)>=0?(e.isub(r),n.isub(a),s.isub(u)):(r.isub(e),a.isub(n),u.isub(s))}return{a,b:u,gcd:r.iushln(h)}},o.prototype._invmp=function(t){i(0===t.negative),i(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var n,s=new o(1),a=new o(0),u=r.clone();e.cmpn(1)>0&&r.cmpn(1)>0;){for(var h=0,c=1;0==(e.words[0]&c)&&h<26;++h,c<<=1);if(h>0)for(e.iushrn(h);h-- >0;)s.isOdd()&&s.iadd(u),s.iushrn(1);for(var f=0,l=1;0==(r.words[0]&l)&&f<26;++f,l<<=1);if(f>0)for(r.iushrn(f);f-- >0;)a.isOdd()&&a.iadd(u),a.iushrn(1);e.cmp(r)>=0?(e.isub(r),s.isub(a)):(r.isub(e),a.isub(s))}return(n=0===e.cmpn(1)?s:a).cmpn(0)<0&&n.iadd(t),n},o.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),r=t.clone();e.negative=0,r.negative=0;for(var i=0;e.isEven()&&r.isEven();i++)e.iushrn(1),r.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;r.isEven();)r.iushrn(1);var n=e.cmp(r);if(n<0){var o=e;e=r,r=o}else if(0===n||0===r.cmpn(1))break;e.isub(r)}return r.iushln(i)},o.prototype.invm=function(t){return this.egcd(t).a.umod(t)},o.prototype.isEven=function(){return 0==(1&this.words[0])},o.prototype.isOdd=function(){return 1==(1&this.words[0])},o.prototype.andln=function(t){return this.words[0]&t},o.prototype.bincn=function(t){i("number"==typeof t);var e=t%26,r=(t-e)/26,n=1<<e;if(this.length<=r)return this._expand(r+1),this.words[r]|=n,this;for(var o=n,s=r;0!==o&&s<this.length;s++){var a=0|this.words[s];o=(a+=o)>>>26,a&=67108863,this.words[s]=a}return 0!==o&&(this.words[s]=o,this.length++),this},o.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},o.prototype.cmpn=function(t){var e,r=t<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this._strip(),this.length>1)e=1;else{r&&(t=-t),i(t<=67108863,"Number is too big");var n=0|this.words[0];e=n===t?0:n<t?-1:1}return 0!==this.negative?0|-e:e},o.prototype.cmp=function(t){if(0!==this.negative&&0===t.negative)return-1;if(0===this.negative&&0!==t.negative)return 1;var e=this.ucmp(t);return 0!==this.negative?0|-e:e},o.prototype.ucmp=function(t){if(this.length>t.length)return 1;if(this.length<t.length)return-1;for(var e=0,r=this.length-1;r>=0;r--){var i=0|this.words[r],n=0|t.words[r];if(i!==n){i<n?e=-1:i>n&&(e=1);break}}return e},o.prototype.gtn=function(t){return 1===this.cmpn(t)},o.prototype.gt=function(t){return 1===this.cmp(t)},o.prototype.gten=function(t){return this.cmpn(t)>=0},o.prototype.gte=function(t){return this.cmp(t)>=0},o.prototype.ltn=function(t){return-1===this.cmpn(t)},o.prototype.lt=function(t){return-1===this.cmp(t)},o.prototype.lten=function(t){return this.cmpn(t)<=0},o.prototype.lte=function(t){return this.cmp(t)<=0},o.prototype.eqn=function(t){return 0===this.cmpn(t)},o.prototype.eq=function(t){return 0===this.cmp(t)},o.red=function(t){return new A(t)},o.prototype.toRed=function(t){return i(!this.red,"Already a number in reduction context"),i(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},o.prototype.fromRed=function(){return i(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(t){return this.red=t,this},o.prototype.forceRed=function(t){return i(!this.red,"Already a number in reduction context"),this._forceRed(t)},o.prototype.redAdd=function(t){return i(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},o.prototype.redIAdd=function(t){return i(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},o.prototype.redSub=function(t){return i(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},o.prototype.redISub=function(t){return i(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},o.prototype.redShl=function(t){return i(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},o.prototype.redMul=function(t){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},o.prototype.redIMul=function(t){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},o.prototype.redSqr=function(){return i(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return i(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return i(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return i(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return i(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(t){return i(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var b={k256:null,p224:null,p192:null,p25519:null};function w(t,e){this.name=t,this.p=new o(e,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function _(){w.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function S(){w.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function E(){w.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function M(){w.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function A(t){if("string"==typeof t){var e=o._prime(t);this.m=e.p,this.prime=e}else i(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function C(t){A.call(this,t),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new o(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}w.prototype._tmp=function(){var t=new o(null);return t.words=new Array(Math.ceil(this.n/13)),t},w.prototype.ireduce=function(t){var e,r=t;do{this.split(r,this.tmp),e=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(e>this.n);var i=e<this.n?-1:r.ucmp(this.p);return 0===i?(r.words[0]=0,r.length=1):i>0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},w.prototype.split=function(t,e){t.iushrn(this.n,0,e)},w.prototype.imulK=function(t){return t.imul(this.k)},n(_,w),_.prototype.split=function(t,e){for(var r=4194303,i=Math.min(t.length,9),n=0;n<i;n++)e.words[n]=t.words[n];if(e.length=i,t.length<=9)return t.words[0]=0,void(t.length=1);var o=t.words[9];for(e.words[e.length++]=o&r,n=10;n<t.length;n++){var s=0|t.words[n];t.words[n-10]=(s&r)<<4|o>>>22,o=s}o>>>=22,t.words[n-10]=o,0===o&&t.length>10?t.length-=10:t.length-=9},_.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,r=0;r<t.length;r++){var i=0|t.words[r];e+=977*i,t.words[r]=67108863&e,e=64*i+(e/67108864|0)}return 0===t.words[t.length-1]&&(t.length--,0===t.words[t.length-1]&&t.length--),t},n(S,w),n(E,w),n(M,w),M.prototype.imulK=function(t){for(var e=0,r=0;r<t.length;r++){var i=19*(0|t.words[r])+e,n=67108863&i;i>>>=26,t.words[r]=n,e=i}return 0!==e&&(t.words[t.length++]=e),t},o._prime=function(t){if(b[t])return b[t];var e;if("k256"===t)e=new _;else if("p224"===t)e=new S;else if("p192"===t)e=new E;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new M}return b[t]=e,e},A.prototype._verify1=function(t){i(0===t.negative,"red works only with positives"),i(t.red,"red works only with red numbers")},A.prototype._verify2=function(t,e){i(0==(t.negative|e.negative),"red works only with positives"),i(t.red&&t.red===e.red,"red works only with red numbers")},A.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):(h(t,t.umod(this.m)._forceRed(this)),t)},A.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},A.prototype.add=function(t,e){this._verify2(t,e);var r=t.add(e);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},A.prototype.iadd=function(t,e){this._verify2(t,e);var r=t.iadd(e);return r.cmp(this.m)>=0&&r.isub(this.m),r},A.prototype.sub=function(t,e){this._verify2(t,e);var r=t.sub(e);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},A.prototype.isub=function(t,e){this._verify2(t,e);var r=t.isub(e);return r.cmpn(0)<0&&r.iadd(this.m),r},A.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},A.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},A.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},A.prototype.isqr=function(t){return this.imul(t,t.clone())},A.prototype.sqr=function(t){return this.mul(t,t)},A.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(i(e%2==1),3===e){var r=this.m.add(new o(1)).iushrn(2);return this.pow(t,r)}for(var n=this.m.subn(1),s=0;!n.isZero()&&0===n.andln(1);)s++,n.iushrn(1);i(!n.isZero());var a=new o(1).toRed(this),u=a.redNeg(),h=this.m.subn(1).iushrn(1),c=this.m.bitLength();for(c=new o(2*c*c).toRed(this);0!==this.pow(c,h).cmp(u);)c.redIAdd(u);for(var f=this.pow(c,n),l=this.pow(t,n.addn(1).iushrn(1)),d=this.pow(t,n),p=s;0!==d.cmp(a);){for(var g=d,y=0;0!==g.cmp(a);y++)g=g.redSqr();i(y<p);var m=this.pow(f,new o(1).iushln(p-y-1));l=l.redMul(m),f=m.redSqr(),d=d.redMul(f),p=y}return l},A.prototype.invm=function(t){var e=t._invmp(this.m);return 0!==e.negative?(e.negative=0,this.imod(e).redNeg()):this.imod(e)},A.prototype.pow=function(t,e){if(e.isZero())return new o(1).toRed(this);if(0===e.cmpn(1))return t.clone();var r=new Array(16);r[0]=new o(1).toRed(this),r[1]=t;for(var i=2;i<r.length;i++)r[i]=this.mul(r[i-1],t);var n=r[0],s=0,a=0,u=e.bitLength()%26;for(0===u&&(u=26),i=e.length-1;i>=0;i--){for(var h=e.words[i],c=u-1;c>=0;c--){var f=h>>c&1;n!==r[0]&&(n=this.sqr(n)),0!==f||0!==s?(s<<=1,s|=f,(4==++a||0===i&&0===c)&&(n=this.mul(n,r[s]),a=0,s=0)):a=0}u=26}return n},A.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},A.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},o.mont=function(t){return new C(t)},n(C,A),C.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},C.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},C.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var r=t.imul(e),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(i).iushrn(this.shift),o=n;return n.cmp(this.m)>=0?o=n.isub(this.m):n.cmpn(0)<0&&(o=n.iadd(this.m)),o._forceRed(this)},C.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new o(0)._forceRed(this);var r=t.mul(e),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(i).iushrn(this.shift),s=n;return n.cmp(this.m)>=0?s=n.isub(this.m):n.cmpn(0)<0&&(s=n.iadd(this.m)),s._forceRed(this)},C.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(t=r.nmd(t),this)},29931:(t,e,r)=>{var i;function n(t){this.rand=t}if(t.exports=function(t){return i||(i=new n(null)),i.generate(t)},t.exports.Rand=n,n.prototype.generate=function(t){return this._rand(t)},n.prototype._rand=function(t){if(this.rand.getBytes)return this.rand.getBytes(t);for(var e=new Uint8Array(t),r=0;r<e.length;r++)e[r]=this.rand.getByte();return e},"object"==typeof self)self.crypto&&self.crypto.getRandomValues?n.prototype._rand=function(t){var e=new Uint8Array(t);return self.crypto.getRandomValues(e),e}:self.msCrypto&&self.msCrypto.getRandomValues?n.prototype._rand=function(t){var e=new Uint8Array(t);return self.msCrypto.getRandomValues(e),e}:"object"==typeof window&&(n.prototype._rand=function(){throw new Error("Not implemented yet")});else try{var o=r(63906);if("function"!=typeof o.randomBytes)throw new Error("Not supported");n.prototype._rand=function(t){return o.randomBytes(t)}}catch(t){}},74497:(t,e,r)=>{var i=r(89509).Buffer;function n(t){i.isBuffer(t)||(t=i.from(t));for(var e=t.length/4|0,r=new Array(e),n=0;n<e;n++)r[n]=t.readUInt32BE(4*n);return r}function o(t){for(;0<t.length;t++)t[0]=0}function s(t,e,r,i,n){for(var o,s,a,u,h=r[0],c=r[1],f=r[2],l=r[3],d=t[0]^e[0],p=t[1]^e[1],g=t[2]^e[2],y=t[3]^e[3],m=4,v=1;v<n;v++)o=h[d>>>24]^c[p>>>16&255]^f[g>>>8&255]^l[255&y]^e[m++],s=h[p>>>24]^c[g>>>16&255]^f[y>>>8&255]^l[255&d]^e[m++],a=h[g>>>24]^c[y>>>16&255]^f[d>>>8&255]^l[255&p]^e[m++],u=h[y>>>24]^c[d>>>16&255]^f[p>>>8&255]^l[255&g]^e[m++],d=o,p=s,g=a,y=u;return o=(i[d>>>24]<<24|i[p>>>16&255]<<16|i[g>>>8&255]<<8|i[255&y])^e[m++],s=(i[p>>>24]<<24|i[g>>>16&255]<<16|i[y>>>8&255]<<8|i[255&d])^e[m++],a=(i[g>>>24]<<24|i[y>>>16&255]<<16|i[d>>>8&255]<<8|i[255&p])^e[m++],u=(i[y>>>24]<<24|i[d>>>16&255]<<16|i[p>>>8&255]<<8|i[255&g])^e[m++],[o>>>=0,s>>>=0,a>>>=0,u>>>=0]}var a=[0,1,2,4,8,16,32,64,128,27,54],u=function(){for(var t=new Array(256),e=0;e<256;e++)t[e]=e<128?e<<1:e<<1^283;for(var r=[],i=[],n=[[],[],[],[]],o=[[],[],[],[]],s=0,a=0,u=0;u<256;++u){var h=a^a<<1^a<<2^a<<3^a<<4;h=h>>>8^255&h^99,r[s]=h,i[h]=s;var c=t[s],f=t[c],l=t[f],d=257*t[h]^16843008*h;n[0][s]=d<<24|d>>>8,n[1][s]=d<<16|d>>>16,n[2][s]=d<<8|d>>>24,n[3][s]=d,d=16843009*l^65537*f^257*c^16843008*s,o[0][h]=d<<24|d>>>8,o[1][h]=d<<16|d>>>16,o[2][h]=d<<8|d>>>24,o[3][h]=d,0===s?s=a=1:(s=c^t[t[t[l^c]]],a^=t[t[a]])}return{SBOX:r,INV_SBOX:i,SUB_MIX:n,INV_SUB_MIX:o}}();function h(t){this._key=n(t),this._reset()}h.blockSize=16,h.keySize=32,h.prototype.blockSize=h.blockSize,h.prototype.keySize=h.keySize,h.prototype._reset=function(){for(var t=this._key,e=t.length,r=e+6,i=4*(r+1),n=[],o=0;o<e;o++)n[o]=t[o];for(o=e;o<i;o++){var s=n[o-1];o%e==0?(s=s<<8|s>>>24,s=u.SBOX[s>>>24]<<24|u.SBOX[s>>>16&255]<<16|u.SBOX[s>>>8&255]<<8|u.SBOX[255&s],s^=a[o/e|0]<<24):e>6&&o%e==4&&(s=u.SBOX[s>>>24]<<24|u.SBOX[s>>>16&255]<<16|u.SBOX[s>>>8&255]<<8|u.SBOX[255&s]),n[o]=n[o-e]^s}for(var h=[],c=0;c<i;c++){var f=i-c,l=n[f-(c%4?0:4)];h[c]=c<4||f<=4?l:u.INV_SUB_MIX[0][u.SBOX[l>>>24]]^u.INV_SUB_MIX[1][u.SBOX[l>>>16&255]]^u.INV_SUB_MIX[2][u.SBOX[l>>>8&255]]^u.INV_SUB_MIX[3][u.SBOX[255&l]]}this._nRounds=r,this._keySchedule=n,this._invKeySchedule=h},h.prototype.encryptBlockRaw=function(t){return s(t=n(t),this._keySchedule,u.SUB_MIX,u.SBOX,this._nRounds)},h.prototype.encryptBlock=function(t){var e=this.encryptBlockRaw(t),r=i.allocUnsafe(16);return r.writeUInt32BE(e[0],0),r.writeUInt32BE(e[1],4),r.writeUInt32BE(e[2],8),r.writeUInt32BE(e[3],12),r},h.prototype.decryptBlock=function(t){var e=(t=n(t))[1];t[1]=t[3],t[3]=e;var r=s(t,this._invKeySchedule,u.INV_SUB_MIX,u.INV_SBOX,this._nRounds),o=i.allocUnsafe(16);return o.writeUInt32BE(r[0],0),o.writeUInt32BE(r[3],4),o.writeUInt32BE(r[2],8),o.writeUInt32BE(r[1],12),o},h.prototype.scrub=function(){o(this._keySchedule),o(this._invKeySchedule),o(this._key)},t.exports.AES=h},62422:(t,e,r)=>{var i=r(74497),n=r(89509).Buffer,o=r(71027),s=r(35717),a=r(83288),u=r(67295),h=r(20685);function c(t,e,r,s){o.call(this);var u=n.alloc(4,0);this._cipher=new i.AES(e);var c=this._cipher.encryptBlock(u);this._ghash=new a(c),r=function(t,e,r){if(12===e.length)return t._finID=n.concat([e,n.from([0,0,0,1])]),n.concat([e,n.from([0,0,0,2])]);var i=new a(r),o=e.length,s=o%16;i.update(e),s&&(s=16-s,i.update(n.alloc(s,0))),i.update(n.alloc(8,0));var u=8*o,c=n.alloc(8);c.writeUIntBE(u,0,8),i.update(c),t._finID=i.state;var f=n.from(t._finID);return h(f),f}(this,r,c),this._prev=n.from(r),this._cache=n.allocUnsafe(0),this._secCache=n.allocUnsafe(0),this._decrypt=s,this._alen=0,this._len=0,this._mode=t,this._authTag=null,this._called=!1}s(c,o),c.prototype._update=function(t){if(!this._called&&this._alen){var e=16-this._alen%16;e<16&&(e=n.alloc(e,0),this._ghash.update(e))}this._called=!0;var r=this._mode.encrypt(this,t);return this._decrypt?this._ghash.update(t):this._ghash.update(r),this._len+=t.length,r},c.prototype._final=function(){if(this._decrypt&&!this._authTag)throw new Error("Unsupported state or unable to authenticate data");var t=u(this._ghash.final(8*this._alen,8*this._len),this._cipher.encryptBlock(this._finID));if(this._decrypt&&function(t,e){var r=0;t.length!==e.length&&r++;for(var i=Math.min(t.length,e.length),n=0;n<i;++n)r+=t[n]^e[n];return r}(t,this._authTag))throw new Error("Unsupported state or unable to authenticate data");this._authTag=t,this._cipher.scrub()},c.prototype.getAuthTag=function(){if(this._decrypt||!n.isBuffer(this._authTag))throw new Error("Attempting to get auth tag in unsupported state");return this._authTag},c.prototype.setAuthTag=function(t){if(!this._decrypt)throw new Error("Attempting to set auth tag in unsupported state");this._authTag=t},c.prototype.setAAD=function(t){if(this._called)throw new Error("Attempting to set AAD in unsupported state");this._ghash.update(t),this._alen+=t.length},t.exports=c},44696:(t,e,r)=>{var i=r(71494),n=r(66193),o=r(55415);e.createCipher=e.Cipher=i.createCipher,e.createCipheriv=e.Cipheriv=i.createCipheriv,e.createDecipher=e.Decipher=n.createDecipher,e.createDecipheriv=e.Decipheriv=n.createDecipheriv,e.listCiphers=e.getCiphers=function(){return Object.keys(o)}},66193:(t,e,r)=>{var i=r(62422),n=r(89509).Buffer,o=r(45),s=r(25969),a=r(71027),u=r(74497),h=r(13048);function c(t,e,r){a.call(this),this._cache=new f,this._last=void 0,this._cipher=new u.AES(e),this._prev=n.from(r),this._mode=t,this._autopadding=!0}function f(){this.cache=n.allocUnsafe(0)}function l(t,e,r){var a=o[t.toLowerCase()];if(!a)throw new TypeError("invalid suite type");if("string"==typeof r&&(r=n.from(r)),"GCM"!==a.mode&&r.length!==a.iv)throw new TypeError("invalid iv length "+r.length);if("string"==typeof e&&(e=n.from(e)),e.length!==a.key/8)throw new TypeError("invalid key length "+e.length);return"stream"===a.type?new s(a.module,e,r,!0):"auth"===a.type?new i(a.module,e,r,!0):new c(a.module,e,r)}r(35717)(c,a),c.prototype._update=function(t){var e,r;this._cache.add(t);for(var i=[];e=this._cache.get(this._autopadding);)r=this._mode.decrypt(this,e),i.push(r);return n.concat(i)},c.prototype._final=function(){var t=this._cache.flush();if(this._autopadding)return function(t){var e=t[15];if(e<1||e>16)throw new Error("unable to decrypt data");for(var r=-1;++r<e;)if(t[r+(16-e)]!==e)throw new Error("unable to decrypt data");if(16!==e)return t.slice(0,16-e)}(this._mode.decrypt(this,t));if(t)throw new Error("data not multiple of block length")},c.prototype.setAutoPadding=function(t){return this._autopadding=!!t,this},f.prototype.add=function(t){this.cache=n.concat([this.cache,t])},f.prototype.get=function(t){var e;if(t){if(this.cache.length>16)return e=this.cache.slice(0,16),this.cache=this.cache.slice(16),e}else if(this.cache.length>=16)return e=this.cache.slice(0,16),this.cache=this.cache.slice(16),e;return null},f.prototype.flush=function(){if(this.cache.length)return this.cache},e.createDecipher=function(t,e){var r=o[t.toLowerCase()];if(!r)throw new TypeError("invalid suite type");var i=h(e,!1,r.key,r.iv);return l(t,i.key,i.iv)},e.createDecipheriv=l},71494:(t,e,r)=>{var i=r(45),n=r(62422),o=r(89509).Buffer,s=r(25969),a=r(71027),u=r(74497),h=r(13048);function c(t,e,r){a.call(this),this._cache=new l,this._cipher=new u.AES(e),this._prev=o.from(r),this._mode=t,this._autopadding=!0}r(35717)(c,a),c.prototype._update=function(t){var e,r;this._cache.add(t);for(var i=[];e=this._cache.get();)r=this._mode.encrypt(this,e),i.push(r);return o.concat(i)};var f=o.alloc(16,16);function l(){this.cache=o.allocUnsafe(0)}function d(t,e,r){var a=i[t.toLowerCase()];if(!a)throw new TypeError("invalid suite type");if("string"==typeof e&&(e=o.from(e)),e.length!==a.key/8)throw new TypeError("invalid key length "+e.length);if("string"==typeof r&&(r=o.from(r)),"GCM"!==a.mode&&r.length!==a.iv)throw new TypeError("invalid iv length "+r.length);return"stream"===a.type?new s(a.module,e,r):"auth"===a.type?new n(a.module,e,r):new c(a.module,e,r)}c.prototype._final=function(){var t=this._cache.flush();if(this._autopadding)return t=this._mode.encrypt(this,t),this._cipher.scrub(),t;if(!t.equals(f))throw this._cipher.scrub(),new Error("data not multiple of block length")},c.prototype.setAutoPadding=function(t){return this._autopadding=!!t,this},l.prototype.add=function(t){this.cache=o.concat([this.cache,t])},l.prototype.get=function(){if(this.cache.length>15){var t=this.cache.slice(0,16);return this.cache=this.cache.slice(16),t}return null},l.prototype.flush=function(){for(var t=16-this.cache.length,e=o.allocUnsafe(t),r=-1;++r<t;)e.writeUInt8(t,r);return o.concat([this.cache,e])},e.createCipheriv=d,e.createCipher=function(t,e){var r=i[t.toLowerCase()];if(!r)throw new TypeError("invalid suite type");var n=h(e,!1,r.key,r.iv);return d(t,n.key,n.iv)}},83288:(t,e,r)=>{var i=r(89509).Buffer,n=i.alloc(16,0);function o(t){var e=i.allocUnsafe(16);return e.writeUInt32BE(t[0]>>>0,0),e.writeUInt32BE(t[1]>>>0,4),e.writeUInt32BE(t[2]>>>0,8),e.writeUInt32BE(t[3]>>>0,12),e}function s(t){this.h=t,this.state=i.alloc(16,0),this.cache=i.allocUnsafe(0)}s.prototype.ghash=function(t){for(var e=-1;++e<t.length;)this.state[e]^=t[e];this._multiply()},s.prototype._multiply=function(){for(var t,e,r,i=[(t=this.h).readUInt32BE(0),t.readUInt32BE(4),t.readUInt32BE(8),t.readUInt32BE(12)],n=[0,0,0,0],s=-1;++s<128;){for(0!=(this.state[~~(s/8)]&1<<7-s%8)&&(n[0]^=i[0],n[1]^=i[1],n[2]^=i[2],n[3]^=i[3]),r=0!=(1&i[3]),e=3;e>0;e--)i[e]=i[e]>>>1|(1&i[e-1])<<31;i[0]=i[0]>>>1,r&&(i[0]=i[0]^225<<24)}this.state=o(n)},s.prototype.update=function(t){var e;for(this.cache=i.concat([this.cache,t]);this.cache.length>=16;)e=this.cache.slice(0,16),this.cache=this.cache.slice(16),this.ghash(e)},s.prototype.final=function(t,e){return this.cache.length&&this.ghash(i.concat([this.cache,n],16)),this.ghash(o([0,t,0,e])),this.state},t.exports=s},20685:t=>{t.exports=function(t){for(var e,r=t.length;r--;){if(255!==(e=t.readUInt8(r))){e++,t.writeUInt8(e,r);break}t.writeUInt8(0,r)}}},25292:(t,e,r)=>{var i=r(67295);e.encrypt=function(t,e){var r=i(e,t._prev);return t._prev=t._cipher.encryptBlock(r),t._prev},e.decrypt=function(t,e){var r=t._prev;t._prev=e;var n=t._cipher.decryptBlock(e);return i(n,r)}},86311:(t,e,r)=>{var i=r(89509).Buffer,n=r(67295);function o(t,e,r){var o=e.length,s=n(e,t._cache);return t._cache=t._cache.slice(o),t._prev=i.concat([t._prev,r?e:s]),s}e.encrypt=function(t,e,r){for(var n,s=i.allocUnsafe(0);e.length;){if(0===t._cache.length&&(t._cache=t._cipher.encryptBlock(t._prev),t._prev=i.allocUnsafe(0)),!(t._cache.length<=e.length)){s=i.concat([s,o(t,e,r)]);break}n=t._cache.length,s=i.concat([s,o(t,e.slice(0,n),r)]),e=e.slice(n)}return s}},21510:(t,e,r)=>{var i=r(89509).Buffer;function n(t,e,r){for(var i,n,s=-1,a=0;++s<8;)i=e&1<<7-s?128:0,a+=(128&(n=t._cipher.encryptBlock(t._prev)[0]^i))>>s%8,t._prev=o(t._prev,r?i:n);return a}function o(t,e){var r=t.length,n=-1,o=i.allocUnsafe(t.length);for(t=i.concat([t,i.from([e])]);++n<r;)o[n]=t[n]<<1|t[n+1]>>7;return o}e.encrypt=function(t,e,r){for(var o=e.length,s=i.allocUnsafe(o),a=-1;++a<o;)s[a]=n(t,e[a],r);return s}},71964:(t,e,r)=>{var i=r(89509).Buffer;function n(t,e,r){var n=t._cipher.encryptBlock(t._prev)[0]^e;return t._prev=i.concat([t._prev.slice(1),i.from([r?e:n])]),n}e.encrypt=function(t,e,r){for(var o=e.length,s=i.allocUnsafe(o),a=-1;++a<o;)s[a]=n(t,e[a],r);return s}},96009:(t,e,r)=>{var i=r(67295),n=r(89509).Buffer,o=r(20685);function s(t){var e=t._cipher.encryptBlockRaw(t._prev);return o(t._prev),e}e.encrypt=function(t,e){var r=Math.ceil(e.length/16),o=t._cache.length;t._cache=n.concat([t._cache,n.allocUnsafe(16*r)]);for(var a=0;a<r;a++){var u=s(t),h=o+16*a;t._cache.writeUInt32BE(u[0],h+0),t._cache.writeUInt32BE(u[1],h+4),t._cache.writeUInt32BE(u[2],h+8),t._cache.writeUInt32BE(u[3],h+12)}var c=t._cache.slice(0,e.length);return t._cache=t._cache.slice(e.length),i(e,c)}},11084:(t,e)=>{e.encrypt=function(t,e){return t._cipher.encryptBlock(e)},e.decrypt=function(t,e){return t._cipher.decryptBlock(e)}},45:(t,e,r)=>{var i={ECB:r(11084),CBC:r(25292),CFB:r(86311),CFB8:r(71964),CFB1:r(21510),OFB:r(18861),CTR:r(96009),GCM:r(96009)},n=r(55415);for(var o in n)n[o].module=i[n[o].mode];t.exports=n},55415:t=>{"use strict";t.exports=JSON.parse('{"aes-128-ecb":{"cipher":"AES","key":128,"iv":0,"mode":"ECB","type":"block"},"aes-192-ecb":{"cipher":"AES","key":192,"iv":0,"mode":"ECB","type":"block"},"aes-256-ecb":{"cipher":"AES","key":256,"iv":0,"mode":"ECB","type":"block"},"aes-128-cbc":{"cipher":"AES","key":128,"iv":16,"mode":"CBC","type":"block"},"aes-192-cbc":{"cipher":"AES","key":192,"iv":16,"mode":"CBC","type":"block"},"aes-256-cbc":{"cipher":"AES","key":256,"iv":16,"mode":"CBC","type":"block"},"aes128":{"cipher":"AES","key":128,"iv":16,"mode":"CBC","type":"block"},"aes192":{"cipher":"AES","key":192,"iv":16,"mode":"CBC","type":"block"},"aes256":{"cipher":"AES","key":256,"iv":16,"mode":"CBC","type":"block"},"aes-128-cfb":{"cipher":"AES","key":128,"iv":16,"mode":"CFB","type":"stream"},"aes-192-cfb":{"cipher":"AES","key":192,"iv":16,"mode":"CFB","type":"stream"},"aes-256-cfb":{"cipher":"AES","key":256,"iv":16,"mode":"CFB","type":"stream"},"aes-128-cfb8":{"cipher":"AES","key":128,"iv":16,"mode":"CFB8","type":"stream"},"aes-192-cfb8":{"cipher":"AES","key":192,"iv":16,"mode":"CFB8","type":"stream"},"aes-256-cfb8":{"cipher":"AES","key":256,"iv":16,"mode":"CFB8","type":"stream"},"aes-128-cfb1":{"cipher":"AES","key":128,"iv":16,"mode":"CFB1","type":"stream"},"aes-192-cfb1":{"cipher":"AES","key":192,"iv":16,"mode":"CFB1","type":"stream"},"aes-256-cfb1":{"cipher":"AES","key":256,"iv":16,"mode":"CFB1","type":"stream"},"aes-128-ofb":{"cipher":"AES","key":128,"iv":16,"mode":"OFB","type":"stream"},"aes-192-ofb":{"cipher":"AES","key":192,"iv":16,"mode":"OFB","type":"stream"},"aes-256-ofb":{"cipher":"AES","key":256,"iv":16,"mode":"OFB","type":"stream"},"aes-128-ctr":{"cipher":"AES","key":128,"iv":16,"mode":"CTR","type":"stream"},"aes-192-ctr":{"cipher":"AES","key":192,"iv":16,"mode":"CTR","type":"stream"},"aes-256-ctr":{"cipher":"AES","key":256,"iv":16,"mode":"CTR","type":"stream"},"aes-128-gcm":{"cipher":"AES","key":128,"iv":12,"mode":"GCM","type":"auth"},"aes-192-gcm":{"cipher":"AES","key":192,"iv":12,"mode":"GCM","type":"auth"},"aes-256-gcm":{"cipher":"AES","key":256,"iv":12,"mode":"GCM","type":"auth"}}')},18861:(t,e,r)=>{var i=r(67295);function n(t){return t._prev=t._cipher.encryptBlock(t._prev),t._prev}e.encrypt=function(t,e){for(;t._cache.length<e.length;)t._cache=Buffer.concat([t._cache,n(t)]);var r=t._cache.slice(0,e.length);return t._cache=t._cache.slice(e.length),i(e,r)}},25969:(t,e,r)=>{var i=r(74497),n=r(89509).Buffer,o=r(71027);function s(t,e,r,s){o.call(this),this._cipher=new i.AES(e),this._prev=n.from(r),this._cache=n.allocUnsafe(0),this._secCache=n.allocUnsafe(0),this._decrypt=s,this._mode=t}r(35717)(s,o),s.prototype._update=function(t){return this._mode.encrypt(this,t,this._decrypt)},s.prototype._final=function(){this._cipher.scrub()},t.exports=s},53614:(t,e,r)=>{var i=r(47667),n=r(44696),o=r(45),s=r(99715),a=r(13048);function u(t,e,r){if(t=t.toLowerCase(),o[t])return n.createCipheriv(t,e,r);if(s[t])return new i({key:e,iv:r,mode:t});throw new TypeError("invalid suite type")}function h(t,e,r){if(t=t.toLowerCase(),o[t])return n.createDecipheriv(t,e,r);if(s[t])return new i({key:e,iv:r,mode:t,decrypt:!0});throw new TypeError("invalid suite type")}e.createCipher=e.Cipher=function(t,e){var r,i;if(t=t.toLowerCase(),o[t])r=o[t].key,i=o[t].iv;else{if(!s[t])throw new TypeError("invalid suite type");r=8*s[t].key,i=s[t].iv}var n=a(e,!1,r,i);return u(t,n.key,n.iv)},e.createCipheriv=e.Cipheriv=u,e.createDecipher=e.Decipher=function(t,e){var r,i;if(t=t.toLowerCase(),o[t])r=o[t].key,i=o[t].iv;else{if(!s[t])throw new TypeError("invalid suite type");r=8*s[t].key,i=s[t].iv}var n=a(e,!1,r,i);return h(t,n.key,n.iv)},e.createDecipheriv=e.Decipheriv=h,e.listCiphers=e.getCiphers=function(){return Object.keys(s).concat(n.getCiphers())}},47667:(t,e,r)=>{var i=r(71027),n=r(15251),o=r(35717),s=r(89509).Buffer,a={"des-ede3-cbc":n.CBC.instantiate(n.EDE),"des-ede3":n.EDE,"des-ede-cbc":n.CBC.instantiate(n.EDE),"des-ede":n.EDE,"des-cbc":n.CBC.instantiate(n.DES),"des-ecb":n.DES};function u(t){i.call(this);var e,r=t.mode.toLowerCase(),n=a[r];e=t.decrypt?"decrypt":"encrypt";var o=t.key;s.isBuffer(o)||(o=s.from(o)),"des-ede"!==r&&"des-ede-cbc"!==r||(o=s.concat([o,o.slice(0,8)]));var u=t.iv;s.isBuffer(u)||(u=s.from(u)),this._des=n.create({key:o,iv:u,type:e})}a.des=a["des-cbc"],a.des3=a["des-ede3-cbc"],t.exports=u,o(u,i),u.prototype._update=function(t){return s.from(this._des.update(t))},u.prototype._final=function(){return s.from(this._des.final())}},99715:(t,e)=>{e["des-ecb"]={key:8,iv:0},e["des-cbc"]=e.des={key:8,iv:8},e["des-ede3-cbc"]=e.des3={key:24,iv:8},e["des-ede3"]={key:24,iv:0},e["des-ede-cbc"]={key:16,iv:8},e["des-ede"]={key:16,iv:0}},23663:(t,e,r)=>{var i=r(13550),n=r(61798);function o(t){var e,r=t.modulus.byteLength();do{e=new i(n(r))}while(e.cmp(t.modulus)>=0||!e.umod(t.prime1)||!e.umod(t.prime2));return e}function s(t,e){var r=function(t){var e=o(t);return{blinder:e.toRed(i.mont(t.modulus)).redPow(new i(t.publicExponent)).fromRed(),unblinder:e.invm(t.modulus)}}(e),n=e.modulus.byteLength(),s=new i(t).mul(r.blinder).umod(e.modulus),a=s.toRed(i.mont(e.prime1)),u=s.toRed(i.mont(e.prime2)),h=e.coefficient,c=e.prime1,f=e.prime2,l=a.redPow(e.exponent1).fromRed(),d=u.redPow(e.exponent2).fromRed(),p=l.isub(d).imul(h).umod(c).imul(f);return d.iadd(p).imul(r.unblinder).umod(e.modulus).toArrayLike(Buffer,"be",n)}s.getr=o,t.exports=s},56042:(t,e,r)=>{t.exports=r(42063)},42063:t=>{"use strict";t.exports=JSON.parse('{"sha224WithRSAEncryption":{"sign":"rsa","hash":"sha224","id":"302d300d06096086480165030402040500041c"},"RSA-SHA224":{"sign":"ecdsa/rsa","hash":"sha224","id":"302d300d06096086480165030402040500041c"},"sha256WithRSAEncryption":{"sign":"rsa","hash":"sha256","id":"3031300d060960864801650304020105000420"},"RSA-SHA256":{"sign":"ecdsa/rsa","hash":"sha256","id":"3031300d060960864801650304020105000420"},"sha384WithRSAEncryption":{"sign":"rsa","hash":"sha384","id":"3041300d060960864801650304020205000430"},"RSA-SHA384":{"sign":"ecdsa/rsa","hash":"sha384","id":"3041300d060960864801650304020205000430"},"sha512WithRSAEncryption":{"sign":"rsa","hash":"sha512","id":"3051300d060960864801650304020305000440"},"RSA-SHA512":{"sign":"ecdsa/rsa","hash":"sha512","id":"3051300d060960864801650304020305000440"},"RSA-SHA1":{"sign":"rsa","hash":"sha1","id":"3021300906052b0e03021a05000414"},"ecdsa-with-SHA1":{"sign":"ecdsa","hash":"sha1","id":""},"sha256":{"sign":"ecdsa","hash":"sha256","id":""},"sha224":{"sign":"ecdsa","hash":"sha224","id":""},"sha384":{"sign":"ecdsa","hash":"sha384","id":""},"sha512":{"sign":"ecdsa","hash":"sha512","id":""},"DSA-SHA":{"sign":"dsa","hash":"sha1","id":""},"DSA-SHA1":{"sign":"dsa","hash":"sha1","id":""},"DSA":{"sign":"dsa","hash":"sha1","id":""},"DSA-WITH-SHA224":{"sign":"dsa","hash":"sha224","id":""},"DSA-SHA224":{"sign":"dsa","hash":"sha224","id":""},"DSA-WITH-SHA256":{"sign":"dsa","hash":"sha256","id":""},"DSA-SHA256":{"sign":"dsa","hash":"sha256","id":""},"DSA-WITH-SHA384":{"sign":"dsa","hash":"sha384","id":""},"DSA-SHA384":{"sign":"dsa","hash":"sha384","id":""},"DSA-WITH-SHA512":{"sign":"dsa","hash":"sha512","id":""},"DSA-SHA512":{"sign":"dsa","hash":"sha512","id":""},"DSA-RIPEMD160":{"sign":"dsa","hash":"rmd160","id":""},"ripemd160WithRSA":{"sign":"rsa","hash":"rmd160","id":"3021300906052b2403020105000414"},"RSA-RIPEMD160":{"sign":"rsa","hash":"rmd160","id":"3021300906052b2403020105000414"},"md5WithRSAEncryption":{"sign":"rsa","hash":"md5","id":"3020300c06082a864886f70d020505000410"},"RSA-MD5":{"sign":"rsa","hash":"md5","id":"3020300c06082a864886f70d020505000410"}}')},42236:t=>{"use strict";t.exports=JSON.parse('{"1.3.132.0.10":"secp256k1","1.3.132.0.33":"p224","1.2.840.10045.3.1.1":"p192","1.2.840.10045.3.1.7":"p256","1.3.132.0.34":"p384","1.3.132.0.35":"p521"}')},64743:(t,e,r)=>{var i=r(25679).Buffer,n=r(23482),o=r(23872),s=r(35717),a=r(82957),u=r(47753),h=r(42063);function c(t){o.Writable.call(this);var e=h[t];if(!e)throw new Error("Unknown message digest");this._hashType=e.hash,this._hash=n(e.hash),this._tag=e.id,this._signType=e.sign}function f(t){o.Writable.call(this);var e=h[t];if(!e)throw new Error("Unknown message digest");this._hash=n(e.hash),this._tag=e.id,this._signType=e.sign}function l(t){return new c(t)}function d(t){return new f(t)}Object.keys(h).forEach((function(t){h[t].id=i.from(h[t].id,"hex"),h[t.toLowerCase()]=h[t]})),s(c,o.Writable),c.prototype._write=function(t,e,r){this._hash.update(t),r()},c.prototype.update=function(t,e){return"string"==typeof t&&(t=i.from(t,e)),this._hash.update(t),this},c.prototype.sign=function(t,e){this.end();var r=this._hash.digest(),i=a(r,t,this._hashType,this._signType,this._tag);return e?i.toString(e):i},s(f,o.Writable),f.prototype._write=function(t,e,r){this._hash.update(t),r()},f.prototype.update=function(t,e){return"string"==typeof t&&(t=i.from(t,e)),this._hash.update(t),this},f.prototype.verify=function(t,e,r){"string"==typeof e&&(e=i.from(e,r)),this.end();var n=this._hash.digest();return u(e,n,t,this._signType,this._tag)},t.exports={Sign:l,Verify:d,createSign:l,createVerify:d}},82957:(t,e,r)=>{var i=r(25679).Buffer,n=r(58355),o=r(23663),s=r(86266).ec,a=r(13550),u=r(70980),h=r(42236);function c(t,e,r,o){if((t=i.from(t.toArray())).length<e.byteLength()){var s=i.alloc(e.byteLength()-t.length);t=i.concat([s,t])}var a=r.length,u=function(t,e){t=(t=f(t,e)).mod(e);var r=i.from(t.toArray());if(r.length<e.byteLength()){var n=i.alloc(e.byteLength()-r.length);r=i.concat([n,r])}return r}(r,e),h=i.alloc(a);h.fill(1);var c=i.alloc(a);return c=n(o,c).update(h).update(i.from([0])).update(t).update(u).digest(),h=n(o,c).update(h).digest(),{k:c=n(o,c).update(h).update(i.from([1])).update(t).update(u).digest(),v:h=n(o,c).update(h).digest()}}function f(t,e){var r=new a(t),i=(t.length<<3)-e.bitLength();return i>0&&r.ishrn(i),r}function l(t,e,r){var o,s;do{for(o=i.alloc(0);8*o.length<t.bitLength();)e.v=n(r,e.k).update(e.v).digest(),o=i.concat([o,e.v]);s=f(o,t),e.k=n(r,e.k).update(e.v).update(i.from([0])).digest(),e.v=n(r,e.k).update(e.v).digest()}while(-1!==s.cmp(t));return s}function d(t,e,r,i){return t.toRed(a.mont(r)).redPow(e).fromRed().mod(i)}t.exports=function(t,e,r,n,p){var g=u(e);if(g.curve){if("ecdsa"!==n&&"ecdsa/rsa"!==n)throw new Error("wrong private key type");return function(t,e){var r=h[e.curve.join(".")];if(!r)throw new Error("unknown curve "+e.curve.join("."));var n=new s(r).keyFromPrivate(e.privateKey).sign(t);return i.from(n.toDER())}(t,g)}if("dsa"===g.type){if("dsa"!==n)throw new Error("wrong private key type");return function(t,e,r){for(var n,o=e.params.priv_key,s=e.params.p,u=e.params.q,h=e.params.g,p=new a(0),g=f(t,u).mod(u),y=!1,m=c(o,u,t,r);!1===y;)p=d(h,n=l(u,m,r),s,u),0===(y=n.invm(u).imul(g.add(o.mul(p))).mod(u)).cmpn(0)&&(y=!1,p=new a(0));return function(t,e){t=t.toArray(),e=e.toArray(),128&t[0]&&(t=[0].concat(t)),128&e[0]&&(e=[0].concat(e));var r=[48,t.length+e.length+4,2,t.length];return r=r.concat(t,[2,e.length],e),i.from(r)}(p,y)}(t,g,r)}if("rsa"!==n&&"ecdsa/rsa"!==n)throw new Error("wrong private key type");t=i.concat([p,t]);for(var y=g.modulus.byteLength(),m=[0,1];t.length+m.length+1<y;)m.push(255);m.push(0);for(var v=-1;++v<t.length;)m.push(t[v]);return o(m,g)},t.exports.getKey=c,t.exports.makeKey=l},47753:(t,e,r)=>{var i=r(25679).Buffer,n=r(13550),o=r(86266).ec,s=r(70980),a=r(42236);function u(t,e){if(t.cmpn(0)<=0)throw new Error("invalid sig");if(t.cmp(e)>=e)throw new Error("invalid sig")}t.exports=function(t,e,r,h,c){var f=s(r);if("ec"===f.type){if("ecdsa"!==h&&"ecdsa/rsa"!==h)throw new Error("wrong public key type");return function(t,e,r){var i=a[r.data.algorithm.curve.join(".")];if(!i)throw new Error("unknown curve "+r.data.algorithm.curve.join("."));var n=new o(i),s=r.data.subjectPrivateKey.data;return n.verify(e,t,s)}(t,e,f)}if("dsa"===f.type){if("dsa"!==h)throw new Error("wrong public key type");return function(t,e,r){var i=r.data.p,o=r.data.q,a=r.data.g,h=r.data.pub_key,c=s.signature.decode(t,"der"),f=c.s,l=c.r;u(f,o),u(l,o);var d=n.mont(i),p=f.invm(o);return 0===a.toRed(d).redPow(new n(e).mul(p).mod(o)).fromRed().mul(h.toRed(d).redPow(l.mul(p).mod(o)).fromRed()).mod(i).mod(o).cmp(l)}(t,e,f)}if("rsa"!==h&&"ecdsa/rsa"!==h)throw new Error("wrong public key type");e=i.concat([c,e]);for(var l=f.modulus.byteLength(),d=[1],p=0;e.length+d.length+2<l;)d.push(255),p++;d.push(0);for(var g=-1;++g<e.length;)d.push(e[g]);d=i.from(d);var y=n.mont(f.modulus);t=(t=new n(t).toRed(y)).redPow(new n(f.publicExponent)),t=i.from(t.fromRed().toArray());var m=p<8?1:0;for(l=Math.min(t.length,d.length),t.length!==d.length&&(m=1),g=-1;++g<l;)m|=t[g]^d[g];return 0===m}},84419:t=>{"use strict";var e={};function r(t,r,i){i||(i=Error);var n=function(t){var e,i;function n(e,i,n){return t.call(this,function(t,e,i){return"string"==typeof r?r:r(t,e,i)}(e,i,n))||this}return i=t,(e=n).prototype=Object.create(i.prototype),e.prototype.constructor=e,e.__proto__=i,n}(i);n.prototype.name=i.name,n.prototype.code=t,e[t]=n}function i(t,e){if(Array.isArray(t)){var r=t.length;return t=t.map((function(t){return String(t)})),r>2?"one of ".concat(e," ").concat(t.slice(0,r-1).join(", "),", or ")+t[r-1]:2===r?"one of ".concat(e," ").concat(t[0]," or ").concat(t[1]):"of ".concat(e," ").concat(t[0])}return"of ".concat(e," ").concat(String(t))}r("ERR_INVALID_OPT_VALUE",(function(t,e){return'The value "'+e+'" is invalid for option "'+t+'"'}),TypeError),r("ERR_INVALID_ARG_TYPE",(function(t,e,r){var n,o,s,a,u;if("string"==typeof e&&(o="not ",e.substr(0,o.length)===o)?(n="must not be",e=e.replace(/^not /,"")):n="must be",function(t,e,r){return(void 0===r||r>t.length)&&(r=t.length),t.substring(r-e.length,r)===e}(t," argument"))s="The ".concat(t," ").concat(n," ").concat(i(e,"type"));else{var h=("number"!=typeof u&&(u=0),u+".".length>(a=t).length||-1===a.indexOf(".",u)?"argument":"property");s='The "'.concat(t,'" ').concat(h," ").concat(n," ").concat(i(e,"type"))}return s+". Received type ".concat(typeof r)}),TypeError),r("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),r("ERR_METHOD_NOT_IMPLEMENTED",(function(t){return"The "+t+" method is not implemented"})),r("ERR_STREAM_PREMATURE_CLOSE","Premature close"),r("ERR_STREAM_DESTROYED",(function(t){return"Cannot call "+t+" after a stream was destroyed"})),r("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),r("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),r("ERR_STREAM_WRITE_AFTER_END","write after end"),r("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),r("ERR_UNKNOWN_ENCODING",(function(t){return"Unknown encoding: "+t}),TypeError),r("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),t.exports.q=e},34390:(t,e,r)=>{"use strict";var i=Object.keys||function(t){var e=[];for(var r in t)e.push(r);return e};t.exports=h;var n=r(44960),o=r(92010);r(35717)(h,n);for(var s=i(o.prototype),a=0;a<s.length;a++){var u=s[a];h.prototype[u]||(h.prototype[u]=o.prototype[u])}function h(t){if(!(this instanceof h))return new h(t);n.call(this,t),o.call(this,t),this.allowHalfOpen=!0,t&&(!1===t.readable&&(this.readable=!1),!1===t.writable&&(this.writable=!1),!1===t.allowHalfOpen&&(this.allowHalfOpen=!1,this.once("end",c)))}function c(){this._writableState.ended||process.nextTick(f,this)}function f(t){t.end()}Object.defineProperty(h.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(h.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(h.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(h.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&void 0!==this._writableState&&this._readableState.destroyed&&this._writableState.destroyed},set:function(t){void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed=t,this._writableState.destroyed=t)}})},41294:(t,e,r)=>{"use strict";t.exports=n;var i=r(3912);function n(t){if(!(this instanceof n))return new n(t);i.call(this,t)}r(35717)(n,i),n.prototype._transform=function(t,e,r){r(null,t)}},44960:(t,e,r)=>{"use strict";var i;t.exports=M,M.ReadableState=E,r(17187).EventEmitter;var n,o=function(t,e){return t.listeners(e).length},s=r(59819),a=r(48764).Buffer,u=r.g.Uint8Array||function(){},h=r(61758);n=h&&h.debuglog?h.debuglog("stream"):function(){};var c,f,l,d=r(76633),p=r(75997),g=r(898).getHighWaterMark,y=r(84419).q,m=y.ERR_INVALID_ARG_TYPE,v=y.ERR_STREAM_PUSH_AFTER_EOF,b=y.ERR_METHOD_NOT_IMPLEMENTED,w=y.ERR_STREAM_UNSHIFT_AFTER_END_EVENT;r(35717)(M,s);var _=p.errorOrDestroy,S=["error","close","destroy","pause","resume"];function E(t,e,n){i=i||r(34390),t=t||{},"boolean"!=typeof n&&(n=e instanceof i),this.objectMode=!!t.objectMode,n&&(this.objectMode=this.objectMode||!!t.readableObjectMode),this.highWaterMark=g(this,t,"readableHighWaterMark",n),this.buffer=new d,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=!1!==t.emitClose,this.autoDestroy=!!t.autoDestroy,this.destroyed=!1,this.defaultEncoding=t.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,t.encoding&&(c||(c=r(32553).s),this.decoder=new c(t.encoding),this.encoding=t.encoding)}function M(t){if(i=i||r(34390),!(this instanceof M))return new M(t);var e=this instanceof i;this._readableState=new E(t,this,e),this.readable=!0,t&&("function"==typeof t.read&&(this._read=t.read),"function"==typeof t.destroy&&(this._destroy=t.destroy)),s.call(this)}function A(t,e,r,i,o){n("readableAddChunk",e);var s,h=t._readableState;if(null===e)h.reading=!1,function(t,e){if(n("onEofChunk"),!e.ended){if(e.decoder){var r=e.decoder.end();r&&r.length&&(e.buffer.push(r),e.length+=e.objectMode?1:r.length)}e.ended=!0,e.sync?T(t):(e.needReadable=!1,e.emittedReadable||(e.emittedReadable=!0,R(t)))}}(t,h);else if(o||(s=function(t,e){var r,i;return i=e,a.isBuffer(i)||i instanceof u||"string"==typeof e||void 0===e||t.objectMode||(r=new m("chunk",["string","Buffer","Uint8Array"],e)),r}(h,e)),s)_(t,s);else if(h.objectMode||e&&e.length>0)if("string"==typeof e||h.objectMode||Object.getPrototypeOf(e)===a.prototype||(e=function(t){return a.from(t)}(e)),i)h.endEmitted?_(t,new w):C(t,h,e,!0);else if(h.ended)_(t,new v);else{if(h.destroyed)return!1;h.reading=!1,h.decoder&&!r?(e=h.decoder.write(e),h.objectMode||0!==e.length?C(t,h,e,!1):B(t,h)):C(t,h,e,!1)}else i||(h.reading=!1,B(t,h));return!h.ended&&(h.length<h.highWaterMark||0===h.length)}function C(t,e,r,i){e.flowing&&0===e.length&&!e.sync?(e.awaitDrain=0,t.emit("data",r)):(e.length+=e.objectMode?1:r.length,i?e.buffer.unshift(r):e.buffer.push(r),e.needReadable&&T(t)),B(t,e)}Object.defineProperty(M.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&this._readableState.destroyed},set:function(t){this._readableState&&(this._readableState.destroyed=t)}}),M.prototype.destroy=p.destroy,M.prototype._undestroy=p.undestroy,M.prototype._destroy=function(t,e){e(t)},M.prototype.push=function(t,e){var r,i=this._readableState;return i.objectMode?r=!0:"string"==typeof t&&((e=e||i.defaultEncoding)!==i.encoding&&(t=a.from(t,e),e=""),r=!0),A(this,t,e,!1,r)},M.prototype.unshift=function(t){return A(this,t,null,!0,!1)},M.prototype.isPaused=function(){return!1===this._readableState.flowing},M.prototype.setEncoding=function(t){c||(c=r(32553).s);var e=new c(t);this._readableState.decoder=e,this._readableState.encoding=this._readableState.decoder.encoding;for(var i=this._readableState.buffer.head,n="";null!==i;)n+=e.write(i.data),i=i.next;return this._readableState.buffer.clear(),""!==n&&this._readableState.buffer.push(n),this._readableState.length=n.length,this};var k=1073741824;function I(t,e){return t<=0||0===e.length&&e.ended?0:e.objectMode?1:t!=t?e.flowing&&e.length?e.buffer.head.data.length:e.length:(t>e.highWaterMark&&(e.highWaterMark=function(t){return t>=k?t=k:(t--,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,t++),t}(t)),t<=e.length?t:e.ended?e.length:(e.needReadable=!0,0))}function T(t){var e=t._readableState;n("emitReadable",e.needReadable,e.emittedReadable),e.needReadable=!1,e.emittedReadable||(n("emitReadable",e.flowing),e.emittedReadable=!0,process.nextTick(R,t))}function R(t){var e=t._readableState;n("emitReadable_",e.destroyed,e.length,e.ended),e.destroyed||!e.length&&!e.ended||(t.emit("readable"),e.emittedReadable=!1),e.needReadable=!e.flowing&&!e.ended&&e.length<=e.highWaterMark,O(t)}function B(t,e){e.readingMore||(e.readingMore=!0,process.nextTick(x,t,e))}function x(t,e){for(;!e.reading&&!e.ended&&(e.length<e.highWaterMark||e.flowing&&0===e.length);){var r=e.length;if(n("maybeReadMore read 0"),t.read(0),r===e.length)break}e.readingMore=!1}function F(t){var e=t._readableState;e.readableListening=t.listenerCount("readable")>0,e.resumeScheduled&&!e.paused?e.flowing=!0:t.listenerCount("data")>0&&t.resume()}function P(t){n("readable nexttick read 0"),t.read(0)}function N(t,e){n("resume",e.reading),e.reading||t.read(0),e.resumeScheduled=!1,t.emit("resume"),O(t),e.flowing&&!e.reading&&t.read(0)}function O(t){var e=t._readableState;for(n("flow",e.flowing);e.flowing&&null!==t.read(););}function L(t,e){return 0===e.length?null:(e.objectMode?r=e.buffer.shift():!t||t>=e.length?(r=e.decoder?e.buffer.join(""):1===e.buffer.length?e.buffer.first():e.buffer.concat(e.length),e.buffer.clear()):r=e.buffer.consume(t,e.decoder),r);var r}function U(t){var e=t._readableState;n("endReadable",e.endEmitted),e.endEmitted||(e.ended=!0,process.nextTick(j,e,t))}function j(t,e){if(n("endReadableNT",t.endEmitted,t.length),!t.endEmitted&&0===t.length&&(t.endEmitted=!0,e.readable=!1,e.emit("end"),t.autoDestroy)){var r=e._writableState;(!r||r.autoDestroy&&r.finished)&&e.destroy()}}function D(t,e){for(var r=0,i=t.length;r<i;r++)if(t[r]===e)return r;return-1}M.prototype.read=function(t){n("read",t),t=parseInt(t,10);var e=this._readableState,r=t;if(0!==t&&(e.emittedReadable=!1),0===t&&e.needReadable&&((0!==e.highWaterMark?e.length>=e.highWaterMark:e.length>0)||e.ended))return n("read: emitReadable",e.length,e.ended),0===e.length&&e.ended?U(this):T(this),null;if(0===(t=I(t,e))&&e.ended)return 0===e.length&&U(this),null;var i,o=e.needReadable;return n("need readable",o),(0===e.length||e.length-t<e.highWaterMark)&&n("length less than watermark",o=!0),e.ended||e.reading?n("reading or ended",o=!1):o&&(n("do read"),e.reading=!0,e.sync=!0,0===e.length&&(e.needReadable=!0),this._read(e.highWaterMark),e.sync=!1,e.reading||(t=I(r,e))),null===(i=t>0?L(t,e):null)?(e.needReadable=e.length<=e.highWaterMark,t=0):(e.length-=t,e.awaitDrain=0),0===e.length&&(e.ended||(e.needReadable=!0),r!==t&&e.ended&&U(this)),null!==i&&this.emit("data",i),i},M.prototype._read=function(t){_(this,new b("_read()"))},M.prototype.pipe=function(t,e){var r=this,i=this._readableState;switch(i.pipesCount){case 0:i.pipes=t;break;case 1:i.pipes=[i.pipes,t];break;default:i.pipes.push(t)}i.pipesCount+=1,n("pipe count=%d opts=%j",i.pipesCount,e);var s=e&&!1===e.end||t===process.stdout||t===process.stderr?p:a;function a(){n("onend"),t.end()}i.endEmitted?process.nextTick(s):r.once("end",s),t.on("unpipe",(function e(o,s){n("onunpipe"),o===r&&s&&!1===s.hasUnpiped&&(s.hasUnpiped=!0,n("cleanup"),t.removeListener("close",l),t.removeListener("finish",d),t.removeListener("drain",u),t.removeListener("error",f),t.removeListener("unpipe",e),r.removeListener("end",a),r.removeListener("end",p),r.removeListener("data",c),h=!0,!i.awaitDrain||t._writableState&&!t._writableState.needDrain||u())}));var u=function(t){return function(){var e=t._readableState;n("pipeOnDrain",e.awaitDrain),e.awaitDrain&&e.awaitDrain--,0===e.awaitDrain&&o(t,"data")&&(e.flowing=!0,O(t))}}(r);t.on("drain",u);var h=!1;function c(e){n("ondata");var o=t.write(e);n("dest.write",o),!1===o&&((1===i.pipesCount&&i.pipes===t||i.pipesCount>1&&-1!==D(i.pipes,t))&&!h&&(n("false write response, pause",i.awaitDrain),i.awaitDrain++),r.pause())}function f(e){n("onerror",e),p(),t.removeListener("error",f),0===o(t,"error")&&_(t,e)}function l(){t.removeListener("finish",d),p()}function d(){n("onfinish"),t.removeListener("close",l),p()}function p(){n("unpipe"),r.unpipe(t)}return r.on("data",c),function(t,e,r){if("function"==typeof t.prependListener)return t.prependListener(e,r);t._events&&t._events.error?Array.isArray(t._events.error)?t._events.error.unshift(r):t._events.error=[r,t._events.error]:t.on(e,r)}(t,"error",f),t.once("close",l),t.once("finish",d),t.emit("pipe",r),i.flowing||(n("pipe resume"),r.resume()),t},M.prototype.unpipe=function(t){var e=this._readableState,r={hasUnpiped:!1};if(0===e.pipesCount)return this;if(1===e.pipesCount)return t&&t!==e.pipes||(t||(t=e.pipes),e.pipes=null,e.pipesCount=0,e.flowing=!1,t&&t.emit("unpipe",this,r)),this;if(!t){var i=e.pipes,n=e.pipesCount;e.pipes=null,e.pipesCount=0,e.flowing=!1;for(var o=0;o<n;o++)i[o].emit("unpipe",this,{hasUnpiped:!1});return this}var s=D(e.pipes,t);return-1===s||(e.pipes.splice(s,1),e.pipesCount-=1,1===e.pipesCount&&(e.pipes=e.pipes[0]),t.emit("unpipe",this,r)),this},M.prototype.on=function(t,e){var r=s.prototype.on.call(this,t,e),i=this._readableState;return"data"===t?(i.readableListening=this.listenerCount("readable")>0,!1!==i.flowing&&this.resume()):"readable"===t&&(i.endEmitted||i.readableListening||(i.readableListening=i.needReadable=!0,i.flowing=!1,i.emittedReadable=!1,n("on readable",i.length,i.reading),i.length?T(this):i.reading||process.nextTick(P,this))),r},M.prototype.addListener=M.prototype.on,M.prototype.removeListener=function(t,e){var r=s.prototype.removeListener.call(this,t,e);return"readable"===t&&process.nextTick(F,this),r},M.prototype.removeAllListeners=function(t){var e=s.prototype.removeAllListeners.apply(this,arguments);return"readable"!==t&&void 0!==t||process.nextTick(F,this),e},M.prototype.resume=function(){var t=this._readableState;return t.flowing||(n("resume"),t.flowing=!t.readableListening,function(t,e){e.resumeScheduled||(e.resumeScheduled=!0,process.nextTick(N,t,e))}(this,t)),t.paused=!1,this},M.prototype.pause=function(){return n("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(n("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},M.prototype.wrap=function(t){var e=this,r=this._readableState,i=!1;for(var o in t.on("end",(function(){if(n("wrapped end"),r.decoder&&!r.ended){var t=r.decoder.end();t&&t.length&&e.push(t)}e.push(null)})),t.on("data",(function(o){n("wrapped data"),r.decoder&&(o=r.decoder.write(o)),r.objectMode&&null==o||(r.objectMode||o&&o.length)&&(e.push(o)||(i=!0,t.pause()))})),t)void 0===this[o]&&"function"==typeof t[o]&&(this[o]=function(e){return function(){return t[e].apply(t,arguments)}}(o));for(var s=0;s<S.length;s++)t.on(S[s],this.emit.bind(this,S[s]));return this._read=function(e){n("wrapped _read",e),i&&(i=!1,t.resume())},this},"function"==typeof Symbol&&(M.prototype[Symbol.asyncIterator]=function(){return void 0===f&&(f=r(54887)),f(this)}),Object.defineProperty(M.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Object.defineProperty(M.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty(M.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(t){this._readableState&&(this._readableState.flowing=t)}}),M._fromList=L,Object.defineProperty(M.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}}),"function"==typeof Symbol&&(M.from=function(t,e){return void 0===l&&(l=r(98859)),l(M,t,e)})},3912:(t,e,r)=>{"use strict";t.exports=c;var i=r(84419).q,n=i.ERR_METHOD_NOT_IMPLEMENTED,o=i.ERR_MULTIPLE_CALLBACK,s=i.ERR_TRANSFORM_ALREADY_TRANSFORMING,a=i.ERR_TRANSFORM_WITH_LENGTH_0,u=r(34390);function h(t,e){var r=this._transformState;r.transforming=!1;var i=r.writecb;if(null===i)return this.emit("error",new o);r.writechunk=null,r.writecb=null,null!=e&&this.push(e),i(t);var n=this._readableState;n.reading=!1,(n.needReadable||n.length<n.highWaterMark)&&this._read(n.highWaterMark)}function c(t){if(!(this instanceof c))return new c(t);u.call(this,t),this._transformState={afterTransform:h.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,t&&("function"==typeof t.transform&&(this._transform=t.transform),"function"==typeof t.flush&&(this._flush=t.flush)),this.on("prefinish",f)}function f(){var t=this;"function"!=typeof this._flush||this._readableState.destroyed?l(this,null,null):this._flush((function(e,r){l(t,e,r)}))}function l(t,e,r){if(e)return t.emit("error",e);if(null!=r&&t.push(r),t._writableState.length)throw new a;if(t._transformState.transforming)throw new s;return t.push(null)}r(35717)(c,u),c.prototype.push=function(t,e){return this._transformState.needTransform=!1,u.prototype.push.call(this,t,e)},c.prototype._transform=function(t,e,r){r(new n("_transform()"))},c.prototype._write=function(t,e,r){var i=this._transformState;if(i.writecb=r,i.writechunk=t,i.writeencoding=e,!i.transforming){var n=this._readableState;(i.needTransform||n.needReadable||n.length<n.highWaterMark)&&this._read(n.highWaterMark)}},c.prototype._read=function(t){var e=this._transformState;null===e.writechunk||e.transforming?e.needTransform=!0:(e.transforming=!0,this._transform(e.writechunk,e.writeencoding,e.afterTransform))},c.prototype._destroy=function(t,e){u.prototype._destroy.call(this,t,(function(t){e(t)}))}},92010:(t,e,r)=>{"use strict";function i(t){var e=this;this.next=null,this.entry=null,this.finish=function(){!function(t,e,r){var i=t.entry;for(t.entry=null;i;){var n=i.callback;e.pendingcb--,n(undefined),i=i.next}e.corkedRequestsFree.next=t}(e,t)}}var n;t.exports=M,M.WritableState=E;var o,s={deprecate:r(94927)},a=r(59819),u=r(48764).Buffer,h=r.g.Uint8Array||function(){},c=r(75997),f=r(898).getHighWaterMark,l=r(84419).q,d=l.ERR_INVALID_ARG_TYPE,p=l.ERR_METHOD_NOT_IMPLEMENTED,g=l.ERR_MULTIPLE_CALLBACK,y=l.ERR_STREAM_CANNOT_PIPE,m=l.ERR_STREAM_DESTROYED,v=l.ERR_STREAM_NULL_VALUES,b=l.ERR_STREAM_WRITE_AFTER_END,w=l.ERR_UNKNOWN_ENCODING,_=c.errorOrDestroy;function S(){}function E(t,e,o){n=n||r(34390),t=t||{},"boolean"!=typeof o&&(o=e instanceof n),this.objectMode=!!t.objectMode,o&&(this.objectMode=this.objectMode||!!t.writableObjectMode),this.highWaterMark=f(this,t,"writableHighWaterMark",o),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var s=!1===t.decodeStrings;this.decodeStrings=!s,this.defaultEncoding=t.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(t){!function(t,e){var r=t._writableState,i=r.sync,n=r.writecb;if("function"!=typeof n)throw new g;if(function(t){t.writing=!1,t.writecb=null,t.length-=t.writelen,t.writelen=0}(r),e)!function(t,e,r,i,n){--e.pendingcb,r?(process.nextTick(n,i),process.nextTick(R,t,e),t._writableState.errorEmitted=!0,_(t,i)):(n(i),t._writableState.errorEmitted=!0,_(t,i),R(t,e))}(t,r,i,e,n);else{var o=I(r)||t.destroyed;o||r.corked||r.bufferProcessing||!r.bufferedRequest||k(t,r),i?process.nextTick(C,t,r,o,n):C(t,r,o,n)}}(e,t)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!1!==t.emitClose,this.autoDestroy=!!t.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new i(this)}function M(t){var e=this instanceof(n=n||r(34390));if(!e&&!o.call(M,this))return new M(t);this._writableState=new E(t,this,e),this.writable=!0,t&&("function"==typeof t.write&&(this._write=t.write),"function"==typeof t.writev&&(this._writev=t.writev),"function"==typeof t.destroy&&(this._destroy=t.destroy),"function"==typeof t.final&&(this._final=t.final)),a.call(this)}function A(t,e,r,i,n,o,s){e.writelen=i,e.writecb=s,e.writing=!0,e.sync=!0,e.destroyed?e.onwrite(new m("write")):r?t._writev(n,e.onwrite):t._write(n,o,e.onwrite),e.sync=!1}function C(t,e,r,i){r||function(t,e){0===e.length&&e.needDrain&&(e.needDrain=!1,t.emit("drain"))}(t,e),e.pendingcb--,i(),R(t,e)}function k(t,e){e.bufferProcessing=!0;var r=e.bufferedRequest;if(t._writev&&r&&r.next){var n=e.bufferedRequestCount,o=new Array(n),s=e.corkedRequestsFree;s.entry=r;for(var a=0,u=!0;r;)o[a]=r,r.isBuf||(u=!1),r=r.next,a+=1;o.allBuffers=u,A(t,e,!0,e.length,o,"",s.finish),e.pendingcb++,e.lastBufferedRequest=null,s.next?(e.corkedRequestsFree=s.next,s.next=null):e.corkedRequestsFree=new i(e),e.bufferedRequestCount=0}else{for(;r;){var h=r.chunk,c=r.encoding,f=r.callback;if(A(t,e,!1,e.objectMode?1:h.length,h,c,f),r=r.next,e.bufferedRequestCount--,e.writing)break}null===r&&(e.lastBufferedRequest=null)}e.bufferedRequest=r,e.bufferProcessing=!1}function I(t){return t.ending&&0===t.length&&null===t.bufferedRequest&&!t.finished&&!t.writing}function T(t,e){t._final((function(r){e.pendingcb--,r&&_(t,r),e.prefinished=!0,t.emit("prefinish"),R(t,e)}))}function R(t,e){var r=I(e);if(r&&(function(t,e){e.prefinished||e.finalCalled||("function"!=typeof t._final||e.destroyed?(e.prefinished=!0,t.emit("prefinish")):(e.pendingcb++,e.finalCalled=!0,process.nextTick(T,t,e)))}(t,e),0===e.pendingcb&&(e.finished=!0,t.emit("finish"),e.autoDestroy))){var i=t._readableState;(!i||i.autoDestroy&&i.endEmitted)&&t.destroy()}return r}r(35717)(M,a),E.prototype.getBuffer=function(){for(var t=this.bufferedRequest,e=[];t;)e.push(t),t=t.next;return e},function(){try{Object.defineProperty(E.prototype,"buffer",{get:s.deprecate((function(){return this.getBuffer()}),"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(t){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(o=Function.prototype[Symbol.hasInstance],Object.defineProperty(M,Symbol.hasInstance,{value:function(t){return!!o.call(this,t)||this===M&&t&&t._writableState instanceof E}})):o=function(t){return t instanceof this},M.prototype.pipe=function(){_(this,new y)},M.prototype.write=function(t,e,r){var i,n=this._writableState,o=!1,s=!n.objectMode&&(i=t,u.isBuffer(i)||i instanceof h);return s&&!u.isBuffer(t)&&(t=function(t){return u.from(t)}(t)),"function"==typeof e&&(r=e,e=null),s?e="buffer":e||(e=n.defaultEncoding),"function"!=typeof r&&(r=S),n.ending?function(t,e){var r=new b;_(t,r),process.nextTick(e,r)}(this,r):(s||function(t,e,r,i){var n;return null===r?n=new v:"string"==typeof r||e.objectMode||(n=new d("chunk",["string","Buffer"],r)),!n||(_(t,n),process.nextTick(i,n),!1)}(this,n,t,r))&&(n.pendingcb++,o=function(t,e,r,i,n,o){if(!r){var s=function(t,e,r){return t.objectMode||!1===t.decodeStrings||"string"!=typeof e||(e=u.from(e,r)),e}(e,i,n);i!==s&&(r=!0,n="buffer",i=s)}var a=e.objectMode?1:i.length;e.length+=a;var h=e.length<e.highWaterMark;if(h||(e.needDrain=!0),e.writing||e.corked){var c=e.lastBufferedRequest;e.lastBufferedRequest={chunk:i,encoding:n,isBuf:r,callback:o,next:null},c?c.next=e.lastBufferedRequest:e.bufferedRequest=e.lastBufferedRequest,e.bufferedRequestCount+=1}else A(t,e,!1,a,i,n,o);return h}(this,n,s,t,e,r)),o},M.prototype.cork=function(){this._writableState.corked++},M.prototype.uncork=function(){var t=this._writableState;t.corked&&(t.corked--,t.writing||t.corked||t.bufferProcessing||!t.bufferedRequest||k(this,t))},M.prototype.setDefaultEncoding=function(t){if("string"==typeof t&&(t=t.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((t+"").toLowerCase())>-1))throw new w(t);return this._writableState.defaultEncoding=t,this},Object.defineProperty(M.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(M.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),M.prototype._write=function(t,e,r){r(new p("_write()"))},M.prototype._writev=null,M.prototype.end=function(t,e,r){var i=this._writableState;return"function"==typeof t?(r=t,t=null,e=null):"function"==typeof e&&(r=e,e=null),null!=t&&this.write(t,e),i.corked&&(i.corked=1,this.uncork()),i.ending||function(t,e,r){e.ending=!0,R(t,e),r&&(e.finished?process.nextTick(r):t.once("finish",r)),e.ended=!0,t.writable=!1}(this,i,r),this},Object.defineProperty(M.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(M.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(t){this._writableState&&(this._writableState.destroyed=t)}}),M.prototype.destroy=c.destroy,M.prototype._undestroy=c.undestroy,M.prototype._destroy=function(t,e){e(t)}},54887:(t,e,r)=>{"use strict";var i;function n(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var o=r(5800),s=Symbol("lastResolve"),a=Symbol("lastReject"),u=Symbol("error"),h=Symbol("ended"),c=Symbol("lastPromise"),f=Symbol("handlePromise"),l=Symbol("stream");function d(t,e){return{value:t,done:e}}function p(t){var e=t[s];if(null!==e){var r=t[l].read();null!==r&&(t[c]=null,t[s]=null,t[a]=null,e(d(r,!1)))}}function g(t){process.nextTick(p,t)}var y=Object.getPrototypeOf((function(){})),m=Object.setPrototypeOf((n(i={get stream(){return this[l]},next:function(){var t=this,e=this[u];if(null!==e)return Promise.reject(e);if(this[h])return Promise.resolve(d(void 0,!0));if(this[l].destroyed)return new Promise((function(e,r){process.nextTick((function(){t[u]?r(t[u]):e(d(void 0,!0))}))}));var r,i=this[c];if(i)r=new Promise(function(t,e){return function(r,i){t.then((function(){e[h]?r(d(void 0,!0)):e[f](r,i)}),i)}}(i,this));else{var n=this[l].read();if(null!==n)return Promise.resolve(d(n,!1));r=new Promise(this[f])}return this[c]=r,r}},Symbol.asyncIterator,(function(){return this})),n(i,"return",(function(){var t=this;return new Promise((function(e,r){t[l].destroy(null,(function(t){t?r(t):e(d(void 0,!0))}))}))})),i),y);t.exports=function(t){var e,r=Object.create(m,(n(e={},l,{value:t,writable:!0}),n(e,s,{value:null,writable:!0}),n(e,a,{value:null,writable:!0}),n(e,u,{value:null,writable:!0}),n(e,h,{value:t._readableState.endEmitted,writable:!0}),n(e,f,{value:function(t,e){var i=r[l].read();i?(r[c]=null,r[s]=null,r[a]=null,t(d(i,!1))):(r[s]=t,r[a]=e)},writable:!0}),e));return r[c]=null,o(t,(function(t){if(t&&"ERR_STREAM_PREMATURE_CLOSE"!==t.code){var e=r[a];return null!==e&&(r[c]=null,r[s]=null,r[a]=null,e(t)),void(r[u]=t)}var i=r[s];null!==i&&(r[c]=null,r[s]=null,r[a]=null,i(d(void 0,!0))),r[h]=!0})),t.on("readable",g.bind(null,r)),r}},76633:(t,e,r)=>{"use strict";function i(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,i)}return r}function n(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function o(t,e){for(var r=0;r<e.length;r++){var i=e[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}var s=r(48764).Buffer,a=r(61758).inspect,u=a&&a.custom||"inspect";t.exports=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.head=null,this.tail=null,this.length=0}var e,r;return e=t,(r=[{key:"push",value:function(t){var e={data:t,next:null};this.length>0?this.tail.next=e:this.head=e,this.tail=e,++this.length}},{key:"unshift",value:function(t){var e={data:t,next:this.head};0===this.length&&(this.tail=e),this.head=e,++this.length}},{key:"shift",value:function(){if(0!==this.length){var t=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,t}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(t){if(0===this.length)return"";for(var e=this.head,r=""+e.data;e=e.next;)r+=t+e.data;return r}},{key:"concat",value:function(t){if(0===this.length)return s.alloc(0);for(var e,r,i,n=s.allocUnsafe(t>>>0),o=this.head,a=0;o;)e=o.data,r=n,i=a,s.prototype.copy.call(e,r,i),a+=o.data.length,o=o.next;return n}},{key:"consume",value:function(t,e){var r;return t<this.head.data.length?(r=this.head.data.slice(0,t),this.head.data=this.head.data.slice(t)):r=t===this.head.data.length?this.shift():e?this._getString(t):this._getBuffer(t),r}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(t){var e=this.head,r=1,i=e.data;for(t-=i.length;e=e.next;){var n=e.data,o=t>n.length?n.length:t;if(o===n.length?i+=n:i+=n.slice(0,t),0==(t-=o)){o===n.length?(++r,e.next?this.head=e.next:this.head=this.tail=null):(this.head=e,e.data=n.slice(o));break}++r}return this.length-=r,i}},{key:"_getBuffer",value:function(t){var e=s.allocUnsafe(t),r=this.head,i=1;for(r.data.copy(e),t-=r.data.length;r=r.next;){var n=r.data,o=t>n.length?n.length:t;if(n.copy(e,e.length-t,0,o),0==(t-=o)){o===n.length?(++i,r.next?this.head=r.next:this.head=this.tail=null):(this.head=r,r.data=n.slice(o));break}++i}return this.length-=i,e}},{key:u,value:function(t,e){return a(this,function(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?i(Object(r),!0).forEach((function(e){n(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):i(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}({},e,{depth:0,customInspect:!1}))}}])&&o(e.prototype,r),t}()},75997:t=>{"use strict";function e(t,e){i(t,e),r(t)}function r(t){t._writableState&&!t._writableState.emitClose||t._readableState&&!t._readableState.emitClose||t.emit("close")}function i(t,e){t.emit("error",e)}t.exports={destroy:function(t,n){var o=this,s=this._readableState&&this._readableState.destroyed,a=this._writableState&&this._writableState.destroyed;return s||a?(n?n(t):t&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,process.nextTick(i,this,t)):process.nextTick(i,this,t)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(t||null,(function(t){!n&&t?o._writableState?o._writableState.errorEmitted?process.nextTick(r,o):(o._writableState.errorEmitted=!0,process.nextTick(e,o,t)):process.nextTick(e,o,t):n?(process.nextTick(r,o),n(t)):process.nextTick(r,o)})),this)},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)},errorOrDestroy:function(t,e){var r=t._readableState,i=t._writableState;r&&r.autoDestroy||i&&i.autoDestroy?t.destroy(e):t.emit("error",e)}}},5800:(t,e,r)=>{"use strict";var i=r(84419).q.ERR_STREAM_PREMATURE_CLOSE;function n(){}t.exports=function t(e,r,o){if("function"==typeof r)return t(e,null,r);r||(r={}),o=function(t){var e=!1;return function(){if(!e){e=!0;for(var r=arguments.length,i=new Array(r),n=0;n<r;n++)i[n]=arguments[n];t.apply(this,i)}}}(o||n);var s=r.readable||!1!==r.readable&&e.readable,a=r.writable||!1!==r.writable&&e.writable,u=function(){e.writable||c()},h=e._writableState&&e._writableState.finished,c=function(){a=!1,h=!0,s||o.call(e)},f=e._readableState&&e._readableState.endEmitted,l=function(){s=!1,f=!0,a||o.call(e)},d=function(t){o.call(e,t)},p=function(){var t;return s&&!f?(e._readableState&&e._readableState.ended||(t=new i),o.call(e,t)):a&&!h?(e._writableState&&e._writableState.ended||(t=new i),o.call(e,t)):void 0},g=function(){e.req.on("finish",c)};return function(t){return t.setHeader&&"function"==typeof t.abort}(e)?(e.on("complete",c),e.on("abort",p),e.req?g():e.on("request",g)):a&&!e._writableState&&(e.on("end",u),e.on("close",u)),e.on("end",l),e.on("finish",c),!1!==r.error&&e.on("error",d),e.on("close",p),function(){e.removeListener("complete",c),e.removeListener("abort",p),e.removeListener("request",g),e.req&&e.req.removeListener("finish",c),e.removeListener("end",u),e.removeListener("close",u),e.removeListener("finish",c),e.removeListener("end",l),e.removeListener("error",d),e.removeListener("close",p)}}},98859:t=>{t.exports=function(){throw new Error("Readable.from is not available in the browser")}},37065:(t,e,r)=>{"use strict";var i,n=r(84419).q,o=n.ERR_MISSING_ARGS,s=n.ERR_STREAM_DESTROYED;function a(t){if(t)throw t}function u(t,e,n,o){o=function(t){var e=!1;return function(){e||(e=!0,t.apply(void 0,arguments))}}(o);var a=!1;t.on("close",(function(){a=!0})),void 0===i&&(i=r(5800)),i(t,{readable:e,writable:n},(function(t){if(t)return o(t);a=!0,o()}));var u=!1;return function(e){if(!a&&!u)return u=!0,function(t){return t.setHeader&&"function"==typeof t.abort}(t)?t.abort():"function"==typeof t.destroy?t.destroy():void o(e||new s("pipe"))}}function h(t){t()}function c(t,e){return t.pipe(e)}function f(t){return t.length?"function"!=typeof t[t.length-1]?a:t.pop():a}t.exports=function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];var i,n=f(e);if(Array.isArray(e[0])&&(e=e[0]),e.length<2)throw new o("streams");var s=e.map((function(t,r){var o=r<e.length-1;return u(t,o,r>0,(function(t){i||(i=t),t&&s.forEach(h),o||(s.forEach(h),n(i))}))}));return e.reduce(c)}},898:(t,e,r)=>{"use strict";var i=r(84419).q.ERR_INVALID_OPT_VALUE;t.exports={getHighWaterMark:function(t,e,r,n){var o=function(t,e,r){return null!=t.highWaterMark?t.highWaterMark:e?t[r]:null}(e,n,r);if(null!=o){if(!isFinite(o)||Math.floor(o)!==o||o<0)throw new i(n?r:"highWaterMark",o);return Math.floor(o)}return t.objectMode?16:16384}}},59819:(t,e,r)=>{t.exports=r(17187).EventEmitter},23872:(t,e,r)=>{(e=t.exports=r(44960)).Stream=e,e.Readable=e,e.Writable=r(92010),e.Duplex=r(34390),e.Transform=r(3912),e.PassThrough=r(41294),e.finished=r(5800),e.pipeline=r(37065)},25679:(t,e,r)=>{var i=r(48764),n=i.Buffer;function o(t,e){for(var r in t)e[r]=t[r]}function s(t,e,r){return n(t,e,r)}n.from&&n.alloc&&n.allocUnsafe&&n.allocUnsafeSlow?t.exports=i:(o(i,e),e.Buffer=s),s.prototype=Object.create(n.prototype),o(n,s),s.from=function(t,e,r){if("number"==typeof t)throw new TypeError("Argument must not be a number");return n(t,e,r)},s.alloc=function(t,e,r){if("number"!=typeof t)throw new TypeError("Argument must be a number");var i=n(t);return void 0!==e?"string"==typeof r?i.fill(e,r):i.fill(e):i.fill(0),i},s.allocUnsafe=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return n(t)},s.allocUnsafeSlow=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return i.SlowBuffer(t)}},88500:(t,e,r)=>{"use strict";var i=r(48764).Buffer,n=r(48764).SlowBuffer;function o(t,e){if(!i.isBuffer(t)||!i.isBuffer(e))return!1;if(t.length!==e.length)return!1;for(var r=0,n=0;n<t.length;n++)r|=t[n]^e[n];return 0===r}t.exports=o,o.install=function(){i.prototype.equal=n.prototype.equal=function(t){return o(this,t)}};var s=i.prototype.equal,a=n.prototype.equal;o.restore=function(){i.prototype.equal=s,n.prototype.equal=a}},67295:t=>{t.exports=function(t,e){for(var r=Math.min(t.length,e.length),i=new Buffer(r),n=0;n<r;++n)i[n]=t[n]^e[n];return i}},48764:(t,e,r)=>{"use strict";const i=r(79742),n=r(80645),o="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;e.Buffer=u,e.SlowBuffer=function(t){return+t!=t&&(t=0),u.alloc(+t)},e.INSPECT_MAX_BYTES=50;const s=2147483647;function a(t){if(t>s)throw new RangeError('The value "'+t+'" is invalid for option "size"');const e=new Uint8Array(t);return Object.setPrototypeOf(e,u.prototype),e}function u(t,e,r){if("number"==typeof t){if("string"==typeof e)throw new TypeError('The "string" argument must be of type string. Received type number');return f(t)}return h(t,e,r)}function h(t,e,r){if("string"==typeof t)return function(t,e){if("string"==typeof e&&""!==e||(e="utf8"),!u.isEncoding(e))throw new TypeError("Unknown encoding: "+e);const r=0|g(t,e);let i=a(r);const n=i.write(t,e);return n!==r&&(i=i.slice(0,n)),i}(t,e);if(ArrayBuffer.isView(t))return function(t){if(Z(t,Uint8Array)){const e=new Uint8Array(t);return d(e.buffer,e.byteOffset,e.byteLength)}return l(t)}(t);if(null==t)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);if(Z(t,ArrayBuffer)||t&&Z(t.buffer,ArrayBuffer))return d(t,e,r);if("undefined"!=typeof SharedArrayBuffer&&(Z(t,SharedArrayBuffer)||t&&Z(t.buffer,SharedArrayBuffer)))return d(t,e,r);if("number"==typeof t)throw new TypeError('The "value" argument must not be of type number. Received type number');const i=t.valueOf&&t.valueOf();if(null!=i&&i!==t)return u.from(i,e,r);const n=function(t){if(u.isBuffer(t)){const e=0|p(t.length),r=a(e);return 0===r.length||t.copy(r,0,0,e),r}return void 0!==t.length?"number"!=typeof t.length||$(t.length)?a(0):l(t):"Buffer"===t.type&&Array.isArray(t.data)?l(t.data):void 0}(t);if(n)return n;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof t[Symbol.toPrimitive])return u.from(t[Symbol.toPrimitive]("string"),e,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t)}function c(t){if("number"!=typeof t)throw new TypeError('"size" argument must be of type number');if(t<0)throw new RangeError('The value "'+t+'" is invalid for option "size"')}function f(t){return c(t),a(t<0?0:0|p(t))}function l(t){const e=t.length<0?0:0|p(t.length),r=a(e);for(let i=0;i<e;i+=1)r[i]=255&t[i];return r}function d(t,e,r){if(e<0||t.byteLength<e)throw new RangeError('"offset" is outside of buffer bounds');if(t.byteLength<e+(r||0))throw new RangeError('"length" is outside of buffer bounds');let i;return i=void 0===e&&void 0===r?new Uint8Array(t):void 0===r?new Uint8Array(t,e):new Uint8Array(t,e,r),Object.setPrototypeOf(i,u.prototype),i}function p(t){if(t>=s)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s.toString(16)+" bytes");return 0|t}function g(t,e){if(u.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||Z(t,ArrayBuffer))return t.byteLength;if("string"!=typeof t)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof t);const r=t.length,i=arguments.length>2&&!0===arguments[2];if(!i&&0===r)return 0;let n=!1;for(;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return W(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return G(t).length;default:if(n)return i?-1:W(t).length;e=(""+e).toLowerCase(),n=!0}}function y(t,e,r){let i=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return R(this,e,r);case"utf8":case"utf-8":return C(this,e,r);case"ascii":return I(this,e,r);case"latin1":case"binary":return T(this,e,r);case"base64":return A(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return B(this,e,r);default:if(i)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),i=!0}}function m(t,e,r){const i=t[e];t[e]=t[r],t[r]=i}function v(t,e,r,i,n){if(0===t.length)return-1;if("string"==typeof r?(i=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),$(r=+r)&&(r=n?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(n)return-1;r=t.length-1}else if(r<0){if(!n)return-1;r=0}if("string"==typeof e&&(e=u.from(e,i)),u.isBuffer(e))return 0===e.length?-1:b(t,e,r,i,n);if("number"==typeof e)return e&=255,"function"==typeof Uint8Array.prototype.indexOf?n?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):b(t,[e],r,i,n);throw new TypeError("val must be string, number or Buffer")}function b(t,e,r,i,n){let o,s=1,a=t.length,u=e.length;if(void 0!==i&&("ucs2"===(i=String(i).toLowerCase())||"ucs-2"===i||"utf16le"===i||"utf-16le"===i)){if(t.length<2||e.length<2)return-1;s=2,a/=2,u/=2,r/=2}function h(t,e){return 1===s?t[e]:t.readUInt16BE(e*s)}if(n){let i=-1;for(o=r;o<a;o++)if(h(t,o)===h(e,-1===i?0:o-i)){if(-1===i&&(i=o),o-i+1===u)return i*s}else-1!==i&&(o-=o-i),i=-1}else for(r+u>a&&(r=a-u),o=r;o>=0;o--){let r=!0;for(let i=0;i<u;i++)if(h(t,o+i)!==h(e,i)){r=!1;break}if(r)return o}return-1}function w(t,e,r,i){r=Number(r)||0;const n=t.length-r;i?(i=Number(i))>n&&(i=n):i=n;const o=e.length;let s;for(i>o/2&&(i=o/2),s=0;s<i;++s){const i=parseInt(e.substr(2*s,2),16);if($(i))return s;t[r+s]=i}return s}function _(t,e,r,i){return J(W(e,t.length-r),t,r,i)}function S(t,e,r,i){return J(function(t){const e=[];for(let r=0;r<t.length;++r)e.push(255&t.charCodeAt(r));return e}(e),t,r,i)}function E(t,e,r,i){return J(G(e),t,r,i)}function M(t,e,r,i){return J(function(t,e){let r,i,n;const o=[];for(let s=0;s<t.length&&!((e-=2)<0);++s)r=t.charCodeAt(s),i=r>>8,n=r%256,o.push(n),o.push(i);return o}(e,t.length-r),t,r,i)}function A(t,e,r){return 0===e&&r===t.length?i.fromByteArray(t):i.fromByteArray(t.slice(e,r))}function C(t,e,r){r=Math.min(t.length,r);const i=[];let n=e;for(;n<r;){const e=t[n];let o=null,s=e>239?4:e>223?3:e>191?2:1;if(n+s<=r){let r,i,a,u;switch(s){case 1:e<128&&(o=e);break;case 2:r=t[n+1],128==(192&r)&&(u=(31&e)<<6|63&r,u>127&&(o=u));break;case 3:r=t[n+1],i=t[n+2],128==(192&r)&&128==(192&i)&&(u=(15&e)<<12|(63&r)<<6|63&i,u>2047&&(u<55296||u>57343)&&(o=u));break;case 4:r=t[n+1],i=t[n+2],a=t[n+3],128==(192&r)&&128==(192&i)&&128==(192&a)&&(u=(15&e)<<18|(63&r)<<12|(63&i)<<6|63&a,u>65535&&u<1114112&&(o=u))}}null===o?(o=65533,s=1):o>65535&&(o-=65536,i.push(o>>>10&1023|55296),o=56320|1023&o),i.push(o),n+=s}return function(t){const e=t.length;if(e<=k)return String.fromCharCode.apply(String,t);let r="",i=0;for(;i<e;)r+=String.fromCharCode.apply(String,t.slice(i,i+=k));return r}(i)}e.kMaxLength=s,u.TYPED_ARRAY_SUPPORT=function(){try{const t=new Uint8Array(1),e={foo:function(){return 42}};return Object.setPrototypeOf(e,Uint8Array.prototype),Object.setPrototypeOf(t,e),42===t.foo()}catch(t){return!1}}(),u.TYPED_ARRAY_SUPPORT||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(u.prototype,"parent",{enumerable:!0,get:function(){if(u.isBuffer(this))return this.buffer}}),Object.defineProperty(u.prototype,"offset",{enumerable:!0,get:function(){if(u.isBuffer(this))return this.byteOffset}}),u.poolSize=8192,u.from=function(t,e,r){return h(t,e,r)},Object.setPrototypeOf(u.prototype,Uint8Array.prototype),Object.setPrototypeOf(u,Uint8Array),u.alloc=function(t,e,r){return function(t,e,r){return c(t),t<=0?a(t):void 0!==e?"string"==typeof r?a(t).fill(e,r):a(t).fill(e):a(t)}(t,e,r)},u.allocUnsafe=function(t){return f(t)},u.allocUnsafeSlow=function(t){return f(t)},u.isBuffer=function(t){return null!=t&&!0===t._isBuffer&&t!==u.prototype},u.compare=function(t,e){if(Z(t,Uint8Array)&&(t=u.from(t,t.offset,t.byteLength)),Z(e,Uint8Array)&&(e=u.from(e,e.offset,e.byteLength)),!u.isBuffer(t)||!u.isBuffer(e))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(t===e)return 0;let r=t.length,i=e.length;for(let n=0,o=Math.min(r,i);n<o;++n)if(t[n]!==e[n]){r=t[n],i=e[n];break}return r<i?-1:i<r?1:0},u.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},u.concat=function(t,e){if(!Array.isArray(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return u.alloc(0);let r;if(void 0===e)for(e=0,r=0;r<t.length;++r)e+=t[r].length;const i=u.allocUnsafe(e);let n=0;for(r=0;r<t.length;++r){let e=t[r];if(Z(e,Uint8Array))n+e.length>i.length?(u.isBuffer(e)||(e=u.from(e)),e.copy(i,n)):Uint8Array.prototype.set.call(i,e,n);else{if(!u.isBuffer(e))throw new TypeError('"list" argument must be an Array of Buffers');e.copy(i,n)}n+=e.length}return i},u.byteLength=g,u.prototype._isBuffer=!0,u.prototype.swap16=function(){const t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let e=0;e<t;e+=2)m(this,e,e+1);return this},u.prototype.swap32=function(){const t=this.length;if(t%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let e=0;e<t;e+=4)m(this,e,e+3),m(this,e+1,e+2);return this},u.prototype.swap64=function(){const t=this.length;if(t%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let e=0;e<t;e+=8)m(this,e,e+7),m(this,e+1,e+6),m(this,e+2,e+5),m(this,e+3,e+4);return this},u.prototype.toString=function(){const t=this.length;return 0===t?"":0===arguments.length?C(this,0,t):y.apply(this,arguments)},u.prototype.toLocaleString=u.prototype.toString,u.prototype.equals=function(t){if(!u.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===u.compare(this,t)},u.prototype.inspect=function(){let t="";const r=e.INSPECT_MAX_BYTES;return t=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(t+=" ... "),"<Buffer "+t+">"},o&&(u.prototype[o]=u.prototype.inspect),u.prototype.compare=function(t,e,r,i,n){if(Z(t,Uint8Array)&&(t=u.from(t,t.offset,t.byteLength)),!u.isBuffer(t))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof t);if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===i&&(i=0),void 0===n&&(n=this.length),e<0||r>t.length||i<0||n>this.length)throw new RangeError("out of range index");if(i>=n&&e>=r)return 0;if(i>=n)return-1;if(e>=r)return 1;if(this===t)return 0;let o=(n>>>=0)-(i>>>=0),s=(r>>>=0)-(e>>>=0);const a=Math.min(o,s),h=this.slice(i,n),c=t.slice(e,r);for(let t=0;t<a;++t)if(h[t]!==c[t]){o=h[t],s=c[t];break}return o<s?-1:s<o?1:0},u.prototype.includes=function(t,e,r){return-1!==this.indexOf(t,e,r)},u.prototype.indexOf=function(t,e,r){return v(this,t,e,r,!0)},u.prototype.lastIndexOf=function(t,e,r){return v(this,t,e,r,!1)},u.prototype.write=function(t,e,r,i){if(void 0===e)i="utf8",r=this.length,e=0;else if(void 0===r&&"string"==typeof e)i=e,r=this.length,e=0;else{if(!isFinite(e))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");e>>>=0,isFinite(r)?(r>>>=0,void 0===i&&(i="utf8")):(i=r,r=void 0)}const n=this.length-e;if((void 0===r||r>n)&&(r=n),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");i||(i="utf8");let o=!1;for(;;)switch(i){case"hex":return w(this,t,e,r);case"utf8":case"utf-8":return _(this,t,e,r);case"ascii":case"latin1":case"binary":return S(this,t,e,r);case"base64":return E(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return M(this,t,e,r);default:if(o)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),o=!0}},u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};const k=4096;function I(t,e,r){let i="";r=Math.min(t.length,r);for(let n=e;n<r;++n)i+=String.fromCharCode(127&t[n]);return i}function T(t,e,r){let i="";r=Math.min(t.length,r);for(let n=e;n<r;++n)i+=String.fromCharCode(t[n]);return i}function R(t,e,r){const i=t.length;(!e||e<0)&&(e=0),(!r||r<0||r>i)&&(r=i);let n="";for(let i=e;i<r;++i)n+=Y[t[i]];return n}function B(t,e,r){const i=t.slice(e,r);let n="";for(let t=0;t<i.length-1;t+=2)n+=String.fromCharCode(i[t]+256*i[t+1]);return n}function x(t,e,r){if(t%1!=0||t<0)throw new RangeError("offset is not uint");if(t+e>r)throw new RangeError("Trying to access beyond buffer length")}function F(t,e,r,i,n,o){if(!u.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>n||e<o)throw new RangeError('"value" argument is out of bounds');if(r+i>t.length)throw new RangeError("Index out of range")}function P(t,e,r,i,n){V(e,i,n,t,r,7);let o=Number(e&BigInt(4294967295));t[r++]=o,o>>=8,t[r++]=o,o>>=8,t[r++]=o,o>>=8,t[r++]=o;let s=Number(e>>BigInt(32)&BigInt(4294967295));return t[r++]=s,s>>=8,t[r++]=s,s>>=8,t[r++]=s,s>>=8,t[r++]=s,r}function N(t,e,r,i,n){V(e,i,n,t,r,7);let o=Number(e&BigInt(4294967295));t[r+7]=o,o>>=8,t[r+6]=o,o>>=8,t[r+5]=o,o>>=8,t[r+4]=o;let s=Number(e>>BigInt(32)&BigInt(4294967295));return t[r+3]=s,s>>=8,t[r+2]=s,s>>=8,t[r+1]=s,s>>=8,t[r]=s,r+8}function O(t,e,r,i,n,o){if(r+i>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function L(t,e,r,i,o){return e=+e,r>>>=0,o||O(t,0,r,4),n.write(t,e,r,i,23,4),r+4}function U(t,e,r,i,o){return e=+e,r>>>=0,o||O(t,0,r,8),n.write(t,e,r,i,52,8),r+8}u.prototype.slice=function(t,e){const r=this.length;(t=~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),(e=void 0===e?r:~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),e<t&&(e=t);const i=this.subarray(t,e);return Object.setPrototypeOf(i,u.prototype),i},u.prototype.readUintLE=u.prototype.readUIntLE=function(t,e,r){t>>>=0,e>>>=0,r||x(t,e,this.length);let i=this[t],n=1,o=0;for(;++o<e&&(n*=256);)i+=this[t+o]*n;return i},u.prototype.readUintBE=u.prototype.readUIntBE=function(t,e,r){t>>>=0,e>>>=0,r||x(t,e,this.length);let i=this[t+--e],n=1;for(;e>0&&(n*=256);)i+=this[t+--e]*n;return i},u.prototype.readUint8=u.prototype.readUInt8=function(t,e){return t>>>=0,e||x(t,1,this.length),this[t]},u.prototype.readUint16LE=u.prototype.readUInt16LE=function(t,e){return t>>>=0,e||x(t,2,this.length),this[t]|this[t+1]<<8},u.prototype.readUint16BE=u.prototype.readUInt16BE=function(t,e){return t>>>=0,e||x(t,2,this.length),this[t]<<8|this[t+1]},u.prototype.readUint32LE=u.prototype.readUInt32LE=function(t,e){return t>>>=0,e||x(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},u.prototype.readUint32BE=u.prototype.readUInt32BE=function(t,e){return t>>>=0,e||x(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},u.prototype.readBigUInt64LE=Q((function(t){H(t>>>=0,"offset");const e=this[t],r=this[t+7];void 0!==e&&void 0!==r||q(t,this.length-8);const i=e+256*this[++t]+65536*this[++t]+this[++t]*2**24,n=this[++t]+256*this[++t]+65536*this[++t]+r*2**24;return BigInt(i)+(BigInt(n)<<BigInt(32))})),u.prototype.readBigUInt64BE=Q((function(t){H(t>>>=0,"offset");const e=this[t],r=this[t+7];void 0!==e&&void 0!==r||q(t,this.length-8);const i=e*2**24+65536*this[++t]+256*this[++t]+this[++t],n=this[++t]*2**24+65536*this[++t]+256*this[++t]+r;return(BigInt(i)<<BigInt(32))+BigInt(n)})),u.prototype.readIntLE=function(t,e,r){t>>>=0,e>>>=0,r||x(t,e,this.length);let i=this[t],n=1,o=0;for(;++o<e&&(n*=256);)i+=this[t+o]*n;return n*=128,i>=n&&(i-=Math.pow(2,8*e)),i},u.prototype.readIntBE=function(t,e,r){t>>>=0,e>>>=0,r||x(t,e,this.length);let i=e,n=1,o=this[t+--i];for(;i>0&&(n*=256);)o+=this[t+--i]*n;return n*=128,o>=n&&(o-=Math.pow(2,8*e)),o},u.prototype.readInt8=function(t,e){return t>>>=0,e||x(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},u.prototype.readInt16LE=function(t,e){t>>>=0,e||x(t,2,this.length);const r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},u.prototype.readInt16BE=function(t,e){t>>>=0,e||x(t,2,this.length);const r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},u.prototype.readInt32LE=function(t,e){return t>>>=0,e||x(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},u.prototype.readInt32BE=function(t,e){return t>>>=0,e||x(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},u.prototype.readBigInt64LE=Q((function(t){H(t>>>=0,"offset");const e=this[t],r=this[t+7];void 0!==e&&void 0!==r||q(t,this.length-8);const i=this[t+4]+256*this[t+5]+65536*this[t+6]+(r<<24);return(BigInt(i)<<BigInt(32))+BigInt(e+256*this[++t]+65536*this[++t]+this[++t]*2**24)})),u.prototype.readBigInt64BE=Q((function(t){H(t>>>=0,"offset");const e=this[t],r=this[t+7];void 0!==e&&void 0!==r||q(t,this.length-8);const i=(e<<24)+65536*this[++t]+256*this[++t]+this[++t];return(BigInt(i)<<BigInt(32))+BigInt(this[++t]*2**24+65536*this[++t]+256*this[++t]+r)})),u.prototype.readFloatLE=function(t,e){return t>>>=0,e||x(t,4,this.length),n.read(this,t,!0,23,4)},u.prototype.readFloatBE=function(t,e){return t>>>=0,e||x(t,4,this.length),n.read(this,t,!1,23,4)},u.prototype.readDoubleLE=function(t,e){return t>>>=0,e||x(t,8,this.length),n.read(this,t,!0,52,8)},u.prototype.readDoubleBE=function(t,e){return t>>>=0,e||x(t,8,this.length),n.read(this,t,!1,52,8)},u.prototype.writeUintLE=u.prototype.writeUIntLE=function(t,e,r,i){t=+t,e>>>=0,r>>>=0,i||F(this,t,e,r,Math.pow(2,8*r)-1,0);let n=1,o=0;for(this[e]=255&t;++o<r&&(n*=256);)this[e+o]=t/n&255;return e+r},u.prototype.writeUintBE=u.prototype.writeUIntBE=function(t,e,r,i){t=+t,e>>>=0,r>>>=0,i||F(this,t,e,r,Math.pow(2,8*r)-1,0);let n=r-1,o=1;for(this[e+n]=255&t;--n>=0&&(o*=256);)this[e+n]=t/o&255;return e+r},u.prototype.writeUint8=u.prototype.writeUInt8=function(t,e,r){return t=+t,e>>>=0,r||F(this,t,e,1,255,0),this[e]=255&t,e+1},u.prototype.writeUint16LE=u.prototype.writeUInt16LE=function(t,e,r){return t=+t,e>>>=0,r||F(this,t,e,2,65535,0),this[e]=255&t,this[e+1]=t>>>8,e+2},u.prototype.writeUint16BE=u.prototype.writeUInt16BE=function(t,e,r){return t=+t,e>>>=0,r||F(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=255&t,e+2},u.prototype.writeUint32LE=u.prototype.writeUInt32LE=function(t,e,r){return t=+t,e>>>=0,r||F(this,t,e,4,4294967295,0),this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t,e+4},u.prototype.writeUint32BE=u.prototype.writeUInt32BE=function(t,e,r){return t=+t,e>>>=0,r||F(this,t,e,4,4294967295,0),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},u.prototype.writeBigUInt64LE=Q((function(t,e=0){return P(this,t,e,BigInt(0),BigInt("0xffffffffffffffff"))})),u.prototype.writeBigUInt64BE=Q((function(t,e=0){return N(this,t,e,BigInt(0),BigInt("0xffffffffffffffff"))})),u.prototype.writeIntLE=function(t,e,r,i){if(t=+t,e>>>=0,!i){const i=Math.pow(2,8*r-1);F(this,t,e,r,i-1,-i)}let n=0,o=1,s=0;for(this[e]=255&t;++n<r&&(o*=256);)t<0&&0===s&&0!==this[e+n-1]&&(s=1),this[e+n]=(t/o>>0)-s&255;return e+r},u.prototype.writeIntBE=function(t,e,r,i){if(t=+t,e>>>=0,!i){const i=Math.pow(2,8*r-1);F(this,t,e,r,i-1,-i)}let n=r-1,o=1,s=0;for(this[e+n]=255&t;--n>=0&&(o*=256);)t<0&&0===s&&0!==this[e+n+1]&&(s=1),this[e+n]=(t/o>>0)-s&255;return e+r},u.prototype.writeInt8=function(t,e,r){return t=+t,e>>>=0,r||F(this,t,e,1,127,-128),t<0&&(t=255+t+1),this[e]=255&t,e+1},u.prototype.writeInt16LE=function(t,e,r){return t=+t,e>>>=0,r||F(this,t,e,2,32767,-32768),this[e]=255&t,this[e+1]=t>>>8,e+2},u.prototype.writeInt16BE=function(t,e,r){return t=+t,e>>>=0,r||F(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=255&t,e+2},u.prototype.writeInt32LE=function(t,e,r){return t=+t,e>>>=0,r||F(this,t,e,4,2147483647,-2147483648),this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24,e+4},u.prototype.writeInt32BE=function(t,e,r){return t=+t,e>>>=0,r||F(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},u.prototype.writeBigInt64LE=Q((function(t,e=0){return P(this,t,e,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),u.prototype.writeBigInt64BE=Q((function(t,e=0){return N(this,t,e,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),u.prototype.writeFloatLE=function(t,e,r){return L(this,t,e,!0,r)},u.prototype.writeFloatBE=function(t,e,r){return L(this,t,e,!1,r)},u.prototype.writeDoubleLE=function(t,e,r){return U(this,t,e,!0,r)},u.prototype.writeDoubleBE=function(t,e,r){return U(this,t,e,!1,r)},u.prototype.copy=function(t,e,r,i){if(!u.isBuffer(t))throw new TypeError("argument should be a Buffer");if(r||(r=0),i||0===i||(i=this.length),e>=t.length&&(e=t.length),e||(e=0),i>0&&i<r&&(i=r),i===r)return 0;if(0===t.length||0===this.length)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("Index out of range");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),t.length-e<i-r&&(i=t.length-e+r);const n=i-r;return this===t&&"function"==typeof Uint8Array.prototype.copyWithin?this.copyWithin(e,r,i):Uint8Array.prototype.set.call(t,this.subarray(r,i),e),n},u.prototype.fill=function(t,e,r,i){if("string"==typeof t){if("string"==typeof e?(i=e,e=0,r=this.length):"string"==typeof r&&(i=r,r=this.length),void 0!==i&&"string"!=typeof i)throw new TypeError("encoding must be a string");if("string"==typeof i&&!u.isEncoding(i))throw new TypeError("Unknown encoding: "+i);if(1===t.length){const e=t.charCodeAt(0);("utf8"===i&&e<128||"latin1"===i)&&(t=e)}}else"number"==typeof t?t&=255:"boolean"==typeof t&&(t=Number(t));if(e<0||this.length<e||this.length<r)throw new RangeError("Out of range index");if(r<=e)return this;let n;if(e>>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"==typeof t)for(n=e;n<r;++n)this[n]=t;else{const o=u.isBuffer(t)?t:u.from(t,i),s=o.length;if(0===s)throw new TypeError('The value "'+t+'" is invalid for argument "value"');for(n=0;n<r-e;++n)this[n+e]=o[n%s]}return this};const j={};function D(t,e,r){j[t]=class extends r{constructor(){super(),Object.defineProperty(this,"message",{value:e.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${t}]`,this.stack,delete this.name}get code(){return t}set code(t){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:t,writable:!0})}toString(){return`${this.name} [${t}]: ${this.message}`}}}function K(t){let e="",r=t.length;const i="-"===t[0]?1:0;for(;r>=i+4;r-=3)e=`_${t.slice(r-3,r)}${e}`;return`${t.slice(0,r)}${e}`}function V(t,e,r,i,n,o){if(t>r||t<e){const i="bigint"==typeof e?"n":"";let n;throw n=o>3?0===e||e===BigInt(0)?`>= 0${i} and < 2${i} ** ${8*(o+1)}${i}`:`>= -(2${i} ** ${8*(o+1)-1}${i}) and < 2 ** ${8*(o+1)-1}${i}`:`>= ${e}${i} and <= ${r}${i}`,new j.ERR_OUT_OF_RANGE("value",n,t)}!function(t,e,r){H(e,"offset"),void 0!==t[e]&&void 0!==t[e+r]||q(e,t.length-(r+1))}(i,n,o)}function H(t,e){if("number"!=typeof t)throw new j.ERR_INVALID_ARG_TYPE(e,"number",t)}function q(t,e,r){if(Math.floor(t)!==t)throw H(t,r),new j.ERR_OUT_OF_RANGE(r||"offset","an integer",t);if(e<0)throw new j.ERR_BUFFER_OUT_OF_BOUNDS;throw new j.ERR_OUT_OF_RANGE(r||"offset",`>= ${r?1:0} and <= ${e}`,t)}D("ERR_BUFFER_OUT_OF_BOUNDS",(function(t){return t?`${t} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"}),RangeError),D("ERR_INVALID_ARG_TYPE",(function(t,e){return`The "${t}" argument must be of type number. Received type ${typeof e}`}),TypeError),D("ERR_OUT_OF_RANGE",(function(t,e,r){let i=`The value of "${t}" is out of range.`,n=r;return Number.isInteger(r)&&Math.abs(r)>2**32?n=K(String(r)):"bigint"==typeof r&&(n=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(n=K(n)),n+="n"),i+=` It must be ${e}. Received ${n}`,i}),RangeError);const z=/[^+/0-9A-Za-z-_]/g;function W(t,e){let r;e=e||1/0;const i=t.length;let n=null;const o=[];for(let s=0;s<i;++s){if(r=t.charCodeAt(s),r>55295&&r<57344){if(!n){if(r>56319){(e-=3)>-1&&o.push(239,191,189);continue}if(s+1===i){(e-=3)>-1&&o.push(239,191,189);continue}n=r;continue}if(r<56320){(e-=3)>-1&&o.push(239,191,189),n=r;continue}r=65536+(n-55296<<10|r-56320)}else n&&(e-=3)>-1&&o.push(239,191,189);if(n=null,r<128){if((e-=1)<0)break;o.push(r)}else if(r<2048){if((e-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function G(t){return i.toByteArray(function(t){if((t=(t=t.split("=")[0]).trim().replace(z,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function J(t,e,r,i){let n;for(n=0;n<i&&!(n+r>=e.length||n>=t.length);++n)e[n+r]=t[n];return n}function Z(t,e){return t instanceof e||null!=t&&null!=t.constructor&&null!=t.constructor.name&&t.constructor.name===e.name}function $(t){return t!=t}const Y=function(){const t="0123456789abcdef",e=new Array(256);for(let r=0;r<16;++r){const i=16*r;for(let n=0;n<16;++n)e[i+n]=t[r]+t[n]}return e}();function Q(t){return"undefined"==typeof BigInt?X:t}function X(){throw new Error("BigInt not supported")}},21924:(t,e,r)=>{"use strict";var i=r(40210),n=r(55559),o=n(i("String.prototype.indexOf"));t.exports=function(t,e){var r=i(t,!!e);return"function"==typeof r&&o(t,".prototype.")>-1?n(r):r}},55559:(t,e,r)=>{"use strict";var i=r(58612),n=r(40210),o=n("%Function.prototype.apply%"),s=n("%Function.prototype.call%"),a=n("%Reflect.apply%",!0)||i.call(s,o),u=n("%Object.getOwnPropertyDescriptor%",!0),h=n("%Object.defineProperty%",!0),c=n("%Math.max%");if(h)try{h({},"a",{value:1})}catch(t){h=null}t.exports=function(t){var e=a(i,s,arguments);if(u&&h){var r=u(e,"length");r.configurable&&h(e,"length",{value:1+c(0,t.length-(arguments.length-1))})}return e};var f=function(){return a(i,o,arguments)};h?h(t.exports,"apply",{value:f}):t.exports.apply=f},71027:(t,e,r)=>{var i=r(89509).Buffer,n=r(42830).Transform,o=r(32553).s;function s(t){n.call(this),this.hashMode="string"==typeof t,this.hashMode?this[t]=this._finalOrDigest:this.final=this._finalOrDigest,this._final&&(this.__final=this._final,this._final=null),this._decoder=null,this._encoding=null}r(35717)(s,n),s.prototype.update=function(t,e,r){"string"==typeof t&&(t=i.from(t,e));var n=this._update(t);return this.hashMode?this:(r&&(n=this._toString(n,r)),n)},s.prototype.setAutoPadding=function(){},s.prototype.getAuthTag=function(){throw new Error("trying to get auth tag in unsupported state")},s.prototype.setAuthTag=function(){throw new Error("trying to set auth tag in unsupported state")},s.prototype.setAAD=function(){throw new Error("trying to set aad in unsupported state")},s.prototype._transform=function(t,e,r){var i;try{this.hashMode?this._update(t):this.push(this._update(t))}catch(t){i=t}finally{r(i)}},s.prototype._flush=function(t){var e;try{this.push(this.__final())}catch(t){e=t}t(e)},s.prototype._finalOrDigest=function(t){var e=this.__final()||i.alloc(0);return t&&(e=this._toString(e,t,!0)),e},s.prototype._toString=function(t,e,r){if(this._decoder||(this._decoder=new o(e),this._encoding=e),this._encoding!==e)throw new Error("can't switch encodings");var i=this._decoder.write(t);return r&&(i+=this._decoder.end()),i},t.exports=s},76393:(t,e,r)=>{var i=r(86266),n=r(16426);t.exports=function(t){return new s(t)};var o={secp256k1:{name:"secp256k1",byteLength:32},secp224r1:{name:"p224",byteLength:28},prime256v1:{name:"p256",byteLength:32},prime192v1:{name:"p192",byteLength:24},ed25519:{name:"ed25519",byteLength:32},secp384r1:{name:"p384",byteLength:48},secp521r1:{name:"p521",byteLength:66}};function s(t){this.curveType=o[t],this.curveType||(this.curveType={name:t}),this.curve=new i.ec(this.curveType.name),this.keys=void 0}function a(t,e,r){Array.isArray(t)||(t=t.toArray());var i=new Buffer(t);if(r&&i.length<r){var n=new Buffer(r-i.length);n.fill(0),i=Buffer.concat([n,i])}return e?i.toString(e):i}o.p224=o.secp224r1,o.p256=o.secp256r1=o.prime256v1,o.p192=o.secp192r1=o.prime192v1,o.p384=o.secp384r1,o.p521=o.secp521r1,s.prototype.generateKeys=function(t,e){return this.keys=this.curve.genKeyPair(),this.getPublicKey(t,e)},s.prototype.computeSecret=function(t,e,r){return e=e||"utf8",Buffer.isBuffer(t)||(t=new Buffer(t,e)),a(this.curve.keyFromPublic(t).getPublic().mul(this.keys.getPrivate()).getX(),r,this.curveType.byteLength)},s.prototype.getPublicKey=function(t,e){var r=this.keys.getPublic("compressed"===e,!0);return"hybrid"===e&&(r[r.length-1]%2?r[0]=7:r[0]=6),a(r,t)},s.prototype.getPrivateKey=function(t){return a(this.keys.getPrivate(),t)},s.prototype.setPublicKey=function(t,e){return e=e||"utf8",Buffer.isBuffer(t)||(t=new Buffer(t,e)),this.keys._importPublic(t),this},s.prototype.setPrivateKey=function(t,e){e=e||"utf8",Buffer.isBuffer(t)||(t=new Buffer(t,e));var r=new n(t);return r=r.toString(16),this.keys=this.curve.genKeyPair(),this.keys._importPrivate(r),this}},16426:function(t,e,r){!function(t,e){"use strict";function i(t,e){if(!t)throw new Error(e||"Assertion failed")}function n(t,e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}function o(t,e,r){if(o.isBN(t))return t;this.negative=0,this.words=null,this.length=0,this.red=null,null!==t&&("le"!==e&&"be"!==e||(r=e,e=10),this._init(t||0,e||10,r||"be"))}var s;"object"==typeof t?t.exports=o:e.BN=o,o.BN=o,o.wordSize=26;try{s=r(32574).Buffer}catch(t){}function a(t,e,r){for(var i=0,n=Math.min(t.length,r),o=e;o<n;o++){var s=t.charCodeAt(o)-48;i<<=4,i|=s>=49&&s<=54?s-49+10:s>=17&&s<=22?s-17+10:15&s}return i}function u(t,e,r,i){for(var n=0,o=Math.min(t.length,r),s=e;s<o;s++){var a=t.charCodeAt(s)-48;n*=i,n+=a>=49?a-49+10:a>=17?a-17+10:a}return n}o.isBN=function(t){return t instanceof o||null!==t&&"object"==typeof t&&t.constructor.wordSize===o.wordSize&&Array.isArray(t.words)},o.max=function(t,e){return t.cmp(e)>0?t:e},o.min=function(t,e){return t.cmp(e)<0?t:e},o.prototype._init=function(t,e,r){if("number"==typeof t)return this._initNumber(t,e,r);if("object"==typeof t)return this._initArray(t,e,r);"hex"===e&&(e=16),i(e===(0|e)&&e>=2&&e<=36);var n=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&n++,16===e?this._parseHex(t,n):this._parseBase(t,e,n),"-"===t[0]&&(this.negative=1),this.strip(),"le"===r&&this._initArray(this.toArray(),e,r)},o.prototype._initNumber=function(t,e,r){t<0&&(this.negative=1,t=-t),t<67108864?(this.words=[67108863&t],this.length=1):t<4503599627370496?(this.words=[67108863&t,t/67108864&67108863],this.length=2):(i(t<9007199254740992),this.words=[67108863&t,t/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),e,r)},o.prototype._initArray=function(t,e,r){if(i("number"==typeof t.length),t.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(t.length/3),this.words=new Array(this.length);for(var n=0;n<this.length;n++)this.words[n]=0;var o,s,a=0;if("be"===r)for(n=t.length-1,o=0;n>=0;n-=3)s=t[n]|t[n-1]<<8|t[n-2]<<16,this.words[o]|=s<<a&67108863,this.words[o+1]=s>>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);else if("le"===r)for(n=0,o=0;n<t.length;n+=3)s=t[n]|t[n+1]<<8|t[n+2]<<16,this.words[o]|=s<<a&67108863,this.words[o+1]=s>>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);return this.strip()},o.prototype._parseHex=function(t,e){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var r=0;r<this.length;r++)this.words[r]=0;var i,n,o=0;for(r=t.length-6,i=0;r>=e;r-=6)n=a(t,r,r+6),this.words[i]|=n<<o&67108863,this.words[i+1]|=n>>>26-o&4194303,(o+=24)>=26&&(o-=26,i++);r+6!==e&&(n=a(t,e,r+6),this.words[i]|=n<<o&67108863,this.words[i+1]|=n>>>26-o&4194303),this.strip()},o.prototype._parseBase=function(t,e,r){this.words=[0],this.length=1;for(var i=0,n=1;n<=67108863;n*=e)i++;i--,n=n/e|0;for(var o=t.length-r,s=o%i,a=Math.min(o,o-s)+r,h=0,c=r;c<a;c+=i)h=u(t,c,c+i,e),this.imuln(n),this.words[0]+h<67108864?this.words[0]+=h:this._iaddn(h);if(0!==s){var f=1;for(h=u(t,c,t.length,e),c=0;c<s;c++)f*=e;this.imuln(f),this.words[0]+h<67108864?this.words[0]+=h:this._iaddn(h)}},o.prototype.copy=function(t){t.words=new Array(this.length);for(var e=0;e<this.length;e++)t.words[e]=this.words[e];t.length=this.length,t.negative=this.negative,t.red=this.red},o.prototype.clone=function(){var t=new o(null);return this.copy(t),t},o.prototype._expand=function(t){for(;this.length<t;)this.words[this.length++]=0;return this},o.prototype.strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},o.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},o.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var h=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],c=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],f=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function l(t,e,r){r.negative=e.negative^t.negative;var i=t.length+e.length|0;r.length=i,i=i-1|0;var n=0|t.words[0],o=0|e.words[0],s=n*o,a=67108863&s,u=s/67108864|0;r.words[0]=a;for(var h=1;h<i;h++){for(var c=u>>>26,f=67108863&u,l=Math.min(h,e.length-1),d=Math.max(0,h-t.length+1);d<=l;d++){var p=h-d|0;c+=(s=(n=0|t.words[p])*(o=0|e.words[d])+f)/67108864|0,f=67108863&s}r.words[h]=0|f,u=0|c}return 0!==u?r.words[h]=0|u:r.length--,r.strip()}o.prototype.toString=function(t,e){var r;if(e=0|e||1,16===(t=t||10)||"hex"===t){r="";for(var n=0,o=0,s=0;s<this.length;s++){var a=this.words[s],u=(16777215&(a<<n|o)).toString(16);r=0!=(o=a>>>24-n&16777215)||s!==this.length-1?h[6-u.length]+u+r:u+r,(n+=2)>=26&&(n-=26,s--)}for(0!==o&&(r=o.toString(16)+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(t===(0|t)&&t>=2&&t<=36){var l=c[t],d=f[t];r="";var p=this.clone();for(p.negative=0;!p.isZero();){var g=p.modn(d).toString(t);r=(p=p.idivn(d)).isZero()?g+r:h[l-g.length]+g+r}for(this.isZero()&&(r="0"+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}i(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:this.length>2&&i(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},o.prototype.toJSON=function(){return this.toString(16)},o.prototype.toBuffer=function(t,e){return i(void 0!==s),this.toArrayLike(s,t,e)},o.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)},o.prototype.toArrayLike=function(t,e,r){var n=this.byteLength(),o=r||Math.max(1,n);i(n<=o,"byte array longer than desired length"),i(o>0,"Requested array length <= 0"),this.strip();var s,a,u="le"===e,h=new t(o),c=this.clone();if(u){for(a=0;!c.isZero();a++)s=c.andln(255),c.iushrn(8),h[a]=s;for(;a<o;a++)h[a]=0}else{for(a=0;a<o-n;a++)h[a]=0;for(a=0;!c.isZero();a++)s=c.andln(255),c.iushrn(8),h[o-a-1]=s}return h},Math.clz32?o.prototype._countBits=function(t){return 32-Math.clz32(t)}:o.prototype._countBits=function(t){var e=t,r=0;return e>=4096&&(r+=13,e>>>=13),e>=64&&(r+=7,e>>>=7),e>=8&&(r+=4,e>>>=4),e>=2&&(r+=2,e>>>=2),r+e},o.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,r=0;return 0==(8191&e)&&(r+=13,e>>>=13),0==(127&e)&&(r+=7,e>>>=7),0==(15&e)&&(r+=4,e>>>=4),0==(3&e)&&(r+=2,e>>>=2),0==(1&e)&&r++,r},o.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;e<this.length;e++){var r=this._zeroBits(this.words[e]);if(t+=r,26!==r)break}return t},o.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},o.prototype.toTwos=function(t){return 0!==this.negative?this.abs().inotn(t).iaddn(1):this.clone()},o.prototype.fromTwos=function(t){return this.testn(t-1)?this.notn(t).iaddn(1).ineg():this.clone()},o.prototype.isNeg=function(){return 0!==this.negative},o.prototype.neg=function(){return this.clone().ineg()},o.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},o.prototype.iuor=function(t){for(;this.length<t.length;)this.words[this.length++]=0;for(var e=0;e<t.length;e++)this.words[e]=this.words[e]|t.words[e];return this.strip()},o.prototype.ior=function(t){return i(0==(this.negative|t.negative)),this.iuor(t)},o.prototype.or=function(t){return this.length>t.length?this.clone().ior(t):t.clone().ior(this)},o.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},o.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var r=0;r<e.length;r++)this.words[r]=this.words[r]&t.words[r];return this.length=e.length,this.strip()},o.prototype.iand=function(t){return i(0==(this.negative|t.negative)),this.iuand(t)},o.prototype.and=function(t){return this.length>t.length?this.clone().iand(t):t.clone().iand(this)},o.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},o.prototype.iuxor=function(t){var e,r;this.length>t.length?(e=this,r=t):(e=t,r=this);for(var i=0;i<r.length;i++)this.words[i]=e.words[i]^r.words[i];if(this!==e)for(;i<e.length;i++)this.words[i]=e.words[i];return this.length=e.length,this.strip()},o.prototype.ixor=function(t){return i(0==(this.negative|t.negative)),this.iuxor(t)},o.prototype.xor=function(t){return this.length>t.length?this.clone().ixor(t):t.clone().ixor(this)},o.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},o.prototype.inotn=function(t){i("number"==typeof t&&t>=0);var e=0|Math.ceil(t/26),r=t%26;this._expand(e),r>0&&e--;for(var n=0;n<e;n++)this.words[n]=67108863&~this.words[n];return r>0&&(this.words[n]=~this.words[n]&67108863>>26-r),this.strip()},o.prototype.notn=function(t){return this.clone().inotn(t)},o.prototype.setn=function(t,e){i("number"==typeof t&&t>=0);var r=t/26|0,n=t%26;return this._expand(r+1),this.words[r]=e?this.words[r]|1<<n:this.words[r]&~(1<<n),this.strip()},o.prototype.iadd=function(t){var e,r,i;if(0!==this.negative&&0===t.negative)return this.negative=0,e=this.isub(t),this.negative^=1,this._normSign();if(0===this.negative&&0!==t.negative)return t.negative=0,e=this.isub(t),t.negative=1,e._normSign();this.length>t.length?(r=this,i=t):(r=t,i=this);for(var n=0,o=0;o<i.length;o++)e=(0|r.words[o])+(0|i.words[o])+n,this.words[o]=67108863&e,n=e>>>26;for(;0!==n&&o<r.length;o++)e=(0|r.words[o])+n,this.words[o]=67108863&e,n=e>>>26;if(this.length=r.length,0!==n)this.words[this.length]=n,this.length++;else if(r!==this)for(;o<r.length;o++)this.words[o]=r.words[o];return this},o.prototype.add=function(t){var e;return 0!==t.negative&&0===this.negative?(t.negative=0,e=this.sub(t),t.negative^=1,e):0===t.negative&&0!==this.negative?(this.negative=0,e=t.sub(this),this.negative=1,e):this.length>t.length?this.clone().iadd(t):t.clone().iadd(this)},o.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e=this.iadd(t);return t.negative=1,e._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var r,i,n=this.cmp(t);if(0===n)return this.negative=0,this.length=1,this.words[0]=0,this;n>0?(r=this,i=t):(r=t,i=this);for(var o=0,s=0;s<i.length;s++)o=(e=(0|r.words[s])-(0|i.words[s])+o)>>26,this.words[s]=67108863&e;for(;0!==o&&s<r.length;s++)o=(e=(0|r.words[s])+o)>>26,this.words[s]=67108863&e;if(0===o&&s<r.length&&r!==this)for(;s<r.length;s++)this.words[s]=r.words[s];return this.length=Math.max(this.length,s),r!==this&&(this.negative=1),this.strip()},o.prototype.sub=function(t){return this.clone().isub(t)};var d=function(t,e,r){var i,n,o,s=t.words,a=e.words,u=r.words,h=0,c=0|s[0],f=8191&c,l=c>>>13,d=0|s[1],p=8191&d,g=d>>>13,y=0|s[2],m=8191&y,v=y>>>13,b=0|s[3],w=8191&b,_=b>>>13,S=0|s[4],E=8191&S,M=S>>>13,A=0|s[5],C=8191&A,k=A>>>13,I=0|s[6],T=8191&I,R=I>>>13,B=0|s[7],x=8191&B,F=B>>>13,P=0|s[8],N=8191&P,O=P>>>13,L=0|s[9],U=8191&L,j=L>>>13,D=0|a[0],K=8191&D,V=D>>>13,H=0|a[1],q=8191&H,z=H>>>13,W=0|a[2],G=8191&W,J=W>>>13,Z=0|a[3],$=8191&Z,Y=Z>>>13,Q=0|a[4],X=8191&Q,tt=Q>>>13,et=0|a[5],rt=8191&et,it=et>>>13,nt=0|a[6],ot=8191&nt,st=nt>>>13,at=0|a[7],ut=8191&at,ht=at>>>13,ct=0|a[8],ft=8191&ct,lt=ct>>>13,dt=0|a[9],pt=8191&dt,gt=dt>>>13;r.negative=t.negative^e.negative,r.length=19;var yt=(h+(i=Math.imul(f,K))|0)+((8191&(n=(n=Math.imul(f,V))+Math.imul(l,K)|0))<<13)|0;h=((o=Math.imul(l,V))+(n>>>13)|0)+(yt>>>26)|0,yt&=67108863,i=Math.imul(p,K),n=(n=Math.imul(p,V))+Math.imul(g,K)|0,o=Math.imul(g,V);var mt=(h+(i=i+Math.imul(f,q)|0)|0)+((8191&(n=(n=n+Math.imul(f,z)|0)+Math.imul(l,q)|0))<<13)|0;h=((o=o+Math.imul(l,z)|0)+(n>>>13)|0)+(mt>>>26)|0,mt&=67108863,i=Math.imul(m,K),n=(n=Math.imul(m,V))+Math.imul(v,K)|0,o=Math.imul(v,V),i=i+Math.imul(p,q)|0,n=(n=n+Math.imul(p,z)|0)+Math.imul(g,q)|0,o=o+Math.imul(g,z)|0;var vt=(h+(i=i+Math.imul(f,G)|0)|0)+((8191&(n=(n=n+Math.imul(f,J)|0)+Math.imul(l,G)|0))<<13)|0;h=((o=o+Math.imul(l,J)|0)+(n>>>13)|0)+(vt>>>26)|0,vt&=67108863,i=Math.imul(w,K),n=(n=Math.imul(w,V))+Math.imul(_,K)|0,o=Math.imul(_,V),i=i+Math.imul(m,q)|0,n=(n=n+Math.imul(m,z)|0)+Math.imul(v,q)|0,o=o+Math.imul(v,z)|0,i=i+Math.imul(p,G)|0,n=(n=n+Math.imul(p,J)|0)+Math.imul(g,G)|0,o=o+Math.imul(g,J)|0;var bt=(h+(i=i+Math.imul(f,$)|0)|0)+((8191&(n=(n=n+Math.imul(f,Y)|0)+Math.imul(l,$)|0))<<13)|0;h=((o=o+Math.imul(l,Y)|0)+(n>>>13)|0)+(bt>>>26)|0,bt&=67108863,i=Math.imul(E,K),n=(n=Math.imul(E,V))+Math.imul(M,K)|0,o=Math.imul(M,V),i=i+Math.imul(w,q)|0,n=(n=n+Math.imul(w,z)|0)+Math.imul(_,q)|0,o=o+Math.imul(_,z)|0,i=i+Math.imul(m,G)|0,n=(n=n+Math.imul(m,J)|0)+Math.imul(v,G)|0,o=o+Math.imul(v,J)|0,i=i+Math.imul(p,$)|0,n=(n=n+Math.imul(p,Y)|0)+Math.imul(g,$)|0,o=o+Math.imul(g,Y)|0;var wt=(h+(i=i+Math.imul(f,X)|0)|0)+((8191&(n=(n=n+Math.imul(f,tt)|0)+Math.imul(l,X)|0))<<13)|0;h=((o=o+Math.imul(l,tt)|0)+(n>>>13)|0)+(wt>>>26)|0,wt&=67108863,i=Math.imul(C,K),n=(n=Math.imul(C,V))+Math.imul(k,K)|0,o=Math.imul(k,V),i=i+Math.imul(E,q)|0,n=(n=n+Math.imul(E,z)|0)+Math.imul(M,q)|0,o=o+Math.imul(M,z)|0,i=i+Math.imul(w,G)|0,n=(n=n+Math.imul(w,J)|0)+Math.imul(_,G)|0,o=o+Math.imul(_,J)|0,i=i+Math.imul(m,$)|0,n=(n=n+Math.imul(m,Y)|0)+Math.imul(v,$)|0,o=o+Math.imul(v,Y)|0,i=i+Math.imul(p,X)|0,n=(n=n+Math.imul(p,tt)|0)+Math.imul(g,X)|0,o=o+Math.imul(g,tt)|0;var _t=(h+(i=i+Math.imul(f,rt)|0)|0)+((8191&(n=(n=n+Math.imul(f,it)|0)+Math.imul(l,rt)|0))<<13)|0;h=((o=o+Math.imul(l,it)|0)+(n>>>13)|0)+(_t>>>26)|0,_t&=67108863,i=Math.imul(T,K),n=(n=Math.imul(T,V))+Math.imul(R,K)|0,o=Math.imul(R,V),i=i+Math.imul(C,q)|0,n=(n=n+Math.imul(C,z)|0)+Math.imul(k,q)|0,o=o+Math.imul(k,z)|0,i=i+Math.imul(E,G)|0,n=(n=n+Math.imul(E,J)|0)+Math.imul(M,G)|0,o=o+Math.imul(M,J)|0,i=i+Math.imul(w,$)|0,n=(n=n+Math.imul(w,Y)|0)+Math.imul(_,$)|0,o=o+Math.imul(_,Y)|0,i=i+Math.imul(m,X)|0,n=(n=n+Math.imul(m,tt)|0)+Math.imul(v,X)|0,o=o+Math.imul(v,tt)|0,i=i+Math.imul(p,rt)|0,n=(n=n+Math.imul(p,it)|0)+Math.imul(g,rt)|0,o=o+Math.imul(g,it)|0;var St=(h+(i=i+Math.imul(f,ot)|0)|0)+((8191&(n=(n=n+Math.imul(f,st)|0)+Math.imul(l,ot)|0))<<13)|0;h=((o=o+Math.imul(l,st)|0)+(n>>>13)|0)+(St>>>26)|0,St&=67108863,i=Math.imul(x,K),n=(n=Math.imul(x,V))+Math.imul(F,K)|0,o=Math.imul(F,V),i=i+Math.imul(T,q)|0,n=(n=n+Math.imul(T,z)|0)+Math.imul(R,q)|0,o=o+Math.imul(R,z)|0,i=i+Math.imul(C,G)|0,n=(n=n+Math.imul(C,J)|0)+Math.imul(k,G)|0,o=o+Math.imul(k,J)|0,i=i+Math.imul(E,$)|0,n=(n=n+Math.imul(E,Y)|0)+Math.imul(M,$)|0,o=o+Math.imul(M,Y)|0,i=i+Math.imul(w,X)|0,n=(n=n+Math.imul(w,tt)|0)+Math.imul(_,X)|0,o=o+Math.imul(_,tt)|0,i=i+Math.imul(m,rt)|0,n=(n=n+Math.imul(m,it)|0)+Math.imul(v,rt)|0,o=o+Math.imul(v,it)|0,i=i+Math.imul(p,ot)|0,n=(n=n+Math.imul(p,st)|0)+Math.imul(g,ot)|0,o=o+Math.imul(g,st)|0;var Et=(h+(i=i+Math.imul(f,ut)|0)|0)+((8191&(n=(n=n+Math.imul(f,ht)|0)+Math.imul(l,ut)|0))<<13)|0;h=((o=o+Math.imul(l,ht)|0)+(n>>>13)|0)+(Et>>>26)|0,Et&=67108863,i=Math.imul(N,K),n=(n=Math.imul(N,V))+Math.imul(O,K)|0,o=Math.imul(O,V),i=i+Math.imul(x,q)|0,n=(n=n+Math.imul(x,z)|0)+Math.imul(F,q)|0,o=o+Math.imul(F,z)|0,i=i+Math.imul(T,G)|0,n=(n=n+Math.imul(T,J)|0)+Math.imul(R,G)|0,o=o+Math.imul(R,J)|0,i=i+Math.imul(C,$)|0,n=(n=n+Math.imul(C,Y)|0)+Math.imul(k,$)|0,o=o+Math.imul(k,Y)|0,i=i+Math.imul(E,X)|0,n=(n=n+Math.imul(E,tt)|0)+Math.imul(M,X)|0,o=o+Math.imul(M,tt)|0,i=i+Math.imul(w,rt)|0,n=(n=n+Math.imul(w,it)|0)+Math.imul(_,rt)|0,o=o+Math.imul(_,it)|0,i=i+Math.imul(m,ot)|0,n=(n=n+Math.imul(m,st)|0)+Math.imul(v,ot)|0,o=o+Math.imul(v,st)|0,i=i+Math.imul(p,ut)|0,n=(n=n+Math.imul(p,ht)|0)+Math.imul(g,ut)|0,o=o+Math.imul(g,ht)|0;var Mt=(h+(i=i+Math.imul(f,ft)|0)|0)+((8191&(n=(n=n+Math.imul(f,lt)|0)+Math.imul(l,ft)|0))<<13)|0;h=((o=o+Math.imul(l,lt)|0)+(n>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,i=Math.imul(U,K),n=(n=Math.imul(U,V))+Math.imul(j,K)|0,o=Math.imul(j,V),i=i+Math.imul(N,q)|0,n=(n=n+Math.imul(N,z)|0)+Math.imul(O,q)|0,o=o+Math.imul(O,z)|0,i=i+Math.imul(x,G)|0,n=(n=n+Math.imul(x,J)|0)+Math.imul(F,G)|0,o=o+Math.imul(F,J)|0,i=i+Math.imul(T,$)|0,n=(n=n+Math.imul(T,Y)|0)+Math.imul(R,$)|0,o=o+Math.imul(R,Y)|0,i=i+Math.imul(C,X)|0,n=(n=n+Math.imul(C,tt)|0)+Math.imul(k,X)|0,o=o+Math.imul(k,tt)|0,i=i+Math.imul(E,rt)|0,n=(n=n+Math.imul(E,it)|0)+Math.imul(M,rt)|0,o=o+Math.imul(M,it)|0,i=i+Math.imul(w,ot)|0,n=(n=n+Math.imul(w,st)|0)+Math.imul(_,ot)|0,o=o+Math.imul(_,st)|0,i=i+Math.imul(m,ut)|0,n=(n=n+Math.imul(m,ht)|0)+Math.imul(v,ut)|0,o=o+Math.imul(v,ht)|0,i=i+Math.imul(p,ft)|0,n=(n=n+Math.imul(p,lt)|0)+Math.imul(g,ft)|0,o=o+Math.imul(g,lt)|0;var At=(h+(i=i+Math.imul(f,pt)|0)|0)+((8191&(n=(n=n+Math.imul(f,gt)|0)+Math.imul(l,pt)|0))<<13)|0;h=((o=o+Math.imul(l,gt)|0)+(n>>>13)|0)+(At>>>26)|0,At&=67108863,i=Math.imul(U,q),n=(n=Math.imul(U,z))+Math.imul(j,q)|0,o=Math.imul(j,z),i=i+Math.imul(N,G)|0,n=(n=n+Math.imul(N,J)|0)+Math.imul(O,G)|0,o=o+Math.imul(O,J)|0,i=i+Math.imul(x,$)|0,n=(n=n+Math.imul(x,Y)|0)+Math.imul(F,$)|0,o=o+Math.imul(F,Y)|0,i=i+Math.imul(T,X)|0,n=(n=n+Math.imul(T,tt)|0)+Math.imul(R,X)|0,o=o+Math.imul(R,tt)|0,i=i+Math.imul(C,rt)|0,n=(n=n+Math.imul(C,it)|0)+Math.imul(k,rt)|0,o=o+Math.imul(k,it)|0,i=i+Math.imul(E,ot)|0,n=(n=n+Math.imul(E,st)|0)+Math.imul(M,ot)|0,o=o+Math.imul(M,st)|0,i=i+Math.imul(w,ut)|0,n=(n=n+Math.imul(w,ht)|0)+Math.imul(_,ut)|0,o=o+Math.imul(_,ht)|0,i=i+Math.imul(m,ft)|0,n=(n=n+Math.imul(m,lt)|0)+Math.imul(v,ft)|0,o=o+Math.imul(v,lt)|0;var Ct=(h+(i=i+Math.imul(p,pt)|0)|0)+((8191&(n=(n=n+Math.imul(p,gt)|0)+Math.imul(g,pt)|0))<<13)|0;h=((o=o+Math.imul(g,gt)|0)+(n>>>13)|0)+(Ct>>>26)|0,Ct&=67108863,i=Math.imul(U,G),n=(n=Math.imul(U,J))+Math.imul(j,G)|0,o=Math.imul(j,J),i=i+Math.imul(N,$)|0,n=(n=n+Math.imul(N,Y)|0)+Math.imul(O,$)|0,o=o+Math.imul(O,Y)|0,i=i+Math.imul(x,X)|0,n=(n=n+Math.imul(x,tt)|0)+Math.imul(F,X)|0,o=o+Math.imul(F,tt)|0,i=i+Math.imul(T,rt)|0,n=(n=n+Math.imul(T,it)|0)+Math.imul(R,rt)|0,o=o+Math.imul(R,it)|0,i=i+Math.imul(C,ot)|0,n=(n=n+Math.imul(C,st)|0)+Math.imul(k,ot)|0,o=o+Math.imul(k,st)|0,i=i+Math.imul(E,ut)|0,n=(n=n+Math.imul(E,ht)|0)+Math.imul(M,ut)|0,o=o+Math.imul(M,ht)|0,i=i+Math.imul(w,ft)|0,n=(n=n+Math.imul(w,lt)|0)+Math.imul(_,ft)|0,o=o+Math.imul(_,lt)|0;var kt=(h+(i=i+Math.imul(m,pt)|0)|0)+((8191&(n=(n=n+Math.imul(m,gt)|0)+Math.imul(v,pt)|0))<<13)|0;h=((o=o+Math.imul(v,gt)|0)+(n>>>13)|0)+(kt>>>26)|0,kt&=67108863,i=Math.imul(U,$),n=(n=Math.imul(U,Y))+Math.imul(j,$)|0,o=Math.imul(j,Y),i=i+Math.imul(N,X)|0,n=(n=n+Math.imul(N,tt)|0)+Math.imul(O,X)|0,o=o+Math.imul(O,tt)|0,i=i+Math.imul(x,rt)|0,n=(n=n+Math.imul(x,it)|0)+Math.imul(F,rt)|0,o=o+Math.imul(F,it)|0,i=i+Math.imul(T,ot)|0,n=(n=n+Math.imul(T,st)|0)+Math.imul(R,ot)|0,o=o+Math.imul(R,st)|0,i=i+Math.imul(C,ut)|0,n=(n=n+Math.imul(C,ht)|0)+Math.imul(k,ut)|0,o=o+Math.imul(k,ht)|0,i=i+Math.imul(E,ft)|0,n=(n=n+Math.imul(E,lt)|0)+Math.imul(M,ft)|0,o=o+Math.imul(M,lt)|0;var It=(h+(i=i+Math.imul(w,pt)|0)|0)+((8191&(n=(n=n+Math.imul(w,gt)|0)+Math.imul(_,pt)|0))<<13)|0;h=((o=o+Math.imul(_,gt)|0)+(n>>>13)|0)+(It>>>26)|0,It&=67108863,i=Math.imul(U,X),n=(n=Math.imul(U,tt))+Math.imul(j,X)|0,o=Math.imul(j,tt),i=i+Math.imul(N,rt)|0,n=(n=n+Math.imul(N,it)|0)+Math.imul(O,rt)|0,o=o+Math.imul(O,it)|0,i=i+Math.imul(x,ot)|0,n=(n=n+Math.imul(x,st)|0)+Math.imul(F,ot)|0,o=o+Math.imul(F,st)|0,i=i+Math.imul(T,ut)|0,n=(n=n+Math.imul(T,ht)|0)+Math.imul(R,ut)|0,o=o+Math.imul(R,ht)|0,i=i+Math.imul(C,ft)|0,n=(n=n+Math.imul(C,lt)|0)+Math.imul(k,ft)|0,o=o+Math.imul(k,lt)|0;var Tt=(h+(i=i+Math.imul(E,pt)|0)|0)+((8191&(n=(n=n+Math.imul(E,gt)|0)+Math.imul(M,pt)|0))<<13)|0;h=((o=o+Math.imul(M,gt)|0)+(n>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,i=Math.imul(U,rt),n=(n=Math.imul(U,it))+Math.imul(j,rt)|0,o=Math.imul(j,it),i=i+Math.imul(N,ot)|0,n=(n=n+Math.imul(N,st)|0)+Math.imul(O,ot)|0,o=o+Math.imul(O,st)|0,i=i+Math.imul(x,ut)|0,n=(n=n+Math.imul(x,ht)|0)+Math.imul(F,ut)|0,o=o+Math.imul(F,ht)|0,i=i+Math.imul(T,ft)|0,n=(n=n+Math.imul(T,lt)|0)+Math.imul(R,ft)|0,o=o+Math.imul(R,lt)|0;var Rt=(h+(i=i+Math.imul(C,pt)|0)|0)+((8191&(n=(n=n+Math.imul(C,gt)|0)+Math.imul(k,pt)|0))<<13)|0;h=((o=o+Math.imul(k,gt)|0)+(n>>>13)|0)+(Rt>>>26)|0,Rt&=67108863,i=Math.imul(U,ot),n=(n=Math.imul(U,st))+Math.imul(j,ot)|0,o=Math.imul(j,st),i=i+Math.imul(N,ut)|0,n=(n=n+Math.imul(N,ht)|0)+Math.imul(O,ut)|0,o=o+Math.imul(O,ht)|0,i=i+Math.imul(x,ft)|0,n=(n=n+Math.imul(x,lt)|0)+Math.imul(F,ft)|0,o=o+Math.imul(F,lt)|0;var Bt=(h+(i=i+Math.imul(T,pt)|0)|0)+((8191&(n=(n=n+Math.imul(T,gt)|0)+Math.imul(R,pt)|0))<<13)|0;h=((o=o+Math.imul(R,gt)|0)+(n>>>13)|0)+(Bt>>>26)|0,Bt&=67108863,i=Math.imul(U,ut),n=(n=Math.imul(U,ht))+Math.imul(j,ut)|0,o=Math.imul(j,ht),i=i+Math.imul(N,ft)|0,n=(n=n+Math.imul(N,lt)|0)+Math.imul(O,ft)|0,o=o+Math.imul(O,lt)|0;var xt=(h+(i=i+Math.imul(x,pt)|0)|0)+((8191&(n=(n=n+Math.imul(x,gt)|0)+Math.imul(F,pt)|0))<<13)|0;h=((o=o+Math.imul(F,gt)|0)+(n>>>13)|0)+(xt>>>26)|0,xt&=67108863,i=Math.imul(U,ft),n=(n=Math.imul(U,lt))+Math.imul(j,ft)|0,o=Math.imul(j,lt);var Ft=(h+(i=i+Math.imul(N,pt)|0)|0)+((8191&(n=(n=n+Math.imul(N,gt)|0)+Math.imul(O,pt)|0))<<13)|0;h=((o=o+Math.imul(O,gt)|0)+(n>>>13)|0)+(Ft>>>26)|0,Ft&=67108863;var Pt=(h+(i=Math.imul(U,pt))|0)+((8191&(n=(n=Math.imul(U,gt))+Math.imul(j,pt)|0))<<13)|0;return h=((o=Math.imul(j,gt))+(n>>>13)|0)+(Pt>>>26)|0,Pt&=67108863,u[0]=yt,u[1]=mt,u[2]=vt,u[3]=bt,u[4]=wt,u[5]=_t,u[6]=St,u[7]=Et,u[8]=Mt,u[9]=At,u[10]=Ct,u[11]=kt,u[12]=It,u[13]=Tt,u[14]=Rt,u[15]=Bt,u[16]=xt,u[17]=Ft,u[18]=Pt,0!==h&&(u[19]=h,r.length++),r};function p(t,e,r){return(new g).mulp(t,e,r)}function g(t,e){this.x=t,this.y=e}Math.imul||(d=l),o.prototype.mulTo=function(t,e){var r=this.length+t.length;return 10===this.length&&10===t.length?d(this,t,e):r<63?l(this,t,e):r<1024?function(t,e,r){r.negative=e.negative^t.negative,r.length=t.length+e.length;for(var i=0,n=0,o=0;o<r.length-1;o++){var s=n;n=0;for(var a=67108863&i,u=Math.min(o,e.length-1),h=Math.max(0,o-t.length+1);h<=u;h++){var c=o-h,f=(0|t.words[c])*(0|e.words[h]),l=67108863&f;a=67108863&(l=l+a|0),n+=(s=(s=s+(f/67108864|0)|0)+(l>>>26)|0)>>>26,s&=67108863}r.words[o]=a,i=s,s=n}return 0!==i?r.words[o]=i:r.length--,r.strip()}(this,t,e):p(this,t,e)},g.prototype.makeRBT=function(t){for(var e=new Array(t),r=o.prototype._countBits(t)-1,i=0;i<t;i++)e[i]=this.revBin(i,r,t);return e},g.prototype.revBin=function(t,e,r){if(0===t||t===r-1)return t;for(var i=0,n=0;n<e;n++)i|=(1&t)<<e-n-1,t>>=1;return i},g.prototype.permute=function(t,e,r,i,n,o){for(var s=0;s<o;s++)i[s]=e[t[s]],n[s]=r[t[s]]},g.prototype.transform=function(t,e,r,i,n,o){this.permute(o,t,e,r,i,n);for(var s=1;s<n;s<<=1)for(var a=s<<1,u=Math.cos(2*Math.PI/a),h=Math.sin(2*Math.PI/a),c=0;c<n;c+=a)for(var f=u,l=h,d=0;d<s;d++){var p=r[c+d],g=i[c+d],y=r[c+d+s],m=i[c+d+s],v=f*y-l*m;m=f*m+l*y,y=v,r[c+d]=p+y,i[c+d]=g+m,r[c+d+s]=p-y,i[c+d+s]=g-m,d!==a&&(v=u*f-h*l,l=u*l+h*f,f=v)}},g.prototype.guessLen13b=function(t,e){var r=1|Math.max(e,t),i=1&r,n=0;for(r=r/2|0;r;r>>>=1)n++;return 1<<n+1+i},g.prototype.conjugate=function(t,e,r){if(!(r<=1))for(var i=0;i<r/2;i++){var n=t[i];t[i]=t[r-i-1],t[r-i-1]=n,n=e[i],e[i]=-e[r-i-1],e[r-i-1]=-n}},g.prototype.normalize13b=function(t,e){for(var r=0,i=0;i<e/2;i++){var n=8192*Math.round(t[2*i+1]/e)+Math.round(t[2*i]/e)+r;t[i]=67108863&n,r=n<67108864?0:n/67108864|0}return t},g.prototype.convert13b=function(t,e,r,n){for(var o=0,s=0;s<e;s++)o+=0|t[s],r[2*s]=8191&o,o>>>=13,r[2*s+1]=8191&o,o>>>=13;for(s=2*e;s<n;++s)r[s]=0;i(0===o),i(0==(-8192&o))},g.prototype.stub=function(t){for(var e=new Array(t),r=0;r<t;r++)e[r]=0;return e},g.prototype.mulp=function(t,e,r){var i=2*this.guessLen13b(t.length,e.length),n=this.makeRBT(i),o=this.stub(i),s=new Array(i),a=new Array(i),u=new Array(i),h=new Array(i),c=new Array(i),f=new Array(i),l=r.words;l.length=i,this.convert13b(t.words,t.length,s,i),this.convert13b(e.words,e.length,h,i),this.transform(s,o,a,u,i,n),this.transform(h,o,c,f,i,n);for(var d=0;d<i;d++){var p=a[d]*c[d]-u[d]*f[d];u[d]=a[d]*f[d]+u[d]*c[d],a[d]=p}return this.conjugate(a,u,i),this.transform(a,u,l,o,i,n),this.conjugate(l,o,i),this.normalize13b(l,i),r.negative=t.negative^e.negative,r.length=t.length+e.length,r.strip()},o.prototype.mul=function(t){var e=new o(null);return e.words=new Array(this.length+t.length),this.mulTo(t,e)},o.prototype.mulf=function(t){var e=new o(null);return e.words=new Array(this.length+t.length),p(this,t,e)},o.prototype.imul=function(t){return this.clone().mulTo(t,this)},o.prototype.imuln=function(t){i("number"==typeof t),i(t<67108864);for(var e=0,r=0;r<this.length;r++){var n=(0|this.words[r])*t,o=(67108863&n)+(67108863&e);e>>=26,e+=n/67108864|0,e+=o>>>26,this.words[r]=67108863&o}return 0!==e&&(this.words[r]=e,this.length++),this},o.prototype.muln=function(t){return this.clone().imuln(t)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(t){var e=function(t){for(var e=new Array(t.bitLength()),r=0;r<e.length;r++){var i=r/26|0,n=r%26;e[r]=(t.words[i]&1<<n)>>>n}return e}(t);if(0===e.length)return new o(1);for(var r=this,i=0;i<e.length&&0===e[i];i++,r=r.sqr());if(++i<e.length)for(var n=r.sqr();i<e.length;i++,n=n.sqr())0!==e[i]&&(r=r.mul(n));return r},o.prototype.iushln=function(t){i("number"==typeof t&&t>=0);var e,r=t%26,n=(t-r)/26,o=67108863>>>26-r<<26-r;if(0!==r){var s=0;for(e=0;e<this.length;e++){var a=this.words[e]&o,u=(0|this.words[e])-a<<r;this.words[e]=u|s,s=a>>>26-r}s&&(this.words[e]=s,this.length++)}if(0!==n){for(e=this.length-1;e>=0;e--)this.words[e+n]=this.words[e];for(e=0;e<n;e++)this.words[e]=0;this.length+=n}return this.strip()},o.prototype.ishln=function(t){return i(0===this.negative),this.iushln(t)},o.prototype.iushrn=function(t,e,r){var n;i("number"==typeof t&&t>=0),n=e?(e-e%26)/26:0;var o=t%26,s=Math.min((t-o)/26,this.length),a=67108863^67108863>>>o<<o,u=r;if(n-=s,n=Math.max(0,n),u){for(var h=0;h<s;h++)u.words[h]=this.words[h];u.length=s}if(0===s);else if(this.length>s)for(this.length-=s,h=0;h<this.length;h++)this.words[h]=this.words[h+s];else this.words[0]=0,this.length=1;var c=0;for(h=this.length-1;h>=0&&(0!==c||h>=n);h--){var f=0|this.words[h];this.words[h]=c<<26-o|f>>>o,c=f&a}return u&&0!==c&&(u.words[u.length++]=c),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},o.prototype.ishrn=function(t,e,r){return i(0===this.negative),this.iushrn(t,e,r)},o.prototype.shln=function(t){return this.clone().ishln(t)},o.prototype.ushln=function(t){return this.clone().iushln(t)},o.prototype.shrn=function(t){return this.clone().ishrn(t)},o.prototype.ushrn=function(t){return this.clone().iushrn(t)},o.prototype.testn=function(t){i("number"==typeof t&&t>=0);var e=t%26,r=(t-e)/26,n=1<<e;return!(this.length<=r||!(this.words[r]&n))},o.prototype.imaskn=function(t){i("number"==typeof t&&t>=0);var e=t%26,r=(t-e)/26;if(i(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==e&&r++,this.length=Math.min(r,this.length),0!==e){var n=67108863^67108863>>>e<<e;this.words[this.length-1]&=n}return this.strip()},o.prototype.maskn=function(t){return this.clone().imaskn(t)},o.prototype.iaddn=function(t){return i("number"==typeof t),i(t<67108864),t<0?this.isubn(-t):0!==this.negative?1===this.length&&(0|this.words[0])<t?(this.words[0]=t-(0|this.words[0]),this.negative=0,this):(this.negative=0,this.isubn(t),this.negative=1,this):this._iaddn(t)},o.prototype._iaddn=function(t){this.words[0]+=t;for(var e=0;e<this.length&&this.words[e]>=67108864;e++)this.words[e]-=67108864,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},o.prototype.isubn=function(t){if(i("number"==typeof t),i(t<67108864),t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var e=0;e<this.length&&this.words[e]<0;e++)this.words[e]+=67108864,this.words[e+1]-=1;return this.strip()},o.prototype.addn=function(t){return this.clone().iaddn(t)},o.prototype.subn=function(t){return this.clone().isubn(t)},o.prototype.iabs=function(){return this.negative=0,this},o.prototype.abs=function(){return this.clone().iabs()},o.prototype._ishlnsubmul=function(t,e,r){var n,o,s=t.length+r;this._expand(s);var a=0;for(n=0;n<t.length;n++){o=(0|this.words[n+r])+a;var u=(0|t.words[n])*e;a=((o-=67108863&u)>>26)-(u/67108864|0),this.words[n+r]=67108863&o}for(;n<this.length-r;n++)a=(o=(0|this.words[n+r])+a)>>26,this.words[n+r]=67108863&o;if(0===a)return this.strip();for(i(-1===a),a=0,n=0;n<this.length;n++)a=(o=-(0|this.words[n])+a)>>26,this.words[n]=67108863&o;return this.negative=1,this.strip()},o.prototype._wordDiv=function(t,e){var r=(this.length,t.length),i=this.clone(),n=t,s=0|n.words[n.length-1];0!=(r=26-this._countBits(s))&&(n=n.ushln(r),i.iushln(r),s=0|n.words[n.length-1]);var a,u=i.length-n.length;if("mod"!==e){(a=new o(null)).length=u+1,a.words=new Array(a.length);for(var h=0;h<a.length;h++)a.words[h]=0}var c=i.clone()._ishlnsubmul(n,1,u);0===c.negative&&(i=c,a&&(a.words[u]=1));for(var f=u-1;f>=0;f--){var l=67108864*(0|i.words[n.length+f])+(0|i.words[n.length+f-1]);for(l=Math.min(l/s|0,67108863),i._ishlnsubmul(n,l,f);0!==i.negative;)l--,i.negative=0,i._ishlnsubmul(n,1,f),i.isZero()||(i.negative^=1);a&&(a.words[f]=l)}return a&&a.strip(),i.strip(),"div"!==e&&0!==r&&i.iushrn(r),{div:a||null,mod:i}},o.prototype.divmod=function(t,e,r){return i(!t.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===t.negative?(a=this.neg().divmod(t,e),"mod"!==e&&(n=a.div.neg()),"div"!==e&&(s=a.mod.neg(),r&&0!==s.negative&&s.iadd(t)),{div:n,mod:s}):0===this.negative&&0!==t.negative?(a=this.divmod(t.neg(),e),"mod"!==e&&(n=a.div.neg()),{div:n,mod:a.mod}):0!=(this.negative&t.negative)?(a=this.neg().divmod(t.neg(),e),"div"!==e&&(s=a.mod.neg(),r&&0!==s.negative&&s.isub(t)),{div:a.div,mod:s}):t.length>this.length||this.cmp(t)<0?{div:new o(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new o(this.modn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new o(this.modn(t.words[0]))}:this._wordDiv(t,e);var n,s,a},o.prototype.div=function(t){return this.divmod(t,"div",!1).div},o.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},o.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},o.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var r=0!==e.div.negative?e.mod.isub(t):e.mod,i=t.ushrn(1),n=t.andln(1),o=r.cmp(i);return o<0||1===n&&0===o?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},o.prototype.modn=function(t){i(t<=67108863);for(var e=(1<<26)%t,r=0,n=this.length-1;n>=0;n--)r=(e*r+(0|this.words[n]))%t;return r},o.prototype.idivn=function(t){i(t<=67108863);for(var e=0,r=this.length-1;r>=0;r--){var n=(0|this.words[r])+67108864*e;this.words[r]=n/t|0,e=n%t}return this.strip()},o.prototype.divn=function(t){return this.clone().idivn(t)},o.prototype.egcd=function(t){i(0===t.negative),i(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var n=new o(1),s=new o(0),a=new o(0),u=new o(1),h=0;e.isEven()&&r.isEven();)e.iushrn(1),r.iushrn(1),++h;for(var c=r.clone(),f=e.clone();!e.isZero();){for(var l=0,d=1;0==(e.words[0]&d)&&l<26;++l,d<<=1);if(l>0)for(e.iushrn(l);l-- >0;)(n.isOdd()||s.isOdd())&&(n.iadd(c),s.isub(f)),n.iushrn(1),s.iushrn(1);for(var p=0,g=1;0==(r.words[0]&g)&&p<26;++p,g<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(a.isOdd()||u.isOdd())&&(a.iadd(c),u.isub(f)),a.iushrn(1),u.iushrn(1);e.cmp(r)>=0?(e.isub(r),n.isub(a),s.isub(u)):(r.isub(e),a.isub(n),u.isub(s))}return{a,b:u,gcd:r.iushln(h)}},o.prototype._invmp=function(t){i(0===t.negative),i(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var n,s=new o(1),a=new o(0),u=r.clone();e.cmpn(1)>0&&r.cmpn(1)>0;){for(var h=0,c=1;0==(e.words[0]&c)&&h<26;++h,c<<=1);if(h>0)for(e.iushrn(h);h-- >0;)s.isOdd()&&s.iadd(u),s.iushrn(1);for(var f=0,l=1;0==(r.words[0]&l)&&f<26;++f,l<<=1);if(f>0)for(r.iushrn(f);f-- >0;)a.isOdd()&&a.iadd(u),a.iushrn(1);e.cmp(r)>=0?(e.isub(r),s.isub(a)):(r.isub(e),a.isub(s))}return(n=0===e.cmpn(1)?s:a).cmpn(0)<0&&n.iadd(t),n},o.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),r=t.clone();e.negative=0,r.negative=0;for(var i=0;e.isEven()&&r.isEven();i++)e.iushrn(1),r.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;r.isEven();)r.iushrn(1);var n=e.cmp(r);if(n<0){var o=e;e=r,r=o}else if(0===n||0===r.cmpn(1))break;e.isub(r)}return r.iushln(i)},o.prototype.invm=function(t){return this.egcd(t).a.umod(t)},o.prototype.isEven=function(){return 0==(1&this.words[0])},o.prototype.isOdd=function(){return 1==(1&this.words[0])},o.prototype.andln=function(t){return this.words[0]&t},o.prototype.bincn=function(t){i("number"==typeof t);var e=t%26,r=(t-e)/26,n=1<<e;if(this.length<=r)return this._expand(r+1),this.words[r]|=n,this;for(var o=n,s=r;0!==o&&s<this.length;s++){var a=0|this.words[s];o=(a+=o)>>>26,a&=67108863,this.words[s]=a}return 0!==o&&(this.words[s]=o,this.length++),this},o.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},o.prototype.cmpn=function(t){var e,r=t<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this.strip(),this.length>1)e=1;else{r&&(t=-t),i(t<=67108863,"Number is too big");var n=0|this.words[0];e=n===t?0:n<t?-1:1}return 0!==this.negative?0|-e:e},o.prototype.cmp=function(t){if(0!==this.negative&&0===t.negative)return-1;if(0===this.negative&&0!==t.negative)return 1;var e=this.ucmp(t);return 0!==this.negative?0|-e:e},o.prototype.ucmp=function(t){if(this.length>t.length)return 1;if(this.length<t.length)return-1;for(var e=0,r=this.length-1;r>=0;r--){var i=0|this.words[r],n=0|t.words[r];if(i!==n){i<n?e=-1:i>n&&(e=1);break}}return e},o.prototype.gtn=function(t){return 1===this.cmpn(t)},o.prototype.gt=function(t){return 1===this.cmp(t)},o.prototype.gten=function(t){return this.cmpn(t)>=0},o.prototype.gte=function(t){return this.cmp(t)>=0},o.prototype.ltn=function(t){return-1===this.cmpn(t)},o.prototype.lt=function(t){return-1===this.cmp(t)},o.prototype.lten=function(t){return this.cmpn(t)<=0},o.prototype.lte=function(t){return this.cmp(t)<=0},o.prototype.eqn=function(t){return 0===this.cmpn(t)},o.prototype.eq=function(t){return 0===this.cmp(t)},o.red=function(t){return new S(t)},o.prototype.toRed=function(t){return i(!this.red,"Already a number in reduction context"),i(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},o.prototype.fromRed=function(){return i(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(t){return this.red=t,this},o.prototype.forceRed=function(t){return i(!this.red,"Already a number in reduction context"),this._forceRed(t)},o.prototype.redAdd=function(t){return i(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},o.prototype.redIAdd=function(t){return i(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},o.prototype.redSub=function(t){return i(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},o.prototype.redISub=function(t){return i(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},o.prototype.redShl=function(t){return i(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},o.prototype.redMul=function(t){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},o.prototype.redIMul=function(t){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},o.prototype.redSqr=function(){return i(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return i(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return i(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return i(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return i(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(t){return i(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var y={k256:null,p224:null,p192:null,p25519:null};function m(t,e){this.name=t,this.p=new o(e,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function v(){m.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function b(){m.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function w(){m.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function _(){m.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function S(t){if("string"==typeof t){var e=o._prime(t);this.m=e.p,this.prime=e}else i(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function E(t){S.call(this,t),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new o(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}m.prototype._tmp=function(){var t=new o(null);return t.words=new Array(Math.ceil(this.n/13)),t},m.prototype.ireduce=function(t){var e,r=t;do{this.split(r,this.tmp),e=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(e>this.n);var i=e<this.n?-1:r.ucmp(this.p);return 0===i?(r.words[0]=0,r.length=1):i>0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},m.prototype.split=function(t,e){t.iushrn(this.n,0,e)},m.prototype.imulK=function(t){return t.imul(this.k)},n(v,m),v.prototype.split=function(t,e){for(var r=4194303,i=Math.min(t.length,9),n=0;n<i;n++)e.words[n]=t.words[n];if(e.length=i,t.length<=9)return t.words[0]=0,void(t.length=1);var o=t.words[9];for(e.words[e.length++]=o&r,n=10;n<t.length;n++){var s=0|t.words[n];t.words[n-10]=(s&r)<<4|o>>>22,o=s}o>>>=22,t.words[n-10]=o,0===o&&t.length>10?t.length-=10:t.length-=9},v.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,r=0;r<t.length;r++){var i=0|t.words[r];e+=977*i,t.words[r]=67108863&e,e=64*i+(e/67108864|0)}return 0===t.words[t.length-1]&&(t.length--,0===t.words[t.length-1]&&t.length--),t},n(b,m),n(w,m),n(_,m),_.prototype.imulK=function(t){for(var e=0,r=0;r<t.length;r++){var i=19*(0|t.words[r])+e,n=67108863&i;i>>>=26,t.words[r]=n,e=i}return 0!==e&&(t.words[t.length++]=e),t},o._prime=function(t){if(y[t])return y[t];var e;if("k256"===t)e=new v;else if("p224"===t)e=new b;else if("p192"===t)e=new w;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new _}return y[t]=e,e},S.prototype._verify1=function(t){i(0===t.negative,"red works only with positives"),i(t.red,"red works only with red numbers")},S.prototype._verify2=function(t,e){i(0==(t.negative|e.negative),"red works only with positives"),i(t.red&&t.red===e.red,"red works only with red numbers")},S.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.umod(this.m)._forceRed(this)},S.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},S.prototype.add=function(t,e){this._verify2(t,e);var r=t.add(e);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},S.prototype.iadd=function(t,e){this._verify2(t,e);var r=t.iadd(e);return r.cmp(this.m)>=0&&r.isub(this.m),r},S.prototype.sub=function(t,e){this._verify2(t,e);var r=t.sub(e);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},S.prototype.isub=function(t,e){this._verify2(t,e);var r=t.isub(e);return r.cmpn(0)<0&&r.iadd(this.m),r},S.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},S.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},S.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},S.prototype.isqr=function(t){return this.imul(t,t.clone())},S.prototype.sqr=function(t){return this.mul(t,t)},S.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(i(e%2==1),3===e){var r=this.m.add(new o(1)).iushrn(2);return this.pow(t,r)}for(var n=this.m.subn(1),s=0;!n.isZero()&&0===n.andln(1);)s++,n.iushrn(1);i(!n.isZero());var a=new o(1).toRed(this),u=a.redNeg(),h=this.m.subn(1).iushrn(1),c=this.m.bitLength();for(c=new o(2*c*c).toRed(this);0!==this.pow(c,h).cmp(u);)c.redIAdd(u);for(var f=this.pow(c,n),l=this.pow(t,n.addn(1).iushrn(1)),d=this.pow(t,n),p=s;0!==d.cmp(a);){for(var g=d,y=0;0!==g.cmp(a);y++)g=g.redSqr();i(y<p);var m=this.pow(f,new o(1).iushln(p-y-1));l=l.redMul(m),f=m.redSqr(),d=d.redMul(f),p=y}return l},S.prototype.invm=function(t){var e=t._invmp(this.m);return 0!==e.negative?(e.negative=0,this.imod(e).redNeg()):this.imod(e)},S.prototype.pow=function(t,e){if(e.isZero())return new o(1).toRed(this);if(0===e.cmpn(1))return t.clone();var r=new Array(16);r[0]=new o(1).toRed(this),r[1]=t;for(var i=2;i<r.length;i++)r[i]=this.mul(r[i-1],t);var n=r[0],s=0,a=0,u=e.bitLength()%26;for(0===u&&(u=26),i=e.length-1;i>=0;i--){for(var h=e.words[i],c=u-1;c>=0;c--){var f=h>>c&1;n!==r[0]&&(n=this.sqr(n)),0!==f||0!==s?(s<<=1,s|=f,(4==++a||0===i&&0===c)&&(n=this.mul(n,r[s]),a=0,s=0)):a=0}u=26}return n},S.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},S.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},o.mont=function(t){return new E(t)},n(E,S),E.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},E.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},E.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var r=t.imul(e),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(i).iushrn(this.shift),o=n;return n.cmp(this.m)>=0?o=n.isub(this.m):n.cmpn(0)<0&&(o=n.iadd(this.m)),o._forceRed(this)},E.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new o(0)._forceRed(this);var r=t.mul(e),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(i).iushrn(this.shift),s=n;return n.cmp(this.m)>=0?s=n.isub(this.m):n.cmpn(0)<0&&(s=n.iadd(this.m)),s._forceRed(this)},E.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(t=r.nmd(t),this)},23482:(t,e,r)=>{"use strict";var i=r(35717),n=r(62318),o=r(79785),s=r(89072),a=r(71027);function u(t){a.call(this,"digest"),this._hash=t}i(u,a),u.prototype._update=function(t){this._hash.update(t)},u.prototype._final=function(){return this._hash.digest()},t.exports=function(t){return"md5"===(t=t.toLowerCase())?new n:"rmd160"===t||"ripemd160"===t?new o:new u(s(t))}},78028:(t,e,r)=>{var i=r(62318);t.exports=function(t){return(new i).update(t).digest()}},58355:(t,e,r)=>{"use strict";var i=r(35717),n=r(51031),o=r(71027),s=r(89509).Buffer,a=r(78028),u=r(79785),h=r(89072),c=s.alloc(128);function f(t,e){o.call(this,"digest"),"string"==typeof e&&(e=s.from(e));var r="sha512"===t||"sha384"===t?128:64;this._alg=t,this._key=e,e.length>r?e=("rmd160"===t?new u:h(t)).update(e).digest():e.length<r&&(e=s.concat([e,c],r));for(var i=this._ipad=s.allocUnsafe(r),n=this._opad=s.allocUnsafe(r),a=0;a<r;a++)i[a]=54^e[a],n[a]=92^e[a];this._hash="rmd160"===t?new u:h(t),this._hash.update(i)}i(f,o),f.prototype._update=function(t){this._hash.update(t)},f.prototype._final=function(){var t=this._hash.digest();return("rmd160"===this._alg?new u:h(this._alg)).update(this._opad).update(t).digest()},t.exports=function(t,e){return"rmd160"===(t=t.toLowerCase())||"ripemd160"===t?new f("rmd160",e):"md5"===t?new n(a,e):new f(t,e)}},51031:(t,e,r)=>{"use strict";var i=r(35717),n=r(89509).Buffer,o=r(71027),s=n.alloc(128),a=64;function u(t,e){o.call(this,"digest"),"string"==typeof e&&(e=n.from(e)),this._alg=t,this._key=e,e.length>a?e=t(e):e.length<a&&(e=n.concat([e,s],a));for(var r=this._ipad=n.allocUnsafe(a),i=this._opad=n.allocUnsafe(a),u=0;u<a;u++)r[u]=54^e[u],i[u]=92^e[u];this._hash=[r]}i(u,o),u.prototype._update=function(t){this._hash.push(t)},u.prototype._final=function(){var t=this._alg(n.concat(this._hash));return this._alg(n.concat([this._opad,t]))},t.exports=u},55835:(t,e,r)=>{"use strict";e.randomBytes=e.rng=e.pseudoRandomBytes=e.prng=r(61798),e.createHash=e.Hash=r(23482),e.createHmac=e.Hmac=r(58355);var i=r(56042),n=Object.keys(i),o=["sha1","sha224","sha256","sha384","sha512","md5","rmd160"].concat(n);e.getHashes=function(){return o};var s=r(25632);e.pbkdf2=s.pbkdf2,e.pbkdf2Sync=s.pbkdf2Sync;var a=r(53614);e.Cipher=a.Cipher,e.createCipher=a.createCipher,e.Cipheriv=a.Cipheriv,e.createCipheriv=a.createCipheriv,e.Decipher=a.Decipher,e.createDecipher=a.createDecipher,e.Decipheriv=a.Decipheriv,e.createDecipheriv=a.createDecipheriv,e.getCiphers=a.getCiphers,e.listCiphers=a.listCiphers;var u=r(62607);e.DiffieHellmanGroup=u.DiffieHellmanGroup,e.createDiffieHellmanGroup=u.createDiffieHellmanGroup,e.getDiffieHellman=u.getDiffieHellman,e.createDiffieHellman=u.createDiffieHellman,e.DiffieHellman=u.DiffieHellman;var h=r(64743);e.createSign=h.createSign,e.Sign=h.Sign,e.createVerify=h.createVerify,e.Verify=h.Verify,e.createECDH=r(76393);var c=r(7900);e.publicEncrypt=c.publicEncrypt,e.privateEncrypt=c.privateEncrypt,e.publicDecrypt=c.publicDecrypt,e.privateDecrypt=c.privateDecrypt;var f=r(77963);e.randomFill=f.randomFill,e.randomFillSync=f.randomFillSync,e.createCredentials=function(){throw new Error(["sorry, createCredentials is not implemented yet","we accept pull requests","https://github.com/crypto-browserify/crypto-browserify"].join("\n"))},e.constants={DH_CHECK_P_NOT_SAFE_PRIME:2,DH_CHECK_P_NOT_PRIME:1,DH_UNABLE_TO_CHECK_GENERATOR:4,DH_NOT_SUITABLE_GENERATOR:8,NPN_ENABLED:1,ALPN_ENABLED:1,RSA_PKCS1_PADDING:1,RSA_SSLV23_PADDING:2,RSA_NO_PADDING:3,RSA_PKCS1_OAEP_PADDING:4,RSA_X931_PADDING:5,RSA_PKCS1_PSS_PADDING:6,POINT_CONVERSION_COMPRESSED:2,POINT_CONVERSION_UNCOMPRESSED:4,POINT_CONVERSION_HYBRID:6}},15251:(t,e,r)=>{"use strict";e.utils=r(11278),e.Cipher=r(55756),e.DES=r(70778),e.CBC=r(39051),e.EDE=r(50651)},39051:(t,e,r)=>{"use strict";var i=r(79746),n=r(35717),o={};function s(t){i.equal(t.length,8,"Invalid IV length"),this.iv=new Array(8);for(var e=0;e<this.iv.length;e++)this.iv[e]=t[e]}e.instantiate=function(t){function e(e){t.call(this,e),this._cbcInit()}n(e,t);for(var r=Object.keys(o),i=0;i<r.length;i++){var s=r[i];e.prototype[s]=o[s]}return e.create=function(t){return new e(t)},e},o._cbcInit=function(){var t=new s(this.options.iv);this._cbcState=t},o._update=function(t,e,r,i){var n=this._cbcState,o=this.constructor.super_.prototype,s=n.iv;if("encrypt"===this.type){for(var a=0;a<this.blockSize;a++)s[a]^=t[e+a];for(o._update.call(this,s,0,r,i),a=0;a<this.blockSize;a++)s[a]=r[i+a]}else{for(o._update.call(this,t,e,r,i),a=0;a<this.blockSize;a++)r[i+a]^=s[a];for(a=0;a<this.blockSize;a++)s[a]=t[e+a]}}},55756:(t,e,r)=>{"use strict";var i=r(79746);function n(t){this.options=t,this.type=this.options.type,this.blockSize=8,this._init(),this.buffer=new Array(this.blockSize),this.bufferOff=0}t.exports=n,n.prototype._init=function(){},n.prototype.update=function(t){return 0===t.length?[]:"decrypt"===this.type?this._updateDecrypt(t):this._updateEncrypt(t)},n.prototype._buffer=function(t,e){for(var r=Math.min(this.buffer.length-this.bufferOff,t.length-e),i=0;i<r;i++)this.buffer[this.bufferOff+i]=t[e+i];return this.bufferOff+=r,r},n.prototype._flushBuffer=function(t,e){return this._update(this.buffer,0,t,e),this.bufferOff=0,this.blockSize},n.prototype._updateEncrypt=function(t){var e=0,r=0,i=(this.bufferOff+t.length)/this.blockSize|0,n=new Array(i*this.blockSize);0!==this.bufferOff&&(e+=this._buffer(t,e),this.bufferOff===this.buffer.length&&(r+=this._flushBuffer(n,r)));for(var o=t.length-(t.length-e)%this.blockSize;e<o;e+=this.blockSize)this._update(t,e,n,r),r+=this.blockSize;for(;e<t.length;e++,this.bufferOff++)this.buffer[this.bufferOff]=t[e];return n},n.prototype._updateDecrypt=function(t){for(var e=0,r=0,i=Math.ceil((this.bufferOff+t.length)/this.blockSize)-1,n=new Array(i*this.blockSize);i>0;i--)e+=this._buffer(t,e),r+=this._flushBuffer(n,r);return e+=this._buffer(t,e),n},n.prototype.final=function(t){var e,r;return t&&(e=this.update(t)),r="encrypt"===this.type?this._finalEncrypt():this._finalDecrypt(),e?e.concat(r):r},n.prototype._pad=function(t,e){if(0===e)return!1;for(;e<t.length;)t[e++]=0;return!0},n.prototype._finalEncrypt=function(){if(!this._pad(this.buffer,this.bufferOff))return[];var t=new Array(this.blockSize);return this._update(this.buffer,0,t,0),t},n.prototype._unpad=function(t){return t},n.prototype._finalDecrypt=function(){i.equal(this.bufferOff,this.blockSize,"Not enough data to decrypt");var t=new Array(this.blockSize);return this._flushBuffer(t,0),this._unpad(t)}},70778:(t,e,r)=>{"use strict";var i=r(79746),n=r(35717),o=r(11278),s=r(55756);function a(){this.tmp=new Array(2),this.keys=null}function u(t){s.call(this,t);var e=new a;this._desState=e,this.deriveKeys(e,t.key)}n(u,s),t.exports=u,u.create=function(t){return new u(t)};var h=[1,1,2,2,2,2,2,2,1,2,2,2,2,2,2,1];u.prototype.deriveKeys=function(t,e){t.keys=new Array(32),i.equal(e.length,this.blockSize,"Invalid key length");var r=o.readUInt32BE(e,0),n=o.readUInt32BE(e,4);o.pc1(r,n,t.tmp,0),r=t.tmp[0],n=t.tmp[1];for(var s=0;s<t.keys.length;s+=2){var a=h[s>>>1];r=o.r28shl(r,a),n=o.r28shl(n,a),o.pc2(r,n,t.keys,s)}},u.prototype._update=function(t,e,r,i){var n=this._desState,s=o.readUInt32BE(t,e),a=o.readUInt32BE(t,e+4);o.ip(s,a,n.tmp,0),s=n.tmp[0],a=n.tmp[1],"encrypt"===this.type?this._encrypt(n,s,a,n.tmp,0):this._decrypt(n,s,a,n.tmp,0),s=n.tmp[0],a=n.tmp[1],o.writeUInt32BE(r,s,i),o.writeUInt32BE(r,a,i+4)},u.prototype._pad=function(t,e){for(var r=t.length-e,i=e;i<t.length;i++)t[i]=r;return!0},u.prototype._unpad=function(t){for(var e=t[t.length-1],r=t.length-e;r<t.length;r++)i.equal(t[r],e);return t.slice(0,t.length-e)},u.prototype._encrypt=function(t,e,r,i,n){for(var s=e,a=r,u=0;u<t.keys.length;u+=2){var h=t.keys[u],c=t.keys[u+1];o.expand(a,t.tmp,0),h^=t.tmp[0],c^=t.tmp[1];var f=o.substitute(h,c),l=a;a=(s^o.permute(f))>>>0,s=l}o.rip(a,s,i,n)},u.prototype._decrypt=function(t,e,r,i,n){for(var s=r,a=e,u=t.keys.length-2;u>=0;u-=2){var h=t.keys[u],c=t.keys[u+1];o.expand(s,t.tmp,0),h^=t.tmp[0],c^=t.tmp[1];var f=o.substitute(h,c),l=s;s=(a^o.permute(f))>>>0,a=l}o.rip(s,a,i,n)}},50651:(t,e,r)=>{"use strict";var i=r(79746),n=r(35717),o=r(55756),s=r(70778);function a(t,e){i.equal(e.length,24,"Invalid key length");var r=e.slice(0,8),n=e.slice(8,16),o=e.slice(16,24);this.ciphers="encrypt"===t?[s.create({type:"encrypt",key:r}),s.create({type:"decrypt",key:n}),s.create({type:"encrypt",key:o})]:[s.create({type:"decrypt",key:o}),s.create({type:"encrypt",key:n}),s.create({type:"decrypt",key:r})]}function u(t){o.call(this,t);var e=new a(this.type,this.options.key);this._edeState=e}n(u,o),t.exports=u,u.create=function(t){return new u(t)},u.prototype._update=function(t,e,r,i){var n=this._edeState;n.ciphers[0]._update(t,e,r,i),n.ciphers[1]._update(r,i,r,i),n.ciphers[2]._update(r,i,r,i)},u.prototype._pad=s.prototype._pad,u.prototype._unpad=s.prototype._unpad},11278:(t,e)=>{"use strict";e.readUInt32BE=function(t,e){return(t[0+e]<<24|t[1+e]<<16|t[2+e]<<8|t[3+e])>>>0},e.writeUInt32BE=function(t,e,r){t[0+r]=e>>>24,t[1+r]=e>>>16&255,t[2+r]=e>>>8&255,t[3+r]=255&e},e.ip=function(t,e,r,i){for(var n=0,o=0,s=6;s>=0;s-=2){for(var a=0;a<=24;a+=8)n<<=1,n|=e>>>a+s&1;for(a=0;a<=24;a+=8)n<<=1,n|=t>>>a+s&1}for(s=6;s>=0;s-=2){for(a=1;a<=25;a+=8)o<<=1,o|=e>>>a+s&1;for(a=1;a<=25;a+=8)o<<=1,o|=t>>>a+s&1}r[i+0]=n>>>0,r[i+1]=o>>>0},e.rip=function(t,e,r,i){for(var n=0,o=0,s=0;s<4;s++)for(var a=24;a>=0;a-=8)n<<=1,n|=e>>>a+s&1,n<<=1,n|=t>>>a+s&1;for(s=4;s<8;s++)for(a=24;a>=0;a-=8)o<<=1,o|=e>>>a+s&1,o<<=1,o|=t>>>a+s&1;r[i+0]=n>>>0,r[i+1]=o>>>0},e.pc1=function(t,e,r,i){for(var n=0,o=0,s=7;s>=5;s--){for(var a=0;a<=24;a+=8)n<<=1,n|=e>>a+s&1;for(a=0;a<=24;a+=8)n<<=1,n|=t>>a+s&1}for(a=0;a<=24;a+=8)n<<=1,n|=e>>a+s&1;for(s=1;s<=3;s++){for(a=0;a<=24;a+=8)o<<=1,o|=e>>a+s&1;for(a=0;a<=24;a+=8)o<<=1,o|=t>>a+s&1}for(a=0;a<=24;a+=8)o<<=1,o|=t>>a+s&1;r[i+0]=n>>>0,r[i+1]=o>>>0},e.r28shl=function(t,e){return t<<e&268435455|t>>>28-e};var r=[14,11,17,4,27,23,25,0,13,22,7,18,5,9,16,24,2,20,12,21,1,8,15,26,15,4,25,19,9,1,26,16,5,11,23,8,12,7,17,0,22,3,10,14,6,20,27,24];e.pc2=function(t,e,i,n){for(var o=0,s=0,a=r.length>>>1,u=0;u<a;u++)o<<=1,o|=t>>>r[u]&1;for(u=a;u<r.length;u++)s<<=1,s|=e>>>r[u]&1;i[n+0]=o>>>0,i[n+1]=s>>>0},e.expand=function(t,e,r){var i=0,n=0;i=(1&t)<<5|t>>>27;for(var o=23;o>=15;o-=4)i<<=6,i|=t>>>o&63;for(o=11;o>=3;o-=4)n|=t>>>o&63,n<<=6;n|=(31&t)<<1|t>>>31,e[r+0]=i>>>0,e[r+1]=n>>>0};var i=[14,0,4,15,13,7,1,4,2,14,15,2,11,13,8,1,3,10,10,6,6,12,12,11,5,9,9,5,0,3,7,8,4,15,1,12,14,8,8,2,13,4,6,9,2,1,11,7,15,5,12,11,9,3,7,14,3,10,10,0,5,6,0,13,15,3,1,13,8,4,14,7,6,15,11,2,3,8,4,14,9,12,7,0,2,1,13,10,12,6,0,9,5,11,10,5,0,13,14,8,7,10,11,1,10,3,4,15,13,4,1,2,5,11,8,6,12,7,6,12,9,0,3,5,2,14,15,9,10,13,0,7,9,0,14,9,6,3,3,4,15,6,5,10,1,2,13,8,12,5,7,14,11,12,4,11,2,15,8,1,13,1,6,10,4,13,9,0,8,6,15,9,3,8,0,7,11,4,1,15,2,14,12,3,5,11,10,5,14,2,7,12,7,13,13,8,14,11,3,5,0,6,6,15,9,0,10,3,1,4,2,7,8,2,5,12,11,1,12,10,4,14,15,9,10,3,6,15,9,0,0,6,12,10,11,1,7,13,13,8,15,9,1,4,3,5,14,11,5,12,2,7,8,2,4,14,2,14,12,11,4,2,1,12,7,4,10,7,11,13,6,1,8,5,5,0,3,15,15,10,13,3,0,9,14,8,9,6,4,11,2,8,1,12,11,7,10,1,13,14,7,2,8,13,15,6,9,15,12,0,5,9,6,10,3,4,0,5,14,3,12,10,1,15,10,4,15,2,9,7,2,12,6,9,8,5,0,6,13,1,3,13,4,14,14,0,7,11,5,3,11,8,9,4,14,3,15,2,5,12,2,9,8,5,12,15,3,10,7,11,0,14,4,1,10,7,1,6,13,0,11,8,6,13,4,13,11,0,2,11,14,7,15,4,0,9,8,1,13,10,3,14,12,3,9,5,7,12,5,2,10,15,6,8,1,6,1,6,4,11,11,13,13,8,12,1,3,4,7,10,14,7,10,9,15,5,6,0,8,15,0,14,5,2,9,3,2,12,13,1,2,15,8,13,4,8,6,10,15,3,11,7,1,4,10,12,9,5,3,6,14,11,5,0,0,14,12,9,7,2,7,2,11,1,4,14,1,7,9,4,12,10,14,8,2,13,0,15,6,12,10,9,13,0,15,3,3,5,5,6,8,11];e.substitute=function(t,e){for(var r=0,n=0;n<4;n++)r<<=4,r|=i[64*n+(t>>>18-6*n&63)];for(n=0;n<4;n++)r<<=4,r|=i[256+64*n+(e>>>18-6*n&63)];return r>>>0};var n=[16,25,12,11,3,20,4,15,31,17,9,6,27,14,1,22,30,24,8,18,0,5,29,23,13,19,2,26,10,21,28,7];e.permute=function(t){for(var e=0,r=0;r<n.length;r++)e<<=1,e|=t>>>n[r]&1;return e>>>0},e.padSplit=function(t,e,r){for(var i=t.toString(2);i.length<e;)i="0"+i;for(var n=[],o=0;o<e;o+=r)n.push(i.slice(o,o+r));return n.join(" ")}},62607:(t,e,r)=>{var i=r(43590),n=r(61930),o=r(57426),s={binary:!0,hex:!0,base64:!0};e.DiffieHellmanGroup=e.createDiffieHellmanGroup=e.getDiffieHellman=function(t){var e=new Buffer(n[t].prime,"hex"),r=new Buffer(n[t].gen,"hex");return new o(e,r)},e.createDiffieHellman=e.DiffieHellman=function t(e,r,n,a){return Buffer.isBuffer(r)||void 0===s[r]?t(e,"binary",r,n):(r=r||"binary",a=a||"binary",n=n||new Buffer([2]),Buffer.isBuffer(n)||(n=new Buffer(n,a)),"number"==typeof e?new o(i(e,n),n,!0):(Buffer.isBuffer(e)||(e=new Buffer(e,r)),new o(e,n,!0)))}},57426:(t,e,r)=>{var i=r(83620),n=new(r(63047)),o=new i(24),s=new i(11),a=new i(10),u=new i(3),h=new i(7),c=r(43590),f=r(61798);function l(t,e){return e=e||"utf8",Buffer.isBuffer(t)||(t=new Buffer(t,e)),this._pub=new i(t),this}function d(t,e){return e=e||"utf8",Buffer.isBuffer(t)||(t=new Buffer(t,e)),this._priv=new i(t),this}t.exports=g;var p={};function g(t,e,r){this.setGenerator(e),this.__prime=new i(t),this._prime=i.mont(this.__prime),this._primeLen=t.length,this._pub=void 0,this._priv=void 0,this._primeCode=void 0,r?(this.setPublicKey=l,this.setPrivateKey=d):this._primeCode=8}function y(t,e){var r=new Buffer(t.toArray());return e?r.toString(e):r}Object.defineProperty(g.prototype,"verifyError",{enumerable:!0,get:function(){return"number"!=typeof this._primeCode&&(this._primeCode=function(t,e){var r=e.toString("hex"),i=[r,t.toString(16)].join("_");if(i in p)return p[i];var f,l=0;if(t.isEven()||!c.simpleSieve||!c.fermatTest(t)||!n.test(t))return l+=1,l+="02"===r||"05"===r?8:4,p[i]=l,l;switch(n.test(t.shrn(1))||(l+=2),r){case"02":t.mod(o).cmp(s)&&(l+=8);break;case"05":(f=t.mod(a)).cmp(u)&&f.cmp(h)&&(l+=8);break;default:l+=4}return p[i]=l,l}(this.__prime,this.__gen)),this._primeCode}}),g.prototype.generateKeys=function(){return this._priv||(this._priv=new i(f(this._primeLen))),this._pub=this._gen.toRed(this._prime).redPow(this._priv).fromRed(),this.getPublicKey()},g.prototype.computeSecret=function(t){var e=(t=(t=new i(t)).toRed(this._prime)).redPow(this._priv).fromRed(),r=new Buffer(e.toArray()),n=this.getPrime();if(r.length<n.length){var o=new Buffer(n.length-r.length);o.fill(0),r=Buffer.concat([o,r])}return r},g.prototype.getPublicKey=function(t){return y(this._pub,t)},g.prototype.getPrivateKey=function(t){return y(this._priv,t)},g.prototype.getPrime=function(t){return y(this.__prime,t)},g.prototype.getGenerator=function(t){return y(this._gen,t)},g.prototype.setGenerator=function(t,e){return e=e||"utf8",Buffer.isBuffer(t)||(t=new Buffer(t,e)),this.__gen=t,this._gen=new i(t),this}},43590:(t,e,r)=>{var i=r(61798);t.exports=v,v.simpleSieve=y,v.fermatTest=m;var n=r(83620),o=new n(24),s=new(r(63047)),a=new n(1),u=new n(2),h=new n(5),c=(new n(16),new n(8),new n(10)),f=new n(3),l=(new n(7),new n(11)),d=new n(4),p=(new n(12),null);function g(){if(null!==p)return p;var t=[];t[0]=2;for(var e=1,r=3;r<1048576;r+=2){for(var i=Math.ceil(Math.sqrt(r)),n=0;n<e&&t[n]<=i&&r%t[n]!=0;n++);e!==n&&t[n]<=i||(t[e++]=r)}return p=t,t}function y(t){for(var e=g(),r=0;r<e.length;r++)if(0===t.modn(e[r]))return 0===t.cmpn(e[r]);return!0}function m(t){var e=n.mont(t);return 0===u.toRed(e).redPow(t.subn(1)).fromRed().cmpn(1)}function v(t,e){if(t<16)return new n(2===e||5===e?[140,123]:[140,39]);var r,p;for(e=new n(e);;){for(r=new n(i(Math.ceil(t/8)));r.bitLength()>t;)r.ishrn(1);if(r.isEven()&&r.iadd(a),r.testn(1)||r.iadd(u),e.cmp(u)){if(!e.cmp(h))for(;r.mod(c).cmp(f);)r.iadd(d)}else for(;r.mod(o).cmp(l);)r.iadd(d);if(y(p=r.shrn(1))&&y(r)&&m(p)&&m(r)&&s.test(p)&&s.test(r))return r}}},61930:t=>{"use strict";t.exports=JSON.parse('{"modp1":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a63a3620ffffffffffffffff"},"modp2":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece65381ffffffffffffffff"},"modp5":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca237327ffffffffffffffff"},"modp14":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aacaa68ffffffffffffffff"},"modp15":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a93ad2caffffffffffffffff"},"modp16":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c934063199ffffffffffffffff"},"modp17":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dcc4024ffffffffffffffff"},"modp18":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dbe115974a3926f12fee5e438777cb6a932df8cd8bec4d073b931ba3bc832b68d9dd300741fa7bf8afc47ed2576f6936ba424663aab639c5ae4f5683423b4742bf1c978238f16cbe39d652de3fdb8befc848ad922222e04a4037c0713eb57a81a23f0c73473fc646cea306b4bcbc8862f8385ddfa9d4b7fa2c087e879683303ed5bdd3a062b3cf5b3a278a66d2a13f83f44f82ddf310ee074ab6a364597e899a0255dc164f31cc50846851df9ab48195ded7ea1b1d510bd7ee74d73faf36bc31ecfa268359046f4eb879f924009438b481c6cd7889a002ed5ee382bc9190da6fc026e479558e4475677e9aa9e3050e2765694dfc81f56e880b96e7160c980dd98edd3dfffffffffffffffff"}}')},83620:function(t,e,r){!function(t,e){"use strict";function i(t,e){if(!t)throw new Error(e||"Assertion failed")}function n(t,e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}function o(t,e,r){if(o.isBN(t))return t;this.negative=0,this.words=null,this.length=0,this.red=null,null!==t&&("le"!==e&&"be"!==e||(r=e,e=10),this._init(t||0,e||10,r||"be"))}var s;"object"==typeof t?t.exports=o:e.BN=o,o.BN=o,o.wordSize=26;try{s=r(32574).Buffer}catch(t){}function a(t,e,r){for(var i=0,n=Math.min(t.length,r),o=e;o<n;o++){var s=t.charCodeAt(o)-48;i<<=4,i|=s>=49&&s<=54?s-49+10:s>=17&&s<=22?s-17+10:15&s}return i}function u(t,e,r,i){for(var n=0,o=Math.min(t.length,r),s=e;s<o;s++){var a=t.charCodeAt(s)-48;n*=i,n+=a>=49?a-49+10:a>=17?a-17+10:a}return n}o.isBN=function(t){return t instanceof o||null!==t&&"object"==typeof t&&t.constructor.wordSize===o.wordSize&&Array.isArray(t.words)},o.max=function(t,e){return t.cmp(e)>0?t:e},o.min=function(t,e){return t.cmp(e)<0?t:e},o.prototype._init=function(t,e,r){if("number"==typeof t)return this._initNumber(t,e,r);if("object"==typeof t)return this._initArray(t,e,r);"hex"===e&&(e=16),i(e===(0|e)&&e>=2&&e<=36);var n=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&n++,16===e?this._parseHex(t,n):this._parseBase(t,e,n),"-"===t[0]&&(this.negative=1),this.strip(),"le"===r&&this._initArray(this.toArray(),e,r)},o.prototype._initNumber=function(t,e,r){t<0&&(this.negative=1,t=-t),t<67108864?(this.words=[67108863&t],this.length=1):t<4503599627370496?(this.words=[67108863&t,t/67108864&67108863],this.length=2):(i(t<9007199254740992),this.words=[67108863&t,t/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),e,r)},o.prototype._initArray=function(t,e,r){if(i("number"==typeof t.length),t.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(t.length/3),this.words=new Array(this.length);for(var n=0;n<this.length;n++)this.words[n]=0;var o,s,a=0;if("be"===r)for(n=t.length-1,o=0;n>=0;n-=3)s=t[n]|t[n-1]<<8|t[n-2]<<16,this.words[o]|=s<<a&67108863,this.words[o+1]=s>>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);else if("le"===r)for(n=0,o=0;n<t.length;n+=3)s=t[n]|t[n+1]<<8|t[n+2]<<16,this.words[o]|=s<<a&67108863,this.words[o+1]=s>>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);return this.strip()},o.prototype._parseHex=function(t,e){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var r=0;r<this.length;r++)this.words[r]=0;var i,n,o=0;for(r=t.length-6,i=0;r>=e;r-=6)n=a(t,r,r+6),this.words[i]|=n<<o&67108863,this.words[i+1]|=n>>>26-o&4194303,(o+=24)>=26&&(o-=26,i++);r+6!==e&&(n=a(t,e,r+6),this.words[i]|=n<<o&67108863,this.words[i+1]|=n>>>26-o&4194303),this.strip()},o.prototype._parseBase=function(t,e,r){this.words=[0],this.length=1;for(var i=0,n=1;n<=67108863;n*=e)i++;i--,n=n/e|0;for(var o=t.length-r,s=o%i,a=Math.min(o,o-s)+r,h=0,c=r;c<a;c+=i)h=u(t,c,c+i,e),this.imuln(n),this.words[0]+h<67108864?this.words[0]+=h:this._iaddn(h);if(0!==s){var f=1;for(h=u(t,c,t.length,e),c=0;c<s;c++)f*=e;this.imuln(f),this.words[0]+h<67108864?this.words[0]+=h:this._iaddn(h)}},o.prototype.copy=function(t){t.words=new Array(this.length);for(var e=0;e<this.length;e++)t.words[e]=this.words[e];t.length=this.length,t.negative=this.negative,t.red=this.red},o.prototype.clone=function(){var t=new o(null);return this.copy(t),t},o.prototype._expand=function(t){for(;this.length<t;)this.words[this.length++]=0;return this},o.prototype.strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},o.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},o.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var h=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],c=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],f=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function l(t,e,r){r.negative=e.negative^t.negative;var i=t.length+e.length|0;r.length=i,i=i-1|0;var n=0|t.words[0],o=0|e.words[0],s=n*o,a=67108863&s,u=s/67108864|0;r.words[0]=a;for(var h=1;h<i;h++){for(var c=u>>>26,f=67108863&u,l=Math.min(h,e.length-1),d=Math.max(0,h-t.length+1);d<=l;d++){var p=h-d|0;c+=(s=(n=0|t.words[p])*(o=0|e.words[d])+f)/67108864|0,f=67108863&s}r.words[h]=0|f,u=0|c}return 0!==u?r.words[h]=0|u:r.length--,r.strip()}o.prototype.toString=function(t,e){var r;if(e=0|e||1,16===(t=t||10)||"hex"===t){r="";for(var n=0,o=0,s=0;s<this.length;s++){var a=this.words[s],u=(16777215&(a<<n|o)).toString(16);r=0!=(o=a>>>24-n&16777215)||s!==this.length-1?h[6-u.length]+u+r:u+r,(n+=2)>=26&&(n-=26,s--)}for(0!==o&&(r=o.toString(16)+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(t===(0|t)&&t>=2&&t<=36){var l=c[t],d=f[t];r="";var p=this.clone();for(p.negative=0;!p.isZero();){var g=p.modn(d).toString(t);r=(p=p.idivn(d)).isZero()?g+r:h[l-g.length]+g+r}for(this.isZero()&&(r="0"+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}i(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:this.length>2&&i(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},o.prototype.toJSON=function(){return this.toString(16)},o.prototype.toBuffer=function(t,e){return i(void 0!==s),this.toArrayLike(s,t,e)},o.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)},o.prototype.toArrayLike=function(t,e,r){var n=this.byteLength(),o=r||Math.max(1,n);i(n<=o,"byte array longer than desired length"),i(o>0,"Requested array length <= 0"),this.strip();var s,a,u="le"===e,h=new t(o),c=this.clone();if(u){for(a=0;!c.isZero();a++)s=c.andln(255),c.iushrn(8),h[a]=s;for(;a<o;a++)h[a]=0}else{for(a=0;a<o-n;a++)h[a]=0;for(a=0;!c.isZero();a++)s=c.andln(255),c.iushrn(8),h[o-a-1]=s}return h},Math.clz32?o.prototype._countBits=function(t){return 32-Math.clz32(t)}:o.prototype._countBits=function(t){var e=t,r=0;return e>=4096&&(r+=13,e>>>=13),e>=64&&(r+=7,e>>>=7),e>=8&&(r+=4,e>>>=4),e>=2&&(r+=2,e>>>=2),r+e},o.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,r=0;return 0==(8191&e)&&(r+=13,e>>>=13),0==(127&e)&&(r+=7,e>>>=7),0==(15&e)&&(r+=4,e>>>=4),0==(3&e)&&(r+=2,e>>>=2),0==(1&e)&&r++,r},o.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;e<this.length;e++){var r=this._zeroBits(this.words[e]);if(t+=r,26!==r)break}return t},o.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},o.prototype.toTwos=function(t){return 0!==this.negative?this.abs().inotn(t).iaddn(1):this.clone()},o.prototype.fromTwos=function(t){return this.testn(t-1)?this.notn(t).iaddn(1).ineg():this.clone()},o.prototype.isNeg=function(){return 0!==this.negative},o.prototype.neg=function(){return this.clone().ineg()},o.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},o.prototype.iuor=function(t){for(;this.length<t.length;)this.words[this.length++]=0;for(var e=0;e<t.length;e++)this.words[e]=this.words[e]|t.words[e];return this.strip()},o.prototype.ior=function(t){return i(0==(this.negative|t.negative)),this.iuor(t)},o.prototype.or=function(t){return this.length>t.length?this.clone().ior(t):t.clone().ior(this)},o.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},o.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var r=0;r<e.length;r++)this.words[r]=this.words[r]&t.words[r];return this.length=e.length,this.strip()},o.prototype.iand=function(t){return i(0==(this.negative|t.negative)),this.iuand(t)},o.prototype.and=function(t){return this.length>t.length?this.clone().iand(t):t.clone().iand(this)},o.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},o.prototype.iuxor=function(t){var e,r;this.length>t.length?(e=this,r=t):(e=t,r=this);for(var i=0;i<r.length;i++)this.words[i]=e.words[i]^r.words[i];if(this!==e)for(;i<e.length;i++)this.words[i]=e.words[i];return this.length=e.length,this.strip()},o.prototype.ixor=function(t){return i(0==(this.negative|t.negative)),this.iuxor(t)},o.prototype.xor=function(t){return this.length>t.length?this.clone().ixor(t):t.clone().ixor(this)},o.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},o.prototype.inotn=function(t){i("number"==typeof t&&t>=0);var e=0|Math.ceil(t/26),r=t%26;this._expand(e),r>0&&e--;for(var n=0;n<e;n++)this.words[n]=67108863&~this.words[n];return r>0&&(this.words[n]=~this.words[n]&67108863>>26-r),this.strip()},o.prototype.notn=function(t){return this.clone().inotn(t)},o.prototype.setn=function(t,e){i("number"==typeof t&&t>=0);var r=t/26|0,n=t%26;return this._expand(r+1),this.words[r]=e?this.words[r]|1<<n:this.words[r]&~(1<<n),this.strip()},o.prototype.iadd=function(t){var e,r,i;if(0!==this.negative&&0===t.negative)return this.negative=0,e=this.isub(t),this.negative^=1,this._normSign();if(0===this.negative&&0!==t.negative)return t.negative=0,e=this.isub(t),t.negative=1,e._normSign();this.length>t.length?(r=this,i=t):(r=t,i=this);for(var n=0,o=0;o<i.length;o++)e=(0|r.words[o])+(0|i.words[o])+n,this.words[o]=67108863&e,n=e>>>26;for(;0!==n&&o<r.length;o++)e=(0|r.words[o])+n,this.words[o]=67108863&e,n=e>>>26;if(this.length=r.length,0!==n)this.words[this.length]=n,this.length++;else if(r!==this)for(;o<r.length;o++)this.words[o]=r.words[o];return this},o.prototype.add=function(t){var e;return 0!==t.negative&&0===this.negative?(t.negative=0,e=this.sub(t),t.negative^=1,e):0===t.negative&&0!==this.negative?(this.negative=0,e=t.sub(this),this.negative=1,e):this.length>t.length?this.clone().iadd(t):t.clone().iadd(this)},o.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e=this.iadd(t);return t.negative=1,e._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var r,i,n=this.cmp(t);if(0===n)return this.negative=0,this.length=1,this.words[0]=0,this;n>0?(r=this,i=t):(r=t,i=this);for(var o=0,s=0;s<i.length;s++)o=(e=(0|r.words[s])-(0|i.words[s])+o)>>26,this.words[s]=67108863&e;for(;0!==o&&s<r.length;s++)o=(e=(0|r.words[s])+o)>>26,this.words[s]=67108863&e;if(0===o&&s<r.length&&r!==this)for(;s<r.length;s++)this.words[s]=r.words[s];return this.length=Math.max(this.length,s),r!==this&&(this.negative=1),this.strip()},o.prototype.sub=function(t){return this.clone().isub(t)};var d=function(t,e,r){var i,n,o,s=t.words,a=e.words,u=r.words,h=0,c=0|s[0],f=8191&c,l=c>>>13,d=0|s[1],p=8191&d,g=d>>>13,y=0|s[2],m=8191&y,v=y>>>13,b=0|s[3],w=8191&b,_=b>>>13,S=0|s[4],E=8191&S,M=S>>>13,A=0|s[5],C=8191&A,k=A>>>13,I=0|s[6],T=8191&I,R=I>>>13,B=0|s[7],x=8191&B,F=B>>>13,P=0|s[8],N=8191&P,O=P>>>13,L=0|s[9],U=8191&L,j=L>>>13,D=0|a[0],K=8191&D,V=D>>>13,H=0|a[1],q=8191&H,z=H>>>13,W=0|a[2],G=8191&W,J=W>>>13,Z=0|a[3],$=8191&Z,Y=Z>>>13,Q=0|a[4],X=8191&Q,tt=Q>>>13,et=0|a[5],rt=8191&et,it=et>>>13,nt=0|a[6],ot=8191&nt,st=nt>>>13,at=0|a[7],ut=8191&at,ht=at>>>13,ct=0|a[8],ft=8191&ct,lt=ct>>>13,dt=0|a[9],pt=8191&dt,gt=dt>>>13;r.negative=t.negative^e.negative,r.length=19;var yt=(h+(i=Math.imul(f,K))|0)+((8191&(n=(n=Math.imul(f,V))+Math.imul(l,K)|0))<<13)|0;h=((o=Math.imul(l,V))+(n>>>13)|0)+(yt>>>26)|0,yt&=67108863,i=Math.imul(p,K),n=(n=Math.imul(p,V))+Math.imul(g,K)|0,o=Math.imul(g,V);var mt=(h+(i=i+Math.imul(f,q)|0)|0)+((8191&(n=(n=n+Math.imul(f,z)|0)+Math.imul(l,q)|0))<<13)|0;h=((o=o+Math.imul(l,z)|0)+(n>>>13)|0)+(mt>>>26)|0,mt&=67108863,i=Math.imul(m,K),n=(n=Math.imul(m,V))+Math.imul(v,K)|0,o=Math.imul(v,V),i=i+Math.imul(p,q)|0,n=(n=n+Math.imul(p,z)|0)+Math.imul(g,q)|0,o=o+Math.imul(g,z)|0;var vt=(h+(i=i+Math.imul(f,G)|0)|0)+((8191&(n=(n=n+Math.imul(f,J)|0)+Math.imul(l,G)|0))<<13)|0;h=((o=o+Math.imul(l,J)|0)+(n>>>13)|0)+(vt>>>26)|0,vt&=67108863,i=Math.imul(w,K),n=(n=Math.imul(w,V))+Math.imul(_,K)|0,o=Math.imul(_,V),i=i+Math.imul(m,q)|0,n=(n=n+Math.imul(m,z)|0)+Math.imul(v,q)|0,o=o+Math.imul(v,z)|0,i=i+Math.imul(p,G)|0,n=(n=n+Math.imul(p,J)|0)+Math.imul(g,G)|0,o=o+Math.imul(g,J)|0;var bt=(h+(i=i+Math.imul(f,$)|0)|0)+((8191&(n=(n=n+Math.imul(f,Y)|0)+Math.imul(l,$)|0))<<13)|0;h=((o=o+Math.imul(l,Y)|0)+(n>>>13)|0)+(bt>>>26)|0,bt&=67108863,i=Math.imul(E,K),n=(n=Math.imul(E,V))+Math.imul(M,K)|0,o=Math.imul(M,V),i=i+Math.imul(w,q)|0,n=(n=n+Math.imul(w,z)|0)+Math.imul(_,q)|0,o=o+Math.imul(_,z)|0,i=i+Math.imul(m,G)|0,n=(n=n+Math.imul(m,J)|0)+Math.imul(v,G)|0,o=o+Math.imul(v,J)|0,i=i+Math.imul(p,$)|0,n=(n=n+Math.imul(p,Y)|0)+Math.imul(g,$)|0,o=o+Math.imul(g,Y)|0;var wt=(h+(i=i+Math.imul(f,X)|0)|0)+((8191&(n=(n=n+Math.imul(f,tt)|0)+Math.imul(l,X)|0))<<13)|0;h=((o=o+Math.imul(l,tt)|0)+(n>>>13)|0)+(wt>>>26)|0,wt&=67108863,i=Math.imul(C,K),n=(n=Math.imul(C,V))+Math.imul(k,K)|0,o=Math.imul(k,V),i=i+Math.imul(E,q)|0,n=(n=n+Math.imul(E,z)|0)+Math.imul(M,q)|0,o=o+Math.imul(M,z)|0,i=i+Math.imul(w,G)|0,n=(n=n+Math.imul(w,J)|0)+Math.imul(_,G)|0,o=o+Math.imul(_,J)|0,i=i+Math.imul(m,$)|0,n=(n=n+Math.imul(m,Y)|0)+Math.imul(v,$)|0,o=o+Math.imul(v,Y)|0,i=i+Math.imul(p,X)|0,n=(n=n+Math.imul(p,tt)|0)+Math.imul(g,X)|0,o=o+Math.imul(g,tt)|0;var _t=(h+(i=i+Math.imul(f,rt)|0)|0)+((8191&(n=(n=n+Math.imul(f,it)|0)+Math.imul(l,rt)|0))<<13)|0;h=((o=o+Math.imul(l,it)|0)+(n>>>13)|0)+(_t>>>26)|0,_t&=67108863,i=Math.imul(T,K),n=(n=Math.imul(T,V))+Math.imul(R,K)|0,o=Math.imul(R,V),i=i+Math.imul(C,q)|0,n=(n=n+Math.imul(C,z)|0)+Math.imul(k,q)|0,o=o+Math.imul(k,z)|0,i=i+Math.imul(E,G)|0,n=(n=n+Math.imul(E,J)|0)+Math.imul(M,G)|0,o=o+Math.imul(M,J)|0,i=i+Math.imul(w,$)|0,n=(n=n+Math.imul(w,Y)|0)+Math.imul(_,$)|0,o=o+Math.imul(_,Y)|0,i=i+Math.imul(m,X)|0,n=(n=n+Math.imul(m,tt)|0)+Math.imul(v,X)|0,o=o+Math.imul(v,tt)|0,i=i+Math.imul(p,rt)|0,n=(n=n+Math.imul(p,it)|0)+Math.imul(g,rt)|0,o=o+Math.imul(g,it)|0;var St=(h+(i=i+Math.imul(f,ot)|0)|0)+((8191&(n=(n=n+Math.imul(f,st)|0)+Math.imul(l,ot)|0))<<13)|0;h=((o=o+Math.imul(l,st)|0)+(n>>>13)|0)+(St>>>26)|0,St&=67108863,i=Math.imul(x,K),n=(n=Math.imul(x,V))+Math.imul(F,K)|0,o=Math.imul(F,V),i=i+Math.imul(T,q)|0,n=(n=n+Math.imul(T,z)|0)+Math.imul(R,q)|0,o=o+Math.imul(R,z)|0,i=i+Math.imul(C,G)|0,n=(n=n+Math.imul(C,J)|0)+Math.imul(k,G)|0,o=o+Math.imul(k,J)|0,i=i+Math.imul(E,$)|0,n=(n=n+Math.imul(E,Y)|0)+Math.imul(M,$)|0,o=o+Math.imul(M,Y)|0,i=i+Math.imul(w,X)|0,n=(n=n+Math.imul(w,tt)|0)+Math.imul(_,X)|0,o=o+Math.imul(_,tt)|0,i=i+Math.imul(m,rt)|0,n=(n=n+Math.imul(m,it)|0)+Math.imul(v,rt)|0,o=o+Math.imul(v,it)|0,i=i+Math.imul(p,ot)|0,n=(n=n+Math.imul(p,st)|0)+Math.imul(g,ot)|0,o=o+Math.imul(g,st)|0;var Et=(h+(i=i+Math.imul(f,ut)|0)|0)+((8191&(n=(n=n+Math.imul(f,ht)|0)+Math.imul(l,ut)|0))<<13)|0;h=((o=o+Math.imul(l,ht)|0)+(n>>>13)|0)+(Et>>>26)|0,Et&=67108863,i=Math.imul(N,K),n=(n=Math.imul(N,V))+Math.imul(O,K)|0,o=Math.imul(O,V),i=i+Math.imul(x,q)|0,n=(n=n+Math.imul(x,z)|0)+Math.imul(F,q)|0,o=o+Math.imul(F,z)|0,i=i+Math.imul(T,G)|0,n=(n=n+Math.imul(T,J)|0)+Math.imul(R,G)|0,o=o+Math.imul(R,J)|0,i=i+Math.imul(C,$)|0,n=(n=n+Math.imul(C,Y)|0)+Math.imul(k,$)|0,o=o+Math.imul(k,Y)|0,i=i+Math.imul(E,X)|0,n=(n=n+Math.imul(E,tt)|0)+Math.imul(M,X)|0,o=o+Math.imul(M,tt)|0,i=i+Math.imul(w,rt)|0,n=(n=n+Math.imul(w,it)|0)+Math.imul(_,rt)|0,o=o+Math.imul(_,it)|0,i=i+Math.imul(m,ot)|0,n=(n=n+Math.imul(m,st)|0)+Math.imul(v,ot)|0,o=o+Math.imul(v,st)|0,i=i+Math.imul(p,ut)|0,n=(n=n+Math.imul(p,ht)|0)+Math.imul(g,ut)|0,o=o+Math.imul(g,ht)|0;var Mt=(h+(i=i+Math.imul(f,ft)|0)|0)+((8191&(n=(n=n+Math.imul(f,lt)|0)+Math.imul(l,ft)|0))<<13)|0;h=((o=o+Math.imul(l,lt)|0)+(n>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,i=Math.imul(U,K),n=(n=Math.imul(U,V))+Math.imul(j,K)|0,o=Math.imul(j,V),i=i+Math.imul(N,q)|0,n=(n=n+Math.imul(N,z)|0)+Math.imul(O,q)|0,o=o+Math.imul(O,z)|0,i=i+Math.imul(x,G)|0,n=(n=n+Math.imul(x,J)|0)+Math.imul(F,G)|0,o=o+Math.imul(F,J)|0,i=i+Math.imul(T,$)|0,n=(n=n+Math.imul(T,Y)|0)+Math.imul(R,$)|0,o=o+Math.imul(R,Y)|0,i=i+Math.imul(C,X)|0,n=(n=n+Math.imul(C,tt)|0)+Math.imul(k,X)|0,o=o+Math.imul(k,tt)|0,i=i+Math.imul(E,rt)|0,n=(n=n+Math.imul(E,it)|0)+Math.imul(M,rt)|0,o=o+Math.imul(M,it)|0,i=i+Math.imul(w,ot)|0,n=(n=n+Math.imul(w,st)|0)+Math.imul(_,ot)|0,o=o+Math.imul(_,st)|0,i=i+Math.imul(m,ut)|0,n=(n=n+Math.imul(m,ht)|0)+Math.imul(v,ut)|0,o=o+Math.imul(v,ht)|0,i=i+Math.imul(p,ft)|0,n=(n=n+Math.imul(p,lt)|0)+Math.imul(g,ft)|0,o=o+Math.imul(g,lt)|0;var At=(h+(i=i+Math.imul(f,pt)|0)|0)+((8191&(n=(n=n+Math.imul(f,gt)|0)+Math.imul(l,pt)|0))<<13)|0;h=((o=o+Math.imul(l,gt)|0)+(n>>>13)|0)+(At>>>26)|0,At&=67108863,i=Math.imul(U,q),n=(n=Math.imul(U,z))+Math.imul(j,q)|0,o=Math.imul(j,z),i=i+Math.imul(N,G)|0,n=(n=n+Math.imul(N,J)|0)+Math.imul(O,G)|0,o=o+Math.imul(O,J)|0,i=i+Math.imul(x,$)|0,n=(n=n+Math.imul(x,Y)|0)+Math.imul(F,$)|0,o=o+Math.imul(F,Y)|0,i=i+Math.imul(T,X)|0,n=(n=n+Math.imul(T,tt)|0)+Math.imul(R,X)|0,o=o+Math.imul(R,tt)|0,i=i+Math.imul(C,rt)|0,n=(n=n+Math.imul(C,it)|0)+Math.imul(k,rt)|0,o=o+Math.imul(k,it)|0,i=i+Math.imul(E,ot)|0,n=(n=n+Math.imul(E,st)|0)+Math.imul(M,ot)|0,o=o+Math.imul(M,st)|0,i=i+Math.imul(w,ut)|0,n=(n=n+Math.imul(w,ht)|0)+Math.imul(_,ut)|0,o=o+Math.imul(_,ht)|0,i=i+Math.imul(m,ft)|0,n=(n=n+Math.imul(m,lt)|0)+Math.imul(v,ft)|0,o=o+Math.imul(v,lt)|0;var Ct=(h+(i=i+Math.imul(p,pt)|0)|0)+((8191&(n=(n=n+Math.imul(p,gt)|0)+Math.imul(g,pt)|0))<<13)|0;h=((o=o+Math.imul(g,gt)|0)+(n>>>13)|0)+(Ct>>>26)|0,Ct&=67108863,i=Math.imul(U,G),n=(n=Math.imul(U,J))+Math.imul(j,G)|0,o=Math.imul(j,J),i=i+Math.imul(N,$)|0,n=(n=n+Math.imul(N,Y)|0)+Math.imul(O,$)|0,o=o+Math.imul(O,Y)|0,i=i+Math.imul(x,X)|0,n=(n=n+Math.imul(x,tt)|0)+Math.imul(F,X)|0,o=o+Math.imul(F,tt)|0,i=i+Math.imul(T,rt)|0,n=(n=n+Math.imul(T,it)|0)+Math.imul(R,rt)|0,o=o+Math.imul(R,it)|0,i=i+Math.imul(C,ot)|0,n=(n=n+Math.imul(C,st)|0)+Math.imul(k,ot)|0,o=o+Math.imul(k,st)|0,i=i+Math.imul(E,ut)|0,n=(n=n+Math.imul(E,ht)|0)+Math.imul(M,ut)|0,o=o+Math.imul(M,ht)|0,i=i+Math.imul(w,ft)|0,n=(n=n+Math.imul(w,lt)|0)+Math.imul(_,ft)|0,o=o+Math.imul(_,lt)|0;var kt=(h+(i=i+Math.imul(m,pt)|0)|0)+((8191&(n=(n=n+Math.imul(m,gt)|0)+Math.imul(v,pt)|0))<<13)|0;h=((o=o+Math.imul(v,gt)|0)+(n>>>13)|0)+(kt>>>26)|0,kt&=67108863,i=Math.imul(U,$),n=(n=Math.imul(U,Y))+Math.imul(j,$)|0,o=Math.imul(j,Y),i=i+Math.imul(N,X)|0,n=(n=n+Math.imul(N,tt)|0)+Math.imul(O,X)|0,o=o+Math.imul(O,tt)|0,i=i+Math.imul(x,rt)|0,n=(n=n+Math.imul(x,it)|0)+Math.imul(F,rt)|0,o=o+Math.imul(F,it)|0,i=i+Math.imul(T,ot)|0,n=(n=n+Math.imul(T,st)|0)+Math.imul(R,ot)|0,o=o+Math.imul(R,st)|0,i=i+Math.imul(C,ut)|0,n=(n=n+Math.imul(C,ht)|0)+Math.imul(k,ut)|0,o=o+Math.imul(k,ht)|0,i=i+Math.imul(E,ft)|0,n=(n=n+Math.imul(E,lt)|0)+Math.imul(M,ft)|0,o=o+Math.imul(M,lt)|0;var It=(h+(i=i+Math.imul(w,pt)|0)|0)+((8191&(n=(n=n+Math.imul(w,gt)|0)+Math.imul(_,pt)|0))<<13)|0;h=((o=o+Math.imul(_,gt)|0)+(n>>>13)|0)+(It>>>26)|0,It&=67108863,i=Math.imul(U,X),n=(n=Math.imul(U,tt))+Math.imul(j,X)|0,o=Math.imul(j,tt),i=i+Math.imul(N,rt)|0,n=(n=n+Math.imul(N,it)|0)+Math.imul(O,rt)|0,o=o+Math.imul(O,it)|0,i=i+Math.imul(x,ot)|0,n=(n=n+Math.imul(x,st)|0)+Math.imul(F,ot)|0,o=o+Math.imul(F,st)|0,i=i+Math.imul(T,ut)|0,n=(n=n+Math.imul(T,ht)|0)+Math.imul(R,ut)|0,o=o+Math.imul(R,ht)|0,i=i+Math.imul(C,ft)|0,n=(n=n+Math.imul(C,lt)|0)+Math.imul(k,ft)|0,o=o+Math.imul(k,lt)|0;var Tt=(h+(i=i+Math.imul(E,pt)|0)|0)+((8191&(n=(n=n+Math.imul(E,gt)|0)+Math.imul(M,pt)|0))<<13)|0;h=((o=o+Math.imul(M,gt)|0)+(n>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,i=Math.imul(U,rt),n=(n=Math.imul(U,it))+Math.imul(j,rt)|0,o=Math.imul(j,it),i=i+Math.imul(N,ot)|0,n=(n=n+Math.imul(N,st)|0)+Math.imul(O,ot)|0,o=o+Math.imul(O,st)|0,i=i+Math.imul(x,ut)|0,n=(n=n+Math.imul(x,ht)|0)+Math.imul(F,ut)|0,o=o+Math.imul(F,ht)|0,i=i+Math.imul(T,ft)|0,n=(n=n+Math.imul(T,lt)|0)+Math.imul(R,ft)|0,o=o+Math.imul(R,lt)|0;var Rt=(h+(i=i+Math.imul(C,pt)|0)|0)+((8191&(n=(n=n+Math.imul(C,gt)|0)+Math.imul(k,pt)|0))<<13)|0;h=((o=o+Math.imul(k,gt)|0)+(n>>>13)|0)+(Rt>>>26)|0,Rt&=67108863,i=Math.imul(U,ot),n=(n=Math.imul(U,st))+Math.imul(j,ot)|0,o=Math.imul(j,st),i=i+Math.imul(N,ut)|0,n=(n=n+Math.imul(N,ht)|0)+Math.imul(O,ut)|0,o=o+Math.imul(O,ht)|0,i=i+Math.imul(x,ft)|0,n=(n=n+Math.imul(x,lt)|0)+Math.imul(F,ft)|0,o=o+Math.imul(F,lt)|0;var Bt=(h+(i=i+Math.imul(T,pt)|0)|0)+((8191&(n=(n=n+Math.imul(T,gt)|0)+Math.imul(R,pt)|0))<<13)|0;h=((o=o+Math.imul(R,gt)|0)+(n>>>13)|0)+(Bt>>>26)|0,Bt&=67108863,i=Math.imul(U,ut),n=(n=Math.imul(U,ht))+Math.imul(j,ut)|0,o=Math.imul(j,ht),i=i+Math.imul(N,ft)|0,n=(n=n+Math.imul(N,lt)|0)+Math.imul(O,ft)|0,o=o+Math.imul(O,lt)|0;var xt=(h+(i=i+Math.imul(x,pt)|0)|0)+((8191&(n=(n=n+Math.imul(x,gt)|0)+Math.imul(F,pt)|0))<<13)|0;h=((o=o+Math.imul(F,gt)|0)+(n>>>13)|0)+(xt>>>26)|0,xt&=67108863,i=Math.imul(U,ft),n=(n=Math.imul(U,lt))+Math.imul(j,ft)|0,o=Math.imul(j,lt);var Ft=(h+(i=i+Math.imul(N,pt)|0)|0)+((8191&(n=(n=n+Math.imul(N,gt)|0)+Math.imul(O,pt)|0))<<13)|0;h=((o=o+Math.imul(O,gt)|0)+(n>>>13)|0)+(Ft>>>26)|0,Ft&=67108863;var Pt=(h+(i=Math.imul(U,pt))|0)+((8191&(n=(n=Math.imul(U,gt))+Math.imul(j,pt)|0))<<13)|0;return h=((o=Math.imul(j,gt))+(n>>>13)|0)+(Pt>>>26)|0,Pt&=67108863,u[0]=yt,u[1]=mt,u[2]=vt,u[3]=bt,u[4]=wt,u[5]=_t,u[6]=St,u[7]=Et,u[8]=Mt,u[9]=At,u[10]=Ct,u[11]=kt,u[12]=It,u[13]=Tt,u[14]=Rt,u[15]=Bt,u[16]=xt,u[17]=Ft,u[18]=Pt,0!==h&&(u[19]=h,r.length++),r};function p(t,e,r){return(new g).mulp(t,e,r)}function g(t,e){this.x=t,this.y=e}Math.imul||(d=l),o.prototype.mulTo=function(t,e){var r=this.length+t.length;return 10===this.length&&10===t.length?d(this,t,e):r<63?l(this,t,e):r<1024?function(t,e,r){r.negative=e.negative^t.negative,r.length=t.length+e.length;for(var i=0,n=0,o=0;o<r.length-1;o++){var s=n;n=0;for(var a=67108863&i,u=Math.min(o,e.length-1),h=Math.max(0,o-t.length+1);h<=u;h++){var c=o-h,f=(0|t.words[c])*(0|e.words[h]),l=67108863&f;a=67108863&(l=l+a|0),n+=(s=(s=s+(f/67108864|0)|0)+(l>>>26)|0)>>>26,s&=67108863}r.words[o]=a,i=s,s=n}return 0!==i?r.words[o]=i:r.length--,r.strip()}(this,t,e):p(this,t,e)},g.prototype.makeRBT=function(t){for(var e=new Array(t),r=o.prototype._countBits(t)-1,i=0;i<t;i++)e[i]=this.revBin(i,r,t);return e},g.prototype.revBin=function(t,e,r){if(0===t||t===r-1)return t;for(var i=0,n=0;n<e;n++)i|=(1&t)<<e-n-1,t>>=1;return i},g.prototype.permute=function(t,e,r,i,n,o){for(var s=0;s<o;s++)i[s]=e[t[s]],n[s]=r[t[s]]},g.prototype.transform=function(t,e,r,i,n,o){this.permute(o,t,e,r,i,n);for(var s=1;s<n;s<<=1)for(var a=s<<1,u=Math.cos(2*Math.PI/a),h=Math.sin(2*Math.PI/a),c=0;c<n;c+=a)for(var f=u,l=h,d=0;d<s;d++){var p=r[c+d],g=i[c+d],y=r[c+d+s],m=i[c+d+s],v=f*y-l*m;m=f*m+l*y,y=v,r[c+d]=p+y,i[c+d]=g+m,r[c+d+s]=p-y,i[c+d+s]=g-m,d!==a&&(v=u*f-h*l,l=u*l+h*f,f=v)}},g.prototype.guessLen13b=function(t,e){var r=1|Math.max(e,t),i=1&r,n=0;for(r=r/2|0;r;r>>>=1)n++;return 1<<n+1+i},g.prototype.conjugate=function(t,e,r){if(!(r<=1))for(var i=0;i<r/2;i++){var n=t[i];t[i]=t[r-i-1],t[r-i-1]=n,n=e[i],e[i]=-e[r-i-1],e[r-i-1]=-n}},g.prototype.normalize13b=function(t,e){for(var r=0,i=0;i<e/2;i++){var n=8192*Math.round(t[2*i+1]/e)+Math.round(t[2*i]/e)+r;t[i]=67108863&n,r=n<67108864?0:n/67108864|0}return t},g.prototype.convert13b=function(t,e,r,n){for(var o=0,s=0;s<e;s++)o+=0|t[s],r[2*s]=8191&o,o>>>=13,r[2*s+1]=8191&o,o>>>=13;for(s=2*e;s<n;++s)r[s]=0;i(0===o),i(0==(-8192&o))},g.prototype.stub=function(t){for(var e=new Array(t),r=0;r<t;r++)e[r]=0;return e},g.prototype.mulp=function(t,e,r){var i=2*this.guessLen13b(t.length,e.length),n=this.makeRBT(i),o=this.stub(i),s=new Array(i),a=new Array(i),u=new Array(i),h=new Array(i),c=new Array(i),f=new Array(i),l=r.words;l.length=i,this.convert13b(t.words,t.length,s,i),this.convert13b(e.words,e.length,h,i),this.transform(s,o,a,u,i,n),this.transform(h,o,c,f,i,n);for(var d=0;d<i;d++){var p=a[d]*c[d]-u[d]*f[d];u[d]=a[d]*f[d]+u[d]*c[d],a[d]=p}return this.conjugate(a,u,i),this.transform(a,u,l,o,i,n),this.conjugate(l,o,i),this.normalize13b(l,i),r.negative=t.negative^e.negative,r.length=t.length+e.length,r.strip()},o.prototype.mul=function(t){var e=new o(null);return e.words=new Array(this.length+t.length),this.mulTo(t,e)},o.prototype.mulf=function(t){var e=new o(null);return e.words=new Array(this.length+t.length),p(this,t,e)},o.prototype.imul=function(t){return this.clone().mulTo(t,this)},o.prototype.imuln=function(t){i("number"==typeof t),i(t<67108864);for(var e=0,r=0;r<this.length;r++){var n=(0|this.words[r])*t,o=(67108863&n)+(67108863&e);e>>=26,e+=n/67108864|0,e+=o>>>26,this.words[r]=67108863&o}return 0!==e&&(this.words[r]=e,this.length++),this},o.prototype.muln=function(t){return this.clone().imuln(t)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(t){var e=function(t){for(var e=new Array(t.bitLength()),r=0;r<e.length;r++){var i=r/26|0,n=r%26;e[r]=(t.words[i]&1<<n)>>>n}return e}(t);if(0===e.length)return new o(1);for(var r=this,i=0;i<e.length&&0===e[i];i++,r=r.sqr());if(++i<e.length)for(var n=r.sqr();i<e.length;i++,n=n.sqr())0!==e[i]&&(r=r.mul(n));return r},o.prototype.iushln=function(t){i("number"==typeof t&&t>=0);var e,r=t%26,n=(t-r)/26,o=67108863>>>26-r<<26-r;if(0!==r){var s=0;for(e=0;e<this.length;e++){var a=this.words[e]&o,u=(0|this.words[e])-a<<r;this.words[e]=u|s,s=a>>>26-r}s&&(this.words[e]=s,this.length++)}if(0!==n){for(e=this.length-1;e>=0;e--)this.words[e+n]=this.words[e];for(e=0;e<n;e++)this.words[e]=0;this.length+=n}return this.strip()},o.prototype.ishln=function(t){return i(0===this.negative),this.iushln(t)},o.prototype.iushrn=function(t,e,r){var n;i("number"==typeof t&&t>=0),n=e?(e-e%26)/26:0;var o=t%26,s=Math.min((t-o)/26,this.length),a=67108863^67108863>>>o<<o,u=r;if(n-=s,n=Math.max(0,n),u){for(var h=0;h<s;h++)u.words[h]=this.words[h];u.length=s}if(0===s);else if(this.length>s)for(this.length-=s,h=0;h<this.length;h++)this.words[h]=this.words[h+s];else this.words[0]=0,this.length=1;var c=0;for(h=this.length-1;h>=0&&(0!==c||h>=n);h--){var f=0|this.words[h];this.words[h]=c<<26-o|f>>>o,c=f&a}return u&&0!==c&&(u.words[u.length++]=c),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},o.prototype.ishrn=function(t,e,r){return i(0===this.negative),this.iushrn(t,e,r)},o.prototype.shln=function(t){return this.clone().ishln(t)},o.prototype.ushln=function(t){return this.clone().iushln(t)},o.prototype.shrn=function(t){return this.clone().ishrn(t)},o.prototype.ushrn=function(t){return this.clone().iushrn(t)},o.prototype.testn=function(t){i("number"==typeof t&&t>=0);var e=t%26,r=(t-e)/26,n=1<<e;return!(this.length<=r||!(this.words[r]&n))},o.prototype.imaskn=function(t){i("number"==typeof t&&t>=0);var e=t%26,r=(t-e)/26;if(i(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==e&&r++,this.length=Math.min(r,this.length),0!==e){var n=67108863^67108863>>>e<<e;this.words[this.length-1]&=n}return this.strip()},o.prototype.maskn=function(t){return this.clone().imaskn(t)},o.prototype.iaddn=function(t){return i("number"==typeof t),i(t<67108864),t<0?this.isubn(-t):0!==this.negative?1===this.length&&(0|this.words[0])<t?(this.words[0]=t-(0|this.words[0]),this.negative=0,this):(this.negative=0,this.isubn(t),this.negative=1,this):this._iaddn(t)},o.prototype._iaddn=function(t){this.words[0]+=t;for(var e=0;e<this.length&&this.words[e]>=67108864;e++)this.words[e]-=67108864,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},o.prototype.isubn=function(t){if(i("number"==typeof t),i(t<67108864),t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var e=0;e<this.length&&this.words[e]<0;e++)this.words[e]+=67108864,this.words[e+1]-=1;return this.strip()},o.prototype.addn=function(t){return this.clone().iaddn(t)},o.prototype.subn=function(t){return this.clone().isubn(t)},o.prototype.iabs=function(){return this.negative=0,this},o.prototype.abs=function(){return this.clone().iabs()},o.prototype._ishlnsubmul=function(t,e,r){var n,o,s=t.length+r;this._expand(s);var a=0;for(n=0;n<t.length;n++){o=(0|this.words[n+r])+a;var u=(0|t.words[n])*e;a=((o-=67108863&u)>>26)-(u/67108864|0),this.words[n+r]=67108863&o}for(;n<this.length-r;n++)a=(o=(0|this.words[n+r])+a)>>26,this.words[n+r]=67108863&o;if(0===a)return this.strip();for(i(-1===a),a=0,n=0;n<this.length;n++)a=(o=-(0|this.words[n])+a)>>26,this.words[n]=67108863&o;return this.negative=1,this.strip()},o.prototype._wordDiv=function(t,e){var r=(this.length,t.length),i=this.clone(),n=t,s=0|n.words[n.length-1];0!=(r=26-this._countBits(s))&&(n=n.ushln(r),i.iushln(r),s=0|n.words[n.length-1]);var a,u=i.length-n.length;if("mod"!==e){(a=new o(null)).length=u+1,a.words=new Array(a.length);for(var h=0;h<a.length;h++)a.words[h]=0}var c=i.clone()._ishlnsubmul(n,1,u);0===c.negative&&(i=c,a&&(a.words[u]=1));for(var f=u-1;f>=0;f--){var l=67108864*(0|i.words[n.length+f])+(0|i.words[n.length+f-1]);for(l=Math.min(l/s|0,67108863),i._ishlnsubmul(n,l,f);0!==i.negative;)l--,i.negative=0,i._ishlnsubmul(n,1,f),i.isZero()||(i.negative^=1);a&&(a.words[f]=l)}return a&&a.strip(),i.strip(),"div"!==e&&0!==r&&i.iushrn(r),{div:a||null,mod:i}},o.prototype.divmod=function(t,e,r){return i(!t.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===t.negative?(a=this.neg().divmod(t,e),"mod"!==e&&(n=a.div.neg()),"div"!==e&&(s=a.mod.neg(),r&&0!==s.negative&&s.iadd(t)),{div:n,mod:s}):0===this.negative&&0!==t.negative?(a=this.divmod(t.neg(),e),"mod"!==e&&(n=a.div.neg()),{div:n,mod:a.mod}):0!=(this.negative&t.negative)?(a=this.neg().divmod(t.neg(),e),"div"!==e&&(s=a.mod.neg(),r&&0!==s.negative&&s.isub(t)),{div:a.div,mod:s}):t.length>this.length||this.cmp(t)<0?{div:new o(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new o(this.modn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new o(this.modn(t.words[0]))}:this._wordDiv(t,e);var n,s,a},o.prototype.div=function(t){return this.divmod(t,"div",!1).div},o.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},o.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},o.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var r=0!==e.div.negative?e.mod.isub(t):e.mod,i=t.ushrn(1),n=t.andln(1),o=r.cmp(i);return o<0||1===n&&0===o?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},o.prototype.modn=function(t){i(t<=67108863);for(var e=(1<<26)%t,r=0,n=this.length-1;n>=0;n--)r=(e*r+(0|this.words[n]))%t;return r},o.prototype.idivn=function(t){i(t<=67108863);for(var e=0,r=this.length-1;r>=0;r--){var n=(0|this.words[r])+67108864*e;this.words[r]=n/t|0,e=n%t}return this.strip()},o.prototype.divn=function(t){return this.clone().idivn(t)},o.prototype.egcd=function(t){i(0===t.negative),i(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var n=new o(1),s=new o(0),a=new o(0),u=new o(1),h=0;e.isEven()&&r.isEven();)e.iushrn(1),r.iushrn(1),++h;for(var c=r.clone(),f=e.clone();!e.isZero();){for(var l=0,d=1;0==(e.words[0]&d)&&l<26;++l,d<<=1);if(l>0)for(e.iushrn(l);l-- >0;)(n.isOdd()||s.isOdd())&&(n.iadd(c),s.isub(f)),n.iushrn(1),s.iushrn(1);for(var p=0,g=1;0==(r.words[0]&g)&&p<26;++p,g<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(a.isOdd()||u.isOdd())&&(a.iadd(c),u.isub(f)),a.iushrn(1),u.iushrn(1);e.cmp(r)>=0?(e.isub(r),n.isub(a),s.isub(u)):(r.isub(e),a.isub(n),u.isub(s))}return{a,b:u,gcd:r.iushln(h)}},o.prototype._invmp=function(t){i(0===t.negative),i(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var n,s=new o(1),a=new o(0),u=r.clone();e.cmpn(1)>0&&r.cmpn(1)>0;){for(var h=0,c=1;0==(e.words[0]&c)&&h<26;++h,c<<=1);if(h>0)for(e.iushrn(h);h-- >0;)s.isOdd()&&s.iadd(u),s.iushrn(1);for(var f=0,l=1;0==(r.words[0]&l)&&f<26;++f,l<<=1);if(f>0)for(r.iushrn(f);f-- >0;)a.isOdd()&&a.iadd(u),a.iushrn(1);e.cmp(r)>=0?(e.isub(r),s.isub(a)):(r.isub(e),a.isub(s))}return(n=0===e.cmpn(1)?s:a).cmpn(0)<0&&n.iadd(t),n},o.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),r=t.clone();e.negative=0,r.negative=0;for(var i=0;e.isEven()&&r.isEven();i++)e.iushrn(1),r.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;r.isEven();)r.iushrn(1);var n=e.cmp(r);if(n<0){var o=e;e=r,r=o}else if(0===n||0===r.cmpn(1))break;e.isub(r)}return r.iushln(i)},o.prototype.invm=function(t){return this.egcd(t).a.umod(t)},o.prototype.isEven=function(){return 0==(1&this.words[0])},o.prototype.isOdd=function(){return 1==(1&this.words[0])},o.prototype.andln=function(t){return this.words[0]&t},o.prototype.bincn=function(t){i("number"==typeof t);var e=t%26,r=(t-e)/26,n=1<<e;if(this.length<=r)return this._expand(r+1),this.words[r]|=n,this;for(var o=n,s=r;0!==o&&s<this.length;s++){var a=0|this.words[s];o=(a+=o)>>>26,a&=67108863,this.words[s]=a}return 0!==o&&(this.words[s]=o,this.length++),this},o.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},o.prototype.cmpn=function(t){var e,r=t<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this.strip(),this.length>1)e=1;else{r&&(t=-t),i(t<=67108863,"Number is too big");var n=0|this.words[0];e=n===t?0:n<t?-1:1}return 0!==this.negative?0|-e:e},o.prototype.cmp=function(t){if(0!==this.negative&&0===t.negative)return-1;if(0===this.negative&&0!==t.negative)return 1;var e=this.ucmp(t);return 0!==this.negative?0|-e:e},o.prototype.ucmp=function(t){if(this.length>t.length)return 1;if(this.length<t.length)return-1;for(var e=0,r=this.length-1;r>=0;r--){var i=0|this.words[r],n=0|t.words[r];if(i!==n){i<n?e=-1:i>n&&(e=1);break}}return e},o.prototype.gtn=function(t){return 1===this.cmpn(t)},o.prototype.gt=function(t){return 1===this.cmp(t)},o.prototype.gten=function(t){return this.cmpn(t)>=0},o.prototype.gte=function(t){return this.cmp(t)>=0},o.prototype.ltn=function(t){return-1===this.cmpn(t)},o.prototype.lt=function(t){return-1===this.cmp(t)},o.prototype.lten=function(t){return this.cmpn(t)<=0},o.prototype.lte=function(t){return this.cmp(t)<=0},o.prototype.eqn=function(t){return 0===this.cmpn(t)},o.prototype.eq=function(t){return 0===this.cmp(t)},o.red=function(t){return new S(t)},o.prototype.toRed=function(t){return i(!this.red,"Already a number in reduction context"),i(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},o.prototype.fromRed=function(){return i(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(t){return this.red=t,this},o.prototype.forceRed=function(t){return i(!this.red,"Already a number in reduction context"),this._forceRed(t)},o.prototype.redAdd=function(t){return i(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},o.prototype.redIAdd=function(t){return i(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},o.prototype.redSub=function(t){return i(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},o.prototype.redISub=function(t){return i(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},o.prototype.redShl=function(t){return i(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},o.prototype.redMul=function(t){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},o.prototype.redIMul=function(t){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},o.prototype.redSqr=function(){return i(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return i(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return i(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return i(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return i(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(t){return i(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var y={k256:null,p224:null,p192:null,p25519:null};function m(t,e){this.name=t,this.p=new o(e,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function v(){m.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function b(){m.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function w(){m.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function _(){m.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function S(t){if("string"==typeof t){var e=o._prime(t);this.m=e.p,this.prime=e}else i(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function E(t){S.call(this,t),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new o(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}m.prototype._tmp=function(){var t=new o(null);return t.words=new Array(Math.ceil(this.n/13)),t},m.prototype.ireduce=function(t){var e,r=t;do{this.split(r,this.tmp),e=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(e>this.n);var i=e<this.n?-1:r.ucmp(this.p);return 0===i?(r.words[0]=0,r.length=1):i>0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},m.prototype.split=function(t,e){t.iushrn(this.n,0,e)},m.prototype.imulK=function(t){return t.imul(this.k)},n(v,m),v.prototype.split=function(t,e){for(var r=4194303,i=Math.min(t.length,9),n=0;n<i;n++)e.words[n]=t.words[n];if(e.length=i,t.length<=9)return t.words[0]=0,void(t.length=1);var o=t.words[9];for(e.words[e.length++]=o&r,n=10;n<t.length;n++){var s=0|t.words[n];t.words[n-10]=(s&r)<<4|o>>>22,o=s}o>>>=22,t.words[n-10]=o,0===o&&t.length>10?t.length-=10:t.length-=9},v.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,r=0;r<t.length;r++){var i=0|t.words[r];e+=977*i,t.words[r]=67108863&e,e=64*i+(e/67108864|0)}return 0===t.words[t.length-1]&&(t.length--,0===t.words[t.length-1]&&t.length--),t},n(b,m),n(w,m),n(_,m),_.prototype.imulK=function(t){for(var e=0,r=0;r<t.length;r++){var i=19*(0|t.words[r])+e,n=67108863&i;i>>>=26,t.words[r]=n,e=i}return 0!==e&&(t.words[t.length++]=e),t},o._prime=function(t){if(y[t])return y[t];var e;if("k256"===t)e=new v;else if("p224"===t)e=new b;else if("p192"===t)e=new w;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new _}return y[t]=e,e},S.prototype._verify1=function(t){i(0===t.negative,"red works only with positives"),i(t.red,"red works only with red numbers")},S.prototype._verify2=function(t,e){i(0==(t.negative|e.negative),"red works only with positives"),i(t.red&&t.red===e.red,"red works only with red numbers")},S.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.umod(this.m)._forceRed(this)},S.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},S.prototype.add=function(t,e){this._verify2(t,e);var r=t.add(e);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},S.prototype.iadd=function(t,e){this._verify2(t,e);var r=t.iadd(e);return r.cmp(this.m)>=0&&r.isub(this.m),r},S.prototype.sub=function(t,e){this._verify2(t,e);var r=t.sub(e);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},S.prototype.isub=function(t,e){this._verify2(t,e);var r=t.isub(e);return r.cmpn(0)<0&&r.iadd(this.m),r},S.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},S.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},S.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},S.prototype.isqr=function(t){return this.imul(t,t.clone())},S.prototype.sqr=function(t){return this.mul(t,t)},S.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(i(e%2==1),3===e){var r=this.m.add(new o(1)).iushrn(2);return this.pow(t,r)}for(var n=this.m.subn(1),s=0;!n.isZero()&&0===n.andln(1);)s++,n.iushrn(1);i(!n.isZero());var a=new o(1).toRed(this),u=a.redNeg(),h=this.m.subn(1).iushrn(1),c=this.m.bitLength();for(c=new o(2*c*c).toRed(this);0!==this.pow(c,h).cmp(u);)c.redIAdd(u);for(var f=this.pow(c,n),l=this.pow(t,n.addn(1).iushrn(1)),d=this.pow(t,n),p=s;0!==d.cmp(a);){for(var g=d,y=0;0!==g.cmp(a);y++)g=g.redSqr();i(y<p);var m=this.pow(f,new o(1).iushln(p-y-1));l=l.redMul(m),f=m.redSqr(),d=d.redMul(f),p=y}return l},S.prototype.invm=function(t){var e=t._invmp(this.m);return 0!==e.negative?(e.negative=0,this.imod(e).redNeg()):this.imod(e)},S.prototype.pow=function(t,e){if(e.isZero())return new o(1).toRed(this);if(0===e.cmpn(1))return t.clone();var r=new Array(16);r[0]=new o(1).toRed(this),r[1]=t;for(var i=2;i<r.length;i++)r[i]=this.mul(r[i-1],t);var n=r[0],s=0,a=0,u=e.bitLength()%26;for(0===u&&(u=26),i=e.length-1;i>=0;i--){for(var h=e.words[i],c=u-1;c>=0;c--){var f=h>>c&1;n!==r[0]&&(n=this.sqr(n)),0!==f||0!==s?(s<<=1,s|=f,(4==++a||0===i&&0===c)&&(n=this.mul(n,r[s]),a=0,s=0)):a=0}u=26}return n},S.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},S.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},o.mont=function(t){return new E(t)},n(E,S),E.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},E.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},E.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var r=t.imul(e),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(i).iushrn(this.shift),o=n;return n.cmp(this.m)>=0?o=n.isub(this.m):n.cmpn(0)<0&&(o=n.iadd(this.m)),o._forceRed(this)},E.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new o(0)._forceRed(this);var r=t.mul(e),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(i).iushrn(this.shift),s=n;return n.cmp(this.m)>=0?s=n.isub(this.m):n.cmpn(0)<0&&(s=n.iadd(this.m)),s._forceRed(this)},E.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(t=r.nmd(t),this)},35015:(t,e,r)=>{"use strict";var i=r(89509).Buffer,n=r(6972);function o(t){if(i.isBuffer(t))return t;if("string"==typeof t)return i.from(t,"base64");throw new TypeError("ECDSA signature must be a Base64 string or a Buffer")}function s(t,e,r){for(var i=0;e+i<r&&0===t[e+i];)++i;return t[e+i]>=128&&--i,i}t.exports={derToJose:function(t,e){t=o(t);var r=n(e),s=r+1,a=t.length,u=0;if(48!==t[u++])throw new Error('Could not find expected "seq"');var h=t[u++];if(129===h&&(h=t[u++]),a-u<h)throw new Error('"seq" specified length of "'+h+'", only "'+(a-u)+'" remaining');if(2!==t[u++])throw new Error('Could not find expected "int" for "r"');var c=t[u++];if(a-u-2<c)throw new Error('"r" specified length of "'+c+'", only "'+(a-u-2)+'" available');if(s<c)throw new Error('"r" specified length of "'+c+'", max of "'+s+'" is acceptable');var f=u;if(u+=c,2!==t[u++])throw new Error('Could not find expected "int" for "s"');var l=t[u++];if(a-u!==l)throw new Error('"s" specified length of "'+l+'", expected "'+(a-u)+'"');if(s<l)throw new Error('"s" specified length of "'+l+'", max of "'+s+'" is acceptable');var d=u;if((u+=l)!==a)throw new Error('Expected to consume entire buffer, but "'+(a-u)+'" bytes remain');var p=r-c,g=r-l,y=i.allocUnsafe(p+c+g+l);for(u=0;u<p;++u)y[u]=0;t.copy(y,u,f+Math.max(-p,0),f+c);for(var m=u=r;u<m+g;++u)y[u]=0;return t.copy(y,u,d+Math.max(-g,0),d+l),(y=y.toString("base64")).replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")},joseToDer:function(t,e){t=o(t);var r=n(e),a=t.length;if(a!==2*r)throw new TypeError('"'+e+'" signatures must be "'+2*r+'" bytes, saw "'+a+'"');var u=s(t,0,r),h=s(t,r,t.length),c=r-u,f=r-h,l=2+c+1+1+f,d=l<128,p=i.allocUnsafe((d?2:3)+l),g=0;return p[g++]=48,d?p[g++]=l:(p[g++]=129,p[g++]=255&l),p[g++]=2,p[g++]=c,u<0?(p[g++]=0,g+=t.copy(p,g,0,r)):g+=t.copy(p,g,u,r),p[g++]=2,p[g++]=f,h<0?(p[g++]=0,t.copy(p,g,r)):t.copy(p,g,r+h),p}}},6972:t=>{"use strict";function e(t){return(t/8|0)+(t%8==0?0:1)}var r={ES256:e(256),ES384:e(384),ES512:e(521)};t.exports=function(t){var e=r[t];if(e)return e;throw new Error('Unknown algorithm "'+t+'"')}},86266:(t,e,r)=>{"use strict";var i=e;i.version=r(17519).i8,i.utils=r(80953),i.rand=r(29931),i.curve=r(88254),i.curves=r(45427),i.ec=r(57954),i.eddsa=r(65980)},4918:(t,e,r)=>{"use strict";var i=r(73785),n=r(80953),o=n.getNAF,s=n.getJSF,a=n.assert;function u(t,e){this.type=t,this.p=new i(e.p,16),this.red=e.prime?i.red(e.prime):i.mont(this.p),this.zero=new i(0).toRed(this.red),this.one=new i(1).toRed(this.red),this.two=new i(2).toRed(this.red),this.n=e.n&&new i(e.n,16),this.g=e.g&&this.pointFromJSON(e.g,e.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4),this._bitLength=this.n?this.n.bitLength():0;var r=this.n&&this.p.div(this.n);!r||r.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}function h(t,e){this.curve=t,this.type=e,this.precomputed=null}t.exports=u,u.prototype.point=function(){throw new Error("Not implemented")},u.prototype.validate=function(){throw new Error("Not implemented")},u.prototype._fixedNafMul=function(t,e){a(t.precomputed);var r=t._getDoubles(),i=o(e,1,this._bitLength),n=(1<<r.step+1)-(r.step%2==0?2:1);n/=3;var s,u,h=[];for(s=0;s<i.length;s+=r.step){u=0;for(var c=s+r.step-1;c>=s;c--)u=(u<<1)+i[c];h.push(u)}for(var f=this.jpoint(null,null,null),l=this.jpoint(null,null,null),d=n;d>0;d--){for(s=0;s<h.length;s++)(u=h[s])===d?l=l.mixedAdd(r.points[s]):u===-d&&(l=l.mixedAdd(r.points[s].neg()));f=f.add(l)}return f.toP()},u.prototype._wnafMul=function(t,e){var r=4,i=t._getNAFPoints(r);r=i.wnd;for(var n=i.points,s=o(e,r,this._bitLength),u=this.jpoint(null,null,null),h=s.length-1;h>=0;h--){for(var c=0;h>=0&&0===s[h];h--)c++;if(h>=0&&c++,u=u.dblp(c),h<0)break;var f=s[h];a(0!==f),u="affine"===t.type?f>0?u.mixedAdd(n[f-1>>1]):u.mixedAdd(n[-f-1>>1].neg()):f>0?u.add(n[f-1>>1]):u.add(n[-f-1>>1].neg())}return"affine"===t.type?u.toP():u},u.prototype._wnafMulAdd=function(t,e,r,i,n){var a,u,h,c=this._wnafT1,f=this._wnafT2,l=this._wnafT3,d=0;for(a=0;a<i;a++){var p=(h=e[a])._getNAFPoints(t);c[a]=p.wnd,f[a]=p.points}for(a=i-1;a>=1;a-=2){var g=a-1,y=a;if(1===c[g]&&1===c[y]){var m=[e[g],null,null,e[y]];0===e[g].y.cmp(e[y].y)?(m[1]=e[g].add(e[y]),m[2]=e[g].toJ().mixedAdd(e[y].neg())):0===e[g].y.cmp(e[y].y.redNeg())?(m[1]=e[g].toJ().mixedAdd(e[y]),m[2]=e[g].add(e[y].neg())):(m[1]=e[g].toJ().mixedAdd(e[y]),m[2]=e[g].toJ().mixedAdd(e[y].neg()));var v=[-3,-1,-5,-7,0,7,5,1,3],b=s(r[g],r[y]);for(d=Math.max(b[0].length,d),l[g]=new Array(d),l[y]=new Array(d),u=0;u<d;u++){var w=0|b[0][u],_=0|b[1][u];l[g][u]=v[3*(w+1)+(_+1)],l[y][u]=0,f[g]=m}}else l[g]=o(r[g],c[g],this._bitLength),l[y]=o(r[y],c[y],this._bitLength),d=Math.max(l[g].length,d),d=Math.max(l[y].length,d)}var S=this.jpoint(null,null,null),E=this._wnafT4;for(a=d;a>=0;a--){for(var M=0;a>=0;){var A=!0;for(u=0;u<i;u++)E[u]=0|l[u][a],0!==E[u]&&(A=!1);if(!A)break;M++,a--}if(a>=0&&M++,S=S.dblp(M),a<0)break;for(u=0;u<i;u++){var C=E[u];0!==C&&(C>0?h=f[u][C-1>>1]:C<0&&(h=f[u][-C-1>>1].neg()),S="affine"===h.type?S.mixedAdd(h):S.add(h))}}for(a=0;a<i;a++)f[a]=null;return n?S:S.toP()},u.BasePoint=h,h.prototype.eq=function(){throw new Error("Not implemented")},h.prototype.validate=function(){return this.curve.validate(this)},u.prototype.decodePoint=function(t,e){t=n.toArray(t,e);var r=this.p.byteLength();if((4===t[0]||6===t[0]||7===t[0])&&t.length-1==2*r)return 6===t[0]?a(t[t.length-1]%2==0):7===t[0]&&a(t[t.length-1]%2==1),this.point(t.slice(1,1+r),t.slice(1+r,1+2*r));if((2===t[0]||3===t[0])&&t.length-1===r)return this.pointFromX(t.slice(1,1+r),3===t[0]);throw new Error("Unknown point format")},h.prototype.encodeCompressed=function(t){return this.encode(t,!0)},h.prototype._encode=function(t){var e=this.curve.p.byteLength(),r=this.getX().toArray("be",e);return t?[this.getY().isEven()?2:3].concat(r):[4].concat(r,this.getY().toArray("be",e))},h.prototype.encode=function(t,e){return n.encode(this._encode(e),t)},h.prototype.precompute=function(t){if(this.precomputed)return this;var e={doubles:null,naf:null,beta:null};return e.naf=this._getNAFPoints(8),e.doubles=this._getDoubles(4,t),e.beta=this._getBeta(),this.precomputed=e,this},h.prototype._hasDoubles=function(t){if(!this.precomputed)return!1;var e=this.precomputed.doubles;return!!e&&e.points.length>=Math.ceil((t.bitLength()+1)/e.step)},h.prototype._getDoubles=function(t,e){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var r=[this],i=this,n=0;n<e;n+=t){for(var o=0;o<t;o++)i=i.dbl();r.push(i)}return{step:t,points:r}},h.prototype._getNAFPoints=function(t){if(this.precomputed&&this.precomputed.naf)return this.precomputed.naf;for(var e=[this],r=(1<<t)-1,i=1===r?null:this.dbl(),n=1;n<r;n++)e[n]=e[n-1].add(i);return{wnd:t,points:e}},h.prototype._getBeta=function(){return null},h.prototype.dblp=function(t){for(var e=this,r=0;r<t;r++)e=e.dbl();return e}},31138:(t,e,r)=>{"use strict";var i=r(80953),n=r(73785),o=r(35717),s=r(4918),a=i.assert;function u(t){this.twisted=1!=(0|t.a),this.mOneA=this.twisted&&-1==(0|t.a),this.extended=this.mOneA,s.call(this,"edwards",t),this.a=new n(t.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new n(t.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new n(t.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),a(!this.twisted||0===this.c.fromRed().cmpn(1)),this.oneC=1==(0|t.c)}function h(t,e,r,i,o){s.BasePoint.call(this,t,"projective"),null===e&&null===r&&null===i?(this.x=this.curve.zero,this.y=this.curve.one,this.z=this.curve.one,this.t=this.curve.zero,this.zOne=!0):(this.x=new n(e,16),this.y=new n(r,16),this.z=i?new n(i,16):this.curve.one,this.t=o&&new n(o,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.t&&!this.t.red&&(this.t=this.t.toRed(this.curve.red)),this.zOne=this.z===this.curve.one,this.curve.extended&&!this.t&&(this.t=this.x.redMul(this.y),this.zOne||(this.t=this.t.redMul(this.z.redInvm()))))}o(u,s),t.exports=u,u.prototype._mulA=function(t){return this.mOneA?t.redNeg():this.a.redMul(t)},u.prototype._mulC=function(t){return this.oneC?t:this.c.redMul(t)},u.prototype.jpoint=function(t,e,r,i){return this.point(t,e,r,i)},u.prototype.pointFromX=function(t,e){(t=new n(t,16)).red||(t=t.toRed(this.red));var r=t.redSqr(),i=this.c2.redSub(this.a.redMul(r)),o=this.one.redSub(this.c2.redMul(this.d).redMul(r)),s=i.redMul(o.redInvm()),a=s.redSqrt();if(0!==a.redSqr().redSub(s).cmp(this.zero))throw new Error("invalid point");var u=a.fromRed().isOdd();return(e&&!u||!e&&u)&&(a=a.redNeg()),this.point(t,a)},u.prototype.pointFromY=function(t,e){(t=new n(t,16)).red||(t=t.toRed(this.red));var r=t.redSqr(),i=r.redSub(this.c2),o=r.redMul(this.d).redMul(this.c2).redSub(this.a),s=i.redMul(o.redInvm());if(0===s.cmp(this.zero)){if(e)throw new Error("invalid point");return this.point(this.zero,t)}var a=s.redSqrt();if(0!==a.redSqr().redSub(s).cmp(this.zero))throw new Error("invalid point");return a.fromRed().isOdd()!==e&&(a=a.redNeg()),this.point(a,t)},u.prototype.validate=function(t){if(t.isInfinity())return!0;t.normalize();var e=t.x.redSqr(),r=t.y.redSqr(),i=e.redMul(this.a).redAdd(r),n=this.c2.redMul(this.one.redAdd(this.d.redMul(e).redMul(r)));return 0===i.cmp(n)},o(h,s.BasePoint),u.prototype.pointFromJSON=function(t){return h.fromJSON(this,t)},u.prototype.point=function(t,e,r,i){return new h(this,t,e,r,i)},h.fromJSON=function(t,e){return new h(t,e[0],e[1],e[2])},h.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"},h.prototype.isInfinity=function(){return 0===this.x.cmpn(0)&&(0===this.y.cmp(this.z)||this.zOne&&0===this.y.cmp(this.curve.c))},h.prototype._extDbl=function(){var t=this.x.redSqr(),e=this.y.redSqr(),r=this.z.redSqr();r=r.redIAdd(r);var i=this.curve._mulA(t),n=this.x.redAdd(this.y).redSqr().redISub(t).redISub(e),o=i.redAdd(e),s=o.redSub(r),a=i.redSub(e),u=n.redMul(s),h=o.redMul(a),c=n.redMul(a),f=s.redMul(o);return this.curve.point(u,h,f,c)},h.prototype._projDbl=function(){var t,e,r,i,n,o,s=this.x.redAdd(this.y).redSqr(),a=this.x.redSqr(),u=this.y.redSqr();if(this.curve.twisted){var h=(i=this.curve._mulA(a)).redAdd(u);this.zOne?(t=s.redSub(a).redSub(u).redMul(h.redSub(this.curve.two)),e=h.redMul(i.redSub(u)),r=h.redSqr().redSub(h).redSub(h)):(n=this.z.redSqr(),o=h.redSub(n).redISub(n),t=s.redSub(a).redISub(u).redMul(o),e=h.redMul(i.redSub(u)),r=h.redMul(o))}else i=a.redAdd(u),n=this.curve._mulC(this.z).redSqr(),o=i.redSub(n).redSub(n),t=this.curve._mulC(s.redISub(i)).redMul(o),e=this.curve._mulC(i).redMul(a.redISub(u)),r=i.redMul(o);return this.curve.point(t,e,r)},h.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},h.prototype._extAdd=function(t){var e=this.y.redSub(this.x).redMul(t.y.redSub(t.x)),r=this.y.redAdd(this.x).redMul(t.y.redAdd(t.x)),i=this.t.redMul(this.curve.dd).redMul(t.t),n=this.z.redMul(t.z.redAdd(t.z)),o=r.redSub(e),s=n.redSub(i),a=n.redAdd(i),u=r.redAdd(e),h=o.redMul(s),c=a.redMul(u),f=o.redMul(u),l=s.redMul(a);return this.curve.point(h,c,l,f)},h.prototype._projAdd=function(t){var e,r,i=this.z.redMul(t.z),n=i.redSqr(),o=this.x.redMul(t.x),s=this.y.redMul(t.y),a=this.curve.d.redMul(o).redMul(s),u=n.redSub(a),h=n.redAdd(a),c=this.x.redAdd(this.y).redMul(t.x.redAdd(t.y)).redISub(o).redISub(s),f=i.redMul(u).redMul(c);return this.curve.twisted?(e=i.redMul(h).redMul(s.redSub(this.curve._mulA(o))),r=u.redMul(h)):(e=i.redMul(h).redMul(s.redSub(o)),r=this.curve._mulC(u).redMul(h)),this.curve.point(f,e,r)},h.prototype.add=function(t){return this.isInfinity()?t:t.isInfinity()?this:this.curve.extended?this._extAdd(t):this._projAdd(t)},h.prototype.mul=function(t){return this._hasDoubles(t)?this.curve._fixedNafMul(this,t):this.curve._wnafMul(this,t)},h.prototype.mulAdd=function(t,e,r){return this.curve._wnafMulAdd(1,[this,e],[t,r],2,!1)},h.prototype.jmulAdd=function(t,e,r){return this.curve._wnafMulAdd(1,[this,e],[t,r],2,!0)},h.prototype.normalize=function(){if(this.zOne)return this;var t=this.z.redInvm();return this.x=this.x.redMul(t),this.y=this.y.redMul(t),this.t&&(this.t=this.t.redMul(t)),this.z=this.curve.one,this.zOne=!0,this},h.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},h.prototype.getX=function(){return this.normalize(),this.x.fromRed()},h.prototype.getY=function(){return this.normalize(),this.y.fromRed()},h.prototype.eq=function(t){return this===t||0===this.getX().cmp(t.getX())&&0===this.getY().cmp(t.getY())},h.prototype.eqXToP=function(t){var e=t.toRed(this.curve.red).redMul(this.z);if(0===this.x.cmp(e))return!0;for(var r=t.clone(),i=this.curve.redN.redMul(this.z);;){if(r.iadd(this.curve.n),r.cmp(this.curve.p)>=0)return!1;if(e.redIAdd(i),0===this.x.cmp(e))return!0}},h.prototype.toP=h.prototype.normalize,h.prototype.mixedAdd=h.prototype.add},88254:(t,e,r)=>{"use strict";var i=e;i.base=r(4918),i.short=r(6673),i.mont=r(22881),i.edwards=r(31138)},22881:(t,e,r)=>{"use strict";var i=r(73785),n=r(35717),o=r(4918),s=r(80953);function a(t){o.call(this,"mont",t),this.a=new i(t.a,16).toRed(this.red),this.b=new i(t.b,16).toRed(this.red),this.i4=new i(4).toRed(this.red).redInvm(),this.two=new i(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}function u(t,e,r){o.BasePoint.call(this,t,"projective"),null===e&&null===r?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new i(e,16),this.z=new i(r,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}n(a,o),t.exports=a,a.prototype.validate=function(t){var e=t.normalize().x,r=e.redSqr(),i=r.redMul(e).redAdd(r.redMul(this.a)).redAdd(e);return 0===i.redSqrt().redSqr().cmp(i)},n(u,o.BasePoint),a.prototype.decodePoint=function(t,e){return this.point(s.toArray(t,e),1)},a.prototype.point=function(t,e){return new u(this,t,e)},a.prototype.pointFromJSON=function(t){return u.fromJSON(this,t)},u.prototype.precompute=function(){},u.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())},u.fromJSON=function(t,e){return new u(t,e[0],e[1]||t.one)},u.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"},u.prototype.isInfinity=function(){return 0===this.z.cmpn(0)},u.prototype.dbl=function(){var t=this.x.redAdd(this.z).redSqr(),e=this.x.redSub(this.z).redSqr(),r=t.redSub(e),i=t.redMul(e),n=r.redMul(e.redAdd(this.curve.a24.redMul(r)));return this.curve.point(i,n)},u.prototype.add=function(){throw new Error("Not supported on Montgomery curve")},u.prototype.diffAdd=function(t,e){var r=this.x.redAdd(this.z),i=this.x.redSub(this.z),n=t.x.redAdd(t.z),o=t.x.redSub(t.z).redMul(r),s=n.redMul(i),a=e.z.redMul(o.redAdd(s).redSqr()),u=e.x.redMul(o.redISub(s).redSqr());return this.curve.point(a,u)},u.prototype.mul=function(t){for(var e=t.clone(),r=this,i=this.curve.point(null,null),n=[];0!==e.cmpn(0);e.iushrn(1))n.push(e.andln(1));for(var o=n.length-1;o>=0;o--)0===n[o]?(r=r.diffAdd(i,this),i=i.dbl()):(i=r.diffAdd(i,this),r=r.dbl());return i},u.prototype.mulAdd=function(){throw new Error("Not supported on Montgomery curve")},u.prototype.jumlAdd=function(){throw new Error("Not supported on Montgomery curve")},u.prototype.eq=function(t){return 0===this.getX().cmp(t.getX())},u.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},u.prototype.getX=function(){return this.normalize(),this.x.fromRed()}},6673:(t,e,r)=>{"use strict";var i=r(80953),n=r(73785),o=r(35717),s=r(4918),a=i.assert;function u(t){s.call(this,"short",t),this.a=new n(t.a,16).toRed(this.red),this.b=new n(t.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=0===this.a.fromRed().cmpn(0),this.threeA=0===this.a.fromRed().sub(this.p).cmpn(-3),this.endo=this._getEndomorphism(t),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}function h(t,e,r,i){s.BasePoint.call(this,t,"affine"),null===e&&null===r?(this.x=null,this.y=null,this.inf=!0):(this.x=new n(e,16),this.y=new n(r,16),i&&(this.x.forceRed(this.curve.red),this.y.forceRed(this.curve.red)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.inf=!1)}function c(t,e,r,i){s.BasePoint.call(this,t,"jacobian"),null===e&&null===r&&null===i?(this.x=this.curve.one,this.y=this.curve.one,this.z=new n(0)):(this.x=new n(e,16),this.y=new n(r,16),this.z=new n(i,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}o(u,s),t.exports=u,u.prototype._getEndomorphism=function(t){if(this.zeroA&&this.g&&this.n&&1===this.p.modn(3)){var e,r;if(t.beta)e=new n(t.beta,16).toRed(this.red);else{var i=this._getEndoRoots(this.p);e=(e=i[0].cmp(i[1])<0?i[0]:i[1]).toRed(this.red)}if(t.lambda)r=new n(t.lambda,16);else{var o=this._getEndoRoots(this.n);0===this.g.mul(o[0]).x.cmp(this.g.x.redMul(e))?r=o[0]:(r=o[1],a(0===this.g.mul(r).x.cmp(this.g.x.redMul(e))))}return{beta:e,lambda:r,basis:t.basis?t.basis.map((function(t){return{a:new n(t.a,16),b:new n(t.b,16)}})):this._getEndoBasis(r)}}},u.prototype._getEndoRoots=function(t){var e=t===this.p?this.red:n.mont(t),r=new n(2).toRed(e).redInvm(),i=r.redNeg(),o=new n(3).toRed(e).redNeg().redSqrt().redMul(r);return[i.redAdd(o).fromRed(),i.redSub(o).fromRed()]},u.prototype._getEndoBasis=function(t){for(var e,r,i,o,s,a,u,h,c,f=this.n.ushrn(Math.floor(this.n.bitLength()/2)),l=t,d=this.n.clone(),p=new n(1),g=new n(0),y=new n(0),m=new n(1),v=0;0!==l.cmpn(0);){var b=d.div(l);h=d.sub(b.mul(l)),c=y.sub(b.mul(p));var w=m.sub(b.mul(g));if(!i&&h.cmp(f)<0)e=u.neg(),r=p,i=h.neg(),o=c;else if(i&&2==++v)break;u=h,d=l,l=h,y=p,p=c,m=g,g=w}s=h.neg(),a=c;var _=i.sqr().add(o.sqr());return s.sqr().add(a.sqr()).cmp(_)>=0&&(s=e,a=r),i.negative&&(i=i.neg(),o=o.neg()),s.negative&&(s=s.neg(),a=a.neg()),[{a:i,b:o},{a:s,b:a}]},u.prototype._endoSplit=function(t){var e=this.endo.basis,r=e[0],i=e[1],n=i.b.mul(t).divRound(this.n),o=r.b.neg().mul(t).divRound(this.n),s=n.mul(r.a),a=o.mul(i.a),u=n.mul(r.b),h=o.mul(i.b);return{k1:t.sub(s).sub(a),k2:u.add(h).neg()}},u.prototype.pointFromX=function(t,e){(t=new n(t,16)).red||(t=t.toRed(this.red));var r=t.redSqr().redMul(t).redIAdd(t.redMul(this.a)).redIAdd(this.b),i=r.redSqrt();if(0!==i.redSqr().redSub(r).cmp(this.zero))throw new Error("invalid point");var o=i.fromRed().isOdd();return(e&&!o||!e&&o)&&(i=i.redNeg()),this.point(t,i)},u.prototype.validate=function(t){if(t.inf)return!0;var e=t.x,r=t.y,i=this.a.redMul(e),n=e.redSqr().redMul(e).redIAdd(i).redIAdd(this.b);return 0===r.redSqr().redISub(n).cmpn(0)},u.prototype._endoWnafMulAdd=function(t,e,r){for(var i=this._endoWnafT1,n=this._endoWnafT2,o=0;o<t.length;o++){var s=this._endoSplit(e[o]),a=t[o],u=a._getBeta();s.k1.negative&&(s.k1.ineg(),a=a.neg(!0)),s.k2.negative&&(s.k2.ineg(),u=u.neg(!0)),i[2*o]=a,i[2*o+1]=u,n[2*o]=s.k1,n[2*o+1]=s.k2}for(var h=this._wnafMulAdd(1,i,n,2*o,r),c=0;c<2*o;c++)i[c]=null,n[c]=null;return h},o(h,s.BasePoint),u.prototype.point=function(t,e,r){return new h(this,t,e,r)},u.prototype.pointFromJSON=function(t,e){return h.fromJSON(this,t,e)},h.prototype._getBeta=function(){if(this.curve.endo){var t=this.precomputed;if(t&&t.beta)return t.beta;var e=this.curve.point(this.x.redMul(this.curve.endo.beta),this.y);if(t){var r=this.curve,i=function(t){return r.point(t.x.redMul(r.endo.beta),t.y)};t.beta=e,e.precomputed={beta:null,naf:t.naf&&{wnd:t.naf.wnd,points:t.naf.points.map(i)},doubles:t.doubles&&{step:t.doubles.step,points:t.doubles.points.map(i)}}}return e}},h.prototype.toJSON=function(){return this.precomputed?[this.x,this.y,this.precomputed&&{doubles:this.precomputed.doubles&&{step:this.precomputed.doubles.step,points:this.precomputed.doubles.points.slice(1)},naf:this.precomputed.naf&&{wnd:this.precomputed.naf.wnd,points:this.precomputed.naf.points.slice(1)}}]:[this.x,this.y]},h.fromJSON=function(t,e,r){"string"==typeof e&&(e=JSON.parse(e));var i=t.point(e[0],e[1],r);if(!e[2])return i;function n(e){return t.point(e[0],e[1],r)}var o=e[2];return i.precomputed={beta:null,doubles:o.doubles&&{step:o.doubles.step,points:[i].concat(o.doubles.points.map(n))},naf:o.naf&&{wnd:o.naf.wnd,points:[i].concat(o.naf.points.map(n))}},i},h.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+">"},h.prototype.isInfinity=function(){return this.inf},h.prototype.add=function(t){if(this.inf)return t;if(t.inf)return this;if(this.eq(t))return this.dbl();if(this.neg().eq(t))return this.curve.point(null,null);if(0===this.x.cmp(t.x))return this.curve.point(null,null);var e=this.y.redSub(t.y);0!==e.cmpn(0)&&(e=e.redMul(this.x.redSub(t.x).redInvm()));var r=e.redSqr().redISub(this.x).redISub(t.x),i=e.redMul(this.x.redSub(r)).redISub(this.y);return this.curve.point(r,i)},h.prototype.dbl=function(){if(this.inf)return this;var t=this.y.redAdd(this.y);if(0===t.cmpn(0))return this.curve.point(null,null);var e=this.curve.a,r=this.x.redSqr(),i=t.redInvm(),n=r.redAdd(r).redIAdd(r).redIAdd(e).redMul(i),o=n.redSqr().redISub(this.x.redAdd(this.x)),s=n.redMul(this.x.redSub(o)).redISub(this.y);return this.curve.point(o,s)},h.prototype.getX=function(){return this.x.fromRed()},h.prototype.getY=function(){return this.y.fromRed()},h.prototype.mul=function(t){return t=new n(t,16),this.isInfinity()?this:this._hasDoubles(t)?this.curve._fixedNafMul(this,t):this.curve.endo?this.curve._endoWnafMulAdd([this],[t]):this.curve._wnafMul(this,t)},h.prototype.mulAdd=function(t,e,r){var i=[this,e],n=[t,r];return this.curve.endo?this.curve._endoWnafMulAdd(i,n):this.curve._wnafMulAdd(1,i,n,2)},h.prototype.jmulAdd=function(t,e,r){var i=[this,e],n=[t,r];return this.curve.endo?this.curve._endoWnafMulAdd(i,n,!0):this.curve._wnafMulAdd(1,i,n,2,!0)},h.prototype.eq=function(t){return this===t||this.inf===t.inf&&(this.inf||0===this.x.cmp(t.x)&&0===this.y.cmp(t.y))},h.prototype.neg=function(t){if(this.inf)return this;var e=this.curve.point(this.x,this.y.redNeg());if(t&&this.precomputed){var r=this.precomputed,i=function(t){return t.neg()};e.precomputed={naf:r.naf&&{wnd:r.naf.wnd,points:r.naf.points.map(i)},doubles:r.doubles&&{step:r.doubles.step,points:r.doubles.points.map(i)}}}return e},h.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},o(c,s.BasePoint),u.prototype.jpoint=function(t,e,r){return new c(this,t,e,r)},c.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var t=this.z.redInvm(),e=t.redSqr(),r=this.x.redMul(e),i=this.y.redMul(e).redMul(t);return this.curve.point(r,i)},c.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},c.prototype.add=function(t){if(this.isInfinity())return t;if(t.isInfinity())return this;var e=t.z.redSqr(),r=this.z.redSqr(),i=this.x.redMul(e),n=t.x.redMul(r),o=this.y.redMul(e.redMul(t.z)),s=t.y.redMul(r.redMul(this.z)),a=i.redSub(n),u=o.redSub(s);if(0===a.cmpn(0))return 0!==u.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var h=a.redSqr(),c=h.redMul(a),f=i.redMul(h),l=u.redSqr().redIAdd(c).redISub(f).redISub(f),d=u.redMul(f.redISub(l)).redISub(o.redMul(c)),p=this.z.redMul(t.z).redMul(a);return this.curve.jpoint(l,d,p)},c.prototype.mixedAdd=function(t){if(this.isInfinity())return t.toJ();if(t.isInfinity())return this;var e=this.z.redSqr(),r=this.x,i=t.x.redMul(e),n=this.y,o=t.y.redMul(e).redMul(this.z),s=r.redSub(i),a=n.redSub(o);if(0===s.cmpn(0))return 0!==a.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var u=s.redSqr(),h=u.redMul(s),c=r.redMul(u),f=a.redSqr().redIAdd(h).redISub(c).redISub(c),l=a.redMul(c.redISub(f)).redISub(n.redMul(h)),d=this.z.redMul(s);return this.curve.jpoint(f,l,d)},c.prototype.dblp=function(t){if(0===t)return this;if(this.isInfinity())return this;if(!t)return this.dbl();var e;if(this.curve.zeroA||this.curve.threeA){var r=this;for(e=0;e<t;e++)r=r.dbl();return r}var i=this.curve.a,n=this.curve.tinv,o=this.x,s=this.y,a=this.z,u=a.redSqr().redSqr(),h=s.redAdd(s);for(e=0;e<t;e++){var c=o.redSqr(),f=h.redSqr(),l=f.redSqr(),d=c.redAdd(c).redIAdd(c).redIAdd(i.redMul(u)),p=o.redMul(f),g=d.redSqr().redISub(p.redAdd(p)),y=p.redISub(g),m=d.redMul(y);m=m.redIAdd(m).redISub(l);var v=h.redMul(a);e+1<t&&(u=u.redMul(l)),o=g,a=v,h=m}return this.curve.jpoint(o,h.redMul(n),a)},c.prototype.dbl=function(){return this.isInfinity()?this:this.curve.zeroA?this._zeroDbl():this.curve.threeA?this._threeDbl():this._dbl()},c.prototype._zeroDbl=function(){var t,e,r;if(this.zOne){var i=this.x.redSqr(),n=this.y.redSqr(),o=n.redSqr(),s=this.x.redAdd(n).redSqr().redISub(i).redISub(o);s=s.redIAdd(s);var a=i.redAdd(i).redIAdd(i),u=a.redSqr().redISub(s).redISub(s),h=o.redIAdd(o);h=(h=h.redIAdd(h)).redIAdd(h),t=u,e=a.redMul(s.redISub(u)).redISub(h),r=this.y.redAdd(this.y)}else{var c=this.x.redSqr(),f=this.y.redSqr(),l=f.redSqr(),d=this.x.redAdd(f).redSqr().redISub(c).redISub(l);d=d.redIAdd(d);var p=c.redAdd(c).redIAdd(c),g=p.redSqr(),y=l.redIAdd(l);y=(y=y.redIAdd(y)).redIAdd(y),t=g.redISub(d).redISub(d),e=p.redMul(d.redISub(t)).redISub(y),r=(r=this.y.redMul(this.z)).redIAdd(r)}return this.curve.jpoint(t,e,r)},c.prototype._threeDbl=function(){var t,e,r;if(this.zOne){var i=this.x.redSqr(),n=this.y.redSqr(),o=n.redSqr(),s=this.x.redAdd(n).redSqr().redISub(i).redISub(o);s=s.redIAdd(s);var a=i.redAdd(i).redIAdd(i).redIAdd(this.curve.a),u=a.redSqr().redISub(s).redISub(s);t=u;var h=o.redIAdd(o);h=(h=h.redIAdd(h)).redIAdd(h),e=a.redMul(s.redISub(u)).redISub(h),r=this.y.redAdd(this.y)}else{var c=this.z.redSqr(),f=this.y.redSqr(),l=this.x.redMul(f),d=this.x.redSub(c).redMul(this.x.redAdd(c));d=d.redAdd(d).redIAdd(d);var p=l.redIAdd(l),g=(p=p.redIAdd(p)).redAdd(p);t=d.redSqr().redISub(g),r=this.y.redAdd(this.z).redSqr().redISub(f).redISub(c);var y=f.redSqr();y=(y=(y=y.redIAdd(y)).redIAdd(y)).redIAdd(y),e=d.redMul(p.redISub(t)).redISub(y)}return this.curve.jpoint(t,e,r)},c.prototype._dbl=function(){var t=this.curve.a,e=this.x,r=this.y,i=this.z,n=i.redSqr().redSqr(),o=e.redSqr(),s=r.redSqr(),a=o.redAdd(o).redIAdd(o).redIAdd(t.redMul(n)),u=e.redAdd(e),h=(u=u.redIAdd(u)).redMul(s),c=a.redSqr().redISub(h.redAdd(h)),f=h.redISub(c),l=s.redSqr();l=(l=(l=l.redIAdd(l)).redIAdd(l)).redIAdd(l);var d=a.redMul(f).redISub(l),p=r.redAdd(r).redMul(i);return this.curve.jpoint(c,d,p)},c.prototype.trpl=function(){if(!this.curve.zeroA)return this.dbl().add(this);var t=this.x.redSqr(),e=this.y.redSqr(),r=this.z.redSqr(),i=e.redSqr(),n=t.redAdd(t).redIAdd(t),o=n.redSqr(),s=this.x.redAdd(e).redSqr().redISub(t).redISub(i),a=(s=(s=(s=s.redIAdd(s)).redAdd(s).redIAdd(s)).redISub(o)).redSqr(),u=i.redIAdd(i);u=(u=(u=u.redIAdd(u)).redIAdd(u)).redIAdd(u);var h=n.redIAdd(s).redSqr().redISub(o).redISub(a).redISub(u),c=e.redMul(h);c=(c=c.redIAdd(c)).redIAdd(c);var f=this.x.redMul(a).redISub(c);f=(f=f.redIAdd(f)).redIAdd(f);var l=this.y.redMul(h.redMul(u.redISub(h)).redISub(s.redMul(a)));l=(l=(l=l.redIAdd(l)).redIAdd(l)).redIAdd(l);var d=this.z.redAdd(s).redSqr().redISub(r).redISub(a);return this.curve.jpoint(f,l,d)},c.prototype.mul=function(t,e){return t=new n(t,e),this.curve._wnafMul(this,t)},c.prototype.eq=function(t){if("affine"===t.type)return this.eq(t.toJ());if(this===t)return!0;var e=this.z.redSqr(),r=t.z.redSqr();if(0!==this.x.redMul(r).redISub(t.x.redMul(e)).cmpn(0))return!1;var i=e.redMul(this.z),n=r.redMul(t.z);return 0===this.y.redMul(n).redISub(t.y.redMul(i)).cmpn(0)},c.prototype.eqXToP=function(t){var e=this.z.redSqr(),r=t.toRed(this.curve.red).redMul(e);if(0===this.x.cmp(r))return!0;for(var i=t.clone(),n=this.curve.redN.redMul(e);;){if(i.iadd(this.curve.n),i.cmp(this.curve.p)>=0)return!1;if(r.redIAdd(n),0===this.x.cmp(r))return!0}},c.prototype.inspect=function(){return this.isInfinity()?"<EC JPoint Infinity>":"<EC JPoint x: "+this.x.toString(16,2)+" y: "+this.y.toString(16,2)+" z: "+this.z.toString(16,2)+">"},c.prototype.isInfinity=function(){return 0===this.z.cmpn(0)}},45427:(t,e,r)=>{"use strict";var i,n=e,o=r(33715),s=r(88254),a=r(80953).assert;function u(t){"short"===t.type?this.curve=new s.short(t):"edwards"===t.type?this.curve=new s.edwards(t):this.curve=new s.mont(t),this.g=this.curve.g,this.n=this.curve.n,this.hash=t.hash,a(this.g.validate(),"Invalid curve"),a(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function h(t,e){Object.defineProperty(n,t,{configurable:!0,enumerable:!0,get:function(){var r=new u(e);return Object.defineProperty(n,t,{configurable:!0,enumerable:!0,value:r}),r}})}n.PresetCurve=u,h("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:o.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),h("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:o.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),h("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:o.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),h("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:o.sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]}),h("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:o.sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]}),h("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:o.sha256,gRed:!1,g:["9"]}),h("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:o.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});try{i=r(91037)}catch(t){i=void 0}h("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:o.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",i]})},57954:(t,e,r)=>{"use strict";var i=r(73785),n=r(2156),o=r(80953),s=r(45427),a=r(29931),u=o.assert,h=r(31251),c=r(90611);function f(t){if(!(this instanceof f))return new f(t);"string"==typeof t&&(u(Object.prototype.hasOwnProperty.call(s,t),"Unknown curve "+t),t=s[t]),t instanceof s.PresetCurve&&(t={curve:t}),this.curve=t.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=t.curve.g,this.g.precompute(t.curve.n.bitLength()+1),this.hash=t.hash||t.curve.hash}t.exports=f,f.prototype.keyPair=function(t){return new h(this,t)},f.prototype.keyFromPrivate=function(t,e){return h.fromPrivate(this,t,e)},f.prototype.keyFromPublic=function(t,e){return h.fromPublic(this,t,e)},f.prototype.genKeyPair=function(t){t||(t={});for(var e=new n({hash:this.hash,pers:t.pers,persEnc:t.persEnc||"utf8",entropy:t.entropy||a(this.hash.hmacStrength),entropyEnc:t.entropy&&t.entropyEnc||"utf8",nonce:this.n.toArray()}),r=this.n.byteLength(),o=this.n.sub(new i(2));;){var s=new i(e.generate(r));if(!(s.cmp(o)>0))return s.iaddn(1),this.keyFromPrivate(s)}},f.prototype._truncateToN=function(t,e){var r=8*t.byteLength()-this.n.bitLength();return r>0&&(t=t.ushrn(r)),!e&&t.cmp(this.n)>=0?t.sub(this.n):t},f.prototype.sign=function(t,e,r,o){"object"==typeof r&&(o=r,r=null),o||(o={}),e=this.keyFromPrivate(e,r),t=this._truncateToN(new i(t,16));for(var s=this.n.byteLength(),a=e.getPrivate().toArray("be",s),u=t.toArray("be",s),h=new n({hash:this.hash,entropy:a,nonce:u,pers:o.pers,persEnc:o.persEnc||"utf8"}),f=this.n.sub(new i(1)),l=0;;l++){var d=o.k?o.k(l):new i(h.generate(this.n.byteLength()));if(!((d=this._truncateToN(d,!0)).cmpn(1)<=0||d.cmp(f)>=0)){var p=this.g.mul(d);if(!p.isInfinity()){var g=p.getX(),y=g.umod(this.n);if(0!==y.cmpn(0)){var m=d.invm(this.n).mul(y.mul(e.getPrivate()).iadd(t));if(0!==(m=m.umod(this.n)).cmpn(0)){var v=(p.getY().isOdd()?1:0)|(0!==g.cmp(y)?2:0);return o.canonical&&m.cmp(this.nh)>0&&(m=this.n.sub(m),v^=1),new c({r:y,s:m,recoveryParam:v})}}}}}},f.prototype.verify=function(t,e,r,n){t=this._truncateToN(new i(t,16)),r=this.keyFromPublic(r,n);var o=(e=new c(e,"hex")).r,s=e.s;if(o.cmpn(1)<0||o.cmp(this.n)>=0)return!1;if(s.cmpn(1)<0||s.cmp(this.n)>=0)return!1;var a,u=s.invm(this.n),h=u.mul(t).umod(this.n),f=u.mul(o).umod(this.n);return this.curve._maxwellTrick?!(a=this.g.jmulAdd(h,r.getPublic(),f)).isInfinity()&&a.eqXToP(o):!(a=this.g.mulAdd(h,r.getPublic(),f)).isInfinity()&&0===a.getX().umod(this.n).cmp(o)},f.prototype.recoverPubKey=function(t,e,r,n){u((3&r)===r,"The recovery param is more than two bits"),e=new c(e,n);var o=this.n,s=new i(t),a=e.r,h=e.s,f=1&r,l=r>>1;if(a.cmp(this.curve.p.umod(this.curve.n))>=0&&l)throw new Error("Unable to find sencond key candinate");a=l?this.curve.pointFromX(a.add(this.curve.n),f):this.curve.pointFromX(a,f);var d=e.r.invm(o),p=o.sub(s).mul(d).umod(o),g=h.mul(d).umod(o);return this.g.mulAdd(p,a,g)},f.prototype.getKeyRecoveryParam=function(t,e,r,i){if(null!==(e=new c(e,i)).recoveryParam)return e.recoveryParam;for(var n=0;n<4;n++){var o;try{o=this.recoverPubKey(t,e,n)}catch(t){continue}if(o.eq(r))return n}throw new Error("Unable to find valid recovery factor")}},31251:(t,e,r)=>{"use strict";var i=r(73785),n=r(80953).assert;function o(t,e){this.ec=t,this.priv=null,this.pub=null,e.priv&&this._importPrivate(e.priv,e.privEnc),e.pub&&this._importPublic(e.pub,e.pubEnc)}t.exports=o,o.fromPublic=function(t,e,r){return e instanceof o?e:new o(t,{pub:e,pubEnc:r})},o.fromPrivate=function(t,e,r){return e instanceof o?e:new o(t,{priv:e,privEnc:r})},o.prototype.validate=function(){var t=this.getPublic();return t.isInfinity()?{result:!1,reason:"Invalid public key"}:t.validate()?t.mul(this.ec.curve.n).isInfinity()?{result:!0,reason:null}:{result:!1,reason:"Public key * N != O"}:{result:!1,reason:"Public key is not a point"}},o.prototype.getPublic=function(t,e){return"string"==typeof t&&(e=t,t=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),e?this.pub.encode(e,t):this.pub},o.prototype.getPrivate=function(t){return"hex"===t?this.priv.toString(16,2):this.priv},o.prototype._importPrivate=function(t,e){this.priv=new i(t,e||16),this.priv=this.priv.umod(this.ec.curve.n)},o.prototype._importPublic=function(t,e){if(t.x||t.y)return"mont"===this.ec.curve.type?n(t.x,"Need x coordinate"):"short"!==this.ec.curve.type&&"edwards"!==this.ec.curve.type||n(t.x&&t.y,"Need both x and y coordinate"),void(this.pub=this.ec.curve.point(t.x,t.y));this.pub=this.ec.curve.decodePoint(t,e)},o.prototype.derive=function(t){return t.validate()||n(t.validate(),"public point not validated"),t.mul(this.priv).getX()},o.prototype.sign=function(t,e,r){return this.ec.sign(t,this,e,r)},o.prototype.verify=function(t,e){return this.ec.verify(t,e,this)},o.prototype.inspect=function(){return"<Key priv: "+(this.priv&&this.priv.toString(16,2))+" pub: "+(this.pub&&this.pub.inspect())+" >"}},90611:(t,e,r)=>{"use strict";var i=r(73785),n=r(80953),o=n.assert;function s(t,e){if(t instanceof s)return t;this._importDER(t,e)||(o(t.r&&t.s,"Signature without r or s"),this.r=new i(t.r,16),this.s=new i(t.s,16),void 0===t.recoveryParam?this.recoveryParam=null:this.recoveryParam=t.recoveryParam)}function a(){this.place=0}function u(t,e){var r=t[e.place++];if(!(128&r))return r;var i=15&r;if(0===i||i>4)return!1;for(var n=0,o=0,s=e.place;o<i;o++,s++)n<<=8,n|=t[s],n>>>=0;return!(n<=127)&&(e.place=s,n)}function h(t){for(var e=0,r=t.length-1;!t[e]&&!(128&t[e+1])&&e<r;)e++;return 0===e?t:t.slice(e)}function c(t,e){if(e<128)t.push(e);else{var r=1+(Math.log(e)/Math.LN2>>>3);for(t.push(128|r);--r;)t.push(e>>>(r<<3)&255);t.push(e)}}t.exports=s,s.prototype._importDER=function(t,e){t=n.toArray(t,e);var r=new a;if(48!==t[r.place++])return!1;var o=u(t,r);if(!1===o)return!1;if(o+r.place!==t.length)return!1;if(2!==t[r.place++])return!1;var s=u(t,r);if(!1===s)return!1;var h=t.slice(r.place,s+r.place);if(r.place+=s,2!==t[r.place++])return!1;var c=u(t,r);if(!1===c)return!1;if(t.length!==c+r.place)return!1;var f=t.slice(r.place,c+r.place);if(0===h[0]){if(!(128&h[1]))return!1;h=h.slice(1)}if(0===f[0]){if(!(128&f[1]))return!1;f=f.slice(1)}return this.r=new i(h),this.s=new i(f),this.recoveryParam=null,!0},s.prototype.toDER=function(t){var e=this.r.toArray(),r=this.s.toArray();for(128&e[0]&&(e=[0].concat(e)),128&r[0]&&(r=[0].concat(r)),e=h(e),r=h(r);!(r[0]||128&r[1]);)r=r.slice(1);var i=[2];c(i,e.length),(i=i.concat(e)).push(2),c(i,r.length);var o=i.concat(r),s=[48];return c(s,o.length),s=s.concat(o),n.encode(s,t)}},65980:(t,e,r)=>{"use strict";var i=r(33715),n=r(45427),o=r(80953),s=o.assert,a=o.parseBytes,u=r(79087),h=r(23622);function c(t){if(s("ed25519"===t,"only tested with ed25519 so far"),!(this instanceof c))return new c(t);t=n[t].curve,this.curve=t,this.g=t.g,this.g.precompute(t.n.bitLength()+1),this.pointClass=t.point().constructor,this.encodingLength=Math.ceil(t.n.bitLength()/8),this.hash=i.sha512}t.exports=c,c.prototype.sign=function(t,e){t=a(t);var r=this.keyFromSecret(e),i=this.hashInt(r.messagePrefix(),t),n=this.g.mul(i),o=this.encodePoint(n),s=this.hashInt(o,r.pubBytes(),t).mul(r.priv()),u=i.add(s).umod(this.curve.n);return this.makeSignature({R:n,S:u,Rencoded:o})},c.prototype.verify=function(t,e,r){t=a(t),e=this.makeSignature(e);var i=this.keyFromPublic(r),n=this.hashInt(e.Rencoded(),i.pubBytes(),t),o=this.g.mul(e.S());return e.R().add(i.pub().mul(n)).eq(o)},c.prototype.hashInt=function(){for(var t=this.hash(),e=0;e<arguments.length;e++)t.update(arguments[e]);return o.intFromLE(t.digest()).umod(this.curve.n)},c.prototype.keyFromPublic=function(t){return u.fromPublic(this,t)},c.prototype.keyFromSecret=function(t){return u.fromSecret(this,t)},c.prototype.makeSignature=function(t){return t instanceof h?t:new h(this,t)},c.prototype.encodePoint=function(t){var e=t.getY().toArray("le",this.encodingLength);return e[this.encodingLength-1]|=t.getX().isOdd()?128:0,e},c.prototype.decodePoint=function(t){var e=(t=o.parseBytes(t)).length-1,r=t.slice(0,e).concat(-129&t[e]),i=0!=(128&t[e]),n=o.intFromLE(r);return this.curve.pointFromY(n,i)},c.prototype.encodeInt=function(t){return t.toArray("le",this.encodingLength)},c.prototype.decodeInt=function(t){return o.intFromLE(t)},c.prototype.isPoint=function(t){return t instanceof this.pointClass}},79087:(t,e,r)=>{"use strict";var i=r(80953),n=i.assert,o=i.parseBytes,s=i.cachedProperty;function a(t,e){this.eddsa=t,this._secret=o(e.secret),t.isPoint(e.pub)?this._pub=e.pub:this._pubBytes=o(e.pub)}a.fromPublic=function(t,e){return e instanceof a?e:new a(t,{pub:e})},a.fromSecret=function(t,e){return e instanceof a?e:new a(t,{secret:e})},a.prototype.secret=function(){return this._secret},s(a,"pubBytes",(function(){return this.eddsa.encodePoint(this.pub())})),s(a,"pub",(function(){return this._pubBytes?this.eddsa.decodePoint(this._pubBytes):this.eddsa.g.mul(this.priv())})),s(a,"privBytes",(function(){var t=this.eddsa,e=this.hash(),r=t.encodingLength-1,i=e.slice(0,t.encodingLength);return i[0]&=248,i[r]&=127,i[r]|=64,i})),s(a,"priv",(function(){return this.eddsa.decodeInt(this.privBytes())})),s(a,"hash",(function(){return this.eddsa.hash().update(this.secret()).digest()})),s(a,"messagePrefix",(function(){return this.hash().slice(this.eddsa.encodingLength)})),a.prototype.sign=function(t){return n(this._secret,"KeyPair can only verify"),this.eddsa.sign(t,this)},a.prototype.verify=function(t,e){return this.eddsa.verify(t,e,this)},a.prototype.getSecret=function(t){return n(this._secret,"KeyPair is public only"),i.encode(this.secret(),t)},a.prototype.getPublic=function(t){return i.encode(this.pubBytes(),t)},t.exports=a},23622:(t,e,r)=>{"use strict";var i=r(73785),n=r(80953),o=n.assert,s=n.cachedProperty,a=n.parseBytes;function u(t,e){this.eddsa=t,"object"!=typeof e&&(e=a(e)),Array.isArray(e)&&(e={R:e.slice(0,t.encodingLength),S:e.slice(t.encodingLength)}),o(e.R&&e.S,"Signature without R or S"),t.isPoint(e.R)&&(this._R=e.R),e.S instanceof i&&(this._S=e.S),this._Rencoded=Array.isArray(e.R)?e.R:e.Rencoded,this._Sencoded=Array.isArray(e.S)?e.S:e.Sencoded}s(u,"S",(function(){return this.eddsa.decodeInt(this.Sencoded())})),s(u,"R",(function(){return this.eddsa.decodePoint(this.Rencoded())})),s(u,"Rencoded",(function(){return this.eddsa.encodePoint(this.R())})),s(u,"Sencoded",(function(){return this.eddsa.encodeInt(this.S())})),u.prototype.toBytes=function(){return this.Rencoded().concat(this.Sencoded())},u.prototype.toHex=function(){return n.encode(this.toBytes(),"hex").toUpperCase()},t.exports=u},91037:t=>{t.exports={doubles:{step:4,points:[["e60fce93b59e9ec53011aabc21c23e97b2a31369b87a5ae9c44ee89e2a6dec0a","f7e3507399e595929db99f34f57937101296891e44d23f0be1f32cce69616821"],["8282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508","11f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf"],["175e159f728b865a72f99cc6c6fc846de0b93833fd2222ed73fce5b551e5b739","d3506e0d9e3c79eba4ef97a51ff71f5eacb5955add24345c6efa6ffee9fed695"],["363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640","4e273adfc732221953b445397f3363145b9a89008199ecb62003c7f3bee9de9"],["8b4b5f165df3c2be8c6244b5b745638843e4a781a15bcd1b69f79a55dffdf80c","4aad0a6f68d308b4b3fbd7813ab0da04f9e336546162ee56b3eff0c65fd4fd36"],["723cbaa6e5db996d6bf771c00bd548c7b700dbffa6c0e77bcb6115925232fcda","96e867b5595cc498a921137488824d6e2660a0653779494801dc069d9eb39f5f"],["eebfa4d493bebf98ba5feec812c2d3b50947961237a919839a533eca0e7dd7fa","5d9a8ca3970ef0f269ee7edaf178089d9ae4cdc3a711f712ddfd4fdae1de8999"],["100f44da696e71672791d0a09b7bde459f1215a29b3c03bfefd7835b39a48db0","cdd9e13192a00b772ec8f3300c090666b7ff4a18ff5195ac0fbd5cd62bc65a09"],["e1031be262c7ed1b1dc9227a4a04c017a77f8d4464f3b3852c8acde6e534fd2d","9d7061928940405e6bb6a4176597535af292dd419e1ced79a44f18f29456a00d"],["feea6cae46d55b530ac2839f143bd7ec5cf8b266a41d6af52d5e688d9094696d","e57c6b6c97dce1bab06e4e12bf3ecd5c981c8957cc41442d3155debf18090088"],["da67a91d91049cdcb367be4be6ffca3cfeed657d808583de33fa978bc1ec6cb1","9bacaa35481642bc41f463f7ec9780e5dec7adc508f740a17e9ea8e27a68be1d"],["53904faa0b334cdda6e000935ef22151ec08d0f7bb11069f57545ccc1a37b7c0","5bc087d0bc80106d88c9eccac20d3c1c13999981e14434699dcb096b022771c8"],["8e7bcd0bd35983a7719cca7764ca906779b53a043a9b8bcaeff959f43ad86047","10b7770b2a3da4b3940310420ca9514579e88e2e47fd68b3ea10047e8460372a"],["385eed34c1cdff21e6d0818689b81bde71a7f4f18397e6690a841e1599c43862","283bebc3e8ea23f56701de19e9ebf4576b304eec2086dc8cc0458fe5542e5453"],["6f9d9b803ecf191637c73a4413dfa180fddf84a5947fbc9c606ed86c3fac3a7","7c80c68e603059ba69b8e2a30e45c4d47ea4dd2f5c281002d86890603a842160"],["3322d401243c4e2582a2147c104d6ecbf774d163db0f5e5313b7e0e742d0e6bd","56e70797e9664ef5bfb019bc4ddaf9b72805f63ea2873af624f3a2e96c28b2a0"],["85672c7d2de0b7da2bd1770d89665868741b3f9af7643397721d74d28134ab83","7c481b9b5b43b2eb6374049bfa62c2e5e77f17fcc5298f44c8e3094f790313a6"],["948bf809b1988a46b06c9f1919413b10f9226c60f668832ffd959af60c82a0a","53a562856dcb6646dc6b74c5d1c3418c6d4dff08c97cd2bed4cb7f88d8c8e589"],["6260ce7f461801c34f067ce0f02873a8f1b0e44dfc69752accecd819f38fd8e8","bc2da82b6fa5b571a7f09049776a1ef7ecd292238051c198c1a84e95b2b4ae17"],["e5037de0afc1d8d43d8348414bbf4103043ec8f575bfdc432953cc8d2037fa2d","4571534baa94d3b5f9f98d09fb990bddbd5f5b03ec481f10e0e5dc841d755bda"],["e06372b0f4a207adf5ea905e8f1771b4e7e8dbd1c6a6c5b725866a0ae4fce725","7a908974bce18cfe12a27bb2ad5a488cd7484a7787104870b27034f94eee31dd"],["213c7a715cd5d45358d0bbf9dc0ce02204b10bdde2a3f58540ad6908d0559754","4b6dad0b5ae462507013ad06245ba190bb4850f5f36a7eeddff2c27534b458f2"],["4e7c272a7af4b34e8dbb9352a5419a87e2838c70adc62cddf0cc3a3b08fbd53c","17749c766c9d0b18e16fd09f6def681b530b9614bff7dd33e0b3941817dcaae6"],["fea74e3dbe778b1b10f238ad61686aa5c76e3db2be43057632427e2840fb27b6","6e0568db9b0b13297cf674deccb6af93126b596b973f7b77701d3db7f23cb96f"],["76e64113f677cf0e10a2570d599968d31544e179b760432952c02a4417bdde39","c90ddf8dee4e95cf577066d70681f0d35e2a33d2b56d2032b4b1752d1901ac01"],["c738c56b03b2abe1e8281baa743f8f9a8f7cc643df26cbee3ab150242bcbb891","893fb578951ad2537f718f2eacbfbbbb82314eef7880cfe917e735d9699a84c3"],["d895626548b65b81e264c7637c972877d1d72e5f3a925014372e9f6588f6c14b","febfaa38f2bc7eae728ec60818c340eb03428d632bb067e179363ed75d7d991f"],["b8da94032a957518eb0f6433571e8761ceffc73693e84edd49150a564f676e03","2804dfa44805a1e4d7c99cc9762808b092cc584d95ff3b511488e4e74efdf6e7"],["e80fea14441fb33a7d8adab9475d7fab2019effb5156a792f1a11778e3c0df5d","eed1de7f638e00771e89768ca3ca94472d155e80af322ea9fcb4291b6ac9ec78"],["a301697bdfcd704313ba48e51d567543f2a182031efd6915ddc07bbcc4e16070","7370f91cfb67e4f5081809fa25d40f9b1735dbf7c0a11a130c0d1a041e177ea1"],["90ad85b389d6b936463f9d0512678de208cc330b11307fffab7ac63e3fb04ed4","e507a3620a38261affdcbd9427222b839aefabe1582894d991d4d48cb6ef150"],["8f68b9d2f63b5f339239c1ad981f162ee88c5678723ea3351b7b444c9ec4c0da","662a9f2dba063986de1d90c2b6be215dbbea2cfe95510bfdf23cbf79501fff82"],["e4f3fb0176af85d65ff99ff9198c36091f48e86503681e3e6686fd5053231e11","1e63633ad0ef4f1c1661a6d0ea02b7286cc7e74ec951d1c9822c38576feb73bc"],["8c00fa9b18ebf331eb961537a45a4266c7034f2f0d4e1d0716fb6eae20eae29e","efa47267fea521a1a9dc343a3736c974c2fadafa81e36c54e7d2a4c66702414b"],["e7a26ce69dd4829f3e10cec0a9e98ed3143d084f308b92c0997fddfc60cb3e41","2a758e300fa7984b471b006a1aafbb18d0a6b2c0420e83e20e8a9421cf2cfd51"],["b6459e0ee3662ec8d23540c223bcbdc571cbcb967d79424f3cf29eb3de6b80ef","67c876d06f3e06de1dadf16e5661db3c4b3ae6d48e35b2ff30bf0b61a71ba45"],["d68a80c8280bb840793234aa118f06231d6f1fc67e73c5a5deda0f5b496943e8","db8ba9fff4b586d00c4b1f9177b0e28b5b0e7b8f7845295a294c84266b133120"],["324aed7df65c804252dc0270907a30b09612aeb973449cea4095980fc28d3d5d","648a365774b61f2ff130c0c35aec1f4f19213b0c7e332843967224af96ab7c84"],["4df9c14919cde61f6d51dfdbe5fee5dceec4143ba8d1ca888e8bd373fd054c96","35ec51092d8728050974c23a1d85d4b5d506cdc288490192ebac06cad10d5d"],["9c3919a84a474870faed8a9c1cc66021523489054d7f0308cbfc99c8ac1f98cd","ddb84f0f4a4ddd57584f044bf260e641905326f76c64c8e6be7e5e03d4fc599d"],["6057170b1dd12fdf8de05f281d8e06bb91e1493a8b91d4cc5a21382120a959e5","9a1af0b26a6a4807add9a2daf71df262465152bc3ee24c65e899be932385a2a8"],["a576df8e23a08411421439a4518da31880cef0fba7d4df12b1a6973eecb94266","40a6bf20e76640b2c92b97afe58cd82c432e10a7f514d9f3ee8be11ae1b28ec8"],["7778a78c28dec3e30a05fe9629de8c38bb30d1f5cf9a3a208f763889be58ad71","34626d9ab5a5b22ff7098e12f2ff580087b38411ff24ac563b513fc1fd9f43ac"],["928955ee637a84463729fd30e7afd2ed5f96274e5ad7e5cb09eda9c06d903ac","c25621003d3f42a827b78a13093a95eeac3d26efa8a8d83fc5180e935bcd091f"],["85d0fef3ec6db109399064f3a0e3b2855645b4a907ad354527aae75163d82751","1f03648413a38c0be29d496e582cf5663e8751e96877331582c237a24eb1f962"],["ff2b0dce97eece97c1c9b6041798b85dfdfb6d8882da20308f5404824526087e","493d13fef524ba188af4c4dc54d07936c7b7ed6fb90e2ceb2c951e01f0c29907"],["827fbbe4b1e880ea9ed2b2e6301b212b57f1ee148cd6dd28780e5e2cf856e241","c60f9c923c727b0b71bef2c67d1d12687ff7a63186903166d605b68baec293ec"],["eaa649f21f51bdbae7be4ae34ce6e5217a58fdce7f47f9aa7f3b58fa2120e2b3","be3279ed5bbbb03ac69a80f89879aa5a01a6b965f13f7e59d47a5305ba5ad93d"],["e4a42d43c5cf169d9391df6decf42ee541b6d8f0c9a137401e23632dda34d24f","4d9f92e716d1c73526fc99ccfb8ad34ce886eedfa8d8e4f13a7f7131deba9414"],["1ec80fef360cbdd954160fadab352b6b92b53576a88fea4947173b9d4300bf19","aeefe93756b5340d2f3a4958a7abbf5e0146e77f6295a07b671cdc1cc107cefd"],["146a778c04670c2f91b00af4680dfa8bce3490717d58ba889ddb5928366642be","b318e0ec3354028add669827f9d4b2870aaa971d2f7e5ed1d0b297483d83efd0"],["fa50c0f61d22e5f07e3acebb1aa07b128d0012209a28b9776d76a8793180eef9","6b84c6922397eba9b72cd2872281a68a5e683293a57a213b38cd8d7d3f4f2811"],["da1d61d0ca721a11b1a5bf6b7d88e8421a288ab5d5bba5220e53d32b5f067ec2","8157f55a7c99306c79c0766161c91e2966a73899d279b48a655fba0f1ad836f1"],["a8e282ff0c9706907215ff98e8fd416615311de0446f1e062a73b0610d064e13","7f97355b8db81c09abfb7f3c5b2515888b679a3e50dd6bd6cef7c73111f4cc0c"],["174a53b9c9a285872d39e56e6913cab15d59b1fa512508c022f382de8319497c","ccc9dc37abfc9c1657b4155f2c47f9e6646b3a1d8cb9854383da13ac079afa73"],["959396981943785c3d3e57edf5018cdbe039e730e4918b3d884fdff09475b7ba","2e7e552888c331dd8ba0386a4b9cd6849c653f64c8709385e9b8abf87524f2fd"],["d2a63a50ae401e56d645a1153b109a8fcca0a43d561fba2dbb51340c9d82b151","e82d86fb6443fcb7565aee58b2948220a70f750af484ca52d4142174dcf89405"],["64587e2335471eb890ee7896d7cfdc866bacbdbd3839317b3436f9b45617e073","d99fcdd5bf6902e2ae96dd6447c299a185b90a39133aeab358299e5e9faf6589"],["8481bde0e4e4d885b3a546d3e549de042f0aa6cea250e7fd358d6c86dd45e458","38ee7b8cba5404dd84a25bf39cecb2ca900a79c42b262e556d64b1b59779057e"],["13464a57a78102aa62b6979ae817f4637ffcfed3c4b1ce30bcd6303f6caf666b","69be159004614580ef7e433453ccb0ca48f300a81d0942e13f495a907f6ecc27"],["bc4a9df5b713fe2e9aef430bcc1dc97a0cd9ccede2f28588cada3a0d2d83f366","d3a81ca6e785c06383937adf4b798caa6e8a9fbfa547b16d758d666581f33c1"],["8c28a97bf8298bc0d23d8c749452a32e694b65e30a9472a3954ab30fe5324caa","40a30463a3305193378fedf31f7cc0eb7ae784f0451cb9459e71dc73cbef9482"],["8ea9666139527a8c1dd94ce4f071fd23c8b350c5a4bb33748c4ba111faccae0","620efabbc8ee2782e24e7c0cfb95c5d735b783be9cf0f8e955af34a30e62b945"],["dd3625faef5ba06074669716bbd3788d89bdde815959968092f76cc4eb9a9787","7a188fa3520e30d461da2501045731ca941461982883395937f68d00c644a573"],["f710d79d9eb962297e4f6232b40e8f7feb2bc63814614d692c12de752408221e","ea98e67232d3b3295d3b535532115ccac8612c721851617526ae47a9c77bfc82"]]},naf:{wnd:7,points:[["f9308a019258c31049344f85f89d5229b531c845836f99b08601f113bce036f9","388f7b0f632de8140fe337e62a37f3566500a99934c2231b6cb9fd7584b8e672"],["2f8bde4d1a07209355b4a7250a5c5128e88b84bddc619ab7cba8d569b240efe4","d8ac222636e5e3d6d4dba9dda6c9c426f788271bab0d6840dca87d3aa6ac62d6"],["5cbdf0646e5db4eaa398f365f2ea7a0e3d419b7e0330e39ce92bddedcac4f9bc","6aebca40ba255960a3178d6d861a54dba813d0b813fde7b5a5082628087264da"],["acd484e2f0c7f65309ad178a9f559abde09796974c57e714c35f110dfc27ccbe","cc338921b0a7d9fd64380971763b61e9add888a4375f8e0f05cc262ac64f9c37"],["774ae7f858a9411e5ef4246b70c65aac5649980be5c17891bbec17895da008cb","d984a032eb6b5e190243dd56d7b7b365372db1e2dff9d6a8301d74c9c953c61b"],["f28773c2d975288bc7d1d205c3748651b075fbc6610e58cddeeddf8f19405aa8","ab0902e8d880a89758212eb65cdaf473a1a06da521fa91f29b5cb52db03ed81"],["d7924d4f7d43ea965a465ae3095ff41131e5946f3c85f79e44adbcf8e27e080e","581e2872a86c72a683842ec228cc6defea40af2bd896d3a5c504dc9ff6a26b58"],["defdea4cdb677750a420fee807eacf21eb9898ae79b9768766e4faa04a2d4a34","4211ab0694635168e997b0ead2a93daeced1f4a04a95c0f6cfb199f69e56eb77"],["2b4ea0a797a443d293ef5cff444f4979f06acfebd7e86d277475656138385b6c","85e89bc037945d93b343083b5a1c86131a01f60c50269763b570c854e5c09b7a"],["352bbf4a4cdd12564f93fa332ce333301d9ad40271f8107181340aef25be59d5","321eb4075348f534d59c18259dda3e1f4a1b3b2e71b1039c67bd3d8bcf81998c"],["2fa2104d6b38d11b0230010559879124e42ab8dfeff5ff29dc9cdadd4ecacc3f","2de1068295dd865b64569335bd5dd80181d70ecfc882648423ba76b532b7d67"],["9248279b09b4d68dab21a9b066edda83263c3d84e09572e269ca0cd7f5453714","73016f7bf234aade5d1aa71bdea2b1ff3fc0de2a887912ffe54a32ce97cb3402"],["daed4f2be3a8bf278e70132fb0beb7522f570e144bf615c07e996d443dee8729","a69dce4a7d6c98e8d4a1aca87ef8d7003f83c230f3afa726ab40e52290be1c55"],["c44d12c7065d812e8acf28d7cbb19f9011ecd9e9fdf281b0e6a3b5e87d22e7db","2119a460ce326cdc76c45926c982fdac0e106e861edf61c5a039063f0e0e6482"],["6a245bf6dc698504c89a20cfded60853152b695336c28063b61c65cbd269e6b4","e022cf42c2bd4a708b3f5126f16a24ad8b33ba48d0423b6efd5e6348100d8a82"],["1697ffa6fd9de627c077e3d2fe541084ce13300b0bec1146f95ae57f0d0bd6a5","b9c398f186806f5d27561506e4557433a2cf15009e498ae7adee9d63d01b2396"],["605bdb019981718b986d0f07e834cb0d9deb8360ffb7f61df982345ef27a7479","2972d2de4f8d20681a78d93ec96fe23c26bfae84fb14db43b01e1e9056b8c49"],["62d14dab4150bf497402fdc45a215e10dcb01c354959b10cfe31c7e9d87ff33d","80fc06bd8cc5b01098088a1950eed0db01aa132967ab472235f5642483b25eaf"],["80c60ad0040f27dade5b4b06c408e56b2c50e9f56b9b8b425e555c2f86308b6f","1c38303f1cc5c30f26e66bad7fe72f70a65eed4cbe7024eb1aa01f56430bd57a"],["7a9375ad6167ad54aa74c6348cc54d344cc5dc9487d847049d5eabb0fa03c8fb","d0e3fa9eca8726909559e0d79269046bdc59ea10c70ce2b02d499ec224dc7f7"],["d528ecd9b696b54c907a9ed045447a79bb408ec39b68df504bb51f459bc3ffc9","eecf41253136e5f99966f21881fd656ebc4345405c520dbc063465b521409933"],["49370a4b5f43412ea25f514e8ecdad05266115e4a7ecb1387231808f8b45963","758f3f41afd6ed428b3081b0512fd62a54c3f3afbb5b6764b653052a12949c9a"],["77f230936ee88cbbd73df930d64702ef881d811e0e1498e2f1c13eb1fc345d74","958ef42a7886b6400a08266e9ba1b37896c95330d97077cbbe8eb3c7671c60d6"],["f2dac991cc4ce4b9ea44887e5c7c0bce58c80074ab9d4dbaeb28531b7739f530","e0dedc9b3b2f8dad4da1f32dec2531df9eb5fbeb0598e4fd1a117dba703a3c37"],["463b3d9f662621fb1b4be8fbbe2520125a216cdfc9dae3debcba4850c690d45b","5ed430d78c296c3543114306dd8622d7c622e27c970a1de31cb377b01af7307e"],["f16f804244e46e2a09232d4aff3b59976b98fac14328a2d1a32496b49998f247","cedabd9b82203f7e13d206fcdf4e33d92a6c53c26e5cce26d6579962c4e31df6"],["caf754272dc84563b0352b7a14311af55d245315ace27c65369e15f7151d41d1","cb474660ef35f5f2a41b643fa5e460575f4fa9b7962232a5c32f908318a04476"],["2600ca4b282cb986f85d0f1709979d8b44a09c07cb86d7c124497bc86f082120","4119b88753c15bd6a693b03fcddbb45d5ac6be74ab5f0ef44b0be9475a7e4b40"],["7635ca72d7e8432c338ec53cd12220bc01c48685e24f7dc8c602a7746998e435","91b649609489d613d1d5e590f78e6d74ecfc061d57048bad9e76f302c5b9c61"],["754e3239f325570cdbbf4a87deee8a66b7f2b33479d468fbc1a50743bf56cc18","673fb86e5bda30fb3cd0ed304ea49a023ee33d0197a695d0c5d98093c536683"],["e3e6bd1071a1e96aff57859c82d570f0330800661d1c952f9fe2694691d9b9e8","59c9e0bba394e76f40c0aa58379a3cb6a5a2283993e90c4167002af4920e37f5"],["186b483d056a033826ae73d88f732985c4ccb1f32ba35f4b4cc47fdcf04aa6eb","3b952d32c67cf77e2e17446e204180ab21fb8090895138b4a4a797f86e80888b"],["df9d70a6b9876ce544c98561f4be4f725442e6d2b737d9c91a8321724ce0963f","55eb2dafd84d6ccd5f862b785dc39d4ab157222720ef9da217b8c45cf2ba2417"],["5edd5cc23c51e87a497ca815d5dce0f8ab52554f849ed8995de64c5f34ce7143","efae9c8dbc14130661e8cec030c89ad0c13c66c0d17a2905cdc706ab7399a868"],["290798c2b6476830da12fe02287e9e777aa3fba1c355b17a722d362f84614fba","e38da76dcd440621988d00bcf79af25d5b29c094db2a23146d003afd41943e7a"],["af3c423a95d9f5b3054754efa150ac39cd29552fe360257362dfdecef4053b45","f98a3fd831eb2b749a93b0e6f35cfb40c8cd5aa667a15581bc2feded498fd9c6"],["766dbb24d134e745cccaa28c99bf274906bb66b26dcf98df8d2fed50d884249a","744b1152eacbe5e38dcc887980da38b897584a65fa06cedd2c924f97cbac5996"],["59dbf46f8c94759ba21277c33784f41645f7b44f6c596a58ce92e666191abe3e","c534ad44175fbc300f4ea6ce648309a042ce739a7919798cd85e216c4a307f6e"],["f13ada95103c4537305e691e74e9a4a8dd647e711a95e73cb62dc6018cfd87b8","e13817b44ee14de663bf4bc808341f326949e21a6a75c2570778419bdaf5733d"],["7754b4fa0e8aced06d4167a2c59cca4cda1869c06ebadfb6488550015a88522c","30e93e864e669d82224b967c3020b8fa8d1e4e350b6cbcc537a48b57841163a2"],["948dcadf5990e048aa3874d46abef9d701858f95de8041d2a6828c99e2262519","e491a42537f6e597d5d28a3224b1bc25df9154efbd2ef1d2cbba2cae5347d57e"],["7962414450c76c1689c7b48f8202ec37fb224cf5ac0bfa1570328a8a3d7c77ab","100b610ec4ffb4760d5c1fc133ef6f6b12507a051f04ac5760afa5b29db83437"],["3514087834964b54b15b160644d915485a16977225b8847bb0dd085137ec47ca","ef0afbb2056205448e1652c48e8127fc6039e77c15c2378b7e7d15a0de293311"],["d3cc30ad6b483e4bc79ce2c9dd8bc54993e947eb8df787b442943d3f7b527eaf","8b378a22d827278d89c5e9be8f9508ae3c2ad46290358630afb34db04eede0a4"],["1624d84780732860ce1c78fcbfefe08b2b29823db913f6493975ba0ff4847610","68651cf9b6da903e0914448c6cd9d4ca896878f5282be4c8cc06e2a404078575"],["733ce80da955a8a26902c95633e62a985192474b5af207da6df7b4fd5fc61cd4","f5435a2bd2badf7d485a4d8b8db9fcce3e1ef8e0201e4578c54673bc1dc5ea1d"],["15d9441254945064cf1a1c33bbd3b49f8966c5092171e699ef258dfab81c045c","d56eb30b69463e7234f5137b73b84177434800bacebfc685fc37bbe9efe4070d"],["a1d0fcf2ec9de675b612136e5ce70d271c21417c9d2b8aaaac138599d0717940","edd77f50bcb5a3cab2e90737309667f2641462a54070f3d519212d39c197a629"],["e22fbe15c0af8ccc5780c0735f84dbe9a790badee8245c06c7ca37331cb36980","a855babad5cd60c88b430a69f53a1a7a38289154964799be43d06d77d31da06"],["311091dd9860e8e20ee13473c1155f5f69635e394704eaa74009452246cfa9b3","66db656f87d1f04fffd1f04788c06830871ec5a64feee685bd80f0b1286d8374"],["34c1fd04d301be89b31c0442d3e6ac24883928b45a9340781867d4232ec2dbdf","9414685e97b1b5954bd46f730174136d57f1ceeb487443dc5321857ba73abee"],["f219ea5d6b54701c1c14de5b557eb42a8d13f3abbcd08affcc2a5e6b049b8d63","4cb95957e83d40b0f73af4544cccf6b1f4b08d3c07b27fb8d8c2962a400766d1"],["d7b8740f74a8fbaab1f683db8f45de26543a5490bca627087236912469a0b448","fa77968128d9c92ee1010f337ad4717eff15db5ed3c049b3411e0315eaa4593b"],["32d31c222f8f6f0ef86f7c98d3a3335ead5bcd32abdd94289fe4d3091aa824bf","5f3032f5892156e39ccd3d7915b9e1da2e6dac9e6f26e961118d14b8462e1661"],["7461f371914ab32671045a155d9831ea8793d77cd59592c4340f86cbc18347b5","8ec0ba238b96bec0cbdddcae0aa442542eee1ff50c986ea6b39847b3cc092ff6"],["ee079adb1df1860074356a25aa38206a6d716b2c3e67453d287698bad7b2b2d6","8dc2412aafe3be5c4c5f37e0ecc5f9f6a446989af04c4e25ebaac479ec1c8c1e"],["16ec93e447ec83f0467b18302ee620f7e65de331874c9dc72bfd8616ba9da6b5","5e4631150e62fb40d0e8c2a7ca5804a39d58186a50e497139626778e25b0674d"],["eaa5f980c245f6f038978290afa70b6bd8855897f98b6aa485b96065d537bd99","f65f5d3e292c2e0819a528391c994624d784869d7e6ea67fb18041024edc07dc"],["78c9407544ac132692ee1910a02439958ae04877151342ea96c4b6b35a49f51","f3e0319169eb9b85d5404795539a5e68fa1fbd583c064d2462b675f194a3ddb4"],["494f4be219a1a77016dcd838431aea0001cdc8ae7a6fc688726578d9702857a5","42242a969283a5f339ba7f075e36ba2af925ce30d767ed6e55f4b031880d562c"],["a598a8030da6d86c6bc7f2f5144ea549d28211ea58faa70ebf4c1e665c1fe9b5","204b5d6f84822c307e4b4a7140737aec23fc63b65b35f86a10026dbd2d864e6b"],["c41916365abb2b5d09192f5f2dbeafec208f020f12570a184dbadc3e58595997","4f14351d0087efa49d245b328984989d5caf9450f34bfc0ed16e96b58fa9913"],["841d6063a586fa475a724604da03bc5b92a2e0d2e0a36acfe4c73a5514742881","73867f59c0659e81904f9a1c7543698e62562d6744c169ce7a36de01a8d6154"],["5e95bb399a6971d376026947f89bde2f282b33810928be4ded112ac4d70e20d5","39f23f366809085beebfc71181313775a99c9aed7d8ba38b161384c746012865"],["36e4641a53948fd476c39f8a99fd974e5ec07564b5315d8bf99471bca0ef2f66","d2424b1b1abe4eb8164227b085c9aa9456ea13493fd563e06fd51cf5694c78fc"],["336581ea7bfbbb290c191a2f507a41cf5643842170e914faeab27c2c579f726","ead12168595fe1be99252129b6e56b3391f7ab1410cd1e0ef3dcdcabd2fda224"],["8ab89816dadfd6b6a1f2634fcf00ec8403781025ed6890c4849742706bd43ede","6fdcef09f2f6d0a044e654aef624136f503d459c3e89845858a47a9129cdd24e"],["1e33f1a746c9c5778133344d9299fcaa20b0938e8acff2544bb40284b8c5fb94","60660257dd11b3aa9c8ed618d24edff2306d320f1d03010e33a7d2057f3b3b6"],["85b7c1dcb3cec1b7ee7f30ded79dd20a0ed1f4cc18cbcfcfa410361fd8f08f31","3d98a9cdd026dd43f39048f25a8847f4fcafad1895d7a633c6fed3c35e999511"],["29df9fbd8d9e46509275f4b125d6d45d7fbe9a3b878a7af872a2800661ac5f51","b4c4fe99c775a606e2d8862179139ffda61dc861c019e55cd2876eb2a27d84b"],["a0b1cae06b0a847a3fea6e671aaf8adfdfe58ca2f768105c8082b2e449fce252","ae434102edde0958ec4b19d917a6a28e6b72da1834aff0e650f049503a296cf2"],["4e8ceafb9b3e9a136dc7ff67e840295b499dfb3b2133e4ba113f2e4c0e121e5","cf2174118c8b6d7a4b48f6d534ce5c79422c086a63460502b827ce62a326683c"],["d24a44e047e19b6f5afb81c7ca2f69080a5076689a010919f42725c2b789a33b","6fb8d5591b466f8fc63db50f1c0f1c69013f996887b8244d2cdec417afea8fa3"],["ea01606a7a6c9cdd249fdfcfacb99584001edd28abbab77b5104e98e8e3b35d4","322af4908c7312b0cfbfe369f7a7b3cdb7d4494bc2823700cfd652188a3ea98d"],["af8addbf2b661c8a6c6328655eb96651252007d8c5ea31be4ad196de8ce2131f","6749e67c029b85f52a034eafd096836b2520818680e26ac8f3dfbcdb71749700"],["e3ae1974566ca06cc516d47e0fb165a674a3dabcfca15e722f0e3450f45889","2aeabe7e4531510116217f07bf4d07300de97e4874f81f533420a72eeb0bd6a4"],["591ee355313d99721cf6993ffed1e3e301993ff3ed258802075ea8ced397e246","b0ea558a113c30bea60fc4775460c7901ff0b053d25ca2bdeee98f1a4be5d196"],["11396d55fda54c49f19aa97318d8da61fa8584e47b084945077cf03255b52984","998c74a8cd45ac01289d5833a7beb4744ff536b01b257be4c5767bea93ea57a4"],["3c5d2a1ba39c5a1790000738c9e0c40b8dcdfd5468754b6405540157e017aa7a","b2284279995a34e2f9d4de7396fc18b80f9b8b9fdd270f6661f79ca4c81bd257"],["cc8704b8a60a0defa3a99a7299f2e9c3fbc395afb04ac078425ef8a1793cc030","bdd46039feed17881d1e0862db347f8cf395b74fc4bcdc4e940b74e3ac1f1b13"],["c533e4f7ea8555aacd9777ac5cad29b97dd4defccc53ee7ea204119b2889b197","6f0a256bc5efdf429a2fb6242f1a43a2d9b925bb4a4b3a26bb8e0f45eb596096"],["c14f8f2ccb27d6f109f6d08d03cc96a69ba8c34eec07bbcf566d48e33da6593","c359d6923bb398f7fd4473e16fe1c28475b740dd098075e6c0e8649113dc3a38"],["a6cbc3046bc6a450bac24789fa17115a4c9739ed75f8f21ce441f72e0b90e6ef","21ae7f4680e889bb130619e2c0f95a360ceb573c70603139862afd617fa9b9f"],["347d6d9a02c48927ebfb86c1359b1caf130a3c0267d11ce6344b39f99d43cc38","60ea7f61a353524d1c987f6ecec92f086d565ab687870cb12689ff1e31c74448"],["da6545d2181db8d983f7dcb375ef5866d47c67b1bf31c8cf855ef7437b72656a","49b96715ab6878a79e78f07ce5680c5d6673051b4935bd897fea824b77dc208a"],["c40747cc9d012cb1a13b8148309c6de7ec25d6945d657146b9d5994b8feb1111","5ca560753be2a12fc6de6caf2cb489565db936156b9514e1bb5e83037e0fa2d4"],["4e42c8ec82c99798ccf3a610be870e78338c7f713348bd34c8203ef4037f3502","7571d74ee5e0fb92a7a8b33a07783341a5492144cc54bcc40a94473693606437"],["3775ab7089bc6af823aba2e1af70b236d251cadb0c86743287522a1b3b0dedea","be52d107bcfa09d8bcb9736a828cfa7fac8db17bf7a76a2c42ad961409018cf7"],["cee31cbf7e34ec379d94fb814d3d775ad954595d1314ba8846959e3e82f74e26","8fd64a14c06b589c26b947ae2bcf6bfa0149ef0be14ed4d80f448a01c43b1c6d"],["b4f9eaea09b6917619f6ea6a4eb5464efddb58fd45b1ebefcdc1a01d08b47986","39e5c9925b5a54b07433a4f18c61726f8bb131c012ca542eb24a8ac07200682a"],["d4263dfc3d2df923a0179a48966d30ce84e2515afc3dccc1b77907792ebcc60e","62dfaf07a0f78feb30e30d6295853ce189e127760ad6cf7fae164e122a208d54"],["48457524820fa65a4f8d35eb6930857c0032acc0a4a2de422233eeda897612c4","25a748ab367979d98733c38a1fa1c2e7dc6cc07db2d60a9ae7a76aaa49bd0f77"],["dfeeef1881101f2cb11644f3a2afdfc2045e19919152923f367a1767c11cceda","ecfb7056cf1de042f9420bab396793c0c390bde74b4bbdff16a83ae09a9a7517"],["6d7ef6b17543f8373c573f44e1f389835d89bcbc6062ced36c82df83b8fae859","cd450ec335438986dfefa10c57fea9bcc521a0959b2d80bbf74b190dca712d10"],["e75605d59102a5a2684500d3b991f2e3f3c88b93225547035af25af66e04541f","f5c54754a8f71ee540b9b48728473e314f729ac5308b06938360990e2bfad125"],["eb98660f4c4dfaa06a2be453d5020bc99a0c2e60abe388457dd43fefb1ed620c","6cb9a8876d9cb8520609af3add26cd20a0a7cd8a9411131ce85f44100099223e"],["13e87b027d8514d35939f2e6892b19922154596941888336dc3563e3b8dba942","fef5a3c68059a6dec5d624114bf1e91aac2b9da568d6abeb2570d55646b8adf1"],["ee163026e9fd6fe017c38f06a5be6fc125424b371ce2708e7bf4491691e5764a","1acb250f255dd61c43d94ccc670d0f58f49ae3fa15b96623e5430da0ad6c62b2"],["b268f5ef9ad51e4d78de3a750c2dc89b1e626d43505867999932e5db33af3d80","5f310d4b3c99b9ebb19f77d41c1dee018cf0d34fd4191614003e945a1216e423"],["ff07f3118a9df035e9fad85eb6c7bfe42b02f01ca99ceea3bf7ffdba93c4750d","438136d603e858a3a5c440c38eccbaddc1d2942114e2eddd4740d098ced1f0d8"],["8d8b9855c7c052a34146fd20ffb658bea4b9f69e0d825ebec16e8c3ce2b526a1","cdb559eedc2d79f926baf44fb84ea4d44bcf50fee51d7ceb30e2e7f463036758"],["52db0b5384dfbf05bfa9d472d7ae26dfe4b851ceca91b1eba54263180da32b63","c3b997d050ee5d423ebaf66a6db9f57b3180c902875679de924b69d84a7b375"],["e62f9490d3d51da6395efd24e80919cc7d0f29c3f3fa48c6fff543becbd43352","6d89ad7ba4876b0b22c2ca280c682862f342c8591f1daf5170e07bfd9ccafa7d"],["7f30ea2476b399b4957509c88f77d0191afa2ff5cb7b14fd6d8e7d65aaab1193","ca5ef7d4b231c94c3b15389a5f6311e9daff7bb67b103e9880ef4bff637acaec"],["5098ff1e1d9f14fb46a210fada6c903fef0fb7b4a1dd1d9ac60a0361800b7a00","9731141d81fc8f8084d37c6e7542006b3ee1b40d60dfe5362a5b132fd17ddc0"],["32b78c7de9ee512a72895be6b9cbefa6e2f3c4ccce445c96b9f2c81e2778ad58","ee1849f513df71e32efc3896ee28260c73bb80547ae2275ba497237794c8753c"],["e2cb74fddc8e9fbcd076eef2a7c72b0ce37d50f08269dfc074b581550547a4f7","d3aa2ed71c9dd2247a62df062736eb0baddea9e36122d2be8641abcb005cc4a4"],["8438447566d4d7bedadc299496ab357426009a35f235cb141be0d99cd10ae3a8","c4e1020916980a4da5d01ac5e6ad330734ef0d7906631c4f2390426b2edd791f"],["4162d488b89402039b584c6fc6c308870587d9c46f660b878ab65c82c711d67e","67163e903236289f776f22c25fb8a3afc1732f2b84b4e95dbda47ae5a0852649"],["3fad3fa84caf0f34f0f89bfd2dcf54fc175d767aec3e50684f3ba4a4bf5f683d","cd1bc7cb6cc407bb2f0ca647c718a730cf71872e7d0d2a53fa20efcdfe61826"],["674f2600a3007a00568c1a7ce05d0816c1fb84bf1370798f1c69532faeb1a86b","299d21f9413f33b3edf43b257004580b70db57da0b182259e09eecc69e0d38a5"],["d32f4da54ade74abb81b815ad1fb3b263d82d6c692714bcff87d29bd5ee9f08f","f9429e738b8e53b968e99016c059707782e14f4535359d582fc416910b3eea87"],["30e4e670435385556e593657135845d36fbb6931f72b08cb1ed954f1e3ce3ff6","462f9bce619898638499350113bbc9b10a878d35da70740dc695a559eb88db7b"],["be2062003c51cc3004682904330e4dee7f3dcd10b01e580bf1971b04d4cad297","62188bc49d61e5428573d48a74e1c655b1c61090905682a0d5558ed72dccb9bc"],["93144423ace3451ed29e0fb9ac2af211cb6e84a601df5993c419859fff5df04a","7c10dfb164c3425f5c71a3f9d7992038f1065224f72bb9d1d902a6d13037b47c"],["b015f8044f5fcbdcf21ca26d6c34fb8197829205c7b7d2a7cb66418c157b112c","ab8c1e086d04e813744a655b2df8d5f83b3cdc6faa3088c1d3aea1454e3a1d5f"],["d5e9e1da649d97d89e4868117a465a3a4f8a18de57a140d36b3f2af341a21b52","4cb04437f391ed73111a13cc1d4dd0db1693465c2240480d8955e8592f27447a"],["d3ae41047dd7ca065dbf8ed77b992439983005cd72e16d6f996a5316d36966bb","bd1aeb21ad22ebb22a10f0303417c6d964f8cdd7df0aca614b10dc14d125ac46"],["463e2763d885f958fc66cdd22800f0a487197d0a82e377b49f80af87c897b065","bfefacdb0e5d0fd7df3a311a94de062b26b80c61fbc97508b79992671ef7ca7f"],["7985fdfd127c0567c6f53ec1bb63ec3158e597c40bfe747c83cddfc910641917","603c12daf3d9862ef2b25fe1de289aed24ed291e0ec6708703a5bd567f32ed03"],["74a1ad6b5f76e39db2dd249410eac7f99e74c59cb83d2d0ed5ff1543da7703e9","cc6157ef18c9c63cd6193d83631bbea0093e0968942e8c33d5737fd790e0db08"],["30682a50703375f602d416664ba19b7fc9bab42c72747463a71d0896b22f6da3","553e04f6b018b4fa6c8f39e7f311d3176290d0e0f19ca73f17714d9977a22ff8"],["9e2158f0d7c0d5f26c3791efefa79597654e7a2b2464f52b1ee6c1347769ef57","712fcdd1b9053f09003a3481fa7762e9ffd7c8ef35a38509e2fbf2629008373"],["176e26989a43c9cfeba4029c202538c28172e566e3c4fce7322857f3be327d66","ed8cc9d04b29eb877d270b4878dc43c19aefd31f4eee09ee7b47834c1fa4b1c3"],["75d46efea3771e6e68abb89a13ad747ecf1892393dfc4f1b7004788c50374da8","9852390a99507679fd0b86fd2b39a868d7efc22151346e1a3ca4726586a6bed8"],["809a20c67d64900ffb698c4c825f6d5f2310fb0451c869345b7319f645605721","9e994980d9917e22b76b061927fa04143d096ccc54963e6a5ebfa5f3f8e286c1"],["1b38903a43f7f114ed4500b4eac7083fdefece1cf29c63528d563446f972c180","4036edc931a60ae889353f77fd53de4a2708b26b6f5da72ad3394119daf408f9"]]}}},80953:(t,e,r)=>{"use strict";var i=e,n=r(73785),o=r(79746),s=r(34504);i.assert=o,i.toArray=s.toArray,i.zero2=s.zero2,i.toHex=s.toHex,i.encode=s.encode,i.getNAF=function(t,e,r){var i=new Array(Math.max(t.bitLength(),r)+1);i.fill(0);for(var n=1<<e+1,o=t.clone(),s=0;s<i.length;s++){var a,u=o.andln(n-1);o.isOdd()?(a=u>(n>>1)-1?(n>>1)-u:u,o.isubn(a)):a=0,i[s]=a,o.iushrn(1)}return i},i.getJSF=function(t,e){var r=[[],[]];t=t.clone(),e=e.clone();for(var i,n=0,o=0;t.cmpn(-n)>0||e.cmpn(-o)>0;){var s,a,u=t.andln(3)+n&3,h=e.andln(3)+o&3;3===u&&(u=-1),3===h&&(h=-1),s=0==(1&u)?0:3!=(i=t.andln(7)+n&7)&&5!==i||2!==h?u:-u,r[0].push(s),a=0==(1&h)?0:3!=(i=e.andln(7)+o&7)&&5!==i||2!==u?h:-h,r[1].push(a),2*n===s+1&&(n=1-n),2*o===a+1&&(o=1-o),t.iushrn(1),e.iushrn(1)}return r},i.cachedProperty=function(t,e,r){var i="_"+e;t.prototype[e]=function(){return void 0!==this[i]?this[i]:this[i]=r.call(this)}},i.parseBytes=function(t){return"string"==typeof t?i.toArray(t,"hex"):t},i.intFromLE=function(t){return new n(t,"hex","le")}},73785:function(t,e,r){!function(t,e){"use strict";function i(t,e){if(!t)throw new Error(e||"Assertion failed")}function n(t,e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}function o(t,e,r){if(o.isBN(t))return t;this.negative=0,this.words=null,this.length=0,this.red=null,null!==t&&("le"!==e&&"be"!==e||(r=e,e=10),this._init(t||0,e||10,r||"be"))}var s;"object"==typeof t?t.exports=o:e.BN=o,o.BN=o,o.wordSize=26;try{s=r(32574).Buffer}catch(t){}function a(t,e,r){for(var i=0,n=Math.min(t.length,r),o=e;o<n;o++){var s=t.charCodeAt(o)-48;i<<=4,i|=s>=49&&s<=54?s-49+10:s>=17&&s<=22?s-17+10:15&s}return i}function u(t,e,r,i){for(var n=0,o=Math.min(t.length,r),s=e;s<o;s++){var a=t.charCodeAt(s)-48;n*=i,n+=a>=49?a-49+10:a>=17?a-17+10:a}return n}o.isBN=function(t){return t instanceof o||null!==t&&"object"==typeof t&&t.constructor.wordSize===o.wordSize&&Array.isArray(t.words)},o.max=function(t,e){return t.cmp(e)>0?t:e},o.min=function(t,e){return t.cmp(e)<0?t:e},o.prototype._init=function(t,e,r){if("number"==typeof t)return this._initNumber(t,e,r);if("object"==typeof t)return this._initArray(t,e,r);"hex"===e&&(e=16),i(e===(0|e)&&e>=2&&e<=36);var n=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&n++,16===e?this._parseHex(t,n):this._parseBase(t,e,n),"-"===t[0]&&(this.negative=1),this.strip(),"le"===r&&this._initArray(this.toArray(),e,r)},o.prototype._initNumber=function(t,e,r){t<0&&(this.negative=1,t=-t),t<67108864?(this.words=[67108863&t],this.length=1):t<4503599627370496?(this.words=[67108863&t,t/67108864&67108863],this.length=2):(i(t<9007199254740992),this.words=[67108863&t,t/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),e,r)},o.prototype._initArray=function(t,e,r){if(i("number"==typeof t.length),t.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(t.length/3),this.words=new Array(this.length);for(var n=0;n<this.length;n++)this.words[n]=0;var o,s,a=0;if("be"===r)for(n=t.length-1,o=0;n>=0;n-=3)s=t[n]|t[n-1]<<8|t[n-2]<<16,this.words[o]|=s<<a&67108863,this.words[o+1]=s>>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);else if("le"===r)for(n=0,o=0;n<t.length;n+=3)s=t[n]|t[n+1]<<8|t[n+2]<<16,this.words[o]|=s<<a&67108863,this.words[o+1]=s>>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);return this.strip()},o.prototype._parseHex=function(t,e){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var r=0;r<this.length;r++)this.words[r]=0;var i,n,o=0;for(r=t.length-6,i=0;r>=e;r-=6)n=a(t,r,r+6),this.words[i]|=n<<o&67108863,this.words[i+1]|=n>>>26-o&4194303,(o+=24)>=26&&(o-=26,i++);r+6!==e&&(n=a(t,e,r+6),this.words[i]|=n<<o&67108863,this.words[i+1]|=n>>>26-o&4194303),this.strip()},o.prototype._parseBase=function(t,e,r){this.words=[0],this.length=1;for(var i=0,n=1;n<=67108863;n*=e)i++;i--,n=n/e|0;for(var o=t.length-r,s=o%i,a=Math.min(o,o-s)+r,h=0,c=r;c<a;c+=i)h=u(t,c,c+i,e),this.imuln(n),this.words[0]+h<67108864?this.words[0]+=h:this._iaddn(h);if(0!==s){var f=1;for(h=u(t,c,t.length,e),c=0;c<s;c++)f*=e;this.imuln(f),this.words[0]+h<67108864?this.words[0]+=h:this._iaddn(h)}},o.prototype.copy=function(t){t.words=new Array(this.length);for(var e=0;e<this.length;e++)t.words[e]=this.words[e];t.length=this.length,t.negative=this.negative,t.red=this.red},o.prototype.clone=function(){var t=new o(null);return this.copy(t),t},o.prototype._expand=function(t){for(;this.length<t;)this.words[this.length++]=0;return this},o.prototype.strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},o.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},o.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var h=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],c=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],f=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function l(t,e,r){r.negative=e.negative^t.negative;var i=t.length+e.length|0;r.length=i,i=i-1|0;var n=0|t.words[0],o=0|e.words[0],s=n*o,a=67108863&s,u=s/67108864|0;r.words[0]=a;for(var h=1;h<i;h++){for(var c=u>>>26,f=67108863&u,l=Math.min(h,e.length-1),d=Math.max(0,h-t.length+1);d<=l;d++){var p=h-d|0;c+=(s=(n=0|t.words[p])*(o=0|e.words[d])+f)/67108864|0,f=67108863&s}r.words[h]=0|f,u=0|c}return 0!==u?r.words[h]=0|u:r.length--,r.strip()}o.prototype.toString=function(t,e){var r;if(e=0|e||1,16===(t=t||10)||"hex"===t){r="";for(var n=0,o=0,s=0;s<this.length;s++){var a=this.words[s],u=(16777215&(a<<n|o)).toString(16);r=0!=(o=a>>>24-n&16777215)||s!==this.length-1?h[6-u.length]+u+r:u+r,(n+=2)>=26&&(n-=26,s--)}for(0!==o&&(r=o.toString(16)+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(t===(0|t)&&t>=2&&t<=36){var l=c[t],d=f[t];r="";var p=this.clone();for(p.negative=0;!p.isZero();){var g=p.modn(d).toString(t);r=(p=p.idivn(d)).isZero()?g+r:h[l-g.length]+g+r}for(this.isZero()&&(r="0"+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}i(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:this.length>2&&i(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},o.prototype.toJSON=function(){return this.toString(16)},o.prototype.toBuffer=function(t,e){return i(void 0!==s),this.toArrayLike(s,t,e)},o.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)},o.prototype.toArrayLike=function(t,e,r){var n=this.byteLength(),o=r||Math.max(1,n);i(n<=o,"byte array longer than desired length"),i(o>0,"Requested array length <= 0"),this.strip();var s,a,u="le"===e,h=new t(o),c=this.clone();if(u){for(a=0;!c.isZero();a++)s=c.andln(255),c.iushrn(8),h[a]=s;for(;a<o;a++)h[a]=0}else{for(a=0;a<o-n;a++)h[a]=0;for(a=0;!c.isZero();a++)s=c.andln(255),c.iushrn(8),h[o-a-1]=s}return h},Math.clz32?o.prototype._countBits=function(t){return 32-Math.clz32(t)}:o.prototype._countBits=function(t){var e=t,r=0;return e>=4096&&(r+=13,e>>>=13),e>=64&&(r+=7,e>>>=7),e>=8&&(r+=4,e>>>=4),e>=2&&(r+=2,e>>>=2),r+e},o.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,r=0;return 0==(8191&e)&&(r+=13,e>>>=13),0==(127&e)&&(r+=7,e>>>=7),0==(15&e)&&(r+=4,e>>>=4),0==(3&e)&&(r+=2,e>>>=2),0==(1&e)&&r++,r},o.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;e<this.length;e++){var r=this._zeroBits(this.words[e]);if(t+=r,26!==r)break}return t},o.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},o.prototype.toTwos=function(t){return 0!==this.negative?this.abs().inotn(t).iaddn(1):this.clone()},o.prototype.fromTwos=function(t){return this.testn(t-1)?this.notn(t).iaddn(1).ineg():this.clone()},o.prototype.isNeg=function(){return 0!==this.negative},o.prototype.neg=function(){return this.clone().ineg()},o.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},o.prototype.iuor=function(t){for(;this.length<t.length;)this.words[this.length++]=0;for(var e=0;e<t.length;e++)this.words[e]=this.words[e]|t.words[e];return this.strip()},o.prototype.ior=function(t){return i(0==(this.negative|t.negative)),this.iuor(t)},o.prototype.or=function(t){return this.length>t.length?this.clone().ior(t):t.clone().ior(this)},o.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},o.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var r=0;r<e.length;r++)this.words[r]=this.words[r]&t.words[r];return this.length=e.length,this.strip()},o.prototype.iand=function(t){return i(0==(this.negative|t.negative)),this.iuand(t)},o.prototype.and=function(t){return this.length>t.length?this.clone().iand(t):t.clone().iand(this)},o.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},o.prototype.iuxor=function(t){var e,r;this.length>t.length?(e=this,r=t):(e=t,r=this);for(var i=0;i<r.length;i++)this.words[i]=e.words[i]^r.words[i];if(this!==e)for(;i<e.length;i++)this.words[i]=e.words[i];return this.length=e.length,this.strip()},o.prototype.ixor=function(t){return i(0==(this.negative|t.negative)),this.iuxor(t)},o.prototype.xor=function(t){return this.length>t.length?this.clone().ixor(t):t.clone().ixor(this)},o.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},o.prototype.inotn=function(t){i("number"==typeof t&&t>=0);var e=0|Math.ceil(t/26),r=t%26;this._expand(e),r>0&&e--;for(var n=0;n<e;n++)this.words[n]=67108863&~this.words[n];return r>0&&(this.words[n]=~this.words[n]&67108863>>26-r),this.strip()},o.prototype.notn=function(t){return this.clone().inotn(t)},o.prototype.setn=function(t,e){i("number"==typeof t&&t>=0);var r=t/26|0,n=t%26;return this._expand(r+1),this.words[r]=e?this.words[r]|1<<n:this.words[r]&~(1<<n),this.strip()},o.prototype.iadd=function(t){var e,r,i;if(0!==this.negative&&0===t.negative)return this.negative=0,e=this.isub(t),this.negative^=1,this._normSign();if(0===this.negative&&0!==t.negative)return t.negative=0,e=this.isub(t),t.negative=1,e._normSign();this.length>t.length?(r=this,i=t):(r=t,i=this);for(var n=0,o=0;o<i.length;o++)e=(0|r.words[o])+(0|i.words[o])+n,this.words[o]=67108863&e,n=e>>>26;for(;0!==n&&o<r.length;o++)e=(0|r.words[o])+n,this.words[o]=67108863&e,n=e>>>26;if(this.length=r.length,0!==n)this.words[this.length]=n,this.length++;else if(r!==this)for(;o<r.length;o++)this.words[o]=r.words[o];return this},o.prototype.add=function(t){var e;return 0!==t.negative&&0===this.negative?(t.negative=0,e=this.sub(t),t.negative^=1,e):0===t.negative&&0!==this.negative?(this.negative=0,e=t.sub(this),this.negative=1,e):this.length>t.length?this.clone().iadd(t):t.clone().iadd(this)},o.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e=this.iadd(t);return t.negative=1,e._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var r,i,n=this.cmp(t);if(0===n)return this.negative=0,this.length=1,this.words[0]=0,this;n>0?(r=this,i=t):(r=t,i=this);for(var o=0,s=0;s<i.length;s++)o=(e=(0|r.words[s])-(0|i.words[s])+o)>>26,this.words[s]=67108863&e;for(;0!==o&&s<r.length;s++)o=(e=(0|r.words[s])+o)>>26,this.words[s]=67108863&e;if(0===o&&s<r.length&&r!==this)for(;s<r.length;s++)this.words[s]=r.words[s];return this.length=Math.max(this.length,s),r!==this&&(this.negative=1),this.strip()},o.prototype.sub=function(t){return this.clone().isub(t)};var d=function(t,e,r){var i,n,o,s=t.words,a=e.words,u=r.words,h=0,c=0|s[0],f=8191&c,l=c>>>13,d=0|s[1],p=8191&d,g=d>>>13,y=0|s[2],m=8191&y,v=y>>>13,b=0|s[3],w=8191&b,_=b>>>13,S=0|s[4],E=8191&S,M=S>>>13,A=0|s[5],C=8191&A,k=A>>>13,I=0|s[6],T=8191&I,R=I>>>13,B=0|s[7],x=8191&B,F=B>>>13,P=0|s[8],N=8191&P,O=P>>>13,L=0|s[9],U=8191&L,j=L>>>13,D=0|a[0],K=8191&D,V=D>>>13,H=0|a[1],q=8191&H,z=H>>>13,W=0|a[2],G=8191&W,J=W>>>13,Z=0|a[3],$=8191&Z,Y=Z>>>13,Q=0|a[4],X=8191&Q,tt=Q>>>13,et=0|a[5],rt=8191&et,it=et>>>13,nt=0|a[6],ot=8191&nt,st=nt>>>13,at=0|a[7],ut=8191&at,ht=at>>>13,ct=0|a[8],ft=8191&ct,lt=ct>>>13,dt=0|a[9],pt=8191&dt,gt=dt>>>13;r.negative=t.negative^e.negative,r.length=19;var yt=(h+(i=Math.imul(f,K))|0)+((8191&(n=(n=Math.imul(f,V))+Math.imul(l,K)|0))<<13)|0;h=((o=Math.imul(l,V))+(n>>>13)|0)+(yt>>>26)|0,yt&=67108863,i=Math.imul(p,K),n=(n=Math.imul(p,V))+Math.imul(g,K)|0,o=Math.imul(g,V);var mt=(h+(i=i+Math.imul(f,q)|0)|0)+((8191&(n=(n=n+Math.imul(f,z)|0)+Math.imul(l,q)|0))<<13)|0;h=((o=o+Math.imul(l,z)|0)+(n>>>13)|0)+(mt>>>26)|0,mt&=67108863,i=Math.imul(m,K),n=(n=Math.imul(m,V))+Math.imul(v,K)|0,o=Math.imul(v,V),i=i+Math.imul(p,q)|0,n=(n=n+Math.imul(p,z)|0)+Math.imul(g,q)|0,o=o+Math.imul(g,z)|0;var vt=(h+(i=i+Math.imul(f,G)|0)|0)+((8191&(n=(n=n+Math.imul(f,J)|0)+Math.imul(l,G)|0))<<13)|0;h=((o=o+Math.imul(l,J)|0)+(n>>>13)|0)+(vt>>>26)|0,vt&=67108863,i=Math.imul(w,K),n=(n=Math.imul(w,V))+Math.imul(_,K)|0,o=Math.imul(_,V),i=i+Math.imul(m,q)|0,n=(n=n+Math.imul(m,z)|0)+Math.imul(v,q)|0,o=o+Math.imul(v,z)|0,i=i+Math.imul(p,G)|0,n=(n=n+Math.imul(p,J)|0)+Math.imul(g,G)|0,o=o+Math.imul(g,J)|0;var bt=(h+(i=i+Math.imul(f,$)|0)|0)+((8191&(n=(n=n+Math.imul(f,Y)|0)+Math.imul(l,$)|0))<<13)|0;h=((o=o+Math.imul(l,Y)|0)+(n>>>13)|0)+(bt>>>26)|0,bt&=67108863,i=Math.imul(E,K),n=(n=Math.imul(E,V))+Math.imul(M,K)|0,o=Math.imul(M,V),i=i+Math.imul(w,q)|0,n=(n=n+Math.imul(w,z)|0)+Math.imul(_,q)|0,o=o+Math.imul(_,z)|0,i=i+Math.imul(m,G)|0,n=(n=n+Math.imul(m,J)|0)+Math.imul(v,G)|0,o=o+Math.imul(v,J)|0,i=i+Math.imul(p,$)|0,n=(n=n+Math.imul(p,Y)|0)+Math.imul(g,$)|0,o=o+Math.imul(g,Y)|0;var wt=(h+(i=i+Math.imul(f,X)|0)|0)+((8191&(n=(n=n+Math.imul(f,tt)|0)+Math.imul(l,X)|0))<<13)|0;h=((o=o+Math.imul(l,tt)|0)+(n>>>13)|0)+(wt>>>26)|0,wt&=67108863,i=Math.imul(C,K),n=(n=Math.imul(C,V))+Math.imul(k,K)|0,o=Math.imul(k,V),i=i+Math.imul(E,q)|0,n=(n=n+Math.imul(E,z)|0)+Math.imul(M,q)|0,o=o+Math.imul(M,z)|0,i=i+Math.imul(w,G)|0,n=(n=n+Math.imul(w,J)|0)+Math.imul(_,G)|0,o=o+Math.imul(_,J)|0,i=i+Math.imul(m,$)|0,n=(n=n+Math.imul(m,Y)|0)+Math.imul(v,$)|0,o=o+Math.imul(v,Y)|0,i=i+Math.imul(p,X)|0,n=(n=n+Math.imul(p,tt)|0)+Math.imul(g,X)|0,o=o+Math.imul(g,tt)|0;var _t=(h+(i=i+Math.imul(f,rt)|0)|0)+((8191&(n=(n=n+Math.imul(f,it)|0)+Math.imul(l,rt)|0))<<13)|0;h=((o=o+Math.imul(l,it)|0)+(n>>>13)|0)+(_t>>>26)|0,_t&=67108863,i=Math.imul(T,K),n=(n=Math.imul(T,V))+Math.imul(R,K)|0,o=Math.imul(R,V),i=i+Math.imul(C,q)|0,n=(n=n+Math.imul(C,z)|0)+Math.imul(k,q)|0,o=o+Math.imul(k,z)|0,i=i+Math.imul(E,G)|0,n=(n=n+Math.imul(E,J)|0)+Math.imul(M,G)|0,o=o+Math.imul(M,J)|0,i=i+Math.imul(w,$)|0,n=(n=n+Math.imul(w,Y)|0)+Math.imul(_,$)|0,o=o+Math.imul(_,Y)|0,i=i+Math.imul(m,X)|0,n=(n=n+Math.imul(m,tt)|0)+Math.imul(v,X)|0,o=o+Math.imul(v,tt)|0,i=i+Math.imul(p,rt)|0,n=(n=n+Math.imul(p,it)|0)+Math.imul(g,rt)|0,o=o+Math.imul(g,it)|0;var St=(h+(i=i+Math.imul(f,ot)|0)|0)+((8191&(n=(n=n+Math.imul(f,st)|0)+Math.imul(l,ot)|0))<<13)|0;h=((o=o+Math.imul(l,st)|0)+(n>>>13)|0)+(St>>>26)|0,St&=67108863,i=Math.imul(x,K),n=(n=Math.imul(x,V))+Math.imul(F,K)|0,o=Math.imul(F,V),i=i+Math.imul(T,q)|0,n=(n=n+Math.imul(T,z)|0)+Math.imul(R,q)|0,o=o+Math.imul(R,z)|0,i=i+Math.imul(C,G)|0,n=(n=n+Math.imul(C,J)|0)+Math.imul(k,G)|0,o=o+Math.imul(k,J)|0,i=i+Math.imul(E,$)|0,n=(n=n+Math.imul(E,Y)|0)+Math.imul(M,$)|0,o=o+Math.imul(M,Y)|0,i=i+Math.imul(w,X)|0,n=(n=n+Math.imul(w,tt)|0)+Math.imul(_,X)|0,o=o+Math.imul(_,tt)|0,i=i+Math.imul(m,rt)|0,n=(n=n+Math.imul(m,it)|0)+Math.imul(v,rt)|0,o=o+Math.imul(v,it)|0,i=i+Math.imul(p,ot)|0,n=(n=n+Math.imul(p,st)|0)+Math.imul(g,ot)|0,o=o+Math.imul(g,st)|0;var Et=(h+(i=i+Math.imul(f,ut)|0)|0)+((8191&(n=(n=n+Math.imul(f,ht)|0)+Math.imul(l,ut)|0))<<13)|0;h=((o=o+Math.imul(l,ht)|0)+(n>>>13)|0)+(Et>>>26)|0,Et&=67108863,i=Math.imul(N,K),n=(n=Math.imul(N,V))+Math.imul(O,K)|0,o=Math.imul(O,V),i=i+Math.imul(x,q)|0,n=(n=n+Math.imul(x,z)|0)+Math.imul(F,q)|0,o=o+Math.imul(F,z)|0,i=i+Math.imul(T,G)|0,n=(n=n+Math.imul(T,J)|0)+Math.imul(R,G)|0,o=o+Math.imul(R,J)|0,i=i+Math.imul(C,$)|0,n=(n=n+Math.imul(C,Y)|0)+Math.imul(k,$)|0,o=o+Math.imul(k,Y)|0,i=i+Math.imul(E,X)|0,n=(n=n+Math.imul(E,tt)|0)+Math.imul(M,X)|0,o=o+Math.imul(M,tt)|0,i=i+Math.imul(w,rt)|0,n=(n=n+Math.imul(w,it)|0)+Math.imul(_,rt)|0,o=o+Math.imul(_,it)|0,i=i+Math.imul(m,ot)|0,n=(n=n+Math.imul(m,st)|0)+Math.imul(v,ot)|0,o=o+Math.imul(v,st)|0,i=i+Math.imul(p,ut)|0,n=(n=n+Math.imul(p,ht)|0)+Math.imul(g,ut)|0,o=o+Math.imul(g,ht)|0;var Mt=(h+(i=i+Math.imul(f,ft)|0)|0)+((8191&(n=(n=n+Math.imul(f,lt)|0)+Math.imul(l,ft)|0))<<13)|0;h=((o=o+Math.imul(l,lt)|0)+(n>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,i=Math.imul(U,K),n=(n=Math.imul(U,V))+Math.imul(j,K)|0,o=Math.imul(j,V),i=i+Math.imul(N,q)|0,n=(n=n+Math.imul(N,z)|0)+Math.imul(O,q)|0,o=o+Math.imul(O,z)|0,i=i+Math.imul(x,G)|0,n=(n=n+Math.imul(x,J)|0)+Math.imul(F,G)|0,o=o+Math.imul(F,J)|0,i=i+Math.imul(T,$)|0,n=(n=n+Math.imul(T,Y)|0)+Math.imul(R,$)|0,o=o+Math.imul(R,Y)|0,i=i+Math.imul(C,X)|0,n=(n=n+Math.imul(C,tt)|0)+Math.imul(k,X)|0,o=o+Math.imul(k,tt)|0,i=i+Math.imul(E,rt)|0,n=(n=n+Math.imul(E,it)|0)+Math.imul(M,rt)|0,o=o+Math.imul(M,it)|0,i=i+Math.imul(w,ot)|0,n=(n=n+Math.imul(w,st)|0)+Math.imul(_,ot)|0,o=o+Math.imul(_,st)|0,i=i+Math.imul(m,ut)|0,n=(n=n+Math.imul(m,ht)|0)+Math.imul(v,ut)|0,o=o+Math.imul(v,ht)|0,i=i+Math.imul(p,ft)|0,n=(n=n+Math.imul(p,lt)|0)+Math.imul(g,ft)|0,o=o+Math.imul(g,lt)|0;var At=(h+(i=i+Math.imul(f,pt)|0)|0)+((8191&(n=(n=n+Math.imul(f,gt)|0)+Math.imul(l,pt)|0))<<13)|0;h=((o=o+Math.imul(l,gt)|0)+(n>>>13)|0)+(At>>>26)|0,At&=67108863,i=Math.imul(U,q),n=(n=Math.imul(U,z))+Math.imul(j,q)|0,o=Math.imul(j,z),i=i+Math.imul(N,G)|0,n=(n=n+Math.imul(N,J)|0)+Math.imul(O,G)|0,o=o+Math.imul(O,J)|0,i=i+Math.imul(x,$)|0,n=(n=n+Math.imul(x,Y)|0)+Math.imul(F,$)|0,o=o+Math.imul(F,Y)|0,i=i+Math.imul(T,X)|0,n=(n=n+Math.imul(T,tt)|0)+Math.imul(R,X)|0,o=o+Math.imul(R,tt)|0,i=i+Math.imul(C,rt)|0,n=(n=n+Math.imul(C,it)|0)+Math.imul(k,rt)|0,o=o+Math.imul(k,it)|0,i=i+Math.imul(E,ot)|0,n=(n=n+Math.imul(E,st)|0)+Math.imul(M,ot)|0,o=o+Math.imul(M,st)|0,i=i+Math.imul(w,ut)|0,n=(n=n+Math.imul(w,ht)|0)+Math.imul(_,ut)|0,o=o+Math.imul(_,ht)|0,i=i+Math.imul(m,ft)|0,n=(n=n+Math.imul(m,lt)|0)+Math.imul(v,ft)|0,o=o+Math.imul(v,lt)|0;var Ct=(h+(i=i+Math.imul(p,pt)|0)|0)+((8191&(n=(n=n+Math.imul(p,gt)|0)+Math.imul(g,pt)|0))<<13)|0;h=((o=o+Math.imul(g,gt)|0)+(n>>>13)|0)+(Ct>>>26)|0,Ct&=67108863,i=Math.imul(U,G),n=(n=Math.imul(U,J))+Math.imul(j,G)|0,o=Math.imul(j,J),i=i+Math.imul(N,$)|0,n=(n=n+Math.imul(N,Y)|0)+Math.imul(O,$)|0,o=o+Math.imul(O,Y)|0,i=i+Math.imul(x,X)|0,n=(n=n+Math.imul(x,tt)|0)+Math.imul(F,X)|0,o=o+Math.imul(F,tt)|0,i=i+Math.imul(T,rt)|0,n=(n=n+Math.imul(T,it)|0)+Math.imul(R,rt)|0,o=o+Math.imul(R,it)|0,i=i+Math.imul(C,ot)|0,n=(n=n+Math.imul(C,st)|0)+Math.imul(k,ot)|0,o=o+Math.imul(k,st)|0,i=i+Math.imul(E,ut)|0,n=(n=n+Math.imul(E,ht)|0)+Math.imul(M,ut)|0,o=o+Math.imul(M,ht)|0,i=i+Math.imul(w,ft)|0,n=(n=n+Math.imul(w,lt)|0)+Math.imul(_,ft)|0,o=o+Math.imul(_,lt)|0;var kt=(h+(i=i+Math.imul(m,pt)|0)|0)+((8191&(n=(n=n+Math.imul(m,gt)|0)+Math.imul(v,pt)|0))<<13)|0;h=((o=o+Math.imul(v,gt)|0)+(n>>>13)|0)+(kt>>>26)|0,kt&=67108863,i=Math.imul(U,$),n=(n=Math.imul(U,Y))+Math.imul(j,$)|0,o=Math.imul(j,Y),i=i+Math.imul(N,X)|0,n=(n=n+Math.imul(N,tt)|0)+Math.imul(O,X)|0,o=o+Math.imul(O,tt)|0,i=i+Math.imul(x,rt)|0,n=(n=n+Math.imul(x,it)|0)+Math.imul(F,rt)|0,o=o+Math.imul(F,it)|0,i=i+Math.imul(T,ot)|0,n=(n=n+Math.imul(T,st)|0)+Math.imul(R,ot)|0,o=o+Math.imul(R,st)|0,i=i+Math.imul(C,ut)|0,n=(n=n+Math.imul(C,ht)|0)+Math.imul(k,ut)|0,o=o+Math.imul(k,ht)|0,i=i+Math.imul(E,ft)|0,n=(n=n+Math.imul(E,lt)|0)+Math.imul(M,ft)|0,o=o+Math.imul(M,lt)|0;var It=(h+(i=i+Math.imul(w,pt)|0)|0)+((8191&(n=(n=n+Math.imul(w,gt)|0)+Math.imul(_,pt)|0))<<13)|0;h=((o=o+Math.imul(_,gt)|0)+(n>>>13)|0)+(It>>>26)|0,It&=67108863,i=Math.imul(U,X),n=(n=Math.imul(U,tt))+Math.imul(j,X)|0,o=Math.imul(j,tt),i=i+Math.imul(N,rt)|0,n=(n=n+Math.imul(N,it)|0)+Math.imul(O,rt)|0,o=o+Math.imul(O,it)|0,i=i+Math.imul(x,ot)|0,n=(n=n+Math.imul(x,st)|0)+Math.imul(F,ot)|0,o=o+Math.imul(F,st)|0,i=i+Math.imul(T,ut)|0,n=(n=n+Math.imul(T,ht)|0)+Math.imul(R,ut)|0,o=o+Math.imul(R,ht)|0,i=i+Math.imul(C,ft)|0,n=(n=n+Math.imul(C,lt)|0)+Math.imul(k,ft)|0,o=o+Math.imul(k,lt)|0;var Tt=(h+(i=i+Math.imul(E,pt)|0)|0)+((8191&(n=(n=n+Math.imul(E,gt)|0)+Math.imul(M,pt)|0))<<13)|0;h=((o=o+Math.imul(M,gt)|0)+(n>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,i=Math.imul(U,rt),n=(n=Math.imul(U,it))+Math.imul(j,rt)|0,o=Math.imul(j,it),i=i+Math.imul(N,ot)|0,n=(n=n+Math.imul(N,st)|0)+Math.imul(O,ot)|0,o=o+Math.imul(O,st)|0,i=i+Math.imul(x,ut)|0,n=(n=n+Math.imul(x,ht)|0)+Math.imul(F,ut)|0,o=o+Math.imul(F,ht)|0,i=i+Math.imul(T,ft)|0,n=(n=n+Math.imul(T,lt)|0)+Math.imul(R,ft)|0,o=o+Math.imul(R,lt)|0;var Rt=(h+(i=i+Math.imul(C,pt)|0)|0)+((8191&(n=(n=n+Math.imul(C,gt)|0)+Math.imul(k,pt)|0))<<13)|0;h=((o=o+Math.imul(k,gt)|0)+(n>>>13)|0)+(Rt>>>26)|0,Rt&=67108863,i=Math.imul(U,ot),n=(n=Math.imul(U,st))+Math.imul(j,ot)|0,o=Math.imul(j,st),i=i+Math.imul(N,ut)|0,n=(n=n+Math.imul(N,ht)|0)+Math.imul(O,ut)|0,o=o+Math.imul(O,ht)|0,i=i+Math.imul(x,ft)|0,n=(n=n+Math.imul(x,lt)|0)+Math.imul(F,ft)|0,o=o+Math.imul(F,lt)|0;var Bt=(h+(i=i+Math.imul(T,pt)|0)|0)+((8191&(n=(n=n+Math.imul(T,gt)|0)+Math.imul(R,pt)|0))<<13)|0;h=((o=o+Math.imul(R,gt)|0)+(n>>>13)|0)+(Bt>>>26)|0,Bt&=67108863,i=Math.imul(U,ut),n=(n=Math.imul(U,ht))+Math.imul(j,ut)|0,o=Math.imul(j,ht),i=i+Math.imul(N,ft)|0,n=(n=n+Math.imul(N,lt)|0)+Math.imul(O,ft)|0,o=o+Math.imul(O,lt)|0;var xt=(h+(i=i+Math.imul(x,pt)|0)|0)+((8191&(n=(n=n+Math.imul(x,gt)|0)+Math.imul(F,pt)|0))<<13)|0;h=((o=o+Math.imul(F,gt)|0)+(n>>>13)|0)+(xt>>>26)|0,xt&=67108863,i=Math.imul(U,ft),n=(n=Math.imul(U,lt))+Math.imul(j,ft)|0,o=Math.imul(j,lt);var Ft=(h+(i=i+Math.imul(N,pt)|0)|0)+((8191&(n=(n=n+Math.imul(N,gt)|0)+Math.imul(O,pt)|0))<<13)|0;h=((o=o+Math.imul(O,gt)|0)+(n>>>13)|0)+(Ft>>>26)|0,Ft&=67108863;var Pt=(h+(i=Math.imul(U,pt))|0)+((8191&(n=(n=Math.imul(U,gt))+Math.imul(j,pt)|0))<<13)|0;return h=((o=Math.imul(j,gt))+(n>>>13)|0)+(Pt>>>26)|0,Pt&=67108863,u[0]=yt,u[1]=mt,u[2]=vt,u[3]=bt,u[4]=wt,u[5]=_t,u[6]=St,u[7]=Et,u[8]=Mt,u[9]=At,u[10]=Ct,u[11]=kt,u[12]=It,u[13]=Tt,u[14]=Rt,u[15]=Bt,u[16]=xt,u[17]=Ft,u[18]=Pt,0!==h&&(u[19]=h,r.length++),r};function p(t,e,r){return(new g).mulp(t,e,r)}function g(t,e){this.x=t,this.y=e}Math.imul||(d=l),o.prototype.mulTo=function(t,e){var r=this.length+t.length;return 10===this.length&&10===t.length?d(this,t,e):r<63?l(this,t,e):r<1024?function(t,e,r){r.negative=e.negative^t.negative,r.length=t.length+e.length;for(var i=0,n=0,o=0;o<r.length-1;o++){var s=n;n=0;for(var a=67108863&i,u=Math.min(o,e.length-1),h=Math.max(0,o-t.length+1);h<=u;h++){var c=o-h,f=(0|t.words[c])*(0|e.words[h]),l=67108863&f;a=67108863&(l=l+a|0),n+=(s=(s=s+(f/67108864|0)|0)+(l>>>26)|0)>>>26,s&=67108863}r.words[o]=a,i=s,s=n}return 0!==i?r.words[o]=i:r.length--,r.strip()}(this,t,e):p(this,t,e)},g.prototype.makeRBT=function(t){for(var e=new Array(t),r=o.prototype._countBits(t)-1,i=0;i<t;i++)e[i]=this.revBin(i,r,t);return e},g.prototype.revBin=function(t,e,r){if(0===t||t===r-1)return t;for(var i=0,n=0;n<e;n++)i|=(1&t)<<e-n-1,t>>=1;return i},g.prototype.permute=function(t,e,r,i,n,o){for(var s=0;s<o;s++)i[s]=e[t[s]],n[s]=r[t[s]]},g.prototype.transform=function(t,e,r,i,n,o){this.permute(o,t,e,r,i,n);for(var s=1;s<n;s<<=1)for(var a=s<<1,u=Math.cos(2*Math.PI/a),h=Math.sin(2*Math.PI/a),c=0;c<n;c+=a)for(var f=u,l=h,d=0;d<s;d++){var p=r[c+d],g=i[c+d],y=r[c+d+s],m=i[c+d+s],v=f*y-l*m;m=f*m+l*y,y=v,r[c+d]=p+y,i[c+d]=g+m,r[c+d+s]=p-y,i[c+d+s]=g-m,d!==a&&(v=u*f-h*l,l=u*l+h*f,f=v)}},g.prototype.guessLen13b=function(t,e){var r=1|Math.max(e,t),i=1&r,n=0;for(r=r/2|0;r;r>>>=1)n++;return 1<<n+1+i},g.prototype.conjugate=function(t,e,r){if(!(r<=1))for(var i=0;i<r/2;i++){var n=t[i];t[i]=t[r-i-1],t[r-i-1]=n,n=e[i],e[i]=-e[r-i-1],e[r-i-1]=-n}},g.prototype.normalize13b=function(t,e){for(var r=0,i=0;i<e/2;i++){var n=8192*Math.round(t[2*i+1]/e)+Math.round(t[2*i]/e)+r;t[i]=67108863&n,r=n<67108864?0:n/67108864|0}return t},g.prototype.convert13b=function(t,e,r,n){for(var o=0,s=0;s<e;s++)o+=0|t[s],r[2*s]=8191&o,o>>>=13,r[2*s+1]=8191&o,o>>>=13;for(s=2*e;s<n;++s)r[s]=0;i(0===o),i(0==(-8192&o))},g.prototype.stub=function(t){for(var e=new Array(t),r=0;r<t;r++)e[r]=0;return e},g.prototype.mulp=function(t,e,r){var i=2*this.guessLen13b(t.length,e.length),n=this.makeRBT(i),o=this.stub(i),s=new Array(i),a=new Array(i),u=new Array(i),h=new Array(i),c=new Array(i),f=new Array(i),l=r.words;l.length=i,this.convert13b(t.words,t.length,s,i),this.convert13b(e.words,e.length,h,i),this.transform(s,o,a,u,i,n),this.transform(h,o,c,f,i,n);for(var d=0;d<i;d++){var p=a[d]*c[d]-u[d]*f[d];u[d]=a[d]*f[d]+u[d]*c[d],a[d]=p}return this.conjugate(a,u,i),this.transform(a,u,l,o,i,n),this.conjugate(l,o,i),this.normalize13b(l,i),r.negative=t.negative^e.negative,r.length=t.length+e.length,r.strip()},o.prototype.mul=function(t){var e=new o(null);return e.words=new Array(this.length+t.length),this.mulTo(t,e)},o.prototype.mulf=function(t){var e=new o(null);return e.words=new Array(this.length+t.length),p(this,t,e)},o.prototype.imul=function(t){return this.clone().mulTo(t,this)},o.prototype.imuln=function(t){i("number"==typeof t),i(t<67108864);for(var e=0,r=0;r<this.length;r++){var n=(0|this.words[r])*t,o=(67108863&n)+(67108863&e);e>>=26,e+=n/67108864|0,e+=o>>>26,this.words[r]=67108863&o}return 0!==e&&(this.words[r]=e,this.length++),this},o.prototype.muln=function(t){return this.clone().imuln(t)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(t){var e=function(t){for(var e=new Array(t.bitLength()),r=0;r<e.length;r++){var i=r/26|0,n=r%26;e[r]=(t.words[i]&1<<n)>>>n}return e}(t);if(0===e.length)return new o(1);for(var r=this,i=0;i<e.length&&0===e[i];i++,r=r.sqr());if(++i<e.length)for(var n=r.sqr();i<e.length;i++,n=n.sqr())0!==e[i]&&(r=r.mul(n));return r},o.prototype.iushln=function(t){i("number"==typeof t&&t>=0);var e,r=t%26,n=(t-r)/26,o=67108863>>>26-r<<26-r;if(0!==r){var s=0;for(e=0;e<this.length;e++){var a=this.words[e]&o,u=(0|this.words[e])-a<<r;this.words[e]=u|s,s=a>>>26-r}s&&(this.words[e]=s,this.length++)}if(0!==n){for(e=this.length-1;e>=0;e--)this.words[e+n]=this.words[e];for(e=0;e<n;e++)this.words[e]=0;this.length+=n}return this.strip()},o.prototype.ishln=function(t){return i(0===this.negative),this.iushln(t)},o.prototype.iushrn=function(t,e,r){var n;i("number"==typeof t&&t>=0),n=e?(e-e%26)/26:0;var o=t%26,s=Math.min((t-o)/26,this.length),a=67108863^67108863>>>o<<o,u=r;if(n-=s,n=Math.max(0,n),u){for(var h=0;h<s;h++)u.words[h]=this.words[h];u.length=s}if(0===s);else if(this.length>s)for(this.length-=s,h=0;h<this.length;h++)this.words[h]=this.words[h+s];else this.words[0]=0,this.length=1;var c=0;for(h=this.length-1;h>=0&&(0!==c||h>=n);h--){var f=0|this.words[h];this.words[h]=c<<26-o|f>>>o,c=f&a}return u&&0!==c&&(u.words[u.length++]=c),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},o.prototype.ishrn=function(t,e,r){return i(0===this.negative),this.iushrn(t,e,r)},o.prototype.shln=function(t){return this.clone().ishln(t)},o.prototype.ushln=function(t){return this.clone().iushln(t)},o.prototype.shrn=function(t){return this.clone().ishrn(t)},o.prototype.ushrn=function(t){return this.clone().iushrn(t)},o.prototype.testn=function(t){i("number"==typeof t&&t>=0);var e=t%26,r=(t-e)/26,n=1<<e;return!(this.length<=r||!(this.words[r]&n))},o.prototype.imaskn=function(t){i("number"==typeof t&&t>=0);var e=t%26,r=(t-e)/26;if(i(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==e&&r++,this.length=Math.min(r,this.length),0!==e){var n=67108863^67108863>>>e<<e;this.words[this.length-1]&=n}return this.strip()},o.prototype.maskn=function(t){return this.clone().imaskn(t)},o.prototype.iaddn=function(t){return i("number"==typeof t),i(t<67108864),t<0?this.isubn(-t):0!==this.negative?1===this.length&&(0|this.words[0])<t?(this.words[0]=t-(0|this.words[0]),this.negative=0,this):(this.negative=0,this.isubn(t),this.negative=1,this):this._iaddn(t)},o.prototype._iaddn=function(t){this.words[0]+=t;for(var e=0;e<this.length&&this.words[e]>=67108864;e++)this.words[e]-=67108864,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},o.prototype.isubn=function(t){if(i("number"==typeof t),i(t<67108864),t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var e=0;e<this.length&&this.words[e]<0;e++)this.words[e]+=67108864,this.words[e+1]-=1;return this.strip()},o.prototype.addn=function(t){return this.clone().iaddn(t)},o.prototype.subn=function(t){return this.clone().isubn(t)},o.prototype.iabs=function(){return this.negative=0,this},o.prototype.abs=function(){return this.clone().iabs()},o.prototype._ishlnsubmul=function(t,e,r){var n,o,s=t.length+r;this._expand(s);var a=0;for(n=0;n<t.length;n++){o=(0|this.words[n+r])+a;var u=(0|t.words[n])*e;a=((o-=67108863&u)>>26)-(u/67108864|0),this.words[n+r]=67108863&o}for(;n<this.length-r;n++)a=(o=(0|this.words[n+r])+a)>>26,this.words[n+r]=67108863&o;if(0===a)return this.strip();for(i(-1===a),a=0,n=0;n<this.length;n++)a=(o=-(0|this.words[n])+a)>>26,this.words[n]=67108863&o;return this.negative=1,this.strip()},o.prototype._wordDiv=function(t,e){var r=(this.length,t.length),i=this.clone(),n=t,s=0|n.words[n.length-1];0!=(r=26-this._countBits(s))&&(n=n.ushln(r),i.iushln(r),s=0|n.words[n.length-1]);var a,u=i.length-n.length;if("mod"!==e){(a=new o(null)).length=u+1,a.words=new Array(a.length);for(var h=0;h<a.length;h++)a.words[h]=0}var c=i.clone()._ishlnsubmul(n,1,u);0===c.negative&&(i=c,a&&(a.words[u]=1));for(var f=u-1;f>=0;f--){var l=67108864*(0|i.words[n.length+f])+(0|i.words[n.length+f-1]);for(l=Math.min(l/s|0,67108863),i._ishlnsubmul(n,l,f);0!==i.negative;)l--,i.negative=0,i._ishlnsubmul(n,1,f),i.isZero()||(i.negative^=1);a&&(a.words[f]=l)}return a&&a.strip(),i.strip(),"div"!==e&&0!==r&&i.iushrn(r),{div:a||null,mod:i}},o.prototype.divmod=function(t,e,r){return i(!t.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===t.negative?(a=this.neg().divmod(t,e),"mod"!==e&&(n=a.div.neg()),"div"!==e&&(s=a.mod.neg(),r&&0!==s.negative&&s.iadd(t)),{div:n,mod:s}):0===this.negative&&0!==t.negative?(a=this.divmod(t.neg(),e),"mod"!==e&&(n=a.div.neg()),{div:n,mod:a.mod}):0!=(this.negative&t.negative)?(a=this.neg().divmod(t.neg(),e),"div"!==e&&(s=a.mod.neg(),r&&0!==s.negative&&s.isub(t)),{div:a.div,mod:s}):t.length>this.length||this.cmp(t)<0?{div:new o(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new o(this.modn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new o(this.modn(t.words[0]))}:this._wordDiv(t,e);var n,s,a},o.prototype.div=function(t){return this.divmod(t,"div",!1).div},o.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},o.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},o.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var r=0!==e.div.negative?e.mod.isub(t):e.mod,i=t.ushrn(1),n=t.andln(1),o=r.cmp(i);return o<0||1===n&&0===o?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},o.prototype.modn=function(t){i(t<=67108863);for(var e=(1<<26)%t,r=0,n=this.length-1;n>=0;n--)r=(e*r+(0|this.words[n]))%t;return r},o.prototype.idivn=function(t){i(t<=67108863);for(var e=0,r=this.length-1;r>=0;r--){var n=(0|this.words[r])+67108864*e;this.words[r]=n/t|0,e=n%t}return this.strip()},o.prototype.divn=function(t){return this.clone().idivn(t)},o.prototype.egcd=function(t){i(0===t.negative),i(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var n=new o(1),s=new o(0),a=new o(0),u=new o(1),h=0;e.isEven()&&r.isEven();)e.iushrn(1),r.iushrn(1),++h;for(var c=r.clone(),f=e.clone();!e.isZero();){for(var l=0,d=1;0==(e.words[0]&d)&&l<26;++l,d<<=1);if(l>0)for(e.iushrn(l);l-- >0;)(n.isOdd()||s.isOdd())&&(n.iadd(c),s.isub(f)),n.iushrn(1),s.iushrn(1);for(var p=0,g=1;0==(r.words[0]&g)&&p<26;++p,g<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(a.isOdd()||u.isOdd())&&(a.iadd(c),u.isub(f)),a.iushrn(1),u.iushrn(1);e.cmp(r)>=0?(e.isub(r),n.isub(a),s.isub(u)):(r.isub(e),a.isub(n),u.isub(s))}return{a,b:u,gcd:r.iushln(h)}},o.prototype._invmp=function(t){i(0===t.negative),i(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var n,s=new o(1),a=new o(0),u=r.clone();e.cmpn(1)>0&&r.cmpn(1)>0;){for(var h=0,c=1;0==(e.words[0]&c)&&h<26;++h,c<<=1);if(h>0)for(e.iushrn(h);h-- >0;)s.isOdd()&&s.iadd(u),s.iushrn(1);for(var f=0,l=1;0==(r.words[0]&l)&&f<26;++f,l<<=1);if(f>0)for(r.iushrn(f);f-- >0;)a.isOdd()&&a.iadd(u),a.iushrn(1);e.cmp(r)>=0?(e.isub(r),s.isub(a)):(r.isub(e),a.isub(s))}return(n=0===e.cmpn(1)?s:a).cmpn(0)<0&&n.iadd(t),n},o.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),r=t.clone();e.negative=0,r.negative=0;for(var i=0;e.isEven()&&r.isEven();i++)e.iushrn(1),r.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;r.isEven();)r.iushrn(1);var n=e.cmp(r);if(n<0){var o=e;e=r,r=o}else if(0===n||0===r.cmpn(1))break;e.isub(r)}return r.iushln(i)},o.prototype.invm=function(t){return this.egcd(t).a.umod(t)},o.prototype.isEven=function(){return 0==(1&this.words[0])},o.prototype.isOdd=function(){return 1==(1&this.words[0])},o.prototype.andln=function(t){return this.words[0]&t},o.prototype.bincn=function(t){i("number"==typeof t);var e=t%26,r=(t-e)/26,n=1<<e;if(this.length<=r)return this._expand(r+1),this.words[r]|=n,this;for(var o=n,s=r;0!==o&&s<this.length;s++){var a=0|this.words[s];o=(a+=o)>>>26,a&=67108863,this.words[s]=a}return 0!==o&&(this.words[s]=o,this.length++),this},o.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},o.prototype.cmpn=function(t){var e,r=t<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this.strip(),this.length>1)e=1;else{r&&(t=-t),i(t<=67108863,"Number is too big");var n=0|this.words[0];e=n===t?0:n<t?-1:1}return 0!==this.negative?0|-e:e},o.prototype.cmp=function(t){if(0!==this.negative&&0===t.negative)return-1;if(0===this.negative&&0!==t.negative)return 1;var e=this.ucmp(t);return 0!==this.negative?0|-e:e},o.prototype.ucmp=function(t){if(this.length>t.length)return 1;if(this.length<t.length)return-1;for(var e=0,r=this.length-1;r>=0;r--){var i=0|this.words[r],n=0|t.words[r];if(i!==n){i<n?e=-1:i>n&&(e=1);break}}return e},o.prototype.gtn=function(t){return 1===this.cmpn(t)},o.prototype.gt=function(t){return 1===this.cmp(t)},o.prototype.gten=function(t){return this.cmpn(t)>=0},o.prototype.gte=function(t){return this.cmp(t)>=0},o.prototype.ltn=function(t){return-1===this.cmpn(t)},o.prototype.lt=function(t){return-1===this.cmp(t)},o.prototype.lten=function(t){return this.cmpn(t)<=0},o.prototype.lte=function(t){return this.cmp(t)<=0},o.prototype.eqn=function(t){return 0===this.cmpn(t)},o.prototype.eq=function(t){return 0===this.cmp(t)},o.red=function(t){return new S(t)},o.prototype.toRed=function(t){return i(!this.red,"Already a number in reduction context"),i(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},o.prototype.fromRed=function(){return i(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(t){return this.red=t,this},o.prototype.forceRed=function(t){return i(!this.red,"Already a number in reduction context"),this._forceRed(t)},o.prototype.redAdd=function(t){return i(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},o.prototype.redIAdd=function(t){return i(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},o.prototype.redSub=function(t){return i(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},o.prototype.redISub=function(t){return i(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},o.prototype.redShl=function(t){return i(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},o.prototype.redMul=function(t){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},o.prototype.redIMul=function(t){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},o.prototype.redSqr=function(){return i(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return i(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return i(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return i(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return i(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(t){return i(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var y={k256:null,p224:null,p192:null,p25519:null};function m(t,e){this.name=t,this.p=new o(e,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function v(){m.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function b(){m.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function w(){m.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function _(){m.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function S(t){if("string"==typeof t){var e=o._prime(t);this.m=e.p,this.prime=e}else i(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function E(t){S.call(this,t),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new o(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}m.prototype._tmp=function(){var t=new o(null);return t.words=new Array(Math.ceil(this.n/13)),t},m.prototype.ireduce=function(t){var e,r=t;do{this.split(r,this.tmp),e=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(e>this.n);var i=e<this.n?-1:r.ucmp(this.p);return 0===i?(r.words[0]=0,r.length=1):i>0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},m.prototype.split=function(t,e){t.iushrn(this.n,0,e)},m.prototype.imulK=function(t){return t.imul(this.k)},n(v,m),v.prototype.split=function(t,e){for(var r=4194303,i=Math.min(t.length,9),n=0;n<i;n++)e.words[n]=t.words[n];if(e.length=i,t.length<=9)return t.words[0]=0,void(t.length=1);var o=t.words[9];for(e.words[e.length++]=o&r,n=10;n<t.length;n++){var s=0|t.words[n];t.words[n-10]=(s&r)<<4|o>>>22,o=s}o>>>=22,t.words[n-10]=o,0===o&&t.length>10?t.length-=10:t.length-=9},v.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,r=0;r<t.length;r++){var i=0|t.words[r];e+=977*i,t.words[r]=67108863&e,e=64*i+(e/67108864|0)}return 0===t.words[t.length-1]&&(t.length--,0===t.words[t.length-1]&&t.length--),t},n(b,m),n(w,m),n(_,m),_.prototype.imulK=function(t){for(var e=0,r=0;r<t.length;r++){var i=19*(0|t.words[r])+e,n=67108863&i;i>>>=26,t.words[r]=n,e=i}return 0!==e&&(t.words[t.length++]=e),t},o._prime=function(t){if(y[t])return y[t];var e;if("k256"===t)e=new v;else if("p224"===t)e=new b;else if("p192"===t)e=new w;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new _}return y[t]=e,e},S.prototype._verify1=function(t){i(0===t.negative,"red works only with positives"),i(t.red,"red works only with red numbers")},S.prototype._verify2=function(t,e){i(0==(t.negative|e.negative),"red works only with positives"),i(t.red&&t.red===e.red,"red works only with red numbers")},S.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.umod(this.m)._forceRed(this)},S.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},S.prototype.add=function(t,e){this._verify2(t,e);var r=t.add(e);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},S.prototype.iadd=function(t,e){this._verify2(t,e);var r=t.iadd(e);return r.cmp(this.m)>=0&&r.isub(this.m),r},S.prototype.sub=function(t,e){this._verify2(t,e);var r=t.sub(e);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},S.prototype.isub=function(t,e){this._verify2(t,e);var r=t.isub(e);return r.cmpn(0)<0&&r.iadd(this.m),r},S.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},S.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},S.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},S.prototype.isqr=function(t){return this.imul(t,t.clone())},S.prototype.sqr=function(t){return this.mul(t,t)},S.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(i(e%2==1),3===e){var r=this.m.add(new o(1)).iushrn(2);return this.pow(t,r)}for(var n=this.m.subn(1),s=0;!n.isZero()&&0===n.andln(1);)s++,n.iushrn(1);i(!n.isZero());var a=new o(1).toRed(this),u=a.redNeg(),h=this.m.subn(1).iushrn(1),c=this.m.bitLength();for(c=new o(2*c*c).toRed(this);0!==this.pow(c,h).cmp(u);)c.redIAdd(u);for(var f=this.pow(c,n),l=this.pow(t,n.addn(1).iushrn(1)),d=this.pow(t,n),p=s;0!==d.cmp(a);){for(var g=d,y=0;0!==g.cmp(a);y++)g=g.redSqr();i(y<p);var m=this.pow(f,new o(1).iushln(p-y-1));l=l.redMul(m),f=m.redSqr(),d=d.redMul(f),p=y}return l},S.prototype.invm=function(t){var e=t._invmp(this.m);return 0!==e.negative?(e.negative=0,this.imod(e).redNeg()):this.imod(e)},S.prototype.pow=function(t,e){if(e.isZero())return new o(1).toRed(this);if(0===e.cmpn(1))return t.clone();var r=new Array(16);r[0]=new o(1).toRed(this),r[1]=t;for(var i=2;i<r.length;i++)r[i]=this.mul(r[i-1],t);var n=r[0],s=0,a=0,u=e.bitLength()%26;for(0===u&&(u=26),i=e.length-1;i>=0;i--){for(var h=e.words[i],c=u-1;c>=0;c--){var f=h>>c&1;n!==r[0]&&(n=this.sqr(n)),0!==f||0!==s?(s<<=1,s|=f,(4==++a||0===i&&0===c)&&(n=this.mul(n,r[s]),a=0,s=0)):a=0}u=26}return n},S.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},S.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},o.mont=function(t){return new E(t)},n(E,S),E.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},E.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},E.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var r=t.imul(e),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(i).iushrn(this.shift),o=n;return n.cmp(this.m)>=0?o=n.isub(this.m):n.cmpn(0)<0&&(o=n.iadd(this.m)),o._forceRed(this)},E.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new o(0)._forceRed(this);var r=t.mul(e),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(i).iushrn(this.shift),s=n;return n.cmp(this.m)>=0?s=n.isub(this.m):n.cmpn(0)<0&&(s=n.iadd(this.m)),s._forceRed(this)},E.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(t=r.nmd(t),this)},17519:t=>{"use strict";t.exports={i8:"6.5.4"}},94079:(t,e,r)=>{"use strict";var i=r(40210)("%Object.getOwnPropertyDescriptor%");if(i)try{i([],"length")}catch(t){i=null}t.exports=i},82702:function(t,e,r){t.exports=function(){"use strict";function t(t){return"function"==typeof t}var e=Array.isArray?Array.isArray:function(t){return"[object Array]"===Object.prototype.toString.call(t)},i=0,n=void 0,o=void 0,s=function(t,e){d[i]=t,d[i+1]=e,2===(i+=2)&&(o?o(p):b())};var a="undefined"!=typeof window?window:void 0,u=a||{},h=u.MutationObserver||u.WebKitMutationObserver,c="undefined"==typeof self&&"undefined"!=typeof process&&"[object process]"==={}.toString.call(process),f="undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof importScripts&&"undefined"!=typeof MessageChannel;function l(){var t=setTimeout;return function(){return t(p,1)}}var d=new Array(1e3);function p(){for(var t=0;t<i;t+=2)(0,d[t])(d[t+1]),d[t]=void 0,d[t+1]=void 0;i=0}var g,y,m,v,b=void 0;function w(t,e){var r=this,i=new this.constructor(E);void 0===i[S]&&P(i);var n=r._state;if(n){var o=arguments[n-1];s((function(){return x(n,i,o,r._result)}))}else R(r,i,t,e);return i}function _(t){if(t&&"object"==typeof t&&t.constructor===this)return t;var e=new this(E);return C(e,t),e}b=c?function(){return process.nextTick(p)}:h?(y=0,m=new h(p),v=document.createTextNode(""),m.observe(v,{characterData:!0}),function(){v.data=y=++y%2}):f?((g=new MessageChannel).port1.onmessage=p,function(){return g.port2.postMessage(0)}):void 0===a?function(){try{var t=Function("return this")().require("vertx");return void 0!==(n=t.runOnLoop||t.runOnContext)?function(){n(p)}:l()}catch(t){return l()}}():l();var S=Math.random().toString(36).substring(2);function E(){}var M=void 0;function A(e,r,i){r.constructor===e.constructor&&i===w&&r.constructor.resolve===_?function(t,e){1===e._state?I(t,e._result):2===e._state?T(t,e._result):R(e,void 0,(function(e){return C(t,e)}),(function(e){return T(t,e)}))}(e,r):void 0===i?I(e,r):t(i)?function(t,e,r){s((function(t){var i=!1,n=function(t,e,r,i){try{t.call(e,r,i)}catch(t){return t}}(r,e,(function(r){i||(i=!0,e!==r?C(t,r):I(t,r))}),(function(e){i||(i=!0,T(t,e))}),t._label);!i&&n&&(i=!0,T(t,n))}),t)}(e,r,i):I(e,r)}function C(t,e){if(t===e)T(t,new TypeError("You cannot resolve a promise with itself"));else if(n=typeof(i=e),null===i||"object"!==n&&"function"!==n)I(t,e);else{var r=void 0;try{r=e.then}catch(e){return void T(t,e)}A(t,e,r)}var i,n}function k(t){t._onerror&&t._onerror(t._result),B(t)}function I(t,e){t._state===M&&(t._result=e,t._state=1,0!==t._subscribers.length&&s(B,t))}function T(t,e){t._state===M&&(t._state=2,t._result=e,s(k,t))}function R(t,e,r,i){var n=t._subscribers,o=n.length;t._onerror=null,n[o]=e,n[o+1]=r,n[o+2]=i,0===o&&t._state&&s(B,t)}function B(t){var e=t._subscribers,r=t._state;if(0!==e.length){for(var i=void 0,n=void 0,o=t._result,s=0;s<e.length;s+=3)i=e[s],n=e[s+r],i?x(r,i,n,o):n(o);t._subscribers.length=0}}function x(e,r,i,n){var o=t(i),s=void 0,a=void 0,u=!0;if(o){try{s=i(n)}catch(t){u=!1,a=t}if(r===s)return void T(r,new TypeError("A promises callback cannot return that same promise."))}else s=n;r._state!==M||(o&&u?C(r,s):!1===u?T(r,a):1===e?I(r,s):2===e&&T(r,s))}var F=0;function P(t){t[S]=F++,t._state=void 0,t._result=void 0,t._subscribers=[]}var N=function(){function t(t,r){this._instanceConstructor=t,this.promise=new t(E),this.promise[S]||P(this.promise),e(r)?(this.length=r.length,this._remaining=r.length,this._result=new Array(this.length),0===this.length?I(this.promise,this._result):(this.length=this.length||0,this._enumerate(r),0===this._remaining&&I(this.promise,this._result))):T(this.promise,new Error("Array Methods must be provided an Array"))}return t.prototype._enumerate=function(t){for(var e=0;this._state===M&&e<t.length;e++)this._eachEntry(t[e],e)},t.prototype._eachEntry=function(t,e){var r=this._instanceConstructor,i=r.resolve;if(i===_){var n=void 0,o=void 0,s=!1;try{n=t.then}catch(t){s=!0,o=t}if(n===w&&t._state!==M)this._settledAt(t._state,e,t._result);else if("function"!=typeof n)this._remaining--,this._result[e]=t;else if(r===O){var a=new r(E);s?T(a,o):A(a,t,n),this._willSettleAt(a,e)}else this._willSettleAt(new r((function(e){return e(t)})),e)}else this._willSettleAt(i(t),e)},t.prototype._settledAt=function(t,e,r){var i=this.promise;i._state===M&&(this._remaining--,2===t?T(i,r):this._result[e]=r),0===this._remaining&&I(i,this._result)},t.prototype._willSettleAt=function(t,e){var r=this;R(t,void 0,(function(t){return r._settledAt(1,e,t)}),(function(t){return r._settledAt(2,e,t)}))},t}();var O=function(){function e(t){this[S]=F++,this._result=this._state=void 0,this._subscribers=[],E!==t&&("function"!=typeof t&&function(){throw new TypeError("You must pass a resolver function as the first argument to the promise constructor")}(),this instanceof e?function(t,e){try{e((function(e){C(t,e)}),(function(e){T(t,e)}))}catch(e){T(t,e)}}(this,t):function(){throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.")}())}return e.prototype.catch=function(t){return this.then(null,t)},e.prototype.finally=function(e){var r=this,i=r.constructor;return t(e)?r.then((function(t){return i.resolve(e()).then((function(){return t}))}),(function(t){return i.resolve(e()).then((function(){throw t}))})):r.then(e,e)},e}();return O.prototype.then=w,O.all=function(t){return new N(this,t).promise},O.race=function(t){var r=this;return e(t)?new r((function(e,i){for(var n=t.length,o=0;o<n;o++)r.resolve(t[o]).then(e,i)})):new r((function(t,e){return e(new TypeError("You must pass an array to race."))}))},O.resolve=_,O.reject=function(t){var e=new this(E);return T(e,t),e},O._setScheduler=function(t){o=t},O._setAsap=function(t){s=t},O._asap=s,O.polyfill=function(){var t=void 0;if(void 0!==r.g)t=r.g;else if("undefined"!=typeof self)t=self;else try{t=Function("return this")()}catch(t){throw new Error("polyfill failed because global object is unavailable in this environment")}var e=t.Promise;if(e){var i=null;try{i=Object.prototype.toString.call(e.resolve())}catch(t){}if("[object Promise]"===i&&!e.cast)return}t.Promise=O},O.Promise=O,O}()},17187:t=>{"use strict";var e,r="object"==typeof Reflect?Reflect:null,i=r&&"function"==typeof r.apply?r.apply:function(t,e,r){return Function.prototype.apply.call(t,e,r)};e=r&&"function"==typeof r.ownKeys?r.ownKeys:Object.getOwnPropertySymbols?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:function(t){return Object.getOwnPropertyNames(t)};var n=Number.isNaN||function(t){return t!=t};function o(){o.init.call(this)}t.exports=o,t.exports.once=function(t,e){return new Promise((function(r,i){function n(){void 0!==o&&t.removeListener("error",o),r([].slice.call(arguments))}var o;"error"!==e&&(o=function(r){t.removeListener(e,n),i(r)},t.once("error",o)),t.once(e,n)}))},o.EventEmitter=o,o.prototype._events=void 0,o.prototype._eventsCount=0,o.prototype._maxListeners=void 0;var s=10;function a(t){if("function"!=typeof t)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t)}function u(t){return void 0===t._maxListeners?o.defaultMaxListeners:t._maxListeners}function h(t,e,r,i){var n,o,s,h;if(a(r),void 0===(o=t._events)?(o=t._events=Object.create(null),t._eventsCount=0):(void 0!==o.newListener&&(t.emit("newListener",e,r.listener?r.listener:r),o=t._events),s=o[e]),void 0===s)s=o[e]=r,++t._eventsCount;else if("function"==typeof s?s=o[e]=i?[r,s]:[s,r]:i?s.unshift(r):s.push(r),(n=u(t))>0&&s.length>n&&!s.warned){s.warned=!0;var c=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");c.name="MaxListenersExceededWarning",c.emitter=t,c.type=e,c.count=s.length,h=c,console&&console.warn&&console.warn(h)}return t}function c(){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 f(t,e,r){var i={fired:!1,wrapFn:void 0,target:t,type:e,listener:r},n=c.bind(i);return n.listener=r,i.wrapFn=n,n}function l(t,e,r){var i=t._events;if(void 0===i)return[];var n=i[e];return void 0===n?[]:"function"==typeof n?r?[n.listener||n]:[n]:r?function(t){for(var e=new Array(t.length),r=0;r<e.length;++r)e[r]=t[r].listener||t[r];return e}(n):p(n,n.length)}function d(t){var e=this._events;if(void 0!==e){var r=e[t];if("function"==typeof r)return 1;if(void 0!==r)return r.length}return 0}function p(t,e){for(var r=new Array(e),i=0;i<e;++i)r[i]=t[i];return r}Object.defineProperty(o,"defaultMaxListeners",{enumerable:!0,get:function(){return s},set:function(t){if("number"!=typeof t||t<0||n(t))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+t+".");s=t}}),o.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},o.prototype.setMaxListeners=function(t){if("number"!=typeof t||t<0||n(t))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+t+".");return this._maxListeners=t,this},o.prototype.getMaxListeners=function(){return u(this)},o.prototype.emit=function(t){for(var e=[],r=1;r<arguments.length;r++)e.push(arguments[r]);var n="error"===t,o=this._events;if(void 0!==o)n=n&&void 0===o.error;else if(!n)return!1;if(n){var s;if(e.length>0&&(s=e[0]),s instanceof Error)throw s;var a=new Error("Unhandled error."+(s?" ("+s.message+")":""));throw a.context=s,a}var u=o[t];if(void 0===u)return!1;if("function"==typeof u)i(u,this,e);else{var h=u.length,c=p(u,h);for(r=0;r<h;++r)i(c[r],this,e)}return!0},o.prototype.addListener=function(t,e){return h(this,t,e,!1)},o.prototype.on=o.prototype.addListener,o.prototype.prependListener=function(t,e){return h(this,t,e,!0)},o.prototype.once=function(t,e){return a(e),this.on(t,f(this,t,e)),this},o.prototype.prependOnceListener=function(t,e){return a(e),this.prependListener(t,f(this,t,e)),this},o.prototype.removeListener=function(t,e){var r,i,n,o,s;if(a(e),void 0===(i=this._events))return this;if(void 0===(r=i[t]))return this;if(r===e||r.listener===e)0==--this._eventsCount?this._events=Object.create(null):(delete i[t],i.removeListener&&this.emit("removeListener",t,r.listener||e));else if("function"!=typeof r){for(n=-1,o=r.length-1;o>=0;o--)if(r[o]===e||r[o].listener===e){s=r[o].listener,n=o;break}if(n<0)return this;0===n?r.shift():function(t,e){for(;e+1<t.length;e++)t[e]=t[e+1];t.pop()}(r,n),1===r.length&&(i[t]=r[0]),void 0!==i.removeListener&&this.emit("removeListener",t,s||e)}return this},o.prototype.off=o.prototype.removeListener,o.prototype.removeAllListeners=function(t){var e,r,i;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[t]&&(0==--this._eventsCount?this._events=Object.create(null):delete r[t]),this;if(0===arguments.length){var n,o=Object.keys(r);for(i=0;i<o.length;++i)"removeListener"!==(n=o[i])&&this.removeAllListeners(n);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(e=r[t]))this.removeListener(t,e);else if(void 0!==e)for(i=e.length-1;i>=0;i--)this.removeListener(t,e[i]);return this},o.prototype.listeners=function(t){return l(this,t,!0)},o.prototype.rawListeners=function(t){return l(this,t,!1)},o.listenerCount=function(t,e){return"function"==typeof t.listenerCount?t.listenerCount(e):d.call(t,e)},o.prototype.listenerCount=d,o.prototype.eventNames=function(){return this._eventsCount>0?e(this._events):[]}},13048:(t,e,r)=>{var i=r(89509).Buffer,n=r(62318);t.exports=function(t,e,r,o){if(i.isBuffer(t)||(t=i.from(t,"binary")),e&&(i.isBuffer(e)||(e=i.from(e,"binary")),8!==e.length))throw new RangeError("salt should be Buffer with 8 byte length");for(var s=r/8,a=i.alloc(s),u=i.alloc(o||0),h=i.alloc(0);s>0||o>0;){var c=new n;c.update(h),c.update(t),e&&c.update(e),h=c.digest();var f=0;if(s>0){var l=a.length-s;f=Math.min(s,h.length),h.copy(a,l,0,f),s-=f}if(f<h.length&&o>0){var d=u.length-o,p=Math.min(o,h.length-f);h.copy(u,d,f,f+p),o-=p}}return h.fill(0),{key:a,iv:u}}},49804:t=>{var e=Object.prototype.hasOwnProperty,r=Object.prototype.toString;t.exports=function(t,i,n){if("[object Function]"!==r.call(i))throw new TypeError("iterator must be a function");var o=t.length;if(o===+o)for(var s=0;s<o;s++)i.call(n,t[s],s,t);else for(var a in t)e.call(t,a)&&i.call(n,t[a],a,t)}},17648:t=>{"use strict";var e="Function.prototype.bind called on incompatible ",r=Array.prototype.slice,i=Object.prototype.toString,n="[object Function]";t.exports=function(t){var o=this;if("function"!=typeof o||i.call(o)!==n)throw new TypeError(e+o);for(var s,a=r.call(arguments,1),u=function(){if(this instanceof s){var e=o.apply(this,a.concat(r.call(arguments)));return Object(e)===e?e:this}return o.apply(t,a.concat(r.call(arguments)))},h=Math.max(0,o.length-a.length),c=[],f=0;f<h;f++)c.push("$"+f);if(s=Function("binder","return function ("+c.join(",")+"){ return binder.apply(this,arguments); }")(u),o.prototype){var l=function(){};l.prototype=o.prototype,s.prototype=new l,l.prototype=null}return s}},58612:(t,e,r)=>{"use strict";var i=r(17648);t.exports=Function.prototype.bind||i},40210:(t,e,r)=>{"use strict";var i,n=SyntaxError,o=Function,s=TypeError,a=function(t){try{return o('"use strict"; return ('+t+").constructor;")()}catch(t){}},u=Object.getOwnPropertyDescriptor;if(u)try{u({},"")}catch(t){u=null}var h=function(){throw new s},c=u?function(){try{return h}catch(t){try{return u(arguments,"callee").get}catch(t){return h}}}():h,f=r(41405)(),l=Object.getPrototypeOf||function(t){return t.__proto__},d={},p="undefined"==typeof Uint8Array?i:l(Uint8Array),g={"%AggregateError%":"undefined"==typeof AggregateError?i:AggregateError,"%Array%":Array,"%ArrayBuffer%":"undefined"==typeof ArrayBuffer?i:ArrayBuffer,"%ArrayIteratorPrototype%":f?l([][Symbol.iterator]()):i,"%AsyncFromSyncIteratorPrototype%":i,"%AsyncFunction%":d,"%AsyncGenerator%":d,"%AsyncGeneratorFunction%":d,"%AsyncIteratorPrototype%":d,"%Atomics%":"undefined"==typeof Atomics?i:Atomics,"%BigInt%":"undefined"==typeof BigInt?i:BigInt,"%Boolean%":Boolean,"%DataView%":"undefined"==typeof DataView?i:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":"undefined"==typeof Float32Array?i:Float32Array,"%Float64Array%":"undefined"==typeof Float64Array?i:Float64Array,"%FinalizationRegistry%":"undefined"==typeof FinalizationRegistry?i:FinalizationRegistry,"%Function%":o,"%GeneratorFunction%":d,"%Int8Array%":"undefined"==typeof Int8Array?i:Int8Array,"%Int16Array%":"undefined"==typeof Int16Array?i:Int16Array,"%Int32Array%":"undefined"==typeof Int32Array?i:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":f?l(l([][Symbol.iterator]())):i,"%JSON%":"object"==typeof JSON?JSON:i,"%Map%":"undefined"==typeof Map?i:Map,"%MapIteratorPrototype%":"undefined"!=typeof Map&&f?l((new Map)[Symbol.iterator]()):i,"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":"undefined"==typeof Promise?i:Promise,"%Proxy%":"undefined"==typeof Proxy?i:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":"undefined"==typeof Reflect?i:Reflect,"%RegExp%":RegExp,"%Set%":"undefined"==typeof Set?i:Set,"%SetIteratorPrototype%":"undefined"!=typeof Set&&f?l((new Set)[Symbol.iterator]()):i,"%SharedArrayBuffer%":"undefined"==typeof SharedArrayBuffer?i:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":f?l(""[Symbol.iterator]()):i,"%Symbol%":f?Symbol:i,"%SyntaxError%":n,"%ThrowTypeError%":c,"%TypedArray%":p,"%TypeError%":s,"%Uint8Array%":"undefined"==typeof Uint8Array?i:Uint8Array,"%Uint8ClampedArray%":"undefined"==typeof Uint8ClampedArray?i:Uint8ClampedArray,"%Uint16Array%":"undefined"==typeof Uint16Array?i:Uint16Array,"%Uint32Array%":"undefined"==typeof Uint32Array?i:Uint32Array,"%URIError%":URIError,"%WeakMap%":"undefined"==typeof WeakMap?i:WeakMap,"%WeakRef%":"undefined"==typeof WeakRef?i:WeakRef,"%WeakSet%":"undefined"==typeof WeakSet?i:WeakSet},y=function t(e){var r;if("%AsyncFunction%"===e)r=a("async function () {}");else if("%GeneratorFunction%"===e)r=a("function* () {}");else if("%AsyncGeneratorFunction%"===e)r=a("async function* () {}");else if("%AsyncGenerator%"===e){var i=t("%AsyncGeneratorFunction%");i&&(r=i.prototype)}else if("%AsyncIteratorPrototype%"===e){var n=t("%AsyncGenerator%");n&&(r=l(n.prototype))}return g[e]=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"]},v=r(58612),b=r(17642),w=v.call(Function.call,Array.prototype.concat),_=v.call(Function.apply,Array.prototype.splice),S=v.call(Function.call,String.prototype.replace),E=v.call(Function.call,String.prototype.slice),M=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,A=/\\(\\)?/g,C=function(t){var e=E(t,0,1),r=E(t,-1);if("%"===e&&"%"!==r)throw new n("invalid intrinsic syntax, expected closing `%`");if("%"===r&&"%"!==e)throw new n("invalid intrinsic syntax, expected opening `%`");var i=[];return S(t,M,(function(t,e,r,n){i[i.length]=r?S(n,A,"$1"):e||t})),i},k=function(t,e){var r,i=t;if(b(m,i)&&(i="%"+(r=m[i])[0]+"%"),b(g,i)){var o=g[i];if(o===d&&(o=y(i)),void 0===o&&!e)throw new s("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:r,name:i,value:o}}throw new n("intrinsic "+t+" does not exist!")};t.exports=function(t,e){if("string"!=typeof t||0===t.length)throw new s("intrinsic name must be a non-empty string");if(arguments.length>1&&"boolean"!=typeof e)throw new s('"allowMissing" argument must be a boolean');var r=C(t),i=r.length>0?r[0]:"",o=k("%"+i+"%",e),a=o.name,h=o.value,c=!1,f=o.alias;f&&(i=f[0],_(r,w([0,1],f)));for(var l=1,d=!0;l<r.length;l+=1){var p=r[l],y=E(p,0,1),m=E(p,-1);if(('"'===y||"'"===y||"`"===y||'"'===m||"'"===m||"`"===m)&&y!==m)throw new n("property names with quotes must have matching quotes");if("constructor"!==p&&d||(c=!0),b(g,a="%"+(i+="."+p)+"%"))h=g[a];else if(null!=h){if(!(p in h)){if(!e)throw new s("base intrinsic for "+t+" exists, but the property is not available.");return}if(u&&l+1>=r.length){var v=u(h,p);h=(d=!!v)&&"get"in v&&!("originalValue"in v.get)?v.get:h[p]}else d=b(h,p),h=h[p];d&&!c&&(g[a]=h)}}return h}},41405:(t,e,r)=>{"use strict";var i=r.g.Symbol,n=r(55419);t.exports=function(){return"function"==typeof i&&"function"==typeof Symbol&&"symbol"==typeof i("foo")&&"symbol"==typeof Symbol("bar")&&n()}},55419:t=>{"use strict";t.exports=function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var t={},e=Symbol("test"),r=Object(e);if("string"==typeof e)return!1;if("[object Symbol]"!==Object.prototype.toString.call(e))return!1;if("[object Symbol]"!==Object.prototype.toString.call(r))return!1;for(e in t[e]=42,t)return!1;if("function"==typeof Object.keys&&0!==Object.keys(t).length)return!1;if("function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(t).length)return!1;var i=Object.getOwnPropertySymbols(t);if(1!==i.length||i[0]!==e)return!1;if(!Object.prototype.propertyIsEnumerable.call(t,e))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var n=Object.getOwnPropertyDescriptor(t,e);if(42!==n.value||!0!==n.enumerable)return!1}return!0}},17642:(t,e,r)=>{"use strict";var i=r(58612);t.exports=i.call(Function.call,Object.prototype.hasOwnProperty)},3349:(t,e,r)=>{"use strict";var i=r(50213).Buffer,n=r(70326).Transform;function o(t){n.call(this),this._block=i.allocUnsafe(t),this._blockSize=t,this._blockOffset=0,this._length=[0,0,0,0],this._finalized=!1}r(35717)(o,n),o.prototype._transform=function(t,e,r){var i=null;try{this.update(t,e)}catch(t){i=t}r(i)},o.prototype._flush=function(t){var e=null;try{this.push(this.digest())}catch(t){e=t}t(e)},o.prototype.update=function(t,e){if(function(t,e){if(!i.isBuffer(t)&&"string"!=typeof t)throw new TypeError("Data must be a string or a buffer")}(t),this._finalized)throw new Error("Digest already called");i.isBuffer(t)||(t=i.from(t,e));for(var r=this._block,n=0;this._blockOffset+t.length-n>=this._blockSize;){for(var o=this._blockOffset;o<this._blockSize;)r[o++]=t[n++];this._update(),this._blockOffset=0}for(;n<t.length;)r[this._blockOffset++]=t[n++];for(var s=0,a=8*t.length;a>0;++s)this._length[s]+=a,(a=this._length[s]/4294967296|0)>0&&(this._length[s]-=4294967296*a);return this},o.prototype._update=function(){throw new Error("_update is not implemented")},o.prototype.digest=function(t){if(this._finalized)throw new Error("Digest already called");this._finalized=!0;var e=this._digest();void 0!==t&&(e=e.toString(t)),this._block.fill(0),this._blockOffset=0;for(var r=0;r<4;++r)this._length[r]=0;return e},o.prototype._digest=function(){throw new Error("_digest is not implemented")},t.exports=o},9786:t=>{"use strict";var e={};function r(t,r,i){i||(i=Error);var n=function(t){var e,i;function n(e,i,n){return t.call(this,function(t,e,i){return"string"==typeof r?r:r(t,e,i)}(e,i,n))||this}return i=t,(e=n).prototype=Object.create(i.prototype),e.prototype.constructor=e,e.__proto__=i,n}(i);n.prototype.name=i.name,n.prototype.code=t,e[t]=n}function i(t,e){if(Array.isArray(t)){var r=t.length;return t=t.map((function(t){return String(t)})),r>2?"one of ".concat(e," ").concat(t.slice(0,r-1).join(", "),", or ")+t[r-1]:2===r?"one of ".concat(e," ").concat(t[0]," or ").concat(t[1]):"of ".concat(e," ").concat(t[0])}return"of ".concat(e," ").concat(String(t))}r("ERR_INVALID_OPT_VALUE",(function(t,e){return'The value "'+e+'" is invalid for option "'+t+'"'}),TypeError),r("ERR_INVALID_ARG_TYPE",(function(t,e,r){var n,o,s,a,u;if("string"==typeof e&&(o="not ",e.substr(0,o.length)===o)?(n="must not be",e=e.replace(/^not /,"")):n="must be",function(t,e,r){return(void 0===r||r>t.length)&&(r=t.length),t.substring(r-e.length,r)===e}(t," argument"))s="The ".concat(t," ").concat(n," ").concat(i(e,"type"));else{var h=("number"!=typeof u&&(u=0),u+".".length>(a=t).length||-1===a.indexOf(".",u)?"argument":"property");s='The "'.concat(t,'" ').concat(h," ").concat(n," ").concat(i(e,"type"))}return s+". Received type ".concat(typeof r)}),TypeError),r("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),r("ERR_METHOD_NOT_IMPLEMENTED",(function(t){return"The "+t+" method is not implemented"})),r("ERR_STREAM_PREMATURE_CLOSE","Premature close"),r("ERR_STREAM_DESTROYED",(function(t){return"Cannot call "+t+" after a stream was destroyed"})),r("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),r("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),r("ERR_STREAM_WRITE_AFTER_END","write after end"),r("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),r("ERR_UNKNOWN_ENCODING",(function(t){return"Unknown encoding: "+t}),TypeError),r("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),t.exports.q=e},62910:(t,e,r)=>{"use strict";var i=Object.keys||function(t){var e=[];for(var r in t)e.push(r);return e};t.exports=h;var n=r(45789),o=r(70469);r(35717)(h,n);for(var s=i(o.prototype),a=0;a<s.length;a++){var u=s[a];h.prototype[u]||(h.prototype[u]=o.prototype[u])}function h(t){if(!(this instanceof h))return new h(t);n.call(this,t),o.call(this,t),this.allowHalfOpen=!0,t&&(!1===t.readable&&(this.readable=!1),!1===t.writable&&(this.writable=!1),!1===t.allowHalfOpen&&(this.allowHalfOpen=!1,this.once("end",c)))}function c(){this._writableState.ended||process.nextTick(f,this)}function f(t){t.end()}Object.defineProperty(h.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(h.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(h.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(h.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&void 0!==this._writableState&&this._readableState.destroyed&&this._writableState.destroyed},set:function(t){void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed=t,this._writableState.destroyed=t)}})},58994:(t,e,r)=>{"use strict";t.exports=n;var i=r(70421);function n(t){if(!(this instanceof n))return new n(t);i.call(this,t)}r(35717)(n,i),n.prototype._transform=function(t,e,r){r(null,t)}},45789:(t,e,r)=>{"use strict";var i;t.exports=M,M.ReadableState=E,r(17187).EventEmitter;var n,o=function(t,e){return t.listeners(e).length},s=r(50677),a=r(48764).Buffer,u=r.g.Uint8Array||function(){},h=r(61758);n=h&&h.debuglog?h.debuglog("stream"):function(){};var c,f,l,d=r(98354),p=r(35072),g=r(31222).getHighWaterMark,y=r(9786).q,m=y.ERR_INVALID_ARG_TYPE,v=y.ERR_STREAM_PUSH_AFTER_EOF,b=y.ERR_METHOD_NOT_IMPLEMENTED,w=y.ERR_STREAM_UNSHIFT_AFTER_END_EVENT;r(35717)(M,s);var _=p.errorOrDestroy,S=["error","close","destroy","pause","resume"];function E(t,e,n){i=i||r(62910),t=t||{},"boolean"!=typeof n&&(n=e instanceof i),this.objectMode=!!t.objectMode,n&&(this.objectMode=this.objectMode||!!t.readableObjectMode),this.highWaterMark=g(this,t,"readableHighWaterMark",n),this.buffer=new d,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=!1!==t.emitClose,this.autoDestroy=!!t.autoDestroy,this.destroyed=!1,this.defaultEncoding=t.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,t.encoding&&(c||(c=r(32553).s),this.decoder=new c(t.encoding),this.encoding=t.encoding)}function M(t){if(i=i||r(62910),!(this instanceof M))return new M(t);var e=this instanceof i;this._readableState=new E(t,this,e),this.readable=!0,t&&("function"==typeof t.read&&(this._read=t.read),"function"==typeof t.destroy&&(this._destroy=t.destroy)),s.call(this)}function A(t,e,r,i,o){n("readableAddChunk",e);var s,h=t._readableState;if(null===e)h.reading=!1,function(t,e){if(n("onEofChunk"),!e.ended){if(e.decoder){var r=e.decoder.end();r&&r.length&&(e.buffer.push(r),e.length+=e.objectMode?1:r.length)}e.ended=!0,e.sync?T(t):(e.needReadable=!1,e.emittedReadable||(e.emittedReadable=!0,R(t)))}}(t,h);else if(o||(s=function(t,e){var r,i;return i=e,a.isBuffer(i)||i instanceof u||"string"==typeof e||void 0===e||t.objectMode||(r=new m("chunk",["string","Buffer","Uint8Array"],e)),r}(h,e)),s)_(t,s);else if(h.objectMode||e&&e.length>0)if("string"==typeof e||h.objectMode||Object.getPrototypeOf(e)===a.prototype||(e=function(t){return a.from(t)}(e)),i)h.endEmitted?_(t,new w):C(t,h,e,!0);else if(h.ended)_(t,new v);else{if(h.destroyed)return!1;h.reading=!1,h.decoder&&!r?(e=h.decoder.write(e),h.objectMode||0!==e.length?C(t,h,e,!1):B(t,h)):C(t,h,e,!1)}else i||(h.reading=!1,B(t,h));return!h.ended&&(h.length<h.highWaterMark||0===h.length)}function C(t,e,r,i){e.flowing&&0===e.length&&!e.sync?(e.awaitDrain=0,t.emit("data",r)):(e.length+=e.objectMode?1:r.length,i?e.buffer.unshift(r):e.buffer.push(r),e.needReadable&&T(t)),B(t,e)}Object.defineProperty(M.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&this._readableState.destroyed},set:function(t){this._readableState&&(this._readableState.destroyed=t)}}),M.prototype.destroy=p.destroy,M.prototype._undestroy=p.undestroy,M.prototype._destroy=function(t,e){e(t)},M.prototype.push=function(t,e){var r,i=this._readableState;return i.objectMode?r=!0:"string"==typeof t&&((e=e||i.defaultEncoding)!==i.encoding&&(t=a.from(t,e),e=""),r=!0),A(this,t,e,!1,r)},M.prototype.unshift=function(t){return A(this,t,null,!0,!1)},M.prototype.isPaused=function(){return!1===this._readableState.flowing},M.prototype.setEncoding=function(t){c||(c=r(32553).s);var e=new c(t);this._readableState.decoder=e,this._readableState.encoding=this._readableState.decoder.encoding;for(var i=this._readableState.buffer.head,n="";null!==i;)n+=e.write(i.data),i=i.next;return this._readableState.buffer.clear(),""!==n&&this._readableState.buffer.push(n),this._readableState.length=n.length,this};var k=1073741824;function I(t,e){return t<=0||0===e.length&&e.ended?0:e.objectMode?1:t!=t?e.flowing&&e.length?e.buffer.head.data.length:e.length:(t>e.highWaterMark&&(e.highWaterMark=function(t){return t>=k?t=k:(t--,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,t++),t}(t)),t<=e.length?t:e.ended?e.length:(e.needReadable=!0,0))}function T(t){var e=t._readableState;n("emitReadable",e.needReadable,e.emittedReadable),e.needReadable=!1,e.emittedReadable||(n("emitReadable",e.flowing),e.emittedReadable=!0,process.nextTick(R,t))}function R(t){var e=t._readableState;n("emitReadable_",e.destroyed,e.length,e.ended),e.destroyed||!e.length&&!e.ended||(t.emit("readable"),e.emittedReadable=!1),e.needReadable=!e.flowing&&!e.ended&&e.length<=e.highWaterMark,O(t)}function B(t,e){e.readingMore||(e.readingMore=!0,process.nextTick(x,t,e))}function x(t,e){for(;!e.reading&&!e.ended&&(e.length<e.highWaterMark||e.flowing&&0===e.length);){var r=e.length;if(n("maybeReadMore read 0"),t.read(0),r===e.length)break}e.readingMore=!1}function F(t){var e=t._readableState;e.readableListening=t.listenerCount("readable")>0,e.resumeScheduled&&!e.paused?e.flowing=!0:t.listenerCount("data")>0&&t.resume()}function P(t){n("readable nexttick read 0"),t.read(0)}function N(t,e){n("resume",e.reading),e.reading||t.read(0),e.resumeScheduled=!1,t.emit("resume"),O(t),e.flowing&&!e.reading&&t.read(0)}function O(t){var e=t._readableState;for(n("flow",e.flowing);e.flowing&&null!==t.read(););}function L(t,e){return 0===e.length?null:(e.objectMode?r=e.buffer.shift():!t||t>=e.length?(r=e.decoder?e.buffer.join(""):1===e.buffer.length?e.buffer.first():e.buffer.concat(e.length),e.buffer.clear()):r=e.buffer.consume(t,e.decoder),r);var r}function U(t){var e=t._readableState;n("endReadable",e.endEmitted),e.endEmitted||(e.ended=!0,process.nextTick(j,e,t))}function j(t,e){if(n("endReadableNT",t.endEmitted,t.length),!t.endEmitted&&0===t.length&&(t.endEmitted=!0,e.readable=!1,e.emit("end"),t.autoDestroy)){var r=e._writableState;(!r||r.autoDestroy&&r.finished)&&e.destroy()}}function D(t,e){for(var r=0,i=t.length;r<i;r++)if(t[r]===e)return r;return-1}M.prototype.read=function(t){n("read",t),t=parseInt(t,10);var e=this._readableState,r=t;if(0!==t&&(e.emittedReadable=!1),0===t&&e.needReadable&&((0!==e.highWaterMark?e.length>=e.highWaterMark:e.length>0)||e.ended))return n("read: emitReadable",e.length,e.ended),0===e.length&&e.ended?U(this):T(this),null;if(0===(t=I(t,e))&&e.ended)return 0===e.length&&U(this),null;var i,o=e.needReadable;return n("need readable",o),(0===e.length||e.length-t<e.highWaterMark)&&n("length less than watermark",o=!0),e.ended||e.reading?n("reading or ended",o=!1):o&&(n("do read"),e.reading=!0,e.sync=!0,0===e.length&&(e.needReadable=!0),this._read(e.highWaterMark),e.sync=!1,e.reading||(t=I(r,e))),null===(i=t>0?L(t,e):null)?(e.needReadable=e.length<=e.highWaterMark,t=0):(e.length-=t,e.awaitDrain=0),0===e.length&&(e.ended||(e.needReadable=!0),r!==t&&e.ended&&U(this)),null!==i&&this.emit("data",i),i},M.prototype._read=function(t){_(this,new b("_read()"))},M.prototype.pipe=function(t,e){var r=this,i=this._readableState;switch(i.pipesCount){case 0:i.pipes=t;break;case 1:i.pipes=[i.pipes,t];break;default:i.pipes.push(t)}i.pipesCount+=1,n("pipe count=%d opts=%j",i.pipesCount,e);var s=e&&!1===e.end||t===process.stdout||t===process.stderr?p:a;function a(){n("onend"),t.end()}i.endEmitted?process.nextTick(s):r.once("end",s),t.on("unpipe",(function e(o,s){n("onunpipe"),o===r&&s&&!1===s.hasUnpiped&&(s.hasUnpiped=!0,n("cleanup"),t.removeListener("close",l),t.removeListener("finish",d),t.removeListener("drain",u),t.removeListener("error",f),t.removeListener("unpipe",e),r.removeListener("end",a),r.removeListener("end",p),r.removeListener("data",c),h=!0,!i.awaitDrain||t._writableState&&!t._writableState.needDrain||u())}));var u=function(t){return function(){var e=t._readableState;n("pipeOnDrain",e.awaitDrain),e.awaitDrain&&e.awaitDrain--,0===e.awaitDrain&&o(t,"data")&&(e.flowing=!0,O(t))}}(r);t.on("drain",u);var h=!1;function c(e){n("ondata");var o=t.write(e);n("dest.write",o),!1===o&&((1===i.pipesCount&&i.pipes===t||i.pipesCount>1&&-1!==D(i.pipes,t))&&!h&&(n("false write response, pause",i.awaitDrain),i.awaitDrain++),r.pause())}function f(e){n("onerror",e),p(),t.removeListener("error",f),0===o(t,"error")&&_(t,e)}function l(){t.removeListener("finish",d),p()}function d(){n("onfinish"),t.removeListener("close",l),p()}function p(){n("unpipe"),r.unpipe(t)}return r.on("data",c),function(t,e,r){if("function"==typeof t.prependListener)return t.prependListener(e,r);t._events&&t._events.error?Array.isArray(t._events.error)?t._events.error.unshift(r):t._events.error=[r,t._events.error]:t.on(e,r)}(t,"error",f),t.once("close",l),t.once("finish",d),t.emit("pipe",r),i.flowing||(n("pipe resume"),r.resume()),t},M.prototype.unpipe=function(t){var e=this._readableState,r={hasUnpiped:!1};if(0===e.pipesCount)return this;if(1===e.pipesCount)return t&&t!==e.pipes||(t||(t=e.pipes),e.pipes=null,e.pipesCount=0,e.flowing=!1,t&&t.emit("unpipe",this,r)),this;if(!t){var i=e.pipes,n=e.pipesCount;e.pipes=null,e.pipesCount=0,e.flowing=!1;for(var o=0;o<n;o++)i[o].emit("unpipe",this,{hasUnpiped:!1});return this}var s=D(e.pipes,t);return-1===s||(e.pipes.splice(s,1),e.pipesCount-=1,1===e.pipesCount&&(e.pipes=e.pipes[0]),t.emit("unpipe",this,r)),this},M.prototype.on=function(t,e){var r=s.prototype.on.call(this,t,e),i=this._readableState;return"data"===t?(i.readableListening=this.listenerCount("readable")>0,!1!==i.flowing&&this.resume()):"readable"===t&&(i.endEmitted||i.readableListening||(i.readableListening=i.needReadable=!0,i.flowing=!1,i.emittedReadable=!1,n("on readable",i.length,i.reading),i.length?T(this):i.reading||process.nextTick(P,this))),r},M.prototype.addListener=M.prototype.on,M.prototype.removeListener=function(t,e){var r=s.prototype.removeListener.call(this,t,e);return"readable"===t&&process.nextTick(F,this),r},M.prototype.removeAllListeners=function(t){var e=s.prototype.removeAllListeners.apply(this,arguments);return"readable"!==t&&void 0!==t||process.nextTick(F,this),e},M.prototype.resume=function(){var t=this._readableState;return t.flowing||(n("resume"),t.flowing=!t.readableListening,function(t,e){e.resumeScheduled||(e.resumeScheduled=!0,process.nextTick(N,t,e))}(this,t)),t.paused=!1,this},M.prototype.pause=function(){return n("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(n("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},M.prototype.wrap=function(t){var e=this,r=this._readableState,i=!1;for(var o in t.on("end",(function(){if(n("wrapped end"),r.decoder&&!r.ended){var t=r.decoder.end();t&&t.length&&e.push(t)}e.push(null)})),t.on("data",(function(o){n("wrapped data"),r.decoder&&(o=r.decoder.write(o)),r.objectMode&&null==o||(r.objectMode||o&&o.length)&&(e.push(o)||(i=!0,t.pause()))})),t)void 0===this[o]&&"function"==typeof t[o]&&(this[o]=function(e){return function(){return t[e].apply(t,arguments)}}(o));for(var s=0;s<S.length;s++)t.on(S[s],this.emit.bind(this,S[s]));return this._read=function(e){n("wrapped _read",e),i&&(i=!1,t.resume())},this},"function"==typeof Symbol&&(M.prototype[Symbol.asyncIterator]=function(){return void 0===f&&(f=r(30527)),f(this)}),Object.defineProperty(M.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Object.defineProperty(M.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty(M.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(t){this._readableState&&(this._readableState.flowing=t)}}),M._fromList=L,Object.defineProperty(M.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}}),"function"==typeof Symbol&&(M.from=function(t,e){return void 0===l&&(l=r(5327)),l(M,t,e)})},70421:(t,e,r)=>{"use strict";t.exports=c;var i=r(9786).q,n=i.ERR_METHOD_NOT_IMPLEMENTED,o=i.ERR_MULTIPLE_CALLBACK,s=i.ERR_TRANSFORM_ALREADY_TRANSFORMING,a=i.ERR_TRANSFORM_WITH_LENGTH_0,u=r(62910);function h(t,e){var r=this._transformState;r.transforming=!1;var i=r.writecb;if(null===i)return this.emit("error",new o);r.writechunk=null,r.writecb=null,null!=e&&this.push(e),i(t);var n=this._readableState;n.reading=!1,(n.needReadable||n.length<n.highWaterMark)&&this._read(n.highWaterMark)}function c(t){if(!(this instanceof c))return new c(t);u.call(this,t),this._transformState={afterTransform:h.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,t&&("function"==typeof t.transform&&(this._transform=t.transform),"function"==typeof t.flush&&(this._flush=t.flush)),this.on("prefinish",f)}function f(){var t=this;"function"!=typeof this._flush||this._readableState.destroyed?l(this,null,null):this._flush((function(e,r){l(t,e,r)}))}function l(t,e,r){if(e)return t.emit("error",e);if(null!=r&&t.push(r),t._writableState.length)throw new a;if(t._transformState.transforming)throw new s;return t.push(null)}r(35717)(c,u),c.prototype.push=function(t,e){return this._transformState.needTransform=!1,u.prototype.push.call(this,t,e)},c.prototype._transform=function(t,e,r){r(new n("_transform()"))},c.prototype._write=function(t,e,r){var i=this._transformState;if(i.writecb=r,i.writechunk=t,i.writeencoding=e,!i.transforming){var n=this._readableState;(i.needTransform||n.needReadable||n.length<n.highWaterMark)&&this._read(n.highWaterMark)}},c.prototype._read=function(t){var e=this._transformState;null===e.writechunk||e.transforming?e.needTransform=!0:(e.transforming=!0,this._transform(e.writechunk,e.writeencoding,e.afterTransform))},c.prototype._destroy=function(t,e){u.prototype._destroy.call(this,t,(function(t){e(t)}))}},70469:(t,e,r)=>{"use strict";function i(t){var e=this;this.next=null,this.entry=null,this.finish=function(){!function(t,e,r){var i=t.entry;for(t.entry=null;i;){var n=i.callback;e.pendingcb--,n(undefined),i=i.next}e.corkedRequestsFree.next=t}(e,t)}}var n;t.exports=M,M.WritableState=E;var o,s={deprecate:r(94927)},a=r(50677),u=r(48764).Buffer,h=r.g.Uint8Array||function(){},c=r(35072),f=r(31222).getHighWaterMark,l=r(9786).q,d=l.ERR_INVALID_ARG_TYPE,p=l.ERR_METHOD_NOT_IMPLEMENTED,g=l.ERR_MULTIPLE_CALLBACK,y=l.ERR_STREAM_CANNOT_PIPE,m=l.ERR_STREAM_DESTROYED,v=l.ERR_STREAM_NULL_VALUES,b=l.ERR_STREAM_WRITE_AFTER_END,w=l.ERR_UNKNOWN_ENCODING,_=c.errorOrDestroy;function S(){}function E(t,e,o){n=n||r(62910),t=t||{},"boolean"!=typeof o&&(o=e instanceof n),this.objectMode=!!t.objectMode,o&&(this.objectMode=this.objectMode||!!t.writableObjectMode),this.highWaterMark=f(this,t,"writableHighWaterMark",o),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var s=!1===t.decodeStrings;this.decodeStrings=!s,this.defaultEncoding=t.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(t){!function(t,e){var r=t._writableState,i=r.sync,n=r.writecb;if("function"!=typeof n)throw new g;if(function(t){t.writing=!1,t.writecb=null,t.length-=t.writelen,t.writelen=0}(r),e)!function(t,e,r,i,n){--e.pendingcb,r?(process.nextTick(n,i),process.nextTick(R,t,e),t._writableState.errorEmitted=!0,_(t,i)):(n(i),t._writableState.errorEmitted=!0,_(t,i),R(t,e))}(t,r,i,e,n);else{var o=I(r)||t.destroyed;o||r.corked||r.bufferProcessing||!r.bufferedRequest||k(t,r),i?process.nextTick(C,t,r,o,n):C(t,r,o,n)}}(e,t)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!1!==t.emitClose,this.autoDestroy=!!t.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new i(this)}function M(t){var e=this instanceof(n=n||r(62910));if(!e&&!o.call(M,this))return new M(t);this._writableState=new E(t,this,e),this.writable=!0,t&&("function"==typeof t.write&&(this._write=t.write),"function"==typeof t.writev&&(this._writev=t.writev),"function"==typeof t.destroy&&(this._destroy=t.destroy),"function"==typeof t.final&&(this._final=t.final)),a.call(this)}function A(t,e,r,i,n,o,s){e.writelen=i,e.writecb=s,e.writing=!0,e.sync=!0,e.destroyed?e.onwrite(new m("write")):r?t._writev(n,e.onwrite):t._write(n,o,e.onwrite),e.sync=!1}function C(t,e,r,i){r||function(t,e){0===e.length&&e.needDrain&&(e.needDrain=!1,t.emit("drain"))}(t,e),e.pendingcb--,i(),R(t,e)}function k(t,e){e.bufferProcessing=!0;var r=e.bufferedRequest;if(t._writev&&r&&r.next){var n=e.bufferedRequestCount,o=new Array(n),s=e.corkedRequestsFree;s.entry=r;for(var a=0,u=!0;r;)o[a]=r,r.isBuf||(u=!1),r=r.next,a+=1;o.allBuffers=u,A(t,e,!0,e.length,o,"",s.finish),e.pendingcb++,e.lastBufferedRequest=null,s.next?(e.corkedRequestsFree=s.next,s.next=null):e.corkedRequestsFree=new i(e),e.bufferedRequestCount=0}else{for(;r;){var h=r.chunk,c=r.encoding,f=r.callback;if(A(t,e,!1,e.objectMode?1:h.length,h,c,f),r=r.next,e.bufferedRequestCount--,e.writing)break}null===r&&(e.lastBufferedRequest=null)}e.bufferedRequest=r,e.bufferProcessing=!1}function I(t){return t.ending&&0===t.length&&null===t.bufferedRequest&&!t.finished&&!t.writing}function T(t,e){t._final((function(r){e.pendingcb--,r&&_(t,r),e.prefinished=!0,t.emit("prefinish"),R(t,e)}))}function R(t,e){var r=I(e);if(r&&(function(t,e){e.prefinished||e.finalCalled||("function"!=typeof t._final||e.destroyed?(e.prefinished=!0,t.emit("prefinish")):(e.pendingcb++,e.finalCalled=!0,process.nextTick(T,t,e)))}(t,e),0===e.pendingcb&&(e.finished=!0,t.emit("finish"),e.autoDestroy))){var i=t._readableState;(!i||i.autoDestroy&&i.endEmitted)&&t.destroy()}return r}r(35717)(M,a),E.prototype.getBuffer=function(){for(var t=this.bufferedRequest,e=[];t;)e.push(t),t=t.next;return e},function(){try{Object.defineProperty(E.prototype,"buffer",{get:s.deprecate((function(){return this.getBuffer()}),"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(t){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(o=Function.prototype[Symbol.hasInstance],Object.defineProperty(M,Symbol.hasInstance,{value:function(t){return!!o.call(this,t)||this===M&&t&&t._writableState instanceof E}})):o=function(t){return t instanceof this},M.prototype.pipe=function(){_(this,new y)},M.prototype.write=function(t,e,r){var i,n=this._writableState,o=!1,s=!n.objectMode&&(i=t,u.isBuffer(i)||i instanceof h);return s&&!u.isBuffer(t)&&(t=function(t){return u.from(t)}(t)),"function"==typeof e&&(r=e,e=null),s?e="buffer":e||(e=n.defaultEncoding),"function"!=typeof r&&(r=S),n.ending?function(t,e){var r=new b;_(t,r),process.nextTick(e,r)}(this,r):(s||function(t,e,r,i){var n;return null===r?n=new v:"string"==typeof r||e.objectMode||(n=new d("chunk",["string","Buffer"],r)),!n||(_(t,n),process.nextTick(i,n),!1)}(this,n,t,r))&&(n.pendingcb++,o=function(t,e,r,i,n,o){if(!r){var s=function(t,e,r){return t.objectMode||!1===t.decodeStrings||"string"!=typeof e||(e=u.from(e,r)),e}(e,i,n);i!==s&&(r=!0,n="buffer",i=s)}var a=e.objectMode?1:i.length;e.length+=a;var h=e.length<e.highWaterMark;if(h||(e.needDrain=!0),e.writing||e.corked){var c=e.lastBufferedRequest;e.lastBufferedRequest={chunk:i,encoding:n,isBuf:r,callback:o,next:null},c?c.next=e.lastBufferedRequest:e.bufferedRequest=e.lastBufferedRequest,e.bufferedRequestCount+=1}else A(t,e,!1,a,i,n,o);return h}(this,n,s,t,e,r)),o},M.prototype.cork=function(){this._writableState.corked++},M.prototype.uncork=function(){var t=this._writableState;t.corked&&(t.corked--,t.writing||t.corked||t.bufferProcessing||!t.bufferedRequest||k(this,t))},M.prototype.setDefaultEncoding=function(t){if("string"==typeof t&&(t=t.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((t+"").toLowerCase())>-1))throw new w(t);return this._writableState.defaultEncoding=t,this},Object.defineProperty(M.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(M.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),M.prototype._write=function(t,e,r){r(new p("_write()"))},M.prototype._writev=null,M.prototype.end=function(t,e,r){var i=this._writableState;return"function"==typeof t?(r=t,t=null,e=null):"function"==typeof e&&(r=e,e=null),null!=t&&this.write(t,e),i.corked&&(i.corked=1,this.uncork()),i.ending||function(t,e,r){e.ending=!0,R(t,e),r&&(e.finished?process.nextTick(r):t.once("finish",r)),e.ended=!0,t.writable=!1}(this,i,r),this},Object.defineProperty(M.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(M.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(t){this._writableState&&(this._writableState.destroyed=t)}}),M.prototype.destroy=c.destroy,M.prototype._undestroy=c.undestroy,M.prototype._destroy=function(t,e){e(t)}},30527:(t,e,r)=>{"use strict";var i;function n(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var o=r(28640),s=Symbol("lastResolve"),a=Symbol("lastReject"),u=Symbol("error"),h=Symbol("ended"),c=Symbol("lastPromise"),f=Symbol("handlePromise"),l=Symbol("stream");function d(t,e){return{value:t,done:e}}function p(t){var e=t[s];if(null!==e){var r=t[l].read();null!==r&&(t[c]=null,t[s]=null,t[a]=null,e(d(r,!1)))}}function g(t){process.nextTick(p,t)}var y=Object.getPrototypeOf((function(){})),m=Object.setPrototypeOf((n(i={get stream(){return this[l]},next:function(){var t=this,e=this[u];if(null!==e)return Promise.reject(e);if(this[h])return Promise.resolve(d(void 0,!0));if(this[l].destroyed)return new Promise((function(e,r){process.nextTick((function(){t[u]?r(t[u]):e(d(void 0,!0))}))}));var r,i=this[c];if(i)r=new Promise(function(t,e){return function(r,i){t.then((function(){e[h]?r(d(void 0,!0)):e[f](r,i)}),i)}}(i,this));else{var n=this[l].read();if(null!==n)return Promise.resolve(d(n,!1));r=new Promise(this[f])}return this[c]=r,r}},Symbol.asyncIterator,(function(){return this})),n(i,"return",(function(){var t=this;return new Promise((function(e,r){t[l].destroy(null,(function(t){t?r(t):e(d(void 0,!0))}))}))})),i),y);t.exports=function(t){var e,r=Object.create(m,(n(e={},l,{value:t,writable:!0}),n(e,s,{value:null,writable:!0}),n(e,a,{value:null,writable:!0}),n(e,u,{value:null,writable:!0}),n(e,h,{value:t._readableState.endEmitted,writable:!0}),n(e,f,{value:function(t,e){var i=r[l].read();i?(r[c]=null,r[s]=null,r[a]=null,t(d(i,!1))):(r[s]=t,r[a]=e)},writable:!0}),e));return r[c]=null,o(t,(function(t){if(t&&"ERR_STREAM_PREMATURE_CLOSE"!==t.code){var e=r[a];return null!==e&&(r[c]=null,r[s]=null,r[a]=null,e(t)),void(r[u]=t)}var i=r[s];null!==i&&(r[c]=null,r[s]=null,r[a]=null,i(d(void 0,!0))),r[h]=!0})),t.on("readable",g.bind(null,r)),r}},98354:(t,e,r)=>{"use strict";function i(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,i)}return r}function n(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function o(t,e){for(var r=0;r<e.length;r++){var i=e[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}var s=r(48764).Buffer,a=r(61758).inspect,u=a&&a.custom||"inspect";t.exports=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.head=null,this.tail=null,this.length=0}var e,r;return e=t,(r=[{key:"push",value:function(t){var e={data:t,next:null};this.length>0?this.tail.next=e:this.head=e,this.tail=e,++this.length}},{key:"unshift",value:function(t){var e={data:t,next:this.head};0===this.length&&(this.tail=e),this.head=e,++this.length}},{key:"shift",value:function(){if(0!==this.length){var t=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,t}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(t){if(0===this.length)return"";for(var e=this.head,r=""+e.data;e=e.next;)r+=t+e.data;return r}},{key:"concat",value:function(t){if(0===this.length)return s.alloc(0);for(var e,r,i,n=s.allocUnsafe(t>>>0),o=this.head,a=0;o;)e=o.data,r=n,i=a,s.prototype.copy.call(e,r,i),a+=o.data.length,o=o.next;return n}},{key:"consume",value:function(t,e){var r;return t<this.head.data.length?(r=this.head.data.slice(0,t),this.head.data=this.head.data.slice(t)):r=t===this.head.data.length?this.shift():e?this._getString(t):this._getBuffer(t),r}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(t){var e=this.head,r=1,i=e.data;for(t-=i.length;e=e.next;){var n=e.data,o=t>n.length?n.length:t;if(o===n.length?i+=n:i+=n.slice(0,t),0==(t-=o)){o===n.length?(++r,e.next?this.head=e.next:this.head=this.tail=null):(this.head=e,e.data=n.slice(o));break}++r}return this.length-=r,i}},{key:"_getBuffer",value:function(t){var e=s.allocUnsafe(t),r=this.head,i=1;for(r.data.copy(e),t-=r.data.length;r=r.next;){var n=r.data,o=t>n.length?n.length:t;if(n.copy(e,e.length-t,0,o),0==(t-=o)){o===n.length?(++i,r.next?this.head=r.next:this.head=this.tail=null):(this.head=r,r.data=n.slice(o));break}++i}return this.length-=i,e}},{key:u,value:function(t,e){return a(this,function(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?i(Object(r),!0).forEach((function(e){n(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):i(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}({},e,{depth:0,customInspect:!1}))}}])&&o(e.prototype,r),t}()},35072:t=>{"use strict";function e(t,e){i(t,e),r(t)}function r(t){t._writableState&&!t._writableState.emitClose||t._readableState&&!t._readableState.emitClose||t.emit("close")}function i(t,e){t.emit("error",e)}t.exports={destroy:function(t,n){var o=this,s=this._readableState&&this._readableState.destroyed,a=this._writableState&&this._writableState.destroyed;return s||a?(n?n(t):t&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,process.nextTick(i,this,t)):process.nextTick(i,this,t)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(t||null,(function(t){!n&&t?o._writableState?o._writableState.errorEmitted?process.nextTick(r,o):(o._writableState.errorEmitted=!0,process.nextTick(e,o,t)):process.nextTick(e,o,t):n?(process.nextTick(r,o),n(t)):process.nextTick(r,o)})),this)},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)},errorOrDestroy:function(t,e){var r=t._readableState,i=t._writableState;r&&r.autoDestroy||i&&i.autoDestroy?t.destroy(e):t.emit("error",e)}}},28640:(t,e,r)=>{"use strict";var i=r(9786).q.ERR_STREAM_PREMATURE_CLOSE;function n(){}t.exports=function t(e,r,o){if("function"==typeof r)return t(e,null,r);r||(r={}),o=function(t){var e=!1;return function(){if(!e){e=!0;for(var r=arguments.length,i=new Array(r),n=0;n<r;n++)i[n]=arguments[n];t.apply(this,i)}}}(o||n);var s=r.readable||!1!==r.readable&&e.readable,a=r.writable||!1!==r.writable&&e.writable,u=function(){e.writable||c()},h=e._writableState&&e._writableState.finished,c=function(){a=!1,h=!0,s||o.call(e)},f=e._readableState&&e._readableState.endEmitted,l=function(){s=!1,f=!0,a||o.call(e)},d=function(t){o.call(e,t)},p=function(){var t;return s&&!f?(e._readableState&&e._readableState.ended||(t=new i),o.call(e,t)):a&&!h?(e._writableState&&e._writableState.ended||(t=new i),o.call(e,t)):void 0},g=function(){e.req.on("finish",c)};return function(t){return t.setHeader&&"function"==typeof t.abort}(e)?(e.on("complete",c),e.on("abort",p),e.req?g():e.on("request",g)):a&&!e._writableState&&(e.on("end",u),e.on("close",u)),e.on("end",l),e.on("finish",c),!1!==r.error&&e.on("error",d),e.on("close",p),function(){e.removeListener("complete",c),e.removeListener("abort",p),e.removeListener("request",g),e.req&&e.req.removeListener("finish",c),e.removeListener("end",u),e.removeListener("close",u),e.removeListener("finish",c),e.removeListener("end",l),e.removeListener("error",d),e.removeListener("close",p)}}},5327:t=>{t.exports=function(){throw new Error("Readable.from is not available in the browser")}},64218:(t,e,r)=>{"use strict";var i,n=r(9786).q,o=n.ERR_MISSING_ARGS,s=n.ERR_STREAM_DESTROYED;function a(t){if(t)throw t}function u(t,e,n,o){o=function(t){var e=!1;return function(){e||(e=!0,t.apply(void 0,arguments))}}(o);var a=!1;t.on("close",(function(){a=!0})),void 0===i&&(i=r(28640)),i(t,{readable:e,writable:n},(function(t){if(t)return o(t);a=!0,o()}));var u=!1;return function(e){if(!a&&!u)return u=!0,function(t){return t.setHeader&&"function"==typeof t.abort}(t)?t.abort():"function"==typeof t.destroy?t.destroy():void o(e||new s("pipe"))}}function h(t){t()}function c(t,e){return t.pipe(e)}function f(t){return t.length?"function"!=typeof t[t.length-1]?a:t.pop():a}t.exports=function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];var i,n=f(e);if(Array.isArray(e[0])&&(e=e[0]),e.length<2)throw new o("streams");var s=e.map((function(t,r){var o=r<e.length-1;return u(t,o,r>0,(function(t){i||(i=t),t&&s.forEach(h),o||(s.forEach(h),n(i))}))}));return e.reduce(c)}},31222:(t,e,r)=>{"use strict";var i=r(9786).q.ERR_INVALID_OPT_VALUE;t.exports={getHighWaterMark:function(t,e,r,n){var o=function(t,e,r){return null!=t.highWaterMark?t.highWaterMark:e?t[r]:null}(e,n,r);if(null!=o){if(!isFinite(o)||Math.floor(o)!==o||o<0)throw new i(n?r:"highWaterMark",o);return Math.floor(o)}return t.objectMode?16:16384}}},50677:(t,e,r)=>{t.exports=r(17187).EventEmitter},70326:(t,e,r)=>{(e=t.exports=r(45789)).Stream=e,e.Readable=e,e.Writable=r(70469),e.Duplex=r(62910),e.Transform=r(70421),e.PassThrough=r(58994),e.finished=r(28640),e.pipeline=r(64218)},50213:(t,e,r)=>{var i=r(48764),n=i.Buffer;function o(t,e){for(var r in t)e[r]=t[r]}function s(t,e,r){return n(t,e,r)}n.from&&n.alloc&&n.allocUnsafe&&n.allocUnsafeSlow?t.exports=i:(o(i,e),e.Buffer=s),s.prototype=Object.create(n.prototype),o(n,s),s.from=function(t,e,r){if("number"==typeof t)throw new TypeError("Argument must not be a number");return n(t,e,r)},s.alloc=function(t,e,r){if("number"!=typeof t)throw new TypeError("Argument must be a number");var i=n(t);return void 0!==e?"string"==typeof r?i.fill(e,r):i.fill(e):i.fill(0),i},s.allocUnsafe=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return n(t)},s.allocUnsafeSlow=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return i.SlowBuffer(t)}},33715:(t,e,r)=>{var i=e;i.utils=r(26436),i.common=r(95772),i.sha=r(89041),i.ripemd=r(12949),i.hmac=r(52344),i.sha1=i.sha.sha1,i.sha256=i.sha.sha256,i.sha224=i.sha.sha224,i.sha384=i.sha.sha384,i.sha512=i.sha.sha512,i.ripemd160=i.ripemd.ripemd160},95772:(t,e,r)=>{"use strict";var i=r(26436),n=r(79746);function o(){this.pending=null,this.pendingTotal=0,this.blockSize=this.constructor.blockSize,this.outSize=this.constructor.outSize,this.hmacStrength=this.constructor.hmacStrength,this.padLength=this.constructor.padLength/8,this.endian="big",this._delta8=this.blockSize/8,this._delta32=this.blockSize/32}e.BlockHash=o,o.prototype.update=function(t,e){if(t=i.toArray(t,e),this.pending?this.pending=this.pending.concat(t):this.pending=t,this.pendingTotal+=t.length,this.pending.length>=this._delta8){var r=(t=this.pending).length%this._delta8;this.pending=t.slice(t.length-r,t.length),0===this.pending.length&&(this.pending=null),t=i.join32(t,0,t.length-r,this.endian);for(var n=0;n<t.length;n+=this._delta32)this._update(t,n,n+this._delta32)}return this},o.prototype.digest=function(t){return this.update(this._pad()),n(null===this.pending),this._digest(t)},o.prototype._pad=function(){var t=this.pendingTotal,e=this._delta8,r=e-(t+this.padLength)%e,i=new Array(r+this.padLength);i[0]=128;for(var n=1;n<r;n++)i[n]=0;if(t<<=3,"big"===this.endian){for(var o=8;o<this.padLength;o++)i[n++]=0;i[n++]=0,i[n++]=0,i[n++]=0,i[n++]=0,i[n++]=t>>>24&255,i[n++]=t>>>16&255,i[n++]=t>>>8&255,i[n++]=255&t}else for(i[n++]=255&t,i[n++]=t>>>8&255,i[n++]=t>>>16&255,i[n++]=t>>>24&255,i[n++]=0,i[n++]=0,i[n++]=0,i[n++]=0,o=8;o<this.padLength;o++)i[n++]=0;return i}},52344:(t,e,r)=>{"use strict";var i=r(26436),n=r(79746);function o(t,e,r){if(!(this instanceof o))return new o(t,e,r);this.Hash=t,this.blockSize=t.blockSize/8,this.outSize=t.outSize/8,this.inner=null,this.outer=null,this._init(i.toArray(e,r))}t.exports=o,o.prototype._init=function(t){t.length>this.blockSize&&(t=(new this.Hash).update(t).digest()),n(t.length<=this.blockSize);for(var e=t.length;e<this.blockSize;e++)t.push(0);for(e=0;e<t.length;e++)t[e]^=54;for(this.inner=(new this.Hash).update(t),e=0;e<t.length;e++)t[e]^=106;this.outer=(new this.Hash).update(t)},o.prototype.update=function(t,e){return this.inner.update(t,e),this},o.prototype.digest=function(t){return this.outer.update(this.inner.digest()),this.outer.digest(t)}},12949:(t,e,r)=>{"use strict";var i=r(26436),n=r(95772),o=i.rotl32,s=i.sum32,a=i.sum32_3,u=i.sum32_4,h=n.BlockHash;function c(){if(!(this instanceof c))return new c;h.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.endian="little"}function f(t,e,r,i){return t<=15?e^r^i:t<=31?e&r|~e&i:t<=47?(e|~r)^i:t<=63?e&i|r&~i:e^(r|~i)}function l(t){return t<=15?0:t<=31?1518500249:t<=47?1859775393:t<=63?2400959708:2840853838}function d(t){return t<=15?1352829926:t<=31?1548603684:t<=47?1836072691:t<=63?2053994217:0}i.inherits(c,h),e.ripemd160=c,c.blockSize=512,c.outSize=160,c.hmacStrength=192,c.padLength=64,c.prototype._update=function(t,e){for(var r=this.h[0],i=this.h[1],n=this.h[2],h=this.h[3],c=this.h[4],v=r,b=i,w=n,_=h,S=c,E=0;E<80;E++){var M=s(o(u(r,f(E,i,n,h),t[p[E]+e],l(E)),y[E]),c);r=c,c=h,h=o(n,10),n=i,i=M,M=s(o(u(v,f(79-E,b,w,_),t[g[E]+e],d(E)),m[E]),S),v=S,S=_,_=o(w,10),w=b,b=M}M=a(this.h[1],n,_),this.h[1]=a(this.h[2],h,S),this.h[2]=a(this.h[3],c,v),this.h[3]=a(this.h[4],r,b),this.h[4]=a(this.h[0],i,w),this.h[0]=M},c.prototype._digest=function(t){return"hex"===t?i.toHex32(this.h,"little"):i.split32(this.h,"little")};var p=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],g=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],y=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],m=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11]},89041:(t,e,r)=>{"use strict";e.sha1=r(84761),e.sha224=r(10799),e.sha256=r(89344),e.sha384=r(80772),e.sha512=r(45900)},84761:(t,e,r)=>{"use strict";var i=r(26436),n=r(95772),o=r(37038),s=i.rotl32,a=i.sum32,u=i.sum32_5,h=o.ft_1,c=n.BlockHash,f=[1518500249,1859775393,2400959708,3395469782];function l(){if(!(this instanceof l))return new l;c.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}i.inherits(l,c),t.exports=l,l.blockSize=512,l.outSize=160,l.hmacStrength=80,l.padLength=64,l.prototype._update=function(t,e){for(var r=this.W,i=0;i<16;i++)r[i]=t[e+i];for(;i<r.length;i++)r[i]=s(r[i-3]^r[i-8]^r[i-14]^r[i-16],1);var n=this.h[0],o=this.h[1],c=this.h[2],l=this.h[3],d=this.h[4];for(i=0;i<r.length;i++){var p=~~(i/20),g=u(s(n,5),h(p,o,c,l),d,r[i],f[p]);d=l,l=c,c=s(o,30),o=n,n=g}this.h[0]=a(this.h[0],n),this.h[1]=a(this.h[1],o),this.h[2]=a(this.h[2],c),this.h[3]=a(this.h[3],l),this.h[4]=a(this.h[4],d)},l.prototype._digest=function(t){return"hex"===t?i.toHex32(this.h,"big"):i.split32(this.h,"big")}},10799:(t,e,r)=>{"use strict";var i=r(26436),n=r(89344);function o(){if(!(this instanceof o))return new o;n.call(this),this.h=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]}i.inherits(o,n),t.exports=o,o.blockSize=512,o.outSize=224,o.hmacStrength=192,o.padLength=64,o.prototype._digest=function(t){return"hex"===t?i.toHex32(this.h.slice(0,7),"big"):i.split32(this.h.slice(0,7),"big")}},89344:(t,e,r)=>{"use strict";var i=r(26436),n=r(95772),o=r(37038),s=r(79746),a=i.sum32,u=i.sum32_4,h=i.sum32_5,c=o.ch32,f=o.maj32,l=o.s0_256,d=o.s1_256,p=o.g0_256,g=o.g1_256,y=n.BlockHash,m=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298];function v(){if(!(this instanceof v))return new v;y.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=m,this.W=new Array(64)}i.inherits(v,y),t.exports=v,v.blockSize=512,v.outSize=256,v.hmacStrength=192,v.padLength=64,v.prototype._update=function(t,e){for(var r=this.W,i=0;i<16;i++)r[i]=t[e+i];for(;i<r.length;i++)r[i]=u(g(r[i-2]),r[i-7],p(r[i-15]),r[i-16]);var n=this.h[0],o=this.h[1],y=this.h[2],m=this.h[3],v=this.h[4],b=this.h[5],w=this.h[6],_=this.h[7];for(s(this.k.length===r.length),i=0;i<r.length;i++){var S=h(_,d(v),c(v,b,w),this.k[i],r[i]),E=a(l(n),f(n,o,y));_=w,w=b,b=v,v=a(m,S),m=y,y=o,o=n,n=a(S,E)}this.h[0]=a(this.h[0],n),this.h[1]=a(this.h[1],o),this.h[2]=a(this.h[2],y),this.h[3]=a(this.h[3],m),this.h[4]=a(this.h[4],v),this.h[5]=a(this.h[5],b),this.h[6]=a(this.h[6],w),this.h[7]=a(this.h[7],_)},v.prototype._digest=function(t){return"hex"===t?i.toHex32(this.h,"big"):i.split32(this.h,"big")}},80772:(t,e,r)=>{"use strict";var i=r(26436),n=r(45900);function o(){if(!(this instanceof o))return new o;n.call(this),this.h=[3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]}i.inherits(o,n),t.exports=o,o.blockSize=1024,o.outSize=384,o.hmacStrength=192,o.padLength=128,o.prototype._digest=function(t){return"hex"===t?i.toHex32(this.h.slice(0,12),"big"):i.split32(this.h.slice(0,12),"big")}},45900:(t,e,r)=>{"use strict";var i=r(26436),n=r(95772),o=r(79746),s=i.rotr64_hi,a=i.rotr64_lo,u=i.shr64_hi,h=i.shr64_lo,c=i.sum64,f=i.sum64_hi,l=i.sum64_lo,d=i.sum64_4_hi,p=i.sum64_4_lo,g=i.sum64_5_hi,y=i.sum64_5_lo,m=n.BlockHash,v=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591];function b(){if(!(this instanceof b))return new b;m.call(this),this.h=[1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209],this.k=v,this.W=new Array(160)}function w(t,e,r,i,n){var o=t&r^~t&n;return o<0&&(o+=4294967296),o}function _(t,e,r,i,n,o){var s=e&i^~e&o;return s<0&&(s+=4294967296),s}function S(t,e,r,i,n){var o=t&r^t&n^r&n;return o<0&&(o+=4294967296),o}function E(t,e,r,i,n,o){var s=e&i^e&o^i&o;return s<0&&(s+=4294967296),s}function M(t,e){var r=s(t,e,28)^s(e,t,2)^s(e,t,7);return r<0&&(r+=4294967296),r}function A(t,e){var r=a(t,e,28)^a(e,t,2)^a(e,t,7);return r<0&&(r+=4294967296),r}function C(t,e){var r=a(t,e,14)^a(t,e,18)^a(e,t,9);return r<0&&(r+=4294967296),r}function k(t,e){var r=s(t,e,1)^s(t,e,8)^u(t,e,7);return r<0&&(r+=4294967296),r}function I(t,e){var r=a(t,e,1)^a(t,e,8)^h(t,e,7);return r<0&&(r+=4294967296),r}function T(t,e){var r=a(t,e,19)^a(e,t,29)^h(t,e,6);return r<0&&(r+=4294967296),r}i.inherits(b,m),t.exports=b,b.blockSize=1024,b.outSize=512,b.hmacStrength=192,b.padLength=128,b.prototype._prepareBlock=function(t,e){for(var r=this.W,i=0;i<32;i++)r[i]=t[e+i];for(;i<r.length;i+=2){var n=(y=r[i-4],m=r[i-3],v=void 0,(v=s(y,m,19)^s(m,y,29)^u(y,m,6))<0&&(v+=4294967296),v),o=T(r[i-4],r[i-3]),a=r[i-14],h=r[i-13],c=k(r[i-30],r[i-29]),f=I(r[i-30],r[i-29]),l=r[i-32],g=r[i-31];r[i]=d(n,o,a,h,c,f,l,g),r[i+1]=p(n,o,a,h,c,f,l,g)}var y,m,v},b.prototype._update=function(t,e){this._prepareBlock(t,e);var r,i,n,a=this.W,u=this.h[0],h=this.h[1],d=this.h[2],p=this.h[3],m=this.h[4],v=this.h[5],b=this.h[6],k=this.h[7],I=this.h[8],T=this.h[9],R=this.h[10],B=this.h[11],x=this.h[12],F=this.h[13],P=this.h[14],N=this.h[15];o(this.k.length===a.length);for(var O=0;O<a.length;O+=2){var L=P,U=N,j=(n=void 0,(n=s(r=I,i=T,14)^s(r,i,18)^s(i,r,9))<0&&(n+=4294967296),n),D=C(I,T),K=w(I,0,R,0,x),V=_(0,T,0,B,0,F),H=this.k[O],q=this.k[O+1],z=a[O],W=a[O+1],G=g(L,U,j,D,K,V,H,q,z,W),J=y(L,U,j,D,K,V,H,q,z,W);L=M(u,h),U=A(u,h),j=S(u,0,d,0,m),D=E(0,h,0,p,0,v);var Z=f(L,U,j,D),$=l(L,U,j,D);P=x,N=F,x=R,F=B,R=I,B=T,I=f(b,k,G,J),T=l(k,k,G,J),b=m,k=v,m=d,v=p,d=u,p=h,u=f(G,J,Z,$),h=l(G,J,Z,$)}c(this.h,0,u,h),c(this.h,2,d,p),c(this.h,4,m,v),c(this.h,6,b,k),c(this.h,8,I,T),c(this.h,10,R,B),c(this.h,12,x,F),c(this.h,14,P,N)},b.prototype._digest=function(t){return"hex"===t?i.toHex32(this.h,"big"):i.split32(this.h,"big")}},37038:(t,e,r)=>{"use strict";var i=r(26436).rotr32;function n(t,e,r){return t&e^~t&r}function o(t,e,r){return t&e^t&r^e&r}function s(t,e,r){return t^e^r}e.ft_1=function(t,e,r,i){return 0===t?n(e,r,i):1===t||3===t?s(e,r,i):2===t?o(e,r,i):void 0},e.ch32=n,e.maj32=o,e.p32=s,e.s0_256=function(t){return i(t,2)^i(t,13)^i(t,22)},e.s1_256=function(t){return i(t,6)^i(t,11)^i(t,25)},e.g0_256=function(t){return i(t,7)^i(t,18)^t>>>3},e.g1_256=function(t){return i(t,17)^i(t,19)^t>>>10}},26436:(t,e,r)=>{"use strict";var i=r(79746),n=r(35717);function o(t,e){return 55296==(64512&t.charCodeAt(e))&&!(e<0||e+1>=t.length)&&56320==(64512&t.charCodeAt(e+1))}function s(t){return(t>>>24|t>>>8&65280|t<<8&16711680|(255&t)<<24)>>>0}function a(t){return 1===t.length?"0"+t:t}function u(t){return 7===t.length?"0"+t:6===t.length?"00"+t:5===t.length?"000"+t:4===t.length?"0000"+t:3===t.length?"00000"+t:2===t.length?"000000"+t:1===t.length?"0000000"+t:t}e.inherits=n,e.toArray=function(t,e){if(Array.isArray(t))return t.slice();if(!t)return[];var r=[];if("string"==typeof t)if(e){if("hex"===e)for((t=t.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(t="0"+t),n=0;n<t.length;n+=2)r.push(parseInt(t[n]+t[n+1],16))}else for(var i=0,n=0;n<t.length;n++){var s=t.charCodeAt(n);s<128?r[i++]=s:s<2048?(r[i++]=s>>6|192,r[i++]=63&s|128):o(t,n)?(s=65536+((1023&s)<<10)+(1023&t.charCodeAt(++n)),r[i++]=s>>18|240,r[i++]=s>>12&63|128,r[i++]=s>>6&63|128,r[i++]=63&s|128):(r[i++]=s>>12|224,r[i++]=s>>6&63|128,r[i++]=63&s|128)}else for(n=0;n<t.length;n++)r[n]=0|t[n];return r},e.toHex=function(t){for(var e="",r=0;r<t.length;r++)e+=a(t[r].toString(16));return e},e.htonl=s,e.toHex32=function(t,e){for(var r="",i=0;i<t.length;i++){var n=t[i];"little"===e&&(n=s(n)),r+=u(n.toString(16))}return r},e.zero2=a,e.zero8=u,e.join32=function(t,e,r,n){var o=r-e;i(o%4==0);for(var s=new Array(o/4),a=0,u=e;a<s.length;a++,u+=4){var h;h="big"===n?t[u]<<24|t[u+1]<<16|t[u+2]<<8|t[u+3]:t[u+3]<<24|t[u+2]<<16|t[u+1]<<8|t[u],s[a]=h>>>0}return s},e.split32=function(t,e){for(var r=new Array(4*t.length),i=0,n=0;i<t.length;i++,n+=4){var o=t[i];"big"===e?(r[n]=o>>>24,r[n+1]=o>>>16&255,r[n+2]=o>>>8&255,r[n+3]=255&o):(r[n+3]=o>>>24,r[n+2]=o>>>16&255,r[n+1]=o>>>8&255,r[n]=255&o)}return r},e.rotr32=function(t,e){return t>>>e|t<<32-e},e.rotl32=function(t,e){return t<<e|t>>>32-e},e.sum32=function(t,e){return t+e>>>0},e.sum32_3=function(t,e,r){return t+e+r>>>0},e.sum32_4=function(t,e,r,i){return t+e+r+i>>>0},e.sum32_5=function(t,e,r,i,n){return t+e+r+i+n>>>0},e.sum64=function(t,e,r,i){var n=t[e],o=i+t[e+1]>>>0,s=(o<i?1:0)+r+n;t[e]=s>>>0,t[e+1]=o},e.sum64_hi=function(t,e,r,i){return(e+i>>>0<e?1:0)+t+r>>>0},e.sum64_lo=function(t,e,r,i){return e+i>>>0},e.sum64_4_hi=function(t,e,r,i,n,o,s,a){var u=0,h=e;return u+=(h=h+i>>>0)<e?1:0,u+=(h=h+o>>>0)<o?1:0,t+r+n+s+(u+=(h=h+a>>>0)<a?1:0)>>>0},e.sum64_4_lo=function(t,e,r,i,n,o,s,a){return e+i+o+a>>>0},e.sum64_5_hi=function(t,e,r,i,n,o,s,a,u,h){var c=0,f=e;return c+=(f=f+i>>>0)<e?1:0,c+=(f=f+o>>>0)<o?1:0,c+=(f=f+a>>>0)<a?1:0,t+r+n+s+u+(c+=(f=f+h>>>0)<h?1:0)>>>0},e.sum64_5_lo=function(t,e,r,i,n,o,s,a,u,h){return e+i+o+a+h>>>0},e.rotr64_hi=function(t,e,r){return(e<<32-r|t>>>r)>>>0},e.rotr64_lo=function(t,e,r){return(t<<32-r|e>>>r)>>>0},e.shr64_hi=function(t,e,r){return t>>>r},e.shr64_lo=function(t,e,r){return(t<<32-r|e>>>r)>>>0}},2156:(t,e,r)=>{"use strict";var i=r(33715),n=r(34504),o=r(79746);function s(t){if(!(this instanceof s))return new s(t);this.hash=t.hash,this.predResist=!!t.predResist,this.outLen=this.hash.outSize,this.minEntropy=t.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var e=n.toArray(t.entropy,t.entropyEnc||"hex"),r=n.toArray(t.nonce,t.nonceEnc||"hex"),i=n.toArray(t.pers,t.persEnc||"hex");o(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(e,r,i)}t.exports=s,s.prototype._init=function(t,e,r){var i=t.concat(e).concat(r);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var n=0;n<this.V.length;n++)this.K[n]=0,this.V[n]=1;this._update(i),this._reseed=1,this.reseedInterval=281474976710656},s.prototype._hmac=function(){return new i.hmac(this.hash,this.K)},s.prototype._update=function(t){var e=this._hmac().update(this.V).update([0]);t&&(e=e.update(t)),this.K=e.digest(),this.V=this._hmac().update(this.V).digest(),t&&(this.K=this._hmac().update(this.V).update([1]).update(t).digest(),this.V=this._hmac().update(this.V).digest())},s.prototype.reseed=function(t,e,r,i){"string"!=typeof e&&(i=r,r=e,e=null),t=n.toArray(t,e),r=n.toArray(r,i),o(t.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(t.concat(r||[])),this._reseed=1},s.prototype.generate=function(t,e,r,i){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");"string"!=typeof e&&(i=r,r=e,e=null),r&&(r=n.toArray(r,i||"hex"),this._update(r));for(var o=[];o.length<t;)this.V=this._hmac().update(this.V).digest(),o=o.concat(this.V);var s=o.slice(0,t);return this._update(r),this._reseed++,n.encode(s,e)}},80645:(t,e)=>{e.read=function(t,e,r,i,n){var o,s,a=8*n-i-1,u=(1<<a)-1,h=u>>1,c=-7,f=r?n-1:0,l=r?-1:1,d=t[e+f];for(f+=l,o=d&(1<<-c)-1,d>>=-c,c+=a;c>0;o=256*o+t[e+f],f+=l,c-=8);for(s=o&(1<<-c)-1,o>>=-c,c+=i;c>0;s=256*s+t[e+f],f+=l,c-=8);if(0===o)o=1-h;else{if(o===u)return s?NaN:1/0*(d?-1:1);s+=Math.pow(2,i),o-=h}return(d?-1:1)*s*Math.pow(2,o-i)},e.write=function(t,e,r,i,n,o){var s,a,u,h=8*o-n-1,c=(1<<h)-1,f=c>>1,l=23===n?Math.pow(2,-24)-Math.pow(2,-77):0,d=i?0:o-1,p=i?1:-1,g=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,s=c):(s=Math.floor(Math.log(e)/Math.LN2),e*(u=Math.pow(2,-s))<1&&(s--,u*=2),(e+=s+f>=1?l/u:l*Math.pow(2,1-f))*u>=2&&(s++,u/=2),s+f>=c?(a=0,s=c):s+f>=1?(a=(e*u-1)*Math.pow(2,n),s+=f):(a=e*Math.pow(2,f-1)*Math.pow(2,n),s=0));n>=8;t[r+d]=255&a,d+=p,a/=256,n-=8);for(s=s<<n|a,h+=n;h>0;t[r+d]=255&s,d+=p,s/=256,h-=8);t[r+d-p]|=128*g}},35717:t=>{"function"==typeof Object.create?t.exports=function(t,e){e&&(t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))}:t.exports=function(t,e){if(e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}}},82584:(t,e,r)=>{"use strict";var i="function"==typeof Symbol&&"symbol"==typeof Symbol.toStringTag,n=r(21924)("Object.prototype.toString"),o=function(t){return!(i&&t&&"object"==typeof t&&Symbol.toStringTag in t)&&"[object Arguments]"===n(t)},s=function(t){return!!o(t)||null!==t&&"object"==typeof t&&"number"==typeof t.length&&t.length>=0&&"[object Array]"!==n(t)&&"[object Function]"===n(t.callee)},a=function(){return o(arguments)}();o.isLegacyArguments=s,t.exports=a?o:s},48662:t=>{"use strict";var e=Object.prototype.toString,r=Function.prototype.toString,i=/^\s*(?:function)?\*/,n="function"==typeof Symbol&&"symbol"==typeof Symbol.toStringTag,o=Object.getPrototypeOf,s=function(){if(!n)return!1;try{return Function("return function*() {}")()}catch(t){}}(),a=!(!o||!s)&&o(s);t.exports=function(t){return"function"==typeof t&&(!!i.test(r.call(t))||(n?o&&o(t)===a:"[object GeneratorFunction]"===e.call(t)))}},85692:(t,e,r)=>{"use strict";var i=r(49804),n=r(16314),o=r(21924),s=o("Object.prototype.toString"),a=r(41405)()&&"symbol"==typeof Symbol.toStringTag,u=n(),h=o("Array.prototype.indexOf",!0)||function(t,e){for(var r=0;r<t.length;r+=1)if(t[r]===e)return r;return-1},c=o("String.prototype.slice"),f={},l=r(94079),d=Object.getPrototypeOf;a&&l&&d&&i(u,(function(t){var e=new r.g[t];if(!(Symbol.toStringTag in e))throw new EvalError("this engine has support for Symbol.toStringTag, but "+t+" does not have the property! Please report this.");var i=d(e),n=l(i,Symbol.toStringTag);if(!n){var o=d(i);n=l(o,Symbol.toStringTag)}f[t]=n.get})),t.exports=function(t){if(!t||"object"!=typeof t)return!1;if(!a){var e=c(s(t),8,-1);return h(u,e)>-1}return!!l&&function(t){var e=!1;return i(f,(function(r,i){if(!e)try{e=r.call(t)===i}catch(t){}})),e}(t)}},97626:(t,e,r)=>{var i=r(40158);t.exports=function(t,e){e=e||{};var r=i.decode(t,e);if(!r)return null;var n=r.payload;if("string"==typeof n)try{var o=JSON.parse(n);null!==o&&"object"==typeof o&&(n=o)}catch(t){}return!0===e.complete?{header:r.header,payload:n,signature:r.signature}:n}},49704:(t,e,r)=>{t.exports={decode:r(97626),verify:r(17030),sign:r(22506),JsonWebTokenError:r(58619),NotBeforeError:r(71826),TokenExpiredError:r(2340)}},58619:t=>{var e=function(t,e){Error.call(this,t),Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor),this.name="JsonWebTokenError",this.message=t,e&&(this.inner=e)};(e.prototype=Object.create(Error.prototype)).constructor=e,t.exports=e},71826:(t,e,r)=>{var i=r(58619),n=function(t,e){i.call(this,t),this.name="NotBeforeError",this.date=e};(n.prototype=Object.create(i.prototype)).constructor=n,t.exports=n},2340:(t,e,r)=>{var i=r(58619),n=function(t,e){i.call(this,t),this.name="TokenExpiredError",this.expiredAt=e};(n.prototype=Object.create(i.prototype)).constructor=n,t.exports=n},14964:(t,e,r)=>{var i=r(1878);t.exports=i.satisfies(process.version,"^6.12.0 || >=8.0.0")},68034:(t,e,r)=>{var i=r(57824);t.exports=function(t,e){var r=e||Math.floor(Date.now()/1e3);if("string"==typeof t){var n=i(t);if(void 0===n)return;return Math.floor(r+n/1e3)}return"number"==typeof t?r+t:void 0}},22506:(t,e,r)=>{var i=r(68034),n=r(14964),o=r(40158),s=r(28922),a=r(48094),u=r(55928),h=r(23126),c=r(8146),f=r(25751),l=r(38917),d=["RS256","RS384","RS512","ES256","ES384","ES512","HS256","HS384","HS512","none"];n&&d.splice(3,0,"PS256","PS384","PS512");var p={expiresIn:{isValid:function(t){return u(t)||f(t)&&t},message:'"expiresIn" should be a number of seconds or string representing a timespan'},notBefore:{isValid:function(t){return u(t)||f(t)&&t},message:'"notBefore" should be a number of seconds or string representing a timespan'},audience:{isValid:function(t){return f(t)||Array.isArray(t)},message:'"audience" must be a string or array'},algorithm:{isValid:s.bind(null,d),message:'"algorithm" must be a valid string enum value'},header:{isValid:c,message:'"header" must be an object'},encoding:{isValid:f,message:'"encoding" must be a string'},issuer:{isValid:f,message:'"issuer" must be a string'},subject:{isValid:f,message:'"subject" must be a string'},jwtid:{isValid:f,message:'"jwtid" must be a string'},noTimestamp:{isValid:a,message:'"noTimestamp" must be a boolean'},keyid:{isValid:f,message:'"keyid" must be a string'},mutatePayload:{isValid:a,message:'"mutatePayload" must be a boolean'}},g={iat:{isValid:h,message:'"iat" should be a number of seconds'},exp:{isValid:h,message:'"exp" should be a number of seconds'},nbf:{isValid:h,message:'"nbf" should be a number of seconds'}};function y(t,e,r,i){if(!c(r))throw new Error('Expected "'+i+'" to be a plain object.');Object.keys(r).forEach((function(n){var o=t[n];if(o){if(!o.isValid(r[n]))throw new Error(o.message)}else if(!e)throw new Error('"'+n+'" is not allowed in "'+i+'"')}))}var m={audience:"aud",issuer:"iss",subject:"sub",jwtid:"jti"},v=["expiresIn","notBefore","noTimestamp","audience","issuer","subject","jwtid"];t.exports=function(t,e,r,n){"function"==typeof r?(n=r,r={}):r=r||{};var s="object"==typeof t&&!Buffer.isBuffer(t),a=Object.assign({alg:r.algorithm||"HS256",typ:s?"JWT":void 0,kid:r.keyid},r.header);function u(t){if(n)return n(t);throw t}if(!e&&"none"!==r.algorithm)return u(new Error("secretOrPrivateKey must have a value"));if(void 0===t)return u(new Error("payload is required"));if(s){try{!function(t){y(g,!0,t,"payload")}(t)}catch(t){return u(t)}r.mutatePayload||(t=Object.assign({},t))}else{var h=v.filter((function(t){return void 0!==r[t]}));if(h.length>0)return u(new Error("invalid "+h.join(",")+" option for "+typeof t+" payload"))}if(void 0!==t.exp&&void 0!==r.expiresIn)return u(new Error('Bad "options.expiresIn" option the payload already has an "exp" property.'));if(void 0!==t.nbf&&void 0!==r.notBefore)return u(new Error('Bad "options.notBefore" option the payload already has an "nbf" property.'));try{!function(t){y(p,!1,t,"options")}(r)}catch(t){return u(t)}var c=t.iat||Math.floor(Date.now()/1e3);if(r.noTimestamp?delete t.iat:s&&(t.iat=c),void 0!==r.notBefore){try{t.nbf=i(r.notBefore,c)}catch(t){return u(t)}if(void 0===t.nbf)return u(new Error('"notBefore" should be a number of seconds or string representing a timespan eg: "1d", "20h", 60'))}if(void 0!==r.expiresIn&&"object"==typeof t){try{t.exp=i(r.expiresIn,c)}catch(t){return u(t)}if(void 0===t.exp)return u(new Error('"expiresIn" should be a number of seconds or string representing a timespan eg: "1d", "20h", 60'))}Object.keys(m).forEach((function(e){var i=m[e];if(void 0!==r[e]){if(void 0!==t[i])return u(new Error('Bad "options.'+e+'" option. The payload already has an "'+i+'" property.'));t[i]=r[e]}}));var f=r.encoding||"utf8";if("function"!=typeof n)return o.sign({header:a,payload:t,secret:e,encoding:f});n=n&&l(n),o.createSign({header:a,privateKey:e,payload:t,encoding:f}).once("error",n).once("done",(function(t){n(null,t)}))}},17030:(t,e,r)=>{var i=r(58619),n=r(71826),o=r(2340),s=r(97626),a=r(68034),u=r(14964),h=r(40158),c=["RS256","RS384","RS512","ES256","ES384","ES512"],f=["RS256","RS384","RS512"],l=["HS256","HS384","HS512"];u&&(c.splice(3,0,"PS256","PS384","PS512"),f.splice(3,0,"PS256","PS384","PS512")),t.exports=function(t,e,r,u){var d;if("function"!=typeof r||u||(u=r,r={}),r||(r={}),r=Object.assign({},r),d=u||function(t,e){if(t)throw t;return e},r.clockTimestamp&&"number"!=typeof r.clockTimestamp)return d(new i("clockTimestamp must be a number"));if(void 0!==r.nonce&&("string"!=typeof r.nonce||""===r.nonce.trim()))return d(new i("nonce must be a non-empty string"));var p=r.clockTimestamp||Math.floor(Date.now()/1e3);if(!t)return d(new i("jwt must be provided"));if("string"!=typeof t)return d(new i("jwt must be a string"));var g,y=t.split(".");if(3!==y.length)return d(new i("jwt malformed"));try{g=s(t,{complete:!0})}catch(t){return d(t)}if(!g)return d(new i("invalid token"));var m,v=g.header;if("function"==typeof e){if(!u)return d(new i("verify must be called asynchronous if secret or public key is provided as a callback"));m=e}else m=function(t,r){return r(null,e)};return m(v,(function(e,s){if(e)return d(new i("error in secret or public key callback: "+e.message));var u,m=""!==y[2].trim();if(!m&&s)return d(new i("jwt signature is required"));if(m&&!s)return d(new i("secret or public key must be provided"));if(m||r.algorithms||(r.algorithms=["none"]),r.algorithms||(r.algorithms=~s.toString().indexOf("BEGIN CERTIFICATE")||~s.toString().indexOf("BEGIN PUBLIC KEY")?c:~s.toString().indexOf("BEGIN RSA PUBLIC KEY")?f:l),!~r.algorithms.indexOf(g.header.alg))return d(new i("invalid algorithm"));try{u=h.verify(t,g.header.alg,s)}catch(t){return d(t)}if(!u)return d(new i("invalid signature"));var b=g.payload;if(void 0!==b.nbf&&!r.ignoreNotBefore){if("number"!=typeof b.nbf)return d(new i("invalid nbf value"));if(b.nbf>p+(r.clockTolerance||0))return d(new n("jwt not active",new Date(1e3*b.nbf)))}if(void 0!==b.exp&&!r.ignoreExpiration){if("number"!=typeof b.exp)return d(new i("invalid exp value"));if(p>=b.exp+(r.clockTolerance||0))return d(new o("jwt expired",new Date(1e3*b.exp)))}if(r.audience){var w=Array.isArray(r.audience)?r.audience:[r.audience];if(!(Array.isArray(b.aud)?b.aud:[b.aud]).some((function(t){return w.some((function(e){return e instanceof RegExp?e.test(t):e===t}))})))return d(new i("jwt audience invalid. expected: "+w.join(" or ")))}if(r.issuer&&("string"==typeof r.issuer&&b.iss!==r.issuer||Array.isArray(r.issuer)&&-1===r.issuer.indexOf(b.iss)))return d(new i("jwt issuer invalid. expected: "+r.issuer));if(r.subject&&b.sub!==r.subject)return d(new i("jwt subject invalid. expected: "+r.subject));if(r.jwtid&&b.jti!==r.jwtid)return d(new i("jwt jwtid invalid. expected: "+r.jwtid));if(r.nonce&&b.nonce!==r.nonce)return d(new i("jwt nonce invalid. expected: "+r.nonce));if(r.maxAge){if("number"!=typeof b.iat)return d(new i("iat required when maxAge is specified"));var _=a(r.maxAge,b.iat);if(void 0===_)return d(new i('"maxAge" should be a number of seconds or string representing a timespan eg: "1d", "20h", 60'));if(p>=_+(r.clockTolerance||0))return d(new o("maxAge exceeded",new Date(1e3*_)))}if(!0===r.complete){var S=g.signature;return d(null,{header:v,payload:b,signature:S})}return d(null,b)}))}},54178:(t,e,r)=>{var i=r(88500),n=r(89509).Buffer,o=r(55835),s=r(35015),a=r(89539),u="secret must be a string or buffer",h="key must be a string or a buffer",c="function"==typeof o.createPublicKey;function f(t){if(!n.isBuffer(t)&&"string"!=typeof t){if(!c)throw g(h);if("object"!=typeof t)throw g(h);if("string"!=typeof t.type)throw g(h);if("string"!=typeof t.asymmetricKeyType)throw g(h);if("function"!=typeof t.export)throw g(h)}}function l(t){if(!n.isBuffer(t)&&"string"!=typeof t&&"object"!=typeof t)throw g("key must be a string, a buffer or an object")}function d(t){return t.replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function p(t){var e=4-(t=t.toString()).length%4;if(4!==e)for(var r=0;r<e;++r)t+="=";return t.replace(/\-/g,"+").replace(/_/g,"/")}function g(t){var e=[].slice.call(arguments,1),r=a.format.bind(a,t).apply(null,e);return new TypeError(r)}function y(t){var e;return e=t,n.isBuffer(e)||"string"==typeof e||(t=JSON.stringify(t)),t}function m(t){return function(e,r){!function(t){if(!n.isBuffer(t)){if("string"==typeof t)return t;if(!c)throw g(u);if("object"!=typeof t)throw g(u);if("secret"!==t.type)throw g(u);if("function"!=typeof t.export)throw g(u)}}(r),e=y(e);var i=o.createHmac("sha"+t,r);return d((i.update(e),i.digest("base64")))}}function v(t){return function(e,r,o){var s=m(t)(e,o);return i(n.from(r),n.from(s))}}function b(t){return function(e,r){l(r),e=y(e);var i=o.createSign("RSA-SHA"+t);return d((i.update(e),i.sign(r,"base64")))}}function w(t){return function(e,r,i){f(i),e=y(e),r=p(r);var n=o.createVerify("RSA-SHA"+t);return n.update(e),n.verify(i,r,"base64")}}function _(t){return function(e,r){l(r),e=y(e);var i=o.createSign("RSA-SHA"+t);return d((i.update(e),i.sign({key:r,padding:o.constants.RSA_PKCS1_PSS_PADDING,saltLength:o.constants.RSA_PSS_SALTLEN_DIGEST},"base64")))}}function S(t){return function(e,r,i){f(i),e=y(e),r=p(r);var n=o.createVerify("RSA-SHA"+t);return n.update(e),n.verify({key:i,padding:o.constants.RSA_PKCS1_PSS_PADDING,saltLength:o.constants.RSA_PSS_SALTLEN_DIGEST},r,"base64")}}function E(t){var e=b(t);return function(){var r=e.apply(null,arguments);return s.derToJose(r,"ES"+t)}}function M(t){var e=w(t);return function(r,i,n){return i=s.joseToDer(i,"ES"+t).toString("base64"),e(r,i,n)}}function A(){return function(){return""}}function C(){return function(t,e){return""===e}}c&&(h+=" or a KeyObject",u+="or a KeyObject"),t.exports=function(t){var e={hs:m,rs:b,ps:_,es:E,none:A},r={hs:v,rs:w,ps:S,es:M,none:C},i=t.match(/^(RS|PS|ES|HS)(256|384|512)$|^(none)$/i);if(!i)throw g('"%s" is not a valid algorithm.\n  Supported algorithms are:\n  "HS256", "HS384", "HS512", "RS256", "RS384", "RS512", "PS256", "PS384", "PS512", "ES256", "ES384", "ES512" and "none".',t);var n=(i[1]||i[3]).toLowerCase(),o=i[2];return{sign:e[n](o),verify:r[n](o)}}},40158:(t,e,r)=>{var i=r(48952),n=r(43079);e.ALGORITHMS=["HS256","HS384","HS512","RS256","RS384","RS512","PS256","PS384","PS512","ES256","ES384","ES512"],e.sign=i.sign,e.verify=n.verify,e.decode=n.decode,e.isValid=n.isValid,e.createSign=function(t){return new i(t)},e.createVerify=function(t){return new n(t)}},97006:(t,e,r)=>{var i=r(89509).Buffer,n=r(42830);function o(t){if(this.buffer=null,this.writable=!0,this.readable=!0,!t)return this.buffer=i.alloc(0),this;if("function"==typeof t.pipe)return this.buffer=i.alloc(0),t.pipe(this),this;if(t.length||"object"==typeof t)return this.buffer=t,this.writable=!1,process.nextTick(function(){this.emit("end",t),this.readable=!1,this.emit("close")}.bind(this)),this;throw new TypeError("Unexpected data type ("+typeof t+")")}r(89539).inherits(o,n),o.prototype.write=function(t){this.buffer=i.concat([this.buffer,i.from(t)]),this.emit("data",t)},o.prototype.end=function(t){t&&this.write(t),this.emit("end",t),this.emit("close"),this.writable=!1,this.readable=!1},t.exports=o},48952:(t,e,r)=>{var i=r(89509).Buffer,n=r(97006),o=r(54178),s=r(42830),a=r(32010),u=r(89539);function h(t,e){return i.from(t,e).toString("base64").replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function c(t){var e=t.header,r=t.payload,i=t.secret||t.privateKey,n=t.encoding,s=o(e.alg),c=function(t,e,r){r=r||"utf8";var i=h(a(t),"binary"),n=h(a(e),r);return u.format("%s.%s",i,n)}(e,r,n),f=s.sign(c,i);return u.format("%s.%s",c,f)}function f(t){var e=t.secret||t.privateKey||t.key,r=new n(e);this.readable=!0,this.header=t.header,this.encoding=t.encoding,this.secret=this.privateKey=this.key=r,this.payload=new n(t.payload),this.secret.once("close",function(){!this.payload.writable&&this.readable&&this.sign()}.bind(this)),this.payload.once("close",function(){!this.secret.writable&&this.readable&&this.sign()}.bind(this))}u.inherits(f,s),f.prototype.sign=function(){try{var t=c({header:this.header,payload:this.payload.buffer,secret:this.secret.buffer,encoding:this.encoding});return this.emit("done",t),this.emit("data",t),this.emit("end"),this.readable=!1,t}catch(t){this.readable=!1,this.emit("error",t),this.emit("close")}},f.sign=c,t.exports=f},32010:(t,e,r)=>{var i=r(48764).Buffer;t.exports=function(t){return"string"==typeof t?t:"number"==typeof t||i.isBuffer(t)?t.toString():JSON.stringify(t)}},43079:(t,e,r)=>{var i=r(89509).Buffer,n=r(97006),o=r(54178),s=r(42830),a=r(32010),u=r(89539),h=/^[a-zA-Z0-9\-_]+?\.[a-zA-Z0-9\-_]+?\.([a-zA-Z0-9\-_]+)?$/;function c(t){var e=t.split(".",1)[0];return function(t){if(function(t){return"[object Object]"===Object.prototype.toString.call(t)}(t))return t;try{return JSON.parse(t)}catch(t){return}}(i.from(e,"base64").toString("binary"))}function f(t){return t.split(".")[2]}function l(t){return h.test(t)&&!!c(t)}function d(t,e,r){if(!e){var i=new Error("Missing algorithm parameter for jws.verify");throw i.code="MISSING_ALGORITHM",i}var n=f(t=a(t)),s=function(t){return t.split(".",2).join(".")}(t);return o(e).verify(s,n,r)}function p(t,e){if(e=e||{},!l(t=a(t)))return null;var r=c(t);if(!r)return null;var n=function(t,e){e=e||"utf8";var r=t.split(".")[1];return i.from(r,"base64").toString(e)}(t);return("JWT"===r.typ||e.json)&&(n=JSON.parse(n,e.encoding)),{header:r,payload:n,signature:f(t)}}function g(t){var e=(t=t||{}).secret||t.publicKey||t.key,r=new n(e);this.readable=!0,this.algorithm=t.algorithm,this.encoding=t.encoding,this.secret=this.publicKey=this.key=r,this.signature=new n(t.signature),this.secret.once("close",function(){!this.signature.writable&&this.readable&&this.verify()}.bind(this)),this.signature.once("close",function(){!this.secret.writable&&this.readable&&this.verify()}.bind(this))}u.inherits(g,s),g.prototype.verify=function(){try{var t=d(this.signature.buffer,this.algorithm,this.key.buffer),e=p(this.signature.buffer,this.encoding);return this.emit("done",t,e),this.emit("data",t),this.emit("end"),this.readable=!1,t}catch(t){this.readable=!1,this.emit("error",t),this.emit("close")}},g.decode=p,g.isValid=l,g.verify=d,t.exports=g},28922:t=>{var e=9007199254740991,r=/^\s+|\s+$/g,i=/^[-+]0x[0-9a-f]+$/i,n=/^0b[01]+$/i,o=/^0o[0-7]+$/i,s=/^(?:0|[1-9]\d*)$/,a=parseInt;function u(t){return t!=t}var h,c,f=Object.prototype,l=f.hasOwnProperty,d=f.toString,p=f.propertyIsEnumerable,g=(h=Object.keys,c=Object,function(t){return h(c(t))}),y=Math.max;function m(t,r){return!!(r=null==r?e:r)&&("number"==typeof t||s.test(t))&&t>-1&&t%1==0&&t<r}var v=Array.isArray;function b(t){return null!=t&&function(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=e}(t.length)&&!function(t){var e=w(t)?d.call(t):"";return"[object Function]"==e||"[object GeneratorFunction]"==e}(t)}function w(t){var e=typeof t;return!!t&&("object"==e||"function"==e)}function _(t){return!!t&&"object"==typeof t}t.exports=function(t,e,s,h){var c;t=b(t)?t:(c=t)?function(t,e){return function(e,r){for(var i=-1,n=e?e.length:0,o=Array(n);++i<n;)o[i]=(s=e[i],t[s]);var s;return o}(e)}(c,function(t){return b(t)?function(t,e){var r=v(t)||function(t){return function(t){return _(t)&&b(t)}(t)&&l.call(t,"callee")&&(!p.call(t,"callee")||"[object Arguments]"==d.call(t))}(t)?function(t,e){for(var r=-1,i=Array(t);++r<t;)i[r]=e(r);return i}(t.length,String):[],i=r.length,n=!!i;for(var o in t)!e&&!l.call(t,o)||n&&("length"==o||m(o,i))||r.push(o);return r}(t):function(t){if(r=(e=t)&&e.constructor,e!==("function"==typeof r&&r.prototype||f))return g(t);var e,r,i=[];for(var n in Object(t))l.call(t,n)&&"constructor"!=n&&i.push(n);return i}(t)}(c)):[],s=s&&!h?function(t){var e=function(t){return t?Infinity===(t=function(t){if("number"==typeof t)return t;if(function(t){return"symbol"==typeof t||_(t)&&"[object Symbol]"==d.call(t)}(t))return NaN;if(w(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=w(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=t.replace(r,"");var s=n.test(t);return s||o.test(t)?a(t.slice(2),s?2:8):i.test(t)?NaN:+t}(t))||t===-1/0?17976931348623157e292*(t<0?-1:1):t==t?t:0:0===t?t:0}(t),s=e%1;return e==e?s?e-s:e:0}(s):0;var S=t.length;return s<0&&(s=y(S+s,0)),function(t){return"string"==typeof t||!v(t)&&_(t)&&"[object String]"==d.call(t)}(t)?s<=S&&t.indexOf(e,s)>-1:!!S&&function(t,e,r){if(e!=e)return function(t,e,r,i){for(var n=t.length,o=r+-1;++o<n;)if(e(t[o],o,t))return o;return-1}(t,u,r);for(var i=r-1,n=t.length;++i<n;)if(t[i]===e)return i;return-1}(t,e,s)>-1}},48094:t=>{var e=Object.prototype.toString;t.exports=function(t){return!0===t||!1===t||function(t){return!!t&&"object"==typeof t}(t)&&"[object Boolean]"==e.call(t)}},55928:t=>{var e=/^\s+|\s+$/g,r=/^[-+]0x[0-9a-f]+$/i,i=/^0b[01]+$/i,n=/^0o[0-7]+$/i,o=parseInt,s=Object.prototype.toString;function a(t){var e=typeof t;return!!t&&("object"==e||"function"==e)}t.exports=function(t){return"number"==typeof t&&t==function(t){var u=function(t){return t?Infinity===(t=function(t){if("number"==typeof t)return t;if(function(t){return"symbol"==typeof t||function(t){return!!t&&"object"==typeof t}(t)&&"[object Symbol]"==s.call(t)}(t))return NaN;if(a(t)){var u="function"==typeof t.valueOf?t.valueOf():t;t=a(u)?u+"":u}if("string"!=typeof t)return 0===t?t:+t;t=t.replace(e,"");var h=i.test(t);return h||n.test(t)?o(t.slice(2),h?2:8):r.test(t)?NaN:+t}(t))||t===-1/0?17976931348623157e292*(t<0?-1:1):t==t?t:0:0===t?t:0}(t),h=u%1;return u==u?h?u-h:u:0}(t)}},23126:t=>{var e=Object.prototype.toString;t.exports=function(t){return"number"==typeof t||function(t){return!!t&&"object"==typeof t}(t)&&"[object Number]"==e.call(t)}},8146:t=>{var e,r,i=Function.prototype,n=Object.prototype,o=i.toString,s=n.hasOwnProperty,a=o.call(Object),u=n.toString,h=(e=Object.getPrototypeOf,r=Object,function(t){return e(r(t))});t.exports=function(t){if(!function(t){return!!t&&"object"==typeof t}(t)||"[object Object]"!=u.call(t)||function(t){var e=!1;if(null!=t&&"function"!=typeof t.toString)try{e=!!(t+"")}catch(t){}return e}(t))return!1;var e=h(t);if(null===e)return!0;var r=s.call(e,"constructor")&&e.constructor;return"function"==typeof r&&r instanceof r&&o.call(r)==a}},25751:t=>{var e=Object.prototype.toString,r=Array.isArray;t.exports=function(t){return"string"==typeof t||!r(t)&&function(t){return!!t&&"object"==typeof t}(t)&&"[object String]"==e.call(t)}},38917:t=>{var e=/^\s+|\s+$/g,r=/^[-+]0x[0-9a-f]+$/i,i=/^0b[01]+$/i,n=/^0o[0-7]+$/i,o=parseInt,s=Object.prototype.toString;function a(t){var e=typeof t;return!!t&&("object"==e||"function"==e)}t.exports=function(t){return function(t,u){var h;if("function"!=typeof u)throw new TypeError("Expected a function");return t=function(t){var u=function(t){return t?1/0===(t=function(t){if("number"==typeof t)return t;if(function(t){return"symbol"==typeof t||function(t){return!!t&&"object"==typeof t}(t)&&"[object Symbol]"==s.call(t)}(t))return NaN;if(a(t)){var u="function"==typeof t.valueOf?t.valueOf():t;t=a(u)?u+"":u}if("string"!=typeof t)return 0===t?t:+t;t=t.replace(e,"");var h=i.test(t);return h||n.test(t)?o(t.slice(2),h?2:8):r.test(t)?NaN:+t}(t))||t===-1/0?17976931348623157e292*(t<0?-1:1):t==t?t:0:0===t?t:0}(t),h=u%1;return u==u?h?u-h:u:0}(t),function(){return--t>0&&(h=u.apply(this,arguments)),t<=1&&(u=void 0),h}}(2,t)}},18552:(t,e,r)=>{var i=r(10852)(r(55639),"DataView");t.exports=i},1989:(t,e,r)=>{var i=r(51789),n=r(80401),o=r(57667),s=r(21327),a=r(81866);function u(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var i=t[e];this.set(i[0],i[1])}}u.prototype.clear=i,u.prototype.delete=n,u.prototype.get=o,u.prototype.has=s,u.prototype.set=a,t.exports=u},96425:(t,e,r)=>{var i=r(3118),n=r(9435);function o(t){this.__wrapped__=t,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=4294967295,this.__views__=[]}o.prototype=i(n.prototype),o.prototype.constructor=o,t.exports=o},38407:(t,e,r)=>{var i=r(27040),n=r(14125),o=r(82117),s=r(67518),a=r(54705);function u(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var i=t[e];this.set(i[0],i[1])}}u.prototype.clear=i,u.prototype.delete=n,u.prototype.get=o,u.prototype.has=s,u.prototype.set=a,t.exports=u},7548:(t,e,r)=>{var i=r(3118),n=r(9435);function o(t,e){this.__wrapped__=t,this.__actions__=[],this.__chain__=!!e,this.__index__=0,this.__values__=void 0}o.prototype=i(n.prototype),o.prototype.constructor=o,t.exports=o},57071:(t,e,r)=>{var i=r(10852)(r(55639),"Map");t.exports=i},83369:(t,e,r)=>{var i=r(24785),n=r(11285),o=r(96e3),s=r(49916),a=r(95265);function u(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var i=t[e];this.set(i[0],i[1])}}u.prototype.clear=i,u.prototype.delete=n,u.prototype.get=o,u.prototype.has=s,u.prototype.set=a,t.exports=u},53818:(t,e,r)=>{var i=r(10852)(r(55639),"Promise");t.exports=i},58525:(t,e,r)=>{var i=r(10852)(r(55639),"Set");t.exports=i},88668:(t,e,r)=>{var i=r(83369),n=r(90619),o=r(72385);function s(t){var e=-1,r=null==t?0:t.length;for(this.__data__=new i;++e<r;)this.add(t[e])}s.prototype.add=s.prototype.push=n,s.prototype.has=o,t.exports=s},46384:(t,e,r)=>{var i=r(38407),n=r(37465),o=r(63779),s=r(67599),a=r(44758),u=r(34309);function h(t){var e=this.__data__=new i(t);this.size=e.size}h.prototype.clear=n,h.prototype.delete=o,h.prototype.get=s,h.prototype.has=a,h.prototype.set=u,t.exports=h},62705:(t,e,r)=>{var i=r(55639).Symbol;t.exports=i},11149:(t,e,r)=>{var i=r(55639).Uint8Array;t.exports=i},70577:(t,e,r)=>{var i=r(10852)(r(55639),"WeakMap");t.exports=i},96874:t=>{t.exports=function(t,e,r){switch(r.length){case 0:return t.call(e);case 1:return t.call(e,r[0]);case 2:return t.call(e,r[0],r[1]);case 3:return t.call(e,r[0],r[1],r[2])}return t.apply(e,r)}},77412:t=>{t.exports=function(t,e){for(var r=-1,i=null==t?0:t.length;++r<i&&!1!==e(t[r],r,t););return t}},34963:t=>{t.exports=function(t,e){for(var r=-1,i=null==t?0:t.length,n=0,o=[];++r<i;){var s=t[r];e(s,r,t)&&(o[n++]=s)}return o}},47443:(t,e,r)=>{var i=r(42118);t.exports=function(t,e){return!(null==t||!t.length)&&i(t,e,0)>-1}},1196:t=>{t.exports=function(t,e,r){for(var i=-1,n=null==t?0:t.length;++i<n;)if(r(e,t[i]))return!0;return!1}},14636:(t,e,r)=>{var i=r(22545),n=r(35694),o=r(1469),s=r(44144),a=r(65776),u=r(36719),h=Object.prototype.hasOwnProperty;t.exports=function(t,e){var r=o(t),c=!r&&n(t),f=!r&&!c&&s(t),l=!r&&!c&&!f&&u(t),d=r||c||f||l,p=d?i(t.length,String):[],g=p.length;for(var y in t)!e&&!h.call(t,y)||d&&("length"==y||f&&("offset"==y||"parent"==y)||l&&("buffer"==y||"byteLength"==y||"byteOffset"==y)||a(y,g))||p.push(y);return p}},29932:t=>{t.exports=function(t,e){for(var r=-1,i=null==t?0:t.length,n=Array(i);++r<i;)n[r]=e(t[r],r,t);return n}},62488:t=>{t.exports=function(t,e){for(var r=-1,i=e.length,n=t.length;++r<i;)t[n+r]=e[r];return t}},86556:(t,e,r)=>{var i=r(89465),n=r(77813);t.exports=function(t,e,r){(void 0!==r&&!n(t[e],r)||void 0===r&&!(e in t))&&i(t,e,r)}},34865:(t,e,r)=>{var i=r(89465),n=r(77813),o=Object.prototype.hasOwnProperty;t.exports=function(t,e,r){var s=t[e];o.call(t,e)&&n(s,r)&&(void 0!==r||e in t)||i(t,e,r)}},18470:(t,e,r)=>{var i=r(77813);t.exports=function(t,e){for(var r=t.length;r--;)if(i(t[r][0],e))return r;return-1}},44037:(t,e,r)=>{var i=r(98363),n=r(3674);t.exports=function(t,e){return t&&i(e,n(e),t)}},63886:(t,e,r)=>{var i=r(98363),n=r(81704);t.exports=function(t,e){return t&&i(e,n(e),t)}},89465:(t,e,r)=>{var i=r(38777);t.exports=function(t,e,r){"__proto__"==e&&i?i(t,e,{configurable:!0,enumerable:!0,value:r,writable:!0}):t[e]=r}},29750:t=>{t.exports=function(t,e,r){return t==t&&(void 0!==r&&(t=t<=r?t:r),void 0!==e&&(t=t>=e?t:e)),t}},85990:(t,e,r)=>{var i=r(46384),n=r(77412),o=r(34865),s=r(44037),a=r(63886),u=r(64626),h=r(278),c=r(18805),f=r(1911),l=r(58234),d=r(46904),p=r(64160),g=r(43824),y=r(29148),m=r(38517),v=r(1469),b=r(44144),w=r(56688),_=r(13218),S=r(72928),E=r(3674),M=r(81704),A="[object Arguments]",C="[object Function]",k="[object Object]",I={};I[A]=I["[object Array]"]=I["[object ArrayBuffer]"]=I["[object DataView]"]=I["[object Boolean]"]=I["[object Date]"]=I["[object Float32Array]"]=I["[object Float64Array]"]=I["[object Int8Array]"]=I["[object Int16Array]"]=I["[object Int32Array]"]=I["[object Map]"]=I["[object Number]"]=I[k]=I["[object RegExp]"]=I["[object Set]"]=I["[object String]"]=I["[object Symbol]"]=I["[object Uint8Array]"]=I["[object Uint8ClampedArray]"]=I["[object Uint16Array]"]=I["[object Uint32Array]"]=!0,I["[object Error]"]=I[C]=I["[object WeakMap]"]=!1,t.exports=function t(e,r,T,R,B,x){var F,P=1&r,N=2&r,O=4&r;if(T&&(F=B?T(e,R,B,x):T(e)),void 0!==F)return F;if(!_(e))return e;var L=v(e);if(L){if(F=g(e),!P)return h(e,F)}else{var U=p(e),j=U==C||"[object GeneratorFunction]"==U;if(b(e))return u(e,P);if(U==k||U==A||j&&!B){if(F=N||j?{}:m(e),!P)return N?f(e,a(F,e)):c(e,s(F,e))}else{if(!I[U])return B?e:{};F=y(e,U,P)}}x||(x=new i);var D=x.get(e);if(D)return D;x.set(e,F),S(e)?e.forEach((function(i){F.add(t(i,r,T,i,e,x))})):w(e)&&e.forEach((function(i,n){F.set(n,t(i,r,T,n,e,x))}));var K=L?void 0:(O?N?d:l:N?M:E)(e);return n(K||e,(function(i,n){K&&(i=e[n=i]),o(F,n,t(i,r,T,n,e,x))})),F}},3118:(t,e,r)=>{var i=r(13218),n=Object.create,o=function(){function t(){}return function(e){if(!i(e))return{};if(n)return n(e);t.prototype=e;var r=new t;return t.prototype=void 0,r}}();t.exports=o},87157:(t,e,r)=>{var i=r(40554),n=r(88958);t.exports=function(t,e,r,o){var s=t.length;for((r=i(r))<0&&(r=-r>s?0:s+r),(o=void 0===o||o>s?s:i(o))<0&&(o+=s),o=r>o?0:n(o);r<o;)t[r++]=e;return t}},41848:t=>{t.exports=function(t,e,r,i){for(var n=t.length,o=r+(i?1:-1);i?o--:++o<n;)if(e(t[o],o,t))return o;return-1}},21078:(t,e,r)=>{var i=r(62488),n=r(37285);t.exports=function t(e,r,o,s,a){var u=-1,h=e.length;for(o||(o=n),a||(a=[]);++u<h;){var c=e[u];r>0&&o(c)?r>1?t(c,r-1,o,s,a):i(a,c):s||(a[a.length]=c)}return a}},28483:(t,e,r)=>{var i=r(25063)();t.exports=i},97786:(t,e,r)=>{var i=r(71811),n=r(40327);t.exports=function(t,e){for(var r=0,o=(e=i(e,t)).length;null!=t&&r<o;)t=t[n(e[r++])];return r&&r==o?t:void 0}},68866:(t,e,r)=>{var i=r(62488),n=r(1469);t.exports=function(t,e,r){var o=e(t);return n(t)?o:i(o,r(t))}},44239:(t,e,r)=>{var i=r(62705),n=r(89607),o=r(2333),s=i?i.toStringTag:void 0;t.exports=function(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":s&&s in Object(t)?n(t):o(t)}},13:t=>{t.exports=function(t,e){return null!=t&&e in Object(t)}},42118:(t,e,r)=>{var i=r(41848),n=r(62722),o=r(42351);t.exports=function(t,e,r){return e==e?o(t,e,r):i(t,n,r)}},47556:(t,e,r)=>{var i=r(88668),n=r(47443),o=r(1196),s=r(29932),a=r(7518),u=r(74757),h=Math.min;t.exports=function(t,e,r){for(var c=r?o:n,f=t[0].length,l=t.length,d=l,p=Array(l),g=1/0,y=[];d--;){var m=t[d];d&&e&&(m=s(m,a(e))),g=h(m.length,g),p[d]=!r&&(e||f>=120&&m.length>=120)?new i(d&&m):void 0}m=t[0];var v=-1,b=p[0];t:for(;++v<f&&y.length<g;){var w=m[v],_=e?e(w):w;if(w=r||0!==w?w:0,!(b?u(b,_):c(y,_,r))){for(d=l;--d;){var S=p[d];if(!(S?u(S,_):c(t[d],_,r)))continue t}b&&b.push(_),y.push(w)}}return y}},9454:(t,e,r)=>{var i=r(44239),n=r(37005);t.exports=function(t){return n(t)&&"[object Arguments]"==i(t)}},25588:(t,e,r)=>{var i=r(64160),n=r(37005);t.exports=function(t){return n(t)&&"[object Map]"==i(t)}},62722:t=>{t.exports=function(t){return t!=t}},28458:(t,e,r)=>{var i=r(23560),n=r(15346),o=r(13218),s=r(80346),a=/^\[object .+?Constructor\]$/,u=Function.prototype,h=Object.prototype,c=u.toString,f=h.hasOwnProperty,l=RegExp("^"+c.call(f).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");t.exports=function(t){return!(!o(t)||n(t))&&(i(t)?l:a).test(s(t))}},29221:(t,e,r)=>{var i=r(64160),n=r(37005);t.exports=function(t){return n(t)&&"[object Set]"==i(t)}},38749:(t,e,r)=>{var i=r(44239),n=r(41780),o=r(37005),s={};s["[object Float32Array]"]=s["[object Float64Array]"]=s["[object Int8Array]"]=s["[object Int16Array]"]=s["[object Int32Array]"]=s["[object Uint8Array]"]=s["[object Uint8ClampedArray]"]=s["[object Uint16Array]"]=s["[object Uint32Array]"]=!0,s["[object Arguments]"]=s["[object Array]"]=s["[object ArrayBuffer]"]=s["[object Boolean]"]=s["[object DataView]"]=s["[object Date]"]=s["[object Error]"]=s["[object Function]"]=s["[object Map]"]=s["[object Number]"]=s["[object Object]"]=s["[object RegExp]"]=s["[object Set]"]=s["[object String]"]=s["[object WeakMap]"]=!1,t.exports=function(t){return o(t)&&n(t.length)&&!!s[i(t)]}},280:(t,e,r)=>{var i=r(25726),n=r(86916),o=Object.prototype.hasOwnProperty;t.exports=function(t){if(!i(t))return n(t);var e=[];for(var r in Object(t))o.call(t,r)&&"constructor"!=r&&e.push(r);return e}},10313:(t,e,r)=>{var i=r(13218),n=r(25726),o=r(33498),s=Object.prototype.hasOwnProperty;t.exports=function(t){if(!i(t))return o(t);var e=n(t),r=[];for(var a in t)("constructor"!=a||!e&&s.call(t,a))&&r.push(a);return r}},9435:t=>{t.exports=function(){}},42980:(t,e,r)=>{var i=r(46384),n=r(86556),o=r(28483),s=r(59783),a=r(13218),u=r(81704),h=r(36390);t.exports=function t(e,r,c,f,l){e!==r&&o(r,(function(o,u){if(l||(l=new i),a(o))s(e,r,u,c,t,f,l);else{var d=f?f(h(e,u),o,u+"",e,r,l):void 0;void 0===d&&(d=o),n(e,u,d)}}),u)}},59783:(t,e,r)=>{var i=r(86556),n=r(64626),o=r(77133),s=r(278),a=r(38517),u=r(35694),h=r(1469),c=r(29246),f=r(44144),l=r(23560),d=r(13218),p=r(68630),g=r(36719),y=r(36390),m=r(59881);t.exports=function(t,e,r,v,b,w,_){var S=y(t,r),E=y(e,r),M=_.get(E);if(M)i(t,r,M);else{var A=w?w(S,E,r+"",t,e,_):void 0,C=void 0===A;if(C){var k=h(E),I=!k&&f(E),T=!k&&!I&&g(E);A=E,k||I||T?h(S)?A=S:c(S)?A=s(S):I?(C=!1,A=n(E,!0)):T?(C=!1,A=o(E,!0)):A=[]:p(E)||u(E)?(A=S,u(S)?A=m(S):d(S)&&!l(S)||(A=a(E))):C=!1}C&&(_.set(E,A),b(A,E,v,w,_),_.delete(E)),i(t,r,A)}}},25970:(t,e,r)=>{var i=r(63012),n=r(79095);t.exports=function(t,e){return i(t,e,(function(e,r){return n(t,r)}))}},63012:(t,e,r)=>{var i=r(97786),n=r(10611),o=r(71811);t.exports=function(t,e,r){for(var s=-1,a=e.length,u={};++s<a;){var h=e[s],c=i(t,h);r(c,h)&&n(u,o(h,t),c)}return u}},5976:(t,e,r)=>{var i=r(6557),n=r(45357),o=r(30061);t.exports=function(t,e){return o(n(t,e,i),t+"")}},10611:(t,e,r)=>{var i=r(34865),n=r(71811),o=r(65776),s=r(13218),a=r(40327);t.exports=function(t,e,r,u){if(!s(t))return t;for(var h=-1,c=(e=n(e,t)).length,f=c-1,l=t;null!=l&&++h<c;){var d=a(e[h]),p=r;if("__proto__"===d||"constructor"===d||"prototype"===d)return t;if(h!=f){var g=l[d];void 0===(p=u?u(g,d,l):void 0)&&(p=s(g)?g:o(e[h+1])?[]:{})}i(l,d,p),l=l[d]}return t}},28045:(t,e,r)=>{var i=r(6557),n=r(89250),o=n?function(t,e){return n.set(t,e),t}:i;t.exports=o},56560:(t,e,r)=>{var i=r(75703),n=r(38777),o=r(6557),s=n?function(t,e){return n(t,"toString",{configurable:!0,enumerable:!1,value:i(e),writable:!0})}:o;t.exports=s},14259:t=>{t.exports=function(t,e,r){var i=-1,n=t.length;e<0&&(e=-e>n?0:n+e),(r=r>n?n:r)<0&&(r+=n),n=e>r?0:r-e>>>0,e>>>=0;for(var o=Array(n);++i<n;)o[i]=t[i+e];return o}},22545:t=>{t.exports=function(t,e){for(var r=-1,i=Array(t);++r<t;)i[r]=e(r);return i}},80531:(t,e,r)=>{var i=r(62705),n=r(29932),o=r(1469),s=r(33448),a=i?i.prototype:void 0,u=a?a.toString:void 0;t.exports=function t(e){if("string"==typeof e)return e;if(o(e))return n(e,t)+"";if(s(e))return u?u.call(e):"";var r=e+"";return"0"==r&&1/e==-1/0?"-0":r}},27561:(t,e,r)=>{var i=r(67990),n=/^\s+/;t.exports=function(t){return t?t.slice(0,i(t)+1).replace(n,""):t}},7518:t=>{t.exports=function(t){return function(e){return t(e)}}},45652:(t,e,r)=>{var i=r(88668),n=r(47443),o=r(1196),s=r(74757),a=r(23593),u=r(21814);t.exports=function(t,e,r){var h=-1,c=n,f=t.length,l=!0,d=[],p=d;if(r)l=!1,c=o;else if(f>=200){var g=e?null:a(t);if(g)return u(g);l=!1,c=s,p=new i}else p=e?[]:d;t:for(;++h<f;){var y=t[h],m=e?e(y):y;if(y=r||0!==y?y:0,l&&m==m){for(var v=p.length;v--;)if(p[v]===m)continue t;e&&p.push(m),d.push(y)}else c(p,m,r)||(p!==d&&p.push(m),d.push(y))}return d}},57406:(t,e,r)=>{var i=r(71811),n=r(10928),o=r(40292),s=r(40327);t.exports=function(t,e){return e=i(e,t),null==(t=o(t,e))||delete t[s(n(e))]}},74757:t=>{t.exports=function(t,e){return t.has(e)}},24387:(t,e,r)=>{var i=r(29246);t.exports=function(t){return i(t)?t:[]}},71811:(t,e,r)=>{var i=r(1469),n=r(15403),o=r(55514),s=r(79833);t.exports=function(t,e){return i(t)?t:n(t,e)?[t]:o(s(t))}},74318:(t,e,r)=>{var i=r(11149);t.exports=function(t){var e=new t.constructor(t.byteLength);return new i(e).set(new i(t)),e}},64626:(t,e,r)=>{t=r.nmd(t);var i=r(55639),n=e&&!e.nodeType&&e,o=n&&t&&!t.nodeType&&t,s=o&&o.exports===n?i.Buffer:void 0,a=s?s.allocUnsafe:void 0;t.exports=function(t,e){if(e)return t.slice();var r=t.length,i=a?a(r):new t.constructor(r);return t.copy(i),i}},57157:(t,e,r)=>{var i=r(74318);t.exports=function(t,e){var r=e?i(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.byteLength)}},93147:t=>{var e=/\w*$/;t.exports=function(t){var r=new t.constructor(t.source,e.exec(t));return r.lastIndex=t.lastIndex,r}},40419:(t,e,r)=>{var i=r(62705),n=i?i.prototype:void 0,o=n?n.valueOf:void 0;t.exports=function(t){return o?Object(o.call(t)):{}}},77133:(t,e,r)=>{var i=r(74318);t.exports=function(t,e){var r=e?i(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.length)}},52157:t=>{var e=Math.max;t.exports=function(t,r,i,n){for(var o=-1,s=t.length,a=i.length,u=-1,h=r.length,c=e(s-a,0),f=Array(h+c),l=!n;++u<h;)f[u]=r[u];for(;++o<a;)(l||o<s)&&(f[i[o]]=t[o]);for(;c--;)f[u++]=t[o++];return f}},14054:t=>{var e=Math.max;t.exports=function(t,r,i,n){for(var o=-1,s=t.length,a=-1,u=i.length,h=-1,c=r.length,f=e(s-u,0),l=Array(f+c),d=!n;++o<f;)l[o]=t[o];for(var p=o;++h<c;)l[p+h]=r[h];for(;++a<u;)(d||o<s)&&(l[p+i[a]]=t[o++]);return l}},278:t=>{t.exports=function(t,e){var r=-1,i=t.length;for(e||(e=Array(i));++r<i;)e[r]=t[r];return e}},98363:(t,e,r)=>{var i=r(34865),n=r(89465);t.exports=function(t,e,r,o){var s=!r;r||(r={});for(var a=-1,u=e.length;++a<u;){var h=e[a],c=o?o(r[h],t[h],h,r,t):void 0;void 0===c&&(c=t[h]),s?n(r,h,c):i(r,h,c)}return r}},18805:(t,e,r)=>{var i=r(98363),n=r(99551);t.exports=function(t,e){return i(t,n(t),e)}},1911:(t,e,r)=>{var i=r(98363),n=r(51442);t.exports=function(t,e){return i(t,n(t),e)}},14429:(t,e,r)=>{var i=r(55639)["__core-js_shared__"];t.exports=i},97991:t=>{t.exports=function(t,e){for(var r=t.length,i=0;r--;)t[r]===e&&++i;return i}},21463:(t,e,r)=>{var i=r(5976),n=r(16612);t.exports=function(t){return i((function(e,r){var i=-1,o=r.length,s=o>1?r[o-1]:void 0,a=o>2?r[2]:void 0;for(s=t.length>3&&"function"==typeof s?(o--,s):void 0,a&&n(r[0],r[1],a)&&(s=o<3?void 0:s,o=1),e=Object(e);++i<o;){var u=r[i];u&&t(e,u,i,s)}return e}))}},25063:t=>{t.exports=function(t){return function(e,r,i){for(var n=-1,o=Object(e),s=i(e),a=s.length;a--;){var u=s[t?a:++n];if(!1===r(o[u],u,o))break}return e}}},22402:(t,e,r)=>{var i=r(71774),n=r(55639);t.exports=function(t,e,r){var o=1&e,s=i(t);return function e(){var i=this&&this!==n&&this instanceof e?s:t;return i.apply(o?r:this,arguments)}}},71774:(t,e,r)=>{var i=r(3118),n=r(13218);t.exports=function(t){return function(){var e=arguments;switch(e.length){case 0:return new t;case 1:return new t(e[0]);case 2:return new t(e[0],e[1]);case 3:return new t(e[0],e[1],e[2]);case 4:return new t(e[0],e[1],e[2],e[3]);case 5:return new t(e[0],e[1],e[2],e[3],e[4]);case 6:return new t(e[0],e[1],e[2],e[3],e[4],e[5]);case 7:return new t(e[0],e[1],e[2],e[3],e[4],e[5],e[6])}var r=i(t.prototype),o=t.apply(r,e);return n(o)?o:r}}},46347:(t,e,r)=>{var i=r(96874),n=r(71774),o=r(86935),s=r(94487),a=r(20893),u=r(46460),h=r(55639);t.exports=function(t,e,r){var c=n(t);return function n(){for(var f=arguments.length,l=Array(f),d=f,p=a(n);d--;)l[d]=arguments[d];var g=f<3&&l[0]!==p&&l[f-1]!==p?[]:u(l,p);if((f-=g.length)<r)return s(t,e,o,n.placeholder,void 0,l,g,void 0,void 0,r-f);var y=this&&this!==h&&this instanceof n?c:t;return i(y,this,l)}}},86935:(t,e,r)=>{var i=r(52157),n=r(14054),o=r(97991),s=r(71774),a=r(94487),u=r(20893),h=r(90451),c=r(46460),f=r(55639);t.exports=function t(e,r,l,d,p,g,y,m,v,b){var w=128&r,_=1&r,S=2&r,E=24&r,M=512&r,A=S?void 0:s(e);return function C(){for(var k=arguments.length,I=Array(k),T=k;T--;)I[T]=arguments[T];if(E)var R=u(C),B=o(I,R);if(d&&(I=i(I,d,p,E)),g&&(I=n(I,g,y,E)),k-=B,E&&k<b){var x=c(I,R);return a(e,r,t,C.placeholder,l,I,x,m,v,b-k)}var F=_?l:this,P=S?F[e]:e;return k=I.length,m?I=h(I,m):M&&k>1&&I.reverse(),w&&v<k&&(I.length=v),this&&this!==f&&this instanceof C&&(P=A||s(P)),P.apply(F,I)}}},84375:(t,e,r)=>{var i=r(96874),n=r(71774),o=r(55639);t.exports=function(t,e,r,s){var a=1&e,u=n(t);return function e(){for(var n=-1,h=arguments.length,c=-1,f=s.length,l=Array(f+h),d=this&&this!==o&&this instanceof e?u:t;++c<f;)l[c]=s[c];for(;h--;)l[c++]=arguments[++n];return i(d,a?r:this,l)}}},94487:(t,e,r)=>{var i=r(86528),n=r(258),o=r(69255);t.exports=function(t,e,r,s,a,u,h,c,f,l){var d=8&e;e|=d?32:64,4&(e&=~(d?64:32))||(e&=-4);var p=[t,e,a,d?u:void 0,d?h:void 0,d?void 0:u,d?void 0:h,c,f,l],g=r.apply(void 0,p);return i(t)&&n(g,p),g.placeholder=s,o(g,t,e)}},23593:(t,e,r)=>{var i=r(58525),n=r(50308),o=r(21814),s=i&&1/o(new i([,-0]))[1]==1/0?function(t){return new i(t)}:n;t.exports=s},97727:(t,e,r)=>{var i=r(28045),n=r(22402),o=r(46347),s=r(86935),a=r(84375),u=r(66833),h=r(63833),c=r(258),f=r(69255),l=r(40554),d=Math.max;t.exports=function(t,e,r,p,g,y,m,v){var b=2&e;if(!b&&"function"!=typeof t)throw new TypeError("Expected a function");var w=p?p.length:0;if(w||(e&=-97,p=g=void 0),m=void 0===m?m:d(l(m),0),v=void 0===v?v:l(v),w-=g?g.length:0,64&e){var _=p,S=g;p=g=void 0}var E=b?void 0:u(t),M=[t,e,r,p,g,_,S,y,m,v];if(E&&h(M,E),t=M[0],e=M[1],r=M[2],p=M[3],g=M[4],!(v=M[9]=void 0===M[9]?b?0:t.length:d(M[9]-w,0))&&24&e&&(e&=-25),e&&1!=e)A=8==e||16==e?o(t,e,v):32!=e&&33!=e||g.length?s.apply(void 0,M):a(t,e,r,p);else var A=n(t,e,r);return f((E?i:c)(A,M),t,e)}},60696:(t,e,r)=>{var i=r(68630);t.exports=function(t){return i(t)?void 0:t}},38777:(t,e,r)=>{var i=r(10852),n=function(){try{var t=i(Object,"defineProperty");return t({},"",{}),t}catch(t){}}();t.exports=n},99021:(t,e,r)=>{var i=r(85564),n=r(45357),o=r(30061);t.exports=function(t){return o(n(t,void 0,i),t+"")}},31957:(t,e,r)=>{var i="object"==typeof r.g&&r.g&&r.g.Object===Object&&r.g;t.exports=i},58234:(t,e,r)=>{var i=r(68866),n=r(99551),o=r(3674);t.exports=function(t){return i(t,o,n)}},46904:(t,e,r)=>{var i=r(68866),n=r(51442),o=r(81704);t.exports=function(t){return i(t,o,n)}},66833:(t,e,r)=>{var i=r(89250),n=r(50308),o=i?function(t){return i.get(t)}:n;t.exports=o},97658:(t,e,r)=>{var i=r(52060),n=Object.prototype.hasOwnProperty;t.exports=function(t){for(var e=t.name+"",r=i[e],o=n.call(i,e)?r.length:0;o--;){var s=r[o],a=s.func;if(null==a||a==t)return s.name}return e}},20893:t=>{t.exports=function(t){return t.placeholder}},45050:(t,e,r)=>{var i=r(37019);t.exports=function(t,e){var r=t.__data__;return i(e)?r["string"==typeof e?"string":"hash"]:r.map}},10852:(t,e,r)=>{var i=r(28458),n=r(47801);t.exports=function(t,e){var r=n(t,e);return i(r)?r:void 0}},85924:(t,e,r)=>{var i=r(5569)(Object.getPrototypeOf,Object);t.exports=i},89607:(t,e,r)=>{var i=r(62705),n=Object.prototype,o=n.hasOwnProperty,s=n.toString,a=i?i.toStringTag:void 0;t.exports=function(t){var e=o.call(t,a),r=t[a];try{t[a]=void 0;var i=!0}catch(t){}var n=s.call(t);return i&&(e?t[a]=r:delete t[a]),n}},99551:(t,e,r)=>{var i=r(34963),n=r(70479),o=Object.prototype.propertyIsEnumerable,s=Object.getOwnPropertySymbols,a=s?function(t){return null==t?[]:(t=Object(t),i(s(t),(function(e){return o.call(t,e)})))}:n;t.exports=a},51442:(t,e,r)=>{var i=r(62488),n=r(85924),o=r(99551),s=r(70479),a=Object.getOwnPropertySymbols?function(t){for(var e=[];t;)i(e,o(t)),t=n(t);return e}:s;t.exports=a},64160:(t,e,r)=>{var i=r(18552),n=r(57071),o=r(53818),s=r(58525),a=r(70577),u=r(44239),h=r(80346),c="[object Map]",f="[object Promise]",l="[object Set]",d="[object WeakMap]",p="[object DataView]",g=h(i),y=h(n),m=h(o),v=h(s),b=h(a),w=u;(i&&w(new i(new ArrayBuffer(1)))!=p||n&&w(new n)!=c||o&&w(o.resolve())!=f||s&&w(new s)!=l||a&&w(new a)!=d)&&(w=function(t){var e=u(t),r="[object Object]"==e?t.constructor:void 0,i=r?h(r):"";if(i)switch(i){case g:return p;case y:return c;case m:return f;case v:return l;case b:return d}return e}),t.exports=w},47801:t=>{t.exports=function(t,e){return null==t?void 0:t[e]}},58775:t=>{var e=/\{\n\/\* \[wrapped with (.+)\] \*/,r=/,? & /;t.exports=function(t){var i=t.match(e);return i?i[1].split(r):[]}},222:(t,e,r)=>{var i=r(71811),n=r(35694),o=r(1469),s=r(65776),a=r(41780),u=r(40327);t.exports=function(t,e,r){for(var h=-1,c=(e=i(e,t)).length,f=!1;++h<c;){var l=u(e[h]);if(!(f=null!=t&&r(t,l)))break;t=t[l]}return f||++h!=c?f:!!(c=null==t?0:t.length)&&a(c)&&s(l,c)&&(o(t)||n(t))}},51789:(t,e,r)=>{var i=r(94536);t.exports=function(){this.__data__=i?i(null):{},this.size=0}},80401:t=>{t.exports=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}},57667:(t,e,r)=>{var i=r(94536),n=Object.prototype.hasOwnProperty;t.exports=function(t){var e=this.__data__;if(i){var r=e[t];return"__lodash_hash_undefined__"===r?void 0:r}return n.call(e,t)?e[t]:void 0}},21327:(t,e,r)=>{var i=r(94536),n=Object.prototype.hasOwnProperty;t.exports=function(t){var e=this.__data__;return i?void 0!==e[t]:n.call(e,t)}},81866:(t,e,r)=>{var i=r(94536);t.exports=function(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=i&&void 0===e?"__lodash_hash_undefined__":e,this}},43824:t=>{var e=Object.prototype.hasOwnProperty;t.exports=function(t){var r=t.length,i=new t.constructor(r);return r&&"string"==typeof t[0]&&e.call(t,"index")&&(i.index=t.index,i.input=t.input),i}},29148:(t,e,r)=>{var i=r(74318),n=r(57157),o=r(93147),s=r(40419),a=r(77133);t.exports=function(t,e,r){var u=t.constructor;switch(e){case"[object ArrayBuffer]":return i(t);case"[object Boolean]":case"[object Date]":return new u(+t);case"[object DataView]":return n(t,r);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return a(t,r);case"[object Map]":return new u;case"[object Number]":case"[object String]":return new u(t);case"[object RegExp]":return o(t);case"[object Set]":return new u;case"[object Symbol]":return s(t)}}},38517:(t,e,r)=>{var i=r(3118),n=r(85924),o=r(25726);t.exports=function(t){return"function"!=typeof t.constructor||o(t)?{}:i(n(t))}},83112:t=>{var e=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/;t.exports=function(t,r){var i=r.length;if(!i)return t;var n=i-1;return r[n]=(i>1?"& ":"")+r[n],r=r.join(i>2?", ":" "),t.replace(e,"{\n/* [wrapped with "+r+"] */\n")}},37285:(t,e,r)=>{var i=r(62705),n=r(35694),o=r(1469),s=i?i.isConcatSpreadable:void 0;t.exports=function(t){return o(t)||n(t)||!!(s&&t&&t[s])}},65776:t=>{var e=/^(?:0|[1-9]\d*)$/;t.exports=function(t,r){var i=typeof t;return!!(r=null==r?9007199254740991:r)&&("number"==i||"symbol"!=i&&e.test(t))&&t>-1&&t%1==0&&t<r}},16612:(t,e,r)=>{var i=r(77813),n=r(98612),o=r(65776),s=r(13218);t.exports=function(t,e,r){if(!s(r))return!1;var a=typeof e;return!!("number"==a?n(r)&&o(e,r.length):"string"==a&&e in r)&&i(r[e],t)}},15403:(t,e,r)=>{var i=r(1469),n=r(33448),o=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,s=/^\w*$/;t.exports=function(t,e){if(i(t))return!1;var r=typeof t;return!("number"!=r&&"symbol"!=r&&"boolean"!=r&&null!=t&&!n(t))||s.test(t)||!o.test(t)||null!=e&&t in Object(e)}},37019:t=>{t.exports=function(t){var e=typeof t;return"string"==e||"number"==e||"symbol"==e||"boolean"==e?"__proto__"!==t:null===t}},86528:(t,e,r)=>{var i=r(96425),n=r(66833),o=r(97658),s=r(8111);t.exports=function(t){var e=o(t),r=s[e];if("function"!=typeof r||!(e in i.prototype))return!1;if(t===r)return!0;var a=n(r);return!!a&&t===a[0]}},15346:(t,e,r)=>{var i,n=r(14429),o=(i=/[^.]+$/.exec(n&&n.keys&&n.keys.IE_PROTO||""))?"Symbol(src)_1."+i:"";t.exports=function(t){return!!o&&o in t}},25726:t=>{var e=Object.prototype;t.exports=function(t){var r=t&&t.constructor;return t===("function"==typeof r&&r.prototype||e)}},27040:t=>{t.exports=function(){this.__data__=[],this.size=0}},14125:(t,e,r)=>{var i=r(18470),n=Array.prototype.splice;t.exports=function(t){var e=this.__data__,r=i(e,t);return!(r<0||(r==e.length-1?e.pop():n.call(e,r,1),--this.size,0))}},82117:(t,e,r)=>{var i=r(18470);t.exports=function(t){var e=this.__data__,r=i(e,t);return r<0?void 0:e[r][1]}},67518:(t,e,r)=>{var i=r(18470);t.exports=function(t){return i(this.__data__,t)>-1}},54705:(t,e,r)=>{var i=r(18470);t.exports=function(t,e){var r=this.__data__,n=i(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this}},24785:(t,e,r)=>{var i=r(1989),n=r(38407),o=r(57071);t.exports=function(){this.size=0,this.__data__={hash:new i,map:new(o||n),string:new i}}},11285:(t,e,r)=>{var i=r(45050);t.exports=function(t){var e=i(this,t).delete(t);return this.size-=e?1:0,e}},96e3:(t,e,r)=>{var i=r(45050);t.exports=function(t){return i(this,t).get(t)}},49916:(t,e,r)=>{var i=r(45050);t.exports=function(t){return i(this,t).has(t)}},95265:(t,e,r)=>{var i=r(45050);t.exports=function(t,e){var r=i(this,t),n=r.size;return r.set(t,e),this.size+=r.size==n?0:1,this}},24523:(t,e,r)=>{var i=r(88306);t.exports=function(t){var e=i(t,(function(t){return 500===r.size&&r.clear(),t})),r=e.cache;return e}},63833:(t,e,r)=>{var i=r(52157),n=r(14054),o=r(46460),s="__lodash_placeholder__",a=Math.min;t.exports=function(t,e){var r=t[1],u=e[1],h=r|u,c=h<131,f=128==u&&8==r||128==u&&256==r&&t[7].length<=e[8]||384==u&&e[7].length<=e[8]&&8==r;if(!c&&!f)return t;1&u&&(t[2]=e[2],h|=1&r?0:4);var l=e[3];if(l){var d=t[3];t[3]=d?i(d,l,e[4]):l,t[4]=d?o(t[3],s):e[4]}return(l=e[5])&&(d=t[5],t[5]=d?n(d,l,e[6]):l,t[6]=d?o(t[5],s):e[6]),(l=e[7])&&(t[7]=l),128&u&&(t[8]=null==t[8]?e[8]:a(t[8],e[8])),null==t[9]&&(t[9]=e[9]),t[0]=e[0],t[1]=h,t}},89250:(t,e,r)=>{var i=r(70577),n=i&&new i;t.exports=n},94536:(t,e,r)=>{var i=r(10852)(Object,"create");t.exports=i},86916:(t,e,r)=>{var i=r(5569)(Object.keys,Object);t.exports=i},33498:t=>{t.exports=function(t){var e=[];if(null!=t)for(var r in Object(t))e.push(r);return e}},31167:(t,e,r)=>{t=r.nmd(t);var i=r(31957),n=e&&!e.nodeType&&e,o=n&&t&&!t.nodeType&&t,s=o&&o.exports===n&&i.process,a=function(){try{return o&&o.require&&o.require("util").types||s&&s.binding&&s.binding("util")}catch(t){}}();t.exports=a},2333:t=>{var e=Object.prototype.toString;t.exports=function(t){return e.call(t)}},5569:t=>{t.exports=function(t,e){return function(r){return t(e(r))}}},45357:(t,e,r)=>{var i=r(96874),n=Math.max;t.exports=function(t,e,r){return e=n(void 0===e?t.length-1:e,0),function(){for(var o=arguments,s=-1,a=n(o.length-e,0),u=Array(a);++s<a;)u[s]=o[e+s];s=-1;for(var h=Array(e+1);++s<e;)h[s]=o[s];return h[e]=r(u),i(t,this,h)}}},40292:(t,e,r)=>{var i=r(97786),n=r(14259);t.exports=function(t,e){return e.length<2?t:i(t,n(e,0,-1))}},52060:t=>{t.exports={}},90451:(t,e,r)=>{var i=r(278),n=r(65776),o=Math.min;t.exports=function(t,e){for(var r=t.length,s=o(e.length,r),a=i(t);s--;){var u=e[s];t[s]=n(u,r)?a[u]:void 0}return t}},46460:t=>{var e="__lodash_placeholder__";t.exports=function(t,r){for(var i=-1,n=t.length,o=0,s=[];++i<n;){var a=t[i];a!==r&&a!==e||(t[i]=e,s[o++]=i)}return s}},55639:(t,e,r)=>{var i=r(31957),n="object"==typeof self&&self&&self.Object===Object&&self,o=i||n||Function("return this")();t.exports=o},36390:t=>{t.exports=function(t,e){if(("constructor"!==e||"function"!=typeof t[e])&&"__proto__"!=e)return t[e]}},90619:t=>{t.exports=function(t){return this.__data__.set(t,"__lodash_hash_undefined__"),this}},72385:t=>{t.exports=function(t){return this.__data__.has(t)}},258:(t,e,r)=>{var i=r(28045),n=r(21275)(i);t.exports=n},21814:t=>{t.exports=function(t){var e=-1,r=Array(t.size);return t.forEach((function(t){r[++e]=t})),r}},30061:(t,e,r)=>{var i=r(56560),n=r(21275)(i);t.exports=n},69255:(t,e,r)=>{var i=r(58775),n=r(83112),o=r(30061),s=r(87241);t.exports=function(t,e,r){var a=e+"";return o(t,n(a,s(i(a),r)))}},21275:t=>{var e=Date.now;t.exports=function(t){var r=0,i=0;return function(){var n=e(),o=16-(n-i);if(i=n,o>0){if(++r>=800)return arguments[0]}else r=0;return t.apply(void 0,arguments)}}},37465:(t,e,r)=>{var i=r(38407);t.exports=function(){this.__data__=new i,this.size=0}},63779:t=>{t.exports=function(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r}},67599:t=>{t.exports=function(t){return this.__data__.get(t)}},44758:t=>{t.exports=function(t){return this.__data__.has(t)}},34309:(t,e,r)=>{var i=r(38407),n=r(57071),o=r(83369);t.exports=function(t,e){var r=this.__data__;if(r instanceof i){var s=r.__data__;if(!n||s.length<199)return s.push([t,e]),this.size=++r.size,this;r=this.__data__=new o(s)}return r.set(t,e),this.size=r.size,this}},42351:t=>{t.exports=function(t,e,r){for(var i=r-1,n=t.length;++i<n;)if(t[i]===e)return i;return-1}},55514:(t,e,r)=>{var i=r(24523),n=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,o=/\\(\\)?/g,s=i((function(t){var e=[];return 46===t.charCodeAt(0)&&e.push(""),t.replace(n,(function(t,r,i,n){e.push(i?n.replace(o,"$1"):r||t)})),e}));t.exports=s},40327:(t,e,r)=>{var i=r(33448);t.exports=function(t){if("string"==typeof t||i(t))return t;var e=t+"";return"0"==e&&1/t==-1/0?"-0":e}},80346:t=>{var e=Function.prototype.toString;t.exports=function(t){if(null!=t){try{return e.call(t)}catch(t){}try{return t+""}catch(t){}}return""}},67990:t=>{var e=/\s/;t.exports=function(t){for(var r=t.length;r--&&e.test(t.charAt(r)););return r}},87241:(t,e,r)=>{var i=r(77412),n=r(47443),o=[["ary",128],["bind",1],["bindKey",2],["curry",8],["curryRight",16],["flip",512],["partial",32],["partialRight",64],["rearg",256]];t.exports=function(t,e){return i(o,(function(r){var i="_."+r[0];e&r[1]&&!n(t,i)&&t.push(i)})),t.sort()}},21913:(t,e,r)=>{var i=r(96425),n=r(7548),o=r(278);t.exports=function(t){if(t instanceof i)return t.clone();var e=new n(t.__wrapped__,t.__chain__);return e.__actions__=o(t.__actions__),e.__index__=t.__index__,e.__values__=t.__values__,e}},28583:(t,e,r)=>{var i=r(34865),n=r(98363),o=r(21463),s=r(98612),a=r(25726),u=r(3674),h=Object.prototype.hasOwnProperty,c=o((function(t,e){if(a(e)||s(e))n(e,u(e),t);else for(var r in e)h.call(e,r)&&i(t,r,e[r])}));t.exports=c},66678:(t,e,r)=>{var i=r(85990);t.exports=function(t){return i(t,4)}},75703:t=>{t.exports=function(t){return function(){return t}}},77813:t=>{t.exports=function(t,e){return t===e||t!=t&&e!=e}},19873:(t,e,r)=>{var i=r(87157),n=r(16612);t.exports=function(t,e,r,o){var s=null==t?0:t.length;return s?(r&&"number"!=typeof r&&n(t,e,r)&&(r=0,o=s),i(t,e,r,o)):[]}},85564:(t,e,r)=>{var i=r(21078);t.exports=function(t){return null!=t&&t.length?i(t,1):[]}},79095:(t,e,r)=>{var i=r(13),n=r(222);t.exports=function(t,e){return null!=t&&n(t,e,i)}},6557:t=>{t.exports=function(t){return t}},25325:(t,e,r)=>{var i=r(29932),n=r(47556),o=r(5976),s=r(24387),a=o((function(t){var e=i(t,s);return e.length&&e[0]===t[0]?n(e):[]}));t.exports=a},35694:(t,e,r)=>{var i=r(9454),n=r(37005),o=Object.prototype,s=o.hasOwnProperty,a=o.propertyIsEnumerable,u=i(function(){return arguments}())?i:function(t){return n(t)&&s.call(t,"callee")&&!a.call(t,"callee")};t.exports=u},1469:t=>{var e=Array.isArray;t.exports=e},98612:(t,e,r)=>{var i=r(23560),n=r(41780);t.exports=function(t){return null!=t&&n(t.length)&&!i(t)}},29246:(t,e,r)=>{var i=r(98612),n=r(37005);t.exports=function(t){return n(t)&&i(t)}},44144:(t,e,r)=>{t=r.nmd(t);var i=r(55639),n=r(95062),o=e&&!e.nodeType&&e,s=o&&t&&!t.nodeType&&t,a=s&&s.exports===o?i.Buffer:void 0,u=(a?a.isBuffer:void 0)||n;t.exports=u},23560:(t,e,r)=>{var i=r(44239),n=r(13218);t.exports=function(t){if(!n(t))return!1;var e=i(t);return"[object Function]"==e||"[object GeneratorFunction]"==e||"[object AsyncFunction]"==e||"[object Proxy]"==e}},41780:t=>{t.exports=function(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=9007199254740991}},56688:(t,e,r)=>{var i=r(25588),n=r(7518),o=r(31167),s=o&&o.isMap,a=s?n(s):i;t.exports=a},13218:t=>{t.exports=function(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}},37005:t=>{t.exports=function(t){return null!=t&&"object"==typeof t}},68630:(t,e,r)=>{var i=r(44239),n=r(85924),o=r(37005),s=Function.prototype,a=Object.prototype,u=s.toString,h=a.hasOwnProperty,c=u.call(Object);t.exports=function(t){if(!o(t)||"[object Object]"!=i(t))return!1;var e=n(t);if(null===e)return!0;var r=h.call(e,"constructor")&&e.constructor;return"function"==typeof r&&r instanceof r&&u.call(r)==c}},72928:(t,e,r)=>{var i=r(29221),n=r(7518),o=r(31167),s=o&&o.isSet,a=s?n(s):i;t.exports=a},33448:(t,e,r)=>{var i=r(44239),n=r(37005);t.exports=function(t){return"symbol"==typeof t||n(t)&&"[object Symbol]"==i(t)}},36719:(t,e,r)=>{var i=r(38749),n=r(7518),o=r(31167),s=o&&o.isTypedArray,a=s?n(s):i;t.exports=a},3674:(t,e,r)=>{var i=r(14636),n=r(280),o=r(98612);t.exports=function(t){return o(t)?i(t):n(t)}},81704:(t,e,r)=>{var i=r(14636),n=r(10313),o=r(98612);t.exports=function(t){return o(t)?i(t,!0):n(t)}},10928:t=>{t.exports=function(t){var e=null==t?0:t.length;return e?t[e-1]:void 0}},88306:(t,e,r)=>{var i=r(83369);function n(t,e){if("function"!=typeof t||null!=e&&"function"!=typeof e)throw new TypeError("Expected a function");var r=function(){var i=arguments,n=e?e.apply(this,i):i[0],o=r.cache;if(o.has(n))return o.get(n);var s=t.apply(this,i);return r.cache=o.set(n,s)||o,s};return r.cache=new(n.Cache||i),r}n.Cache=i,t.exports=n},82492:(t,e,r)=>{var i=r(42980),n=r(21463)((function(t,e,r){i(t,e,r)}));t.exports=n},50308:t=>{t.exports=function(){}},57557:(t,e,r)=>{var i=r(29932),n=r(85990),o=r(57406),s=r(71811),a=r(98363),u=r(60696),h=r(99021),c=r(46904),f=h((function(t,e){var r={};if(null==t)return r;var h=!1;e=i(e,(function(e){return e=s(e,t),h||(h=e.length>1),e})),a(t,c(t),r),h&&(r=n(r,7,u));for(var f=e.length;f--;)o(r,e[f]);return r}));t.exports=f},65544:(t,e,r)=>{var i=r(5976),n=r(97727),o=r(20893),s=r(46460),a=i((function(t,e){var r=s(e,o(a));return n(t,64,void 0,e,r)}));a.placeholder={},t.exports=a},78718:(t,e,r)=>{var i=r(25970),n=r(99021)((function(t,e){return null==t?{}:i(t,e)}));t.exports=n},70479:t=>{t.exports=function(){return[]}},95062:t=>{t.exports=function(){return!1}},18601:(t,e,r)=>{var i=r(14841);t.exports=function(t){return t?Infinity===(t=i(t))||t===-1/0?17976931348623157e292*(t<0?-1:1):t==t?t:0:0===t?t:0}},40554:(t,e,r)=>{var i=r(18601);t.exports=function(t){var e=i(t),r=e%1;return e==e?r?e-r:e:0}},88958:(t,e,r)=>{var i=r(29750),n=r(40554);t.exports=function(t){return t?i(n(t),0,4294967295):0}},14841:(t,e,r)=>{var i=r(27561),n=r(13218),o=r(33448),s=/^[-+]0x[0-9a-f]+$/i,a=/^0b[01]+$/i,u=/^0o[0-7]+$/i,h=parseInt;t.exports=function(t){if("number"==typeof t)return t;if(o(t))return NaN;if(n(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=n(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=i(t);var r=a.test(t);return r||u.test(t)?h(t.slice(2),r?2:8):s.test(t)?NaN:+t}},59881:(t,e,r)=>{var i=r(98363),n=r(81704);t.exports=function(t){return i(t,n(t))}},79833:(t,e,r)=>{var i=r(80531);t.exports=function(t){return null==t?"":i(t)}},44908:(t,e,r)=>{var i=r(45652);t.exports=function(t){return t&&t.length?i(t):[]}},8111:(t,e,r)=>{var i=r(96425),n=r(7548),o=r(9435),s=r(1469),a=r(37005),u=r(21913),h=Object.prototype.hasOwnProperty;function c(t){if(a(t)&&!s(t)&&!(t instanceof i)){if(t instanceof n)return t;if(h.call(t,"__wrapped__"))return u(t)}return new n(t)}c.prototype=o.prototype,c.prototype.constructor=c,t.exports=c},43720:t=>{t.exports=r;var e=null;try{e=new WebAssembly.Instance(new WebAssembly.Module(new Uint8Array([0,97,115,109,1,0,0,0,1,13,2,96,0,1,127,96,4,127,127,127,127,1,127,3,7,6,0,1,1,1,1,1,6,6,1,127,1,65,0,11,7,50,6,3,109,117,108,0,1,5,100,105,118,95,115,0,2,5,100,105,118,95,117,0,3,5,114,101,109,95,115,0,4,5,114,101,109,95,117,0,5,8,103,101,116,95,104,105,103,104,0,0,10,191,1,6,4,0,35,0,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,126,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,127,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,128,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,129,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,130,34,4,66,32,135,167,36,0,32,4,167,11])),{}).exports}catch(t){}function r(t,e,r){this.low=0|t,this.high=0|e,this.unsigned=!!r}function i(t){return!0===(t&&t.__isLong__)}r.prototype.__isLong__,Object.defineProperty(r.prototype,"__isLong__",{value:!0}),r.isLong=i;var n={},o={};function s(t,e){var r,i,s;return e?(s=0<=(t>>>=0)&&t<256)&&(i=o[t])?i:(r=u(t,(0|t)<0?-1:0,!0),s&&(o[t]=r),r):(s=-128<=(t|=0)&&t<128)&&(i=n[t])?i:(r=u(t,t<0?-1:0,!1),s&&(n[t]=r),r)}function a(t,e){if(isNaN(t))return e?m:y;if(e){if(t<0)return m;if(t>=d)return S}else{if(t<=-p)return E;if(t+1>=p)return _}return t<0?a(-t,e).neg():u(t%l|0,t/l|0,e)}function u(t,e,i){return new r(t,e,i)}r.fromInt=s,r.fromNumber=a,r.fromBits=u;var h=Math.pow;function c(t,e,r){if(0===t.length)throw Error("empty string");if("NaN"===t||"Infinity"===t||"+Infinity"===t||"-Infinity"===t)return y;if("number"==typeof e?(r=e,e=!1):e=!!e,(r=r||10)<2||36<r)throw RangeError("radix");var i;if((i=t.indexOf("-"))>0)throw Error("interior hyphen");if(0===i)return c(t.substring(1),e,r).neg();for(var n=a(h(r,8)),o=y,s=0;s<t.length;s+=8){var u=Math.min(8,t.length-s),f=parseInt(t.substring(s,s+u),r);if(u<8){var l=a(h(r,u));o=o.mul(l).add(a(f))}else o=(o=o.mul(n)).add(a(f))}return o.unsigned=e,o}function f(t,e){return"number"==typeof t?a(t,e):"string"==typeof t?c(t,e):u(t.low,t.high,"boolean"==typeof e?e:t.unsigned)}r.fromString=c,r.fromValue=f;var l=4294967296,d=l*l,p=d/2,g=s(1<<24),y=s(0);r.ZERO=y;var m=s(0,!0);r.UZERO=m;var v=s(1);r.ONE=v;var b=s(1,!0);r.UONE=b;var w=s(-1);r.NEG_ONE=w;var _=u(-1,2147483647,!1);r.MAX_VALUE=_;var S=u(-1,-1,!0);r.MAX_UNSIGNED_VALUE=S;var E=u(0,-2147483648,!1);r.MIN_VALUE=E;var M=r.prototype;M.toInt=function(){return this.unsigned?this.low>>>0:this.low},M.toNumber=function(){return this.unsigned?(this.high>>>0)*l+(this.low>>>0):this.high*l+(this.low>>>0)},M.toString=function(t){if((t=t||10)<2||36<t)throw RangeError("radix");if(this.isZero())return"0";if(this.isNegative()){if(this.eq(E)){var e=a(t),r=this.div(e),i=r.mul(e).sub(this);return r.toString(t)+i.toInt().toString(t)}return"-"+this.neg().toString(t)}for(var n=a(h(t,6),this.unsigned),o=this,s="";;){var u=o.div(n),c=(o.sub(u.mul(n)).toInt()>>>0).toString(t);if((o=u).isZero())return c+s;for(;c.length<6;)c="0"+c;s=""+c+s}},M.getHighBits=function(){return this.high},M.getHighBitsUnsigned=function(){return this.high>>>0},M.getLowBits=function(){return this.low},M.getLowBitsUnsigned=function(){return this.low>>>0},M.getNumBitsAbs=function(){if(this.isNegative())return this.eq(E)?64:this.neg().getNumBitsAbs();for(var t=0!=this.high?this.high:this.low,e=31;e>0&&0==(t&1<<e);e--);return 0!=this.high?e+33:e+1},M.isZero=function(){return 0===this.high&&0===this.low},M.eqz=M.isZero,M.isNegative=function(){return!this.unsigned&&this.high<0},M.isPositive=function(){return this.unsigned||this.high>=0},M.isOdd=function(){return 1==(1&this.low)},M.isEven=function(){return 0==(1&this.low)},M.equals=function(t){return i(t)||(t=f(t)),(this.unsigned===t.unsigned||this.high>>>31!=1||t.high>>>31!=1)&&this.high===t.high&&this.low===t.low},M.eq=M.equals,M.notEquals=function(t){return!this.eq(t)},M.neq=M.notEquals,M.ne=M.notEquals,M.lessThan=function(t){return this.comp(t)<0},M.lt=M.lessThan,M.lessThanOrEqual=function(t){return this.comp(t)<=0},M.lte=M.lessThanOrEqual,M.le=M.lessThanOrEqual,M.greaterThan=function(t){return this.comp(t)>0},M.gt=M.greaterThan,M.greaterThanOrEqual=function(t){return this.comp(t)>=0},M.gte=M.greaterThanOrEqual,M.ge=M.greaterThanOrEqual,M.compare=function(t){if(i(t)||(t=f(t)),this.eq(t))return 0;var e=this.isNegative(),r=t.isNegative();return e&&!r?-1:!e&&r?1:this.unsigned?t.high>>>0>this.high>>>0||t.high===this.high&&t.low>>>0>this.low>>>0?-1:1:this.sub(t).isNegative()?-1:1},M.comp=M.compare,M.negate=function(){return!this.unsigned&&this.eq(E)?E:this.not().add(v)},M.neg=M.negate,M.add=function(t){i(t)||(t=f(t));var e=this.high>>>16,r=65535&this.high,n=this.low>>>16,o=65535&this.low,s=t.high>>>16,a=65535&t.high,h=t.low>>>16,c=0,l=0,d=0,p=0;return d+=(p+=o+(65535&t.low))>>>16,l+=(d+=n+h)>>>16,c+=(l+=r+a)>>>16,c+=e+s,u((d&=65535)<<16|(p&=65535),(c&=65535)<<16|(l&=65535),this.unsigned)},M.subtract=function(t){return i(t)||(t=f(t)),this.add(t.neg())},M.sub=M.subtract,M.multiply=function(t){if(this.isZero())return y;if(i(t)||(t=f(t)),e)return u(e.mul(this.low,this.high,t.low,t.high),e.get_high(),this.unsigned);if(t.isZero())return y;if(this.eq(E))return t.isOdd()?E:y;if(t.eq(E))return this.isOdd()?E:y;if(this.isNegative())return t.isNegative()?this.neg().mul(t.neg()):this.neg().mul(t).neg();if(t.isNegative())return this.mul(t.neg()).neg();if(this.lt(g)&&t.lt(g))return a(this.toNumber()*t.toNumber(),this.unsigned);var r=this.high>>>16,n=65535&this.high,o=this.low>>>16,s=65535&this.low,h=t.high>>>16,c=65535&t.high,l=t.low>>>16,d=65535&t.low,p=0,m=0,v=0,b=0;return v+=(b+=s*d)>>>16,m+=(v+=o*d)>>>16,v&=65535,m+=(v+=s*l)>>>16,p+=(m+=n*d)>>>16,m&=65535,p+=(m+=o*l)>>>16,m&=65535,p+=(m+=s*c)>>>16,p+=r*d+n*l+o*c+s*h,u((v&=65535)<<16|(b&=65535),(p&=65535)<<16|(m&=65535),this.unsigned)},M.mul=M.multiply,M.divide=function(t){if(i(t)||(t=f(t)),t.isZero())throw Error("division by zero");var r,n,o;if(e)return this.unsigned||-2147483648!==this.high||-1!==t.low||-1!==t.high?u((this.unsigned?e.div_u:e.div_s)(this.low,this.high,t.low,t.high),e.get_high(),this.unsigned):this;if(this.isZero())return this.unsigned?m:y;if(this.unsigned){if(t.unsigned||(t=t.toUnsigned()),t.gt(this))return m;if(t.gt(this.shru(1)))return b;o=m}else{if(this.eq(E))return t.eq(v)||t.eq(w)?E:t.eq(E)?v:(r=this.shr(1).div(t).shl(1)).eq(y)?t.isNegative()?v:w:(n=this.sub(t.mul(r)),o=r.add(n.div(t)));if(t.eq(E))return this.unsigned?m:y;if(this.isNegative())return t.isNegative()?this.neg().div(t.neg()):this.neg().div(t).neg();if(t.isNegative())return this.div(t.neg()).neg();o=y}for(n=this;n.gte(t);){r=Math.max(1,Math.floor(n.toNumber()/t.toNumber()));for(var s=Math.ceil(Math.log(r)/Math.LN2),c=s<=48?1:h(2,s-48),l=a(r),d=l.mul(t);d.isNegative()||d.gt(n);)d=(l=a(r-=c,this.unsigned)).mul(t);l.isZero()&&(l=v),o=o.add(l),n=n.sub(d)}return o},M.div=M.divide,M.modulo=function(t){return i(t)||(t=f(t)),e?u((this.unsigned?e.rem_u:e.rem_s)(this.low,this.high,t.low,t.high),e.get_high(),this.unsigned):this.sub(this.div(t).mul(t))},M.mod=M.modulo,M.rem=M.modulo,M.not=function(){return u(~this.low,~this.high,this.unsigned)},M.and=function(t){return i(t)||(t=f(t)),u(this.low&t.low,this.high&t.high,this.unsigned)},M.or=function(t){return i(t)||(t=f(t)),u(this.low|t.low,this.high|t.high,this.unsigned)},M.xor=function(t){return i(t)||(t=f(t)),u(this.low^t.low,this.high^t.high,this.unsigned)},M.shiftLeft=function(t){return i(t)&&(t=t.toInt()),0==(t&=63)?this:t<32?u(this.low<<t,this.high<<t|this.low>>>32-t,this.unsigned):u(0,this.low<<t-32,this.unsigned)},M.shl=M.shiftLeft,M.shiftRight=function(t){return i(t)&&(t=t.toInt()),0==(t&=63)?this:t<32?u(this.low>>>t|this.high<<32-t,this.high>>t,this.unsigned):u(this.high>>t-32,this.high>=0?0:-1,this.unsigned)},M.shr=M.shiftRight,M.shiftRightUnsigned=function(t){if(i(t)&&(t=t.toInt()),0==(t&=63))return this;var e=this.high;return t<32?u(this.low>>>t|e<<32-t,e>>>t,this.unsigned):u(32===t?e:e>>>t-32,0,this.unsigned)},M.shru=M.shiftRightUnsigned,M.shr_u=M.shiftRightUnsigned,M.toSigned=function(){return this.unsigned?u(this.low,this.high,!1):this},M.toUnsigned=function(){return this.unsigned?this:u(this.low,this.high,!0)},M.toBytes=function(t){return t?this.toBytesLE():this.toBytesBE()},M.toBytesLE=function(){var t=this.high,e=this.low;return[255&e,e>>>8&255,e>>>16&255,e>>>24,255&t,t>>>8&255,t>>>16&255,t>>>24]},M.toBytesBE=function(){var t=this.high,e=this.low;return[t>>>24,t>>>16&255,t>>>8&255,255&t,e>>>24,e>>>16&255,e>>>8&255,255&e]},r.fromBytes=function(t,e,i){return i?r.fromBytesLE(t,e):r.fromBytesBE(t,e)},r.fromBytesLE=function(t,e){return new r(t[0]|t[1]<<8|t[2]<<16|t[3]<<24,t[4]|t[5]<<8|t[6]<<16|t[7]<<24,e)},r.fromBytesBE=function(t,e){return new r(t[4]<<24|t[5]<<16|t[6]<<8|t[7],t[0]<<24|t[1]<<16|t[2]<<8|t[3],e)}},62318:(t,e,r)=>{"use strict";var i=r(35717),n=r(3349),o=r(89509).Buffer,s=new Array(16);function a(){n.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878}function u(t,e){return t<<e|t>>>32-e}function h(t,e,r,i,n,o,s){return u(t+(e&r|~e&i)+n+o|0,s)+e|0}function c(t,e,r,i,n,o,s){return u(t+(e&i|r&~i)+n+o|0,s)+e|0}function f(t,e,r,i,n,o,s){return u(t+(e^r^i)+n+o|0,s)+e|0}function l(t,e,r,i,n,o,s){return u(t+(r^(e|~i))+n+o|0,s)+e|0}i(a,n),a.prototype._update=function(){for(var t=s,e=0;e<16;++e)t[e]=this._block.readInt32LE(4*e);var r=this._a,i=this._b,n=this._c,o=this._d;r=h(r,i,n,o,t[0],3614090360,7),o=h(o,r,i,n,t[1],3905402710,12),n=h(n,o,r,i,t[2],606105819,17),i=h(i,n,o,r,t[3],3250441966,22),r=h(r,i,n,o,t[4],4118548399,7),o=h(o,r,i,n,t[5],1200080426,12),n=h(n,o,r,i,t[6],2821735955,17),i=h(i,n,o,r,t[7],4249261313,22),r=h(r,i,n,o,t[8],1770035416,7),o=h(o,r,i,n,t[9],2336552879,12),n=h(n,o,r,i,t[10],4294925233,17),i=h(i,n,o,r,t[11],2304563134,22),r=h(r,i,n,o,t[12],1804603682,7),o=h(o,r,i,n,t[13],4254626195,12),n=h(n,o,r,i,t[14],2792965006,17),r=c(r,i=h(i,n,o,r,t[15],1236535329,22),n,o,t[1],4129170786,5),o=c(o,r,i,n,t[6],3225465664,9),n=c(n,o,r,i,t[11],643717713,14),i=c(i,n,o,r,t[0],3921069994,20),r=c(r,i,n,o,t[5],3593408605,5),o=c(o,r,i,n,t[10],38016083,9),n=c(n,o,r,i,t[15],3634488961,14),i=c(i,n,o,r,t[4],3889429448,20),r=c(r,i,n,o,t[9],568446438,5),o=c(o,r,i,n,t[14],3275163606,9),n=c(n,o,r,i,t[3],4107603335,14),i=c(i,n,o,r,t[8],1163531501,20),r=c(r,i,n,o,t[13],2850285829,5),o=c(o,r,i,n,t[2],4243563512,9),n=c(n,o,r,i,t[7],1735328473,14),r=f(r,i=c(i,n,o,r,t[12],2368359562,20),n,o,t[5],4294588738,4),o=f(o,r,i,n,t[8],2272392833,11),n=f(n,o,r,i,t[11],1839030562,16),i=f(i,n,o,r,t[14],4259657740,23),r=f(r,i,n,o,t[1],2763975236,4),o=f(o,r,i,n,t[4],1272893353,11),n=f(n,o,r,i,t[7],4139469664,16),i=f(i,n,o,r,t[10],3200236656,23),r=f(r,i,n,o,t[13],681279174,4),o=f(o,r,i,n,t[0],3936430074,11),n=f(n,o,r,i,t[3],3572445317,16),i=f(i,n,o,r,t[6],76029189,23),r=f(r,i,n,o,t[9],3654602809,4),o=f(o,r,i,n,t[12],3873151461,11),n=f(n,o,r,i,t[15],530742520,16),r=l(r,i=f(i,n,o,r,t[2],3299628645,23),n,o,t[0],4096336452,6),o=l(o,r,i,n,t[7],1126891415,10),n=l(n,o,r,i,t[14],2878612391,15),i=l(i,n,o,r,t[5],4237533241,21),r=l(r,i,n,o,t[12],1700485571,6),o=l(o,r,i,n,t[3],2399980690,10),n=l(n,o,r,i,t[10],4293915773,15),i=l(i,n,o,r,t[1],2240044497,21),r=l(r,i,n,o,t[8],1873313359,6),o=l(o,r,i,n,t[15],4264355552,10),n=l(n,o,r,i,t[6],2734768916,15),i=l(i,n,o,r,t[13],1309151649,21),r=l(r,i,n,o,t[4],4149444226,6),o=l(o,r,i,n,t[11],3174756917,10),n=l(n,o,r,i,t[2],718787259,15),i=l(i,n,o,r,t[9],3951481745,21),this._a=this._a+r|0,this._b=this._b+i|0,this._c=this._c+n|0,this._d=this._d+o|0},a.prototype._digest=function(){this._block[this._blockOffset++]=128,this._blockOffset>56&&(this._block.fill(0,this._blockOffset,64),this._update(),this._blockOffset=0),this._block.fill(0,this._blockOffset,56),this._block.writeUInt32LE(this._length[0],56),this._block.writeUInt32LE(this._length[1],60),this._update();var t=o.allocUnsafe(16);return t.writeInt32LE(this._a,0),t.writeInt32LE(this._b,4),t.writeInt32LE(this._c,8),t.writeInt32LE(this._d,12),t},t.exports=a},63047:(t,e,r)=>{var i=r(96240),n=r(29931);function o(t){this.rand=t||new n.Rand}t.exports=o,o.create=function(t){return new o(t)},o.prototype._randbelow=function(t){var e=t.bitLength(),r=Math.ceil(e/8);do{var n=new i(this.rand.generate(r))}while(n.cmp(t)>=0);return n},o.prototype._randrange=function(t,e){var r=e.sub(t);return t.add(this._randbelow(r))},o.prototype.test=function(t,e,r){var n=t.bitLength(),o=i.mont(t),s=new i(1).toRed(o);e||(e=Math.max(1,n/48|0));for(var a=t.subn(1),u=0;!a.testn(u);u++);for(var h=t.shrn(u),c=a.toRed(o);e>0;e--){var f=this._randrange(new i(2),a);r&&r(f);var l=f.toRed(o).redPow(h);if(0!==l.cmp(s)&&0!==l.cmp(c)){for(var d=1;d<u;d++){if(0===(l=l.redSqr()).cmp(s))return!1;if(0===l.cmp(c))break}if(d===u)return!1}}return!0},o.prototype.getDivisor=function(t,e){var r=t.bitLength(),n=i.mont(t),o=new i(1).toRed(n);e||(e=Math.max(1,r/48|0));for(var s=t.subn(1),a=0;!s.testn(a);a++);for(var u=t.shrn(a),h=s.toRed(n);e>0;e--){var c=this._randrange(new i(2),s),f=t.gcd(c);if(0!==f.cmpn(1))return f;var l=c.toRed(n).redPow(u);if(0!==l.cmp(o)&&0!==l.cmp(h)){for(var d=1;d<a;d++){if(0===(l=l.redSqr()).cmp(o))return l.fromRed().subn(1).gcd(t);if(0===l.cmp(h))break}if(d===a)return(l=l.redSqr()).fromRed().subn(1).gcd(t)}}return!1}},96240:function(t,e,r){!function(t,e){"use strict";function i(t,e){if(!t)throw new Error(e||"Assertion failed")}function n(t,e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}function o(t,e,r){if(o.isBN(t))return t;this.negative=0,this.words=null,this.length=0,this.red=null,null!==t&&("le"!==e&&"be"!==e||(r=e,e=10),this._init(t||0,e||10,r||"be"))}var s;"object"==typeof t?t.exports=o:e.BN=o,o.BN=o,o.wordSize=26;try{s=r(32574).Buffer}catch(t){}function a(t,e,r){for(var i=0,n=Math.min(t.length,r),o=e;o<n;o++){var s=t.charCodeAt(o)-48;i<<=4,i|=s>=49&&s<=54?s-49+10:s>=17&&s<=22?s-17+10:15&s}return i}function u(t,e,r,i){for(var n=0,o=Math.min(t.length,r),s=e;s<o;s++){var a=t.charCodeAt(s)-48;n*=i,n+=a>=49?a-49+10:a>=17?a-17+10:a}return n}o.isBN=function(t){return t instanceof o||null!==t&&"object"==typeof t&&t.constructor.wordSize===o.wordSize&&Array.isArray(t.words)},o.max=function(t,e){return t.cmp(e)>0?t:e},o.min=function(t,e){return t.cmp(e)<0?t:e},o.prototype._init=function(t,e,r){if("number"==typeof t)return this._initNumber(t,e,r);if("object"==typeof t)return this._initArray(t,e,r);"hex"===e&&(e=16),i(e===(0|e)&&e>=2&&e<=36);var n=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&n++,16===e?this._parseHex(t,n):this._parseBase(t,e,n),"-"===t[0]&&(this.negative=1),this.strip(),"le"===r&&this._initArray(this.toArray(),e,r)},o.prototype._initNumber=function(t,e,r){t<0&&(this.negative=1,t=-t),t<67108864?(this.words=[67108863&t],this.length=1):t<4503599627370496?(this.words=[67108863&t,t/67108864&67108863],this.length=2):(i(t<9007199254740992),this.words=[67108863&t,t/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),e,r)},o.prototype._initArray=function(t,e,r){if(i("number"==typeof t.length),t.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(t.length/3),this.words=new Array(this.length);for(var n=0;n<this.length;n++)this.words[n]=0;var o,s,a=0;if("be"===r)for(n=t.length-1,o=0;n>=0;n-=3)s=t[n]|t[n-1]<<8|t[n-2]<<16,this.words[o]|=s<<a&67108863,this.words[o+1]=s>>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);else if("le"===r)for(n=0,o=0;n<t.length;n+=3)s=t[n]|t[n+1]<<8|t[n+2]<<16,this.words[o]|=s<<a&67108863,this.words[o+1]=s>>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);return this.strip()},o.prototype._parseHex=function(t,e){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var r=0;r<this.length;r++)this.words[r]=0;var i,n,o=0;for(r=t.length-6,i=0;r>=e;r-=6)n=a(t,r,r+6),this.words[i]|=n<<o&67108863,this.words[i+1]|=n>>>26-o&4194303,(o+=24)>=26&&(o-=26,i++);r+6!==e&&(n=a(t,e,r+6),this.words[i]|=n<<o&67108863,this.words[i+1]|=n>>>26-o&4194303),this.strip()},o.prototype._parseBase=function(t,e,r){this.words=[0],this.length=1;for(var i=0,n=1;n<=67108863;n*=e)i++;i--,n=n/e|0;for(var o=t.length-r,s=o%i,a=Math.min(o,o-s)+r,h=0,c=r;c<a;c+=i)h=u(t,c,c+i,e),this.imuln(n),this.words[0]+h<67108864?this.words[0]+=h:this._iaddn(h);if(0!==s){var f=1;for(h=u(t,c,t.length,e),c=0;c<s;c++)f*=e;this.imuln(f),this.words[0]+h<67108864?this.words[0]+=h:this._iaddn(h)}},o.prototype.copy=function(t){t.words=new Array(this.length);for(var e=0;e<this.length;e++)t.words[e]=this.words[e];t.length=this.length,t.negative=this.negative,t.red=this.red},o.prototype.clone=function(){var t=new o(null);return this.copy(t),t},o.prototype._expand=function(t){for(;this.length<t;)this.words[this.length++]=0;return this},o.prototype.strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},o.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},o.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var h=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],c=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],f=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function l(t,e,r){r.negative=e.negative^t.negative;var i=t.length+e.length|0;r.length=i,i=i-1|0;var n=0|t.words[0],o=0|e.words[0],s=n*o,a=67108863&s,u=s/67108864|0;r.words[0]=a;for(var h=1;h<i;h++){for(var c=u>>>26,f=67108863&u,l=Math.min(h,e.length-1),d=Math.max(0,h-t.length+1);d<=l;d++){var p=h-d|0;c+=(s=(n=0|t.words[p])*(o=0|e.words[d])+f)/67108864|0,f=67108863&s}r.words[h]=0|f,u=0|c}return 0!==u?r.words[h]=0|u:r.length--,r.strip()}o.prototype.toString=function(t,e){var r;if(e=0|e||1,16===(t=t||10)||"hex"===t){r="";for(var n=0,o=0,s=0;s<this.length;s++){var a=this.words[s],u=(16777215&(a<<n|o)).toString(16);r=0!=(o=a>>>24-n&16777215)||s!==this.length-1?h[6-u.length]+u+r:u+r,(n+=2)>=26&&(n-=26,s--)}for(0!==o&&(r=o.toString(16)+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(t===(0|t)&&t>=2&&t<=36){var l=c[t],d=f[t];r="";var p=this.clone();for(p.negative=0;!p.isZero();){var g=p.modn(d).toString(t);r=(p=p.idivn(d)).isZero()?g+r:h[l-g.length]+g+r}for(this.isZero()&&(r="0"+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}i(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:this.length>2&&i(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},o.prototype.toJSON=function(){return this.toString(16)},o.prototype.toBuffer=function(t,e){return i(void 0!==s),this.toArrayLike(s,t,e)},o.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)},o.prototype.toArrayLike=function(t,e,r){var n=this.byteLength(),o=r||Math.max(1,n);i(n<=o,"byte array longer than desired length"),i(o>0,"Requested array length <= 0"),this.strip();var s,a,u="le"===e,h=new t(o),c=this.clone();if(u){for(a=0;!c.isZero();a++)s=c.andln(255),c.iushrn(8),h[a]=s;for(;a<o;a++)h[a]=0}else{for(a=0;a<o-n;a++)h[a]=0;for(a=0;!c.isZero();a++)s=c.andln(255),c.iushrn(8),h[o-a-1]=s}return h},Math.clz32?o.prototype._countBits=function(t){return 32-Math.clz32(t)}:o.prototype._countBits=function(t){var e=t,r=0;return e>=4096&&(r+=13,e>>>=13),e>=64&&(r+=7,e>>>=7),e>=8&&(r+=4,e>>>=4),e>=2&&(r+=2,e>>>=2),r+e},o.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,r=0;return 0==(8191&e)&&(r+=13,e>>>=13),0==(127&e)&&(r+=7,e>>>=7),0==(15&e)&&(r+=4,e>>>=4),0==(3&e)&&(r+=2,e>>>=2),0==(1&e)&&r++,r},o.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;e<this.length;e++){var r=this._zeroBits(this.words[e]);if(t+=r,26!==r)break}return t},o.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},o.prototype.toTwos=function(t){return 0!==this.negative?this.abs().inotn(t).iaddn(1):this.clone()},o.prototype.fromTwos=function(t){return this.testn(t-1)?this.notn(t).iaddn(1).ineg():this.clone()},o.prototype.isNeg=function(){return 0!==this.negative},o.prototype.neg=function(){return this.clone().ineg()},o.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},o.prototype.iuor=function(t){for(;this.length<t.length;)this.words[this.length++]=0;for(var e=0;e<t.length;e++)this.words[e]=this.words[e]|t.words[e];return this.strip()},o.prototype.ior=function(t){return i(0==(this.negative|t.negative)),this.iuor(t)},o.prototype.or=function(t){return this.length>t.length?this.clone().ior(t):t.clone().ior(this)},o.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},o.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var r=0;r<e.length;r++)this.words[r]=this.words[r]&t.words[r];return this.length=e.length,this.strip()},o.prototype.iand=function(t){return i(0==(this.negative|t.negative)),this.iuand(t)},o.prototype.and=function(t){return this.length>t.length?this.clone().iand(t):t.clone().iand(this)},o.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},o.prototype.iuxor=function(t){var e,r;this.length>t.length?(e=this,r=t):(e=t,r=this);for(var i=0;i<r.length;i++)this.words[i]=e.words[i]^r.words[i];if(this!==e)for(;i<e.length;i++)this.words[i]=e.words[i];return this.length=e.length,this.strip()},o.prototype.ixor=function(t){return i(0==(this.negative|t.negative)),this.iuxor(t)},o.prototype.xor=function(t){return this.length>t.length?this.clone().ixor(t):t.clone().ixor(this)},o.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},o.prototype.inotn=function(t){i("number"==typeof t&&t>=0);var e=0|Math.ceil(t/26),r=t%26;this._expand(e),r>0&&e--;for(var n=0;n<e;n++)this.words[n]=67108863&~this.words[n];return r>0&&(this.words[n]=~this.words[n]&67108863>>26-r),this.strip()},o.prototype.notn=function(t){return this.clone().inotn(t)},o.prototype.setn=function(t,e){i("number"==typeof t&&t>=0);var r=t/26|0,n=t%26;return this._expand(r+1),this.words[r]=e?this.words[r]|1<<n:this.words[r]&~(1<<n),this.strip()},o.prototype.iadd=function(t){var e,r,i;if(0!==this.negative&&0===t.negative)return this.negative=0,e=this.isub(t),this.negative^=1,this._normSign();if(0===this.negative&&0!==t.negative)return t.negative=0,e=this.isub(t),t.negative=1,e._normSign();this.length>t.length?(r=this,i=t):(r=t,i=this);for(var n=0,o=0;o<i.length;o++)e=(0|r.words[o])+(0|i.words[o])+n,this.words[o]=67108863&e,n=e>>>26;for(;0!==n&&o<r.length;o++)e=(0|r.words[o])+n,this.words[o]=67108863&e,n=e>>>26;if(this.length=r.length,0!==n)this.words[this.length]=n,this.length++;else if(r!==this)for(;o<r.length;o++)this.words[o]=r.words[o];return this},o.prototype.add=function(t){var e;return 0!==t.negative&&0===this.negative?(t.negative=0,e=this.sub(t),t.negative^=1,e):0===t.negative&&0!==this.negative?(this.negative=0,e=t.sub(this),this.negative=1,e):this.length>t.length?this.clone().iadd(t):t.clone().iadd(this)},o.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e=this.iadd(t);return t.negative=1,e._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var r,i,n=this.cmp(t);if(0===n)return this.negative=0,this.length=1,this.words[0]=0,this;n>0?(r=this,i=t):(r=t,i=this);for(var o=0,s=0;s<i.length;s++)o=(e=(0|r.words[s])-(0|i.words[s])+o)>>26,this.words[s]=67108863&e;for(;0!==o&&s<r.length;s++)o=(e=(0|r.words[s])+o)>>26,this.words[s]=67108863&e;if(0===o&&s<r.length&&r!==this)for(;s<r.length;s++)this.words[s]=r.words[s];return this.length=Math.max(this.length,s),r!==this&&(this.negative=1),this.strip()},o.prototype.sub=function(t){return this.clone().isub(t)};var d=function(t,e,r){var i,n,o,s=t.words,a=e.words,u=r.words,h=0,c=0|s[0],f=8191&c,l=c>>>13,d=0|s[1],p=8191&d,g=d>>>13,y=0|s[2],m=8191&y,v=y>>>13,b=0|s[3],w=8191&b,_=b>>>13,S=0|s[4],E=8191&S,M=S>>>13,A=0|s[5],C=8191&A,k=A>>>13,I=0|s[6],T=8191&I,R=I>>>13,B=0|s[7],x=8191&B,F=B>>>13,P=0|s[8],N=8191&P,O=P>>>13,L=0|s[9],U=8191&L,j=L>>>13,D=0|a[0],K=8191&D,V=D>>>13,H=0|a[1],q=8191&H,z=H>>>13,W=0|a[2],G=8191&W,J=W>>>13,Z=0|a[3],$=8191&Z,Y=Z>>>13,Q=0|a[4],X=8191&Q,tt=Q>>>13,et=0|a[5],rt=8191&et,it=et>>>13,nt=0|a[6],ot=8191&nt,st=nt>>>13,at=0|a[7],ut=8191&at,ht=at>>>13,ct=0|a[8],ft=8191&ct,lt=ct>>>13,dt=0|a[9],pt=8191&dt,gt=dt>>>13;r.negative=t.negative^e.negative,r.length=19;var yt=(h+(i=Math.imul(f,K))|0)+((8191&(n=(n=Math.imul(f,V))+Math.imul(l,K)|0))<<13)|0;h=((o=Math.imul(l,V))+(n>>>13)|0)+(yt>>>26)|0,yt&=67108863,i=Math.imul(p,K),n=(n=Math.imul(p,V))+Math.imul(g,K)|0,o=Math.imul(g,V);var mt=(h+(i=i+Math.imul(f,q)|0)|0)+((8191&(n=(n=n+Math.imul(f,z)|0)+Math.imul(l,q)|0))<<13)|0;h=((o=o+Math.imul(l,z)|0)+(n>>>13)|0)+(mt>>>26)|0,mt&=67108863,i=Math.imul(m,K),n=(n=Math.imul(m,V))+Math.imul(v,K)|0,o=Math.imul(v,V),i=i+Math.imul(p,q)|0,n=(n=n+Math.imul(p,z)|0)+Math.imul(g,q)|0,o=o+Math.imul(g,z)|0;var vt=(h+(i=i+Math.imul(f,G)|0)|0)+((8191&(n=(n=n+Math.imul(f,J)|0)+Math.imul(l,G)|0))<<13)|0;h=((o=o+Math.imul(l,J)|0)+(n>>>13)|0)+(vt>>>26)|0,vt&=67108863,i=Math.imul(w,K),n=(n=Math.imul(w,V))+Math.imul(_,K)|0,o=Math.imul(_,V),i=i+Math.imul(m,q)|0,n=(n=n+Math.imul(m,z)|0)+Math.imul(v,q)|0,o=o+Math.imul(v,z)|0,i=i+Math.imul(p,G)|0,n=(n=n+Math.imul(p,J)|0)+Math.imul(g,G)|0,o=o+Math.imul(g,J)|0;var bt=(h+(i=i+Math.imul(f,$)|0)|0)+((8191&(n=(n=n+Math.imul(f,Y)|0)+Math.imul(l,$)|0))<<13)|0;h=((o=o+Math.imul(l,Y)|0)+(n>>>13)|0)+(bt>>>26)|0,bt&=67108863,i=Math.imul(E,K),n=(n=Math.imul(E,V))+Math.imul(M,K)|0,o=Math.imul(M,V),i=i+Math.imul(w,q)|0,n=(n=n+Math.imul(w,z)|0)+Math.imul(_,q)|0,o=o+Math.imul(_,z)|0,i=i+Math.imul(m,G)|0,n=(n=n+Math.imul(m,J)|0)+Math.imul(v,G)|0,o=o+Math.imul(v,J)|0,i=i+Math.imul(p,$)|0,n=(n=n+Math.imul(p,Y)|0)+Math.imul(g,$)|0,o=o+Math.imul(g,Y)|0;var wt=(h+(i=i+Math.imul(f,X)|0)|0)+((8191&(n=(n=n+Math.imul(f,tt)|0)+Math.imul(l,X)|0))<<13)|0;h=((o=o+Math.imul(l,tt)|0)+(n>>>13)|0)+(wt>>>26)|0,wt&=67108863,i=Math.imul(C,K),n=(n=Math.imul(C,V))+Math.imul(k,K)|0,o=Math.imul(k,V),i=i+Math.imul(E,q)|0,n=(n=n+Math.imul(E,z)|0)+Math.imul(M,q)|0,o=o+Math.imul(M,z)|0,i=i+Math.imul(w,G)|0,n=(n=n+Math.imul(w,J)|0)+Math.imul(_,G)|0,o=o+Math.imul(_,J)|0,i=i+Math.imul(m,$)|0,n=(n=n+Math.imul(m,Y)|0)+Math.imul(v,$)|0,o=o+Math.imul(v,Y)|0,i=i+Math.imul(p,X)|0,n=(n=n+Math.imul(p,tt)|0)+Math.imul(g,X)|0,o=o+Math.imul(g,tt)|0;var _t=(h+(i=i+Math.imul(f,rt)|0)|0)+((8191&(n=(n=n+Math.imul(f,it)|0)+Math.imul(l,rt)|0))<<13)|0;h=((o=o+Math.imul(l,it)|0)+(n>>>13)|0)+(_t>>>26)|0,_t&=67108863,i=Math.imul(T,K),n=(n=Math.imul(T,V))+Math.imul(R,K)|0,o=Math.imul(R,V),i=i+Math.imul(C,q)|0,n=(n=n+Math.imul(C,z)|0)+Math.imul(k,q)|0,o=o+Math.imul(k,z)|0,i=i+Math.imul(E,G)|0,n=(n=n+Math.imul(E,J)|0)+Math.imul(M,G)|0,o=o+Math.imul(M,J)|0,i=i+Math.imul(w,$)|0,n=(n=n+Math.imul(w,Y)|0)+Math.imul(_,$)|0,o=o+Math.imul(_,Y)|0,i=i+Math.imul(m,X)|0,n=(n=n+Math.imul(m,tt)|0)+Math.imul(v,X)|0,o=o+Math.imul(v,tt)|0,i=i+Math.imul(p,rt)|0,n=(n=n+Math.imul(p,it)|0)+Math.imul(g,rt)|0,o=o+Math.imul(g,it)|0;var St=(h+(i=i+Math.imul(f,ot)|0)|0)+((8191&(n=(n=n+Math.imul(f,st)|0)+Math.imul(l,ot)|0))<<13)|0;h=((o=o+Math.imul(l,st)|0)+(n>>>13)|0)+(St>>>26)|0,St&=67108863,i=Math.imul(x,K),n=(n=Math.imul(x,V))+Math.imul(F,K)|0,o=Math.imul(F,V),i=i+Math.imul(T,q)|0,n=(n=n+Math.imul(T,z)|0)+Math.imul(R,q)|0,o=o+Math.imul(R,z)|0,i=i+Math.imul(C,G)|0,n=(n=n+Math.imul(C,J)|0)+Math.imul(k,G)|0,o=o+Math.imul(k,J)|0,i=i+Math.imul(E,$)|0,n=(n=n+Math.imul(E,Y)|0)+Math.imul(M,$)|0,o=o+Math.imul(M,Y)|0,i=i+Math.imul(w,X)|0,n=(n=n+Math.imul(w,tt)|0)+Math.imul(_,X)|0,o=o+Math.imul(_,tt)|0,i=i+Math.imul(m,rt)|0,n=(n=n+Math.imul(m,it)|0)+Math.imul(v,rt)|0,o=o+Math.imul(v,it)|0,i=i+Math.imul(p,ot)|0,n=(n=n+Math.imul(p,st)|0)+Math.imul(g,ot)|0,o=o+Math.imul(g,st)|0;var Et=(h+(i=i+Math.imul(f,ut)|0)|0)+((8191&(n=(n=n+Math.imul(f,ht)|0)+Math.imul(l,ut)|0))<<13)|0;h=((o=o+Math.imul(l,ht)|0)+(n>>>13)|0)+(Et>>>26)|0,Et&=67108863,i=Math.imul(N,K),n=(n=Math.imul(N,V))+Math.imul(O,K)|0,o=Math.imul(O,V),i=i+Math.imul(x,q)|0,n=(n=n+Math.imul(x,z)|0)+Math.imul(F,q)|0,o=o+Math.imul(F,z)|0,i=i+Math.imul(T,G)|0,n=(n=n+Math.imul(T,J)|0)+Math.imul(R,G)|0,o=o+Math.imul(R,J)|0,i=i+Math.imul(C,$)|0,n=(n=n+Math.imul(C,Y)|0)+Math.imul(k,$)|0,o=o+Math.imul(k,Y)|0,i=i+Math.imul(E,X)|0,n=(n=n+Math.imul(E,tt)|0)+Math.imul(M,X)|0,o=o+Math.imul(M,tt)|0,i=i+Math.imul(w,rt)|0,n=(n=n+Math.imul(w,it)|0)+Math.imul(_,rt)|0,o=o+Math.imul(_,it)|0,i=i+Math.imul(m,ot)|0,n=(n=n+Math.imul(m,st)|0)+Math.imul(v,ot)|0,o=o+Math.imul(v,st)|0,i=i+Math.imul(p,ut)|0,n=(n=n+Math.imul(p,ht)|0)+Math.imul(g,ut)|0,o=o+Math.imul(g,ht)|0;var Mt=(h+(i=i+Math.imul(f,ft)|0)|0)+((8191&(n=(n=n+Math.imul(f,lt)|0)+Math.imul(l,ft)|0))<<13)|0;h=((o=o+Math.imul(l,lt)|0)+(n>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,i=Math.imul(U,K),n=(n=Math.imul(U,V))+Math.imul(j,K)|0,o=Math.imul(j,V),i=i+Math.imul(N,q)|0,n=(n=n+Math.imul(N,z)|0)+Math.imul(O,q)|0,o=o+Math.imul(O,z)|0,i=i+Math.imul(x,G)|0,n=(n=n+Math.imul(x,J)|0)+Math.imul(F,G)|0,o=o+Math.imul(F,J)|0,i=i+Math.imul(T,$)|0,n=(n=n+Math.imul(T,Y)|0)+Math.imul(R,$)|0,o=o+Math.imul(R,Y)|0,i=i+Math.imul(C,X)|0,n=(n=n+Math.imul(C,tt)|0)+Math.imul(k,X)|0,o=o+Math.imul(k,tt)|0,i=i+Math.imul(E,rt)|0,n=(n=n+Math.imul(E,it)|0)+Math.imul(M,rt)|0,o=o+Math.imul(M,it)|0,i=i+Math.imul(w,ot)|0,n=(n=n+Math.imul(w,st)|0)+Math.imul(_,ot)|0,o=o+Math.imul(_,st)|0,i=i+Math.imul(m,ut)|0,n=(n=n+Math.imul(m,ht)|0)+Math.imul(v,ut)|0,o=o+Math.imul(v,ht)|0,i=i+Math.imul(p,ft)|0,n=(n=n+Math.imul(p,lt)|0)+Math.imul(g,ft)|0,o=o+Math.imul(g,lt)|0;var At=(h+(i=i+Math.imul(f,pt)|0)|0)+((8191&(n=(n=n+Math.imul(f,gt)|0)+Math.imul(l,pt)|0))<<13)|0;h=((o=o+Math.imul(l,gt)|0)+(n>>>13)|0)+(At>>>26)|0,At&=67108863,i=Math.imul(U,q),n=(n=Math.imul(U,z))+Math.imul(j,q)|0,o=Math.imul(j,z),i=i+Math.imul(N,G)|0,n=(n=n+Math.imul(N,J)|0)+Math.imul(O,G)|0,o=o+Math.imul(O,J)|0,i=i+Math.imul(x,$)|0,n=(n=n+Math.imul(x,Y)|0)+Math.imul(F,$)|0,o=o+Math.imul(F,Y)|0,i=i+Math.imul(T,X)|0,n=(n=n+Math.imul(T,tt)|0)+Math.imul(R,X)|0,o=o+Math.imul(R,tt)|0,i=i+Math.imul(C,rt)|0,n=(n=n+Math.imul(C,it)|0)+Math.imul(k,rt)|0,o=o+Math.imul(k,it)|0,i=i+Math.imul(E,ot)|0,n=(n=n+Math.imul(E,st)|0)+Math.imul(M,ot)|0,o=o+Math.imul(M,st)|0,i=i+Math.imul(w,ut)|0,n=(n=n+Math.imul(w,ht)|0)+Math.imul(_,ut)|0,o=o+Math.imul(_,ht)|0,i=i+Math.imul(m,ft)|0,n=(n=n+Math.imul(m,lt)|0)+Math.imul(v,ft)|0,o=o+Math.imul(v,lt)|0;var Ct=(h+(i=i+Math.imul(p,pt)|0)|0)+((8191&(n=(n=n+Math.imul(p,gt)|0)+Math.imul(g,pt)|0))<<13)|0;h=((o=o+Math.imul(g,gt)|0)+(n>>>13)|0)+(Ct>>>26)|0,Ct&=67108863,i=Math.imul(U,G),n=(n=Math.imul(U,J))+Math.imul(j,G)|0,o=Math.imul(j,J),i=i+Math.imul(N,$)|0,n=(n=n+Math.imul(N,Y)|0)+Math.imul(O,$)|0,o=o+Math.imul(O,Y)|0,i=i+Math.imul(x,X)|0,n=(n=n+Math.imul(x,tt)|0)+Math.imul(F,X)|0,o=o+Math.imul(F,tt)|0,i=i+Math.imul(T,rt)|0,n=(n=n+Math.imul(T,it)|0)+Math.imul(R,rt)|0,o=o+Math.imul(R,it)|0,i=i+Math.imul(C,ot)|0,n=(n=n+Math.imul(C,st)|0)+Math.imul(k,ot)|0,o=o+Math.imul(k,st)|0,i=i+Math.imul(E,ut)|0,n=(n=n+Math.imul(E,ht)|0)+Math.imul(M,ut)|0,o=o+Math.imul(M,ht)|0,i=i+Math.imul(w,ft)|0,n=(n=n+Math.imul(w,lt)|0)+Math.imul(_,ft)|0,o=o+Math.imul(_,lt)|0;var kt=(h+(i=i+Math.imul(m,pt)|0)|0)+((8191&(n=(n=n+Math.imul(m,gt)|0)+Math.imul(v,pt)|0))<<13)|0;h=((o=o+Math.imul(v,gt)|0)+(n>>>13)|0)+(kt>>>26)|0,kt&=67108863,i=Math.imul(U,$),n=(n=Math.imul(U,Y))+Math.imul(j,$)|0,o=Math.imul(j,Y),i=i+Math.imul(N,X)|0,n=(n=n+Math.imul(N,tt)|0)+Math.imul(O,X)|0,o=o+Math.imul(O,tt)|0,i=i+Math.imul(x,rt)|0,n=(n=n+Math.imul(x,it)|0)+Math.imul(F,rt)|0,o=o+Math.imul(F,it)|0,i=i+Math.imul(T,ot)|0,n=(n=n+Math.imul(T,st)|0)+Math.imul(R,ot)|0,o=o+Math.imul(R,st)|0,i=i+Math.imul(C,ut)|0,n=(n=n+Math.imul(C,ht)|0)+Math.imul(k,ut)|0,o=o+Math.imul(k,ht)|0,i=i+Math.imul(E,ft)|0,n=(n=n+Math.imul(E,lt)|0)+Math.imul(M,ft)|0,o=o+Math.imul(M,lt)|0;var It=(h+(i=i+Math.imul(w,pt)|0)|0)+((8191&(n=(n=n+Math.imul(w,gt)|0)+Math.imul(_,pt)|0))<<13)|0;h=((o=o+Math.imul(_,gt)|0)+(n>>>13)|0)+(It>>>26)|0,It&=67108863,i=Math.imul(U,X),n=(n=Math.imul(U,tt))+Math.imul(j,X)|0,o=Math.imul(j,tt),i=i+Math.imul(N,rt)|0,n=(n=n+Math.imul(N,it)|0)+Math.imul(O,rt)|0,o=o+Math.imul(O,it)|0,i=i+Math.imul(x,ot)|0,n=(n=n+Math.imul(x,st)|0)+Math.imul(F,ot)|0,o=o+Math.imul(F,st)|0,i=i+Math.imul(T,ut)|0,n=(n=n+Math.imul(T,ht)|0)+Math.imul(R,ut)|0,o=o+Math.imul(R,ht)|0,i=i+Math.imul(C,ft)|0,n=(n=n+Math.imul(C,lt)|0)+Math.imul(k,ft)|0,o=o+Math.imul(k,lt)|0;var Tt=(h+(i=i+Math.imul(E,pt)|0)|0)+((8191&(n=(n=n+Math.imul(E,gt)|0)+Math.imul(M,pt)|0))<<13)|0;h=((o=o+Math.imul(M,gt)|0)+(n>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,i=Math.imul(U,rt),n=(n=Math.imul(U,it))+Math.imul(j,rt)|0,o=Math.imul(j,it),i=i+Math.imul(N,ot)|0,n=(n=n+Math.imul(N,st)|0)+Math.imul(O,ot)|0,o=o+Math.imul(O,st)|0,i=i+Math.imul(x,ut)|0,n=(n=n+Math.imul(x,ht)|0)+Math.imul(F,ut)|0,o=o+Math.imul(F,ht)|0,i=i+Math.imul(T,ft)|0,n=(n=n+Math.imul(T,lt)|0)+Math.imul(R,ft)|0,o=o+Math.imul(R,lt)|0;var Rt=(h+(i=i+Math.imul(C,pt)|0)|0)+((8191&(n=(n=n+Math.imul(C,gt)|0)+Math.imul(k,pt)|0))<<13)|0;h=((o=o+Math.imul(k,gt)|0)+(n>>>13)|0)+(Rt>>>26)|0,Rt&=67108863,i=Math.imul(U,ot),n=(n=Math.imul(U,st))+Math.imul(j,ot)|0,o=Math.imul(j,st),i=i+Math.imul(N,ut)|0,n=(n=n+Math.imul(N,ht)|0)+Math.imul(O,ut)|0,o=o+Math.imul(O,ht)|0,i=i+Math.imul(x,ft)|0,n=(n=n+Math.imul(x,lt)|0)+Math.imul(F,ft)|0,o=o+Math.imul(F,lt)|0;var Bt=(h+(i=i+Math.imul(T,pt)|0)|0)+((8191&(n=(n=n+Math.imul(T,gt)|0)+Math.imul(R,pt)|0))<<13)|0;h=((o=o+Math.imul(R,gt)|0)+(n>>>13)|0)+(Bt>>>26)|0,Bt&=67108863,i=Math.imul(U,ut),n=(n=Math.imul(U,ht))+Math.imul(j,ut)|0,o=Math.imul(j,ht),i=i+Math.imul(N,ft)|0,n=(n=n+Math.imul(N,lt)|0)+Math.imul(O,ft)|0,o=o+Math.imul(O,lt)|0;var xt=(h+(i=i+Math.imul(x,pt)|0)|0)+((8191&(n=(n=n+Math.imul(x,gt)|0)+Math.imul(F,pt)|0))<<13)|0;h=((o=o+Math.imul(F,gt)|0)+(n>>>13)|0)+(xt>>>26)|0,xt&=67108863,i=Math.imul(U,ft),n=(n=Math.imul(U,lt))+Math.imul(j,ft)|0,o=Math.imul(j,lt);var Ft=(h+(i=i+Math.imul(N,pt)|0)|0)+((8191&(n=(n=n+Math.imul(N,gt)|0)+Math.imul(O,pt)|0))<<13)|0;h=((o=o+Math.imul(O,gt)|0)+(n>>>13)|0)+(Ft>>>26)|0,Ft&=67108863;var Pt=(h+(i=Math.imul(U,pt))|0)+((8191&(n=(n=Math.imul(U,gt))+Math.imul(j,pt)|0))<<13)|0;return h=((o=Math.imul(j,gt))+(n>>>13)|0)+(Pt>>>26)|0,Pt&=67108863,u[0]=yt,u[1]=mt,u[2]=vt,u[3]=bt,u[4]=wt,u[5]=_t,u[6]=St,u[7]=Et,u[8]=Mt,u[9]=At,u[10]=Ct,u[11]=kt,u[12]=It,u[13]=Tt,u[14]=Rt,u[15]=Bt,u[16]=xt,u[17]=Ft,u[18]=Pt,0!==h&&(u[19]=h,r.length++),r};function p(t,e,r){return(new g).mulp(t,e,r)}function g(t,e){this.x=t,this.y=e}Math.imul||(d=l),o.prototype.mulTo=function(t,e){var r=this.length+t.length;return 10===this.length&&10===t.length?d(this,t,e):r<63?l(this,t,e):r<1024?function(t,e,r){r.negative=e.negative^t.negative,r.length=t.length+e.length;for(var i=0,n=0,o=0;o<r.length-1;o++){var s=n;n=0;for(var a=67108863&i,u=Math.min(o,e.length-1),h=Math.max(0,o-t.length+1);h<=u;h++){var c=o-h,f=(0|t.words[c])*(0|e.words[h]),l=67108863&f;a=67108863&(l=l+a|0),n+=(s=(s=s+(f/67108864|0)|0)+(l>>>26)|0)>>>26,s&=67108863}r.words[o]=a,i=s,s=n}return 0!==i?r.words[o]=i:r.length--,r.strip()}(this,t,e):p(this,t,e)},g.prototype.makeRBT=function(t){for(var e=new Array(t),r=o.prototype._countBits(t)-1,i=0;i<t;i++)e[i]=this.revBin(i,r,t);return e},g.prototype.revBin=function(t,e,r){if(0===t||t===r-1)return t;for(var i=0,n=0;n<e;n++)i|=(1&t)<<e-n-1,t>>=1;return i},g.prototype.permute=function(t,e,r,i,n,o){for(var s=0;s<o;s++)i[s]=e[t[s]],n[s]=r[t[s]]},g.prototype.transform=function(t,e,r,i,n,o){this.permute(o,t,e,r,i,n);for(var s=1;s<n;s<<=1)for(var a=s<<1,u=Math.cos(2*Math.PI/a),h=Math.sin(2*Math.PI/a),c=0;c<n;c+=a)for(var f=u,l=h,d=0;d<s;d++){var p=r[c+d],g=i[c+d],y=r[c+d+s],m=i[c+d+s],v=f*y-l*m;m=f*m+l*y,y=v,r[c+d]=p+y,i[c+d]=g+m,r[c+d+s]=p-y,i[c+d+s]=g-m,d!==a&&(v=u*f-h*l,l=u*l+h*f,f=v)}},g.prototype.guessLen13b=function(t,e){var r=1|Math.max(e,t),i=1&r,n=0;for(r=r/2|0;r;r>>>=1)n++;return 1<<n+1+i},g.prototype.conjugate=function(t,e,r){if(!(r<=1))for(var i=0;i<r/2;i++){var n=t[i];t[i]=t[r-i-1],t[r-i-1]=n,n=e[i],e[i]=-e[r-i-1],e[r-i-1]=-n}},g.prototype.normalize13b=function(t,e){for(var r=0,i=0;i<e/2;i++){var n=8192*Math.round(t[2*i+1]/e)+Math.round(t[2*i]/e)+r;t[i]=67108863&n,r=n<67108864?0:n/67108864|0}return t},g.prototype.convert13b=function(t,e,r,n){for(var o=0,s=0;s<e;s++)o+=0|t[s],r[2*s]=8191&o,o>>>=13,r[2*s+1]=8191&o,o>>>=13;for(s=2*e;s<n;++s)r[s]=0;i(0===o),i(0==(-8192&o))},g.prototype.stub=function(t){for(var e=new Array(t),r=0;r<t;r++)e[r]=0;return e},g.prototype.mulp=function(t,e,r){var i=2*this.guessLen13b(t.length,e.length),n=this.makeRBT(i),o=this.stub(i),s=new Array(i),a=new Array(i),u=new Array(i),h=new Array(i),c=new Array(i),f=new Array(i),l=r.words;l.length=i,this.convert13b(t.words,t.length,s,i),this.convert13b(e.words,e.length,h,i),this.transform(s,o,a,u,i,n),this.transform(h,o,c,f,i,n);for(var d=0;d<i;d++){var p=a[d]*c[d]-u[d]*f[d];u[d]=a[d]*f[d]+u[d]*c[d],a[d]=p}return this.conjugate(a,u,i),this.transform(a,u,l,o,i,n),this.conjugate(l,o,i),this.normalize13b(l,i),r.negative=t.negative^e.negative,r.length=t.length+e.length,r.strip()},o.prototype.mul=function(t){var e=new o(null);return e.words=new Array(this.length+t.length),this.mulTo(t,e)},o.prototype.mulf=function(t){var e=new o(null);return e.words=new Array(this.length+t.length),p(this,t,e)},o.prototype.imul=function(t){return this.clone().mulTo(t,this)},o.prototype.imuln=function(t){i("number"==typeof t),i(t<67108864);for(var e=0,r=0;r<this.length;r++){var n=(0|this.words[r])*t,o=(67108863&n)+(67108863&e);e>>=26,e+=n/67108864|0,e+=o>>>26,this.words[r]=67108863&o}return 0!==e&&(this.words[r]=e,this.length++),this},o.prototype.muln=function(t){return this.clone().imuln(t)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(t){var e=function(t){for(var e=new Array(t.bitLength()),r=0;r<e.length;r++){var i=r/26|0,n=r%26;e[r]=(t.words[i]&1<<n)>>>n}return e}(t);if(0===e.length)return new o(1);for(var r=this,i=0;i<e.length&&0===e[i];i++,r=r.sqr());if(++i<e.length)for(var n=r.sqr();i<e.length;i++,n=n.sqr())0!==e[i]&&(r=r.mul(n));return r},o.prototype.iushln=function(t){i("number"==typeof t&&t>=0);var e,r=t%26,n=(t-r)/26,o=67108863>>>26-r<<26-r;if(0!==r){var s=0;for(e=0;e<this.length;e++){var a=this.words[e]&o,u=(0|this.words[e])-a<<r;this.words[e]=u|s,s=a>>>26-r}s&&(this.words[e]=s,this.length++)}if(0!==n){for(e=this.length-1;e>=0;e--)this.words[e+n]=this.words[e];for(e=0;e<n;e++)this.words[e]=0;this.length+=n}return this.strip()},o.prototype.ishln=function(t){return i(0===this.negative),this.iushln(t)},o.prototype.iushrn=function(t,e,r){var n;i("number"==typeof t&&t>=0),n=e?(e-e%26)/26:0;var o=t%26,s=Math.min((t-o)/26,this.length),a=67108863^67108863>>>o<<o,u=r;if(n-=s,n=Math.max(0,n),u){for(var h=0;h<s;h++)u.words[h]=this.words[h];u.length=s}if(0===s);else if(this.length>s)for(this.length-=s,h=0;h<this.length;h++)this.words[h]=this.words[h+s];else this.words[0]=0,this.length=1;var c=0;for(h=this.length-1;h>=0&&(0!==c||h>=n);h--){var f=0|this.words[h];this.words[h]=c<<26-o|f>>>o,c=f&a}return u&&0!==c&&(u.words[u.length++]=c),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},o.prototype.ishrn=function(t,e,r){return i(0===this.negative),this.iushrn(t,e,r)},o.prototype.shln=function(t){return this.clone().ishln(t)},o.prototype.ushln=function(t){return this.clone().iushln(t)},o.prototype.shrn=function(t){return this.clone().ishrn(t)},o.prototype.ushrn=function(t){return this.clone().iushrn(t)},o.prototype.testn=function(t){i("number"==typeof t&&t>=0);var e=t%26,r=(t-e)/26,n=1<<e;return!(this.length<=r||!(this.words[r]&n))},o.prototype.imaskn=function(t){i("number"==typeof t&&t>=0);var e=t%26,r=(t-e)/26;if(i(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==e&&r++,this.length=Math.min(r,this.length),0!==e){var n=67108863^67108863>>>e<<e;this.words[this.length-1]&=n}return this.strip()},o.prototype.maskn=function(t){return this.clone().imaskn(t)},o.prototype.iaddn=function(t){return i("number"==typeof t),i(t<67108864),t<0?this.isubn(-t):0!==this.negative?1===this.length&&(0|this.words[0])<t?(this.words[0]=t-(0|this.words[0]),this.negative=0,this):(this.negative=0,this.isubn(t),this.negative=1,this):this._iaddn(t)},o.prototype._iaddn=function(t){this.words[0]+=t;for(var e=0;e<this.length&&this.words[e]>=67108864;e++)this.words[e]-=67108864,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},o.prototype.isubn=function(t){if(i("number"==typeof t),i(t<67108864),t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var e=0;e<this.length&&this.words[e]<0;e++)this.words[e]+=67108864,this.words[e+1]-=1;return this.strip()},o.prototype.addn=function(t){return this.clone().iaddn(t)},o.prototype.subn=function(t){return this.clone().isubn(t)},o.prototype.iabs=function(){return this.negative=0,this},o.prototype.abs=function(){return this.clone().iabs()},o.prototype._ishlnsubmul=function(t,e,r){var n,o,s=t.length+r;this._expand(s);var a=0;for(n=0;n<t.length;n++){o=(0|this.words[n+r])+a;var u=(0|t.words[n])*e;a=((o-=67108863&u)>>26)-(u/67108864|0),this.words[n+r]=67108863&o}for(;n<this.length-r;n++)a=(o=(0|this.words[n+r])+a)>>26,this.words[n+r]=67108863&o;if(0===a)return this.strip();for(i(-1===a),a=0,n=0;n<this.length;n++)a=(o=-(0|this.words[n])+a)>>26,this.words[n]=67108863&o;return this.negative=1,this.strip()},o.prototype._wordDiv=function(t,e){var r=(this.length,t.length),i=this.clone(),n=t,s=0|n.words[n.length-1];0!=(r=26-this._countBits(s))&&(n=n.ushln(r),i.iushln(r),s=0|n.words[n.length-1]);var a,u=i.length-n.length;if("mod"!==e){(a=new o(null)).length=u+1,a.words=new Array(a.length);for(var h=0;h<a.length;h++)a.words[h]=0}var c=i.clone()._ishlnsubmul(n,1,u);0===c.negative&&(i=c,a&&(a.words[u]=1));for(var f=u-1;f>=0;f--){var l=67108864*(0|i.words[n.length+f])+(0|i.words[n.length+f-1]);for(l=Math.min(l/s|0,67108863),i._ishlnsubmul(n,l,f);0!==i.negative;)l--,i.negative=0,i._ishlnsubmul(n,1,f),i.isZero()||(i.negative^=1);a&&(a.words[f]=l)}return a&&a.strip(),i.strip(),"div"!==e&&0!==r&&i.iushrn(r),{div:a||null,mod:i}},o.prototype.divmod=function(t,e,r){return i(!t.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===t.negative?(a=this.neg().divmod(t,e),"mod"!==e&&(n=a.div.neg()),"div"!==e&&(s=a.mod.neg(),r&&0!==s.negative&&s.iadd(t)),{div:n,mod:s}):0===this.negative&&0!==t.negative?(a=this.divmod(t.neg(),e),"mod"!==e&&(n=a.div.neg()),{div:n,mod:a.mod}):0!=(this.negative&t.negative)?(a=this.neg().divmod(t.neg(),e),"div"!==e&&(s=a.mod.neg(),r&&0!==s.negative&&s.isub(t)),{div:a.div,mod:s}):t.length>this.length||this.cmp(t)<0?{div:new o(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new o(this.modn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new o(this.modn(t.words[0]))}:this._wordDiv(t,e);var n,s,a},o.prototype.div=function(t){return this.divmod(t,"div",!1).div},o.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},o.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},o.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var r=0!==e.div.negative?e.mod.isub(t):e.mod,i=t.ushrn(1),n=t.andln(1),o=r.cmp(i);return o<0||1===n&&0===o?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},o.prototype.modn=function(t){i(t<=67108863);for(var e=(1<<26)%t,r=0,n=this.length-1;n>=0;n--)r=(e*r+(0|this.words[n]))%t;return r},o.prototype.idivn=function(t){i(t<=67108863);for(var e=0,r=this.length-1;r>=0;r--){var n=(0|this.words[r])+67108864*e;this.words[r]=n/t|0,e=n%t}return this.strip()},o.prototype.divn=function(t){return this.clone().idivn(t)},o.prototype.egcd=function(t){i(0===t.negative),i(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var n=new o(1),s=new o(0),a=new o(0),u=new o(1),h=0;e.isEven()&&r.isEven();)e.iushrn(1),r.iushrn(1),++h;for(var c=r.clone(),f=e.clone();!e.isZero();){for(var l=0,d=1;0==(e.words[0]&d)&&l<26;++l,d<<=1);if(l>0)for(e.iushrn(l);l-- >0;)(n.isOdd()||s.isOdd())&&(n.iadd(c),s.isub(f)),n.iushrn(1),s.iushrn(1);for(var p=0,g=1;0==(r.words[0]&g)&&p<26;++p,g<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(a.isOdd()||u.isOdd())&&(a.iadd(c),u.isub(f)),a.iushrn(1),u.iushrn(1);e.cmp(r)>=0?(e.isub(r),n.isub(a),s.isub(u)):(r.isub(e),a.isub(n),u.isub(s))}return{a,b:u,gcd:r.iushln(h)}},o.prototype._invmp=function(t){i(0===t.negative),i(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var n,s=new o(1),a=new o(0),u=r.clone();e.cmpn(1)>0&&r.cmpn(1)>0;){for(var h=0,c=1;0==(e.words[0]&c)&&h<26;++h,c<<=1);if(h>0)for(e.iushrn(h);h-- >0;)s.isOdd()&&s.iadd(u),s.iushrn(1);for(var f=0,l=1;0==(r.words[0]&l)&&f<26;++f,l<<=1);if(f>0)for(r.iushrn(f);f-- >0;)a.isOdd()&&a.iadd(u),a.iushrn(1);e.cmp(r)>=0?(e.isub(r),s.isub(a)):(r.isub(e),a.isub(s))}return(n=0===e.cmpn(1)?s:a).cmpn(0)<0&&n.iadd(t),n},o.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),r=t.clone();e.negative=0,r.negative=0;for(var i=0;e.isEven()&&r.isEven();i++)e.iushrn(1),r.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;r.isEven();)r.iushrn(1);var n=e.cmp(r);if(n<0){var o=e;e=r,r=o}else if(0===n||0===r.cmpn(1))break;e.isub(r)}return r.iushln(i)},o.prototype.invm=function(t){return this.egcd(t).a.umod(t)},o.prototype.isEven=function(){return 0==(1&this.words[0])},o.prototype.isOdd=function(){return 1==(1&this.words[0])},o.prototype.andln=function(t){return this.words[0]&t},o.prototype.bincn=function(t){i("number"==typeof t);var e=t%26,r=(t-e)/26,n=1<<e;if(this.length<=r)return this._expand(r+1),this.words[r]|=n,this;for(var o=n,s=r;0!==o&&s<this.length;s++){var a=0|this.words[s];o=(a+=o)>>>26,a&=67108863,this.words[s]=a}return 0!==o&&(this.words[s]=o,this.length++),this},o.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},o.prototype.cmpn=function(t){var e,r=t<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this.strip(),this.length>1)e=1;else{r&&(t=-t),i(t<=67108863,"Number is too big");var n=0|this.words[0];e=n===t?0:n<t?-1:1}return 0!==this.negative?0|-e:e},o.prototype.cmp=function(t){if(0!==this.negative&&0===t.negative)return-1;if(0===this.negative&&0!==t.negative)return 1;var e=this.ucmp(t);return 0!==this.negative?0|-e:e},o.prototype.ucmp=function(t){if(this.length>t.length)return 1;if(this.length<t.length)return-1;for(var e=0,r=this.length-1;r>=0;r--){var i=0|this.words[r],n=0|t.words[r];if(i!==n){i<n?e=-1:i>n&&(e=1);break}}return e},o.prototype.gtn=function(t){return 1===this.cmpn(t)},o.prototype.gt=function(t){return 1===this.cmp(t)},o.prototype.gten=function(t){return this.cmpn(t)>=0},o.prototype.gte=function(t){return this.cmp(t)>=0},o.prototype.ltn=function(t){return-1===this.cmpn(t)},o.prototype.lt=function(t){return-1===this.cmp(t)},o.prototype.lten=function(t){return this.cmpn(t)<=0},o.prototype.lte=function(t){return this.cmp(t)<=0},o.prototype.eqn=function(t){return 0===this.cmpn(t)},o.prototype.eq=function(t){return 0===this.cmp(t)},o.red=function(t){return new S(t)},o.prototype.toRed=function(t){return i(!this.red,"Already a number in reduction context"),i(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},o.prototype.fromRed=function(){return i(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(t){return this.red=t,this},o.prototype.forceRed=function(t){return i(!this.red,"Already a number in reduction context"),this._forceRed(t)},o.prototype.redAdd=function(t){return i(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},o.prototype.redIAdd=function(t){return i(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},o.prototype.redSub=function(t){return i(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},o.prototype.redISub=function(t){return i(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},o.prototype.redShl=function(t){return i(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},o.prototype.redMul=function(t){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},o.prototype.redIMul=function(t){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},o.prototype.redSqr=function(){return i(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return i(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return i(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return i(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return i(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(t){return i(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var y={k256:null,p224:null,p192:null,p25519:null};function m(t,e){this.name=t,this.p=new o(e,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function v(){m.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function b(){m.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function w(){m.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function _(){m.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function S(t){if("string"==typeof t){var e=o._prime(t);this.m=e.p,this.prime=e}else i(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function E(t){S.call(this,t),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new o(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}m.prototype._tmp=function(){var t=new o(null);return t.words=new Array(Math.ceil(this.n/13)),t},m.prototype.ireduce=function(t){var e,r=t;do{this.split(r,this.tmp),e=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(e>this.n);var i=e<this.n?-1:r.ucmp(this.p);return 0===i?(r.words[0]=0,r.length=1):i>0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},m.prototype.split=function(t,e){t.iushrn(this.n,0,e)},m.prototype.imulK=function(t){return t.imul(this.k)},n(v,m),v.prototype.split=function(t,e){for(var r=4194303,i=Math.min(t.length,9),n=0;n<i;n++)e.words[n]=t.words[n];if(e.length=i,t.length<=9)return t.words[0]=0,void(t.length=1);var o=t.words[9];for(e.words[e.length++]=o&r,n=10;n<t.length;n++){var s=0|t.words[n];t.words[n-10]=(s&r)<<4|o>>>22,o=s}o>>>=22,t.words[n-10]=o,0===o&&t.length>10?t.length-=10:t.length-=9},v.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,r=0;r<t.length;r++){var i=0|t.words[r];e+=977*i,t.words[r]=67108863&e,e=64*i+(e/67108864|0)}return 0===t.words[t.length-1]&&(t.length--,0===t.words[t.length-1]&&t.length--),t},n(b,m),n(w,m),n(_,m),_.prototype.imulK=function(t){for(var e=0,r=0;r<t.length;r++){var i=19*(0|t.words[r])+e,n=67108863&i;i>>>=26,t.words[r]=n,e=i}return 0!==e&&(t.words[t.length++]=e),t},o._prime=function(t){if(y[t])return y[t];var e;if("k256"===t)e=new v;else if("p224"===t)e=new b;else if("p192"===t)e=new w;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new _}return y[t]=e,e},S.prototype._verify1=function(t){i(0===t.negative,"red works only with positives"),i(t.red,"red works only with red numbers")},S.prototype._verify2=function(t,e){i(0==(t.negative|e.negative),"red works only with positives"),i(t.red&&t.red===e.red,"red works only with red numbers")},S.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.umod(this.m)._forceRed(this)},S.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},S.prototype.add=function(t,e){this._verify2(t,e);var r=t.add(e);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},S.prototype.iadd=function(t,e){this._verify2(t,e);var r=t.iadd(e);return r.cmp(this.m)>=0&&r.isub(this.m),r},S.prototype.sub=function(t,e){this._verify2(t,e);var r=t.sub(e);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},S.prototype.isub=function(t,e){this._verify2(t,e);var r=t.isub(e);return r.cmpn(0)<0&&r.iadd(this.m),r},S.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},S.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},S.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},S.prototype.isqr=function(t){return this.imul(t,t.clone())},S.prototype.sqr=function(t){return this.mul(t,t)},S.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(i(e%2==1),3===e){var r=this.m.add(new o(1)).iushrn(2);return this.pow(t,r)}for(var n=this.m.subn(1),s=0;!n.isZero()&&0===n.andln(1);)s++,n.iushrn(1);i(!n.isZero());var a=new o(1).toRed(this),u=a.redNeg(),h=this.m.subn(1).iushrn(1),c=this.m.bitLength();for(c=new o(2*c*c).toRed(this);0!==this.pow(c,h).cmp(u);)c.redIAdd(u);for(var f=this.pow(c,n),l=this.pow(t,n.addn(1).iushrn(1)),d=this.pow(t,n),p=s;0!==d.cmp(a);){for(var g=d,y=0;0!==g.cmp(a);y++)g=g.redSqr();i(y<p);var m=this.pow(f,new o(1).iushln(p-y-1));l=l.redMul(m),f=m.redSqr(),d=d.redMul(f),p=y}return l},S.prototype.invm=function(t){var e=t._invmp(this.m);return 0!==e.negative?(e.negative=0,this.imod(e).redNeg()):this.imod(e)},S.prototype.pow=function(t,e){if(e.isZero())return new o(1).toRed(this);if(0===e.cmpn(1))return t.clone();var r=new Array(16);r[0]=new o(1).toRed(this),r[1]=t;for(var i=2;i<r.length;i++)r[i]=this.mul(r[i-1],t);var n=r[0],s=0,a=0,u=e.bitLength()%26;for(0===u&&(u=26),i=e.length-1;i>=0;i--){for(var h=e.words[i],c=u-1;c>=0;c--){var f=h>>c&1;n!==r[0]&&(n=this.sqr(n)),0!==f||0!==s?(s<<=1,s|=f,(4==++a||0===i&&0===c)&&(n=this.mul(n,r[s]),a=0,s=0)):a=0}u=26}return n},S.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},S.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},o.mont=function(t){return new E(t)},n(E,S),E.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},E.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},E.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var r=t.imul(e),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(i).iushrn(this.shift),o=n;return n.cmp(this.m)>=0?o=n.isub(this.m):n.cmpn(0)<0&&(o=n.iadd(this.m)),o._forceRed(this)},E.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new o(0)._forceRed(this);var r=t.mul(e),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(i).iushrn(this.shift),s=n;return n.cmp(this.m)>=0?s=n.isub(this.m):n.cmpn(0)<0&&(s=n.iadd(this.m)),s._forceRed(this)},E.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(t=r.nmd(t),this)},79746:t=>{function e(t,e){if(!t)throw new Error(e||"Assertion failed")}t.exports=e,e.equal=function(t,e,r){if(t!=e)throw new Error(r||"Assertion failed: "+t+" != "+e)}},34504:(t,e)=>{"use strict";var r=e;function i(t){return 1===t.length?"0"+t:t}function n(t){for(var e="",r=0;r<t.length;r++)e+=i(t[r].toString(16));return e}r.toArray=function(t,e){if(Array.isArray(t))return t.slice();if(!t)return[];var r=[];if("string"!=typeof t){for(var i=0;i<t.length;i++)r[i]=0|t[i];return r}if("hex"===e)for((t=t.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(t="0"+t),i=0;i<t.length;i+=2)r.push(parseInt(t[i]+t[i+1],16));else for(i=0;i<t.length;i++){var n=t.charCodeAt(i),o=n>>8,s=255&n;o?r.push(o,s):r.push(s)}return r},r.zero2=i,r.toHex=n,r.encode=function(t,e){return"hex"===e?n(t):t}},57824:t=>{var e=1e3,r=60*e,i=60*r,n=24*i;function o(t,e,r,i){var n=e>=1.5*r;return Math.round(t/r)+" "+i+(n?"s":"")}t.exports=function(t,s){s=s||{};var a,u,h=typeof t;if("string"===h&&t.length>0)return function(t){if(!((t=String(t)).length>100)){var o=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(t);if(o){var s=parseFloat(o[1]);switch((o[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return 315576e5*s;case"weeks":case"week":case"w":return 6048e5*s;case"days":case"day":case"d":return s*n;case"hours":case"hour":case"hrs":case"hr":case"h":return s*i;case"minutes":case"minute":case"mins":case"min":case"m":return s*r;case"seconds":case"second":case"secs":case"sec":case"s":return s*e;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return s;default:return}}}}(t);if("number"===h&&isFinite(t))return s.long?(a=t,(u=Math.abs(a))>=n?o(a,u,n,"day"):u>=i?o(a,u,i,"hour"):u>=r?o(a,u,r,"minute"):u>=e?o(a,u,e,"second"):a+" ms"):function(t){var o=Math.abs(t);return o>=n?Math.round(t/n)+"d":o>=i?Math.round(t/i)+"h":o>=r?Math.round(t/r)+"m":o>=e?Math.round(t/e)+"s":t+"ms"}(t);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(t))}},8925:(t,e,r)=>{var i=r(3832);function n(t,e){i.cipher.registerAlgorithm(t,(function(){return new i.aes.Algorithm(t,e)}))}r(85649),r(61967),r(97116),t.exports=i.aes=i.aes||{},i.aes.startEncrypting=function(t,e,r,i){var n=p({key:t,output:r,decrypt:!1,mode:i});return n.start(e),n},i.aes.createEncryptionCipher=function(t,e){return p({key:t,output:null,decrypt:!1,mode:e})},i.aes.startDecrypting=function(t,e,r,i){var n=p({key:t,output:r,decrypt:!0,mode:i});return n.start(e),n},i.aes.createDecryptionCipher=function(t,e){return p({key:t,output:null,decrypt:!0,mode:e})},i.aes.Algorithm=function(t,e){c||f();var r=this;r.name=t,r.mode=new e({blockSize:16,cipher:{encrypt:function(t,e){return d(r._w,t,e,!1)},decrypt:function(t,e){return d(r._w,t,e,!0)}}}),r._init=!1},i.aes.Algorithm.prototype.initialize=function(t){if(!this._init){var e,r=t.key;if("string"!=typeof r||16!==r.length&&24!==r.length&&32!==r.length){if(i.util.isArray(r)&&(16===r.length||24===r.length||32===r.length)){e=r,r=i.util.createBuffer();for(var n=0;n<e.length;++n)r.putByte(e[n])}}else r=i.util.createBuffer(r);if(!i.util.isArray(r)){e=r,r=[];var o=e.length();if(16===o||24===o||32===o)for(o>>>=2,n=0;n<o;++n)r.push(e.getInt32())}if(!i.util.isArray(r)||4!==r.length&&6!==r.length&&8!==r.length)throw new Error("Invalid key parameter.");var s=this.mode.name,a=-1!==["CFB","OFB","CTR","GCM"].indexOf(s);this._w=l(r,t.decrypt&&!a),this._init=!0}},i.aes._expandKey=function(t,e){return c||f(),l(t,e)},i.aes._updateBlock=d,n("AES-ECB",i.cipher.modes.ecb),n("AES-CBC",i.cipher.modes.cbc),n("AES-CFB",i.cipher.modes.cfb),n("AES-OFB",i.cipher.modes.ofb),n("AES-CTR",i.cipher.modes.ctr),n("AES-GCM",i.cipher.modes.gcm);var o,s,a,u,h,c=!1;function f(){c=!0,a=[0,1,2,4,8,16,32,64,128,27,54];for(var t=new Array(256),e=0;e<128;++e)t[e]=e<<1,t[e+128]=e+128<<1^283;for(o=new Array(256),s=new Array(256),u=new Array(4),h=new Array(4),e=0;e<4;++e)u[e]=new Array(256),h[e]=new Array(256);var r,i,n,f,l,d,p,g=0,y=0;for(e=0;e<256;++e){f=(f=y^y<<1^y<<2^y<<3^y<<4)>>8^255&f^99,o[g]=f,s[f]=g,d=(l=t[f])<<24^f<<16^f<<8^f^l,p=((r=t[g])^(i=t[r])^(n=t[i]))<<24^(g^n)<<16^(g^i^n)<<8^g^r^n;for(var m=0;m<4;++m)u[m][g]=d,h[m][f]=p,d=d<<24|d>>>8,p=p<<24|p>>>8;0===g?g=y=1:(g=r^t[t[t[r^n]]],y^=t[t[y]])}}function l(t,e){for(var r,i=t.slice(0),n=1,s=i.length,u=4*(s+6+1),c=s;c<u;++c)r=i[c-1],c%s==0?(r=o[r>>>16&255]<<24^o[r>>>8&255]<<16^o[255&r]<<8^o[r>>>24]^a[n]<<24,n++):s>6&&c%s==4&&(r=o[r>>>24]<<24^o[r>>>16&255]<<16^o[r>>>8&255]<<8^o[255&r]),i[c]=i[c-s]^r;if(e){for(var f,l=h[0],d=h[1],p=h[2],g=h[3],y=i.slice(0),m=(c=0,(u=i.length)-4);c<u;c+=4,m-=4)if(0===c||c===u-4)y[c]=i[m],y[c+1]=i[m+3],y[c+2]=i[m+2],y[c+3]=i[m+1];else for(var v=0;v<4;++v)f=i[m+v],y[c+(3&-v)]=l[o[f>>>24]]^d[o[f>>>16&255]]^p[o[f>>>8&255]]^g[o[255&f]];i=y}return i}function d(t,e,r,i){var n,a,c,f,l,d,p,g,y,m,v,b,w=t.length/4-1;i?(n=h[0],a=h[1],c=h[2],f=h[3],l=s):(n=u[0],a=u[1],c=u[2],f=u[3],l=o),d=e[0]^t[0],p=e[i?3:1]^t[1],g=e[2]^t[2],y=e[i?1:3]^t[3];for(var _=3,S=1;S<w;++S)m=n[d>>>24]^a[p>>>16&255]^c[g>>>8&255]^f[255&y]^t[++_],v=n[p>>>24]^a[g>>>16&255]^c[y>>>8&255]^f[255&d]^t[++_],b=n[g>>>24]^a[y>>>16&255]^c[d>>>8&255]^f[255&p]^t[++_],y=n[y>>>24]^a[d>>>16&255]^c[p>>>8&255]^f[255&g]^t[++_],d=m,p=v,g=b;r[0]=l[d>>>24]<<24^l[p>>>16&255]<<16^l[g>>>8&255]<<8^l[255&y]^t[++_],r[i?3:1]=l[p>>>24]<<24^l[g>>>16&255]<<16^l[y>>>8&255]<<8^l[255&d]^t[++_],r[2]=l[g>>>24]<<24^l[y>>>16&255]<<16^l[d>>>8&255]<<8^l[255&p]^t[++_],r[i?1:3]=l[y>>>24]<<24^l[d>>>16&255]<<16^l[p>>>8&255]<<8^l[255&g]^t[++_]}function p(t){var e,r="AES-"+((t=t||{}).mode||"CBC").toUpperCase(),n=(e=t.decrypt?i.cipher.createDecipher(r,t.key):i.cipher.createCipher(r,t.key)).start;return e.start=function(t,r){var o=null;r instanceof i.util.ByteBuffer&&(o=r,r={}),(r=r||{}).output=o,r.iv=t,n.call(e,r)},e}},3068:(t,e,r)=>{var i=r(3832);r(97116),r(66270);var n=t.exports=i.asn1=i.asn1||{};function o(t,e,r){if(r>e){var i=new Error("Too few bytes to parse DER.");throw i.available=t.length(),i.remaining=e,i.requested=r,i}}function s(t,e,r,i){var a;o(t,e,2);var u=t.getByte();e--;var h=192&u,c=31&u;a=t.length();var f,l,d=function(t,e){var r=t.getByte();if(e--,128!==r){var i;if(128&r){var n=127&r;o(t,e,n),i=t.getInt(n<<3)}else i=r;if(i<0)throw new Error("Negative length: "+i);return i}}(t,e);if(e-=a-t.length(),void 0!==d&&d>e){if(i.strict){var p=new Error("Too few bytes to read ASN.1 value.");throw p.available=t.length(),p.remaining=e,p.requested=d,p}d=e}var g=32==(32&u);if(g)if(f=[],void 0===d)for(;;){if(o(t,e,2),t.bytes(2)===String.fromCharCode(0,0)){t.getBytes(2),e-=2;break}a=t.length(),f.push(s(t,e,r+1,i)),e-=a-t.length()}else for(;d>0;)a=t.length(),f.push(s(t,d,r+1,i)),e-=a-t.length(),d-=a-t.length();if(void 0===f&&h===n.Class.UNIVERSAL&&c===n.Type.BITSTRING&&(l=t.bytes(d)),void 0===f&&i.decodeBitStrings&&h===n.Class.UNIVERSAL&&c===n.Type.BITSTRING&&d>1){var y=t.read,m=e,v=0;if(c===n.Type.BITSTRING&&(o(t,e,1),v=t.getByte(),e--),0===v)try{a=t.length();var b=s(t,e,r+1,{verbose:i.verbose,strict:!0,decodeBitStrings:!0}),w=a-t.length();e-=w,c==n.Type.BITSTRING&&w++;var _=b.tagClass;w!==d||_!==n.Class.UNIVERSAL&&_!==n.Class.CONTEXT_SPECIFIC||(f=[b])}catch(t){}void 0===f&&(t.read=y,e=m)}if(void 0===f){if(void 0===d){if(i.strict)throw new Error("Non-constructed ASN.1 object of indefinite length.");d=e}if(c===n.Type.BMPSTRING)for(f="";d>0;d-=2)o(t,e,2),f+=String.fromCharCode(t.getInt16()),e-=2;else f=t.getBytes(d)}var S=void 0===l?null:{bitStringContents:l};return n.create(h,c,g,f,S)}n.Class={UNIVERSAL:0,APPLICATION:64,CONTEXT_SPECIFIC:128,PRIVATE:192},n.Type={NONE:0,BOOLEAN:1,INTEGER:2,BITSTRING:3,OCTETSTRING:4,NULL:5,OID:6,ODESC:7,EXTERNAL:8,REAL:9,ENUMERATED:10,EMBEDDED:11,UTF8:12,ROID:13,SEQUENCE:16,SET:17,PRINTABLESTRING:19,IA5STRING:22,UTCTIME:23,GENERALIZEDTIME:24,BMPSTRING:30},n.create=function(t,e,r,o,s){if(i.util.isArray(o)){for(var a=[],u=0;u<o.length;++u)void 0!==o[u]&&a.push(o[u]);o=a}var h={tagClass:t,type:e,constructed:r,composed:r||i.util.isArray(o),value:o};return s&&"bitStringContents"in s&&(h.bitStringContents=s.bitStringContents,h.original=n.copy(h)),h},n.copy=function(t,e){var r;if(i.util.isArray(t)){r=[];for(var o=0;o<t.length;++o)r.push(n.copy(t[o],e));return r}return"string"==typeof t?t:(r={tagClass:t.tagClass,type:t.type,constructed:t.constructed,composed:t.composed,value:n.copy(t.value,e)},e&&!e.excludeBitStringContents&&(r.bitStringContents=t.bitStringContents),r)},n.equals=function(t,e,r){if(i.util.isArray(t)){if(!i.util.isArray(e))return!1;if(t.length!==e.length)return!1;for(var o=0;o<t.length;++o)if(!n.equals(t[o],e[o]))return!1;return!0}if(typeof t!=typeof e)return!1;if("string"==typeof t)return t===e;var s=t.tagClass===e.tagClass&&t.type===e.type&&t.constructed===e.constructed&&t.composed===e.composed&&n.equals(t.value,e.value);return r&&r.includeBitStringContents&&(s=s&&t.bitStringContents===e.bitStringContents),s},n.getBerValueLength=function(t){var e=t.getByte();if(128!==e)return 128&e?t.getInt((127&e)<<3):e},n.fromDer=function(t,e){return void 0===e&&(e={strict:!0,decodeBitStrings:!0}),"boolean"==typeof e&&(e={strict:e,decodeBitStrings:!0}),"strict"in e||(e.strict=!0),"decodeBitStrings"in e||(e.decodeBitStrings=!0),"string"==typeof t&&(t=i.util.createBuffer(t)),s(t,t.length(),0,e)},n.toDer=function(t){var e=i.util.createBuffer(),r=t.tagClass|t.type,o=i.util.createBuffer(),s=!1;if("bitStringContents"in t&&(s=!0,t.original&&(s=n.equals(t,t.original))),s)o.putBytes(t.bitStringContents);else if(t.composed){t.constructed?r|=32:o.putByte(0);for(var a=0;a<t.value.length;++a)void 0!==t.value[a]&&o.putBuffer(n.toDer(t.value[a]))}else if(t.type===n.Type.BMPSTRING)for(a=0;a<t.value.length;++a)o.putInt16(t.value.charCodeAt(a));else t.type===n.Type.INTEGER&&t.value.length>1&&(0===t.value.charCodeAt(0)&&0==(128&t.value.charCodeAt(1))||255===t.value.charCodeAt(0)&&128==(128&t.value.charCodeAt(1)))?o.putBytes(t.value.substr(1)):o.putBytes(t.value);if(e.putByte(r),o.length()<=127)e.putByte(127&o.length());else{var u=o.length(),h="";do{h+=String.fromCharCode(255&u),u>>>=8}while(u>0);for(e.putByte(128|h.length),a=h.length-1;a>=0;--a)e.putByte(h.charCodeAt(a))}return e.putBuffer(o),e},n.oidToDer=function(t){var e,r,n,o,s=t.split("."),a=i.util.createBuffer();a.putByte(40*parseInt(s[0],10)+parseInt(s[1],10));for(var u=2;u<s.length;++u){e=!0,r=[],n=parseInt(s[u],10);do{o=127&n,n>>>=7,e||(o|=128),r.push(o),e=!1}while(n>0);for(var h=r.length-1;h>=0;--h)a.putByte(r[h])}return a},n.derToOid=function(t){var e;"string"==typeof t&&(t=i.util.createBuffer(t));var r=t.getByte();e=Math.floor(r/40)+"."+r%40;for(var n=0;t.length()>0;)n<<=7,128&(r=t.getByte())?n+=127&r:(e+="."+(n+r),n=0);return e},n.utcTimeToDate=function(t){var e=new Date,r=parseInt(t.substr(0,2),10);r=r>=50?1900+r:2e3+r;var i=parseInt(t.substr(2,2),10)-1,n=parseInt(t.substr(4,2),10),o=parseInt(t.substr(6,2),10),s=parseInt(t.substr(8,2),10),a=0;if(t.length>11){var u=t.charAt(10),h=10;"+"!==u&&"-"!==u&&(a=parseInt(t.substr(10,2),10),h+=2)}if(e.setUTCFullYear(r,i,n),e.setUTCHours(o,s,a,0),h&&("+"===(u=t.charAt(h))||"-"===u)){var c=60*parseInt(t.substr(h+1,2),10)+parseInt(t.substr(h+4,2),10);c*=6e4,"+"===u?e.setTime(+e-c):e.setTime(+e+c)}return e},n.generalizedTimeToDate=function(t){var e=new Date,r=parseInt(t.substr(0,4),10),i=parseInt(t.substr(4,2),10)-1,n=parseInt(t.substr(6,2),10),o=parseInt(t.substr(8,2),10),s=parseInt(t.substr(10,2),10),a=parseInt(t.substr(12,2),10),u=0,h=0,c=!1;"Z"===t.charAt(t.length-1)&&(c=!0);var f=t.length-5,l=t.charAt(f);return"+"!==l&&"-"!==l||(h=60*parseInt(t.substr(f+1,2),10)+parseInt(t.substr(f+4,2),10),h*=6e4,"+"===l&&(h*=-1),c=!0),"."===t.charAt(14)&&(u=1e3*parseFloat(t.substr(14),10)),c?(e.setUTCFullYear(r,i,n),e.setUTCHours(o,s,a,u),e.setTime(+e+h)):(e.setFullYear(r,i,n),e.setHours(o,s,a,u)),e},n.dateToUtcTime=function(t){if("string"==typeof t)return t;var e="",r=[];r.push((""+t.getUTCFullYear()).substr(2)),r.push(""+(t.getUTCMonth()+1)),r.push(""+t.getUTCDate()),r.push(""+t.getUTCHours()),r.push(""+t.getUTCMinutes()),r.push(""+t.getUTCSeconds());for(var i=0;i<r.length;++i)r[i].length<2&&(e+="0"),e+=r[i];return e+"Z"},n.dateToGeneralizedTime=function(t){if("string"==typeof t)return t;var e="",r=[];r.push(""+t.getUTCFullYear()),r.push(""+(t.getUTCMonth()+1)),r.push(""+t.getUTCDate()),r.push(""+t.getUTCHours()),r.push(""+t.getUTCMinutes()),r.push(""+t.getUTCSeconds());for(var i=0;i<r.length;++i)r[i].length<2&&(e+="0"),e+=r[i];return e+"Z"},n.integerToDer=function(t){var e=i.util.createBuffer();if(t>=-128&&t<128)return e.putSignedInt(t,8);if(t>=-32768&&t<32768)return e.putSignedInt(t,16);if(t>=-8388608&&t<8388608)return e.putSignedInt(t,24);if(t>=-2147483648&&t<2147483648)return e.putSignedInt(t,32);var r=new Error("Integer too large; max is 32-bits.");throw r.integer=t,r},n.derToInteger=function(t){"string"==typeof t&&(t=i.util.createBuffer(t));var e=8*t.length();if(e>32)throw new Error("Integer too large; max is 32-bits.");return t.getSignedInt(e)},n.validate=function(t,e,r,o){var s=!1;if(t.tagClass!==e.tagClass&&void 0!==e.tagClass||t.type!==e.type&&void 0!==e.type)o&&(t.tagClass!==e.tagClass&&o.push("["+e.name+'] Expected tag class "'+e.tagClass+'", got "'+t.tagClass+'"'),t.type!==e.type&&o.push("["+e.name+'] Expected type "'+e.type+'", got "'+t.type+'"'));else if(t.constructed===e.constructed||void 0===e.constructed){if(s=!0,e.value&&i.util.isArray(e.value))for(var a=0,u=0;s&&u<e.value.length;++u)s=e.value[u].optional||!1,t.value[a]&&((s=n.validate(t.value[a],e.value[u],r,o))?++a:e.value[u].optional&&(s=!0)),!s&&o&&o.push("["+e.name+'] Tag class "'+e.tagClass+'", type "'+e.type+'" expected value length "'+e.value.length+'", got "'+t.value.length+'"');if(s&&r&&(e.capture&&(r[e.capture]=t.value),e.captureAsn1&&(r[e.captureAsn1]=t),e.captureBitStringContents&&"bitStringContents"in t&&(r[e.captureBitStringContents]=t.bitStringContents),e.captureBitStringValue&&"bitStringContents"in t))if(t.bitStringContents.length<2)r[e.captureBitStringValue]="";else{if(0!==t.bitStringContents.charCodeAt(0))throw new Error("captureBitStringValue only supported for zero unused bits");r[e.captureBitStringValue]=t.bitStringContents.slice(1)}}else o&&o.push("["+e.name+'] Expected constructed "'+e.constructed+'", got "'+t.constructed+'"');return s};var a=/[^\\u0000-\\u00ff]/;n.prettyPrint=function(t,e,r){var o="";r=r||2,(e=e||0)>0&&(o+="\n");for(var s="",u=0;u<e*r;++u)s+=" ";switch(o+=s+"Tag: ",t.tagClass){case n.Class.UNIVERSAL:o+="Universal:";break;case n.Class.APPLICATION:o+="Application:";break;case n.Class.CONTEXT_SPECIFIC:o+="Context-Specific:";break;case n.Class.PRIVATE:o+="Private:"}if(t.tagClass===n.Class.UNIVERSAL)switch(o+=t.type,t.type){case n.Type.NONE:o+=" (None)";break;case n.Type.BOOLEAN:o+=" (Boolean)";break;case n.Type.INTEGER:o+=" (Integer)";break;case n.Type.BITSTRING:o+=" (Bit string)";break;case n.Type.OCTETSTRING:o+=" (Octet string)";break;case n.Type.NULL:o+=" (Null)";break;case n.Type.OID:o+=" (Object Identifier)";break;case n.Type.ODESC:o+=" (Object Descriptor)";break;case n.Type.EXTERNAL:o+=" (External or Instance of)";break;case n.Type.REAL:o+=" (Real)";break;case n.Type.ENUMERATED:o+=" (Enumerated)";break;case n.Type.EMBEDDED:o+=" (Embedded PDV)";break;case n.Type.UTF8:o+=" (UTF8)";break;case n.Type.ROID:o+=" (Relative Object Identifier)";break;case n.Type.SEQUENCE:o+=" (Sequence)";break;case n.Type.SET:o+=" (Set)";break;case n.Type.PRINTABLESTRING:o+=" (Printable String)";break;case n.Type.IA5String:o+=" (IA5String (ASCII))";break;case n.Type.UTCTIME:o+=" (UTC time)";break;case n.Type.GENERALIZEDTIME:o+=" (Generalized time)";break;case n.Type.BMPSTRING:o+=" (BMP String)"}else o+=t.type;if(o+="\n",o+=s+"Constructed: "+t.constructed+"\n",t.composed){var h=0,c="";for(u=0;u<t.value.length;++u)void 0!==t.value[u]&&(h+=1,c+=n.prettyPrint(t.value[u],e+1,r),u+1<t.value.length&&(c+=","));o+=s+"Sub values: "+h+c}else{if(o+=s+"Value: ",t.type===n.Type.OID){var f=n.derToOid(t.value);o+=f,i.pki&&i.pki.oids&&f in i.pki.oids&&(o+=" ("+i.pki.oids[f]+") ")}if(t.type===n.Type.INTEGER)try{o+=n.derToInteger(t.value)}catch(e){o+="0x"+i.util.bytesToHex(t.value)}else if(t.type===n.Type.BITSTRING){if(t.value.length>1?o+="0x"+i.util.bytesToHex(t.value.slice(1)):o+="(none)",t.value.length>0){var l=t.value.charCodeAt(0);1==l?o+=" (1 unused bit shown)":l>1&&(o+=" ("+l+" unused bits shown)")}}else t.type===n.Type.OCTETSTRING?(a.test(t.value)||(o+="("+t.value+") "),o+="0x"+i.util.bytesToHex(t.value)):t.type===n.Type.UTF8?o+=i.util.decodeUtf8(t.value):t.type===n.Type.PRINTABLESTRING||t.type===n.Type.IA5String?o+=t.value:a.test(t.value)?o+="0x"+i.util.bytesToHex(t.value):0===t.value.length?o+="[null]":o+=t.value}return o}},78807:t=>{var e={};t.exports=e;var r={};e.encode=function(t,e,r){if("string"!=typeof e)throw new TypeError('"alphabet" must be a string.');if(void 0!==r&&"number"!=typeof r)throw new TypeError('"maxline" must be a number.');var i="";if(t instanceof Uint8Array){var n=0,o=e.length,s=e.charAt(0),a=[0];for(n=0;n<t.length;++n){for(var u=0,h=t[n];u<a.length;++u)h+=a[u]<<8,a[u]=h%o,h=h/o|0;for(;h>0;)a.push(h%o),h=h/o|0}for(n=0;0===t[n]&&n<t.length-1;++n)i+=s;for(n=a.length-1;n>=0;--n)i+=e[a[n]]}else i=function(t,e){var r=0,i=e.length,n=e.charAt(0),o=[0];for(r=0;r<t.length();++r){for(var s=0,a=t.at(r);s<o.length;++s)a+=o[s]<<8,o[s]=a%i,a=a/i|0;for(;a>0;)o.push(a%i),a=a/i|0}var u="";for(r=0;0===t.at(r)&&r<t.length()-1;++r)u+=n;for(r=o.length-1;r>=0;--r)u+=e[o[r]];return u}(t,e);if(r){var c=new RegExp(".{1,"+r+"}","g");i=i.match(c).join("\r\n")}return i},e.decode=function(t,e){if("string"!=typeof t)throw new TypeError('"input" must be a string.');if("string"!=typeof e)throw new TypeError('"alphabet" must be a string.');var i=r[e];if(!i){i=r[e]=[];for(var n=0;n<e.length;++n)i[e.charCodeAt(n)]=n}t=t.replace(/\s/g,"");var o=e.length,s=e.charAt(0),a=[0];for(n=0;n<t.length;n++){var u=i[t.charCodeAt(n)];if(void 0===u)return;for(var h=0,c=u;h<a.length;++h)c+=a[h]*o,a[h]=255&c,c>>=8;for(;c>0;)a.push(255&c),c>>=8}for(var f=0;t[f]===s&&f<t.length-1;++f)a.push(0);return"undefined"!=typeof Buffer?Buffer.from(a.reverse()):new Uint8Array(a.reverse())}},85649:(t,e,r)=>{var i=r(3832);r(97116),t.exports=i.cipher=i.cipher||{},i.cipher.algorithms=i.cipher.algorithms||{},i.cipher.createCipher=function(t,e){var r=t;if("string"==typeof r&&(r=i.cipher.getAlgorithm(r))&&(r=r()),!r)throw new Error("Unsupported algorithm: "+t);return new i.cipher.BlockCipher({algorithm:r,key:e,decrypt:!1})},i.cipher.createDecipher=function(t,e){var r=t;if("string"==typeof r&&(r=i.cipher.getAlgorithm(r))&&(r=r()),!r)throw new Error("Unsupported algorithm: "+t);return new i.cipher.BlockCipher({algorithm:r,key:e,decrypt:!0})},i.cipher.registerAlgorithm=function(t,e){t=t.toUpperCase(),i.cipher.algorithms[t]=e},i.cipher.getAlgorithm=function(t){return(t=t.toUpperCase())in i.cipher.algorithms?i.cipher.algorithms[t]:null};var n=i.cipher.BlockCipher=function(t){this.algorithm=t.algorithm,this.mode=this.algorithm.mode,this.blockSize=this.mode.blockSize,this._finish=!1,this._input=null,this.output=null,this._op=t.decrypt?this.mode.decrypt:this.mode.encrypt,this._decrypt=t.decrypt,this.algorithm.initialize(t)};n.prototype.start=function(t){t=t||{};var e={};for(var r in t)e[r]=t[r];e.decrypt=this._decrypt,this._finish=!1,this._input=i.util.createBuffer(),this.output=t.output||i.util.createBuffer(),this.mode.start(e)},n.prototype.update=function(t){for(t&&this._input.putBuffer(t);!this._op.call(this.mode,this._input,this.output,this._finish)&&!this._finish;);this._input.compact()},n.prototype.finish=function(t){!t||"ECB"!==this.mode.name&&"CBC"!==this.mode.name||(this.mode.pad=function(e){return t(this.blockSize,e,!1)},this.mode.unpad=function(e){return t(this.blockSize,e,!0)});var e={};return e.decrypt=this._decrypt,e.overflow=this._input.length()%this.blockSize,!(!this._decrypt&&this.mode.pad&&!this.mode.pad(this._input,e)||(this._finish=!0,this.update(),this._decrypt&&this.mode.unpad&&!this.mode.unpad(this.output,e)||this.mode.afterFinish&&!this.mode.afterFinish(this.output,e)))}},61967:(t,e,r)=>{var i=r(3832);r(97116),i.cipher=i.cipher||{};var n=t.exports=i.cipher.modes=i.cipher.modes||{};function o(t,e){if("string"==typeof t&&(t=i.util.createBuffer(t)),i.util.isArray(t)&&t.length>4){var r=t;t=i.util.createBuffer();for(var n=0;n<r.length;++n)t.putByte(r[n])}if(t.length()<e)throw new Error("Invalid IV length; got "+t.length()+" bytes and expected "+e+" bytes.");if(!i.util.isArray(t)){var o=[],s=e/4;for(n=0;n<s;++n)o.push(t.getInt32());t=o}return t}function s(t){t[t.length-1]=t[t.length-1]+1&4294967295}function a(t){return[t/4294967296|0,4294967295&t]}n.ecb=function(t){t=t||{},this.name="ECB",this.cipher=t.cipher,this.blockSize=t.blockSize||16,this._ints=this.blockSize/4,this._inBlock=new Array(this._ints),this._outBlock=new Array(this._ints)},n.ecb.prototype.start=function(t){},n.ecb.prototype.encrypt=function(t,e,r){if(t.length()<this.blockSize&&!(r&&t.length()>0))return!0;for(var i=0;i<this._ints;++i)this._inBlock[i]=t.getInt32();for(this.cipher.encrypt(this._inBlock,this._outBlock),i=0;i<this._ints;++i)e.putInt32(this._outBlock[i])},n.ecb.prototype.decrypt=function(t,e,r){if(t.length()<this.blockSize&&!(r&&t.length()>0))return!0;for(var i=0;i<this._ints;++i)this._inBlock[i]=t.getInt32();for(this.cipher.decrypt(this._inBlock,this._outBlock),i=0;i<this._ints;++i)e.putInt32(this._outBlock[i])},n.ecb.prototype.pad=function(t,e){var r=t.length()===this.blockSize?this.blockSize:this.blockSize-t.length();return t.fillWithByte(r,r),!0},n.ecb.prototype.unpad=function(t,e){if(e.overflow>0)return!1;var r=t.length(),i=t.at(r-1);return!(i>this.blockSize<<2||(t.truncate(i),0))},n.cbc=function(t){t=t||{},this.name="CBC",this.cipher=t.cipher,this.blockSize=t.blockSize||16,this._ints=this.blockSize/4,this._inBlock=new Array(this._ints),this._outBlock=new Array(this._ints)},n.cbc.prototype.start=function(t){if(null===t.iv){if(!this._prev)throw new Error("Invalid IV parameter.");this._iv=this._prev.slice(0)}else{if(!("iv"in t))throw new Error("Invalid IV parameter.");this._iv=o(t.iv,this.blockSize),this._prev=this._iv.slice(0)}},n.cbc.prototype.encrypt=function(t,e,r){if(t.length()<this.blockSize&&!(r&&t.length()>0))return!0;for(var i=0;i<this._ints;++i)this._inBlock[i]=this._prev[i]^t.getInt32();for(this.cipher.encrypt(this._inBlock,this._outBlock),i=0;i<this._ints;++i)e.putInt32(this._outBlock[i]);this._prev=this._outBlock},n.cbc.prototype.decrypt=function(t,e,r){if(t.length()<this.blockSize&&!(r&&t.length()>0))return!0;for(var i=0;i<this._ints;++i)this._inBlock[i]=t.getInt32();for(this.cipher.decrypt(this._inBlock,this._outBlock),i=0;i<this._ints;++i)e.putInt32(this._prev[i]^this._outBlock[i]);this._prev=this._inBlock.slice(0)},n.cbc.prototype.pad=function(t,e){var r=t.length()===this.blockSize?this.blockSize:this.blockSize-t.length();return t.fillWithByte(r,r),!0},n.cbc.prototype.unpad=function(t,e){if(e.overflow>0)return!1;var r=t.length(),i=t.at(r-1);return!(i>this.blockSize<<2||(t.truncate(i),0))},n.cfb=function(t){t=t||{},this.name="CFB",this.cipher=t.cipher,this.blockSize=t.blockSize||16,this._ints=this.blockSize/4,this._inBlock=null,this._outBlock=new Array(this._ints),this._partialBlock=new Array(this._ints),this._partialOutput=i.util.createBuffer(),this._partialBytes=0},n.cfb.prototype.start=function(t){if(!("iv"in t))throw new Error("Invalid IV parameter.");this._iv=o(t.iv,this.blockSize),this._inBlock=this._iv.slice(0),this._partialBytes=0},n.cfb.prototype.encrypt=function(t,e,r){var i=t.length();if(0===i)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),0===this._partialBytes&&i>=this.blockSize)for(var n=0;n<this._ints;++n)this._inBlock[n]=t.getInt32()^this._outBlock[n],e.putInt32(this._inBlock[n]);else{var o=(this.blockSize-i)%this.blockSize;for(o>0&&(o=this.blockSize-o),this._partialOutput.clear(),n=0;n<this._ints;++n)this._partialBlock[n]=t.getInt32()^this._outBlock[n],this._partialOutput.putInt32(this._partialBlock[n]);if(o>0)t.read-=this.blockSize;else for(n=0;n<this._ints;++n)this._inBlock[n]=this._partialBlock[n];if(this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),o>0&&!r)return e.putBytes(this._partialOutput.getBytes(o-this._partialBytes)),this._partialBytes=o,!0;e.putBytes(this._partialOutput.getBytes(i-this._partialBytes)),this._partialBytes=0}},n.cfb.prototype.decrypt=function(t,e,r){var i=t.length();if(0===i)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),0===this._partialBytes&&i>=this.blockSize)for(var n=0;n<this._ints;++n)this._inBlock[n]=t.getInt32(),e.putInt32(this._inBlock[n]^this._outBlock[n]);else{var o=(this.blockSize-i)%this.blockSize;for(o>0&&(o=this.blockSize-o),this._partialOutput.clear(),n=0;n<this._ints;++n)this._partialBlock[n]=t.getInt32(),this._partialOutput.putInt32(this._partialBlock[n]^this._outBlock[n]);if(o>0)t.read-=this.blockSize;else for(n=0;n<this._ints;++n)this._inBlock[n]=this._partialBlock[n];if(this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),o>0&&!r)return e.putBytes(this._partialOutput.getBytes(o-this._partialBytes)),this._partialBytes=o,!0;e.putBytes(this._partialOutput.getBytes(i-this._partialBytes)),this._partialBytes=0}},n.ofb=function(t){t=t||{},this.name="OFB",this.cipher=t.cipher,this.blockSize=t.blockSize||16,this._ints=this.blockSize/4,this._inBlock=null,this._outBlock=new Array(this._ints),this._partialOutput=i.util.createBuffer(),this._partialBytes=0},n.ofb.prototype.start=function(t){if(!("iv"in t))throw new Error("Invalid IV parameter.");this._iv=o(t.iv,this.blockSize),this._inBlock=this._iv.slice(0),this._partialBytes=0},n.ofb.prototype.encrypt=function(t,e,r){var i=t.length();if(0===t.length())return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),0===this._partialBytes&&i>=this.blockSize)for(var n=0;n<this._ints;++n)e.putInt32(t.getInt32()^this._outBlock[n]),this._inBlock[n]=this._outBlock[n];else{var o=(this.blockSize-i)%this.blockSize;for(o>0&&(o=this.blockSize-o),this._partialOutput.clear(),n=0;n<this._ints;++n)this._partialOutput.putInt32(t.getInt32()^this._outBlock[n]);if(o>0)t.read-=this.blockSize;else for(n=0;n<this._ints;++n)this._inBlock[n]=this._outBlock[n];if(this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),o>0&&!r)return e.putBytes(this._partialOutput.getBytes(o-this._partialBytes)),this._partialBytes=o,!0;e.putBytes(this._partialOutput.getBytes(i-this._partialBytes)),this._partialBytes=0}},n.ofb.prototype.decrypt=n.ofb.prototype.encrypt,n.ctr=function(t){t=t||{},this.name="CTR",this.cipher=t.cipher,this.blockSize=t.blockSize||16,this._ints=this.blockSize/4,this._inBlock=null,this._outBlock=new Array(this._ints),this._partialOutput=i.util.createBuffer(),this._partialBytes=0},n.ctr.prototype.start=function(t){if(!("iv"in t))throw new Error("Invalid IV parameter.");this._iv=o(t.iv,this.blockSize),this._inBlock=this._iv.slice(0),this._partialBytes=0},n.ctr.prototype.encrypt=function(t,e,r){var i=t.length();if(0===i)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),0===this._partialBytes&&i>=this.blockSize)for(var n=0;n<this._ints;++n)e.putInt32(t.getInt32()^this._outBlock[n]);else{var o=(this.blockSize-i)%this.blockSize;for(o>0&&(o=this.blockSize-o),this._partialOutput.clear(),n=0;n<this._ints;++n)this._partialOutput.putInt32(t.getInt32()^this._outBlock[n]);if(o>0&&(t.read-=this.blockSize),this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),o>0&&!r)return e.putBytes(this._partialOutput.getBytes(o-this._partialBytes)),this._partialBytes=o,!0;e.putBytes(this._partialOutput.getBytes(i-this._partialBytes)),this._partialBytes=0}s(this._inBlock)},n.ctr.prototype.decrypt=n.ctr.prototype.encrypt,n.gcm=function(t){t=t||{},this.name="GCM",this.cipher=t.cipher,this.blockSize=t.blockSize||16,this._ints=this.blockSize/4,this._inBlock=new Array(this._ints),this._outBlock=new Array(this._ints),this._partialOutput=i.util.createBuffer(),this._partialBytes=0,this._R=3774873600},n.gcm.prototype.start=function(t){if(!("iv"in t))throw new Error("Invalid IV parameter.");var e,r=i.util.createBuffer(t.iv);if(this._cipherLength=0,e="additionalData"in t?i.util.createBuffer(t.additionalData):i.util.createBuffer(),this._tagLength="tagLength"in t?t.tagLength:128,this._tag=null,t.decrypt&&(this._tag=i.util.createBuffer(t.tag).getBytes(),this._tag.length!==this._tagLength/8))throw new Error("Authentication tag does not match tag length.");this._hashBlock=new Array(this._ints),this.tag=null,this._hashSubkey=new Array(this._ints),this.cipher.encrypt([0,0,0,0],this._hashSubkey),this.componentBits=4,this._m=this.generateHashTable(this._hashSubkey,this.componentBits);var n=r.length();if(12===n)this._j0=[r.getInt32(),r.getInt32(),r.getInt32(),1];else{for(this._j0=[0,0,0,0];r.length()>0;)this._j0=this.ghash(this._hashSubkey,this._j0,[r.getInt32(),r.getInt32(),r.getInt32(),r.getInt32()]);this._j0=this.ghash(this._hashSubkey,this._j0,[0,0].concat(a(8*n)))}this._inBlock=this._j0.slice(0),s(this._inBlock),this._partialBytes=0,e=i.util.createBuffer(e),this._aDataLength=a(8*e.length());var o=e.length()%this.blockSize;for(o&&e.fillWithByte(0,this.blockSize-o),this._s=[0,0,0,0];e.length()>0;)this._s=this.ghash(this._hashSubkey,this._s,[e.getInt32(),e.getInt32(),e.getInt32(),e.getInt32()])},n.gcm.prototype.encrypt=function(t,e,r){var i=t.length();if(0===i)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),0===this._partialBytes&&i>=this.blockSize){for(var n=0;n<this._ints;++n)e.putInt32(this._outBlock[n]^=t.getInt32());this._cipherLength+=this.blockSize}else{var o=(this.blockSize-i)%this.blockSize;for(o>0&&(o=this.blockSize-o),this._partialOutput.clear(),n=0;n<this._ints;++n)this._partialOutput.putInt32(t.getInt32()^this._outBlock[n]);if(o<=0||r){if(r){var a=i%this.blockSize;this._cipherLength+=a,this._partialOutput.truncate(this.blockSize-a)}else this._cipherLength+=this.blockSize;for(n=0;n<this._ints;++n)this._outBlock[n]=this._partialOutput.getInt32();this._partialOutput.read-=this.blockSize}if(this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),o>0&&!r)return t.read-=this.blockSize,e.putBytes(this._partialOutput.getBytes(o-this._partialBytes)),this._partialBytes=o,!0;e.putBytes(this._partialOutput.getBytes(i-this._partialBytes)),this._partialBytes=0}this._s=this.ghash(this._hashSubkey,this._s,this._outBlock),s(this._inBlock)},n.gcm.prototype.decrypt=function(t,e,r){var i=t.length();if(i<this.blockSize&&!(r&&i>0))return!0;this.cipher.encrypt(this._inBlock,this._outBlock),s(this._inBlock),this._hashBlock[0]=t.getInt32(),this._hashBlock[1]=t.getInt32(),this._hashBlock[2]=t.getInt32(),this._hashBlock[3]=t.getInt32(),this._s=this.ghash(this._hashSubkey,this._s,this._hashBlock);for(var n=0;n<this._ints;++n)e.putInt32(this._outBlock[n]^this._hashBlock[n]);i<this.blockSize?this._cipherLength+=i%this.blockSize:this._cipherLength+=this.blockSize},n.gcm.prototype.afterFinish=function(t,e){var r=!0;e.decrypt&&e.overflow&&t.truncate(this.blockSize-e.overflow),this.tag=i.util.createBuffer();var n=this._aDataLength.concat(a(8*this._cipherLength));this._s=this.ghash(this._hashSubkey,this._s,n);var o=[];this.cipher.encrypt(this._j0,o);for(var s=0;s<this._ints;++s)this.tag.putInt32(this._s[s]^o[s]);return this.tag.truncate(this.tag.length()%(this._tagLength/8)),e.decrypt&&this.tag.bytes()!==this._tag&&(r=!1),r},n.gcm.prototype.multiply=function(t,e){for(var r=[0,0,0,0],i=e.slice(0),n=0;n<128;++n)t[n/32|0]&1<<31-n%32&&(r[0]^=i[0],r[1]^=i[1],r[2]^=i[2],r[3]^=i[3]),this.pow(i,i);return r},n.gcm.prototype.pow=function(t,e){for(var r=1&t[3],i=3;i>0;--i)e[i]=t[i]>>>1|(1&t[i-1])<<31;e[0]=t[0]>>>1,r&&(e[0]^=this._R)},n.gcm.prototype.tableMultiply=function(t){for(var e=[0,0,0,0],r=0;r<32;++r){var i=t[r/8|0]>>>4*(7-r%8)&15,n=this._m[r][i];e[0]^=n[0],e[1]^=n[1],e[2]^=n[2],e[3]^=n[3]}return e},n.gcm.prototype.ghash=function(t,e,r){return e[0]^=r[0],e[1]^=r[1],e[2]^=r[2],e[3]^=r[3],this.tableMultiply(e)},n.gcm.prototype.generateHashTable=function(t,e){for(var r=8/e,i=4*r,n=16*r,o=new Array(n),s=0;s<n;++s){var a=[0,0,0,0],u=(i-1-s%i)*e;a[s/i|0]=1<<e-1<<u,o[s]=this.generateSubHashTable(this.multiply(a,t),e)}return o},n.gcm.prototype.generateSubHashTable=function(t,e){var r=1<<e,i=r>>>1,n=new Array(r);n[i]=t.slice(0);for(var o=i>>>1;o>0;)this.pow(n[2*o],n[o]=[]),o>>=1;for(o=2;o<i;){for(var s=1;s<o;++s){var a=n[o],u=n[s];n[o+s]=[a[0]^u[0],a[1]^u[1],a[2]^u[2],a[3]^u[3]]}o*=2}for(n[0]=[0,0,0,0],o=i+1;o<r;++o){var h=n[o^i];n[o]=[t[0]^h[0],t[1]^h[1],t[2]^h[2],t[3]^h[3]]}return n}},33480:(t,e,r)=>{var i=r(3832);function n(t,e){i.cipher.registerAlgorithm(t,(function(){return new i.des.Algorithm(t,e)}))}r(85649),r(61967),r(97116),t.exports=i.des=i.des||{},i.des.startEncrypting=function(t,e,r,i){var n=p({key:t,output:r,decrypt:!1,mode:i||(null===e?"ECB":"CBC")});return n.start(e),n},i.des.createEncryptionCipher=function(t,e){return p({key:t,output:null,decrypt:!1,mode:e})},i.des.startDecrypting=function(t,e,r,i){var n=p({key:t,output:r,decrypt:!0,mode:i||(null===e?"ECB":"CBC")});return n.start(e),n},i.des.createDecryptionCipher=function(t,e){return p({key:t,output:null,decrypt:!0,mode:e})},i.des.Algorithm=function(t,e){var r=this;r.name=t,r.mode=new e({blockSize:8,cipher:{encrypt:function(t,e){return d(r._keys,t,e,!1)},decrypt:function(t,e){return d(r._keys,t,e,!0)}}}),r._init=!1},i.des.Algorithm.prototype.initialize=function(t){if(!this._init){var e=i.util.createBuffer(t.key);if(0===this.name.indexOf("3DES")&&24!==e.length())throw new Error("Invalid Triple-DES key size: "+8*e.length());this._keys=function(t){for(var e,r=[0,4,536870912,536870916,65536,65540,536936448,536936452,512,516,536871424,536871428,66048,66052,536936960,536936964],i=[0,1,1048576,1048577,67108864,67108865,68157440,68157441,256,257,1048832,1048833,67109120,67109121,68157696,68157697],n=[0,8,2048,2056,16777216,16777224,16779264,16779272,0,8,2048,2056,16777216,16777224,16779264,16779272],o=[0,2097152,134217728,136314880,8192,2105344,134225920,136323072,131072,2228224,134348800,136445952,139264,2236416,134356992,136454144],s=[0,262144,16,262160,0,262144,16,262160,4096,266240,4112,266256,4096,266240,4112,266256],a=[0,1024,32,1056,0,1024,32,1056,33554432,33555456,33554464,33555488,33554432,33555456,33554464,33555488],u=[0,268435456,524288,268959744,2,268435458,524290,268959746,0,268435456,524288,268959744,2,268435458,524290,268959746],h=[0,65536,2048,67584,536870912,536936448,536872960,536938496,131072,196608,133120,198656,537001984,537067520,537004032,537069568],c=[0,262144,0,262144,2,262146,2,262146,33554432,33816576,33554432,33816576,33554434,33816578,33554434,33816578],f=[0,268435456,8,268435464,0,268435456,8,268435464,1024,268436480,1032,268436488,1024,268436480,1032,268436488],l=[0,32,0,32,1048576,1048608,1048576,1048608,8192,8224,8192,8224,1056768,1056800,1056768,1056800],d=[0,16777216,512,16777728,2097152,18874368,2097664,18874880,67108864,83886080,67109376,83886592,69206016,85983232,69206528,85983744],p=[0,4096,134217728,134221824,524288,528384,134742016,134746112,16,4112,134217744,134221840,524304,528400,134742032,134746128],g=[0,4,256,260,0,4,256,260,1,5,257,261,1,5,257,261],y=t.length()>8?3:1,m=[],v=[0,0,1,1,1,1,1,1,0,1,1,1,1,1,1,0],b=0,w=0;w<y;w++){var _=t.getInt32(),S=t.getInt32();_^=(e=252645135&(_>>>4^S))<<4,_^=e=65535&((S^=e)>>>-16^_),_^=(e=858993459&(_>>>2^(S^=e<<-16)))<<2,_^=e=65535&((S^=e)>>>-16^_),_^=(e=1431655765&(_>>>1^(S^=e<<-16)))<<1,_^=e=16711935&((S^=e)>>>8^_),e=(_^=(e=1431655765&(_>>>1^(S^=e<<8)))<<1)<<8|(S^=e)>>>20&240,_=S<<24|S<<8&16711680|S>>>8&65280|S>>>24&240,S=e;for(var E=0;E<v.length;++E){v[E]?(_=_<<2|_>>>26,S=S<<2|S>>>26):(_=_<<1|_>>>27,S=S<<1|S>>>27);var M=r[(_&=-15)>>>28]|i[_>>>24&15]|n[_>>>20&15]|o[_>>>16&15]|s[_>>>12&15]|a[_>>>8&15]|u[_>>>4&15],A=h[(S&=-15)>>>28]|c[S>>>24&15]|f[S>>>20&15]|l[S>>>16&15]|d[S>>>12&15]|p[S>>>8&15]|g[S>>>4&15];e=65535&(A>>>16^M),m[b++]=M^e,m[b++]=A^e<<16}}return m}(e),this._init=!0}},n("DES-ECB",i.cipher.modes.ecb),n("DES-CBC",i.cipher.modes.cbc),n("DES-CFB",i.cipher.modes.cfb),n("DES-OFB",i.cipher.modes.ofb),n("DES-CTR",i.cipher.modes.ctr),n("3DES-ECB",i.cipher.modes.ecb),n("3DES-CBC",i.cipher.modes.cbc),n("3DES-CFB",i.cipher.modes.cfb),n("3DES-OFB",i.cipher.modes.ofb),n("3DES-CTR",i.cipher.modes.ctr);var o=[16843776,0,65536,16843780,16842756,66564,4,65536,1024,16843776,16843780,1024,16778244,16842756,16777216,4,1028,16778240,16778240,66560,66560,16842752,16842752,16778244,65540,16777220,16777220,65540,0,1028,66564,16777216,65536,16843780,4,16842752,16843776,16777216,16777216,1024,16842756,65536,66560,16777220,1024,4,16778244,66564,16843780,65540,16842752,16778244,16777220,1028,66564,16843776,1028,16778240,16778240,0,65540,66560,0,16842756],s=[-2146402272,-2147450880,32768,1081376,1048576,32,-2146435040,-2147450848,-2147483616,-2146402272,-2146402304,-2147483648,-2147450880,1048576,32,-2146435040,1081344,1048608,-2147450848,0,-2147483648,32768,1081376,-2146435072,1048608,-2147483616,0,1081344,32800,-2146402304,-2146435072,32800,0,1081376,-2146435040,1048576,-2147450848,-2146435072,-2146402304,32768,-2146435072,-2147450880,32,-2146402272,1081376,32,32768,-2147483648,32800,-2146402304,1048576,-2147483616,1048608,-2147450848,-2147483616,1048608,1081344,0,-2147450880,32800,-2147483648,-2146435040,-2146402272,1081344],a=[520,134349312,0,134348808,134218240,0,131592,134218240,131080,134217736,134217736,131072,134349320,131080,134348800,520,134217728,8,134349312,512,131584,134348800,134348808,131592,134218248,131584,131072,134218248,8,134349320,512,134217728,134349312,134217728,131080,520,131072,134349312,134218240,0,512,131080,134349320,134218240,134217736,512,0,134348808,134218248,131072,134217728,134349320,8,131592,131584,134217736,134348800,134218248,520,134348800,131592,8,134348808,131584],u=[8396801,8321,8321,128,8396928,8388737,8388609,8193,0,8396800,8396800,8396929,129,0,8388736,8388609,1,8192,8388608,8396801,128,8388608,8193,8320,8388737,1,8320,8388736,8192,8396928,8396929,129,8388736,8388609,8396800,8396929,129,0,0,8396800,8320,8388736,8388737,1,8396801,8321,8321,128,8396929,129,1,8192,8388609,8193,8396928,8388737,8193,8320,8388608,8396801,128,8388608,8192,8396928],h=[256,34078976,34078720,1107296512,524288,256,1073741824,34078720,1074266368,524288,33554688,1074266368,1107296512,1107820544,524544,1073741824,33554432,1074266112,1074266112,0,1073742080,1107820800,1107820800,33554688,1107820544,1073742080,0,1107296256,34078976,33554432,1107296256,524544,524288,1107296512,256,33554432,1073741824,34078720,1107296512,1074266368,33554688,1073741824,1107820544,34078976,1074266368,256,33554432,1107820544,1107820800,524544,1107296256,1107820800,34078720,0,1074266112,1107296256,524544,33554688,1073742080,524288,0,1074266112,34078976,1073742080],c=[536870928,541065216,16384,541081616,541065216,16,541081616,4194304,536887296,4210704,4194304,536870928,4194320,536887296,536870912,16400,0,4194320,536887312,16384,4210688,536887312,16,541065232,541065232,0,4210704,541081600,16400,4210688,541081600,536870912,536887296,16,541065232,4210688,541081616,4194304,16400,536870928,4194304,536887296,536870912,16400,536870928,541081616,4210688,541065216,4210704,541081600,0,541065232,16,16384,541065216,4210704,16384,4194320,536887312,0,541081600,536870912,4194320,536887312],f=[2097152,69206018,67110914,0,2048,67110914,2099202,69208064,69208066,2097152,0,67108866,2,67108864,69206018,2050,67110912,2099202,2097154,67110912,67108866,69206016,69208064,2097154,69206016,2048,2050,69208066,2099200,2,67108864,2099200,67108864,2099200,2097152,67110914,67110914,69206018,69206018,2,2097154,67108864,67110912,2097152,69208064,2050,2099202,69208064,2050,67108866,69208066,69206016,2099200,0,2,69208066,0,2099202,69206016,2048,67108866,67110912,2048,2097154],l=[268439616,4096,262144,268701760,268435456,268439616,64,268435456,262208,268697600,268701760,266240,268701696,266304,4096,64,268697600,268435520,268439552,4160,266240,262208,268697664,268701696,4160,0,0,268697664,268435520,268439552,266304,262144,266304,262144,268701696,4096,64,268697664,4096,266304,268439552,64,268435520,268697600,268697664,268435456,262144,268439616,0,268701760,262208,268435520,268697600,268439552,268439616,0,268701760,266240,266240,4160,4160,262208,268435456,268701696];function d(t,e,r,i){var n,d,p=32===t.length?3:9;n=3===p?i?[30,-2,-2]:[0,32,2]:i?[94,62,-2,32,64,2,30,-2,-2]:[0,32,2,62,30,-2,64,96,2];var g=e[0],y=e[1];g^=(d=252645135&(g>>>4^y))<<4,g^=(d=65535&(g>>>16^(y^=d)))<<16,g^=d=858993459&((y^=d)>>>2^g),g^=d=16711935&((y^=d<<2)>>>8^g),g=(g^=(d=1431655765&(g>>>1^(y^=d<<8)))<<1)<<1|g>>>31,y=(y^=d)<<1|y>>>31;for(var m=0;m<p;m+=3){for(var v=n[m+1],b=n[m+2],w=n[m];w!=v;w+=b){var _=y^t[w],S=(y>>>4|y<<28)^t[w+1];d=g,g=y,y=d^(s[_>>>24&63]|u[_>>>16&63]|c[_>>>8&63]|l[63&_]|o[S>>>24&63]|a[S>>>16&63]|h[S>>>8&63]|f[63&S])}d=g,g=y,y=d}y=y>>>1|y<<31,y^=d=1431655765&((g=g>>>1|g<<31)>>>1^y),y^=(d=16711935&(y>>>8^(g^=d<<1)))<<8,y^=(d=858993459&(y>>>2^(g^=d)))<<2,y^=d=65535&((g^=d)>>>16^y),y^=d=252645135&((g^=d<<16)>>>4^y),g^=d<<4,r[0]=g,r[1]=y}function p(t){var e,r="DES-"+((t=t||{}).mode||"CBC").toUpperCase(),n=(e=t.decrypt?i.cipher.createDecipher(r,t.key):i.cipher.createCipher(r,t.key)).start;return e.start=function(t,r){var o=null;r instanceof i.util.ByteBuffer&&(o=r,r={}),(r=r||{}).output=o,r.iv=t,n.call(e,r)},e}},3832:t=>{t.exports={options:{usePureJavaScript:!1}}},36607:(t,e,r)=>{var i=r(3832);r(28991),r(97116),(t.exports=i.hmac=i.hmac||{}).create=function(){var t=null,e=null,r=null,n=null,o={start:function(o,s){if(null!==o)if("string"==typeof o){if(!((o=o.toLowerCase())in i.md.algorithms))throw new Error('Unknown hash algorithm "'+o+'"');e=i.md.algorithms[o].create()}else e=o;if(null===s)s=t;else{if("string"==typeof s)s=i.util.createBuffer(s);else if(i.util.isArray(s)){var a=s;s=i.util.createBuffer();for(var u=0;u<a.length;++u)s.putByte(a[u])}var h=s.length();for(h>e.blockLength&&(e.start(),e.update(s.bytes()),s=e.digest()),r=i.util.createBuffer(),n=i.util.createBuffer(),h=s.length(),u=0;u<h;++u)a=s.at(u),r.putByte(54^a),n.putByte(92^a);if(h<e.blockLength)for(a=e.blockLength-h,u=0;u<a;++u)r.putByte(54),n.putByte(92);t=s,r=r.bytes(),n=n.bytes()}e.start(),e.update(r)},update:function(t){e.update(t)},getMac:function(){var t=e.digest().bytes();return e.start(),e.update(n),e.update(t),e.digest()}};return o.digest=o.getMac,o}},15764:(t,e,r)=>{var i,n=r(3832);function o(t,e,r){this.data=[],null!=t&&("number"==typeof t?this.fromNumber(t,e,r):null==e&&"string"!=typeof t?this.fromString(t,256):this.fromString(t,e))}function s(){return new o(null)}function a(t,e,r,i,n,o){for(var s=16383&e,a=e>>14;--o>=0;){var u=16383&this.data[t],h=this.data[t++]>>14,c=a*u+h*s;n=((u=s*u+((16383&c)<<14)+r.data[i]+n)>>28)+(c>>14)+a*h,r.data[i++]=268435455&u}return n}t.exports=n.jsbn=n.jsbn||{},n.jsbn.BigInteger=o,"undefined"==typeof navigator?(o.prototype.am=a,i=28):"Microsoft Internet Explorer"==navigator.appName?(o.prototype.am=function(t,e,r,i,n,o){for(var s=32767&e,a=e>>15;--o>=0;){var u=32767&this.data[t],h=this.data[t++]>>15,c=a*u+h*s;n=((u=s*u+((32767&c)<<15)+r.data[i]+(1073741823&n))>>>30)+(c>>>15)+a*h+(n>>>30),r.data[i++]=1073741823&u}return n},i=30):"Netscape"!=navigator.appName?(o.prototype.am=function(t,e,r,i,n,o){for(;--o>=0;){var s=e*this.data[t++]+r.data[i]+n;n=Math.floor(s/67108864),r.data[i++]=67108863&s}return n},i=26):(o.prototype.am=a,i=28),o.prototype.DB=i,o.prototype.DM=(1<<i)-1,o.prototype.DV=1<<i,o.prototype.FV=Math.pow(2,52),o.prototype.F1=52-i,o.prototype.F2=2*i-52;var u,h,c=new Array;for(u="0".charCodeAt(0),h=0;h<=9;++h)c[u++]=h;for(u="a".charCodeAt(0),h=10;h<36;++h)c[u++]=h;for(u="A".charCodeAt(0),h=10;h<36;++h)c[u++]=h;function f(t){return"0123456789abcdefghijklmnopqrstuvwxyz".charAt(t)}function l(t,e){var r=c[t.charCodeAt(e)];return null==r?-1:r}function d(t){var e=s();return e.fromInt(t),e}function p(t){var e,r=1;return 0!=(e=t>>>16)&&(t=e,r+=16),0!=(e=t>>8)&&(t=e,r+=8),0!=(e=t>>4)&&(t=e,r+=4),0!=(e=t>>2)&&(t=e,r+=2),0!=(e=t>>1)&&(t=e,r+=1),r}function g(t){this.m=t}function y(t){this.m=t,this.mp=t.invDigit(),this.mpl=32767&this.mp,this.mph=this.mp>>15,this.um=(1<<t.DB-15)-1,this.mt2=2*t.t}function m(t,e){return t&e}function v(t,e){return t|e}function b(t,e){return t^e}function w(t,e){return t&~e}function _(t){if(0==t)return-1;var e=0;return 0==(65535&t)&&(t>>=16,e+=16),0==(255&t)&&(t>>=8,e+=8),0==(15&t)&&(t>>=4,e+=4),0==(3&t)&&(t>>=2,e+=2),0==(1&t)&&++e,e}function S(t){for(var e=0;0!=t;)t&=t-1,++e;return e}function E(){}function M(t){return t}function A(t){this.r2=s(),this.q3=s(),o.ONE.dlShiftTo(2*t.t,this.r2),this.mu=this.r2.divide(t),this.m=t}g.prototype.convert=function(t){return t.s<0||t.compareTo(this.m)>=0?t.mod(this.m):t},g.prototype.revert=function(t){return t},g.prototype.reduce=function(t){t.divRemTo(this.m,null,t)},g.prototype.mulTo=function(t,e,r){t.multiplyTo(e,r),this.reduce(r)},g.prototype.sqrTo=function(t,e){t.squareTo(e),this.reduce(e)},y.prototype.convert=function(t){var e=s();return t.abs().dlShiftTo(this.m.t,e),e.divRemTo(this.m,null,e),t.s<0&&e.compareTo(o.ZERO)>0&&this.m.subTo(e,e),e},y.prototype.revert=function(t){var e=s();return t.copyTo(e),this.reduce(e),e},y.prototype.reduce=function(t){for(;t.t<=this.mt2;)t.data[t.t++]=0;for(var e=0;e<this.m.t;++e){var r=32767&t.data[e],i=r*this.mpl+((r*this.mph+(t.data[e]>>15)*this.mpl&this.um)<<15)&t.DM;for(r=e+this.m.t,t.data[r]+=this.m.am(0,i,t,e,0,this.m.t);t.data[r]>=t.DV;)t.data[r]-=t.DV,t.data[++r]++}t.clamp(),t.drShiftTo(this.m.t,t),t.compareTo(this.m)>=0&&t.subTo(this.m,t)},y.prototype.mulTo=function(t,e,r){t.multiplyTo(e,r),this.reduce(r)},y.prototype.sqrTo=function(t,e){t.squareTo(e),this.reduce(e)},o.prototype.copyTo=function(t){for(var e=this.t-1;e>=0;--e)t.data[e]=this.data[e];t.t=this.t,t.s=this.s},o.prototype.fromInt=function(t){this.t=1,this.s=t<0?-1:0,t>0?this.data[0]=t:t<-1?this.data[0]=t+this.DV:this.t=0},o.prototype.fromString=function(t,e){var r;if(16==e)r=4;else if(8==e)r=3;else if(256==e)r=8;else if(2==e)r=1;else if(32==e)r=5;else{if(4!=e)return void this.fromRadix(t,e);r=2}this.t=0,this.s=0;for(var i=t.length,n=!1,s=0;--i>=0;){var a=8==r?255&t[i]:l(t,i);a<0?"-"==t.charAt(i)&&(n=!0):(n=!1,0==s?this.data[this.t++]=a:s+r>this.DB?(this.data[this.t-1]|=(a&(1<<this.DB-s)-1)<<s,this.data[this.t++]=a>>this.DB-s):this.data[this.t-1]|=a<<s,(s+=r)>=this.DB&&(s-=this.DB))}8==r&&0!=(128&t[0])&&(this.s=-1,s>0&&(this.data[this.t-1]|=(1<<this.DB-s)-1<<s)),this.clamp(),n&&o.ZERO.subTo(this,this)},o.prototype.clamp=function(){for(var t=this.s&this.DM;this.t>0&&this.data[this.t-1]==t;)--this.t},o.prototype.dlShiftTo=function(t,e){var r;for(r=this.t-1;r>=0;--r)e.data[r+t]=this.data[r];for(r=t-1;r>=0;--r)e.data[r]=0;e.t=this.t+t,e.s=this.s},o.prototype.drShiftTo=function(t,e){for(var r=t;r<this.t;++r)e.data[r-t]=this.data[r];e.t=Math.max(this.t-t,0),e.s=this.s},o.prototype.lShiftTo=function(t,e){var r,i=t%this.DB,n=this.DB-i,o=(1<<n)-1,s=Math.floor(t/this.DB),a=this.s<<i&this.DM;for(r=this.t-1;r>=0;--r)e.data[r+s+1]=this.data[r]>>n|a,a=(this.data[r]&o)<<i;for(r=s-1;r>=0;--r)e.data[r]=0;e.data[s]=a,e.t=this.t+s+1,e.s=this.s,e.clamp()},o.prototype.rShiftTo=function(t,e){e.s=this.s;var r=Math.floor(t/this.DB);if(r>=this.t)e.t=0;else{var i=t%this.DB,n=this.DB-i,o=(1<<i)-1;e.data[0]=this.data[r]>>i;for(var s=r+1;s<this.t;++s)e.data[s-r-1]|=(this.data[s]&o)<<n,e.data[s-r]=this.data[s]>>i;i>0&&(e.data[this.t-r-1]|=(this.s&o)<<n),e.t=this.t-r,e.clamp()}},o.prototype.subTo=function(t,e){for(var r=0,i=0,n=Math.min(t.t,this.t);r<n;)i+=this.data[r]-t.data[r],e.data[r++]=i&this.DM,i>>=this.DB;if(t.t<this.t){for(i-=t.s;r<this.t;)i+=this.data[r],e.data[r++]=i&this.DM,i>>=this.DB;i+=this.s}else{for(i+=this.s;r<t.t;)i-=t.data[r],e.data[r++]=i&this.DM,i>>=this.DB;i-=t.s}e.s=i<0?-1:0,i<-1?e.data[r++]=this.DV+i:i>0&&(e.data[r++]=i),e.t=r,e.clamp()},o.prototype.multiplyTo=function(t,e){var r=this.abs(),i=t.abs(),n=r.t;for(e.t=n+i.t;--n>=0;)e.data[n]=0;for(n=0;n<i.t;++n)e.data[n+r.t]=r.am(0,i.data[n],e,n,0,r.t);e.s=0,e.clamp(),this.s!=t.s&&o.ZERO.subTo(e,e)},o.prototype.squareTo=function(t){for(var e=this.abs(),r=t.t=2*e.t;--r>=0;)t.data[r]=0;for(r=0;r<e.t-1;++r){var i=e.am(r,e.data[r],t,2*r,0,1);(t.data[r+e.t]+=e.am(r+1,2*e.data[r],t,2*r+1,i,e.t-r-1))>=e.DV&&(t.data[r+e.t]-=e.DV,t.data[r+e.t+1]=1)}t.t>0&&(t.data[t.t-1]+=e.am(r,e.data[r],t,2*r,0,1)),t.s=0,t.clamp()},o.prototype.divRemTo=function(t,e,r){var i=t.abs();if(!(i.t<=0)){var n=this.abs();if(n.t<i.t)return null!=e&&e.fromInt(0),void(null!=r&&this.copyTo(r));null==r&&(r=s());var a=s(),u=this.s,h=t.s,c=this.DB-p(i.data[i.t-1]);c>0?(i.lShiftTo(c,a),n.lShiftTo(c,r)):(i.copyTo(a),n.copyTo(r));var f=a.t,l=a.data[f-1];if(0!=l){var d=l*(1<<this.F1)+(f>1?a.data[f-2]>>this.F2:0),g=this.FV/d,y=(1<<this.F1)/d,m=1<<this.F2,v=r.t,b=v-f,w=null==e?s():e;for(a.dlShiftTo(b,w),r.compareTo(w)>=0&&(r.data[r.t++]=1,r.subTo(w,r)),o.ONE.dlShiftTo(f,w),w.subTo(a,a);a.t<f;)a.data[a.t++]=0;for(;--b>=0;){var _=r.data[--v]==l?this.DM:Math.floor(r.data[v]*g+(r.data[v-1]+m)*y);if((r.data[v]+=a.am(0,_,r,b,0,f))<_)for(a.dlShiftTo(b,w),r.subTo(w,r);r.data[v]<--_;)r.subTo(w,r)}null!=e&&(r.drShiftTo(f,e),u!=h&&o.ZERO.subTo(e,e)),r.t=f,r.clamp(),c>0&&r.rShiftTo(c,r),u<0&&o.ZERO.subTo(r,r)}}},o.prototype.invDigit=function(){if(this.t<1)return 0;var t=this.data[0];if(0==(1&t))return 0;var e=3&t;return(e=(e=(e=(e=e*(2-(15&t)*e)&15)*(2-(255&t)*e)&255)*(2-((65535&t)*e&65535))&65535)*(2-t*e%this.DV)%this.DV)>0?this.DV-e:-e},o.prototype.isEven=function(){return 0==(this.t>0?1&this.data[0]:this.s)},o.prototype.exp=function(t,e){if(t>4294967295||t<1)return o.ONE;var r=s(),i=s(),n=e.convert(this),a=p(t)-1;for(n.copyTo(r);--a>=0;)if(e.sqrTo(r,i),(t&1<<a)>0)e.mulTo(i,n,r);else{var u=r;r=i,i=u}return e.revert(r)},o.prototype.toString=function(t){if(this.s<0)return"-"+this.negate().toString(t);var e;if(16==t)e=4;else if(8==t)e=3;else if(2==t)e=1;else if(32==t)e=5;else{if(4!=t)return this.toRadix(t);e=2}var r,i=(1<<e)-1,n=!1,o="",s=this.t,a=this.DB-s*this.DB%e;if(s-- >0)for(a<this.DB&&(r=this.data[s]>>a)>0&&(n=!0,o=f(r));s>=0;)a<e?(r=(this.data[s]&(1<<a)-1)<<e-a,r|=this.data[--s]>>(a+=this.DB-e)):(r=this.data[s]>>(a-=e)&i,a<=0&&(a+=this.DB,--s)),r>0&&(n=!0),n&&(o+=f(r));return n?o:"0"},o.prototype.negate=function(){var t=s();return o.ZERO.subTo(this,t),t},o.prototype.abs=function(){return this.s<0?this.negate():this},o.prototype.compareTo=function(t){var e=this.s-t.s;if(0!=e)return e;var r=this.t;if(0!=(e=r-t.t))return this.s<0?-e:e;for(;--r>=0;)if(0!=(e=this.data[r]-t.data[r]))return e;return 0},o.prototype.bitLength=function(){return this.t<=0?0:this.DB*(this.t-1)+p(this.data[this.t-1]^this.s&this.DM)},o.prototype.mod=function(t){var e=s();return this.abs().divRemTo(t,null,e),this.s<0&&e.compareTo(o.ZERO)>0&&t.subTo(e,e),e},o.prototype.modPowInt=function(t,e){var r;return r=t<256||e.isEven()?new g(e):new y(e),this.exp(t,r)},o.ZERO=d(0),o.ONE=d(1),E.prototype.convert=M,E.prototype.revert=M,E.prototype.mulTo=function(t,e,r){t.multiplyTo(e,r)},E.prototype.sqrTo=function(t,e){t.squareTo(e)},A.prototype.convert=function(t){if(t.s<0||t.t>2*this.m.t)return t.mod(this.m);if(t.compareTo(this.m)<0)return t;var e=s();return t.copyTo(e),this.reduce(e),e},A.prototype.revert=function(t){return t},A.prototype.reduce=function(t){for(t.drShiftTo(this.m.t-1,this.r2),t.t>this.m.t+1&&(t.t=this.m.t+1,t.clamp()),this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3),this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);t.compareTo(this.r2)<0;)t.dAddOffset(1,this.m.t+1);for(t.subTo(this.r2,t);t.compareTo(this.m)>=0;)t.subTo(this.m,t)},A.prototype.mulTo=function(t,e,r){t.multiplyTo(e,r),this.reduce(r)},A.prototype.sqrTo=function(t,e){t.squareTo(e),this.reduce(e)};var C=[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509],k=(1<<26)/C[C.length-1];o.prototype.chunkSize=function(t){return Math.floor(Math.LN2*this.DB/Math.log(t))},o.prototype.toRadix=function(t){if(null==t&&(t=10),0==this.signum()||t<2||t>36)return"0";var e=this.chunkSize(t),r=Math.pow(t,e),i=d(r),n=s(),o=s(),a="";for(this.divRemTo(i,n,o);n.signum()>0;)a=(r+o.intValue()).toString(t).substr(1)+a,n.divRemTo(i,n,o);return o.intValue().toString(t)+a},o.prototype.fromRadix=function(t,e){this.fromInt(0),null==e&&(e=10);for(var r=this.chunkSize(e),i=Math.pow(e,r),n=!1,s=0,a=0,u=0;u<t.length;++u){var h=l(t,u);h<0?"-"==t.charAt(u)&&0==this.signum()&&(n=!0):(a=e*a+h,++s>=r&&(this.dMultiply(i),this.dAddOffset(a,0),s=0,a=0))}s>0&&(this.dMultiply(Math.pow(e,s)),this.dAddOffset(a,0)),n&&o.ZERO.subTo(this,this)},o.prototype.fromNumber=function(t,e,r){if("number"==typeof e)if(t<2)this.fromInt(1);else for(this.fromNumber(t,r),this.testBit(t-1)||this.bitwiseTo(o.ONE.shiftLeft(t-1),v,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(e);)this.dAddOffset(2,0),this.bitLength()>t&&this.subTo(o.ONE.shiftLeft(t-1),this);else{var i=new Array,n=7&t;i.length=1+(t>>3),e.nextBytes(i),n>0?i[0]&=(1<<n)-1:i[0]=0,this.fromString(i,256)}},o.prototype.bitwiseTo=function(t,e,r){var i,n,o=Math.min(t.t,this.t);for(i=0;i<o;++i)r.data[i]=e(this.data[i],t.data[i]);if(t.t<this.t){for(n=t.s&this.DM,i=o;i<this.t;++i)r.data[i]=e(this.data[i],n);r.t=this.t}else{for(n=this.s&this.DM,i=o;i<t.t;++i)r.data[i]=e(n,t.data[i]);r.t=t.t}r.s=e(this.s,t.s),r.clamp()},o.prototype.changeBit=function(t,e){var r=o.ONE.shiftLeft(t);return this.bitwiseTo(r,e,r),r},o.prototype.addTo=function(t,e){for(var r=0,i=0,n=Math.min(t.t,this.t);r<n;)i+=this.data[r]+t.data[r],e.data[r++]=i&this.DM,i>>=this.DB;if(t.t<this.t){for(i+=t.s;r<this.t;)i+=this.data[r],e.data[r++]=i&this.DM,i>>=this.DB;i+=this.s}else{for(i+=this.s;r<t.t;)i+=t.data[r],e.data[r++]=i&this.DM,i>>=this.DB;i+=t.s}e.s=i<0?-1:0,i>0?e.data[r++]=i:i<-1&&(e.data[r++]=this.DV+i),e.t=r,e.clamp()},o.prototype.dMultiply=function(t){this.data[this.t]=this.am(0,t-1,this,0,0,this.t),++this.t,this.clamp()},o.prototype.dAddOffset=function(t,e){if(0!=t){for(;this.t<=e;)this.data[this.t++]=0;for(this.data[e]+=t;this.data[e]>=this.DV;)this.data[e]-=this.DV,++e>=this.t&&(this.data[this.t++]=0),++this.data[e]}},o.prototype.multiplyLowerTo=function(t,e,r){var i,n=Math.min(this.t+t.t,e);for(r.s=0,r.t=n;n>0;)r.data[--n]=0;for(i=r.t-this.t;n<i;++n)r.data[n+this.t]=this.am(0,t.data[n],r,n,0,this.t);for(i=Math.min(t.t,e);n<i;++n)this.am(0,t.data[n],r,n,0,e-n);r.clamp()},o.prototype.multiplyUpperTo=function(t,e,r){--e;var i=r.t=this.t+t.t-e;for(r.s=0;--i>=0;)r.data[i]=0;for(i=Math.max(e-this.t,0);i<t.t;++i)r.data[this.t+i-e]=this.am(e-i,t.data[i],r,0,0,this.t+i-e);r.clamp(),r.drShiftTo(1,r)},o.prototype.modInt=function(t){if(t<=0)return 0;var e=this.DV%t,r=this.s<0?t-1:0;if(this.t>0)if(0==e)r=this.data[0]%t;else for(var i=this.t-1;i>=0;--i)r=(e*r+this.data[i])%t;return r},o.prototype.millerRabin=function(t){var e=this.subtract(o.ONE),r=e.getLowestSetBit();if(r<=0)return!1;for(var i,n=e.shiftRight(r),s={nextBytes:function(t){for(var e=0;e<t.length;++e)t[e]=Math.floor(256*Math.random())}},a=0;a<t;++a){do{i=new o(this.bitLength(),s)}while(i.compareTo(o.ONE)<=0||i.compareTo(e)>=0);var u=i.modPow(n,this);if(0!=u.compareTo(o.ONE)&&0!=u.compareTo(e)){for(var h=1;h++<r&&0!=u.compareTo(e);)if(0==(u=u.modPowInt(2,this)).compareTo(o.ONE))return!1;if(0!=u.compareTo(e))return!1}}return!0},o.prototype.clone=function(){var t=s();return this.copyTo(t),t},o.prototype.intValue=function(){if(this.s<0){if(1==this.t)return this.data[0]-this.DV;if(0==this.t)return-1}else{if(1==this.t)return this.data[0];if(0==this.t)return 0}return(this.data[1]&(1<<32-this.DB)-1)<<this.DB|this.data[0]},o.prototype.byteValue=function(){return 0==this.t?this.s:this.data[0]<<24>>24},o.prototype.shortValue=function(){return 0==this.t?this.s:this.data[0]<<16>>16},o.prototype.signum=function(){return this.s<0?-1:this.t<=0||1==this.t&&this.data[0]<=0?0:1},o.prototype.toByteArray=function(){var t=this.t,e=new Array;e[0]=this.s;var r,i=this.DB-t*this.DB%8,n=0;if(t-- >0)for(i<this.DB&&(r=this.data[t]>>i)!=(this.s&this.DM)>>i&&(e[n++]=r|this.s<<this.DB-i);t>=0;)i<8?(r=(this.data[t]&(1<<i)-1)<<8-i,r|=this.data[--t]>>(i+=this.DB-8)):(r=this.data[t]>>(i-=8)&255,i<=0&&(i+=this.DB,--t)),0!=(128&r)&&(r|=-256),0==n&&(128&this.s)!=(128&r)&&++n,(n>0||r!=this.s)&&(e[n++]=r);return e},o.prototype.equals=function(t){return 0==this.compareTo(t)},o.prototype.min=function(t){return this.compareTo(t)<0?this:t},o.prototype.max=function(t){return this.compareTo(t)>0?this:t},o.prototype.and=function(t){var e=s();return this.bitwiseTo(t,m,e),e},o.prototype.or=function(t){var e=s();return this.bitwiseTo(t,v,e),e},o.prototype.xor=function(t){var e=s();return this.bitwiseTo(t,b,e),e},o.prototype.andNot=function(t){var e=s();return this.bitwiseTo(t,w,e),e},o.prototype.not=function(){for(var t=s(),e=0;e<this.t;++e)t.data[e]=this.DM&~this.data[e];return t.t=this.t,t.s=~this.s,t},o.prototype.shiftLeft=function(t){var e=s();return t<0?this.rShiftTo(-t,e):this.lShiftTo(t,e),e},o.prototype.shiftRight=function(t){var e=s();return t<0?this.lShiftTo(-t,e):this.rShiftTo(t,e),e},o.prototype.getLowestSetBit=function(){for(var t=0;t<this.t;++t)if(0!=this.data[t])return t*this.DB+_(this.data[t]);return this.s<0?this.t*this.DB:-1},o.prototype.bitCount=function(){for(var t=0,e=this.s&this.DM,r=0;r<this.t;++r)t+=S(this.data[r]^e);return t},o.prototype.testBit=function(t){var e=Math.floor(t/this.DB);return e>=this.t?0!=this.s:0!=(this.data[e]&1<<t%this.DB)},o.prototype.setBit=function(t){return this.changeBit(t,v)},o.prototype.clearBit=function(t){return this.changeBit(t,w)},o.prototype.flipBit=function(t){return this.changeBit(t,b)},o.prototype.add=function(t){var e=s();return this.addTo(t,e),e},o.prototype.subtract=function(t){var e=s();return this.subTo(t,e),e},o.prototype.multiply=function(t){var e=s();return this.multiplyTo(t,e),e},o.prototype.divide=function(t){var e=s();return this.divRemTo(t,e,null),e},o.prototype.remainder=function(t){var e=s();return this.divRemTo(t,null,e),e},o.prototype.divideAndRemainder=function(t){var e=s(),r=s();return this.divRemTo(t,e,r),new Array(e,r)},o.prototype.modPow=function(t,e){var r,i,n=t.bitLength(),o=d(1);if(n<=0)return o;r=n<18?1:n<48?3:n<144?4:n<768?5:6,i=n<8?new g(e):e.isEven()?new A(e):new y(e);var a=new Array,u=3,h=r-1,c=(1<<r)-1;if(a[1]=i.convert(this),r>1){var f=s();for(i.sqrTo(a[1],f);u<=c;)a[u]=s(),i.mulTo(f,a[u-2],a[u]),u+=2}var l,m,v=t.t-1,b=!0,w=s();for(n=p(t.data[v])-1;v>=0;){for(n>=h?l=t.data[v]>>n-h&c:(l=(t.data[v]&(1<<n+1)-1)<<h-n,v>0&&(l|=t.data[v-1]>>this.DB+n-h)),u=r;0==(1&l);)l>>=1,--u;if((n-=u)<0&&(n+=this.DB,--v),b)a[l].copyTo(o),b=!1;else{for(;u>1;)i.sqrTo(o,w),i.sqrTo(w,o),u-=2;u>0?i.sqrTo(o,w):(m=o,o=w,w=m),i.mulTo(w,a[l],o)}for(;v>=0&&0==(t.data[v]&1<<n);)i.sqrTo(o,w),m=o,o=w,w=m,--n<0&&(n=this.DB-1,--v)}return i.revert(o)},o.prototype.modInverse=function(t){var e=t.isEven();if(this.isEven()&&e||0==t.signum())return o.ZERO;for(var r=t.clone(),i=this.clone(),n=d(1),s=d(0),a=d(0),u=d(1);0!=r.signum();){for(;r.isEven();)r.rShiftTo(1,r),e?(n.isEven()&&s.isEven()||(n.addTo(this,n),s.subTo(t,s)),n.rShiftTo(1,n)):s.isEven()||s.subTo(t,s),s.rShiftTo(1,s);for(;i.isEven();)i.rShiftTo(1,i),e?(a.isEven()&&u.isEven()||(a.addTo(this,a),u.subTo(t,u)),a.rShiftTo(1,a)):u.isEven()||u.subTo(t,u),u.rShiftTo(1,u);r.compareTo(i)>=0?(r.subTo(i,r),e&&n.subTo(a,n),s.subTo(u,s)):(i.subTo(r,i),e&&a.subTo(n,a),u.subTo(s,u))}return 0!=i.compareTo(o.ONE)?o.ZERO:u.compareTo(t)>=0?u.subtract(t):u.signum()<0?(u.addTo(t,u),u.signum()<0?u.add(t):u):u},o.prototype.pow=function(t){return this.exp(t,new E)},o.prototype.gcd=function(t){var e=this.s<0?this.negate():this.clone(),r=t.s<0?t.negate():t.clone();if(e.compareTo(r)<0){var i=e;e=r,r=i}var n=e.getLowestSetBit(),o=r.getLowestSetBit();if(o<0)return e;for(n<o&&(o=n),o>0&&(e.rShiftTo(o,e),r.rShiftTo(o,r));e.signum()>0;)(n=e.getLowestSetBit())>0&&e.rShiftTo(n,e),(n=r.getLowestSetBit())>0&&r.rShiftTo(n,r),e.compareTo(r)>=0?(e.subTo(r,e),e.rShiftTo(1,e)):(r.subTo(e,r),r.rShiftTo(1,r));return o>0&&r.lShiftTo(o,r),r},o.prototype.isProbablePrime=function(t){var e,r=this.abs();if(1==r.t&&r.data[0]<=C[C.length-1]){for(e=0;e<C.length;++e)if(r.data[0]==C[e])return!0;return!1}if(r.isEven())return!1;for(e=1;e<C.length;){for(var i=C[e],n=e+1;n<C.length&&i<k;)i*=C[n++];for(i=r.modInt(i);e<n;)if(i%C[e++]==0)return!1}return r.millerRabin(t)}},28991:(t,e,r)=>{var i=r(3832);t.exports=i.md=i.md||{},i.md.algorithms=i.md.algorithms||{}},86971:(t,e,r)=>{var i=r(3832);r(83453),t.exports=i.mgf=i.mgf||{},i.mgf.mgf1=i.mgf1},83453:(t,e,r)=>{var i=r(3832);r(97116),i.mgf=i.mgf||{},(t.exports=i.mgf.mgf1=i.mgf1=i.mgf1||{}).create=function(t){return{generate:function(e,r){for(var n=new i.util.ByteBuffer,o=Math.ceil(r/t.digestLength),s=0;s<o;s++){var a=new i.util.ByteBuffer;a.putInt32(s),t.start(),t.update(e+a.getBytes()),n.putBuffer(t.digest())}return n.truncate(n.length()-r),n.getBytes()}}}},66270:(t,e,r)=>{var i=r(3832);i.pki=i.pki||{};var n=t.exports=i.pki.oids=i.oids=i.oids||{};function o(t,e){n[t]=e,n[e]=t}function s(t,e){n[t]=e}o("1.2.840.113549.1.1.1","rsaEncryption"),o("1.2.840.113549.1.1.4","md5WithRSAEncryption"),o("1.2.840.113549.1.1.5","sha1WithRSAEncryption"),o("1.2.840.113549.1.1.7","RSAES-OAEP"),o("1.2.840.113549.1.1.8","mgf1"),o("1.2.840.113549.1.1.9","pSpecified"),o("1.2.840.113549.1.1.10","RSASSA-PSS"),o("1.2.840.113549.1.1.11","sha256WithRSAEncryption"),o("1.2.840.113549.1.1.12","sha384WithRSAEncryption"),o("1.2.840.113549.1.1.13","sha512WithRSAEncryption"),o("1.3.101.112","EdDSA25519"),o("1.2.840.10040.4.3","dsa-with-sha1"),o("1.3.14.3.2.7","desCBC"),o("1.3.14.3.2.26","sha1"),o("2.16.840.1.101.3.4.2.1","sha256"),o("2.16.840.1.101.3.4.2.2","sha384"),o("2.16.840.1.101.3.4.2.3","sha512"),o("1.2.840.113549.2.5","md5"),o("1.2.840.113549.1.7.1","data"),o("1.2.840.113549.1.7.2","signedData"),o("1.2.840.113549.1.7.3","envelopedData"),o("1.2.840.113549.1.7.4","signedAndEnvelopedData"),o("1.2.840.113549.1.7.5","digestedData"),o("1.2.840.113549.1.7.6","encryptedData"),o("1.2.840.113549.1.9.1","emailAddress"),o("1.2.840.113549.1.9.2","unstructuredName"),o("1.2.840.113549.1.9.3","contentType"),o("1.2.840.113549.1.9.4","messageDigest"),o("1.2.840.113549.1.9.5","signingTime"),o("1.2.840.113549.1.9.6","counterSignature"),o("1.2.840.113549.1.9.7","challengePassword"),o("1.2.840.113549.1.9.8","unstructuredAddress"),o("1.2.840.113549.1.9.14","extensionRequest"),o("1.2.840.113549.1.9.20","friendlyName"),o("1.2.840.113549.1.9.21","localKeyId"),o("1.2.840.113549.1.9.22.1","x509Certificate"),o("1.2.840.113549.1.12.10.1.1","keyBag"),o("1.2.840.113549.1.12.10.1.2","pkcs8ShroudedKeyBag"),o("1.2.840.113549.1.12.10.1.3","certBag"),o("1.2.840.113549.1.12.10.1.4","crlBag"),o("1.2.840.113549.1.12.10.1.5","secretBag"),o("1.2.840.113549.1.12.10.1.6","safeContentsBag"),o("1.2.840.113549.1.5.13","pkcs5PBES2"),o("1.2.840.113549.1.5.12","pkcs5PBKDF2"),o("1.2.840.113549.1.12.1.1","pbeWithSHAAnd128BitRC4"),o("1.2.840.113549.1.12.1.2","pbeWithSHAAnd40BitRC4"),o("1.2.840.113549.1.12.1.3","pbeWithSHAAnd3-KeyTripleDES-CBC"),o("1.2.840.113549.1.12.1.4","pbeWithSHAAnd2-KeyTripleDES-CBC"),o("1.2.840.113549.1.12.1.5","pbeWithSHAAnd128BitRC2-CBC"),o("1.2.840.113549.1.12.1.6","pbewithSHAAnd40BitRC2-CBC"),o("1.2.840.113549.2.7","hmacWithSHA1"),o("1.2.840.113549.2.8","hmacWithSHA224"),o("1.2.840.113549.2.9","hmacWithSHA256"),o("1.2.840.113549.2.10","hmacWithSHA384"),o("1.2.840.113549.2.11","hmacWithSHA512"),o("1.2.840.113549.3.7","des-EDE3-CBC"),o("2.16.840.1.101.3.4.1.2","aes128-CBC"),o("2.16.840.1.101.3.4.1.22","aes192-CBC"),o("2.16.840.1.101.3.4.1.42","aes256-CBC"),o("2.5.4.3","commonName"),o("2.5.4.5","serialName"),o("2.5.4.6","countryName"),o("2.5.4.7","localityName"),o("2.5.4.8","stateOrProvinceName"),o("2.5.4.9","streetAddress"),o("2.5.4.10","organizationName"),o("2.5.4.11","organizationalUnitName"),o("2.5.4.13","description"),o("2.5.4.15","businessCategory"),o("2.5.4.17","postalCode"),o("1.3.6.1.4.1.311.60.2.1.2","jurisdictionOfIncorporationStateOrProvinceName"),o("1.3.6.1.4.1.311.60.2.1.3","jurisdictionOfIncorporationCountryName"),o("2.16.840.1.113730.1.1","nsCertType"),o("2.16.840.1.113730.1.13","nsComment"),s("2.5.29.1","authorityKeyIdentifier"),s("2.5.29.2","keyAttributes"),s("2.5.29.3","certificatePolicies"),s("2.5.29.4","keyUsageRestriction"),s("2.5.29.5","policyMapping"),s("2.5.29.6","subtreesConstraint"),s("2.5.29.7","subjectAltName"),s("2.5.29.8","issuerAltName"),s("2.5.29.9","subjectDirectoryAttributes"),s("2.5.29.10","basicConstraints"),s("2.5.29.11","nameConstraints"),s("2.5.29.12","policyConstraints"),s("2.5.29.13","basicConstraints"),o("2.5.29.14","subjectKeyIdentifier"),o("2.5.29.15","keyUsage"),s("2.5.29.16","privateKeyUsagePeriod"),o("2.5.29.17","subjectAltName"),o("2.5.29.18","issuerAltName"),o("2.5.29.19","basicConstraints"),s("2.5.29.20","cRLNumber"),s("2.5.29.21","cRLReason"),s("2.5.29.22","expirationDate"),s("2.5.29.23","instructionCode"),s("2.5.29.24","invalidityDate"),s("2.5.29.25","cRLDistributionPoints"),s("2.5.29.26","issuingDistributionPoint"),s("2.5.29.27","deltaCRLIndicator"),s("2.5.29.28","issuingDistributionPoint"),s("2.5.29.29","certificateIssuer"),s("2.5.29.30","nameConstraints"),o("2.5.29.31","cRLDistributionPoints"),o("2.5.29.32","certificatePolicies"),s("2.5.29.33","policyMappings"),s("2.5.29.34","policyConstraints"),o("2.5.29.35","authorityKeyIdentifier"),s("2.5.29.36","policyConstraints"),o("2.5.29.37","extKeyUsage"),s("2.5.29.46","freshestCRL"),s("2.5.29.54","inhibitAnyPolicy"),o("1.3.6.1.4.1.11129.2.4.2","timestampList"),o("1.3.6.1.5.5.7.1.1","authorityInfoAccess"),o("1.3.6.1.5.5.7.3.1","serverAuth"),o("1.3.6.1.5.5.7.3.2","clientAuth"),o("1.3.6.1.5.5.7.3.3","codeSigning"),o("1.3.6.1.5.5.7.3.4","emailProtection"),o("1.3.6.1.5.5.7.3.8","timeStamping")},97450:(t,e,r)=>{var i=r(3832);if(r(8925),r(3068),r(33480),r(28991),r(66270),r(98960),r(26953),r(49563),r(69372),r(28095),r(97116),void 0===n)var n=i.jsbn.BigInteger;var o=i.asn1,s=i.pki=i.pki||{};t.exports=s.pbe=i.pbe=i.pbe||{};var a=s.oids,u={name:"EncryptedPrivateKeyInfo",tagClass:o.Class.UNIVERSAL,type:o.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedPrivateKeyInfo.encryptionAlgorithm",tagClass:o.Class.UNIVERSAL,type:o.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:o.Class.UNIVERSAL,type:o.Type.OID,constructed:!1,capture:"encryptionOid"},{name:"AlgorithmIdentifier.parameters",tagClass:o.Class.UNIVERSAL,type:o.Type.SEQUENCE,constructed:!0,captureAsn1:"encryptionParams"}]},{name:"EncryptedPrivateKeyInfo.encryptedData",tagClass:o.Class.UNIVERSAL,type:o.Type.OCTETSTRING,constructed:!1,capture:"encryptedData"}]},h={name:"PBES2Algorithms",tagClass:o.Class.UNIVERSAL,type:o.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.keyDerivationFunc",tagClass:o.Class.UNIVERSAL,type:o.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.keyDerivationFunc.oid",tagClass:o.Class.UNIVERSAL,type:o.Type.OID,constructed:!1,capture:"kdfOid"},{name:"PBES2Algorithms.params",tagClass:o.Class.UNIVERSAL,type:o.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.params.salt",tagClass:o.Class.UNIVERSAL,type:o.Type.OCTETSTRING,constructed:!1,capture:"kdfSalt"},{name:"PBES2Algorithms.params.iterationCount",tagClass:o.Class.UNIVERSAL,type:o.Type.INTEGER,constructed:!1,capture:"kdfIterationCount"},{name:"PBES2Algorithms.params.keyLength",tagClass:o.Class.UNIVERSAL,type:o.Type.INTEGER,constructed:!1,optional:!0,capture:"keyLength"},{name:"PBES2Algorithms.params.prf",tagClass:o.Class.UNIVERSAL,type:o.Type.SEQUENCE,constructed:!0,optional:!0,value:[{name:"PBES2Algorithms.params.prf.algorithm",tagClass:o.Class.UNIVERSAL,type:o.Type.OID,constructed:!1,capture:"prfOid"}]}]}]},{name:"PBES2Algorithms.encryptionScheme",tagClass:o.Class.UNIVERSAL,type:o.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.encryptionScheme.oid",tagClass:o.Class.UNIVERSAL,type:o.Type.OID,constructed:!1,capture:"encOid"},{name:"PBES2Algorithms.encryptionScheme.iv",tagClass:o.Class.UNIVERSAL,type:o.Type.OCTETSTRING,constructed:!1,capture:"encIv"}]}]},c={name:"pkcs-12PbeParams",tagClass:o.Class.UNIVERSAL,type:o.Type.SEQUENCE,constructed:!0,value:[{name:"pkcs-12PbeParams.salt",tagClass:o.Class.UNIVERSAL,type:o.Type.OCTETSTRING,constructed:!1,capture:"salt"},{name:"pkcs-12PbeParams.iterations",tagClass:o.Class.UNIVERSAL,type:o.Type.INTEGER,constructed:!1,capture:"iterations"}]};function f(t,e){return t.start().update(e).digest().getBytes()}function l(t){var e;if(t){if(!(e=s.oids[o.derToOid(t)])){var r=new Error("Unsupported PRF OID.");throw r.oid=t,r.supported=["hmacWithSHA1","hmacWithSHA224","hmacWithSHA256","hmacWithSHA384","hmacWithSHA512"],r}}else e="hmacWithSHA1";return d(e)}function d(t){var e=i.md;switch(t){case"hmacWithSHA224":e=i.md.sha512;case"hmacWithSHA1":case"hmacWithSHA256":case"hmacWithSHA384":case"hmacWithSHA512":t=t.substr(8).toLowerCase();break;default:var r=new Error("Unsupported PRF algorithm.");throw r.algorithm=t,r.supported=["hmacWithSHA1","hmacWithSHA224","hmacWithSHA256","hmacWithSHA384","hmacWithSHA512"],r}if(!e||!(t in e))throw new Error("Unknown hash algorithm: "+t);return e[t].create()}s.encryptPrivateKeyInfo=function(t,e,r){(r=r||{}).saltSize=r.saltSize||8,r.count=r.count||2048,r.algorithm=r.algorithm||"aes128",r.prfAlgorithm=r.prfAlgorithm||"sha1";var n,u,h,c=i.random.getBytesSync(r.saltSize),f=r.count,l=o.integerToDer(f);if(0===r.algorithm.indexOf("aes")||"des"===r.algorithm){var p,g,y;switch(r.algorithm){case"aes128":n=16,p=16,g=a["aes128-CBC"],y=i.aes.createEncryptionCipher;break;case"aes192":n=24,p=16,g=a["aes192-CBC"],y=i.aes.createEncryptionCipher;break;case"aes256":n=32,p=16,g=a["aes256-CBC"],y=i.aes.createEncryptionCipher;break;case"des":n=8,p=8,g=a.desCBC,y=i.des.createEncryptionCipher;break;default:throw(S=new Error("Cannot encrypt private key. Unknown encryption algorithm.")).algorithm=r.algorithm,S}var m="hmacWith"+r.prfAlgorithm.toUpperCase(),v=d(m),b=i.pkcs5.pbkdf2(e,c,f,n,v),w=i.random.getBytesSync(p);(E=y(b)).start(w),E.update(o.toDer(t)),E.finish(),h=E.output.getBytes();var _=function(t,e,r,n){var a=o.create(o.Class.UNIVERSAL,o.Type.SEQUENCE,!0,[o.create(o.Class.UNIVERSAL,o.Type.OCTETSTRING,!1,t),o.create(o.Class.UNIVERSAL,o.Type.INTEGER,!1,e.getBytes())]);return"hmacWithSHA1"!==n&&a.value.push(o.create(o.Class.UNIVERSAL,o.Type.INTEGER,!1,i.util.hexToBytes(r.toString(16))),o.create(o.Class.UNIVERSAL,o.Type.SEQUENCE,!0,[o.create(o.Class.UNIVERSAL,o.Type.OID,!1,o.oidToDer(s.oids[n]).getBytes()),o.create(o.Class.UNIVERSAL,o.Type.NULL,!1,"")])),a}(c,l,n,m);u=o.create(o.Class.UNIVERSAL,o.Type.SEQUENCE,!0,[o.create(o.Class.UNIVERSAL,o.Type.OID,!1,o.oidToDer(a.pkcs5PBES2).getBytes()),o.create(o.Class.UNIVERSAL,o.Type.SEQUENCE,!0,[o.create(o.Class.UNIVERSAL,o.Type.SEQUENCE,!0,[o.create(o.Class.UNIVERSAL,o.Type.OID,!1,o.oidToDer(a.pkcs5PBKDF2).getBytes()),_]),o.create(o.Class.UNIVERSAL,o.Type.SEQUENCE,!0,[o.create(o.Class.UNIVERSAL,o.Type.OID,!1,o.oidToDer(g).getBytes()),o.create(o.Class.UNIVERSAL,o.Type.OCTETSTRING,!1,w)])])])}else{var S;if("3des"!==r.algorithm)throw(S=new Error("Cannot encrypt private key. Unknown encryption algorithm.")).algorithm=r.algorithm,S;n=24;var E,M=new i.util.ByteBuffer(c);b=s.pbe.generatePkcs12Key(e,M,1,f,n),w=s.pbe.generatePkcs12Key(e,M,2,f,n),(E=i.des.createEncryptionCipher(b)).start(w),E.update(o.toDer(t)),E.finish(),h=E.output.getBytes(),u=o.create(o.Class.UNIVERSAL,o.Type.SEQUENCE,!0,[o.create(o.Class.UNIVERSAL,o.Type.OID,!1,o.oidToDer(a["pbeWithSHAAnd3-KeyTripleDES-CBC"]).getBytes()),o.create(o.Class.UNIVERSAL,o.Type.SEQUENCE,!0,[o.create(o.Class.UNIVERSAL,o.Type.OCTETSTRING,!1,c),o.create(o.Class.UNIVERSAL,o.Type.INTEGER,!1,l.getBytes())])])}return o.create(o.Class.UNIVERSAL,o.Type.SEQUENCE,!0,[u,o.create(o.Class.UNIVERSAL,o.Type.OCTETSTRING,!1,h)])},s.decryptPrivateKeyInfo=function(t,e){var r=null,n={},a=[];if(!o.validate(t,u,n,a)){var h=new Error("Cannot read encrypted private key. ASN.1 object is not a supported EncryptedPrivateKeyInfo.");throw h.errors=a,h}var c=o.derToOid(n.encryptionOid),f=s.pbe.getCipher(c,n.encryptionParams,e),l=i.util.createBuffer(n.encryptedData);return f.update(l),f.finish()&&(r=o.fromDer(f.output)),r},s.encryptedPrivateKeyToPem=function(t,e){var r={type:"ENCRYPTED PRIVATE KEY",body:o.toDer(t).getBytes()};return i.pem.encode(r,{maxline:e})},s.encryptedPrivateKeyFromPem=function(t){var e=i.pem.decode(t)[0];if("ENCRYPTED PRIVATE KEY"!==e.type){var r=new Error('Could not convert encrypted private key from PEM; PEM header type is "ENCRYPTED PRIVATE KEY".');throw r.headerType=e.type,r}if(e.procType&&"ENCRYPTED"===e.procType.type)throw new Error("Could not convert encrypted private key from PEM; PEM is encrypted.");return o.fromDer(e.body)},s.encryptRsaPrivateKey=function(t,e,r){if(!(r=r||{}).legacy){var n=s.wrapRsaPrivateKey(s.privateKeyToAsn1(t));return n=s.encryptPrivateKeyInfo(n,e,r),s.encryptedPrivateKeyToPem(n)}var a,u,h,c;switch(r.algorithm){case"aes128":a="AES-128-CBC",h=16,u=i.random.getBytesSync(16),c=i.aes.createEncryptionCipher;break;case"aes192":a="AES-192-CBC",h=24,u=i.random.getBytesSync(16),c=i.aes.createEncryptionCipher;break;case"aes256":a="AES-256-CBC",h=32,u=i.random.getBytesSync(16),c=i.aes.createEncryptionCipher;break;case"3des":a="DES-EDE3-CBC",h=24,u=i.random.getBytesSync(8),c=i.des.createEncryptionCipher;break;case"des":a="DES-CBC",h=8,u=i.random.getBytesSync(8),c=i.des.createEncryptionCipher;break;default:var f=new Error('Could not encrypt RSA private key; unsupported encryption algorithm "'+r.algorithm+'".');throw f.algorithm=r.algorithm,f}var l=c(i.pbe.opensslDeriveBytes(e,u.substr(0,8),h));l.start(u),l.update(o.toDer(s.privateKeyToAsn1(t))),l.finish();var d={type:"RSA PRIVATE KEY",procType:{version:"4",type:"ENCRYPTED"},dekInfo:{algorithm:a,parameters:i.util.bytesToHex(u).toUpperCase()},body:l.output.getBytes()};return i.pem.encode(d)},s.decryptRsaPrivateKey=function(t,e){var r=null,n=i.pem.decode(t)[0];if("ENCRYPTED PRIVATE KEY"!==n.type&&"PRIVATE KEY"!==n.type&&"RSA PRIVATE KEY"!==n.type)throw(h=new Error('Could not convert private key from PEM; PEM header type is not "ENCRYPTED PRIVATE KEY", "PRIVATE KEY", or "RSA PRIVATE KEY".')).headerType=h,h;if(n.procType&&"ENCRYPTED"===n.procType.type){var a,u;switch(n.dekInfo.algorithm){case"DES-CBC":a=8,u=i.des.createDecryptionCipher;break;case"DES-EDE3-CBC":a=24,u=i.des.createDecryptionCipher;break;case"AES-128-CBC":a=16,u=i.aes.createDecryptionCipher;break;case"AES-192-CBC":a=24,u=i.aes.createDecryptionCipher;break;case"AES-256-CBC":a=32,u=i.aes.createDecryptionCipher;break;case"RC2-40-CBC":a=5,u=function(t){return i.rc2.createDecryptionCipher(t,40)};break;case"RC2-64-CBC":a=8,u=function(t){return i.rc2.createDecryptionCipher(t,64)};break;case"RC2-128-CBC":a=16,u=function(t){return i.rc2.createDecryptionCipher(t,128)};break;default:var h;throw(h=new Error('Could not decrypt private key; unsupported encryption algorithm "'+n.dekInfo.algorithm+'".')).algorithm=n.dekInfo.algorithm,h}var c=i.util.hexToBytes(n.dekInfo.parameters),f=u(i.pbe.opensslDeriveBytes(e,c.substr(0,8),a));if(f.start(c),f.update(i.util.createBuffer(n.body)),!f.finish())return r;r=f.output.getBytes()}else r=n.body;return null!==(r="ENCRYPTED PRIVATE KEY"===n.type?s.decryptPrivateKeyInfo(o.fromDer(r),e):o.fromDer(r))&&(r=s.privateKeyFromAsn1(r)),r},s.pbe.generatePkcs12Key=function(t,e,r,n,o,s){var a,u;if(null==s){if(!("sha1"in i.md))throw new Error('"sha1" hash algorithm unavailable.');s=i.md.sha1.create()}var h=s.digestLength,c=s.blockLength,f=new i.util.ByteBuffer,l=new i.util.ByteBuffer;if(null!=t){for(u=0;u<t.length;u++)l.putInt16(t.charCodeAt(u));l.putInt16(0)}var d=l.length(),p=e.length(),g=new i.util.ByteBuffer;g.fillWithByte(r,c);var y=c*Math.ceil(p/c),m=new i.util.ByteBuffer;for(u=0;u<y;u++)m.putByte(e.at(u%p));var v=c*Math.ceil(d/c),b=new i.util.ByteBuffer;for(u=0;u<v;u++)b.putByte(l.at(u%d));var w=m;w.putBuffer(b);for(var _=Math.ceil(o/h),S=1;S<=_;S++){var E=new i.util.ByteBuffer;E.putBytes(g.bytes()),E.putBytes(w.bytes());for(var M=0;M<n;M++)s.start(),s.update(E.getBytes()),E=s.digest();var A=new i.util.ByteBuffer;for(u=0;u<c;u++)A.putByte(E.at(u%h));var C=Math.ceil(p/c)+Math.ceil(d/c),k=new i.util.ByteBuffer;for(a=0;a<C;a++){var I=new i.util.ByteBuffer(w.getBytes(c)),T=511;for(u=A.length()-1;u>=0;u--)T>>=8,T+=A.at(u)+I.at(u),I.setAt(u,255&T);k.putBuffer(I)}w=k,f.putBuffer(E)}return f.truncate(f.length()-o),f},s.pbe.getCipher=function(t,e,r){switch(t){case s.oids.pkcs5PBES2:return s.pbe.getCipherForPBES2(t,e,r);case s.oids["pbeWithSHAAnd3-KeyTripleDES-CBC"]:case s.oids["pbewithSHAAnd40BitRC2-CBC"]:return s.pbe.getCipherForPKCS12PBE(t,e,r);default:var i=new Error("Cannot read encrypted PBE data block. Unsupported OID.");throw i.oid=t,i.supportedOids=["pkcs5PBES2","pbeWithSHAAnd3-KeyTripleDES-CBC","pbewithSHAAnd40BitRC2-CBC"],i}},s.pbe.getCipherForPBES2=function(t,e,r){var n,a={},u=[];if(!o.validate(e,h,a,u))throw(n=new Error("Cannot read password-based-encryption algorithm parameters. ASN.1 object is not a supported EncryptedPrivateKeyInfo.")).errors=u,n;if((t=o.derToOid(a.kdfOid))!==s.oids.pkcs5PBKDF2)throw(n=new Error("Cannot read encrypted private key. Unsupported key derivation function OID.")).oid=t,n.supportedOids=["pkcs5PBKDF2"],n;if((t=o.derToOid(a.encOid))!==s.oids["aes128-CBC"]&&t!==s.oids["aes192-CBC"]&&t!==s.oids["aes256-CBC"]&&t!==s.oids["des-EDE3-CBC"]&&t!==s.oids.desCBC)throw(n=new Error("Cannot read encrypted private key. Unsupported encryption scheme OID.")).oid=t,n.supportedOids=["aes128-CBC","aes192-CBC","aes256-CBC","des-EDE3-CBC","desCBC"],n;var c,f,d=a.kdfSalt,p=i.util.createBuffer(a.kdfIterationCount);switch(p=p.getInt(p.length()<<3),s.oids[t]){case"aes128-CBC":c=16,f=i.aes.createDecryptionCipher;break;case"aes192-CBC":c=24,f=i.aes.createDecryptionCipher;break;case"aes256-CBC":c=32,f=i.aes.createDecryptionCipher;break;case"des-EDE3-CBC":c=24,f=i.des.createDecryptionCipher;break;case"desCBC":c=8,f=i.des.createDecryptionCipher}var g=l(a.prfOid),y=i.pkcs5.pbkdf2(r,d,p,c,g),m=a.encIv,v=f(y);return v.start(m),v},s.pbe.getCipherForPKCS12PBE=function(t,e,r){var n={},a=[];if(!o.validate(e,c,n,a))throw(g=new Error("Cannot read password-based-encryption algorithm parameters. ASN.1 object is not a supported EncryptedPrivateKeyInfo.")).errors=a,g;var u,h,f,d=i.util.createBuffer(n.salt),p=i.util.createBuffer(n.iterations);switch(p=p.getInt(p.length()<<3),t){case s.oids["pbeWithSHAAnd3-KeyTripleDES-CBC"]:u=24,h=8,f=i.des.startDecrypting;break;case s.oids["pbewithSHAAnd40BitRC2-CBC"]:u=5,h=8,f=function(t,e){var r=i.rc2.createDecryptionCipher(t,40);return r.start(e,null),r};break;default:var g;throw(g=new Error("Cannot read PKCS #12 PBE data block. Unsupported OID.")).oid=t,g}var y=l(n.prfOid),m=s.pbe.generatePkcs12Key(r,d,1,p,u,y);return y.start(),f(m,s.pbe.generatePkcs12Key(r,d,2,p,h,y))},s.pbe.opensslDeriveBytes=function(t,e,r,n){if(null==n){if(!("md5"in i.md))throw new Error('"md5" hash algorithm unavailable.');n=i.md.md5.create()}null===e&&(e="");for(var o=[f(n,t+e)],s=16,a=1;s<r;++a,s+=16)o.push(f(n,o[a-1]+t+e));return o.join("").substr(0,r)}},98960:(t,e,r)=>{var i=r(3832);r(36607),r(28991),r(97116);var n,o=i.pkcs5=i.pkcs5||{};i.util.isNodejs&&!i.options.usePureJavaScript&&(n=r(63906)),t.exports=i.pbkdf2=o.pbkdf2=function(t,e,r,o,s,a){if("function"==typeof s&&(a=s,s=null),i.util.isNodejs&&!i.options.usePureJavaScript&&n.pbkdf2&&(null===s||"object"!=typeof s)&&(n.pbkdf2Sync.length>4||!s||"sha1"===s))return"string"!=typeof s&&(s="sha1"),t=Buffer.from(t,"binary"),e=Buffer.from(e,"binary"),a?4===n.pbkdf2Sync.length?n.pbkdf2(t,e,r,o,(function(t,e){if(t)return a(t);a(null,e.toString("binary"))})):n.pbkdf2(t,e,r,o,s,(function(t,e){if(t)return a(t);a(null,e.toString("binary"))})):4===n.pbkdf2Sync.length?n.pbkdf2Sync(t,e,r,o).toString("binary"):n.pbkdf2Sync(t,e,r,o,s).toString("binary");if(null==s&&(s="sha1"),"string"==typeof s){if(!(s in i.md.algorithms))throw new Error("Unknown hash algorithm: "+s);s=i.md[s].create()}var u=s.digestLength;if(o>4294967295*u){var h=new Error("Derived key is too long.");if(a)return a(h);throw h}var c=Math.ceil(o/u),f=o-(c-1)*u,l=i.hmac.create();l.start(s,t);var d,p,g,y="";if(!a){for(var m=1;m<=c;++m){l.start(null,null),l.update(e),l.update(i.util.int32ToBytes(m)),d=g=l.digest().getBytes();for(var v=2;v<=r;++v)l.start(null,null),l.update(g),p=l.digest().getBytes(),d=i.util.xorBytes(d,p,u),g=p;y+=m<c?d:d.substr(0,f)}return y}function b(){if(m>c)return a(null,y);l.start(null,null),l.update(e),l.update(i.util.int32ToBytes(m)),d=g=l.digest().getBytes(),v=2,w()}function w(){if(v<=r)return l.start(null,null),l.update(g),p=l.digest().getBytes(),d=i.util.xorBytes(d,p,u),g=p,++v,i.util.setImmediate(w);y+=m<c?d:d.substr(0,f),++m,b()}m=1,b()}},26953:(t,e,r)=>{var i=r(3832);r(97116);var n=t.exports=i.pem=i.pem||{};function o(t){for(var e=t.name+": ",r=[],i=function(t,e){return" "+e},n=0;n<t.values.length;++n)r.push(t.values[n].replace(/^(\S+\r\n)/,i));e+=r.join(",")+"\r\n";var o=0,s=-1;for(n=0;n<e.length;++n,++o)if(o>65&&-1!==s){var a=e[s];","===a?(++s,e=e.substr(0,s)+"\r\n "+e.substr(s)):e=e.substr(0,s)+"\r\n"+a+e.substr(s+1),o=n-s-1,s=-1,++n}else" "!==e[n]&&"\t"!==e[n]&&","!==e[n]||(s=n);return e}function s(t){return t.replace(/^\s+/,"")}n.encode=function(t,e){e=e||{};var r,n="-----BEGIN "+t.type+"-----\r\n";if(t.procType&&(n+=o(r={name:"Proc-Type",values:[String(t.procType.version),t.procType.type]})),t.contentDomain&&(n+=o(r={name:"Content-Domain",values:[t.contentDomain]})),t.dekInfo&&(r={name:"DEK-Info",values:[t.dekInfo.algorithm]},t.dekInfo.parameters&&r.values.push(t.dekInfo.parameters),n+=o(r)),t.headers)for(var s=0;s<t.headers.length;++s)n+=o(t.headers[s]);return t.procType&&(n+="\r\n"),(n+=i.util.encode64(t.body,e.maxline||64)+"\r\n")+"-----END "+t.type+"-----\r\n"},n.decode=function(t){for(var e,r=[],n=/\s*-----BEGIN ([A-Z0-9- ]+)-----\r?\n?([\x21-\x7e\s]+?(?:\r?\n\r?\n))?([:A-Za-z0-9+\/=\s]+?)-----END \1-----/g,o=/([\x21-\x7e]+):\s*([\x21-\x7e\s^:]+)/,a=/\r?\n/;e=n.exec(t);){var u={type:e[1],procType:null,contentDomain:null,dekInfo:null,headers:[],body:i.util.decode64(e[3])};if(r.push(u),e[2]){for(var h=e[2].split(a),c=0;e&&c<h.length;){for(var f=h[c].replace(/\s+$/,""),l=c+1;l<h.length;++l){var d=h[l];if(!/\s/.test(d[0]))break;f+=d,c=l}if(e=f.match(o)){for(var p={name:e[1],values:[]},g=e[2].split(","),y=0;y<g.length;++y)p.values.push(s(g[y]));if(u.procType)if(u.contentDomain||"Content-Domain"!==p.name)if(u.dekInfo||"DEK-Info"!==p.name)u.headers.push(p);else{if(0===p.values.length)throw new Error('Invalid PEM formatted message. The "DEK-Info" header must have at least one subfield.');u.dekInfo={algorithm:g[0],parameters:g[1]||null}}else u.contentDomain=g[0]||"";else{if("Proc-Type"!==p.name)throw new Error('Invalid PEM formatted message. The first encapsulated header must be "Proc-Type".');if(2!==p.values.length)throw new Error('Invalid PEM formatted message. The "Proc-Type" header must have two subfields.');u.procType={version:g[0],type:g[1]}}}++c}if("ENCRYPTED"===u.procType&&!u.dekInfo)throw new Error('Invalid PEM formatted message. The "DEK-Info" header must be present if "Proc-Type" is "ENCRYPTED".')}}if(0===r.length)throw new Error("Invalid PEM formatted message.");return r}},18936:(t,e,r)=>{var i=r(3832);r(97116),r(49563),r(137);var n=t.exports=i.pkcs1=i.pkcs1||{};function o(t,e,r){r||(r=i.md.sha1.create());for(var n="",o=Math.ceil(e/r.digestLength),s=0;s<o;++s){var a=String.fromCharCode(s>>24&255,s>>16&255,s>>8&255,255&s);r.start(),r.update(t+a),n+=r.digest().getBytes()}return n.substring(0,e)}n.encode_rsa_oaep=function(t,e,r){var n,s,a,u;"string"==typeof r?(n=r,s=arguments[3]||void 0,a=arguments[4]||void 0):r&&(n=r.label||void 0,s=r.seed||void 0,a=r.md||void 0,r.mgf1&&r.mgf1.md&&(u=r.mgf1.md)),a?a.start():a=i.md.sha1.create(),u||(u=a);var h=Math.ceil(t.n.bitLength()/8),c=h-2*a.digestLength-2;if(e.length>c)throw(y=new Error("RSAES-OAEP input message length is too long.")).length=e.length,y.maxLength=c,y;n||(n=""),a.update(n,"raw");for(var f=a.digest(),l="",d=c-e.length,p=0;p<d;p++)l+="\0";var g=f.getBytes()+l+""+e;if(s){if(s.length!==a.digestLength){var y;throw(y=new Error("Invalid RSAES-OAEP seed. The seed length must match the digest length.")).seedLength=s.length,y.digestLength=a.digestLength,y}}else s=i.random.getBytes(a.digestLength);var m=o(s,h-a.digestLength-1,u),v=i.util.xorBytes(g,m,g.length),b=o(v,a.digestLength,u),w=i.util.xorBytes(s,b,s.length);return"\0"+w+v},n.decode_rsa_oaep=function(t,e,r){var n,s,a;"string"==typeof r?(n=r,s=arguments[3]||void 0):r&&(n=r.label||void 0,s=r.md||void 0,r.mgf1&&r.mgf1.md&&(a=r.mgf1.md));var u=Math.ceil(t.n.bitLength()/8);if(e.length!==u)throw(v=new Error("RSAES-OAEP encoded message length is invalid.")).length=e.length,v.expectedLength=u,v;if(void 0===s?s=i.md.sha1.create():s.start(),a||(a=s),u<2*s.digestLength+2)throw new Error("RSAES-OAEP key is too short for the hash function.");n||(n=""),s.update(n,"raw");for(var h=s.digest().getBytes(),c=e.charAt(0),f=e.substring(1,s.digestLength+1),l=e.substring(1+s.digestLength),d=o(l,s.digestLength,a),p=i.util.xorBytes(f,d,f.length),g=o(p,u-s.digestLength-1,a),y=i.util.xorBytes(l,g,l.length),m=y.substring(0,s.digestLength),v="\0"!==c,b=0;b<s.digestLength;++b)v|=h.charAt(b)!==m.charAt(b);for(var w=1,_=s.digestLength,S=s.digestLength;S<y.length;S++){var E=y.charCodeAt(S),M=1&E^1,A=w?65534:0;v|=E&A,_+=w&=M}if(v||1!==y.charCodeAt(_))throw new Error("Invalid RSAES-OAEP padding.");return y.substring(_+1)}},55147:(t,e,r)=>{var i=r(3832);r(3068),r(36607),r(66270),r(95496),r(97450),r(49563),r(28095),r(137),r(97116),r(25414);var n=i.asn1,o=i.pki,s=t.exports=i.pkcs12=i.pkcs12||{},a={name:"ContentInfo",tagClass:n.Class.UNIVERSAL,type:n.Type.SEQUENCE,constructed:!0,value:[{name:"ContentInfo.contentType",tagClass:n.Class.UNIVERSAL,type:n.Type.OID,constructed:!1,capture:"contentType"},{name:"ContentInfo.content",tagClass:n.Class.CONTEXT_SPECIFIC,constructed:!0,captureAsn1:"content"}]},u={name:"PFX",tagClass:n.Class.UNIVERSAL,type:n.Type.SEQUENCE,constructed:!0,value:[{name:"PFX.version",tagClass:n.Class.UNIVERSAL,type:n.Type.INTEGER,constructed:!1,capture:"version"},a,{name:"PFX.macData",tagClass:n.Class.UNIVERSAL,type:n.Type.SEQUENCE,constructed:!0,optional:!0,captureAsn1:"mac",value:[{name:"PFX.macData.mac",tagClass:n.Class.UNIVERSAL,type:n.Type.SEQUENCE,constructed:!0,value:[{name:"PFX.macData.mac.digestAlgorithm",tagClass:n.Class.UNIVERSAL,type:n.Type.SEQUENCE,constructed:!0,value:[{name:"PFX.macData.mac.digestAlgorithm.algorithm",tagClass:n.Class.UNIVERSAL,type:n.Type.OID,constructed:!1,capture:"macAlgorithm"},{name:"PFX.macData.mac.digestAlgorithm.parameters",tagClass:n.Class.UNIVERSAL,captureAsn1:"macAlgorithmParameters"}]},{name:"PFX.macData.mac.digest",tagClass:n.Class.UNIVERSAL,type:n.Type.OCTETSTRING,constructed:!1,capture:"macDigest"}]},{name:"PFX.macData.macSalt",tagClass:n.Class.UNIVERSAL,type:n.Type.OCTETSTRING,constructed:!1,capture:"macSalt"},{name:"PFX.macData.iterations",tagClass:n.Class.UNIVERSAL,type:n.Type.INTEGER,constructed:!1,optional:!0,capture:"macIterations"}]}]},h={name:"SafeBag",tagClass:n.Class.UNIVERSAL,type:n.Type.SEQUENCE,constructed:!0,value:[{name:"SafeBag.bagId",tagClass:n.Class.UNIVERSAL,type:n.Type.OID,constructed:!1,capture:"bagId"},{name:"SafeBag.bagValue",tagClass:n.Class.CONTEXT_SPECIFIC,constructed:!0,captureAsn1:"bagValue"},{name:"SafeBag.bagAttributes",tagClass:n.Class.UNIVERSAL,type:n.Type.SET,constructed:!0,optional:!0,capture:"bagAttributes"}]},c={name:"Attribute",tagClass:n.Class.UNIVERSAL,type:n.Type.SEQUENCE,constructed:!0,value:[{name:"Attribute.attrId",tagClass:n.Class.UNIVERSAL,type:n.Type.OID,constructed:!1,capture:"oid"},{name:"Attribute.attrValues",tagClass:n.Class.UNIVERSAL,type:n.Type.SET,constructed:!0,capture:"values"}]},f={name:"CertBag",tagClass:n.Class.UNIVERSAL,type:n.Type.SEQUENCE,constructed:!0,value:[{name:"CertBag.certId",tagClass:n.Class.UNIVERSAL,type:n.Type.OID,constructed:!1,capture:"certId"},{name:"CertBag.certValue",tagClass:n.Class.CONTEXT_SPECIFIC,constructed:!0,value:[{name:"CertBag.certValue[0]",tagClass:n.Class.UNIVERSAL,type:n.Class.OCTETSTRING,constructed:!1,capture:"cert"}]}]};function l(t,e,r,i){for(var n=[],o=0;o<t.length;o++)for(var s=0;s<t[o].safeBags.length;s++){var a=t[o].safeBags[s];void 0!==i&&a.type!==i||(null!==e?void 0!==a.attributes[e]&&a.attributes[e].indexOf(r)>=0&&n.push(a):n.push(a))}return n}function d(t){if(t.composed||t.constructed){for(var e=i.util.createBuffer(),r=0;r<t.value.length;++r)e.putBytes(t.value[r].value);t.composed=t.constructed=!1,t.value=e.getBytes()}return t}function p(t,e){var r={},s=[];if(!n.validate(t,i.pkcs7.asn1.encryptedDataValidator,r,s))throw(a=new Error("Cannot read EncryptedContentInfo.")).errors=s,a;var a,u=n.derToOid(r.contentType);if(u!==o.oids.data)throw(a=new Error("PKCS#12 EncryptedContentInfo ContentType is not Data.")).oid=u,a;u=n.derToOid(r.encAlgorithm);var h=o.pbe.getCipher(u,r.encParameter,e),c=d(r.encryptedContentAsn1),f=i.util.createBuffer(c.value);if(h.update(f),!h.finish())throw new Error("Failed to decrypt PKCS#12 SafeContents.");return h.output.getBytes()}function g(t,e,r){if(!e&&0===t.length)return[];if((t=n.fromDer(t,e)).tagClass!==n.Class.UNIVERSAL||t.type!==n.Type.SEQUENCE||!0!==t.constructed)throw new Error("PKCS#12 SafeContents expected to be a SEQUENCE OF SafeBag.");for(var i=[],s=0;s<t.value.length;s++){var a=t.value[s],u={},c=[];if(!n.validate(a,h,u,c))throw(m=new Error("Cannot read SafeBag.")).errors=c,m;var l,d,p={type:n.derToOid(u.bagId),attributes:y(u.bagAttributes)};i.push(p);var g=u.bagValue.value[0];switch(p.type){case o.oids.pkcs8ShroudedKeyBag:if(null===(g=o.decryptPrivateKeyInfo(g,r)))throw new Error("Unable to decrypt PKCS#8 ShroudedKeyBag, wrong password?");case o.oids.keyBag:try{p.key=o.privateKeyFromAsn1(g)}catch(t){p.key=null,p.asn1=g}continue;case o.oids.certBag:l=f,d=function(){if(n.derToOid(u.certId)!==o.oids.x509Certificate){var t=new Error("Unsupported certificate type, only X.509 supported.");throw t.oid=n.derToOid(u.certId),t}var r=n.fromDer(u.cert,e);try{p.cert=o.certificateFromAsn1(r,!0)}catch(t){p.cert=null,p.asn1=r}};break;default:var m;throw(m=new Error("Unsupported PKCS#12 SafeBag type.")).oid=p.type,m}if(void 0!==l&&!n.validate(g,l,u,c))throw(m=new Error("Cannot read PKCS#12 "+l.name)).errors=c,m;d()}return i}function y(t){var e={};if(void 0!==t)for(var r=0;r<t.length;++r){var i={},s=[];if(!n.validate(t[r],c,i,s)){var a=new Error("Cannot read PKCS#12 BagAttribute.");throw a.errors=s,a}var u=n.derToOid(i.oid);if(void 0!==o.oids[u]){e[o.oids[u]]=[];for(var h=0;h<i.values.length;++h)e[o.oids[u]].push(i.values[h].value)}}return e}s.pkcs12FromAsn1=function(t,e,r){"string"==typeof e?(r=e,e=!0):void 0===e&&(e=!0);var h={};if(!n.validate(t,u,h,[]))throw(c=new Error("Cannot read PKCS#12 PFX. ASN.1 object is not an PKCS#12 PFX.")).errors=c,c;var c,f={version:h.version.charCodeAt(0),safeContents:[],getBags:function(t){var e,r={};return"localKeyId"in t?e=t.localKeyId:"localKeyIdHex"in t&&(e=i.util.hexToBytes(t.localKeyIdHex)),void 0===e&&!("friendlyName"in t)&&"bagType"in t&&(r[t.bagType]=l(f.safeContents,null,null,t.bagType)),void 0!==e&&(r.localKeyId=l(f.safeContents,"localKeyId",e,t.bagType)),"friendlyName"in t&&(r.friendlyName=l(f.safeContents,"friendlyName",t.friendlyName,t.bagType)),r},getBagsByFriendlyName:function(t,e){return l(f.safeContents,"friendlyName",t,e)},getBagsByLocalKeyId:function(t,e){return l(f.safeContents,"localKeyId",t,e)}};if(3!==h.version.charCodeAt(0))throw(c=new Error("PKCS#12 PFX of version other than 3 not supported.")).version=h.version.charCodeAt(0),c;if(n.derToOid(h.contentType)!==o.oids.data)throw(c=new Error("Only PKCS#12 PFX in password integrity mode supported.")).oid=n.derToOid(h.contentType),c;var y=h.content.value[0];if(y.tagClass!==n.Class.UNIVERSAL||y.type!==n.Type.OCTETSTRING)throw new Error("PKCS#12 authSafe content data is not an OCTET STRING.");if(y=d(y),h.mac){var m=null,v=0,b=n.derToOid(h.macAlgorithm);switch(b){case o.oids.sha1:m=i.md.sha1.create(),v=20;break;case o.oids.sha256:m=i.md.sha256.create(),v=32;break;case o.oids.sha384:m=i.md.sha384.create(),v=48;break;case o.oids.sha512:m=i.md.sha512.create(),v=64;break;case o.oids.md5:m=i.md.md5.create(),v=16}if(null===m)throw new Error("PKCS#12 uses unsupported MAC algorithm: "+b);var w=new i.util.ByteBuffer(h.macSalt),_="macIterations"in h?parseInt(i.util.bytesToHex(h.macIterations),16):1,S=s.generateKey(r,w,3,_,v,m),E=i.hmac.create();if(E.start(m,S),E.update(y.value),E.getMac().getBytes()!==h.macDigest)throw new Error("PKCS#12 MAC could not be verified. Invalid password?")}return function(t,e,r,i){if((e=n.fromDer(e,r)).tagClass!==n.Class.UNIVERSAL||e.type!==n.Type.SEQUENCE||!0!==e.constructed)throw new Error("PKCS#12 AuthenticatedSafe expected to be a SEQUENCE OF ContentInfo");for(var s=0;s<e.value.length;s++){var u=e.value[s],h={},c=[];if(!n.validate(u,a,h,c))throw(m=new Error("Cannot read ContentInfo.")).errors=c,m;var f={encrypted:!1},l=null,y=h.content.value[0];switch(n.derToOid(h.contentType)){case o.oids.data:if(y.tagClass!==n.Class.UNIVERSAL||y.type!==n.Type.OCTETSTRING)throw new Error("PKCS#12 SafeContents Data is not an OCTET STRING.");l=d(y).value;break;case o.oids.encryptedData:l=p(y,i),f.encrypted=!0;break;default:var m;throw(m=new Error("Unsupported PKCS#12 contentType.")).contentType=n.derToOid(h.contentType),m}f.safeBags=g(l,r,i),t.safeContents.push(f)}}(f,y.value,e,r),f},s.toPkcs12Asn1=function(t,e,r,a){(a=a||{}).saltSize=a.saltSize||8,a.count=a.count||2048,a.algorithm=a.algorithm||a.encAlgorithm||"aes128","useMac"in a||(a.useMac=!0),"localKeyId"in a||(a.localKeyId=null),"generateLocalKeyId"in a||(a.generateLocalKeyId=!0);var u,h=a.localKeyId;if(null!==h)h=i.util.hexToBytes(h);else if(a.generateLocalKeyId)if(e){var c=i.util.isArray(e)?e[0]:e;"string"==typeof c&&(c=o.certificateFromPem(c)),(k=i.md.sha1.create()).update(n.toDer(o.certificateToAsn1(c)).getBytes()),h=k.digest().getBytes()}else h=i.random.getBytes(20);var f=[];null!==h&&f.push(n.create(n.Class.UNIVERSAL,n.Type.SEQUENCE,!0,[n.create(n.Class.UNIVERSAL,n.Type.OID,!1,n.oidToDer(o.oids.localKeyId).getBytes()),n.create(n.Class.UNIVERSAL,n.Type.SET,!0,[n.create(n.Class.UNIVERSAL,n.Type.OCTETSTRING,!1,h)])])),"friendlyName"in a&&f.push(n.create(n.Class.UNIVERSAL,n.Type.SEQUENCE,!0,[n.create(n.Class.UNIVERSAL,n.Type.OID,!1,n.oidToDer(o.oids.friendlyName).getBytes()),n.create(n.Class.UNIVERSAL,n.Type.SET,!0,[n.create(n.Class.UNIVERSAL,n.Type.BMPSTRING,!1,a.friendlyName)])])),f.length>0&&(u=n.create(n.Class.UNIVERSAL,n.Type.SET,!0,f));var l=[],d=[];null!==e&&(d=i.util.isArray(e)?e:[e]);for(var p=[],g=0;g<d.length;++g){"string"==typeof(e=d[g])&&(e=o.certificateFromPem(e));var y=0===g?u:void 0,m=o.certificateToAsn1(e),v=n.create(n.Class.UNIVERSAL,n.Type.SEQUENCE,!0,[n.create(n.Class.UNIVERSAL,n.Type.OID,!1,n.oidToDer(o.oids.certBag).getBytes()),n.create(n.Class.CONTEXT_SPECIFIC,0,!0,[n.create(n.Class.UNIVERSAL,n.Type.SEQUENCE,!0,[n.create(n.Class.UNIVERSAL,n.Type.OID,!1,n.oidToDer(o.oids.x509Certificate).getBytes()),n.create(n.Class.CONTEXT_SPECIFIC,0,!0,[n.create(n.Class.UNIVERSAL,n.Type.OCTETSTRING,!1,n.toDer(m).getBytes())])])]),y]);p.push(v)}if(p.length>0){var b=n.create(n.Class.UNIVERSAL,n.Type.SEQUENCE,!0,p),w=n.create(n.Class.UNIVERSAL,n.Type.SEQUENCE,!0,[n.create(n.Class.UNIVERSAL,n.Type.OID,!1,n.oidToDer(o.oids.data).getBytes()),n.create(n.Class.CONTEXT_SPECIFIC,0,!0,[n.create(n.Class.UNIVERSAL,n.Type.OCTETSTRING,!1,n.toDer(b).getBytes())])]);l.push(w)}var _=null;if(null!==t){var S=o.wrapRsaPrivateKey(o.privateKeyToAsn1(t));_=null===r?n.create(n.Class.UNIVERSAL,n.Type.SEQUENCE,!0,[n.create(n.Class.UNIVERSAL,n.Type.OID,!1,n.oidToDer(o.oids.keyBag).getBytes()),n.create(n.Class.CONTEXT_SPECIFIC,0,!0,[S]),u]):n.create(n.Class.UNIVERSAL,n.Type.SEQUENCE,!0,[n.create(n.Class.UNIVERSAL,n.Type.OID,!1,n.oidToDer(o.oids.pkcs8ShroudedKeyBag).getBytes()),n.create(n.Class.CONTEXT_SPECIFIC,0,!0,[o.encryptPrivateKeyInfo(S,r,a)]),u]);var E=n.create(n.Class.UNIVERSAL,n.Type.SEQUENCE,!0,[_]),M=n.create(n.Class.UNIVERSAL,n.Type.SEQUENCE,!0,[n.create(n.Class.UNIVERSAL,n.Type.OID,!1,n.oidToDer(o.oids.data).getBytes()),n.create(n.Class.CONTEXT_SPECIFIC,0,!0,[n.create(n.Class.UNIVERSAL,n.Type.OCTETSTRING,!1,n.toDer(E).getBytes())])]);l.push(M)}var A,C=n.create(n.Class.UNIVERSAL,n.Type.SEQUENCE,!0,l);if(a.useMac){var k=i.md.sha1.create(),I=new i.util.ByteBuffer(i.random.getBytes(a.saltSize)),T=a.count,R=(t=s.generateKey(r,I,3,T,20),i.hmac.create());R.start(k,t),R.update(n.toDer(C).getBytes());var B=R.getMac();A=n.create(n.Class.UNIVERSAL,n.Type.SEQUENCE,!0,[n.create(n.Class.UNIVERSAL,n.Type.SEQUENCE,!0,[n.create(n.Class.UNIVERSAL,n.Type.SEQUENCE,!0,[n.create(n.Class.UNIVERSAL,n.Type.OID,!1,n.oidToDer(o.oids.sha1).getBytes()),n.create(n.Class.UNIVERSAL,n.Type.NULL,!1,"")]),n.create(n.Class.UNIVERSAL,n.Type.OCTETSTRING,!1,B.getBytes())]),n.create(n.Class.UNIVERSAL,n.Type.OCTETSTRING,!1,I.getBytes()),n.create(n.Class.UNIVERSAL,n.Type.INTEGER,!1,n.integerToDer(T).getBytes())])}return n.create(n.Class.UNIVERSAL,n.Type.SEQUENCE,!0,[n.create(n.Class.UNIVERSAL,n.Type.INTEGER,!1,n.integerToDer(3).getBytes()),n.create(n.Class.UNIVERSAL,n.Type.SEQUENCE,!0,[n.create(n.Class.UNIVERSAL,n.Type.OID,!1,n.oidToDer(o.oids.data).getBytes()),n.create(n.Class.CONTEXT_SPECIFIC,0,!0,[n.create(n.Class.UNIVERSAL,n.Type.OCTETSTRING,!1,n.toDer(C).getBytes())])]),A])},s.generateKey=i.pbe.generatePkcs12Key},79437:(t,e,r)=>{var i=r(3832);r(8925),r(3068),r(33480),r(66270),r(26953),r(95496),r(49563),r(97116),r(25414);var n=i.asn1,o=t.exports=i.pkcs7=i.pkcs7||{};function s(t){var e={},r=[];if(!n.validate(t,o.asn1.recipientInfoValidator,e,r)){var s=new Error("Cannot read PKCS#7 RecipientInfo. ASN.1 object is not an PKCS#7 RecipientInfo.");throw s.errors=r,s}return{version:e.version.charCodeAt(0),issuer:i.pki.RDNAttributesAsArray(e.issuer),serialNumber:i.util.createBuffer(e.serial).toHex(),encryptedContent:{algorithm:n.derToOid(e.encAlgorithm),parameter:e.encParameter.value,content:e.encKey}}}function a(t){for(var e,r=[],o=0;o<t.length;++o)r.push((e=t[o],n.create(n.Class.UNIVERSAL,n.Type.SEQUENCE,!0,[n.create(n.Class.UNIVERSAL,n.Type.INTEGER,!1,n.integerToDer(e.version).getBytes()),n.create(n.Class.UNIVERSAL,n.Type.SEQUENCE,!0,[i.pki.distinguishedNameToAsn1({attributes:e.issuer}),n.create(n.Class.UNIVERSAL,n.Type.INTEGER,!1,i.util.hexToBytes(e.serialNumber))]),n.create(n.Class.UNIVERSAL,n.Type.SEQUENCE,!0,[n.create(n.Class.UNIVERSAL,n.Type.OID,!1,n.oidToDer(e.encryptedContent.algorithm).getBytes()),n.create(n.Class.UNIVERSAL,n.Type.NULL,!1,"")]),n.create(n.Class.UNIVERSAL,n.Type.OCTETSTRING,!1,e.encryptedContent.content)])));return r}function u(t){var e=n.create(n.Class.UNIVERSAL,n.Type.SEQUENCE,!0,[n.create(n.Class.UNIVERSAL,n.Type.INTEGER,!1,n.integerToDer(t.version).getBytes()),n.create(n.Class.UNIVERSAL,n.Type.SEQUENCE,!0,[i.pki.distinguishedNameToAsn1({attributes:t.issuer}),n.create(n.Class.UNIVERSAL,n.Type.INTEGER,!1,i.util.hexToBytes(t.serialNumber))]),n.create(n.Class.UNIVERSAL,n.Type.SEQUENCE,!0,[n.create(n.Class.UNIVERSAL,n.Type.OID,!1,n.oidToDer(t.digestAlgorithm).getBytes()),n.create(n.Class.UNIVERSAL,n.Type.NULL,!1,"")])]);if(t.authenticatedAttributesAsn1&&e.value.push(t.authenticatedAttributesAsn1),e.value.push(n.create(n.Class.UNIVERSAL,n.Type.SEQUENCE,!0,[n.create(n.Class.UNIVERSAL,n.Type.OID,!1,n.oidToDer(t.signatureAlgorithm).getBytes()),n.create(n.Class.UNIVERSAL,n.Type.NULL,!1,"")])),e.value.push(n.create(n.Class.UNIVERSAL,n.Type.OCTETSTRING,!1,t.signature)),t.unauthenticatedAttributes.length>0){for(var r=n.create(n.Class.CONTEXT_SPECIFIC,1,!0,[]),o=0;o<t.unauthenticatedAttributes.length;++o){var s=t.unauthenticatedAttributes[o];r.values.push(h(s))}e.value.push(r)}return e}function h(t){var e;if(t.type===i.pki.oids.contentType)e=n.create(n.Class.UNIVERSAL,n.Type.OID,!1,n.oidToDer(t.value).getBytes());else if(t.type===i.pki.oids.messageDigest)e=n.create(n.Class.UNIVERSAL,n.Type.OCTETSTRING,!1,t.value.bytes());else if(t.type===i.pki.oids.signingTime){var r=new Date("1950-01-01T00:00:00Z"),o=new Date("2050-01-01T00:00:00Z"),s=t.value;if("string"==typeof s){var a=Date.parse(s);s=isNaN(a)?13===s.length?n.utcTimeToDate(s):n.generalizedTimeToDate(s):new Date(a)}e=s>=r&&s<o?n.create(n.Class.UNIVERSAL,n.Type.UTCTIME,!1,n.dateToUtcTime(s)):n.create(n.Class.UNIVERSAL,n.Type.GENERALIZEDTIME,!1,n.dateToGeneralizedTime(s))}return n.create(n.Class.UNIVERSAL,n.Type.SEQUENCE,!0,[n.create(n.Class.UNIVERSAL,n.Type.OID,!1,n.oidToDer(t.type).getBytes()),n.create(n.Class.UNIVERSAL,n.Type.SET,!0,[e])])}function c(t,e,r){var o={};if(!n.validate(e,r,o,[])){var s=new Error("Cannot read PKCS#7 message. ASN.1 object is not a supported PKCS#7 message.");throw s.errors=s,s}if(n.derToOid(o.contentType)!==i.pki.oids.data)throw new Error("Unsupported PKCS#7 message. Only wrapped ContentType Data supported.");if(o.encryptedContent){var a="";if(i.util.isArray(o.encryptedContent))for(var u=0;u<o.encryptedContent.length;++u){if(o.encryptedContent[u].type!==n.Type.OCTETSTRING)throw new Error("Malformed PKCS#7 message, expecting encrypted content constructed of only OCTET STRING objects.");a+=o.encryptedContent[u].value}else a=o.encryptedContent;t.encryptedContent={algorithm:n.derToOid(o.encAlgorithm),parameter:i.util.createBuffer(o.encParameter.value),content:i.util.createBuffer(a)}}if(o.content){if(a="",i.util.isArray(o.content))for(u=0;u<o.content.length;++u){if(o.content[u].type!==n.Type.OCTETSTRING)throw new Error("Malformed PKCS#7 message, expecting content constructed of only OCTET STRING objects.");a+=o.content[u].value}else a=o.content;t.content=i.util.createBuffer(a)}return t.version=o.version.charCodeAt(0),t.rawCapture=o,o}function f(t){if(void 0===t.encryptedContent.key)throw new Error("Symmetric key not available.");if(void 0===t.content){var e;switch(t.encryptedContent.algorithm){case i.pki.oids["aes128-CBC"]:case i.pki.oids["aes192-CBC"]:case i.pki.oids["aes256-CBC"]:e=i.aes.createDecryptionCipher(t.encryptedContent.key);break;case i.pki.oids.desCBC:case i.pki.oids["des-EDE3-CBC"]:e=i.des.createDecryptionCipher(t.encryptedContent.key);break;default:throw new Error("Unsupported symmetric cipher, OID "+t.encryptedContent.algorithm)}if(e.start(t.encryptedContent.parameter),e.update(t.encryptedContent.content),!e.finish())throw new Error("Symmetric decryption failed.");t.content=e.output}}o.messageFromPem=function(t){var e=i.pem.decode(t)[0];if("PKCS7"!==e.type){var r=new Error('Could not convert PKCS#7 message from PEM; PEM header type is not "PKCS#7".');throw r.headerType=e.type,r}if(e.procType&&"ENCRYPTED"===e.procType.type)throw new Error("Could not convert PKCS#7 message from PEM; PEM is encrypted.");var s=n.fromDer(e.body);return o.messageFromAsn1(s)},o.messageToPem=function(t,e){var r={type:"PKCS7",body:n.toDer(t.toAsn1()).getBytes()};return i.pem.encode(r,{maxline:e})},o.messageFromAsn1=function(t){var e={},r=[];if(!n.validate(t,o.asn1.contentInfoValidator,e,r)){var s=new Error("Cannot read PKCS#7 message. ASN.1 object is not an PKCS#7 ContentInfo.");throw s.errors=r,s}var a,u=n.derToOid(e.contentType);switch(u){case i.pki.oids.envelopedData:a=o.createEnvelopedData();break;case i.pki.oids.encryptedData:a=o.createEncryptedData();break;case i.pki.oids.signedData:a=o.createSignedData();break;default:throw new Error("Cannot read PKCS#7 message. ContentType with OID "+u+" is not (yet) supported.")}return a.fromAsn1(e.content.value[0]),a},o.createSignedData=function(){var t=null;return t={type:i.pki.oids.signedData,version:1,certificates:[],crls:[],signers:[],digestAlgorithmIdentifiers:[],contentInfo:null,signerInfos:[],fromAsn1:function(e){if(c(t,e,o.asn1.signedDataValidator),t.certificates=[],t.crls=[],t.digestAlgorithmIdentifiers=[],t.contentInfo=null,t.signerInfos=[],t.rawCapture.certificates)for(var r=t.rawCapture.certificates.value,n=0;n<r.length;++n)t.certificates.push(i.pki.certificateFromAsn1(r[n]))},toAsn1:function(){t.contentInfo||t.sign();for(var e=[],r=0;r<t.certificates.length;++r)e.push(i.pki.certificateToAsn1(t.certificates[r]));var o=[],s=n.create(n.Class.CONTEXT_SPECIFIC,0,!0,[n.create(n.Class.UNIVERSAL,n.Type.SEQUENCE,!0,[n.create(n.Class.UNIVERSAL,n.Type.INTEGER,!1,n.integerToDer(t.version).getBytes()),n.create(n.Class.UNIVERSAL,n.Type.SET,!0,t.digestAlgorithmIdentifiers),t.contentInfo])]);return e.length>0&&s.value[0].value.push(n.create(n.Class.CONTEXT_SPECIFIC,0,!0,e)),o.length>0&&s.value[0].value.push(n.create(n.Class.CONTEXT_SPECIFIC,1,!0,o)),s.value[0].value.push(n.create(n.Class.UNIVERSAL,n.Type.SET,!0,t.signerInfos)),n.create(n.Class.UNIVERSAL,n.Type.SEQUENCE,!0,[n.create(n.Class.UNIVERSAL,n.Type.OID,!1,n.oidToDer(t.type).getBytes()),s])},addSigner:function(e){var r=e.issuer,n=e.serialNumber;if(e.certificate){var o=e.certificate;"string"==typeof o&&(o=i.pki.certificateFromPem(o)),r=o.issuer.attributes,n=o.serialNumber}var s=e.key;if(!s)throw new Error("Could not add PKCS#7 signer; no private key specified.");"string"==typeof s&&(s=i.pki.privateKeyFromPem(s));var a=e.digestAlgorithm||i.pki.oids.sha1;switch(a){case i.pki.oids.sha1:case i.pki.oids.sha256:case i.pki.oids.sha384:case i.pki.oids.sha512:case i.pki.oids.md5:break;default:throw new Error("Could not add PKCS#7 signer; unknown message digest algorithm: "+a)}var u=e.authenticatedAttributes||[];if(u.length>0){for(var h=!1,c=!1,f=0;f<u.length;++f){var l=u[f];if(h||l.type!==i.pki.oids.contentType){if(c||l.type!==i.pki.oids.messageDigest);else if(c=!0,h)break}else if(h=!0,c)break}if(!h||!c)throw new Error("Invalid signer.authenticatedAttributes. If signer.authenticatedAttributes is specified, then it must contain at least two attributes, PKCS #9 content-type and PKCS #9 message-digest.")}t.signers.push({key:s,version:1,issuer:r,serialNumber:n,digestAlgorithm:a,signatureAlgorithm:i.pki.oids.rsaEncryption,signature:null,authenticatedAttributes:u,unauthenticatedAttributes:[]})},sign:function(e){var r;e=e||{},("object"!=typeof t.content||null===t.contentInfo)&&(t.contentInfo=n.create(n.Class.UNIVERSAL,n.Type.SEQUENCE,!0,[n.create(n.Class.UNIVERSAL,n.Type.OID,!1,n.oidToDer(i.pki.oids.data).getBytes())]),"content"in t&&(t.content instanceof i.util.ByteBuffer?r=t.content.bytes():"string"==typeof t.content&&(r=i.util.encodeUtf8(t.content)),e.detached?t.detachedContent=n.create(n.Class.UNIVERSAL,n.Type.OCTETSTRING,!1,r):t.contentInfo.value.push(n.create(n.Class.CONTEXT_SPECIFIC,0,!0,[n.create(n.Class.UNIVERSAL,n.Type.OCTETSTRING,!1,r)])))),0!==t.signers.length&&function(e){var r;if(!(r=t.detachedContent?t.detachedContent:(r=t.contentInfo.value[1]).value[0]))throw new Error("Could not sign PKCS#7 message; there is no content to sign.");var o=n.derToOid(t.contentInfo.value[0].value),s=n.toDer(r);for(var a in s.getByte(),n.getBerValueLength(s),s=s.getBytes(),e)e[a].start().update(s);for(var c=new Date,f=0;f<t.signers.length;++f){var l=t.signers[f];if(0===l.authenticatedAttributes.length){if(o!==i.pki.oids.data)throw new Error("Invalid signer; authenticatedAttributes must be present when the ContentInfo content type is not PKCS#7 Data.")}else{l.authenticatedAttributesAsn1=n.create(n.Class.CONTEXT_SPECIFIC,0,!0,[]);for(var d=n.create(n.Class.UNIVERSAL,n.Type.SET,!0,[]),p=0;p<l.authenticatedAttributes.length;++p){var g=l.authenticatedAttributes[p];g.type===i.pki.oids.messageDigest?g.value=e[l.digestAlgorithm].digest():g.type===i.pki.oids.signingTime&&(g.value||(g.value=c)),d.value.push(h(g)),l.authenticatedAttributesAsn1.value.push(h(g))}s=n.toDer(d).getBytes(),l.md.start().update(s)}l.signature=l.key.sign(l.md,"RSASSA-PKCS1-V1_5")}t.signerInfos=function(t){for(var e=[],r=0;r<t.length;++r)e.push(u(t[r]));return e}(t.signers)}(function(){for(var e={},r=0;r<t.signers.length;++r){var o=t.signers[r];(s=o.digestAlgorithm)in e||(e[s]=i.md[i.pki.oids[s]].create()),0===o.authenticatedAttributes.length?o.md=e[s]:o.md=i.md[i.pki.oids[s]].create()}for(var s in t.digestAlgorithmIdentifiers=[],e)t.digestAlgorithmIdentifiers.push(n.create(n.Class.UNIVERSAL,n.Type.SEQUENCE,!0,[n.create(n.Class.UNIVERSAL,n.Type.OID,!1,n.oidToDer(s).getBytes()),n.create(n.Class.UNIVERSAL,n.Type.NULL,!1,"")]));return e}())},verify:function(){throw new Error("PKCS#7 signature verification not yet implemented.")},addCertificate:function(e){"string"==typeof e&&(e=i.pki.certificateFromPem(e)),t.certificates.push(e)},addCertificateRevokationList:function(t){throw new Error("PKCS#7 CRL support not yet implemented.")}}},o.createEncryptedData=function(){var t=null;return t={type:i.pki.oids.encryptedData,version:0,encryptedContent:{algorithm:i.pki.oids["aes256-CBC"]},fromAsn1:function(e){c(t,e,o.asn1.encryptedDataValidator)},decrypt:function(e){void 0!==e&&(t.encryptedContent.key=e),f(t)}}},o.createEnvelopedData=function(){var t=null;return t={type:i.pki.oids.envelopedData,version:0,recipients:[],encryptedContent:{algorithm:i.pki.oids["aes256-CBC"]},fromAsn1:function(e){var r=c(t,e,o.asn1.envelopedDataValidator);t.recipients=function(t){for(var e=[],r=0;r<t.length;++r)e.push(s(t[r]));return e}(r.recipientInfos.value)},toAsn1:function(){return n.create(n.Class.UNIVERSAL,n.Type.SEQUENCE,!0,[n.create(n.Class.UNIVERSAL,n.Type.OID,!1,n.oidToDer(t.type).getBytes()),n.create(n.Class.CONTEXT_SPECIFIC,0,!0,[n.create(n.Class.UNIVERSAL,n.Type.SEQUENCE,!0,[n.create(n.Class.UNIVERSAL,n.Type.INTEGER,!1,n.integerToDer(t.version).getBytes()),n.create(n.Class.UNIVERSAL,n.Type.SET,!0,a(t.recipients)),n.create(n.Class.UNIVERSAL,n.Type.SEQUENCE,!0,(e=t.encryptedContent,[n.create(n.Class.UNIVERSAL,n.Type.OID,!1,n.oidToDer(i.pki.oids.data).getBytes()),n.create(n.Class.UNIVERSAL,n.Type.SEQUENCE,!0,[n.create(n.Class.UNIVERSAL,n.Type.OID,!1,n.oidToDer(e.algorithm).getBytes()),n.create(n.Class.UNIVERSAL,n.Type.OCTETSTRING,!1,e.parameter.getBytes())]),n.create(n.Class.CONTEXT_SPECIFIC,0,!0,[n.create(n.Class.UNIVERSAL,n.Type.OCTETSTRING,!1,e.content.getBytes())])]))])])]);var e},findRecipient:function(e){for(var r=e.issuer.attributes,i=0;i<t.recipients.length;++i){var n=t.recipients[i],o=n.issuer;if(n.serialNumber===e.serialNumber&&o.length===r.length){for(var s=!0,a=0;a<r.length;++a)if(o[a].type!==r[a].type||o[a].value!==r[a].value){s=!1;break}if(s)return n}}return null},decrypt:function(e,r){if(void 0===t.encryptedContent.key&&void 0!==e&&void 0!==r)switch(e.encryptedContent.algorithm){case i.pki.oids.rsaEncryption:case i.pki.oids.desCBC:var n=r.decrypt(e.encryptedContent.content);t.encryptedContent.key=i.util.createBuffer(n);break;default:throw new Error("Unsupported asymmetric cipher, OID "+e.encryptedContent.algorithm)}f(t)},addRecipient:function(e){t.recipients.push({version:0,issuer:e.issuer.attributes,serialNumber:e.serialNumber,encryptedContent:{algorithm:i.pki.oids.rsaEncryption,key:e.publicKey}})},encrypt:function(e,r){if(void 0===t.encryptedContent.content){var n,o,s;switch(r=r||t.encryptedContent.algorithm,e=e||t.encryptedContent.key,r){case i.pki.oids["aes128-CBC"]:n=16,o=16,s=i.aes.createEncryptionCipher;break;case i.pki.oids["aes192-CBC"]:n=24,o=16,s=i.aes.createEncryptionCipher;break;case i.pki.oids["aes256-CBC"]:n=32,o=16,s=i.aes.createEncryptionCipher;break;case i.pki.oids["des-EDE3-CBC"]:n=24,o=8,s=i.des.createEncryptionCipher;break;default:throw new Error("Unsupported symmetric cipher, OID "+r)}if(void 0===e)e=i.util.createBuffer(i.random.getBytes(n));else if(e.length()!=n)throw new Error("Symmetric key has wrong length; got "+e.length()+" bytes, expected "+n+".");t.encryptedContent.algorithm=r,t.encryptedContent.key=e,t.encryptedContent.parameter=i.util.createBuffer(i.random.getBytes(o));var a=s(e);if(a.start(t.encryptedContent.parameter.copy()),a.update(t.content),!a.finish())throw new Error("Symmetric encryption failed.");t.encryptedContent.content=a.output}for(var u=0;u<t.recipients.length;++u){var h=t.recipients[u];if(void 0===h.encryptedContent.content)switch(h.encryptedContent.algorithm){case i.pki.oids.rsaEncryption:h.encryptedContent.content=h.encryptedContent.key.encrypt(t.encryptedContent.key.data);break;default:throw new Error("Unsupported asymmetric cipher, OID "+h.encryptedContent.algorithm)}}}}}},95496:(t,e,r)=>{var i=r(3832);r(3068),r(97116);var n=i.asn1,o=t.exports=i.pkcs7asn1=i.pkcs7asn1||{};i.pkcs7=i.pkcs7||{},i.pkcs7.asn1=o;var s={name:"ContentInfo",tagClass:n.Class.UNIVERSAL,type:n.Type.SEQUENCE,constructed:!0,value:[{name:"ContentInfo.ContentType",tagClass:n.Class.UNIVERSAL,type:n.Type.OID,constructed:!1,capture:"contentType"},{name:"ContentInfo.content",tagClass:n.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,captureAsn1:"content"}]};o.contentInfoValidator=s;var a={name:"EncryptedContentInfo",tagClass:n.Class.UNIVERSAL,type:n.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedContentInfo.contentType",tagClass:n.Class.UNIVERSAL,type:n.Type.OID,constructed:!1,capture:"contentType"},{name:"EncryptedContentInfo.contentEncryptionAlgorithm",tagClass:n.Class.UNIVERSAL,type:n.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedContentInfo.contentEncryptionAlgorithm.algorithm",tagClass:n.Class.UNIVERSAL,type:n.Type.OID,constructed:!1,capture:"encAlgorithm"},{name:"EncryptedContentInfo.contentEncryptionAlgorithm.parameter",tagClass:n.Class.UNIVERSAL,captureAsn1:"encParameter"}]},{name:"EncryptedContentInfo.encryptedContent",tagClass:n.Class.CONTEXT_SPECIFIC,type:0,capture:"encryptedContent",captureAsn1:"encryptedContentAsn1"}]};o.envelopedDataValidator={name:"EnvelopedData",tagClass:n.Class.UNIVERSAL,type:n.Type.SEQUENCE,constructed:!0,value:[{name:"EnvelopedData.Version",tagClass:n.Class.UNIVERSAL,type:n.Type.INTEGER,constructed:!1,capture:"version"},{name:"EnvelopedData.RecipientInfos",tagClass:n.Class.UNIVERSAL,type:n.Type.SET,constructed:!0,captureAsn1:"recipientInfos"}].concat(a)},o.encryptedDataValidator={name:"EncryptedData",tagClass:n.Class.UNIVERSAL,type:n.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedData.Version",tagClass:n.Class.UNIVERSAL,type:n.Type.INTEGER,constructed:!1,capture:"version"}].concat(a)};var u={name:"SignerInfo",tagClass:n.Class.UNIVERSAL,type:n.Type.SEQUENCE,constructed:!0,value:[{name:"SignerInfo.version",tagClass:n.Class.UNIVERSAL,type:n.Type.INTEGER,constructed:!1},{name:"SignerInfo.issuerAndSerialNumber",tagClass:n.Class.UNIVERSAL,type:n.Type.SEQUENCE,constructed:!0,value:[{name:"SignerInfo.issuerAndSerialNumber.issuer",tagClass:n.Class.UNIVERSAL,type:n.Type.SEQUENCE,constructed:!0,captureAsn1:"issuer"},{name:"SignerInfo.issuerAndSerialNumber.serialNumber",tagClass:n.Class.UNIVERSAL,type:n.Type.INTEGER,constructed:!1,capture:"serial"}]},{name:"SignerInfo.digestAlgorithm",tagClass:n.Class.UNIVERSAL,type:n.Type.SEQUENCE,constructed:!0,value:[{name:"SignerInfo.digestAlgorithm.algorithm",tagClass:n.Class.UNIVERSAL,type:n.Type.OID,constructed:!1,capture:"digestAlgorithm"},{name:"SignerInfo.digestAlgorithm.parameter",tagClass:n.Class.UNIVERSAL,constructed:!1,captureAsn1:"digestParameter",optional:!0}]},{name:"SignerInfo.authenticatedAttributes",tagClass:n.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,capture:"authenticatedAttributes"},{name:"SignerInfo.digestEncryptionAlgorithm",tagClass:n.Class.UNIVERSAL,type:n.Type.SEQUENCE,constructed:!0,capture:"signatureAlgorithm"},{name:"SignerInfo.encryptedDigest",tagClass:n.Class.UNIVERSAL,type:n.Type.OCTETSTRING,constructed:!1,capture:"signature"},{name:"SignerInfo.unauthenticatedAttributes",tagClass:n.Class.CONTEXT_SPECIFIC,type:1,constructed:!0,optional:!0,capture:"unauthenticatedAttributes"}]};o.signedDataValidator={name:"SignedData",tagClass:n.Class.UNIVERSAL,type:n.Type.SEQUENCE,constructed:!0,value:[{name:"SignedData.Version",tagClass:n.Class.UNIVERSAL,type:n.Type.INTEGER,constructed:!1,capture:"version"},{name:"SignedData.DigestAlgorithms",tagClass:n.Class.UNIVERSAL,type:n.Type.SET,constructed:!0,captureAsn1:"digestAlgorithms"},s,{name:"SignedData.Certificates",tagClass:n.Class.CONTEXT_SPECIFIC,type:0,optional:!0,captureAsn1:"certificates"},{name:"SignedData.CertificateRevocationLists",tagClass:n.Class.CONTEXT_SPECIFIC,type:1,optional:!0,captureAsn1:"crls"},{name:"SignedData.SignerInfos",tagClass:n.Class.UNIVERSAL,type:n.Type.SET,capture:"signerInfos",optional:!0,value:[u]}]},o.recipientInfoValidator={name:"RecipientInfo",tagClass:n.Class.UNIVERSAL,type:n.Type.SEQUENCE,constructed:!0,value:[{name:"RecipientInfo.version",tagClass:n.Class.UNIVERSAL,type:n.Type.INTEGER,constructed:!1,capture:"version"},{name:"RecipientInfo.issuerAndSerial",tagClass:n.Class.UNIVERSAL,type:n.Type.SEQUENCE,constructed:!0,value:[{name:"RecipientInfo.issuerAndSerial.issuer",tagClass:n.Class.UNIVERSAL,type:n.Type.SEQUENCE,constructed:!0,captureAsn1:"issuer"},{name:"RecipientInfo.issuerAndSerial.serialNumber",tagClass:n.Class.UNIVERSAL,type:n.Type.INTEGER,constructed:!1,capture:"serial"}]},{name:"RecipientInfo.keyEncryptionAlgorithm",tagClass:n.Class.UNIVERSAL,type:n.Type.SEQUENCE,constructed:!0,value:[{name:"RecipientInfo.keyEncryptionAlgorithm.algorithm",tagClass:n.Class.UNIVERSAL,type:n.Type.OID,constructed:!1,capture:"encAlgorithm"},{name:"RecipientInfo.keyEncryptionAlgorithm.parameter",tagClass:n.Class.UNIVERSAL,constructed:!1,captureAsn1:"encParameter"}]},{name:"RecipientInfo.encryptedKey",tagClass:n.Class.UNIVERSAL,type:n.Type.OCTETSTRING,constructed:!1,capture:"encKey"}]}},4742:(t,e,r)=>{var i=r(3832);r(3068),r(66270),r(97450),r(26953),r(98960),r(55147),r(96007),r(28095),r(97116),r(25414);var n=i.asn1,o=t.exports=i.pki=i.pki||{};o.pemToDer=function(t){var e=i.pem.decode(t)[0];if(e.procType&&"ENCRYPTED"===e.procType.type)throw new Error("Could not convert PEM to DER; PEM is encrypted.");return i.util.createBuffer(e.body)},o.privateKeyFromPem=function(t){var e=i.pem.decode(t)[0];if("PRIVATE KEY"!==e.type&&"RSA PRIVATE KEY"!==e.type){var r=new Error('Could not convert private key from PEM; PEM header type is not "PRIVATE KEY" or "RSA PRIVATE KEY".');throw r.headerType=e.type,r}if(e.procType&&"ENCRYPTED"===e.procType.type)throw new Error("Could not convert private key from PEM; PEM is encrypted.");var s=n.fromDer(e.body);return o.privateKeyFromAsn1(s)},o.privateKeyToPem=function(t,e){var r={type:"RSA PRIVATE KEY",body:n.toDer(o.privateKeyToAsn1(t)).getBytes()};return i.pem.encode(r,{maxline:e})},o.privateKeyInfoToPem=function(t,e){var r={type:"PRIVATE KEY",body:n.toDer(t).getBytes()};return i.pem.encode(r,{maxline:e})}},29654:(t,e,r)=>{var i=r(3832);r(97116),r(15764),r(49563),function(){if(i.prime)t.exports=i.prime;else{var e=t.exports=i.prime=i.prime||{},r=i.jsbn.BigInteger,n=[6,4,2,4,2,4,6,2],o=new r(null);o.fromInt(30);var s=function(t,e){return t|e};e.generateProbablePrime=function(t,e,n){"function"==typeof e&&(n=e,e={});var o=(e=e||{}).algorithm||"PRIMEINC";"string"==typeof o&&(o={name:o}),o.options=o.options||{};var s=e.prng||i.random,u={nextBytes:function(t){for(var e=s.getBytesSync(t.length),r=0;r<t.length;++r)t[r]=e.charCodeAt(r)}};if("PRIMEINC"===o.name)return function(t,e,n,o){return"workers"in n?function(t,e,n,o){if("undefined"==typeof Worker)return a(t,e,n,o);var s=h(t,e),u=n.workers,c=n.workLoad||100,f=30*c/8,l=n.workerScript||"forge/prime.worker.js";if(-1===u)return i.util.estimateCores((function(t,e){t&&(e=2),u=e-1,d()}));function d(){u=Math.max(1,u);for(var i=[],n=0;n<u;++n)i[n]=new Worker(l);for(n=0;n<u;++n)i[n].addEventListener("message",d);var a=!1;function d(n){if(!a){var u=n.data;if(u.found){for(var l=0;l<i.length;++l)i[l].terminate();return a=!0,o(null,new r(u.prime,16))}s.bitLength()>t&&(s=h(t,e));var d=s.toString(16);n.target.postMessage({hex:d,workLoad:c}),s.dAddOffset(f,0)}}}d()}(t,e,n,o):a(t,e,n,o)}(t,u,o.options,n);throw new Error("Invalid prime generation algorithm: "+o.name)}}function a(t,e,r,i){var n=h(t,e),o=function(t){return t<=100?27:t<=150?18:t<=200?15:t<=250?12:t<=300?9:t<=350?8:t<=400?7:t<=500?6:t<=600?5:t<=800?4:t<=1250?3:2}(n.bitLength());"millerRabinTests"in r&&(o=r.millerRabinTests);var s=10;"maxBlockTime"in r&&(s=r.maxBlockTime),u(n,t,e,0,o,s,i)}function u(t,e,r,o,s,a,c){var f=+new Date;do{if(t.bitLength()>e&&(t=h(e,r)),t.isProbablePrime(s))return c(null,t);t.dAddOffset(n[o++%8],0)}while(a<0||+new Date-f<a);i.util.setImmediate((function(){u(t,e,r,o,s,a,c)}))}function h(t,e){var i=new r(t,e),n=t-1;return i.testBit(n)||i.bitwiseTo(r.ONE.shiftLeft(n),s,i),i.dAddOffset(31-i.mod(o).byteValue(),0),i}}()},74933:(t,e,r)=>{var i=r(3832);r(97116);var n=null;!i.util.isNodejs||i.options.usePureJavaScript||process.versions["node-webkit"]||(n=r(63906)),(t.exports=i.prng=i.prng||{}).create=function(t){for(var e={plugin:t,key:null,seed:null,time:null,reseeds:0,generated:0,keyBytes:""},r=t.md,o=new Array(32),s=0;s<32;++s)o[s]=r.create();function a(){if(e.pools[0].messageLength>=32)return u();var t=32-e.pools[0].messageLength<<5;e.collect(e.seedFileSync(t)),u()}function u(){e.reseeds=4294967295===e.reseeds?0:e.reseeds+1;var t=e.plugin.md.create();t.update(e.keyBytes);for(var r=1,i=0;i<32;++i)e.reseeds%r==0&&(t.update(e.pools[i].digest().getBytes()),e.pools[i].start()),r<<=1;e.keyBytes=t.digest().getBytes(),t.start(),t.update(e.keyBytes);var n=t.digest().getBytes();e.key=e.plugin.formatKey(e.keyBytes),e.seed=e.plugin.formatSeed(n),e.generated=0}function h(t){var e=null,r=i.util.globalScope,n=r.crypto||r.msCrypto;n&&n.getRandomValues&&(e=function(t){return n.getRandomValues(t)});var o=i.util.createBuffer();if(e)for(;o.length()<t;){var s=Math.max(1,Math.min(t-o.length(),65536)/4),a=new Uint32Array(Math.floor(s));try{e(a);for(var u=0;u<a.length;++u)o.putInt32(a[u])}catch(t){if(!("undefined"!=typeof QuotaExceededError&&t instanceof QuotaExceededError))throw t}}if(o.length()<t)for(var h,c,f,l=Math.floor(65536*Math.random());o.length()<t;)for(c=16807*(65535&l),c+=(32767&(h=16807*(l>>16)))<<16,l=4294967295&(c=(2147483647&(c+=h>>15))+(c>>31)),u=0;u<3;++u)f=l>>>(u<<3),f^=Math.floor(256*Math.random()),o.putByte(String.fromCharCode(255&f));return o.getBytes(t)}return e.pools=o,e.pool=0,e.generate=function(t,r){if(!r)return e.generateSync(t);var n=e.plugin.cipher,o=e.plugin.increment,s=e.plugin.formatKey,a=e.plugin.formatSeed,h=i.util.createBuffer();e.key=null,function c(f){if(f)return r(f);if(h.length()>=t)return r(null,h.getBytes(t));if(e.generated>1048575&&(e.key=null),null===e.key)return i.util.nextTick((function(){!function(t){if(e.pools[0].messageLength>=32)return u(),t();var r=32-e.pools[0].messageLength<<5;e.seedFile(r,(function(r,i){if(r)return t(r);e.collect(i),u(),t()}))}(c)}));var l=n(e.key,e.seed);e.generated+=l.length,h.putBytes(l),e.key=s(n(e.key,o(e.seed))),e.seed=a(n(e.key,e.seed)),i.util.setImmediate(c)}()},e.generateSync=function(t){var r=e.plugin.cipher,n=e.plugin.increment,o=e.plugin.formatKey,s=e.plugin.formatSeed;e.key=null;for(var u=i.util.createBuffer();u.length()<t;){e.generated>1048575&&(e.key=null),null===e.key&&a();var h=r(e.key,e.seed);e.generated+=h.length,u.putBytes(h),e.key=o(r(e.key,n(e.seed))),e.seed=s(r(e.key,e.seed))}return u.getBytes(t)},n?(e.seedFile=function(t,e){n.randomBytes(t,(function(t,r){if(t)return e(t);e(null,r.toString())}))},e.seedFileSync=function(t){return n.randomBytes(t).toString()}):(e.seedFile=function(t,e){try{e(null,h(t))}catch(t){e(t)}},e.seedFileSync=h),e.collect=function(t){for(var r=t.length,i=0;i<r;++i)e.pools[e.pool].update(t.substr(i,1)),e.pool=31===e.pool?0:e.pool+1},e.collectInt=function(t,r){for(var i="",n=0;n<r;n+=8)i+=String.fromCharCode(t>>n&255);e.collect(i)},e.registerWorker=function(t){t===self?e.seedFile=function(t,e){self.addEventListener("message",(function t(r){var i=r.data;i.forge&&i.forge.prng&&(self.removeEventListener("message",t),e(i.forge.prng.err,i.forge.prng.bytes))})),self.postMessage({forge:{prng:{needed:t}}})}:t.addEventListener("message",(function(r){var i=r.data;i.forge&&i.forge.prng&&e.seedFile(i.forge.prng.needed,(function(e,r){t.postMessage({forge:{prng:{err:e,bytes:r}}})}))}))},e}},96007:(t,e,r)=>{var i=r(3832);r(49563),r(97116),(t.exports=i.pss=i.pss||{}).create=function(t){3===arguments.length&&(t={md:arguments[0],mgf:arguments[1],saltLength:arguments[2]});var e,r=t.md,n=t.mgf,o=r.digestLength,s=t.salt||null;if("string"==typeof s&&(s=i.util.createBuffer(s)),"saltLength"in t)e=t.saltLength;else{if(null===s)throw new Error("Salt length not specified or specific salt not given.");e=s.length()}if(null!==s&&s.length()!==e)throw new Error("Given salt length does not match length of given salt.");var a=t.prng||i.random,u={encode:function(t,u){var h,c,f=u-1,l=Math.ceil(f/8),d=t.digest().getBytes();if(l<o+e+2)throw new Error("Message is too long to encrypt.");c=null===s?a.getBytesSync(e):s.bytes();var p=new i.util.ByteBuffer;p.fillWithByte(0,8),p.putBytes(d),p.putBytes(c),r.start(),r.update(p.getBytes());var g=r.digest().getBytes(),y=new i.util.ByteBuffer;y.fillWithByte(0,l-e-o-2),y.putByte(1),y.putBytes(c);var m=y.getBytes(),v=l-o-1,b=n.generate(g,v),w="";for(h=0;h<v;h++)w+=String.fromCharCode(m.charCodeAt(h)^b.charCodeAt(h));var _=65280>>8*l-f&255;return(w=String.fromCharCode(w.charCodeAt(0)&~_)+w.substr(1))+g+String.fromCharCode(188)},verify:function(t,s,a){var u,h=a-1,c=Math.ceil(h/8);if(s=s.substr(-c),c<o+e+2)throw new Error("Inconsistent parameters to PSS signature verification.");if(188!==s.charCodeAt(c-1))throw new Error("Encoded message does not end in 0xBC.");var f=c-o-1,l=s.substr(0,f),d=s.substr(f,o),p=65280>>8*c-h&255;if(0!=(l.charCodeAt(0)&p))throw new Error("Bits beyond keysize not zero as expected.");var g=n.generate(d,f),y="";for(u=0;u<f;u++)y+=String.fromCharCode(l.charCodeAt(u)^g.charCodeAt(u));y=String.fromCharCode(y.charCodeAt(0)&~p)+y.substr(1);var m=c-o-e-2;for(u=0;u<m;u++)if(0!==y.charCodeAt(u))throw new Error("Leftmost octets not zero as expected");if(1!==y.charCodeAt(m))throw new Error("Inconsistent PSS signature, 0x01 marker not found");var v=y.substr(-e),b=new i.util.ByteBuffer;return b.fillWithByte(0,8),b.putBytes(t),b.putBytes(v),r.start(),r.update(b.getBytes()),d===r.digest().getBytes()}};return u}},49563:(t,e,r)=>{var i=r(3832);r(8925),r(41668),r(74933),r(97116),i.random&&i.random.getBytes?t.exports=i.random:function(e){var r={},n=new Array(4),o=i.util.createBuffer();function s(){var t=i.prng.create(r);return t.getBytes=function(e,r){return t.generate(e,r)},t.getBytesSync=function(e){return t.generate(e)},t}r.formatKey=function(t){var e=i.util.createBuffer(t);return(t=new Array(4))[0]=e.getInt32(),t[1]=e.getInt32(),t[2]=e.getInt32(),t[3]=e.getInt32(),i.aes._expandKey(t,!1)},r.formatSeed=function(t){var e=i.util.createBuffer(t);return(t=new Array(4))[0]=e.getInt32(),t[1]=e.getInt32(),t[2]=e.getInt32(),t[3]=e.getInt32(),t},r.cipher=function(t,e){return i.aes._updateBlock(t,e,n,!1),o.putInt32(n[0]),o.putInt32(n[1]),o.putInt32(n[2]),o.putInt32(n[3]),o.getBytes()},r.increment=function(t){return++t[3],t},r.md=i.md.sha256;var a=s(),u=null,h=i.util.globalScope,c=h.crypto||h.msCrypto;if(c&&c.getRandomValues&&(u=function(t){return c.getRandomValues(t)}),i.options.usePureJavaScript||!i.util.isNodejs&&!u){if("undefined"==typeof window||window.document,a.collectInt(+new Date,32),"undefined"!=typeof navigator){var f="";for(var l in navigator)try{"string"==typeof navigator[l]&&(f+=navigator[l])}catch(t){}a.collect(f),f=null}e&&(e().mousemove((function(t){a.collectInt(t.clientX,16),a.collectInt(t.clientY,16)})),e().keypress((function(t){a.collectInt(t.charCode,8)})))}if(i.random)for(var l in a)i.random[l]=a[l];else i.random=a;i.random.createInstance=s,t.exports=i.random}("undefined"!=typeof jQuery?jQuery:null)},69372:(t,e,r)=>{var i=r(3832);r(97116);var n=[217,120,249,196,25,221,181,237,40,233,253,121,74,160,216,157,198,126,55,131,43,118,83,142,98,76,100,136,68,139,251,162,23,154,89,245,135,179,79,19,97,69,109,141,9,129,125,50,189,143,64,235,134,183,123,11,240,149,33,34,92,107,78,130,84,214,101,147,206,96,178,28,115,86,192,20,167,140,241,220,18,117,202,31,59,190,228,209,66,61,212,48,163,60,182,38,111,191,14,218,70,105,7,87,39,242,29,155,188,148,67,3,248,17,199,246,144,239,62,231,6,195,213,47,200,102,30,215,8,232,234,222,128,82,238,247,132,170,114,172,53,77,106,42,150,26,210,113,90,21,73,116,75,159,208,94,4,24,164,236,194,224,65,110,15,81,203,204,36,145,175,80,161,244,112,57,153,124,58,133,35,184,180,122,252,2,54,91,37,85,151,49,45,93,250,152,227,138,146,174,5,223,41,16,103,108,186,201,211,0,230,207,225,158,168,44,99,22,1,63,88,226,137,169,13,56,52,27,171,51,255,176,187,72,12,95,185,177,205,46,197,243,219,71,229,165,156,119,10,166,32,104,254,127,193,173],o=[1,2,3,5],s=function(t,e){return t<<e&65535|(65535&t)>>16-e},a=function(t,e){return(65535&t)>>e|t<<16-e&65535};t.exports=i.rc2=i.rc2||{},i.rc2.expandKey=function(t,e){"string"==typeof t&&(t=i.util.createBuffer(t)),e=e||128;var r,o=t,s=t.length(),a=e,u=Math.ceil(a/8),h=255>>(7&a);for(r=s;r<128;r++)o.putByte(n[o.at(r-1)+o.at(r-s)&255]);for(o.setAt(128-u,n[o.at(128-u)&h]),r=127-u;r>=0;r--)o.setAt(r,n[o.at(r+1)^o.at(r+u)]);return o};var u=function(t,e,r){var n,u,h,c,f=!1,l=null,d=null,p=null,g=[];for(t=i.rc2.expandKey(t,e),h=0;h<64;h++)g.push(t.getInt16Le());r?(n=function(t){for(h=0;h<4;h++)t[h]+=g[c]+(t[(h+3)%4]&t[(h+2)%4])+(~t[(h+3)%4]&t[(h+1)%4]),t[h]=s(t[h],o[h]),c++},u=function(t){for(h=0;h<4;h++)t[h]+=g[63&t[(h+3)%4]]}):(n=function(t){for(h=3;h>=0;h--)t[h]=a(t[h],o[h]),t[h]-=g[c]+(t[(h+3)%4]&t[(h+2)%4])+(~t[(h+3)%4]&t[(h+1)%4]),c--},u=function(t){for(h=3;h>=0;h--)t[h]-=g[63&t[(h+3)%4]]});var y=function(t){var e=[];for(h=0;h<4;h++){var i=l.getInt16Le();null!==p&&(r?i^=p.getInt16Le():p.putInt16Le(i)),e.push(65535&i)}c=r?0:63;for(var n=0;n<t.length;n++)for(var o=0;o<t[n][0];o++)t[n][1](e);for(h=0;h<4;h++)null!==p&&(r?p.putInt16Le(e[h]):e[h]^=p.getInt16Le()),d.putInt16Le(e[h])},m=null;return m={start:function(t,e){t&&"string"==typeof t&&(t=i.util.createBuffer(t)),f=!1,l=i.util.createBuffer(),d=e||new i.util.createBuffer,p=t,m.output=d},update:function(t){for(f||l.putBuffer(t);l.length()>=8;)y([[5,n],[1,u],[6,n],[1,u],[5,n]])},finish:function(t){var e=!0;if(r)if(t)e=t(8,l,!r);else{var i=8===l.length()?8:8-l.length();l.fillWithByte(i,i)}if(e&&(f=!0,m.update()),!r&&(e=0===l.length()))if(t)e=t(8,d,!r);else{var n=d.length(),o=d.at(n-1);o>n?e=!1:d.truncate(o)}return e}}};i.rc2.startEncrypting=function(t,e,r){var n=i.rc2.createEncryptionCipher(t,128);return n.start(e,r),n},i.rc2.createEncryptionCipher=function(t,e){return u(t,e,!0)},i.rc2.startDecrypting=function(t,e,r){var n=i.rc2.createDecryptionCipher(t,128);return n.start(e,r),n},i.rc2.createDecryptionCipher=function(t,e){return u(t,e,!1)}},28095:(t,e,r)=>{var i=r(3832);if(r(3068),r(15764),r(66270),r(18936),r(29654),r(49563),r(97116),void 0===n)var n=i.jsbn.BigInteger;var o=i.util.isNodejs?r(63906):null,s=i.asn1,a=i.util;i.pki=i.pki||{},t.exports=i.pki.rsa=i.rsa=i.rsa||{};var u=i.pki,h=[6,4,2,4,2,4,6,2],c={name:"PrivateKeyInfo",tagClass:s.Class.UNIVERSAL,type:s.Type.SEQUENCE,constructed:!0,value:[{name:"PrivateKeyInfo.version",tagClass:s.Class.UNIVERSAL,type:s.Type.INTEGER,constructed:!1,capture:"privateKeyVersion"},{name:"PrivateKeyInfo.privateKeyAlgorithm",tagClass:s.Class.UNIVERSAL,type:s.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:s.Class.UNIVERSAL,type:s.Type.OID,constructed:!1,capture:"privateKeyOid"}]},{name:"PrivateKeyInfo",tagClass:s.Class.UNIVERSAL,type:s.Type.OCTETSTRING,constructed:!1,capture:"privateKey"}]},f={name:"RSAPrivateKey",tagClass:s.Class.UNIVERSAL,type:s.Type.SEQUENCE,constructed:!0,value:[{name:"RSAPrivateKey.version",tagClass:s.Class.UNIVERSAL,type:s.Type.INTEGER,constructed:!1,capture:"privateKeyVersion"},{name:"RSAPrivateKey.modulus",tagClass:s.Class.UNIVERSAL,type:s.Type.INTEGER,constructed:!1,capture:"privateKeyModulus"},{name:"RSAPrivateKey.publicExponent",tagClass:s.Class.UNIVERSAL,type:s.Type.INTEGER,constructed:!1,capture:"privateKeyPublicExponent"},{name:"RSAPrivateKey.privateExponent",tagClass:s.Class.UNIVERSAL,type:s.Type.INTEGER,constructed:!1,capture:"privateKeyPrivateExponent"},{name:"RSAPrivateKey.prime1",tagClass:s.Class.UNIVERSAL,type:s.Type.INTEGER,constructed:!1,capture:"privateKeyPrime1"},{name:"RSAPrivateKey.prime2",tagClass:s.Class.UNIVERSAL,type:s.Type.INTEGER,constructed:!1,capture:"privateKeyPrime2"},{name:"RSAPrivateKey.exponent1",tagClass:s.Class.UNIVERSAL,type:s.Type.INTEGER,constructed:!1,capture:"privateKeyExponent1"},{name:"RSAPrivateKey.exponent2",tagClass:s.Class.UNIVERSAL,type:s.Type.INTEGER,constructed:!1,capture:"privateKeyExponent2"},{name:"RSAPrivateKey.coefficient",tagClass:s.Class.UNIVERSAL,type:s.Type.INTEGER,constructed:!1,capture:"privateKeyCoefficient"}]},l={name:"RSAPublicKey",tagClass:s.Class.UNIVERSAL,type:s.Type.SEQUENCE,constructed:!0,value:[{name:"RSAPublicKey.modulus",tagClass:s.Class.UNIVERSAL,type:s.Type.INTEGER,constructed:!1,capture:"publicKeyModulus"},{name:"RSAPublicKey.exponent",tagClass:s.Class.UNIVERSAL,type:s.Type.INTEGER,constructed:!1,capture:"publicKeyExponent"}]},d=i.pki.rsa.publicKeyValidator={name:"SubjectPublicKeyInfo",tagClass:s.Class.UNIVERSAL,type:s.Type.SEQUENCE,constructed:!0,captureAsn1:"subjectPublicKeyInfo",value:[{name:"SubjectPublicKeyInfo.AlgorithmIdentifier",tagClass:s.Class.UNIVERSAL,type:s.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:s.Class.UNIVERSAL,type:s.Type.OID,constructed:!1,capture:"publicKeyOid"}]},{name:"SubjectPublicKeyInfo.subjectPublicKey",tagClass:s.Class.UNIVERSAL,type:s.Type.BITSTRING,constructed:!1,value:[{name:"SubjectPublicKeyInfo.subjectPublicKey.RSAPublicKey",tagClass:s.Class.UNIVERSAL,type:s.Type.SEQUENCE,constructed:!0,optional:!0,captureAsn1:"rsaPublicKey"}]}]},p=function(t){var e;if(!(t.algorithm in u.oids)){var r=new Error("Unknown message digest algorithm.");throw r.algorithm=t.algorithm,r}e=u.oids[t.algorithm];var i=s.oidToDer(e).getBytes(),n=s.create(s.Class.UNIVERSAL,s.Type.SEQUENCE,!0,[]),o=s.create(s.Class.UNIVERSAL,s.Type.SEQUENCE,!0,[]);o.value.push(s.create(s.Class.UNIVERSAL,s.Type.OID,!1,i)),o.value.push(s.create(s.Class.UNIVERSAL,s.Type.NULL,!1,""));var a=s.create(s.Class.UNIVERSAL,s.Type.OCTETSTRING,!1,t.digest().getBytes());return n.value.push(o),n.value.push(a),s.toDer(n).getBytes()},g=function(t,e,r){if(r)return t.modPow(e.e,e.n);if(!e.p||!e.q)return t.modPow(e.d,e.n);var o;e.dP||(e.dP=e.d.mod(e.p.subtract(n.ONE))),e.dQ||(e.dQ=e.d.mod(e.q.subtract(n.ONE))),e.qInv||(e.qInv=e.q.modInverse(e.p));do{o=new n(i.util.bytesToHex(i.random.getBytes(e.n.bitLength()/8)),16)}while(o.compareTo(e.n)>=0||!o.gcd(e.n).equals(n.ONE));for(var s=(t=t.multiply(o.modPow(e.e,e.n)).mod(e.n)).mod(e.p).modPow(e.dP,e.p),a=t.mod(e.q).modPow(e.dQ,e.q);s.compareTo(a)<0;)s=s.add(e.p);var u=s.subtract(a).multiply(e.qInv).mod(e.p).multiply(e.q).add(a);return u.multiply(o.modInverse(e.n)).mod(e.n)};function y(t,e,r){var n=i.util.createBuffer(),o=Math.ceil(e.n.bitLength()/8);if(t.length>o-11){var s=new Error("Message is too long for PKCS#1 v1.5 padding.");throw s.length=t.length,s.max=o-11,s}n.putByte(0),n.putByte(r);var a,u=o-3-t.length;if(0===r||1===r){a=0===r?0:255;for(var h=0;h<u;++h)n.putByte(a)}else for(;u>0;){var c=0,f=i.random.getBytes(u);for(h=0;h<u;++h)0===(a=f.charCodeAt(h))?++c:n.putByte(a);u=c}return n.putByte(0),n.putBytes(t),n}function m(t,e,r,n){var o=Math.ceil(e.n.bitLength()/8),s=i.util.createBuffer(t),a=s.getByte(),u=s.getByte();if(0!==a||r&&0!==u&&1!==u||!r&&2!=u||r&&0===u&&void 0===n)throw new Error("Encryption block is invalid.");var h=0;if(0===u){h=o-3-n;for(var c=0;c<h;++c)if(0!==s.getByte())throw new Error("Encryption block is invalid.")}else if(1===u)for(h=0;s.length()>1;){if(255!==s.getByte()){--s.read;break}++h}else if(2===u)for(h=0;s.length()>1;){if(0===s.getByte()){--s.read;break}++h}if(0!==s.getByte()||h!==o-3-s.length())throw new Error("Encryption block is invalid.");return s.getBytes()}function v(t,e,r){"function"==typeof e&&(r=e,e={});var o={algorithm:{name:(e=e||{}).algorithm||"PRIMEINC",options:{workers:e.workers||2,workLoad:e.workLoad||100,workerScript:e.workerScript}}};function s(){a(t.pBits,(function(e,i){return e?r(e):(t.p=i,null!==t.q?h(e,t.q):void a(t.qBits,h))}))}function a(t,e){i.prime.generateProbablePrime(t,o,e)}function h(e,i){if(e)return r(e);if(t.q=i,t.p.compareTo(t.q)<0){var o=t.p;t.p=t.q,t.q=o}if(0!==t.p.subtract(n.ONE).gcd(t.e).compareTo(n.ONE))return t.p=null,void s();if(0!==t.q.subtract(n.ONE).gcd(t.e).compareTo(n.ONE))return t.q=null,void a(t.qBits,h);if(t.p1=t.p.subtract(n.ONE),t.q1=t.q.subtract(n.ONE),t.phi=t.p1.multiply(t.q1),0!==t.phi.gcd(t.e).compareTo(n.ONE))return t.p=t.q=null,void s();if(t.n=t.p.multiply(t.q),t.n.bitLength()!==t.bits)return t.q=null,void a(t.qBits,h);var c=t.e.modInverse(t.phi);t.keys={privateKey:u.rsa.setPrivateKey(t.n,t.e,c,t.p,t.q,c.mod(t.p1),c.mod(t.q1),t.q.modInverse(t.p)),publicKey:u.rsa.setPublicKey(t.n,t.e)},r(null,t.keys)}"prng"in e&&(o.prng=e.prng),s()}function b(t){var e=t.toString(16);e[0]>="8"&&(e="00"+e);var r=i.util.hexToBytes(e);return r.length>1&&(0===r.charCodeAt(0)&&0==(128&r.charCodeAt(1))||255===r.charCodeAt(0)&&128==(128&r.charCodeAt(1)))?r.substr(1):r}function w(t){return t<=100?27:t<=150?18:t<=200?15:t<=250?12:t<=300?9:t<=350?8:t<=400?7:t<=500?6:t<=600?5:t<=800?4:t<=1250?3:2}function _(t){return i.util.isNodejs&&"function"==typeof o[t]}function S(t){return void 0!==a.globalScope&&"object"==typeof a.globalScope.crypto&&"object"==typeof a.globalScope.crypto.subtle&&"function"==typeof a.globalScope.crypto.subtle[t]}function E(t){return void 0!==a.globalScope&&"object"==typeof a.globalScope.msCrypto&&"object"==typeof a.globalScope.msCrypto.subtle&&"function"==typeof a.globalScope.msCrypto.subtle[t]}function M(t){for(var e=i.util.hexToBytes(t.toString(16)),r=new Uint8Array(e.length),n=0;n<e.length;++n)r[n]=e.charCodeAt(n);return r}u.rsa.encrypt=function(t,e,r){var o,s=r,a=Math.ceil(e.n.bitLength()/8);!1!==r&&!0!==r?(s=2===r,o=y(t,e,r)):(o=i.util.createBuffer()).putBytes(t);for(var u=new n(o.toHex(),16),h=g(u,e,s).toString(16),c=i.util.createBuffer(),f=a-Math.ceil(h.length/2);f>0;)c.putByte(0),--f;return c.putBytes(i.util.hexToBytes(h)),c.getBytes()},u.rsa.decrypt=function(t,e,r,o){var s=Math.ceil(e.n.bitLength()/8);if(t.length!==s){var a=new Error("Encrypted message length is invalid.");throw a.length=t.length,a.expected=s,a}var u=new n(i.util.createBuffer(t).toHex(),16);if(u.compareTo(e.n)>=0)throw new Error("Encrypted message is invalid.");for(var h=g(u,e,r).toString(16),c=i.util.createBuffer(),f=s-Math.ceil(h.length/2);f>0;)c.putByte(0),--f;return c.putBytes(i.util.hexToBytes(h)),!1!==o?m(c.getBytes(),e,r):c.getBytes()},u.rsa.createKeyPairGenerationState=function(t,e,r){"string"==typeof t&&(t=parseInt(t,10)),t=t||2048;var o,s=(r=r||{}).prng||i.random,a={nextBytes:function(t){for(var e=s.getBytesSync(t.length),r=0;r<t.length;++r)t[r]=e.charCodeAt(r)}},u=r.algorithm||"PRIMEINC";if("PRIMEINC"!==u)throw new Error("Invalid key generation algorithm: "+u);return(o={algorithm:u,state:0,bits:t,rng:a,eInt:e||65537,e:new n(null),p:null,q:null,qBits:t>>1,pBits:t-(t>>1),pqState:0,num:null,keys:null}).e.fromInt(o.eInt),o},u.rsa.stepKeyPairGenerationState=function(t,e){"algorithm"in t||(t.algorithm="PRIMEINC");var r=new n(null);r.fromInt(30);for(var i,o=0,s=function(t,e){return t|e},a=+new Date,c=0;null===t.keys&&(e<=0||c<e);){if(0===t.state){var f=null===t.p?t.pBits:t.qBits,l=f-1;0===t.pqState?(t.num=new n(f,t.rng),t.num.testBit(l)||t.num.bitwiseTo(n.ONE.shiftLeft(l),s,t.num),t.num.dAddOffset(31-t.num.mod(r).byteValue(),0),o=0,++t.pqState):1===t.pqState?t.num.bitLength()>f?t.pqState=0:t.num.isProbablePrime(w(t.num.bitLength()))?++t.pqState:t.num.dAddOffset(h[o++%8],0):2===t.pqState?t.pqState=0===t.num.subtract(n.ONE).gcd(t.e).compareTo(n.ONE)?3:0:3===t.pqState&&(t.pqState=0,null===t.p?t.p=t.num:t.q=t.num,null!==t.p&&null!==t.q&&++t.state,t.num=null)}else if(1===t.state)t.p.compareTo(t.q)<0&&(t.num=t.p,t.p=t.q,t.q=t.num),++t.state;else if(2===t.state)t.p1=t.p.subtract(n.ONE),t.q1=t.q.subtract(n.ONE),t.phi=t.p1.multiply(t.q1),++t.state;else if(3===t.state)0===t.phi.gcd(t.e).compareTo(n.ONE)?++t.state:(t.p=null,t.q=null,t.state=0);else if(4===t.state)t.n=t.p.multiply(t.q),t.n.bitLength()===t.bits?++t.state:(t.q=null,t.state=0);else if(5===t.state){var d=t.e.modInverse(t.phi);t.keys={privateKey:u.rsa.setPrivateKey(t.n,t.e,d,t.p,t.q,d.mod(t.p1),d.mod(t.q1),t.q.modInverse(t.p)),publicKey:u.rsa.setPublicKey(t.n,t.e)}}c+=(i=+new Date)-a,a=i}return null!==t.keys},u.rsa.generateKeyPair=function(t,e,r,n){if(1===arguments.length?"object"==typeof t?(r=t,t=void 0):"function"==typeof t&&(n=t,t=void 0):2===arguments.length?"number"==typeof t?"function"==typeof e?(n=e,e=void 0):"number"!=typeof e&&(r=e,e=void 0):(r=t,n=e,t=void 0,e=void 0):3===arguments.length&&("number"==typeof e?"function"==typeof r&&(n=r,r=void 0):(n=r,r=e,e=void 0)),r=r||{},void 0===t&&(t=r.bits||2048),void 0===e&&(e=r.e||65537),!i.options.usePureJavaScript&&!r.prng&&t>=256&&t<=16384&&(65537===e||3===e))if(n){if(_("generateKeyPair"))return o.generateKeyPair("rsa",{modulusLength:t,publicExponent:e,publicKeyEncoding:{type:"spki",format:"pem"},privateKeyEncoding:{type:"pkcs8",format:"pem"}},(function(t,e,r){if(t)return n(t);n(null,{privateKey:u.privateKeyFromPem(r),publicKey:u.publicKeyFromPem(e)})}));if(S("generateKey")&&S("exportKey"))return a.globalScope.crypto.subtle.generateKey({name:"RSASSA-PKCS1-v1_5",modulusLength:t,publicExponent:M(e),hash:{name:"SHA-256"}},!0,["sign","verify"]).then((function(t){return a.globalScope.crypto.subtle.exportKey("pkcs8",t.privateKey)})).then(void 0,(function(t){n(t)})).then((function(t){if(t){var e=u.privateKeyFromAsn1(s.fromDer(i.util.createBuffer(t)));n(null,{privateKey:e,publicKey:u.setRsaPublicKey(e.n,e.e)})}}));if(E("generateKey")&&E("exportKey")){var h=a.globalScope.msCrypto.subtle.generateKey({name:"RSASSA-PKCS1-v1_5",modulusLength:t,publicExponent:M(e),hash:{name:"SHA-256"}},!0,["sign","verify"]);return h.oncomplete=function(t){var e=t.target.result,r=a.globalScope.msCrypto.subtle.exportKey("pkcs8",e.privateKey);r.oncomplete=function(t){var e=t.target.result,r=u.privateKeyFromAsn1(s.fromDer(i.util.createBuffer(e)));n(null,{privateKey:r,publicKey:u.setRsaPublicKey(r.n,r.e)})},r.onerror=function(t){n(t)}},void(h.onerror=function(t){n(t)})}}else if(_("generateKeyPairSync")){var c=o.generateKeyPairSync("rsa",{modulusLength:t,publicExponent:e,publicKeyEncoding:{type:"spki",format:"pem"},privateKeyEncoding:{type:"pkcs8",format:"pem"}});return{privateKey:u.privateKeyFromPem(c.privateKey),publicKey:u.publicKeyFromPem(c.publicKey)}}var f=u.rsa.createKeyPairGenerationState(t,e,r);if(!n)return u.rsa.stepKeyPairGenerationState(f,0),f.keys;v(f,r,n)},u.setRsaPublicKey=u.rsa.setPublicKey=function(t,e){var r={n:t,e,encrypt:function(t,e,n){if("string"==typeof e?e=e.toUpperCase():void 0===e&&(e="RSAES-PKCS1-V1_5"),"RSAES-PKCS1-V1_5"===e)e={encode:function(t,e,r){return y(t,e,2).getBytes()}};else if("RSA-OAEP"===e||"RSAES-OAEP"===e)e={encode:function(t,e){return i.pkcs1.encode_rsa_oaep(e,t,n)}};else if(-1!==["RAW","NONE","NULL",null].indexOf(e))e={encode:function(t){return t}};else if("string"==typeof e)throw new Error('Unsupported encryption scheme: "'+e+'".');var o=e.encode(t,r,!0);return u.rsa.encrypt(o,r,!0)},verify:function(t,e,i){"string"==typeof i?i=i.toUpperCase():void 0===i&&(i="RSASSA-PKCS1-V1_5"),"RSASSA-PKCS1-V1_5"===i?i={verify:function(t,e){return e=m(e,r,!0),t===s.fromDer(e).value[1].value}}:"NONE"!==i&&"NULL"!==i&&null!==i||(i={verify:function(t,e){return t===m(e,r,!0)}});var n=u.rsa.decrypt(e,r,!0,!1);return i.verify(t,n,r.n.bitLength())}};return r},u.setRsaPrivateKey=u.rsa.setPrivateKey=function(t,e,r,n,o,s,a,h){var c={n:t,e,d:r,p:n,q:o,dP:s,dQ:a,qInv:h,decrypt:function(t,e,r){"string"==typeof e?e=e.toUpperCase():void 0===e&&(e="RSAES-PKCS1-V1_5");var n=u.rsa.decrypt(t,c,!1,!1);if("RSAES-PKCS1-V1_5"===e)e={decode:m};else if("RSA-OAEP"===e||"RSAES-OAEP"===e)e={decode:function(t,e){return i.pkcs1.decode_rsa_oaep(e,t,r)}};else{if(-1===["RAW","NONE","NULL",null].indexOf(e))throw new Error('Unsupported encryption scheme: "'+e+'".');e={decode:function(t){return t}}}return e.decode(n,c,!1)},sign:function(t,e){var r=!1;"string"==typeof e&&(e=e.toUpperCase()),void 0===e||"RSASSA-PKCS1-V1_5"===e?(e={encode:p},r=1):"NONE"!==e&&"NULL"!==e&&null!==e||(e={encode:function(){return t}},r=1);var i=e.encode(t,c.n.bitLength());return u.rsa.encrypt(i,c,r)}};return c},u.wrapRsaPrivateKey=function(t){return s.create(s.Class.UNIVERSAL,s.Type.SEQUENCE,!0,[s.create(s.Class.UNIVERSAL,s.Type.INTEGER,!1,s.integerToDer(0).getBytes()),s.create(s.Class.UNIVERSAL,s.Type.SEQUENCE,!0,[s.create(s.Class.UNIVERSAL,s.Type.OID,!1,s.oidToDer(u.oids.rsaEncryption).getBytes()),s.create(s.Class.UNIVERSAL,s.Type.NULL,!1,"")]),s.create(s.Class.UNIVERSAL,s.Type.OCTETSTRING,!1,s.toDer(t).getBytes())])},u.privateKeyFromAsn1=function(t){var e,r,o,a,h,l,d,p,g={},y=[];if(s.validate(t,c,g,y)&&(t=s.fromDer(i.util.createBuffer(g.privateKey))),g={},y=[],!s.validate(t,f,g,y)){var m=new Error("Cannot read private key. ASN.1 object does not contain an RSAPrivateKey.");throw m.errors=y,m}return e=i.util.createBuffer(g.privateKeyModulus).toHex(),r=i.util.createBuffer(g.privateKeyPublicExponent).toHex(),o=i.util.createBuffer(g.privateKeyPrivateExponent).toHex(),a=i.util.createBuffer(g.privateKeyPrime1).toHex(),h=i.util.createBuffer(g.privateKeyPrime2).toHex(),l=i.util.createBuffer(g.privateKeyExponent1).toHex(),d=i.util.createBuffer(g.privateKeyExponent2).toHex(),p=i.util.createBuffer(g.privateKeyCoefficient).toHex(),u.setRsaPrivateKey(new n(e,16),new n(r,16),new n(o,16),new n(a,16),new n(h,16),new n(l,16),new n(d,16),new n(p,16))},u.privateKeyToAsn1=u.privateKeyToRSAPrivateKey=function(t){return s.create(s.Class.UNIVERSAL,s.Type.SEQUENCE,!0,[s.create(s.Class.UNIVERSAL,s.Type.INTEGER,!1,s.integerToDer(0).getBytes()),s.create(s.Class.UNIVERSAL,s.Type.INTEGER,!1,b(t.n)),s.create(s.Class.UNIVERSAL,s.Type.INTEGER,!1,b(t.e)),s.create(s.Class.UNIVERSAL,s.Type.INTEGER,!1,b(t.d)),s.create(s.Class.UNIVERSAL,s.Type.INTEGER,!1,b(t.p)),s.create(s.Class.UNIVERSAL,s.Type.INTEGER,!1,b(t.q)),s.create(s.Class.UNIVERSAL,s.Type.INTEGER,!1,b(t.dP)),s.create(s.Class.UNIVERSAL,s.Type.INTEGER,!1,b(t.dQ)),s.create(s.Class.UNIVERSAL,s.Type.INTEGER,!1,b(t.qInv))])},u.publicKeyFromAsn1=function(t){var e={},r=[];if(s.validate(t,d,e,r)){var o,a=s.derToOid(e.publicKeyOid);if(a!==u.oids.rsaEncryption)throw(o=new Error("Cannot read public key. Unknown OID.")).oid=a,o;t=e.rsaPublicKey}if(r=[],!s.validate(t,l,e,r))throw(o=new Error("Cannot read public key. ASN.1 object does not contain an RSAPublicKey.")).errors=r,o;var h=i.util.createBuffer(e.publicKeyModulus).toHex(),c=i.util.createBuffer(e.publicKeyExponent).toHex();return u.setRsaPublicKey(new n(h,16),new n(c,16))},u.publicKeyToAsn1=u.publicKeyToSubjectPublicKeyInfo=function(t){return s.create(s.Class.UNIVERSAL,s.Type.SEQUENCE,!0,[s.create(s.Class.UNIVERSAL,s.Type.SEQUENCE,!0,[s.create(s.Class.UNIVERSAL,s.Type.OID,!1,s.oidToDer(u.oids.rsaEncryption).getBytes()),s.create(s.Class.UNIVERSAL,s.Type.NULL,!1,"")]),s.create(s.Class.UNIVERSAL,s.Type.BITSTRING,!1,[u.publicKeyToRSAPublicKey(t)])])},u.publicKeyToRSAPublicKey=function(t){return s.create(s.Class.UNIVERSAL,s.Type.SEQUENCE,!0,[s.create(s.Class.UNIVERSAL,s.Type.INTEGER,!1,b(t.n)),s.create(s.Class.UNIVERSAL,s.Type.INTEGER,!1,b(t.e))])}},137:(t,e,r)=>{var i=r(3832);r(28991),r(97116);var n=t.exports=i.sha1=i.sha1||{};i.md.sha1=i.md.algorithms.sha1=n,n.create=function(){s||(o=String.fromCharCode(128),o+=i.util.fillString(String.fromCharCode(0),64),s=!0);var t=null,e=i.util.createBuffer(),r=new Array(80),n={algorithm:"sha1",blockLength:64,digestLength:20,messageLength:0,fullMessageLength:null,messageLengthSize:8,start:function(){n.messageLength=0,n.fullMessageLength=n.messageLength64=[];for(var r=n.messageLengthSize/4,o=0;o<r;++o)n.fullMessageLength.push(0);return e=i.util.createBuffer(),t={h0:1732584193,h1:4023233417,h2:2562383102,h3:271733878,h4:3285377520},n}};return n.start(),n.update=function(o,s){"utf8"===s&&(o=i.util.encodeUtf8(o));var u=o.length;n.messageLength+=u,u=[u/4294967296>>>0,u>>>0];for(var h=n.fullMessageLength.length-1;h>=0;--h)n.fullMessageLength[h]+=u[1],u[1]=u[0]+(n.fullMessageLength[h]/4294967296>>>0),n.fullMessageLength[h]=n.fullMessageLength[h]>>>0,u[0]=u[1]/4294967296>>>0;return e.putBytes(o),a(t,r,e),(e.read>2048||0===e.length())&&e.compact(),n},n.digest=function(){var s=i.util.createBuffer();s.putBytes(e.bytes());var u,h=n.fullMessageLength[n.fullMessageLength.length-1]+n.messageLengthSize&n.blockLength-1;s.putBytes(o.substr(0,n.blockLength-h));for(var c=8*n.fullMessageLength[0],f=0;f<n.fullMessageLength.length-1;++f)c+=(u=8*n.fullMessageLength[f+1])/4294967296>>>0,s.putInt32(c>>>0),c=u>>>0;s.putInt32(c);var l={h0:t.h0,h1:t.h1,h2:t.h2,h3:t.h3,h4:t.h4};a(l,r,s);var d=i.util.createBuffer();return d.putInt32(l.h0),d.putInt32(l.h1),d.putInt32(l.h2),d.putInt32(l.h3),d.putInt32(l.h4),d},n};var o=null,s=!1;function a(t,e,r){for(var i,n,o,s,a,u,h,c=r.length();c>=64;){for(n=t.h0,o=t.h1,s=t.h2,a=t.h3,u=t.h4,h=0;h<16;++h)i=r.getInt32(),e[h]=i,i=(n<<5|n>>>27)+(a^o&(s^a))+u+1518500249+i,u=a,a=s,s=(o<<30|o>>>2)>>>0,o=n,n=i;for(;h<20;++h)i=(i=e[h-3]^e[h-8]^e[h-14]^e[h-16])<<1|i>>>31,e[h]=i,i=(n<<5|n>>>27)+(a^o&(s^a))+u+1518500249+i,u=a,a=s,s=(o<<30|o>>>2)>>>0,o=n,n=i;for(;h<32;++h)i=(i=e[h-3]^e[h-8]^e[h-14]^e[h-16])<<1|i>>>31,e[h]=i,i=(n<<5|n>>>27)+(o^s^a)+u+1859775393+i,u=a,a=s,s=(o<<30|o>>>2)>>>0,o=n,n=i;for(;h<40;++h)i=(i=e[h-6]^e[h-16]^e[h-28]^e[h-32])<<2|i>>>30,e[h]=i,i=(n<<5|n>>>27)+(o^s^a)+u+1859775393+i,u=a,a=s,s=(o<<30|o>>>2)>>>0,o=n,n=i;for(;h<60;++h)i=(i=e[h-6]^e[h-16]^e[h-28]^e[h-32])<<2|i>>>30,e[h]=i,i=(n<<5|n>>>27)+(o&s|a&(o^s))+u+2400959708+i,u=a,a=s,s=(o<<30|o>>>2)>>>0,o=n,n=i;for(;h<80;++h)i=(i=e[h-6]^e[h-16]^e[h-28]^e[h-32])<<2|i>>>30,e[h]=i,i=(n<<5|n>>>27)+(o^s^a)+u+3395469782+i,u=a,a=s,s=(o<<30|o>>>2)>>>0,o=n,n=i;t.h0=t.h0+n|0,t.h1=t.h1+o|0,t.h2=t.h2+s|0,t.h3=t.h3+a|0,t.h4=t.h4+u|0,c-=64}}},41668:(t,e,r)=>{var i=r(3832);r(28991),r(97116);var n=t.exports=i.sha256=i.sha256||{};i.md.sha256=i.md.algorithms.sha256=n,n.create=function(){s||(o=String.fromCharCode(128),o+=i.util.fillString(String.fromCharCode(0),64),a=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],s=!0);var t=null,e=i.util.createBuffer(),r=new Array(64),n={algorithm:"sha256",blockLength:64,digestLength:32,messageLength:0,fullMessageLength:null,messageLengthSize:8,start:function(){n.messageLength=0,n.fullMessageLength=n.messageLength64=[];for(var r=n.messageLengthSize/4,o=0;o<r;++o)n.fullMessageLength.push(0);return e=i.util.createBuffer(),t={h0:1779033703,h1:3144134277,h2:1013904242,h3:2773480762,h4:1359893119,h5:2600822924,h6:528734635,h7:1541459225},n}};return n.start(),n.update=function(o,s){"utf8"===s&&(o=i.util.encodeUtf8(o));var a=o.length;n.messageLength+=a,a=[a/4294967296>>>0,a>>>0];for(var h=n.fullMessageLength.length-1;h>=0;--h)n.fullMessageLength[h]+=a[1],a[1]=a[0]+(n.fullMessageLength[h]/4294967296>>>0),n.fullMessageLength[h]=n.fullMessageLength[h]>>>0,a[0]=a[1]/4294967296>>>0;return e.putBytes(o),u(t,r,e),(e.read>2048||0===e.length())&&e.compact(),n},n.digest=function(){var s=i.util.createBuffer();s.putBytes(e.bytes());var a,h=n.fullMessageLength[n.fullMessageLength.length-1]+n.messageLengthSize&n.blockLength-1;s.putBytes(o.substr(0,n.blockLength-h));for(var c=8*n.fullMessageLength[0],f=0;f<n.fullMessageLength.length-1;++f)c+=(a=8*n.fullMessageLength[f+1])/4294967296>>>0,s.putInt32(c>>>0),c=a>>>0;s.putInt32(c);var l={h0:t.h0,h1:t.h1,h2:t.h2,h3:t.h3,h4:t.h4,h5:t.h5,h6:t.h6,h7:t.h7};u(l,r,s);var d=i.util.createBuffer();return d.putInt32(l.h0),d.putInt32(l.h1),d.putInt32(l.h2),d.putInt32(l.h3),d.putInt32(l.h4),d.putInt32(l.h5),d.putInt32(l.h6),d.putInt32(l.h7),d},n};var o=null,s=!1,a=null;function u(t,e,r){for(var i,n,o,s,u,h,c,f,l,d,p,g,y,m=r.length();m>=64;){for(u=0;u<16;++u)e[u]=r.getInt32();for(;u<64;++u)i=((i=e[u-2])>>>17|i<<15)^(i>>>19|i<<13)^i>>>10,n=((n=e[u-15])>>>7|n<<25)^(n>>>18|n<<14)^n>>>3,e[u]=i+e[u-7]+n+e[u-16]|0;for(h=t.h0,c=t.h1,f=t.h2,l=t.h3,d=t.h4,p=t.h5,g=t.h6,y=t.h7,u=0;u<64;++u)o=(h>>>2|h<<30)^(h>>>13|h<<19)^(h>>>22|h<<10),s=h&c|f&(h^c),i=y+((d>>>6|d<<26)^(d>>>11|d<<21)^(d>>>25|d<<7))+(g^d&(p^g))+a[u]+e[u],y=g,g=p,p=d,d=l+i>>>0,l=f,f=c,c=h,h=i+(n=o+s)>>>0;t.h0=t.h0+h|0,t.h1=t.h1+c|0,t.h2=t.h2+f|0,t.h3=t.h3+l|0,t.h4=t.h4+d|0,t.h5=t.h5+p|0,t.h6=t.h6+g|0,t.h7=t.h7+y|0,m-=64}}},63219:(t,e,r)=>{var i=r(3832);r(28991),r(97116);var n=t.exports=i.sha512=i.sha512||{};i.md.sha512=i.md.algorithms.sha512=n;var o=i.sha384=i.sha512.sha384=i.sha512.sha384||{};o.create=function(){return n.create("SHA-384")},i.md.sha384=i.md.algorithms.sha384=o,i.sha512.sha256=i.sha512.sha256||{create:function(){return n.create("SHA-512/256")}},i.md["sha512/256"]=i.md.algorithms["sha512/256"]=i.sha512.sha256,i.sha512.sha224=i.sha512.sha224||{create:function(){return n.create("SHA-512/224")}},i.md["sha512/224"]=i.md.algorithms["sha512/224"]=i.sha512.sha224,n.create=function(t){if(a||(s=String.fromCharCode(128),s+=i.util.fillString(String.fromCharCode(0),128),u=[[1116352408,3609767458],[1899447441,602891725],[3049323471,3964484399],[3921009573,2173295548],[961987163,4081628472],[1508970993,3053834265],[2453635748,2937671579],[2870763221,3664609560],[3624381080,2734883394],[310598401,1164996542],[607225278,1323610764],[1426881987,3590304994],[1925078388,4068182383],[2162078206,991336113],[2614888103,633803317],[3248222580,3479774868],[3835390401,2666613458],[4022224774,944711139],[264347078,2341262773],[604807628,2007800933],[770255983,1495990901],[1249150122,1856431235],[1555081692,3175218132],[1996064986,2198950837],[2554220882,3999719339],[2821834349,766784016],[2952996808,2566594879],[3210313671,3203337956],[3336571891,1034457026],[3584528711,2466948901],[113926993,3758326383],[338241895,168717936],[666307205,1188179964],[773529912,1546045734],[1294757372,1522805485],[1396182291,2643833823],[1695183700,2343527390],[1986661051,1014477480],[2177026350,1206759142],[2456956037,344077627],[2730485921,1290863460],[2820302411,3158454273],[3259730800,3505952657],[3345764771,106217008],[3516065817,3606008344],[3600352804,1432725776],[4094571909,1467031594],[275423344,851169720],[430227734,3100823752],[506948616,1363258195],[659060556,3750685593],[883997877,3785050280],[958139571,3318307427],[1322822218,3812723403],[1537002063,2003034995],[1747873779,3602036899],[1955562222,1575990012],[2024104815,1125592928],[2227730452,2716904306],[2361852424,442776044],[2428436474,593698344],[2756734187,3733110249],[3204031479,2999351573],[3329325298,3815920427],[3391569614,3928383900],[3515267271,566280711],[3940187606,3454069534],[4118630271,4000239992],[116418474,1914138554],[174292421,2731055270],[289380356,3203993006],[460393269,320620315],[685471733,587496836],[852142971,1086792851],[1017036298,365543100],[1126000580,2618297676],[1288033470,3409855158],[1501505948,4234509866],[1607167915,987167468],[1816402316,1246189591]],(h={})["SHA-512"]=[[1779033703,4089235720],[3144134277,2227873595],[1013904242,4271175723],[2773480762,1595750129],[1359893119,2917565137],[2600822924,725511199],[528734635,4215389547],[1541459225,327033209]],h["SHA-384"]=[[3418070365,3238371032],[1654270250,914150663],[2438529370,812702999],[355462360,4144912697],[1731405415,4290775857],[2394180231,1750603025],[3675008525,1694076839],[1203062813,3204075428]],h["SHA-512/256"]=[[573645204,4230739756],[2673172387,3360449730],[596883563,1867755857],[2520282905,1497426621],[2519219938,2827943907],[3193839141,1401305490],[721525244,746961066],[246885852,2177182882]],h["SHA-512/224"]=[[2352822216,424955298],[1944164710,2312950998],[502970286,855612546],[1738396948,1479516111],[258812777,2077511080],[2011393907,79989058],[1067287976,1780299464],[286451373,2446758561]],a=!0),void 0===t&&(t="SHA-512"),!(t in h))throw new Error("Invalid SHA-512 algorithm: "+t);for(var e=h[t],r=null,n=i.util.createBuffer(),o=new Array(80),f=0;f<80;++f)o[f]=new Array(2);var l=64;switch(t){case"SHA-384":l=48;break;case"SHA-512/256":l=32;break;case"SHA-512/224":l=28}var d={algorithm:t.replace("-","").toLowerCase(),blockLength:128,digestLength:l,messageLength:0,fullMessageLength:null,messageLengthSize:16,start:function(){d.messageLength=0,d.fullMessageLength=d.messageLength128=[];for(var t=d.messageLengthSize/4,o=0;o<t;++o)d.fullMessageLength.push(0);for(n=i.util.createBuffer(),r=new Array(e.length),o=0;o<e.length;++o)r[o]=e[o].slice(0);return d}};return d.start(),d.update=function(t,e){"utf8"===e&&(t=i.util.encodeUtf8(t));var s=t.length;d.messageLength+=s,s=[s/4294967296>>>0,s>>>0];for(var a=d.fullMessageLength.length-1;a>=0;--a)d.fullMessageLength[a]+=s[1],s[1]=s[0]+(d.fullMessageLength[a]/4294967296>>>0),d.fullMessageLength[a]=d.fullMessageLength[a]>>>0,s[0]=s[1]/4294967296>>>0;return n.putBytes(t),c(r,o,n),(n.read>2048||0===n.length())&&n.compact(),d},d.digest=function(){var e=i.util.createBuffer();e.putBytes(n.bytes());var a,u=d.fullMessageLength[d.fullMessageLength.length-1]+d.messageLengthSize&d.blockLength-1;e.putBytes(s.substr(0,d.blockLength-u));for(var h=8*d.fullMessageLength[0],f=0;f<d.fullMessageLength.length-1;++f)h+=(a=8*d.fullMessageLength[f+1])/4294967296>>>0,e.putInt32(h>>>0),h=a>>>0;e.putInt32(h);var l=new Array(r.length);for(f=0;f<r.length;++f)l[f]=r[f].slice(0);c(l,o,e);var p,g=i.util.createBuffer();for(p="SHA-512"===t?l.length:"SHA-384"===t?l.length-2:l.length-4,f=0;f<p;++f)g.putInt32(l[f][0]),f===p-1&&"SHA-512/224"===t||g.putInt32(l[f][1]);return g},d};var s=null,a=!1,u=null,h=null;function c(t,e,r){for(var i,n,o,s,a,h,c,f,l,d,p,g,y,m,v,b,w,_,S,E,M,A,C,k,I,T,R,B,x,F,P,N,O,L=r.length();L>=128;){for(R=0;R<16;++R)e[R][0]=r.getInt32()>>>0,e[R][1]=r.getInt32()>>>0;for(;R<80;++R)i=(((B=(F=e[R-2])[0])>>>19|(x=F[1])<<13)^(x>>>29|B<<3)^B>>>6)>>>0,n=((B<<13|x>>>19)^(x<<3|B>>>29)^(B<<26|x>>>6))>>>0,o=(((B=(N=e[R-15])[0])>>>1|(x=N[1])<<31)^(B>>>8|x<<24)^B>>>7)>>>0,s=((B<<31|x>>>1)^(B<<24|x>>>8)^(B<<25|x>>>7))>>>0,P=e[R-7],O=e[R-16],x=n+P[1]+s+O[1],e[R][0]=i+P[0]+o+O[0]+(x/4294967296>>>0)>>>0,e[R][1]=x>>>0;for(p=t[0][0],g=t[0][1],y=t[1][0],m=t[1][1],v=t[2][0],b=t[2][1],w=t[3][0],_=t[3][1],S=t[4][0],E=t[4][1],M=t[5][0],A=t[5][1],C=t[6][0],k=t[6][1],I=t[7][0],T=t[7][1],R=0;R<80;++R)c=((S>>>14|E<<18)^(S>>>18|E<<14)^(E>>>9|S<<23))>>>0,f=(C^S&(M^C))>>>0,a=((p>>>28|g<<4)^(g>>>2|p<<30)^(g>>>7|p<<25))>>>0,h=((p<<4|g>>>28)^(g<<30|p>>>2)^(g<<25|p>>>7))>>>0,l=(p&y|v&(p^y))>>>0,d=(g&m|b&(g^m))>>>0,x=T+(((S<<18|E>>>14)^(S<<14|E>>>18)^(E<<23|S>>>9))>>>0)+((k^E&(A^k))>>>0)+u[R][1]+e[R][1],i=I+c+f+u[R][0]+e[R][0]+(x/4294967296>>>0)>>>0,n=x>>>0,o=a+l+((x=h+d)/4294967296>>>0)>>>0,s=x>>>0,I=C,T=k,C=M,k=A,M=S,A=E,S=w+i+((x=_+n)/4294967296>>>0)>>>0,E=x>>>0,w=v,_=b,v=y,b=m,y=p,m=g,p=i+o+((x=n+s)/4294967296>>>0)>>>0,g=x>>>0;x=t[0][1]+g,t[0][0]=t[0][0]+p+(x/4294967296>>>0)>>>0,t[0][1]=x>>>0,x=t[1][1]+m,t[1][0]=t[1][0]+y+(x/4294967296>>>0)>>>0,t[1][1]=x>>>0,x=t[2][1]+b,t[2][0]=t[2][0]+v+(x/4294967296>>>0)>>>0,t[2][1]=x>>>0,x=t[3][1]+_,t[3][0]=t[3][0]+w+(x/4294967296>>>0)>>>0,t[3][1]=x>>>0,x=t[4][1]+E,t[4][0]=t[4][0]+S+(x/4294967296>>>0)>>>0,t[4][1]=x>>>0,x=t[5][1]+A,t[5][0]=t[5][0]+M+(x/4294967296>>>0)>>>0,t[5][1]=x>>>0,x=t[6][1]+k,t[6][0]=t[6][0]+C+(x/4294967296>>>0)>>>0,t[6][1]=x>>>0,x=t[7][1]+T,t[7][0]=t[7][0]+I+(x/4294967296>>>0)>>>0,t[7][1]=x>>>0,L-=128}}},97116:(t,e,r)=>{var i=r(3832),n=r(78807),o=t.exports=i.util=i.util||{};function s(t){if(8!==t&&16!==t&&24!==t&&32!==t)throw new Error("Only 8, 16, 24, or 32 bits supported: "+t)}function a(t){if(this.data="",this.read=0,"string"==typeof t)this.data=t;else if(o.isArrayBuffer(t)||o.isArrayBufferView(t))if("undefined"!=typeof Buffer&&t instanceof Buffer)this.data=t.toString("binary");else{var e=new Uint8Array(t);try{this.data=String.fromCharCode.apply(null,e)}catch(t){for(var r=0;r<e.length;++r)this.putByte(e[r])}}else(t instanceof a||"object"==typeof t&&"string"==typeof t.data&&"number"==typeof t.read)&&(this.data=t.data,this.read=t.read);this._constructedStringLength=0}!function(){if("undefined"!=typeof process&&process.nextTick&&!process.browser)return o.nextTick=process.nextTick,void("function"==typeof setImmediate?o.setImmediate=setImmediate:o.setImmediate=o.nextTick);if("function"==typeof setImmediate)return o.setImmediate=function(){return setImmediate.apply(void 0,arguments)},void(o.nextTick=function(t){return setImmediate(t)});if(o.setImmediate=function(t){setTimeout(t,0)},"undefined"!=typeof window&&"function"==typeof window.postMessage){var t="forge.setImmediate",e=[];o.setImmediate=function(r){e.push(r),1===e.length&&window.postMessage(t,"*")},window.addEventListener("message",(function(r){if(r.source===window&&r.data===t){r.stopPropagation();var i=e.slice();e.length=0,i.forEach((function(t){t()}))}}),!0)}if("undefined"!=typeof MutationObserver){var r=Date.now(),i=!0,n=document.createElement("div");e=[],new MutationObserver((function(){var t=e.slice();e.length=0,t.forEach((function(t){t()}))})).observe(n,{attributes:!0});var s=o.setImmediate;o.setImmediate=function(t){Date.now()-r>15?(r=Date.now(),s(t)):(e.push(t),1===e.length&&n.setAttribute("a",i=!i))}}o.nextTick=o.setImmediate}(),o.isNodejs="undefined"!=typeof process&&process.versions&&process.versions.node,o.globalScope=o.isNodejs?r.g:"undefined"==typeof self?window:self,o.isArray=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)},o.isArrayBuffer=function(t){return"undefined"!=typeof ArrayBuffer&&t instanceof ArrayBuffer},o.isArrayBufferView=function(t){return t&&o.isArrayBuffer(t.buffer)&&void 0!==t.byteLength},o.ByteBuffer=a,o.ByteStringBuffer=a,o.ByteStringBuffer.prototype._optimizeConstructedString=function(t){this._constructedStringLength+=t,this._constructedStringLength>4096&&(this.data.substr(0,1),this._constructedStringLength=0)},o.ByteStringBuffer.prototype.length=function(){return this.data.length-this.read},o.ByteStringBuffer.prototype.isEmpty=function(){return this.length()<=0},o.ByteStringBuffer.prototype.putByte=function(t){return this.putBytes(String.fromCharCode(t))},o.ByteStringBuffer.prototype.fillWithByte=function(t,e){t=String.fromCharCode(t);for(var r=this.data;e>0;)1&e&&(r+=t),(e>>>=1)>0&&(t+=t);return this.data=r,this._optimizeConstructedString(e),this},o.ByteStringBuffer.prototype.putBytes=function(t){return this.data+=t,this._optimizeConstructedString(t.length),this},o.ByteStringBuffer.prototype.putString=function(t){return this.putBytes(o.encodeUtf8(t))},o.ByteStringBuffer.prototype.putInt16=function(t){return this.putBytes(String.fromCharCode(t>>8&255)+String.fromCharCode(255&t))},o.ByteStringBuffer.prototype.putInt24=function(t){return this.putBytes(String.fromCharCode(t>>16&255)+String.fromCharCode(t>>8&255)+String.fromCharCode(255&t))},o.ByteStringBuffer.prototype.putInt32=function(t){return this.putBytes(String.fromCharCode(t>>24&255)+String.fromCharCode(t>>16&255)+String.fromCharCode(t>>8&255)+String.fromCharCode(255&t))},o.ByteStringBuffer.prototype.putInt16Le=function(t){return this.putBytes(String.fromCharCode(255&t)+String.fromCharCode(t>>8&255))},o.ByteStringBuffer.prototype.putInt24Le=function(t){return this.putBytes(String.fromCharCode(255&t)+String.fromCharCode(t>>8&255)+String.fromCharCode(t>>16&255))},o.ByteStringBuffer.prototype.putInt32Le=function(t){return this.putBytes(String.fromCharCode(255&t)+String.fromCharCode(t>>8&255)+String.fromCharCode(t>>16&255)+String.fromCharCode(t>>24&255))},o.ByteStringBuffer.prototype.putInt=function(t,e){s(e);var r="";do{e-=8,r+=String.fromCharCode(t>>e&255)}while(e>0);return this.putBytes(r)},o.ByteStringBuffer.prototype.putSignedInt=function(t,e){return t<0&&(t+=2<<e-1),this.putInt(t,e)},o.ByteStringBuffer.prototype.putBuffer=function(t){return this.putBytes(t.getBytes())},o.ByteStringBuffer.prototype.getByte=function(){return this.data.charCodeAt(this.read++)},o.ByteStringBuffer.prototype.getInt16=function(){var t=this.data.charCodeAt(this.read)<<8^this.data.charCodeAt(this.read+1);return this.read+=2,t},o.ByteStringBuffer.prototype.getInt24=function(){var t=this.data.charCodeAt(this.read)<<16^this.data.charCodeAt(this.read+1)<<8^this.data.charCodeAt(this.read+2);return this.read+=3,t},o.ByteStringBuffer.prototype.getInt32=function(){var t=this.data.charCodeAt(this.read)<<24^this.data.charCodeAt(this.read+1)<<16^this.data.charCodeAt(this.read+2)<<8^this.data.charCodeAt(this.read+3);return this.read+=4,t},o.ByteStringBuffer.prototype.getInt16Le=function(){var t=this.data.charCodeAt(this.read)^this.data.charCodeAt(this.read+1)<<8;return this.read+=2,t},o.ByteStringBuffer.prototype.getInt24Le=function(){var t=this.data.charCodeAt(this.read)^this.data.charCodeAt(this.read+1)<<8^this.data.charCodeAt(this.read+2)<<16;return this.read+=3,t},o.ByteStringBuffer.prototype.getInt32Le=function(){var t=this.data.charCodeAt(this.read)^this.data.charCodeAt(this.read+1)<<8^this.data.charCodeAt(this.read+2)<<16^this.data.charCodeAt(this.read+3)<<24;return this.read+=4,t},o.ByteStringBuffer.prototype.getInt=function(t){s(t);var e=0;do{e=(e<<8)+this.data.charCodeAt(this.read++),t-=8}while(t>0);return e},o.ByteStringBuffer.prototype.getSignedInt=function(t){var e=this.getInt(t),r=2<<t-2;return e>=r&&(e-=r<<1),e},o.ByteStringBuffer.prototype.getBytes=function(t){var e;return t?(t=Math.min(this.length(),t),e=this.data.slice(this.read,this.read+t),this.read+=t):0===t?e="":(e=0===this.read?this.data:this.data.slice(this.read),this.clear()),e},o.ByteStringBuffer.prototype.bytes=function(t){return void 0===t?this.data.slice(this.read):this.data.slice(this.read,this.read+t)},o.ByteStringBuffer.prototype.at=function(t){return this.data.charCodeAt(this.read+t)},o.ByteStringBuffer.prototype.setAt=function(t,e){return this.data=this.data.substr(0,this.read+t)+String.fromCharCode(e)+this.data.substr(this.read+t+1),this},o.ByteStringBuffer.prototype.last=function(){return this.data.charCodeAt(this.data.length-1)},o.ByteStringBuffer.prototype.copy=function(){var t=o.createBuffer(this.data);return t.read=this.read,t},o.ByteStringBuffer.prototype.compact=function(){return this.read>0&&(this.data=this.data.slice(this.read),this.read=0),this},o.ByteStringBuffer.prototype.clear=function(){return this.data="",this.read=0,this},o.ByteStringBuffer.prototype.truncate=function(t){var e=Math.max(0,this.length()-t);return this.data=this.data.substr(this.read,e),this.read=0,this},o.ByteStringBuffer.prototype.toHex=function(){for(var t="",e=this.read;e<this.data.length;++e){var r=this.data.charCodeAt(e);r<16&&(t+="0"),t+=r.toString(16)}return t},o.ByteStringBuffer.prototype.toString=function(){return o.decodeUtf8(this.bytes())},o.DataBuffer=function(t,e){e=e||{},this.read=e.readOffset||0,this.growSize=e.growSize||1024;var r=o.isArrayBuffer(t),i=o.isArrayBufferView(t);if(r||i)return this.data=r?new DataView(t):new DataView(t.buffer,t.byteOffset,t.byteLength),void(this.write="writeOffset"in e?e.writeOffset:this.data.byteLength);this.data=new DataView(new ArrayBuffer(0)),this.write=0,null!=t&&this.putBytes(t),"writeOffset"in e&&(this.write=e.writeOffset)},o.DataBuffer.prototype.length=function(){return this.write-this.read},o.DataBuffer.prototype.isEmpty=function(){return this.length()<=0},o.DataBuffer.prototype.accommodate=function(t,e){if(this.length()>=t)return this;e=Math.max(e||this.growSize,t);var r=new Uint8Array(this.data.buffer,this.data.byteOffset,this.data.byteLength),i=new Uint8Array(this.length()+e);return i.set(r),this.data=new DataView(i.buffer),this},o.DataBuffer.prototype.putByte=function(t){return this.accommodate(1),this.data.setUint8(this.write++,t),this},o.DataBuffer.prototype.fillWithByte=function(t,e){this.accommodate(e);for(var r=0;r<e;++r)this.data.setUint8(t);return this},o.DataBuffer.prototype.putBytes=function(t,e){if(o.isArrayBufferView(t)){var r=(i=new Uint8Array(t.buffer,t.byteOffset,t.byteLength)).byteLength-i.byteOffset;return this.accommodate(r),new Uint8Array(this.data.buffer,this.write).set(i),this.write+=r,this}if(o.isArrayBuffer(t)){var i=new Uint8Array(t);return this.accommodate(i.byteLength),new Uint8Array(this.data.buffer).set(i,this.write),this.write+=i.byteLength,this}if(t instanceof o.DataBuffer||"object"==typeof t&&"number"==typeof t.read&&"number"==typeof t.write&&o.isArrayBufferView(t.data))return i=new Uint8Array(t.data.byteLength,t.read,t.length()),this.accommodate(i.byteLength),new Uint8Array(t.data.byteLength,this.write).set(i),this.write+=i.byteLength,this;if(t instanceof o.ByteStringBuffer&&(t=t.data,e="binary"),e=e||"binary","string"==typeof t){var n;if("hex"===e)return this.accommodate(Math.ceil(t.length/2)),n=new Uint8Array(this.data.buffer,this.write),this.write+=o.binary.hex.decode(t,n,this.write),this;if("base64"===e)return this.accommodate(3*Math.ceil(t.length/4)),n=new Uint8Array(this.data.buffer,this.write),this.write+=o.binary.base64.decode(t,n,this.write),this;if("utf8"===e&&(t=o.encodeUtf8(t),e="binary"),"binary"===e||"raw"===e)return this.accommodate(t.length),n=new Uint8Array(this.data.buffer,this.write),this.write+=o.binary.raw.decode(n),this;if("utf16"===e)return this.accommodate(2*t.length),n=new Uint16Array(this.data.buffer,this.write),this.write+=o.text.utf16.encode(n),this;throw new Error("Invalid encoding: "+e)}throw Error("Invalid parameter: "+t)},o.DataBuffer.prototype.putBuffer=function(t){return this.putBytes(t),t.clear(),this},o.DataBuffer.prototype.putString=function(t){return this.putBytes(t,"utf16")},o.DataBuffer.prototype.putInt16=function(t){return this.accommodate(2),this.data.setInt16(this.write,t),this.write+=2,this},o.DataBuffer.prototype.putInt24=function(t){return this.accommodate(3),this.data.setInt16(this.write,t>>8&65535),this.data.setInt8(this.write,t>>16&255),this.write+=3,this},o.DataBuffer.prototype.putInt32=function(t){return this.accommodate(4),this.data.setInt32(this.write,t),this.write+=4,this},o.DataBuffer.prototype.putInt16Le=function(t){return this.accommodate(2),this.data.setInt16(this.write,t,!0),this.write+=2,this},o.DataBuffer.prototype.putInt24Le=function(t){return this.accommodate(3),this.data.setInt8(this.write,t>>16&255),this.data.setInt16(this.write,t>>8&65535,!0),this.write+=3,this},o.DataBuffer.prototype.putInt32Le=function(t){return this.accommodate(4),this.data.setInt32(this.write,t,!0),this.write+=4,this},o.DataBuffer.prototype.putInt=function(t,e){s(e),this.accommodate(e/8);do{e-=8,this.data.setInt8(this.write++,t>>e&255)}while(e>0);return this},o.DataBuffer.prototype.putSignedInt=function(t,e){return s(e),this.accommodate(e/8),t<0&&(t+=2<<e-1),this.putInt(t,e)},o.DataBuffer.prototype.getByte=function(){return this.data.getInt8(this.read++)},o.DataBuffer.prototype.getInt16=function(){var t=this.data.getInt16(this.read);return this.read+=2,t},o.DataBuffer.prototype.getInt24=function(){var t=this.data.getInt16(this.read)<<8^this.data.getInt8(this.read+2);return this.read+=3,t},o.DataBuffer.prototype.getInt32=function(){var t=this.data.getInt32(this.read);return this.read+=4,t},o.DataBuffer.prototype.getInt16Le=function(){var t=this.data.getInt16(this.read,!0);return this.read+=2,t},o.DataBuffer.prototype.getInt24Le=function(){var t=this.data.getInt8(this.read)^this.data.getInt16(this.read+1,!0)<<8;return this.read+=3,t},o.DataBuffer.prototype.getInt32Le=function(){var t=this.data.getInt32(this.read,!0);return this.read+=4,t},o.DataBuffer.prototype.getInt=function(t){s(t);var e=0;do{e=(e<<8)+this.data.getInt8(this.read++),t-=8}while(t>0);return e},o.DataBuffer.prototype.getSignedInt=function(t){var e=this.getInt(t),r=2<<t-2;return e>=r&&(e-=r<<1),e},o.DataBuffer.prototype.getBytes=function(t){var e;return t?(t=Math.min(this.length(),t),e=this.data.slice(this.read,this.read+t),this.read+=t):0===t?e="":(e=0===this.read?this.data:this.data.slice(this.read),this.clear()),e},o.DataBuffer.prototype.bytes=function(t){return void 0===t?this.data.slice(this.read):this.data.slice(this.read,this.read+t)},o.DataBuffer.prototype.at=function(t){return this.data.getUint8(this.read+t)},o.DataBuffer.prototype.setAt=function(t,e){return this.data.setUint8(t,e),this},o.DataBuffer.prototype.last=function(){return this.data.getUint8(this.write-1)},o.DataBuffer.prototype.copy=function(){return new o.DataBuffer(this)},o.DataBuffer.prototype.compact=function(){if(this.read>0){var t=new Uint8Array(this.data.buffer,this.read),e=new Uint8Array(t.byteLength);e.set(t),this.data=new DataView(e),this.write-=this.read,this.read=0}return this},o.DataBuffer.prototype.clear=function(){return this.data=new DataView(new ArrayBuffer(0)),this.read=this.write=0,this},o.DataBuffer.prototype.truncate=function(t){return this.write=Math.max(0,this.length()-t),this.read=Math.min(this.read,this.write),this},o.DataBuffer.prototype.toHex=function(){for(var t="",e=this.read;e<this.data.byteLength;++e){var r=this.data.getUint8(e);r<16&&(t+="0"),t+=r.toString(16)}return t},o.DataBuffer.prototype.toString=function(t){var e=new Uint8Array(this.data,this.read,this.length());if("binary"===(t=t||"utf8")||"raw"===t)return o.binary.raw.encode(e);if("hex"===t)return o.binary.hex.encode(e);if("base64"===t)return o.binary.base64.encode(e);if("utf8"===t)return o.text.utf8.decode(e);if("utf16"===t)return o.text.utf16.decode(e);throw new Error("Invalid encoding: "+t)},o.createBuffer=function(t,e){return e=e||"raw",void 0!==t&&"utf8"===e&&(t=o.encodeUtf8(t)),new o.ByteBuffer(t)},o.fillString=function(t,e){for(var r="";e>0;)1&e&&(r+=t),(e>>>=1)>0&&(t+=t);return r},o.xorBytes=function(t,e,r){for(var i="",n="",o="",s=0,a=0;r>0;--r,++s)n=t.charCodeAt(s)^e.charCodeAt(s),a>=10&&(i+=o,o="",a=0),o+=String.fromCharCode(n),++a;return i+o},o.hexToBytes=function(t){var e="",r=0;for(!0&t.length&&(r=1,e+=String.fromCharCode(parseInt(t[0],16)));r<t.length;r+=2)e+=String.fromCharCode(parseInt(t.substr(r,2),16));return e},o.bytesToHex=function(t){return o.createBuffer(t).toHex()},o.int32ToBytes=function(t){return String.fromCharCode(t>>24&255)+String.fromCharCode(t>>16&255)+String.fromCharCode(t>>8&255)+String.fromCharCode(255&t)};var u="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",h=[62,-1,-1,-1,63,52,53,54,55,56,57,58,59,60,61,-1,-1,-1,64,-1,-1,-1,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,-1,-1,-1,-1,-1,-1,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51],c="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";o.encode64=function(t,e){for(var r,i,n,o="",s="",a=0;a<t.length;)r=t.charCodeAt(a++),i=t.charCodeAt(a++),n=t.charCodeAt(a++),o+=u.charAt(r>>2),o+=u.charAt((3&r)<<4|i>>4),isNaN(i)?o+="==":(o+=u.charAt((15&i)<<2|n>>6),o+=isNaN(n)?"=":u.charAt(63&n)),e&&o.length>e&&(s+=o.substr(0,e)+"\r\n",o=o.substr(e));return s+o},o.decode64=function(t){t=t.replace(/[^A-Za-z0-9\+\/\=]/g,"");for(var e,r,i,n,o="",s=0;s<t.length;)e=h[t.charCodeAt(s++)-43],r=h[t.charCodeAt(s++)-43],i=h[t.charCodeAt(s++)-43],n=h[t.charCodeAt(s++)-43],o+=String.fromCharCode(e<<2|r>>4),64!==i&&(o+=String.fromCharCode((15&r)<<4|i>>2),64!==n&&(o+=String.fromCharCode((3&i)<<6|n)));return o},o.encodeUtf8=function(t){return unescape(encodeURIComponent(t))},o.decodeUtf8=function(t){return decodeURIComponent(escape(t))},o.binary={raw:{},hex:{},base64:{},base58:{},baseN:{encode:n.encode,decode:n.decode}},o.binary.raw.encode=function(t){return String.fromCharCode.apply(null,t)},o.binary.raw.decode=function(t,e,r){var i=e;i||(i=new Uint8Array(t.length));for(var n=r=r||0,o=0;o<t.length;++o)i[n++]=t.charCodeAt(o);return e?n-r:i},o.binary.hex.encode=o.bytesToHex,o.binary.hex.decode=function(t,e,r){var i=e;i||(i=new Uint8Array(Math.ceil(t.length/2)));var n=0,o=r=r||0;for(1&t.length&&(n=1,i[o++]=parseInt(t[0],16));n<t.length;n+=2)i[o++]=parseInt(t.substr(n,2),16);return e?o-r:i},o.binary.base64.encode=function(t,e){for(var r,i,n,o="",s="",a=0;a<t.byteLength;)r=t[a++],i=t[a++],n=t[a++],o+=u.charAt(r>>2),o+=u.charAt((3&r)<<4|i>>4),isNaN(i)?o+="==":(o+=u.charAt((15&i)<<2|n>>6),o+=isNaN(n)?"=":u.charAt(63&n)),e&&o.length>e&&(s+=o.substr(0,e)+"\r\n",o=o.substr(e));return s+o},o.binary.base64.decode=function(t,e,r){var i,n,o,s,a=e;a||(a=new Uint8Array(3*Math.ceil(t.length/4))),t=t.replace(/[^A-Za-z0-9\+\/\=]/g,"");for(var u=0,c=r=r||0;u<t.length;)i=h[t.charCodeAt(u++)-43],n=h[t.charCodeAt(u++)-43],o=h[t.charCodeAt(u++)-43],s=h[t.charCodeAt(u++)-43],a[c++]=i<<2|n>>4,64!==o&&(a[c++]=(15&n)<<4|o>>2,64!==s&&(a[c++]=(3&o)<<6|s));return e?c-r:a.subarray(0,c)},o.binary.base58.encode=function(t,e){return o.binary.baseN.encode(t,c,e)},o.binary.base58.decode=function(t,e){return o.binary.baseN.decode(t,c,e)},o.text={utf8:{},utf16:{}},o.text.utf8.encode=function(t,e,r){t=o.encodeUtf8(t);var i=e;i||(i=new Uint8Array(t.length));for(var n=r=r||0,s=0;s<t.length;++s)i[n++]=t.charCodeAt(s);return e?n-r:i},o.text.utf8.decode=function(t){return o.decodeUtf8(String.fromCharCode.apply(null,t))},o.text.utf16.encode=function(t,e,r){var i=e;i||(i=new Uint8Array(2*t.length));for(var n=new Uint16Array(i.buffer),o=r=r||0,s=r,a=0;a<t.length;++a)n[s++]=t.charCodeAt(a),o+=2;return e?o-r:i},o.text.utf16.decode=function(t){return String.fromCharCode.apply(null,new Uint16Array(t.buffer))},o.deflate=function(t,e,r){if(e=o.decode64(t.deflate(o.encode64(e)).rval),r){var i=2;32&e.charCodeAt(1)&&(i=6),e=e.substring(i,e.length-4)}return e},o.inflate=function(t,e,r){var i=t.inflate(o.encode64(e)).rval;return null===i?null:o.decode64(i)};var f=function(t,e,r){if(!t)throw new Error("WebStorage not available.");var i;if(null===r?i=t.removeItem(e):(r=o.encode64(JSON.stringify(r)),i=t.setItem(e,r)),void 0!==i&&!0!==i.rval){var n=new Error(i.error.message);throw n.id=i.error.id,n.name=i.error.name,n}},l=function(t,e){if(!t)throw new Error("WebStorage not available.");var r=t.getItem(e);if(t.init)if(null===r.rval){if(r.error){var i=new Error(r.error.message);throw i.id=r.error.id,i.name=r.error.name,i}r=null}else r=r.rval;return null!==r&&(r=JSON.parse(o.decode64(r))),r},d=function(t,e,r,i){var n=l(t,e);null===n&&(n={}),n[r]=i,f(t,e,n)},p=function(t,e,r){var i=l(t,e);return null!==i&&(i=r in i?i[r]:null),i},g=function(t,e,r){var i=l(t,e);if(null!==i&&r in i){delete i[r];var n=!0;for(var o in i){n=!1;break}n&&(i=null),f(t,e,i)}},y=function(t,e){f(t,e,null)},m=function(t,e,r){var i,n=null;void 0===r&&(r=["web","flash"]);var o=!1,s=null;for(var a in r){i=r[a];try{if("flash"===i||"both"===i){if(null===e[0])throw new Error("Flash local storage not available.");n=t.apply(this,e),o="flash"===i}"web"!==i&&"both"!==i||(e[0]=localStorage,n=t.apply(this,e),o=!0)}catch(t){s=t}if(o)break}if(!o)throw s;return n};o.setItem=function(t,e,r,i,n){m(d,arguments,n)},o.getItem=function(t,e,r,i){return m(p,arguments,i)},o.removeItem=function(t,e,r,i){m(g,arguments,i)},o.clearItems=function(t,e,r){m(y,arguments,r)},o.parseUrl=function(t){var e=/^(https?):\/\/([^:&^\/]*):?(\d*)(.*)$/g;e.lastIndex=0;var r=e.exec(t),i=null===r?null:{full:t,scheme:r[1],host:r[2],port:r[3],path:r[4]};return i&&(i.fullHost=i.host,i.port?(80!==i.port&&"http"===i.scheme||443!==i.port&&"https"===i.scheme)&&(i.fullHost+=":"+i.port):"http"===i.scheme?i.port=80:"https"===i.scheme&&(i.port=443),i.full=i.scheme+"://"+i.fullHost),i};var v=null;o.getQueryVariables=function(t){var e,r=function(t){for(var e={},r=t.split("&"),i=0;i<r.length;i++){var n,o,s=r[i].indexOf("=");s>0?(n=r[i].substring(0,s),o=r[i].substring(s+1)):(n=r[i],o=null),n in e||(e[n]=[]),n in Object.prototype||null===o||e[n].push(unescape(o))}return e};return void 0===t?(null===v&&(v="undefined"!=typeof window&&window.location&&window.location.search?r(window.location.search.substring(1)):{}),e=v):e=r(t),e},o.parseFragment=function(t){var e=t,r="",i=t.indexOf("?");i>0&&(e=t.substring(0,i),r=t.substring(i+1));var n=e.split("/");return n.length>0&&""===n[0]&&n.shift(),{pathString:e,queryString:r,path:n,query:""===r?{}:o.getQueryVariables(r)}},o.makeRequest=function(t){var e=o.parseFragment(t),r={path:e.pathString,query:e.queryString,getPath:function(t){return void 0===t?e.path:e.path[t]},getQuery:function(t,r){var i;return void 0===t?i=e.query:(i=e.query[t])&&void 0!==r&&(i=i[r]),i},getQueryLast:function(t,e){var i=r.getQuery(t);return i?i[i.length-1]:e}};return r},o.makeLink=function(t,e,r){t=jQuery.isArray(t)?t.join("/"):t;var i=jQuery.param(e||{});return r=r||"",t+(i.length>0?"?"+i:"")+(r.length>0?"#"+r:"")},o.isEmpty=function(t){for(var e in t)if(t.hasOwnProperty(e))return!1;return!0},o.format=function(t){for(var e,r,i=/%./g,n=0,o=[],s=0;e=i.exec(t);){(r=t.substring(s,i.lastIndex-2)).length>0&&o.push(r),s=i.lastIndex;var a=e[0][1];switch(a){case"s":case"o":n<arguments.length?o.push(arguments[1+n++]):o.push("<?>");break;case"%":o.push("%");break;default:o.push("<%"+a+"?>")}}return o.push(t.substring(s)),o.join("")},o.formatNumber=function(t,e,r,i){var n=t,o=isNaN(e=Math.abs(e))?2:e,s=void 0===r?",":r,a=void 0===i?".":i,u=n<0?"-":"",h=parseInt(n=Math.abs(+n||0).toFixed(o),10)+"",c=h.length>3?h.length%3:0;return u+(c?h.substr(0,c)+a:"")+h.substr(c).replace(/(\d{3})(?=\d)/g,"$1"+a)+(o?s+Math.abs(n-h).toFixed(o).slice(2):"")},o.formatSize=function(t){return t>=1073741824?o.formatNumber(t/1073741824,2,".","")+" GiB":t>=1048576?o.formatNumber(t/1048576,2,".","")+" MiB":t>=1024?o.formatNumber(t/1024,0)+" KiB":o.formatNumber(t,0)+" bytes"},o.bytesFromIP=function(t){return-1!==t.indexOf(".")?o.bytesFromIPv4(t):-1!==t.indexOf(":")?o.bytesFromIPv6(t):null},o.bytesFromIPv4=function(t){if(4!==(t=t.split(".")).length)return null;for(var e=o.createBuffer(),r=0;r<t.length;++r){var i=parseInt(t[r],10);if(isNaN(i))return null;e.putByte(i)}return e.getBytes()},o.bytesFromIPv6=function(t){for(var e=0,r=2*(8-(t=t.split(":").filter((function(t){return 0===t.length&&++e,!0}))).length+e),i=o.createBuffer(),n=0;n<8;++n)if(t[n]&&0!==t[n].length){var s=o.hexToBytes(t[n]);s.length<2&&i.putByte(0),i.putBytes(s)}else i.fillWithByte(0,r),r=0;return i.getBytes()},o.bytesToIP=function(t){return 4===t.length?o.bytesToIPv4(t):16===t.length?o.bytesToIPv6(t):null},o.bytesToIPv4=function(t){if(4!==t.length)return null;for(var e=[],r=0;r<t.length;++r)e.push(t.charCodeAt(r));return e.join(".")},o.bytesToIPv6=function(t){if(16!==t.length)return null;for(var e=[],r=[],i=0,n=0;n<t.length;n+=2){for(var s=o.bytesToHex(t[n]+t[n+1]);"0"===s[0]&&"0"!==s;)s=s.substr(1);if("0"===s){var a=r[r.length-1],u=e.length;a&&u===a.end+1?(a.end=u,a.end-a.start>r[i].end-r[i].start&&(i=r.length-1)):r.push({start:u,end:u})}e.push(s)}if(r.length>0){var h=r[i];h.end-h.start>0&&(e.splice(h.start,h.end-h.start+1,""),0===h.start&&e.unshift(""),7===h.end&&e.push(""))}return e.join(":")},o.estimateCores=function(t,e){if("function"==typeof t&&(e=t,t={}),t=t||{},"cores"in o&&!t.update)return e(null,o.cores);if("undefined"!=typeof navigator&&"hardwareConcurrency"in navigator&&navigator.hardwareConcurrency>0)return o.cores=navigator.hardwareConcurrency,e(null,o.cores);if("undefined"==typeof Worker)return o.cores=1,e(null,o.cores);if("undefined"==typeof Blob)return o.cores=2,e(null,o.cores);var r=URL.createObjectURL(new Blob(["(",function(){self.addEventListener("message",(function(t){for(var e=Date.now(),r=e+4;Date.now()<r;);self.postMessage({st:e,et:r})}))}.toString(),")()"],{type:"application/javascript"}));!function t(i,n,s){if(0===n){var a=Math.floor(i.reduce((function(t,e){return t+e}),0)/i.length);return o.cores=Math.max(1,a),URL.revokeObjectURL(r),e(null,o.cores)}!function(t,e){for(var i=[],n=[],o=0;o<t;++o){var s=new Worker(r);s.addEventListener("message",(function(r){if(n.push(r.data),n.length===t){for(var o=0;o<t;++o)i[o].terminate();e(0,n)}})),i.push(s)}for(o=0;o<t;++o)i[o].postMessage(o)}(s,(function(e,r){i.push(function(t,e){for(var r=[],i=0;i<t;++i)for(var n=e[i],o=r[i]=[],s=0;s<t;++s)if(i!==s){var a=e[s];(n.st>a.st&&n.st<a.et||a.st>n.st&&a.st<n.et)&&o.push(s)}return r.reduce((function(t,e){return Math.max(t,e.length)}),0)}(s,r)),t(i,n-1,s)}))}([],5,16)}},25414:(t,e,r)=>{var i=r(3832);r(8925),r(3068),r(33480),r(28991),r(86971),r(66270),r(26953),r(96007),r(28095),r(97116);var n=i.asn1,o=t.exports=i.pki=i.pki||{},s=o.oids,a={};a.CN=s.commonName,a.commonName="CN",a.C=s.countryName,a.countryName="C",a.L=s.localityName,a.localityName="L",a.ST=s.stateOrProvinceName,a.stateOrProvinceName="ST",a.O=s.organizationName,a.organizationName="O",a.OU=s.organizationalUnitName,a.organizationalUnitName="OU",a.E=s.emailAddress,a.emailAddress="E";var u=i.pki.rsa.publicKeyValidator,h={name:"Certificate",tagClass:n.Class.UNIVERSAL,type:n.Type.SEQUENCE,constructed:!0,value:[{name:"Certificate.TBSCertificate",tagClass:n.Class.UNIVERSAL,type:n.Type.SEQUENCE,constructed:!0,captureAsn1:"tbsCertificate",value:[{name:"Certificate.TBSCertificate.version",tagClass:n.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,value:[{name:"Certificate.TBSCertificate.version.integer",tagClass:n.Class.UNIVERSAL,type:n.Type.INTEGER,constructed:!1,capture:"certVersion"}]},{name:"Certificate.TBSCertificate.serialNumber",tagClass:n.Class.UNIVERSAL,type:n.Type.INTEGER,constructed:!1,capture:"certSerialNumber"},{name:"Certificate.TBSCertificate.signature",tagClass:n.Class.UNIVERSAL,type:n.Type.SEQUENCE,constructed:!0,value:[{name:"Certificate.TBSCertificate.signature.algorithm",tagClass:n.Class.UNIVERSAL,type:n.Type.OID,constructed:!1,capture:"certinfoSignatureOid"},{name:"Certificate.TBSCertificate.signature.parameters",tagClass:n.Class.UNIVERSAL,optional:!0,captureAsn1:"certinfoSignatureParams"}]},{name:"Certificate.TBSCertificate.issuer",tagClass:n.Class.UNIVERSAL,type:n.Type.SEQUENCE,constructed:!0,captureAsn1:"certIssuer"},{name:"Certificate.TBSCertificate.validity",tagClass:n.Class.UNIVERSAL,type:n.Type.SEQUENCE,constructed:!0,value:[{name:"Certificate.TBSCertificate.validity.notBefore (utc)",tagClass:n.Class.UNIVERSAL,type:n.Type.UTCTIME,constructed:!1,optional:!0,capture:"certValidity1UTCTime"},{name:"Certificate.TBSCertificate.validity.notBefore (generalized)",tagClass:n.Class.UNIVERSAL,type:n.Type.GENERALIZEDTIME,constructed:!1,optional:!0,capture:"certValidity2GeneralizedTime"},{name:"Certificate.TBSCertificate.validity.notAfter (utc)",tagClass:n.Class.UNIVERSAL,type:n.Type.UTCTIME,constructed:!1,optional:!0,capture:"certValidity3UTCTime"},{name:"Certificate.TBSCertificate.validity.notAfter (generalized)",tagClass:n.Class.UNIVERSAL,type:n.Type.GENERALIZEDTIME,constructed:!1,optional:!0,capture:"certValidity4GeneralizedTime"}]},{name:"Certificate.TBSCertificate.subject",tagClass:n.Class.UNIVERSAL,type:n.Type.SEQUENCE,constructed:!0,captureAsn1:"certSubject"},u,{name:"Certificate.TBSCertificate.issuerUniqueID",tagClass:n.Class.CONTEXT_SPECIFIC,type:1,constructed:!0,optional:!0,value:[{name:"Certificate.TBSCertificate.issuerUniqueID.id",tagClass:n.Class.UNIVERSAL,type:n.Type.BITSTRING,constructed:!1,captureBitStringValue:"certIssuerUniqueId"}]},{name:"Certificate.TBSCertificate.subjectUniqueID",tagClass:n.Class.CONTEXT_SPECIFIC,type:2,constructed:!0,optional:!0,value:[{name:"Certificate.TBSCertificate.subjectUniqueID.id",tagClass:n.Class.UNIVERSAL,type:n.Type.BITSTRING,constructed:!1,captureBitStringValue:"certSubjectUniqueId"}]},{name:"Certificate.TBSCertificate.extensions",tagClass:n.Class.CONTEXT_SPECIFIC,type:3,constructed:!0,captureAsn1:"certExtensions",optional:!0}]},{name:"Certificate.signatureAlgorithm",tagClass:n.Class.UNIVERSAL,type:n.Type.SEQUENCE,constructed:!0,value:[{name:"Certificate.signatureAlgorithm.algorithm",tagClass:n.Class.UNIVERSAL,type:n.Type.OID,constructed:!1,capture:"certSignatureOid"},{name:"Certificate.TBSCertificate.signature.parameters",tagClass:n.Class.UNIVERSAL,optional:!0,captureAsn1:"certSignatureParams"}]},{name:"Certificate.signatureValue",tagClass:n.Class.UNIVERSAL,type:n.Type.BITSTRING,constructed:!1,captureBitStringValue:"certSignature"}]},c={name:"rsapss",tagClass:n.Class.UNIVERSAL,type:n.Type.SEQUENCE,constructed:!0,value:[{name:"rsapss.hashAlgorithm",tagClass:n.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,value:[{name:"rsapss.hashAlgorithm.AlgorithmIdentifier",tagClass:n.Class.UNIVERSAL,type:n.Class.SEQUENCE,constructed:!0,optional:!0,value:[{name:"rsapss.hashAlgorithm.AlgorithmIdentifier.algorithm",tagClass:n.Class.UNIVERSAL,type:n.Type.OID,constructed:!1,capture:"hashOid"}]}]},{name:"rsapss.maskGenAlgorithm",tagClass:n.Class.CONTEXT_SPECIFIC,type:1,constructed:!0,value:[{name:"rsapss.maskGenAlgorithm.AlgorithmIdentifier",tagClass:n.Class.UNIVERSAL,type:n.Class.SEQUENCE,constructed:!0,optional:!0,value:[{name:"rsapss.maskGenAlgorithm.AlgorithmIdentifier.algorithm",tagClass:n.Class.UNIVERSAL,type:n.Type.OID,constructed:!1,capture:"maskGenOid"},{name:"rsapss.maskGenAlgorithm.AlgorithmIdentifier.params",tagClass:n.Class.UNIVERSAL,type:n.Type.SEQUENCE,constructed:!0,value:[{name:"rsapss.maskGenAlgorithm.AlgorithmIdentifier.params.algorithm",tagClass:n.Class.UNIVERSAL,type:n.Type.OID,constructed:!1,capture:"maskGenHashOid"}]}]}]},{name:"rsapss.saltLength",tagClass:n.Class.CONTEXT_SPECIFIC,type:2,optional:!0,value:[{name:"rsapss.saltLength.saltLength",tagClass:n.Class.UNIVERSAL,type:n.Class.INTEGER,constructed:!1,capture:"saltLength"}]},{name:"rsapss.trailerField",tagClass:n.Class.CONTEXT_SPECIFIC,type:3,optional:!0,value:[{name:"rsapss.trailer.trailer",tagClass:n.Class.UNIVERSAL,type:n.Class.INTEGER,constructed:!1,capture:"trailer"}]}]},f={name:"CertificationRequestInfo",tagClass:n.Class.UNIVERSAL,type:n.Type.SEQUENCE,constructed:!0,captureAsn1:"certificationRequestInfo",value:[{name:"CertificationRequestInfo.integer",tagClass:n.Class.UNIVERSAL,type:n.Type.INTEGER,constructed:!1,capture:"certificationRequestInfoVersion"},{name:"CertificationRequestInfo.subject",tagClass:n.Class.UNIVERSAL,type:n.Type.SEQUENCE,constructed:!0,captureAsn1:"certificationRequestInfoSubject"},u,{name:"CertificationRequestInfo.attributes",tagClass:n.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,capture:"certificationRequestInfoAttributes",value:[{name:"CertificationRequestInfo.attributes",tagClass:n.Class.UNIVERSAL,type:n.Type.SEQUENCE,constructed:!0,value:[{name:"CertificationRequestInfo.attributes.type",tagClass:n.Class.UNIVERSAL,type:n.Type.OID,constructed:!1},{name:"CertificationRequestInfo.attributes.value",tagClass:n.Class.UNIVERSAL,type:n.Type.SET,constructed:!0}]}]}]},l={name:"CertificationRequest",tagClass:n.Class.UNIVERSAL,type:n.Type.SEQUENCE,constructed:!0,captureAsn1:"csr",value:[f,{name:"CertificationRequest.signatureAlgorithm",tagClass:n.Class.UNIVERSAL,type:n.Type.SEQUENCE,constructed:!0,value:[{name:"CertificationRequest.signatureAlgorithm.algorithm",tagClass:n.Class.UNIVERSAL,type:n.Type.OID,constructed:!1,capture:"csrSignatureOid"},{name:"CertificationRequest.signatureAlgorithm.parameters",tagClass:n.Class.UNIVERSAL,optional:!0,captureAsn1:"csrSignatureParams"}]},{name:"CertificationRequest.signature",tagClass:n.Class.UNIVERSAL,type:n.Type.BITSTRING,constructed:!1,captureBitStringValue:"csrSignature"}]};function d(t,e){"string"==typeof e&&(e={shortName:e});for(var r,i=null,n=0;null===i&&n<t.attributes.length;++n)r=t.attributes[n],(e.type&&e.type===r.type||e.name&&e.name===r.name||e.shortName&&e.shortName===r.shortName)&&(i=r);return i}o.RDNAttributesAsArray=function(t,e){for(var r,i,o,u=[],h=0;h<t.value.length;++h){r=t.value[h];for(var c=0;c<r.value.length;++c)o={},i=r.value[c],o.type=n.derToOid(i.value[0].value),o.value=i.value[1].value,o.valueTagClass=i.value[1].type,o.type in s&&(o.name=s[o.type],o.name in a&&(o.shortName=a[o.name])),e&&(e.update(o.type),e.update(o.value)),u.push(o)}return u},o.CRIAttributesAsArray=function(t){for(var e=[],r=0;r<t.length;++r)for(var i=t[r],u=n.derToOid(i.value[0].value),h=i.value[1].value,c=0;c<h.length;++c){var f={};if(f.type=u,f.value=h[c].value,f.valueTagClass=h[c].type,f.type in s&&(f.name=s[f.type],f.name in a&&(f.shortName=a[f.name])),f.type===s.extensionRequest){f.extensions=[];for(var l=0;l<f.value.length;++l)f.extensions.push(o.certificateExtensionFromAsn1(f.value[l]))}e.push(f)}return e};var p=function(t,e,r){var i={};if(t!==s["RSASSA-PSS"])return i;r&&(i={hash:{algorithmOid:s.sha1},mgf:{algorithmOid:s.mgf1,hash:{algorithmOid:s.sha1}},saltLength:20});var o={},a=[];if(!n.validate(e,c,o,a)){var u=new Error("Cannot read RSASSA-PSS parameter block.");throw u.errors=a,u}return void 0!==o.hashOid&&(i.hash=i.hash||{},i.hash.algorithmOid=n.derToOid(o.hashOid)),void 0!==o.maskGenOid&&(i.mgf=i.mgf||{},i.mgf.algorithmOid=n.derToOid(o.maskGenOid),i.mgf.hash=i.mgf.hash||{},i.mgf.hash.algorithmOid=n.derToOid(o.maskGenHashOid)),void 0!==o.saltLength&&(i.saltLength=o.saltLength.charCodeAt(0)),i};function g(t){for(var e,r,o=n.create(n.Class.UNIVERSAL,n.Type.SEQUENCE,!0,[]),s=t.attributes,a=0;a<s.length;++a){var u=(e=s[a]).value,h=n.Type.PRINTABLESTRING;"valueTagClass"in e&&(h=e.valueTagClass)===n.Type.UTF8&&(u=i.util.encodeUtf8(u)),r=n.create(n.Class.UNIVERSAL,n.Type.SET,!0,[n.create(n.Class.UNIVERSAL,n.Type.SEQUENCE,!0,[n.create(n.Class.UNIVERSAL,n.Type.OID,!1,n.oidToDer(e.type).getBytes()),n.create(n.Class.UNIVERSAL,h,!1,u)])]),o.value.push(r)}return o}function y(t){for(var e,r=0;r<t.length;++r){if(void 0===(e=t[r]).name&&(e.type&&e.type in o.oids?e.name=o.oids[e.type]:e.shortName&&e.shortName in a&&(e.name=o.oids[a[e.shortName]])),void 0===e.type){if(!e.name||!(e.name in o.oids))throw(u=new Error("Attribute type not specified.")).attribute=e,u;e.type=o.oids[e.name]}if(void 0===e.shortName&&e.name&&e.name in a&&(e.shortName=a[e.name]),e.type===s.extensionRequest&&(e.valueConstructed=!0,e.valueTagClass=n.Type.SEQUENCE,!e.value&&e.extensions)){e.value=[];for(var i=0;i<e.extensions.length;++i)e.value.push(o.certificateExtensionToAsn1(m(e.extensions[i])))}var u;if(void 0===e.value)throw(u=new Error("Attribute value not specified.")).attribute=e,u}}function m(t,e){if(e=e||{},void 0===t.name&&t.id&&t.id in o.oids&&(t.name=o.oids[t.id]),void 0===t.id){if(!t.name||!(t.name in o.oids))throw(_=new Error("Extension ID not specified.")).extension=t,_;t.id=o.oids[t.name]}if(void 0!==t.value)return t;if("keyUsage"===t.name){var r=0,a=0,u=0;t.digitalSignature&&(a|=128,r=7),t.nonRepudiation&&(a|=64,r=6),t.keyEncipherment&&(a|=32,r=5),t.dataEncipherment&&(a|=16,r=4),t.keyAgreement&&(a|=8,r=3),t.keyCertSign&&(a|=4,r=2),t.cRLSign&&(a|=2,r=1),t.encipherOnly&&(a|=1,r=0),t.decipherOnly&&(u|=128,r=7);var h=String.fromCharCode(r);0!==u?h+=String.fromCharCode(a)+String.fromCharCode(u):0!==a&&(h+=String.fromCharCode(a)),t.value=n.create(n.Class.UNIVERSAL,n.Type.BITSTRING,!1,h)}else if("basicConstraints"===t.name)t.value=n.create(n.Class.UNIVERSAL,n.Type.SEQUENCE,!0,[]),t.cA&&t.value.value.push(n.create(n.Class.UNIVERSAL,n.Type.BOOLEAN,!1,String.fromCharCode(255))),"pathLenConstraint"in t&&t.value.value.push(n.create(n.Class.UNIVERSAL,n.Type.INTEGER,!1,n.integerToDer(t.pathLenConstraint).getBytes()));else if("extKeyUsage"===t.name){t.value=n.create(n.Class.UNIVERSAL,n.Type.SEQUENCE,!0,[]);var c=t.value.value;for(var f in t)!0===t[f]&&(f in s?c.push(n.create(n.Class.UNIVERSAL,n.Type.OID,!1,n.oidToDer(s[f]).getBytes())):-1!==f.indexOf(".")&&c.push(n.create(n.Class.UNIVERSAL,n.Type.OID,!1,n.oidToDer(f).getBytes())))}else if("nsCertType"===t.name)r=0,a=0,t.client&&(a|=128,r=7),t.server&&(a|=64,r=6),t.email&&(a|=32,r=5),t.objsign&&(a|=16,r=4),t.reserved&&(a|=8,r=3),t.sslCA&&(a|=4,r=2),t.emailCA&&(a|=2,r=1),t.objCA&&(a|=1,r=0),h=String.fromCharCode(r),0!==a&&(h+=String.fromCharCode(a)),t.value=n.create(n.Class.UNIVERSAL,n.Type.BITSTRING,!1,h);else if("subjectAltName"===t.name||"issuerAltName"===t.name){t.value=n.create(n.Class.UNIVERSAL,n.Type.SEQUENCE,!0,[]);for(var l=0;l<t.altNames.length;++l){if(h=(v=t.altNames[l]).value,7===v.type&&v.ip){if(null===(h=i.util.bytesFromIP(v.ip)))throw(_=new Error('Extension "ip" value is not a valid IPv4 or IPv6 address.')).extension=t,_}else 8===v.type&&(h=v.oid?n.oidToDer(n.oidToDer(v.oid)):n.oidToDer(h));t.value.value.push(n.create(n.Class.CONTEXT_SPECIFIC,v.type,!1,h))}}else if("nsComment"===t.name&&e.cert){if(!/^[\x00-\x7F]*$/.test(t.comment)||t.comment.length<1||t.comment.length>128)throw new Error('Invalid "nsComment" content.');t.value=n.create(n.Class.UNIVERSAL,n.Type.IA5STRING,!1,t.comment)}else if("subjectKeyIdentifier"===t.name&&e.cert){var d=e.cert.generateSubjectKeyIdentifier();t.subjectKeyIdentifier=d.toHex(),t.value=n.create(n.Class.UNIVERSAL,n.Type.OCTETSTRING,!1,d.getBytes())}else if("authorityKeyIdentifier"===t.name&&e.cert){if(t.value=n.create(n.Class.UNIVERSAL,n.Type.SEQUENCE,!0,[]),c=t.value.value,t.keyIdentifier){var p=!0===t.keyIdentifier?e.cert.generateSubjectKeyIdentifier().getBytes():t.keyIdentifier;c.push(n.create(n.Class.CONTEXT_SPECIFIC,0,!1,p))}if(t.authorityCertIssuer){var y=[n.create(n.Class.CONTEXT_SPECIFIC,4,!0,[g(!0===t.authorityCertIssuer?e.cert.issuer:t.authorityCertIssuer)])];c.push(n.create(n.Class.CONTEXT_SPECIFIC,1,!0,y))}if(t.serialNumber){var m=i.util.hexToBytes(!0===t.serialNumber?e.cert.serialNumber:t.serialNumber);c.push(n.create(n.Class.CONTEXT_SPECIFIC,2,!1,m))}}else if("cRLDistributionPoints"===t.name){t.value=n.create(n.Class.UNIVERSAL,n.Type.SEQUENCE,!0,[]),c=t.value.value;var v,b=n.create(n.Class.UNIVERSAL,n.Type.SEQUENCE,!0,[]),w=n.create(n.Class.CONTEXT_SPECIFIC,0,!0,[]);for(l=0;l<t.altNames.length;++l){if(h=(v=t.altNames[l]).value,7===v.type&&v.ip){if(null===(h=i.util.bytesFromIP(v.ip)))throw(_=new Error('Extension "ip" value is not a valid IPv4 or IPv6 address.')).extension=t,_}else 8===v.type&&(h=v.oid?n.oidToDer(n.oidToDer(v.oid)):n.oidToDer(h));w.value.push(n.create(n.Class.CONTEXT_SPECIFIC,v.type,!1,h))}b.value.push(n.create(n.Class.CONTEXT_SPECIFIC,0,!0,[w])),c.push(b)}var _;if(void 0===t.value)throw(_=new Error("Extension value not specified.")).extension=t,_;return t}function v(t,e){switch(t){case s["RSASSA-PSS"]:var r=[];return void 0!==e.hash.algorithmOid&&r.push(n.create(n.Class.CONTEXT_SPECIFIC,0,!0,[n.create(n.Class.UNIVERSAL,n.Type.SEQUENCE,!0,[n.create(n.Class.UNIVERSAL,n.Type.OID,!1,n.oidToDer(e.hash.algorithmOid).getBytes()),n.create(n.Class.UNIVERSAL,n.Type.NULL,!1,"")])])),void 0!==e.mgf.algorithmOid&&r.push(n.create(n.Class.CONTEXT_SPECIFIC,1,!0,[n.create(n.Class.UNIVERSAL,n.Type.SEQUENCE,!0,[n.create(n.Class.UNIVERSAL,n.Type.OID,!1,n.oidToDer(e.mgf.algorithmOid).getBytes()),n.create(n.Class.UNIVERSAL,n.Type.SEQUENCE,!0,[n.create(n.Class.UNIVERSAL,n.Type.OID,!1,n.oidToDer(e.mgf.hash.algorithmOid).getBytes()),n.create(n.Class.UNIVERSAL,n.Type.NULL,!1,"")])])])),void 0!==e.saltLength&&r.push(n.create(n.Class.CONTEXT_SPECIFIC,2,!0,[n.create(n.Class.UNIVERSAL,n.Type.INTEGER,!1,n.integerToDer(e.saltLength).getBytes())])),n.create(n.Class.UNIVERSAL,n.Type.SEQUENCE,!0,r);default:return n.create(n.Class.UNIVERSAL,n.Type.NULL,!1,"")}}function b(t){var e=n.create(n.Class.CONTEXT_SPECIFIC,0,!0,[]);if(0===t.attributes.length)return e;for(var r=t.attributes,o=0;o<r.length;++o){var s=r[o],a=s.value,u=n.Type.UTF8;"valueTagClass"in s&&(u=s.valueTagClass),u===n.Type.UTF8&&(a=i.util.encodeUtf8(a));var h=!1;"valueConstructed"in s&&(h=s.valueConstructed);var c=n.create(n.Class.UNIVERSAL,n.Type.SEQUENCE,!0,[n.create(n.Class.UNIVERSAL,n.Type.OID,!1,n.oidToDer(s.type).getBytes()),n.create(n.Class.UNIVERSAL,n.Type.SET,!0,[n.create(n.Class.UNIVERSAL,u,h,a)])]);e.value.push(c)}return e}o.certificateFromPem=function(t,e,r){var s=i.pem.decode(t)[0];if("CERTIFICATE"!==s.type&&"X509 CERTIFICATE"!==s.type&&"TRUSTED CERTIFICATE"!==s.type){var a=new Error('Could not convert certificate from PEM; PEM header type is not "CERTIFICATE", "X509 CERTIFICATE", or "TRUSTED CERTIFICATE".');throw a.headerType=s.type,a}if(s.procType&&"ENCRYPTED"===s.procType.type)throw new Error("Could not convert certificate from PEM; PEM is encrypted.");var u=n.fromDer(s.body,r);return o.certificateFromAsn1(u,e)},o.certificateToPem=function(t,e){var r={type:"CERTIFICATE",body:n.toDer(o.certificateToAsn1(t)).getBytes()};return i.pem.encode(r,{maxline:e})},o.publicKeyFromPem=function(t){var e=i.pem.decode(t)[0];if("PUBLIC KEY"!==e.type&&"RSA PUBLIC KEY"!==e.type){var r=new Error('Could not convert public key from PEM; PEM header type is not "PUBLIC KEY" or "RSA PUBLIC KEY".');throw r.headerType=e.type,r}if(e.procType&&"ENCRYPTED"===e.procType.type)throw new Error("Could not convert public key from PEM; PEM is encrypted.");var s=n.fromDer(e.body);return o.publicKeyFromAsn1(s)},o.publicKeyToPem=function(t,e){var r={type:"PUBLIC KEY",body:n.toDer(o.publicKeyToAsn1(t)).getBytes()};return i.pem.encode(r,{maxline:e})},o.publicKeyToRSAPublicKeyPem=function(t,e){var r={type:"RSA PUBLIC KEY",body:n.toDer(o.publicKeyToRSAPublicKey(t)).getBytes()};return i.pem.encode(r,{maxline:e})},o.getPublicKeyFingerprint=function(t,e){var r,s=(e=e||{}).md||i.md.sha1.create();switch(e.type||"RSAPublicKey"){case"RSAPublicKey":r=n.toDer(o.publicKeyToRSAPublicKey(t)).getBytes();break;case"SubjectPublicKeyInfo":r=n.toDer(o.publicKeyToAsn1(t)).getBytes();break;default:throw new Error('Unknown fingerprint type "'+e.type+'".')}s.start(),s.update(r);var a=s.digest();if("hex"===e.encoding){var u=a.toHex();return e.delimiter?u.match(/.{2}/g).join(e.delimiter):u}if("binary"===e.encoding)return a.getBytes();if(e.encoding)throw new Error('Unknown encoding "'+e.encoding+'".');return a},o.certificationRequestFromPem=function(t,e,r){var s=i.pem.decode(t)[0];if("CERTIFICATE REQUEST"!==s.type){var a=new Error('Could not convert certification request from PEM; PEM header type is not "CERTIFICATE REQUEST".');throw a.headerType=s.type,a}if(s.procType&&"ENCRYPTED"===s.procType.type)throw new Error("Could not convert certification request from PEM; PEM is encrypted.");var u=n.fromDer(s.body,r);return o.certificationRequestFromAsn1(u,e)},o.certificationRequestToPem=function(t,e){var r={type:"CERTIFICATE REQUEST",body:n.toDer(o.certificationRequestToAsn1(t)).getBytes()};return i.pem.encode(r,{maxline:e})},o.createCertificate=function(){var t={version:2,serialNumber:"00",signatureOid:null,signature:null,siginfo:{}};return t.siginfo.algorithmOid=null,t.validity={},t.validity.notBefore=new Date,t.validity.notAfter=new Date,t.issuer={},t.issuer.getField=function(e){return d(t.issuer,e)},t.issuer.addField=function(e){y([e]),t.issuer.attributes.push(e)},t.issuer.attributes=[],t.issuer.hash=null,t.subject={},t.subject.getField=function(e){return d(t.subject,e)},t.subject.addField=function(e){y([e]),t.subject.attributes.push(e)},t.subject.attributes=[],t.subject.hash=null,t.extensions=[],t.publicKey=null,t.md=null,t.setSubject=function(e,r){y(e),t.subject.attributes=e,delete t.subject.uniqueId,r&&(t.subject.uniqueId=r),t.subject.hash=null},t.setIssuer=function(e,r){y(e),t.issuer.attributes=e,delete t.issuer.uniqueId,r&&(t.issuer.uniqueId=r),t.issuer.hash=null},t.setExtensions=function(e){for(var r=0;r<e.length;++r)m(e[r],{cert:t});t.extensions=e},t.getExtension=function(e){"string"==typeof e&&(e={name:e});for(var r,i=null,n=0;null===i&&n<t.extensions.length;++n)r=t.extensions[n],(e.id&&r.id===e.id||e.name&&r.name===e.name)&&(i=r);return i},t.sign=function(e,r){t.md=r||i.md.sha1.create();var a=s[t.md.algorithm+"WithRSAEncryption"];if(!a){var u=new Error("Could not compute certificate digest. Unknown message digest algorithm OID.");throw u.algorithm=t.md.algorithm,u}t.signatureOid=t.siginfo.algorithmOid=a,t.tbsCertificate=o.getTBSCertificate(t);var h=n.toDer(t.tbsCertificate);t.md.update(h.getBytes()),t.signature=e.sign(t.md)},t.verify=function(e){var r=!1;if(!t.issued(e)){var a=e.issuer,u=t.subject;throw(g=new Error("The parent certificate did not issue the given child certificate; the child certificate's issuer does not match the parent's subject.")).expectedIssuer=a.attributes,g.actualIssuer=u.attributes,g}var h=e.md;if(null===h){if(e.signatureOid in s)switch(s[e.signatureOid]){case"sha1WithRSAEncryption":h=i.md.sha1.create();break;case"md5WithRSAEncryption":h=i.md.md5.create();break;case"sha256WithRSAEncryption":h=i.md.sha256.create();break;case"sha384WithRSAEncryption":h=i.md.sha384.create();break;case"sha512WithRSAEncryption":h=i.md.sha512.create();break;case"RSASSA-PSS":h=i.md.sha256.create()}if(null===h)throw(g=new Error("Could not compute certificate digest. Unknown signature OID.")).signatureOid=e.signatureOid,g;var c=e.tbsCertificate||o.getTBSCertificate(e),f=n.toDer(c);h.update(f.getBytes())}if(null!==h){var l;switch(e.signatureOid){case s.sha1WithRSAEncryption:l=void 0;break;case s["RSASSA-PSS"]:var d,p,g;if(void 0===(d=s[e.signatureParameters.mgf.hash.algorithmOid])||void 0===i.md[d])throw(g=new Error("Unsupported MGF hash function.")).oid=e.signatureParameters.mgf.hash.algorithmOid,g.name=d,g;if(void 0===(p=s[e.signatureParameters.mgf.algorithmOid])||void 0===i.mgf[p])throw(g=new Error("Unsupported MGF function.")).oid=e.signatureParameters.mgf.algorithmOid,g.name=p,g;if(p=i.mgf[p].create(i.md[d].create()),void 0===(d=s[e.signatureParameters.hash.algorithmOid])||void 0===i.md[d])throw{message:"Unsupported RSASSA-PSS hash function.",oid:e.signatureParameters.hash.algorithmOid,name:d};l=i.pss.create(i.md[d].create(),p,e.signatureParameters.saltLength)}r=t.publicKey.verify(h.digest().getBytes(),e.signature,l)}return r},t.isIssuer=function(e){var r=!1,i=t.issuer,n=e.subject;if(i.hash&&n.hash)r=i.hash===n.hash;else if(i.attributes.length===n.attributes.length){var o,s;r=!0;for(var a=0;r&&a<i.attributes.length;++a)o=i.attributes[a],s=n.attributes[a],o.type===s.type&&o.value===s.value||(r=!1)}return r},t.issued=function(e){return e.isIssuer(t)},t.generateSubjectKeyIdentifier=function(){return o.getPublicKeyFingerprint(t.publicKey,{type:"RSAPublicKey"})},t.verifySubjectKeyIdentifier=function(){for(var e=s.subjectKeyIdentifier,r=0;r<t.extensions.length;++r){var n=t.extensions[r];if(n.id===e){var o=t.generateSubjectKeyIdentifier().getBytes();return i.util.hexToBytes(n.subjectKeyIdentifier)===o}}return!1},t},o.certificateFromAsn1=function(t,e){var r={},a=[];if(!n.validate(t,h,r,a))throw(l=new Error("Cannot read X.509 certificate. ASN.1 object is not an X509v3 Certificate.")).errors=a,l;if(n.derToOid(r.publicKeyOid)!==o.oids.rsaEncryption)throw new Error("Cannot read public key. OID is not RSA.");var u=o.createCertificate();u.version=r.certVersion?r.certVersion.charCodeAt(0):0;var c=i.util.createBuffer(r.certSerialNumber);u.serialNumber=c.toHex(),u.signatureOid=i.asn1.derToOid(r.certSignatureOid),u.signatureParameters=p(u.signatureOid,r.certSignatureParams,!0),u.siginfo.algorithmOid=i.asn1.derToOid(r.certinfoSignatureOid),u.siginfo.parameters=p(u.siginfo.algorithmOid,r.certinfoSignatureParams,!1),u.signature=r.certSignature;var f=[];if(void 0!==r.certValidity1UTCTime&&f.push(n.utcTimeToDate(r.certValidity1UTCTime)),void 0!==r.certValidity2GeneralizedTime&&f.push(n.generalizedTimeToDate(r.certValidity2GeneralizedTime)),void 0!==r.certValidity3UTCTime&&f.push(n.utcTimeToDate(r.certValidity3UTCTime)),void 0!==r.certValidity4GeneralizedTime&&f.push(n.generalizedTimeToDate(r.certValidity4GeneralizedTime)),f.length>2)throw new Error("Cannot read notBefore/notAfter validity times; more than two times were provided in the certificate.");if(f.length<2)throw new Error("Cannot read notBefore/notAfter validity times; they were not provided as either UTCTime or GeneralizedTime.");if(u.validity.notBefore=f[0],u.validity.notAfter=f[1],u.tbsCertificate=r.tbsCertificate,e){var l;if(u.md=null,u.signatureOid in s)switch(s[u.signatureOid]){case"sha1WithRSAEncryption":u.md=i.md.sha1.create();break;case"md5WithRSAEncryption":u.md=i.md.md5.create();break;case"sha256WithRSAEncryption":u.md=i.md.sha256.create();break;case"sha384WithRSAEncryption":u.md=i.md.sha384.create();break;case"sha512WithRSAEncryption":u.md=i.md.sha512.create();break;case"RSASSA-PSS":u.md=i.md.sha256.create()}if(null===u.md)throw(l=new Error("Could not compute certificate digest. Unknown signature OID.")).signatureOid=u.signatureOid,l;var g=n.toDer(u.tbsCertificate);u.md.update(g.getBytes())}var m=i.md.sha1.create();u.issuer.getField=function(t){return d(u.issuer,t)},u.issuer.addField=function(t){y([t]),u.issuer.attributes.push(t)},u.issuer.attributes=o.RDNAttributesAsArray(r.certIssuer,m),r.certIssuerUniqueId&&(u.issuer.uniqueId=r.certIssuerUniqueId),u.issuer.hash=m.digest().toHex();var v=i.md.sha1.create();return u.subject.getField=function(t){return d(u.subject,t)},u.subject.addField=function(t){y([t]),u.subject.attributes.push(t)},u.subject.attributes=o.RDNAttributesAsArray(r.certSubject,v),r.certSubjectUniqueId&&(u.subject.uniqueId=r.certSubjectUniqueId),u.subject.hash=v.digest().toHex(),r.certExtensions?u.extensions=o.certificateExtensionsFromAsn1(r.certExtensions):u.extensions=[],u.publicKey=o.publicKeyFromAsn1(r.subjectPublicKeyInfo),u},o.certificateExtensionsFromAsn1=function(t){for(var e=[],r=0;r<t.value.length;++r)for(var i=t.value[r],n=0;n<i.value.length;++n)e.push(o.certificateExtensionFromAsn1(i.value[n]));return e},o.certificateExtensionFromAsn1=function(t){var e={};if(e.id=n.derToOid(t.value[0].value),e.critical=!1,t.value[1].type===n.Type.BOOLEAN?(e.critical=0!==t.value[1].value.charCodeAt(0),e.value=t.value[2].value):e.value=t.value[1].value,e.id in s)if(e.name=s[e.id],"keyUsage"===e.name){var r=0,o=0;(u=n.fromDer(e.value)).value.length>1&&(r=u.value.charCodeAt(1),o=u.value.length>2?u.value.charCodeAt(2):0),e.digitalSignature=128==(128&r),e.nonRepudiation=64==(64&r),e.keyEncipherment=32==(32&r),e.dataEncipherment=16==(16&r),e.keyAgreement=8==(8&r),e.keyCertSign=4==(4&r),e.cRLSign=2==(2&r),e.encipherOnly=1==(1&r),e.decipherOnly=128==(128&o)}else if("basicConstraints"===e.name){(u=n.fromDer(e.value)).value.length>0&&u.value[0].type===n.Type.BOOLEAN?e.cA=0!==u.value[0].value.charCodeAt(0):e.cA=!1;var a=null;u.value.length>0&&u.value[0].type===n.Type.INTEGER?a=u.value[0].value:u.value.length>1&&(a=u.value[1].value),null!==a&&(e.pathLenConstraint=n.derToInteger(a))}else if("extKeyUsage"===e.name)for(var u=n.fromDer(e.value),h=0;h<u.value.length;++h){var c=n.derToOid(u.value[h].value);c in s?e[s[c]]=!0:e[c]=!0}else if("nsCertType"===e.name)r=0,(u=n.fromDer(e.value)).value.length>1&&(r=u.value.charCodeAt(1)),e.client=128==(128&r),e.server=64==(64&r),e.email=32==(32&r),e.objsign=16==(16&r),e.reserved=8==(8&r),e.sslCA=4==(4&r),e.emailCA=2==(2&r),e.objCA=1==(1&r);else if("subjectAltName"===e.name||"issuerAltName"===e.name){var f;e.altNames=[],u=n.fromDer(e.value);for(var l=0;l<u.value.length;++l){var d={type:(f=u.value[l]).type,value:f.value};switch(e.altNames.push(d),f.type){case 1:case 2:case 6:break;case 7:d.ip=i.util.bytesToIP(f.value);break;case 8:d.oid=n.derToOid(f.value)}}}else"subjectKeyIdentifier"===e.name&&(u=n.fromDer(e.value),e.subjectKeyIdentifier=i.util.bytesToHex(u.value));return e},o.certificationRequestFromAsn1=function(t,e){var r={},a=[];if(!n.validate(t,l,r,a))throw(h=new Error("Cannot read PKCS#10 certificate request. ASN.1 object is not a PKCS#10 CertificationRequest.")).errors=a,h;if(n.derToOid(r.publicKeyOid)!==o.oids.rsaEncryption)throw new Error("Cannot read public key. OID is not RSA.");var u=o.createCertificationRequest();if(u.version=r.csrVersion?r.csrVersion.charCodeAt(0):0,u.signatureOid=i.asn1.derToOid(r.csrSignatureOid),u.signatureParameters=p(u.signatureOid,r.csrSignatureParams,!0),u.siginfo.algorithmOid=i.asn1.derToOid(r.csrSignatureOid),u.siginfo.parameters=p(u.siginfo.algorithmOid,r.csrSignatureParams,!1),u.signature=r.csrSignature,u.certificationRequestInfo=r.certificationRequestInfo,e){var h;if(u.md=null,u.signatureOid in s)switch(s[u.signatureOid]){case"sha1WithRSAEncryption":u.md=i.md.sha1.create();break;case"md5WithRSAEncryption":u.md=i.md.md5.create();break;case"sha256WithRSAEncryption":u.md=i.md.sha256.create();break;case"sha384WithRSAEncryption":u.md=i.md.sha384.create();break;case"sha512WithRSAEncryption":u.md=i.md.sha512.create();break;case"RSASSA-PSS":u.md=i.md.sha256.create()}if(null===u.md)throw(h=new Error("Could not compute certification request digest. Unknown signature OID.")).signatureOid=u.signatureOid,h;var c=n.toDer(u.certificationRequestInfo);u.md.update(c.getBytes())}var f=i.md.sha1.create();return u.subject.getField=function(t){return d(u.subject,t)},u.subject.addField=function(t){y([t]),u.subject.attributes.push(t)},u.subject.attributes=o.RDNAttributesAsArray(r.certificationRequestInfoSubject,f),u.subject.hash=f.digest().toHex(),u.publicKey=o.publicKeyFromAsn1(r.subjectPublicKeyInfo),u.getAttribute=function(t){return d(u,t)},u.addAttribute=function(t){y([t]),u.attributes.push(t)},u.attributes=o.CRIAttributesAsArray(r.certificationRequestInfoAttributes||[]),u},o.createCertificationRequest=function(){var t={version:0,signatureOid:null,signature:null,siginfo:{}};return t.siginfo.algorithmOid=null,t.subject={},t.subject.getField=function(e){return d(t.subject,e)},t.subject.addField=function(e){y([e]),t.subject.attributes.push(e)},t.subject.attributes=[],t.subject.hash=null,t.publicKey=null,t.attributes=[],t.getAttribute=function(e){return d(t,e)},t.addAttribute=function(e){y([e]),t.attributes.push(e)},t.md=null,t.setSubject=function(e){y(e),t.subject.attributes=e,t.subject.hash=null},t.setAttributes=function(e){y(e),t.attributes=e},t.sign=function(e,r){t.md=r||i.md.sha1.create();var a=s[t.md.algorithm+"WithRSAEncryption"];if(!a){var u=new Error("Could not compute certification request digest. Unknown message digest algorithm OID.");throw u.algorithm=t.md.algorithm,u}t.signatureOid=t.siginfo.algorithmOid=a,t.certificationRequestInfo=o.getCertificationRequestInfo(t);var h=n.toDer(t.certificationRequestInfo);t.md.update(h.getBytes()),t.signature=e.sign(t.md)},t.verify=function(){var e=!1,r=t.md;if(null===r){if(t.signatureOid in s)switch(s[t.signatureOid]){case"sha1WithRSAEncryption":r=i.md.sha1.create();break;case"md5WithRSAEncryption":r=i.md.md5.create();break;case"sha256WithRSAEncryption":r=i.md.sha256.create();break;case"sha384WithRSAEncryption":r=i.md.sha384.create();break;case"sha512WithRSAEncryption":r=i.md.sha512.create();break;case"RSASSA-PSS":r=i.md.sha256.create()}if(null===r)throw(l=new Error("Could not compute certification request digest. Unknown signature OID.")).signatureOid=t.signatureOid,l;var a=t.certificationRequestInfo||o.getCertificationRequestInfo(t),u=n.toDer(a);r.update(u.getBytes())}if(null!==r){var h;switch(t.signatureOid){case s.sha1WithRSAEncryption:break;case s["RSASSA-PSS"]:var c,f,l;if(void 0===(c=s[t.signatureParameters.mgf.hash.algorithmOid])||void 0===i.md[c])throw(l=new Error("Unsupported MGF hash function.")).oid=t.signatureParameters.mgf.hash.algorithmOid,l.name=c,l;if(void 0===(f=s[t.signatureParameters.mgf.algorithmOid])||void 0===i.mgf[f])throw(l=new Error("Unsupported MGF function.")).oid=t.signatureParameters.mgf.algorithmOid,l.name=f,l;if(f=i.mgf[f].create(i.md[c].create()),void 0===(c=s[t.signatureParameters.hash.algorithmOid])||void 0===i.md[c])throw(l=new Error("Unsupported RSASSA-PSS hash function.")).oid=t.signatureParameters.hash.algorithmOid,l.name=c,l;h=i.pss.create(i.md[c].create(),f,t.signatureParameters.saltLength)}e=t.publicKey.verify(r.digest().getBytes(),t.signature,h)}return e},t};var w=new Date("1950-01-01T00:00:00Z"),_=new Date("2050-01-01T00:00:00Z");function S(t){return t>=w&&t<_?n.create(n.Class.UNIVERSAL,n.Type.UTCTIME,!1,n.dateToUtcTime(t)):n.create(n.Class.UNIVERSAL,n.Type.GENERALIZEDTIME,!1,n.dateToGeneralizedTime(t))}o.getTBSCertificate=function(t){var e=S(t.validity.notBefore),r=S(t.validity.notAfter),s=n.create(n.Class.UNIVERSAL,n.Type.SEQUENCE,!0,[n.create(n.Class.CONTEXT_SPECIFIC,0,!0,[n.create(n.Class.UNIVERSAL,n.Type.INTEGER,!1,n.integerToDer(t.version).getBytes())]),n.create(n.Class.UNIVERSAL,n.Type.INTEGER,!1,i.util.hexToBytes(t.serialNumber)),n.create(n.Class.UNIVERSAL,n.Type.SEQUENCE,!0,[n.create(n.Class.UNIVERSAL,n.Type.OID,!1,n.oidToDer(t.siginfo.algorithmOid).getBytes()),v(t.siginfo.algorithmOid,t.siginfo.parameters)]),g(t.issuer),n.create(n.Class.UNIVERSAL,n.Type.SEQUENCE,!0,[e,r]),g(t.subject),o.publicKeyToAsn1(t.publicKey)]);return t.issuer.uniqueId&&s.value.push(n.create(n.Class.CONTEXT_SPECIFIC,1,!0,[n.create(n.Class.UNIVERSAL,n.Type.BITSTRING,!1,String.fromCharCode(0)+t.issuer.uniqueId)])),t.subject.uniqueId&&s.value.push(n.create(n.Class.CONTEXT_SPECIFIC,2,!0,[n.create(n.Class.UNIVERSAL,n.Type.BITSTRING,!1,String.fromCharCode(0)+t.subject.uniqueId)])),t.extensions.length>0&&s.value.push(o.certificateExtensionsToAsn1(t.extensions)),s},o.getCertificationRequestInfo=function(t){return n.create(n.Class.UNIVERSAL,n.Type.SEQUENCE,!0,[n.create(n.Class.UNIVERSAL,n.Type.INTEGER,!1,n.integerToDer(t.version).getBytes()),g(t.subject),o.publicKeyToAsn1(t.publicKey),b(t)])},o.distinguishedNameToAsn1=function(t){return g(t)},o.certificateToAsn1=function(t){var e=t.tbsCertificate||o.getTBSCertificate(t);return n.create(n.Class.UNIVERSAL,n.Type.SEQUENCE,!0,[e,n.create(n.Class.UNIVERSAL,n.Type.SEQUENCE,!0,[n.create(n.Class.UNIVERSAL,n.Type.OID,!1,n.oidToDer(t.signatureOid).getBytes()),v(t.signatureOid,t.signatureParameters)]),n.create(n.Class.UNIVERSAL,n.Type.BITSTRING,!1,String.fromCharCode(0)+t.signature)])},o.certificateExtensionsToAsn1=function(t){var e=n.create(n.Class.CONTEXT_SPECIFIC,3,!0,[]),r=n.create(n.Class.UNIVERSAL,n.Type.SEQUENCE,!0,[]);e.value.push(r);for(var i=0;i<t.length;++i)r.value.push(o.certificateExtensionToAsn1(t[i]));return e},o.certificateExtensionToAsn1=function(t){var e=n.create(n.Class.UNIVERSAL,n.Type.SEQUENCE,!0,[]);e.value.push(n.create(n.Class.UNIVERSAL,n.Type.OID,!1,n.oidToDer(t.id).getBytes())),t.critical&&e.value.push(n.create(n.Class.UNIVERSAL,n.Type.BOOLEAN,!1,String.fromCharCode(255)));var r=t.value;return"string"!=typeof t.value&&(r=n.toDer(r).getBytes()),e.value.push(n.create(n.Class.UNIVERSAL,n.Type.OCTETSTRING,!1,r)),e},o.certificationRequestToAsn1=function(t){var e=t.certificationRequestInfo||o.getCertificationRequestInfo(t);return n.create(n.Class.UNIVERSAL,n.Type.SEQUENCE,!0,[e,n.create(n.Class.UNIVERSAL,n.Type.SEQUENCE,!0,[n.create(n.Class.UNIVERSAL,n.Type.OID,!1,n.oidToDer(t.signatureOid).getBytes()),v(t.signatureOid,t.signatureParameters)]),n.create(n.Class.UNIVERSAL,n.Type.BITSTRING,!1,String.fromCharCode(0)+t.signature)])},o.createCaStore=function(t){var e={certs:{}};function r(t){return s(t),e.certs[t.hash]||null}function s(t){if(!t.hash){var e=i.md.sha1.create();t.attributes=o.RDNAttributesAsArray(g(t),e),t.hash=e.digest().toHex()}}if(e.getIssuer=function(t){return r(t.issuer)},e.addCertificate=function(t){if("string"==typeof t&&(t=i.pki.certificateFromPem(t)),s(t.subject),!e.hasCertificate(t))if(t.subject.hash in e.certs){var r=e.certs[t.subject.hash];i.util.isArray(r)||(r=[r]),r.push(t),e.certs[t.subject.hash]=r}else e.certs[t.subject.hash]=t},e.hasCertificate=function(t){"string"==typeof t&&(t=i.pki.certificateFromPem(t));var e=r(t.subject);if(!e)return!1;i.util.isArray(e)||(e=[e]);for(var s=n.toDer(o.certificateToAsn1(t)).getBytes(),a=0;a<e.length;++a)if(s===n.toDer(o.certificateToAsn1(e[a])).getBytes())return!0;return!1},e.listAllCertificates=function(){var t=[];for(var r in e.certs)if(e.certs.hasOwnProperty(r)){var n=e.certs[r];if(i.util.isArray(n))for(var o=0;o<n.length;++o)t.push(n[o]);else t.push(n)}return t},e.removeCertificate=function(t){var a;if("string"==typeof t&&(t=i.pki.certificateFromPem(t)),s(t.subject),!e.hasCertificate(t))return null;var u=r(t.subject);if(!i.util.isArray(u))return a=e.certs[t.subject.hash],delete e.certs[t.subject.hash],a;for(var h=n.toDer(o.certificateToAsn1(t)).getBytes(),c=0;c<u.length;++c)h===n.toDer(o.certificateToAsn1(u[c])).getBytes()&&(a=u[c],u.splice(c,1));return 0===u.length&&delete e.certs[t.subject.hash],a},t)for(var a=0;a<t.length;++a){var u=t[a];e.addCertificate(u)}return e},o.certificateError={bad_certificate:"forge.pki.BadCertificate",unsupported_certificate:"forge.pki.UnsupportedCertificate",certificate_revoked:"forge.pki.CertificateRevoked",certificate_expired:"forge.pki.CertificateExpired",certificate_unknown:"forge.pki.CertificateUnknown",unknown_ca:"forge.pki.UnknownCertificateAuthority"},o.verifyCertificateChain=function(t,e,r){"function"==typeof r&&(r={verify:r}),r=r||{};var n=(e=e.slice(0)).slice(0),s=r.validityCheckDate;void 0===s&&(s=new Date);var a=!0,u=null,h=0;do{var c=e.shift(),f=null,l=!1;if(s&&(s<c.validity.notBefore||s>c.validity.notAfter)&&(u={message:"Certificate is not valid yet or has expired.",error:o.certificateError.certificate_expired,notBefore:c.validity.notBefore,notAfter:c.validity.notAfter,now:s}),null===u){if(null===(f=e[0]||t.getIssuer(c))&&c.isIssuer(c)&&(l=!0,f=c),f){var d=f;i.util.isArray(d)||(d=[d]);for(var p=!1;!p&&d.length>0;){f=d.shift();try{p=f.verify(c)}catch(t){}}p||(u={message:"Certificate signature is invalid.",error:o.certificateError.bad_certificate})}null!==u||f&&!l||t.hasCertificate(c)||(u={message:"Certificate is not trusted.",error:o.certificateError.unknown_ca})}if(null===u&&f&&!c.isIssuer(f)&&(u={message:"Certificate issuer is invalid.",error:o.certificateError.bad_certificate}),null===u)for(var g={keyUsage:!0,basicConstraints:!0},y=0;null===u&&y<c.extensions.length;++y){var m=c.extensions[y];m.critical&&!(m.name in g)&&(u={message:"Certificate has an unsupported critical extension.",error:o.certificateError.unsupported_certificate})}if(null===u&&(!a||0===e.length&&(!f||l))){var v=c.getExtension("basicConstraints"),b=c.getExtension("keyUsage");null!==b&&(b.keyCertSign&&null!==v||(u={message:"Certificate keyUsage or basicConstraints conflict or indicate that the certificate is not a CA. If the certificate is the only one in the chain or isn't the first then the certificate must be a valid CA.",error:o.certificateError.bad_certificate})),null!==u||null===v||v.cA||(u={message:"Certificate basicConstraints indicates the certificate is not a CA.",error:o.certificateError.bad_certificate}),null===u&&null!==b&&"pathLenConstraint"in v&&h-1>v.pathLenConstraint&&(u={message:"Certificate basicConstraints pathLenConstraint violated.",error:o.certificateError.bad_certificate})}var w=null===u||u.error,_=r.verify?r.verify(w,h,n):w;if(!0!==_)throw!0===w&&(u={message:"The application rejected the certificate.",error:o.certificateError.bad_certificate}),(_||0===_)&&("object"!=typeof _||i.util.isArray(_)?"string"==typeof _&&(u.error=_):(_.message&&(u.message=_.message),_.error&&(u.error=_.error))),u;u=null,a=!1,++h}while(e.length>0);return!0}},11379:(t,e,r)=>{"use strict";var i=r(83748),n=r(61733),o=r(48545),s=r(41194),a=r(64678),u=r(44237);function h(t){if(16!==t.length)throw new Error("invalid iv")}function c(t){return i.setupFallback((function(e,r,n){try{h(n)}catch(t){return Promise.reject(t)}var o=Promise.resolve(r);return o.then((function(r){var o="AES-"+t+"-CBC",s=i.nodeCrypto.createCipheriv(o,e,n);return Buffer.concat([s.update(r),s.final()])}))}),(function(t,e,r){try{h(r)}catch(t){return Promise.reject(t)}var n=Promise.resolve();return(n=(n=n.then((function(){return i.subtleCrypto.importKey("raw",t,{name:"AES-CBC"},!0,["encrypt"])}))).then((function(t){var n={name:"AES-CBC",iv:r};return i.subtleCrypto.encrypt(n,t,e)}))).then((function(t){return Buffer.from(t)}))}),(function(t,e,r){try{h(r)}catch(t){return Promise.reject(t)}var i=Promise.resolve();return i.then((function(){var i=s.cipher.createCipher("AES-CBC",new a(t));return i.start({iv:new a(r)}),i.update(new a(e)),i.finish()?Buffer.from(i.output.bytes(),"binary"):Promise.reject(new Error("encryption failed"))}))}))}function f(t){return i.setupFallback((function(e,r,n){try{h(n)}catch(t){return Promise.reject(t)}var o=Promise.resolve();return o.then((function(){var o="AES-"+t+"-CBC",s=i.nodeCrypto.createDecipheriv(o,e,n);return Buffer.concat([s.update(r),s.final()])}))}),(function(t,e,r){try{h(r)}catch(t){return Promise.reject(t)}var n=Promise.resolve();return(n=(n=n.then((function(){return i.subtleCrypto.importKey("raw",t,{name:"AES-CBC"},!0,["decrypt"])}))).then((function(t){var n={name:"AES-CBC",iv:r};return i.subtleCrypto.decrypt(n,t,e)}))).then((function(t){return Buffer.from(t)}))}),(function(t,e,r){try{h(r)}catch(t){return Promise.reject(t)}var i=Promise.resolve();return i.then((function(){var i=s.cipher.createDecipher("AES-CBC",new a(t));return i.start({iv:new a(r)}),i.update(new a(e)),i.finish()?Buffer.from(i.output.bytes(),"binary"):Promise.reject(new Error("encryption failed"))}))}))}function l(t,e){if(e<<1!=t.length<<3)throw new Error("invalid encryption key size")}function d(t){var e=c(t);return function(r,o,s){try{l(r,t)}catch(t){return Promise.reject(t)}var a=r.slice(t/8),u=r.slice(0,t/8),h=s.iv||Buffer.alloc(0),c=s.aad||s.adata||Buffer.alloc(0),f=e(a,o,h);return f.then((function(e){var r=Buffer.concat([c,h,e,i.int64ToBuffer(8*c.length)]);return n["HS"+2*t].sign(u,r,{length:t}).then((function(r){var i=r.mac.slice(0,t/8);return{data:e,tag:i}}))}))}}function p(t){var e=f(t);return function(r,o,s){try{l(r,t)}catch(t){return Promise.reject(t)}var a=r.slice(t/8),u=r.slice(0,t/8),h=s.iv||Buffer.alloc(0),c=s.aad||s.adata||Buffer.alloc(0),f=s.tag||s.mac||Buffer.alloc(0),d=Promise.resolve();return(d=d.then((function(){var e=Buffer.concat([c,h,o,i.int64ToBuffer(8*c.length)]);return n["HS"+2*t].verify(u,e,f,{length:t}).then((function(){return o}),(function(){throw new Error("mac check failed")}))}))).then((function(){return e(a,o,h)}))}}var g=Buffer.from("Encryption","utf8"),y=Buffer.from("Integrity","utf8"),m=Buffer.from(".","utf8");function v(t,e,r,n){var s=8*t.length,a=s/2,u=Promise.resolve();return u=(u=u.then((function(){return Buffer.concat([i.int32ToBuffer(1),t,i.int32ToBuffer(a),Buffer.from(e,"utf8"),r,n,g])}))).then((function(t){return o["SHA-"+s].digest(t).then((function(t){return t.slice(0,a/8)}))})),Promise.resolve(u)}function b(t,e,r,n){var s=8*t.length,a=s,u=Promise.resolve();return u=(u=u.then((function(){return Buffer.concat([i.int32ToBuffer(1),t,i.int32ToBuffer(a),Buffer.from(e,"utf8"),r,n,y])}))).then((function(t){return o["SHA-"+s].digest(t).then((function(t){return t.slice(0,a/8)}))})),Promise.resolve(u)}function w(t,e){var r=c(t);return function(o,s,a){var h,c,f=a.epu||i.int32ToBuffer(0),l=a.epv||i.int32ToBuffer(0),d=a.iv||Buffer.alloc(0),p=a.aad||a.adata||Buffer.alloc(0),g=a.kdata||Buffer.alloc(0),y=[v(o,e,f,l),b(o,e,f,l)],w=Promise.all(y).then((function(t){h=t[0],c=t[1]}));return(w=(w=w.then((function(){return r(h,s,d)}))).then((function(e){var r=Buffer.concat([p,m,Buffer.from(g),m,Buffer.from(u.base64url.encode(d),"utf8"),m,Buffer.from(u.base64url.encode(e),"utf8")]);return Promise.all([Promise.resolve(e),n["HS"+2*t].sign(c,r,{length:t})])}))).then((function(t){return{data:t[0],tag:t[1].mac}}))}}function _(t,e){var r=f(t);return function(o,s,a){var h,c,f=a.epu||i.int32ToBuffer(0),l=a.epv||i.int32ToBuffer(0),d=a.iv||Buffer.alloc(0),p=a.aad||a.adata||Buffer.alloc(0),g=a.kdata||Buffer.alloc(0),y=a.tag||a.mac||Buffer.alloc(0),w=[v(o,e,f,l),b(o,e,f,l)],_=Promise.all(w).then((function(t){h=t[0],c=t[1]}));return(_=_.then((function(){var e=Buffer.concat([p,m,Buffer.from(g),m,Buffer.from(u.base64url.encode(d),"utf8"),m,Buffer.from(u.base64url.encode(s),"utf8")]);try{return n["HS"+2*t].verify(c,e,y,{loose:!1})}catch(t){throw new Error("mac check failed")}}))).then((function(){return r(h,s,d)}))}}var S={};["A128CBC-HS256","A192CBC-HS384","A256CBC-HS512"].forEach((function(t){var e=parseInt(/A(\d+)CBC-HS(\d+)?/g.exec(t)[1]);S[t]={encrypt:d(e),decrypt:p(e)}})),["A128CBC+HS256","A192CBC+HS384","A256CBC+HS512"].forEach((function(t){var e=parseInt(/A(\d+)CBC\+HS(\d+)?/g.exec(t)[1]);S[t]={encrypt:w(e,t),decrypt:_(e,t)}})),t.exports=S},82736:(t,e,r)=>{"use strict";var i=r(83748),n=r(44237),o=r(50414),s=r(49560);function a(t,e){function r(r,i){if(t!==r.length<<3)throw new Error("invalid key size");if(!i&&!e)throw new Error("invalid iv");if(i&&12!==i.length)throw new Error("invalid iv")}function a(t){if(e){var r=n.base64url.encode(t.iv),i=n.base64url.encode(t.tag);t={data:t.data,header:{iv:r,tag:i}}}return t}return i.setupFallback((function(t,e,o){var s=o.iv,u=o.aad||o.adata||Buffer.alloc(0);try{r(t,s)}catch(t){return Promise.reject(t)}s=s||n.randomBytes(12);var h,c="aes-"+8*t.length+"-gcm";try{h=i.nodeCrypto.createCipheriv(c,t,s)}catch(t){throw new Error("unsupported algorithm: "+c)}if("function"!=typeof h.setAAD)throw new Error("unsupported algorithm: "+c);return u.length&&h.setAAD(u),a({data:Buffer.concat([h.update(e),h.final()]),iv:s,tag:h.getAuthTag()})}),(function(t,e,o){var s=o.iv,u=o.aad||o.adata||Buffer.alloc(0);try{r(t,s)}catch(t){return Promise.reject(t)}s=s||n.randomBytes(12);var h={name:"AES-GCM"};return i.subtleCrypto.importKey("raw",t,h,!0,["encrypt"]).then((function(t){return h.iv=s,h.tagLength=128,u.length&&(h.additionalData=u),i.subtleCrypto.encrypt(h,t,e)})).then((function(t){var e=t.byteLength-16,r=t.slice(e);r=Buffer.from(r);var i=t.slice(0,e);return a({data:i=Buffer.from(i),iv:s,tag:r})}))}),(function(t,e,i){var u,h,c=i.iv,f=i.aad||i.adata||Buffer.alloc(0);try{r(t,c)}catch(t){return Promise.reject(t)}return c=c||n.randomBytes(12),u=s.createCipher({key:t,iv:c,additionalData:f}),h=Buffer.alloc(e.length),new Promise((function(t,r){var i=o.CHUNK_SIZE,n=0,s=0;!function o(){var f=Math.min(i,e.length-s);if(n+=u.update(e,s,f,h,n),s+=f,e.length>s)setTimeout(o,0);else if((n+=u.finish(h,n))===e.length){var l=u.tag;t(a({data:h,iv:c,tag:l}))}else r(new Error("encryption failed"))}()}))}))}function u(t){function e(e,r,i){if(t!==e.length<<3)throw new Error("invalid key size");if(12!==r.length)throw new Error("invalid iv");if(16!==i.length)throw new Error("invalid tag length")}return i.setupFallback((function(t,r,n){var o=n.aad||n.adata||Buffer.alloc(0),s=n.iv||Buffer.alloc(0),a=n.tag||n.mac||Buffer.alloc(0);try{e(t,s,a)}catch(t){return Promise.reject(t)}var u,h="aes-"+8*t.length+"-gcm";try{u=i.nodeCrypto.createDecipheriv(h,t,s)}catch(t){throw new Error("unsupported algorithm: "+h)}if("function"!=typeof u.setAAD)throw new Error("unsupported algorithm: "+h);u.setAuthTag(a),o.length&&u.setAAD(o);try{return Buffer.concat([u.update(r),u.final()])}catch(t){throw new Error("decryption failed")}}),(function(t,r,n){var o=n.aad||n.adata||Buffer.alloc(0),s=n.iv||Buffer.alloc(0),a=n.tag||n.mac||Buffer.alloc(0);try{e(t,s,a)}catch(t){return Promise.reject(t)}var u={name:"AES-GCM"};return i.subtleCrypto.importKey("raw",t,u,!0,["decrypt"]).then((function(t){return u.iv=s,u.tagLength=128,o.length&&(u.additionalData=o),r=Buffer.concat([r,a],r.length+a.length),i.subtleCrypto.decrypt(u,t,r)})).then((function(t){return Buffer.from(t)}))}),(function(t,r,i){var n,a,u=i.aad||i.adata||Buffer.alloc(0),h=i.iv||Buffer.alloc(0),c=i.tag||i.mac||Buffer.alloc(0);try{e(t,h,c)}catch(t){return Promise.reject(t)}return n=s.createDecipher({key:t,iv:h,additionalData:u,tag:c}),a=Buffer.alloc(r.length),new Promise((function(t,e){var i=o.CHUNK_SIZE,s=0,u=0;!function o(){var h=Math.min(i,r.length-u);if(s+=n.update(r,u,h,a,s),u+=h,r.length>u)setTimeout(o,0);else{try{s+=n.finish(a,s)}catch(t){return void e(new Error("decryption failed"))}s===r.length?t(a):e(new Error("decryption failed"))}}()}))}))}var h={};["A128GCM","A192GCM","A256GCM","A128GCMKW","A192GCMKW","A256GCMKW"].forEach((function(t){var e=/A(\d+)GCM(KW)?/g.exec(t),r=parseInt(e[1]),i="KW"===e[2];h[t]={encrypt:a(r,i),decrypt:u(r)}})),t.exports=h},44179:(t,e,r)=>{"use strict";var i=r(83748),n=r(41194),o=r(64678),s=Buffer.from("a6a6a6a6a6a6a6a6","hex");function a(t,e){for(var r=Math.max(t.length,e.length),i=Buffer.alloc(r),n=0;r>n;n++)i[n]=(t[n]||0)^(e[n]||0);return i}function u(t,e){for(var r=[],i=0;t.length>i;i+=e)r.push(t.slice(i,i+e));return r}function h(t){var e=Math.floor(t/4294967296),r=t%4294967296,i=Buffer.alloc(8);return i[0]=255&e>>>24,i[1]=255&e>>>16,i[2]=255&e>>>8,i[3]=255&e>>>0,i[4]=255&r>>>24,i[5]=255&r>>>16,i[6]=255&r>>>8,i[7]=255&r>>>0,i}function c(t){function e(e,r){if(t!==e.length<<3)throw new Error("invalid key size");if(0<r.length&&0!=r.length%8)throw new Error("invalid data length")}return i.setupFallback((function(r,n){try{e(r,n)}catch(t){return Promise.reject(t)}var o,c,f,l=u(n,8),d=Buffer.alloc(16);o=s;for(var p=0;6>p;p++)for(var g=0;l.length>g;g++)f=l.length*p+g+1,c=Buffer.concat([o,l[g]]),o=a((c=i.nodeCrypto.createCipheriv("AES"+t,r,d).update(c)).slice(0,8),h(f)),l[g]=c.slice(8,16);l=[o].concat(l);var y=Buffer.concat(l);return Promise.resolve({data:y})}),(function(t,r){try{e(t,r)}catch(t){return Promise.reject(t)}var n={name:"AES-KW"},o=[i.subtleCrypto.importKey("raw",r,{name:"HMAC",hash:"SHA-256"},!0,["sign"]),i.subtleCrypto.importKey("raw",t,n,!0,["wrapKey"])];return(o=(o=Promise.all(o)).then((function(t){return i.subtleCrypto.wrapKey("raw",t[0],t[1],n)}))).then((function(t){return{data:t=Buffer.from(t)}}))}),(function(t,r){try{e(t,r)}catch(t){return Promise.reject(t)}var i,c,f,l=n.cipher.createCipher("AES",new o(t)),d=u(r,8);i=s;for(var p=0;6>p;p++)for(var g=0;d.length>g;g++)f=d.length*p+g+1,c=Buffer.concat([i,d[g]]),l.start(),l.update(new o(c)),l.finish(),i=a((c=Buffer.from(l.output.bytes(),"binary")).slice(0,8),h(f)),d[g]=c.slice(8,16);d=[i].concat(d);var y=Buffer.concat(d);return Promise.resolve({data:y})}))}function f(t){function e(e,r){if(t!==e.length<<3)throw new Error("invalid key size");if(0<r.length-8&&0!=r.length%8)throw new Error("invalid data length")}return i.setupFallback((function(r,n){try{e(r,n)}catch(t){return Promise.reject(t)}var o,c,f=u(n,8),l=Buffer.alloc(16);o=f[0],f=f.slice(1);for(var d=5;0<=d;--d)for(var p=f.length-1;0<=p;--p)c=a(o,h(f.length*d+p+1)),c=Buffer.concat([c,f[p],l]),o=(c=i.nodeCrypto.createDecipheriv("AES"+t,r,l).update(c)).slice(0,8),f[p]=c.slice(8,16);if(o.toString()!==s.toString())return Promise.reject(new Error("decryption failed"));var g=Buffer.concat(f);return Promise.resolve(g)}),(function(t,r){try{e(t,r)}catch(t){return Promise.reject(t)}var n={name:"AES-KW"},o=i.subtleCrypto.importKey("raw",t,n,!0,["unwrapKey"]);return(o=(o=o.then((function(t){return i.subtleCrypto.unwrapKey("raw",r,t,n,{name:"HMAC",hash:"SHA-256"},!0,["sign"])}))).then((function(t){return i.subtleCrypto.exportKey("raw",t)}))).then((function(t){return Buffer.from(t)}))}),(function(t,r){try{e(t,r)}catch(t){return Promise.reject(t)}var i,c,f=n.cipher.createDecipher("AES",new o(t)),l=u(r,8);i=l[0],l=l.slice(1);for(var d=5;0<=d;--d)for(var p=l.length-1;0<=p;--p)c=a(i,h(l.length*d+p+1)),c=Buffer.concat([c,l[p]]),f.start(),f.update(new o(c)),f.finish(),i=(c=Buffer.from(f.output.bytes(),"binary")).slice(0,8),l[p]=c.slice(8,16);if(i.toString()!==s.toString())return Promise.reject(new Error("decryption failed"));var g=Buffer.concat(l);return Promise.resolve(g)}))}var l={};["A128KW","A192KW","A256KW"].forEach((function(t){var e=parseInt(/A(\d+)KW/g.exec(t)[1]);l[t]={encrypt:c(e),decrypt:f(e)}})),t.exports=l},42319:(t,e,r)=>{"use strict";var i=r(50414),n=r(48545);function o(t){return t=t.replace("CONCAT-",""),function(e,r){var o=(r=r||{}).length,s=i.HASHLENGTH[t];if(!o)return Promise.reject(new Error("invalid key length"));if(!r.otherInfo)return Promise.reject(new Error("invalid otherInfo"));var a=r.otherInfo,u=n[t].digest,h=Math.ceil(o/s),c=0,f=[];return function t(){if(h===c++)return Buffer.concat(f).slice(0,o);var r=Buffer.alloc(4+e.length+a.length);return r.writeUInt32BE(c,0),e.copy(r,4),a.copy(r,4+e.length),u(r).then((function(e){return f.push(e),t()}))}()}}var s={};["CONCAT-SHA-1","CONCAT-SHA-256","CONCAT-SHA-384","CONCAT-SHA-512"].forEach((function(t){s[t]={derive:o(t)}})),t.exports=s},50414:t=>{"use strict";t.exports={CHUNK_SIZE:1024,HASHLENGTH:{"SHA-1":160,"SHA-256":256,"SHA-384":384,"SHA-512":512},ENCLENGTH:{"AES-128-CBC":128,"AES-192-CBC":192,"AES-256-CBC":256,"AES-128-KW":128,"AES-192-KW":192,"AES-256-KW":256},KEYLENGTH:{"A128CBC-HS256":256,"A192CBC-HS384":384,"A256CBC-HS512":512,"A128CBC+HS256":256,"A192CBC+HS384":384,"A256CBC+HS512":512,A128GCM:128,A192GCM:192,A256GCM:256,A128KW:128,A192KW:192,A256KW:256,"ECDH-ES+A128KW":128,"ECDH-ES+A192KW":192,"ECDH-ES+A256KW":256},NONCELENGTH:{"A128CBC-HS256":128,"A192CBC-HS384":128,"A256CBC-HS512":128,"A128CBC+HS256":128,"A192CBC+HS384":128,"A256CBC+HS512":128,A128GCM:96,A192GCM:96,A256GCM:96}}},82274:t=>{"use strict";var e={dir:{encrypt:function(t){return Promise.resolve({data:t,once:!0,direct:!0})},decrypt:function(t){return Promise.resolve(t)}}};t.exports=e},71762:(t,e,r)=>{"use strict";var i=r(66678),n=r(91634),o=r(41194),s=r(44237),a={"P-256":256,"P-384":384,"P-521":521};function u(t,e){var r=i(t);return(e?["x","y"]:["d"]).forEach((function(t){r[t]=s.asBuffer(r[t],"base64url")})),r}var h=Buffer.from([4]),c="1.2.840.10045.2.1",f="Could not extract parameters from DER signature";function l(t,e,r){for(var i=0;e+i<r&&0===t[e+i];)++i;return t[e+i]>=128&&--i,i}t.exports={convertToForge:function(t,e){var r=e?["x","y"]:["d"];return r=r.map((function(e){return new o.jsbn.BigInteger(t[e].toString("hex"),16)})),r=[t.crv].concat(r),(e?n.asPublicKey:n.asPrivateKey).apply(n,r)},convertToJWK:function(t,e){var r=i(t);return(e?["x","y"]:["x","y","d"]).forEach((function(t){r[t]=s.base64url.encode(r[t])})),delete r.key_ops,delete r.use,delete r.alg,e&&delete r.d,r},convertToObj:u,convertToBuffer:function(t,e){return t=u(t,e),e?Buffer.concat([h,t.x,t.y]):t.d},curveSize:function(t){return a[t||""]||NaN},derToConcat:function(t,e){var r=0;if(48!==t[r++])throw new Error(f);var i=t[r++];if(129===i&&(i=t[r++]),i>t.length-r)throw new Error(f);if(2!==t[r++])throw new Error(f);var n=t[r++];if(n>t.length-r-2)throw new Error(f);if(n>e+1)throw new Error(f);var o=r;if(r+=n,2!==t[r++])throw new Error(f);var s=t[r++];if(s!==t.length-r)throw new Error(f);if(s>e+1)throw new Error(f);var a=r;if((r+=s)!==t.length)throw new Error(f);var u=e-n,h=e-s,c=Buffer.alloc(u+n+h+s);for(r=0;r<u;++r)c[r]=0;var l=Math.max(-u,0);t.copy(c,r,o+l,o+n);for(var d=r=e;r<d+h;++r)c[r]=0;var p=Math.max(-h,0);return t.copy(c,r,a+p,a+s),c},concatToDer:function(t,e){var r=l(t,0,e),i=l(t,e,t.length),n=e-r,o=e-i,s=n+o+4,a=s<128,u=Buffer.alloc((a?2:3)+s),h=0;return u[h++]=48,a?u[h++]=s:(u[h++]=129,u[h++]=255&s),u[h++]=2,u[h++]=n,r<0?(u[h++]=0,h+=t.copy(u,h,0,e)):h+=t.copy(u,h,r,e),u[h++]=2,u[h++]=o,i<0?(u[h++]=0,t.copy(u,h,e)):t.copy(u,h,e+i),u},convertToPEM:function(t,e){var r,i,n,s=t.crv;return s=function(t){switch(t){case"P-256":return"1.2.840.10045.3.1.7";case"P-384":return"1.3.132.0.34";case"P-521":return"1.3.132.0.35";default:return null}}(s),s=o.asn1.oidToDer(s),e?(r="EC PRIVATE KEY",i=Buffer.concat([Buffer.from([0,4]),t.x,t.y]).toString("binary"),t=t.d.toString("binary"),n=o.asn1.create(o.asn1.Class.UNIVERSAL,o.asn1.Type.SEQUENCE,!0,[o.asn1.create(o.asn1.Class.UNIVERSAL,o.asn1.Type.INTEGER,!1,""),o.asn1.create(o.asn1.Class.UNIVERSAL,o.asn1.Type.OCTETSTRING,!1,t),o.asn1.create(o.asn1.Class.CONTEXT_SPECIFIC,0,!0,[o.asn1.create(o.asn1.Class.UNIVERSAL,o.asn1.Type.OID,!1,s.bytes())]),o.asn1.create(o.asn1.Class.CONTEXT_SPECIFIC,1,!0,[o.asn1.create(o.asn1.Class.UNIVERSAL,o.asn1.Type.BITSTRING,!1,i)])])):(r="PUBLIC KEY",t=Buffer.concat([Buffer.from([0,4]),t.x,t.y]).toString("binary"),n=o.asn1.create(o.asn1.Class.UNIVERSAL,o.asn1.Type.SEQUENCE,!0,[o.asn1.create(o.asn1.Class.UNIVERSAL,o.asn1.Type.SEQUENCE,!0,[o.asn1.create(o.asn1.Class.UNIVERSAL,o.asn1.Type.OID,!1,o.asn1.oidToDer(c).bytes()),o.asn1.create(o.asn1.Class.UNIVERSAL,o.asn1.Type.OID,!1,s.bytes())]),o.asn1.create(o.asn1.Class.UNIVERSAL,o.asn1.Type.BITSTRING,!1,t)])),n=o.asn1.toDer(n).bytes(),o.pem.encode({type:r,body:n})},EC_OID:c}},33724:(t,e,r)=>{"use strict";var i=r(85029),n=r(44237),o=r(71762),s=r(85141),a=r(42319),u=r(44179),h=r(83748),c=r(50414),f=r(66678),l=r(57557),d=r(78718);function p(t){switch(t){case"P-256":return"SHA-256";case"P-384":return"SHA-384";case"P-521":return"SHA-512";default:throw new Error("unsupported curve: "+t)}}var g=t.exports={};function y(t,e,r){function i(t){return Buffer.concat([h.int32ToBuffer(t.length),t])}var o=r.algorithm||"",s=c.KEYLENGTH[o],a=n.asBuffer(r.apu||"","base64url"),u=n.asBuffer(r.apv||"","base64url"),f={public:e,length:s/8,hash:"SHA-256",otherInfo:Buffer.concat([i(Buffer.from(o,"utf8")),i(a),i(u),h.int32ToBuffer(s)])};return g["ECDH-CONCAT"].derive(t,f)}["ECDH","ECDH-HKDF","ECDH-CONCAT"].forEach((function(t){var e,r,n=/^ECDH(?:-(\w+))?$/g.exec(t||"")[1],u=g[t]=g[t]||{};switch(n||""){case"CONCAT":u.derive=function(t,e){var r;e=e||{};try{if(!(r=e.hash||p(t.crv)))throw new Error("invalid hash: "+r);r.toUpperCase()}catch(t){return Promise.reject(t)}var i=["public"];return g.ECDH.derive(t,d(e,i)).then((function(t){return a["CONCAT-"+r].derive(t,l(e,i))}))};break;case"HKDF":u.derive=function(t,e){var r;e=e||{};try{if(!(r=e.hash||p(t.crv)))throw new Error("invalid hash: "+r);r.toUpperCase()}catch(t){return Promise.reject(t)}var i=["public"];return g.ECDH.derive(t,d(e,i)).then((function(t){return s["HKDF-"+r].derive(t,l(e,i))}))};break;case"":u.derive=(e={name:"ECDH"},r=function(t,e){var r=t&&o.convertToForge(t,!0);if(!r||!r.isValid())return Promise.reject(new Error("invalid EC public key"));switch(e){case"jwk":r=o.convertToJWK(t,!0);break;case"buffer":r=o.convertToBuffer(t,!0)}return Promise.resolve(r)},h.setupFallback((function(t,e){if("function"!=typeof h.nodeCrypto.createECDH)throw new Error("unsupported algorithm: ECDH");var i,n=(e=e||{}).length||0;switch(t.crv){case"P-256":i="prime256v1";break;case"P-384":i="secp384r1";break;case"P-521":i="secp521r1";break;default:return Promise.reject(new Error("invalid curve: "+i))}var s=o.convertToBuffer(t,!1);return r(e.public,"buffer").then((function(t){var e=h.nodeCrypto.createECDH(i);e.setPrivateKey(s);var r=e.computeSecret(t);if(n){if(r.length<n)return Promise.reject(new Error("key length too large: "+n));r=r.slice(0,n)}return r}))}),(function(t,n){t=t||{};var s=(n=n||{}).length||0,a=i(f(e),{namedCurve:t.crv});s||(s=t.d.length);var u=o.convertToJWK(t,!1);u=h.subtleCrypto.importKey("jwk",u,a,!1,["deriveBits"]);var c=r(n.public,"jwk");c=c.then((function(t){return h.subtleCrypto.importKey("jwk",t,a,!1,[])}));var l=Promise.all([u,c]);return(l=l.then((function(t){var r=t[0],n=t[1],o=i(f(e),{public:n});return h.subtleCrypto.deriveBits(o,r,8*s)}))).then((function(t){return Buffer.from(t)}))}),(function(t,e){var i=(e=e||{}).length||0,n=o.convertToForge(t,!1);return r(e.public,"forge").then((function(t){var e=n.computeSecret(t);if(i){if(e.length<i)return Promise.reject(new Error("key length too large: "+i));e=e.slice(0,i)}return e}))})));break;default:u.derive=null}})),["ECDH-ES","ECDH-ES+A128KW","ECDH-ES+A192KW","ECDH-ES+A256KW"].forEach((function(t){var e,r,i=/^ECDH-ES(?:\+(.+))?/g.exec(t||"")[1],n=g[t]=g[t]||{};i?(i=u[i])?(n.encrypt=(r=i.encrypt,function(t,e,i){if(!(i=i||{}).epk||!i.epk.d)return Promise.reject(new Error("missing ephemeral private key"));var n=o.convertToObj(i.epk,!1);return t&&t.x&&t.y?y(n,o.convertToObj(t,!0),{algorithm:i.alg,apu:i.apu,apv:i.apv}).then((function(t){return r(t,e)})):Promise.reject(new Error("missing static public key"))}),n.decrypt=(e=i.decrypt,function(t,r,i){if(!(i=i||{}).epk||!i.epk.x||!i.epk.y)return Promise.reject(new Error("missing ephemeral public key"));var n=o.convertToObj(i.epk,!0);return t&&t.d?y(o.convertToObj(t,!1),n,{algorithm:i.alg,apu:i.apu,apv:i.apv}).then((function(t){return e(t,r)})):Promise.reject(new Error("missing static private key"))})):n.ecrypt=n.decrypt=null:(n.encrypt=function(t,e,r){if(!(r=r||{}).epk||!r.epk.d)return Promise.reject(new Error("missing ephemeral private key"));var i=o.convertToObj(r.epk,!1);return t&&t.x&&t.y?y(i,o.convertToObj(t,!0),{algorithm:r.enc,apu:r.apu,apv:r.apv}).then((function(t){return{data:t,once:!0,direct:!0}})):Promise.reject(new Error("missing static public key"))},n.decrypt=function(t,e,r){if(!(r=r||{}).epk||!r.epk.x||!r.epk.y)return Promise.reject(new Error("missing ephemeral public key"));var i=o.convertToObj(r.epk,!0);return t&&t.d?y(o.convertToObj(t,!1),i,{algorithm:r.enc,apu:r.apu,apv:r.apv}).then((function(t){return t})):Promise.reject(new Error("missing static private key"))})}))},64008:(t,e,r)=>{"use strict";var i=r(71762),n=r(83748),o=r(48545);function s(t){switch(t){case"SHA-256":return"P-256";case"SHA-384":return"P-384";case"SHA-512":return"P-521";default:throw new Error("unsupported hash: "+t)}}function a(t){var e,r=s(t),a=t.toLowerCase().replace("-","");return n.nodeCrypto&&n.nodeCrypto.getHashes().indexOf(a)>-1&&(e=function(t,e){if(r!==t.crv)return Promise.reject(new Error("invalid curve"));var o,s;switch(o=(o=Promise.resolve(n.nodeCrypto.createSign(a))).then((function(t){return t.update(e),t})),a.slice(-3)){case"384":s=48;break;case"512":s=66;break;default:s=32}return(o=o.then((function(e){return i.derToConcat(e.sign(i.convertToPEM(t,!0)),s)}))).then((function(t){return{data:e,mac:t}}))}),n.setupFallback(e,(function(e,o){if(r!==e.crv)return Promise.reject(new Error("invalid curve"));var s=i.convertToJWK(e,!1),a={name:"ECDSA",namedCurve:s.crv,hash:{name:t}};return n.subtleCrypto.importKey("jwk",s,a,!0,["sign"]).then((function(t){return n.subtleCrypto.sign(a,t,o)})).then((function(t){return t=Buffer.from(t),{data:o,mac:t}}))}),(function(e,n){if(r!==e.crv)return Promise.reject(new Error("invalid curve"));var s=i.convertToForge(e,!1);return o[t].digest(n).then((function(t){return t=s.sign(t),t=Buffer.concat([t.r,t.s]),{data:n,mac:t}}))}))}function u(t){var e,r=s(t),a=t.toLowerCase().replace("-","");return n.nodeCrypto&&n.nodeCrypto.getHashes().indexOf(a)>-1&&(e=function(t,e,o){if(r!==t.crv)return Promise.reject(new Error("invalid curve"));var s;switch(a.slice(-3)){case"384":s=48;break;case"512":s=66;break;default:s=32}return Promise.resolve(n.nodeCrypto.createVerify(a)).then((function(r){return r.update(e),r.end(),r.verify(i.convertToPEM(t,!1),i.concatToDer(o,s))})).then((function(t){if(!t)throw new Error("verification failed");return{data:e,mac:o,valid:!0}}))}),n.setupFallback(e,(function(e,o,s){if(r!==e.crv)return Promise.reject(new Error("invalid curve"));var a=i.convertToJWK(e,!0),u={name:"ECDSA",namedCurve:a.crv,hash:{name:t}};return n.subtleCrypto.importKey("jwk",a,u,!0,["verify"]).then((function(t){return n.subtleCrypto.verify(u,t,s,o)})).then((function(t){return t?{data:o,mac:s,valid:!0}:Promise.reject(new Error("verification failed"))}))}),(function(e,n,s){if(r!==e.crv)return Promise.reject(new Error("invalid curve"));var a=i.convertToForge(e,!0);return o[t].digest(n).then((function(t){var e=s.length/2,r={r:s.slice(0,e),s:s.slice(e)};return a.verify(t,r)?{data:n,mac:s,valid:!0}:Promise.reject(new Error("verification failed"))}))}))}var h={};["ES256","ES384","ES512"].forEach((function(t){var e=t.replace(/ES(\d+)/g,(function(t,e){return"SHA-"+e}));h[t]={sign:a(e),verify:u(e)}})),t.exports=h},83748:(t,e,r)=>{"use strict";"undefined"==typeof Promise&&r(82702).polyfill(),e.int32ToBuffer=function(t,e){return(e=e||Buffer.alloc(4))[0]=t>>>24&255,e[1]=t>>>16&255,e[2]=t>>>8&255,e[3]=255&t,e};var i=Math.pow(2,32);e.int64ToBuffer=function(t,r){r=r||Buffer.alloc(8);var n=Math.floor(t/i),o=t%i;return n=e.int32ToBuffer(n),o=e.int32ToBuffer(o),Buffer.concat([n,o])};var n={};Object.defineProperty(e,"subtleCrypto",{get:function(){return"subtleCrypto"in n?n.subtleCrypto:n.subtleCrypto=function(){if("undefined"!=typeof crypto&&void 0!==crypto.subtle)return crypto.subtle}()},enumerable:!0}),Object.defineProperty(e,"nodeCrypto",{get:function(){return"nodeCrypto"in n?n.nodeCrypto:n.nodeCrypto=function(){var t;try{t=r(63906)}catch(t){return}if(Object.keys(t).length)return t}()},enumerable:!0}),e.setupFallback=function(t,r,i){return t&&e.nodeCrypto?function(){var e,r=arguments;function n(t){return 0===t.message.indexOf("unsupported algorithm:")?i.apply(null,r):Promise.reject(t)}try{e=Promise.resolve(t.apply(null,r))}catch(t){e=n(t)}return e}:r&&e.subtleCrypto?function(){var t,e=arguments;function n(t){return t.code!==DOMException.NOT_SUPPORTED_ERR&&"Only ArrayBuffer and ArrayBufferView objects can be passed as CryptoOperationData"!==t.message&&t instanceof Error?Promise.reject(t):i.apply(null,e)}try{t=(t=r.apply(null,e)).catch(n)}catch(e){t=n(e)}return t}:i}},85141:(t,e,r)=>{"use strict";var i=r(50414),n=r(61733);function o(t){var e=t.replace("HKDF-",""),r=t.replace("HKDF-SHA-","HS");return function(t,o){var s=i.HASHLENGTH[e]/8;"string"==typeof r&&(r=n[r].sign);var a=(o=o||{}).salt;a&&0!==a.length||(a=Buffer.alloc(s));var u=o.info||Buffer.alloc(0),h=o.length||s,c=Math.ceil(h/s),f=[],l=0;function d(t,e){return c===l++?Buffer.concat(f).slice(0,h):(e||(e=Buffer.alloc(0)),e=Buffer.concat([e,u,Buffer.from([l])]),e=(e=r(t,e)).then((function(r){return e=r.mac,f.push(e),d(t,e)})))}return r(a,t,{length:8*a.length}).then((function(t){return d(t.mac)}))}}var s={};["HKDF-SHA-1","HKDF-SHA-256","HKDF-SHA-384","HKDF-SHA-512"].forEach((function(t){s[t]={derive:o(t)}})),t.exports=s},61733:(t,e,r)=>{"use strict";var i=r(50414),n=r(41194),o=r(64678),s=r(83748);function a(t){var e=t.replace("HS","SHA").toLowerCase(),r=t.replace("HS","SHA-");function o(t,e){return(t=(t||i.HASHLENGTH[r])/8)>e.length?Promise.reject(new Error("invalid key length")):Promise.resolve(e)}return s.setupFallback((function(t,r,i){return o((i=i||{}).length,t).then((function(){var i=s.nodeCrypto.createHmac(e,t);i.update(r);var n=i.digest();return{data:r,mac:n}}))}),(function(t,e,i){var n={name:"HMAC",hash:{name:r}};return o((i=i||{}).length,t).then((function(){return s.subtleCrypto.importKey("raw",t,n,!0,["sign"])})).then((function(t){return s.subtleCrypto.sign(n,t,e)})).then((function(t){var r=Buffer.from(t);return{data:e,mac:r}}))}),(function(t,r,i){return o((i=i||{}).length,t).then((function(){var i=n.hmac.create();return i.start(e,t.toString("binary")),i.update(r.toString("binary")),i=Buffer.from(i.digest().bytes(),"binary"),{data:r,mac:i}}))}))}function u(t){var e=t.replace("HS","SHA").toLowerCase(),r=t.replace("HS","SHA-");function a(t,e,n){t=(t||i.HASHLENGTH[r])/8;for(var o=!0,s=0;t>s;s++)o=o&&e[s]===n[s];return o}return s.setupFallback((function(t,r,i,n){n=n||{};var o=s.nodeCrypto.createHmac(e,t);o.update(r);var u=o.digest();if(!a(n.length,i,u))throw new Error("verification failed");return{data:r,mac:u,valid:!0}}),(function(t,e,i,n){var o={name:"HMAC",hash:{name:r}};return((n=n||{}).length?s.subtleCrypto.importKey("raw",t,o,!0,["sign"]).then((function(t){return s.subtleCrypto.sign(o,t,e)})).then((function(t){var e=Buffer.from(t);return a(n.length,i,e)})):s.subtleCrypto.importKey("raw",t,o,!0,["verify"]).then((function(t){return s.subtleCrypto.verify(o,t,i,e)}))).then((function(t){return t?{data:e,mac:i,valid:!0}:Promise.reject(new Error("verifaction failed"))}))}),(function(t,r,i,s){s=s||{};var u=n.hmac.create();return u.start(e,new o(t)),u.update(r.toString("binary")),u=Buffer.from(u.digest().bytes(),"binary"),a(s.length,i,u)?Promise.resolve({data:r,mac:i,valid:!0}):Promise.reject(new Error("verification failed"))}))}var h={};["HS1","HS256","HS384","HS512"].forEach((function(t){h[t]={sign:a(t),verify:u(t)}})),t.exports=h},35382:(t,e,r)=>{"use strict";var i=[r(11379),r(82736),r(44179),r(42319),r(82274),r(33724),r(64008),r(85141),r(61733),r(30152),r(93516),r(24658),r(48545)],n={},o={},s={},a={},u={},h={};i.forEach((function(t){Object.keys(t).forEach((function(e){var r=t[e];"function"==typeof r.encrypt&&(u[e]=r.encrypt),"function"==typeof r.decrypt&&(h[e]=r.decrypt),"function"==typeof r.sign&&(s[e]=r.sign),"function"==typeof r.verify&&(a[e]=r.verify),"function"==typeof r.digest&&(n[e]=r.digest),"function"==typeof r.derive&&(o[e]=r.derive)}))})),e.digest=function(t,e,r){var i=n[t];return i?i(e,r):Promise.reject(new Error("unsupported algorithm: "+t))},e.derive=function(t,e,r){var i=o[t];return i?i(e,r):Promise.reject(new Error("unsupported algorithm: "+t))},e.sign=function(t,e,r,i){var n=s[t];return n?n(e,r,i||{}):Promise.reject(new Error("unsupported algorithm: "+t))},e.verify=function(t,e,r,i,n){var o=a[t];return o?o(e,r,i,n||{}):Promise.reject(new Error("unsupported algorithm: "+t))},e.encrypt=function(t,e,r,i){var n=u[t];return n?n(e,r,i||{}):Promise.reject(new Error("unsupported algorithm: "+t))},e.decrypt=function(t,e,r,i){var n=h[t];return n?n(e,r,i||{}):Promise.reject(new Error("unsupported algorithm: "+t))}},30152:(t,e,r)=>{"use strict";var i=r(41194),n=r(85029),o=r(44237),s=r(83748),a=r(50414),u=r(44179),h=Buffer.from([0]);function c(t,e,r){var i="PBES2-"+t+"+"+e,n=[Buffer.from(i,"utf8"),h,r];return Buffer.concat(n)}function f(t){function e(t){var e=(t=t||{}).length||0,r=o.asBuffer(t.salt||Buffer.alloc(0),"base64u4l"),i=t.iterations||0;if(0>=e)throw new Error("invalid key length");if(0>=i)throw new Error("invalid iteration count");return t.length=e,t.salt=r,t.iterations=i,t}return s.setupFallback((function(r,i){if(6>s.nodeCrypto.pbkdf2.length)throw new Error("unsupported algorithm: PBKDF2-"+t);try{i=e(i)}catch(t){return Promise.reject(t)}var n=i.length,o=i.salt,a=i.iterations,u=t.replace("-","");return new Promise((function(t,e){s.nodeCrypto.pbkdf2(r,o,a,n,u,(function(r,i){r?e(r):t(i)}))}))}),(function(r,i){try{i=e(i)}catch(t){return Promise.reject(t)}var n=i.length,a=i.salt,u=i.iterations,h=Promise.resolve(r);return(h=(h=h.then((function(t){return s.subtleCrypto.importKey("raw",t,"PBKDF2",!1,["deriveBits"])}))).then((function(e){var r={name:"PBKDF2",salt:new Uint8Array(a),iterations:u,hash:t};return s.subtleCrypto.deriveBits(r,e,8*n)}))).then((function(t){return o.asBuffer(t)}))}),(function(r,n){try{n=e(n)}catch(t){return Promise.reject(t)}var o=n.length,s=n.salt,a=n.iterations;return new Promise((function(e,n){var u=i.md[t.replace("-","").toLowerCase()].create();i.pkcs5.pbkdf2(r.toString("binary"),s.toString("binary"),a,o,u,(function(t,r){t?n(t):(r=Buffer.from(r,"binary"),e(r))}))}))}))}function l(t,e){var r="PBKDF2-"+t.replace("HS","SHA-"),i=a.KEYLENGTH[e]/8;return function(s,a,h){h=h||{};var f=o.asBuffer(h.p2s||Buffer.alloc(0),"base64url"),l=h.p2c||8192;if(0>=l)throw new Error("invalid iteration count");if(0===f.length)f=o.randomBytes(16);else if(8>f.length)throw new Error("salt too small");var d={p2s:o.base64url.encode(f),p2c:l};f=c(t,e,f),h=n(h,{salt:f,iterations:l,length:i});var g=Promise.resolve(s);return(g=(g=g.then((function(t){return p[r].derive(t,h)}))).then((function(t){return u[e].encrypt(t,a)}))).then((function(t){return t.header=n(t.header||{},d),t}))}}function d(t,e){var r="PBKDF2-"+t.replace("HS","SHA-"),i=a.KEYLENGTH[e]/8;return function(s,a,h){h=h||{};var f=o.asBuffer(h.p2s||Buffer.alloc(0),"base64url"),l=h.p2c||0;if(0>=l)return Promise.reject(new Error("invalid iteration count"));if(8>f.length)return Promise.reject(new Error("salt too small"));f=c(t,e,f),h=n(h,{salt:f,iterations:l,length:i});var d=Promise.resolve(s);return(d=d.then((function(t){return p[r].derive(t,h)}))).then((function(t){return u[e].decrypt(t,a)}))}}var p={};["PBKDF2-SHA-256","PBKDF2-SHA-384","PBKDF2-SHA-512"].forEach((function(t){var e=t.replace("PBKDF2-","");p[t]={derive:f(e)}})),["PBES2-HS256+A128KW","PBES2-HS384+A192KW","PBES2-HS512+A256KW"].forEach((function(t){var e=/PBES2-(HS\d+)\+(A\d+KW)/g.exec(t),r=e[1],i=e[2];p[t]={encrypt:l(r,i),decrypt:d(r,i)}})),t.exports=p},78501:(t,e,r)=>{"use strict";var i=r(66678),n=r(41194),o=r(44237);function s(t,e){var r=e?["n","e"]:["n","e","d","p","q","dp","dq","qi"];return r=r.map((function(e){return new n.jsbn.BigInteger(t[e].toString("hex"),16)})),(e?n.pki.rsa.setPublicKey:n.pki.rsa.setPrivateKey).apply(n.pki.rsa,r)}t.exports={convertToForge:s,convertToJWK:function(t,e){var r=i(t);return(e?["n","e"]:["n","e","d","p","q","dp","dq","qi"]).forEach((function(t){r[t]=o.base64url.encode(r[t])})),delete r.key_ops,delete r.use,delete r.alg,e&&(delete r.d,delete r.p,delete r.q,delete r.dp,delete r.dq,delete r.qi),r},convertToPem:function(t,e){var r,i=e?"__cachedPublicPem":"__cachedPrivatePem";return t[i]?t[i]:(r=e?n.pki.publicKeyToPem(s(t,e)):n.pki.privateKeyToPem(s(t,e)),Object.defineProperty(t,i,{value:r}),r)}}},93516:(t,e,r)=>{"use strict";var i=r(41194),n=r(83748),o=r(64678),s=r(78501),a={"RSA-OAEP":"RSA_PKCS1_OAEP_PADDING",RSA1_5:"RSA_PKCS1_PADDING"};function u(t){return n.nodeCrypto&&n.nodeCrypto.constants&&-1!==Object.keys(a).indexOf(t)}function h(t){var e,r,h={name:t};return"RSA-OAEP-256"===t?(h.name="RSA-OAEP",h.hash={name:"SHA-256"}):"RSA-OAEP"===t?h.hash={name:"SHA-1"}:h.name="RSAES-PKCS1-v1_5",e="RSAES-PKCS1-v1_5"!==h.name?function(t,e){return t=s.convertToJWK(t,!0),n.subtleCrypto.importKey("jwk",t,h,!0,["encrypt"]).then((function(t){return n.subtleCrypto.encrypt(h,t,e)})).then((function(t){return{data:Buffer.from(t)}}))}:null,u(t)&&(r=function(e,r){return e=s.convertToPem(e,!0),{data:n.nodeCrypto.publicEncrypt({key:e,padding:n.nodeCrypto.constants[a[t]]},r)}}),n.setupFallback(r,e,(function(t,e){e=new o(e).bytes();var r=s.convertToForge(t,!0),n={};"RSA-OAEP"===h.name&&(n.md=h.hash.name.toLowerCase().replace(/-/g,""),n.md=i.md[n.md].create());var a=r.encrypt(e,h.name.toUpperCase(),n);return a=new o(a).native(),Promise.resolve({data:a})}))}function c(t){var e,r,h={name:t};return"RSA-OAEP-256"===t?(h.name="RSA-OAEP",h.hash={name:"SHA-256"}):"RSA-OAEP"===t?h.hash={name:"SHA-1"}:h.name="RSAES-PKCS1-v1_5",e="RSAES-PKCS1-v1_5"!==h.name?function(t,e){return t=s.convertToJWK(t,!1),n.subtleCrypto.importKey("jwk",t,h,!0,["decrypt"]).then((function(t){return n.subtleCrypto.decrypt(h,t,e)})).then((function(t){return Buffer.from(t)}))}:null,u(t)?r=function(e,r){return e=s.convertToPem(e,!1),n.nodeCrypto.privateDecrypt({key:e,padding:n.nodeCrypto.constants[a[t]]},r)}:n.nodeCrypto&&"RSA-OAEP"===t&&(r=function(t,e){return t=s.convertToPem(t,!1),n.nodeCrypto.privateDecrypt(t,e)}),n.setupFallback(r,e,(function(t,e){e=new o(e).bytes();var r=s.convertToForge(t,!1),n={};"RSA-OAEP"===h.name&&(n.md=h.hash.name.toLowerCase().replace(/-/g,""),n.md=i.md[n.md].create());var a=r.decrypt(e,h.name.toUpperCase(),n);return a=new o(a).native(),Promise.resolve(a)}))}var f={};["RSA-OAEP","RSA-OAEP-256","RSA1_5"].forEach((function(t){f[t]={encrypt:h(t),decrypt:c(t)}})),t.exports=f},24658:(t,e,r)=>{"use strict";var i=r(41194),n=r(50414),o=r(83748),s=r(78501);function a(){return o.nodeCrypto&&o.nodeCrypto.constants&&o.nodeCrypto.constants.RSA_PSS_SALTLEN_DIGEST}function u(t){var e,r=t.replace("RS","SHA").toLowerCase(),n=t.replace("RS","SHA-"),a={name:"RSASSA-PKCS1-V1_5",hash:{name:n}},u="RSA-"+n.replace("-","");return o.nodeCrypto&&o.nodeCrypto.getHashes().indexOf(u)>-1&&(e=function(t,e){var r=o.nodeCrypto.createSign(u);return r.update(e),{data:e,mac:r.sign(s.convertToPem(t,!1))}}),o.setupFallback(e,(function(t,e){return t=s.convertToJWK(t,!1),o.subtleCrypto.importKey("jwk",t,a,!0,["sign"]).then((function(t){return o.subtleCrypto.sign(a,t,e)})).then((function(t){var r=Buffer.from(t);return{data:e,mac:r}}))}),(function(t,e){var n=i.md[r].create();n.start(),n.update(e);var o=s.convertToForge(t,!1).sign(n,"RSASSA-PKCS1-V1_5");return o=Buffer.from(o,"binary"),Promise.resolve({data:e,mac:o})}))}function h(t){var e,r=t.replace("RS","SHA").toLowerCase(),n={name:"RSASSA-PKCS1-V1_5",hash:{name:t.replace("RS","SHA-")}};return o.nodeCrypto&&o.nodeCrypto.getHashes().indexOf(r)>-1&&(e=function(t,e,i){var n=o.nodeCrypto.createVerify(r);return n.update(e),n.end(),n.verify(s.convertToPem(t,!0),i)?{data:e,mac:i,valid:!0}:Promise.reject(new Error("verification failed"))}),o.setupFallback(e,(function(t,e,r){return t=s.convertToJWK(t,!0),o.subtleCrypto.importKey("jwk",t,n,!0,["verify"]).then((function(t){return o.subtleCrypto.verify(n,t,r,e)})).then((function(t){return t?{data:e,mac:r,valid:!0}:Promise.reject(new Error("verification failed"))}))}),(function(t,e,n){var o=i.md[r].create();o.start(),o.update(e),o=o.digest().bytes();var a=s.convertToForge(t,!0),u=n.toString("binary");return a.verify(o,u,"RSASSA-PKCS1-V1_5")?Promise.resolve({data:e,mac:n,valid:!0}):Promise.reject(new Error("verification failed"))}))}function c(t){var e,r=t.replace("PS","SHA").toLowerCase(),u=t.replace("PS","SHA-"),h={name:"RSA-PSS",hash:{name:u},saltLength:n.HASHLENGTH[u]/8},c="RSA-"+u.replace("-","");return a()&&(e=function(t,e){var r=o.nodeCrypto.createSign(c);return r.update(e),{data:e,mac:r.sign({key:s.convertToPem(t,!1),padding:o.nodeCrypto.constants.RSA_PKCS1_PSS_PADDING,saltLength:o.nodeCrypto.constants.RSA_PSS_SALTLEN_DIGEST})}}),o.setupFallback(e,(function(t,e){return t=s.convertToJWK(t,!1),o.subtleCrypto.importKey("jwk",t,h,!0,["sign"]).then((function(t){return o.subtleCrypto.sign(h,t,e)})).then((function(t){var r=Buffer.from(t);return{data:e,mac:r}}))}),(function(t,e){var o=i.md[r].create();o.start(),o.update(e);var a=i.pss.create({md:i.md[r].create(),mgf:i.mgf.mgf1.create(i.md[r].create()),saltLength:n.HASHLENGTH[u]/8}),h=s.convertToForge(t,!1).sign(o,a);return h=Buffer.from(h,"binary"),Promise.resolve({data:e,mac:h})}))}function f(t){var e,r=t.replace("PS","SHA").toLowerCase(),u=t.replace("PS","SHA-"),h={name:"RSA-PSS",hash:{name:u},saltLength:n.HASHLENGTH[u]/8};return a()&&(e=function(t,e,i){var n=o.nodeCrypto.createVerify(r);return n.update(e),n.end(),n.verify({key:s.convertToPem(t,!0),padding:o.nodeCrypto.constants.RSA_PKCS1_PSS_PADDING,saltLength:o.nodeCrypto.constants.RSA_PSS_SALTLEN_DIGEST},i)?{data:e,mac:i,valid:!0}:Promise.reject(new Error("verification failed"))}),o.setupFallback(e,(function(t,e,r){return t=s.convertToJWK(t,!0),o.subtleCrypto.importKey("jwk",t,h,!0,["verify"]).then((function(t){return o.subtleCrypto.verify(h,t,r,e)})).then((function(t){return t?{data:e,mac:r,valid:!0}:Promise.reject(new Error("verification failed"))}))}),(function(t,e,o){var a=i.md[r].create();a.start(),a.update(e),a=a.digest().bytes();var h=i.pss.create({md:i.md[r].create(),mgf:i.mgf.mgf1.create(i.md[r].create()),saltLength:n.HASHLENGTH[u]/8}),c=s.convertToForge(t,!0),f=o.toString("binary");return c.verify(a,f,h)?Promise.resolve({data:e,mac:o,valid:!0}):Promise.reject(new Error("verification failed"))}))}var l={};["PS256","PS384","PS512"].forEach((function(t){l[t]={sign:c(t),verify:f(t)}})),["RS256","RS384","RS512"].forEach((function(t){l[t]={sign:u(t),verify:h(t)}})),t.exports=l},48545:(t,e,r)=>{"use strict";var i=r(41194),n=r(83748),o={};["SHA-1","SHA-256","SHA-384","SHA-512"].forEach((function(t){var e,r,s;o[t]={digest:(e=t,r=e.replace("SHA-","SHA").toLowerCase(),s={name:e},n.setupFallback((function(t){var e=n.nodeCrypto.createHash(r);return e.update(t),e.digest()}),(function(t){return n.subtleCrypto.digest(s,t).then((function(t){return Buffer.from(t)}))}),(function(t){var e=i.md[r].create();return e.update(t.toString("binary")),e=Buffer.from(e.digest().bytes(),"binary"),Promise.resolve(e)})))}})),t.exports=o},82150:(t,e,r)=>{"use strict";var i=r(43720),n=r(19873),o=r(13891),s=3774873600,a=new i(s>>8),u=t.exports={E1:s,E1B:225,E1L:a,LOOKUP:function(){for(var t=[],e=0;e<256;++e){for(var r=0,i=7;i>=0;--i)0!=(e&1<<i)&&(r^=s>>>7-i);t.push(r)}return t}(),arrayCopy:function(t,e,r,i,n){if(e<0||i<0||n<0)throw new TypeError("Invalid input.");if(r instanceof Uint8Array){if(i>=r.length||i+n>r.length)throw new TypeError("Invalid input.");(0!==e||n<t.length)&&(t=t instanceof Uint8Array?t.subarray(e,e+n):t.slice(e,e+n)),r.set(t,i)}else for(var o=0;o<n;++o)r[i+o]=t[e+o]},arrayEqual:function(t,e){t=t||[],e=e||[];for(var r=Math.min(t.length,e.length),i=t.length===e.length,n=0;n<r;n++)i=i&&void 0!==t[n]&&void 0!==e[n]&&t[n]===e[n];return i},asBytes:function(t,e){switch(arguments.length){case 1:return e=Buffer.alloc(16),o.intToBigEndian(t,e,0),e;case 2:o.intToBigEndian(t,e,0);break;default:throw new TypeError("Expected 1 or 2 arguments.")}},asInts:function(t,e){switch(arguments.length){case 1:return n(e=[],0,0,4),o.bigEndianToInt(t,0,e),e;case 2:o.bigEndianToInt(t,0,e);break;default:throw new TypeError("Expected 1 or 2 arguments.")}},oneAsInts:function(){for(var t=[],e=0;e<4;++e)t.push(1<<31);return t},shiftRight:function(t,e){var r,i;switch(arguments.length){case 1:return r=t[0],t[0]=r>>>1,i=r<<31,r=t[1],t[1]=r>>>1|i,i=r<<31,r=t[2],t[2]=r>>>1|i,i=r<<31,r=t[3],t[3]=r>>>1|i,r<<31&4294967295;case 2:return r=t[0],e[0]=r>>>1,i=r<<31,r=t[1],e[1]=r>>>1|i,i=r<<31,r=t[2],e[2]=r>>>1|i,i=r<<31,r=t[3],e[3]=r>>>1|i,r<<31&4294967295;default:throw new TypeError("Expected 1 or 2 arguments.")}},shiftRightN:function(t,e,r){var i,n,o;switch(arguments.length){case 2:return n=t[0],i=32-e,t[0]=n>>>e,o=n<<i,n=t[1],t[1]=n>>>e|o,o=n<<i,n=t[2],t[2]=n>>>e|o,o=n<<i,n=t[3],t[3]=n>>>e|o,n<<i;case 3:return n=t[0],i=32-e,r[0]=n>>>e,o=n<<i,n=t[1],r[1]=n>>>e|o,o=n<<i,n=t[2],r[2]=n>>>e|o,o=n<<i,n=t[3],r[3]=n>>>e|o,n<<i;default:throw new TypeError("Expected 2 or 3 arguments.")}},xor:function(t,e,r){switch(arguments.length){case 2:t[0]^=e[0],t[1]^=e[1],t[2]^=e[2],t[3]^=e[3];break;case 3:r[0]=t[0]^e[0],r[1]=t[1]^e[1],r[2]=t[2]^e[2],r[3]=t[3]^e[3];break;default:throw new TypeError("Expected 2 or 3 arguments.")}},multiply:function(t,e){for(var r=t.slice(),i=[],n=0;n<4;++n)for(var o=e[n],s=31;s>=0;--s)0!=(o&1<<s)&&u.xor(i,r),0!==u.shiftRight(r)&&(r[0]^=u.E1);u.arrayCopy(i,0,t,0,4)},multiplyP:function(t,e){switch(arguments.length){case 1:0!==u.shiftRight(t)&&(t[0]^=u.E1);break;case 2:0!==u.shiftRight(t,e)&&(e[0]^=u.E1);break;default:throw new TypeError("Expected 1 or 2 arguments.")}},multiplyP8:function(t,e){var r;switch(arguments.length){case 1:r=u.shiftRightN(t,8),t[0]^=u.LOOKUP[r>>>24];break;case 2:r=u.shiftRightN(t,8,e),e[0]^=u.LOOKUP[r>>>24];break;default:throw new TypeError("Expected 1 or 2 arguments.")}}}},49560:(t,e,r)=>{"use strict";var i=r(43720),n=r(41194),o=r(38140),s=r(82150),a=r(13891),u=r(64678),h=r(47826);function c(t){t=t||{},this.name="GCM",this.cipher=t.cipher,this.blockSize=this.blockSize||16}t.exports={createCipher:function(t){var e=new n.aes.Algorithm("AES-GCM",c);return e.initialize({key:new u(t.key)}),e.mode.start(t),e.mode},createDecipher:function(t){var e=new n.aes.Algorithm("AES-GCM",c);return e.initialize({key:new u(t.key)}),e.mode._decrypt=!0,e.mode.start(t),e.mode}},c.prototype.start=function(t){if(this.tag=null,!("iv"in(t=t||{})))throw new Error("Gcm needs ParametersWithIV or AEADParameters");if(this.nonce=t.iv,null==this.nonce||this.nonce.length<1)throw new Error("IV must be at least 1 byte");this.tagLength=16,"tag"in t&&(this.tag=Buffer.from(t.tag));var e=this._decrypt?this.blockSize+this.tagLength:this.blockSize;this.bufBlock=Buffer.alloc(e);var r=t.multiplier;if(null==r&&(r=new o["8k"]),this.multiplier=r,this.H=this.zeroBlock(),h.encrypt(this.cipher,this.H,0,this.H,0),this.multiplier.init(this.H),this.exp=null,this.J0=this.zeroBlock(),12===this.nonce.length)this.nonce.copy(this.J0,0,0,this.nonce.length),this.J0[this.blockSize-1]=1;else{this.gHASH(this.J0,this.nonce,this.nonce.length);var n=this.zeroBlock();a.longToBigEndian(new i(this.nonce.length).multiply(8),n,8),this.gHASHBlock(this.J0,n)}this.S=this.zeroBlock(),this.SAt=this.zeroBlock(),this.SAtPre=this.zeroBlock(),this.atBlock=this.zeroBlock(),this.atBlockPos=0,this.atLength=i.ZERO,this.atLengthPre=i.ZERO,this.counter=Buffer.from(this.J0),this.bufOff=0,this.totalLength=i.ZERO,"additionalData"in t&&this.processAADBytes(t.additionalData,0,t.additionalData.length)},c.prototype.update=function(t,e,r,i,n){for(var o=0;r>0;){var s=Math.min(r,this.bufBlock.length-this.bufOff);t.copy(this.bufBlock,this.bufOff,e,e+s),r-=s,e+=s,this.bufOff+=s,this.bufOff===this.bufBlock.length&&(this.outputBlock(i,n+o),o+=this.blockSize)}return o},c.prototype.finish=function(t,e){var r=0;this._decrypt&&(r+=this.update(this.tag,0,this.tag.length,t,e)),this.totalLength.isZero()&&this.initCipher();var i=this.bufOff;if(this._decrypt){if(i<this.tagLength)throw new Error("data too short");i-=this.tagLength}i>0&&(this.gCTRPartial(this.bufBlock,0,i,t,e+r),r+=i),this.atLength=this.atLength.add(this.atBlockPos);var n=this.zeroBlock();a.longToBigEndian(this.atLength.multiply(8),n,0),a.longToBigEndian(this.totalLength.multiply(8),n,8),this.gHASHBlock(this.S,n);var o=Buffer.alloc(this.blockSize);if(h.encrypt(this.cipher,this.J0,0,o,0),this.xor(o,this.S),this._decrypt){if(!s.arrayEqual(this.tag,o))throw new Error("mac check in Gcm failed")}else this.tag=Buffer.alloc(this.tagLength),o.copy(this.tag,0,0,this.tagLength);return r},c.prototype.initCipher=function(){this.atLength.greaterThan(i.ZERO)&&(this.SAt.copy(this.SAtPre,0,0,this.blockSize),this.atLengthPre=this.atLength.add(i.ZERO)),this.atBlockPos>0&&(this.gHASHPartial(this.SAtPre,this.atBlock,0,this.atBlockPos),this.atLengthPre=this.atLengthPre.add(this.atBlockPos)),this.atLengthPre.greaterThan(i.ZERO)&&this.SAtPre.copy(this.S,0,0,this.blockSize)},c.prototype.outputBlock=function(t,e){this.totalLength.isZero()&&this.initCipher(),this.gCTRBlock(this.bufBlock,t,e),this._decrypt?(this.bufBlock.copy(this.bufBlock,0,this.blockSize,this.blockSize+this.tagLength),this.bufOff=this.tagLength):this.bufOff=0},c.prototype.processAADBytes=function(t,e,r){for(var i=0;i<r;++i)this.atBlock[this.atBlockPos]=t[e+i],++this.atBlockPos===this.blockSize&&(this.gHASHBlock(this.SAt,this.atBlock),this.atBlockPos=0,this.atLength=this.atLength.add(this.blockSize))},c.prototype.getNextCounterBlock=function(){for(var t=15;t>=12;--t){var e=this.counter[t]+1&255;if(this.counter[t]=e,0!==e)break}var r=Buffer.alloc(this.blockSize);return h.encrypt(this.cipher,this.counter,0,r,0),r},c.prototype.gCTRBlock=function(t,e,r){var i=this.getNextCounterBlock();this.xor(i,t),i.copy(e,r,0,this.blockSize),this.gHASHBlock(this.S,this._decrypt?t:i),this.totalLength=this.totalLength.add(this.blockSize)},c.prototype.gCTRPartial=function(t,e,r,i,n){var o=this.getNextCounterBlock();this.xor(o,t,e,r),o.copy(i,n,0,r),this.gHASHPartial(this.S,this._decrypt?t:o,0,r),this.totalLength=this.totalLength.add(r)},c.prototype.gHASHBlock=function(t,e){this.xor(t,e),this.multiplier.multiplyH(t)},c.prototype.gHASHPartial=function(t,e,r,i){this.xor(t,e,r,i),this.multiplier.multiplyH(t)},c.prototype.xor=function(t,e,r,i){switch(arguments.length){case 2:for(var n=15;n>=0;--n)t[n]^=e[n];break;case 4:for(;i-- >0;)t[i]^=e[r+i];break;default:throw new TypeError("Expected 2 or 4 arguments.")}return t},c.prototype.zeroBlock=function(){return Buffer.alloc(16)}},38140:(t,e,r)=>{"use strict";var i=r(82150),n=r(13891);function o(){this.H=[],this.M=null}o.prototype.init=function(t){var e,r,n;if(null==this.M)for(this.M=[],e=0;e<32;++e)for(this.M[e]=[],r=0;r<16;++r)for(this.M[e][r]=[],n=0;n<4;++n)this.M[e][r][n]=0;else if(i.arrayEqual(this.H,t))return;for(this.H=t.slice(),i.asInts(t,this.M[1][8]),r=4;r>=1;r>>=1)i.multiplyP(this.M[1][r+r],this.M[1][r]);for(i.multiplyP(this.M[1][1],this.M[0][8]),r=4;r>=1;r>>=1)i.multiplyP(this.M[0][r+r],this.M[0][r]);for(e=0;;){for(r=2;r<16;r+=r)for(n=1;n<r;++n)i.xor(this.M[e][r],this.M[e][n],this.M[e][r+n]);if(32==++e)return;if(e>1)for(r=8;r>0;r>>=1)i.multiplyP8(this.M[e-2][r],this.M[e][r])}},o.prototype.multiplyH=function(t){for(var e=[],r=15;r>=0;--r){var i=this.M[r+r][15&t[r]];e[0]^=i[0],e[1]^=i[1],e[2]^=i[2],e[3]^=i[3],i=this.M[r+r+1][(240&t[r])>>>4],e[0]^=i[0],e[1]^=i[1],e[2]^=i[2],e[3]^=i[3]}n.intToBigEndian(e,t,0)},t.exports={"8k":o}},47826:(t,e,r)=>{"use strict";var i=r(13891);t.exports={encrypt:function(t,e,r,n,o){var s=new Array(4),a=new Array(4);i.bigEndianToInt(e,r,s),t.encrypt(s,a),i.intToBigEndian(a,n,o)}}},13891:(t,e,r)=>{"use strict";var i=r(43720),n=t.exports={intToBigEndian:function(t,e,r){if("number"==typeof t)switch(arguments.length){case 1:e=Buffer.alloc(4),n.intToBigEndian(t,e,0);break;case 3:e[r]=255&t>>>24,e[++r]=255&t>>>16,e[++r]=255&t>>>8,e[++r]=255&t;break;default:throw new TypeError("Expected 1 or 3 arguments.")}else switch(arguments.length){case 1:e=Buffer.alloc(4*t.length),n.intToBigEndian(t,e,0);break;case 3:for(var i=0;i<t.length;++i)n.intToBigEndian(t[i],e,r),r+=4;break;default:throw new TypeError("Expected 1 or 3 arguments.")}return e},longToBigEndian:function(t,e,r){if(Array.isArray(t))switch(arguments.length){case 1:e=Buffer.alloc(8*t.length),n.longToBigEndian(t,e,0);break;case 3:for(var i=0;i<t.length;++i)n.longToBigEndian(t[i],e,r),r+=8;break;default:throw new TypeError("Expected 1 or 3 arguments.")}else switch(arguments.length){case 1:e=Buffer.alloc(8),n.longToBigEndian(t,e,0);break;case 3:var o=t.low,s=t.high;n.intToBigEndian(s,e,r),n.intToBigEndian(o,e,r+4);break;default:throw new TypeError("Expected 1 or 3 arguments.")}return e},bigEndianToInt:function(t,e,r){switch(arguments.length){case 2:var i=t[e]<<24;return i|=(255&t[++e])<<16,(i|=(255&t[++e])<<8)|255&t[++e];case 3:for(var o=0;o<r.length;++o)r[o]=n.bigEndianToInt(t,e),e+=4;break;default:throw new TypeError("Expected 2 or 3 arguments.")}},bigEndianToLong:function(t,e,r){switch(arguments.length){case 2:var o=n.bigEndianToInt(t,e),s=n.bigEndianToInt(t,e+4),a=new i(s,o);return a;case 3:for(var u=0;u<r.length;++u)r[u]=n.bigEndianToLong(t,e),e+=8;break;default:throw new TypeError("Expected 2 or 3 arguments.")}}}},26778:(t,e,r)=>{"use strict";var i=r(41194).jsbn.BigInteger,n=r(77118);function o(t,e,r,i){this.curve=t,this.g=e,this.n=r,this.h=i}function s(t){return new i(t,16)}o.prototype.getCurve=function(){return this.curve},o.prototype.getG=function(){return this.g},o.prototype.getN=function(){return this.n},o.prototype.getH=function(){return this.h};var a,u,h,c,f,l,d,p=t.exports={secp256r1:(a=s("FFFFFFFF00000001000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFF"),u=s("FFFFFFFF00000001000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFC"),h=s("5AC635D8AA3A93E7B3EBBD55769886BC651D06B0CC53B0F63BCE3C3E27D2604B"),c=s("FFFFFFFF00000000FFFFFFFFFFFFFFFFBCE6FAADA7179E84F3B9CAC2FC632551"),f=i.ONE,l=new n.ECCurveFp(a,u,h),d=l.decodePointHex("046B17D1F2E12C4247F8BCE6E563A440F277037D812DEB33A0F4A13945D898C2964FE342E2FE1A7F9B8EE7EB4A7C0F9E162BCE33576B315ECECBB6406837BF51F5"),new o(l,d,c,f)),secp384r1:function(){var t=s("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFF0000000000000000FFFFFFFF"),e=s("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFF0000000000000000FFFFFFFC"),r=s("B3312FA7E23EE7E4988E056BE3F82D19181D9C6EFE8141120314088F5013875AC656398D8A2ED19D2A85C8EDD3EC2AEF"),a=s("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFC7634D81F4372DDF581A0DB248B0A77AECEC196ACCC52973"),u=i.ONE,h=new n.ECCurveFp(t,e,r),c=h.decodePointHex("04AA87CA22BE8B05378EB1C71EF320AD746E1D3B628BA79B9859F741E082542A385502F25DBF55296C3A545E3872760AB73617DE4A96262C6F5D9E98BF9292DC29F8F41DBD289A147CE9DA3113B5F0B8C00A60B1CE1D7E819D7A431D7C90EA0E5F");return new o(h,c,a,u)}(),secp521r1:function(){var t=s("01FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"),e=s("01FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFC"),r=s("0051953EB9618E1C9A1F929A21A0B68540EEA2DA725B99B315F3B8B489918EF109E156193951EC7E937B1652C0BD3BB1BF073573DF883D2C34F1EF451FD46B503F00"),a=s("01FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA51868783BF2F966B7FCC0148F709A5D03BB5C9B8899C47AEBB6FB71E91386409"),u=i.ONE,h=new n.ECCurveFp(t,e,r),c=h.decodePointHex("0400C6858E06B70404E9CD9E3ECB662395B4429C648139053FB521F828AF606B4D3DBAA14B5E77EFE75928FE1DC127A2FFA8DE3348B3C1856A429BF97E7E31C2E5BD66011839296A789A3BC0045C8A5FB42C7D1BD998F54449579B446817AFBD17273E662C97EE72995EF42640C550B9013FAD0761353C7086A272C24088BE94769FD16650");return new o(h,c,a,u)}()};p["P-256"]=p.secp256r1,p["P-384"]=p.secp384r1,p["P-521"]=p.secp521r1},91634:(t,e,r)=>{"use strict";var i=r(41194),n=i.jsbn.BigInteger,o=r(77118),s=r(26778);function a(t){return new n(t,16)}function u(t,e){e||(e=Math.ceil(t.bitLength()/8)),e*=2;var r=t.toString(16);for(r=r.substring(Math.max(r.length-e,0));e>r.length;)r="0"+r;return Buffer.from(r,"hex")}function h(t){return"string"==typeof t&&(t=Buffer.from(t,"binary")),a(t.toString("hex"))}function c(t){return Math.ceil(t.getN().bitLength()/8)}function f(t){var e=s[t];if(!e)throw new TypeError("unsupported named curve: "+t);return e}function l(t,e){var r=t.getN().bitLength(),i=8*e.length,n=h(e);return r<i&&(n=n.shiftRight(i-r)),n}function d(t,e,r){var i=f(t),n=i.getCurve(),s=new o.ECPointFp(n,n.fromBigInteger(e),n.fromBigInteger(r));this.curve=t,this.params=i,this.point=s;var a=c(i);this.x=u(e,a),this.y=u(r,a)}function p(t,e){var r=f(t);this.curve=t,this.params=r;var i=c(r);this.d=u(e,i)}d.prototype.isValid=function(){return this.params.curve.contains(this.point)},d.prototype.verify=function(t,e){var r=this.params.getN(),i=this.params.getG(),o=h(e.r),s=h(e.s);if(o.compareTo(n.ONE)<0||o.compareTo(r)>=0)return!1;if(s.compareTo(n.ONE)<0||o.compareTo(r)>=0)return!1;var a=l(this.params,t),u=s.modInverse(r),c=a.multiply(u).mod(r),f=o.multiply(u).mod(r),d=i.multiplyTwo(c,this.point,f).getX().toBigInteger();return(d=d.mod(r)).equals(o)},p.prototype.toPublicKey=function(){var t=h(this.d),e=this.params.getG().multiply(t);return new d(this.curve,e.getX().toBigInteger(),e.getY().toBigInteger())},p.prototype.sign=function(t){var e,r,o,s,a=c(this.params),f=this.params.getN(),d=this.params.getG(),p=l(this.params,t),g=h(this.d);do{do{do{o=h(i.random.getBytes(a))}while(o.equals(n.ZERO)||o.compareTo(f)>=0);e=d.multiply(o).getX().toBigInteger().mod(f)}while(e.equals(n.ZERO));s=g.multiply(e),s=p.add(s),r=o.modInverse(f).multiply(s).mod(f)}while(r.equals(n.ONE));var y=c(this.params);return{r:e=u(e,y),s:r=u(r,y)}},p.prototype.isValid=function(){var t=h(this.d),e=this.params.getN().subtract(n.ONE);return t.compareTo(n.ONE)>=0&&t.compareTo(e)<0},p.prototype.computeSecret=function(t){var e=h(this.d),r=t.point.multiply(e).getX().toBigInteger();return u(r,c(this.params))},e.generateKeyPair=function(t){var e=f(t),r=e.getN(),o=i.random.getBytes(c(e));o=h(o);var s=r.subtract(n.ONE),a=new p(t,o.mod(s).add(n.ONE)),u=a.toPublicKey();return{private:a,public:u}},e.asPublicKey=function(t,e,r){return"string"==typeof e?e=a(e):Buffer.isBuffer(e)&&(e=h(e)),"string"==typeof r?r=a(r):Buffer.isBuffer(r)&&(r=h(r)),new d(t,e,r)},e.asPrivateKey=function(t,e){return"string"==typeof e?e=a(e):Buffer.isBuffer(e)&&(e=h(e)),new p(t,e)}},77118:(t,e,r)=>{"use strict";var i=r(41194).jsbn.BigInteger;function n(){return new i(null)}function o(t){this.r2=n(),this.q3=n(),i.ONE.dlShiftTo(2*t.t,this.r2),this.mu=this.r2.divide(t),this.m=t}function s(t,e){this.x=e,this.p=t}function a(t,e,r,n){this.curve=t,this.x=e,this.y=r,this.z=n||i.ONE,this.zinv=null}function u(t,e,r){this.p=t,this.a=this.fromBigInteger(e),this.b=this.fromBigInteger(r),this.infinity=new a(this,null,null),this.reducer=new o(this.p)}o.prototype.convert=function(t){if(t.s<0||t.t>2*this.m.t)return t.mod(this.m);if(t.compareTo(this.m)<0)return t;var e=n();return t.copyTo(e),this.reduce(e),e},o.prototype.revert=function(t){return t},o.prototype.reduce=function(t){for(t.drShiftTo(this.m.t-1,this.r2),t.t>this.m.t+1&&(t.t=this.m.t+1,t.clamp()),this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3),this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);t.compareTo(this.r2)<0;)t.dAddOffset(1,this.m.t+1);for(t.subTo(this.r2,t);t.compareTo(this.m)>=0;)t.subTo(this.m,t)},o.prototype.mulTo=function(t,e,r){t.multiplyTo(e,r),this.reduce(r)},o.prototype.sqrTo=function(t,e){t.squareTo(e),this.reduce(e)},s.prototype.equals=function(t){return t===this||this.p.equals(t.p)&&this.x.equals(t.x)},s.prototype.toBigInteger=function(){return this.x},s.prototype.negate=function(){return new s(this.p,this.x.negate().mod(this.p))},s.prototype.add=function(t){return new s(this.p,this.x.add(t.toBigInteger()).mod(this.p))},s.prototype.subtract=function(t){return new s(this.p,this.x.subtract(t.toBigInteger()).mod(this.p))},s.prototype.multiply=function(t){return new s(this.p,this.x.multiply(t.toBigInteger()).mod(this.p))},s.prototype.square=function(){return new s(this.p,this.x.pow(2).mod(this.p))},s.prototype.divide=function(t){return new s(this.p,this.x.multiply(t.toBigInteger().modInverse(this.p)).mod(this.p))},a.prototype.getX=function(){this.zinv||(this.zinv=this.z.modInverse(this.curve.p));var t=this.x.toBigInteger().multiply(this.zinv);return this.curve.reduce(t),this.curve.fromBigInteger(t)},a.prototype.getY=function(){this.zinv||(this.zinv=this.z.modInverse(this.curve.p));var t=this.y.toBigInteger().multiply(this.zinv);return this.curve.reduce(t),this.curve.fromBigInteger(t)},a.prototype.equals=function(t){return t===this||(this.isInfinity()?t.isInfinity():t.isInfinity()?this.isInfinity():!!t.y.toBigInteger().multiply(this.z).subtract(this.y.toBigInteger().multiply(t.z)).mod(this.curve.p).equals(i.ZERO)&&t.x.toBigInteger().multiply(this.z).subtract(this.x.toBigInteger().multiply(t.z)).mod(this.curve.p).equals(i.ZERO))},a.prototype.isInfinity=function(){return null==this.x&&null==this.y||this.z.equals(i.ZERO)&&!this.y.toBigInteger().equals(i.ZERO)},a.prototype.negate=function(){return new a(this.curve,this.x,this.y.negate(),this.z)},a.prototype.add=function(t){if(this.isInfinity())return t;if(t.isInfinity())return this;var e=t.y.toBigInteger().multiply(this.z).subtract(this.y.toBigInteger().multiply(t.z)).mod(this.curve.p),r=t.x.toBigInteger().multiply(this.z).subtract(this.x.toBigInteger().multiply(t.z)).mod(this.curve.p);if(i.ZERO.equals(r))return i.ZERO.equals(e)?this.twice():this.curve.getInfinity();var n=new i("3"),o=this.x.toBigInteger(),s=this.y.toBigInteger(),u=r.pow(2),h=u.multiply(r),c=o.multiply(u),f=e.pow(2).multiply(this.z),l=f.subtract(c.shiftLeft(1)).multiply(t.z).subtract(h).multiply(r).mod(this.curve.p),d=c.multiply(n).multiply(e).subtract(s.multiply(h)).subtract(f.multiply(e)).multiply(t.z).add(e.multiply(h)).mod(this.curve.p),p=h.multiply(this.z).multiply(t.z).mod(this.curve.p);return new a(this.curve,this.curve.fromBigInteger(l),this.curve.fromBigInteger(d),p)},a.prototype.twice=function(){if(this.isInfinity())return this;if(0===this.y.toBigInteger().signum())return this.curve.getInfinity();var t=new i("3"),e=this.x.toBigInteger(),r=this.y.toBigInteger(),n=r.multiply(this.z),o=n.multiply(r).mod(this.curve.p),s=this.curve.a.toBigInteger(),u=e.pow(2).multiply(t);i.ZERO.equals(s)||(u=u.add(this.z.pow(2).multiply(s)));var h=(u=u.mod(this.curve.p)).pow(2).subtract(e.shiftLeft(3).multiply(o)).shiftLeft(1).multiply(n).mod(this.curve.p),c=u.multiply(t).multiply(e).subtract(o.shiftLeft(1)).shiftLeft(2).multiply(o).subtract(u.pow(2).multiply(u)).mod(this.curve.p),f=n.pow(2).multiply(n).shiftLeft(3).mod(this.curve.p);return new a(this.curve,this.curve.fromBigInteger(h),this.curve.fromBigInteger(c),f)},a.prototype.multiply=function(t){if(this.isInfinity())return this;if(0===t.signum())return this.curve.getInfinity();var e,r=t,n=r.multiply(new i("3")),o=this.negate(),s=this;for(e=n.bitLength()-2;e>0;--e){s=s.twice();var a=n.testBit(e);a!==r.testBit(e)&&(s=s.add(a?this:o))}return s},a.prototype.multiplyTwo=function(t,e,r){var i;i=t.bitLength()>r.bitLength()?t.bitLength()-1:r.bitLength()-1;for(var n=this.curve.getInfinity(),o=this.add(e);i>=0;)n=n.twice(),t.testBit(i)?n=r.testBit(i)?n.add(o):n.add(this):r.testBit(i)&&(n=n.add(e)),--i;return n},u.prototype.getP=function(){return this.p},u.prototype.getA=function(){return this.a},u.prototype.getB=function(){return this.b},u.prototype.equals=function(t){return t===this||this.p.equals(t.p)&&this.a.equals(t.a)&&this.b.equals(t.b)},u.prototype.contains=function(t){var e=t.getX().toBigInteger(),r=t.getY().toBigInteger(),i=this.a.toBigInteger(),n=this.b.toBigInteger(),o=this.p,s=r.pow(2).mod(o),a=e.pow(3).add(i.multiply(e)).add(n).mod(o);return s.equals(a)},u.prototype.getInfinity=function(){return this.infinity},u.prototype.fromBigInteger=function(t){return new s(this.p,t)},u.prototype.reduce=function(t){this.reducer.reduce(t)},u.prototype.decodePointHex=function(t){switch(parseInt(t.substring(0,2),16)){case 0:return this.infinity;case 2:case 3:return null;case 4:case 6:case 7:var e=(t.length-2)/2,r=t.substr(2,e),n=t.substr(e+2,e);return new a(this,this.fromBigInteger(new i(r,16)),this.fromBigInteger(new i(n,16)));default:return null}},u.prototype.encodePointHex=function(t){if(t.isInfinity())return"00";var e=t.getX().toBigInteger().toString(16),r=t.getY().toBigInteger().toString(16),i=this.getP().toString(16).length;for(i%2!=0&&i++;e.length<i;)e="0"+e;for(;r.length<i;)r="0"+r;return"04"+e+r},t.exports={ECFieldElementFp:s,ECPointFp:a,ECCurveFp:u}},41194:(t,e,r)=>{"use strict";var i,n,o=r(3832);function s(t){t=t||{},this.name="",this.cipher=t.cipher,this.blockSize=t.blockSize||16,this._blocks=this.blockSize/4,this._inBlock=new Array(this._blocks),this._outBlock=new Array(this._blocks)}r(8925),r(3068),r(85649),r(36607),r(83453),r(98960),r(26953),r(18936),r(79437),r(4742),r(29654),r(74933),r(96007),r(49563),r(137),r(41668),r(63219),r(97116),s.prototype.start=function(){},s.prototype.encrypt=function(t,e,r){if(t.length()<this.blockSize&&!(r&&t.length()>0))return!0;var i;for(i=0;i<this._blocks;++i)this._inBlock[i]=t.getInt32();for(this.cipher.encrypt(this._inBlock,this._outBlock),i=0;i<this._blocks;++i)e.putInt32(this._outBlock[i])},s.prototype.decrypt=function(t,e,r){if(t.length()<this.blockSize&&!(r&&t.length()>0))return!0;var i;for(i=0;i<this._blocks;++i)this._inBlock[i]=t.getInt32();for(this.cipher.decrypt(this._inBlock,this._outBlock),i=0;i<this._blocks;++i)e.putInt32(this._outBlock[i])},n=s,i=function(){return new o.aes.Algorithm("AES",n)},o.cipher.registerAlgorithm("AES",i),t.exports=o},21217:(t,e,r)=>{"use strict";"undefined"==typeof Promise&&r(82702).polyfill(),"undefined"==typeof Buffer&&((r.g||window).Buffer=r(14476).lW),"undefined"==typeof process&&((r.g||window).process=r(34155)),process.version||(process.version="");var i=r(32109);t.exports={JWA:r(35382),JWE:r(30701),JWK:r(32543),JWS:i,util:r(44237),parse:r(48650),canYouSee:i.createVerify}},8668:(t,e,r)=>{"use strict";var i=r(9752),n=r(63171),o=r(32543),s=r(85029),a=r(99591),u={algorithms:"*"};function h(t,e){var r,h;if(o.isKey(t))h=(r=t).keystore;else{if(!o.isKeyStore(t))throw new TypeError("Keystore must be provided");h=t}e=s(u,e),Object.defineProperty(this,"decrypt",{value:function(t,u){var c=(u=s({},e,u||{})).handlers||{},f=Object.keys(c),l=new n(u.algorithms);if("string"==typeof t)t={protected:(t=t.split("."))[0],recipients:[{encrypted_key:t[1]}],iv:t[2],ciphertext:t[3],tag:t[4]};else if(!t||"object"!=typeof t)throw new Error("invalid input");"encrypted_key"in t&&(t.recipients=[{encrypted_key:t.encrypted_key}]);var d,p,g,y,m,v=t.recipients||[{}];return Promise.resolve(v).then((function(e){if(t.protected){p=i.decode(t.protected).toString("utf8");var r=(p=JSON.parse(p)).crit;if(r){if(!Array.isArray(r))return Promise.reject(new Error("Invalid 'crit' header"));for(var n=0;r.length>n;n++)if(-1===f.indexOf(r[n]))return Promise.reject(new Error("Critical extension is not supported: "+r[n]))}d=p,p=Object.keys(p)}else d={},p=[];return d=s(t.unprotected||{},d),e=e.map((function(t){var e=Promise.resolve(),r=t.header||{};return r=s(r,d),t.header=r,t.protected=p,l.match(r.alg)||(e=e.then((function(){return Promise.reject(new Error("Algorithm not allowed: "+r.alg))}))),l.match(r.enc)||(e=e.then((function(){return Promise.reject(new Error("Algorithm not allowed: "+r.enc))}))),r.epk&&(e=(e=e.then((function(){return o.asKey(r.epk)}))).then((function(t){r.epk=t.toObject(!1)}))),e.then((function(){return t}))})),Promise.all(e)})).then((function(t){var e={};return new Promise((function(n,s){var a=function(){var u=t.shift();if(u){var c=Promise.resolve(u);(c=(c=c.then((function(t){var e=m=t.encrypted_key||"";return e=i.decode(e),(g=r||h.get({use:"enc",alg:t.header.alg,kid:t.header.kid}))?g.unwrap(t.header.alg,e,t.header):Promise.reject()}))).then((function(t){y={kty:"oct",k:i.encode(t)},y=o.asKey(y),e.key=g,e.header=u.header,e.protected=u.protected,n(e)}))).catch(a)}else s(new Error("no key found"))};a()}))})).then((function(e){return e.iv=t.iv,e.tag=t.tag,e.ciphertext=t.ciphertext,e})).then((function(t){var e=[];return f.forEach((function(r){var i;"function"==typeof(r=c[r])?i=r(t):"object"==typeof r&&"function"==typeof r.prepare&&(i=r.prepare(t)),i&&e.push(Promise.resolve(i))})),Promise.all(e).then((function(){return t}))})).then((function(t){return Buffer.isBuffer(t.ciphertext)||(t.ciphertext=i.decode(t.ciphertext)),t})).then((function(e){var r=t.protected;"aad"in t&&null!=t.aad&&(r+="."+t.aad);var i={iv:e.iv,adata:r,tag:e.tag,kdata:m,epu:e.epu,epv:e.epv},n=e.ciphertext;return delete e.iv,delete e.tag,delete e.ciphertext,y.then((function(t){return t.decrypt(e.header.enc,n,i).then((function(t){return e.payload=e.plaintext=t,e}))}))})).then((function(t){return"DEF"===t.header.zip?new Promise((function(e,r){try{var i=a.inflateRaw(Buffer.from(t.plaintext));t.payload=t.plaintext=Buffer.from(i),e(t)}catch(t){r(t)}})):t})).then((function(t){var e=[];return f.forEach((function(r){var i;"object"==typeof(r=c[r])&&"function"==typeof r.complete&&(i=r.complete(t)),i&&e.push(Promise.resolve(i))})),Promise.all(e).then((function(){return t}))}))}})}t.exports={decrypter:h,createDecrypt:function(t,e){return new h(t,e)}}},65141:t=>{"use strict";t.exports={zip:!1,format:"general",contentAlg:"A128CBC-HS256",protect:"*"}},58414:(t,e,r)=>{"use strict";var i=r(44237),n=r(59077).generateCEK,o=r(32543),s=r(59077).slice,a=r(99591),u=r(50414),h=r(28583),c=r(66678),f=r(65141);function l(t,e,r){var s=!1,f=t.format||"general",l=!!t.protectAll,d=Buffer.alloc(0);Object.defineProperty(this,"zip",{get:function(){return e.zip||""},enumerable:!0}),Object.defineProperty(this,"compact",{get:function(){return"compact"===f},enumerable:!0}),Object.defineProperty(this,"format",{get:function(){return f},enumerable:!0}),Object.defineProperty(this,"protected",{get:function(){return c(t.protect)},enumerable:!0}),Object.defineProperty(this,"header",{get:function(){return c(e)},enumerable:!0}),Object.defineProperty(this,"update",{value:function(t,e){if(s)throw new Error("already final");return null!=t&&(t=i.asBuffer(t,e),d=d.length?Buffer.concat([d,t],d.length+t.length):t),this}}),Object.defineProperty(this,"final",{value:function(p,g){if(s)return Promise.reject(new Error("already final"));this.update(p,g),s=!0;var y,m=Promise.resolve({}),v=e.enc;m=(m=m.then((function(e){return t.cek&&(y=o.asKey(t.cek)),e}))).then((function(s){var a=Promise.all(r);return(a=a.then((function(r){var s=1===r.length;return r=r.map((function(r){return function(r,s){var a={};a=h(a,e),a=h(a,r.header);var u,f,l=r.key,d=a.alg;return 0===(a.alg||"").indexOf("ECDH-ES")?(u=l.keystore.temp(),f=r.epk?Promise.resolve(r.epk).then((function(t){r.header.epk=t.toJSON(!1,["kid"]),a.epk=t.toObject(!0,["kid"])})):u.generate("EC",l.get("crv")).then((function(t){r.header.epk=t.toJSON(!1,["kid"]),a.epk=t.toObject(!0,["kid"])}))):f=Promise.resolve(),(f=f.then((function(){var r,i;return"dir"===d&&s?i=(y=Promise.resolve(l)).then((function(t){return v||(a.enc=e.enc=v=t.algorithms(o.MODE_ENCRYPT)[0]),{once:!0,direct:!0}})):(y||(v||(a.enc=e.enc=v=t.contentAlg),y=n(v)),i=(i=y.then((function(t){return r=t.get("k",!0),l}))).then((function(t){return t.wrap(d,r,a)}))),i}))).then((function(t){if(t.once&&!s)return Promise.reject(new Error("cannot use 'alg':'"+d+"' with multiple recipients"));var e,n={};return t.data&&(e=t.data,e=i.base64url.encode(e)),t.direct&&e?y=o.asKey({kty:"oct",k:e}):e&&(n.encrypted_key=e),r.header&&Object.keys(r.header).length&&(n.header=c(r.header||{})),t.header&&(n.header=h(n.header||{},t.header)),n}))}(r,s)})),Promise.all(r)}))).then((function(t){return s.recipients=t.filter((function(t){return!!t})),s}))}));var b={};switch(m=(m=(m=m.then((function(r){var n,o,s,a;return s=c(e),l&&1===r.recipients.length||"compact"===f?(n={},n=h({},s,r.recipients[0].header),o=Object.keys(n).length,s=void 0,a=0,delete r.recipients[0].header,0===Object.keys(r.recipients[0]).length&&r.recipients.splice(0,1)):(n={},o=0,a=Object.keys(s).length,t.protect.forEach((function(t){t in s&&(n[t]=s[t],o++,delete s[t],a--)})),r.recipients=(r.recipients||[]).map((function(t){var e=(t=t||{}).header;return e&&(Object.keys(e).forEach((function(t){t in n&&delete e[t]})),Object.keys(e).length||delete t.header),t}))),r.recipients&&0!==r.recipients.length||delete r.recipients,s&&a>0&&(b=h(b,s),r.unprotected=s),n&&o>0&&(b=h(b,n),n=JSON.stringify(n),r.protected=i.base64url.encode(n,"utf8")),r}))).then((function(t){var e=d;return b.zip?"DEF"===b.zip?new Promise((function(r,i){try{var n=a.deflateRaw(Buffer.from(e,"binary"));t.plaintext=n,r(t)}catch(t){i(t)}})):Promise.reject(new Error("unsupported 'zip' mode")):(t.plaintext=e,t)}))).then((function(e){b.adata=e.protected,"aad"in t&&null!=t.aad&&(b.adata+="."+t.aad,b.adata=Buffer.from(b.adata,"utf8"));var r=t.iv||i.randomBytes(u.NONCELENGTH[v]/8);"string"==typeof r&&(r=i.base64url.decode(r)),b.iv=r,"recipients"in e&&1===e.recipients.length&&(b.kdata=e.recipients[0].encrypted_key),"epu"in t&&null!=t.epu&&(b.epu=t.epu),"epv"in t&&null!=t.epv&&(b.epv=t.epv);var n=e.plaintext;return delete e.plaintext,y.then((function(o){var s=o.encrypt(v,n,b);return s.then((function(n){return e.iv=i.base64url.encode(r,"binary"),"aad"in t&&null!=t.aad&&(e.aad=t.aad),e.ciphertext=i.base64url.encode(n.data,"binary"),e.tag=i.base64url.encode(n.tag,"binary"),e}))}))})),f){case"compact":m=m.then((function(t){var e=new Array(5);return e[0]=t.protected,t.recipients&&t.recipients[0]&&(e[1]=t.recipients[0].encrypted_key),e[2]=t.iv,e[3]=t.ciphertext,e[4]=t.tag,e.join(".")}));break;case"flattened":m=m.then((function(t){var e={},r=t.recipients&&t.recipients[0];return t.protected&&(e.protected=t.protected),t.unprotected&&(e.unprotected=t.unprotected),["header","encrypted_key"].forEach((function(t){r&&t in r&&r[t]&&("object"!=typeof r[t]||Object.keys(r[t]).length)&&(e[t]=r[t])})),t.aad&&(e.aad=t.aad),e.iv=t.iv,e.ciphertext=t.ciphertext,e.tag=t.tag,e}));break;case"general":m=m.then((function(t){var e=t.recipients||[];return(e=(e=e.map((function(t){if(Object.keys(t).length)return t}))).filter((function(t){return!!t}))).length?t.recipients=e:delete t.recipients,t}))}return m}})}t.exports={encrypter:l,createEncrypt:function(t,e){var r=t,n=1,a=e;if(0===arguments.length)throw new Error("at least one recipient must be provided");1===arguments.length||o.isKey(t)||t&&"kty"in t||t&&"key"in t&&(o.isKey(t.key)||"kty"in t.key)?(a=t,n=0,r={}):r=c(t),Array.isArray(a)||(a=s(arguments,n)),r=h(c(f),r);var u=c(r.fields||{});switch(r.zip&&(u.zip="boolean"==typeof r.zip?!!r.zip&&"DEF":r.zip),r.format=(r.compact?"compact":r.format)||"general",r.format){case"compact":if("aad"in t)throw new Error("additional authenticated data cannot be used for compact serialization");case"flattened":if(a.length>1)throw new Error("too many recipients for compact serialization")}var d=!1;if("compact"===r.format||"*"===r.protect)d=!0,r.protect=Object.keys(u).concat("enc");else if("string"==typeof r.protect)r.protect=[r.protect];else if(Array.isArray(r.protect))r.protect=r.protect.concat();else{if(r.protect)throw new Error("protect must be a list of fields");r.protect=[]}if(d&&1<a.length)throw new Error("too many recipients to protect all header parameters");a=a.map((function(t,e){var r;return r=t&&"kty"in t?(r=o.asKey(t)).then((function(t){return{key:t}})):t?(r=o.asKey(t.key)).then((function(e){return{header:t.header,reference:t.reference,key:e}})):Promise.reject(new Error("missing key for recipient "+e)),t.epk&&(r=r.then((function(e){return o.asKey(t.epk).then((function(t){return e.epk=t,e}))}))),r.then((function(t){var r=t.key,i=t.header||{};t.header=i;var n={};if(n=h(n,u),(n=h(n,t.header)).alg||(n.alg=r.algorithms(o.MODE_WRAP)[0],i.alg=n.alg),!n.alg)return Promise.reject(new Error("key not valid for encrypting to recipient "+e));i.alg=n.alg;var s,a=t.reference;if(delete t.reference,void 0===a?a=(a=["kid","jku","x5c","x5t","x5u"].some((function(t){return t in i})))?null:"kid":"boolean"==typeof a&&(a=a?"kid":null),a)if(s=r.toJSON(),"jwk"===a){if("oct"===r.kty)return Promise.reject(new Error("cannot embed key"));i.jwk=s}else a in s&&(i[a]=s[a]);return Object.freeze(t)}))}));var p={aad:"aad"in r?i.base64url.encode(r.aad||""):null,contentAlg:r.contentAlg,format:r.format,protect:r.protect,cek:r.cek,iv:r.iv,protectAll:d},g=new l(p,u,a);return g}}},59077:(t,e,r)=>{"use strict";var i=r(50414),n=r(32543);t.exports={slice:function(t,e){return Array.prototype.slice.call(t,e||0)},generateCEK:function(t){var e=n.createKeyStore(),r=i.KEYLENGTH[t];if(r)return e.generate("oct",r);throw new Error("unsupported encryption algorithm")}}},30701:(t,e,r)=>{"use strict";var i={createEncrypt:r(58414).createEncrypt,createDecrypt:r(8668).createDecrypt};t.exports=i},57136:(t,e,r)=>{"use strict";var i=r(85029),n=r(66071),o=r(28583),s=r(66678),a=r(85564),u=r(25325),h=r(57557),c=r(78718),f=r(44908),l=r(35382),d=r(26395),p=r(49684),g=r(44237);t.exports=function(t,e,r,y){if(!t)throw new Error("kty cannot be null");if(!e)throw new Error("keystore cannot be null");if(!r)throw new Error("props cannot be null");if("string"==typeof r&&(r=JSON.parse(r)),!y)throw new Error("cfg cannot be null");var m,v,b=[],w={},_={};r=s(r),m=o({},r[p.INTERNALS.THUMBPRINT_KEY]||{}),delete r[p.INTERNALS.THUMBPRINT_KEY],Object.keys(m).forEach((function(t){var e=m[t];v||(v=e,Buffer.isBuffer(v)&&(v=g.base64url.encode(v))),Buffer.isBuffer(e)||(e=g.base64url.decode(e),m[t]=e)})),r.kty=t,r.kid=r.kid||v||n();var S,E=Object.keys(p.COMMON_PROPS).map((function(t){return p.COMMON_PROPS[t].name}));_.base=c(r,E),b=b.concat(Object.keys(_.base)),_.public=s(r),w.public=y.publicKey(_.public),w.public&&(b=b.concat(Object.keys(_.public))),_.private=s(r),w.private=y.privateKey(_.private),w.private&&(b=b.concat(Object.keys(_.private))),_.extra=h(r,b),S=w.public&&"length"in w.public?w.public.length:w.private&&"length"in w.private?w.private.length:NaN,Object.defineProperty(this,"keystore",{value:e,enumerable:!0}),Object.defineProperty(this,"length",{value:S,enumerable:!0}),Object.defineProperty(this,"kty",{value:t,enumerable:!0}),Object.defineProperty(this,"kid",{value:_.base.kid,enumerable:!0}),Object.defineProperty(this,"use",{value:_.base.use||"",enumerable:!0}),Object.defineProperty(this,"alg",{value:_.base.alg||"",enumerable:!0}),Object.defineProperty(this,"thumbprint",{value:function(t){if(t=(t||p.INTERNALS.THUMBPRINT_HASH).toUpperCase(),m[t])return Promise.resolve(m[t]);var e=p.thumbprint(y,_,t);return e.then((function(e){return e&&(m[t]=e),e}))}}),Object.defineProperty(this,"algorithms",{value:function(e){var r=[];this.use&&"sig"!==this.use||(e&&d.MODE_SIGN!==e||r.push(d.MODE_SIGN),e&&d.MODE_VERIFY!==e||r.push(d.MODE_VERIFY)),this.use&&"enc"!==this.use||(e&&d.MODE_ENCRYPT!==e||r.push(d.MODE_ENCRYPT),e&&d.MODE_DECRYPT!==e||r.push(d.MODE_DECRYPT),e&&d.MODE_WRAP!==e||r.push(d.MODE_WRAP),e&&d.MODE_UNWRAP!==e||r.push(d.MODE_UNWRAP));var i,n=this,o=r.map((function(t){return y.algorithms.call(n,w,t)}));return o=a(o),o=f(o),this.alg&&(i="oct"===t?[this.alg,"dir"]:[this.alg],o=u(o,i)),o}}),Object.defineProperty(this,"supports",{value:function(t,e){return-1!==this.algorithms(e).indexOf(t)}}),Object.defineProperty(this,"has",{value:function(t,e){var r=!1;return(r=(r=(r=r||!(!_.base||!(t in _.base)))||!(!w.public||!(t in w.public)))||!(!_.extra||!(t in _.extra)))||!!(e&&w.private&&t in w.private)}}),Object.defineProperty(this,"get",{value:function(t,e){var r;return _.base&&t in _.base?r=_.base:w.public&&t in w.public?r=w.public:_.extra&&t in _.extra?r=_.extra:e&&w.private&&t in w.private&&(r=w.private),r&&r[t]||null}}),Object.defineProperty(this,"toJSON",{value:function(t,e){Array.isArray(t)&&(e=t,t=!1);var r={};return r=i(r,_.base,_.public,"boolean"==typeof t&&t?_.private:{},_.extra),h(r,e||[])}}),Object.defineProperty(this,"toPEM",{value:function(t){if(null===t&&(t=!1),!y.convertToPEM)throw new Error("Unsupported key type for PEM encoding");var e=t?w.private:w.public;if(!e)throw new Error("Invalid key");return y.convertToPEM.call(this,e,t)}}),Object.defineProperty(this,"toObject",{value:function(t,e){Array.isArray(t)&&(e=t,t=!1);var r={};return r=i(r,_.base,w.public,"boolean"==typeof t&&t?w.private:{},_.extra),h(r,(e||[]).concat("length"))}}),Object.defineProperty(this,"sign",{value:function(t,e,r){if(-1===this.algorithms("sign").indexOf(t))return Promise.reject(new Error("unsupported algorithm"));var n=y.signKey.call(this,t,w);return n?(r=r?s(r):{},y.signProps&&(r=i(r,y.signProps.call(this,t,r))),l.sign(t,n,e,r)):Promise.reject(new Error("improper key"))}}),Object.defineProperty(this,"verify",{value:function(t,e,r,n){if(-1===this.algorithms("verify").indexOf(t))return Promise.reject(new Error("unsupported algorithm"));var o=y.verifyKey.call(this,t,w);return o?(n=n?s(n):{},y.verifyProps&&(n=i(n,y.verifyProps.call(this,t,n))),l.verify(t,o,e,r,n)):Promise.reject(new Error("improper key"))}}),Object.defineProperty(this,"encrypt",{value:function(t,e,r){if(-1===this.algorithms("encrypt").indexOf(t))return Promise.reject(new Error("unsupported algorithm"));var n=y.encryptKey.call(this,t,w);return n?(r=r?s(r):{},y.encryptProps&&(r=i(r,y.encryptProps.call(this,t,r))),l.encrypt(t,n,e,r)):Promise.reject(new Error("improper key"))}}),Object.defineProperty(this,"decrypt",{value:function(t,e,r){if(-1===this.algorithms("decrypt").indexOf(t))return Promise.reject(new Error("unsupported algorithm"));var n=y.decryptKey.call(this,t,w);return n?(r=r?s(r):{},y.decryptProps&&(r=i(r,y.decryptProps.call(this,t,r))),l.decrypt(t,n,e,r)):Promise.reject(new Error("improper key"))}}),Object.defineProperty(this,"wrap",{value:function(t,e,r){if(-1===this.algorithms("wrap").indexOf(t))return Promise.reject(new Error("unsupported algorithm"));var n=y.wrapKey.call(this,t,w);return n?(r=r?s(r):{},y.wrapProps&&(r=i(r,y.wrapProps.call(this,t,r))),l.encrypt(t,n,e,r)):Promise.reject(new Error("improper key"))}}),Object.defineProperty(this,"unwrap",{value:function(t,e,r){if(-1===this.algorithms("unwrap").indexOf(t))return Promise.reject(new Error("unsupported algorithm"));var n=y.unwrapKey.call(this,t,w);return n?(r=r?s(r):{},y.unwrapProps&&(r=i(r,y.unwrapProps.call(this,t,r))),l.decrypt(t,n,e,r)):Promise.reject(new Error("improper key"))}})}},26395:t=>{"use strict";t.exports={MODE_SIGN:"sign",MODE_VERIFY:"verify",MODE_ENCRYPT:"encrypt",MODE_DECRYPT:"decrypt",MODE_WRAP:"wrap",MODE_UNWRAP:"unwrap"}},15339:(t,e,r)=>{"use strict";var i=r(71762),n=r(41194),o=r(91634),s={BaseKey:r(57136),helpers:r(49684)},a=["ES256","ES384","ES512"],u=["ECDH-ES","ECDH-ES+A128KW","ECDH-ES+A192KW","ECDH-ES+A256KW"],h=i.EC_OID;function c(t){switch(t){case"1.2.840.10045.3.1.7":return"P-256";case"1.3.132.0.34":return"P-384";case"1.3.132.0.35":return"P-521";default:return null}}var f={publicKey:function(t){var e=s.helpers.COMMON_PROPS.concat([{name:"crv",type:"string"},{name:"x",type:"binary"},{name:"y",type:"binary"}]),r=s.helpers.unpackProps(t,e);return r&&r.crv&&r.x&&r.y?r.length=i.curveSize(r.crv):(delete r.crv,delete r.x,delete r.y),r},privateKey:function(t){var e=s.helpers.COMMON_PROPS.concat([{name:"crv",type:"string"},{name:"x",type:"binary"},{name:"y",type:"binary"},{name:"d",type:"binary"}]),r=s.helpers.unpackProps(t,e);return r&&r.crv&&r.x&&r.y&&r.d?r.length=i.curveSize(r.crv):r=void 0,r},thumbprint:function(t){return t.public&&(t=t.public),{crv:t.crv,kty:"EC",x:t.x,y:t.y}},algorithms:function(t,e){var r=t.public&&t.public.length||t.private&&t.private.length||0;switch(521===r&&(r=512),e){case"encrypt":case"decrypt":return[];case"wrap":return t.public&&u||[];case"unwrap":return t.private&&u||[];case"sign":return t.private?a.filter((function(t){return t==="ES"+r})):[];case"verify":return t.public?a.filter((function(t){return t==="ES"+r})):[]}},encryptKey:function(t,e){return e.public},decryptKey:function(t,e){return e.private},wrapKey:function(t,e){return e.public},unwrapKey:function(t,e){return e.private},signKey:function(t,e){return e.private},verifyKey:function(t,e){return e.public}};f.convertToPEM=i.convertToPEM;var l={oid:h,privateKey:{name:"ECPrivateKey",tagClass:n.asn1.Class.UNIVERSAL,type:n.asn1.Type.SEQUENCE,constructed:!0,value:[{name:"ECPrivateKey.version",tagClass:n.asn1.Class.UNIVERSAL,type:n.asn1.Type.INTEGER,constructed:!1},{name:"ECPrivateKey.private",tagClass:n.asn1.Class.UNIVERSAL,type:n.asn1.Type.OCTETSTRING,constructed:!1,capture:"d"},{tagClass:n.asn1.Class.CONTEXT_SPECIFIC,name:"ECPrivateKey.parameters",constructed:!0,value:[{name:"ECPrivateKey.namedCurve",tagClass:n.asn1.Class.UNIVERSAL,type:n.asn1.Type.OID,constructed:!1,capture:"crv"}]},{name:"ECPrivateKey.publicKey",tagClass:n.asn1.Class.CONTEXT_SPECIFIC,constructed:!0,value:[{name:"ECPrivateKey.point",tagClass:n.asn1.Class.UNIVERSAL,type:n.asn1.Type.BITSTRING,constructed:!1,capture:"point"}]}]},embeddedPrivateKey:{name:"ECPrivateKey",tagClass:n.asn1.Class.UNIVERSAL,type:n.asn1.Type.SEQUENCE,constructed:!0,value:[{name:"ECPrivateKey.version",tagClass:n.asn1.Class.UNIVERSAL,type:n.asn1.Type.INTEGER,constructed:!1},{name:"ECPrivateKey.private",tagClass:n.asn1.Class.UNIVERSAL,type:n.asn1.Type.OCTETSTRING,constructed:!1,capture:"d"},{name:"ECPrivateKey.publicKey",tagClass:n.asn1.Class.CONTEXT_SPECIFIC,constructed:!0,value:[{name:"ECPrivateKey.point",tagClass:n.asn1.Class.UNIVERSAL,type:n.asn1.Type.BITSTRING,constructed:!1,capture:"point"}]}]}},d={kty:"EC",validators:l,prepare:function(t){var e=f,r=Promise.resolve(t);return(r=r.then((function(t){return s.helpers.thumbprint(e,t)}))).then((function(r){var i={};return i[s.helpers.INTERNALS.THUMBPRINT_HASH]=r,t[s.helpers.INTERNALS.THUMBPRINT_KEY]=i,e}))},generate:function(t){var e=o.generateKeyPair(t),r={crv:t,x:e.public.x,y:e.public.y,d:e.private.d};return Promise.resolve(r)},import:function(t){if(l.oid!==t.keyOid)return null;var e;if(t.keyParams&&n.asn1.Type.OID===t.keyParams.type?e=c(e=n.asn1.derToOid(t.keyParams.value)):t.crv&&(e=c(e=n.asn1.derToOid(t.crv))),!e)return null;if(!t.parsed){var r={};if("private"===t.type){if("string"==typeof t.keyValue?t.keyValue=n.asn1.fromDer(t.keyValue):Array.isArray(t.keyValue)&&(t.keyValue=t.keyValue[0]),!n.asn1.validate(t.keyValue,l.embeddedPrivateKey,r,[]))return null}else r.point=t.keyValue;t=r}var i={kty:"EC",crv:e};if(t.d&&(i.d=Buffer.from(t.d,"binary")),t.point){var o=Buffer.from(t.point,"binary");if(4!==o.readUInt16BE(0))return null;var s=(o=o.slice(2)).length/2;i.x=o.slice(0,s),i.y=o.slice(s)}return i}};t.exports=Object.freeze({config:f,factory:d}),r(4567).registry.register(d)},49684:(t,e,r)=>{"use strict";var i=r(66678),n=r(44237),o=r(41194),s=r(35382),a={name:"PrivateKeyInfo",tagClass:o.asn1.Class.UNIVERSAL,type:o.asn1.Type.SEQUENCE,constructed:!0,value:[{name:"PrivateKeyInfo.version",tagClass:o.asn1.Class.UNIVERSAL,type:o.asn1.Type.INTEGER,constructed:!1,capture:"keyVersion"},{name:"PrivateKeyInfo.privateKeyAlgorithm",tagClass:o.asn1.Class.UNIVERSAL,type:o.asn1.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:o.asn1.Class.UNIVERSAL,type:o.asn1.Type.OID,constructed:!1,capture:"keyOid"},{name:"AlgorithmIdentifier.parameters",captureAsn1:"keyParams"}]},{name:"PrivateKeyInfo",tagClass:o.asn1.Class.UNIVERSAL,type:o.asn1.Type.OCTETSTRING,constructed:!1,capture:"keyValue"}]},u={name:"SubjectPublicKeyInfo",tagClass:o.asn1.Class.UNIVERSAL,type:o.asn1.Type.SEQUENCE,constructed:!0,value:[{name:"SubjectPublicKeyInfo.AlgorithmIdentifier",tagClass:o.asn1.Class.UNIVERSAL,type:o.asn1.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:o.asn1.Class.UNIVERSAL,type:o.asn1.Type.OID,constructed:!1,capture:"keyOid"},{name:"AlgorithmIdentifier.parameters",captureAsn1:"keyParams"}]},{name:"SubjectPublicKeyInfo.subjectPublicKey",tagClass:o.asn1.Class.UNIVERSAL,type:o.asn1.Type.BITSTRING,constructed:!1,capture:"keyValue"}]},h={name:"Certificate",tagClass:o.asn1.Class.UNIVERSAL,type:o.asn1.Type.SEQUENCE,constructed:!0,value:[{name:"Certificate.TBSCertificate",tagClass:o.asn1.Class.UNIVERSAL,type:o.asn1.Type.SEQUENCE,constructed:!0,captureAsn1:"certificate",value:[{name:"Certificate.TBSCertificate.version",tagClass:o.asn1.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,value:[{name:"Certificate.TBSCertificate.version.integer",tagClass:o.asn1.Class.UNIVERSAL,type:o.asn1.Type.INTEGER,constructed:!1,capture:"certVersion"}]},{name:"Certificate.TBSCertificate.serialNumber",tagClass:o.asn1.Class.UNIVERSAL,type:o.asn1.Type.INTEGER,constructed:!1,capture:"certSerialNumber"},{name:"Certificate.TBSCertificate.signature",tagClass:o.asn1.Class.UNIVERSAL,type:o.asn1.Type.SEQUENCE,constructed:!0,value:[{name:"Certificate.TBSCertificate.signature.algorithm",tagClass:o.asn1.Class.UNIVERSAL,type:o.asn1.Type.OID,constructed:!1,capture:"certSignatureOid"},{name:"Certificate.TBSCertificate.signature.parameters",tagClass:o.asn1.Class.UNIVERSAL,optional:!0,captureAsn1:"certSignatureParams"}]},{name:"Certificate.TBSCertificate.issuer",tagClass:o.asn1.Class.UNIVERSAL,type:o.asn1.Type.SEQUENCE,constructed:!0,captureAsn1:"certIssuer"},{name:"Certificate.TBSCertificate.validity",tagClass:o.asn1.Class.UNIVERSAL,type:o.asn1.Type.SEQUENCE,constructed:!0,value:[{name:"Certificate.TBSCertificate.validity.notBefore (utc)",tagClass:o.asn1.Class.UNIVERSAL,type:o.asn1.Type.UTCTIME,constructed:!1,optional:!0,capture:"certValidity1UTCTime"},{name:"Certificate.TBSCertificate.validity.notBefore (generalized)",tagClass:o.asn1.Class.UNIVERSAL,type:o.asn1.Type.GENERALIZEDTIME,constructed:!1,optional:!0,capture:"certValidity2GeneralizedTime"},{name:"Certificate.TBSCertificate.validity.notAfter (utc)",tagClass:o.asn1.Class.UNIVERSAL,type:o.asn1.Type.UTCTIME,constructed:!1,optional:!0,capture:"certValidity3UTCTime"},{name:"Certificate.TBSCertificate.validity.notAfter (generalized)",tagClass:o.asn1.Class.UNIVERSAL,type:o.asn1.Type.GENERALIZEDTIME,constructed:!1,optional:!0,capture:"certValidity4GeneralizedTime"}]},{name:"Certificate.TBSCertificate.subject",tagClass:o.asn1.Class.UNIVERSAL,type:o.asn1.Type.SEQUENCE,constructed:!0,captureAsn1:"certSubject"},u,{name:"Certificate.TBSCertificate.issuerUniqueID",tagClass:o.asn1.Class.CONTEXT_SPECIFIC,type:1,constructed:!0,optional:!0,value:[{name:"Certificate.TBSCertificate.issuerUniqueID.id",tagClass:o.asn1.Class.UNIVERSAL,type:o.asn1.Type.BITSTRING,constructed:!1,capture:"certIssuerUniqueId"}]},{name:"Certificate.TBSCertificate.subjectUniqueID",tagClass:o.asn1.Class.CONTEXT_SPECIFIC,type:2,constructed:!0,optional:!0,value:[{name:"Certificate.TBSCertificate.subjectUniqueID.id",tagClass:o.asn1.Class.UNIVERSAL,type:o.asn1.Type.BITSTRING,constructed:!1,capture:"certSubjectUniqueId"}]},{name:"Certificate.TBSCertificate.extensions",tagClass:o.asn1.Class.CONTEXT_SPECIFIC,type:3,constructed:!0,captureAsn1:"certExtensions",optional:!0}]},{name:"Certificate.signatureAlgorithm",tagClass:o.asn1.Class.UNIVERSAL,type:o.asn1.Type.SEQUENCE,constructed:!0,value:[{name:"Certificate.signatureAlgorithm.algorithm",tagClass:o.asn1.Class.UNIVERSAL,type:o.asn1.Type.OID,constructed:!1,capture:"certSignatureOid"},{name:"Certificate.TBSCertificate.signature.parameters",tagClass:o.asn1.Class.UNIVERSAL,optional:!0,captureAsn1:"certSignatureParams"}]},{name:"Certificate.signatureValue",tagClass:o.asn1.Class.UNIVERSAL,type:o.asn1.Type.BITSTRING,constructed:!1,capture:"certSignature"}]},c={THUMBPRINT_KEY:"internal\0thumbprint",THUMBPRINT_HASH:"SHA-256"};t.exports={validators:{privateKey:a,publicKey:u,certificate:h},thumbprint:function(t,e,r){if("function"!=typeof t.thumbprint)return Promise.reject(new Error("thumbprint not supported"));r=(r||c.THUMBPRINT_HASH).toUpperCase();var i=t.thumbprint(e),o=Object.keys(i).sort().map((function(t){var e=i[t];return Buffer.isBuffer(e)&&(e=n.base64url.encode(e)),JSON.stringify(t)+":"+JSON.stringify(e)}));o="{"+o.join(",")+"}";try{return s.digest(r,Buffer.from(o,"utf8"))}catch(t){return Promise.reject(t)}},unpackProps:function(t,e){var r;e.forEach((function(e){if(e.name in t){r=r||{};var o=t[e.name];switch(e.type){case"binary":Buffer.isBuffer(o)?t[e.name]=n.base64url.encode(o):o=n.base64url.decode(o);break;case"string":case"number":case"boolean":break;case"array":o=[].concat(o);break;case"object":o=i(o)}r[e.name]=o}}));var o=r||{};return Object.keys(t).forEach((function(e){e in o||delete t[e]})),r},COMMON_PROPS:[{name:"kty",type:"string"},{name:"kid",type:"string"},{name:"use",type:"string"},{name:"alg",type:"string"},{name:"x5c",type:"array"},{name:"x5t",type:"binary"},{name:"x5u",type:"string"},{name:"key_ops",type:"array"}],INTERNALS:c}},32543:(t,e,r)=>{"use strict";var i=r(4567);Object.keys(i.KeyStore).forEach((function(t){e[t]=i.KeyStore[t]}));var n=r(26395);Object.keys(n).forEach((function(t){e[t]=n[t]})),r(29170),r(29746),r(15339)},4567:(t,e,r)=>{"use strict";var i=r(66678),n=r(85029),o=r(41194),s=r(44237),a={BaseKey:r(57136),helpers:r(49684)},u=function(){var t={};Object.defineProperty(this,"register",{value:function(e){if(!e||"string"!=typeof e.kty||!e.kty)throw new Error("invalid Key factory");var r=e.kty;return t[r]=e,this}}),Object.defineProperty(this,"unregister",{value:function(e){if(!e||"string"!=typeof e.kty||!e.kty)throw new Error("invalid Key factory");var r=e.kty;return e===t[r]&&delete t[r],this}}),Object.defineProperty(this,"get",{value:function(e){return t[e||""]||void 0}}),Object.defineProperty(this,"all",{value:function(){return Object.keys(t).map((function(e){return t[e]}))}})},h=new u;var c=function(t,e){var r={};Object.defineProperty(this,"generate",{value:function(e,r,o){var s=t.get(e);if(!s)return Promise.reject(new Error("unsupported key type"));(o=i(o||{})).kty=e;var a=this;return s.generate(r).then((function(t){return t=n(o,t,{kty:e}),a.add(t)}))}}),Object.defineProperty(this,"add",{value:function(e,n,u){var f;if(u=u||{},Buffer.isBuffer(e)||"string"==typeof e)if("json"===(n=(n||"json").toLowerCase()))e=JSON.parse(e.toString("utf8"));else try{if(f="pem"===n?function(t){var e={};if(!o.pem.decode(t).some((function(t){switch(t.type){case"CERTIFICATE":e.form="pkix";break;case"PUBLIC KEY":e.form="spki";break;case"PRIVATE KEY":e.form="pkcs8";break;case"EC PRIVATE KEY":case"RSA PRIVATE KEY":e.form="private";break;default:return!1}return e.body=t.body,!0})))throw new Error("supported PEM type not found");return e}(e):{body:e.toString("binary"),form:n},!(e=function(t,e){var r,i={},n=[],u=e.form,c=e.body,f=null;switch(e=o.asn1.fromDer(c),u){case"private":t.all().some((function(t){if(r)return!1;if(!t.validators)return!1;var s=t.validators.oid,a=t.validators.privateKey;return!!a&&(i={},n=[],(r=o.asn1.validate(e,a,i,n))&&(i.keyOid=o.asn1.oidToDer(s),i.parsed=!0),r)})),i.type="private";break;case"pkcs8":r=o.asn1.validate(e,a.helpers.validators.privateKey,i,n),i.type="private";break;case"public":case"spki":r=o.asn1.validate(e,a.helpers.validators.publicKey,i,n),i.type="public";break;case"pkix":case"x509":if(r=o.asn1.validate(e,a.helpers.validators.certificate,i,n)){i=function(t){return["certIssuer","certSubject"].forEach((function(e){var r=o.pki.RDNAttributesAsArray(t[e]),i=t[e]={};r.forEach((function(t){i[t.name||t.type]=t.value}))})),t}(i);var l=o.md.sha1.create();l.update(c),f=s.base64url.encode(Buffer.from(l.digest().toHex(),"hex"))}i.type="public"}return r?(i.keyOid&&(i.keyOid=o.asn1.derToOid(i.keyOid)),r=null,h.all().forEach((function(t){r||t&&"function"==typeof t.import&&(r=t.import(i))})),r&&i.certSubject&&i.certSubject.commonName&&(r.kid=i.certSubject.commonName),r&&f&&(r.x5t=f),r):null}(t,f)))throw new Error("no importer for key");Object.keys(u).forEach((function(t){e[t]=u[t]}))}catch(t){return Promise.reject(t)}else e=c.isKey(e)?e.toJSON(!0):i(e);var l=t.get(e.kty);if(!l)return Promise.reject(new Error("unsupported key type"));var d=this;return l.prepare(e).then((function(t){return new a.BaseKey(e.kty,d,e,t)})).then((function(t){var e=t.kid||"";return(r[e]=r[e]||[]).push(t),t}))}}),Object.defineProperty(this,"remove",{value:function(t){if(t){var e=r[t.kid];if(e){var i=e.indexOf(t);-1!==i&&(e.splice(i,1),e.length||delete r[t.kid])}}}}),Object.defineProperty(this,"all",{value:function(t,i){void 0!==(t=t||{}).kid&&null!==t.kid&&"string"!=typeof t.kid&&(t.kid=String(t.kid));var n=[],o=function(e){return(!t.kty||!e.kty||t.kty===e.kty)&&(!t.use||!e.use||t.use===e.use)&&(!t.alg||("dir"===t.alg||!e.alg||t.alg===e.alg)&&e.supports(t.alg))};return Object.keys(r).forEach((function(e){if(!t.kid||t.kid===e){var i=r[e].filter(o);i.length&&(n=n.concat(i))}})),!i&&e&&(n=n.concat(e.all(t))),n}}),Object.defineProperty(this,"get",{value:function(t,r,i){"boolean"==typeof t?(i=t,r=t=null):"object"==typeof t&&(i=r,r=t,t=null),r=r||{},t&&(r.kid=t),void 0!==r.kid&&null!==r.kid&&"string"!=typeof r.kid&&(r.kid=String(r.kid));var n=this.all(r,!0);return n.length||!e||i||(n=e.get(r,i)),n[0]||null}}),Object.defineProperty(this,"temp",{value:function(){return new c(t,this)}}),Object.defineProperty(this,"toJSON",{value:function(t){var e=[];return Object.keys(r).forEach((function(i){var n=r[i].map((function(e){return e.toJSON(t)}));e=e.concat(n)})),{keys:e}}})};c.isKeyStore=function(t){return!!t&&"object"==typeof t&&"function"==typeof t.get&&"function"==typeof t.all&&"function"==typeof t.generate&&"function"==typeof t.add&&"function"==typeof t.remove},c.createKeyStore=function(){return new c(h)},c.asKeyStore=function(t){if(c.isKeyStore(t))return Promise.resolve(t);var e,r=c.createKeyStore();if("string"==typeof t&&(t=JSON.parse(t)),Array.isArray(t))e=t;else{if(!("keys"in t))return Promise.reject(new Error("invalid keystore"));e=t.keys}e=e.map((function(t){return r.add(t)}));var i=Promise.all(e);return i.then((function(){return r}))},c.isKey=function(t){return!!t&&"object"==typeof t&&!!c.isKeyStore(t.keystore)&&"string"==typeof t.kty&&"number"==typeof t.length&&"function"==typeof t.algorithms&&"function"==typeof t.supports&&"function"==typeof t.encrypt&&"function"==typeof t.decrypt&&"function"==typeof t.wrap&&"function"==typeof t.unwrap&&"function"==typeof t.sign&&"function"==typeof t.verify},c.createKey=function(t,e,r){return c.createKeyStore().generate(t,e,r)},c.asKey=function(t,e,r){return c.isKey(t)?Promise.resolve(t):t=c.createKeyStore().add(t,e,r)},t.exports={KeyRegistry:u,KeyStore:c,registry:h}},29170:(t,e,r)=>{"use strict";var i=r(44237),n={BaseKey:r(57136),helpers:r(49684)},o=["HS256","HS384","HS512"],s=["A128GCM","A192GCM","A256GCM","A128CBC-HS256","A192CBC-HS384","A256CBC-HS512","A128CBC+HS256","A192CBC+HS384","A256CBC+HS512"],a=["A128KW","A192KW","A256KW","A128GCMKW","A192GCMKW","A256GCMKW","PBES2-HS256+A128KW","PBES2-HS384+A192KW","PBES2-HS512+A256KW","dir"];function u(t,e){return"iv"in e&&(e.iv=Buffer.isBuffer(e.iv)?e.iv:i.base64url.decode(e.iv||"")),"adata"in e&&(e.adata=Buffer.isBuffer(e.adata)?e.adata:Buffer.from(e.adata||"","utf8")),"mac"in e&&(e.mac=Buffer.isBuffer(e.mac)?e.mac:i.base64url.decode(e.mac||"")),"tag"in e&&(e.tag=Buffer.isBuffer(e.tag)?e.tag:i.base64url.decode(e.tag||"")),e}function h(t,e){return"iv"in e&&(e.iv=Buffer.isBuffer(e.iv)?e.iv:i.base64url.decode(e.iv||"")),"adata"in e&&(e.adata=Buffer.isBuffer(e.adata)?e.adata:Buffer.from(e.adata||"","utf8")),e}var c={publicKey:function(t){var e=n.helpers.COMMON_PROPS.concat([]);return n.helpers.unpackProps(t,e)},privateKey:function(t){var e,r=n.helpers.COMMON_PROPS.concat([{name:"k",type:"binary"}]);return(e=n.helpers.unpackProps(t,r))&&e.k?e.length=8*e.k.length:e=void 0,e},thumbprint:function(t){return t.private&&(t=t.private),{k:t.k||"",kty:"oct"}},algorithms:function(t,e){var r=t.private&&8*t.private.k.length,i=[256,384,512];if(!r)return[];switch(e){case"encrypt":case"decrypt":return s.filter((function(t){return t==="A"+r/2+"CBC-HS"+r||t==="A"+r/2+"CBC+HS"+r||t==="A"+r+"GCM"}));case"sign":case"verify":return o.filter((function(t){var e=!1;return i.forEach((function(i){i>r||(e|=t==="HS"+i)})),e}));case"wrap":case"unwrap":return a.filter((function(t){return t==="A"+r+"KW"||t==="A"+r+"GCMKW"||0===t.indexOf("PBES2-")||"dir"===t}))}return[]},encryptKey:function(t,e){return e.private&&e.private.k},encryptProps:h,decryptKey:function(t,e){return e.private&&e.private.k},decryptProps:u,wrapKey:function(t,e){return e.private&&e.private.k},wrapProps:h,unwrapKey:function(t,e){return e.private&&e.private.k},unwrapProps:u,signKey:function(t,e){return e.private&&e.private.k},verifyKey:function(t,e){return e.private&&e.private.k}},f={kty:"oct",prepare:function(t){var e=c,r=Promise.resolve(t);return(r=r.then((function(t){return n.helpers.thumbprint(e,t)}))).then((function(r){var i={};return i[n.helpers.INTERNALS.THUMBPRINT_HASH]=r,t[n.helpers.INTERNALS.THUMBPRINT_KEY]=i,e}))},generate:function(t){var e=i.randomBytes(t/8);return Promise.resolve({k:e})}};t.exports=Object.freeze({config:c,factory:f}),r(4567).registry.register(f)},29746:(t,e,r)=>{"use strict";var i=r(41194),n=r(78501),o=r(83748).nodeCrypto,s={BaseKey:r(57136),helpers:r(49684)},a=["RS256","RS384","RS512","PS256","PS384","PS512"],u=["RSA-OAEP","RSA-OAEP-256","RSA1_5"],h={publicKey:function(t){var e,r=s.helpers.COMMON_PROPS.concat([{name:"n",type:"binary"},{name:"e",type:"binary"}]);return(e=s.helpers.unpackProps(t,r))&&e.n&&e.e?e.length=8*e.n.length:(delete e.e,delete e.n),e},privateKey:function(t){var e,r=s.helpers.COMMON_PROPS.concat([{name:"n",type:"binary"},{name:"e",type:"binary"},{name:"d",type:"binary"},{name:"p",type:"binary"},{name:"q",type:"binary"},{name:"dp",type:"binary"},{name:"dq",type:"binary"},{name:"qi",type:"binary"}]);return(e=s.helpers.unpackProps(t,r))&&e.d&&e.n&&e.e&&e.p&&e.q&&e.dp&&e.dq&&e.qi?e.length=8*e.d.length:e=void 0,e},thumbprint:function(t){return t.public&&(t=t.public),{e:t.e,kty:"RSA",n:t.n}},algorithms:function(t,e){switch(e){case"encrypt":case"decrypt":return[];case"wrap":return t.public&&u.slice()||[];case"unwrap":return t.private&&u.slice()||[];case"sign":return t.private&&a.slice()||[];case"verify":return t.public&&a.slice()||[]}return[]},wrapKey:function(t,e){return e.public},unwrapKey:function(t,e){return e.private},signKey:function(t,e){return e.private},verifyKey:function(t,e){return e.public},convertToPEM:function(t,e){var r=n.convertToForge(t,!e);return e?i.pki.privateKeyToPem(r):i.pki.publicKeyToPem(r)}},c={oid:"1.2.840.113549.1.1.1",privateKey:{name:"RSAPrivateKey",tagClass:i.asn1.Class.UNIVERSAL,type:i.asn1.Type.SEQUENCE,constructed:!0,value:[{name:"RSAPrivateKey.version",tagClass:i.asn1.Class.UNIVERSAL,type:i.asn1.Type.INTEGER,constructed:!1,capture:"version"},{name:"RSAPrivateKey.modulus",tagClass:i.asn1.Class.UNIVERSAL,type:i.asn1.Type.INTEGER,constructed:!1,capture:"n"},{name:"RSAPrivateKey.publicExponent",tagClass:i.asn1.Class.UNIVERSAL,type:i.asn1.Type.INTEGER,constructed:!1,capture:"e"},{name:"RSAPrivateKey.privateExponent",tagClass:i.asn1.Class.UNIVERSAL,type:i.asn1.Type.INTEGER,constructed:!1,capture:"d"},{name:"RSAPrivateKey.prime1",tagClass:i.asn1.Class.UNIVERSAL,type:i.asn1.Type.INTEGER,constructed:!1,capture:"p"},{name:"RSAPrivateKey.prime2",tagClass:i.asn1.Class.UNIVERSAL,type:i.asn1.Type.INTEGER,constructed:!1,capture:"q"},{name:"RSAPrivateKey.exponent1",tagClass:i.asn1.Class.UNIVERSAL,type:i.asn1.Type.INTEGER,constructed:!1,capture:"dp"},{name:"RSAPrivateKey.exponent2",tagClass:i.asn1.Class.UNIVERSAL,type:i.asn1.Type.INTEGER,constructed:!1,capture:"dq"},{name:"RSAPrivateKey.coefficient",tagClass:i.asn1.Class.UNIVERSAL,type:i.asn1.Type.INTEGER,constructed:!1,capture:"qi"}]},publicKey:{name:"RSAPublicKey",tagClass:i.asn1.Class.UNIVERSAL,type:i.asn1.Type.SEQUENCE,constructed:!0,value:[{name:"RSAPublicKey.modulus",tagClass:i.asn1.Class.UNIVERSAL,type:i.asn1.Type.INTEGER,constructed:!1,capture:"n"},{name:"RSAPublicKey.exponent",tagClass:i.asn1.Class.UNIVERSAL,type:i.asn1.Type.INTEGER,constructed:!1,capture:"e"}]}},f={kty:"RSA",validators:c,prepare:function(t){var e=h,r=Promise.resolve(t);return(r=r.then((function(t){return s.helpers.thumbprint(e,t)}))).then((function(r){var i={};return i[s.helpers.INTERNALS.THUMBPRINT_HASH]=r,t[s.helpers.INTERNALS.THUMBPRINT_KEY]=i,e}))},generate:function(t){var e;if(o)e=new Promise((function(e,r){i.pki.rsa.generateKeyPair({bits:t,e:65537},(function(t,i){if(t)return r(t);e(i.privateKey)}))}));else{var r=i.pki.rsa.generateKeyPair({bits:t,e:65537});e=Promise.resolve(r.privateKey)}return e.then((function(t){var e={};return["e","n","d","p","q",{incoming:"dP",outgoing:"dp"},{incoming:"dQ",outgoing:"dq"},{incoming:"qInv",outgoing:"qi"}].forEach((function(r){var i,n,o;"string"==typeof r?i=n=r:(i=r.incoming,n=r.outgoing),i in t&&(e[n]=((o=(o=t[i]).toString(16)).length%2&&(o="0"+o),Buffer.from(o,"hex")))})),e}))},import:function(t){if(c.oid!==t.keyOid)return null;if(!t.parsed){"string"==typeof t.keyValue?t.keyValue=i.asn1.fromDer(t.keyValue):Array.isArray(t.keyValue)&&(t.keyValue=t.keyValue[0]);var e="private"===t.type?c.privateKey:c.publicKey,r={};if(!i.asn1.validate(t.keyValue,e,r,[]))return null;t=r}var n={kty:"RSA"};return["n","e","d","p","q","dp","dq","qi"].forEach((function(e){if(e in t){var r=Buffer.from(t[e],"binary");0===r[0]&&(r=r.slice(1)),n[e]=r}})),n}};t.exports=Object.freeze({config:h,factory:f}),r(4567).registry.register(f)},46589:t=>{"use strict";t.exports={compact:!1,protect:"*"}},97286:t=>{"use strict";t.exports={slice:function(t,e){return Array.prototype.slice.call(t,e||0)}}},32109:(t,e,r)=>{"use strict";var i={createSign:r(54873).createSign,createVerify:r(58747).createVerify};t.exports=i},54873:(t,e,r)=>{"use strict";var i=r(85029),n=r(44237),o=r(32543),s=r(97286).slice,a=r(66678),u=r(44908),h=r(46589),c=function(t,e){var r=!1,i=t.format||"general",o=Buffer.alloc(0);Object.defineProperty(this,"compact",{get:function(){return"compact"===i},enumerable:!0}),Object.defineProperty(this,"format",{get:function(){return i},enumerable:!0}),Object.defineProperty(this,"update",{value:function(t,e){if(r)throw new Error("already final");return null!=t&&(t=n.asBuffer(t,e),o=o.length?Buffer.concat([o,t],o.length+t.length):t),this}}),Object.defineProperty(this,"final",{value:function(t,s){if(r)return Promise.reject(new Error("already final"));var u;switch(this.update(t,s),r=!0,u=(u=(u=Promise.all(e)).then((function(t){return o=n.base64url.encode(o),t=t.map((function(t){var e={},r=0,i=a(t.header),s=Object.keys(i).length;t.protected.forEach((function(t){t in i&&(e[t]=i[t],r++,delete i[t],s--)})),r>0?(e=JSON.stringify(e),e=n.base64url.encode(e)):e="";var u=Buffer.from(e+"."+o,"ascii");return(t=t.key.sign(t.header.alg,u,t.header)).then((function(t){var o={};return 0<r&&(o.protected=e),0<s&&(o.header=i),o.signature=n.base64url.encode(t.mac),o}))})),t=[Promise.resolve(o)].concat(t),Promise.all(t)}))).then((function(t){return{payload:t[0],signatures:t.slice(1)}})),i){case"compact":u=u.then((function(t){var e=[t.signatures[0].protected,t.payload,t.signatures[0].signature];return e.join(".")}));break;case"flattened":u=u.then((function(t){var e={};e.payload=t.payload;var r=t.signatures[0];return r.protected&&(e.protected=r.protected),r.header&&(e.header=r.header),e.signature=r.signature,e}))}return u}})};t.exports={signer:c,createSign:function(t,e){var r=t,n=1,f=e;if(0===arguments.length)throw new Error("at least one signatory must be provided");1===arguments.length||o.isKey(t)||t&&"kty"in t||t&&"key"in t&&(o.isKey(t.key)||"kty"in t.key)?(f=t,n=0,r={}):r=a(t),Array.isArray(f)||(f=s(arguments,n));var l=(r=i(a(h),r)).fields||{},d=r.format;if(d||(d=r.compact?"compact":"general"),("compact"===d||"flattened"===d)&&1<f.length)throw new Error("too many signatories for compact or flattened JSON serialization");var p="*"===r.protect;r.compact&&(p=!0),f=f.map((function(t,e){return(t&&"kty"in t?o.asKey(t).then((function(t){return{key:t}})):t?o.asKey(t.key).then((function(e){return{header:t.header,reference:t.reference,protect:t.protect,key:e}})):Promise.reject(new Error("missing key for signatory "+e))).then((function(t){var e=t.key,r=t.header||{};r=i(i({},l),r),t.header=r,r.alg||(r.alg=e.algorithms(o.MODE_SIGN)[0]||"");var n,s=t.reference;if(delete t.reference,void 0===s?s=(s=["kid","jku","x5c","x5t","x5u"].some((function(t){return t in r})))?null:"kid":"boolean"==typeof s&&(s=s?"kid":null),s)if(n=e.toJSON(),"jwk"===s){if("oct"===e.kty)return Promise.reject(new Error("cannot embed key"));r.jwk=n}else s in n&&(r[s]=n[s]);var a=t.protect;if(p||"*"===a)a=Object.keys(r);else if("string"===a)a=[a];else if(Array.isArray(a))a=a.concat();else{if(a)return Promise.reject(new Error("protect must be a list of fields"));a=[]}return a=u(a),t.protected=a,Object.freeze(t)}))}));var g={format:d};return new c(g,f)}}},58747:(t,e,r)=>{"use strict";var i=r(66678),n=r(85029),o=r(9752),s=r(63171),a=r(32543),u={algorithms:"*",allowEmbeddedKey:!1},h=function(t,e){var r,h;h=a.isKey(t)?(r=t).keystore:a.isKeyStore(t)?t:a.createKeyStore(),e=n(u,e),Object.defineProperty(this,"defaultKey",{value:r||void 0,enumerable:!0}),Object.defineProperty(this,"keystore",{value:h,enumerable:!0}),Object.defineProperty(this,"verify",{value:function(t,u){var c=(u=n({},e,u||{})).handlers||{},f=Object.keys(c),l=new s(u.algorithms);if("string"==typeof t)t={payload:(t=t.split("."))[1],signatures:[{protected:t[0],signature:t[2]}]};else if(!t||"object"!=typeof t)throw new Error("invalid input");t.signature&&(t.signatures=[{protected:t.protected||void 0,header:t.header||void 0,signature:t.signature}]);var d=t.signatures||[{}];d=d.map((function(t){var e=i(t.header||{}),r=t.protected?JSON.parse(o.decode(t.protected,"utf8")):{};e=n(e,r);var s=o.decode(t.signature);if(!l.match(e.alg))return Promise.reject(new Error("Algorithm not allowed: "+e.alg));var a=r.crit;if(a){if(!Array.isArray(a))return Promise.reject(new Error("Invalid 'crit' header"));for(var u=0;a.length>u;u++)if(-1===f.indexOf(a[u]))return Promise.reject(new Error("Critical extension is not supported: "+a[u]))}return r=Object.keys(r),Promise.resolve({protected:r,aad:t.protected||"",header:e,signature:s})}));var p=Promise.all(d);return p.then((function(e){return new Promise((function(i,s){var l=function(){var d=e.shift();if(d){d=n({},d,{payload:t.payload});var p=Promise.resolve(d);(p=(p=(p=(p=(p=(p=p.then((function(t){var e;return u.allowEmbeddedKey&&t.header.jwk?e=a.asKey(t.header.jwk):u.allowEmbeddedKey&&t.header.x5c?(e=t.header.x5c[0],e=Buffer.from(e,"base64"),e=a.asKey(e,"pkix")):e=Promise.resolve(r||h.get({use:"sig",alg:t.header.alg,kid:t.header.kid})),e.then((function(e){return e?(t.key=e,t):Promise.reject(new Error("key does not match"))}))}))).then((function(t){var e=[];return f.forEach((function(r){var i;"function"==typeof(r=c[r])?i=r(t):"object"==typeof r&&"function"==typeof r.prepare&&(i=r.prepare(t)),i&&e.push(Promise.resolve(i))})),Promise.all(e).then((function(){return t}))}))).then((function(t){var e=t.aad||"",r=t.payload||"",i=Buffer.alloc(1+e.length+r.length),n=0;return i.write(e,n,"ascii"),n+=e.length,i.write(".",n,"ascii"),n++,Buffer.isBuffer(r)?r.copy(i,n):i.write(r,n,"binary"),t.content=i,t}))).then((function(t){return t.key.verify(t.header.alg,t.content,t.signature)}))).then((function(t){var e=d.payload;return e=o.decode(e),{protected:d.protected,header:d.header,payload:e,signature:t.mac,key:d.key}}))).then((function(t){var e=[];return f.forEach((function(r){var i;"object"==typeof(r=c[r])&&"function"==typeof r.complete&&(i=r.complete(t)),i&&e.push(Promise.resolve(i))})),Promise.all(e).then((function(){return t}))}))).then(i,l)}else s(new Error("no key found"))};l()}))}))}})};t.exports={verifier:h,createVerify:function(t,e){return new h(t,e)}}},92393:(t,e,r)=>{"use strict";var i={JWE:r(30701),JWS:r(32109),util:r(44237)};t.exports=function(t){var e,r,n,o=t.split(".");if(3===o.length)e="JWS",r=function(e,r){return i.JWS.createVerify(e).verify(t,r)};else{if(5!==o.length)throw new TypeError("invalid jose serialization");e="JWE",r=function(e,r){return i.JWE.createDecrypt(e).decrypt(t,r)}}return n=i.util.base64url.decode(o[0],"utf8"),n=JSON.parse(n),{type:e,format:"compact",input:t,header:n,perform:r}}},48650:(t,e,r)=>{"use strict";var i=r(92393),n=r(94631),o=t.exports=function(t){if(Buffer.isBuffer(t))return i(t.toString("ascii"));if("string"==typeof t)return i(t);if(t)return n(t);throw new TypeError("invalid input")};o.compact=i,o.json=n},94631:(t,e,r)=>{"use strict";var i=r(85029),n={JWE:r(30701),JWS:r(32109),util:r(44237)};t.exports=function(t){var e,r,o;if("signatures"in t||"signature"in t)e="JWS",r=function(e,r){return n.JWS.createVerify(e).verify(t,r)},o=(o=t.signatures||[{protected:t.protected,header:t.header,signature:t.signature}]).map((function(t){var e,r={};return t.header&&(r=i(r,t.header)),t.protected&&(e=t.protected,e=n.util.base64url.decode(e,"utf8"),e=JSON.parse(e),r=i(r,e)),r}));else if("ciphertext"in t){e="JWE",r=function(e,r){return n.JWE.createDecrypt(e).decrypt(t,r)};var s={};t.protected&&(s.protected=t.protected,s.protected=n.util.base64url.decode(s.protected,"utf8"),s.protected=JSON.parse(s.protected)),t.unprotected&&(s.unprotected=t.unprotected),o=(o=t.recipients||[{}]).map((function(t){var e={};return t.header&&(e=i(e,t.header)),s.unprotected&&(e=i(e,s.unprotected)),s.protected&&(e=i(e,s.protected)),e}))}return{type:e,format:"json",input:t,all:o,perform:r}}},63171:t=>{"use strict";function e(t){return t.replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}t.exports=function(t){t?"string"==typeof t&&(t=t.split(" ")):t=[];var r,i=[],n=[],o=[],s=[],a=/^(!)?([^*]*)(\*?)([^*]*)$/;t.forEach((function(t){if(t){a.lastIndex=0;var u=a.exec(t);u&&(r="("+function(t,r,i){var n=[];return n.push("^"),t&&(t=e(t),n.push(t)),r&&n.push(t||i?".*":".+"),i&&(i=e(i),n.push(i)),n.push("$"),n.join("")}(u[2],u[3],u[4])+")",u[1]?(s.push(r),n.push(u[0])):(o.push(r),i.push(u[0])))}})),o=o.length?new RegExp(o.join("|")):null,s=s.length?new RegExp(s.join("|")):null,i.length||(i=["*"]),Object.defineProperty(this,"spec",{value:i.join(" ")+" "+n.join(" "),enumerable:!0}),Object.defineProperty(this,"match",{value:function(t){var e=Boolean(t);return e&&o&&(o.lastIndex=0,e=o.test(t)),e&&s&&(s.lastIndex=0,e=!s.test(t)),e}})}},9752:(t,e,r)=>{"use strict";var i=r(45772),n={encode:function(t,e){return t instanceof ArrayBuffer&&(t=new Uint8Array(t)),Buffer.isBuffer(t)||(t=Buffer.from(t,e)),i.encode(t)},decode:i.toBuffer};t.exports=n},64678:(t,e,r)=>{"use strict";var i=r(41194),n=r(9752);function o(t,e){e=e||{},Buffer.isBuffer(t)?this.data=t:i.util.isArrayBuffer(t)?(t=new Uint8Array(t),this.data=Buffer.from(t)):i.util.isArrayBufferView(t)&&(t=new Uint8Array(t.buffer,t.byteOffset,t.byteLength),this.data=Buffer.from(t)),this.data&&(this.write=this.data.length,t=void 0),this.growSize=e.growSize||o.DEFAULT_GROW_SIZE,this.write=this.write||0,this.read=this.read||0,t?this.putBytes(t):this.data||this.accommodate(0),e.readOffset="readOffset"in e?e.readOffset:this.read,this.write="writeOffset"in e?e.writeOffset:this.write,this.read=Math.min(e.readOffset,this.write)}o.DEFAULT_GROW_SIZE=16,o.prototype.length=function(){return this.write-this.read},o.prototype.available=function(){return this.data.length-this.write},o.prototype.isEmpty=function(){return this.length()<=0},o.prototype.accommodate=function(t){if(this.data){if(this.available()<t){t=Math.max(t,this.growSize);var e=this.data,r=Buffer.alloc(e.length+t);e.copy(r,0),this.data=r}}else t=Math.max(this.write+t,this.growSize),this.data=Buffer.alloc(t);return this.data.fill(0,this.write),this},o.prototype.clear=function(){return this.read=this.write=0,this.data=Buffer.alloc(0),this},o.prototype.truncate=function(t){return this.write=this.read+Math.max(0,this.length()-t),this.data.fill(0,this.write),this},o.prototype.compact=function(){return this.read>0&&(this.write===this.read?this.read=this.write=0:(this.data.copy(this.data,0,this.read,this.write),this.write=this.write-this.read,this.read=0),this.data.fill(0,this.write)),this},o.prototype.copy=function(){return new o(this,{readOffset:this.read,writeOffset:this.write,growSize:this.growSize})},o.prototype.equals=function(t){if(!o.isBuffer(t))return!1;if(t.length()!==this.length())return!1;for(var e=!0,r=this.read-t.read,i=t.read;t.write>i;i++)e=e&&this.data[i+r]===t.data[i];return e},o.prototype.at=function(t){return this.data[this.read+t]},o.prototype.setAt=function(t,e){return this.data[this.read+t]=e,this},o.prototype.last=function(){return this.data[this.write-1]},o.prototype.bytes=function(t){var e;if(void 0===t?t=this.length():t&&(t=Math.min(t,this.length())),0===t)e="";else{var r=this.read,i=r+t,n=this.data.slice(r,i);e=String.fromCharCode.apply(null,n)}return e},o.prototype.buffer=function(t){var e;if(void 0===t?t=this.length():t&&(t=Math.min(t,this.length())),0===t)e=new ArrayBuffer(0);else{var r=this.read,i=r+t,n=this.data.slice(r,i);(e=new Uint8Array(i-r)).set(n)}return e},o.prototype.native=function(t){var e;if(void 0===t?t=this.length():t&&(t=Math.min(t,this.length())),0===t)e=Buffer.alloc(0);else{var r=this.read,i=r+t;e=this.data.slice(r,i)}return e},o.prototype.toHex=function(){return this.toString("hex")},o.prototype.toString=function(t){if(0===this.length())return"";var e=this.data.slice(this.read,this.write);switch(t=t||"utf8"){case"raw":return e.toString("binary");case"base64url":return n.encode(e);case"utf16":return e.toString("ucs2");default:return e.toString(t)}},o.prototype.fillWithByte=function(t,e){return e||(e=this.available()),this.accommodate(e),this.data.fill(t,this.write,this.write+e),this.write+=e,this},o.prototype.getBuffer=function(t){var e=this.buffer(t);return this.read+=e.byteLength,e},o.prototype.putBuffer=function(t){return this.putBytes(t)},o.prototype.getBytes=function(t){var e=this.bytes(t);return this.read+=e.length,e},o.prototype.putBytes=function(t,e){if("string"==typeof t){switch(e=e||"binary"){case"utf16":e="ucs-2";break;case"raw":e="binary";break;case"base64url":t=n.decode(t)}Buffer.isBuffer(t)||(t=Buffer.from(t,e))}var r,s;if(t instanceof o){var a=t;t=a.data.slice(a.read,a.write),a.read=a.write}else t instanceof i.util.ByteStringBuffer&&(t=t.getBytes());if(Buffer.isBuffer(t))r=t;else if(Array.isArray(t))r=Buffer.from(t);else if(i.util.isArrayBuffer(t))r=new Uint8Array(t),r=Buffer.from(r);else{if(!i.util.isArrayBufferView(t))throw new TypeError("invalid source type");r=t instanceof Uint8Array?t:new Uint8Array(t.buffer,t.byteOffset,t.byteLength),r=Buffer.from(r)}return this.accommodate(r.length),s=this.data,r.copy(s,this.write),this.write+=r.length,this},o.prototype.getNative=function(t){var e=this.native(t);return this.read+=e.length,e},o.prototype.putNative=o.prototype.putBuffer,o.prototype.getByte=function(){var t=this.data[this.read];return this.read=Math.min(this.read+1,this.write),t},o.prototype.putByte=function(t){return this.accommodate(1),this.data[this.write]=255&t,this.write++,this},o.prototype.getInt16=function(){var t=this.data[this.read]<<8^this.data[this.read+1];return this.read=Math.min(this.read+2,this.write),t},o.prototype.putInt16=function(t){return this.accommodate(2),this.data[this.write]=t>>>8&255,this.data[this.write+1]=255&t,this.write+=2,this},o.prototype.getInt24=function(){var t=this.data[this.read]<<16^this.data[this.read+1]<<8^this.data[this.read+2];return this.read=Math.min(this.read+3,this.write),t},o.prototype.putInt24=function(t){return this.accommodate(3),this.data[this.write]=t>>>16&255,this.data[this.write+1]=t>>>8&255,this.data[this.write+2]=255&t,this.write+=3,this},o.prototype.getInt32=function(){var t=this.data[this.read]<<24^this.data[this.read+1]<<16^this.data[this.read+2]<<8^this.data[this.read+3];return this.read=Math.min(this.read+4,this.write),t},o.prototype.putInt32=function(t){return this.accommodate(4),this.data[this.write]=t>>>24&255,this.data[this.write+1]=t>>>16&255,this.data[this.write+2]=t>>>8&255,this.data[this.write+3]=255&t,this.write+=4,this},o.prototype.getInt16Le=function(){var t=this.data[this.read+1]<<8^this.data[this.read];return this.read=Math.min(this.read+2,this.write),t},o.prototype.putInt16Le=function(t){return this.accommodate(2),this.data[this.write+1]=t>>>8&255,this.data[this.write]=255&t,this.write+=2,this},o.prototype.getInt24Le=function(){var t=this.data[this.read+2]<<16^this.data[this.read+1]<<8^this.data[this.read];return this.read=Math.min(this.read+3,this.write),t},o.prototype.putInt24Le=function(t){return this.accommodate(3),this.data[this.write+2]=t>>>16&255,this.data[this.write+1]=t>>>8&255,this.data[this.write]=255&t,this.write+=3,this},o.prototype.getInt32Le=function(){var t=this.data[this.read+3]<<24^this.data[this.read+2]<<16^this.data[this.read+1]<<8^this.data[this.read];return this.read=Math.min(this.read+4,this.write),t},o.prototype.putInt32Le=function(t){return this.accommodate(4),this.data[this.write+3]=t>>>24&255,this.data[this.write+2]=t>>>16&255,this.data[this.write+1]=t>>>8&255,this.data[this.write]=255&t,this.write+=4,this},o.prototype.getInt=function(t){var e=0;do{e=e<<8|this.getByte(),t-=8}while(t>0);return e},o.prototype.putInt=function(t,e){this.accommodate(Math.ceil(e/8));do{e-=8,this.putByte(t>>e&255)}while(e>0);return this},o.prototype.putSignedInt=function(t,e){return t<0&&(t+=2<<e-1),this.putInt(t,e)},o.prototype.putString=function(t){return this.putBytes(t,"utf16")},o.isBuffer=function(t){return t instanceof o},o.asBuffer=function(t){return o.isBuffer(t)?t:t?new o(t):new o},t.exports=o},44237:(t,e,r)=>{"use strict";var i,n=r(41194);i={base64url:r(9752),utf8:r(68572),asBuffer:function(t,e){return Buffer.isBuffer(t)?t:"string"==typeof t?"base64url"===(e=e||"binary")?i.base64url.decode(t):Buffer.from(t,e):(n.util.isArrayBufferView(t)?t=t instanceof Uint8Array?t:new Uint8Array(t.buffer,t.byteOffset,t.byteOffset+t.byteLength):n.util.isArrayBuffer(t)&&(t=new Uint8Array(t)),Buffer.from(t))},randomBytes:function(t){return Buffer.from(n.random.getBytes(t),"binary")}},t.exports=i},85029:(t,e,r)=>{"use strict";var i,n=r(65544),o=r(82492),s=(i=[],"undefined"!=typeof Uint8ClampedArray&&i.push(Uint8ClampedArray),"undefined"!=typeof Uint8Array&&i.push(Uint8Array),"undefined"!=typeof Uint16Array&&i.push(Uint16Array),"undefined"!=typeof Uint32Array&&i.push(Uint32Array),"undefined"!=typeof Float32Array&&i.push(Float32Array),"undefined"!=typeof Float64Array&&i.push(Float64Array),i);t.exports=n(o,(function(t,e){if(Buffer.isBuffer(e))e=Buffer.from(e);else{var r=function(t){for(var e,r=0;!e&&s.length>r;r++)t instanceof s[r]&&(e=s[r]);return e}(e);e=r?new r(e,e.byteOffset,e.byteLength):void 0}return e}))},68572:(t,e)=>{"use strict";var r=e;r.encode=function(t){var e=encodeURIComponent(t||"");return e.replace(/%([0-9a-fA-F]{2})/g,(function(t,e){return e=parseInt(e,16),String.fromCharCode(e)}))},r.decode=function(t){var e=(t||"").replace(/[\u0080-\u00ff]/g,(function(t){return"%"+(256|t.charCodeAt(0)).toString(16).substring(1)}));return decodeURIComponent(e)}},14476:(t,e,r)=>{"use strict";var i=r(79742),n=r(80645),o="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;e.lW=u,e.h2=50;var s=2147483647;function a(t){if(t>s)throw new RangeError('The value "'+t+'" is invalid for option "size"');var e=new Uint8Array(t);return Object.setPrototypeOf(e,u.prototype),e}function u(t,e,r){if("number"==typeof t){if("string"==typeof e)throw new TypeError('The "string" argument must be of type string. Received type number');return f(t)}return h(t,e,r)}function h(t,e,r){if("string"==typeof t)return function(t,e){if("string"==typeof e&&""!==e||(e="utf8"),!u.isEncoding(e))throw new TypeError("Unknown encoding: "+e);var r=0|g(t,e),i=a(r),n=i.write(t,e);return n!==r&&(i=i.slice(0,n)),i}(t,e);if(ArrayBuffer.isView(t))return function(t){if(K(t,Uint8Array)){var e=new Uint8Array(t);return d(e.buffer,e.byteOffset,e.byteLength)}return l(t)}(t);if(null==t)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);if(K(t,ArrayBuffer)||t&&K(t.buffer,ArrayBuffer))return d(t,e,r);if("undefined"!=typeof SharedArrayBuffer&&(K(t,SharedArrayBuffer)||t&&K(t.buffer,SharedArrayBuffer)))return d(t,e,r);if("number"==typeof t)throw new TypeError('The "value" argument must not be of type number. Received type number');var i=t.valueOf&&t.valueOf();if(null!=i&&i!==t)return u.from(i,e,r);var n=function(t){if(u.isBuffer(t)){var e=0|p(t.length),r=a(e);return 0===r.length||t.copy(r,0,0,e),r}return void 0!==t.length?"number"!=typeof t.length||V(t.length)?a(0):l(t):"Buffer"===t.type&&Array.isArray(t.data)?l(t.data):void 0}(t);if(n)return n;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof t[Symbol.toPrimitive])return u.from(t[Symbol.toPrimitive]("string"),e,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t)}function c(t){if("number"!=typeof t)throw new TypeError('"size" argument must be of type number');if(t<0)throw new RangeError('The value "'+t+'" is invalid for option "size"')}function f(t){return c(t),a(t<0?0:0|p(t))}function l(t){for(var e=t.length<0?0:0|p(t.length),r=a(e),i=0;i<e;i+=1)r[i]=255&t[i];return r}function d(t,e,r){if(e<0||t.byteLength<e)throw new RangeError('"offset" is outside of buffer bounds');if(t.byteLength<e+(r||0))throw new RangeError('"length" is outside of buffer bounds');var i;return i=void 0===e&&void 0===r?new Uint8Array(t):void 0===r?new Uint8Array(t,e):new Uint8Array(t,e,r),Object.setPrototypeOf(i,u.prototype),i}function p(t){if(t>=s)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s.toString(16)+" bytes");return 0|t}function g(t,e){if(u.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||K(t,ArrayBuffer))return t.byteLength;if("string"!=typeof t)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof t);var r=t.length,i=arguments.length>2&&!0===arguments[2];if(!i&&0===r)return 0;for(var n=!1;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return U(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return j(t).length;default:if(n)return i?-1:U(t).length;e=(""+e).toLowerCase(),n=!0}}function y(t,e,r){var i=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return R(this,e,r);case"utf8":case"utf-8":return C(this,e,r);case"ascii":return I(this,e,r);case"latin1":case"binary":return T(this,e,r);case"base64":return A(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return B(this,e,r);default:if(i)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),i=!0}}function m(t,e,r){var i=t[e];t[e]=t[r],t[r]=i}function v(t,e,r,i,n){if(0===t.length)return-1;if("string"==typeof r?(i=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),V(r=+r)&&(r=n?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(n)return-1;r=t.length-1}else if(r<0){if(!n)return-1;r=0}if("string"==typeof e&&(e=u.from(e,i)),u.isBuffer(e))return 0===e.length?-1:b(t,e,r,i,n);if("number"==typeof e)return e&=255,"function"==typeof Uint8Array.prototype.indexOf?n?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):b(t,[e],r,i,n);throw new TypeError("val must be string, number or Buffer")}function b(t,e,r,i,n){var o,s=1,a=t.length,u=e.length;if(void 0!==i&&("ucs2"===(i=String(i).toLowerCase())||"ucs-2"===i||"utf16le"===i||"utf-16le"===i)){if(t.length<2||e.length<2)return-1;s=2,a/=2,u/=2,r/=2}function h(t,e){return 1===s?t[e]:t.readUInt16BE(e*s)}if(n){var c=-1;for(o=r;o<a;o++)if(h(t,o)===h(e,-1===c?0:o-c)){if(-1===c&&(c=o),o-c+1===u)return c*s}else-1!==c&&(o-=o-c),c=-1}else for(r+u>a&&(r=a-u),o=r;o>=0;o--){for(var f=!0,l=0;l<u;l++)if(h(t,o+l)!==h(e,l)){f=!1;break}if(f)return o}return-1}function w(t,e,r,i){r=Number(r)||0;var n=t.length-r;i?(i=Number(i))>n&&(i=n):i=n;var o=e.length;i>o/2&&(i=o/2);for(var s=0;s<i;++s){var a=parseInt(e.substr(2*s,2),16);if(V(a))return s;t[r+s]=a}return s}function _(t,e,r,i){return D(U(e,t.length-r),t,r,i)}function S(t,e,r,i){return D(function(t){for(var e=[],r=0;r<t.length;++r)e.push(255&t.charCodeAt(r));return e}(e),t,r,i)}function E(t,e,r,i){return D(j(e),t,r,i)}function M(t,e,r,i){return D(function(t,e){for(var r,i,n,o=[],s=0;s<t.length&&!((e-=2)<0);++s)i=(r=t.charCodeAt(s))>>8,n=r%256,o.push(n),o.push(i);return o}(e,t.length-r),t,r,i)}function A(t,e,r){return 0===e&&r===t.length?i.fromByteArray(t):i.fromByteArray(t.slice(e,r))}function C(t,e,r){r=Math.min(t.length,r);for(var i=[],n=e;n<r;){var o,s,a,u,h=t[n],c=null,f=h>239?4:h>223?3:h>191?2:1;if(n+f<=r)switch(f){case 1:h<128&&(c=h);break;case 2:128==(192&(o=t[n+1]))&&(u=(31&h)<<6|63&o)>127&&(c=u);break;case 3:o=t[n+1],s=t[n+2],128==(192&o)&&128==(192&s)&&(u=(15&h)<<12|(63&o)<<6|63&s)>2047&&(u<55296||u>57343)&&(c=u);break;case 4:o=t[n+1],s=t[n+2],a=t[n+3],128==(192&o)&&128==(192&s)&&128==(192&a)&&(u=(15&h)<<18|(63&o)<<12|(63&s)<<6|63&a)>65535&&u<1114112&&(c=u)}null===c?(c=65533,f=1):c>65535&&(c-=65536,i.push(c>>>10&1023|55296),c=56320|1023&c),i.push(c),n+=f}return function(t){var e=t.length;if(e<=k)return String.fromCharCode.apply(String,t);for(var r="",i=0;i<e;)r+=String.fromCharCode.apply(String,t.slice(i,i+=k));return r}(i)}u.TYPED_ARRAY_SUPPORT=function(){try{var t=new Uint8Array(1),e={foo:function(){return 42}};return Object.setPrototypeOf(e,Uint8Array.prototype),Object.setPrototypeOf(t,e),42===t.foo()}catch(t){return!1}}(),u.TYPED_ARRAY_SUPPORT||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(u.prototype,"parent",{enumerable:!0,get:function(){if(u.isBuffer(this))return this.buffer}}),Object.defineProperty(u.prototype,"offset",{enumerable:!0,get:function(){if(u.isBuffer(this))return this.byteOffset}}),u.poolSize=8192,u.from=function(t,e,r){return h(t,e,r)},Object.setPrototypeOf(u.prototype,Uint8Array.prototype),Object.setPrototypeOf(u,Uint8Array),u.alloc=function(t,e,r){return function(t,e,r){return c(t),t<=0?a(t):void 0!==e?"string"==typeof r?a(t).fill(e,r):a(t).fill(e):a(t)}(t,e,r)},u.allocUnsafe=function(t){return f(t)},u.allocUnsafeSlow=function(t){return f(t)},u.isBuffer=function(t){return null!=t&&!0===t._isBuffer&&t!==u.prototype},u.compare=function(t,e){if(K(t,Uint8Array)&&(t=u.from(t,t.offset,t.byteLength)),K(e,Uint8Array)&&(e=u.from(e,e.offset,e.byteLength)),!u.isBuffer(t)||!u.isBuffer(e))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(t===e)return 0;for(var r=t.length,i=e.length,n=0,o=Math.min(r,i);n<o;++n)if(t[n]!==e[n]){r=t[n],i=e[n];break}return r<i?-1:i<r?1:0},u.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},u.concat=function(t,e){if(!Array.isArray(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return u.alloc(0);var r;if(void 0===e)for(e=0,r=0;r<t.length;++r)e+=t[r].length;var i=u.allocUnsafe(e),n=0;for(r=0;r<t.length;++r){var o=t[r];if(K(o,Uint8Array))n+o.length>i.length?u.from(o).copy(i,n):Uint8Array.prototype.set.call(i,o,n);else{if(!u.isBuffer(o))throw new TypeError('"list" argument must be an Array of Buffers');o.copy(i,n)}n+=o.length}return i},u.byteLength=g,u.prototype._isBuffer=!0,u.prototype.swap16=function(){var t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var e=0;e<t;e+=2)m(this,e,e+1);return this},u.prototype.swap32=function(){var t=this.length;if(t%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var e=0;e<t;e+=4)m(this,e,e+3),m(this,e+1,e+2);return this},u.prototype.swap64=function(){var t=this.length;if(t%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var e=0;e<t;e+=8)m(this,e,e+7),m(this,e+1,e+6),m(this,e+2,e+5),m(this,e+3,e+4);return this},u.prototype.toString=function(){var t=this.length;return 0===t?"":0===arguments.length?C(this,0,t):y.apply(this,arguments)},u.prototype.toLocaleString=u.prototype.toString,u.prototype.equals=function(t){if(!u.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===u.compare(this,t)},u.prototype.inspect=function(){var t="",r=e.h2;return t=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(t+=" ... "),"<Buffer "+t+">"},o&&(u.prototype[o]=u.prototype.inspect),u.prototype.compare=function(t,e,r,i,n){if(K(t,Uint8Array)&&(t=u.from(t,t.offset,t.byteLength)),!u.isBuffer(t))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof t);if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===i&&(i=0),void 0===n&&(n=this.length),e<0||r>t.length||i<0||n>this.length)throw new RangeError("out of range index");if(i>=n&&e>=r)return 0;if(i>=n)return-1;if(e>=r)return 1;if(this===t)return 0;for(var o=(n>>>=0)-(i>>>=0),s=(r>>>=0)-(e>>>=0),a=Math.min(o,s),h=this.slice(i,n),c=t.slice(e,r),f=0;f<a;++f)if(h[f]!==c[f]){o=h[f],s=c[f];break}return o<s?-1:s<o?1:0},u.prototype.includes=function(t,e,r){return-1!==this.indexOf(t,e,r)},u.prototype.indexOf=function(t,e,r){return v(this,t,e,r,!0)},u.prototype.lastIndexOf=function(t,e,r){return v(this,t,e,r,!1)},u.prototype.write=function(t,e,r,i){if(void 0===e)i="utf8",r=this.length,e=0;else if(void 0===r&&"string"==typeof e)i=e,r=this.length,e=0;else{if(!isFinite(e))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");e>>>=0,isFinite(r)?(r>>>=0,void 0===i&&(i="utf8")):(i=r,r=void 0)}var n=this.length-e;if((void 0===r||r>n)&&(r=n),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");i||(i="utf8");for(var o=!1;;)switch(i){case"hex":return w(this,t,e,r);case"utf8":case"utf-8":return _(this,t,e,r);case"ascii":case"latin1":case"binary":return S(this,t,e,r);case"base64":return E(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return M(this,t,e,r);default:if(o)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),o=!0}},u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var k=4096;function I(t,e,r){var i="";r=Math.min(t.length,r);for(var n=e;n<r;++n)i+=String.fromCharCode(127&t[n]);return i}function T(t,e,r){var i="";r=Math.min(t.length,r);for(var n=e;n<r;++n)i+=String.fromCharCode(t[n]);return i}function R(t,e,r){var i=t.length;(!e||e<0)&&(e=0),(!r||r<0||r>i)&&(r=i);for(var n="",o=e;o<r;++o)n+=H[t[o]];return n}function B(t,e,r){for(var i=t.slice(e,r),n="",o=0;o<i.length-1;o+=2)n+=String.fromCharCode(i[o]+256*i[o+1]);return n}function x(t,e,r){if(t%1!=0||t<0)throw new RangeError("offset is not uint");if(t+e>r)throw new RangeError("Trying to access beyond buffer length")}function F(t,e,r,i,n,o){if(!u.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>n||e<o)throw new RangeError('"value" argument is out of bounds');if(r+i>t.length)throw new RangeError("Index out of range")}function P(t,e,r,i,n,o){if(r+i>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function N(t,e,r,i,o){return e=+e,r>>>=0,o||P(t,0,r,4),n.write(t,e,r,i,23,4),r+4}function O(t,e,r,i,o){return e=+e,r>>>=0,o||P(t,0,r,8),n.write(t,e,r,i,52,8),r+8}u.prototype.slice=function(t,e){var r=this.length;(t=~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),(e=void 0===e?r:~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),e<t&&(e=t);var i=this.subarray(t,e);return Object.setPrototypeOf(i,u.prototype),i},u.prototype.readUintLE=u.prototype.readUIntLE=function(t,e,r){t>>>=0,e>>>=0,r||x(t,e,this.length);for(var i=this[t],n=1,o=0;++o<e&&(n*=256);)i+=this[t+o]*n;return i},u.prototype.readUintBE=u.prototype.readUIntBE=function(t,e,r){t>>>=0,e>>>=0,r||x(t,e,this.length);for(var i=this[t+--e],n=1;e>0&&(n*=256);)i+=this[t+--e]*n;return i},u.prototype.readUint8=u.prototype.readUInt8=function(t,e){return t>>>=0,e||x(t,1,this.length),this[t]},u.prototype.readUint16LE=u.prototype.readUInt16LE=function(t,e){return t>>>=0,e||x(t,2,this.length),this[t]|this[t+1]<<8},u.prototype.readUint16BE=u.prototype.readUInt16BE=function(t,e){return t>>>=0,e||x(t,2,this.length),this[t]<<8|this[t+1]},u.prototype.readUint32LE=u.prototype.readUInt32LE=function(t,e){return t>>>=0,e||x(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},u.prototype.readUint32BE=u.prototype.readUInt32BE=function(t,e){return t>>>=0,e||x(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},u.prototype.readIntLE=function(t,e,r){t>>>=0,e>>>=0,r||x(t,e,this.length);for(var i=this[t],n=1,o=0;++o<e&&(n*=256);)i+=this[t+o]*n;return i>=(n*=128)&&(i-=Math.pow(2,8*e)),i},u.prototype.readIntBE=function(t,e,r){t>>>=0,e>>>=0,r||x(t,e,this.length);for(var i=e,n=1,o=this[t+--i];i>0&&(n*=256);)o+=this[t+--i]*n;return o>=(n*=128)&&(o-=Math.pow(2,8*e)),o},u.prototype.readInt8=function(t,e){return t>>>=0,e||x(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},u.prototype.readInt16LE=function(t,e){t>>>=0,e||x(t,2,this.length);var r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},u.prototype.readInt16BE=function(t,e){t>>>=0,e||x(t,2,this.length);var r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},u.prototype.readInt32LE=function(t,e){return t>>>=0,e||x(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},u.prototype.readInt32BE=function(t,e){return t>>>=0,e||x(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},u.prototype.readFloatLE=function(t,e){return t>>>=0,e||x(t,4,this.length),n.read(this,t,!0,23,4)},u.prototype.readFloatBE=function(t,e){return t>>>=0,e||x(t,4,this.length),n.read(this,t,!1,23,4)},u.prototype.readDoubleLE=function(t,e){return t>>>=0,e||x(t,8,this.length),n.read(this,t,!0,52,8)},u.prototype.readDoubleBE=function(t,e){return t>>>=0,e||x(t,8,this.length),n.read(this,t,!1,52,8)},u.prototype.writeUintLE=u.prototype.writeUIntLE=function(t,e,r,i){t=+t,e>>>=0,r>>>=0,i||F(this,t,e,r,Math.pow(2,8*r)-1,0);var n=1,o=0;for(this[e]=255&t;++o<r&&(n*=256);)this[e+o]=t/n&255;return e+r},u.prototype.writeUintBE=u.prototype.writeUIntBE=function(t,e,r,i){t=+t,e>>>=0,r>>>=0,i||F(this,t,e,r,Math.pow(2,8*r)-1,0);var n=r-1,o=1;for(this[e+n]=255&t;--n>=0&&(o*=256);)this[e+n]=t/o&255;return e+r},u.prototype.writeUint8=u.prototype.writeUInt8=function(t,e,r){return t=+t,e>>>=0,r||F(this,t,e,1,255,0),this[e]=255&t,e+1},u.prototype.writeUint16LE=u.prototype.writeUInt16LE=function(t,e,r){return t=+t,e>>>=0,r||F(this,t,e,2,65535,0),this[e]=255&t,this[e+1]=t>>>8,e+2},u.prototype.writeUint16BE=u.prototype.writeUInt16BE=function(t,e,r){return t=+t,e>>>=0,r||F(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=255&t,e+2},u.prototype.writeUint32LE=u.prototype.writeUInt32LE=function(t,e,r){return t=+t,e>>>=0,r||F(this,t,e,4,4294967295,0),this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t,e+4},u.prototype.writeUint32BE=u.prototype.writeUInt32BE=function(t,e,r){return t=+t,e>>>=0,r||F(this,t,e,4,4294967295,0),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},u.prototype.writeIntLE=function(t,e,r,i){if(t=+t,e>>>=0,!i){var n=Math.pow(2,8*r-1);F(this,t,e,r,n-1,-n)}var o=0,s=1,a=0;for(this[e]=255&t;++o<r&&(s*=256);)t<0&&0===a&&0!==this[e+o-1]&&(a=1),this[e+o]=(t/s>>0)-a&255;return e+r},u.prototype.writeIntBE=function(t,e,r,i){if(t=+t,e>>>=0,!i){var n=Math.pow(2,8*r-1);F(this,t,e,r,n-1,-n)}var o=r-1,s=1,a=0;for(this[e+o]=255&t;--o>=0&&(s*=256);)t<0&&0===a&&0!==this[e+o+1]&&(a=1),this[e+o]=(t/s>>0)-a&255;return e+r},u.prototype.writeInt8=function(t,e,r){return t=+t,e>>>=0,r||F(this,t,e,1,127,-128),t<0&&(t=255+t+1),this[e]=255&t,e+1},u.prototype.writeInt16LE=function(t,e,r){return t=+t,e>>>=0,r||F(this,t,e,2,32767,-32768),this[e]=255&t,this[e+1]=t>>>8,e+2},u.prototype.writeInt16BE=function(t,e,r){return t=+t,e>>>=0,r||F(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=255&t,e+2},u.prototype.writeInt32LE=function(t,e,r){return t=+t,e>>>=0,r||F(this,t,e,4,2147483647,-2147483648),this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24,e+4},u.prototype.writeInt32BE=function(t,e,r){return t=+t,e>>>=0,r||F(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},u.prototype.writeFloatLE=function(t,e,r){return N(this,t,e,!0,r)},u.prototype.writeFloatBE=function(t,e,r){return N(this,t,e,!1,r)},u.prototype.writeDoubleLE=function(t,e,r){return O(this,t,e,!0,r)},u.prototype.writeDoubleBE=function(t,e,r){return O(this,t,e,!1,r)},u.prototype.copy=function(t,e,r,i){if(!u.isBuffer(t))throw new TypeError("argument should be a Buffer");if(r||(r=0),i||0===i||(i=this.length),e>=t.length&&(e=t.length),e||(e=0),i>0&&i<r&&(i=r),i===r)return 0;if(0===t.length||0===this.length)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("Index out of range");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),t.length-e<i-r&&(i=t.length-e+r);var n=i-r;return this===t&&"function"==typeof Uint8Array.prototype.copyWithin?this.copyWithin(e,r,i):Uint8Array.prototype.set.call(t,this.subarray(r,i),e),n},u.prototype.fill=function(t,e,r,i){if("string"==typeof t){if("string"==typeof e?(i=e,e=0,r=this.length):"string"==typeof r&&(i=r,r=this.length),void 0!==i&&"string"!=typeof i)throw new TypeError("encoding must be a string");if("string"==typeof i&&!u.isEncoding(i))throw new TypeError("Unknown encoding: "+i);if(1===t.length){var n=t.charCodeAt(0);("utf8"===i&&n<128||"latin1"===i)&&(t=n)}}else"number"==typeof t?t&=255:"boolean"==typeof t&&(t=Number(t));if(e<0||this.length<e||this.length<r)throw new RangeError("Out of range index");if(r<=e)return this;var o;if(e>>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"==typeof t)for(o=e;o<r;++o)this[o]=t;else{var s=u.isBuffer(t)?t:u.from(t,i),a=s.length;if(0===a)throw new TypeError('The value "'+t+'" is invalid for argument "value"');for(o=0;o<r-e;++o)this[o+e]=s[o%a]}return this};var L=/[^+/0-9A-Za-z-_]/g;function U(t,e){var r;e=e||1/0;for(var i=t.length,n=null,o=[],s=0;s<i;++s){if((r=t.charCodeAt(s))>55295&&r<57344){if(!n){if(r>56319){(e-=3)>-1&&o.push(239,191,189);continue}if(s+1===i){(e-=3)>-1&&o.push(239,191,189);continue}n=r;continue}if(r<56320){(e-=3)>-1&&o.push(239,191,189),n=r;continue}r=65536+(n-55296<<10|r-56320)}else n&&(e-=3)>-1&&o.push(239,191,189);if(n=null,r<128){if((e-=1)<0)break;o.push(r)}else if(r<2048){if((e-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function j(t){return i.toByteArray(function(t){if((t=(t=t.split("=")[0]).trim().replace(L,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function D(t,e,r,i){for(var n=0;n<i&&!(n+r>=e.length||n>=t.length);++n)e[n+r]=t[n];return n}function K(t,e){return t instanceof e||null!=t&&null!=t.constructor&&null!=t.constructor.name&&t.constructor.name===e.name}function V(t){return t!=t}var H=function(){for(var t="0123456789abcdef",e=new Array(256),r=0;r<16;++r)for(var i=16*r,n=0;n<16;++n)e[i+n]=t[r]+t[n];return e}()},66071:(t,e,r)=>{var i=r(81769),n=r(39614),o=n;o.v1=i,o.v4=n,t.exports=o},55005:t=>{for(var e=[],r=0;r<256;++r)e[r]=(r+256).toString(16).substr(1);t.exports=function(t,r){var i=r||0,n=e;return[n[t[i++]],n[t[i++]],n[t[i++]],n[t[i++]],"-",n[t[i++]],n[t[i++]],"-",n[t[i++]],n[t[i++]],"-",n[t[i++]],n[t[i++]],"-",n[t[i++]],n[t[i++]],n[t[i++]],n[t[i++]],n[t[i++]],n[t[i++]]].join("")}},42522:t=>{var e="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof window.msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto);if(e){var r=new Uint8Array(16);t.exports=function(){return e(r),r}}else{var i=new Array(16);t.exports=function(){for(var t,e=0;e<16;e++)0==(3&e)&&(t=4294967296*Math.random()),i[e]=t>>>((3&e)<<3)&255;return i}}},81769:(t,e,r)=>{var i,n,o=r(42522),s=r(55005),a=0,u=0;t.exports=function(t,e,r){var h=e&&r||0,c=e||[],f=(t=t||{}).node||i,l=void 0!==t.clockseq?t.clockseq:n;if(null==f||null==l){var d=o();null==f&&(f=i=[1|d[0],d[1],d[2],d[3],d[4],d[5]]),null==l&&(l=n=16383&(d[6]<<8|d[7]))}var p=void 0!==t.msecs?t.msecs:(new Date).getTime(),g=void 0!==t.nsecs?t.nsecs:u+1,y=p-a+(g-u)/1e4;if(y<0&&void 0===t.clockseq&&(l=l+1&16383),(y<0||p>a)&&void 0===t.nsecs&&(g=0),g>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");a=p,u=g,n=l;var m=(1e4*(268435455&(p+=122192928e5))+g)%4294967296;c[h++]=m>>>24&255,c[h++]=m>>>16&255,c[h++]=m>>>8&255,c[h++]=255&m;var v=p/4294967296*1e4&268435455;c[h++]=v>>>8&255,c[h++]=255&v,c[h++]=v>>>24&15|16,c[h++]=v>>>16&255,c[h++]=l>>>8|128,c[h++]=255&l;for(var b=0;b<6;++b)c[h+b]=f[b];return e||s(c)}},39614:(t,e,r)=>{var i=r(42522),n=r(55005);t.exports=function(t,e,r){var o=e&&r||0;"string"==typeof t&&(e="binary"===t?new Array(16):null,t=null);var s=(t=t||{}).random||(t.rng||i)();if(s[6]=15&s[6]|64,s[8]=63&s[8]|128,e)for(var a=0;a<16;++a)e[o+a]=s[a];return e||n(s)}},64671:function(t){var e;e=function(){return function(t){var e={};function r(i){if(e[i])return e[i].exports;var n=e[i]={i,l:!1,exports:{}};return t[i].call(n.exports,n,n.exports,r),n.l=!0,n.exports}return r.m=t,r.c=e,r.d=function(t,e,i){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:i})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var i=Object.create(null);if(r.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var n in t)r.d(i,n,function(e){return t[e]}.bind(null,n));return i},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=22)}([function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=function(){function t(t,e){for(var r=0;r<e.length;r++){var i=e[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,r,i){return r&&t(e.prototype,r),i&&t(e,i),e}}(),n={debug:function(){},info:function(){},warn:function(){},error:function(){}},o=void 0,s=void 0;(e.Log=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)}return t.reset=function(){s=3,o=n},t.debug=function(){if(s>=4){for(var t=arguments.length,e=Array(t),r=0;r<t;r++)e[r]=arguments[r];o.debug.apply(o,Array.from(e))}},t.info=function(){if(s>=3){for(var t=arguments.length,e=Array(t),r=0;r<t;r++)e[r]=arguments[r];o.info.apply(o,Array.from(e))}},t.warn=function(){if(s>=2){for(var t=arguments.length,e=Array(t),r=0;r<t;r++)e[r]=arguments[r];o.warn.apply(o,Array.from(e))}},t.error=function(){if(s>=1){for(var t=arguments.length,e=Array(t),r=0;r<t;r++)e[r]=arguments[r];o.error.apply(o,Array.from(e))}},i(t,null,[{key:"NONE",get:function(){return 0}},{key:"ERROR",get:function(){return 1}},{key:"WARN",get:function(){return 2}},{key:"INFO",get:function(){return 3}},{key:"DEBUG",get:function(){return 4}},{key:"level",get:function(){return s},set:function(t){if(!(0<=t&&t<=4))throw new Error("Invalid log level");s=t}},{key:"logger",get:function(){return o},set:function(t){if(!t.debug&&t.info&&(t.debug=t.info),!(t.debug&&t.info&&t.warn&&t.error))throw new Error("Invalid logger");o=t}}]),t}()).reset()},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=function(){function t(t,e){for(var r=0;r<e.length;r++){var i=e[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,r,i){return r&&t(e.prototype,r),i&&t(e,i),e}}(),n={setInterval:function(t){function e(e,r){return t.apply(this,arguments)}return e.toString=function(){return t.toString()},e}((function(t,e){return setInterval(t,e)})),clearInterval:function(t){function e(e){return t.apply(this,arguments)}return e.toString=function(){return t.toString()},e}((function(t){return clearInterval(t)}))},o=!1,s=null;e.Global=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)}return t._testing=function(){o=!0},t.setXMLHttpRequest=function(t){s=t},i(t,null,[{key:"location",get:function(){if(!o)return location}},{key:"localStorage",get:function(){if(!o&&"undefined"!=typeof window)return localStorage}},{key:"sessionStorage",get:function(){if(!o&&"undefined"!=typeof window)return sessionStorage}},{key:"XMLHttpRequest",get:function(){if(!o&&"undefined"!=typeof window)return s||XMLHttpRequest}},{key:"timer",get:function(){if(!o)return n}}]),t}()},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.MetadataService=void 0;var i=function(){function t(t,e){for(var r=0;r<e.length;r++){var i=e[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,r,i){return r&&t(e.prototype,r),i&&t(e,i),e}}(),n=r(0),o=r(7);function s(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var a=".well-known/openid-configuration";e.MetadataService=function(){function t(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:o.JsonService;if(s(this,t),!e)throw n.Log.error("MetadataService: No settings passed to MetadataService"),new Error("settings");this._settings=e,this._jsonService=new r(["application/jwk-set+json"])}return t.prototype.resetSigningKeys=function(){this._settings=this._settings||{},this._settings.signingKeys=void 0},t.prototype.getMetadata=function(){var t=this;return this._settings.metadata?(n.Log.debug("MetadataService.getMetadata: Returning metadata from settings"),Promise.resolve(this._settings.metadata)):this.metadataUrl?(n.Log.debug("MetadataService.getMetadata: getting metadata from",this.metadataUrl),this._jsonService.getJson(this.metadataUrl).then((function(e){n.Log.debug("MetadataService.getMetadata: json received");var r=t._settings.metadataSeed||{};return t._settings.metadata=Object.assign({},r,e),t._settings.metadata}))):(n.Log.error("MetadataService.getMetadata: No authority or metadataUrl configured on settings"),Promise.reject(new Error("No authority or metadataUrl configured on settings")))},t.prototype.getIssuer=function(){return this._getMetadataProperty("issuer")},t.prototype.getAuthorizationEndpoint=function(){return this._getMetadataProperty("authorization_endpoint")},t.prototype.getUserInfoEndpoint=function(){return this._getMetadataProperty("userinfo_endpoint")},t.prototype.getTokenEndpoint=function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return this._getMetadataProperty("token_endpoint",t)},t.prototype.getCheckSessionIframe=function(){return this._getMetadataProperty("check_session_iframe",!0)},t.prototype.getEndSessionEndpoint=function(){return this._getMetadataProperty("end_session_endpoint",!0)},t.prototype.getRevocationEndpoint=function(){return this._getMetadataProperty("revocation_endpoint",!0)},t.prototype.getKeysEndpoint=function(){return this._getMetadataProperty("jwks_uri",!0)},t.prototype._getMetadataProperty=function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return n.Log.debug("MetadataService.getMetadataProperty for: "+t),this.getMetadata().then((function(r){if(n.Log.debug("MetadataService.getMetadataProperty: metadata recieved"),void 0===r[t]){if(!0===e)return void n.Log.warn("MetadataService.getMetadataProperty: Metadata does not contain optional property "+t);throw n.Log.error("MetadataService.getMetadataProperty: Metadata does not contain property "+t),new Error("Metadata does not contain property "+t)}return r[t]}))},t.prototype.getSigningKeys=function(){var t=this;return this._settings.signingKeys?(n.Log.debug("MetadataService.getSigningKeys: Returning signingKeys from settings"),Promise.resolve(this._settings.signingKeys)):this._getMetadataProperty("jwks_uri").then((function(e){return n.Log.debug("MetadataService.getSigningKeys: jwks_uri received",e),t._jsonService.getJson(e).then((function(e){if(n.Log.debug("MetadataService.getSigningKeys: key set received",e),!e.keys)throw n.Log.error("MetadataService.getSigningKeys: Missing keys on keyset"),new Error("Missing keys on keyset");return t._settings.signingKeys=e.keys,t._settings.signingKeys}))}))},i(t,[{key:"metadataUrl",get:function(){return this._metadataUrl||(this._settings.metadataUrl?this._metadataUrl=this._settings.metadataUrl:(this._metadataUrl=this._settings.authority,this._metadataUrl&&this._metadataUrl.indexOf(a)<0&&("/"!==this._metadataUrl[this._metadataUrl.length-1]&&(this._metadataUrl+="/"),this._metadataUrl+=a))),this._metadataUrl}}]),t}()},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.UrlUtility=void 0;var i=r(0),n=r(1);e.UrlUtility=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)}return t.addQueryParam=function(t,e,r){return t.indexOf("?")<0&&(t+="?"),"?"!==t[t.length-1]&&(t+="&"),t+=encodeURIComponent(e),(t+="=")+encodeURIComponent(r)},t.parseUrlFragment=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"#",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:n.Global;"string"!=typeof t&&(t=r.location.href);var o=t.lastIndexOf(e);o>=0&&(t=t.substr(o+1)),"?"===e&&(o=t.indexOf("#"))>=0&&(t=t.substr(0,o));for(var s,a={},u=/([^&=]+)=([^&]*)/g,h=0;s=u.exec(t);)if(a[decodeURIComponent(s[1])]=decodeURIComponent(s[2].replace(/\+/g," ")),h++>50)return i.Log.error("UrlUtility.parseUrlFragment: response exceeded expected number of parameters",t),{error:"Response exceeded expected number of parameters"};for(var c in a)return a;return{}},t}()},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.JoseUtil=void 0;var i=r(26),n=function(t){return t&&t.__esModule?t:{default:t}}(r(33));e.JoseUtil=(0,n.default)({jws:i.jws,KeyUtil:i.KeyUtil,X509:i.X509,crypto:i.crypto,hextob64u:i.hextob64u,b64tohex:i.b64tohex,AllowedSigningAlgs:i.AllowedSigningAlgs})},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.OidcClientSettings=void 0;var i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n=function(){function t(t,e){for(var r=0;r<e.length;r++){var i=e[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,r,i){return r&&t(e.prototype,r),i&&t(e,i),e}}(),o=r(0),s=r(23),a=r(6),u=r(24),h=r(2);function c(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var f=".well-known/openid-configuration",l="id_token",d="openid",p="client_secret_post";e.OidcClientSettings=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=e.authority,n=e.metadataUrl,o=e.metadata,f=e.signingKeys,g=e.metadataSeed,y=e.client_id,m=e.client_secret,v=e.response_type,b=void 0===v?l:v,w=e.scope,_=void 0===w?d:w,S=e.redirect_uri,E=e.post_logout_redirect_uri,M=e.client_authentication,A=void 0===M?p:M,C=e.prompt,k=e.display,I=e.max_age,T=e.ui_locales,R=e.acr_values,B=e.resource,x=e.response_mode,F=e.filterProtocolClaims,P=void 0===F||F,N=e.loadUserInfo,O=void 0===N||N,L=e.staleStateAge,U=void 0===L?900:L,j=e.clockSkew,D=void 0===j?300:j,K=e.clockService,V=void 0===K?new s.ClockService:K,H=e.userInfoJwtIssuer,q=void 0===H?"OP":H,z=e.mergeClaims,W=void 0!==z&&z,G=e.stateStore,J=void 0===G?new a.WebStorageStateStore:G,Z=e.ResponseValidatorCtor,$=void 0===Z?u.ResponseValidator:Z,Y=e.MetadataServiceCtor,Q=void 0===Y?h.MetadataService:Y,X=e.extraQueryParams,tt=void 0===X?{}:X,et=e.extraTokenParams,rt=void 0===et?{}:et;c(this,t),this._authority=r,this._metadataUrl=n,this._metadata=o,this._metadataSeed=g,this._signingKeys=f,this._client_id=y,this._client_secret=m,this._response_type=b,this._scope=_,this._redirect_uri=S,this._post_logout_redirect_uri=E,this._client_authentication=A,this._prompt=C,this._display=k,this._max_age=I,this._ui_locales=T,this._acr_values=R,this._resource=B,this._response_mode=x,this._filterProtocolClaims=!!P,this._loadUserInfo=!!O,this._staleStateAge=U,this._clockSkew=D,this._clockService=V,this._userInfoJwtIssuer=q,this._mergeClaims=!!W,this._stateStore=J,this._validator=new $(this),this._metadataService=new Q(this),this._extraQueryParams="object"===(void 0===tt?"undefined":i(tt))?tt:{},this._extraTokenParams="object"===(void 0===rt?"undefined":i(rt))?rt:{}}return t.prototype.getEpochTime=function(){return this._clockService.getEpochTime()},n(t,[{key:"client_id",get:function(){return this._client_id},set:function(t){if(this._client_id)throw o.Log.error("OidcClientSettings.set_client_id: client_id has already been assigned."),new Error("client_id has already been assigned.");this._client_id=t}},{key:"client_secret",get:function(){return this._client_secret}},{key:"response_type",get:function(){return this._response_type}},{key:"scope",get:function(){return this._scope}},{key:"redirect_uri",get:function(){return this._redirect_uri}},{key:"post_logout_redirect_uri",get:function(){return this._post_logout_redirect_uri}},{key:"client_authentication",get:function(){return this._client_authentication}},{key:"prompt",get:function(){return this._prompt}},{key:"display",get:function(){return this._display}},{key:"max_age",get:function(){return this._max_age}},{key:"ui_locales",get:function(){return this._ui_locales}},{key:"acr_values",get:function(){return this._acr_values}},{key:"resource",get:function(){return this._resource}},{key:"response_mode",get:function(){return this._response_mode}},{key:"authority",get:function(){return this._authority},set:function(t){if(this._authority)throw o.Log.error("OidcClientSettings.set_authority: authority has already been assigned."),new Error("authority has already been assigned.");this._authority=t}},{key:"metadataUrl",get:function(){return this._metadataUrl||(this._metadataUrl=this.authority,this._metadataUrl&&this._metadataUrl.indexOf(f)<0&&("/"!==this._metadataUrl[this._metadataUrl.length-1]&&(this._metadataUrl+="/"),this._metadataUrl+=f)),this._metadataUrl}},{key:"metadata",get:function(){return this._metadata},set:function(t){this._metadata=t}},{key:"metadataSeed",get:function(){return this._metadataSeed},set:function(t){this._metadataSeed=t}},{key:"signingKeys",get:function(){return this._signingKeys},set:function(t){this._signingKeys=t}},{key:"filterProtocolClaims",get:function(){return this._filterProtocolClaims}},{key:"loadUserInfo",get:function(){return this._loadUserInfo}},{key:"staleStateAge",get:function(){return this._staleStateAge}},{key:"clockSkew",get:function(){return this._clockSkew}},{key:"userInfoJwtIssuer",get:function(){return this._userInfoJwtIssuer}},{key:"mergeClaims",get:function(){return this._mergeClaims}},{key:"stateStore",get:function(){return this._stateStore}},{key:"validator",get:function(){return this._validator}},{key:"metadataService",get:function(){return this._metadataService}},{key:"extraQueryParams",get:function(){return this._extraQueryParams},set:function(t){"object"===(void 0===t?"undefined":i(t))?this._extraQueryParams=t:this._extraQueryParams={}}},{key:"extraTokenParams",get:function(){return this._extraTokenParams},set:function(t){"object"===(void 0===t?"undefined":i(t))?this._extraTokenParams=t:this._extraTokenParams={}}}]),t}()},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.WebStorageStateStore=void 0;var i=r(0),n=r(1);function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}e.WebStorageStateStore=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=e.prefix,i=void 0===r?"oidc.":r,s=e.store,a=void 0===s?n.Global.localStorage:s;o(this,t),this._store=a,this._prefix=i}return t.prototype.set=function(t,e){return i.Log.debug("WebStorageStateStore.set",t),t=this._prefix+t,this._store.setItem(t,e),Promise.resolve()},t.prototype.get=function(t){i.Log.debug("WebStorageStateStore.get",t),t=this._prefix+t;var e=this._store.getItem(t);return Promise.resolve(e)},t.prototype.remove=function(t){i.Log.debug("WebStorageStateStore.remove",t),t=this._prefix+t;var e=this._store.getItem(t);return this._store.removeItem(t),Promise.resolve(e)},t.prototype.getAllKeys=function(){i.Log.debug("WebStorageStateStore.getAllKeys");for(var t=[],e=0;e<this._store.length;e++){var r=this._store.key(e);0===r.indexOf(this._prefix)&&t.push(r.substr(this._prefix.length))}return Promise.resolve(t)},t}()},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.JsonService=void 0;var i=r(0),n=r(1);function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}e.JsonService=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:n.Global.XMLHttpRequest,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;o(this,t),e&&Array.isArray(e)?this._contentTypes=e.slice():this._contentTypes=[],this._contentTypes.push("application/json"),i&&this._contentTypes.push("application/jwt"),this._XMLHttpRequest=r,this._jwtHandler=i}return t.prototype.getJson=function(t,e){var r=this;if(!t)throw i.Log.error("JsonService.getJson: No url passed"),new Error("url");return i.Log.debug("JsonService.getJson, url: ",t),new Promise((function(n,o){var s=new r._XMLHttpRequest;s.open("GET",t);var a=r._contentTypes,u=r._jwtHandler;s.onload=function(){if(i.Log.debug("JsonService.getJson: HTTP response received, status",s.status),200===s.status){var e=s.getResponseHeader("Content-Type");if(e){var r=a.find((function(t){if(e.startsWith(t))return!0}));if("application/jwt"==r)return void u(s).then(n,o);if(r)try{return void n(JSON.parse(s.responseText))}catch(t){return i.Log.error("JsonService.getJson: Error parsing JSON response",t.message),void o(t)}}o(Error("Invalid response Content-Type: "+e+", from URL: "+t))}else o(Error(s.statusText+" ("+s.status+")"))},s.onerror=function(){i.Log.error("JsonService.getJson: network error"),o(Error("Network Error"))},e&&(i.Log.debug("JsonService.getJson: token passed, setting Authorization header"),s.setRequestHeader("Authorization","Bearer "+e)),s.send()}))},t.prototype.postForm=function(t,e,r){var n=this;if(!t)throw i.Log.error("JsonService.postForm: No url passed"),new Error("url");return i.Log.debug("JsonService.postForm, url: ",t),new Promise((function(o,s){var a=new n._XMLHttpRequest;a.open("POST",t);var u=n._contentTypes;a.onload=function(){if(i.Log.debug("JsonService.postForm: HTTP response received, status",a.status),200!==a.status){if(400===a.status&&(r=a.getResponseHeader("Content-Type"))&&u.find((function(t){if(r.startsWith(t))return!0})))try{var e=JSON.parse(a.responseText);if(e&&e.error)return i.Log.error("JsonService.postForm: Error from server: ",e.error),void s(new Error(e.error))}catch(t){return i.Log.error("JsonService.postForm: Error parsing JSON response",t.message),void s(t)}s(Error(a.statusText+" ("+a.status+")"))}else{var r;if((r=a.getResponseHeader("Content-Type"))&&u.find((function(t){if(r.startsWith(t))return!0})))try{return void o(JSON.parse(a.responseText))}catch(t){return i.Log.error("JsonService.postForm: Error parsing JSON response",t.message),void s(t)}s(Error("Invalid response Content-Type: "+r+", from URL: "+t))}},a.onerror=function(){i.Log.error("JsonService.postForm: network error"),s(Error("Network Error"))};var h="";for(var c in e){var f=e[c];f&&(h.length>0&&(h+="&"),h+=encodeURIComponent(c),h+="=",h+=encodeURIComponent(f))}a.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),void 0!==r&&a.setRequestHeader("Authorization","Basic "+btoa(r)),a.send(h)}))},t}()},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.SigninRequest=void 0;var i=r(0),n=r(3),o=r(13);e.SigninRequest=function(){function t(e){var r=e.url,s=e.client_id,a=e.redirect_uri,u=e.response_type,h=e.scope,c=e.authority,f=e.data,l=e.prompt,d=e.display,p=e.max_age,g=e.ui_locales,y=e.id_token_hint,m=e.login_hint,v=e.acr_values,b=e.resource,w=e.response_mode,_=e.request,S=e.request_uri,E=e.extraQueryParams,M=e.request_type,A=e.client_secret,C=e.extraTokenParams,k=e.skipUserInfo;if(function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),!r)throw i.Log.error("SigninRequest.ctor: No url passed"),new Error("url");if(!s)throw i.Log.error("SigninRequest.ctor: No client_id passed"),new Error("client_id");if(!a)throw i.Log.error("SigninRequest.ctor: No redirect_uri passed"),new Error("redirect_uri");if(!u)throw i.Log.error("SigninRequest.ctor: No response_type passed"),new Error("response_type");if(!h)throw i.Log.error("SigninRequest.ctor: No scope passed"),new Error("scope");if(!c)throw i.Log.error("SigninRequest.ctor: No authority passed"),new Error("authority");var I=t.isOidc(u),T=t.isCode(u);w||(w=t.isCode(u)?"query":null),this.state=new o.SigninState({nonce:I,data:f,client_id:s,authority:c,redirect_uri:a,code_verifier:T,request_type:M,response_mode:w,client_secret:A,scope:h,extraTokenParams:C,skipUserInfo:k}),r=n.UrlUtility.addQueryParam(r,"client_id",s),r=n.UrlUtility.addQueryParam(r,"redirect_uri",a),r=n.UrlUtility.addQueryParam(r,"response_type",u),r=n.UrlUtility.addQueryParam(r,"scope",h),r=n.UrlUtility.addQueryParam(r,"state",this.state.id),I&&(r=n.UrlUtility.addQueryParam(r,"nonce",this.state.nonce)),T&&(r=n.UrlUtility.addQueryParam(r,"code_challenge",this.state.code_challenge),r=n.UrlUtility.addQueryParam(r,"code_challenge_method","S256"));var R={prompt:l,display:d,max_age:p,ui_locales:g,id_token_hint:y,login_hint:m,acr_values:v,resource:b,request:_,request_uri:S,response_mode:w};for(var B in R)R[B]&&(r=n.UrlUtility.addQueryParam(r,B,R[B]));for(var x in E)r=n.UrlUtility.addQueryParam(r,x,E[x]);this.url=r}return t.isOidc=function(t){return!!t.split(/\s+/g).filter((function(t){return"id_token"===t}))[0]},t.isOAuth=function(t){return!!t.split(/\s+/g).filter((function(t){return"token"===t}))[0]},t.isCode=function(t){return!!t.split(/\s+/g).filter((function(t){return"code"===t}))[0]},t}()},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.State=void 0;var i=function(){function t(t,e){for(var r=0;r<e.length;r++){var i=e[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,r,i){return r&&t(e.prototype,r),i&&t(e,i),e}}(),n=r(0),o=function(t){return t&&t.__esModule?t:{default:t}}(r(14));function s(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}e.State=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=e.id,i=e.data,n=e.created,a=e.request_type;s(this,t),this._id=r||(0,o.default)(),this._data=i,this._created="number"==typeof n&&n>0?n:parseInt(Date.now()/1e3),this._request_type=a}return t.prototype.toStorageString=function(){return n.Log.debug("State.toStorageString"),JSON.stringify({id:this.id,data:this.data,created:this.created,request_type:this.request_type})},t.fromStorageString=function(e){return n.Log.debug("State.fromStorageString"),new t(JSON.parse(e))},t.clearStaleState=function(e,r){var i=Date.now()/1e3-r;return e.getAllKeys().then((function(r){n.Log.debug("State.clearStaleState: got keys",r);for(var o=[],s=function(s){var a=r[s];u=e.get(a).then((function(r){var o=!1;if(r)try{var s=t.fromStorageString(r);n.Log.debug("State.clearStaleState: got item from key: ",a,s.created),s.created<=i&&(o=!0)}catch(t){n.Log.error("State.clearStaleState: Error parsing state for key",a,t.message),o=!0}else n.Log.debug("State.clearStaleState: no item in storage for key: ",a),o=!0;if(o)return n.Log.debug("State.clearStaleState: removed item for key: ",a),e.remove(a)})),o.push(u)},a=0;a<r.length;a++){var u;s(a)}return n.Log.debug("State.clearStaleState: waiting on promise count:",o.length),Promise.all(o)}))},i(t,[{key:"id",get:function(){return this._id}},{key:"data",get:function(){return this._data}},{key:"created",get:function(){return this._created}},{key:"request_type",get:function(){return this._request_type}}]),t}()},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.OidcClient=void 0;var i=function(){function t(t,e){for(var r=0;r<e.length;r++){var i=e[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,r,i){return r&&t(e.prototype,r),i&&t(e,i),e}}(),n=r(0),o=r(5),s=r(12),a=r(8),u=r(34),h=r(35),c=r(36),f=r(13),l=r(9);function d(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}e.OidcClient=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};d(this,t),e instanceof o.OidcClientSettings?this._settings=e:this._settings=new o.OidcClientSettings(e)}return t.prototype.createSigninRequest=function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=e.response_type,i=e.scope,o=e.redirect_uri,s=e.data,u=e.state,h=e.prompt,c=e.display,f=e.max_age,l=e.ui_locales,d=e.id_token_hint,p=e.login_hint,g=e.acr_values,y=e.resource,m=e.request,v=e.request_uri,b=e.response_mode,w=e.extraQueryParams,_=e.extraTokenParams,S=e.request_type,E=e.skipUserInfo,M=arguments[1];n.Log.debug("OidcClient.createSigninRequest");var A=this._settings.client_id;r=r||this._settings.response_type,i=i||this._settings.scope,o=o||this._settings.redirect_uri,h=h||this._settings.prompt,c=c||this._settings.display,f=f||this._settings.max_age,l=l||this._settings.ui_locales,g=g||this._settings.acr_values,y=y||this._settings.resource,b=b||this._settings.response_mode,w=w||this._settings.extraQueryParams,_=_||this._settings.extraTokenParams;var C=this._settings.authority;return a.SigninRequest.isCode(r)&&"code"!==r?Promise.reject(new Error("OpenID Connect hybrid flow is not supported")):this._metadataService.getAuthorizationEndpoint().then((function(e){n.Log.debug("OidcClient.createSigninRequest: Received authorization endpoint",e);var k=new a.SigninRequest({url:e,client_id:A,redirect_uri:o,response_type:r,scope:i,data:s||u,authority:C,prompt:h,display:c,max_age:f,ui_locales:l,id_token_hint:d,login_hint:p,acr_values:g,resource:y,request:m,request_uri:v,extraQueryParams:w,extraTokenParams:_,request_type:S,response_mode:b,client_secret:t._settings.client_secret,skipUserInfo:E}),I=k.state;return(M=M||t._stateStore).set(I.id,I.toStorageString()).then((function(){return k}))}))},t.prototype.readSigninResponseState=function(t,e){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];n.Log.debug("OidcClient.readSigninResponseState");var i="query"===this._settings.response_mode||!this._settings.response_mode&&a.SigninRequest.isCode(this._settings.response_type),o=i?"?":"#",s=new u.SigninResponse(t,o);if(!s.state)return n.Log.error("OidcClient.readSigninResponseState: No state in response"),Promise.reject(new Error("No state in response"));e=e||this._stateStore;var h=r?e.remove.bind(e):e.get.bind(e);return h(s.state).then((function(t){if(!t)throw n.Log.error("OidcClient.readSigninResponseState: No matching state found in storage"),new Error("No matching state found in storage");return{state:f.SigninState.fromStorageString(t),response:s}}))},t.prototype.processSigninResponse=function(t,e){var r=this;return n.Log.debug("OidcClient.processSigninResponse"),this.readSigninResponseState(t,e,!0).then((function(t){var e=t.state,i=t.response;return n.Log.debug("OidcClient.processSigninResponse: Received state from storage; validating response"),r._validator.validateSigninResponse(e,i)}))},t.prototype.createSignoutRequest=function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=e.id_token_hint,i=e.data,o=e.state,s=e.post_logout_redirect_uri,a=e.extraQueryParams,u=e.request_type,c=arguments[1];return n.Log.debug("OidcClient.createSignoutRequest"),s=s||this._settings.post_logout_redirect_uri,a=a||this._settings.extraQueryParams,this._metadataService.getEndSessionEndpoint().then((function(e){if(!e)throw n.Log.error("OidcClient.createSignoutRequest: No end session endpoint url returned"),new Error("no end session endpoint");n.Log.debug("OidcClient.createSignoutRequest: Received end session endpoint",e);var f=new h.SignoutRequest({url:e,id_token_hint:r,post_logout_redirect_uri:s,data:i||o,extraQueryParams:a,request_type:u}),l=f.state;return l&&(n.Log.debug("OidcClient.createSignoutRequest: Signout request has state to persist"),(c=c||t._stateStore).set(l.id,l.toStorageString())),f}))},t.prototype.readSignoutResponseState=function(t,e){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];n.Log.debug("OidcClient.readSignoutResponseState");var i=new c.SignoutResponse(t);if(!i.state)return n.Log.debug("OidcClient.readSignoutResponseState: No state in response"),i.error?(n.Log.warn("OidcClient.readSignoutResponseState: Response was error: ",i.error),Promise.reject(new s.ErrorResponse(i))):Promise.resolve({state:void 0,response:i});var o=i.state;e=e||this._stateStore;var a=r?e.remove.bind(e):e.get.bind(e);return a(o).then((function(t){if(!t)throw n.Log.error("OidcClient.readSignoutResponseState: No matching state found in storage"),new Error("No matching state found in storage");return{state:l.State.fromStorageString(t),response:i}}))},t.prototype.processSignoutResponse=function(t,e){var r=this;return n.Log.debug("OidcClient.processSignoutResponse"),this.readSignoutResponseState(t,e,!0).then((function(t){var e=t.state,i=t.response;return e?(n.Log.debug("OidcClient.processSignoutResponse: Received state from storage; validating response"),r._validator.validateSignoutResponse(e,i)):(n.Log.debug("OidcClient.processSignoutResponse: No state from storage; skipping validating response"),i)}))},t.prototype.clearStaleState=function(t){return n.Log.debug("OidcClient.clearStaleState"),t=t||this._stateStore,l.State.clearStaleState(t,this.settings.staleStateAge)},i(t,[{key:"_stateStore",get:function(){return this.settings.stateStore}},{key:"_validator",get:function(){return this.settings.validator}},{key:"_metadataService",get:function(){return this.settings.metadataService}},{key:"settings",get:function(){return this._settings}},{key:"metadataService",get:function(){return this._metadataService}}]),t}()},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.TokenClient=void 0;var i=r(7),n=r(2),o=r(0);function s(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}e.TokenClient=function(){function t(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:i.JsonService,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:n.MetadataService;if(s(this,t),!e)throw o.Log.error("TokenClient.ctor: No settings passed"),new Error("settings");this._settings=e,this._jsonService=new r,this._metadataService=new a(this._settings)}return t.prototype.exchangeCode=function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};(e=Object.assign({},e)).grant_type=e.grant_type||"authorization_code",e.client_id=e.client_id||this._settings.client_id,e.client_secret=e.client_secret||this._settings.client_secret,e.redirect_uri=e.redirect_uri||this._settings.redirect_uri;var r=void 0,i=e._client_authentication||this._settings._client_authentication;return delete e._client_authentication,e.code?e.redirect_uri?e.code_verifier?e.client_id?e.client_secret||"client_secret_basic"!=i?("client_secret_basic"==i&&(r=e.client_id+":"+e.client_secret,delete e.client_id,delete e.client_secret),this._metadataService.getTokenEndpoint(!1).then((function(i){return o.Log.debug("TokenClient.exchangeCode: Received token endpoint"),t._jsonService.postForm(i,e,r).then((function(t){return o.Log.debug("TokenClient.exchangeCode: response received"),t}))}))):(o.Log.error("TokenClient.exchangeCode: No client_secret passed"),Promise.reject(new Error("A client_secret is required"))):(o.Log.error("TokenClient.exchangeCode: No client_id passed"),Promise.reject(new Error("A client_id is required"))):(o.Log.error("TokenClient.exchangeCode: No code_verifier passed"),Promise.reject(new Error("A code_verifier is required"))):(o.Log.error("TokenClient.exchangeCode: No redirect_uri passed"),Promise.reject(new Error("A redirect_uri is required"))):(o.Log.error("TokenClient.exchangeCode: No code passed"),Promise.reject(new Error("A code is required")))},t.prototype.exchangeRefreshToken=function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};(e=Object.assign({},e)).grant_type=e.grant_type||"refresh_token",e.client_id=e.client_id||this._settings.client_id,e.client_secret=e.client_secret||this._settings.client_secret;var r=void 0,i=e._client_authentication||this._settings._client_authentication;return delete e._client_authentication,e.refresh_token?e.client_id?("client_secret_basic"==i&&(r=e.client_id+":"+e.client_secret,delete e.client_id,delete e.client_secret),this._metadataService.getTokenEndpoint(!1).then((function(i){return o.Log.debug("TokenClient.exchangeRefreshToken: Received token endpoint"),t._jsonService.postForm(i,e,r).then((function(t){return o.Log.debug("TokenClient.exchangeRefreshToken: response received"),t}))}))):(o.Log.error("TokenClient.exchangeRefreshToken: No client_id passed"),Promise.reject(new Error("A client_id is required"))):(o.Log.error("TokenClient.exchangeRefreshToken: No refresh_token passed"),Promise.reject(new Error("A refresh_token is required")))},t}()},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ErrorResponse=void 0;var i=r(0);function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}e.ErrorResponse=function(t){function e(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},s=r.error,a=r.error_description,u=r.error_uri,h=r.state,c=r.session_state;if(n(this,e),!s)throw i.Log.error("No error passed to ErrorResponse"),new Error("error");var f=o(this,t.call(this,a||s));return f.name="ErrorResponse",f.error=s,f.error_description=a,f.error_uri=u,f.state=h,f.session_state=c,f}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,t),e}(Error)},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.SigninState=void 0;var i=function(){function t(t,e){for(var r=0;r<e.length;r++){var i=e[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,r,i){return r&&t(e.prototype,r),i&&t(e,i),e}}(),n=r(0),o=r(9),s=r(4),a=function(t){return t&&t.__esModule?t:{default:t}}(r(14));function u(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function h(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}e.SigninState=function(t){function e(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=r.nonce,n=r.authority,o=r.client_id,c=r.redirect_uri,f=r.code_verifier,l=r.response_mode,d=r.client_secret,p=r.scope,g=r.extraTokenParams,y=r.skipUserInfo;u(this,e);var m=h(this,t.call(this,arguments[0]));if(!0===i?m._nonce=(0,a.default)():i&&(m._nonce=i),!0===f?m._code_verifier=(0,a.default)()+(0,a.default)()+(0,a.default)():f&&(m._code_verifier=f),m.code_verifier){var v=s.JoseUtil.hashString(m.code_verifier,"SHA256");m._code_challenge=s.JoseUtil.hexToBase64Url(v)}return m._redirect_uri=c,m._authority=n,m._client_id=o,m._response_mode=l,m._client_secret=d,m._scope=p,m._extraTokenParams=g,m._skipUserInfo=y,m}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,t),e.prototype.toStorageString=function(){return n.Log.debug("SigninState.toStorageString"),JSON.stringify({id:this.id,data:this.data,created:this.created,request_type:this.request_type,nonce:this.nonce,code_verifier:this.code_verifier,redirect_uri:this.redirect_uri,authority:this.authority,client_id:this.client_id,response_mode:this.response_mode,client_secret:this.client_secret,scope:this.scope,extraTokenParams:this.extraTokenParams,skipUserInfo:this.skipUserInfo})},e.fromStorageString=function(t){return n.Log.debug("SigninState.fromStorageString"),new e(JSON.parse(t))},i(e,[{key:"nonce",get:function(){return this._nonce}},{key:"authority",get:function(){return this._authority}},{key:"client_id",get:function(){return this._client_id}},{key:"redirect_uri",get:function(){return this._redirect_uri}},{key:"code_verifier",get:function(){return this._code_verifier}},{key:"code_challenge",get:function(){return this._code_challenge}},{key:"response_mode",get:function(){return this._response_mode}},{key:"client_secret",get:function(){return this._client_secret}},{key:"scope",get:function(){return this._scope}},{key:"extraTokenParams",get:function(){return this._extraTokenParams}},{key:"skipUserInfo",get:function(){return this._skipUserInfo}}]),e}(o.State)},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(){return("undefined"!=i&&null!==i&&void 0!==i.getRandomValues?n:o)().replace(/-/g,"")};var i="undefined"!=typeof window?window.crypto||window.msCrypto:null;function n(){return([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g,(function(t){return(t^i.getRandomValues(new Uint8Array(1))[0]&15>>t/4).toString(16)}))}function o(){return([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g,(function(t){return(t^16*Math.random()>>t/4).toString(16)}))}t.exports=e.default},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.User=void 0;var i=function(){function t(t,e){for(var r=0;r<e.length;r++){var i=e[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,r,i){return r&&t(e.prototype,r),i&&t(e,i),e}}(),n=r(0);e.User=function(){function t(e){var r=e.id_token,i=e.session_state,n=e.access_token,o=e.refresh_token,s=e.token_type,a=e.scope,u=e.profile,h=e.expires_at,c=e.state;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.id_token=r,this.session_state=i,this.access_token=n,this.refresh_token=o,this.token_type=s,this.scope=a,this.profile=u,this.expires_at=h,this.state=c}return t.prototype.toStorageString=function(){return n.Log.debug("User.toStorageString"),JSON.stringify({id_token:this.id_token,session_state:this.session_state,access_token:this.access_token,refresh_token:this.refresh_token,token_type:this.token_type,scope:this.scope,profile:this.profile,expires_at:this.expires_at})},t.fromStorageString=function(e){return n.Log.debug("User.fromStorageString"),new t(JSON.parse(e))},i(t,[{key:"expires_in",get:function(){if(this.expires_at){var t=parseInt(Date.now()/1e3);return this.expires_at-t}},set:function(t){var e=parseInt(t);if("number"==typeof e&&e>0){var r=parseInt(Date.now()/1e3);this.expires_at=r+e}}},{key:"expired",get:function(){var t=this.expires_in;if(void 0!==t)return t<=0}},{key:"scopes",get:function(){return(this.scope||"").split(" ")}}]),t}()},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.AccessTokenEvents=void 0;var i=r(0),n=r(46);function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}e.AccessTokenEvents=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=e.accessTokenExpiringNotificationTime,i=void 0===r?60:r,s=e.accessTokenExpiringTimer,a=void 0===s?new n.Timer("Access token expiring"):s,u=e.accessTokenExpiredTimer,h=void 0===u?new n.Timer("Access token expired"):u;o(this,t),this._accessTokenExpiringNotificationTime=i,this._accessTokenExpiring=a,this._accessTokenExpired=h}return t.prototype.load=function(t){if(t.access_token&&void 0!==t.expires_in){var e=t.expires_in;if(i.Log.debug("AccessTokenEvents.load: access token present, remaining duration:",e),e>0){var r=e-this._accessTokenExpiringNotificationTime;r<=0&&(r=1),i.Log.debug("AccessTokenEvents.load: registering expiring timer in:",r),this._accessTokenExpiring.init(r)}else i.Log.debug("AccessTokenEvents.load: canceling existing expiring timer becase we're past expiration."),this._accessTokenExpiring.cancel();var n=e+1;i.Log.debug("AccessTokenEvents.load: registering expired timer in:",n),this._accessTokenExpired.init(n)}else this._accessTokenExpiring.cancel(),this._accessTokenExpired.cancel()},t.prototype.unload=function(){i.Log.debug("AccessTokenEvents.unload: canceling existing access token timers"),this._accessTokenExpiring.cancel(),this._accessTokenExpired.cancel()},t.prototype.addAccessTokenExpiring=function(t){this._accessTokenExpiring.addHandler(t)},t.prototype.removeAccessTokenExpiring=function(t){this._accessTokenExpiring.removeHandler(t)},t.prototype.addAccessTokenExpired=function(t){this._accessTokenExpired.addHandler(t)},t.prototype.removeAccessTokenExpired=function(t){this._accessTokenExpired.removeHandler(t)},t}()},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Event=void 0;var i=r(0);e.Event=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this._name=e,this._callbacks=[]}return t.prototype.addHandler=function(t){this._callbacks.push(t)},t.prototype.removeHandler=function(t){var e=this._callbacks.findIndex((function(e){return e===t}));e>=0&&this._callbacks.splice(e,1)},t.prototype.raise=function(){i.Log.debug("Event: Raising event: "+this._name);for(var t=0;t<this._callbacks.length;t++){var e;(e=this._callbacks)[t].apply(e,arguments)}},t}()},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.SessionMonitor=void 0;var i=function(){function t(t,e){for(var r=0;r<e.length;r++){var i=e[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,r,i){return r&&t(e.prototype,r),i&&t(e,i),e}}(),n=r(0),o=r(19),s=r(1);function a(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}e.SessionMonitor=function(){function t(e){var r=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:o.CheckSessionIFrame,u=arguments.length>2&&void 0!==arguments[2]?arguments[2]:s.Global.timer;if(a(this,t),!e)throw n.Log.error("SessionMonitor.ctor: No user manager passed to SessionMonitor"),new Error("userManager");this._userManager=e,this._CheckSessionIFrameCtor=i,this._timer=u,this._userManager.events.addUserLoaded(this._start.bind(this)),this._userManager.events.addUserUnloaded(this._stop.bind(this)),Promise.resolve(this._userManager.getUser().then((function(t){t?r._start(t):r._settings.monitorAnonymousSession&&r._userManager.querySessionStatus().then((function(t){var e={session_state:t.session_state};t.sub&&t.sid&&(e.profile={sub:t.sub,sid:t.sid}),r._start(e)})).catch((function(t){n.Log.error("SessionMonitor ctor: error from querySessionStatus:",t.message)}))})).catch((function(t){n.Log.error("SessionMonitor ctor: error from getUser:",t.message)})))}return t.prototype._start=function(t){var e=this,r=t.session_state;r&&(t.profile?(this._sub=t.profile.sub,this._sid=t.profile.sid,n.Log.debug("SessionMonitor._start: session_state:",r,", sub:",this._sub)):(this._sub=void 0,this._sid=void 0,n.Log.debug("SessionMonitor._start: session_state:",r,", anonymous user")),this._checkSessionIFrame?this._checkSessionIFrame.start(r):this._metadataService.getCheckSessionIframe().then((function(t){if(t){n.Log.debug("SessionMonitor._start: Initializing check session iframe");var i=e._client_id,o=e._checkSessionInterval,s=e._stopCheckSessionOnError;e._checkSessionIFrame=new e._CheckSessionIFrameCtor(e._callback.bind(e),i,t,o,s),e._checkSessionIFrame.load().then((function(){e._checkSessionIFrame.start(r)}))}else n.Log.warn("SessionMonitor._start: No check session iframe found in the metadata")})).catch((function(t){n.Log.error("SessionMonitor._start: Error from getCheckSessionIframe:",t.message)})))},t.prototype._stop=function(){var t=this;if(this._sub=void 0,this._sid=void 0,this._checkSessionIFrame&&(n.Log.debug("SessionMonitor._stop"),this._checkSessionIFrame.stop()),this._settings.monitorAnonymousSession)var e=this._timer.setInterval((function(){t._timer.clearInterval(e),t._userManager.querySessionStatus().then((function(e){var r={session_state:e.session_state};e.sub&&e.sid&&(r.profile={sub:e.sub,sid:e.sid}),t._start(r)})).catch((function(t){n.Log.error("SessionMonitor: error from querySessionStatus:",t.message)}))}),1e3)},t.prototype._callback=function(){var t=this;this._userManager.querySessionStatus().then((function(e){var r=!0;e?e.sub===t._sub?(r=!1,t._checkSessionIFrame.start(e.session_state),e.sid===t._sid?n.Log.debug("SessionMonitor._callback: Same sub still logged in at OP, restarting check session iframe; session_state:",e.session_state):(n.Log.debug("SessionMonitor._callback: Same sub still logged in at OP, session state has changed, restarting check session iframe; session_state:",e.session_state),t._userManager.events._raiseUserSessionChanged())):n.Log.debug("SessionMonitor._callback: Different subject signed into OP:",e.sub):n.Log.debug("SessionMonitor._callback: Subject no longer signed into OP"),r&&(t._sub?(n.Log.debug("SessionMonitor._callback: SessionMonitor._callback; raising signed out event"),t._userManager.events._raiseUserSignedOut()):(n.Log.debug("SessionMonitor._callback: SessionMonitor._callback; raising signed in event"),t._userManager.events._raiseUserSignedIn()))})).catch((function(e){t._sub&&(n.Log.debug("SessionMonitor._callback: Error calling queryCurrentSigninSession; raising signed out event",e.message),t._userManager.events._raiseUserSignedOut())}))},i(t,[{key:"_settings",get:function(){return this._userManager.settings}},{key:"_metadataService",get:function(){return this._userManager.metadataService}},{key:"_client_id",get:function(){return this._settings.client_id}},{key:"_checkSessionInterval",get:function(){return this._settings.checkSessionInterval}},{key:"_stopCheckSessionOnError",get:function(){return this._settings.stopCheckSessionOnError}}]),t}()},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.CheckSessionIFrame=void 0;var i=r(0);function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}e.CheckSessionIFrame=function(){function t(e,r,i,o){var s=!(arguments.length>4&&void 0!==arguments[4])||arguments[4];n(this,t),this._callback=e,this._client_id=r,this._url=i,this._interval=o||2e3,this._stopOnError=s;var a=i.indexOf("/",i.indexOf("//")+2);this._frame_origin=i.substr(0,a),this._frame=window.document.createElement("iframe"),this._frame.style.visibility="hidden",this._frame.style.position="absolute",this._frame.style.display="none",this._frame.width=0,this._frame.height=0,this._frame.src=i}return t.prototype.load=function(){var t=this;return new Promise((function(e){t._frame.onload=function(){e()},window.document.body.appendChild(t._frame),t._boundMessageEvent=t._message.bind(t),window.addEventListener("message",t._boundMessageEvent,!1)}))},t.prototype._message=function(t){t.origin===this._frame_origin&&t.source===this._frame.contentWindow&&("error"===t.data?(i.Log.error("CheckSessionIFrame: error message from check session op iframe"),this._stopOnError&&this.stop()):"changed"===t.data?(i.Log.debug("CheckSessionIFrame: changed message from check session op iframe"),this.stop(),this._callback()):i.Log.debug("CheckSessionIFrame: "+t.data+" message from check session op iframe"))},t.prototype.start=function(t){var e=this;if(this._session_state!==t){i.Log.debug("CheckSessionIFrame.start"),this.stop(),this._session_state=t;var r=function(){e._frame.contentWindow.postMessage(e._client_id+" "+e._session_state,e._frame_origin)};r(),this._timer=window.setInterval(r,this._interval)}},t.prototype.stop=function(){this._session_state=null,this._timer&&(i.Log.debug("CheckSessionIFrame.stop"),window.clearInterval(this._timer),this._timer=null)},t}()},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.TokenRevocationClient=void 0;var i=r(0),n=r(2),o=r(1);function s(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var a="access_token",u="refresh_token";e.TokenRevocationClient=function(){function t(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:o.Global.XMLHttpRequest,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:n.MetadataService;if(s(this,t),!e)throw i.Log.error("TokenRevocationClient.ctor: No settings provided"),new Error("No settings provided.");this._settings=e,this._XMLHttpRequestCtor=r,this._metadataService=new a(this._settings)}return t.prototype.revoke=function(t,e){var r=this,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"access_token";if(!t)throw i.Log.error("TokenRevocationClient.revoke: No token provided"),new Error("No token provided.");if(n!==a&&n!=u)throw i.Log.error("TokenRevocationClient.revoke: Invalid token type"),new Error("Invalid token type.");return this._metadataService.getRevocationEndpoint().then((function(o){if(o){i.Log.debug("TokenRevocationClient.revoke: Revoking "+n);var s=r._settings.client_id,a=r._settings.client_secret;return r._revoke(o,s,a,t,n)}if(e)throw i.Log.error("TokenRevocationClient.revoke: Revocation not supported"),new Error("Revocation not supported")}))},t.prototype._revoke=function(t,e,r,n,o){var s=this;return new Promise((function(a,u){var h=new s._XMLHttpRequestCtor;h.open("POST",t),h.onload=function(){i.Log.debug("TokenRevocationClient.revoke: HTTP response received, status",h.status),200===h.status?a():u(Error(h.statusText+" ("+h.status+")"))},h.onerror=function(){i.Log.debug("TokenRevocationClient.revoke: Network Error."),u("Network Error")};var c="client_id="+encodeURIComponent(e);r&&(c+="&client_secret="+encodeURIComponent(r)),c+="&token_type_hint="+encodeURIComponent(o),c+="&token="+encodeURIComponent(n),h.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),h.send(c)}))},t}()},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.CordovaPopupWindow=void 0;var i=function(){function t(t,e){for(var r=0;r<e.length;r++){var i=e[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,r,i){return r&&t(e.prototype,r),i&&t(e,i),e}}(),n=r(0);e.CordovaPopupWindow=function(){function t(e){var r=this;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this._promise=new Promise((function(t,e){r._resolve=t,r._reject=e})),this.features=e.popupWindowFeatures||"location=no,toolbar=no,zoom=no",this.target=e.popupWindowTarget||"_blank",this.redirect_uri=e.startUrl,n.Log.debug("CordovaPopupWindow.ctor: redirect_uri: "+this.redirect_uri)}return t.prototype._isInAppBrowserInstalled=function(t){return["cordova-plugin-inappbrowser","cordova-plugin-inappbrowser.inappbrowser","org.apache.cordova.inappbrowser"].some((function(e){return t.hasOwnProperty(e)}))},t.prototype.navigate=function(t){if(t&&t.url){if(!window.cordova)return this._error("cordova is undefined");var e=window.cordova.require("cordova/plugin_list").metadata;if(!1===this._isInAppBrowserInstalled(e))return this._error("InAppBrowser plugin not found");this._popup=cordova.InAppBrowser.open(t.url,this.target,this.features),this._popup?(n.Log.debug("CordovaPopupWindow.navigate: popup successfully created"),this._exitCallbackEvent=this._exitCallback.bind(this),this._loadStartCallbackEvent=this._loadStartCallback.bind(this),this._popup.addEventListener("exit",this._exitCallbackEvent,!1),this._popup.addEventListener("loadstart",this._loadStartCallbackEvent,!1)):this._error("Error opening popup window")}else this._error("No url provided");return this.promise},t.prototype._loadStartCallback=function(t){0===t.url.indexOf(this.redirect_uri)&&this._success({url:t.url})},t.prototype._exitCallback=function(t){this._error(t)},t.prototype._success=function(t){this._cleanup(),n.Log.debug("CordovaPopupWindow: Successful response from cordova popup window"),this._resolve(t)},t.prototype._error=function(t){this._cleanup(),n.Log.error(t),this._reject(new Error(t))},t.prototype.close=function(){this._cleanup()},t.prototype._cleanup=function(){this._popup&&(n.Log.debug("CordovaPopupWindow: cleaning up popup"),this._popup.removeEventListener("exit",this._exitCallbackEvent,!1),this._popup.removeEventListener("loadstart",this._loadStartCallbackEvent,!1),this._popup.close()),this._popup=null},i(t,[{key:"promise",get:function(){return this._promise}}]),t}()},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=r(0),n=r(10),o=r(5),s=r(6),a=r(37),u=r(38),h=r(16),c=r(2),f=r(48),l=r(49),d=r(19),p=r(20),g=r(18),y=r(1),m=r(15),v=r(50);e.default={Version:v.Version,Log:i.Log,OidcClient:n.OidcClient,OidcClientSettings:o.OidcClientSettings,WebStorageStateStore:s.WebStorageStateStore,InMemoryWebStorage:a.InMemoryWebStorage,UserManager:u.UserManager,AccessTokenEvents:h.AccessTokenEvents,MetadataService:c.MetadataService,CordovaPopupNavigator:f.CordovaPopupNavigator,CordovaIFrameNavigator:l.CordovaIFrameNavigator,CheckSessionIFrame:d.CheckSessionIFrame,TokenRevocationClient:p.TokenRevocationClient,SessionMonitor:g.SessionMonitor,Global:y.Global,User:m.User},t.exports=e.default},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ClockService=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)}return t.prototype.getEpochTime=function(){return Promise.resolve(Date.now()/1e3|0)},t}()},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ResponseValidator=void 0;var i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n=r(0),o=r(2),s=r(25),a=r(11),u=r(12),h=r(4);function c(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var f=["nonce","at_hash","iat","nbf","exp","aud","iss","c_hash"];e.ResponseValidator=function(){function t(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:o.MetadataService,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:s.UserInfoService,u=arguments.length>3&&void 0!==arguments[3]?arguments[3]:h.JoseUtil,f=arguments.length>4&&void 0!==arguments[4]?arguments[4]:a.TokenClient;if(c(this,t),!e)throw n.Log.error("ResponseValidator.ctor: No settings passed to ResponseValidator"),new Error("settings");this._settings=e,this._metadataService=new r(this._settings),this._userInfoService=new i(this._settings),this._joseUtil=u,this._tokenClient=new f(this._settings)}return t.prototype.validateSigninResponse=function(t,e){var r=this;return n.Log.debug("ResponseValidator.validateSigninResponse"),this._processSigninParams(t,e).then((function(e){return n.Log.debug("ResponseValidator.validateSigninResponse: state processed"),r._validateTokens(t,e).then((function(e){return n.Log.debug("ResponseValidator.validateSigninResponse: tokens validated"),r._processClaims(t,e).then((function(t){return n.Log.debug("ResponseValidator.validateSigninResponse: claims processed"),t}))}))}))},t.prototype.validateSignoutResponse=function(t,e){return t.id!==e.state?(n.Log.error("ResponseValidator.validateSignoutResponse: State does not match"),Promise.reject(new Error("State does not match"))):(n.Log.debug("ResponseValidator.validateSignoutResponse: state validated"),e.state=t.data,e.error?(n.Log.warn("ResponseValidator.validateSignoutResponse: Response was error",e.error),Promise.reject(new u.ErrorResponse(e))):Promise.resolve(e))},t.prototype._processSigninParams=function(t,e){if(t.id!==e.state)return n.Log.error("ResponseValidator._processSigninParams: State does not match"),Promise.reject(new Error("State does not match"));if(!t.client_id)return n.Log.error("ResponseValidator._processSigninParams: No client_id on state"),Promise.reject(new Error("No client_id on state"));if(!t.authority)return n.Log.error("ResponseValidator._processSigninParams: No authority on state"),Promise.reject(new Error("No authority on state"));if(this._settings.authority){if(this._settings.authority&&this._settings.authority!==t.authority)return n.Log.error("ResponseValidator._processSigninParams: authority mismatch on settings vs. signin state"),Promise.reject(new Error("authority mismatch on settings vs. signin state"))}else this._settings.authority=t.authority;if(this._settings.client_id){if(this._settings.client_id&&this._settings.client_id!==t.client_id)return n.Log.error("ResponseValidator._processSigninParams: client_id mismatch on settings vs. signin state"),Promise.reject(new Error("client_id mismatch on settings vs. signin state"))}else this._settings.client_id=t.client_id;return n.Log.debug("ResponseValidator._processSigninParams: state validated"),e.state=t.data,e.error?(n.Log.warn("ResponseValidator._processSigninParams: Response was error",e.error),Promise.reject(new u.ErrorResponse(e))):t.nonce&&!e.id_token?(n.Log.error("ResponseValidator._processSigninParams: Expecting id_token in response"),Promise.reject(new Error("No id_token in response"))):!t.nonce&&e.id_token?(n.Log.error("ResponseValidator._processSigninParams: Not expecting id_token in response"),Promise.reject(new Error("Unexpected id_token in response"))):t.code_verifier&&!e.code?(n.Log.error("ResponseValidator._processSigninParams: Expecting code in response"),Promise.reject(new Error("No code in response"))):!t.code_verifier&&e.code?(n.Log.error("ResponseValidator._processSigninParams: Not expecting code in response"),Promise.reject(new Error("Unexpected code in response"))):(e.scope||(e.scope=t.scope),Promise.resolve(e))},t.prototype._processClaims=function(t,e){var r=this;if(e.isOpenIdConnect){if(n.Log.debug("ResponseValidator._processClaims: response is OIDC, processing claims"),e.profile=this._filterProtocolClaims(e.profile),!0!==t.skipUserInfo&&this._settings.loadUserInfo&&e.access_token)return n.Log.debug("ResponseValidator._processClaims: loading user info"),this._userInfoService.getClaims(e.access_token).then((function(t){return n.Log.debug("ResponseValidator._processClaims: user info claims received from user info endpoint"),t.sub!==e.profile.sub?(n.Log.error("ResponseValidator._processClaims: sub from user info endpoint does not match sub in id_token"),Promise.reject(new Error("sub from user info endpoint does not match sub in id_token"))):(e.profile=r._mergeClaims(e.profile,t),n.Log.debug("ResponseValidator._processClaims: user info claims received, updated profile:",e.profile),e)}));n.Log.debug("ResponseValidator._processClaims: not loading user info")}else n.Log.debug("ResponseValidator._processClaims: response is not OIDC, not processing claims");return Promise.resolve(e)},t.prototype._mergeClaims=function(t,e){var r=Object.assign({},t);for(var n in e){var o=e[n];Array.isArray(o)||(o=[o]);for(var s=0;s<o.length;s++){var a=o[s];r[n]?Array.isArray(r[n])?r[n].indexOf(a)<0&&r[n].push(a):r[n]!==a&&("object"===(void 0===a?"undefined":i(a))&&this._settings.mergeClaims?r[n]=this._mergeClaims(r[n],a):r[n]=[r[n],a]):r[n]=a}}return r},t.prototype._filterProtocolClaims=function(t){n.Log.debug("ResponseValidator._filterProtocolClaims, incoming claims:",t);var e=Object.assign({},t);return this._settings._filterProtocolClaims?(f.forEach((function(t){delete e[t]})),n.Log.debug("ResponseValidator._filterProtocolClaims: protocol claims filtered",e)):n.Log.debug("ResponseValidator._filterProtocolClaims: protocol claims not filtered"),e},t.prototype._validateTokens=function(t,e){return e.code?(n.Log.debug("ResponseValidator._validateTokens: Validating code"),this._processCode(t,e)):e.id_token?e.access_token?(n.Log.debug("ResponseValidator._validateTokens: Validating id_token and access_token"),this._validateIdTokenAndAccessToken(t,e)):(n.Log.debug("ResponseValidator._validateTokens: Validating id_token"),this._validateIdToken(t,e)):(n.Log.debug("ResponseValidator._validateTokens: No code to process or id_token to validate"),Promise.resolve(e))},t.prototype._processCode=function(t,e){var r=this,o={client_id:t.client_id,client_secret:t.client_secret,code:e.code,redirect_uri:t.redirect_uri,code_verifier:t.code_verifier};return t.extraTokenParams&&"object"===i(t.extraTokenParams)&&Object.assign(o,t.extraTokenParams),this._tokenClient.exchangeCode(o).then((function(i){for(var o in i)e[o]=i[o];return e.id_token?(n.Log.debug("ResponseValidator._processCode: token response successful, processing id_token"),r._validateIdTokenAttributes(t,e)):(n.Log.debug("ResponseValidator._processCode: token response successful, returning response"),e)}))},t.prototype._validateIdTokenAttributes=function(t,e){var r=this;return this._metadataService.getIssuer().then((function(i){var o=t.client_id,s=r._settings.clockSkew;return n.Log.debug("ResponseValidator._validateIdTokenAttributes: Validaing JWT attributes; using clock skew (in seconds) of: ",s),r._settings.getEpochTime().then((function(a){return r._joseUtil.validateJwtAttributes(e.id_token,i,o,s,a).then((function(r){return t.nonce&&t.nonce!==r.nonce?(n.Log.error("ResponseValidator._validateIdTokenAttributes: Invalid nonce in id_token"),Promise.reject(new Error("Invalid nonce in id_token"))):r.sub?(e.profile=r,e):(n.Log.error("ResponseValidator._validateIdTokenAttributes: No sub present in id_token"),Promise.reject(new Error("No sub present in id_token")))}))}))}))},t.prototype._validateIdTokenAndAccessToken=function(t,e){var r=this;return this._validateIdToken(t,e).then((function(t){return r._validateAccessToken(t)}))},t.prototype._getSigningKeyForJwt=function(t){var e=this;return this._metadataService.getSigningKeys().then((function(r){var i=t.header.kid;if(!r)return n.Log.error("ResponseValidator._validateIdToken: No signing keys from metadata"),Promise.reject(new Error("No signing keys from metadata"));n.Log.debug("ResponseValidator._validateIdToken: Received signing keys");var o=void 0;if(i)o=r.filter((function(t){return t.kid===i}))[0];else{if((r=e._filterByAlg(r,t.header.alg)).length>1)return n.Log.error("ResponseValidator._validateIdToken: No kid found in id_token and more than one key found in metadata"),Promise.reject(new Error("No kid found in id_token and more than one key found in metadata"));o=r[0]}return Promise.resolve(o)}))},t.prototype._getSigningKeyForJwtWithSingleRetry=function(t){var e=this;return this._getSigningKeyForJwt(t).then((function(r){return r?Promise.resolve(r):(e._metadataService.resetSigningKeys(),e._getSigningKeyForJwt(t))}))},t.prototype._validateIdToken=function(t,e){var r=this;if(!t.nonce)return n.Log.error("ResponseValidator._validateIdToken: No nonce on state"),Promise.reject(new Error("No nonce on state"));var i=this._joseUtil.parseJwt(e.id_token);return i&&i.header&&i.payload?t.nonce!==i.payload.nonce?(n.Log.error("ResponseValidator._validateIdToken: Invalid nonce in id_token"),Promise.reject(new Error("Invalid nonce in id_token"))):this._metadataService.getIssuer().then((function(o){return n.Log.debug("ResponseValidator._validateIdToken: Received issuer"),r._getSigningKeyForJwtWithSingleRetry(i).then((function(s){if(!s)return n.Log.error("ResponseValidator._validateIdToken: No key matching kid or alg found in signing keys"),Promise.reject(new Error("No key matching kid or alg found in signing keys"));var a=t.client_id,u=r._settings.clockSkew;return n.Log.debug("ResponseValidator._validateIdToken: Validaing JWT; using clock skew (in seconds) of: ",u),r._joseUtil.validateJwt(e.id_token,s,o,a,u).then((function(){return n.Log.debug("ResponseValidator._validateIdToken: JWT validation successful"),i.payload.sub?(e.profile=i.payload,e):(n.Log.error("ResponseValidator._validateIdToken: No sub present in id_token"),Promise.reject(new Error("No sub present in id_token")))}))}))})):(n.Log.error("ResponseValidator._validateIdToken: Failed to parse id_token",i),Promise.reject(new Error("Failed to parse id_token")))},t.prototype._filterByAlg=function(t,e){var r=null;if(e.startsWith("RS"))r="RSA";else if(e.startsWith("PS"))r="PS";else{if(!e.startsWith("ES"))return n.Log.debug("ResponseValidator._filterByAlg: alg not supported: ",e),[];r="EC"}return n.Log.debug("ResponseValidator._filterByAlg: Looking for keys that match kty: ",r),t=t.filter((function(t){return t.kty===r})),n.Log.debug("ResponseValidator._filterByAlg: Number of keys that match kty: ",r,t.length),t},t.prototype._validateAccessToken=function(t){if(!t.profile)return n.Log.error("ResponseValidator._validateAccessToken: No profile loaded from id_token"),Promise.reject(new Error("No profile loaded from id_token"));if(!t.profile.at_hash)return n.Log.error("ResponseValidator._validateAccessToken: No at_hash in id_token"),Promise.reject(new Error("No at_hash in id_token"));if(!t.id_token)return n.Log.error("ResponseValidator._validateAccessToken: No id_token"),Promise.reject(new Error("No id_token"));var e=this._joseUtil.parseJwt(t.id_token);if(!e||!e.header)return n.Log.error("ResponseValidator._validateAccessToken: Failed to parse id_token",e),Promise.reject(new Error("Failed to parse id_token"));var r=e.header.alg;if(!r||5!==r.length)return n.Log.error("ResponseValidator._validateAccessToken: Unsupported alg:",r),Promise.reject(new Error("Unsupported alg: "+r));var i=r.substr(2,3);if(!i)return n.Log.error("ResponseValidator._validateAccessToken: Unsupported alg:",r,i),Promise.reject(new Error("Unsupported alg: "+r));if(256!==(i=parseInt(i))&&384!==i&&512!==i)return n.Log.error("ResponseValidator._validateAccessToken: Unsupported alg:",r,i),Promise.reject(new Error("Unsupported alg: "+r));var o="sha"+i,s=this._joseUtil.hashString(t.access_token,o);if(!s)return n.Log.error("ResponseValidator._validateAccessToken: access_token hash failed:",o),Promise.reject(new Error("Failed to validate at_hash"));var a=s.substr(0,s.length/2),u=this._joseUtil.hexToBase64Url(a);return u!==t.profile.at_hash?(n.Log.error("ResponseValidator._validateAccessToken: Failed to validate at_hash",u,t.profile.at_hash),Promise.reject(new Error("Failed to validate at_hash"))):(n.Log.debug("ResponseValidator._validateAccessToken: success"),Promise.resolve(t))},t}()},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.UserInfoService=void 0;var i=r(7),n=r(2),o=r(0),s=r(4);function a(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}e.UserInfoService=function(){function t(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:i.JsonService,u=arguments.length>2&&void 0!==arguments[2]?arguments[2]:n.MetadataService,h=arguments.length>3&&void 0!==arguments[3]?arguments[3]:s.JoseUtil;if(a(this,t),!e)throw o.Log.error("UserInfoService.ctor: No settings passed"),new Error("settings");this._settings=e,this._jsonService=new r(void 0,void 0,this._getClaimsFromJwt.bind(this)),this._metadataService=new u(this._settings),this._joseUtil=h}return t.prototype.getClaims=function(t){var e=this;return t?this._metadataService.getUserInfoEndpoint().then((function(r){return o.Log.debug("UserInfoService.getClaims: received userinfo url",r),e._jsonService.getJson(r,t).then((function(t){return o.Log.debug("UserInfoService.getClaims: claims received",t),t}))})):(o.Log.error("UserInfoService.getClaims: No token passed"),Promise.reject(new Error("A token is required")))},t.prototype._getClaimsFromJwt=function t(e){var r=this;try{var i=this._joseUtil.parseJwt(e.responseText);if(!i||!i.header||!i.payload)return o.Log.error("UserInfoService._getClaimsFromJwt: Failed to parse JWT",i),Promise.reject(new Error("Failed to parse id_token"));var n=i.header.kid,s=void 0;switch(this._settings.userInfoJwtIssuer){case"OP":s=this._metadataService.getIssuer();break;case"ANY":s=Promise.resolve(i.payload.iss);break;default:s=Promise.resolve(this._settings.userInfoJwtIssuer)}return s.then((function(t){return o.Log.debug("UserInfoService._getClaimsFromJwt: Received issuer:"+t),r._metadataService.getSigningKeys().then((function(s){if(!s)return o.Log.error("UserInfoService._getClaimsFromJwt: No signing keys from metadata"),Promise.reject(new Error("No signing keys from metadata"));o.Log.debug("UserInfoService._getClaimsFromJwt: Received signing keys");var a=void 0;if(n)a=s.filter((function(t){return t.kid===n}))[0];else{if((s=r._filterByAlg(s,i.header.alg)).length>1)return o.Log.error("UserInfoService._getClaimsFromJwt: No kid found in id_token and more than one key found in metadata"),Promise.reject(new Error("No kid found in id_token and more than one key found in metadata"));a=s[0]}if(!a)return o.Log.error("UserInfoService._getClaimsFromJwt: No key matching kid or alg found in signing keys"),Promise.reject(new Error("No key matching kid or alg found in signing keys"));var u=r._settings.client_id,h=r._settings.clockSkew;return o.Log.debug("UserInfoService._getClaimsFromJwt: Validaing JWT; using clock skew (in seconds) of: ",h),r._joseUtil.validateJwt(e.responseText,a,t,u,h,void 0,!0).then((function(){return o.Log.debug("UserInfoService._getClaimsFromJwt: JWT validation successful"),i.payload}))}))}))}catch(t){return o.Log.error("UserInfoService._getClaimsFromJwt: Error parsing JWT response",t.message),void reject(t)}},t.prototype._filterByAlg=function(t,e){var r=null;if(e.startsWith("RS"))r="RSA";else if(e.startsWith("PS"))r="PS";else{if(!e.startsWith("ES"))return o.Log.debug("UserInfoService._filterByAlg: alg not supported: ",e),[];r="EC"}return o.Log.debug("UserInfoService._filterByAlg: Looking for keys that match kty: ",r),t=t.filter((function(t){return t.kty===r})),o.Log.debug("UserInfoService._filterByAlg: Number of keys that match kty: ",r,t.length),t},t}()},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.AllowedSigningAlgs=e.b64tohex=e.hextob64u=e.crypto=e.X509=e.KeyUtil=e.jws=void 0;var i=r(27);e.jws=i.jws,e.KeyUtil=i.KEYUTIL,e.X509=i.X509,e.crypto=i.crypto,e.hextob64u=i.hextob64u,e.b64tohex=i.b64tohex,e.AllowedSigningAlgs=["RS256","RS384","RS512","PS256","PS384","PS512","ES256","ES384","ES512"]},function(t,e,r){"use strict";(function(t){Object.defineProperty(e,"__esModule",{value:!0});var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},i={userAgent:!1},n={};if(void 0===o)var o={};o.lang={extend:function(t,e,r){if(!e||!t)throw new Error("YAHOO.lang.extend failed, please check that all dependencies are included.");var n=function(){};if(n.prototype=e.prototype,t.prototype=new n,t.prototype.constructor=t,t.superclass=e.prototype,e.prototype.constructor==Object.prototype.constructor&&(e.prototype.constructor=e),r){var o;for(o in r)t.prototype[o]=r[o];var s=function(){},a=["toString","valueOf"];try{/MSIE/.test(i.userAgent)&&(s=function(t,e){for(o=0;o<a.length;o+=1){var r=a[o],i=e[r];"function"==typeof i&&i!=Object.prototype[r]&&(t[r]=i)}})}catch(t){}s(t.prototype,r)}}};var s,a,u,h,c,f,l,d,p,g,y,m=m||(s=Math,u=(a={}).lib={},h=u.Base=function(){function t(){}return{extend:function(e){t.prototype=this;var r=new t;return e&&r.mixIn(e),r.hasOwnProperty("init")||(r.init=function(){r.$super.init.apply(this,arguments)}),r.init.prototype=r,r.$super=this,r},create:function(){var t=this.extend();return t.init.apply(t,arguments),t},init:function(){},mixIn:function(t){for(var e in t)t.hasOwnProperty(e)&&(this[e]=t[e]);t.hasOwnProperty("toString")&&(this.toString=t.toString)},clone:function(){return this.init.prototype.extend(this)}}}(),c=u.WordArray=h.extend({init:function(t,e){t=this.words=t||[],this.sigBytes=null!=e?e:4*t.length},toString:function(t){return(t||l).stringify(this)},concat:function(t){var e=this.words,r=t.words,i=this.sigBytes,n=t.sigBytes;if(this.clamp(),i%4)for(var o=0;o<n;o++){var s=r[o>>>2]>>>24-o%4*8&255;e[i+o>>>2]|=s<<24-(i+o)%4*8}else for(o=0;o<n;o+=4)e[i+o>>>2]=r[o>>>2];return this.sigBytes+=n,this},clamp:function(){var t=this.words,e=this.sigBytes;t[e>>>2]&=4294967295<<32-e%4*8,t.length=s.ceil(e/4)},clone:function(){var t=h.clone.call(this);return t.words=this.words.slice(0),t},random:function(t){for(var e=[],r=0;r<t;r+=4)e.push(4294967296*s.random()|0);return new c.init(e,t)}}),f=a.enc={},l=f.Hex={stringify:function(t){for(var e=t.words,r=t.sigBytes,i=[],n=0;n<r;n++){var o=e[n>>>2]>>>24-n%4*8&255;i.push((o>>>4).toString(16)),i.push((15&o).toString(16))}return i.join("")},parse:function(t){for(var e=t.length,r=[],i=0;i<e;i+=2)r[i>>>3]|=parseInt(t.substr(i,2),16)<<24-i%8*4;return new c.init(r,e/2)}},d=f.Latin1={stringify:function(t){for(var e=t.words,r=t.sigBytes,i=[],n=0;n<r;n++){var o=e[n>>>2]>>>24-n%4*8&255;i.push(String.fromCharCode(o))}return i.join("")},parse:function(t){for(var e=t.length,r=[],i=0;i<e;i++)r[i>>>2]|=(255&t.charCodeAt(i))<<24-i%4*8;return new c.init(r,e)}},p=f.Utf8={stringify:function(t){try{return decodeURIComponent(escape(d.stringify(t)))}catch(t){throw new Error("Malformed UTF-8 data")}},parse:function(t){return d.parse(unescape(encodeURIComponent(t)))}},g=u.BufferedBlockAlgorithm=h.extend({reset:function(){this._data=new c.init,this._nDataBytes=0},_append:function(t){"string"==typeof t&&(t=p.parse(t)),this._data.concat(t),this._nDataBytes+=t.sigBytes},_process:function(t){var e=this._data,r=e.words,i=e.sigBytes,n=this.blockSize,o=i/(4*n),a=(o=t?s.ceil(o):s.max((0|o)-this._minBufferSize,0))*n,u=s.min(4*a,i);if(a){for(var h=0;h<a;h+=n)this._doProcessBlock(r,h);var f=r.splice(0,a);e.sigBytes-=u}return new c.init(f,u)},clone:function(){var t=h.clone.call(this);return t._data=this._data.clone(),t},_minBufferSize:0}),u.Hasher=g.extend({cfg:h.extend(),init:function(t){this.cfg=this.cfg.extend(t),this.reset()},reset:function(){g.reset.call(this),this._doReset()},update:function(t){return this._append(t),this._process(),this},finalize:function(t){return t&&this._append(t),this._doFinalize()},blockSize:16,_createHelper:function(t){return function(e,r){return new t.init(r).finalize(e)}},_createHmacHelper:function(t){return function(e,r){return new y.HMAC.init(t,r).finalize(e)}}}),y=a.algo={},a);!function(t){var e,r=(e=m).lib,i=r.Base,n=r.WordArray;(e=e.x64={}).Word=i.extend({init:function(t,e){this.high=t,this.low=e}}),e.WordArray=i.extend({init:function(t,e){t=this.words=t||[],this.sigBytes=null!=e?e:8*t.length},toX32:function(){for(var t=this.words,e=t.length,r=[],i=0;i<e;i++){var o=t[i];r.push(o.high),r.push(o.low)}return n.create(r,this.sigBytes)},clone:function(){for(var t=i.clone.call(this),e=t.words=this.words.slice(0),r=e.length,n=0;n<r;n++)e[n]=e[n].clone();return t}})}(),function(){var t=m,e=t.lib.WordArray;t.enc.Base64={stringify:function(t){var e=t.words,r=t.sigBytes,i=this._map;t.clamp(),t=[];for(var n=0;n<r;n+=3)for(var o=(e[n>>>2]>>>24-n%4*8&255)<<16|(e[n+1>>>2]>>>24-(n+1)%4*8&255)<<8|e[n+2>>>2]>>>24-(n+2)%4*8&255,s=0;4>s&&n+.75*s<r;s++)t.push(i.charAt(o>>>6*(3-s)&63));if(e=i.charAt(64))for(;t.length%4;)t.push(e);return t.join("")},parse:function(t){var r=t.length,i=this._map;(n=i.charAt(64))&&-1!=(n=t.indexOf(n))&&(r=n);for(var n=[],o=0,s=0;s<r;s++)if(s%4){var a=i.indexOf(t.charAt(s-1))<<s%4*2,u=i.indexOf(t.charAt(s))>>>6-s%4*2;n[o>>>2]|=(a|u)<<24-o%4*8,o++}return e.create(n,o)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="}}(),function(t){for(var e=m,r=(n=e.lib).WordArray,i=n.Hasher,n=e.algo,o=[],s=[],a=function(t){return 4294967296*(t-(0|t))|0},u=2,h=0;64>h;){var c;t:{c=u;for(var f=t.sqrt(c),l=2;l<=f;l++)if(!(c%l)){c=!1;break t}c=!0}c&&(8>h&&(o[h]=a(t.pow(u,.5))),s[h]=a(t.pow(u,1/3)),h++),u++}var d=[];n=n.SHA256=i.extend({_doReset:function(){this._hash=new r.init(o.slice(0))},_doProcessBlock:function(t,e){for(var r=this._hash.words,i=r[0],n=r[1],o=r[2],a=r[3],u=r[4],h=r[5],c=r[6],f=r[7],l=0;64>l;l++){if(16>l)d[l]=0|t[e+l];else{var p=d[l-15],g=d[l-2];d[l]=((p<<25|p>>>7)^(p<<14|p>>>18)^p>>>3)+d[l-7]+((g<<15|g>>>17)^(g<<13|g>>>19)^g>>>10)+d[l-16]}p=f+((u<<26|u>>>6)^(u<<21|u>>>11)^(u<<7|u>>>25))+(u&h^~u&c)+s[l]+d[l],g=((i<<30|i>>>2)^(i<<19|i>>>13)^(i<<10|i>>>22))+(i&n^i&o^n&o),f=c,c=h,h=u,u=a+p|0,a=o,o=n,n=i,i=p+g|0}r[0]=r[0]+i|0,r[1]=r[1]+n|0,r[2]=r[2]+o|0,r[3]=r[3]+a|0,r[4]=r[4]+u|0,r[5]=r[5]+h|0,r[6]=r[6]+c|0,r[7]=r[7]+f|0},_doFinalize:function(){var e=this._data,r=e.words,i=8*this._nDataBytes,n=8*e.sigBytes;return r[n>>>5]|=128<<24-n%32,r[14+(n+64>>>9<<4)]=t.floor(i/4294967296),r[15+(n+64>>>9<<4)]=i,e.sigBytes=4*r.length,this._process(),this._hash},clone:function(){var t=i.clone.call(this);return t._hash=this._hash.clone(),t}}),e.SHA256=i._createHelper(n),e.HmacSHA256=i._createHmacHelper(n)}(Math),function(){function t(){return i.create.apply(i,arguments)}for(var e=m,r=e.lib.Hasher,i=(o=e.x64).Word,n=o.WordArray,o=e.algo,s=[t(1116352408,3609767458),t(1899447441,602891725),t(3049323471,3964484399),t(3921009573,2173295548),t(961987163,4081628472),t(1508970993,3053834265),t(2453635748,2937671579),t(2870763221,3664609560),t(3624381080,2734883394),t(310598401,1164996542),t(607225278,1323610764),t(1426881987,3590304994),t(1925078388,4068182383),t(2162078206,991336113),t(2614888103,633803317),t(3248222580,3479774868),t(3835390401,2666613458),t(4022224774,944711139),t(264347078,2341262773),t(604807628,2007800933),t(770255983,1495990901),t(1249150122,1856431235),t(1555081692,3175218132),t(1996064986,2198950837),t(2554220882,3999719339),t(2821834349,766784016),t(2952996808,2566594879),t(3210313671,3203337956),t(3336571891,1034457026),t(3584528711,2466948901),t(113926993,3758326383),t(338241895,168717936),t(666307205,1188179964),t(773529912,1546045734),t(1294757372,1522805485),t(1396182291,2643833823),t(1695183700,2343527390),t(1986661051,1014477480),t(2177026350,1206759142),t(2456956037,344077627),t(2730485921,1290863460),t(2820302411,3158454273),t(3259730800,3505952657),t(3345764771,106217008),t(3516065817,3606008344),t(3600352804,1432725776),t(4094571909,1467031594),t(275423344,851169720),t(430227734,3100823752),t(506948616,1363258195),t(659060556,3750685593),t(883997877,3785050280),t(958139571,3318307427),t(1322822218,3812723403),t(1537002063,2003034995),t(1747873779,3602036899),t(1955562222,1575990012),t(2024104815,1125592928),t(2227730452,2716904306),t(2361852424,442776044),t(2428436474,593698344),t(2756734187,3733110249),t(3204031479,2999351573),t(3329325298,3815920427),t(3391569614,3928383900),t(3515267271,566280711),t(3940187606,3454069534),t(4118630271,4000239992),t(116418474,1914138554),t(174292421,2731055270),t(289380356,3203993006),t(460393269,320620315),t(685471733,587496836),t(852142971,1086792851),t(1017036298,365543100),t(1126000580,2618297676),t(1288033470,3409855158),t(1501505948,4234509866),t(1607167915,987167468),t(1816402316,1246189591)],a=[],u=0;80>u;u++)a[u]=t();o=o.SHA512=r.extend({_doReset:function(){this._hash=new n.init([new i.init(1779033703,4089235720),new i.init(3144134277,2227873595),new i.init(1013904242,4271175723),new i.init(2773480762,1595750129),new i.init(1359893119,2917565137),new i.init(2600822924,725511199),new i.init(528734635,4215389547),new i.init(1541459225,327033209)])},_doProcessBlock:function(t,e){for(var r=(f=this._hash.words)[0],i=f[1],n=f[2],o=f[3],u=f[4],h=f[5],c=f[6],f=f[7],l=r.high,d=r.low,p=i.high,g=i.low,y=n.high,m=n.low,v=o.high,b=o.low,w=u.high,_=u.low,S=h.high,E=h.low,M=c.high,A=c.low,C=f.high,k=f.low,I=l,T=d,R=p,B=g,x=y,F=m,P=v,N=b,O=w,L=_,U=S,j=E,D=M,K=A,V=C,H=k,q=0;80>q;q++){var z=a[q];if(16>q)var W=z.high=0|t[e+2*q],G=z.low=0|t[e+2*q+1];else{W=((G=(W=a[q-15]).high)>>>1|(J=W.low)<<31)^(G>>>8|J<<24)^G>>>7;var J=(J>>>1|G<<31)^(J>>>8|G<<24)^(J>>>7|G<<25),Z=((G=(Z=a[q-2]).high)>>>19|($=Z.low)<<13)^(G<<3|$>>>29)^G>>>6,$=($>>>19|G<<13)^($<<3|G>>>29)^($>>>6|G<<26),Y=(G=a[q-7]).high,Q=(X=a[q-16]).high,X=X.low;W=(W=(W=W+Y+((G=J+G.low)>>>0<J>>>0?1:0))+Z+((G+=$)>>>0<$>>>0?1:0))+Q+((G+=X)>>>0<X>>>0?1:0),z.high=W,z.low=G}Y=O&U^~O&D,X=L&j^~L&K,z=I&R^I&x^R&x;var tt=T&B^T&F^B&F,et=(J=(I>>>28|T<<4)^(I<<30|T>>>2)^(I<<25|T>>>7),Z=(T>>>28|I<<4)^(T<<30|I>>>2)^(T<<25|I>>>7),($=s[q]).high),rt=$.low;Q=V+((O>>>14|L<<18)^(O>>>18|L<<14)^(O<<23|L>>>9))+(($=H+((L>>>14|O<<18)^(L>>>18|O<<14)^(L<<23|O>>>9)))>>>0<H>>>0?1:0),V=D,H=K,D=U,K=j,U=O,j=L,O=P+(Q=(Q=(Q=Q+Y+(($+=X)>>>0<X>>>0?1:0))+et+(($+=rt)>>>0<rt>>>0?1:0))+W+(($+=G)>>>0<G>>>0?1:0))+((L=N+$|0)>>>0<N>>>0?1:0)|0,P=x,N=F,x=R,F=B,R=I,B=T,I=Q+(z=J+z+((G=Z+tt)>>>0<Z>>>0?1:0))+((T=$+G|0)>>>0<$>>>0?1:0)|0}d=r.low=d+T,r.high=l+I+(d>>>0<T>>>0?1:0),g=i.low=g+B,i.high=p+R+(g>>>0<B>>>0?1:0),m=n.low=m+F,n.high=y+x+(m>>>0<F>>>0?1:0),b=o.low=b+N,o.high=v+P+(b>>>0<N>>>0?1:0),_=u.low=_+L,u.high=w+O+(_>>>0<L>>>0?1:0),E=h.low=E+j,h.high=S+U+(E>>>0<j>>>0?1:0),A=c.low=A+K,c.high=M+D+(A>>>0<K>>>0?1:0),k=f.low=k+H,f.high=C+V+(k>>>0<H>>>0?1:0)},_doFinalize:function(){var t=this._data,e=t.words,r=8*this._nDataBytes,i=8*t.sigBytes;return e[i>>>5]|=128<<24-i%32,e[30+(i+128>>>10<<5)]=Math.floor(r/4294967296),e[31+(i+128>>>10<<5)]=r,t.sigBytes=4*e.length,this._process(),this._hash.toX32()},clone:function(){var t=r.clone.call(this);return t._hash=this._hash.clone(),t},blockSize:32}),e.SHA512=r._createHelper(o),e.HmacSHA512=r._createHmacHelper(o)}(),function(){var t=m,e=(n=t.x64).Word,r=n.WordArray,i=(n=t.algo).SHA512,n=n.SHA384=i.extend({_doReset:function(){this._hash=new r.init([new e.init(3418070365,3238371032),new e.init(1654270250,914150663),new e.init(2438529370,812702999),new e.init(355462360,4144912697),new e.init(1731405415,4290775857),new e.init(2394180231,1750603025),new e.init(3675008525,1694076839),new e.init(1203062813,3204075428)])},_doFinalize:function(){var t=i._doFinalize.call(this);return t.sigBytes-=16,t}});t.SHA384=i._createHelper(n),t.HmacSHA384=i._createHmacHelper(n)}();var v,b="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";function w(t){var e,r,i="";for(e=0;e+3<=t.length;e+=3)r=parseInt(t.substring(e,e+3),16),i+=b.charAt(r>>6)+b.charAt(63&r);for(e+1==t.length?(r=parseInt(t.substring(e,e+1),16),i+=b.charAt(r<<2)):e+2==t.length&&(r=parseInt(t.substring(e,e+2),16),i+=b.charAt(r>>2)+b.charAt((3&r)<<4));(3&i.length)>0;)i+="=";return i}function _(t){var e,r,i,n="",o=0;for(e=0;e<t.length&&"="!=t.charAt(e);++e)(i=b.indexOf(t.charAt(e)))<0||(0==o?(n+=I(i>>2),r=3&i,o=1):1==o?(n+=I(r<<2|i>>4),r=15&i,o=2):2==o?(n+=I(r),n+=I(i>>2),r=3&i,o=3):(n+=I(r<<2|i>>4),n+=I(15&i),o=0));return 1==o&&(n+=I(r<<2)),n}function S(t){var e,r=_(t),i=new Array;for(e=0;2*e<r.length;++e)i[e]=parseInt(r.substring(2*e,2*e+2),16);return i}function E(t,e,r){null!=t&&("number"==typeof t?this.fromNumber(t,e,r):null==e&&"string"!=typeof t?this.fromString(t,256):this.fromString(t,e))}function M(){return new E(null)}"Microsoft Internet Explorer"==i.appName?(E.prototype.am=function(t,e,r,i,n,o){for(var s=32767&e,a=e>>15;--o>=0;){var u=32767&this[t],h=this[t++]>>15,c=a*u+h*s;n=((u=s*u+((32767&c)<<15)+r[i]+(1073741823&n))>>>30)+(c>>>15)+a*h+(n>>>30),r[i++]=1073741823&u}return n},v=30):"Netscape"!=i.appName?(E.prototype.am=function(t,e,r,i,n,o){for(;--o>=0;){var s=e*this[t++]+r[i]+n;n=Math.floor(s/67108864),r[i++]=67108863&s}return n},v=26):(E.prototype.am=function(t,e,r,i,n,o){for(var s=16383&e,a=e>>14;--o>=0;){var u=16383&this[t],h=this[t++]>>14,c=a*u+h*s;n=((u=s*u+((16383&c)<<14)+r[i]+n)>>28)+(c>>14)+a*h,r[i++]=268435455&u}return n},v=28),E.prototype.DB=v,E.prototype.DM=(1<<v)-1,E.prototype.DV=1<<v,E.prototype.FV=Math.pow(2,52),E.prototype.F1=52-v,E.prototype.F2=2*v-52;var A,C,k=new Array;for(A="0".charCodeAt(0),C=0;C<=9;++C)k[A++]=C;for(A="a".charCodeAt(0),C=10;C<36;++C)k[A++]=C;for(A="A".charCodeAt(0),C=10;C<36;++C)k[A++]=C;function I(t){return"0123456789abcdefghijklmnopqrstuvwxyz".charAt(t)}function T(t,e){var r=k[t.charCodeAt(e)];return null==r?-1:r}function R(t){var e=M();return e.fromInt(t),e}function B(t){var e,r=1;return 0!=(e=t>>>16)&&(t=e,r+=16),0!=(e=t>>8)&&(t=e,r+=8),0!=(e=t>>4)&&(t=e,r+=4),0!=(e=t>>2)&&(t=e,r+=2),0!=(e=t>>1)&&(t=e,r+=1),r}function x(t){this.m=t}function F(t){this.m=t,this.mp=t.invDigit(),this.mpl=32767&this.mp,this.mph=this.mp>>15,this.um=(1<<t.DB-15)-1,this.mt2=2*t.t}function P(t,e){return t&e}function N(t,e){return t|e}function O(t,e){return t^e}function L(t,e){return t&~e}function U(t){if(0==t)return-1;var e=0;return 0==(65535&t)&&(t>>=16,e+=16),0==(255&t)&&(t>>=8,e+=8),0==(15&t)&&(t>>=4,e+=4),0==(3&t)&&(t>>=2,e+=2),0==(1&t)&&++e,e}function j(t){for(var e=0;0!=t;)t&=t-1,++e;return e}function D(){}function K(t){return t}function V(t){this.r2=M(),this.q3=M(),E.ONE.dlShiftTo(2*t.t,this.r2),this.mu=this.r2.divide(t),this.m=t}x.prototype.convert=function(t){return t.s<0||t.compareTo(this.m)>=0?t.mod(this.m):t},x.prototype.revert=function(t){return t},x.prototype.reduce=function(t){t.divRemTo(this.m,null,t)},x.prototype.mulTo=function(t,e,r){t.multiplyTo(e,r),this.reduce(r)},x.prototype.sqrTo=function(t,e){t.squareTo(e),this.reduce(e)},F.prototype.convert=function(t){var e=M();return t.abs().dlShiftTo(this.m.t,e),e.divRemTo(this.m,null,e),t.s<0&&e.compareTo(E.ZERO)>0&&this.m.subTo(e,e),e},F.prototype.revert=function(t){var e=M();return t.copyTo(e),this.reduce(e),e},F.prototype.reduce=function(t){for(;t.t<=this.mt2;)t[t.t++]=0;for(var e=0;e<this.m.t;++e){var r=32767&t[e],i=r*this.mpl+((r*this.mph+(t[e]>>15)*this.mpl&this.um)<<15)&t.DM;for(t[r=e+this.m.t]+=this.m.am(0,i,t,e,0,this.m.t);t[r]>=t.DV;)t[r]-=t.DV,t[++r]++}t.clamp(),t.drShiftTo(this.m.t,t),t.compareTo(this.m)>=0&&t.subTo(this.m,t)},F.prototype.mulTo=function(t,e,r){t.multiplyTo(e,r),this.reduce(r)},F.prototype.sqrTo=function(t,e){t.squareTo(e),this.reduce(e)},E.prototype.copyTo=function(t){for(var e=this.t-1;e>=0;--e)t[e]=this[e];t.t=this.t,t.s=this.s},E.prototype.fromInt=function(t){this.t=1,this.s=t<0?-1:0,t>0?this[0]=t:t<-1?this[0]=t+this.DV:this.t=0},E.prototype.fromString=function(t,e){var r;if(16==e)r=4;else if(8==e)r=3;else if(256==e)r=8;else if(2==e)r=1;else if(32==e)r=5;else{if(4!=e)return void this.fromRadix(t,e);r=2}this.t=0,this.s=0;for(var i=t.length,n=!1,o=0;--i>=0;){var s=8==r?255&t[i]:T(t,i);s<0?"-"==t.charAt(i)&&(n=!0):(n=!1,0==o?this[this.t++]=s:o+r>this.DB?(this[this.t-1]|=(s&(1<<this.DB-o)-1)<<o,this[this.t++]=s>>this.DB-o):this[this.t-1]|=s<<o,(o+=r)>=this.DB&&(o-=this.DB))}8==r&&0!=(128&t[0])&&(this.s=-1,o>0&&(this[this.t-1]|=(1<<this.DB-o)-1<<o)),this.clamp(),n&&E.ZERO.subTo(this,this)},E.prototype.clamp=function(){for(var t=this.s&this.DM;this.t>0&&this[this.t-1]==t;)--this.t},E.prototype.dlShiftTo=function(t,e){var r;for(r=this.t-1;r>=0;--r)e[r+t]=this[r];for(r=t-1;r>=0;--r)e[r]=0;e.t=this.t+t,e.s=this.s},E.prototype.drShiftTo=function(t,e){for(var r=t;r<this.t;++r)e[r-t]=this[r];e.t=Math.max(this.t-t,0),e.s=this.s},E.prototype.lShiftTo=function(t,e){var r,i=t%this.DB,n=this.DB-i,o=(1<<n)-1,s=Math.floor(t/this.DB),a=this.s<<i&this.DM;for(r=this.t-1;r>=0;--r)e[r+s+1]=this[r]>>n|a,a=(this[r]&o)<<i;for(r=s-1;r>=0;--r)e[r]=0;e[s]=a,e.t=this.t+s+1,e.s=this.s,e.clamp()},E.prototype.rShiftTo=function(t,e){e.s=this.s;var r=Math.floor(t/this.DB);if(r>=this.t)e.t=0;else{var i=t%this.DB,n=this.DB-i,o=(1<<i)-1;e[0]=this[r]>>i;for(var s=r+1;s<this.t;++s)e[s-r-1]|=(this[s]&o)<<n,e[s-r]=this[s]>>i;i>0&&(e[this.t-r-1]|=(this.s&o)<<n),e.t=this.t-r,e.clamp()}},E.prototype.subTo=function(t,e){for(var r=0,i=0,n=Math.min(t.t,this.t);r<n;)i+=this[r]-t[r],e[r++]=i&this.DM,i>>=this.DB;if(t.t<this.t){for(i-=t.s;r<this.t;)i+=this[r],e[r++]=i&this.DM,i>>=this.DB;i+=this.s}else{for(i+=this.s;r<t.t;)i-=t[r],e[r++]=i&this.DM,i>>=this.DB;i-=t.s}e.s=i<0?-1:0,i<-1?e[r++]=this.DV+i:i>0&&(e[r++]=i),e.t=r,e.clamp()},E.prototype.multiplyTo=function(t,e){var r=this.abs(),i=t.abs(),n=r.t;for(e.t=n+i.t;--n>=0;)e[n]=0;for(n=0;n<i.t;++n)e[n+r.t]=r.am(0,i[n],e,n,0,r.t);e.s=0,e.clamp(),this.s!=t.s&&E.ZERO.subTo(e,e)},E.prototype.squareTo=function(t){for(var e=this.abs(),r=t.t=2*e.t;--r>=0;)t[r]=0;for(r=0;r<e.t-1;++r){var i=e.am(r,e[r],t,2*r,0,1);(t[r+e.t]+=e.am(r+1,2*e[r],t,2*r+1,i,e.t-r-1))>=e.DV&&(t[r+e.t]-=e.DV,t[r+e.t+1]=1)}t.t>0&&(t[t.t-1]+=e.am(r,e[r],t,2*r,0,1)),t.s=0,t.clamp()},E.prototype.divRemTo=function(t,e,r){var i=t.abs();if(!(i.t<=0)){var n=this.abs();if(n.t<i.t)return null!=e&&e.fromInt(0),void(null!=r&&this.copyTo(r));null==r&&(r=M());var o=M(),s=this.s,a=t.s,u=this.DB-B(i[i.t-1]);u>0?(i.lShiftTo(u,o),n.lShiftTo(u,r)):(i.copyTo(o),n.copyTo(r));var h=o.t,c=o[h-1];if(0!=c){var f=c*(1<<this.F1)+(h>1?o[h-2]>>this.F2:0),l=this.FV/f,d=(1<<this.F1)/f,p=1<<this.F2,g=r.t,y=g-h,m=null==e?M():e;for(o.dlShiftTo(y,m),r.compareTo(m)>=0&&(r[r.t++]=1,r.subTo(m,r)),E.ONE.dlShiftTo(h,m),m.subTo(o,o);o.t<h;)o[o.t++]=0;for(;--y>=0;){var v=r[--g]==c?this.DM:Math.floor(r[g]*l+(r[g-1]+p)*d);if((r[g]+=o.am(0,v,r,y,0,h))<v)for(o.dlShiftTo(y,m),r.subTo(m,r);r[g]<--v;)r.subTo(m,r)}null!=e&&(r.drShiftTo(h,e),s!=a&&E.ZERO.subTo(e,e)),r.t=h,r.clamp(),u>0&&r.rShiftTo(u,r),s<0&&E.ZERO.subTo(r,r)}}},E.prototype.invDigit=function(){if(this.t<1)return 0;var t=this[0];if(0==(1&t))return 0;var e=3&t;return(e=(e=(e=(e=e*(2-(15&t)*e)&15)*(2-(255&t)*e)&255)*(2-((65535&t)*e&65535))&65535)*(2-t*e%this.DV)%this.DV)>0?this.DV-e:-e},E.prototype.isEven=function(){return 0==(this.t>0?1&this[0]:this.s)},E.prototype.exp=function(t,e){if(t>4294967295||t<1)return E.ONE;var r=M(),i=M(),n=e.convert(this),o=B(t)-1;for(n.copyTo(r);--o>=0;)if(e.sqrTo(r,i),(t&1<<o)>0)e.mulTo(i,n,r);else{var s=r;r=i,i=s}return e.revert(r)},E.prototype.toString=function(t){if(this.s<0)return"-"+this.negate().toString(t);var e;if(16==t)e=4;else if(8==t)e=3;else if(2==t)e=1;else if(32==t)e=5;else{if(4!=t)return this.toRadix(t);e=2}var r,i=(1<<e)-1,n=!1,o="",s=this.t,a=this.DB-s*this.DB%e;if(s-- >0)for(a<this.DB&&(r=this[s]>>a)>0&&(n=!0,o=I(r));s>=0;)a<e?(r=(this[s]&(1<<a)-1)<<e-a,r|=this[--s]>>(a+=this.DB-e)):(r=this[s]>>(a-=e)&i,a<=0&&(a+=this.DB,--s)),r>0&&(n=!0),n&&(o+=I(r));return n?o:"0"},E.prototype.negate=function(){var t=M();return E.ZERO.subTo(this,t),t},E.prototype.abs=function(){return this.s<0?this.negate():this},E.prototype.compareTo=function(t){var e=this.s-t.s;if(0!=e)return e;var r=this.t;if(0!=(e=r-t.t))return this.s<0?-e:e;for(;--r>=0;)if(0!=(e=this[r]-t[r]))return e;return 0},E.prototype.bitLength=function(){return this.t<=0?0:this.DB*(this.t-1)+B(this[this.t-1]^this.s&this.DM)},E.prototype.mod=function(t){var e=M();return this.abs().divRemTo(t,null,e),this.s<0&&e.compareTo(E.ZERO)>0&&t.subTo(e,e),e},E.prototype.modPowInt=function(t,e){var r;return r=t<256||e.isEven()?new x(e):new F(e),this.exp(t,r)},E.ZERO=R(0),E.ONE=R(1),D.prototype.convert=K,D.prototype.revert=K,D.prototype.mulTo=function(t,e,r){t.multiplyTo(e,r)},D.prototype.sqrTo=function(t,e){t.squareTo(e)},V.prototype.convert=function(t){if(t.s<0||t.t>2*this.m.t)return t.mod(this.m);if(t.compareTo(this.m)<0)return t;var e=M();return t.copyTo(e),this.reduce(e),e},V.prototype.revert=function(t){return t},V.prototype.reduce=function(t){for(t.drShiftTo(this.m.t-1,this.r2),t.t>this.m.t+1&&(t.t=this.m.t+1,t.clamp()),this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3),this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);t.compareTo(this.r2)<0;)t.dAddOffset(1,this.m.t+1);for(t.subTo(this.r2,t);t.compareTo(this.m)>=0;)t.subTo(this.m,t)},V.prototype.mulTo=function(t,e,r){t.multiplyTo(e,r),this.reduce(r)},V.prototype.sqrTo=function(t,e){t.squareTo(e),this.reduce(e)};var H,q,z,W=[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509,521,523,541,547,557,563,569,571,577,587,593,599,601,607,613,617,619,631,641,643,647,653,659,661,673,677,683,691,701,709,719,727,733,739,743,751,757,761,769,773,787,797,809,811,821,823,827,829,839,853,857,859,863,877,881,883,887,907,911,919,929,937,941,947,953,967,971,977,983,991,997],G=(1<<26)/W[W.length-1];function J(){this.i=0,this.j=0,this.S=new Array}function Z(){!function(t){q[z++]^=255&t,q[z++]^=t>>8&255,q[z++]^=t>>16&255,q[z++]^=t>>24&255,z>=256&&(z-=256)}((new Date).getTime())}if(E.prototype.chunkSize=function(t){return Math.floor(Math.LN2*this.DB/Math.log(t))},E.prototype.toRadix=function(t){if(null==t&&(t=10),0==this.signum()||t<2||t>36)return"0";var e=this.chunkSize(t),r=Math.pow(t,e),i=R(r),n=M(),o=M(),s="";for(this.divRemTo(i,n,o);n.signum()>0;)s=(r+o.intValue()).toString(t).substr(1)+s,n.divRemTo(i,n,o);return o.intValue().toString(t)+s},E.prototype.fromRadix=function(t,e){this.fromInt(0),null==e&&(e=10);for(var r=this.chunkSize(e),i=Math.pow(e,r),n=!1,o=0,s=0,a=0;a<t.length;++a){var u=T(t,a);u<0?"-"==t.charAt(a)&&0==this.signum()&&(n=!0):(s=e*s+u,++o>=r&&(this.dMultiply(i),this.dAddOffset(s,0),o=0,s=0))}o>0&&(this.dMultiply(Math.pow(e,o)),this.dAddOffset(s,0)),n&&E.ZERO.subTo(this,this)},E.prototype.fromNumber=function(t,e,r){if("number"==typeof e)if(t<2)this.fromInt(1);else for(this.fromNumber(t,r),this.testBit(t-1)||this.bitwiseTo(E.ONE.shiftLeft(t-1),N,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(e);)this.dAddOffset(2,0),this.bitLength()>t&&this.subTo(E.ONE.shiftLeft(t-1),this);else{var i=new Array,n=7&t;i.length=1+(t>>3),e.nextBytes(i),n>0?i[0]&=(1<<n)-1:i[0]=0,this.fromString(i,256)}},E.prototype.bitwiseTo=function(t,e,r){var i,n,o=Math.min(t.t,this.t);for(i=0;i<o;++i)r[i]=e(this[i],t[i]);if(t.t<this.t){for(n=t.s&this.DM,i=o;i<this.t;++i)r[i]=e(this[i],n);r.t=this.t}else{for(n=this.s&this.DM,i=o;i<t.t;++i)r[i]=e(n,t[i]);r.t=t.t}r.s=e(this.s,t.s),r.clamp()},E.prototype.changeBit=function(t,e){var r=E.ONE.shiftLeft(t);return this.bitwiseTo(r,e,r),r},E.prototype.addTo=function(t,e){for(var r=0,i=0,n=Math.min(t.t,this.t);r<n;)i+=this[r]+t[r],e[r++]=i&this.DM,i>>=this.DB;if(t.t<this.t){for(i+=t.s;r<this.t;)i+=this[r],e[r++]=i&this.DM,i>>=this.DB;i+=this.s}else{for(i+=this.s;r<t.t;)i+=t[r],e[r++]=i&this.DM,i>>=this.DB;i+=t.s}e.s=i<0?-1:0,i>0?e[r++]=i:i<-1&&(e[r++]=this.DV+i),e.t=r,e.clamp()},E.prototype.dMultiply=function(t){this[this.t]=this.am(0,t-1,this,0,0,this.t),++this.t,this.clamp()},E.prototype.dAddOffset=function(t,e){if(0!=t){for(;this.t<=e;)this[this.t++]=0;for(this[e]+=t;this[e]>=this.DV;)this[e]-=this.DV,++e>=this.t&&(this[this.t++]=0),++this[e]}},E.prototype.multiplyLowerTo=function(t,e,r){var i,n=Math.min(this.t+t.t,e);for(r.s=0,r.t=n;n>0;)r[--n]=0;for(i=r.t-this.t;n<i;++n)r[n+this.t]=this.am(0,t[n],r,n,0,this.t);for(i=Math.min(t.t,e);n<i;++n)this.am(0,t[n],r,n,0,e-n);r.clamp()},E.prototype.multiplyUpperTo=function(t,e,r){--e;var i=r.t=this.t+t.t-e;for(r.s=0;--i>=0;)r[i]=0;for(i=Math.max(e-this.t,0);i<t.t;++i)r[this.t+i-e]=this.am(e-i,t[i],r,0,0,this.t+i-e);r.clamp(),r.drShiftTo(1,r)},E.prototype.modInt=function(t){if(t<=0)return 0;var e=this.DV%t,r=this.s<0?t-1:0;if(this.t>0)if(0==e)r=this[0]%t;else for(var i=this.t-1;i>=0;--i)r=(e*r+this[i])%t;return r},E.prototype.millerRabin=function(t){var e=this.subtract(E.ONE),r=e.getLowestSetBit();if(r<=0)return!1;var i=e.shiftRight(r);(t=t+1>>1)>W.length&&(t=W.length);for(var n=M(),o=0;o<t;++o){n.fromInt(W[Math.floor(Math.random()*W.length)]);var s=n.modPow(i,this);if(0!=s.compareTo(E.ONE)&&0!=s.compareTo(e)){for(var a=1;a++<r&&0!=s.compareTo(e);)if(0==(s=s.modPowInt(2,this)).compareTo(E.ONE))return!1;if(0!=s.compareTo(e))return!1}}return!0},E.prototype.clone=function(){var t=M();return this.copyTo(t),t},E.prototype.intValue=function(){if(this.s<0){if(1==this.t)return this[0]-this.DV;if(0==this.t)return-1}else{if(1==this.t)return this[0];if(0==this.t)return 0}return(this[1]&(1<<32-this.DB)-1)<<this.DB|this[0]},E.prototype.byteValue=function(){return 0==this.t?this.s:this[0]<<24>>24},E.prototype.shortValue=function(){return 0==this.t?this.s:this[0]<<16>>16},E.prototype.signum=function(){return this.s<0?-1:this.t<=0||1==this.t&&this[0]<=0?0:1},E.prototype.toByteArray=function(){var t=this.t,e=new Array;e[0]=this.s;var r,i=this.DB-t*this.DB%8,n=0;if(t-- >0)for(i<this.DB&&(r=this[t]>>i)!=(this.s&this.DM)>>i&&(e[n++]=r|this.s<<this.DB-i);t>=0;)i<8?(r=(this[t]&(1<<i)-1)<<8-i,r|=this[--t]>>(i+=this.DB-8)):(r=this[t]>>(i-=8)&255,i<=0&&(i+=this.DB,--t)),0!=(128&r)&&(r|=-256),0==n&&(128&this.s)!=(128&r)&&++n,(n>0||r!=this.s)&&(e[n++]=r);return e},E.prototype.equals=function(t){return 0==this.compareTo(t)},E.prototype.min=function(t){return this.compareTo(t)<0?this:t},E.prototype.max=function(t){return this.compareTo(t)>0?this:t},E.prototype.and=function(t){var e=M();return this.bitwiseTo(t,P,e),e},E.prototype.or=function(t){var e=M();return this.bitwiseTo(t,N,e),e},E.prototype.xor=function(t){var e=M();return this.bitwiseTo(t,O,e),e},E.prototype.andNot=function(t){var e=M();return this.bitwiseTo(t,L,e),e},E.prototype.not=function(){for(var t=M(),e=0;e<this.t;++e)t[e]=this.DM&~this[e];return t.t=this.t,t.s=~this.s,t},E.prototype.shiftLeft=function(t){var e=M();return t<0?this.rShiftTo(-t,e):this.lShiftTo(t,e),e},E.prototype.shiftRight=function(t){var e=M();return t<0?this.lShiftTo(-t,e):this.rShiftTo(t,e),e},E.prototype.getLowestSetBit=function(){for(var t=0;t<this.t;++t)if(0!=this[t])return t*this.DB+U(this[t]);return this.s<0?this.t*this.DB:-1},E.prototype.bitCount=function(){for(var t=0,e=this.s&this.DM,r=0;r<this.t;++r)t+=j(this[r]^e);return t},E.prototype.testBit=function(t){var e=Math.floor(t/this.DB);return e>=this.t?0!=this.s:0!=(this[e]&1<<t%this.DB)},E.prototype.setBit=function(t){return this.changeBit(t,N)},E.prototype.clearBit=function(t){return this.changeBit(t,L)},E.prototype.flipBit=function(t){return this.changeBit(t,O)},E.prototype.add=function(t){var e=M();return this.addTo(t,e),e},E.prototype.subtract=function(t){var e=M();return this.subTo(t,e),e},E.prototype.multiply=function(t){var e=M();return this.multiplyTo(t,e),e},E.prototype.divide=function(t){var e=M();return this.divRemTo(t,e,null),e},E.prototype.remainder=function(t){var e=M();return this.divRemTo(t,null,e),e},E.prototype.divideAndRemainder=function(t){var e=M(),r=M();return this.divRemTo(t,e,r),new Array(e,r)},E.prototype.modPow=function(t,e){var r,i,n=t.bitLength(),o=R(1);if(n<=0)return o;r=n<18?1:n<48?3:n<144?4:n<768?5:6,i=n<8?new x(e):e.isEven()?new V(e):new F(e);var s=new Array,a=3,u=r-1,h=(1<<r)-1;if(s[1]=i.convert(this),r>1){var c=M();for(i.sqrTo(s[1],c);a<=h;)s[a]=M(),i.mulTo(c,s[a-2],s[a]),a+=2}var f,l,d=t.t-1,p=!0,g=M();for(n=B(t[d])-1;d>=0;){for(n>=u?f=t[d]>>n-u&h:(f=(t[d]&(1<<n+1)-1)<<u-n,d>0&&(f|=t[d-1]>>this.DB+n-u)),a=r;0==(1&f);)f>>=1,--a;if((n-=a)<0&&(n+=this.DB,--d),p)s[f].copyTo(o),p=!1;else{for(;a>1;)i.sqrTo(o,g),i.sqrTo(g,o),a-=2;a>0?i.sqrTo(o,g):(l=o,o=g,g=l),i.mulTo(g,s[f],o)}for(;d>=0&&0==(t[d]&1<<n);)i.sqrTo(o,g),l=o,o=g,g=l,--n<0&&(n=this.DB-1,--d)}return i.revert(o)},E.prototype.modInverse=function(t){var e=t.isEven();if(this.isEven()&&e||0==t.signum())return E.ZERO;for(var r=t.clone(),i=this.clone(),n=R(1),o=R(0),s=R(0),a=R(1);0!=r.signum();){for(;r.isEven();)r.rShiftTo(1,r),e?(n.isEven()&&o.isEven()||(n.addTo(this,n),o.subTo(t,o)),n.rShiftTo(1,n)):o.isEven()||o.subTo(t,o),o.rShiftTo(1,o);for(;i.isEven();)i.rShiftTo(1,i),e?(s.isEven()&&a.isEven()||(s.addTo(this,s),a.subTo(t,a)),s.rShiftTo(1,s)):a.isEven()||a.subTo(t,a),a.rShiftTo(1,a);r.compareTo(i)>=0?(r.subTo(i,r),e&&n.subTo(s,n),o.subTo(a,o)):(i.subTo(r,i),e&&s.subTo(n,s),a.subTo(o,a))}return 0!=i.compareTo(E.ONE)?E.ZERO:a.compareTo(t)>=0?a.subtract(t):a.signum()<0?(a.addTo(t,a),a.signum()<0?a.add(t):a):a},E.prototype.pow=function(t){return this.exp(t,new D)},E.prototype.gcd=function(t){var e=this.s<0?this.negate():this.clone(),r=t.s<0?t.negate():t.clone();if(e.compareTo(r)<0){var i=e;e=r,r=i}var n=e.getLowestSetBit(),o=r.getLowestSetBit();if(o<0)return e;for(n<o&&(o=n),o>0&&(e.rShiftTo(o,e),r.rShiftTo(o,r));e.signum()>0;)(n=e.getLowestSetBit())>0&&e.rShiftTo(n,e),(n=r.getLowestSetBit())>0&&r.rShiftTo(n,r),e.compareTo(r)>=0?(e.subTo(r,e),e.rShiftTo(1,e)):(r.subTo(e,r),r.rShiftTo(1,r));return o>0&&r.lShiftTo(o,r),r},E.prototype.isProbablePrime=function(t){var e,r=this.abs();if(1==r.t&&r[0]<=W[W.length-1]){for(e=0;e<W.length;++e)if(r[0]==W[e])return!0;return!1}if(r.isEven())return!1;for(e=1;e<W.length;){for(var i=W[e],n=e+1;n<W.length&&i<G;)i*=W[n++];for(i=r.modInt(i);e<n;)if(i%W[e++]==0)return!1}return r.millerRabin(t)},E.prototype.square=function(){var t=M();return this.squareTo(t),t},J.prototype.init=function(t){var e,r,i;for(e=0;e<256;++e)this.S[e]=e;for(r=0,e=0;e<256;++e)r=r+this.S[e]+t[e%t.length]&255,i=this.S[e],this.S[e]=this.S[r],this.S[r]=i;this.i=0,this.j=0},J.prototype.next=function(){var t;return this.i=this.i+1&255,this.j=this.j+this.S[this.i]&255,t=this.S[this.i],this.S[this.i]=this.S[this.j],this.S[this.j]=t,this.S[t+this.S[this.i]&255]},null==q){var $;if(q=new Array,z=0,void 0!==n&&(void 0!==n.crypto||void 0!==n.msCrypto)){var Y=n.crypto||n.msCrypto;if(Y.getRandomValues){var Q=new Uint8Array(32);for(Y.getRandomValues(Q),$=0;$<32;++$)q[z++]=Q[$]}else if("Netscape"==i.appName&&i.appVersion<"5"){var X=n.crypto.random(32);for($=0;$<X.length;++$)q[z++]=255&X.charCodeAt($)}}for(;z<256;)$=Math.floor(65536*Math.random()),q[z++]=$>>>8,q[z++]=255&$;z=0,Z()}function tt(){if(null==H){for(Z(),(H=new J).init(q),z=0;z<q.length;++z)q[z]=0;z=0}return H.next()}function et(){}function rt(t,e){return new E(t,e)}function it(t,e,r){for(var i="",n=0;i.length<e;)i+=r(String.fromCharCode.apply(String,t.concat([(4278190080&n)>>24,(16711680&n)>>16,(65280&n)>>8,255&n]))),n+=1;return i}function nt(){this.n=null,this.e=0,this.d=null,this.p=null,this.q=null,this.dmp1=null,this.dmq1=null,this.coeff=null}function ot(t,e){this.x=e,this.q=t}function st(t,e,r,i){this.curve=t,this.x=e,this.y=r,this.z=null==i?E.ONE:i,this.zinv=null}function at(t,e,r){this.q=t,this.a=this.fromBigInteger(e),this.b=this.fromBigInteger(r),this.infinity=new st(this,null,null)}et.prototype.nextBytes=function(t){var e;for(e=0;e<t.length;++e)t[e]=tt()},nt.prototype.doPublic=function(t){return t.modPowInt(this.e,this.n)},nt.prototype.setPublic=function(t,e){if(this.isPublic=!0,this.isPrivate=!1,"string"!=typeof t)this.n=t,this.e=e;else{if(!(null!=t&&null!=e&&t.length>0&&e.length>0))throw"Invalid RSA public key";this.n=rt(t,16),this.e=parseInt(e,16)}},nt.prototype.encrypt=function(t){var e=function(t,e){if(e<t.length+11)throw"Message too long for RSA";for(var r=new Array,i=t.length-1;i>=0&&e>0;){var n=t.charCodeAt(i--);n<128?r[--e]=n:n>127&&n<2048?(r[--e]=63&n|128,r[--e]=n>>6|192):(r[--e]=63&n|128,r[--e]=n>>6&63|128,r[--e]=n>>12|224)}r[--e]=0;for(var o=new et,s=new Array;e>2;){for(s[0]=0;0==s[0];)o.nextBytes(s);r[--e]=s[0]}return r[--e]=2,r[--e]=0,new E(r)}(t,this.n.bitLength()+7>>3);if(null==e)return null;var r=this.doPublic(e);if(null==r)return null;var i=r.toString(16);return 0==(1&i.length)?i:"0"+i},nt.prototype.encryptOAEP=function(t,e,r){var i=function(t,e,r,i){var n=ht.crypto.MessageDigest,o=ht.crypto.Util,s=null;if(r||(r="sha1"),"string"==typeof r&&(s=n.getCanonicalAlgName(r),i=n.getHashLength(s),r=function(t){return Et(o.hashHex(Mt(t),s))}),t.length+2*i+2>e)throw"Message too long for RSA";var a,u="";for(a=0;a<e-t.length-2*i-2;a+=1)u+="\0";var h=r("")+u+""+t,c=new Array(i);(new et).nextBytes(c);var f=it(c,h.length,r),l=[];for(a=0;a<h.length;a+=1)l[a]=h.charCodeAt(a)^f.charCodeAt(a);var d=it(l,c.length,r),p=[0];for(a=0;a<c.length;a+=1)p[a+1]=c[a]^d.charCodeAt(a);return new E(p.concat(l))}(t,this.n.bitLength()+7>>3,e,r);if(null==i)return null;var n=this.doPublic(i);if(null==n)return null;var o=n.toString(16);return 0==(1&o.length)?o:"0"+o},nt.prototype.type="RSA",ot.prototype.equals=function(t){return t==this||this.q.equals(t.q)&&this.x.equals(t.x)},ot.prototype.toBigInteger=function(){return this.x},ot.prototype.negate=function(){return new ot(this.q,this.x.negate().mod(this.q))},ot.prototype.add=function(t){return new ot(this.q,this.x.add(t.toBigInteger()).mod(this.q))},ot.prototype.subtract=function(t){return new ot(this.q,this.x.subtract(t.toBigInteger()).mod(this.q))},ot.prototype.multiply=function(t){return new ot(this.q,this.x.multiply(t.toBigInteger()).mod(this.q))},ot.prototype.square=function(){return new ot(this.q,this.x.square().mod(this.q))},ot.prototype.divide=function(t){return new ot(this.q,this.x.multiply(t.toBigInteger().modInverse(this.q)).mod(this.q))},st.prototype.getX=function(){return null==this.zinv&&(this.zinv=this.z.modInverse(this.curve.q)),this.curve.fromBigInteger(this.x.toBigInteger().multiply(this.zinv).mod(this.curve.q))},st.prototype.getY=function(){return null==this.zinv&&(this.zinv=this.z.modInverse(this.curve.q)),this.curve.fromBigInteger(this.y.toBigInteger().multiply(this.zinv).mod(this.curve.q))},st.prototype.equals=function(t){return t==this||(this.isInfinity()?t.isInfinity():t.isInfinity()?this.isInfinity():!!t.y.toBigInteger().multiply(this.z).subtract(this.y.toBigInteger().multiply(t.z)).mod(this.curve.q).equals(E.ZERO)&&t.x.toBigInteger().multiply(this.z).subtract(this.x.toBigInteger().multiply(t.z)).mod(this.curve.q).equals(E.ZERO))},st.prototype.isInfinity=function(){return null==this.x&&null==this.y||this.z.equals(E.ZERO)&&!this.y.toBigInteger().equals(E.ZERO)},st.prototype.negate=function(){return new st(this.curve,this.x,this.y.negate(),this.z)},st.prototype.add=function(t){if(this.isInfinity())return t;if(t.isInfinity())return this;var e=t.y.toBigInteger().multiply(this.z).subtract(this.y.toBigInteger().multiply(t.z)).mod(this.curve.q),r=t.x.toBigInteger().multiply(this.z).subtract(this.x.toBigInteger().multiply(t.z)).mod(this.curve.q);if(E.ZERO.equals(r))return E.ZERO.equals(e)?this.twice():this.curve.getInfinity();var i=new E("3"),n=this.x.toBigInteger(),o=this.y.toBigInteger(),s=(t.x.toBigInteger(),t.y.toBigInteger(),r.square()),a=s.multiply(r),u=n.multiply(s),h=e.square().multiply(this.z),c=h.subtract(u.shiftLeft(1)).multiply(t.z).subtract(a).multiply(r).mod(this.curve.q),f=u.multiply(i).multiply(e).subtract(o.multiply(a)).subtract(h.multiply(e)).multiply(t.z).add(e.multiply(a)).mod(this.curve.q),l=a.multiply(this.z).multiply(t.z).mod(this.curve.q);return new st(this.curve,this.curve.fromBigInteger(c),this.curve.fromBigInteger(f),l)},st.prototype.twice=function(){if(this.isInfinity())return this;if(0==this.y.toBigInteger().signum())return this.curve.getInfinity();var t=new E("3"),e=this.x.toBigInteger(),r=this.y.toBigInteger(),i=r.multiply(this.z),n=i.multiply(r).mod(this.curve.q),o=this.curve.a.toBigInteger(),s=e.square().multiply(t);E.ZERO.equals(o)||(s=s.add(this.z.square().multiply(o)));var a=(s=s.mod(this.curve.q)).square().subtract(e.shiftLeft(3).multiply(n)).shiftLeft(1).multiply(i).mod(this.curve.q),u=s.multiply(t).multiply(e).subtract(n.shiftLeft(1)).shiftLeft(2).multiply(n).subtract(s.square().multiply(s)).mod(this.curve.q),h=i.square().multiply(i).shiftLeft(3).mod(this.curve.q);return new st(this.curve,this.curve.fromBigInteger(a),this.curve.fromBigInteger(u),h)},st.prototype.multiply=function(t){if(this.isInfinity())return this;if(0==t.signum())return this.curve.getInfinity();var e,r=t,i=r.multiply(new E("3")),n=this.negate(),o=this,s=this.curve.q.subtract(t),a=s.multiply(new E("3")),u=new st(this.curve,this.x,this.y),h=u.negate();for(e=i.bitLength()-2;e>0;--e){o=o.twice();var c=i.testBit(e);c!=r.testBit(e)&&(o=o.add(c?this:n))}for(e=a.bitLength()-2;e>0;--e){u=u.twice();var f=a.testBit(e);f!=s.testBit(e)&&(u=u.add(f?u:h))}return o},st.prototype.multiplyTwo=function(t,e,r){var i;i=t.bitLength()>r.bitLength()?t.bitLength()-1:r.bitLength()-1;for(var n=this.curve.getInfinity(),o=this.add(e);i>=0;)n=n.twice(),t.testBit(i)?n=r.testBit(i)?n.add(o):n.add(this):r.testBit(i)&&(n=n.add(e)),--i;return n},at.prototype.getQ=function(){return this.q},at.prototype.getA=function(){return this.a},at.prototype.getB=function(){return this.b},at.prototype.equals=function(t){return t==this||this.q.equals(t.q)&&this.a.equals(t.a)&&this.b.equals(t.b)},at.prototype.getInfinity=function(){return this.infinity},at.prototype.fromBigInteger=function(t){return new ot(this.q,t)},at.prototype.decodePointHex=function(t){switch(parseInt(t.substr(0,2),16)){case 0:return this.infinity;case 2:case 3:return null;case 4:case 6:case 7:var e=(t.length-2)/2,r=t.substr(2,e),i=t.substr(e+2,e);return new st(this,this.fromBigInteger(new E(r,16)),this.fromBigInteger(new E(i,16)));default:return null}},ot.prototype.getByteLength=function(){return Math.floor((this.toBigInteger().bitLength()+7)/8)},st.prototype.getEncoded=function(t){var e=function(t,e){var r=t.toByteArrayUnsigned();if(e<r.length)r=r.slice(r.length-e);else for(;e>r.length;)r.unshift(0);return r},r=this.getX().toBigInteger(),i=this.getY().toBigInteger(),n=e(r,32);return t?i.isEven()?n.unshift(2):n.unshift(3):(n.unshift(4),n=n.concat(e(i,32))),n},st.decodeFrom=function(t,e){e[0];var r=e.length-1,i=e.slice(1,1+r/2),n=e.slice(1+r/2,1+r);i.unshift(0),n.unshift(0);var o=new E(i),s=new E(n);return new st(t,t.fromBigInteger(o),t.fromBigInteger(s))},st.decodeFromHex=function(t,e){e.substr(0,2);var r=e.length-2,i=e.substr(2,r/2),n=e.substr(2+r/2,r/2),o=new E(i,16),s=new E(n,16);return new st(t,t.fromBigInteger(o),t.fromBigInteger(s))},st.prototype.add2D=function(t){if(this.isInfinity())return t;if(t.isInfinity())return this;if(this.x.equals(t.x))return this.y.equals(t.y)?this.twice():this.curve.getInfinity();var e=t.x.subtract(this.x),r=t.y.subtract(this.y).divide(e),i=r.square().subtract(this.x).subtract(t.x),n=r.multiply(this.x.subtract(i)).subtract(this.y);return new st(this.curve,i,n)},st.prototype.twice2D=function(){if(this.isInfinity())return this;if(0==this.y.toBigInteger().signum())return this.curve.getInfinity();var t=this.curve.fromBigInteger(E.valueOf(2)),e=this.curve.fromBigInteger(E.valueOf(3)),r=this.x.square().multiply(e).add(this.curve.a).divide(this.y.multiply(t)),i=r.square().subtract(this.x.multiply(t)),n=r.multiply(this.x.subtract(i)).subtract(this.y);return new st(this.curve,i,n)},st.prototype.multiply2D=function(t){if(this.isInfinity())return this;if(0==t.signum())return this.curve.getInfinity();var e,r=t,i=r.multiply(new E("3")),n=this.negate(),o=this;for(e=i.bitLength()-2;e>0;--e){o=o.twice();var s=i.testBit(e);s!=r.testBit(e)&&(o=o.add2D(s?this:n))}return o},st.prototype.isOnCurve=function(){var t=this.getX().toBigInteger(),e=this.getY().toBigInteger(),r=this.curve.getA().toBigInteger(),i=this.curve.getB().toBigInteger(),n=this.curve.getQ(),o=e.multiply(e).mod(n),s=t.multiply(t).multiply(t).add(r.multiply(t)).add(i).mod(n);return o.equals(s)},st.prototype.toString=function(){return"("+this.getX().toBigInteger().toString()+","+this.getY().toBigInteger().toString()+")"},st.prototype.validate=function(){var t=this.curve.getQ();if(this.isInfinity())throw new Error("Point is at infinity.");var e=this.getX().toBigInteger(),r=this.getY().toBigInteger();if(e.compareTo(E.ONE)<0||e.compareTo(t.subtract(E.ONE))>0)throw new Error("x coordinate out of bounds");if(r.compareTo(E.ONE)<0||r.compareTo(t.subtract(E.ONE))>0)throw new Error("y coordinate out of bounds");if(!this.isOnCurve())throw new Error("Point is not on the curve.");if(this.multiply(t).isInfinity())throw new Error("Point is not a scalar multiple of G.");return!0};var ut=function(){var t=new RegExp('(?:false|true|null|[\\{\\}\\[\\]]|(?:-?\\b(?:0|[1-9][0-9]*)(?:\\.[0-9]+)?(?:[eE][+-]?[0-9]+)?\\b)|(?:"(?:[^\\0-\\x08\\x0a-\\x1f"\\\\]|\\\\(?:["/\\\\bfnrt]|u[0-9A-Fa-f]{4}))*"))',"g"),e=new RegExp("\\\\(?:([^u])|u(.{4}))","g"),i={'"':'"',"/":"/","\\":"\\",b:"\b",f:"\f",n:"\n",r:"\r",t:"\t"};function n(t,e,r){return e?i[e]:String.fromCharCode(parseInt(r,16))}var o=new String(""),s=Object.hasOwnProperty;return function(i,a){var u,h,c=i.match(t),f=c[0],l=!1;"{"===f?u={}:"["===f?u=[]:(u=[],l=!0);for(var d=[u],p=1-l,g=c.length;p<g;++p){var y;switch((f=c[p]).charCodeAt(0)){default:(y=d[0])[h||y.length]=+f,h=void 0;break;case 34:if(-1!==(f=f.substring(1,f.length-1)).indexOf("\\")&&(f=f.replace(e,n)),y=d[0],!h){if(!(y instanceof Array)){h=f||o;break}h=y.length}y[h]=f,h=void 0;break;case 91:y=d[0],d.unshift(y[h||y.length]=[]),h=void 0;break;case 93:d.shift();break;case 102:(y=d[0])[h||y.length]=!1,h=void 0;break;case 110:(y=d[0])[h||y.length]=null,h=void 0;break;case 116:(y=d[0])[h||y.length]=!0,h=void 0;break;case 123:y=d[0],d.unshift(y[h||y.length]={}),h=void 0;break;case 125:d.shift()}}if(l){if(1!==d.length)throw new Error;u=u[0]}else if(d.length)throw new Error;return a&&(u=function t(e,i){var n=e[i];if(n&&"object"===(void 0===n?"undefined":r(n))){var o=null;for(var u in n)if(s.call(n,u)&&n!==e){var h=t(n,u);void 0!==h?n[u]=h:(o||(o=[]),o.push(u))}if(o)for(var c=o.length;--c>=0;)delete n[o[c]]}return a.call(e,i,n)}({"":u},"")),u}}();void 0!==ht&&ht||(e.KJUR=ht={}),void 0!==ht.asn1&&ht.asn1||(ht.asn1={}),ht.asn1.ASN1Util=new function(){this.integerToByteHex=function(t){var e=t.toString(16);return e.length%2==1&&(e="0"+e),e},this.bigIntToMinTwosComplementsHex=function(t){var e=t.toString(16);if("-"!=e.substr(0,1))e.length%2==1?e="0"+e:e.match(/^[0-7]/)||(e="00"+e);else{var r=e.substr(1).length;r%2==1?r+=1:e.match(/^[0-7]/)||(r+=2);for(var i="",n=0;n<r;n++)i+="f";e=new E(i,16).xor(t).add(E.ONE).toString(16).replace(/^-/,"")}return e},this.getPEMStringFromHex=function(t,e){return It(t,e)},this.newObject=function(t){var e=ht.asn1,r=e.ASN1Object,i=e.DERBoolean,n=e.DERInteger,o=e.DERBitString,s=e.DEROctetString,a=e.DERNull,u=e.DERObjectIdentifier,h=e.DEREnumerated,c=e.DERUTF8String,f=e.DERNumericString,l=e.DERPrintableString,d=e.DERTeletexString,p=e.DERIA5String,g=e.DERUTCTime,y=e.DERGeneralizedTime,m=e.DERVisibleString,v=e.DERBMPString,b=e.DERSequence,w=e.DERSet,_=e.DERTaggedObject,S=e.ASN1Util.newObject;if(t instanceof e.ASN1Object)return t;var E=Object.keys(t);if(1!=E.length)throw new Error("key of param shall be only one.");var M=E[0];if(-1==":asn1:bool:int:bitstr:octstr:null:oid:enum:utf8str:numstr:prnstr:telstr:ia5str:utctime:gentime:visstr:bmpstr:seq:set:tag:".indexOf(":"+M+":"))throw new Error("undefined key: "+M);if("bool"==M)return new i(t[M]);if("int"==M)return new n(t[M]);if("bitstr"==M)return new o(t[M]);if("octstr"==M)return new s(t[M]);if("null"==M)return new a(t[M]);if("oid"==M)return new u(t[M]);if("enum"==M)return new h(t[M]);if("utf8str"==M)return new c(t[M]);if("numstr"==M)return new f(t[M]);if("prnstr"==M)return new l(t[M]);if("telstr"==M)return new d(t[M]);if("ia5str"==M)return new p(t[M]);if("utctime"==M)return new g(t[M]);if("gentime"==M)return new y(t[M]);if("visstr"==M)return new m(t[M]);if("bmpstr"==M)return new v(t[M]);if("asn1"==M)return new r(t[M]);if("seq"==M){for(var A=t[M],C=[],k=0;k<A.length;k++){var I=S(A[k]);C.push(I)}return new b({array:C})}if("set"==M){for(A=t[M],C=[],k=0;k<A.length;k++)I=S(A[k]),C.push(I);return new w({array:C})}if("tag"==M){var T=t[M];if("[object Array]"===Object.prototype.toString.call(T)&&3==T.length){var R=S(T[2]);return new _({tag:T[0],explicit:T[1],obj:R})}return new _(T)}},this.jsonToASN1HEX=function(t){return this.newObject(t).getEncodedHex()}},ht.asn1.ASN1Util.oidHexToInt=function(t){for(var e="",r=parseInt(t.substr(0,2),16),i=(e=Math.floor(r/40)+"."+r%40,""),n=2;n<t.length;n+=2){var o=("00000000"+parseInt(t.substr(n,2),16).toString(2)).slice(-8);i+=o.substr(1,7),"0"==o.substr(0,1)&&(e=e+"."+new E(i,2).toString(10),i="")}return e},ht.asn1.ASN1Util.oidIntToHex=function(t){var e=function(t){var e=t.toString(16);return 1==e.length&&(e="0"+e),e},r=function(t){var r="",i=new E(t,10).toString(2),n=7-i.length%7;7==n&&(n=0);for(var o="",s=0;s<n;s++)o+="0";for(i=o+i,s=0;s<i.length-1;s+=7){var a=i.substr(s,7);s!=i.length-7&&(a="1"+a),r+=e(parseInt(a,2))}return r};if(!t.match(/^[0-9.]+$/))throw"malformed oid string: "+t;var i="",n=t.split("."),o=40*parseInt(n[0])+parseInt(n[1]);i+=e(o),n.splice(0,2);for(var s=0;s<n.length;s++)i+=r(n[s]);return i},ht.asn1.ASN1Object=function(t){this.params=null,this.getLengthHexFromValue=function(){if(void 0===this.hV||null==this.hV)throw new Error("this.hV is null or undefined");if(this.hV.length%2==1)throw new Error("value hex must be even length: n="+"".length+",v="+this.hV);var t=this.hV.length/2,e=t.toString(16);if(e.length%2==1&&(e="0"+e),t<128)return e;var r=e.length/2;if(r>15)throw"ASN.1 length too long to represent by 8x: n = "+t.toString(16);return(128+r).toString(16)+e},this.getEncodedHex=function(){return(null==this.hTLV||this.isModified)&&(this.hV=this.getFreshValueHex(),this.hL=this.getLengthHexFromValue(),this.hTLV=this.hT+this.hL+this.hV,this.isModified=!1),this.hTLV},this.getValueHex=function(){return this.getEncodedHex(),this.hV},this.getFreshValueHex=function(){return""},this.setByParam=function(t){this.params=t},null!=t&&null!=t.tlv&&(this.hTLV=t.tlv,this.isModified=!1)},ht.asn1.DERAbstractString=function(t){ht.asn1.DERAbstractString.superclass.constructor.call(this),this.getString=function(){return this.s},this.setString=function(t){this.hTLV=null,this.isModified=!0,this.s=t,this.hV=_t(this.s).toLowerCase()},this.setStringHex=function(t){this.hTLV=null,this.isModified=!0,this.s=null,this.hV=t},this.getFreshValueHex=function(){return this.hV},void 0!==t&&("string"==typeof t?this.setString(t):void 0!==t.str?this.setString(t.str):void 0!==t.hex&&this.setStringHex(t.hex))},o.lang.extend(ht.asn1.DERAbstractString,ht.asn1.ASN1Object),ht.asn1.DERAbstractTime=function(t){ht.asn1.DERAbstractTime.superclass.constructor.call(this),this.localDateToUTC=function(t){var e=t.getTime()+6e4*t.getTimezoneOffset();return new Date(e)},this.formatDate=function(t,e,r){var i=this.zeroPadding,n=this.localDateToUTC(t),o=String(n.getFullYear());"utc"==e&&(o=o.substr(2,2));var s=o+i(String(n.getMonth()+1),2)+i(String(n.getDate()),2)+i(String(n.getHours()),2)+i(String(n.getMinutes()),2)+i(String(n.getSeconds()),2);if(!0===r){var a=n.getMilliseconds();if(0!=a){var u=i(String(a),3);s=s+"."+(u=u.replace(/[0]+$/,""))}}return s+"Z"},this.zeroPadding=function(t,e){return t.length>=e?t:new Array(e-t.length+1).join("0")+t},this.getString=function(){return this.s},this.setString=function(t){this.hTLV=null,this.isModified=!0,this.s=t,this.hV=yt(t)},this.setByDateValue=function(t,e,r,i,n,o){var s=new Date(Date.UTC(t,e-1,r,i,n,o,0));this.setByDate(s)},this.getFreshValueHex=function(){return this.hV}},o.lang.extend(ht.asn1.DERAbstractTime,ht.asn1.ASN1Object),ht.asn1.DERAbstractStructured=function(t){ht.asn1.DERAbstractString.superclass.constructor.call(this),this.setByASN1ObjectArray=function(t){this.hTLV=null,this.isModified=!0,this.asn1Array=t},this.appendASN1Object=function(t){this.hTLV=null,this.isModified=!0,this.asn1Array.push(t)},this.asn1Array=new Array,void 0!==t&&void 0!==t.array&&(this.asn1Array=t.array)},o.lang.extend(ht.asn1.DERAbstractStructured,ht.asn1.ASN1Object),ht.asn1.DERBoolean=function(t){ht.asn1.DERBoolean.superclass.constructor.call(this),this.hT="01",this.hTLV=0==t?"010100":"0101ff"},o.lang.extend(ht.asn1.DERBoolean,ht.asn1.ASN1Object),ht.asn1.DERInteger=function(t){ht.asn1.DERInteger.superclass.constructor.call(this),this.hT="02",this.setByBigInteger=function(t){this.hTLV=null,this.isModified=!0,this.hV=ht.asn1.ASN1Util.bigIntToMinTwosComplementsHex(t)},this.setByInteger=function(t){var e=new E(String(t),10);this.setByBigInteger(e)},this.setValueHex=function(t){this.hV=t},this.getFreshValueHex=function(){return this.hV},void 0!==t&&(void 0!==t.bigint?this.setByBigInteger(t.bigint):void 0!==t.int?this.setByInteger(t.int):"number"==typeof t?this.setByInteger(t):void 0!==t.hex&&this.setValueHex(t.hex))},o.lang.extend(ht.asn1.DERInteger,ht.asn1.ASN1Object),ht.asn1.DERBitString=function(t){if(void 0!==t&&void 0!==t.obj){var e=ht.asn1.ASN1Util.newObject(t.obj);t.hex="00"+e.getEncodedHex()}ht.asn1.DERBitString.superclass.constructor.call(this),this.hT="03",this.setHexValueIncludingUnusedBits=function(t){this.hTLV=null,this.isModified=!0,this.hV=t},this.setUnusedBitsAndHexValue=function(t,e){if(t<0||7<t)throw"unused bits shall be from 0 to 7: u = "+t;var r="0"+t;this.hTLV=null,this.isModified=!0,this.hV=r+e},this.setByBinaryString=function(t){var e=8-(t=t.replace(/0+$/,"")).length%8;8==e&&(e=0);for(var r=0;r<=e;r++)t+="0";var i="";for(r=0;r<t.length-1;r+=8){var n=t.substr(r,8),o=parseInt(n,2).toString(16);1==o.length&&(o="0"+o),i+=o}this.hTLV=null,this.isModified=!0,this.hV="0"+e+i},this.setByBooleanArray=function(t){for(var e="",r=0;r<t.length;r++)1==t[r]?e+="1":e+="0";this.setByBinaryString(e)},this.newFalseArray=function(t){for(var e=new Array(t),r=0;r<t;r++)e[r]=!1;return e},this.getFreshValueHex=function(){return this.hV},void 0!==t&&("string"==typeof t&&t.toLowerCase().match(/^[0-9a-f]+$/)?this.setHexValueIncludingUnusedBits(t):void 0!==t.hex?this.setHexValueIncludingUnusedBits(t.hex):void 0!==t.bin?this.setByBinaryString(t.bin):void 0!==t.array&&this.setByBooleanArray(t.array))},o.lang.extend(ht.asn1.DERBitString,ht.asn1.ASN1Object),ht.asn1.DEROctetString=function(t){if(void 0!==t&&void 0!==t.obj){var e=ht.asn1.ASN1Util.newObject(t.obj);t.hex=e.getEncodedHex()}ht.asn1.DEROctetString.superclass.constructor.call(this,t),this.hT="04"},o.lang.extend(ht.asn1.DEROctetString,ht.asn1.DERAbstractString),ht.asn1.DERNull=function(){ht.asn1.DERNull.superclass.constructor.call(this),this.hT="05",this.hTLV="0500"},o.lang.extend(ht.asn1.DERNull,ht.asn1.ASN1Object),ht.asn1.DERObjectIdentifier=function(t){ht.asn1.DERObjectIdentifier.superclass.constructor.call(this),this.hT="06",this.setValueHex=function(t){this.hTLV=null,this.isModified=!0,this.s=null,this.hV=t},this.setValueOidString=function(t){var e=function(t){var e=function(t){var e=t.toString(16);return 1==e.length&&(e="0"+e),e},r=function(t){var r="",i=parseInt(t,10).toString(2),n=7-i.length%7;7==n&&(n=0);for(var o="",s=0;s<n;s++)o+="0";for(i=o+i,s=0;s<i.length-1;s+=7){var a=i.substr(s,7);s!=i.length-7&&(a="1"+a),r+=e(parseInt(a,2))}return r};try{if(!t.match(/^[0-9.]+$/))return null;var i="",n=t.split("."),o=40*parseInt(n[0],10)+parseInt(n[1],10);i+=e(o),n.splice(0,2);for(var s=0;s<n.length;s++)i+=r(n[s]);return i}catch(t){return null}}(t);if(null==e)throw new Error("malformed oid string: "+t);this.hTLV=null,this.isModified=!0,this.s=null,this.hV=e},this.setValueName=function(t){var e=ht.asn1.x509.OID.name2oid(t);if(""===e)throw new Error("DERObjectIdentifier oidName undefined: "+t);this.setValueOidString(e)},this.setValueNameOrOid=function(t){t.match(/^[0-2].[0-9.]+$/)?this.setValueOidString(t):this.setValueName(t)},this.getFreshValueHex=function(){return this.hV},this.setByParam=function(t){"string"==typeof t?this.setValueNameOrOid(t):void 0!==t.oid?this.setValueNameOrOid(t.oid):void 0!==t.name?this.setValueNameOrOid(t.name):void 0!==t.hex&&this.setValueHex(t.hex)},void 0!==t&&this.setByParam(t)},o.lang.extend(ht.asn1.DERObjectIdentifier,ht.asn1.ASN1Object),ht.asn1.DEREnumerated=function(t){ht.asn1.DEREnumerated.superclass.constructor.call(this),this.hT="0a",this.setByBigInteger=function(t){this.hTLV=null,this.isModified=!0,this.hV=ht.asn1.ASN1Util.bigIntToMinTwosComplementsHex(t)},this.setByInteger=function(t){var e=new E(String(t),10);this.setByBigInteger(e)},this.setValueHex=function(t){this.hV=t},this.getFreshValueHex=function(){return this.hV},void 0!==t&&(void 0!==t.int?this.setByInteger(t.int):"number"==typeof t?this.setByInteger(t):void 0!==t.hex&&this.setValueHex(t.hex))},o.lang.extend(ht.asn1.DEREnumerated,ht.asn1.ASN1Object),ht.asn1.DERUTF8String=function(t){ht.asn1.DERUTF8String.superclass.constructor.call(this,t),this.hT="0c"},o.lang.extend(ht.asn1.DERUTF8String,ht.asn1.DERAbstractString),ht.asn1.DERNumericString=function(t){ht.asn1.DERNumericString.superclass.constructor.call(this,t),this.hT="12"},o.lang.extend(ht.asn1.DERNumericString,ht.asn1.DERAbstractString),ht.asn1.DERPrintableString=function(t){ht.asn1.DERPrintableString.superclass.constructor.call(this,t),this.hT="13"},o.lang.extend(ht.asn1.DERPrintableString,ht.asn1.DERAbstractString),ht.asn1.DERTeletexString=function(t){ht.asn1.DERTeletexString.superclass.constructor.call(this,t),this.hT="14"},o.lang.extend(ht.asn1.DERTeletexString,ht.asn1.DERAbstractString),ht.asn1.DERIA5String=function(t){ht.asn1.DERIA5String.superclass.constructor.call(this,t),this.hT="16"},o.lang.extend(ht.asn1.DERIA5String,ht.asn1.DERAbstractString),ht.asn1.DERVisibleString=function(t){ht.asn1.DERIA5String.superclass.constructor.call(this,t),this.hT="1a"},o.lang.extend(ht.asn1.DERVisibleString,ht.asn1.DERAbstractString),ht.asn1.DERBMPString=function(t){ht.asn1.DERBMPString.superclass.constructor.call(this,t),this.hT="1e"},o.lang.extend(ht.asn1.DERBMPString,ht.asn1.DERAbstractString),ht.asn1.DERUTCTime=function(t){ht.asn1.DERUTCTime.superclass.constructor.call(this,t),this.hT="17",this.setByDate=function(t){this.hTLV=null,this.isModified=!0,this.date=t,this.s=this.formatDate(this.date,"utc"),this.hV=yt(this.s)},this.getFreshValueHex=function(){return void 0===this.date&&void 0===this.s&&(this.date=new Date,this.s=this.formatDate(this.date,"utc"),this.hV=yt(this.s)),this.hV},void 0!==t&&(void 0!==t.str?this.setString(t.str):"string"==typeof t&&t.match(/^[0-9]{12}Z$/)?this.setString(t):void 0!==t.hex?this.setStringHex(t.hex):void 0!==t.date&&this.setByDate(t.date))},o.lang.extend(ht.asn1.DERUTCTime,ht.asn1.DERAbstractTime),ht.asn1.DERGeneralizedTime=function(t){ht.asn1.DERGeneralizedTime.superclass.constructor.call(this,t),this.hT="18",this.withMillis=!1,this.setByDate=function(t){this.hTLV=null,this.isModified=!0,this.date=t,this.s=this.formatDate(this.date,"gen",this.withMillis),this.hV=yt(this.s)},this.getFreshValueHex=function(){return void 0===this.date&&void 0===this.s&&(this.date=new Date,this.s=this.formatDate(this.date,"gen",this.withMillis),this.hV=yt(this.s)),this.hV},void 0!==t&&(void 0!==t.str?this.setString(t.str):"string"==typeof t&&t.match(/^[0-9]{14}Z$/)?this.setString(t):void 0!==t.hex?this.setStringHex(t.hex):void 0!==t.date&&this.setByDate(t.date),!0===t.millis&&(this.withMillis=!0))},o.lang.extend(ht.asn1.DERGeneralizedTime,ht.asn1.DERAbstractTime),ht.asn1.DERSequence=function(t){ht.asn1.DERSequence.superclass.constructor.call(this,t),this.hT="30",this.getFreshValueHex=function(){for(var t="",e=0;e<this.asn1Array.length;e++)t+=this.asn1Array[e].getEncodedHex();return this.hV=t,this.hV}},o.lang.extend(ht.asn1.DERSequence,ht.asn1.DERAbstractStructured),ht.asn1.DERSet=function(t){ht.asn1.DERSet.superclass.constructor.call(this,t),this.hT="31",this.sortFlag=!0,this.getFreshValueHex=function(){for(var t=new Array,e=0;e<this.asn1Array.length;e++){var r=this.asn1Array[e];t.push(r.getEncodedHex())}return 1==this.sortFlag&&t.sort(),this.hV=t.join(""),this.hV},void 0!==t&&void 0!==t.sortflag&&0==t.sortflag&&(this.sortFlag=!1)},o.lang.extend(ht.asn1.DERSet,ht.asn1.DERAbstractStructured),ht.asn1.DERTaggedObject=function(t){ht.asn1.DERTaggedObject.superclass.constructor.call(this);var e=ht.asn1;this.hT="a0",this.hV="",this.isExplicit=!0,this.asn1Object=null,this.setASN1Object=function(t,e,r){this.hT=e,this.isExplicit=t,this.asn1Object=r,this.isExplicit?(this.hV=this.asn1Object.getEncodedHex(),this.hTLV=null,this.isModified=!0):(this.hV=null,this.hTLV=r.getEncodedHex(),this.hTLV=this.hTLV.replace(/^../,e),this.isModified=!1)},this.getFreshValueHex=function(){return this.hV},this.setByParam=function(t){null!=t.tag&&(this.hT=t.tag),null!=t.explicit&&(this.isExplicit=t.explicit),null!=t.tage&&(this.hT=t.tage,this.isExplicit=!0),null!=t.tagi&&(this.hT=t.tagi,this.isExplicit=!1),null!=t.obj&&(t.obj instanceof e.ASN1Object?(this.asn1Object=t.obj,this.setASN1Object(this.isExplicit,this.hT,this.asn1Object)):"object"==r(t.obj)&&(this.asn1Object=e.ASN1Util.newObject(t.obj),this.setASN1Object(this.isExplicit,this.hT,this.asn1Object)))},null!=t&&this.setByParam(t)},o.lang.extend(ht.asn1.DERTaggedObject,ht.asn1.ASN1Object);var ht,ct,ft,lt=new function(){};function dt(t){for(var e=new Array,r=0;r<t.length;r++)e[r]=t.charCodeAt(r);return e}function pt(t){for(var e="",r=0;r<t.length;r++)e+=String.fromCharCode(t[r]);return e}function gt(t){for(var e="",r=0;r<t.length;r++){var i=t[r].toString(16);1==i.length&&(i="0"+i),e+=i}return e}function yt(t){return gt(dt(t))}function mt(t){return(t=(t=t.replace(/\=/g,"")).replace(/\+/g,"-")).replace(/\//g,"_")}function vt(t){return t.length%4==2?t+="==":t.length%4==3&&(t+="="),(t=t.replace(/-/g,"+")).replace(/_/g,"/")}function bt(t){return t.length%2==1&&(t="0"+t),mt(w(t))}function wt(t){return _(vt(t))}function _t(t){return xt(Lt(t))}function St(t){return decodeURIComponent(Ft(t))}function Et(t){for(var e="",r=0;r<t.length-1;r+=2)e+=String.fromCharCode(parseInt(t.substr(r,2),16));return e}function Mt(t){for(var e="",r=0;r<t.length;r++)e+=("0"+t.charCodeAt(r).toString(16)).slice(-2);return e}function At(t){return w(t)}function Ct(t){return At(t).replace(/(.{64})/g,"$1\r\n").replace(/\r\n$/,"")}function kt(t){return _(t.replace(/[^0-9A-Za-z\/+=]*/g,""))}function It(t,e){return"-----BEGIN "+e+"-----\r\n"+Ct(t)+"\r\n-----END "+e+"-----\r\n"}function Tt(t,e){if(-1==t.indexOf("-----BEGIN "))throw"can't find PEM header: "+e;return kt(t=void 0!==e?(t=t.replace(new RegExp("^[^]*-----BEGIN "+e+"-----"),"")).replace(new RegExp("-----END "+e+"-----[^]*$"),""):(t=t.replace(/^[^]*-----BEGIN [^-]+-----/,"")).replace(/-----END [^-]+-----[^]*$/,""))}function Rt(t){var e,r,i,n,o,s,a,u,h,c,f;if(f=t.match(/^(\d{2}|\d{4})(\d\d)(\d\d)(\d\d)(\d\d)(\d\d)(|\.\d+)Z$/))return u=f[1],e=parseInt(u),2===u.length&&(50<=e&&e<100?e=1900+e:0<=e&&e<50&&(e=2e3+e)),r=parseInt(f[2])-1,i=parseInt(f[3]),n=parseInt(f[4]),o=parseInt(f[5]),s=parseInt(f[6]),a=0,""!==(h=f[7])&&(c=(h.substr(1)+"00").substr(0,3),a=parseInt(c)),Date.UTC(e,r,i,n,o,s,a);throw"unsupported zulu format: "+t}function Bt(t){return~~(Rt(t)/1e3)}function xt(t){return t.replace(/%/g,"")}function Ft(t){return t.replace(/(..)/g,"%$1")}function Pt(t){var e="malformed IPv6 address";if(!t.match(/^[0-9A-Fa-f:]+$/))throw e;var r=(t=t.toLowerCase()).split(":").length-1;if(r<2)throw e;var i=":".repeat(7-r+2),n=(t=t.replace("::",i)).split(":");if(8!=n.length)throw e;for(var o=0;o<8;o++)n[o]=("0000"+n[o]).slice(-4);return n.join("")}function Nt(t){if(!t.match(/^[0-9A-Fa-f]{32}$/))throw"malformed IPv6 address octet";for(var e=(t=t.toLowerCase()).match(/.{1,4}/g),r=0;r<8;r++)e[r]=e[r].replace(/^0+/,""),""==e[r]&&(e[r]="0");var i=(t=":"+e.join(":")+":").match(/:(0:){2,}/g);if(null===i)return t.slice(1,-1);var n="";for(r=0;r<i.length;r++)i[r].length>n.length&&(n=i[r]);return(t=t.replace(n,"::")).slice(1,-1)}function Ot(t){var e="malformed hex value";if(!t.match(/^([0-9A-Fa-f][0-9A-Fa-f]){1,}$/))throw e;if(8!=t.length)return 32==t.length?Nt(t):t;try{return parseInt(t.substr(0,2),16)+"."+parseInt(t.substr(2,2),16)+"."+parseInt(t.substr(4,2),16)+"."+parseInt(t.substr(6,2),16)}catch(t){throw e}}function Lt(t){for(var e=encodeURIComponent(t),r="",i=0;i<e.length;i++)"%"==e[i]?(r+=e.substr(i,3),i+=2):r=r+"%"+yt(e[i]);return r}function Ut(t){return!(t.length%2!=0||!t.match(/^[0-9a-f]+$/)&&!t.match(/^[0-9A-F]+$/))}function jt(t){return t.length%2==1?"0"+t:t.substr(0,1)>"7"?"00"+t:t}lt.getLblen=function(t,e){if("8"!=t.substr(e+2,1))return 1;var r=parseInt(t.substr(e+3,1));return 0==r?-1:0<r&&r<10?r+1:-2},lt.getL=function(t,e){var r=lt.getLblen(t,e);return r<1?"":t.substr(e+2,2*r)},lt.getVblen=function(t,e){var r;return""==(r=lt.getL(t,e))?-1:("8"===r.substr(0,1)?new E(r.substr(2),16):new E(r,16)).intValue()},lt.getVidx=function(t,e){var r=lt.getLblen(t,e);return r<0?r:e+2*(r+1)},lt.getV=function(t,e){var r=lt.getVidx(t,e),i=lt.getVblen(t,e);return t.substr(r,2*i)},lt.getTLV=function(t,e){return t.substr(e,2)+lt.getL(t,e)+lt.getV(t,e)},lt.getTLVblen=function(t,e){return 2+2*lt.getLblen(t,e)+2*lt.getVblen(t,e)},lt.getNextSiblingIdx=function(t,e){return lt.getVidx(t,e)+2*lt.getVblen(t,e)},lt.getChildIdx=function(t,e){var r,i,n,o=lt,s=[];r=o.getVidx(t,e),i=2*o.getVblen(t,e),"03"==t.substr(e,2)&&(r+=2,i-=2),n=0;for(var a=r;n<=i;){var u=o.getTLVblen(t,a);if((n+=u)<=i&&s.push(a),a+=u,n>=i)break}return s},lt.getNthChildIdx=function(t,e,r){return lt.getChildIdx(t,e)[r]},lt.getIdxbyList=function(t,e,r,i){var n,o,s=lt;return 0==r.length?void 0!==i&&t.substr(e,2)!==i?-1:e:(n=r.shift())>=(o=s.getChildIdx(t,e)).length?-1:s.getIdxbyList(t,o[n],r,i)},lt.getIdxbyListEx=function(t,e,r,i){var n,o,s=lt;if(0==r.length)return void 0!==i&&t.substr(e,2)!==i?-1:e;n=r.shift(),o=s.getChildIdx(t,e);for(var a=0,u=0;u<o.length;u++){var h=t.substr(o[u],2);if("number"==typeof n&&!s.isContextTag(h)&&a==n||"string"==typeof n&&s.isContextTag(h,n))return s.getIdxbyListEx(t,o[u],r,i);s.isContextTag(h)||a++}return-1},lt.getTLVbyList=function(t,e,r,i){var n=lt,o=n.getIdxbyList(t,e,r,i);return-1==o||o>=t.length?null:n.getTLV(t,o)},lt.getTLVbyListEx=function(t,e,r,i){var n=lt,o=n.getIdxbyListEx(t,e,r,i);return-1==o?null:n.getTLV(t,o)},lt.getVbyList=function(t,e,r,i,n){var o,s,a=lt;return-1==(o=a.getIdxbyList(t,e,r,i))||o>=t.length?null:(s=a.getV(t,o),!0===n&&(s=s.substr(2)),s)},lt.getVbyListEx=function(t,e,r,i,n){var o,s,a=lt;return-1==(o=a.getIdxbyListEx(t,e,r,i))?null:(s=a.getV(t,o),"03"==t.substr(o,2)&&!1!==n&&(s=s.substr(2)),s)},lt.getInt=function(t,e,r){null==r&&(r=-1);try{var i=t.substr(e,2);if("02"!=i&&"03"!=i)return r;var n=lt.getV(t,e);return"02"==i?parseInt(n,16):function(t){try{var e=t.substr(0,2);if("00"==e)return parseInt(t.substr(2),16);var r=parseInt(e,16),i=t.substr(2),n=parseInt(i,16).toString(2);return"0"==n&&(n="00000000"),n=n.slice(0,0-r),parseInt(n,2)}catch(t){return-1}}(n)}catch(t){return r}},lt.getOID=function(t,e,r){null==r&&(r=null);try{return"06"!=t.substr(e,2)?r:function(t){if(!Ut(t))return null;try{var e=[],r=t.substr(0,2),i=parseInt(r,16);e[0]=new String(Math.floor(i/40)),e[1]=new String(i%40);for(var n=t.substr(2),o=[],s=0;s<n.length/2;s++)o.push(parseInt(n.substr(2*s,2),16));var a=[],u="";for(s=0;s<o.length;s++)128&o[s]?u+=Dt((127&o[s]).toString(2),7):(u+=Dt((127&o[s]).toString(2),7),a.push(new String(parseInt(u,2))),u="");var h=e.join(".");return a.length>0&&(h=h+"."+a.join(".")),h}catch(t){return null}}(lt.getV(t,e))}catch(t){return r}},lt.getOIDName=function(t,e,r){null==r&&(r=null);try{var i=lt.getOID(t,e,r);if(i==r)return r;var n=ht.asn1.x509.OID.oid2name(i);return""==n?i:n}catch(t){return r}},lt.getString=function(t,e,r){null==r&&(r=null);try{return Et(lt.getV(t,e))}catch(t){return r}},lt.hextooidstr=function(t){var e=function(t,e){return t.length>=e?t:new Array(e-t.length+1).join("0")+t},r=[],i=t.substr(0,2),n=parseInt(i,16);r[0]=new String(Math.floor(n/40)),r[1]=new String(n%40);for(var o=t.substr(2),s=[],a=0;a<o.length/2;a++)s.push(parseInt(o.substr(2*a,2),16));var u=[],h="";for(a=0;a<s.length;a++)128&s[a]?h+=e((127&s[a]).toString(2),7):(h+=e((127&s[a]).toString(2),7),u.push(new String(parseInt(h,2))),h="");var c=r.join(".");return u.length>0&&(c=c+"."+u.join(".")),c},lt.dump=function(t,e,r,i){var n=lt,o=n.getV,s=n.dump,a=n.getChildIdx,u=t;t instanceof ht.asn1.ASN1Object&&(u=t.getEncodedHex());var h=function(t,e){return t.length<=2*e?t:t.substr(0,e)+"..(total "+t.length/2+"bytes).."+t.substr(t.length-e,e)};void 0===e&&(e={ommit_long_octet:32}),void 0===r&&(r=0),void 0===i&&(i="");var c,f=e.ommit_long_octet;if("01"==(c=u.substr(r,2)))return"00"==(l=o(u,r))?i+"BOOLEAN FALSE\n":i+"BOOLEAN TRUE\n";if("02"==c)return i+"INTEGER "+h(l=o(u,r),f)+"\n";if("03"==c){var l=o(u,r);return n.isASN1HEX(l.substr(2))?(_=i+"BITSTRING, encapsulates\n")+s(l.substr(2),e,0,i+"  "):i+"BITSTRING "+h(l,f)+"\n"}if("04"==c)return l=o(u,r),n.isASN1HEX(l)?(_=i+"OCTETSTRING, encapsulates\n")+s(l,e,0,i+"  "):i+"OCTETSTRING "+h(l,f)+"\n";if("05"==c)return i+"NULL\n";if("06"==c){var d=o(u,r),p=ht.asn1.ASN1Util.oidHexToInt(d),g=ht.asn1.x509.OID.oid2name(p),y=p.replace(/\./g," ");return""!=g?i+"ObjectIdentifier "+g+" ("+y+")\n":i+"ObjectIdentifier ("+y+")\n"}if("0a"==c)return i+"ENUMERATED "+parseInt(o(u,r))+"\n";if("0c"==c)return i+"UTF8String '"+St(o(u,r))+"'\n";if("13"==c)return i+"PrintableString '"+St(o(u,r))+"'\n";if("14"==c)return i+"TeletexString '"+St(o(u,r))+"'\n";if("16"==c)return i+"IA5String '"+St(o(u,r))+"'\n";if("17"==c)return i+"UTCTime "+St(o(u,r))+"\n";if("18"==c)return i+"GeneralizedTime "+St(o(u,r))+"\n";if("1a"==c)return i+"VisualString '"+St(o(u,r))+"'\n";if("1e"==c)return i+"BMPString '"+St(o(u,r))+"'\n";if("30"==c){if("3000"==u.substr(r,4))return i+"SEQUENCE {}\n";_=i+"SEQUENCE\n";var m=e;if((2==(w=a(u,r)).length||3==w.length)&&"06"==u.substr(w[0],2)&&"04"==u.substr(w[w.length-1],2)){g=n.oidname(o(u,w[0]));var v=JSON.parse(JSON.stringify(e));v.x509ExtName=g,m=v}for(var b=0;b<w.length;b++)_+=s(u,m,w[b],i+"  ");return _}if("31"==c){_=i+"SET\n";var w=a(u,r);for(b=0;b<w.length;b++)_+=s(u,e,w[b],i+"  ");return _}if(0!=(128&(c=parseInt(c,16)))){var _,S=31&c;if(0!=(32&c)){for(_=i+"["+S+"]\n",w=a(u,r),b=0;b<w.length;b++)_+=s(u,e,w[b],i+"  ");return _}return l=o(u,r),lt.isASN1HEX(l)?(_=i+"["+S+"]\n")+s(l,e,0,i+"  "):(("68747470"==l.substr(0,8)||"subjectAltName"===e.x509ExtName&&2==S)&&(l=St(l)),i+"["+S+"] "+l+"\n")}return i+"UNKNOWN("+c+") "+o(u,r)+"\n"},lt.isContextTag=function(t,e){var r,i;t=t.toLowerCase();try{r=parseInt(t,16)}catch(t){return-1}if(void 0===e)return 128==(192&r);try{return null!=e.match(/^\[[0-9]+\]$/)&&!((i=parseInt(e.substr(1,e.length-1),10))>31)&&128==(192&r)&&(31&r)==i}catch(t){return!1}},lt.isASN1HEX=function(t){var e=lt;if(t.length%2==1)return!1;var r=e.getVblen(t,0),i=t.substr(0,2),n=e.getL(t,0);return t.length-i.length-n.length==2*r},lt.checkStrictDER=function(t,e,r,i,n){var o=lt;if(void 0===r){if("string"!=typeof t)throw new Error("not hex string");if(t=t.toLowerCase(),!ht.lang.String.isHex(t))throw new Error("not hex string");r=t.length,n=(i=t.length/2)<128?1:Math.ceil(i.toString(16))+1}if(o.getL(t,e).length>2*n)throw new Error("L of TLV too long: idx="+e);var s=o.getVblen(t,e);if(s>i)throw new Error("value of L too long than hex: idx="+e);var a=o.getTLV(t,e),u=a.length-2-o.getL(t,e).length;if(u!==2*s)throw new Error("V string length and L's value not the same:"+u+"/"+2*s);if(0===e&&t.length!=a.length)throw new Error("total length and TLV length unmatch:"+t.length+"!="+a.length);var h=t.substr(e,2);if("02"===h){var c=o.getVidx(t,e);if("00"==t.substr(c,2)&&t.charCodeAt(c+2)<56)throw new Error("not least zeros for DER INTEGER")}if(32&parseInt(h,16)){for(var f=o.getVblen(t,e),l=0,d=o.getChildIdx(t,e),p=0;p<d.length;p++)l+=o.getTLV(t,d[p]).length,o.checkStrictDER(t,d[p],r,i,n);if(2*f!=l)throw new Error("sum of children's TLV length and L unmatch: "+2*f+"!="+l)}},lt.oidname=function(t){var e=ht.asn1;ht.lang.String.isHex(t)&&(t=e.ASN1Util.oidHexToInt(t));var r=e.x509.OID.oid2name(t);return""===r&&(r=t),r},void 0!==ht&&ht||(e.KJUR=ht={}),void 0!==ht.lang&&ht.lang||(ht.lang={}),ht.lang.String=function(){},"function"==typeof t?(e.utf8tob64u=ct=function(e){return mt(t.from(e,"utf8").toString("base64"))},e.b64utoutf8=ft=function(e){return t.from(vt(e),"base64").toString("utf8")}):(e.utf8tob64u=ct=function(t){return bt(xt(Lt(t)))},e.b64utoutf8=ft=function(t){return decodeURIComponent(Ft(wt(t)))}),ht.lang.String.isInteger=function(t){return!!t.match(/^[0-9]+$/)||!!t.match(/^-[0-9]+$/)},ht.lang.String.isHex=function(t){return Ut(t)},ht.lang.String.isBase64=function(t){return!(!(t=t.replace(/\s+/g,"")).match(/^[0-9A-Za-z+\/]+={0,3}$/)||t.length%4!=0)},ht.lang.String.isBase64URL=function(t){return!t.match(/[+/=]/)&&(t=vt(t),ht.lang.String.isBase64(t))},ht.lang.String.isIntegerArray=function(t){return!!(t=t.replace(/\s+/g,"")).match(/^\[[0-9,]+\]$/)},ht.lang.String.isPrintable=function(t){return null!==t.match(/^[0-9A-Za-z '()+,-./:=?]*$/)},ht.lang.String.isIA5=function(t){return null!==t.match(/^[\x20-\x21\x23-\x7f]*$/)},ht.lang.String.isMail=function(t){return null!==t.match(/^[A-Za-z0-9]{1}[A-Za-z0-9_.-]*@{1}[A-Za-z0-9_.-]{1,}\.[A-Za-z0-9]{1,}$/)};var Dt=function(t,e,r){return null==r&&(r="0"),t.length>=e?t:new Array(e-t.length+1).join(r)+t};void 0!==ht&&ht||(e.KJUR=ht={}),void 0!==ht.crypto&&ht.crypto||(ht.crypto={}),ht.crypto.Util=new function(){this.DIGESTINFOHEAD={sha1:"3021300906052b0e03021a05000414",sha224:"302d300d06096086480165030402040500041c",sha256:"3031300d060960864801650304020105000420",sha384:"3041300d060960864801650304020205000430",sha512:"3051300d060960864801650304020305000440",md2:"3020300c06082a864886f70d020205000410",md5:"3020300c06082a864886f70d020505000410",ripemd160:"3021300906052b2403020105000414"},this.DEFAULTPROVIDER={md5:"cryptojs",sha1:"cryptojs",sha224:"cryptojs",sha256:"cryptojs",sha384:"cryptojs",sha512:"cryptojs",ripemd160:"cryptojs",hmacmd5:"cryptojs",hmacsha1:"cryptojs",hmacsha224:"cryptojs",hmacsha256:"cryptojs",hmacsha384:"cryptojs",hmacsha512:"cryptojs",hmacripemd160:"cryptojs",MD5withRSA:"cryptojs/jsrsa",SHA1withRSA:"cryptojs/jsrsa",SHA224withRSA:"cryptojs/jsrsa",SHA256withRSA:"cryptojs/jsrsa",SHA384withRSA:"cryptojs/jsrsa",SHA512withRSA:"cryptojs/jsrsa",RIPEMD160withRSA:"cryptojs/jsrsa",MD5withECDSA:"cryptojs/jsrsa",SHA1withECDSA:"cryptojs/jsrsa",SHA224withECDSA:"cryptojs/jsrsa",SHA256withECDSA:"cryptojs/jsrsa",SHA384withECDSA:"cryptojs/jsrsa",SHA512withECDSA:"cryptojs/jsrsa",RIPEMD160withECDSA:"cryptojs/jsrsa",SHA1withDSA:"cryptojs/jsrsa",SHA224withDSA:"cryptojs/jsrsa",SHA256withDSA:"cryptojs/jsrsa",MD5withRSAandMGF1:"cryptojs/jsrsa",SHAwithRSAandMGF1:"cryptojs/jsrsa",SHA1withRSAandMGF1:"cryptojs/jsrsa",SHA224withRSAandMGF1:"cryptojs/jsrsa",SHA256withRSAandMGF1:"cryptojs/jsrsa",SHA384withRSAandMGF1:"cryptojs/jsrsa",SHA512withRSAandMGF1:"cryptojs/jsrsa",RIPEMD160withRSAandMGF1:"cryptojs/jsrsa"},this.CRYPTOJSMESSAGEDIGESTNAME={md5:m.algo.MD5,sha1:m.algo.SHA1,sha224:m.algo.SHA224,sha256:m.algo.SHA256,sha384:m.algo.SHA384,sha512:m.algo.SHA512,ripemd160:m.algo.RIPEMD160},this.getDigestInfoHex=function(t,e){if(void 0===this.DIGESTINFOHEAD[e])throw"alg not supported in Util.DIGESTINFOHEAD: "+e;return this.DIGESTINFOHEAD[e]+t},this.getPaddedDigestInfoHex=function(t,e,r){var i=this.getDigestInfoHex(t,e),n=r/4;if(i.length+22>n)throw"key is too short for SigAlg: keylen="+r+","+e;for(var o="0001",s="00"+i,a="",u=n-o.length-s.length,h=0;h<u;h+=2)a+="ff";return o+a+s},this.hashString=function(t,e){return new ht.crypto.MessageDigest({alg:e}).digestString(t)},this.hashHex=function(t,e){return new ht.crypto.MessageDigest({alg:e}).digestHex(t)},this.sha1=function(t){return this.hashString(t,"sha1")},this.sha256=function(t){return this.hashString(t,"sha256")},this.sha256Hex=function(t){return this.hashHex(t,"sha256")},this.sha512=function(t){return this.hashString(t,"sha512")},this.sha512Hex=function(t){return this.hashHex(t,"sha512")},this.isKey=function(t){return t instanceof nt||t instanceof ht.crypto.DSA||t instanceof ht.crypto.ECDSA}},ht.crypto.Util.md5=function(t){return new ht.crypto.MessageDigest({alg:"md5",prov:"cryptojs"}).digestString(t)},ht.crypto.Util.ripemd160=function(t){return new ht.crypto.MessageDigest({alg:"ripemd160",prov:"cryptojs"}).digestString(t)},ht.crypto.Util.SECURERANDOMGEN=new et,ht.crypto.Util.getRandomHexOfNbytes=function(t){var e=new Array(t);return ht.crypto.Util.SECURERANDOMGEN.nextBytes(e),gt(e)},ht.crypto.Util.getRandomBigIntegerOfNbytes=function(t){return new E(ht.crypto.Util.getRandomHexOfNbytes(t),16)},ht.crypto.Util.getRandomHexOfNbits=function(t){var e=t%8,r=new Array((t-e)/8+1);return ht.crypto.Util.SECURERANDOMGEN.nextBytes(r),r[0]=(255<<e&255^255)&r[0],gt(r)},ht.crypto.Util.getRandomBigIntegerOfNbits=function(t){return new E(ht.crypto.Util.getRandomHexOfNbits(t),16)},ht.crypto.Util.getRandomBigIntegerZeroToMax=function(t){for(var e=t.bitLength();;){var r=ht.crypto.Util.getRandomBigIntegerOfNbits(e);if(-1!=t.compareTo(r))return r}},ht.crypto.Util.getRandomBigIntegerMinToMax=function(t,e){var r=t.compareTo(e);if(1==r)throw"biMin is greater than biMax";if(0==r)return t;var i=e.subtract(t);return ht.crypto.Util.getRandomBigIntegerZeroToMax(i).add(t)},ht.crypto.MessageDigest=function(t){this.setAlgAndProvider=function(t,e){if(null!==(t=ht.crypto.MessageDigest.getCanonicalAlgName(t))&&void 0===e&&(e=ht.crypto.Util.DEFAULTPROVIDER[t]),-1!=":md5:sha1:sha224:sha256:sha384:sha512:ripemd160:".indexOf(t)&&"cryptojs"==e){try{this.md=ht.crypto.Util.CRYPTOJSMESSAGEDIGESTNAME[t].create()}catch(e){throw"setAlgAndProvider hash alg set fail alg="+t+"/"+e}this.updateString=function(t){this.md.update(t)},this.updateHex=function(t){var e=m.enc.Hex.parse(t);this.md.update(e)},this.digest=function(){return this.md.finalize().toString(m.enc.Hex)},this.digestString=function(t){return this.updateString(t),this.digest()},this.digestHex=function(t){return this.updateHex(t),this.digest()}}if(-1!=":sha256:".indexOf(t)&&"sjcl"==e){try{this.md=new sjcl.hash.sha256}catch(e){throw"setAlgAndProvider hash alg set fail alg="+t+"/"+e}this.updateString=function(t){this.md.update(t)},this.updateHex=function(t){var e=sjcl.codec.hex.toBits(t);this.md.update(e)},this.digest=function(){var t=this.md.finalize();return sjcl.codec.hex.fromBits(t)},this.digestString=function(t){return this.updateString(t),this.digest()},this.digestHex=function(t){return this.updateHex(t),this.digest()}}},this.updateString=function(t){throw"updateString(str) not supported for this alg/prov: "+this.algName+"/"+this.provName},this.updateHex=function(t){throw"updateHex(hex) not supported for this alg/prov: "+this.algName+"/"+this.provName},this.digest=function(){throw"digest() not supported for this alg/prov: "+this.algName+"/"+this.provName},this.digestString=function(t){throw"digestString(str) not supported for this alg/prov: "+this.algName+"/"+this.provName},this.digestHex=function(t){throw"digestHex(hex) not supported for this alg/prov: "+this.algName+"/"+this.provName},void 0!==t&&void 0!==t.alg&&(this.algName=t.alg,void 0===t.prov&&(this.provName=ht.crypto.Util.DEFAULTPROVIDER[this.algName]),this.setAlgAndProvider(this.algName,this.provName))},ht.crypto.MessageDigest.getCanonicalAlgName=function(t){return"string"==typeof t&&(t=(t=t.toLowerCase()).replace(/-/,"")),t},ht.crypto.MessageDigest.getHashLength=function(t){var e=ht.crypto.MessageDigest,r=e.getCanonicalAlgName(t);if(void 0===e.HASHLENGTH[r])throw"not supported algorithm: "+t;return e.HASHLENGTH[r]},ht.crypto.MessageDigest.HASHLENGTH={md5:16,sha1:20,sha224:28,sha256:32,sha384:48,sha512:64,ripemd160:20},ht.crypto.Mac=function(t){this.setAlgAndProvider=function(t,e){if(null==(t=t.toLowerCase())&&(t="hmacsha1"),"hmac"!=(t=t.toLowerCase()).substr(0,4))throw"setAlgAndProvider unsupported HMAC alg: "+t;void 0===e&&(e=ht.crypto.Util.DEFAULTPROVIDER[t]),this.algProv=t+"/"+e;var r=t.substr(4);if(-1!=":md5:sha1:sha224:sha256:sha384:sha512:ripemd160:".indexOf(r)&&"cryptojs"==e){try{var i=ht.crypto.Util.CRYPTOJSMESSAGEDIGESTNAME[r];this.mac=m.algo.HMAC.create(i,this.pass)}catch(t){throw"setAlgAndProvider hash alg set fail hashAlg="+r+"/"+t}this.updateString=function(t){this.mac.update(t)},this.updateHex=function(t){var e=m.enc.Hex.parse(t);this.mac.update(e)},this.doFinal=function(){return this.mac.finalize().toString(m.enc.Hex)},this.doFinalString=function(t){return this.updateString(t),this.doFinal()},this.doFinalHex=function(t){return this.updateHex(t),this.doFinal()}}},this.updateString=function(t){throw"updateString(str) not supported for this alg/prov: "+this.algProv},this.updateHex=function(t){throw"updateHex(hex) not supported for this alg/prov: "+this.algProv},this.doFinal=function(){throw"digest() not supported for this alg/prov: "+this.algProv},this.doFinalString=function(t){throw"digestString(str) not supported for this alg/prov: "+this.algProv},this.doFinalHex=function(t){throw"digestHex(hex) not supported for this alg/prov: "+this.algProv},this.setPassword=function(t){if("string"==typeof t){var e=t;return t.length%2!=1&&t.match(/^[0-9A-Fa-f]+$/)||(e=Mt(t)),void(this.pass=m.enc.Hex.parse(e))}if("object"!=(void 0===t?"undefined":r(t)))throw"KJUR.crypto.Mac unsupported password type: "+t;if(e=null,void 0!==t.hex){if(t.hex.length%2!=0||!t.hex.match(/^[0-9A-Fa-f]+$/))throw"Mac: wrong hex password: "+t.hex;e=t.hex}if(void 0!==t.utf8&&(e=_t(t.utf8)),void 0!==t.rstr&&(e=Mt(t.rstr)),void 0!==t.b64&&(e=_(t.b64)),void 0!==t.b64u&&(e=wt(t.b64u)),null==e)throw"KJUR.crypto.Mac unsupported password type: "+t;this.pass=m.enc.Hex.parse(e)},void 0!==t&&(void 0!==t.pass&&this.setPassword(t.pass),void 0!==t.alg&&(this.algName=t.alg,void 0===t.prov&&(this.provName=ht.crypto.Util.DEFAULTPROVIDER[this.algName]),this.setAlgAndProvider(this.algName,this.provName)))},ht.crypto.Signature=function(t){var e=null;if(this._setAlgNames=function(){var t=this.algName.match(/^(.+)with(.+)$/);t&&(this.mdAlgName=t[1].toLowerCase(),this.pubkeyAlgName=t[2].toLowerCase(),"rsaandmgf1"==this.pubkeyAlgName&&"sha"==this.mdAlgName&&(this.mdAlgName="sha1"))},this._zeroPaddingOfSignature=function(t,e){for(var r="",i=e/4-t.length,n=0;n<i;n++)r+="0";return r+t},this.setAlgAndProvider=function(t,e){if(this._setAlgNames(),"cryptojs/jsrsa"!=e)throw new Error("provider not supported: "+e);if(-1!=":md5:sha1:sha224:sha256:sha384:sha512:ripemd160:".indexOf(this.mdAlgName)){try{this.md=new ht.crypto.MessageDigest({alg:this.mdAlgName})}catch(t){throw new Error("setAlgAndProvider hash alg set fail alg="+this.mdAlgName+"/"+t)}this.init=function(t,e){var r=null;try{r=void 0===e?Kt.getKey(t):Kt.getKey(t,e)}catch(t){throw"init failed:"+t}if(!0===r.isPrivate)this.prvKey=r,this.state="SIGN";else{if(!0!==r.isPublic)throw"init failed.:"+r;this.pubKey=r,this.state="VERIFY"}},this.updateString=function(t){this.md.updateString(t)},this.updateHex=function(t){this.md.updateHex(t)},this.sign=function(){if(this.sHashHex=this.md.digest(),void 0===this.prvKey&&void 0!==this.ecprvhex&&void 0!==this.eccurvename&&void 0!==ht.crypto.ECDSA&&(this.prvKey=new ht.crypto.ECDSA({curve:this.eccurvename,prv:this.ecprvhex})),this.prvKey instanceof nt&&"rsaandmgf1"===this.pubkeyAlgName)this.hSign=this.prvKey.signWithMessageHashPSS(this.sHashHex,this.mdAlgName,this.pssSaltLen);else if(this.prvKey instanceof nt&&"rsa"===this.pubkeyAlgName)this.hSign=this.prvKey.signWithMessageHash(this.sHashHex,this.mdAlgName);else if(this.prvKey instanceof ht.crypto.ECDSA)this.hSign=this.prvKey.signWithMessageHash(this.sHashHex);else{if(!(this.prvKey instanceof ht.crypto.DSA))throw"Signature: unsupported private key alg: "+this.pubkeyAlgName;this.hSign=this.prvKey.signWithMessageHash(this.sHashHex)}return this.hSign},this.signString=function(t){return this.updateString(t),this.sign()},this.signHex=function(t){return this.updateHex(t),this.sign()},this.verify=function(t){if(this.sHashHex=this.md.digest(),void 0===this.pubKey&&void 0!==this.ecpubhex&&void 0!==this.eccurvename&&void 0!==ht.crypto.ECDSA&&(this.pubKey=new ht.crypto.ECDSA({curve:this.eccurvename,pub:this.ecpubhex})),this.pubKey instanceof nt&&"rsaandmgf1"===this.pubkeyAlgName)return this.pubKey.verifyWithMessageHashPSS(this.sHashHex,t,this.mdAlgName,this.pssSaltLen);if(this.pubKey instanceof nt&&"rsa"===this.pubkeyAlgName)return this.pubKey.verifyWithMessageHash(this.sHashHex,t);if(void 0!==ht.crypto.ECDSA&&this.pubKey instanceof ht.crypto.ECDSA)return this.pubKey.verifyWithMessageHash(this.sHashHex,t);if(void 0!==ht.crypto.DSA&&this.pubKey instanceof ht.crypto.DSA)return this.pubKey.verifyWithMessageHash(this.sHashHex,t);throw"Signature: unsupported public key alg: "+this.pubkeyAlgName}}},this.init=function(t,e){throw"init(key, pass) not supported for this alg:prov="+this.algProvName},this.updateString=function(t){throw"updateString(str) not supported for this alg:prov="+this.algProvName},this.updateHex=function(t){throw"updateHex(hex) not supported for this alg:prov="+this.algProvName},this.sign=function(){throw"sign() not supported for this alg:prov="+this.algProvName},this.signString=function(t){throw"digestString(str) not supported for this alg:prov="+this.algProvName},this.signHex=function(t){throw"digestHex(hex) not supported for this alg:prov="+this.algProvName},this.verify=function(t){throw"verify(hSigVal) not supported for this alg:prov="+this.algProvName},this.initParams=t,void 0!==t&&(void 0!==t.alg&&(this.algName=t.alg,void 0===t.prov?this.provName=ht.crypto.Util.DEFAULTPROVIDER[this.algName]:this.provName=t.prov,this.algProvName=this.algName+":"+this.provName,this.setAlgAndProvider(this.algName,this.provName),this._setAlgNames()),void 0!==t.psssaltlen&&(this.pssSaltLen=t.psssaltlen),void 0!==t.prvkeypem)){if(void 0!==t.prvkeypas)throw"both prvkeypem and prvkeypas parameters not supported";try{e=Kt.getKey(t.prvkeypem),this.init(e)}catch(t){throw"fatal error to load pem private key: "+t}}},ht.crypto.Cipher=function(t){},ht.crypto.Cipher.encrypt=function(t,e,r){if(e instanceof nt&&e.isPublic){var i=ht.crypto.Cipher.getAlgByKeyAndName(e,r);if("RSA"===i)return e.encrypt(t);if("RSAOAEP"===i)return e.encryptOAEP(t,"sha1");var n=i.match(/^RSAOAEP(\d+)$/);if(null!==n)return e.encryptOAEP(t,"sha"+n[1]);throw"Cipher.encrypt: unsupported algorithm for RSAKey: "+r}throw"Cipher.encrypt: unsupported key or algorithm"},ht.crypto.Cipher.decrypt=function(t,e,r){if(e instanceof nt&&e.isPrivate){var i=ht.crypto.Cipher.getAlgByKeyAndName(e,r);if("RSA"===i)return e.decrypt(t);if("RSAOAEP"===i)return e.decryptOAEP(t,"sha1");var n=i.match(/^RSAOAEP(\d+)$/);if(null!==n)return e.decryptOAEP(t,"sha"+n[1]);throw"Cipher.decrypt: unsupported algorithm for RSAKey: "+r}throw"Cipher.decrypt: unsupported key or algorithm"},ht.crypto.Cipher.getAlgByKeyAndName=function(t,e){if(t instanceof nt){if(-1!=":RSA:RSAOAEP:RSAOAEP224:RSAOAEP256:RSAOAEP384:RSAOAEP512:".indexOf(e))return e;if(null==e)return"RSA";throw"getAlgByKeyAndName: not supported algorithm name for RSAKey: "+e}throw"getAlgByKeyAndName: not supported algorithm name: "+e},ht.crypto.OID=new function(){this.oidhex2name={"2a864886f70d010101":"rsaEncryption","2a8648ce3d0201":"ecPublicKey","2a8648ce380401":"dsa","2a8648ce3d030107":"secp256r1","2b8104001f":"secp192k1","2b81040021":"secp224r1","2b8104000a":"secp256k1","2b81040023":"secp521r1","2b81040022":"secp384r1","2a8648ce380403":"SHA1withDSA","608648016503040301":"SHA224withDSA","608648016503040302":"SHA256withDSA"}},void 0!==ht&&ht||(e.KJUR=ht={}),void 0!==ht.crypto&&ht.crypto||(ht.crypto={}),ht.crypto.ECDSA=function(t){var e=Error,i=E,n=st,o=ht.crypto.ECDSA,s=ht.crypto.ECParameterDB,a=o.getName,u=lt,h=u.getVbyListEx,c=u.isASN1HEX,f=new et;this.type="EC",this.isPrivate=!1,this.isPublic=!1,this.getBigRandom=function(t){return new i(t.bitLength(),f).mod(t.subtract(i.ONE)).add(i.ONE)},this.setNamedCurve=function(t){this.ecparams=s.getByName(t),this.prvKeyHex=null,this.pubKeyHex=null,this.curveName=t},this.setPrivateKeyHex=function(t){this.isPrivate=!0,this.prvKeyHex=t},this.setPublicKeyHex=function(t){this.isPublic=!0,this.pubKeyHex=t},this.getPublicKeyXYHex=function(){var t=this.pubKeyHex;if("04"!==t.substr(0,2))throw"this method supports uncompressed format(04) only";var e=this.ecparams.keylen/4;if(t.length!==2+2*e)throw"malformed public key hex length";var r={};return r.x=t.substr(2,e),r.y=t.substr(2+e),r},this.getShortNISTPCurveName=function(){var t=this.curveName;return"secp256r1"===t||"NIST P-256"===t||"P-256"===t||"prime256v1"===t?"P-256":"secp384r1"===t||"NIST P-384"===t||"P-384"===t?"P-384":null},this.generateKeyPairHex=function(){var t=this.ecparams.n,e=this.getBigRandom(t),r=this.ecparams.G.multiply(e),i=r.getX().toBigInteger(),n=r.getY().toBigInteger(),o=this.ecparams.keylen/4,s=("0000000000"+e.toString(16)).slice(-o),a="04"+("0000000000"+i.toString(16)).slice(-o)+("0000000000"+n.toString(16)).slice(-o);return this.setPrivateKeyHex(s),this.setPublicKeyHex(a),{ecprvhex:s,ecpubhex:a}},this.signWithMessageHash=function(t){return this.signHex(t,this.prvKeyHex)},this.signHex=function(t,e){var r=new i(e,16),n=this.ecparams.n,s=new i(t.substring(0,this.ecparams.keylen/4),16);do{var a=this.getBigRandom(n),u=this.ecparams.G.multiply(a).getX().toBigInteger().mod(n)}while(u.compareTo(i.ZERO)<=0);var h=a.modInverse(n).multiply(s.add(r.multiply(u))).mod(n);return o.biRSSigToASN1Sig(u,h)},this.sign=function(t,e){var r=e,n=this.ecparams.n,o=i.fromByteArrayUnsigned(t);do{var s=this.getBigRandom(n),a=this.ecparams.G.multiply(s).getX().toBigInteger().mod(n)}while(a.compareTo(E.ZERO)<=0);var u=s.modInverse(n).multiply(o.add(r.multiply(a))).mod(n);return this.serializeSig(a,u)},this.verifyWithMessageHash=function(t,e){return this.verifyHex(t,e,this.pubKeyHex)},this.verifyHex=function(t,e,r){try{var s,a,u=o.parseSigHex(e);s=u.r,a=u.s;var h=n.decodeFromHex(this.ecparams.curve,r),c=new i(t.substring(0,this.ecparams.keylen/4),16);return this.verifyRaw(c,s,a,h)}catch(t){return!1}},this.verify=function(t,e,o){var s,a,u;if(Bitcoin.Util.isArray(e)){var h=this.parseSig(e);s=h.r,a=h.s}else{if("object"!==(void 0===e?"undefined":r(e))||!e.r||!e.s)throw"Invalid value for signature";s=e.r,a=e.s}if(o instanceof st)u=o;else{if(!Bitcoin.Util.isArray(o))throw"Invalid format for pubkey value, must be byte array or ECPointFp";u=n.decodeFrom(this.ecparams.curve,o)}var c=i.fromByteArrayUnsigned(t);return this.verifyRaw(c,s,a,u)},this.verifyRaw=function(t,e,r,n){var o=this.ecparams.n,s=this.ecparams.G;if(e.compareTo(i.ONE)<0||e.compareTo(o)>=0)return!1;if(r.compareTo(i.ONE)<0||r.compareTo(o)>=0)return!1;var a=r.modInverse(o),u=t.multiply(a).mod(o),h=e.multiply(a).mod(o);return s.multiply(u).add(n.multiply(h)).getX().toBigInteger().mod(o).equals(e)},this.serializeSig=function(t,e){var r=t.toByteArraySigned(),i=e.toByteArraySigned(),n=[];return n.push(2),n.push(r.length),(n=n.concat(r)).push(2),n.push(i.length),(n=n.concat(i)).unshift(n.length),n.unshift(48),n},this.parseSig=function(t){var e;if(48!=t[0])throw new Error("Signature not a valid DERSequence");if(2!=t[e=2])throw new Error("First element in signature must be a DERInteger");var r=t.slice(e+2,e+2+t[e+1]);if(2!=t[e+=2+t[e+1]])throw new Error("Second element in signature must be a DERInteger");var n=t.slice(e+2,e+2+t[e+1]);return e+=2+t[e+1],{r:i.fromByteArrayUnsigned(r),s:i.fromByteArrayUnsigned(n)}},this.parseSigCompact=function(t){if(65!==t.length)throw"Signature has the wrong length";var e=t[0]-27;if(e<0||e>7)throw"Invalid signature type";var r=this.ecparams.n;return{r:i.fromByteArrayUnsigned(t.slice(1,33)).mod(r),s:i.fromByteArrayUnsigned(t.slice(33,65)).mod(r),i:e}},this.readPKCS5PrvKeyHex=function(t){if(!1===c(t))throw new Error("not ASN.1 hex string");var e,r,i;try{e=h(t,0,["[0]",0],"06"),r=h(t,0,[1],"04");try{i=h(t,0,["[1]",0],"03")}catch(t){}}catch(t){throw new Error("malformed PKCS#1/5 plain ECC private key")}if(this.curveName=a(e),void 0===this.curveName)throw"unsupported curve name";this.setNamedCurve(this.curveName),this.setPublicKeyHex(i),this.setPrivateKeyHex(r),this.isPublic=!1},this.readPKCS8PrvKeyHex=function(t){if(!1===c(t))throw new e("not ASN.1 hex string");var r,i,n;try{h(t,0,[1,0],"06"),r=h(t,0,[1,1],"06"),i=h(t,0,[2,0,1],"04");try{n=h(t,0,[2,0,"[1]",0],"03")}catch(t){}}catch(t){throw new e("malformed PKCS#8 plain ECC private key")}if(this.curveName=a(r),void 0===this.curveName)throw new e("unsupported curve name");this.setNamedCurve(this.curveName),this.setPublicKeyHex(n),this.setPrivateKeyHex(i),this.isPublic=!1},this.readPKCS8PubKeyHex=function(t){if(!1===c(t))throw new e("not ASN.1 hex string");var r,i;try{h(t,0,[0,0],"06"),r=h(t,0,[0,1],"06"),i=h(t,0,[1],"03")}catch(t){throw new e("malformed PKCS#8 ECC public key")}if(this.curveName=a(r),null===this.curveName)throw new e("unsupported curve name");this.setNamedCurve(this.curveName),this.setPublicKeyHex(i)},this.readCertPubKeyHex=function(t,r){if(!1===c(t))throw new e("not ASN.1 hex string");var i,n;try{i=h(t,0,[0,5,0,1],"06"),n=h(t,0,[0,5,1],"03")}catch(t){throw new e("malformed X.509 certificate ECC public key")}if(this.curveName=a(i),null===this.curveName)throw new e("unsupported curve name");this.setNamedCurve(this.curveName),this.setPublicKeyHex(n)},void 0!==t&&void 0!==t.curve&&(this.curveName=t.curve),void 0===this.curveName&&(this.curveName="secp256r1"),this.setNamedCurve(this.curveName),void 0!==t&&(void 0!==t.prv&&this.setPrivateKeyHex(t.prv),void 0!==t.pub&&this.setPublicKeyHex(t.pub))},ht.crypto.ECDSA.parseSigHex=function(t){var e=ht.crypto.ECDSA.parseSigHexInHexRS(t);return{r:new E(e.r,16),s:new E(e.s,16)}},ht.crypto.ECDSA.parseSigHexInHexRS=function(t){var e=lt,r=e.getChildIdx,i=e.getV;if(e.checkStrictDER(t,0),"30"!=t.substr(0,2))throw new Error("signature is not a ASN.1 sequence");var n=r(t,0);if(2!=n.length)throw new Error("signature shall have two elements");var o=n[0],s=n[1];if("02"!=t.substr(o,2))throw new Error("1st item not ASN.1 integer");if("02"!=t.substr(s,2))throw new Error("2nd item not ASN.1 integer");return{r:i(t,o),s:i(t,s)}},ht.crypto.ECDSA.asn1SigToConcatSig=function(t){var e=ht.crypto.ECDSA.parseSigHexInHexRS(t),r=e.r,i=e.s;if("00"==r.substr(0,2)&&r.length%32==2&&(r=r.substr(2)),"00"==i.substr(0,2)&&i.length%32==2&&(i=i.substr(2)),r.length%32==30&&(r="00"+r),i.length%32==30&&(i="00"+i),r.length%32!=0)throw"unknown ECDSA sig r length error";if(i.length%32!=0)throw"unknown ECDSA sig s length error";return r+i},ht.crypto.ECDSA.concatSigToASN1Sig=function(t){if(t.length/2*8%128!=0)throw"unknown ECDSA concatinated r-s sig  length error";var e=t.substr(0,t.length/2),r=t.substr(t.length/2);return ht.crypto.ECDSA.hexRSSigToASN1Sig(e,r)},ht.crypto.ECDSA.hexRSSigToASN1Sig=function(t,e){var r=new E(t,16),i=new E(e,16);return ht.crypto.ECDSA.biRSSigToASN1Sig(r,i)},ht.crypto.ECDSA.biRSSigToASN1Sig=function(t,e){var r=ht.asn1,i=new r.DERInteger({bigint:t}),n=new r.DERInteger({bigint:e});return new r.DERSequence({array:[i,n]}).getEncodedHex()},ht.crypto.ECDSA.getName=function(t){return"2b8104001f"===t?"secp192k1":"2a8648ce3d030107"===t?"secp256r1":"2b8104000a"===t?"secp256k1":"2b81040021"===t?"secp224r1":"2b81040022"===t?"secp384r1":-1!=="|secp256r1|NIST P-256|P-256|prime256v1|".indexOf(t)?"secp256r1":-1!=="|secp256k1|".indexOf(t)?"secp256k1":-1!=="|secp224r1|NIST P-224|P-224|".indexOf(t)?"secp224r1":-1!=="|secp384r1|NIST P-384|P-384|".indexOf(t)?"secp384r1":null},void 0!==ht&&ht||(e.KJUR=ht={}),void 0!==ht.crypto&&ht.crypto||(ht.crypto={}),ht.crypto.ECParameterDB=new function(){var t={},e={};function r(t){return new E(t,16)}this.getByName=function(r){var i=r;if(void 0!==e[i]&&(i=e[r]),void 0!==t[i])return t[i];throw"unregistered EC curve name: "+i},this.regist=function(i,n,o,s,a,u,h,c,f,l,d,p){t[i]={};var g=r(o),y=r(s),m=r(a),v=r(u),b=r(h),w=new at(g,y,m),_=w.decodePointHex("04"+c+f);t[i].name=i,t[i].keylen=n,t[i].curve=w,t[i].G=_,t[i].n=v,t[i].h=b,t[i].oid=d,t[i].info=p;for(var S=0;S<l.length;S++)e[l[S]]=i}},ht.crypto.ECParameterDB.regist("secp128r1",128,"FFFFFFFDFFFFFFFFFFFFFFFFFFFFFFFF","FFFFFFFDFFFFFFFFFFFFFFFFFFFFFFFC","E87579C11079F43DD824993C2CEE5ED3","FFFFFFFE0000000075A30D1B9038A115","1","161FF7528B899B2D0C28607CA52C5B86","CF5AC8395BAFEB13C02DA292DDED7A83",[],"","secp128r1 : SECG curve over a 128 bit prime field"),ht.crypto.ECParameterDB.regist("secp160k1",160,"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFAC73","0","7","0100000000000000000001B8FA16DFAB9ACA16B6B3","1","3B4C382CE37AA192A4019E763036F4F5DD4D7EBB","938CF935318FDCED6BC28286531733C3F03C4FEE",[],"","secp160k1 : SECG curve over a 160 bit prime field"),ht.crypto.ECParameterDB.regist("secp160r1",160,"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF7FFFFFFF","FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF7FFFFFFC","1C97BEFC54BD7A8B65ACF89F81D4D4ADC565FA45","0100000000000000000001F4C8F927AED3CA752257","1","4A96B5688EF573284664698968C38BB913CBFC82","23A628553168947D59DCC912042351377AC5FB32",[],"","secp160r1 : SECG curve over a 160 bit prime field"),ht.crypto.ECParameterDB.regist("secp192k1",192,"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFEE37","0","3","FFFFFFFFFFFFFFFFFFFFFFFE26F2FC170F69466A74DEFD8D","1","DB4FF10EC057E9AE26B07D0280B7F4341DA5D1B1EAE06C7D","9B2F2F6D9C5628A7844163D015BE86344082AA88D95E2F9D",[]),ht.crypto.ECParameterDB.regist("secp192r1",192,"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFFFFFFFFFF","FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFFFFFFFFFC","64210519E59C80E70FA7E9AB72243049FEB8DEECC146B9B1","FFFFFFFFFFFFFFFFFFFFFFFF99DEF836146BC9B1B4D22831","1","188DA80EB03090F67CBF20EB43A18800F4FF0AFD82FF1012","07192B95FFC8DA78631011ED6B24CDD573F977A11E794811",[]),ht.crypto.ECParameterDB.regist("secp224r1",224,"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF000000000000000000000001","FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFFFFFFFFFFFFFFFFFE","B4050A850C04B3ABF54132565044B0B7D7BFD8BA270B39432355FFB4","FFFFFFFFFFFFFFFFFFFFFFFFFFFF16A2E0B8F03E13DD29455C5C2A3D","1","B70E0CBD6BB4BF7F321390B94A03C1D356C21122343280D6115C1D21","BD376388B5F723FB4C22DFE6CD4375A05A07476444D5819985007E34",[]),ht.crypto.ECParameterDB.regist("secp256k1",256,"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFC2F","0","7","FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141","1","79BE667EF9DCBBAC55A06295CE870B07029BFCDB2DCE28D959F2815B16F81798","483ADA7726A3C4655DA4FBFC0E1108A8FD17B448A68554199C47D08FFB10D4B8",[]),ht.crypto.ECParameterDB.regist("secp256r1",256,"FFFFFFFF00000001000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFF","FFFFFFFF00000001000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFC","5AC635D8AA3A93E7B3EBBD55769886BC651D06B0CC53B0F63BCE3C3E27D2604B","FFFFFFFF00000000FFFFFFFFFFFFFFFFBCE6FAADA7179E84F3B9CAC2FC632551","1","6B17D1F2E12C4247F8BCE6E563A440F277037D812DEB33A0F4A13945D898C296","4FE342E2FE1A7F9B8EE7EB4A7C0F9E162BCE33576B315ECECBB6406837BF51F5",["NIST P-256","P-256","prime256v1"]),ht.crypto.ECParameterDB.regist("secp384r1",384,"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFF0000000000000000FFFFFFFF","FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFF0000000000000000FFFFFFFC","B3312FA7E23EE7E4988E056BE3F82D19181D9C6EFE8141120314088F5013875AC656398D8A2ED19D2A85C8EDD3EC2AEF","FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFC7634D81F4372DDF581A0DB248B0A77AECEC196ACCC52973","1","AA87CA22BE8B05378EB1C71EF320AD746E1D3B628BA79B9859F741E082542A385502F25DBF55296C3A545E3872760AB7","3617de4a96262c6f5d9e98bf9292dc29f8f41dbd289a147ce9da3113b5f0b8c00a60b1ce1d7e819d7a431d7c90ea0e5f",["NIST P-384","P-384"]),ht.crypto.ECParameterDB.regist("secp521r1",521,"1FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF","1FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFC","051953EB9618E1C9A1F929A21A0B68540EEA2DA725B99B315F3B8B489918EF109E156193951EC7E937B1652C0BD3BB1BF073573DF883D2C34F1EF451FD46B503F00","1FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA51868783BF2F966B7FCC0148F709A5D03BB5C9B8899C47AEBB6FB71E91386409","1","C6858E06B70404E9CD9E3ECB662395B4429C648139053FB521F828AF606B4D3DBAA14B5E77EFE75928FE1DC127A2FFA8DE3348B3C1856A429BF97E7E31C2E5BD66","011839296a789a3bc0045c8a5fb42c7d1bd998f54449579b446817afbd17273e662c97ee72995ef42640c550b9013fad0761353c7086a272c24088be94769fd16650",["NIST P-521","P-521"]);var Kt=function(){var t=function(t,r,i){return e(m.AES,t,r,i)},e=function(t,e,r,i){var n=m.enc.Hex.parse(e),o=m.enc.Hex.parse(r),s=m.enc.Hex.parse(i),a={};a.key=o,a.iv=s,a.ciphertext=n;var u=t.decrypt(a,o,{iv:s});return m.enc.Hex.stringify(u)},r=function(t,e,r){return i(m.AES,t,e,r)},i=function(t,e,r,i){var n=m.enc.Hex.parse(e),o=m.enc.Hex.parse(r),s=m.enc.Hex.parse(i),a=t.encrypt(n,o,{iv:s}),u=m.enc.Hex.parse(a.toString());return m.enc.Base64.stringify(u)},n={"AES-256-CBC":{proc:t,eproc:r,keylen:32,ivlen:16},"AES-192-CBC":{proc:t,eproc:r,keylen:24,ivlen:16},"AES-128-CBC":{proc:t,eproc:r,keylen:16,ivlen:16},"DES-EDE3-CBC":{proc:function(t,r,i){return e(m.TripleDES,t,r,i)},eproc:function(t,e,r){return i(m.TripleDES,t,e,r)},keylen:24,ivlen:8},"DES-CBC":{proc:function(t,r,i){return e(m.DES,t,r,i)},eproc:function(t,e,r){return i(m.DES,t,e,r)},keylen:8,ivlen:8}},o=function(t){var e={},r=t.match(new RegExp("DEK-Info: ([^,]+),([0-9A-Fa-f]+)","m"));r&&(e.cipher=r[1],e.ivsalt=r[2]);var i=t.match(new RegExp("-----BEGIN ([A-Z]+) PRIVATE KEY-----"));i&&(e.type=i[1]);var n=-1,o=0;-1!=t.indexOf("\r\n\r\n")&&(n=t.indexOf("\r\n\r\n"),o=2),-1!=t.indexOf("\n\n")&&(n=t.indexOf("\n\n"),o=1);var s=t.indexOf("-----END");if(-1!=n&&-1!=s){var a=t.substring(n+2*o,s-o);a=a.replace(/\s+/g,""),e.data=a}return e},s=function(t,e,r){for(var i=r.substring(0,16),o=m.enc.Hex.parse(i),s=m.enc.Utf8.parse(e),a=n[t].keylen+n[t].ivlen,u="",h=null;;){var c=m.algo.MD5.create();if(null!=h&&c.update(h),c.update(s),c.update(o),h=c.finalize(),(u+=m.enc.Hex.stringify(h)).length>=2*a)break}var f={};return f.keyhex=u.substr(0,2*n[t].keylen),f.ivhex=u.substr(2*n[t].keylen,2*n[t].ivlen),f},a=function(t,e,r,i){var o=m.enc.Base64.parse(t),s=m.enc.Hex.stringify(o);return(0,n[e].proc)(s,r,i)};return{version:"1.0.0",parsePKCS5PEM:function(t){return o(t)},getKeyAndUnusedIvByPasscodeAndIvsalt:function(t,e,r){return s(t,e,r)},decryptKeyB64:function(t,e,r,i){return a(t,e,r,i)},getDecryptedKeyHex:function(t,e){var r=o(t),i=(r.type,r.cipher),n=r.ivsalt,u=r.data,h=s(i,e,n).keyhex;return a(u,i,h,n)},getEncryptedPKCS5PEMFromPrvKeyHex:function(t,e,r,i,o){var a="";if(void 0!==i&&null!=i||(i="AES-256-CBC"),void 0===n[i])throw"KEYUTIL unsupported algorithm: "+i;return void 0!==o&&null!=o||(o=function(t){var e=m.lib.WordArray.random(t);return m.enc.Hex.stringify(e)}(n[i].ivlen).toUpperCase()),a="-----BEGIN "+t+" PRIVATE KEY-----\r\n",a+="Proc-Type: 4,ENCRYPTED\r\n",a+="DEK-Info: "+i+","+o+"\r\n",a+="\r\n",(a+=function(t,e,r,i){return(0,n[e].eproc)(t,r,i)}(e,i,s(i,r,o).keyhex,o).replace(/(.{64})/g,"$1\r\n"))+"\r\n-----END "+t+" PRIVATE KEY-----\r\n"},parseHexOfEncryptedPKCS8:function(t){var e=lt,r=e.getChildIdx,i=e.getV,n={},o=r(t,0);if(2!=o.length)throw"malformed format: SEQUENCE(0).items != 2: "+o.length;n.ciphertext=i(t,o[1]);var s=r(t,o[0]);if(2!=s.length)throw"malformed format: SEQUENCE(0.0).items != 2: "+s.length;if("2a864886f70d01050d"!=i(t,s[0]))throw"this only supports pkcs5PBES2";var a=r(t,s[1]);if(2!=s.length)throw"malformed format: SEQUENCE(0.0.1).items != 2: "+a.length;var u=r(t,a[1]);if(2!=u.length)throw"malformed format: SEQUENCE(0.0.1.1).items != 2: "+u.length;if("2a864886f70d0307"!=i(t,u[0]))throw"this only supports TripleDES";n.encryptionSchemeAlg="TripleDES",n.encryptionSchemeIV=i(t,u[1]);var h=r(t,a[0]);if(2!=h.length)throw"malformed format: SEQUENCE(0.0.1.0).items != 2: "+h.length;if("2a864886f70d01050c"!=i(t,h[0]))throw"this only supports pkcs5PBKDF2";var c=r(t,h[1]);if(c.length<2)throw"malformed format: SEQUENCE(0.0.1.0.1).items < 2: "+c.length;n.pbkdf2Salt=i(t,c[0]);var f=i(t,c[1]);try{n.pbkdf2Iter=parseInt(f,16)}catch(t){throw"malformed format pbkdf2Iter: "+f}return n},getPBKDF2KeyHexFromParam:function(t,e){var r=m.enc.Hex.parse(t.pbkdf2Salt),i=t.pbkdf2Iter,n=m.PBKDF2(e,r,{keySize:6,iterations:i});return m.enc.Hex.stringify(n)},_getPlainPKCS8HexFromEncryptedPKCS8PEM:function(t,e){var r=Tt(t,"ENCRYPTED PRIVATE KEY"),i=this.parseHexOfEncryptedPKCS8(r),n=Kt.getPBKDF2KeyHexFromParam(i,e),o={};o.ciphertext=m.enc.Hex.parse(i.ciphertext);var s=m.enc.Hex.parse(n),a=m.enc.Hex.parse(i.encryptionSchemeIV),u=m.TripleDES.decrypt(o,s,{iv:a});return m.enc.Hex.stringify(u)},getKeyFromEncryptedPKCS8PEM:function(t,e){var r=this._getPlainPKCS8HexFromEncryptedPKCS8PEM(t,e);return this.getKeyFromPlainPrivatePKCS8Hex(r)},parsePlainPrivatePKCS8Hex:function(t){var e=lt,r=e.getChildIdx,i=e.getV,n={algparam:null};if("30"!=t.substr(0,2))throw"malformed plain PKCS8 private key(code:001)";var o=r(t,0);if(3!=o.length)throw"malformed plain PKCS8 private key(code:002)";if("30"!=t.substr(o[1],2))throw"malformed PKCS8 private key(code:003)";var s=r(t,o[1]);if(2!=s.length)throw"malformed PKCS8 private key(code:004)";if("06"!=t.substr(s[0],2))throw"malformed PKCS8 private key(code:005)";if(n.algoid=i(t,s[0]),"06"==t.substr(s[1],2)&&(n.algparam=i(t,s[1])),"04"!=t.substr(o[2],2))throw"malformed PKCS8 private key(code:006)";return n.keyidx=e.getVidx(t,o[2]),n},getKeyFromPlainPrivatePKCS8PEM:function(t){var e=Tt(t,"PRIVATE KEY");return this.getKeyFromPlainPrivatePKCS8Hex(e)},getKeyFromPlainPrivatePKCS8Hex:function(t){var e,r=this.parsePlainPrivatePKCS8Hex(t);if("2a864886f70d010101"==r.algoid)e=new nt;else if("2a8648ce380401"==r.algoid)e=new ht.crypto.DSA;else{if("2a8648ce3d0201"!=r.algoid)throw"unsupported private key algorithm";e=new ht.crypto.ECDSA}return e.readPKCS8PrvKeyHex(t),e},_getKeyFromPublicPKCS8Hex:function(t){var e,r=lt.getVbyList(t,0,[0,0],"06");if("2a864886f70d010101"===r)e=new nt;else if("2a8648ce380401"===r)e=new ht.crypto.DSA;else{if("2a8648ce3d0201"!==r)throw"unsupported PKCS#8 public key hex";e=new ht.crypto.ECDSA}return e.readPKCS8PubKeyHex(t),e},parsePublicRawRSAKeyHex:function(t){var e=lt,r=e.getChildIdx,i=e.getV,n={};if("30"!=t.substr(0,2))throw"malformed RSA key(code:001)";var o=r(t,0);if(2!=o.length)throw"malformed RSA key(code:002)";if("02"!=t.substr(o[0],2))throw"malformed RSA key(code:003)";if(n.n=i(t,o[0]),"02"!=t.substr(o[1],2))throw"malformed RSA key(code:004)";return n.e=i(t,o[1]),n},parsePublicPKCS8Hex:function(t){var e=lt,r=e.getChildIdx,i=e.getV,n={algparam:null},o=r(t,0);if(2!=o.length)throw"outer DERSequence shall have 2 elements: "+o.length;var s=o[0];if("30"!=t.substr(s,2))throw"malformed PKCS8 public key(code:001)";var a=r(t,s);if(2!=a.length)throw"malformed PKCS8 public key(code:002)";if("06"!=t.substr(a[0],2))throw"malformed PKCS8 public key(code:003)";if(n.algoid=i(t,a[0]),"06"==t.substr(a[1],2)?n.algparam=i(t,a[1]):"30"==t.substr(a[1],2)&&(n.algparam={},n.algparam.p=e.getVbyList(t,a[1],[0],"02"),n.algparam.q=e.getVbyList(t,a[1],[1],"02"),n.algparam.g=e.getVbyList(t,a[1],[2],"02")),"03"!=t.substr(o[1],2))throw"malformed PKCS8 public key(code:004)";return n.key=i(t,o[1]).substr(2),n}}}();Kt.getKey=function(t,e,r){var i,n=(m=lt).getChildIdx,o=(m.getV,m.getVbyList),s=ht.crypto,a=s.ECDSA,u=s.DSA,h=nt,c=Tt,f=Kt;if(void 0!==h&&t instanceof h)return t;if(void 0!==a&&t instanceof a)return t;if(void 0!==u&&t instanceof u)return t;if(void 0!==t.curve&&void 0!==t.xy&&void 0===t.d)return new a({pub:t.xy,curve:t.curve});if(void 0!==t.curve&&void 0!==t.d)return new a({prv:t.d,curve:t.curve});if(void 0===t.kty&&void 0!==t.n&&void 0!==t.e&&void 0===t.d)return(T=new h).setPublic(t.n,t.e),T;if(void 0===t.kty&&void 0!==t.n&&void 0!==t.e&&void 0!==t.d&&void 0!==t.p&&void 0!==t.q&&void 0!==t.dp&&void 0!==t.dq&&void 0!==t.co&&void 0===t.qi)return(T=new h).setPrivateEx(t.n,t.e,t.d,t.p,t.q,t.dp,t.dq,t.co),T;if(void 0===t.kty&&void 0!==t.n&&void 0!==t.e&&void 0!==t.d&&void 0===t.p)return(T=new h).setPrivate(t.n,t.e,t.d),T;if(void 0!==t.p&&void 0!==t.q&&void 0!==t.g&&void 0!==t.y&&void 0===t.x)return(T=new u).setPublic(t.p,t.q,t.g,t.y),T;if(void 0!==t.p&&void 0!==t.q&&void 0!==t.g&&void 0!==t.y&&void 0!==t.x)return(T=new u).setPrivate(t.p,t.q,t.g,t.y,t.x),T;if("RSA"===t.kty&&void 0!==t.n&&void 0!==t.e&&void 0===t.d)return(T=new h).setPublic(wt(t.n),wt(t.e)),T;if("RSA"===t.kty&&void 0!==t.n&&void 0!==t.e&&void 0!==t.d&&void 0!==t.p&&void 0!==t.q&&void 0!==t.dp&&void 0!==t.dq&&void 0!==t.qi)return(T=new h).setPrivateEx(wt(t.n),wt(t.e),wt(t.d),wt(t.p),wt(t.q),wt(t.dp),wt(t.dq),wt(t.qi)),T;if("RSA"===t.kty&&void 0!==t.n&&void 0!==t.e&&void 0!==t.d)return(T=new h).setPrivate(wt(t.n),wt(t.e),wt(t.d)),T;if("EC"===t.kty&&void 0!==t.crv&&void 0!==t.x&&void 0!==t.y&&void 0===t.d){var l=(I=new a({curve:t.crv})).ecparams.keylen/4,d="04"+("0000000000"+wt(t.x)).slice(-l)+("0000000000"+wt(t.y)).slice(-l);return I.setPublicKeyHex(d),I}if("EC"===t.kty&&void 0!==t.crv&&void 0!==t.x&&void 0!==t.y&&void 0!==t.d){l=(I=new a({curve:t.crv})).ecparams.keylen/4,d="04"+("0000000000"+wt(t.x)).slice(-l)+("0000000000"+wt(t.y)).slice(-l);var p=("0000000000"+wt(t.d)).slice(-l);return I.setPublicKeyHex(d),I.setPrivateKeyHex(p),I}if("pkcs5prv"===r){var g,y=t,m=lt;if(9===(g=n(y,0)).length)(T=new h).readPKCS5PrvKeyHex(y);else if(6===g.length)(T=new u).readPKCS5PrvKeyHex(y);else{if(!(g.length>2&&"04"===y.substr(g[1],2)))throw"unsupported PKCS#1/5 hexadecimal key";(T=new a).readPKCS5PrvKeyHex(y)}return T}if("pkcs8prv"===r)return f.getKeyFromPlainPrivatePKCS8Hex(t);if("pkcs8pub"===r)return f._getKeyFromPublicPKCS8Hex(t);if("x509pub"===r)return Wt.getPublicKeyFromCertHex(t);if(-1!=t.indexOf("-END CERTIFICATE-",0)||-1!=t.indexOf("-END X509 CERTIFICATE-",0)||-1!=t.indexOf("-END TRUSTED CERTIFICATE-",0))return Wt.getPublicKeyFromCertPEM(t);if(-1!=t.indexOf("-END PUBLIC KEY-")){var v=Tt(t,"PUBLIC KEY");return f._getKeyFromPublicPKCS8Hex(v)}if(-1!=t.indexOf("-END RSA PRIVATE KEY-")&&-1==t.indexOf("4,ENCRYPTED")){var b=c(t,"RSA PRIVATE KEY");return f.getKey(b,null,"pkcs5prv")}if(-1!=t.indexOf("-END DSA PRIVATE KEY-")&&-1==t.indexOf("4,ENCRYPTED")){var w=o(i=c(t,"DSA PRIVATE KEY"),0,[1],"02"),_=o(i,0,[2],"02"),S=o(i,0,[3],"02"),M=o(i,0,[4],"02"),A=o(i,0,[5],"02");return(T=new u).setPrivate(new E(w,16),new E(_,16),new E(S,16),new E(M,16),new E(A,16)),T}if(-1!=t.indexOf("-END EC PRIVATE KEY-")&&-1==t.indexOf("4,ENCRYPTED"))return b=c(t,"EC PRIVATE KEY"),f.getKey(b,null,"pkcs5prv");if(-1!=t.indexOf("-END PRIVATE KEY-"))return f.getKeyFromPlainPrivatePKCS8PEM(t);if(-1!=t.indexOf("-END RSA PRIVATE KEY-")&&-1!=t.indexOf("4,ENCRYPTED")){var C=f.getDecryptedKeyHex(t,e),k=new nt;return k.readPKCS5PrvKeyHex(C),k}if(-1!=t.indexOf("-END EC PRIVATE KEY-")&&-1!=t.indexOf("4,ENCRYPTED")){var I,T=o(i=f.getDecryptedKeyHex(t,e),0,[1],"04"),R=o(i,0,[2,0],"06"),B=o(i,0,[3,0],"03").substr(2);if(void 0===ht.crypto.OID.oidhex2name[R])throw"undefined OID(hex) in KJUR.crypto.OID: "+R;return(I=new a({curve:ht.crypto.OID.oidhex2name[R]})).setPublicKeyHex(B),I.setPrivateKeyHex(T),I.isPublic=!1,I}if(-1!=t.indexOf("-END DSA PRIVATE KEY-")&&-1!=t.indexOf("4,ENCRYPTED"))return w=o(i=f.getDecryptedKeyHex(t,e),0,[1],"02"),_=o(i,0,[2],"02"),S=o(i,0,[3],"02"),M=o(i,0,[4],"02"),A=o(i,0,[5],"02"),(T=new u).setPrivate(new E(w,16),new E(_,16),new E(S,16),new E(M,16),new E(A,16)),T;if(-1!=t.indexOf("-END ENCRYPTED PRIVATE KEY-"))return f.getKeyFromEncryptedPKCS8PEM(t,e);throw new Error("not supported argument")},Kt.generateKeypair=function(t,e){if("RSA"==t){var r=e;(s=new nt).generate(r,"10001"),s.isPrivate=!0,s.isPublic=!0;var i=new nt,n=s.n.toString(16),o=s.e.toString(16);return i.setPublic(n,o),i.isPrivate=!1,i.isPublic=!0,(a={}).prvKeyObj=s,a.pubKeyObj=i,a}if("EC"==t){var s,a,u=e,h=new ht.crypto.ECDSA({curve:u}).generateKeyPairHex();return(s=new ht.crypto.ECDSA({curve:u})).setPublicKeyHex(h.ecpubhex),s.setPrivateKeyHex(h.ecprvhex),s.isPrivate=!0,s.isPublic=!1,(i=new ht.crypto.ECDSA({curve:u})).setPublicKeyHex(h.ecpubhex),i.isPrivate=!1,i.isPublic=!0,(a={}).prvKeyObj=s,a.pubKeyObj=i,a}throw"unknown algorithm: "+t},Kt.getPEM=function(t,e,r,i,n,o){var s=ht,a=s.asn1,u=a.DERObjectIdentifier,h=a.DERInteger,c=a.ASN1Util.newObject,f=a.x509.SubjectPublicKeyInfo,l=s.crypto,d=l.DSA,p=l.ECDSA,g=nt;function y(t){return c({seq:[{int:0},{int:{bigint:t.n}},{int:t.e},{int:{bigint:t.d}},{int:{bigint:t.p}},{int:{bigint:t.q}},{int:{bigint:t.dmp1}},{int:{bigint:t.dmq1}},{int:{bigint:t.coeff}}]})}function v(t){return c({seq:[{int:1},{octstr:{hex:t.prvKeyHex}},{tag:["a0",!0,{oid:{name:t.curveName}}]},{tag:["a1",!0,{bitstr:{hex:"00"+t.pubKeyHex}}]}]})}function b(t){return c({seq:[{int:0},{int:{bigint:t.p}},{int:{bigint:t.q}},{int:{bigint:t.g}},{int:{bigint:t.y}},{int:{bigint:t.x}}]})}if((void 0!==g&&t instanceof g||void 0!==d&&t instanceof d||void 0!==p&&t instanceof p)&&1==t.isPublic&&(void 0===e||"PKCS8PUB"==e))return It(E=new f(t).getEncodedHex(),"PUBLIC KEY");if("PKCS1PRV"==e&&void 0!==g&&t instanceof g&&(void 0===r||null==r)&&1==t.isPrivate)return It(E=y(t).getEncodedHex(),"RSA PRIVATE KEY");if("PKCS1PRV"==e&&void 0!==p&&t instanceof p&&(void 0===r||null==r)&&1==t.isPrivate){var w=new u({name:t.curveName}).getEncodedHex(),_=v(t).getEncodedHex(),S="";return(S+=It(w,"EC PARAMETERS"))+It(_,"EC PRIVATE KEY")}if("PKCS1PRV"==e&&void 0!==d&&t instanceof d&&(void 0===r||null==r)&&1==t.isPrivate)return It(E=b(t).getEncodedHex(),"DSA PRIVATE KEY");if("PKCS5PRV"==e&&void 0!==g&&t instanceof g&&void 0!==r&&null!=r&&1==t.isPrivate){var E=y(t).getEncodedHex();return void 0===i&&(i="DES-EDE3-CBC"),this.getEncryptedPKCS5PEMFromPrvKeyHex("RSA",E,r,i,o)}if("PKCS5PRV"==e&&void 0!==p&&t instanceof p&&void 0!==r&&null!=r&&1==t.isPrivate)return E=v(t).getEncodedHex(),void 0===i&&(i="DES-EDE3-CBC"),this.getEncryptedPKCS5PEMFromPrvKeyHex("EC",E,r,i,o);if("PKCS5PRV"==e&&void 0!==d&&t instanceof d&&void 0!==r&&null!=r&&1==t.isPrivate)return E=b(t).getEncodedHex(),void 0===i&&(i="DES-EDE3-CBC"),this.getEncryptedPKCS5PEMFromPrvKeyHex("DSA",E,r,i,o);var M=function(t,e){var r=A(t,e);return new c({seq:[{seq:[{oid:{name:"pkcs5PBES2"}},{seq:[{seq:[{oid:{name:"pkcs5PBKDF2"}},{seq:[{octstr:{hex:r.pbkdf2Salt}},{int:r.pbkdf2Iter}]}]},{seq:[{oid:{name:"des-EDE3-CBC"}},{octstr:{hex:r.encryptionSchemeIV}}]}]}]},{octstr:{hex:r.ciphertext}}]}).getEncodedHex()},A=function(t,e){var r=m.lib.WordArray.random(8),i=m.lib.WordArray.random(8),n=m.PBKDF2(e,r,{keySize:6,iterations:100}),o=m.enc.Hex.parse(t),s=m.TripleDES.encrypt(o,n,{iv:i})+"",a={};return a.ciphertext=s,a.pbkdf2Salt=m.enc.Hex.stringify(r),a.pbkdf2Iter=100,a.encryptionSchemeAlg="DES-EDE3-CBC",a.encryptionSchemeIV=m.enc.Hex.stringify(i),a};if("PKCS8PRV"==e&&null!=g&&t instanceof g&&1==t.isPrivate){var C=y(t).getEncodedHex();return E=c({seq:[{int:0},{seq:[{oid:{name:"rsaEncryption"}},{null:!0}]},{octstr:{hex:C}}]}).getEncodedHex(),void 0===r||null==r?It(E,"PRIVATE KEY"):It(_=M(E,r),"ENCRYPTED PRIVATE KEY")}if("PKCS8PRV"==e&&void 0!==p&&t instanceof p&&1==t.isPrivate)return C=new c({seq:[{int:1},{octstr:{hex:t.prvKeyHex}},{tag:["a1",!0,{bitstr:{hex:"00"+t.pubKeyHex}}]}]}).getEncodedHex(),E=c({seq:[{int:0},{seq:[{oid:{name:"ecPublicKey"}},{oid:{name:t.curveName}}]},{octstr:{hex:C}}]}).getEncodedHex(),void 0===r||null==r?It(E,"PRIVATE KEY"):It(_=M(E,r),"ENCRYPTED PRIVATE KEY");if("PKCS8PRV"==e&&void 0!==d&&t instanceof d&&1==t.isPrivate)return C=new h({bigint:t.x}).getEncodedHex(),E=c({seq:[{int:0},{seq:[{oid:{name:"dsa"}},{seq:[{int:{bigint:t.p}},{int:{bigint:t.q}},{int:{bigint:t.g}}]}]},{octstr:{hex:C}}]}).getEncodedHex(),void 0===r||null==r?It(E,"PRIVATE KEY"):It(_=M(E,r),"ENCRYPTED PRIVATE KEY");throw new Error("unsupported object nor format")},Kt.getKeyFromCSRPEM=function(t){var e=Tt(t,"CERTIFICATE REQUEST");return Kt.getKeyFromCSRHex(e)},Kt.getKeyFromCSRHex=function(t){var e=Kt.parseCSRHex(t);return Kt.getKey(e.p8pubkeyhex,null,"pkcs8pub")},Kt.parseCSRHex=function(t){var e=lt,r=e.getChildIdx,i=e.getTLV,n={},o=t;if("30"!=o.substr(0,2))throw"malformed CSR(code:001)";var s=r(o,0);if(s.length<1)throw"malformed CSR(code:002)";if("30"!=o.substr(s[0],2))throw"malformed CSR(code:003)";var a=r(o,s[0]);if(a.length<3)throw"malformed CSR(code:004)";return n.p8pubkeyhex=i(o,a[2]),n},Kt.getKeyID=function(t){var e=Kt,r=lt;"string"==typeof t&&-1!=t.indexOf("BEGIN ")&&(t=e.getKey(t));var i=Tt(e.getPEM(t)),n=r.getIdxbyList(i,0,[1]),o=r.getV(i,n).substring(2);return ht.crypto.Util.hashHex(o,"sha1")},Kt.getJWKFromKey=function(t){var e={};if(t instanceof nt&&t.isPrivate)return e.kty="RSA",e.n=bt(t.n.toString(16)),e.e=bt(t.e.toString(16)),e.d=bt(t.d.toString(16)),e.p=bt(t.p.toString(16)),e.q=bt(t.q.toString(16)),e.dp=bt(t.dmp1.toString(16)),e.dq=bt(t.dmq1.toString(16)),e.qi=bt(t.coeff.toString(16)),e;if(t instanceof nt&&t.isPublic)return e.kty="RSA",e.n=bt(t.n.toString(16)),e.e=bt(t.e.toString(16)),e;if(t instanceof ht.crypto.ECDSA&&t.isPrivate){if("P-256"!==(i=t.getShortNISTPCurveName())&&"P-384"!==i)throw"unsupported curve name for JWT: "+i;var r=t.getPublicKeyXYHex();return e.kty="EC",e.crv=i,e.x=bt(r.x),e.y=bt(r.y),e.d=bt(t.prvKeyHex),e}if(t instanceof ht.crypto.ECDSA&&t.isPublic){var i;if("P-256"!==(i=t.getShortNISTPCurveName())&&"P-384"!==i)throw"unsupported curve name for JWT: "+i;return r=t.getPublicKeyXYHex(),e.kty="EC",e.crv=i,e.x=bt(r.x),e.y=bt(r.y),e}throw"not supported key object"},nt.getPosArrayOfChildrenFromHex=function(t){return lt.getChildIdx(t,0)},nt.getHexValueArrayOfChildrenFromHex=function(t){var e,r=lt.getV,i=r(t,(e=nt.getPosArrayOfChildrenFromHex(t))[0]),n=r(t,e[1]),o=r(t,e[2]),s=r(t,e[3]),a=r(t,e[4]),u=r(t,e[5]),h=r(t,e[6]),c=r(t,e[7]),f=r(t,e[8]);return(e=new Array).push(i,n,o,s,a,u,h,c,f),e},nt.prototype.readPrivateKeyFromPEMString=function(t){var e=Tt(t),r=nt.getHexValueArrayOfChildrenFromHex(e);this.setPrivateEx(r[1],r[2],r[3],r[4],r[5],r[6],r[7],r[8])},nt.prototype.readPKCS5PrvKeyHex=function(t){var e=nt.getHexValueArrayOfChildrenFromHex(t);this.setPrivateEx(e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8])},nt.prototype.readPKCS8PrvKeyHex=function(t){var e,r,i,n,o,s,a,u,h=lt,c=h.getVbyListEx;if(!1===h.isASN1HEX(t))throw new Error("not ASN.1 hex string");try{e=c(t,0,[2,0,1],"02"),r=c(t,0,[2,0,2],"02"),i=c(t,0,[2,0,3],"02"),n=c(t,0,[2,0,4],"02"),o=c(t,0,[2,0,5],"02"),s=c(t,0,[2,0,6],"02"),a=c(t,0,[2,0,7],"02"),u=c(t,0,[2,0,8],"02")}catch(t){throw new Error("malformed PKCS#8 plain RSA private key")}this.setPrivateEx(e,r,i,n,o,s,a,u)},nt.prototype.readPKCS5PubKeyHex=function(t){var e=lt,r=e.getV;if(!1===e.isASN1HEX(t))throw new Error("keyHex is not ASN.1 hex string");var i=e.getChildIdx(t,0);if(2!==i.length||"02"!==t.substr(i[0],2)||"02"!==t.substr(i[1],2))throw new Error("wrong hex for PKCS#5 public key");var n=r(t,i[0]),o=r(t,i[1]);this.setPublic(n,o)},nt.prototype.readPKCS8PubKeyHex=function(t){var e=lt;if(!1===e.isASN1HEX(t))throw new Error("not ASN.1 hex string");if("06092a864886f70d010101"!==e.getTLVbyListEx(t,0,[0,0]))throw new Error("not PKCS8 RSA public key");var r=e.getTLVbyListEx(t,0,[1,0]);this.readPKCS5PubKeyHex(r)},nt.prototype.readCertPubKeyHex=function(t,e){var r,i;(r=new Wt).readCertHex(t),i=r.getPublicKeyHex(),this.readPKCS8PubKeyHex(i)};var Vt=new RegExp("[^0-9a-f]","gi");function Ht(t,e){for(var r="",i=e/4-t.length,n=0;n<i;n++)r+="0";return r+t}function qt(t,e,r){for(var i="",n=0;i.length<e;)i+=Et(r(Mt(t+String.fromCharCode.apply(String,[(4278190080&n)>>24,(16711680&n)>>16,(65280&n)>>8,255&n])))),n+=1;return i}function zt(t){for(var e in ht.crypto.Util.DIGESTINFOHEAD){var r=ht.crypto.Util.DIGESTINFOHEAD[e],i=r.length;if(t.substring(0,i)==r)return[e,t.substring(i)]}return[]}function Wt(t){var e,r=lt,i=r.getChildIdx,n=r.getV,o=r.getTLV,s=r.getVbyList,a=r.getVbyListEx,u=r.getTLVbyList,h=r.getTLVbyListEx,c=r.getIdxbyList,f=r.getIdxbyListEx,l=r.getVidx,d=r.oidname,p=r.hextooidstr,g=Wt,y=Tt;try{e=ht.asn1.x509.AlgorithmIdentifier.PSSNAME2ASN1TLV}catch(t){}this.HEX2STAG={"0c":"utf8",13:"prn",16:"ia5","1a":"vis","1e":"bmp"},this.hex=null,this.version=0,this.foffset=0,this.aExtInfo=null,this.getVersion=function(){return null===this.hex||0!==this.version?this.version:"a003020102"!==u(this.hex,0,[0,0])?(this.version=1,this.foffset=-1,1):(this.version=3,3)},this.getSerialNumberHex=function(){return a(this.hex,0,[0,0],"02")},this.getSignatureAlgorithmField=function(){var t=h(this.hex,0,[0,1]);return this.getAlgorithmIdentifierName(t)},this.getAlgorithmIdentifierName=function(t){for(var r in e)if(t===e[r])return r;return d(a(t,0,[0],"06"))},this.getIssuer=function(){return this.getX500Name(this.getIssuerHex())},this.getIssuerHex=function(){return u(this.hex,0,[0,3+this.foffset],"30")},this.getIssuerString=function(){return g.hex2dn(this.getIssuerHex())},this.getSubject=function(){return this.getX500Name(this.getSubjectHex())},this.getSubjectHex=function(){return u(this.hex,0,[0,5+this.foffset],"30")},this.getSubjectString=function(){return g.hex2dn(this.getSubjectHex())},this.getNotBefore=function(){var t=s(this.hex,0,[0,4+this.foffset,0]);return t=t.replace(/(..)/g,"%$1"),decodeURIComponent(t)},this.getNotAfter=function(){var t=s(this.hex,0,[0,4+this.foffset,1]);return t=t.replace(/(..)/g,"%$1"),decodeURIComponent(t)},this.getPublicKeyHex=function(){return r.getTLVbyList(this.hex,0,[0,6+this.foffset],"30")},this.getPublicKeyIdx=function(){return c(this.hex,0,[0,6+this.foffset],"30")},this.getPublicKeyContentIdx=function(){var t=this.getPublicKeyIdx();return c(this.hex,t,[1,0],"30")},this.getPublicKey=function(){return Kt.getKey(this.getPublicKeyHex(),null,"pkcs8pub")},this.getSignatureAlgorithmName=function(){var t=u(this.hex,0,[1],"30");return this.getAlgorithmIdentifierName(t)},this.getSignatureValueHex=function(){return s(this.hex,0,[2],"03",!0)},this.verifySignature=function(t){var e=this.getSignatureAlgorithmField(),r=this.getSignatureValueHex(),i=u(this.hex,0,[0],"30"),n=new ht.crypto.Signature({alg:e});return n.init(t),n.updateHex(i),n.verify(r)},this.parseExt=function(t){var e,o,a;if(void 0===t){if(a=this.hex,3!==this.version)return-1;e=c(a,0,[0,7,0],"30"),o=i(a,e)}else{a=Tt(t);var u=c(a,0,[0,3,0,0],"06");if("2a864886f70d01090e"!=n(a,u))return void(this.aExtInfo=new Array);e=c(a,0,[0,3,0,1,0],"30"),o=i(a,e),this.hex=a}this.aExtInfo=new Array;for(var h=0;h<o.length;h++){var f={critical:!1},d=0;3===i(a,o[h]).length&&(f.critical=!0,d=1),f.oid=r.hextooidstr(s(a,o[h],[0],"06"));var p=c(a,o[h],[1+d]);f.vidx=l(a,p),this.aExtInfo.push(f)}},this.getExtInfo=function(t){var e=this.aExtInfo,r=t;if(t.match(/^[0-9.]+$/)||(r=ht.asn1.x509.OID.name2oid(t)),""!==r)for(var i=0;i<e.length;i++)if(e[i].oid===r)return e[i]},this.getExtBasicConstraints=function(t,e){if(void 0===t&&void 0===e){var r=this.getExtInfo("basicConstraints");if(void 0===r)return;t=o(this.hex,r.vidx),e=r.critical}var i={extname:"basicConstraints"};if(e&&(i.critical=!0),"3000"===t)return i;if("30030101ff"===t)return i.cA=!0,i;if("30060101ff02"===t.substr(0,12)){var s=n(t,10),a=parseInt(s,16);return i.cA=!0,i.pathLen=a,i}throw new Error("hExtV parse error: "+t)},this.getExtKeyUsage=function(t,e){if(void 0===t&&void 0===e){var r=this.getExtInfo("keyUsage");if(void 0===r)return;t=o(this.hex,r.vidx),e=r.critical}var i={extname:"keyUsage"};return e&&(i.critical=!0),i.names=this.getExtKeyUsageString(t).split(","),i},this.getExtKeyUsageBin=function(t){if(void 0===t){var e=this.getExtInfo("keyUsage");if(void 0===e)return"";t=o(this.hex,e.vidx)}if(8!=t.length&&10!=t.length)throw new Error("malformed key usage value: "+t);var r="000000000000000"+parseInt(t.substr(6),16).toString(2);return 8==t.length&&(r=r.slice(-8)),10==t.length&&(r=r.slice(-16)),""==(r=r.replace(/0+$/,""))&&(r="0"),r},this.getExtKeyUsageString=function(t){for(var e=this.getExtKeyUsageBin(t),r=new Array,i=0;i<e.length;i++)"1"==e.substr(i,1)&&r.push(Wt.KEYUSAGE_NAME[i]);return r.join(",")},this.getExtSubjectKeyIdentifier=function(t,e){if(void 0===t&&void 0===e){var r=this.getExtInfo("subjectKeyIdentifier");if(void 0===r)return;t=o(this.hex,r.vidx),e=r.critical}var i={extname:"subjectKeyIdentifier"};e&&(i.critical=!0);var s=n(t,0);return i.kid={hex:s},i},this.getExtAuthorityKeyIdentifier=function(t,e){if(void 0===t&&void 0===e){var r=this.getExtInfo("authorityKeyIdentifier");if(void 0===r)return;t=o(this.hex,r.vidx),e=r.critical}var s={extname:"authorityKeyIdentifier"};e&&(s.critical=!0);for(var a=i(t,0),u=0;u<a.length;u++){var h=t.substr(a[u],2);if("80"===h&&(s.kid={hex:n(t,a[u])}),"a1"===h){var c=o(t,a[u]),f=this.getGeneralNames(c);s.issuer=f[0].dn}"82"===h&&(s.sn={hex:n(t,a[u])})}return s},this.getExtExtKeyUsage=function(t,e){if(void 0===t&&void 0===e){var r=this.getExtInfo("extKeyUsage");if(void 0===r)return;t=o(this.hex,r.vidx),e=r.critical}var s={extname:"extKeyUsage",array:[]};e&&(s.critical=!0);for(var a=i(t,0),u=0;u<a.length;u++)s.array.push(d(n(t,a[u])));return s},this.getExtExtKeyUsageName=function(){var t=this.getExtInfo("extKeyUsage");if(void 0===t)return t;var e=new Array,r=o(this.hex,t.vidx);if(""===r)return e;for(var s=i(r,0),a=0;a<s.length;a++)e.push(d(n(r,s[a])));return e},this.getExtSubjectAltName=function(t,e){if(void 0===t&&void 0===e){var r=this.getExtInfo("subjectAltName");if(void 0===r)return;t=o(this.hex,r.vidx),e=r.critical}var i={extname:"subjectAltName",array:[]};return e&&(i.critical=!0),i.array=this.getGeneralNames(t),i},this.getExtIssuerAltName=function(t,e){if(void 0===t&&void 0===e){var r=this.getExtInfo("issuerAltName");if(void 0===r)return;t=o(this.hex,r.vidx),e=r.critical}var i={extname:"issuerAltName",array:[]};return e&&(i.critical=!0),i.array=this.getGeneralNames(t),i},this.getGeneralNames=function(t){for(var e=i(t,0),r=[],n=0;n<e.length;n++){var s=this.getGeneralName(o(t,e[n]));void 0!==s&&r.push(s)}return r},this.getGeneralName=function(t){var e=t.substr(0,2),r=n(t,0),i=Et(r);return"81"==e?{rfc822:i}:"82"==e?{dns:i}:"86"==e?{uri:i}:"87"==e?{ip:Ot(r)}:"a4"==e?{dn:this.getX500Name(r)}:void 0},this.getExtSubjectAltName2=function(){var t,e,r,s=this.getExtInfo("subjectAltName");if(void 0===s)return s;for(var a=new Array,u=o(this.hex,s.vidx),h=i(u,0),c=0;c<h.length;c++)r=u.substr(h[c],2),t=n(u,h[c]),"81"===r&&(e=St(t),a.push(["MAIL",e])),"82"===r&&(e=St(t),a.push(["DNS",e])),"84"===r&&(e=Wt.hex2dn(t,0),a.push(["DN",e])),"86"===r&&(e=St(t),a.push(["URI",e])),"87"===r&&(e=Ot(t),a.push(["IP",e]));return a},this.getExtCRLDistributionPoints=function(t,e){if(void 0===t&&void 0===e){var r=this.getExtInfo("cRLDistributionPoints");if(void 0===r)return;t=o(this.hex,r.vidx),e=r.critical}var n={extname:"cRLDistributionPoints",array:[]};e&&(n.critical=!0);for(var s=i(t,0),a=0;a<s.length;a++){var u=o(t,s[a]);n.array.push(this.getDistributionPoint(u))}return n},this.getDistributionPoint=function(t){for(var e={},r=i(t,0),n=0;n<r.length;n++){var s=t.substr(r[n],2),a=o(t,r[n]);"a0"==s&&(e.dpname=this.getDistributionPointName(a))}return e},this.getDistributionPointName=function(t){for(var e={},r=i(t,0),n=0;n<r.length;n++){var s=t.substr(r[n],2),a=o(t,r[n]);"a0"==s&&(e.full=this.getGeneralNames(a))}return e},this.getExtCRLDistributionPointsURI=function(){var t=this.getExtInfo("cRLDistributionPoints");if(void 0===t)return t;for(var e=new Array,r=i(this.hex,t.vidx),n=0;n<r.length;n++)try{var o=St(s(this.hex,r[n],[0,0,0],"86"));e.push(o)}catch(t){}return e},this.getExtAIAInfo=function(){var t=this.getExtInfo("authorityInfoAccess");if(void 0===t)return t;for(var e={ocsp:[],caissuer:[]},r=i(this.hex,t.vidx),n=0;n<r.length;n++){var o=s(this.hex,r[n],[0],"06"),a=s(this.hex,r[n],[1],"86");"2b06010505073001"===o&&e.ocsp.push(St(a)),"2b06010505073002"===o&&e.caissuer.push(St(a))}return e},this.getExtAuthorityInfoAccess=function(t,e){if(void 0===t&&void 0===e){var r=this.getExtInfo("authorityInfoAccess");if(void 0===r)return;t=o(this.hex,r.vidx),e=r.critical}var n={extname:"authorityInfoAccess",array:[]};e&&(n.critical=!0);for(var u=i(t,0),h=0;h<u.length;h++){var c=a(t,u[h],[0],"06"),f=St(s(t,u[h],[1],"86"));if("2b06010505073001"==c)n.array.push({ocsp:f});else{if("2b06010505073002"!=c)throw new Error("unknown method: "+c);n.array.push({caissuer:f})}}return n},this.getExtCertificatePolicies=function(t,e){if(void 0===t&&void 0===e){var r=this.getExtInfo("certificatePolicies");if(void 0===r)return;t=o(this.hex,r.vidx),e=r.critical}var n={extname:"certificatePolicies",array:[]};e&&(n.critical=!0);for(var s=i(t,0),a=0;a<s.length;a++){var u=o(t,s[a]),h=this.getPolicyInformation(u);n.array.push(h)}return n},this.getPolicyInformation=function(t){var e={},r=s(t,0,[0],"06");e.policyoid=d(r);var n=f(t,0,[1],"30");if(-1!=n){e.array=[];for(var a=i(t,n),u=0;u<a.length;u++){var h=o(t,a[u]),c=this.getPolicyQualifierInfo(h);e.array.push(c)}}return e},this.getPolicyQualifierInfo=function(t){var e={},r=s(t,0,[0],"06");if("2b06010505070201"===r){var i=a(t,0,[1],"16");e.cps=Et(i)}else if("2b06010505070202"===r){var n=u(t,0,[1],"30");e.unotice=this.getUserNotice(n)}return e},this.getUserNotice=function(t){for(var e={},r=i(t,0),n=0;n<r.length;n++){var s=o(t,r[n]);"30"!=s.substr(0,2)&&(e.exptext=this.getDisplayText(s))}return e},this.getDisplayText=function(t){var e={};return e.type={"0c":"utf8",16:"ia5","1a":"vis","1e":"bmp"}[t.substr(0,2)],e.str=Et(n(t,0)),e},this.getExtCRLNumber=function(t,e){var r={extname:"cRLNumber"};if(e&&(r.critical=!0),"02"==t.substr(0,2))return r.num={hex:n(t,0)},r;throw new Error("hExtV parse error: "+t)},this.getExtCRLReason=function(t,e){var r={extname:"cRLReason"};if(e&&(r.critical=!0),"0a"==t.substr(0,2))return r.code=parseInt(n(t,0),16),r;throw new Error("hExtV parse error: "+t)},this.getExtOcspNonce=function(t,e){var r={extname:"ocspNonce"};e&&(r.critical=!0);var i=n(t,0);return r.hex=i,r},this.getExtOcspNoCheck=function(t,e){var r={extname:"ocspNoCheck"};return e&&(r.critical=!0),r},this.getExtAdobeTimeStamp=function(t,e){if(void 0===t&&void 0===e){var r=this.getExtInfo("adobeTimeStamp");if(void 0===r)return;t=o(this.hex,r.vidx),e=r.critical}var n={extname:"adobeTimeStamp"};e&&(n.critical=!0);var s=i(t,0);if(s.length>1){var a=o(t,s[1]),u=this.getGeneralName(a);null!=u.uri&&(n.uri=u.uri)}if(s.length>2){var h=o(t,s[2]);"0101ff"==h&&(n.reqauth=!0),"010100"==h&&(n.reqauth=!1)}return n},this.getX500NameRule=function(t){for(var e=null,r=[],i=0;i<t.length;i++)for(var n=t[i],o=0;o<n.length;o++)r.push(n[o]);for(i=0;i<r.length;i++){var s=r[i],a=s.ds,u=s.value,h=s.type;if("prn"!=a&&"utf8"!=a&&"ia5"!=a)return"mixed";if("ia5"==a){if("CN"!=h)return"mixed";if(ht.lang.String.isMail(u))continue;return"mixed"}if("C"==h){if("prn"==a)continue;return"mixed"}if(null==e)e=a;else if(e!==a)return"mixed"}return null==e?"prn":e},this.getX500Name=function(t){var e=this.getX500NameArray(t);return{array:e,str:this.dnarraytostr(e)}},this.getX500NameArray=function(t){for(var e=[],r=i(t,0),n=0;n<r.length;n++)e.push(this.getRDN(o(t,r[n])));return e},this.getRDN=function(t){for(var e=[],r=i(t,0),n=0;n<r.length;n++)e.push(this.getAttrTypeAndValue(o(t,r[n])));return e},this.getAttrTypeAndValue=function(t){var e={type:null,value:null,ds:null},r=i(t,0),n=s(t,r[0],[],"06"),o=s(t,r[1],[]),a=ht.asn1.ASN1Util.oidHexToInt(n);return e.type=ht.asn1.x509.OID.oid2atype(a),e.value=Et(o),e.ds=this.HEX2STAG[t.substr(r[1],2)],e},this.readCertPEM=function(t){this.readCertHex(y(t))},this.readCertHex=function(t){this.hex=t,this.getVersion();try{c(this.hex,0,[0,7],"a3"),this.parseExt()}catch(t){}},this.getParam=function(){var t={};return t.version=this.getVersion(),t.serial={hex:this.getSerialNumberHex()},t.sigalg=this.getSignatureAlgorithmField(),t.issuer=this.getIssuer(),t.notbefore=this.getNotBefore(),t.notafter=this.getNotAfter(),t.subject=this.getSubject(),t.sbjpubkey=It(this.getPublicKeyHex(),"PUBLIC KEY"),this.aExtInfo.length>0&&(t.ext=this.getExtParamArray()),t.sighex=this.getSignatureValueHex(),t},this.getExtParamArray=function(t){null==t&&-1!=f(this.hex,0,[0,"[3]"])&&(t=h(this.hex,0,[0,"[3]",0],"30"));for(var e=[],r=i(t,0),n=0;n<r.length;n++){var s=o(t,r[n]),a=this.getExtParam(s);null!=a&&e.push(a)}return e},this.getExtParam=function(t){var e=i(t,0).length;if(2!=e&&3!=e)throw new Error("wrong number elements in Extension: "+e+" "+t);var r=p(s(t,0,[0],"06")),n=!1;3==e&&"0101ff"==u(t,0,[1])&&(n=!0);var o=u(t,0,[e-1,0]),a=void 0;if("2.5.29.14"==r?a=this.getExtSubjectKeyIdentifier(o,n):"2.5.29.15"==r?a=this.getExtKeyUsage(o,n):"2.5.29.17"==r?a=this.getExtSubjectAltName(o,n):"2.5.29.18"==r?a=this.getExtIssuerAltName(o,n):"2.5.29.19"==r?a=this.getExtBasicConstraints(o,n):"2.5.29.31"==r?a=this.getExtCRLDistributionPoints(o,n):"2.5.29.32"==r?a=this.getExtCertificatePolicies(o,n):"2.5.29.35"==r?a=this.getExtAuthorityKeyIdentifier(o,n):"2.5.29.37"==r?a=this.getExtExtKeyUsage(o,n):"1.3.6.1.5.5.7.1.1"==r?a=this.getExtAuthorityInfoAccess(o,n):"2.5.29.20"==r?a=this.getExtCRLNumber(o,n):"2.5.29.21"==r?a=this.getExtCRLReason(o,n):"1.3.6.1.5.5.7.48.1.2"==r?a=this.getExtOcspNonce(o,n):"1.3.6.1.5.5.7.48.1.5"==r?a=this.getExtOcspNoCheck(o,n):"1.2.840.113583.1.1.9.1"==r&&(a=this.getExtAdobeTimeStamp(o,n)),null!=a)return a;var h={extname:r,extn:o};return n&&(h.critical=!0),h},this.findExt=function(t,e){for(var r=0;r<t.length;r++)if(t[r].extname==e)return t[r];return null},this.updateExtCDPFullURI=function(t,e){var r=this.findExt(t,"cRLDistributionPoints");if(null!=r&&null!=r.array)for(var i=r.array,n=0;n<i.length;n++)if(null!=i[n].dpname&&null!=i[n].dpname.full)for(var o=i[n].dpname.full,s=0;s<o.length;s++){var a=o[n];null!=a.uri&&(a.uri=e)}},this.updateExtAIAOCSP=function(t,e){var r=this.findExt(t,"authorityInfoAccess");if(null!=r&&null!=r.array)for(var i=r.array,n=0;n<i.length;n++)null!=i[n].ocsp&&(i[n].ocsp=e)},this.updateExtAIACAIssuer=function(t,e){var r=this.findExt(t,"authorityInfoAccess");if(null!=r&&null!=r.array)for(var i=r.array,n=0;n<i.length;n++)null!=i[n].caissuer&&(i[n].caissuer=e)},this.dnarraytostr=function(t){return"/"+t.map((function(t){return function(t){return t.map((function(t){return function(t){return t.type+"="+t.value}(t)})).join("+")}(t)})).join("/")},this.getInfo=function(){var t,e,r,i=function(t){return JSON.stringify(t.array).replace(/[\[\]\{\}\"]/g,"")},n=function(t){for(var e="",r=t.array,i=0;i<r.length;i++){var n=r[i];if(e+="    policy oid: "+n.policyoid+"\n",void 0!==n.array)for(var o=0;o<n.array.length;o++){var s=n.array[o];void 0!==s.cps&&(e+="    cps: "+s.cps+"\n")}}return e},o=function(t){for(var e="",r=t.array,i=0;i<r.length;i++){var n=r[i];try{void 0!==n.dpname.full[0].uri&&(e+="    "+n.dpname.full[0].uri+"\n")}catch(t){}try{void 0!==n.dname.full[0].dn.hex&&(e+="    "+Wt.hex2dn(n.dpname.full[0].dn.hex)+"\n")}catch(t){}}return e},s=function(t){for(var e="",r=t.array,i=0;i<r.length;i++){var n=r[i];void 0!==n.caissuer&&(e+="    caissuer: "+n.caissuer+"\n"),void 0!==n.ocsp&&(e+="    ocsp: "+n.ocsp+"\n")}return e};if(t="Basic Fields\n",t+="  serial number: "+this.getSerialNumberHex()+"\n",t+="  signature algorithm: "+this.getSignatureAlgorithmField()+"\n",t+="  issuer: "+this.getIssuerString()+"\n",t+="  notBefore: "+this.getNotBefore()+"\n",t+="  notAfter: "+this.getNotAfter()+"\n",t+="  subject: "+this.getSubjectString()+"\n",t+="  subject public key info: \n",t+="    key algorithm: "+(e=this.getPublicKey()).type+"\n","RSA"===e.type&&(t+="    n="+jt(e.n.toString(16)).substr(0,16)+"...\n",t+="    e="+jt(e.e.toString(16))+"\n"),null!=(r=this.aExtInfo)){t+="X509v3 Extensions:\n";for(var a=0;a<r.length;a++){var u=r[a],h=ht.asn1.x509.OID.oid2name(u.oid);""===h&&(h=u.oid);var c="";if(!0===u.critical&&(c="CRITICAL"),t+="  "+h+" "+c+":\n","basicConstraints"===h){var f=this.getExtBasicConstraints();void 0===f.cA?t+="    {}\n":(t+="    cA=true",void 0!==f.pathLen&&(t+=", pathLen="+f.pathLen),t+="\n")}else if("keyUsage"===h)t+="    "+this.getExtKeyUsageString()+"\n";else if("subjectKeyIdentifier"===h)t+="    "+this.getExtSubjectKeyIdentifier().kid.hex+"\n";else if("authorityKeyIdentifier"===h){var l=this.getExtAuthorityKeyIdentifier();void 0!==l.kid&&(t+="    kid="+l.kid.hex+"\n")}else"extKeyUsage"===h?t+="    "+this.getExtExtKeyUsage().array.join(", ")+"\n":"subjectAltName"===h?t+="    "+i(this.getExtSubjectAltName())+"\n":"cRLDistributionPoints"===h?t+=o(this.getExtCRLDistributionPoints()):"authorityInfoAccess"===h?t+=s(this.getExtAuthorityInfoAccess()):"certificatePolicies"===h&&(t+=n(this.getExtCertificatePolicies()))}}return(t+="signature algorithm: "+this.getSignatureAlgorithmName()+"\n")+"signature: "+this.getSignatureValueHex().substr(0,16)+"...\n"},"string"==typeof t&&(-1!=t.indexOf("-----BEGIN")?this.readCertPEM(t):ht.lang.String.isHex(t)&&this.readCertHex(t))}nt.prototype.sign=function(t,e){var r=function(t){return ht.crypto.Util.hashString(t,e)}(t);return this.signWithMessageHash(r,e)},nt.prototype.signWithMessageHash=function(t,e){var r=rt(ht.crypto.Util.getPaddedDigestInfoHex(t,e,this.n.bitLength()),16);return Ht(this.doPrivate(r).toString(16),this.n.bitLength())},nt.prototype.signPSS=function(t,e,r){var i=function(t){return ht.crypto.Util.hashHex(t,e)}(Mt(t));return void 0===r&&(r=-1),this.signWithMessageHashPSS(i,e,r)},nt.prototype.signWithMessageHashPSS=function(t,e,r){var i,n=Et(t),o=n.length,s=this.n.bitLength()-1,a=Math.ceil(s/8),u=function(t){return ht.crypto.Util.hashHex(t,e)};if(-1===r||void 0===r)r=o;else if(-2===r)r=a-o-2;else if(r<-2)throw new Error("invalid salt length");if(a<o+r+2)throw new Error("data too long");var h="";r>0&&(h=new Array(r),(new et).nextBytes(h),h=String.fromCharCode.apply(String,h));var c=Et(u(Mt("\0\0\0\0\0\0\0\0"+n+h))),f=[];for(i=0;i<a-r-o-2;i+=1)f[i]=0;var l=String.fromCharCode.apply(String,f)+""+h,d=qt(c,l.length,u),p=[];for(i=0;i<l.length;i+=1)p[i]=l.charCodeAt(i)^d.charCodeAt(i);var g=65280>>8*a-s&255;for(p[0]&=~g,i=0;i<o;i++)p.push(c.charCodeAt(i));return p.push(188),Ht(this.doPrivate(new E(p)).toString(16),this.n.bitLength())},nt.prototype.verify=function(t,e){var r=rt(e=(e=e.replace(Vt,"")).replace(/[ \n]+/g,""),16);if(r.bitLength()>this.n.bitLength())return 0;var i=zt(this.doPublic(r).toString(16).replace(/^1f+00/,""));if(0==i.length)return!1;var n=i[0];return i[1]==function(t){return ht.crypto.Util.hashString(t,n)}(t)},nt.prototype.verifyWithMessageHash=function(t,e){if(e.length!=Math.ceil(this.n.bitLength()/4))return!1;var r=rt(e,16);if(r.bitLength()>this.n.bitLength())return 0;var i=zt(this.doPublic(r).toString(16).replace(/^1f+00/,""));return 0!=i.length&&(i[0],i[1]==t)},nt.prototype.verifyPSS=function(t,e,r,i){var n=function(t){return ht.crypto.Util.hashHex(t,r)}(Mt(t));return void 0===i&&(i=-1),this.verifyWithMessageHashPSS(n,e,r,i)},nt.prototype.verifyWithMessageHashPSS=function(t,e,r,i){if(e.length!=Math.ceil(this.n.bitLength()/4))return!1;var n,o=new E(e,16),s=function(t){return ht.crypto.Util.hashHex(t,r)},a=Et(t),u=a.length,h=this.n.bitLength()-1,c=Math.ceil(h/8);if(-1===i||void 0===i)i=u;else if(-2===i)i=c-u-2;else if(i<-2)throw new Error("invalid salt length");if(c<u+i+2)throw new Error("data too long");var f=this.doPublic(o).toByteArray();for(n=0;n<f.length;n+=1)f[n]&=255;for(;f.length<c;)f.unshift(0);if(188!==f[c-1])throw new Error("encoded message does not end in 0xbc");var l=(f=String.fromCharCode.apply(String,f)).substr(0,c-u-1),d=f.substr(l.length,u),p=65280>>8*c-h&255;if(0!=(l.charCodeAt(0)&p))throw new Error("bits beyond keysize not zero");var g=qt(d,l.length,s),y=[];for(n=0;n<l.length;n+=1)y[n]=l.charCodeAt(n)^g.charCodeAt(n);y[0]&=~p;var m=c-u-i-2;for(n=0;n<m;n+=1)if(0!==y[n])throw new Error("leftmost octets not zero");if(1!==y[m])throw new Error("0x01 marker not found");return d===Et(s(Mt("\0\0\0\0\0\0\0\0"+a+String.fromCharCode.apply(String,y.slice(-i)))))},nt.SALT_LEN_HLEN=-1,nt.SALT_LEN_MAX=-2,nt.SALT_LEN_RECOVER=-2,Wt.hex2dn=function(t,e){if(void 0===e&&(e=0),"30"!==t.substr(e,2))throw new Error("malformed DN");for(var r=new Array,i=lt.getChildIdx(t,e),n=0;n<i.length;n++)r.push(Wt.hex2rdn(t,i[n]));return"/"+(r=r.map((function(t){return t.replace("/","\\/")}))).join("/")},Wt.hex2rdn=function(t,e){if(void 0===e&&(e=0),"31"!==t.substr(e,2))throw new Error("malformed RDN");for(var r=new Array,i=lt.getChildIdx(t,e),n=0;n<i.length;n++)r.push(Wt.hex2attrTypeValue(t,i[n]));return(r=r.map((function(t){return t.replace("+","\\+")}))).join("+")},Wt.hex2attrTypeValue=function(t,e){var r=lt,i=r.getV;if(void 0===e&&(e=0),"30"!==t.substr(e,2))throw new Error("malformed attribute type and value");var n=r.getChildIdx(t,e);2!==n.length||t.substr(n[0],2);var o=i(t,n[0]),s=ht.asn1.ASN1Util.oidHexToInt(o);return ht.asn1.x509.OID.oid2atype(s)+"="+Et(i(t,n[1]))},Wt.getPublicKeyFromCertHex=function(t){var e=new Wt;return e.readCertHex(t),e.getPublicKey()},Wt.getPublicKeyFromCertPEM=function(t){var e=new Wt;return e.readCertPEM(t),e.getPublicKey()},Wt.getPublicKeyInfoPropOfCertPEM=function(t){var e,r,i=lt.getVbyList,n={algparam:null};return(e=new Wt).readCertPEM(t),r=e.getPublicKeyHex(),n.keyhex=i(r,0,[1],"03").substr(2),n.algoid=i(r,0,[0,0],"06"),"2a8648ce3d0201"===n.algoid&&(n.algparam=i(r,0,[0,1],"06")),n},Wt.KEYUSAGE_NAME=["digitalSignature","nonRepudiation","keyEncipherment","dataEncipherment","keyAgreement","keyCertSign","cRLSign","encipherOnly","decipherOnly"],void 0!==ht&&ht||(e.KJUR=ht={}),void 0!==ht.jws&&ht.jws||(ht.jws={}),ht.jws.JWS=function(){var t=ht.jws.JWS.isSafeJSONString;this.parseJWS=function(e,r){if(void 0===this.parsedJWS||!r&&void 0===this.parsedJWS.sigvalH){var i=e.match(/^([^.]+)\.([^.]+)\.([^.]+)$/);if(null==i)throw"JWS signature is not a form of 'Head.Payload.SigValue'.";var n=i[1],o=i[2],s=i[3],a=n+"."+o;if(this.parsedJWS={},this.parsedJWS.headB64U=n,this.parsedJWS.payloadB64U=o,this.parsedJWS.sigvalB64U=s,this.parsedJWS.si=a,!r){var u=wt(s),h=rt(u,16);this.parsedJWS.sigvalH=u,this.parsedJWS.sigvalBI=h}var c=ft(n),f=ft(o);if(this.parsedJWS.headS=c,this.parsedJWS.payloadS=f,!t(c,this.parsedJWS,"headP"))throw"malformed JSON string for JWS Head: "+c}}},ht.jws.JWS.sign=function(t,e,i,n,o){var s,a,u,h=ht,c=h.jws.JWS,f=c.readSafeJSONString,l=c.isSafeJSONString,d=h.crypto,p=(d.ECDSA,d.Mac),g=d.Signature,y=JSON;if("string"!=typeof e&&"object"!=(void 0===e?"undefined":r(e)))throw"spHeader must be JSON string or object: "+e;if("object"==(void 0===e?"undefined":r(e))&&(a=e,s=y.stringify(a)),"string"==typeof e){if(!l(s=e))throw"JWS Head is not safe JSON string: "+s;a=f(s)}if(u=i,"object"==(void 0===i?"undefined":r(i))&&(u=y.stringify(i)),""!=t&&null!=t||void 0===a.alg||(t=a.alg),""!=t&&null!=t&&void 0===a.alg&&(a.alg=t,s=y.stringify(a)),t!==a.alg)throw"alg and sHeader.alg doesn't match: "+t+"!="+a.alg;var m=null;if(void 0===c.jwsalg2sigalg[t])throw"unsupported alg name: "+t;m=c.jwsalg2sigalg[t];var v=ct(s)+"."+ct(u),b="";if("Hmac"==m.substr(0,4)){if(void 0===n)throw"mac key shall be specified for HS* alg";var w=new p({alg:m,prov:"cryptojs",pass:n});w.updateString(v),b=w.doFinal()}else if(-1!=m.indexOf("withECDSA")){(S=new g({alg:m})).init(n,o),S.updateString(v);var _=S.sign();b=ht.crypto.ECDSA.asn1SigToConcatSig(_)}else{var S;"none"!=m&&((S=new g({alg:m})).init(n,o),S.updateString(v),b=S.sign())}return v+"."+bt(b)},ht.jws.JWS.verify=function(t,e,i){var n,o=ht,s=o.jws.JWS,a=s.readSafeJSONString,u=o.crypto,h=u.ECDSA,c=u.Mac,f=u.Signature;void 0!==r(nt)&&(n=nt);var l=t.split(".");if(3!==l.length)return!1;var d,p=l[0]+"."+l[1],g=wt(l[2]),y=a(ft(l[0])),m=null;if(void 0===y.alg)throw"algorithm not specified in header";if(d=(m=y.alg).substr(0,2),null!=i&&"[object Array]"===Object.prototype.toString.call(i)&&i.length>0&&-1==(":"+i.join(":")+":").indexOf(":"+m+":"))throw"algorithm '"+m+"' not accepted in the list";if("none"!=m&&null===e)throw"key shall be specified to verify.";if("string"==typeof e&&-1!=e.indexOf("-----BEGIN ")&&(e=Kt.getKey(e)),!("RS"!=d&&"PS"!=d||e instanceof n))throw"key shall be a RSAKey obj for RS* and PS* algs";if("ES"==d&&!(e instanceof h))throw"key shall be a ECDSA obj for ES* algs";var v=null;if(void 0===s.jwsalg2sigalg[y.alg])throw"unsupported alg name: "+m;if("none"==(v=s.jwsalg2sigalg[m]))throw"not supported";if("Hmac"==v.substr(0,4)){if(void 0===e)throw"hexadecimal key shall be specified for HMAC";var b=new c({alg:v,pass:e});return b.updateString(p),g==b.doFinal()}if(-1!=v.indexOf("withECDSA")){var w,_=null;try{_=h.concatSigToASN1Sig(g)}catch(t){return!1}return(w=new f({alg:v})).init(e),w.updateString(p),w.verify(_)}return(w=new f({alg:v})).init(e),w.updateString(p),w.verify(g)},ht.jws.JWS.parse=function(t){var e,r,i,n=t.split("."),o={};if(2!=n.length&&3!=n.length)throw"malformed sJWS: wrong number of '.' splitted elements";return e=n[0],r=n[1],3==n.length&&(i=n[2]),o.headerObj=ht.jws.JWS.readSafeJSONString(ft(e)),o.payloadObj=ht.jws.JWS.readSafeJSONString(ft(r)),o.headerPP=JSON.stringify(o.headerObj,null,"  "),null==o.payloadObj?o.payloadPP=ft(r):o.payloadPP=JSON.stringify(o.payloadObj,null,"  "),void 0!==i&&(o.sigHex=wt(i)),o},ht.jws.JWS.verifyJWT=function(t,e,i){var n=ht.jws,o=n.JWS,s=o.readSafeJSONString,a=o.inArray,u=o.includedArray,h=t.split("."),c=h[0],f=h[1],l=(wt(h[2]),s(ft(c))),d=s(ft(f));if(void 0===l.alg)return!1;if(void 0===i.alg)throw"acceptField.alg shall be specified";if(!a(l.alg,i.alg))return!1;if(void 0!==d.iss&&"object"===r(i.iss)&&!a(d.iss,i.iss))return!1;if(void 0!==d.sub&&"object"===r(i.sub)&&!a(d.sub,i.sub))return!1;if(void 0!==d.aud&&"object"===r(i.aud))if("string"==typeof d.aud){if(!a(d.aud,i.aud))return!1}else if("object"==r(d.aud)&&!u(d.aud,i.aud))return!1;var p=n.IntDate.getNow();return void 0!==i.verifyAt&&"number"==typeof i.verifyAt&&(p=i.verifyAt),void 0!==i.gracePeriod&&"number"==typeof i.gracePeriod||(i.gracePeriod=0),!(void 0!==d.exp&&"number"==typeof d.exp&&d.exp+i.gracePeriod<p||void 0!==d.nbf&&"number"==typeof d.nbf&&p<d.nbf-i.gracePeriod||void 0!==d.iat&&"number"==typeof d.iat&&p<d.iat-i.gracePeriod||void 0!==d.jti&&void 0!==i.jti&&d.jti!==i.jti||!o.verify(t,e,i.alg))},ht.jws.JWS.includedArray=function(t,e){var i=ht.jws.JWS.inArray;if(null===t)return!1;if("object"!==(void 0===t?"undefined":r(t)))return!1;if("number"!=typeof t.length)return!1;for(var n=0;n<t.length;n++)if(!i(t[n],e))return!1;return!0},ht.jws.JWS.inArray=function(t,e){if(null===e)return!1;if("object"!==(void 0===e?"undefined":r(e)))return!1;if("number"!=typeof e.length)return!1;for(var i=0;i<e.length;i++)if(e[i]==t)return!0;return!1},ht.jws.JWS.jwsalg2sigalg={HS256:"HmacSHA256",HS384:"HmacSHA384",HS512:"HmacSHA512",RS256:"SHA256withRSA",RS384:"SHA384withRSA",RS512:"SHA512withRSA",ES256:"SHA256withECDSA",ES384:"SHA384withECDSA",PS256:"SHA256withRSAandMGF1",PS384:"SHA384withRSAandMGF1",PS512:"SHA512withRSAandMGF1",none:"none"},ht.jws.JWS.isSafeJSONString=function(t,e,i){var n=null;try{return"object"!=(void 0===(n=ut(t))?"undefined":r(n))||n.constructor===Array?0:(e&&(e[i]=n),1)}catch(t){return 0}},ht.jws.JWS.readSafeJSONString=function(t){var e=null;try{return"object"!=(void 0===(e=ut(t))?"undefined":r(e))||e.constructor===Array?null:e}catch(t){return null}},ht.jws.JWS.getEncodedSignatureValueFromJWS=function(t){var e=t.match(/^[^.]+\.[^.]+\.([^.]+)$/);if(null==e)throw"JWS signature is not a form of 'Head.Payload.SigValue'.";return e[1]},ht.jws.JWS.getJWKthumbprint=function(t){if("RSA"!==t.kty&&"EC"!==t.kty&&"oct"!==t.kty)throw"unsupported algorithm for JWK Thumprint";var e="{";if("RSA"===t.kty){if("string"!=typeof t.n||"string"!=typeof t.e)throw"wrong n and e value for RSA key";e+='"e":"'+t.e+'",',e+='"kty":"'+t.kty+'",',e+='"n":"'+t.n+'"}'}else if("EC"===t.kty){if("string"!=typeof t.crv||"string"!=typeof t.x||"string"!=typeof t.y)throw"wrong crv, x and y value for EC key";e+='"crv":"'+t.crv+'",',e+='"kty":"'+t.kty+'",',e+='"x":"'+t.x+'",',e+='"y":"'+t.y+'"}'}else if("oct"===t.kty){if("string"!=typeof t.k)throw"wrong k value for oct(symmetric) key";e+='"kty":"'+t.kty+'",',e+='"k":"'+t.k+'"}'}var r=Mt(e);return bt(ht.crypto.Util.hashHex(r,"sha256"))},ht.jws.IntDate={},ht.jws.IntDate.get=function(t){var e=ht.jws.IntDate,r=e.getNow,i=e.getZulu;if("now"==t)return r();if("now + 1hour"==t)return r()+3600;if("now + 1day"==t)return r()+86400;if("now + 1month"==t)return r()+2592e3;if("now + 1year"==t)return r()+31536e3;if(t.match(/Z$/))return i(t);if(t.match(/^[0-9]+$/))return parseInt(t);throw"unsupported format: "+t},ht.jws.IntDate.getZulu=function(t){return Bt(t)},ht.jws.IntDate.getNow=function(){return~~(new Date/1e3)},ht.jws.IntDate.intDate2UTCString=function(t){return new Date(1e3*t).toUTCString()},ht.jws.IntDate.intDate2Zulu=function(t){var e=new Date(1e3*t);return("0000"+e.getUTCFullYear()).slice(-4)+("00"+(e.getUTCMonth()+1)).slice(-2)+("00"+e.getUTCDate()).slice(-2)+("00"+e.getUTCHours()).slice(-2)+("00"+e.getUTCMinutes()).slice(-2)+("00"+e.getUTCSeconds()).slice(-2)+"Z"},e.SecureRandom=et,e.rng_seed_time=Z,e.BigInteger=E,e.RSAKey=nt;var Gt=ht.crypto.EDSA;e.EDSA=Gt;var Jt=ht.crypto.DSA;e.DSA=Jt;var Zt=ht.crypto.Signature;e.Signature=Zt;var $t=ht.crypto.MessageDigest;e.MessageDigest=$t;var Yt=ht.crypto.Mac;e.Mac=Yt;var Qt=ht.crypto.Cipher;e.Cipher=Qt,e.KEYUTIL=Kt,e.ASN1HEX=lt,e.X509=Wt,e.CryptoJS=m,e.b64tohex=_,e.b64toBA=S,e.stoBA=dt,e.BAtos=pt,e.BAtohex=gt,e.stohex=yt,e.stob64=function(t){return w(yt(t))},e.stob64u=function(t){return mt(w(yt(t)))},e.b64utos=function(t){return pt(S(vt(t)))},e.b64tob64u=mt,e.b64utob64=vt,e.hex2b64=w,e.hextob64u=bt,e.b64utohex=wt,e.utf8tob64u=ct,e.b64utoutf8=ft,e.utf8tob64=function(t){return w(xt(Lt(t)))},e.b64toutf8=function(t){return decodeURIComponent(Ft(_(t)))},e.utf8tohex=_t,e.hextoutf8=St,e.hextorstr=Et,e.rstrtohex=Mt,e.hextob64=At,e.hextob64nl=Ct,e.b64nltohex=kt,e.hextopem=It,e.pemtohex=Tt,e.hextoArrayBuffer=function(t){if(t.length%2!=0)throw"input is not even length";if(null==t.match(/^[0-9A-Fa-f]+$/))throw"input is not hexadecimal";for(var e=new ArrayBuffer(t.length/2),r=new DataView(e),i=0;i<t.length/2;i++)r.setUint8(i,parseInt(t.substr(2*i,2),16));return e},e.ArrayBuffertohex=function(t){for(var e="",r=new DataView(t),i=0;i<t.byteLength;i++)e+=("00"+r.getUint8(i).toString(16)).slice(-2);return e},e.zulutomsec=Rt,e.zulutosec=Bt,e.zulutodate=function(t){return new Date(Rt(t))},e.datetozulu=function(t,e,r){var i,n=t.getUTCFullYear();if(e){if(n<1950||2049<n)throw"not proper year for UTCTime: "+n;i=(""+n).slice(-2)}else i=("000"+n).slice(-4);if(i+=("0"+(t.getUTCMonth()+1)).slice(-2),i+=("0"+t.getUTCDate()).slice(-2),i+=("0"+t.getUTCHours()).slice(-2),i+=("0"+t.getUTCMinutes()).slice(-2),i+=("0"+t.getUTCSeconds()).slice(-2),r){var o=t.getUTCMilliseconds();0!==o&&(i+="."+(o=(o=("00"+o).slice(-3)).replace(/0+$/g,"")))}return i+"Z"},e.uricmptohex=xt,e.hextouricmp=Ft,e.ipv6tohex=Pt,e.hextoipv6=Nt,e.hextoip=Ot,e.iptohex=function(t){var e="malformed IP address";if(!(t=t.toLowerCase(t)).match(/^[0-9.]+$/)){if(t.match(/^[0-9a-f:]+$/)&&-1!==t.indexOf(":"))return Pt(t);throw e}var r=t.split(".");if(4!==r.length)throw e;var i="";try{for(var n=0;n<4;n++)i+=("0"+parseInt(r[n]).toString(16)).slice(-2);return i}catch(t){throw e}},e.encodeURIComponentAll=Lt,e.newline_toUnix=function(t){return t.replace(/\r\n/gm,"\n")},e.newline_toDos=function(t){return(t=t.replace(/\r\n/gm,"\n")).replace(/\n/gm,"\r\n")},e.hextoposhex=jt,e.intarystrtohex=function(t){t=(t=(t=t.replace(/^\s*\[\s*/,"")).replace(/\s*\]\s*$/,"")).replace(/\s*/g,"");try{return t.split(/,/).map((function(t,e,r){var i=parseInt(t);if(i<0||255<i)throw"integer not in range 0-255";return("00"+i.toString(16)).slice(-2)})).join("")}catch(t){throw"malformed integer array string: "+t}},e.strdiffidx=function(t,e){var r=t.length;t.length>e.length&&(r=e.length);for(var i=0;i<r;i++)if(t.charCodeAt(i)!=e.charCodeAt(i))return i;return t.length!=e.length?r:-1},e.KJUR=ht;var Xt=ht.crypto;e.crypto=Xt;var te=ht.asn1;e.asn1=te;var ee=ht.jws;e.jws=ee;var re=ht.lang;e.lang=re}).call(this,r(28).Buffer)},function(t,e,r){"use strict";(function(t){var i=r(30),n=r(31),o=r(32);function s(){return u.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function a(t,e){if(s()<e)throw new RangeError("Invalid typed array length");return u.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(e)).__proto__=u.prototype:(null===t&&(t=new u(e)),t.length=e),t}function u(t,e,r){if(!(u.TYPED_ARRAY_SUPPORT||this instanceof u))return new u(t,e,r);if("number"==typeof t){if("string"==typeof e)throw new Error("If encoding is specified then the first argument must be a string");return f(this,t)}return h(this,t,e,r)}function h(t,e,r,i){if("number"==typeof e)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&e instanceof ArrayBuffer?function(t,e,r,i){if(e.byteLength,r<0||e.byteLength<r)throw new RangeError("'offset' is out of bounds");if(e.byteLength<r+(i||0))throw new RangeError("'length' is out of bounds");return e=void 0===r&&void 0===i?new Uint8Array(e):void 0===i?new Uint8Array(e,r):new Uint8Array(e,r,i),u.TYPED_ARRAY_SUPPORT?(t=e).__proto__=u.prototype:t=l(t,e),t}(t,e,r,i):"string"==typeof e?function(t,e,r){if("string"==typeof r&&""!==r||(r="utf8"),!u.isEncoding(r))throw new TypeError('"encoding" must be a valid string encoding');var i=0|p(e,r),n=(t=a(t,i)).write(e,r);return n!==i&&(t=t.slice(0,n)),t}(t,e,r):function(t,e){if(u.isBuffer(e)){var r=0|d(e.length);return 0===(t=a(t,r)).length||e.copy(t,0,0,r),t}if(e){if("undefined"!=typeof ArrayBuffer&&e.buffer instanceof ArrayBuffer||"length"in e)return"number"!=typeof e.length||function(t){return t!=t}(e.length)?a(t,0):l(t,e);if("Buffer"===e.type&&o(e.data))return l(t,e.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(t,e)}function c(t){if("number"!=typeof t)throw new TypeError('"size" argument must be a number');if(t<0)throw new RangeError('"size" argument must not be negative')}function f(t,e){if(c(e),t=a(t,e<0?0:0|d(e)),!u.TYPED_ARRAY_SUPPORT)for(var r=0;r<e;++r)t[r]=0;return t}function l(t,e){var r=e.length<0?0:0|d(e.length);t=a(t,r);for(var i=0;i<r;i+=1)t[i]=255&e[i];return t}function d(t){if(t>=s())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s().toString(16)+" bytes");return 0|t}function p(t,e){if(u.isBuffer(t))return t.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;"string"!=typeof t&&(t=""+t);var r=t.length;if(0===r)return 0;for(var i=!1;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return K(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return V(t).length;default:if(i)return K(t).length;e=(""+e).toLowerCase(),i=!0}}function g(t,e,r){var i=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return R(this,e,r);case"utf8":case"utf-8":return C(this,e,r);case"ascii":return I(this,e,r);case"latin1":case"binary":return T(this,e,r);case"base64":return A(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return B(this,e,r);default:if(i)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),i=!0}}function y(t,e,r){var i=t[e];t[e]=t[r],t[r]=i}function m(t,e,r,i,n){if(0===t.length)return-1;if("string"==typeof r?(i=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,isNaN(r)&&(r=n?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(n)return-1;r=t.length-1}else if(r<0){if(!n)return-1;r=0}if("string"==typeof e&&(e=u.from(e,i)),u.isBuffer(e))return 0===e.length?-1:v(t,e,r,i,n);if("number"==typeof e)return e&=255,u.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?n?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):v(t,[e],r,i,n);throw new TypeError("val must be string, number or Buffer")}function v(t,e,r,i,n){var o,s=1,a=t.length,u=e.length;if(void 0!==i&&("ucs2"===(i=String(i).toLowerCase())||"ucs-2"===i||"utf16le"===i||"utf-16le"===i)){if(t.length<2||e.length<2)return-1;s=2,a/=2,u/=2,r/=2}function h(t,e){return 1===s?t[e]:t.readUInt16BE(e*s)}if(n){var c=-1;for(o=r;o<a;o++)if(h(t,o)===h(e,-1===c?0:o-c)){if(-1===c&&(c=o),o-c+1===u)return c*s}else-1!==c&&(o-=o-c),c=-1}else for(r+u>a&&(r=a-u),o=r;o>=0;o--){for(var f=!0,l=0;l<u;l++)if(h(t,o+l)!==h(e,l)){f=!1;break}if(f)return o}return-1}function b(t,e,r,i){r=Number(r)||0;var n=t.length-r;i?(i=Number(i))>n&&(i=n):i=n;var o=e.length;if(o%2!=0)throw new TypeError("Invalid hex string");i>o/2&&(i=o/2);for(var s=0;s<i;++s){var a=parseInt(e.substr(2*s,2),16);if(isNaN(a))return s;t[r+s]=a}return s}function w(t,e,r,i){return H(K(e,t.length-r),t,r,i)}function _(t,e,r,i){return H(function(t){for(var e=[],r=0;r<t.length;++r)e.push(255&t.charCodeAt(r));return e}(e),t,r,i)}function S(t,e,r,i){return _(t,e,r,i)}function E(t,e,r,i){return H(V(e),t,r,i)}function M(t,e,r,i){return H(function(t,e){for(var r,i,n,o=[],s=0;s<t.length&&!((e-=2)<0);++s)i=(r=t.charCodeAt(s))>>8,n=r%256,o.push(n),o.push(i);return o}(e,t.length-r),t,r,i)}function A(t,e,r){return 0===e&&r===t.length?i.fromByteArray(t):i.fromByteArray(t.slice(e,r))}function C(t,e,r){r=Math.min(t.length,r);for(var i=[],n=e;n<r;){var o,s,a,u,h=t[n],c=null,f=h>239?4:h>223?3:h>191?2:1;if(n+f<=r)switch(f){case 1:h<128&&(c=h);break;case 2:128==(192&(o=t[n+1]))&&(u=(31&h)<<6|63&o)>127&&(c=u);break;case 3:o=t[n+1],s=t[n+2],128==(192&o)&&128==(192&s)&&(u=(15&h)<<12|(63&o)<<6|63&s)>2047&&(u<55296||u>57343)&&(c=u);break;case 4:o=t[n+1],s=t[n+2],a=t[n+3],128==(192&o)&&128==(192&s)&&128==(192&a)&&(u=(15&h)<<18|(63&o)<<12|(63&s)<<6|63&a)>65535&&u<1114112&&(c=u)}null===c?(c=65533,f=1):c>65535&&(c-=65536,i.push(c>>>10&1023|55296),c=56320|1023&c),i.push(c),n+=f}return function(t){var e=t.length;if(e<=k)return String.fromCharCode.apply(String,t);for(var r="",i=0;i<e;)r+=String.fromCharCode.apply(String,t.slice(i,i+=k));return r}(i)}e.Buffer=u,e.SlowBuffer=function(t){return+t!=t&&(t=0),u.alloc(+t)},e.INSPECT_MAX_BYTES=50,u.TYPED_ARRAY_SUPPORT=void 0!==t.TYPED_ARRAY_SUPPORT?t.TYPED_ARRAY_SUPPORT:function(){try{var t=new Uint8Array(1);return t.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===t.foo()&&"function"==typeof t.subarray&&0===t.subarray(1,1).byteLength}catch(t){return!1}}(),e.kMaxLength=s(),u.poolSize=8192,u._augment=function(t){return t.__proto__=u.prototype,t},u.from=function(t,e,r){return h(null,t,e,r)},u.TYPED_ARRAY_SUPPORT&&(u.prototype.__proto__=Uint8Array.prototype,u.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&u[Symbol.species]===u&&Object.defineProperty(u,Symbol.species,{value:null,configurable:!0})),u.alloc=function(t,e,r){return function(t,e,r,i){return c(e),e<=0?a(t,e):void 0!==r?"string"==typeof i?a(t,e).fill(r,i):a(t,e).fill(r):a(t,e)}(null,t,e,r)},u.allocUnsafe=function(t){return f(null,t)},u.allocUnsafeSlow=function(t){return f(null,t)},u.isBuffer=function(t){return!(null==t||!t._isBuffer)},u.compare=function(t,e){if(!u.isBuffer(t)||!u.isBuffer(e))throw new TypeError("Arguments must be Buffers");if(t===e)return 0;for(var r=t.length,i=e.length,n=0,o=Math.min(r,i);n<o;++n)if(t[n]!==e[n]){r=t[n],i=e[n];break}return r<i?-1:i<r?1:0},u.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},u.concat=function(t,e){if(!o(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return u.alloc(0);var r;if(void 0===e)for(e=0,r=0;r<t.length;++r)e+=t[r].length;var i=u.allocUnsafe(e),n=0;for(r=0;r<t.length;++r){var s=t[r];if(!u.isBuffer(s))throw new TypeError('"list" argument must be an Array of Buffers');s.copy(i,n),n+=s.length}return i},u.byteLength=p,u.prototype._isBuffer=!0,u.prototype.swap16=function(){var t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var e=0;e<t;e+=2)y(this,e,e+1);return this},u.prototype.swap32=function(){var t=this.length;if(t%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var e=0;e<t;e+=4)y(this,e,e+3),y(this,e+1,e+2);return this},u.prototype.swap64=function(){var t=this.length;if(t%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var e=0;e<t;e+=8)y(this,e,e+7),y(this,e+1,e+6),y(this,e+2,e+5),y(this,e+3,e+4);return this},u.prototype.toString=function(){var t=0|this.length;return 0===t?"":0===arguments.length?C(this,0,t):g.apply(this,arguments)},u.prototype.equals=function(t){if(!u.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===u.compare(this,t)},u.prototype.inspect=function(){var t="",r=e.INSPECT_MAX_BYTES;return this.length>0&&(t=this.toString("hex",0,r).match(/.{2}/g).join(" "),this.length>r&&(t+=" ... ")),"<Buffer "+t+">"},u.prototype.compare=function(t,e,r,i,n){if(!u.isBuffer(t))throw new TypeError("Argument must be a Buffer");if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===i&&(i=0),void 0===n&&(n=this.length),e<0||r>t.length||i<0||n>this.length)throw new RangeError("out of range index");if(i>=n&&e>=r)return 0;if(i>=n)return-1;if(e>=r)return 1;if(this===t)return 0;for(var o=(n>>>=0)-(i>>>=0),s=(r>>>=0)-(e>>>=0),a=Math.min(o,s),h=this.slice(i,n),c=t.slice(e,r),f=0;f<a;++f)if(h[f]!==c[f]){o=h[f],s=c[f];break}return o<s?-1:s<o?1:0},u.prototype.includes=function(t,e,r){return-1!==this.indexOf(t,e,r)},u.prototype.indexOf=function(t,e,r){return m(this,t,e,r,!0)},u.prototype.lastIndexOf=function(t,e,r){return m(this,t,e,r,!1)},u.prototype.write=function(t,e,r,i){if(void 0===e)i="utf8",r=this.length,e=0;else if(void 0===r&&"string"==typeof e)i=e,r=this.length,e=0;else{if(!isFinite(e))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");e|=0,isFinite(r)?(r|=0,void 0===i&&(i="utf8")):(i=r,r=void 0)}var n=this.length-e;if((void 0===r||r>n)&&(r=n),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");i||(i="utf8");for(var o=!1;;)switch(i){case"hex":return b(this,t,e,r);case"utf8":case"utf-8":return w(this,t,e,r);case"ascii":return _(this,t,e,r);case"latin1":case"binary":return S(this,t,e,r);case"base64":return E(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return M(this,t,e,r);default:if(o)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),o=!0}},u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var k=4096;function I(t,e,r){var i="";r=Math.min(t.length,r);for(var n=e;n<r;++n)i+=String.fromCharCode(127&t[n]);return i}function T(t,e,r){var i="";r=Math.min(t.length,r);for(var n=e;n<r;++n)i+=String.fromCharCode(t[n]);return i}function R(t,e,r){var i=t.length;(!e||e<0)&&(e=0),(!r||r<0||r>i)&&(r=i);for(var n="",o=e;o<r;++o)n+=D(t[o]);return n}function B(t,e,r){for(var i=t.slice(e,r),n="",o=0;o<i.length;o+=2)n+=String.fromCharCode(i[o]+256*i[o+1]);return n}function x(t,e,r){if(t%1!=0||t<0)throw new RangeError("offset is not uint");if(t+e>r)throw new RangeError("Trying to access beyond buffer length")}function F(t,e,r,i,n,o){if(!u.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>n||e<o)throw new RangeError('"value" argument is out of bounds');if(r+i>t.length)throw new RangeError("Index out of range")}function P(t,e,r,i){e<0&&(e=65535+e+1);for(var n=0,o=Math.min(t.length-r,2);n<o;++n)t[r+n]=(e&255<<8*(i?n:1-n))>>>8*(i?n:1-n)}function N(t,e,r,i){e<0&&(e=4294967295+e+1);for(var n=0,o=Math.min(t.length-r,4);n<o;++n)t[r+n]=e>>>8*(i?n:3-n)&255}function O(t,e,r,i,n,o){if(r+i>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function L(t,e,r,i,o){return o||O(t,0,r,4),n.write(t,e,r,i,23,4),r+4}function U(t,e,r,i,o){return o||O(t,0,r,8),n.write(t,e,r,i,52,8),r+8}u.prototype.slice=function(t,e){var r,i=this.length;if((t=~~t)<0?(t+=i)<0&&(t=0):t>i&&(t=i),(e=void 0===e?i:~~e)<0?(e+=i)<0&&(e=0):e>i&&(e=i),e<t&&(e=t),u.TYPED_ARRAY_SUPPORT)(r=this.subarray(t,e)).__proto__=u.prototype;else{var n=e-t;r=new u(n,void 0);for(var o=0;o<n;++o)r[o]=this[o+t]}return r},u.prototype.readUIntLE=function(t,e,r){t|=0,e|=0,r||x(t,e,this.length);for(var i=this[t],n=1,o=0;++o<e&&(n*=256);)i+=this[t+o]*n;return i},u.prototype.readUIntBE=function(t,e,r){t|=0,e|=0,r||x(t,e,this.length);for(var i=this[t+--e],n=1;e>0&&(n*=256);)i+=this[t+--e]*n;return i},u.prototype.readUInt8=function(t,e){return e||x(t,1,this.length),this[t]},u.prototype.readUInt16LE=function(t,e){return e||x(t,2,this.length),this[t]|this[t+1]<<8},u.prototype.readUInt16BE=function(t,e){return e||x(t,2,this.length),this[t]<<8|this[t+1]},u.prototype.readUInt32LE=function(t,e){return e||x(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},u.prototype.readUInt32BE=function(t,e){return e||x(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},u.prototype.readIntLE=function(t,e,r){t|=0,e|=0,r||x(t,e,this.length);for(var i=this[t],n=1,o=0;++o<e&&(n*=256);)i+=this[t+o]*n;return i>=(n*=128)&&(i-=Math.pow(2,8*e)),i},u.prototype.readIntBE=function(t,e,r){t|=0,e|=0,r||x(t,e,this.length);for(var i=e,n=1,o=this[t+--i];i>0&&(n*=256);)o+=this[t+--i]*n;return o>=(n*=128)&&(o-=Math.pow(2,8*e)),o},u.prototype.readInt8=function(t,e){return e||x(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},u.prototype.readInt16LE=function(t,e){e||x(t,2,this.length);var r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},u.prototype.readInt16BE=function(t,e){e||x(t,2,this.length);var r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},u.prototype.readInt32LE=function(t,e){return e||x(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},u.prototype.readInt32BE=function(t,e){return e||x(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},u.prototype.readFloatLE=function(t,e){return e||x(t,4,this.length),n.read(this,t,!0,23,4)},u.prototype.readFloatBE=function(t,e){return e||x(t,4,this.length),n.read(this,t,!1,23,4)},u.prototype.readDoubleLE=function(t,e){return e||x(t,8,this.length),n.read(this,t,!0,52,8)},u.prototype.readDoubleBE=function(t,e){return e||x(t,8,this.length),n.read(this,t,!1,52,8)},u.prototype.writeUIntLE=function(t,e,r,i){t=+t,e|=0,r|=0,i||F(this,t,e,r,Math.pow(2,8*r)-1,0);var n=1,o=0;for(this[e]=255&t;++o<r&&(n*=256);)this[e+o]=t/n&255;return e+r},u.prototype.writeUIntBE=function(t,e,r,i){t=+t,e|=0,r|=0,i||F(this,t,e,r,Math.pow(2,8*r)-1,0);var n=r-1,o=1;for(this[e+n]=255&t;--n>=0&&(o*=256);)this[e+n]=t/o&255;return e+r},u.prototype.writeUInt8=function(t,e,r){return t=+t,e|=0,r||F(this,t,e,1,255,0),u.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[e]=255&t,e+1},u.prototype.writeUInt16LE=function(t,e,r){return t=+t,e|=0,r||F(this,t,e,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):P(this,t,e,!0),e+2},u.prototype.writeUInt16BE=function(t,e,r){return t=+t,e|=0,r||F(this,t,e,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):P(this,t,e,!1),e+2},u.prototype.writeUInt32LE=function(t,e,r){return t=+t,e|=0,r||F(this,t,e,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t):N(this,t,e,!0),e+4},u.prototype.writeUInt32BE=function(t,e,r){return t=+t,e|=0,r||F(this,t,e,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):N(this,t,e,!1),e+4},u.prototype.writeIntLE=function(t,e,r,i){if(t=+t,e|=0,!i){var n=Math.pow(2,8*r-1);F(this,t,e,r,n-1,-n)}var o=0,s=1,a=0;for(this[e]=255&t;++o<r&&(s*=256);)t<0&&0===a&&0!==this[e+o-1]&&(a=1),this[e+o]=(t/s>>0)-a&255;return e+r},u.prototype.writeIntBE=function(t,e,r,i){if(t=+t,e|=0,!i){var n=Math.pow(2,8*r-1);F(this,t,e,r,n-1,-n)}var o=r-1,s=1,a=0;for(this[e+o]=255&t;--o>=0&&(s*=256);)t<0&&0===a&&0!==this[e+o+1]&&(a=1),this[e+o]=(t/s>>0)-a&255;return e+r},u.prototype.writeInt8=function(t,e,r){return t=+t,e|=0,r||F(this,t,e,1,127,-128),u.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[e]=255&t,e+1},u.prototype.writeInt16LE=function(t,e,r){return t=+t,e|=0,r||F(this,t,e,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):P(this,t,e,!0),e+2},u.prototype.writeInt16BE=function(t,e,r){return t=+t,e|=0,r||F(this,t,e,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):P(this,t,e,!1),e+2},u.prototype.writeInt32LE=function(t,e,r){return t=+t,e|=0,r||F(this,t,e,4,2147483647,-2147483648),u.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24):N(this,t,e,!0),e+4},u.prototype.writeInt32BE=function(t,e,r){return t=+t,e|=0,r||F(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),u.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):N(this,t,e,!1),e+4},u.prototype.writeFloatLE=function(t,e,r){return L(this,t,e,!0,r)},u.prototype.writeFloatBE=function(t,e,r){return L(this,t,e,!1,r)},u.prototype.writeDoubleLE=function(t,e,r){return U(this,t,e,!0,r)},u.prototype.writeDoubleBE=function(t,e,r){return U(this,t,e,!1,r)},u.prototype.copy=function(t,e,r,i){if(r||(r=0),i||0===i||(i=this.length),e>=t.length&&(e=t.length),e||(e=0),i>0&&i<r&&(i=r),i===r)return 0;if(0===t.length||0===this.length)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("sourceStart out of bounds");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),t.length-e<i-r&&(i=t.length-e+r);var n,o=i-r;if(this===t&&r<e&&e<i)for(n=o-1;n>=0;--n)t[n+e]=this[n+r];else if(o<1e3||!u.TYPED_ARRAY_SUPPORT)for(n=0;n<o;++n)t[n+e]=this[n+r];else Uint8Array.prototype.set.call(t,this.subarray(r,r+o),e);return o},u.prototype.fill=function(t,e,r,i){if("string"==typeof t){if("string"==typeof e?(i=e,e=0,r=this.length):"string"==typeof r&&(i=r,r=this.length),1===t.length){var n=t.charCodeAt(0);n<256&&(t=n)}if(void 0!==i&&"string"!=typeof i)throw new TypeError("encoding must be a string");if("string"==typeof i&&!u.isEncoding(i))throw new TypeError("Unknown encoding: "+i)}else"number"==typeof t&&(t&=255);if(e<0||this.length<e||this.length<r)throw new RangeError("Out of range index");if(r<=e)return this;var o;if(e>>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"==typeof t)for(o=e;o<r;++o)this[o]=t;else{var s=u.isBuffer(t)?t:K(new u(t,i).toString()),a=s.length;for(o=0;o<r-e;++o)this[o+e]=s[o%a]}return this};var j=/[^+\/0-9A-Za-z-_]/g;function D(t){return t<16?"0"+t.toString(16):t.toString(16)}function K(t,e){var r;e=e||1/0;for(var i=t.length,n=null,o=[],s=0;s<i;++s){if((r=t.charCodeAt(s))>55295&&r<57344){if(!n){if(r>56319){(e-=3)>-1&&o.push(239,191,189);continue}if(s+1===i){(e-=3)>-1&&o.push(239,191,189);continue}n=r;continue}if(r<56320){(e-=3)>-1&&o.push(239,191,189),n=r;continue}r=65536+(n-55296<<10|r-56320)}else n&&(e-=3)>-1&&o.push(239,191,189);if(n=null,r<128){if((e-=1)<0)break;o.push(r)}else if(r<2048){if((e-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function V(t){return i.toByteArray(function(t){if((t=function(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}(t).replace(j,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function H(t,e,r,i){for(var n=0;n<i&&!(n+r>=e.length||n>=t.length);++n)e[n+r]=t[n];return n}}).call(this,r(29))},function(t,e){var r;r=function(){return this}();try{r=r||new Function("return this")()}catch(t){"object"==typeof window&&(r=window)}t.exports=r},function(t,e,r){"use strict";e.byteLength=function(t){var e=h(t),r=e[0],i=e[1];return 3*(r+i)/4-i},e.toByteArray=function(t){var e,r,i=h(t),s=i[0],a=i[1],u=new o(function(t,e,r){return 3*(e+r)/4-r}(0,s,a)),c=0,f=a>0?s-4:s;for(r=0;r<f;r+=4)e=n[t.charCodeAt(r)]<<18|n[t.charCodeAt(r+1)]<<12|n[t.charCodeAt(r+2)]<<6|n[t.charCodeAt(r+3)],u[c++]=e>>16&255,u[c++]=e>>8&255,u[c++]=255&e;return 2===a&&(e=n[t.charCodeAt(r)]<<2|n[t.charCodeAt(r+1)]>>4,u[c++]=255&e),1===a&&(e=n[t.charCodeAt(r)]<<10|n[t.charCodeAt(r+1)]<<4|n[t.charCodeAt(r+2)]>>2,u[c++]=e>>8&255,u[c++]=255&e),u},e.fromByteArray=function(t){for(var e,r=t.length,n=r%3,o=[],s=16383,a=0,u=r-n;a<u;a+=s)o.push(c(t,a,a+s>u?u:a+s));return 1===n?(e=t[r-1],o.push(i[e>>2]+i[e<<4&63]+"==")):2===n&&(e=(t[r-2]<<8)+t[r-1],o.push(i[e>>10]+i[e>>4&63]+i[e<<2&63]+"=")),o.join("")};for(var i=[],n=[],o="undefined"!=typeof Uint8Array?Uint8Array:Array,s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0,u=s.length;a<u;++a)i[a]=s[a],n[s.charCodeAt(a)]=a;function h(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");return-1===r&&(r=e),[r,r===e?0:4-r%4]}function c(t,e,r){for(var n,o,s=[],a=e;a<r;a+=3)n=(t[a]<<16&16711680)+(t[a+1]<<8&65280)+(255&t[a+2]),s.push(i[(o=n)>>18&63]+i[o>>12&63]+i[o>>6&63]+i[63&o]);return s.join("")}n["-".charCodeAt(0)]=62,n["_".charCodeAt(0)]=63},function(t,e){e.read=function(t,e,r,i,n){var o,s,a=8*n-i-1,u=(1<<a)-1,h=u>>1,c=-7,f=r?n-1:0,l=r?-1:1,d=t[e+f];for(f+=l,o=d&(1<<-c)-1,d>>=-c,c+=a;c>0;o=256*o+t[e+f],f+=l,c-=8);for(s=o&(1<<-c)-1,o>>=-c,c+=i;c>0;s=256*s+t[e+f],f+=l,c-=8);if(0===o)o=1-h;else{if(o===u)return s?NaN:1/0*(d?-1:1);s+=Math.pow(2,i),o-=h}return(d?-1:1)*s*Math.pow(2,o-i)},e.write=function(t,e,r,i,n,o){var s,a,u,h=8*o-n-1,c=(1<<h)-1,f=c>>1,l=23===n?Math.pow(2,-24)-Math.pow(2,-77):0,d=i?0:o-1,p=i?1:-1,g=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,s=c):(s=Math.floor(Math.log(e)/Math.LN2),e*(u=Math.pow(2,-s))<1&&(s--,u*=2),(e+=s+f>=1?l/u:l*Math.pow(2,1-f))*u>=2&&(s++,u/=2),s+f>=c?(a=0,s=c):s+f>=1?(a=(e*u-1)*Math.pow(2,n),s+=f):(a=e*Math.pow(2,f-1)*Math.pow(2,n),s=0));n>=8;t[r+d]=255&a,d+=p,a/=256,n-=8);for(s=s<<n|a,h+=n;h>0;t[r+d]=255&s,d+=p,s/=256,h-=8);t[r+d-p]|=128*g}},function(t,e){var r={}.toString;t.exports=Array.isArray||function(t){return"[object Array]"==r.call(t)}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t){var e=t.jws,r=t.KeyUtil,n=t.X509,o=t.crypto,s=t.hextob64u,a=t.b64tohex,u=t.AllowedSigningAlgs;return function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)}return t.parseJwt=function t(r){i.Log.debug("JoseUtil.parseJwt");try{var n=e.JWS.parse(r);return{header:n.headerObj,payload:n.payloadObj}}catch(t){i.Log.error(t)}},t.validateJwt=function(e,o,s,u,h,c,f){i.Log.debug("JoseUtil.validateJwt");try{if("RSA"===o.kty)if(o.e&&o.n)o=r.getKey(o);else{if(!o.x5c||!o.x5c.length)return i.Log.error("JoseUtil.validateJwt: RSA key missing key material",o),Promise.reject(new Error("RSA key missing key material"));var l=a(o.x5c[0]);o=n.getPublicKeyFromCertHex(l)}else{if("EC"!==o.kty)return i.Log.error("JoseUtil.validateJwt: Unsupported key type",o&&o.kty),Promise.reject(new Error(o.kty));if(!(o.crv&&o.x&&o.y))return i.Log.error("JoseUtil.validateJwt: EC key missing key material",o),Promise.reject(new Error("EC key missing key material"));o=r.getKey(o)}return t._validateJwt(e,o,s,u,h,c,f)}catch(t){return i.Log.error(t&&t.message||t),Promise.reject("JWT validation failed")}},t.validateJwtAttributes=function(e,r,n,o,s,a){o||(o=0),s||(s=parseInt(Date.now()/1e3));var u=t.parseJwt(e).payload;if(!u.iss)return i.Log.error("JoseUtil._validateJwt: issuer was not provided"),Promise.reject(new Error("issuer was not provided"));if(u.iss!==r)return i.Log.error("JoseUtil._validateJwt: Invalid issuer in token",u.iss),Promise.reject(new Error("Invalid issuer in token: "+u.iss));if(!u.aud)return i.Log.error("JoseUtil._validateJwt: aud was not provided"),Promise.reject(new Error("aud was not provided"));if(!(u.aud===n||Array.isArray(u.aud)&&u.aud.indexOf(n)>=0))return i.Log.error("JoseUtil._validateJwt: Invalid audience in token",u.aud),Promise.reject(new Error("Invalid audience in token: "+u.aud));if(u.azp&&u.azp!==n)return i.Log.error("JoseUtil._validateJwt: Invalid azp in token",u.azp),Promise.reject(new Error("Invalid azp in token: "+u.azp));if(!a){var h=s+o,c=s-o;if(!u.iat)return i.Log.error("JoseUtil._validateJwt: iat was not provided"),Promise.reject(new Error("iat was not provided"));if(h<u.iat)return i.Log.error("JoseUtil._validateJwt: iat is in the future",u.iat),Promise.reject(new Error("iat is in the future: "+u.iat));if(u.nbf&&h<u.nbf)return i.Log.error("JoseUtil._validateJwt: nbf is in the future",u.nbf),Promise.reject(new Error("nbf is in the future: "+u.nbf));if(!u.exp)return i.Log.error("JoseUtil._validateJwt: exp was not provided"),Promise.reject(new Error("exp was not provided"));if(u.exp<c)return i.Log.error("JoseUtil._validateJwt: exp is in the past",u.exp),Promise.reject(new Error("exp is in the past:"+u.exp))}return Promise.resolve(u)},t._validateJwt=function(r,n,o,s,a,h,c){return t.validateJwtAttributes(r,o,s,a,h,c).then((function(t){try{return e.JWS.verify(r,n,u)?t:(i.Log.error("JoseUtil._validateJwt: signature validation failed"),Promise.reject(new Error("signature validation failed")))}catch(t){return i.Log.error(t&&t.message||t),Promise.reject(new Error("signature validation failed"))}}))},t.hashString=function t(e,r){try{return o.Util.hashString(e,r)}catch(t){i.Log.error(t)}},t.hexToBase64Url=function t(e){try{return s(e)}catch(t){i.Log.error(t)}},t}()};var i=r(0);t.exports=e.default},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.SigninResponse=void 0;var i=function(){function t(t,e){for(var r=0;r<e.length;r++){var i=e[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,r,i){return r&&t(e.prototype,r),i&&t(e,i),e}}(),n=r(3);function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}e.SigninResponse=function(){function t(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"#";o(this,t);var i=n.UrlUtility.parseUrlFragment(e,r);this.error=i.error,this.error_description=i.error_description,this.error_uri=i.error_uri,this.code=i.code,this.state=i.state,this.id_token=i.id_token,this.session_state=i.session_state,this.access_token=i.access_token,this.token_type=i.token_type,this.scope=i.scope,this.profile=void 0,this.expires_in=i.expires_in}return i(t,[{key:"expires_in",get:function(){if(this.expires_at){var t=parseInt(Date.now()/1e3);return this.expires_at-t}},set:function(t){var e=parseInt(t);if("number"==typeof e&&e>0){var r=parseInt(Date.now()/1e3);this.expires_at=r+e}}},{key:"expired",get:function(){var t=this.expires_in;if(void 0!==t)return t<=0}},{key:"scopes",get:function(){return(this.scope||"").split(" ")}},{key:"isOpenIdConnect",get:function(){return this.scopes.indexOf("openid")>=0||!!this.id_token}}]),t}()},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.SignoutRequest=void 0;var i=r(0),n=r(3),o=r(9);e.SignoutRequest=function t(e){var r=e.url,s=e.id_token_hint,a=e.post_logout_redirect_uri,u=e.data,h=e.extraQueryParams,c=e.request_type;if(function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),!r)throw i.Log.error("SignoutRequest.ctor: No url passed"),new Error("url");for(var f in s&&(r=n.UrlUtility.addQueryParam(r,"id_token_hint",s)),a&&(r=n.UrlUtility.addQueryParam(r,"post_logout_redirect_uri",a),u&&(this.state=new o.State({data:u,request_type:c}),r=n.UrlUtility.addQueryParam(r,"state",this.state.id))),h)r=n.UrlUtility.addQueryParam(r,f,h[f]);this.url=r}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.SignoutResponse=void 0;var i=r(3);e.SignoutResponse=function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t);var r=i.UrlUtility.parseUrlFragment(e,"?");this.error=r.error,this.error_description=r.error_description,this.error_uri=r.error_uri,this.state=r.state}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.InMemoryWebStorage=void 0;var i=function(){function t(t,e){for(var r=0;r<e.length;r++){var i=e[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,r,i){return r&&t(e.prototype,r),i&&t(e,i),e}}(),n=r(0);e.InMemoryWebStorage=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this._data={}}return t.prototype.getItem=function(t){return n.Log.debug("InMemoryWebStorage.getItem",t),this._data[t]},t.prototype.setItem=function(t,e){n.Log.debug("InMemoryWebStorage.setItem",t),this._data[t]=e},t.prototype.removeItem=function(t){n.Log.debug("InMemoryWebStorage.removeItem",t),delete this._data[t]},t.prototype.key=function(t){return Object.getOwnPropertyNames(this._data)[t]},i(t,[{key:"length",get:function(){return Object.getOwnPropertyNames(this._data).length}}]),t}()},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.UserManager=void 0;var i=function(){function t(t,e){for(var r=0;r<e.length;r++){var i=e[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,r,i){return r&&t(e.prototype,r),i&&t(e,i),e}}(),n=r(0),o=r(10),s=r(39),a=r(15),u=r(45),h=r(47),c=r(18),f=r(8),l=r(20),d=r(11),p=r(4);function g(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function y(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}e.UserManager=function(t){function e(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:h.SilentRenewService,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:c.SessionMonitor,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:l.TokenRevocationClient,f=arguments.length>4&&void 0!==arguments[4]?arguments[4]:d.TokenClient,m=arguments.length>5&&void 0!==arguments[5]?arguments[5]:p.JoseUtil;g(this,e),r instanceof s.UserManagerSettings||(r=new s.UserManagerSettings(r));var v=y(this,t.call(this,r));return v._events=new u.UserManagerEvents(r),v._silentRenewService=new i(v),v.settings.automaticSilentRenew&&(n.Log.debug("UserManager.ctor: automaticSilentRenew is configured, setting up silent renew"),v.startSilentRenew()),v.settings.monitorSession&&(n.Log.debug("UserManager.ctor: monitorSession is configured, setting up session monitor"),v._sessionMonitor=new o(v)),v._tokenRevocationClient=new a(v._settings),v._tokenClient=new f(v._settings),v._joseUtil=m,v}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,t),e.prototype.getUser=function(){var t=this;return this._loadUser().then((function(e){return e?(n.Log.info("UserManager.getUser: user loaded"),t._events.load(e,!1),e):(n.Log.info("UserManager.getUser: user not found in storage"),null)}))},e.prototype.removeUser=function(){var t=this;return this.storeUser(null).then((function(){n.Log.info("UserManager.removeUser: user removed from storage"),t._events.unload()}))},e.prototype.signinRedirect=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};(t=Object.assign({},t)).request_type="si:r";var e={useReplaceToNavigate:t.useReplaceToNavigate};return this._signinStart(t,this._redirectNavigator,e).then((function(){n.Log.info("UserManager.signinRedirect: successful")}))},e.prototype.signinRedirectCallback=function(t){return this._signinEnd(t||this._redirectNavigator.url).then((function(t){return t.profile&&t.profile.sub?n.Log.info("UserManager.signinRedirectCallback: successful, signed in sub: ",t.profile.sub):n.Log.info("UserManager.signinRedirectCallback: no sub"),t}))},e.prototype.signinPopup=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};(t=Object.assign({},t)).request_type="si:p";var e=t.redirect_uri||this.settings.popup_redirect_uri||this.settings.redirect_uri;return e?(t.redirect_uri=e,t.display="popup",this._signin(t,this._popupNavigator,{startUrl:e,popupWindowFeatures:t.popupWindowFeatures||this.settings.popupWindowFeatures,popupWindowTarget:t.popupWindowTarget||this.settings.popupWindowTarget}).then((function(t){return t&&(t.profile&&t.profile.sub?n.Log.info("UserManager.signinPopup: signinPopup successful, signed in sub: ",t.profile.sub):n.Log.info("UserManager.signinPopup: no sub")),t}))):(n.Log.error("UserManager.signinPopup: No popup_redirect_uri or redirect_uri configured"),Promise.reject(new Error("No popup_redirect_uri or redirect_uri configured")))},e.prototype.signinPopupCallback=function(t){return this._signinCallback(t,this._popupNavigator).then((function(t){return t&&(t.profile&&t.profile.sub?n.Log.info("UserManager.signinPopupCallback: successful, signed in sub: ",t.profile.sub):n.Log.info("UserManager.signinPopupCallback: no sub")),t})).catch((function(t){n.Log.error(t.message)}))},e.prototype.signinSilent=function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return e=Object.assign({},e),this._loadUser().then((function(r){return r&&r.refresh_token?(e.refresh_token=r.refresh_token,t._useRefreshToken(e)):(e.request_type="si:s",e.id_token_hint=e.id_token_hint||t.settings.includeIdTokenInSilentRenew&&r&&r.id_token,r&&t._settings.validateSubOnSilentRenew&&(n.Log.debug("UserManager.signinSilent, subject prior to silent renew: ",r.profile.sub),e.current_sub=r.profile.sub),t._signinSilentIframe(e))}))},e.prototype._useRefreshToken=function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this._tokenClient.exchangeRefreshToken(e).then((function(e){return e?e.access_token?t._loadUser().then((function(r){if(r){var i=Promise.resolve();return e.id_token&&(i=t._validateIdTokenFromTokenRefreshToken(r.profile,e.id_token)),i.then((function(){return n.Log.debug("UserManager._useRefreshToken: refresh token response success"),r.id_token=e.id_token||r.id_token,r.access_token=e.access_token,r.refresh_token=e.refresh_token||r.refresh_token,r.expires_in=e.expires_in,t.storeUser(r).then((function(){return t._events.load(r),r}))}))}return null})):(n.Log.error("UserManager._useRefreshToken: No access token returned from token endpoint"),Promise.reject("No access token returned from token endpoint")):(n.Log.error("UserManager._useRefreshToken: No response returned from token endpoint"),Promise.reject("No response returned from token endpoint"))}))},e.prototype._validateIdTokenFromTokenRefreshToken=function(t,e){var r=this;return this._metadataService.getIssuer().then((function(i){return r.settings.getEpochTime().then((function(o){return r._joseUtil.validateJwtAttributes(e,i,r._settings.client_id,r._settings.clockSkew,o).then((function(e){return e?e.sub!==t.sub?(n.Log.error("UserManager._validateIdTokenFromTokenRefreshToken: sub in id_token does not match current sub"),Promise.reject(new Error("sub in id_token does not match current sub"))):e.auth_time&&e.auth_time!==t.auth_time?(n.Log.error("UserManager._validateIdTokenFromTokenRefreshToken: auth_time in id_token does not match original auth_time"),Promise.reject(new Error("auth_time in id_token does not match original auth_time"))):e.azp&&e.azp!==t.azp?(n.Log.error("UserManager._validateIdTokenFromTokenRefreshToken: azp in id_token does not match original azp"),Promise.reject(new Error("azp in id_token does not match original azp"))):!e.azp&&t.azp?(n.Log.error("UserManager._validateIdTokenFromTokenRefreshToken: azp not in id_token, but present in original id_token"),Promise.reject(new Error("azp not in id_token, but present in original id_token"))):void 0:(n.Log.error("UserManager._validateIdTokenFromTokenRefreshToken: Failed to validate id_token"),Promise.reject(new Error("Failed to validate id_token")))}))}))}))},e.prototype._signinSilentIframe=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.redirect_uri||this.settings.silent_redirect_uri||this.settings.redirect_uri;return e?(t.redirect_uri=e,t.prompt=t.prompt||"none",this._signin(t,this._iframeNavigator,{startUrl:e,silentRequestTimeout:t.silentRequestTimeout||this.settings.silentRequestTimeout}).then((function(t){return t&&(t.profile&&t.profile.sub?n.Log.info("UserManager.signinSilent: successful, signed in sub: ",t.profile.sub):n.Log.info("UserManager.signinSilent: no sub")),t}))):(n.Log.error("UserManager.signinSilent: No silent_redirect_uri configured"),Promise.reject(new Error("No silent_redirect_uri configured")))},e.prototype.signinSilentCallback=function(t){return this._signinCallback(t,this._iframeNavigator).then((function(t){return t&&(t.profile&&t.profile.sub?n.Log.info("UserManager.signinSilentCallback: successful, signed in sub: ",t.profile.sub):n.Log.info("UserManager.signinSilentCallback: no sub")),t}))},e.prototype.signinCallback=function(t){var e=this;return this.readSigninResponseState(t).then((function(r){var i=r.state;return r.response,"si:r"===i.request_type?e.signinRedirectCallback(t):"si:p"===i.request_type?e.signinPopupCallback(t):"si:s"===i.request_type?e.signinSilentCallback(t):Promise.reject(new Error("invalid response_type in state"))}))},e.prototype.signoutCallback=function(t,e){var r=this;return this.readSignoutResponseState(t).then((function(i){var n=i.state,o=i.response;return n?"so:r"===n.request_type?r.signoutRedirectCallback(t):"so:p"===n.request_type?r.signoutPopupCallback(t,e):Promise.reject(new Error("invalid response_type in state")):o}))},e.prototype.querySessionStatus=function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};(e=Object.assign({},e)).request_type="si:s";var r=e.redirect_uri||this.settings.silent_redirect_uri||this.settings.redirect_uri;return r?(e.redirect_uri=r,e.prompt="none",e.response_type=e.response_type||this.settings.query_status_response_type,e.scope=e.scope||"openid",e.skipUserInfo=!0,this._signinStart(e,this._iframeNavigator,{startUrl:r,silentRequestTimeout:e.silentRequestTimeout||this.settings.silentRequestTimeout}).then((function(e){return t.processSigninResponse(e.url).then((function(t){if(n.Log.debug("UserManager.querySessionStatus: got signin response"),t.session_state&&t.profile.sub)return n.Log.info("UserManager.querySessionStatus: querySessionStatus success for sub: ",t.profile.sub),{session_state:t.session_state,sub:t.profile.sub,sid:t.profile.sid};n.Log.info("querySessionStatus successful, user not authenticated")})).catch((function(e){if(e.session_state&&t.settings.monitorAnonymousSession&&("login_required"==e.message||"consent_required"==e.message||"interaction_required"==e.message||"account_selection_required"==e.message))return n.Log.info("UserManager.querySessionStatus: querySessionStatus success for anonymous user"),{session_state:e.session_state};throw e}))}))):(n.Log.error("UserManager.querySessionStatus: No silent_redirect_uri configured"),Promise.reject(new Error("No silent_redirect_uri configured")))},e.prototype._signin=function(t,e){var r=this,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this._signinStart(t,e,i).then((function(e){return r._signinEnd(e.url,t)}))},e.prototype._signinStart=function(t,e){var r=this,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return e.prepare(i).then((function(e){return n.Log.debug("UserManager._signinStart: got navigator window handle"),r.createSigninRequest(t).then((function(t){return n.Log.debug("UserManager._signinStart: got signin request"),i.url=t.url,i.id=t.state.id,e.navigate(i)})).catch((function(t){throw e.close&&(n.Log.debug("UserManager._signinStart: Error after preparing navigator, closing navigator window"),e.close()),t}))}))},e.prototype._signinEnd=function(t){var e=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.processSigninResponse(t).then((function(t){n.Log.debug("UserManager._signinEnd: got signin response");var i=new a.User(t);if(r.current_sub){if(r.current_sub!==i.profile.sub)return n.Log.debug("UserManager._signinEnd: current user does not match user returned from signin. sub from signin: ",i.profile.sub),Promise.reject(new Error("login_required"));n.Log.debug("UserManager._signinEnd: current user matches user returned from signin")}return e.storeUser(i).then((function(){return n.Log.debug("UserManager._signinEnd: user stored"),e._events.load(i),i}))}))},e.prototype._signinCallback=function(t,e){n.Log.debug("UserManager._signinCallback");var r="query"===this._settings.response_mode||!this._settings.response_mode&&f.SigninRequest.isCode(this._settings.response_type)?"?":"#";return e.callback(t,void 0,r)},e.prototype.signoutRedirect=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};(t=Object.assign({},t)).request_type="so:r";var e=t.post_logout_redirect_uri||this.settings.post_logout_redirect_uri;e&&(t.post_logout_redirect_uri=e);var r={useReplaceToNavigate:t.useReplaceToNavigate};return this._signoutStart(t,this._redirectNavigator,r).then((function(){n.Log.info("UserManager.signoutRedirect: successful")}))},e.prototype.signoutRedirectCallback=function(t){return this._signoutEnd(t||this._redirectNavigator.url).then((function(t){return n.Log.info("UserManager.signoutRedirectCallback: successful"),t}))},e.prototype.signoutPopup=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};(t=Object.assign({},t)).request_type="so:p";var e=t.post_logout_redirect_uri||this.settings.popup_post_logout_redirect_uri||this.settings.post_logout_redirect_uri;return t.post_logout_redirect_uri=e,t.display="popup",t.post_logout_redirect_uri&&(t.state=t.state||{}),this._signout(t,this._popupNavigator,{startUrl:e,popupWindowFeatures:t.popupWindowFeatures||this.settings.popupWindowFeatures,popupWindowTarget:t.popupWindowTarget||this.settings.popupWindowTarget}).then((function(){n.Log.info("UserManager.signoutPopup: successful")}))},e.prototype.signoutPopupCallback=function(t,e){return void 0===e&&"boolean"==typeof t&&(e=t,t=null),this._popupNavigator.callback(t,e,"?").then((function(){n.Log.info("UserManager.signoutPopupCallback: successful")}))},e.prototype._signout=function(t,e){var r=this,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this._signoutStart(t,e,i).then((function(t){return r._signoutEnd(t.url)}))},e.prototype._signoutStart=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=this,r=arguments[1],i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return r.prepare(i).then((function(r){return n.Log.debug("UserManager._signoutStart: got navigator window handle"),e._loadUser().then((function(o){return n.Log.debug("UserManager._signoutStart: loaded current user from storage"),(e._settings.revokeAccessTokenOnSignout?e._revokeInternal(o):Promise.resolve()).then((function(){var s=t.id_token_hint||o&&o.id_token;return s&&(n.Log.debug("UserManager._signoutStart: Setting id_token into signout request"),t.id_token_hint=s),e.removeUser().then((function(){return n.Log.debug("UserManager._signoutStart: user removed, creating signout request"),e.createSignoutRequest(t).then((function(t){return n.Log.debug("UserManager._signoutStart: got signout request"),i.url=t.url,t.state&&(i.id=t.state.id),r.navigate(i)}))}))}))})).catch((function(t){throw r.close&&(n.Log.debug("UserManager._signoutStart: Error after preparing navigator, closing navigator window"),r.close()),t}))}))},e.prototype._signoutEnd=function(t){return this.processSignoutResponse(t).then((function(t){return n.Log.debug("UserManager._signoutEnd: got signout response"),t}))},e.prototype.revokeAccessToken=function(){var t=this;return this._loadUser().then((function(e){return t._revokeInternal(e,!0).then((function(r){if(r)return n.Log.debug("UserManager.revokeAccessToken: removing token properties from user and re-storing"),e.access_token=null,e.refresh_token=null,e.expires_at=null,e.token_type=null,t.storeUser(e).then((function(){n.Log.debug("UserManager.revokeAccessToken: user stored"),t._events.load(e)}))}))})).then((function(){n.Log.info("UserManager.revokeAccessToken: access token revoked successfully")}))},e.prototype._revokeInternal=function(t,e){var r=this;if(t){var i=t.access_token,o=t.refresh_token;return this._revokeAccessTokenInternal(i,e).then((function(t){return r._revokeRefreshTokenInternal(o,e).then((function(e){return t||e||n.Log.debug("UserManager.revokeAccessToken: no need to revoke due to no token(s), or JWT format"),t||e}))}))}return Promise.resolve(!1)},e.prototype._revokeAccessTokenInternal=function(t,e){return!t||t.indexOf(".")>=0?Promise.resolve(!1):this._tokenRevocationClient.revoke(t,e).then((function(){return!0}))},e.prototype._revokeRefreshTokenInternal=function(t,e){return t?this._tokenRevocationClient.revoke(t,e,"refresh_token").then((function(){return!0})):Promise.resolve(!1)},e.prototype.startSilentRenew=function(){this._silentRenewService.start()},e.prototype.stopSilentRenew=function(){this._silentRenewService.stop()},e.prototype._loadUser=function(){return this._userStore.get(this._userStoreKey).then((function(t){return t?(n.Log.debug("UserManager._loadUser: user storageString loaded"),a.User.fromStorageString(t)):(n.Log.debug("UserManager._loadUser: no user storageString"),null)}))},e.prototype.storeUser=function(t){if(t){n.Log.debug("UserManager.storeUser: storing user");var e=t.toStorageString();return this._userStore.set(this._userStoreKey,e)}return n.Log.debug("storeUser.storeUser: removing user"),this._userStore.remove(this._userStoreKey)},i(e,[{key:"_redirectNavigator",get:function(){return this.settings.redirectNavigator}},{key:"_popupNavigator",get:function(){return this.settings.popupNavigator}},{key:"_iframeNavigator",get:function(){return this.settings.iframeNavigator}},{key:"_userStore",get:function(){return this.settings.userStore}},{key:"events",get:function(){return this._events}},{key:"_userStoreKey",get:function(){return"user:"+this.settings.authority+":"+this.settings.client_id}}]),e}(o.OidcClient)},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.UserManagerSettings=void 0;var i=function(){function t(t,e){for(var r=0;r<e.length;r++){var i=e[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,r,i){return r&&t(e.prototype,r),i&&t(e,i),e}}(),n=(r(0),r(5)),o=r(40),s=r(41),a=r(43),u=r(6),h=r(1),c=r(8);function f(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function l(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}e.UserManagerSettings=function(t){function e(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=r.popup_redirect_uri,n=r.popup_post_logout_redirect_uri,d=r.popupWindowFeatures,p=r.popupWindowTarget,g=r.silent_redirect_uri,y=r.silentRequestTimeout,m=r.automaticSilentRenew,v=void 0!==m&&m,b=r.validateSubOnSilentRenew,w=void 0!==b&&b,_=r.includeIdTokenInSilentRenew,S=void 0===_||_,E=r.monitorSession,M=void 0===E||E,A=r.monitorAnonymousSession,C=void 0!==A&&A,k=r.checkSessionInterval,I=void 0===k?2e3:k,T=r.stopCheckSessionOnError,R=void 0===T||T,B=r.query_status_response_type,x=r.revokeAccessTokenOnSignout,F=void 0!==x&&x,P=r.accessTokenExpiringNotificationTime,N=void 0===P?60:P,O=r.redirectNavigator,L=void 0===O?new o.RedirectNavigator:O,U=r.popupNavigator,j=void 0===U?new s.PopupNavigator:U,D=r.iframeNavigator,K=void 0===D?new a.IFrameNavigator:D,V=r.userStore,H=void 0===V?new u.WebStorageStateStore({store:h.Global.sessionStorage}):V;f(this,e);var q=l(this,t.call(this,arguments[0]));return q._popup_redirect_uri=i,q._popup_post_logout_redirect_uri=n,q._popupWindowFeatures=d,q._popupWindowTarget=p,q._silent_redirect_uri=g,q._silentRequestTimeout=y,q._automaticSilentRenew=v,q._validateSubOnSilentRenew=w,q._includeIdTokenInSilentRenew=S,q._accessTokenExpiringNotificationTime=N,q._monitorSession=M,q._monitorAnonymousSession=C,q._checkSessionInterval=I,q._stopCheckSessionOnError=R,B?q._query_status_response_type=B:arguments[0]&&arguments[0].response_type?q._query_status_response_type=c.SigninRequest.isOidc(arguments[0].response_type)?"id_token":"code":q._query_status_response_type="id_token",q._revokeAccessTokenOnSignout=F,q._redirectNavigator=L,q._popupNavigator=j,q._iframeNavigator=K,q._userStore=H,q}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,t),i(e,[{key:"popup_redirect_uri",get:function(){return this._popup_redirect_uri}},{key:"popup_post_logout_redirect_uri",get:function(){return this._popup_post_logout_redirect_uri}},{key:"popupWindowFeatures",get:function(){return this._popupWindowFeatures}},{key:"popupWindowTarget",get:function(){return this._popupWindowTarget}},{key:"silent_redirect_uri",get:function(){return this._silent_redirect_uri}},{key:"silentRequestTimeout",get:function(){return this._silentRequestTimeout}},{key:"automaticSilentRenew",get:function(){return this._automaticSilentRenew}},{key:"validateSubOnSilentRenew",get:function(){return this._validateSubOnSilentRenew}},{key:"includeIdTokenInSilentRenew",get:function(){return this._includeIdTokenInSilentRenew}},{key:"accessTokenExpiringNotificationTime",get:function(){return this._accessTokenExpiringNotificationTime}},{key:"monitorSession",get:function(){return this._monitorSession}},{key:"monitorAnonymousSession",get:function(){return this._monitorAnonymousSession}},{key:"checkSessionInterval",get:function(){return this._checkSessionInterval}},{key:"stopCheckSessionOnError",get:function(){return this._stopCheckSessionOnError}},{key:"query_status_response_type",get:function(){return this._query_status_response_type}},{key:"revokeAccessTokenOnSignout",get:function(){return this._revokeAccessTokenOnSignout}},{key:"redirectNavigator",get:function(){return this._redirectNavigator}},{key:"popupNavigator",get:function(){return this._popupNavigator}},{key:"iframeNavigator",get:function(){return this._iframeNavigator}},{key:"userStore",get:function(){return this._userStore}}]),e}(n.OidcClientSettings)},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.RedirectNavigator=void 0;var i=function(){function t(t,e){for(var r=0;r<e.length;r++){var i=e[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,r,i){return r&&t(e.prototype,r),i&&t(e,i),e}}(),n=r(0);e.RedirectNavigator=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)}return t.prototype.prepare=function(){return Promise.resolve(this)},t.prototype.navigate=function(t){return t&&t.url?(t.useReplaceToNavigate?window.location.replace(t.url):window.location=t.url,Promise.resolve()):(n.Log.error("RedirectNavigator.navigate: No url provided"),Promise.reject(new Error("No url provided")))},i(t,[{key:"url",get:function(){return window.location.href}}]),t}()},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.PopupNavigator=void 0;var i=r(0),n=r(42);e.PopupNavigator=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)}return t.prototype.prepare=function(t){var e=new n.PopupWindow(t);return Promise.resolve(e)},t.prototype.callback=function t(e,r,o){i.Log.debug("PopupNavigator.callback");try{return n.PopupWindow.notifyOpener(e,r,o),Promise.resolve()}catch(t){return Promise.reject(t)}},t}()},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.PopupWindow=void 0;var i=function(){function t(t,e){for(var r=0;r<e.length;r++){var i=e[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,r,i){return r&&t(e.prototype,r),i&&t(e,i),e}}(),n=r(0),o=r(3);e.PopupWindow=function(){function t(e){var r=this;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this._promise=new Promise((function(t,e){r._resolve=t,r._reject=e}));var i=e.popupWindowTarget||"_blank",o=e.popupWindowFeatures||"location=no,toolbar=no,width=500,height=500,left=100,top=100;";this._popup=window.open("",i,o),this._popup&&(n.Log.debug("PopupWindow.ctor: popup successfully created"),this._checkForPopupClosedTimer=window.setInterval(this._checkForPopupClosed.bind(this),500))}return t.prototype.navigate=function(t){return this._popup?t&&t.url?(n.Log.debug("PopupWindow.navigate: Setting URL in popup"),this._id=t.id,this._id&&(window["popupCallback_"+t.id]=this._callback.bind(this)),this._popup.focus(),this._popup.window.location=t.url):(this._error("PopupWindow.navigate: no url provided"),this._error("No url provided")):this._error("PopupWindow.navigate: Error opening popup window"),this.promise},t.prototype._success=function(t){n.Log.debug("PopupWindow.callback: Successful response from popup window"),this._cleanup(),this._resolve(t)},t.prototype._error=function(t){n.Log.error("PopupWindow.error: ",t),this._cleanup(),this._reject(new Error(t))},t.prototype.close=function(){this._cleanup(!1)},t.prototype._cleanup=function(t){n.Log.debug("PopupWindow.cleanup"),window.clearInterval(this._checkForPopupClosedTimer),this._checkForPopupClosedTimer=null,delete window["popupCallback_"+this._id],this._popup&&!t&&this._popup.close(),this._popup=null},t.prototype._checkForPopupClosed=function(){this._popup&&!this._popup.closed||this._error("Popup window closed")},t.prototype._callback=function(t,e){this._cleanup(e),t?(n.Log.debug("PopupWindow.callback success"),this._success({url:t})):(n.Log.debug("PopupWindow.callback: Invalid response from popup"),this._error("Invalid response from popup"))},t.notifyOpener=function(t,e,r){if(window.opener){if(t=t||window.location.href){var i=o.UrlUtility.parseUrlFragment(t,r);if(i.state){var s="popupCallback_"+i.state,a=window.opener[s];a?(n.Log.debug("PopupWindow.notifyOpener: passing url message to opener"),a(t,e)):n.Log.warn("PopupWindow.notifyOpener: no matching callback found on opener")}else n.Log.warn("PopupWindow.notifyOpener: no state found in response url")}}else n.Log.warn("PopupWindow.notifyOpener: no window.opener. Can't complete notification.")},i(t,[{key:"promise",get:function(){return this._promise}}]),t}()},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.IFrameNavigator=void 0;var i=r(0),n=r(44);e.IFrameNavigator=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)}return t.prototype.prepare=function(t){var e=new n.IFrameWindow(t);return Promise.resolve(e)},t.prototype.callback=function t(e){i.Log.debug("IFrameNavigator.callback");try{return n.IFrameWindow.notifyParent(e),Promise.resolve()}catch(t){return Promise.reject(t)}},t}()},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.IFrameWindow=void 0;var i=function(){function t(t,e){for(var r=0;r<e.length;r++){var i=e[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,r,i){return r&&t(e.prototype,r),i&&t(e,i),e}}(),n=r(0);e.IFrameWindow=function(){function t(e){var r=this;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this._promise=new Promise((function(t,e){r._resolve=t,r._reject=e})),this._boundMessageEvent=this._message.bind(this),window.addEventListener("message",this._boundMessageEvent,!1),this._frame=window.document.createElement("iframe"),this._frame.style.visibility="hidden",this._frame.style.position="absolute",this._frame.width=0,this._frame.height=0,window.document.body.appendChild(this._frame)}return t.prototype.navigate=function(t){if(t&&t.url){var e=t.silentRequestTimeout||1e4;n.Log.debug("IFrameWindow.navigate: Using timeout of:",e),this._timer=window.setTimeout(this._timeout.bind(this),e),this._frame.src=t.url}else this._error("No url provided");return this.promise},t.prototype._success=function(t){this._cleanup(),n.Log.debug("IFrameWindow: Successful response from frame window"),this._resolve(t)},t.prototype._error=function(t){this._cleanup(),n.Log.error(t),this._reject(new Error(t))},t.prototype.close=function(){this._cleanup()},t.prototype._cleanup=function(){this._frame&&(n.Log.debug("IFrameWindow: cleanup"),window.removeEventListener("message",this._boundMessageEvent,!1),window.clearTimeout(this._timer),window.document.body.removeChild(this._frame),this._timer=null,this._frame=null,this._boundMessageEvent=null)},t.prototype._timeout=function(){n.Log.debug("IFrameWindow.timeout"),this._error("Frame window timed out")},t.prototype._message=function(t){if(n.Log.debug("IFrameWindow.message"),this._timer&&t.origin===this._origin&&t.source===this._frame.contentWindow&&"string"==typeof t.data&&(t.data.startsWith("http://")||t.data.startsWith("https://"))){var e=t.data;e?this._success({url:e}):this._error("Invalid response from frame")}},t.notifyParent=function(t){n.Log.debug("IFrameWindow.notifyParent"),(t=t||window.location.href)&&(n.Log.debug("IFrameWindow.notifyParent: posting url message to parent"),window.parent.postMessage(t,location.protocol+"//"+location.host))},i(t,[{key:"promise",get:function(){return this._promise}},{key:"_origin",get:function(){return location.protocol+"//"+location.host}}]),t}()},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.UserManagerEvents=void 0;var i=r(0),n=r(16),o=r(17);e.UserManagerEvents=function(t){function e(r){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var i=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,t.call(this,r));return i._userLoaded=new o.Event("User loaded"),i._userUnloaded=new o.Event("User unloaded"),i._silentRenewError=new o.Event("Silent renew error"),i._userSignedIn=new o.Event("User signed in"),i._userSignedOut=new o.Event("User signed out"),i._userSessionChanged=new o.Event("User session changed"),i}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,t),e.prototype.load=function(e){var r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];i.Log.debug("UserManagerEvents.load"),t.prototype.load.call(this,e),r&&this._userLoaded.raise(e)},e.prototype.unload=function(){i.Log.debug("UserManagerEvents.unload"),t.prototype.unload.call(this),this._userUnloaded.raise()},e.prototype.addUserLoaded=function(t){this._userLoaded.addHandler(t)},e.prototype.removeUserLoaded=function(t){this._userLoaded.removeHandler(t)},e.prototype.addUserUnloaded=function(t){this._userUnloaded.addHandler(t)},e.prototype.removeUserUnloaded=function(t){this._userUnloaded.removeHandler(t)},e.prototype.addSilentRenewError=function(t){this._silentRenewError.addHandler(t)},e.prototype.removeSilentRenewError=function(t){this._silentRenewError.removeHandler(t)},e.prototype._raiseSilentRenewError=function(t){i.Log.debug("UserManagerEvents._raiseSilentRenewError",t.message),this._silentRenewError.raise(t)},e.prototype.addUserSignedIn=function(t){this._userSignedIn.addHandler(t)},e.prototype.removeUserSignedIn=function(t){this._userSignedIn.removeHandler(t)},e.prototype._raiseUserSignedIn=function(){i.Log.debug("UserManagerEvents._raiseUserSignedIn"),this._userSignedIn.raise()},e.prototype.addUserSignedOut=function(t){this._userSignedOut.addHandler(t)},e.prototype.removeUserSignedOut=function(t){this._userSignedOut.removeHandler(t)},e.prototype._raiseUserSignedOut=function(){i.Log.debug("UserManagerEvents._raiseUserSignedOut"),this._userSignedOut.raise()},e.prototype.addUserSessionChanged=function(t){this._userSessionChanged.addHandler(t)},e.prototype.removeUserSessionChanged=function(t){this._userSessionChanged.removeHandler(t)},e.prototype._raiseUserSessionChanged=function(){i.Log.debug("UserManagerEvents._raiseUserSessionChanged"),this._userSessionChanged.raise()},e}(n.AccessTokenEvents)},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Timer=void 0;var i=function(){function t(t,e){for(var r=0;r<e.length;r++){var i=e[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,r,i){return r&&t(e.prototype,r),i&&t(e,i),e}}(),n=r(0),o=r(1),s=r(17);function a(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function u(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}e.Timer=function(t){function e(r){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:o.Global.timer,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0;a(this,e);var s=u(this,t.call(this,r));return s._timer=i,s._nowFunc=n||function(){return Date.now()/1e3},s}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,t),e.prototype.init=function(t){t<=0&&(t=1),t=parseInt(t);var e=this.now+t;if(this.expiration===e&&this._timerHandle)n.Log.debug("Timer.init timer "+this._name+" skipping initialization since already initialized for expiration:",this.expiration);else{this.cancel(),n.Log.debug("Timer.init timer "+this._name+" for duration:",t),this._expiration=e;var r=5;t<r&&(r=t),this._timerHandle=this._timer.setInterval(this._callback.bind(this),1e3*r)}},e.prototype.cancel=function(){this._timerHandle&&(n.Log.debug("Timer.cancel: ",this._name),this._timer.clearInterval(this._timerHandle),this._timerHandle=null)},e.prototype._callback=function(){var e=this._expiration-this.now;n.Log.debug("Timer.callback; "+this._name+" timer expires in:",e),this._expiration<=this.now&&(this.cancel(),t.prototype.raise.call(this))},i(e,[{key:"now",get:function(){return parseInt(this._nowFunc())}},{key:"expiration",get:function(){return this._expiration}}]),e}(s.Event)},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.SilentRenewService=void 0;var i=r(0);e.SilentRenewService=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this._userManager=e}return t.prototype.start=function(){this._callback||(this._callback=this._tokenExpiring.bind(this),this._userManager.events.addAccessTokenExpiring(this._callback),this._userManager.getUser().then((function(t){})).catch((function(t){i.Log.error("SilentRenewService.start: Error from getUser:",t.message)})))},t.prototype.stop=function(){this._callback&&(this._userManager.events.removeAccessTokenExpiring(this._callback),delete this._callback)},t.prototype._tokenExpiring=function(){var t=this;this._userManager.signinSilent().then((function(t){i.Log.debug("SilentRenewService._tokenExpiring: Silent token renewal successful")}),(function(e){i.Log.error("SilentRenewService._tokenExpiring: Error from signinSilent:",e.message),t._userManager.events._raiseSilentRenewError(e)}))},t}()},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.CordovaPopupNavigator=void 0;var i=r(21);e.CordovaPopupNavigator=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)}return t.prototype.prepare=function(t){var e=new i.CordovaPopupWindow(t);return Promise.resolve(e)},t}()},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.CordovaIFrameNavigator=void 0;var i=r(21);e.CordovaIFrameNavigator=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)}return t.prototype.prepare=function(t){t.popupWindowFeatures="hidden=yes";var e=new i.CordovaPopupWindow(t);return Promise.resolve(e)},t}()},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Version="1.11.5"}])},t.exports=e()},99591:(t,e,r)=>{"use strict";var i={};(0,r(24236).assign)(i,r(24555),r(78843),r(71619)),t.exports=i},24555:(t,e,r)=>{"use strict";var i=r(30405),n=r(24236),o=r(29373),s=r(48898),a=r(62292),u=Object.prototype.toString;function h(t){if(!(this instanceof h))return new h(t);this.options=n.assign({level:-1,method:8,chunkSize:16384,windowBits:15,memLevel:8,strategy:0,to:""},t||{});var e=this.options;e.raw&&e.windowBits>0?e.windowBits=-e.windowBits:e.gzip&&e.windowBits>0&&e.windowBits<16&&(e.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new a,this.strm.avail_out=0;var r=i.deflateInit2(this.strm,e.level,e.method,e.windowBits,e.memLevel,e.strategy);if(0!==r)throw new Error(s[r]);if(e.header&&i.deflateSetHeader(this.strm,e.header),e.dictionary){var c;if(c="string"==typeof e.dictionary?o.string2buf(e.dictionary):"[object ArrayBuffer]"===u.call(e.dictionary)?new Uint8Array(e.dictionary):e.dictionary,0!==(r=i.deflateSetDictionary(this.strm,c)))throw new Error(s[r]);this._dict_set=!0}}function c(t,e){var r=new h(e);if(r.push(t,!0),r.err)throw r.msg||s[r.err];return r.result}h.prototype.push=function(t,e){var r,s,a=this.strm,h=this.options.chunkSize;if(this.ended)return!1;s=e===~~e?e:!0===e?4:0,"string"==typeof t?a.input=o.string2buf(t):"[object ArrayBuffer]"===u.call(t)?a.input=new Uint8Array(t):a.input=t,a.next_in=0,a.avail_in=a.input.length;do{if(0===a.avail_out&&(a.output=new n.Buf8(h),a.next_out=0,a.avail_out=h),1!==(r=i.deflate(a,s))&&0!==r)return this.onEnd(r),this.ended=!0,!1;0!==a.avail_out&&(0!==a.avail_in||4!==s&&2!==s)||("string"===this.options.to?this.onData(o.buf2binstring(n.shrinkBuf(a.output,a.next_out))):this.onData(n.shrinkBuf(a.output,a.next_out)))}while((a.avail_in>0||0===a.avail_out)&&1!==r);return 4===s?(r=i.deflateEnd(this.strm),this.onEnd(r),this.ended=!0,0===r):2!==s||(this.onEnd(0),a.avail_out=0,!0)},h.prototype.onData=function(t){this.chunks.push(t)},h.prototype.onEnd=function(t){0===t&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=n.flattenChunks(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg},e.Deflate=h,e.deflate=c,e.deflateRaw=function(t,e){return(e=e||{}).raw=!0,c(t,e)},e.gzip=function(t,e){return(e=e||{}).gzip=!0,c(t,e)}},78843:(t,e,r)=>{"use strict";var i=r(27948),n=r(24236),o=r(29373),s=r(71619),a=r(48898),u=r(62292),h=r(42401),c=Object.prototype.toString;function f(t){if(!(this instanceof f))return new f(t);this.options=n.assign({chunkSize:16384,windowBits:0,to:""},t||{});var e=this.options;e.raw&&e.windowBits>=0&&e.windowBits<16&&(e.windowBits=-e.windowBits,0===e.windowBits&&(e.windowBits=-15)),!(e.windowBits>=0&&e.windowBits<16)||t&&t.windowBits||(e.windowBits+=32),e.windowBits>15&&e.windowBits<48&&0==(15&e.windowBits)&&(e.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new u,this.strm.avail_out=0;var r=i.inflateInit2(this.strm,e.windowBits);if(r!==s.Z_OK)throw new Error(a[r]);if(this.header=new h,i.inflateGetHeader(this.strm,this.header),e.dictionary&&("string"==typeof e.dictionary?e.dictionary=o.string2buf(e.dictionary):"[object ArrayBuffer]"===c.call(e.dictionary)&&(e.dictionary=new Uint8Array(e.dictionary)),e.raw&&(r=i.inflateSetDictionary(this.strm,e.dictionary))!==s.Z_OK))throw new Error(a[r])}function l(t,e){var r=new f(e);if(r.push(t,!0),r.err)throw r.msg||a[r.err];return r.result}f.prototype.push=function(t,e){var r,a,u,h,f,l=this.strm,d=this.options.chunkSize,p=this.options.dictionary,g=!1;if(this.ended)return!1;a=e===~~e?e:!0===e?s.Z_FINISH:s.Z_NO_FLUSH,"string"==typeof t?l.input=o.binstring2buf(t):"[object ArrayBuffer]"===c.call(t)?l.input=new Uint8Array(t):l.input=t,l.next_in=0,l.avail_in=l.input.length;do{if(0===l.avail_out&&(l.output=new n.Buf8(d),l.next_out=0,l.avail_out=d),(r=i.inflate(l,s.Z_NO_FLUSH))===s.Z_NEED_DICT&&p&&(r=i.inflateSetDictionary(this.strm,p)),r===s.Z_BUF_ERROR&&!0===g&&(r=s.Z_OK,g=!1),r!==s.Z_STREAM_END&&r!==s.Z_OK)return this.onEnd(r),this.ended=!0,!1;l.next_out&&(0!==l.avail_out&&r!==s.Z_STREAM_END&&(0!==l.avail_in||a!==s.Z_FINISH&&a!==s.Z_SYNC_FLUSH)||("string"===this.options.to?(u=o.utf8border(l.output,l.next_out),h=l.next_out-u,f=o.buf2string(l.output,u),l.next_out=h,l.avail_out=d-h,h&&n.arraySet(l.output,l.output,u,h,0),this.onData(f)):this.onData(n.shrinkBuf(l.output,l.next_out)))),0===l.avail_in&&0===l.avail_out&&(g=!0)}while((l.avail_in>0||0===l.avail_out)&&r!==s.Z_STREAM_END);return r===s.Z_STREAM_END&&(a=s.Z_FINISH),a===s.Z_FINISH?(r=i.inflateEnd(this.strm),this.onEnd(r),this.ended=!0,r===s.Z_OK):a!==s.Z_SYNC_FLUSH||(this.onEnd(s.Z_OK),l.avail_out=0,!0)},f.prototype.onData=function(t){this.chunks.push(t)},f.prototype.onEnd=function(t){t===s.Z_OK&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=n.flattenChunks(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg},e.Inflate=f,e.inflate=l,e.inflateRaw=function(t,e){return(e=e||{}).raw=!0,l(t,e)},e.ungzip=l},24236:(t,e)=>{"use strict";var r="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Int32Array;function i(t,e){return Object.prototype.hasOwnProperty.call(t,e)}e.assign=function(t){for(var e=Array.prototype.slice.call(arguments,1);e.length;){var r=e.shift();if(r){if("object"!=typeof r)throw new TypeError(r+"must be non-object");for(var n in r)i(r,n)&&(t[n]=r[n])}}return t},e.shrinkBuf=function(t,e){return t.length===e?t:t.subarray?t.subarray(0,e):(t.length=e,t)};var n={arraySet:function(t,e,r,i,n){if(e.subarray&&t.subarray)t.set(e.subarray(r,r+i),n);else for(var o=0;o<i;o++)t[n+o]=e[r+o]},flattenChunks:function(t){var e,r,i,n,o,s;for(i=0,e=0,r=t.length;e<r;e++)i+=t[e].length;for(s=new Uint8Array(i),n=0,e=0,r=t.length;e<r;e++)o=t[e],s.set(o,n),n+=o.length;return s}},o={arraySet:function(t,e,r,i,n){for(var o=0;o<i;o++)t[n+o]=e[r+o]},flattenChunks:function(t){return[].concat.apply([],t)}};e.setTyped=function(t){t?(e.Buf8=Uint8Array,e.Buf16=Uint16Array,e.Buf32=Int32Array,e.assign(e,n)):(e.Buf8=Array,e.Buf16=Array,e.Buf32=Array,e.assign(e,o))},e.setTyped(r)},29373:(t,e,r)=>{"use strict";var i=r(24236),n=!0,o=!0;try{String.fromCharCode.apply(null,[0])}catch(t){n=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(t){o=!1}for(var s=new i.Buf8(256),a=0;a<256;a++)s[a]=a>=252?6:a>=248?5:a>=240?4:a>=224?3:a>=192?2:1;function u(t,e){if(e<65534&&(t.subarray&&o||!t.subarray&&n))return String.fromCharCode.apply(null,i.shrinkBuf(t,e));for(var r="",s=0;s<e;s++)r+=String.fromCharCode(t[s]);return r}s[254]=s[254]=1,e.string2buf=function(t){var e,r,n,o,s,a=t.length,u=0;for(o=0;o<a;o++)55296==(64512&(r=t.charCodeAt(o)))&&o+1<a&&56320==(64512&(n=t.charCodeAt(o+1)))&&(r=65536+(r-55296<<10)+(n-56320),o++),u+=r<128?1:r<2048?2:r<65536?3:4;for(e=new i.Buf8(u),s=0,o=0;s<u;o++)55296==(64512&(r=t.charCodeAt(o)))&&o+1<a&&56320==(64512&(n=t.charCodeAt(o+1)))&&(r=65536+(r-55296<<10)+(n-56320),o++),r<128?e[s++]=r:r<2048?(e[s++]=192|r>>>6,e[s++]=128|63&r):r<65536?(e[s++]=224|r>>>12,e[s++]=128|r>>>6&63,e[s++]=128|63&r):(e[s++]=240|r>>>18,e[s++]=128|r>>>12&63,e[s++]=128|r>>>6&63,e[s++]=128|63&r);return e},e.buf2binstring=function(t){return u(t,t.length)},e.binstring2buf=function(t){for(var e=new i.Buf8(t.length),r=0,n=e.length;r<n;r++)e[r]=t.charCodeAt(r);return e},e.buf2string=function(t,e){var r,i,n,o,a=e||t.length,h=new Array(2*a);for(i=0,r=0;r<a;)if((n=t[r++])<128)h[i++]=n;else if((o=s[n])>4)h[i++]=65533,r+=o-1;else{for(n&=2===o?31:3===o?15:7;o>1&&r<a;)n=n<<6|63&t[r++],o--;o>1?h[i++]=65533:n<65536?h[i++]=n:(n-=65536,h[i++]=55296|n>>10&1023,h[i++]=56320|1023&n)}return u(h,i)},e.utf8border=function(t,e){var r;for((e=e||t.length)>t.length&&(e=t.length),r=e-1;r>=0&&128==(192&t[r]);)r--;return r<0||0===r?e:r+s[t[r]]>e?r:e}},66069:t=>{"use strict";t.exports=function(t,e,r,i){for(var n=65535&t|0,o=t>>>16&65535|0,s=0;0!==r;){r-=s=r>2e3?2e3:r;do{o=o+(n=n+e[i++]|0)|0}while(--s);n%=65521,o%=65521}return n|o<<16|0}},71619:t=>{"use strict";t.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}},2869:t=>{"use strict";var e=function(){for(var t,e=[],r=0;r<256;r++){t=r;for(var i=0;i<8;i++)t=1&t?3988292384^t>>>1:t>>>1;e[r]=t}return e}();t.exports=function(t,r,i,n){var o=e,s=n+i;t^=-1;for(var a=n;a<s;a++)t=t>>>8^o[255&(t^r[a])];return-1^t}},30405:(t,e,r)=>{"use strict";var i,n=r(24236),o=r(10342),s=r(66069),a=r(2869),u=r(48898),h=-2,c=258,f=262,l=103,d=113,p=666;function g(t,e){return t.msg=u[e],e}function y(t){return(t<<1)-(t>4?9:0)}function m(t){for(var e=t.length;--e>=0;)t[e]=0}function v(t){var e=t.state,r=e.pending;r>t.avail_out&&(r=t.avail_out),0!==r&&(n.arraySet(t.output,e.pending_buf,e.pending_out,r,t.next_out),t.next_out+=r,e.pending_out+=r,t.total_out+=r,t.avail_out-=r,e.pending-=r,0===e.pending&&(e.pending_out=0))}function b(t,e){o._tr_flush_block(t,t.block_start>=0?t.block_start:-1,t.strstart-t.block_start,e),t.block_start=t.strstart,v(t.strm)}function w(t,e){t.pending_buf[t.pending++]=e}function _(t,e){t.pending_buf[t.pending++]=e>>>8&255,t.pending_buf[t.pending++]=255&e}function S(t,e){var r,i,n=t.max_chain_length,o=t.strstart,s=t.prev_length,a=t.nice_match,u=t.strstart>t.w_size-f?t.strstart-(t.w_size-f):0,h=t.window,l=t.w_mask,d=t.prev,p=t.strstart+c,g=h[o+s-1],y=h[o+s];t.prev_length>=t.good_match&&(n>>=2),a>t.lookahead&&(a=t.lookahead);do{if(h[(r=e)+s]===y&&h[r+s-1]===g&&h[r]===h[o]&&h[++r]===h[o+1]){o+=2,r++;do{}while(h[++o]===h[++r]&&h[++o]===h[++r]&&h[++o]===h[++r]&&h[++o]===h[++r]&&h[++o]===h[++r]&&h[++o]===h[++r]&&h[++o]===h[++r]&&h[++o]===h[++r]&&o<p);if(i=c-(p-o),o=p-c,i>s){if(t.match_start=e,s=i,i>=a)break;g=h[o+s-1],y=h[o+s]}}}while((e=d[e&l])>u&&0!=--n);return s<=t.lookahead?s:t.lookahead}function E(t){var e,r,i,o,u,h,c,l,d,p,g=t.w_size;do{if(o=t.window_size-t.lookahead-t.strstart,t.strstart>=g+(g-f)){n.arraySet(t.window,t.window,g,g,0),t.match_start-=g,t.strstart-=g,t.block_start-=g,e=r=t.hash_size;do{i=t.head[--e],t.head[e]=i>=g?i-g:0}while(--r);e=r=g;do{i=t.prev[--e],t.prev[e]=i>=g?i-g:0}while(--r);o+=g}if(0===t.strm.avail_in)break;if(h=t.strm,c=t.window,l=t.strstart+t.lookahead,d=o,p=void 0,(p=h.avail_in)>d&&(p=d),r=0===p?0:(h.avail_in-=p,n.arraySet(c,h.input,h.next_in,p,l),1===h.state.wrap?h.adler=s(h.adler,c,p,l):2===h.state.wrap&&(h.adler=a(h.adler,c,p,l)),h.next_in+=p,h.total_in+=p,p),t.lookahead+=r,t.lookahead+t.insert>=3)for(u=t.strstart-t.insert,t.ins_h=t.window[u],t.ins_h=(t.ins_h<<t.hash_shift^t.window[u+1])&t.hash_mask;t.insert&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[u+3-1])&t.hash_mask,t.prev[u&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=u,u++,t.insert--,!(t.lookahead+t.insert<3)););}while(t.lookahead<f&&0!==t.strm.avail_in)}function M(t,e){for(var r,i;;){if(t.lookahead<f){if(E(t),t.lookahead<f&&0===e)return 1;if(0===t.lookahead)break}if(r=0,t.lookahead>=3&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+3-1])&t.hash_mask,r=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),0!==r&&t.strstart-r<=t.w_size-f&&(t.match_length=S(t,r)),t.match_length>=3)if(i=o._tr_tally(t,t.strstart-t.match_start,t.match_length-3),t.lookahead-=t.match_length,t.match_length<=t.max_lazy_match&&t.lookahead>=3){t.match_length--;do{t.strstart++,t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+3-1])&t.hash_mask,r=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart}while(0!=--t.match_length);t.strstart++}else t.strstart+=t.match_length,t.match_length=0,t.ins_h=t.window[t.strstart],t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+1])&t.hash_mask;else i=o._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++;if(i&&(b(t,!1),0===t.strm.avail_out))return 1}return t.insert=t.strstart<2?t.strstart:2,4===e?(b(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(b(t,!1),0===t.strm.avail_out)?1:2}function A(t,e){for(var r,i,n;;){if(t.lookahead<f){if(E(t),t.lookahead<f&&0===e)return 1;if(0===t.lookahead)break}if(r=0,t.lookahead>=3&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+3-1])&t.hash_mask,r=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),t.prev_length=t.match_length,t.prev_match=t.match_start,t.match_length=2,0!==r&&t.prev_length<t.max_lazy_match&&t.strstart-r<=t.w_size-f&&(t.match_length=S(t,r),t.match_length<=5&&(1===t.strategy||3===t.match_length&&t.strstart-t.match_start>4096)&&(t.match_length=2)),t.prev_length>=3&&t.match_length<=t.prev_length){n=t.strstart+t.lookahead-3,i=o._tr_tally(t,t.strstart-1-t.prev_match,t.prev_length-3),t.lookahead-=t.prev_length-1,t.prev_length-=2;do{++t.strstart<=n&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+3-1])&t.hash_mask,r=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart)}while(0!=--t.prev_length);if(t.match_available=0,t.match_length=2,t.strstart++,i&&(b(t,!1),0===t.strm.avail_out))return 1}else if(t.match_available){if((i=o._tr_tally(t,0,t.window[t.strstart-1]))&&b(t,!1),t.strstart++,t.lookahead--,0===t.strm.avail_out)return 1}else t.match_available=1,t.strstart++,t.lookahead--}return t.match_available&&(i=o._tr_tally(t,0,t.window[t.strstart-1]),t.match_available=0),t.insert=t.strstart<2?t.strstart:2,4===e?(b(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(b(t,!1),0===t.strm.avail_out)?1:2}function C(t,e,r,i,n){this.good_length=t,this.max_lazy=e,this.nice_length=r,this.max_chain=i,this.func=n}function k(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=8,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new n.Buf16(1146),this.dyn_dtree=new n.Buf16(122),this.bl_tree=new n.Buf16(78),m(this.dyn_ltree),m(this.dyn_dtree),m(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new n.Buf16(16),this.heap=new n.Buf16(573),m(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new n.Buf16(573),m(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function I(t){var e;return t&&t.state?(t.total_in=t.total_out=0,t.data_type=2,(e=t.state).pending=0,e.pending_out=0,e.wrap<0&&(e.wrap=-e.wrap),e.status=e.wrap?42:d,t.adler=2===e.wrap?0:1,e.last_flush=0,o._tr_init(e),0):g(t,h)}function T(t){var e,r=I(t);return 0===r&&((e=t.state).window_size=2*e.w_size,m(e.head),e.max_lazy_match=i[e.level].max_lazy,e.good_match=i[e.level].good_length,e.nice_match=i[e.level].nice_length,e.max_chain_length=i[e.level].max_chain,e.strstart=0,e.block_start=0,e.lookahead=0,e.insert=0,e.match_length=e.prev_length=2,e.match_available=0,e.ins_h=0),r}function R(t,e,r,i,o,s){if(!t)return h;var a=1;if(-1===e&&(e=6),i<0?(a=0,i=-i):i>15&&(a=2,i-=16),o<1||o>9||8!==r||i<8||i>15||e<0||e>9||s<0||s>4)return g(t,h);8===i&&(i=9);var u=new k;return t.state=u,u.strm=t,u.wrap=a,u.gzhead=null,u.w_bits=i,u.w_size=1<<u.w_bits,u.w_mask=u.w_size-1,u.hash_bits=o+7,u.hash_size=1<<u.hash_bits,u.hash_mask=u.hash_size-1,u.hash_shift=~~((u.hash_bits+3-1)/3),u.window=new n.Buf8(2*u.w_size),u.head=new n.Buf16(u.hash_size),u.prev=new n.Buf16(u.w_size),u.lit_bufsize=1<<o+6,u.pending_buf_size=4*u.lit_bufsize,u.pending_buf=new n.Buf8(u.pending_buf_size),u.d_buf=1*u.lit_bufsize,u.l_buf=3*u.lit_bufsize,u.level=e,u.strategy=s,u.method=r,T(t)}i=[new C(0,0,0,0,(function(t,e){var r=65535;for(r>t.pending_buf_size-5&&(r=t.pending_buf_size-5);;){if(t.lookahead<=1){if(E(t),0===t.lookahead&&0===e)return 1;if(0===t.lookahead)break}t.strstart+=t.lookahead,t.lookahead=0;var i=t.block_start+r;if((0===t.strstart||t.strstart>=i)&&(t.lookahead=t.strstart-i,t.strstart=i,b(t,!1),0===t.strm.avail_out))return 1;if(t.strstart-t.block_start>=t.w_size-f&&(b(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,4===e?(b(t,!0),0===t.strm.avail_out?3:4):(t.strstart>t.block_start&&(b(t,!1),t.strm.avail_out),1)})),new C(4,4,8,4,M),new C(4,5,16,8,M),new C(4,6,32,32,M),new C(4,4,16,16,A),new C(8,16,32,32,A),new C(8,16,128,128,A),new C(8,32,128,256,A),new C(32,128,258,1024,A),new C(32,258,258,4096,A)],e.deflateInit=function(t,e){return R(t,e,8,15,8,0)},e.deflateInit2=R,e.deflateReset=T,e.deflateResetKeep=I,e.deflateSetHeader=function(t,e){return t&&t.state?2!==t.state.wrap?h:(t.state.gzhead=e,0):h},e.deflate=function(t,e){var r,n,s,u;if(!t||!t.state||e>5||e<0)return t?g(t,h):h;if(n=t.state,!t.output||!t.input&&0!==t.avail_in||n.status===p&&4!==e)return g(t,0===t.avail_out?-5:h);if(n.strm=t,r=n.last_flush,n.last_flush=e,42===n.status)if(2===n.wrap)t.adler=0,w(n,31),w(n,139),w(n,8),n.gzhead?(w(n,(n.gzhead.text?1:0)+(n.gzhead.hcrc?2:0)+(n.gzhead.extra?4:0)+(n.gzhead.name?8:0)+(n.gzhead.comment?16:0)),w(n,255&n.gzhead.time),w(n,n.gzhead.time>>8&255),w(n,n.gzhead.time>>16&255),w(n,n.gzhead.time>>24&255),w(n,9===n.level?2:n.strategy>=2||n.level<2?4:0),w(n,255&n.gzhead.os),n.gzhead.extra&&n.gzhead.extra.length&&(w(n,255&n.gzhead.extra.length),w(n,n.gzhead.extra.length>>8&255)),n.gzhead.hcrc&&(t.adler=a(t.adler,n.pending_buf,n.pending,0)),n.gzindex=0,n.status=69):(w(n,0),w(n,0),w(n,0),w(n,0),w(n,0),w(n,9===n.level?2:n.strategy>=2||n.level<2?4:0),w(n,3),n.status=d);else{var f=8+(n.w_bits-8<<4)<<8;f|=(n.strategy>=2||n.level<2?0:n.level<6?1:6===n.level?2:3)<<6,0!==n.strstart&&(f|=32),f+=31-f%31,n.status=d,_(n,f),0!==n.strstart&&(_(n,t.adler>>>16),_(n,65535&t.adler)),t.adler=1}if(69===n.status)if(n.gzhead.extra){for(s=n.pending;n.gzindex<(65535&n.gzhead.extra.length)&&(n.pending!==n.pending_buf_size||(n.gzhead.hcrc&&n.pending>s&&(t.adler=a(t.adler,n.pending_buf,n.pending-s,s)),v(t),s=n.pending,n.pending!==n.pending_buf_size));)w(n,255&n.gzhead.extra[n.gzindex]),n.gzindex++;n.gzhead.hcrc&&n.pending>s&&(t.adler=a(t.adler,n.pending_buf,n.pending-s,s)),n.gzindex===n.gzhead.extra.length&&(n.gzindex=0,n.status=73)}else n.status=73;if(73===n.status)if(n.gzhead.name){s=n.pending;do{if(n.pending===n.pending_buf_size&&(n.gzhead.hcrc&&n.pending>s&&(t.adler=a(t.adler,n.pending_buf,n.pending-s,s)),v(t),s=n.pending,n.pending===n.pending_buf_size)){u=1;break}u=n.gzindex<n.gzhead.name.length?255&n.gzhead.name.charCodeAt(n.gzindex++):0,w(n,u)}while(0!==u);n.gzhead.hcrc&&n.pending>s&&(t.adler=a(t.adler,n.pending_buf,n.pending-s,s)),0===u&&(n.gzindex=0,n.status=91)}else n.status=91;if(91===n.status)if(n.gzhead.comment){s=n.pending;do{if(n.pending===n.pending_buf_size&&(n.gzhead.hcrc&&n.pending>s&&(t.adler=a(t.adler,n.pending_buf,n.pending-s,s)),v(t),s=n.pending,n.pending===n.pending_buf_size)){u=1;break}u=n.gzindex<n.gzhead.comment.length?255&n.gzhead.comment.charCodeAt(n.gzindex++):0,w(n,u)}while(0!==u);n.gzhead.hcrc&&n.pending>s&&(t.adler=a(t.adler,n.pending_buf,n.pending-s,s)),0===u&&(n.status=l)}else n.status=l;if(n.status===l&&(n.gzhead.hcrc?(n.pending+2>n.pending_buf_size&&v(t),n.pending+2<=n.pending_buf_size&&(w(n,255&t.adler),w(n,t.adler>>8&255),t.adler=0,n.status=d)):n.status=d),0!==n.pending){if(v(t),0===t.avail_out)return n.last_flush=-1,0}else if(0===t.avail_in&&y(e)<=y(r)&&4!==e)return g(t,-5);if(n.status===p&&0!==t.avail_in)return g(t,-5);if(0!==t.avail_in||0!==n.lookahead||0!==e&&n.status!==p){var S=2===n.strategy?function(t,e){for(var r;;){if(0===t.lookahead&&(E(t),0===t.lookahead)){if(0===e)return 1;break}if(t.match_length=0,r=o._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++,r&&(b(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,4===e?(b(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(b(t,!1),0===t.strm.avail_out)?1:2}(n,e):3===n.strategy?function(t,e){for(var r,i,n,s,a=t.window;;){if(t.lookahead<=c){if(E(t),t.lookahead<=c&&0===e)return 1;if(0===t.lookahead)break}if(t.match_length=0,t.lookahead>=3&&t.strstart>0&&(i=a[n=t.strstart-1])===a[++n]&&i===a[++n]&&i===a[++n]){s=t.strstart+c;do{}while(i===a[++n]&&i===a[++n]&&i===a[++n]&&i===a[++n]&&i===a[++n]&&i===a[++n]&&i===a[++n]&&i===a[++n]&&n<s);t.match_length=c-(s-n),t.match_length>t.lookahead&&(t.match_length=t.lookahead)}if(t.match_length>=3?(r=o._tr_tally(t,1,t.match_length-3),t.lookahead-=t.match_length,t.strstart+=t.match_length,t.match_length=0):(r=o._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++),r&&(b(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,4===e?(b(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(b(t,!1),0===t.strm.avail_out)?1:2}(n,e):i[n.level].func(n,e);if(3!==S&&4!==S||(n.status=p),1===S||3===S)return 0===t.avail_out&&(n.last_flush=-1),0;if(2===S&&(1===e?o._tr_align(n):5!==e&&(o._tr_stored_block(n,0,0,!1),3===e&&(m(n.head),0===n.lookahead&&(n.strstart=0,n.block_start=0,n.insert=0))),v(t),0===t.avail_out))return n.last_flush=-1,0}return 4!==e?0:n.wrap<=0?1:(2===n.wrap?(w(n,255&t.adler),w(n,t.adler>>8&255),w(n,t.adler>>16&255),w(n,t.adler>>24&255),w(n,255&t.total_in),w(n,t.total_in>>8&255),w(n,t.total_in>>16&255),w(n,t.total_in>>24&255)):(_(n,t.adler>>>16),_(n,65535&t.adler)),v(t),n.wrap>0&&(n.wrap=-n.wrap),0!==n.pending?0:1)},e.deflateEnd=function(t){var e;return t&&t.state?42!==(e=t.state.status)&&69!==e&&73!==e&&91!==e&&e!==l&&e!==d&&e!==p?g(t,h):(t.state=null,e===d?g(t,-3):0):h},e.deflateSetDictionary=function(t,e){var r,i,o,a,u,c,f,l,d=e.length;if(!t||!t.state)return h;if(2===(a=(r=t.state).wrap)||1===a&&42!==r.status||r.lookahead)return h;for(1===a&&(t.adler=s(t.adler,e,d,0)),r.wrap=0,d>=r.w_size&&(0===a&&(m(r.head),r.strstart=0,r.block_start=0,r.insert=0),l=new n.Buf8(r.w_size),n.arraySet(l,e,d-r.w_size,r.w_size,0),e=l,d=r.w_size),u=t.avail_in,c=t.next_in,f=t.input,t.avail_in=d,t.next_in=0,t.input=e,E(r);r.lookahead>=3;){i=r.strstart,o=r.lookahead-2;do{r.ins_h=(r.ins_h<<r.hash_shift^r.window[i+3-1])&r.hash_mask,r.prev[i&r.w_mask]=r.head[r.ins_h],r.head[r.ins_h]=i,i++}while(--o);r.strstart=i,r.lookahead=2,E(r)}return r.strstart+=r.lookahead,r.block_start=r.strstart,r.insert=r.lookahead,r.lookahead=0,r.match_length=r.prev_length=2,r.match_available=0,t.next_in=c,t.input=f,t.avail_in=u,r.wrap=a,0},e.deflateInfo="pako deflate (from Nodeca project)"},42401:t=>{"use strict";t.exports=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}},94264:t=>{"use strict";t.exports=function(t,e){var r,i,n,o,s,a,u,h,c,f,l,d,p,g,y,m,v,b,w,_,S,E,M,A,C;r=t.state,i=t.next_in,A=t.input,n=i+(t.avail_in-5),o=t.next_out,C=t.output,s=o-(e-t.avail_out),a=o+(t.avail_out-257),u=r.dmax,h=r.wsize,c=r.whave,f=r.wnext,l=r.window,d=r.hold,p=r.bits,g=r.lencode,y=r.distcode,m=(1<<r.lenbits)-1,v=(1<<r.distbits)-1;t:do{p<15&&(d+=A[i++]<<p,p+=8,d+=A[i++]<<p,p+=8),b=g[d&m];e:for(;;){if(d>>>=w=b>>>24,p-=w,0==(w=b>>>16&255))C[o++]=65535&b;else{if(!(16&w)){if(0==(64&w)){b=g[(65535&b)+(d&(1<<w)-1)];continue e}if(32&w){r.mode=12;break t}t.msg="invalid literal/length code",r.mode=30;break t}_=65535&b,(w&=15)&&(p<w&&(d+=A[i++]<<p,p+=8),_+=d&(1<<w)-1,d>>>=w,p-=w),p<15&&(d+=A[i++]<<p,p+=8,d+=A[i++]<<p,p+=8),b=y[d&v];r:for(;;){if(d>>>=w=b>>>24,p-=w,!(16&(w=b>>>16&255))){if(0==(64&w)){b=y[(65535&b)+(d&(1<<w)-1)];continue r}t.msg="invalid distance code",r.mode=30;break t}if(S=65535&b,p<(w&=15)&&(d+=A[i++]<<p,(p+=8)<w&&(d+=A[i++]<<p,p+=8)),(S+=d&(1<<w)-1)>u){t.msg="invalid distance too far back",r.mode=30;break t}if(d>>>=w,p-=w,S>(w=o-s)){if((w=S-w)>c&&r.sane){t.msg="invalid distance too far back",r.mode=30;break t}if(E=0,M=l,0===f){if(E+=h-w,w<_){_-=w;do{C[o++]=l[E++]}while(--w);E=o-S,M=C}}else if(f<w){if(E+=h+f-w,(w-=f)<_){_-=w;do{C[o++]=l[E++]}while(--w);if(E=0,f<_){_-=w=f;do{C[o++]=l[E++]}while(--w);E=o-S,M=C}}}else if(E+=f-w,w<_){_-=w;do{C[o++]=l[E++]}while(--w);E=o-S,M=C}for(;_>2;)C[o++]=M[E++],C[o++]=M[E++],C[o++]=M[E++],_-=3;_&&(C[o++]=M[E++],_>1&&(C[o++]=M[E++]))}else{E=o-S;do{C[o++]=C[E++],C[o++]=C[E++],C[o++]=C[E++],_-=3}while(_>2);_&&(C[o++]=C[E++],_>1&&(C[o++]=C[E++]))}break}}break}}while(i<n&&o<a);i-=_=p>>3,d&=(1<<(p-=_<<3))-1,t.next_in=i,t.next_out=o,t.avail_in=i<n?n-i+5:5-(i-n),t.avail_out=o<a?a-o+257:257-(o-a),r.hold=d,r.bits=p}},27948:(t,e,r)=>{"use strict";var i=r(24236),n=r(66069),o=r(2869),s=r(94264),a=r(9241),u=-2,h=12,c=30;function f(t){return(t>>>24&255)+(t>>>8&65280)+((65280&t)<<8)+((255&t)<<24)}function l(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new i.Buf16(320),this.work=new i.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function d(t){var e;return t&&t.state?(e=t.state,t.total_in=t.total_out=e.total=0,t.msg="",e.wrap&&(t.adler=1&e.wrap),e.mode=1,e.last=0,e.havedict=0,e.dmax=32768,e.head=null,e.hold=0,e.bits=0,e.lencode=e.lendyn=new i.Buf32(852),e.distcode=e.distdyn=new i.Buf32(592),e.sane=1,e.back=-1,0):u}function p(t){var e;return t&&t.state?((e=t.state).wsize=0,e.whave=0,e.wnext=0,d(t)):u}function g(t,e){var r,i;return t&&t.state?(i=t.state,e<0?(r=0,e=-e):(r=1+(e>>4),e<48&&(e&=15)),e&&(e<8||e>15)?u:(null!==i.window&&i.wbits!==e&&(i.window=null),i.wrap=r,i.wbits=e,p(t))):u}function y(t,e){var r,i;return t?(i=new l,t.state=i,i.window=null,0!==(r=g(t,e))&&(t.state=null),r):u}var m,v,b=!0;function w(t){if(b){var e;for(m=new i.Buf32(512),v=new i.Buf32(32),e=0;e<144;)t.lens[e++]=8;for(;e<256;)t.lens[e++]=9;for(;e<280;)t.lens[e++]=7;for(;e<288;)t.lens[e++]=8;for(a(1,t.lens,0,288,m,0,t.work,{bits:9}),e=0;e<32;)t.lens[e++]=5;a(2,t.lens,0,32,v,0,t.work,{bits:5}),b=!1}t.lencode=m,t.lenbits=9,t.distcode=v,t.distbits=5}function _(t,e,r,n){var o,s=t.state;return null===s.window&&(s.wsize=1<<s.wbits,s.wnext=0,s.whave=0,s.window=new i.Buf8(s.wsize)),n>=s.wsize?(i.arraySet(s.window,e,r-s.wsize,s.wsize,0),s.wnext=0,s.whave=s.wsize):((o=s.wsize-s.wnext)>n&&(o=n),i.arraySet(s.window,e,r-n,o,s.wnext),(n-=o)?(i.arraySet(s.window,e,r-n,n,0),s.wnext=n,s.whave=s.wsize):(s.wnext+=o,s.wnext===s.wsize&&(s.wnext=0),s.whave<s.wsize&&(s.whave+=o))),0}e.inflateReset=p,e.inflateReset2=g,e.inflateResetKeep=d,e.inflateInit=function(t){return y(t,15)},e.inflateInit2=y,e.inflate=function(t,e){var r,l,d,p,g,y,m,v,b,S,E,M,A,C,k,I,T,R,B,x,F,P,N,O,L=0,U=new i.Buf8(4),j=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!t||!t.state||!t.output||!t.input&&0!==t.avail_in)return u;(r=t.state).mode===h&&(r.mode=13),g=t.next_out,d=t.output,m=t.avail_out,p=t.next_in,l=t.input,y=t.avail_in,v=r.hold,b=r.bits,S=y,E=m,P=0;t:for(;;)switch(r.mode){case 1:if(0===r.wrap){r.mode=13;break}for(;b<16;){if(0===y)break t;y--,v+=l[p++]<<b,b+=8}if(2&r.wrap&&35615===v){r.check=0,U[0]=255&v,U[1]=v>>>8&255,r.check=o(r.check,U,2,0),v=0,b=0,r.mode=2;break}if(r.flags=0,r.head&&(r.head.done=!1),!(1&r.wrap)||(((255&v)<<8)+(v>>8))%31){t.msg="incorrect header check",r.mode=c;break}if(8!=(15&v)){t.msg="unknown compression method",r.mode=c;break}if(b-=4,F=8+(15&(v>>>=4)),0===r.wbits)r.wbits=F;else if(F>r.wbits){t.msg="invalid window size",r.mode=c;break}r.dmax=1<<F,t.adler=r.check=1,r.mode=512&v?10:h,v=0,b=0;break;case 2:for(;b<16;){if(0===y)break t;y--,v+=l[p++]<<b,b+=8}if(r.flags=v,8!=(255&r.flags)){t.msg="unknown compression method",r.mode=c;break}if(57344&r.flags){t.msg="unknown header flags set",r.mode=c;break}r.head&&(r.head.text=v>>8&1),512&r.flags&&(U[0]=255&v,U[1]=v>>>8&255,r.check=o(r.check,U,2,0)),v=0,b=0,r.mode=3;case 3:for(;b<32;){if(0===y)break t;y--,v+=l[p++]<<b,b+=8}r.head&&(r.head.time=v),512&r.flags&&(U[0]=255&v,U[1]=v>>>8&255,U[2]=v>>>16&255,U[3]=v>>>24&255,r.check=o(r.check,U,4,0)),v=0,b=0,r.mode=4;case 4:for(;b<16;){if(0===y)break t;y--,v+=l[p++]<<b,b+=8}r.head&&(r.head.xflags=255&v,r.head.os=v>>8),512&r.flags&&(U[0]=255&v,U[1]=v>>>8&255,r.check=o(r.check,U,2,0)),v=0,b=0,r.mode=5;case 5:if(1024&r.flags){for(;b<16;){if(0===y)break t;y--,v+=l[p++]<<b,b+=8}r.length=v,r.head&&(r.head.extra_len=v),512&r.flags&&(U[0]=255&v,U[1]=v>>>8&255,r.check=o(r.check,U,2,0)),v=0,b=0}else r.head&&(r.head.extra=null);r.mode=6;case 6:if(1024&r.flags&&((M=r.length)>y&&(M=y),M&&(r.head&&(F=r.head.extra_len-r.length,r.head.extra||(r.head.extra=new Array(r.head.extra_len)),i.arraySet(r.head.extra,l,p,M,F)),512&r.flags&&(r.check=o(r.check,l,M,p)),y-=M,p+=M,r.length-=M),r.length))break t;r.length=0,r.mode=7;case 7:if(2048&r.flags){if(0===y)break t;M=0;do{F=l[p+M++],r.head&&F&&r.length<65536&&(r.head.name+=String.fromCharCode(F))}while(F&&M<y);if(512&r.flags&&(r.check=o(r.check,l,M,p)),y-=M,p+=M,F)break t}else r.head&&(r.head.name=null);r.length=0,r.mode=8;case 8:if(4096&r.flags){if(0===y)break t;M=0;do{F=l[p+M++],r.head&&F&&r.length<65536&&(r.head.comment+=String.fromCharCode(F))}while(F&&M<y);if(512&r.flags&&(r.check=o(r.check,l,M,p)),y-=M,p+=M,F)break t}else r.head&&(r.head.comment=null);r.mode=9;case 9:if(512&r.flags){for(;b<16;){if(0===y)break t;y--,v+=l[p++]<<b,b+=8}if(v!==(65535&r.check)){t.msg="header crc mismatch",r.mode=c;break}v=0,b=0}r.head&&(r.head.hcrc=r.flags>>9&1,r.head.done=!0),t.adler=r.check=0,r.mode=h;break;case 10:for(;b<32;){if(0===y)break t;y--,v+=l[p++]<<b,b+=8}t.adler=r.check=f(v),v=0,b=0,r.mode=11;case 11:if(0===r.havedict)return t.next_out=g,t.avail_out=m,t.next_in=p,t.avail_in=y,r.hold=v,r.bits=b,2;t.adler=r.check=1,r.mode=h;case h:if(5===e||6===e)break t;case 13:if(r.last){v>>>=7&b,b-=7&b,r.mode=27;break}for(;b<3;){if(0===y)break t;y--,v+=l[p++]<<b,b+=8}switch(r.last=1&v,b-=1,3&(v>>>=1)){case 0:r.mode=14;break;case 1:if(w(r),r.mode=20,6===e){v>>>=2,b-=2;break t}break;case 2:r.mode=17;break;case 3:t.msg="invalid block type",r.mode=c}v>>>=2,b-=2;break;case 14:for(v>>>=7&b,b-=7&b;b<32;){if(0===y)break t;y--,v+=l[p++]<<b,b+=8}if((65535&v)!=(v>>>16^65535)){t.msg="invalid stored block lengths",r.mode=c;break}if(r.length=65535&v,v=0,b=0,r.mode=15,6===e)break t;case 15:r.mode=16;case 16:if(M=r.length){if(M>y&&(M=y),M>m&&(M=m),0===M)break t;i.arraySet(d,l,p,M,g),y-=M,p+=M,m-=M,g+=M,r.length-=M;break}r.mode=h;break;case 17:for(;b<14;){if(0===y)break t;y--,v+=l[p++]<<b,b+=8}if(r.nlen=257+(31&v),v>>>=5,b-=5,r.ndist=1+(31&v),v>>>=5,b-=5,r.ncode=4+(15&v),v>>>=4,b-=4,r.nlen>286||r.ndist>30){t.msg="too many length or distance symbols",r.mode=c;break}r.have=0,r.mode=18;case 18:for(;r.have<r.ncode;){for(;b<3;){if(0===y)break t;y--,v+=l[p++]<<b,b+=8}r.lens[j[r.have++]]=7&v,v>>>=3,b-=3}for(;r.have<19;)r.lens[j[r.have++]]=0;if(r.lencode=r.lendyn,r.lenbits=7,N={bits:r.lenbits},P=a(0,r.lens,0,19,r.lencode,0,r.work,N),r.lenbits=N.bits,P){t.msg="invalid code lengths set",r.mode=c;break}r.have=0,r.mode=19;case 19:for(;r.have<r.nlen+r.ndist;){for(;I=(L=r.lencode[v&(1<<r.lenbits)-1])>>>16&255,T=65535&L,!((k=L>>>24)<=b);){if(0===y)break t;y--,v+=l[p++]<<b,b+=8}if(T<16)v>>>=k,b-=k,r.lens[r.have++]=T;else{if(16===T){for(O=k+2;b<O;){if(0===y)break t;y--,v+=l[p++]<<b,b+=8}if(v>>>=k,b-=k,0===r.have){t.msg="invalid bit length repeat",r.mode=c;break}F=r.lens[r.have-1],M=3+(3&v),v>>>=2,b-=2}else if(17===T){for(O=k+3;b<O;){if(0===y)break t;y--,v+=l[p++]<<b,b+=8}b-=k,F=0,M=3+(7&(v>>>=k)),v>>>=3,b-=3}else{for(O=k+7;b<O;){if(0===y)break t;y--,v+=l[p++]<<b,b+=8}b-=k,F=0,M=11+(127&(v>>>=k)),v>>>=7,b-=7}if(r.have+M>r.nlen+r.ndist){t.msg="invalid bit length repeat",r.mode=c;break}for(;M--;)r.lens[r.have++]=F}}if(r.mode===c)break;if(0===r.lens[256]){t.msg="invalid code -- missing end-of-block",r.mode=c;break}if(r.lenbits=9,N={bits:r.lenbits},P=a(1,r.lens,0,r.nlen,r.lencode,0,r.work,N),r.lenbits=N.bits,P){t.msg="invalid literal/lengths set",r.mode=c;break}if(r.distbits=6,r.distcode=r.distdyn,N={bits:r.distbits},P=a(2,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,N),r.distbits=N.bits,P){t.msg="invalid distances set",r.mode=c;break}if(r.mode=20,6===e)break t;case 20:r.mode=21;case 21:if(y>=6&&m>=258){t.next_out=g,t.avail_out=m,t.next_in=p,t.avail_in=y,r.hold=v,r.bits=b,s(t,E),g=t.next_out,d=t.output,m=t.avail_out,p=t.next_in,l=t.input,y=t.avail_in,v=r.hold,b=r.bits,r.mode===h&&(r.back=-1);break}for(r.back=0;I=(L=r.lencode[v&(1<<r.lenbits)-1])>>>16&255,T=65535&L,!((k=L>>>24)<=b);){if(0===y)break t;y--,v+=l[p++]<<b,b+=8}if(I&&0==(240&I)){for(R=k,B=I,x=T;I=(L=r.lencode[x+((v&(1<<R+B)-1)>>R)])>>>16&255,T=65535&L,!(R+(k=L>>>24)<=b);){if(0===y)break t;y--,v+=l[p++]<<b,b+=8}v>>>=R,b-=R,r.back+=R}if(v>>>=k,b-=k,r.back+=k,r.length=T,0===I){r.mode=26;break}if(32&I){r.back=-1,r.mode=h;break}if(64&I){t.msg="invalid literal/length code",r.mode=c;break}r.extra=15&I,r.mode=22;case 22:if(r.extra){for(O=r.extra;b<O;){if(0===y)break t;y--,v+=l[p++]<<b,b+=8}r.length+=v&(1<<r.extra)-1,v>>>=r.extra,b-=r.extra,r.back+=r.extra}r.was=r.length,r.mode=23;case 23:for(;I=(L=r.distcode[v&(1<<r.distbits)-1])>>>16&255,T=65535&L,!((k=L>>>24)<=b);){if(0===y)break t;y--,v+=l[p++]<<b,b+=8}if(0==(240&I)){for(R=k,B=I,x=T;I=(L=r.distcode[x+((v&(1<<R+B)-1)>>R)])>>>16&255,T=65535&L,!(R+(k=L>>>24)<=b);){if(0===y)break t;y--,v+=l[p++]<<b,b+=8}v>>>=R,b-=R,r.back+=R}if(v>>>=k,b-=k,r.back+=k,64&I){t.msg="invalid distance code",r.mode=c;break}r.offset=T,r.extra=15&I,r.mode=24;case 24:if(r.extra){for(O=r.extra;b<O;){if(0===y)break t;y--,v+=l[p++]<<b,b+=8}r.offset+=v&(1<<r.extra)-1,v>>>=r.extra,b-=r.extra,r.back+=r.extra}if(r.offset>r.dmax){t.msg="invalid distance too far back",r.mode=c;break}r.mode=25;case 25:if(0===m)break t;if(M=E-m,r.offset>M){if((M=r.offset-M)>r.whave&&r.sane){t.msg="invalid distance too far back",r.mode=c;break}M>r.wnext?(M-=r.wnext,A=r.wsize-M):A=r.wnext-M,M>r.length&&(M=r.length),C=r.window}else C=d,A=g-r.offset,M=r.length;M>m&&(M=m),m-=M,r.length-=M;do{d[g++]=C[A++]}while(--M);0===r.length&&(r.mode=21);break;case 26:if(0===m)break t;d[g++]=r.length,m--,r.mode=21;break;case 27:if(r.wrap){for(;b<32;){if(0===y)break t;y--,v|=l[p++]<<b,b+=8}if(E-=m,t.total_out+=E,r.total+=E,E&&(t.adler=r.check=r.flags?o(r.check,d,E,g-E):n(r.check,d,E,g-E)),E=m,(r.flags?v:f(v))!==r.check){t.msg="incorrect data check",r.mode=c;break}v=0,b=0}r.mode=28;case 28:if(r.wrap&&r.flags){for(;b<32;){if(0===y)break t;y--,v+=l[p++]<<b,b+=8}if(v!==(4294967295&r.total)){t.msg="incorrect length check",r.mode=c;break}v=0,b=0}r.mode=29;case 29:P=1;break t;case c:P=-3;break t;case 31:return-4;case 32:default:return u}return t.next_out=g,t.avail_out=m,t.next_in=p,t.avail_in=y,r.hold=v,r.bits=b,(r.wsize||E!==t.avail_out&&r.mode<c&&(r.mode<27||4!==e))&&_(t,t.output,t.next_out,E-t.avail_out)?(r.mode=31,-4):(S-=t.avail_in,E-=t.avail_out,t.total_in+=S,t.total_out+=E,r.total+=E,r.wrap&&E&&(t.adler=r.check=r.flags?o(r.check,d,E,t.next_out-E):n(r.check,d,E,t.next_out-E)),t.data_type=r.bits+(r.last?64:0)+(r.mode===h?128:0)+(20===r.mode||15===r.mode?256:0),(0===S&&0===E||4===e)&&0===P&&(P=-5),P)},e.inflateEnd=function(t){if(!t||!t.state)return u;var e=t.state;return e.window&&(e.window=null),t.state=null,0},e.inflateGetHeader=function(t,e){var r;return t&&t.state?0==(2&(r=t.state).wrap)?u:(r.head=e,e.done=!1,0):u},e.inflateSetDictionary=function(t,e){var r,i=e.length;return t&&t.state?0!==(r=t.state).wrap&&11!==r.mode?u:11===r.mode&&n(1,e,i,0)!==r.check?-3:_(t,e,i,i)?(r.mode=31,-4):(r.havedict=1,0):u},e.inflateInfo="pako inflate (from Nodeca project)"},9241:(t,e,r)=>{"use strict";var i=r(24236),n=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],o=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],s=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],a=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];t.exports=function(t,e,r,u,h,c,f,l){var d,p,g,y,m,v,b,w,_,S=l.bits,E=0,M=0,A=0,C=0,k=0,I=0,T=0,R=0,B=0,x=0,F=null,P=0,N=new i.Buf16(16),O=new i.Buf16(16),L=null,U=0;for(E=0;E<=15;E++)N[E]=0;for(M=0;M<u;M++)N[e[r+M]]++;for(k=S,C=15;C>=1&&0===N[C];C--);if(k>C&&(k=C),0===C)return h[c++]=20971520,h[c++]=20971520,l.bits=1,0;for(A=1;A<C&&0===N[A];A++);for(k<A&&(k=A),R=1,E=1;E<=15;E++)if(R<<=1,(R-=N[E])<0)return-1;if(R>0&&(0===t||1!==C))return-1;for(O[1]=0,E=1;E<15;E++)O[E+1]=O[E]+N[E];for(M=0;M<u;M++)0!==e[r+M]&&(f[O[e[r+M]]++]=M);if(0===t?(F=L=f,v=19):1===t?(F=n,P-=257,L=o,U-=257,v=256):(F=s,L=a,v=-1),x=0,M=0,E=A,m=c,I=k,T=0,g=-1,y=(B=1<<k)-1,1===t&&B>852||2===t&&B>592)return 1;for(;;){b=E-T,f[M]<v?(w=0,_=f[M]):f[M]>v?(w=L[U+f[M]],_=F[P+f[M]]):(w=96,_=0),d=1<<E-T,A=p=1<<I;do{h[m+(x>>T)+(p-=d)]=b<<24|w<<16|_|0}while(0!==p);for(d=1<<E-1;x&d;)d>>=1;if(0!==d?(x&=d-1,x+=d):x=0,M++,0==--N[E]){if(E===C)break;E=e[r+f[M]]}if(E>k&&(x&y)!==g){for(0===T&&(T=k),m+=A,R=1<<(I=E-T);I+T<C&&!((R-=N[I+T])<=0);)I++,R<<=1;if(B+=1<<I,1===t&&B>852||2===t&&B>592)return 1;h[g=x&y]=k<<24|I<<16|m-c|0}}return 0!==x&&(h[m+x]=E-T<<24|64<<16|0),l.bits=k,0}},48898:t=>{"use strict";t.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}},10342:(t,e,r)=>{"use strict";var i=r(24236);function n(t){for(var e=t.length;--e>=0;)t[e]=0}var o=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],s=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],a=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],u=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],h=new Array(576);n(h);var c=new Array(60);n(c);var f=new Array(512);n(f);var l=new Array(256);n(l);var d=new Array(29);n(d);var p,g,y,m=new Array(30);function v(t,e,r,i,n){this.static_tree=t,this.extra_bits=e,this.extra_base=r,this.elems=i,this.max_length=n,this.has_stree=t&&t.length}function b(t,e){this.dyn_tree=t,this.max_code=0,this.stat_desc=e}function w(t){return t<256?f[t]:f[256+(t>>>7)]}function _(t,e){t.pending_buf[t.pending++]=255&e,t.pending_buf[t.pending++]=e>>>8&255}function S(t,e,r){t.bi_valid>16-r?(t.bi_buf|=e<<t.bi_valid&65535,_(t,t.bi_buf),t.bi_buf=e>>16-t.bi_valid,t.bi_valid+=r-16):(t.bi_buf|=e<<t.bi_valid&65535,t.bi_valid+=r)}function E(t,e,r){S(t,r[2*e],r[2*e+1])}function M(t,e){var r=0;do{r|=1&t,t>>>=1,r<<=1}while(--e>0);return r>>>1}function A(t,e,r){var i,n,o=new Array(16),s=0;for(i=1;i<=15;i++)o[i]=s=s+r[i-1]<<1;for(n=0;n<=e;n++){var a=t[2*n+1];0!==a&&(t[2*n]=M(o[a]++,a))}}function C(t){var e;for(e=0;e<286;e++)t.dyn_ltree[2*e]=0;for(e=0;e<30;e++)t.dyn_dtree[2*e]=0;for(e=0;e<19;e++)t.bl_tree[2*e]=0;t.dyn_ltree[512]=1,t.opt_len=t.static_len=0,t.last_lit=t.matches=0}function k(t){t.bi_valid>8?_(t,t.bi_buf):t.bi_valid>0&&(t.pending_buf[t.pending++]=t.bi_buf),t.bi_buf=0,t.bi_valid=0}function I(t,e,r,i){var n=2*e,o=2*r;return t[n]<t[o]||t[n]===t[o]&&i[e]<=i[r]}function T(t,e,r){for(var i=t.heap[r],n=r<<1;n<=t.heap_len&&(n<t.heap_len&&I(e,t.heap[n+1],t.heap[n],t.depth)&&n++,!I(e,i,t.heap[n],t.depth));)t.heap[r]=t.heap[n],r=n,n<<=1;t.heap[r]=i}function R(t,e,r){var i,n,a,u,h=0;if(0!==t.last_lit)do{i=t.pending_buf[t.d_buf+2*h]<<8|t.pending_buf[t.d_buf+2*h+1],n=t.pending_buf[t.l_buf+h],h++,0===i?E(t,n,e):(E(t,(a=l[n])+256+1,e),0!==(u=o[a])&&S(t,n-=d[a],u),E(t,a=w(--i),r),0!==(u=s[a])&&S(t,i-=m[a],u))}while(h<t.last_lit);E(t,256,e)}function B(t,e){var r,i,n,o=e.dyn_tree,s=e.stat_desc.static_tree,a=e.stat_desc.has_stree,u=e.stat_desc.elems,h=-1;for(t.heap_len=0,t.heap_max=573,r=0;r<u;r++)0!==o[2*r]?(t.heap[++t.heap_len]=h=r,t.depth[r]=0):o[2*r+1]=0;for(;t.heap_len<2;)o[2*(n=t.heap[++t.heap_len]=h<2?++h:0)]=1,t.depth[n]=0,t.opt_len--,a&&(t.static_len-=s[2*n+1]);for(e.max_code=h,r=t.heap_len>>1;r>=1;r--)T(t,o,r);n=u;do{r=t.heap[1],t.heap[1]=t.heap[t.heap_len--],T(t,o,1),i=t.heap[1],t.heap[--t.heap_max]=r,t.heap[--t.heap_max]=i,o[2*n]=o[2*r]+o[2*i],t.depth[n]=(t.depth[r]>=t.depth[i]?t.depth[r]:t.depth[i])+1,o[2*r+1]=o[2*i+1]=n,t.heap[1]=n++,T(t,o,1)}while(t.heap_len>=2);t.heap[--t.heap_max]=t.heap[1],function(t,e){var r,i,n,o,s,a,u=e.dyn_tree,h=e.max_code,c=e.stat_desc.static_tree,f=e.stat_desc.has_stree,l=e.stat_desc.extra_bits,d=e.stat_desc.extra_base,p=e.stat_desc.max_length,g=0;for(o=0;o<=15;o++)t.bl_count[o]=0;for(u[2*t.heap[t.heap_max]+1]=0,r=t.heap_max+1;r<573;r++)(o=u[2*u[2*(i=t.heap[r])+1]+1]+1)>p&&(o=p,g++),u[2*i+1]=o,i>h||(t.bl_count[o]++,s=0,i>=d&&(s=l[i-d]),a=u[2*i],t.opt_len+=a*(o+s),f&&(t.static_len+=a*(c[2*i+1]+s)));if(0!==g){do{for(o=p-1;0===t.bl_count[o];)o--;t.bl_count[o]--,t.bl_count[o+1]+=2,t.bl_count[p]--,g-=2}while(g>0);for(o=p;0!==o;o--)for(i=t.bl_count[o];0!==i;)(n=t.heap[--r])>h||(u[2*n+1]!==o&&(t.opt_len+=(o-u[2*n+1])*u[2*n],u[2*n+1]=o),i--)}}(t,e),A(o,h,t.bl_count)}function x(t,e,r){var i,n,o=-1,s=e[1],a=0,u=7,h=4;for(0===s&&(u=138,h=3),e[2*(r+1)+1]=65535,i=0;i<=r;i++)n=s,s=e[2*(i+1)+1],++a<u&&n===s||(a<h?t.bl_tree[2*n]+=a:0!==n?(n!==o&&t.bl_tree[2*n]++,t.bl_tree[32]++):a<=10?t.bl_tree[34]++:t.bl_tree[36]++,a=0,o=n,0===s?(u=138,h=3):n===s?(u=6,h=3):(u=7,h=4))}function F(t,e,r){var i,n,o=-1,s=e[1],a=0,u=7,h=4;for(0===s&&(u=138,h=3),i=0;i<=r;i++)if(n=s,s=e[2*(i+1)+1],!(++a<u&&n===s)){if(a<h)do{E(t,n,t.bl_tree)}while(0!=--a);else 0!==n?(n!==o&&(E(t,n,t.bl_tree),a--),E(t,16,t.bl_tree),S(t,a-3,2)):a<=10?(E(t,17,t.bl_tree),S(t,a-3,3)):(E(t,18,t.bl_tree),S(t,a-11,7));a=0,o=n,0===s?(u=138,h=3):n===s?(u=6,h=3):(u=7,h=4)}}n(m);var P=!1;function N(t,e,r,n){S(t,0+(n?1:0),3),function(t,e,r,n){k(t),_(t,r),_(t,~r),i.arraySet(t.pending_buf,t.window,e,r,t.pending),t.pending+=r}(t,e,r)}e._tr_init=function(t){P||(function(){var t,e,r,i,n,u=new Array(16);for(r=0,i=0;i<28;i++)for(d[i]=r,t=0;t<1<<o[i];t++)l[r++]=i;for(l[r-1]=i,n=0,i=0;i<16;i++)for(m[i]=n,t=0;t<1<<s[i];t++)f[n++]=i;for(n>>=7;i<30;i++)for(m[i]=n<<7,t=0;t<1<<s[i]-7;t++)f[256+n++]=i;for(e=0;e<=15;e++)u[e]=0;for(t=0;t<=143;)h[2*t+1]=8,t++,u[8]++;for(;t<=255;)h[2*t+1]=9,t++,u[9]++;for(;t<=279;)h[2*t+1]=7,t++,u[7]++;for(;t<=287;)h[2*t+1]=8,t++,u[8]++;for(A(h,287,u),t=0;t<30;t++)c[2*t+1]=5,c[2*t]=M(t,5);p=new v(h,o,257,286,15),g=new v(c,s,0,30,15),y=new v(new Array(0),a,0,19,7)}(),P=!0),t.l_desc=new b(t.dyn_ltree,p),t.d_desc=new b(t.dyn_dtree,g),t.bl_desc=new b(t.bl_tree,y),t.bi_buf=0,t.bi_valid=0,C(t)},e._tr_stored_block=N,e._tr_flush_block=function(t,e,r,i){var n,o,s=0;t.level>0?(2===t.strm.data_type&&(t.strm.data_type=function(t){var e,r=4093624447;for(e=0;e<=31;e++,r>>>=1)if(1&r&&0!==t.dyn_ltree[2*e])return 0;if(0!==t.dyn_ltree[18]||0!==t.dyn_ltree[20]||0!==t.dyn_ltree[26])return 1;for(e=32;e<256;e++)if(0!==t.dyn_ltree[2*e])return 1;return 0}(t)),B(t,t.l_desc),B(t,t.d_desc),s=function(t){var e;for(x(t,t.dyn_ltree,t.l_desc.max_code),x(t,t.dyn_dtree,t.d_desc.max_code),B(t,t.bl_desc),e=18;e>=3&&0===t.bl_tree[2*u[e]+1];e--);return t.opt_len+=3*(e+1)+5+5+4,e}(t),n=t.opt_len+3+7>>>3,(o=t.static_len+3+7>>>3)<=n&&(n=o)):n=o=r+5,r+4<=n&&-1!==e?N(t,e,r,i):4===t.strategy||o===n?(S(t,2+(i?1:0),3),R(t,h,c)):(S(t,4+(i?1:0),3),function(t,e,r,i){var n;for(S(t,e-257,5),S(t,r-1,5),S(t,i-4,4),n=0;n<i;n++)S(t,t.bl_tree[2*u[n]+1],3);F(t,t.dyn_ltree,e-1),F(t,t.dyn_dtree,r-1)}(t,t.l_desc.max_code+1,t.d_desc.max_code+1,s+1),R(t,t.dyn_ltree,t.dyn_dtree)),C(t),i&&k(t)},e._tr_tally=function(t,e,r){return t.pending_buf[t.d_buf+2*t.last_lit]=e>>>8&255,t.pending_buf[t.d_buf+2*t.last_lit+1]=255&e,t.pending_buf[t.l_buf+t.last_lit]=255&r,t.last_lit++,0===e?t.dyn_ltree[2*r]++:(t.matches++,e--,t.dyn_ltree[2*(l[r]+256+1)]++,t.dyn_dtree[2*w(e)]++),t.last_lit===t.lit_bufsize-1},e._tr_align=function(t){S(t,2,3),E(t,256,h),function(t){16===t.bi_valid?(_(t,t.bi_buf),t.bi_buf=0,t.bi_valid=0):t.bi_valid>=8&&(t.pending_buf[t.pending++]=255&t.bi_buf,t.bi_buf>>=8,t.bi_valid-=8)}(t)}},62292:t=>{"use strict";t.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},873:t=>{"use strict";t.exports=JSON.parse('{"2.16.840.1.101.3.4.1.1":"aes-128-ecb","2.16.840.1.101.3.4.1.2":"aes-128-cbc","2.16.840.1.101.3.4.1.3":"aes-128-ofb","2.16.840.1.101.3.4.1.4":"aes-128-cfb","2.16.840.1.101.3.4.1.21":"aes-192-ecb","2.16.840.1.101.3.4.1.22":"aes-192-cbc","2.16.840.1.101.3.4.1.23":"aes-192-ofb","2.16.840.1.101.3.4.1.24":"aes-192-cfb","2.16.840.1.101.3.4.1.41":"aes-256-ecb","2.16.840.1.101.3.4.1.42":"aes-256-cbc","2.16.840.1.101.3.4.1.43":"aes-256-ofb","2.16.840.1.101.3.4.1.44":"aes-256-cfb"}')},52818:(t,e,r)=>{"use strict";var i=r(39809);e.certificate=r(41934);var n=i.define("RSAPrivateKey",(function(){this.seq().obj(this.key("version").int(),this.key("modulus").int(),this.key("publicExponent").int(),this.key("privateExponent").int(),this.key("prime1").int(),this.key("prime2").int(),this.key("exponent1").int(),this.key("exponent2").int(),this.key("coefficient").int())}));e.RSAPrivateKey=n;var o=i.define("RSAPublicKey",(function(){this.seq().obj(this.key("modulus").int(),this.key("publicExponent").int())}));e.RSAPublicKey=o;var s=i.define("SubjectPublicKeyInfo",(function(){this.seq().obj(this.key("algorithm").use(a),this.key("subjectPublicKey").bitstr())}));e.PublicKey=s;var a=i.define("AlgorithmIdentifier",(function(){this.seq().obj(this.key("algorithm").objid(),this.key("none").null_().optional(),this.key("curve").objid().optional(),this.key("params").seq().obj(this.key("p").int(),this.key("q").int(),this.key("g").int()).optional())})),u=i.define("PrivateKeyInfo",(function(){this.seq().obj(this.key("version").int(),this.key("algorithm").use(a),this.key("subjectPrivateKey").octstr())}));e.PrivateKey=u;var h=i.define("EncryptedPrivateKeyInfo",(function(){this.seq().obj(this.key("algorithm").seq().obj(this.key("id").objid(),this.key("decrypt").seq().obj(this.key("kde").seq().obj(this.key("id").objid(),this.key("kdeparams").seq().obj(this.key("salt").octstr(),this.key("iters").int())),this.key("cipher").seq().obj(this.key("algo").objid(),this.key("iv").octstr()))),this.key("subjectPrivateKey").octstr())}));e.EncryptedPrivateKey=h;var c=i.define("DSAPrivateKey",(function(){this.seq().obj(this.key("version").int(),this.key("p").int(),this.key("q").int(),this.key("g").int(),this.key("pub_key").int(),this.key("priv_key").int())}));e.DSAPrivateKey=c,e.DSAparam=i.define("DSAparam",(function(){this.int()}));var f=i.define("ECPrivateKey",(function(){this.seq().obj(this.key("version").int(),this.key("privateKey").octstr(),this.key("parameters").optional().explicit(0).use(l),this.key("publicKey").optional().explicit(1).bitstr())}));e.ECPrivateKey=f;var l=i.define("ECParameters",(function(){this.choice({namedCurve:this.objid()})}));e.signature=i.define("signature",(function(){this.seq().obj(this.key("r").int(),this.key("s").int())}))},41934:(t,e,r)=>{"use strict";var i=r(39809),n=i.define("Time",(function(){this.choice({utcTime:this.utctime(),generalTime:this.gentime()})})),o=i.define("AttributeTypeValue",(function(){this.seq().obj(this.key("type").objid(),this.key("value").any())})),s=i.define("AlgorithmIdentifier",(function(){this.seq().obj(this.key("algorithm").objid(),this.key("parameters").optional(),this.key("curve").objid().optional())})),a=i.define("SubjectPublicKeyInfo",(function(){this.seq().obj(this.key("algorithm").use(s),this.key("subjectPublicKey").bitstr())})),u=i.define("RelativeDistinguishedName",(function(){this.setof(o)})),h=i.define("RDNSequence",(function(){this.seqof(u)})),c=i.define("Name",(function(){this.choice({rdnSequence:this.use(h)})})),f=i.define("Validity",(function(){this.seq().obj(this.key("notBefore").use(n),this.key("notAfter").use(n))})),l=i.define("Extension",(function(){this.seq().obj(this.key("extnID").objid(),this.key("critical").bool().def(!1),this.key("extnValue").octstr())})),d=i.define("TBSCertificate",(function(){this.seq().obj(this.key("version").explicit(0).int().optional(),this.key("serialNumber").int(),this.key("signature").use(s),this.key("issuer").use(c),this.key("validity").use(f),this.key("subject").use(c),this.key("subjectPublicKeyInfo").use(a),this.key("issuerUniqueID").implicit(1).bitstr().optional(),this.key("subjectUniqueID").implicit(2).bitstr().optional(),this.key("extensions").explicit(3).seqof(l).optional())})),p=i.define("X509Certificate",(function(){this.seq().obj(this.key("tbsCertificate").use(d),this.key("signatureAlgorithm").use(s),this.key("signatureValue").bitstr())}));t.exports=p},77631:(t,e,r)=>{var i=/Proc-Type: 4,ENCRYPTED[\n\r]+DEK-Info: AES-((?:128)|(?:192)|(?:256))-CBC,([0-9A-H]+)[\n\r]+([0-9A-z\n\r+/=]+)[\n\r]+/m,n=/^-----BEGIN ((?:.*? KEY)|CERTIFICATE)-----/m,o=/^-----BEGIN ((?:.*? KEY)|CERTIFICATE)-----([0-9A-z\n\r+/=]+)-----END \1-----$/m,s=r(13048),a=r(44696),u=r(89509).Buffer;t.exports=function(t,e){var r,h=t.toString(),c=h.match(i);if(c){var f="aes"+c[1],l=u.from(c[2],"hex"),d=u.from(c[3].replace(/[\r\n]/g,""),"base64"),p=s(e,l.slice(0,8),parseInt(c[1],10)).key,g=[],y=a.createDecipheriv(f,p,l);g.push(y.update(d)),g.push(y.final()),r=u.concat(g)}else{var m=h.match(o);r=u.from(m[2].replace(/[\r\n]/g,""),"base64")}return{tag:h.match(n)[1],data:r}}},70980:(t,e,r)=>{var i=r(52818),n=r(873),o=r(77631),s=r(44696),a=r(25632),u=r(89509).Buffer;function h(t){var e;"object"!=typeof t||u.isBuffer(t)||(e=t.passphrase,t=t.key),"string"==typeof t&&(t=u.from(t));var r,h,c=o(t,e),f=c.tag,l=c.data;switch(f){case"CERTIFICATE":h=i.certificate.decode(l,"der").tbsCertificate.subjectPublicKeyInfo;case"PUBLIC KEY":switch(h||(h=i.PublicKey.decode(l,"der")),r=h.algorithm.algorithm.join(".")){case"1.2.840.113549.1.1.1":return i.RSAPublicKey.decode(h.subjectPublicKey.data,"der");case"1.2.840.10045.2.1":return h.subjectPrivateKey=h.subjectPublicKey,{type:"ec",data:h};case"1.2.840.10040.4.1":return h.algorithm.params.pub_key=i.DSAparam.decode(h.subjectPublicKey.data,"der"),{type:"dsa",data:h.algorithm.params};default:throw new Error("unknown key id "+r)}case"ENCRYPTED PRIVATE KEY":l=function(t,e){var r=t.algorithm.decrypt.kde.kdeparams.salt,i=parseInt(t.algorithm.decrypt.kde.kdeparams.iters.toString(),10),o=n[t.algorithm.decrypt.cipher.algo.join(".")],h=t.algorithm.decrypt.cipher.iv,c=t.subjectPrivateKey,f=parseInt(o.split("-")[1],10)/8,l=a.pbkdf2Sync(e,r,i,f,"sha1"),d=s.createDecipheriv(o,l,h),p=[];return p.push(d.update(c)),p.push(d.final()),u.concat(p)}(l=i.EncryptedPrivateKey.decode(l,"der"),e);case"PRIVATE KEY":switch(r=(h=i.PrivateKey.decode(l,"der")).algorithm.algorithm.join(".")){case"1.2.840.113549.1.1.1":return i.RSAPrivateKey.decode(h.subjectPrivateKey,"der");case"1.2.840.10045.2.1":return{curve:h.algorithm.curve,privateKey:i.ECPrivateKey.decode(h.subjectPrivateKey,"der").privateKey};case"1.2.840.10040.4.1":return h.algorithm.params.priv_key=i.DSAparam.decode(h.subjectPrivateKey,"der"),{type:"dsa",params:h.algorithm.params};default:throw new Error("unknown key id "+r)}case"RSA PUBLIC KEY":return i.RSAPublicKey.decode(l,"der");case"RSA PRIVATE KEY":return i.RSAPrivateKey.decode(l,"der");case"DSA PRIVATE KEY":return{type:"dsa",params:i.DSAPrivateKey.decode(l,"der")};case"EC PRIVATE KEY":return{curve:(l=i.ECPrivateKey.decode(l,"der")).parameters.value,privateKey:l.privateKey};default:throw new Error("unknown key type "+f)}}t.exports=h,h.signature=i.signature},25632:(t,e,r)=>{e.pbkdf2=r(88638),e.pbkdf2Sync=r(91257)},88638:(t,e,r)=>{var i,n=r(89509).Buffer,o=r(77357),s=r(12368),a=r(91257),u=r(57777),h=r.g.crypto&&r.g.crypto.subtle,c={sha:"SHA-1","sha-1":"SHA-1",sha1:"SHA-1",sha256:"SHA-256","sha-256":"SHA-256",sha384:"SHA-384","sha-384":"SHA-384","sha-512":"SHA-512",sha512:"SHA-512"},f=[];function l(t,e,r,i,o){return h.importKey("raw",t,{name:"PBKDF2"},!1,["deriveBits"]).then((function(t){return h.deriveBits({name:"PBKDF2",salt:e,iterations:r,hash:{name:o}},t,i<<3)})).then((function(t){return n.from(t)}))}t.exports=function(t,e,d,p,g,y){"function"==typeof g&&(y=g,g=void 0);var m=c[(g=g||"sha1").toLowerCase()];if(!m||"function"!=typeof r.g.Promise)return process.nextTick((function(){var r;try{r=a(t,e,d,p,g)}catch(t){return y(t)}y(null,r)}));if(o(d,p),t=u(t,s,"Password"),e=u(e,s,"Salt"),"function"!=typeof y)throw new Error("No callback provided to pbkdf2");!function(t,e){t.then((function(t){process.nextTick((function(){e(null,t)}))}),(function(t){process.nextTick((function(){e(t)}))}))}(function(t){if(r.g.process&&!r.g.process.browser)return Promise.resolve(!1);if(!h||!h.importKey||!h.deriveBits)return Promise.resolve(!1);if(void 0!==f[t])return f[t];var e=l(i=i||n.alloc(8),i,10,128,t).then((function(){return!0})).catch((function(){return!1}));return f[t]=e,e}(m).then((function(r){return r?l(t,e,d,p,m):a(t,e,d,p,g)})),y)}},12368:t=>{var e;e=process.browser?"utf-8":process.version?parseInt(process.version.split(".")[0].slice(1),10)>=6?"utf-8":"binary":"utf-8",t.exports=e},77357:t=>{var e=Math.pow(2,30)-1;t.exports=function(t,r){if("number"!=typeof t)throw new TypeError("Iterations not a number");if(t<0)throw new TypeError("Bad iterations");if("number"!=typeof r)throw new TypeError("Key length not a number");if(r<0||r>e||r!=r)throw new TypeError("Bad key length")}},91257:(t,e,r)=>{var i=r(78028),n=r(79785),o=r(89072),s=r(89509).Buffer,a=r(77357),u=r(12368),h=r(57777),c=s.alloc(128),f={md5:16,sha1:20,sha224:28,sha256:32,sha384:48,sha512:64,rmd160:20,ripemd160:20};function l(t,e,r){var a=function(t){return"rmd160"===t||"ripemd160"===t?function(t){return(new n).update(t).digest()}:"md5"===t?i:function(e){return o(t).update(e).digest()}}(t),u="sha512"===t||"sha384"===t?128:64;e.length>u?e=a(e):e.length<u&&(e=s.concat([e,c],u));for(var h=s.allocUnsafe(u+f[t]),l=s.allocUnsafe(u+f[t]),d=0;d<u;d++)h[d]=54^e[d],l[d]=92^e[d];var p=s.allocUnsafe(u+r+4);h.copy(p,0,0,u),this.ipad1=p,this.ipad2=h,this.opad=l,this.alg=t,this.blocksize=u,this.hash=a,this.size=f[t]}l.prototype.run=function(t,e){return t.copy(e,this.blocksize),this.hash(e).copy(this.opad,this.blocksize),this.hash(this.opad)},t.exports=function(t,e,r,i,n){a(r,i);var o=new l(n=n||"sha1",t=h(t,u,"Password"),(e=h(e,u,"Salt")).length),c=s.allocUnsafe(i),d=s.allocUnsafe(e.length+4);e.copy(d,0,0,e.length);for(var p=0,g=f[n],y=Math.ceil(i/g),m=1;m<=y;m++){d.writeUInt32BE(m,e.length);for(var v=o.run(d,o.ipad1),b=v,w=1;w<r;w++){b=o.run(b,o.ipad2);for(var _=0;_<g;_++)v[_]^=b[_]}v.copy(c,p),p+=g}return c}},57777:(t,e,r)=>{var i=r(89509).Buffer;t.exports=function(t,e,r){if(i.isBuffer(t))return t;if("string"==typeof t)return i.from(t,e);if(ArrayBuffer.isView(t))return i.from(t.buffer);throw new TypeError(r+" must be a string, a Buffer, a typed array or a DataView")}},34155:t=>{var e,r,i=t.exports={};function n(){throw new Error("setTimeout has not been defined")}function o(){throw new Error("clearTimeout has not been defined")}function s(t){if(e===setTimeout)return setTimeout(t,0);if((e===n||!e)&&setTimeout)return e=setTimeout,setTimeout(t,0);try{return e(t,0)}catch(r){try{return e.call(null,t,0)}catch(r){return e.call(this,t,0)}}}!function(){try{e="function"==typeof setTimeout?setTimeout:n}catch(t){e=n}try{r="function"==typeof clearTimeout?clearTimeout:o}catch(t){r=o}}();var a,u=[],h=!1,c=-1;function f(){h&&a&&(h=!1,a.length?u=a.concat(u):c=-1,u.length&&l())}function l(){if(!h){var t=s(f);h=!0;for(var e=u.length;e;){for(a=u,u=[];++c<e;)a&&a[c].run();c=-1,e=u.length}a=null,h=!1,function(t){if(r===clearTimeout)return clearTimeout(t);if((r===o||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(t);try{r(t)}catch(e){try{return r.call(null,t)}catch(e){return r.call(this,t)}}}(t)}}function d(t,e){this.fun=t,this.array=e}function p(){}i.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)e[r-1]=arguments[r];u.push(new d(t,e)),1!==u.length||h||s(l)},d.prototype.run=function(){this.fun.apply(null,this.array)},i.title="browser",i.browser=!0,i.env={},i.argv=[],i.version="",i.versions={},i.on=p,i.addListener=p,i.once=p,i.off=p,i.removeListener=p,i.removeAllListeners=p,i.emit=p,i.prependListener=p,i.prependOnceListener=p,i.listeners=function(t){return[]},i.binding=function(t){throw new Error("process.binding is not supported")},i.cwd=function(){return"/"},i.chdir=function(t){throw new Error("process.chdir is not supported")},i.umask=function(){return 0}},7900:(t,e,r)=>{e.publicEncrypt=r(16559),e.privateDecrypt=r(26138),e.privateEncrypt=function(t,r){return e.publicEncrypt(t,r,!0)},e.publicDecrypt=function(t,r){return e.privateDecrypt(t,r,!0)}},99199:(t,e,r)=>{var i=r(23482),n=r(89509).Buffer;function o(t){var e=n.allocUnsafe(4);return e.writeUInt32BE(t,0),e}t.exports=function(t,e){for(var r,s=n.alloc(0),a=0;s.length<e;)r=o(a++),s=n.concat([s,i("sha1").update(t).update(r).digest()]);return s.slice(0,e)}},92144:function(t,e,r){!function(t,e){"use strict";function i(t,e){if(!t)throw new Error(e||"Assertion failed")}function n(t,e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}function o(t,e,r){if(o.isBN(t))return t;this.negative=0,this.words=null,this.length=0,this.red=null,null!==t&&("le"!==e&&"be"!==e||(r=e,e=10),this._init(t||0,e||10,r||"be"))}var s;"object"==typeof t?t.exports=o:e.BN=o,o.BN=o,o.wordSize=26;try{s=r(32574).Buffer}catch(t){}function a(t,e,r){for(var i=0,n=Math.min(t.length,r),o=e;o<n;o++){var s=t.charCodeAt(o)-48;i<<=4,i|=s>=49&&s<=54?s-49+10:s>=17&&s<=22?s-17+10:15&s}return i}function u(t,e,r,i){for(var n=0,o=Math.min(t.length,r),s=e;s<o;s++){var a=t.charCodeAt(s)-48;n*=i,n+=a>=49?a-49+10:a>=17?a-17+10:a}return n}o.isBN=function(t){return t instanceof o||null!==t&&"object"==typeof t&&t.constructor.wordSize===o.wordSize&&Array.isArray(t.words)},o.max=function(t,e){return t.cmp(e)>0?t:e},o.min=function(t,e){return t.cmp(e)<0?t:e},o.prototype._init=function(t,e,r){if("number"==typeof t)return this._initNumber(t,e,r);if("object"==typeof t)return this._initArray(t,e,r);"hex"===e&&(e=16),i(e===(0|e)&&e>=2&&e<=36);var n=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&n++,16===e?this._parseHex(t,n):this._parseBase(t,e,n),"-"===t[0]&&(this.negative=1),this.strip(),"le"===r&&this._initArray(this.toArray(),e,r)},o.prototype._initNumber=function(t,e,r){t<0&&(this.negative=1,t=-t),t<67108864?(this.words=[67108863&t],this.length=1):t<4503599627370496?(this.words=[67108863&t,t/67108864&67108863],this.length=2):(i(t<9007199254740992),this.words=[67108863&t,t/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),e,r)},o.prototype._initArray=function(t,e,r){if(i("number"==typeof t.length),t.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(t.length/3),this.words=new Array(this.length);for(var n=0;n<this.length;n++)this.words[n]=0;var o,s,a=0;if("be"===r)for(n=t.length-1,o=0;n>=0;n-=3)s=t[n]|t[n-1]<<8|t[n-2]<<16,this.words[o]|=s<<a&67108863,this.words[o+1]=s>>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);else if("le"===r)for(n=0,o=0;n<t.length;n+=3)s=t[n]|t[n+1]<<8|t[n+2]<<16,this.words[o]|=s<<a&67108863,this.words[o+1]=s>>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);return this.strip()},o.prototype._parseHex=function(t,e){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var r=0;r<this.length;r++)this.words[r]=0;var i,n,o=0;for(r=t.length-6,i=0;r>=e;r-=6)n=a(t,r,r+6),this.words[i]|=n<<o&67108863,this.words[i+1]|=n>>>26-o&4194303,(o+=24)>=26&&(o-=26,i++);r+6!==e&&(n=a(t,e,r+6),this.words[i]|=n<<o&67108863,this.words[i+1]|=n>>>26-o&4194303),this.strip()},o.prototype._parseBase=function(t,e,r){this.words=[0],this.length=1;for(var i=0,n=1;n<=67108863;n*=e)i++;i--,n=n/e|0;for(var o=t.length-r,s=o%i,a=Math.min(o,o-s)+r,h=0,c=r;c<a;c+=i)h=u(t,c,c+i,e),this.imuln(n),this.words[0]+h<67108864?this.words[0]+=h:this._iaddn(h);if(0!==s){var f=1;for(h=u(t,c,t.length,e),c=0;c<s;c++)f*=e;this.imuln(f),this.words[0]+h<67108864?this.words[0]+=h:this._iaddn(h)}},o.prototype.copy=function(t){t.words=new Array(this.length);for(var e=0;e<this.length;e++)t.words[e]=this.words[e];t.length=this.length,t.negative=this.negative,t.red=this.red},o.prototype.clone=function(){var t=new o(null);return this.copy(t),t},o.prototype._expand=function(t){for(;this.length<t;)this.words[this.length++]=0;return this},o.prototype.strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},o.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},o.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var h=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],c=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],f=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function l(t,e,r){r.negative=e.negative^t.negative;var i=t.length+e.length|0;r.length=i,i=i-1|0;var n=0|t.words[0],o=0|e.words[0],s=n*o,a=67108863&s,u=s/67108864|0;r.words[0]=a;for(var h=1;h<i;h++){for(var c=u>>>26,f=67108863&u,l=Math.min(h,e.length-1),d=Math.max(0,h-t.length+1);d<=l;d++){var p=h-d|0;c+=(s=(n=0|t.words[p])*(o=0|e.words[d])+f)/67108864|0,f=67108863&s}r.words[h]=0|f,u=0|c}return 0!==u?r.words[h]=0|u:r.length--,r.strip()}o.prototype.toString=function(t,e){var r;if(e=0|e||1,16===(t=t||10)||"hex"===t){r="";for(var n=0,o=0,s=0;s<this.length;s++){var a=this.words[s],u=(16777215&(a<<n|o)).toString(16);r=0!=(o=a>>>24-n&16777215)||s!==this.length-1?h[6-u.length]+u+r:u+r,(n+=2)>=26&&(n-=26,s--)}for(0!==o&&(r=o.toString(16)+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(t===(0|t)&&t>=2&&t<=36){var l=c[t],d=f[t];r="";var p=this.clone();for(p.negative=0;!p.isZero();){var g=p.modn(d).toString(t);r=(p=p.idivn(d)).isZero()?g+r:h[l-g.length]+g+r}for(this.isZero()&&(r="0"+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}i(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:this.length>2&&i(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},o.prototype.toJSON=function(){return this.toString(16)},o.prototype.toBuffer=function(t,e){return i(void 0!==s),this.toArrayLike(s,t,e)},o.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)},o.prototype.toArrayLike=function(t,e,r){var n=this.byteLength(),o=r||Math.max(1,n);i(n<=o,"byte array longer than desired length"),i(o>0,"Requested array length <= 0"),this.strip();var s,a,u="le"===e,h=new t(o),c=this.clone();if(u){for(a=0;!c.isZero();a++)s=c.andln(255),c.iushrn(8),h[a]=s;for(;a<o;a++)h[a]=0}else{for(a=0;a<o-n;a++)h[a]=0;for(a=0;!c.isZero();a++)s=c.andln(255),c.iushrn(8),h[o-a-1]=s}return h},Math.clz32?o.prototype._countBits=function(t){return 32-Math.clz32(t)}:o.prototype._countBits=function(t){var e=t,r=0;return e>=4096&&(r+=13,e>>>=13),e>=64&&(r+=7,e>>>=7),e>=8&&(r+=4,e>>>=4),e>=2&&(r+=2,e>>>=2),r+e},o.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,r=0;return 0==(8191&e)&&(r+=13,e>>>=13),0==(127&e)&&(r+=7,e>>>=7),0==(15&e)&&(r+=4,e>>>=4),0==(3&e)&&(r+=2,e>>>=2),0==(1&e)&&r++,r},o.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;e<this.length;e++){var r=this._zeroBits(this.words[e]);if(t+=r,26!==r)break}return t},o.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},o.prototype.toTwos=function(t){return 0!==this.negative?this.abs().inotn(t).iaddn(1):this.clone()},o.prototype.fromTwos=function(t){return this.testn(t-1)?this.notn(t).iaddn(1).ineg():this.clone()},o.prototype.isNeg=function(){return 0!==this.negative},o.prototype.neg=function(){return this.clone().ineg()},o.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},o.prototype.iuor=function(t){for(;this.length<t.length;)this.words[this.length++]=0;for(var e=0;e<t.length;e++)this.words[e]=this.words[e]|t.words[e];return this.strip()},o.prototype.ior=function(t){return i(0==(this.negative|t.negative)),this.iuor(t)},o.prototype.or=function(t){return this.length>t.length?this.clone().ior(t):t.clone().ior(this)},o.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},o.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var r=0;r<e.length;r++)this.words[r]=this.words[r]&t.words[r];return this.length=e.length,this.strip()},o.prototype.iand=function(t){return i(0==(this.negative|t.negative)),this.iuand(t)},o.prototype.and=function(t){return this.length>t.length?this.clone().iand(t):t.clone().iand(this)},o.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},o.prototype.iuxor=function(t){var e,r;this.length>t.length?(e=this,r=t):(e=t,r=this);for(var i=0;i<r.length;i++)this.words[i]=e.words[i]^r.words[i];if(this!==e)for(;i<e.length;i++)this.words[i]=e.words[i];return this.length=e.length,this.strip()},o.prototype.ixor=function(t){return i(0==(this.negative|t.negative)),this.iuxor(t)},o.prototype.xor=function(t){return this.length>t.length?this.clone().ixor(t):t.clone().ixor(this)},o.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},o.prototype.inotn=function(t){i("number"==typeof t&&t>=0);var e=0|Math.ceil(t/26),r=t%26;this._expand(e),r>0&&e--;for(var n=0;n<e;n++)this.words[n]=67108863&~this.words[n];return r>0&&(this.words[n]=~this.words[n]&67108863>>26-r),this.strip()},o.prototype.notn=function(t){return this.clone().inotn(t)},o.prototype.setn=function(t,e){i("number"==typeof t&&t>=0);var r=t/26|0,n=t%26;return this._expand(r+1),this.words[r]=e?this.words[r]|1<<n:this.words[r]&~(1<<n),this.strip()},o.prototype.iadd=function(t){var e,r,i;if(0!==this.negative&&0===t.negative)return this.negative=0,e=this.isub(t),this.negative^=1,this._normSign();if(0===this.negative&&0!==t.negative)return t.negative=0,e=this.isub(t),t.negative=1,e._normSign();this.length>t.length?(r=this,i=t):(r=t,i=this);for(var n=0,o=0;o<i.length;o++)e=(0|r.words[o])+(0|i.words[o])+n,this.words[o]=67108863&e,n=e>>>26;for(;0!==n&&o<r.length;o++)e=(0|r.words[o])+n,this.words[o]=67108863&e,n=e>>>26;if(this.length=r.length,0!==n)this.words[this.length]=n,this.length++;else if(r!==this)for(;o<r.length;o++)this.words[o]=r.words[o];return this},o.prototype.add=function(t){var e;return 0!==t.negative&&0===this.negative?(t.negative=0,e=this.sub(t),t.negative^=1,e):0===t.negative&&0!==this.negative?(this.negative=0,e=t.sub(this),this.negative=1,e):this.length>t.length?this.clone().iadd(t):t.clone().iadd(this)},o.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e=this.iadd(t);return t.negative=1,e._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var r,i,n=this.cmp(t);if(0===n)return this.negative=0,this.length=1,this.words[0]=0,this;n>0?(r=this,i=t):(r=t,i=this);for(var o=0,s=0;s<i.length;s++)o=(e=(0|r.words[s])-(0|i.words[s])+o)>>26,this.words[s]=67108863&e;for(;0!==o&&s<r.length;s++)o=(e=(0|r.words[s])+o)>>26,this.words[s]=67108863&e;if(0===o&&s<r.length&&r!==this)for(;s<r.length;s++)this.words[s]=r.words[s];return this.length=Math.max(this.length,s),r!==this&&(this.negative=1),this.strip()},o.prototype.sub=function(t){return this.clone().isub(t)};var d=function(t,e,r){var i,n,o,s=t.words,a=e.words,u=r.words,h=0,c=0|s[0],f=8191&c,l=c>>>13,d=0|s[1],p=8191&d,g=d>>>13,y=0|s[2],m=8191&y,v=y>>>13,b=0|s[3],w=8191&b,_=b>>>13,S=0|s[4],E=8191&S,M=S>>>13,A=0|s[5],C=8191&A,k=A>>>13,I=0|s[6],T=8191&I,R=I>>>13,B=0|s[7],x=8191&B,F=B>>>13,P=0|s[8],N=8191&P,O=P>>>13,L=0|s[9],U=8191&L,j=L>>>13,D=0|a[0],K=8191&D,V=D>>>13,H=0|a[1],q=8191&H,z=H>>>13,W=0|a[2],G=8191&W,J=W>>>13,Z=0|a[3],$=8191&Z,Y=Z>>>13,Q=0|a[4],X=8191&Q,tt=Q>>>13,et=0|a[5],rt=8191&et,it=et>>>13,nt=0|a[6],ot=8191&nt,st=nt>>>13,at=0|a[7],ut=8191&at,ht=at>>>13,ct=0|a[8],ft=8191&ct,lt=ct>>>13,dt=0|a[9],pt=8191&dt,gt=dt>>>13;r.negative=t.negative^e.negative,r.length=19;var yt=(h+(i=Math.imul(f,K))|0)+((8191&(n=(n=Math.imul(f,V))+Math.imul(l,K)|0))<<13)|0;h=((o=Math.imul(l,V))+(n>>>13)|0)+(yt>>>26)|0,yt&=67108863,i=Math.imul(p,K),n=(n=Math.imul(p,V))+Math.imul(g,K)|0,o=Math.imul(g,V);var mt=(h+(i=i+Math.imul(f,q)|0)|0)+((8191&(n=(n=n+Math.imul(f,z)|0)+Math.imul(l,q)|0))<<13)|0;h=((o=o+Math.imul(l,z)|0)+(n>>>13)|0)+(mt>>>26)|0,mt&=67108863,i=Math.imul(m,K),n=(n=Math.imul(m,V))+Math.imul(v,K)|0,o=Math.imul(v,V),i=i+Math.imul(p,q)|0,n=(n=n+Math.imul(p,z)|0)+Math.imul(g,q)|0,o=o+Math.imul(g,z)|0;var vt=(h+(i=i+Math.imul(f,G)|0)|0)+((8191&(n=(n=n+Math.imul(f,J)|0)+Math.imul(l,G)|0))<<13)|0;h=((o=o+Math.imul(l,J)|0)+(n>>>13)|0)+(vt>>>26)|0,vt&=67108863,i=Math.imul(w,K),n=(n=Math.imul(w,V))+Math.imul(_,K)|0,o=Math.imul(_,V),i=i+Math.imul(m,q)|0,n=(n=n+Math.imul(m,z)|0)+Math.imul(v,q)|0,o=o+Math.imul(v,z)|0,i=i+Math.imul(p,G)|0,n=(n=n+Math.imul(p,J)|0)+Math.imul(g,G)|0,o=o+Math.imul(g,J)|0;var bt=(h+(i=i+Math.imul(f,$)|0)|0)+((8191&(n=(n=n+Math.imul(f,Y)|0)+Math.imul(l,$)|0))<<13)|0;h=((o=o+Math.imul(l,Y)|0)+(n>>>13)|0)+(bt>>>26)|0,bt&=67108863,i=Math.imul(E,K),n=(n=Math.imul(E,V))+Math.imul(M,K)|0,o=Math.imul(M,V),i=i+Math.imul(w,q)|0,n=(n=n+Math.imul(w,z)|0)+Math.imul(_,q)|0,o=o+Math.imul(_,z)|0,i=i+Math.imul(m,G)|0,n=(n=n+Math.imul(m,J)|0)+Math.imul(v,G)|0,o=o+Math.imul(v,J)|0,i=i+Math.imul(p,$)|0,n=(n=n+Math.imul(p,Y)|0)+Math.imul(g,$)|0,o=o+Math.imul(g,Y)|0;var wt=(h+(i=i+Math.imul(f,X)|0)|0)+((8191&(n=(n=n+Math.imul(f,tt)|0)+Math.imul(l,X)|0))<<13)|0;h=((o=o+Math.imul(l,tt)|0)+(n>>>13)|0)+(wt>>>26)|0,wt&=67108863,i=Math.imul(C,K),n=(n=Math.imul(C,V))+Math.imul(k,K)|0,o=Math.imul(k,V),i=i+Math.imul(E,q)|0,n=(n=n+Math.imul(E,z)|0)+Math.imul(M,q)|0,o=o+Math.imul(M,z)|0,i=i+Math.imul(w,G)|0,n=(n=n+Math.imul(w,J)|0)+Math.imul(_,G)|0,o=o+Math.imul(_,J)|0,i=i+Math.imul(m,$)|0,n=(n=n+Math.imul(m,Y)|0)+Math.imul(v,$)|0,o=o+Math.imul(v,Y)|0,i=i+Math.imul(p,X)|0,n=(n=n+Math.imul(p,tt)|0)+Math.imul(g,X)|0,o=o+Math.imul(g,tt)|0;var _t=(h+(i=i+Math.imul(f,rt)|0)|0)+((8191&(n=(n=n+Math.imul(f,it)|0)+Math.imul(l,rt)|0))<<13)|0;h=((o=o+Math.imul(l,it)|0)+(n>>>13)|0)+(_t>>>26)|0,_t&=67108863,i=Math.imul(T,K),n=(n=Math.imul(T,V))+Math.imul(R,K)|0,o=Math.imul(R,V),i=i+Math.imul(C,q)|0,n=(n=n+Math.imul(C,z)|0)+Math.imul(k,q)|0,o=o+Math.imul(k,z)|0,i=i+Math.imul(E,G)|0,n=(n=n+Math.imul(E,J)|0)+Math.imul(M,G)|0,o=o+Math.imul(M,J)|0,i=i+Math.imul(w,$)|0,n=(n=n+Math.imul(w,Y)|0)+Math.imul(_,$)|0,o=o+Math.imul(_,Y)|0,i=i+Math.imul(m,X)|0,n=(n=n+Math.imul(m,tt)|0)+Math.imul(v,X)|0,o=o+Math.imul(v,tt)|0,i=i+Math.imul(p,rt)|0,n=(n=n+Math.imul(p,it)|0)+Math.imul(g,rt)|0,o=o+Math.imul(g,it)|0;var St=(h+(i=i+Math.imul(f,ot)|0)|0)+((8191&(n=(n=n+Math.imul(f,st)|0)+Math.imul(l,ot)|0))<<13)|0;h=((o=o+Math.imul(l,st)|0)+(n>>>13)|0)+(St>>>26)|0,St&=67108863,i=Math.imul(x,K),n=(n=Math.imul(x,V))+Math.imul(F,K)|0,o=Math.imul(F,V),i=i+Math.imul(T,q)|0,n=(n=n+Math.imul(T,z)|0)+Math.imul(R,q)|0,o=o+Math.imul(R,z)|0,i=i+Math.imul(C,G)|0,n=(n=n+Math.imul(C,J)|0)+Math.imul(k,G)|0,o=o+Math.imul(k,J)|0,i=i+Math.imul(E,$)|0,n=(n=n+Math.imul(E,Y)|0)+Math.imul(M,$)|0,o=o+Math.imul(M,Y)|0,i=i+Math.imul(w,X)|0,n=(n=n+Math.imul(w,tt)|0)+Math.imul(_,X)|0,o=o+Math.imul(_,tt)|0,i=i+Math.imul(m,rt)|0,n=(n=n+Math.imul(m,it)|0)+Math.imul(v,rt)|0,o=o+Math.imul(v,it)|0,i=i+Math.imul(p,ot)|0,n=(n=n+Math.imul(p,st)|0)+Math.imul(g,ot)|0,o=o+Math.imul(g,st)|0;var Et=(h+(i=i+Math.imul(f,ut)|0)|0)+((8191&(n=(n=n+Math.imul(f,ht)|0)+Math.imul(l,ut)|0))<<13)|0;h=((o=o+Math.imul(l,ht)|0)+(n>>>13)|0)+(Et>>>26)|0,Et&=67108863,i=Math.imul(N,K),n=(n=Math.imul(N,V))+Math.imul(O,K)|0,o=Math.imul(O,V),i=i+Math.imul(x,q)|0,n=(n=n+Math.imul(x,z)|0)+Math.imul(F,q)|0,o=o+Math.imul(F,z)|0,i=i+Math.imul(T,G)|0,n=(n=n+Math.imul(T,J)|0)+Math.imul(R,G)|0,o=o+Math.imul(R,J)|0,i=i+Math.imul(C,$)|0,n=(n=n+Math.imul(C,Y)|0)+Math.imul(k,$)|0,o=o+Math.imul(k,Y)|0,i=i+Math.imul(E,X)|0,n=(n=n+Math.imul(E,tt)|0)+Math.imul(M,X)|0,o=o+Math.imul(M,tt)|0,i=i+Math.imul(w,rt)|0,n=(n=n+Math.imul(w,it)|0)+Math.imul(_,rt)|0,o=o+Math.imul(_,it)|0,i=i+Math.imul(m,ot)|0,n=(n=n+Math.imul(m,st)|0)+Math.imul(v,ot)|0,o=o+Math.imul(v,st)|0,i=i+Math.imul(p,ut)|0,n=(n=n+Math.imul(p,ht)|0)+Math.imul(g,ut)|0,o=o+Math.imul(g,ht)|0;var Mt=(h+(i=i+Math.imul(f,ft)|0)|0)+((8191&(n=(n=n+Math.imul(f,lt)|0)+Math.imul(l,ft)|0))<<13)|0;h=((o=o+Math.imul(l,lt)|0)+(n>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,i=Math.imul(U,K),n=(n=Math.imul(U,V))+Math.imul(j,K)|0,o=Math.imul(j,V),i=i+Math.imul(N,q)|0,n=(n=n+Math.imul(N,z)|0)+Math.imul(O,q)|0,o=o+Math.imul(O,z)|0,i=i+Math.imul(x,G)|0,n=(n=n+Math.imul(x,J)|0)+Math.imul(F,G)|0,o=o+Math.imul(F,J)|0,i=i+Math.imul(T,$)|0,n=(n=n+Math.imul(T,Y)|0)+Math.imul(R,$)|0,o=o+Math.imul(R,Y)|0,i=i+Math.imul(C,X)|0,n=(n=n+Math.imul(C,tt)|0)+Math.imul(k,X)|0,o=o+Math.imul(k,tt)|0,i=i+Math.imul(E,rt)|0,n=(n=n+Math.imul(E,it)|0)+Math.imul(M,rt)|0,o=o+Math.imul(M,it)|0,i=i+Math.imul(w,ot)|0,n=(n=n+Math.imul(w,st)|0)+Math.imul(_,ot)|0,o=o+Math.imul(_,st)|0,i=i+Math.imul(m,ut)|0,n=(n=n+Math.imul(m,ht)|0)+Math.imul(v,ut)|0,o=o+Math.imul(v,ht)|0,i=i+Math.imul(p,ft)|0,n=(n=n+Math.imul(p,lt)|0)+Math.imul(g,ft)|0,o=o+Math.imul(g,lt)|0;var At=(h+(i=i+Math.imul(f,pt)|0)|0)+((8191&(n=(n=n+Math.imul(f,gt)|0)+Math.imul(l,pt)|0))<<13)|0;h=((o=o+Math.imul(l,gt)|0)+(n>>>13)|0)+(At>>>26)|0,At&=67108863,i=Math.imul(U,q),n=(n=Math.imul(U,z))+Math.imul(j,q)|0,o=Math.imul(j,z),i=i+Math.imul(N,G)|0,n=(n=n+Math.imul(N,J)|0)+Math.imul(O,G)|0,o=o+Math.imul(O,J)|0,i=i+Math.imul(x,$)|0,n=(n=n+Math.imul(x,Y)|0)+Math.imul(F,$)|0,o=o+Math.imul(F,Y)|0,i=i+Math.imul(T,X)|0,n=(n=n+Math.imul(T,tt)|0)+Math.imul(R,X)|0,o=o+Math.imul(R,tt)|0,i=i+Math.imul(C,rt)|0,n=(n=n+Math.imul(C,it)|0)+Math.imul(k,rt)|0,o=o+Math.imul(k,it)|0,i=i+Math.imul(E,ot)|0,n=(n=n+Math.imul(E,st)|0)+Math.imul(M,ot)|0,o=o+Math.imul(M,st)|0,i=i+Math.imul(w,ut)|0,n=(n=n+Math.imul(w,ht)|0)+Math.imul(_,ut)|0,o=o+Math.imul(_,ht)|0,i=i+Math.imul(m,ft)|0,n=(n=n+Math.imul(m,lt)|0)+Math.imul(v,ft)|0,o=o+Math.imul(v,lt)|0;var Ct=(h+(i=i+Math.imul(p,pt)|0)|0)+((8191&(n=(n=n+Math.imul(p,gt)|0)+Math.imul(g,pt)|0))<<13)|0;h=((o=o+Math.imul(g,gt)|0)+(n>>>13)|0)+(Ct>>>26)|0,Ct&=67108863,i=Math.imul(U,G),n=(n=Math.imul(U,J))+Math.imul(j,G)|0,o=Math.imul(j,J),i=i+Math.imul(N,$)|0,n=(n=n+Math.imul(N,Y)|0)+Math.imul(O,$)|0,o=o+Math.imul(O,Y)|0,i=i+Math.imul(x,X)|0,n=(n=n+Math.imul(x,tt)|0)+Math.imul(F,X)|0,o=o+Math.imul(F,tt)|0,i=i+Math.imul(T,rt)|0,n=(n=n+Math.imul(T,it)|0)+Math.imul(R,rt)|0,o=o+Math.imul(R,it)|0,i=i+Math.imul(C,ot)|0,n=(n=n+Math.imul(C,st)|0)+Math.imul(k,ot)|0,o=o+Math.imul(k,st)|0,i=i+Math.imul(E,ut)|0,n=(n=n+Math.imul(E,ht)|0)+Math.imul(M,ut)|0,o=o+Math.imul(M,ht)|0,i=i+Math.imul(w,ft)|0,n=(n=n+Math.imul(w,lt)|0)+Math.imul(_,ft)|0,o=o+Math.imul(_,lt)|0;var kt=(h+(i=i+Math.imul(m,pt)|0)|0)+((8191&(n=(n=n+Math.imul(m,gt)|0)+Math.imul(v,pt)|0))<<13)|0;h=((o=o+Math.imul(v,gt)|0)+(n>>>13)|0)+(kt>>>26)|0,kt&=67108863,i=Math.imul(U,$),n=(n=Math.imul(U,Y))+Math.imul(j,$)|0,o=Math.imul(j,Y),i=i+Math.imul(N,X)|0,n=(n=n+Math.imul(N,tt)|0)+Math.imul(O,X)|0,o=o+Math.imul(O,tt)|0,i=i+Math.imul(x,rt)|0,n=(n=n+Math.imul(x,it)|0)+Math.imul(F,rt)|0,o=o+Math.imul(F,it)|0,i=i+Math.imul(T,ot)|0,n=(n=n+Math.imul(T,st)|0)+Math.imul(R,ot)|0,o=o+Math.imul(R,st)|0,i=i+Math.imul(C,ut)|0,n=(n=n+Math.imul(C,ht)|0)+Math.imul(k,ut)|0,o=o+Math.imul(k,ht)|0,i=i+Math.imul(E,ft)|0,n=(n=n+Math.imul(E,lt)|0)+Math.imul(M,ft)|0,o=o+Math.imul(M,lt)|0;var It=(h+(i=i+Math.imul(w,pt)|0)|0)+((8191&(n=(n=n+Math.imul(w,gt)|0)+Math.imul(_,pt)|0))<<13)|0;h=((o=o+Math.imul(_,gt)|0)+(n>>>13)|0)+(It>>>26)|0,It&=67108863,i=Math.imul(U,X),n=(n=Math.imul(U,tt))+Math.imul(j,X)|0,o=Math.imul(j,tt),i=i+Math.imul(N,rt)|0,n=(n=n+Math.imul(N,it)|0)+Math.imul(O,rt)|0,o=o+Math.imul(O,it)|0,i=i+Math.imul(x,ot)|0,n=(n=n+Math.imul(x,st)|0)+Math.imul(F,ot)|0,o=o+Math.imul(F,st)|0,i=i+Math.imul(T,ut)|0,n=(n=n+Math.imul(T,ht)|0)+Math.imul(R,ut)|0,o=o+Math.imul(R,ht)|0,i=i+Math.imul(C,ft)|0,n=(n=n+Math.imul(C,lt)|0)+Math.imul(k,ft)|0,o=o+Math.imul(k,lt)|0;var Tt=(h+(i=i+Math.imul(E,pt)|0)|0)+((8191&(n=(n=n+Math.imul(E,gt)|0)+Math.imul(M,pt)|0))<<13)|0;h=((o=o+Math.imul(M,gt)|0)+(n>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,i=Math.imul(U,rt),n=(n=Math.imul(U,it))+Math.imul(j,rt)|0,o=Math.imul(j,it),i=i+Math.imul(N,ot)|0,n=(n=n+Math.imul(N,st)|0)+Math.imul(O,ot)|0,o=o+Math.imul(O,st)|0,i=i+Math.imul(x,ut)|0,n=(n=n+Math.imul(x,ht)|0)+Math.imul(F,ut)|0,o=o+Math.imul(F,ht)|0,i=i+Math.imul(T,ft)|0,n=(n=n+Math.imul(T,lt)|0)+Math.imul(R,ft)|0,o=o+Math.imul(R,lt)|0;var Rt=(h+(i=i+Math.imul(C,pt)|0)|0)+((8191&(n=(n=n+Math.imul(C,gt)|0)+Math.imul(k,pt)|0))<<13)|0;h=((o=o+Math.imul(k,gt)|0)+(n>>>13)|0)+(Rt>>>26)|0,Rt&=67108863,i=Math.imul(U,ot),n=(n=Math.imul(U,st))+Math.imul(j,ot)|0,o=Math.imul(j,st),i=i+Math.imul(N,ut)|0,n=(n=n+Math.imul(N,ht)|0)+Math.imul(O,ut)|0,o=o+Math.imul(O,ht)|0,i=i+Math.imul(x,ft)|0,n=(n=n+Math.imul(x,lt)|0)+Math.imul(F,ft)|0,o=o+Math.imul(F,lt)|0;var Bt=(h+(i=i+Math.imul(T,pt)|0)|0)+((8191&(n=(n=n+Math.imul(T,gt)|0)+Math.imul(R,pt)|0))<<13)|0;h=((o=o+Math.imul(R,gt)|0)+(n>>>13)|0)+(Bt>>>26)|0,Bt&=67108863,i=Math.imul(U,ut),n=(n=Math.imul(U,ht))+Math.imul(j,ut)|0,o=Math.imul(j,ht),i=i+Math.imul(N,ft)|0,n=(n=n+Math.imul(N,lt)|0)+Math.imul(O,ft)|0,o=o+Math.imul(O,lt)|0;var xt=(h+(i=i+Math.imul(x,pt)|0)|0)+((8191&(n=(n=n+Math.imul(x,gt)|0)+Math.imul(F,pt)|0))<<13)|0;h=((o=o+Math.imul(F,gt)|0)+(n>>>13)|0)+(xt>>>26)|0,xt&=67108863,i=Math.imul(U,ft),n=(n=Math.imul(U,lt))+Math.imul(j,ft)|0,o=Math.imul(j,lt);var Ft=(h+(i=i+Math.imul(N,pt)|0)|0)+((8191&(n=(n=n+Math.imul(N,gt)|0)+Math.imul(O,pt)|0))<<13)|0;h=((o=o+Math.imul(O,gt)|0)+(n>>>13)|0)+(Ft>>>26)|0,Ft&=67108863;var Pt=(h+(i=Math.imul(U,pt))|0)+((8191&(n=(n=Math.imul(U,gt))+Math.imul(j,pt)|0))<<13)|0;return h=((o=Math.imul(j,gt))+(n>>>13)|0)+(Pt>>>26)|0,Pt&=67108863,u[0]=yt,u[1]=mt,u[2]=vt,u[3]=bt,u[4]=wt,u[5]=_t,u[6]=St,u[7]=Et,u[8]=Mt,u[9]=At,u[10]=Ct,u[11]=kt,u[12]=It,u[13]=Tt,u[14]=Rt,u[15]=Bt,u[16]=xt,u[17]=Ft,u[18]=Pt,0!==h&&(u[19]=h,r.length++),r};function p(t,e,r){return(new g).mulp(t,e,r)}function g(t,e){this.x=t,this.y=e}Math.imul||(d=l),o.prototype.mulTo=function(t,e){var r=this.length+t.length;return 10===this.length&&10===t.length?d(this,t,e):r<63?l(this,t,e):r<1024?function(t,e,r){r.negative=e.negative^t.negative,r.length=t.length+e.length;for(var i=0,n=0,o=0;o<r.length-1;o++){var s=n;n=0;for(var a=67108863&i,u=Math.min(o,e.length-1),h=Math.max(0,o-t.length+1);h<=u;h++){var c=o-h,f=(0|t.words[c])*(0|e.words[h]),l=67108863&f;a=67108863&(l=l+a|0),n+=(s=(s=s+(f/67108864|0)|0)+(l>>>26)|0)>>>26,s&=67108863}r.words[o]=a,i=s,s=n}return 0!==i?r.words[o]=i:r.length--,r.strip()}(this,t,e):p(this,t,e)},g.prototype.makeRBT=function(t){for(var e=new Array(t),r=o.prototype._countBits(t)-1,i=0;i<t;i++)e[i]=this.revBin(i,r,t);return e},g.prototype.revBin=function(t,e,r){if(0===t||t===r-1)return t;for(var i=0,n=0;n<e;n++)i|=(1&t)<<e-n-1,t>>=1;return i},g.prototype.permute=function(t,e,r,i,n,o){for(var s=0;s<o;s++)i[s]=e[t[s]],n[s]=r[t[s]]},g.prototype.transform=function(t,e,r,i,n,o){this.permute(o,t,e,r,i,n);for(var s=1;s<n;s<<=1)for(var a=s<<1,u=Math.cos(2*Math.PI/a),h=Math.sin(2*Math.PI/a),c=0;c<n;c+=a)for(var f=u,l=h,d=0;d<s;d++){var p=r[c+d],g=i[c+d],y=r[c+d+s],m=i[c+d+s],v=f*y-l*m;m=f*m+l*y,y=v,r[c+d]=p+y,i[c+d]=g+m,r[c+d+s]=p-y,i[c+d+s]=g-m,d!==a&&(v=u*f-h*l,l=u*l+h*f,f=v)}},g.prototype.guessLen13b=function(t,e){var r=1|Math.max(e,t),i=1&r,n=0;for(r=r/2|0;r;r>>>=1)n++;return 1<<n+1+i},g.prototype.conjugate=function(t,e,r){if(!(r<=1))for(var i=0;i<r/2;i++){var n=t[i];t[i]=t[r-i-1],t[r-i-1]=n,n=e[i],e[i]=-e[r-i-1],e[r-i-1]=-n}},g.prototype.normalize13b=function(t,e){for(var r=0,i=0;i<e/2;i++){var n=8192*Math.round(t[2*i+1]/e)+Math.round(t[2*i]/e)+r;t[i]=67108863&n,r=n<67108864?0:n/67108864|0}return t},g.prototype.convert13b=function(t,e,r,n){for(var o=0,s=0;s<e;s++)o+=0|t[s],r[2*s]=8191&o,o>>>=13,r[2*s+1]=8191&o,o>>>=13;for(s=2*e;s<n;++s)r[s]=0;i(0===o),i(0==(-8192&o))},g.prototype.stub=function(t){for(var e=new Array(t),r=0;r<t;r++)e[r]=0;return e},g.prototype.mulp=function(t,e,r){var i=2*this.guessLen13b(t.length,e.length),n=this.makeRBT(i),o=this.stub(i),s=new Array(i),a=new Array(i),u=new Array(i),h=new Array(i),c=new Array(i),f=new Array(i),l=r.words;l.length=i,this.convert13b(t.words,t.length,s,i),this.convert13b(e.words,e.length,h,i),this.transform(s,o,a,u,i,n),this.transform(h,o,c,f,i,n);for(var d=0;d<i;d++){var p=a[d]*c[d]-u[d]*f[d];u[d]=a[d]*f[d]+u[d]*c[d],a[d]=p}return this.conjugate(a,u,i),this.transform(a,u,l,o,i,n),this.conjugate(l,o,i),this.normalize13b(l,i),r.negative=t.negative^e.negative,r.length=t.length+e.length,r.strip()},o.prototype.mul=function(t){var e=new o(null);return e.words=new Array(this.length+t.length),this.mulTo(t,e)},o.prototype.mulf=function(t){var e=new o(null);return e.words=new Array(this.length+t.length),p(this,t,e)},o.prototype.imul=function(t){return this.clone().mulTo(t,this)},o.prototype.imuln=function(t){i("number"==typeof t),i(t<67108864);for(var e=0,r=0;r<this.length;r++){var n=(0|this.words[r])*t,o=(67108863&n)+(67108863&e);e>>=26,e+=n/67108864|0,e+=o>>>26,this.words[r]=67108863&o}return 0!==e&&(this.words[r]=e,this.length++),this},o.prototype.muln=function(t){return this.clone().imuln(t)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(t){var e=function(t){for(var e=new Array(t.bitLength()),r=0;r<e.length;r++){var i=r/26|0,n=r%26;e[r]=(t.words[i]&1<<n)>>>n}return e}(t);if(0===e.length)return new o(1);for(var r=this,i=0;i<e.length&&0===e[i];i++,r=r.sqr());if(++i<e.length)for(var n=r.sqr();i<e.length;i++,n=n.sqr())0!==e[i]&&(r=r.mul(n));return r},o.prototype.iushln=function(t){i("number"==typeof t&&t>=0);var e,r=t%26,n=(t-r)/26,o=67108863>>>26-r<<26-r;if(0!==r){var s=0;for(e=0;e<this.length;e++){var a=this.words[e]&o,u=(0|this.words[e])-a<<r;this.words[e]=u|s,s=a>>>26-r}s&&(this.words[e]=s,this.length++)}if(0!==n){for(e=this.length-1;e>=0;e--)this.words[e+n]=this.words[e];for(e=0;e<n;e++)this.words[e]=0;this.length+=n}return this.strip()},o.prototype.ishln=function(t){return i(0===this.negative),this.iushln(t)},o.prototype.iushrn=function(t,e,r){var n;i("number"==typeof t&&t>=0),n=e?(e-e%26)/26:0;var o=t%26,s=Math.min((t-o)/26,this.length),a=67108863^67108863>>>o<<o,u=r;if(n-=s,n=Math.max(0,n),u){for(var h=0;h<s;h++)u.words[h]=this.words[h];u.length=s}if(0===s);else if(this.length>s)for(this.length-=s,h=0;h<this.length;h++)this.words[h]=this.words[h+s];else this.words[0]=0,this.length=1;var c=0;for(h=this.length-1;h>=0&&(0!==c||h>=n);h--){var f=0|this.words[h];this.words[h]=c<<26-o|f>>>o,c=f&a}return u&&0!==c&&(u.words[u.length++]=c),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},o.prototype.ishrn=function(t,e,r){return i(0===this.negative),this.iushrn(t,e,r)},o.prototype.shln=function(t){return this.clone().ishln(t)},o.prototype.ushln=function(t){return this.clone().iushln(t)},o.prototype.shrn=function(t){return this.clone().ishrn(t)},o.prototype.ushrn=function(t){return this.clone().iushrn(t)},o.prototype.testn=function(t){i("number"==typeof t&&t>=0);var e=t%26,r=(t-e)/26,n=1<<e;return!(this.length<=r||!(this.words[r]&n))},o.prototype.imaskn=function(t){i("number"==typeof t&&t>=0);var e=t%26,r=(t-e)/26;if(i(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==e&&r++,this.length=Math.min(r,this.length),0!==e){var n=67108863^67108863>>>e<<e;this.words[this.length-1]&=n}return this.strip()},o.prototype.maskn=function(t){return this.clone().imaskn(t)},o.prototype.iaddn=function(t){return i("number"==typeof t),i(t<67108864),t<0?this.isubn(-t):0!==this.negative?1===this.length&&(0|this.words[0])<t?(this.words[0]=t-(0|this.words[0]),this.negative=0,this):(this.negative=0,this.isubn(t),this.negative=1,this):this._iaddn(t)},o.prototype._iaddn=function(t){this.words[0]+=t;for(var e=0;e<this.length&&this.words[e]>=67108864;e++)this.words[e]-=67108864,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},o.prototype.isubn=function(t){if(i("number"==typeof t),i(t<67108864),t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var e=0;e<this.length&&this.words[e]<0;e++)this.words[e]+=67108864,this.words[e+1]-=1;return this.strip()},o.prototype.addn=function(t){return this.clone().iaddn(t)},o.prototype.subn=function(t){return this.clone().isubn(t)},o.prototype.iabs=function(){return this.negative=0,this},o.prototype.abs=function(){return this.clone().iabs()},o.prototype._ishlnsubmul=function(t,e,r){var n,o,s=t.length+r;this._expand(s);var a=0;for(n=0;n<t.length;n++){o=(0|this.words[n+r])+a;var u=(0|t.words[n])*e;a=((o-=67108863&u)>>26)-(u/67108864|0),this.words[n+r]=67108863&o}for(;n<this.length-r;n++)a=(o=(0|this.words[n+r])+a)>>26,this.words[n+r]=67108863&o;if(0===a)return this.strip();for(i(-1===a),a=0,n=0;n<this.length;n++)a=(o=-(0|this.words[n])+a)>>26,this.words[n]=67108863&o;return this.negative=1,this.strip()},o.prototype._wordDiv=function(t,e){var r=(this.length,t.length),i=this.clone(),n=t,s=0|n.words[n.length-1];0!=(r=26-this._countBits(s))&&(n=n.ushln(r),i.iushln(r),s=0|n.words[n.length-1]);var a,u=i.length-n.length;if("mod"!==e){(a=new o(null)).length=u+1,a.words=new Array(a.length);for(var h=0;h<a.length;h++)a.words[h]=0}var c=i.clone()._ishlnsubmul(n,1,u);0===c.negative&&(i=c,a&&(a.words[u]=1));for(var f=u-1;f>=0;f--){var l=67108864*(0|i.words[n.length+f])+(0|i.words[n.length+f-1]);for(l=Math.min(l/s|0,67108863),i._ishlnsubmul(n,l,f);0!==i.negative;)l--,i.negative=0,i._ishlnsubmul(n,1,f),i.isZero()||(i.negative^=1);a&&(a.words[f]=l)}return a&&a.strip(),i.strip(),"div"!==e&&0!==r&&i.iushrn(r),{div:a||null,mod:i}},o.prototype.divmod=function(t,e,r){return i(!t.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===t.negative?(a=this.neg().divmod(t,e),"mod"!==e&&(n=a.div.neg()),"div"!==e&&(s=a.mod.neg(),r&&0!==s.negative&&s.iadd(t)),{div:n,mod:s}):0===this.negative&&0!==t.negative?(a=this.divmod(t.neg(),e),"mod"!==e&&(n=a.div.neg()),{div:n,mod:a.mod}):0!=(this.negative&t.negative)?(a=this.neg().divmod(t.neg(),e),"div"!==e&&(s=a.mod.neg(),r&&0!==s.negative&&s.isub(t)),{div:a.div,mod:s}):t.length>this.length||this.cmp(t)<0?{div:new o(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new o(this.modn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new o(this.modn(t.words[0]))}:this._wordDiv(t,e);var n,s,a},o.prototype.div=function(t){return this.divmod(t,"div",!1).div},o.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},o.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},o.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var r=0!==e.div.negative?e.mod.isub(t):e.mod,i=t.ushrn(1),n=t.andln(1),o=r.cmp(i);return o<0||1===n&&0===o?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},o.prototype.modn=function(t){i(t<=67108863);for(var e=(1<<26)%t,r=0,n=this.length-1;n>=0;n--)r=(e*r+(0|this.words[n]))%t;return r},o.prototype.idivn=function(t){i(t<=67108863);for(var e=0,r=this.length-1;r>=0;r--){var n=(0|this.words[r])+67108864*e;this.words[r]=n/t|0,e=n%t}return this.strip()},o.prototype.divn=function(t){return this.clone().idivn(t)},o.prototype.egcd=function(t){i(0===t.negative),i(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var n=new o(1),s=new o(0),a=new o(0),u=new o(1),h=0;e.isEven()&&r.isEven();)e.iushrn(1),r.iushrn(1),++h;for(var c=r.clone(),f=e.clone();!e.isZero();){for(var l=0,d=1;0==(e.words[0]&d)&&l<26;++l,d<<=1);if(l>0)for(e.iushrn(l);l-- >0;)(n.isOdd()||s.isOdd())&&(n.iadd(c),s.isub(f)),n.iushrn(1),s.iushrn(1);for(var p=0,g=1;0==(r.words[0]&g)&&p<26;++p,g<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(a.isOdd()||u.isOdd())&&(a.iadd(c),u.isub(f)),a.iushrn(1),u.iushrn(1);e.cmp(r)>=0?(e.isub(r),n.isub(a),s.isub(u)):(r.isub(e),a.isub(n),u.isub(s))}return{a,b:u,gcd:r.iushln(h)}},o.prototype._invmp=function(t){i(0===t.negative),i(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var n,s=new o(1),a=new o(0),u=r.clone();e.cmpn(1)>0&&r.cmpn(1)>0;){for(var h=0,c=1;0==(e.words[0]&c)&&h<26;++h,c<<=1);if(h>0)for(e.iushrn(h);h-- >0;)s.isOdd()&&s.iadd(u),s.iushrn(1);for(var f=0,l=1;0==(r.words[0]&l)&&f<26;++f,l<<=1);if(f>0)for(r.iushrn(f);f-- >0;)a.isOdd()&&a.iadd(u),a.iushrn(1);e.cmp(r)>=0?(e.isub(r),s.isub(a)):(r.isub(e),a.isub(s))}return(n=0===e.cmpn(1)?s:a).cmpn(0)<0&&n.iadd(t),n},o.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),r=t.clone();e.negative=0,r.negative=0;for(var i=0;e.isEven()&&r.isEven();i++)e.iushrn(1),r.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;r.isEven();)r.iushrn(1);var n=e.cmp(r);if(n<0){var o=e;e=r,r=o}else if(0===n||0===r.cmpn(1))break;e.isub(r)}return r.iushln(i)},o.prototype.invm=function(t){return this.egcd(t).a.umod(t)},o.prototype.isEven=function(){return 0==(1&this.words[0])},o.prototype.isOdd=function(){return 1==(1&this.words[0])},o.prototype.andln=function(t){return this.words[0]&t},o.prototype.bincn=function(t){i("number"==typeof t);var e=t%26,r=(t-e)/26,n=1<<e;if(this.length<=r)return this._expand(r+1),this.words[r]|=n,this;for(var o=n,s=r;0!==o&&s<this.length;s++){var a=0|this.words[s];o=(a+=o)>>>26,a&=67108863,this.words[s]=a}return 0!==o&&(this.words[s]=o,this.length++),this},o.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},o.prototype.cmpn=function(t){var e,r=t<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this.strip(),this.length>1)e=1;else{r&&(t=-t),i(t<=67108863,"Number is too big");var n=0|this.words[0];e=n===t?0:n<t?-1:1}return 0!==this.negative?0|-e:e},o.prototype.cmp=function(t){if(0!==this.negative&&0===t.negative)return-1;if(0===this.negative&&0!==t.negative)return 1;var e=this.ucmp(t);return 0!==this.negative?0|-e:e},o.prototype.ucmp=function(t){if(this.length>t.length)return 1;if(this.length<t.length)return-1;for(var e=0,r=this.length-1;r>=0;r--){var i=0|this.words[r],n=0|t.words[r];if(i!==n){i<n?e=-1:i>n&&(e=1);break}}return e},o.prototype.gtn=function(t){return 1===this.cmpn(t)},o.prototype.gt=function(t){return 1===this.cmp(t)},o.prototype.gten=function(t){return this.cmpn(t)>=0},o.prototype.gte=function(t){return this.cmp(t)>=0},o.prototype.ltn=function(t){return-1===this.cmpn(t)},o.prototype.lt=function(t){return-1===this.cmp(t)},o.prototype.lten=function(t){return this.cmpn(t)<=0},o.prototype.lte=function(t){return this.cmp(t)<=0},o.prototype.eqn=function(t){return 0===this.cmpn(t)},o.prototype.eq=function(t){return 0===this.cmp(t)},o.red=function(t){return new S(t)},o.prototype.toRed=function(t){return i(!this.red,"Already a number in reduction context"),i(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},o.prototype.fromRed=function(){return i(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(t){return this.red=t,this},o.prototype.forceRed=function(t){return i(!this.red,"Already a number in reduction context"),this._forceRed(t)},o.prototype.redAdd=function(t){return i(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},o.prototype.redIAdd=function(t){return i(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},o.prototype.redSub=function(t){return i(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},o.prototype.redISub=function(t){return i(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},o.prototype.redShl=function(t){return i(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},o.prototype.redMul=function(t){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},o.prototype.redIMul=function(t){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},o.prototype.redSqr=function(){return i(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return i(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return i(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return i(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return i(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(t){return i(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var y={k256:null,p224:null,p192:null,p25519:null};function m(t,e){this.name=t,this.p=new o(e,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function v(){m.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function b(){m.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function w(){m.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function _(){m.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function S(t){if("string"==typeof t){var e=o._prime(t);this.m=e.p,this.prime=e}else i(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function E(t){S.call(this,t),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new o(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}m.prototype._tmp=function(){var t=new o(null);return t.words=new Array(Math.ceil(this.n/13)),t},m.prototype.ireduce=function(t){var e,r=t;do{this.split(r,this.tmp),e=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(e>this.n);var i=e<this.n?-1:r.ucmp(this.p);return 0===i?(r.words[0]=0,r.length=1):i>0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},m.prototype.split=function(t,e){t.iushrn(this.n,0,e)},m.prototype.imulK=function(t){return t.imul(this.k)},n(v,m),v.prototype.split=function(t,e){for(var r=4194303,i=Math.min(t.length,9),n=0;n<i;n++)e.words[n]=t.words[n];if(e.length=i,t.length<=9)return t.words[0]=0,void(t.length=1);var o=t.words[9];for(e.words[e.length++]=o&r,n=10;n<t.length;n++){var s=0|t.words[n];t.words[n-10]=(s&r)<<4|o>>>22,o=s}o>>>=22,t.words[n-10]=o,0===o&&t.length>10?t.length-=10:t.length-=9},v.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,r=0;r<t.length;r++){var i=0|t.words[r];e+=977*i,t.words[r]=67108863&e,e=64*i+(e/67108864|0)}return 0===t.words[t.length-1]&&(t.length--,0===t.words[t.length-1]&&t.length--),t},n(b,m),n(w,m),n(_,m),_.prototype.imulK=function(t){for(var e=0,r=0;r<t.length;r++){var i=19*(0|t.words[r])+e,n=67108863&i;i>>>=26,t.words[r]=n,e=i}return 0!==e&&(t.words[t.length++]=e),t},o._prime=function(t){if(y[t])return y[t];var e;if("k256"===t)e=new v;else if("p224"===t)e=new b;else if("p192"===t)e=new w;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new _}return y[t]=e,e},S.prototype._verify1=function(t){i(0===t.negative,"red works only with positives"),i(t.red,"red works only with red numbers")},S.prototype._verify2=function(t,e){i(0==(t.negative|e.negative),"red works only with positives"),i(t.red&&t.red===e.red,"red works only with red numbers")},S.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.umod(this.m)._forceRed(this)},S.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},S.prototype.add=function(t,e){this._verify2(t,e);var r=t.add(e);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},S.prototype.iadd=function(t,e){this._verify2(t,e);var r=t.iadd(e);return r.cmp(this.m)>=0&&r.isub(this.m),r},S.prototype.sub=function(t,e){this._verify2(t,e);var r=t.sub(e);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},S.prototype.isub=function(t,e){this._verify2(t,e);var r=t.isub(e);return r.cmpn(0)<0&&r.iadd(this.m),r},S.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},S.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},S.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},S.prototype.isqr=function(t){return this.imul(t,t.clone())},S.prototype.sqr=function(t){return this.mul(t,t)},S.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(i(e%2==1),3===e){var r=this.m.add(new o(1)).iushrn(2);return this.pow(t,r)}for(var n=this.m.subn(1),s=0;!n.isZero()&&0===n.andln(1);)s++,n.iushrn(1);i(!n.isZero());var a=new o(1).toRed(this),u=a.redNeg(),h=this.m.subn(1).iushrn(1),c=this.m.bitLength();for(c=new o(2*c*c).toRed(this);0!==this.pow(c,h).cmp(u);)c.redIAdd(u);for(var f=this.pow(c,n),l=this.pow(t,n.addn(1).iushrn(1)),d=this.pow(t,n),p=s;0!==d.cmp(a);){for(var g=d,y=0;0!==g.cmp(a);y++)g=g.redSqr();i(y<p);var m=this.pow(f,new o(1).iushln(p-y-1));l=l.redMul(m),f=m.redSqr(),d=d.redMul(f),p=y}return l},S.prototype.invm=function(t){var e=t._invmp(this.m);return 0!==e.negative?(e.negative=0,this.imod(e).redNeg()):this.imod(e)},S.prototype.pow=function(t,e){if(e.isZero())return new o(1).toRed(this);if(0===e.cmpn(1))return t.clone();var r=new Array(16);r[0]=new o(1).toRed(this),r[1]=t;for(var i=2;i<r.length;i++)r[i]=this.mul(r[i-1],t);var n=r[0],s=0,a=0,u=e.bitLength()%26;for(0===u&&(u=26),i=e.length-1;i>=0;i--){for(var h=e.words[i],c=u-1;c>=0;c--){var f=h>>c&1;n!==r[0]&&(n=this.sqr(n)),0!==f||0!==s?(s<<=1,s|=f,(4==++a||0===i&&0===c)&&(n=this.mul(n,r[s]),a=0,s=0)):a=0}u=26}return n},S.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},S.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},o.mont=function(t){return new E(t)},n(E,S),E.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},E.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},E.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var r=t.imul(e),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(i).iushrn(this.shift),o=n;return n.cmp(this.m)>=0?o=n.isub(this.m):n.cmpn(0)<0&&(o=n.iadd(this.m)),o._forceRed(this)},E.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new o(0)._forceRed(this);var r=t.mul(e),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(i).iushrn(this.shift),s=n;return n.cmp(this.m)>=0?s=n.isub(this.m):n.cmpn(0)<0&&(s=n.iadd(this.m)),s._forceRed(this)},E.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(t=r.nmd(t),this)},26138:(t,e,r)=>{var i=r(70980),n=r(99199),o=r(57859),s=r(92144),a=r(23663),u=r(23482),h=r(84818),c=r(89509).Buffer;t.exports=function(t,e,r){var f;f=t.padding?t.padding:r?1:4;var l,d=i(t),p=d.modulus.byteLength();if(e.length>p||new s(e).cmp(d.modulus)>=0)throw new Error("decryption error");l=r?h(new s(e),d):a(e,d);var g=c.alloc(p-l.length);if(l=c.concat([g,l],p),4===f)return function(t,e){var r=t.modulus.byteLength(),i=u("sha1").update(c.alloc(0)).digest(),s=i.length;if(0!==e[0])throw new Error("decryption error");var a=e.slice(1,s+1),h=e.slice(s+1),f=o(a,n(h,s)),l=o(h,n(f,r-s-1));if(function(t,e){t=c.from(t),e=c.from(e);var r=0,i=t.length;t.length!==e.length&&(r++,i=Math.min(t.length,e.length));for(var n=-1;++n<i;)r+=t[n]^e[n];return r}(i,l.slice(0,s)))throw new Error("decryption error");for(var d=s;0===l[d];)d++;if(1!==l[d++])throw new Error("decryption error");return l.slice(d)}(d,l);if(1===f)return function(t,e,r){for(var i=e.slice(0,2),n=2,o=0;0!==e[n++];)if(n>=e.length){o++;break}var s=e.slice(2,n-1);if(("0002"!==i.toString("hex")&&!r||"0001"!==i.toString("hex")&&r)&&o++,s.length<8&&o++,o)throw new Error("decryption error");return e.slice(n)}(0,l,r);if(3===f)return l;throw new Error("unknown padding")}},16559:(t,e,r)=>{var i=r(70980),n=r(61798),o=r(23482),s=r(99199),a=r(57859),u=r(92144),h=r(84818),c=r(23663),f=r(89509).Buffer;t.exports=function(t,e,r){var l;l=t.padding?t.padding:r?1:4;var d,p=i(t);if(4===l)d=function(t,e){var r=t.modulus.byteLength(),i=e.length,h=o("sha1").update(f.alloc(0)).digest(),c=h.length,l=2*c;if(i>r-l-2)throw new Error("message too long");var d=f.alloc(r-i-l-2),p=r-c-1,g=n(c),y=a(f.concat([h,d,f.alloc(1,1),e],p),s(g,p)),m=a(g,s(y,c));return new u(f.concat([f.alloc(1),m,y],r))}(p,e);else if(1===l)d=function(t,e,r){var i,o=e.length,s=t.modulus.byteLength();if(o>s-11)throw new Error("message too long");return i=r?f.alloc(s-o-3,255):function(t){for(var e,r=f.allocUnsafe(t),i=0,o=n(2*t),s=0;i<t;)s===o.length&&(o=n(2*t),s=0),(e=o[s++])&&(r[i++]=e);return r}(s-o-3),new u(f.concat([f.from([0,r?1:2]),i,f.alloc(1),e],s))}(p,e,r);else{if(3!==l)throw new Error("unknown padding");if((d=new u(e)).cmp(p.modulus)>=0)throw new Error("data too long for modulus")}return r?c(d,p):h(d,p)}},84818:(t,e,r)=>{var i=r(92144),n=r(89509).Buffer;t.exports=function(t,e){return n.from(t.toRed(i.mont(e.modulus)).redPow(new i(e.publicExponent)).fromRed().toArray())}},57859:t=>{t.exports=function(t,e){for(var r=t.length,i=-1;++i<r;)t[i]^=e[i];return t}},61798:(t,e,r)=>{"use strict";var i=65536,n=r(89509).Buffer,o=r.g.crypto||r.g.msCrypto;o&&o.getRandomValues?t.exports=function(t,e){if(t>4294967295)throw new RangeError("requested too many random bytes");var r=n.allocUnsafe(t);if(t>0)if(t>i)for(var s=0;s<t;s+=i)o.getRandomValues(r.slice(s,s+i));else o.getRandomValues(r);return"function"==typeof e?process.nextTick((function(){e(null,r)})):r}:t.exports=function(){throw new Error("Secure random number generation is not supported by this browser.\nUse Chrome, Firefox or Internet Explorer 11")}},77963:(t,e,r)=>{"use strict";function i(){throw new Error("secure random number generation not supported by this browser\nuse chrome, FireFox or Internet Explorer 11")}var n=r(89509),o=r(61798),s=n.Buffer,a=n.kMaxLength,u=r.g.crypto||r.g.msCrypto,h=Math.pow(2,32)-1;function c(t,e){if("number"!=typeof t||t!=t)throw new TypeError("offset must be a number");if(t>h||t<0)throw new TypeError("offset must be a uint32");if(t>a||t>e)throw new RangeError("offset out of range")}function f(t,e,r){if("number"!=typeof t||t!=t)throw new TypeError("size must be a number");if(t>h||t<0)throw new TypeError("size must be a uint32");if(t+e>r||t>a)throw new RangeError("buffer too small")}function l(t,e,r,i){if(process.browser){var n=t.buffer,s=new Uint8Array(n,e,r);return u.getRandomValues(s),i?void process.nextTick((function(){i(null,t)})):t}if(!i)return o(r).copy(t,e),t;o(r,(function(r,n){if(r)return i(r);n.copy(t,e),i(null,t)}))}u&&u.getRandomValues||!process.browser?(e.randomFill=function(t,e,i,n){if(!(s.isBuffer(t)||t instanceof r.g.Uint8Array))throw new TypeError('"buf" argument must be a Buffer or Uint8Array');if("function"==typeof e)n=e,e=0,i=t.length;else if("function"==typeof i)n=i,i=t.length-e;else if("function"!=typeof n)throw new TypeError('"cb" argument must be a function');return c(e,t.length),f(i,e,t.length),l(t,e,i,n)},e.randomFillSync=function(t,e,i){if(void 0===e&&(e=0),!(s.isBuffer(t)||t instanceof r.g.Uint8Array))throw new TypeError('"buf" argument must be a Buffer or Uint8Array');return c(e,t.length),void 0===i&&(i=t.length-e),f(i,e,t.length),l(t,e,i)}):(e.randomFill=i,e.randomFillSync=i)},28660:(t,e,r)=>{var i;!function(t){!function(e){var i="object"==typeof r.g?r.g:"object"==typeof self?self:"object"==typeof this?this:Function("return this;")(),n=o(t);function o(t,e){return function(r,i){"function"!=typeof t[r]&&Object.defineProperty(t,r,{configurable:!0,writable:!0,value:i}),e&&e(r,i)}}void 0===i.Reflect?i.Reflect=t:n=o(i.Reflect,n),function(t){var e=Object.prototype.hasOwnProperty,r="function"==typeof Symbol,i=r&&void 0!==Symbol.toPrimitive?Symbol.toPrimitive:"@@toPrimitive",n=r&&void 0!==Symbol.iterator?Symbol.iterator:"@@iterator",o="function"==typeof Object.create,s={__proto__:[]}instanceof Array,a=!o&&!s,u={create:o?function(){return N(Object.create(null))}:s?function(){return N({__proto__:null})}:function(){return N({})},has:a?function(t,r){return e.call(t,r)}:function(t,e){return e in t},get:a?function(t,r){return e.call(t,r)?t[r]:void 0}:function(t,e){return t[e]}},h=Object.getPrototypeOf(Function),c="object"==typeof process&&process.env&&"true"===process.env.REFLECT_METADATA_USE_MAP_POLYFILL,f=c||"function"!=typeof Map||"function"!=typeof Map.prototype.entries?function(){var t={},e=[],r=function(){function t(t,e,r){this._index=0,this._keys=t,this._values=e,this._selector=r}return t.prototype["@@iterator"]=function(){return this},t.prototype[n]=function(){return this},t.prototype.next=function(){var t=this._index;if(t>=0&&t<this._keys.length){var r=this._selector(this._keys[t],this._values[t]);return t+1>=this._keys.length?(this._index=-1,this._keys=e,this._values=e):this._index++,{value:r,done:!1}}return{value:void 0,done:!0}},t.prototype.throw=function(t){throw this._index>=0&&(this._index=-1,this._keys=e,this._values=e),t},t.prototype.return=function(t){return this._index>=0&&(this._index=-1,this._keys=e,this._values=e),{value:t,done:!0}},t}();return function(){function e(){this._keys=[],this._values=[],this._cacheKey=t,this._cacheIndex=-2}return Object.defineProperty(e.prototype,"size",{get:function(){return this._keys.length},enumerable:!0,configurable:!0}),e.prototype.has=function(t){return this._find(t,!1)>=0},e.prototype.get=function(t){var e=this._find(t,!1);return e>=0?this._values[e]:void 0},e.prototype.set=function(t,e){var r=this._find(t,!0);return this._values[r]=e,this},e.prototype.delete=function(e){var r=this._find(e,!1);if(r>=0){for(var i=this._keys.length,n=r+1;n<i;n++)this._keys[n-1]=this._keys[n],this._values[n-1]=this._values[n];return this._keys.length--,this._values.length--,e===this._cacheKey&&(this._cacheKey=t,this._cacheIndex=-2),!0}return!1},e.prototype.clear=function(){this._keys.length=0,this._values.length=0,this._cacheKey=t,this._cacheIndex=-2},e.prototype.keys=function(){return new r(this._keys,this._values,i)},e.prototype.values=function(){return new r(this._keys,this._values,o)},e.prototype.entries=function(){return new r(this._keys,this._values,s)},e.prototype["@@iterator"]=function(){return this.entries()},e.prototype[n]=function(){return this.entries()},e.prototype._find=function(t,e){return this._cacheKey!==t&&(this._cacheIndex=this._keys.indexOf(this._cacheKey=t)),this._cacheIndex<0&&e&&(this._cacheIndex=this._keys.length,this._keys.push(t),this._values.push(void 0)),this._cacheIndex},e}();function i(t,e){return t}function o(t,e){return e}function s(t,e){return[t,e]}}():Map,l=c||"function"!=typeof Set||"function"!=typeof Set.prototype.entries?function(){function t(){this._map=new f}return Object.defineProperty(t.prototype,"size",{get:function(){return this._map.size},enumerable:!0,configurable:!0}),t.prototype.has=function(t){return this._map.has(t)},t.prototype.add=function(t){return this._map.set(t,t),this},t.prototype.delete=function(t){return this._map.delete(t)},t.prototype.clear=function(){this._map.clear()},t.prototype.keys=function(){return this._map.keys()},t.prototype.values=function(){return this._map.values()},t.prototype.entries=function(){return this._map.entries()},t.prototype["@@iterator"]=function(){return this.keys()},t.prototype[n]=function(){return this.keys()},t}():Set,d=new(c||"function"!=typeof WeakMap?function(){var t=u.create(),r=i();return function(){function t(){this._key=i()}return t.prototype.has=function(t){var e=n(t,!1);return void 0!==e&&u.has(e,this._key)},t.prototype.get=function(t){var e=n(t,!1);return void 0!==e?u.get(e,this._key):void 0},t.prototype.set=function(t,e){return n(t,!0)[this._key]=e,this},t.prototype.delete=function(t){var e=n(t,!1);return void 0!==e&&delete e[this._key]},t.prototype.clear=function(){this._key=i()},t}();function i(){var e;do{e="@@WeakMap@@"+s()}while(u.has(t,e));return t[e]=!0,e}function n(t,i){if(!e.call(t,r)){if(!i)return;Object.defineProperty(t,r,{value:u.create()})}return t[r]}function o(t,e){for(var r=0;r<e;++r)t[r]=255*Math.random()|0;return t}function s(){var t,e=(t=16,"function"==typeof Uint8Array?"undefined"!=typeof crypto?crypto.getRandomValues(new Uint8Array(t)):"undefined"!=typeof msCrypto?msCrypto.getRandomValues(new Uint8Array(t)):o(new Uint8Array(t),t):o(new Array(t),t));e[6]=79&e[6]|64,e[8]=191&e[8]|128;for(var r="",i=0;i<16;++i){var n=e[i];4!==i&&6!==i&&8!==i||(r+="-"),n<16&&(r+="0"),r+=n.toString(16).toLowerCase()}return r}}():WeakMap);function p(t,e,r){var i=d.get(t);if(E(i)){if(!r)return;i=new f,d.set(t,i)}var n=i.get(e);if(E(n)){if(!r)return;n=new f,i.set(e,n)}return n}function g(t,e,r){if(y(t,e,r))return!0;var i=P(e);return!M(i)&&g(t,i,r)}function y(t,e,r){var i=p(e,r,!1);return!E(i)&&!!i.has(t)}function m(t,e,r){if(y(t,e,r))return v(t,e,r);var i=P(e);return M(i)?void 0:m(t,i,r)}function v(t,e,r){var i=p(e,r,!1);if(!E(i))return i.get(t)}function b(t,e,r,i){p(r,i,!0).set(t,e)}function w(t,e){var r=_(t,e),i=P(t);if(null===i)return r;var n=w(i,e);if(n.length<=0)return r;if(r.length<=0)return n;for(var o=new l,s=[],a=0,u=r;a<u.length;a++){var h=u[a];o.has(h)||(o.add(h),s.push(h))}for(var c=0,f=n;c<f.length;c++)h=f[c],o.has(h)||(o.add(h),s.push(h));return s}function _(t,e){var r=[],i=p(t,e,!1);if(E(i))return r;for(var o=function(t){var e=B(t,n);if(!T(e))throw new TypeError;var r=e.call(t);if(!A(r))throw new TypeError;return r}(i.keys()),s=0;;){var a=x(o);if(!a)return r.length=s,r;var u=a.value;try{r[s]=u}catch(t){try{F(o)}finally{throw t}}s++}}function S(t){if(null===t)return 1;switch(typeof t){case"undefined":return 0;case"boolean":return 2;case"string":return 3;case"symbol":return 4;case"number":return 5;case"object":return null===t?1:6;default:return 6}}function E(t){return void 0===t}function M(t){return null===t}function A(t){return"object"==typeof t?null!==t:"function"==typeof t}function C(t,e){switch(S(t)){case 0:case 1:case 2:case 3:case 4:case 5:return t}var r=3===e?"string":5===e?"number":"default",n=B(t,i);if(void 0!==n){var o=n.call(t,r);if(A(o))throw new TypeError;return o}return function(t,e){if("string"===e){var r=t.toString;if(T(r)&&!A(n=r.call(t)))return n;if(T(i=t.valueOf)&&!A(n=i.call(t)))return n}else{var i;if(T(i=t.valueOf)&&!A(n=i.call(t)))return n;var n,o=t.toString;if(T(o)&&!A(n=o.call(t)))return n}throw new TypeError}(t,"default"===r?"number":r)}function k(t){var e=C(t,3);return"symbol"==typeof e?e:function(t){return""+t}(e)}function I(t){return Array.isArray?Array.isArray(t):t instanceof Object?t instanceof Array:"[object Array]"===Object.prototype.toString.call(t)}function T(t){return"function"==typeof t}function R(t){return"function"==typeof t}function B(t,e){var r=t[e];if(null!=r){if(!T(r))throw new TypeError;return r}}function x(t){var e=t.next();return!e.done&&e}function F(t){var e=t.return;e&&e.call(t)}function P(t){var e=Object.getPrototypeOf(t);if("function"!=typeof t||t===h)return e;if(e!==h)return e;var r=t.prototype,i=r&&Object.getPrototypeOf(r);if(null==i||i===Object.prototype)return e;var n=i.constructor;return"function"!=typeof n||n===t?e:n}function N(t){return t.__=void 0,delete t.__,t}t("decorate",(function(t,e,r,i){if(E(r)){if(!I(t))throw new TypeError;if(!R(e))throw new TypeError;return function(t,e){for(var r=t.length-1;r>=0;--r){var i=(0,t[r])(e);if(!E(i)&&!M(i)){if(!R(i))throw new TypeError;e=i}}return e}(t,e)}if(!I(t))throw new TypeError;if(!A(e))throw new TypeError;if(!A(i)&&!E(i)&&!M(i))throw new TypeError;return M(i)&&(i=void 0),function(t,e,r,i){for(var n=t.length-1;n>=0;--n){var o=(0,t[n])(e,r,i);if(!E(o)&&!M(o)){if(!A(o))throw new TypeError;i=o}}return i}(t,e,r=k(r),i)})),t("metadata",(function(t,e){return function(r,i){if(!A(r))throw new TypeError;if(!E(i)&&!function(t){switch(S(t)){case 3:case 4:return!0;default:return!1}}(i))throw new TypeError;b(t,e,r,i)}})),t("defineMetadata",(function(t,e,r,i){if(!A(r))throw new TypeError;return E(i)||(i=k(i)),b(t,e,r,i)})),t("hasMetadata",(function(t,e,r){if(!A(e))throw new TypeError;return E(r)||(r=k(r)),g(t,e,r)})),t("hasOwnMetadata",(function(t,e,r){if(!A(e))throw new TypeError;return E(r)||(r=k(r)),y(t,e,r)})),t("getMetadata",(function(t,e,r){if(!A(e))throw new TypeError;return E(r)||(r=k(r)),m(t,e,r)})),t("getOwnMetadata",(function(t,e,r){if(!A(e))throw new TypeError;return E(r)||(r=k(r)),v(t,e,r)})),t("getMetadataKeys",(function(t,e){if(!A(t))throw new TypeError;return E(e)||(e=k(e)),w(t,e)})),t("getOwnMetadataKeys",(function(t,e){if(!A(t))throw new TypeError;return E(e)||(e=k(e)),_(t,e)})),t("deleteMetadata",(function(t,e,r){if(!A(e))throw new TypeError;E(r)||(r=k(r));var i=p(e,r,!1);if(E(i))return!1;if(!i.delete(t))return!1;if(i.size>0)return!0;var n=d.get(e);return n.delete(r),n.size>0||d.delete(e),!0}))}(n)}()}(i||(i={}))},79785:(t,e,r)=>{"use strict";var i=r(48764).Buffer,n=r(35717),o=r(3349),s=new Array(16),a=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],u=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],h=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],c=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11],f=[0,1518500249,1859775393,2400959708,2840853838],l=[1352829926,1548603684,1836072691,2053994217,0];function d(){o.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520}function p(t,e){return t<<e|t>>>32-e}function g(t,e,r,i,n,o,s,a){return p(t+(e^r^i)+o+s|0,a)+n|0}function y(t,e,r,i,n,o,s,a){return p(t+(e&r|~e&i)+o+s|0,a)+n|0}function m(t,e,r,i,n,o,s,a){return p(t+((e|~r)^i)+o+s|0,a)+n|0}function v(t,e,r,i,n,o,s,a){return p(t+(e&i|r&~i)+o+s|0,a)+n|0}function b(t,e,r,i,n,o,s,a){return p(t+(e^(r|~i))+o+s|0,a)+n|0}n(d,o),d.prototype._update=function(){for(var t=s,e=0;e<16;++e)t[e]=this._block.readInt32LE(4*e);for(var r=0|this._a,i=0|this._b,n=0|this._c,o=0|this._d,d=0|this._e,w=0|this._a,_=0|this._b,S=0|this._c,E=0|this._d,M=0|this._e,A=0;A<80;A+=1){var C,k;A<16?(C=g(r,i,n,o,d,t[a[A]],f[0],h[A]),k=b(w,_,S,E,M,t[u[A]],l[0],c[A])):A<32?(C=y(r,i,n,o,d,t[a[A]],f[1],h[A]),k=v(w,_,S,E,M,t[u[A]],l[1],c[A])):A<48?(C=m(r,i,n,o,d,t[a[A]],f[2],h[A]),k=m(w,_,S,E,M,t[u[A]],l[2],c[A])):A<64?(C=v(r,i,n,o,d,t[a[A]],f[3],h[A]),k=y(w,_,S,E,M,t[u[A]],l[3],c[A])):(C=b(r,i,n,o,d,t[a[A]],f[4],h[A]),k=g(w,_,S,E,M,t[u[A]],l[4],c[A])),r=d,d=o,o=p(n,10),n=i,i=C,w=M,M=E,E=p(S,10),S=_,_=k}var I=this._b+n+E|0;this._b=this._c+o+M|0,this._c=this._d+d+w|0,this._d=this._e+r+_|0,this._e=this._a+i+S|0,this._a=I},d.prototype._digest=function(){this._block[this._blockOffset++]=128,this._blockOffset>56&&(this._block.fill(0,this._blockOffset,64),this._update(),this._blockOffset=0),this._block.fill(0,this._blockOffset,56),this._block.writeUInt32LE(this._length[0],56),this._block.writeUInt32LE(this._length[1],60),this._update();var t=i.alloc?i.alloc(20):new i(20);return t.writeInt32LE(this._a,0),t.writeInt32LE(this._b,4),t.writeInt32LE(this._c,8),t.writeInt32LE(this._d,12),t.writeInt32LE(this._e,16),t},t.exports=d},89509:(t,e,r)=>{var i=r(48764),n=i.Buffer;function o(t,e){for(var r in t)e[r]=t[r]}function s(t,e,r){return n(t,e,r)}n.from&&n.alloc&&n.allocUnsafe&&n.allocUnsafeSlow?t.exports=i:(o(i,e),e.Buffer=s),o(n,s),s.from=function(t,e,r){if("number"==typeof t)throw new TypeError("Argument must not be a number");return n(t,e,r)},s.alloc=function(t,e,r){if("number"!=typeof t)throw new TypeError("Argument must be a number");var i=n(t);return void 0!==e?"string"==typeof r?i.fill(e,r):i.fill(e):i.fill(0),i},s.allocUnsafe=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return n(t)},s.allocUnsafeSlow=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return i.SlowBuffer(t)}},2399:(t,e,r)=>{"use strict";var i,n=r(48764),o=n.Buffer,s={};for(i in n)n.hasOwnProperty(i)&&"SlowBuffer"!==i&&"Buffer"!==i&&(s[i]=n[i]);var a=s.Buffer={};for(i in o)o.hasOwnProperty(i)&&"allocUnsafe"!==i&&"allocUnsafeSlow"!==i&&(a[i]=o[i]);if(s.Buffer.prototype=o.prototype,a.from&&a.from!==Uint8Array.from||(a.from=function(t,e,r){if("number"==typeof t)throw new TypeError('The "value" argument must not be of type number. Received type '+typeof t);if(t&&void 0===t.length)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);return o(t,e,r)}),a.alloc||(a.alloc=function(t,e,r){if("number"!=typeof t)throw new TypeError('The "size" argument must be of type number. Received type '+typeof t);if(t<0||t>=2*(1<<30))throw new RangeError('The value "'+t+'" is invalid for option "size"');var i=o(t);return e&&0!==e.length?"string"==typeof r?i.fill(e,r):i.fill(e):i.fill(0),i}),!s.kStringMaxLength)try{s.kStringMaxLength=process.binding("buffer").kStringMaxLength}catch(t){}s.constants||(s.constants={MAX_LENGTH:s.kMaxLength},s.kStringMaxLength&&(s.constants.MAX_STRING_LENGTH=s.kStringMaxLength)),t.exports=s},1878:(t,e)=>{var r;e=t.exports=W,r="object"==typeof process&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?function(){var t=Array.prototype.slice.call(arguments,0);t.unshift("SEMVER"),console.log.apply(console,t)}:function(){},e.SEMVER_SPEC_VERSION="2.0.0";var i=Number.MAX_SAFE_INTEGER||9007199254740991,n=e.re=[],o=e.src=[],s=0,a=s++;o[a]="0|[1-9]\\d*";var u=s++;o[u]="[0-9]+";var h=s++;o[h]="\\d*[a-zA-Z-][a-zA-Z0-9-]*";var c=s++;o[c]="("+o[a]+")\\.("+o[a]+")\\.("+o[a]+")";var f=s++;o[f]="("+o[u]+")\\.("+o[u]+")\\.("+o[u]+")";var l=s++;o[l]="(?:"+o[a]+"|"+o[h]+")";var d=s++;o[d]="(?:"+o[u]+"|"+o[h]+")";var p=s++;o[p]="(?:-("+o[l]+"(?:\\."+o[l]+")*))";var g=s++;o[g]="(?:-?("+o[d]+"(?:\\."+o[d]+")*))";var y=s++;o[y]="[0-9A-Za-z-]+";var m=s++;o[m]="(?:\\+("+o[y]+"(?:\\."+o[y]+")*))";var v=s++,b="v?"+o[c]+o[p]+"?"+o[m]+"?";o[v]="^"+b+"$";var w="[v=\\s]*"+o[f]+o[g]+"?"+o[m]+"?",_=s++;o[_]="^"+w+"$";var S=s++;o[S]="((?:<|>)?=?)";var E=s++;o[E]=o[u]+"|x|X|\\*";var M=s++;o[M]=o[a]+"|x|X|\\*";var A=s++;o[A]="[v=\\s]*("+o[M]+")(?:\\.("+o[M]+")(?:\\.("+o[M]+")(?:"+o[p]+")?"+o[m]+"?)?)?";var C=s++;o[C]="[v=\\s]*("+o[E]+")(?:\\.("+o[E]+")(?:\\.("+o[E]+")(?:"+o[g]+")?"+o[m]+"?)?)?";var k=s++;o[k]="^"+o[S]+"\\s*"+o[A]+"$";var I=s++;o[I]="^"+o[S]+"\\s*"+o[C]+"$";var T=s++;o[T]="(?:^|[^\\d])(\\d{1,16})(?:\\.(\\d{1,16}))?(?:\\.(\\d{1,16}))?(?:$|[^\\d])";var R=s++;o[R]="(?:~>?)";var B=s++;o[B]="(\\s*)"+o[R]+"\\s+",n[B]=new RegExp(o[B],"g");var x=s++;o[x]="^"+o[R]+o[A]+"$";var F=s++;o[F]="^"+o[R]+o[C]+"$";var P=s++;o[P]="(?:\\^)";var N=s++;o[N]="(\\s*)"+o[P]+"\\s+",n[N]=new RegExp(o[N],"g");var O=s++;o[O]="^"+o[P]+o[A]+"$";var L=s++;o[L]="^"+o[P]+o[C]+"$";var U=s++;o[U]="^"+o[S]+"\\s*("+w+")$|^$";var j=s++;o[j]="^"+o[S]+"\\s*("+b+")$|^$";var D=s++;o[D]="(\\s*)"+o[S]+"\\s*("+w+"|"+o[A]+")",n[D]=new RegExp(o[D],"g");var K=s++;o[K]="^\\s*("+o[A]+")\\s+-\\s+("+o[A]+")\\s*$";var V=s++;o[V]="^\\s*("+o[C]+")\\s+-\\s+("+o[C]+")\\s*$";var H=s++;o[H]="(<|>)?=?\\s*\\*";for(var q=0;q<35;q++)r(q,o[q]),n[q]||(n[q]=new RegExp(o[q]));function z(t,e){if(e&&"object"==typeof e||(e={loose:!!e,includePrerelease:!1}),t instanceof W)return t;if("string"!=typeof t)return null;if(t.length>256)return null;if(!(e.loose?n[_]:n[v]).test(t))return null;try{return new W(t,e)}catch(t){return null}}function W(t,e){if(e&&"object"==typeof e||(e={loose:!!e,includePrerelease:!1}),t instanceof W){if(t.loose===e.loose)return t;t=t.version}else if("string"!=typeof t)throw new TypeError("Invalid Version: "+t);if(t.length>256)throw new TypeError("version is longer than 256 characters");if(!(this instanceof W))return new W(t,e);r("SemVer",t,e),this.options=e,this.loose=!!e.loose;var o=t.trim().match(e.loose?n[_]:n[v]);if(!o)throw new TypeError("Invalid Version: "+t);if(this.raw=t,this.major=+o[1],this.minor=+o[2],this.patch=+o[3],this.major>i||this.major<0)throw new TypeError("Invalid major version");if(this.minor>i||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>i||this.patch<0)throw new TypeError("Invalid patch version");o[4]?this.prerelease=o[4].split(".").map((function(t){if(/^[0-9]+$/.test(t)){var e=+t;if(e>=0&&e<i)return e}return t})):this.prerelease=[],this.build=o[5]?o[5].split("."):[],this.format()}e.parse=z,e.valid=function(t,e){var r=z(t,e);return r?r.version:null},e.clean=function(t,e){var r=z(t.trim().replace(/^[=v]+/,""),e);return r?r.version:null},e.SemVer=W,W.prototype.format=function(){return this.version=this.major+"."+this.minor+"."+this.patch,this.prerelease.length&&(this.version+="-"+this.prerelease.join(".")),this.version},W.prototype.toString=function(){return this.version},W.prototype.compare=function(t){return r("SemVer.compare",this.version,this.options,t),t instanceof W||(t=new W(t,this.options)),this.compareMain(t)||this.comparePre(t)},W.prototype.compareMain=function(t){return t instanceof W||(t=new W(t,this.options)),J(this.major,t.major)||J(this.minor,t.minor)||J(this.patch,t.patch)},W.prototype.comparePre=function(t){if(t instanceof W||(t=new W(t,this.options)),this.prerelease.length&&!t.prerelease.length)return-1;if(!this.prerelease.length&&t.prerelease.length)return 1;if(!this.prerelease.length&&!t.prerelease.length)return 0;var e=0;do{var i=this.prerelease[e],n=t.prerelease[e];if(r("prerelease compare",e,i,n),void 0===i&&void 0===n)return 0;if(void 0===n)return 1;if(void 0===i)return-1;if(i!==n)return J(i,n)}while(++e)},W.prototype.inc=function(t,e){switch(t){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",e);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",e);break;case"prepatch":this.prerelease.length=0,this.inc("patch",e),this.inc("pre",e);break;case"prerelease":0===this.prerelease.length&&this.inc("patch",e),this.inc("pre",e);break;case"major":0===this.minor&&0===this.patch&&0!==this.prerelease.length||this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":0===this.patch&&0!==this.prerelease.length||this.minor++,this.patch=0,this.prerelease=[];break;case"patch":0===this.prerelease.length&&this.patch++,this.prerelease=[];break;case"pre":if(0===this.prerelease.length)this.prerelease=[0];else{for(var r=this.prerelease.length;--r>=0;)"number"==typeof this.prerelease[r]&&(this.prerelease[r]++,r=-2);-1===r&&this.prerelease.push(0)}e&&(this.prerelease[0]===e?isNaN(this.prerelease[1])&&(this.prerelease=[e,0]):this.prerelease=[e,0]);break;default:throw new Error("invalid increment argument: "+t)}return this.format(),this.raw=this.version,this},e.inc=function(t,e,r,i){"string"==typeof r&&(i=r,r=void 0);try{return new W(t,r).inc(e,i).version}catch(t){return null}},e.diff=function(t,e){if(Q(t,e))return null;var r=z(t),i=z(e),n="";if(r.prerelease.length||i.prerelease.length){n="pre";var o="prerelease"}for(var s in r)if(("major"===s||"minor"===s||"patch"===s)&&r[s]!==i[s])return n+s;return o},e.compareIdentifiers=J;var G=/^[0-9]+$/;function J(t,e){var r=G.test(t),i=G.test(e);return r&&i&&(t=+t,e=+e),t===e?0:r&&!i?-1:i&&!r?1:t<e?-1:1}function Z(t,e,r){return new W(t,r).compare(new W(e,r))}function $(t,e,r){return Z(t,e,r)>0}function Y(t,e,r){return Z(t,e,r)<0}function Q(t,e,r){return 0===Z(t,e,r)}function X(t,e,r){return 0!==Z(t,e,r)}function tt(t,e,r){return Z(t,e,r)>=0}function et(t,e,r){return Z(t,e,r)<=0}function rt(t,e,r,i){switch(e){case"===":return"object"==typeof t&&(t=t.version),"object"==typeof r&&(r=r.version),t===r;case"!==":return"object"==typeof t&&(t=t.version),"object"==typeof r&&(r=r.version),t!==r;case"":case"=":case"==":return Q(t,r,i);case"!=":return X(t,r,i);case">":return $(t,r,i);case">=":return tt(t,r,i);case"<":return Y(t,r,i);case"<=":return et(t,r,i);default:throw new TypeError("Invalid operator: "+e)}}function it(t,e){if(e&&"object"==typeof e||(e={loose:!!e,includePrerelease:!1}),t instanceof it){if(t.loose===!!e.loose)return t;t=t.value}if(!(this instanceof it))return new it(t,e);r("comparator",t,e),this.options=e,this.loose=!!e.loose,this.parse(t),this.semver===nt?this.value="":this.value=this.operator+this.semver.version,r("comp",this)}e.rcompareIdentifiers=function(t,e){return J(e,t)},e.major=function(t,e){return new W(t,e).major},e.minor=function(t,e){return new W(t,e).minor},e.patch=function(t,e){return new W(t,e).patch},e.compare=Z,e.compareLoose=function(t,e){return Z(t,e,!0)},e.rcompare=function(t,e,r){return Z(e,t,r)},e.sort=function(t,r){return t.sort((function(t,i){return e.compare(t,i,r)}))},e.rsort=function(t,r){return t.sort((function(t,i){return e.rcompare(t,i,r)}))},e.gt=$,e.lt=Y,e.eq=Q,e.neq=X,e.gte=tt,e.lte=et,e.cmp=rt,e.Comparator=it;var nt={};function ot(t,e){if(e&&"object"==typeof e||(e={loose:!!e,includePrerelease:!1}),t instanceof ot)return t.loose===!!e.loose&&t.includePrerelease===!!e.includePrerelease?t:new ot(t.raw,e);if(t instanceof it)return new ot(t.value,e);if(!(this instanceof ot))return new ot(t,e);if(this.options=e,this.loose=!!e.loose,this.includePrerelease=!!e.includePrerelease,this.raw=t,this.set=t.split(/\s*\|\|\s*/).map((function(t){return this.parseRange(t.trim())}),this).filter((function(t){return t.length})),!this.set.length)throw new TypeError("Invalid SemVer Range: "+t);this.format()}function st(t){return!t||"x"===t.toLowerCase()||"*"===t}function at(t,e,r,i,n,o,s,a,u,h,c,f,l){return((e=st(r)?"":st(i)?">="+r+".0.0":st(n)?">="+r+"."+i+".0":">="+e)+" "+(a=st(u)?"":st(h)?"<"+(+u+1)+".0.0":st(c)?"<"+u+"."+(+h+1)+".0":f?"<="+u+"."+h+"."+c+"-"+f:"<="+a)).trim()}function ut(t,e,i){for(var n=0;n<t.length;n++)if(!t[n].test(e))return!1;if(e.prerelease.length&&!i.includePrerelease){for(n=0;n<t.length;n++)if(r(t[n].semver),t[n].semver!==nt&&t[n].semver.prerelease.length>0){var o=t[n].semver;if(o.major===e.major&&o.minor===e.minor&&o.patch===e.patch)return!0}return!1}return!0}function ht(t,e,r){try{e=new ot(e,r)}catch(t){return!1}return e.test(t)}function ct(t,e,r,i){var n,o,s,a,u;switch(t=new W(t,i),e=new ot(e,i),r){case">":n=$,o=et,s=Y,a=">",u=">=";break;case"<":n=Y,o=tt,s=$,a="<",u="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(ht(t,e,i))return!1;for(var h=0;h<e.set.length;++h){var c=e.set[h],f=null,l=null;if(c.forEach((function(t){t.semver===nt&&(t=new it(">=0.0.0")),f=f||t,l=l||t,n(t.semver,f.semver,i)?f=t:s(t.semver,l.semver,i)&&(l=t)})),f.operator===a||f.operator===u)return!1;if((!l.operator||l.operator===a)&&o(t,l.semver))return!1;if(l.operator===u&&s(t,l.semver))return!1}return!0}it.prototype.parse=function(t){var e=this.options.loose?n[U]:n[j],r=t.match(e);if(!r)throw new TypeError("Invalid comparator: "+t);this.operator=r[1],"="===this.operator&&(this.operator=""),r[2]?this.semver=new W(r[2],this.options.loose):this.semver=nt},it.prototype.toString=function(){return this.value},it.prototype.test=function(t){return r("Comparator.test",t,this.options.loose),this.semver===nt||("string"==typeof t&&(t=new W(t,this.options)),rt(t,this.operator,this.semver,this.options))},it.prototype.intersects=function(t,e){if(!(t instanceof it))throw new TypeError("a Comparator is required");var r;if(e&&"object"==typeof e||(e={loose:!!e,includePrerelease:!1}),""===this.operator)return r=new ot(t.value,e),ht(this.value,r,e);if(""===t.operator)return r=new ot(this.value,e),ht(t.semver,r,e);var i=!(">="!==this.operator&&">"!==this.operator||">="!==t.operator&&">"!==t.operator),n=!("<="!==this.operator&&"<"!==this.operator||"<="!==t.operator&&"<"!==t.operator),o=this.semver.version===t.semver.version,s=!(">="!==this.operator&&"<="!==this.operator||">="!==t.operator&&"<="!==t.operator),a=rt(this.semver,"<",t.semver,e)&&(">="===this.operator||">"===this.operator)&&("<="===t.operator||"<"===t.operator),u=rt(this.semver,">",t.semver,e)&&("<="===this.operator||"<"===this.operator)&&(">="===t.operator||">"===t.operator);return i||n||o&&s||a||u},e.Range=ot,ot.prototype.format=function(){return this.range=this.set.map((function(t){return t.join(" ").trim()})).join("||").trim(),this.range},ot.prototype.toString=function(){return this.range},ot.prototype.parseRange=function(t){var e=this.options.loose;t=t.trim();var i=e?n[V]:n[K];t=t.replace(i,at),r("hyphen replace",t),t=t.replace(n[D],"$1$2$3"),r("comparator trim",t,n[D]),t=(t=(t=t.replace(n[B],"$1~")).replace(n[N],"$1^")).split(/\s+/).join(" ");var o=e?n[U]:n[j],s=t.split(" ").map((function(t){return function(t,e){return r("comp",t,e),t=function(t,e){return t.trim().split(/\s+/).map((function(t){return function(t,e){r("caret",t,e);var i=e.loose?n[L]:n[O];return t.replace(i,(function(e,i,n,o,s){var a;return r("caret",t,e,i,n,o,s),st(i)?a="":st(n)?a=">="+i+".0.0 <"+(+i+1)+".0.0":st(o)?a="0"===i?">="+i+"."+n+".0 <"+i+"."+(+n+1)+".0":">="+i+"."+n+".0 <"+(+i+1)+".0.0":s?(r("replaceCaret pr",s),a="0"===i?"0"===n?">="+i+"."+n+"."+o+"-"+s+" <"+i+"."+n+"."+(+o+1):">="+i+"."+n+"."+o+"-"+s+" <"+i+"."+(+n+1)+".0":">="+i+"."+n+"."+o+"-"+s+" <"+(+i+1)+".0.0"):(r("no pr"),a="0"===i?"0"===n?">="+i+"."+n+"."+o+" <"+i+"."+n+"."+(+o+1):">="+i+"."+n+"."+o+" <"+i+"."+(+n+1)+".0":">="+i+"."+n+"."+o+" <"+(+i+1)+".0.0"),r("caret return",a),a}))}(t,e)})).join(" ")}(t,e),r("caret",t),t=function(t,e){return t.trim().split(/\s+/).map((function(t){return function(t,e){var i=e.loose?n[F]:n[x];return t.replace(i,(function(e,i,n,o,s){var a;return r("tilde",t,e,i,n,o,s),st(i)?a="":st(n)?a=">="+i+".0.0 <"+(+i+1)+".0.0":st(o)?a=">="+i+"."+n+".0 <"+i+"."+(+n+1)+".0":s?(r("replaceTilde pr",s),a=">="+i+"."+n+"."+o+"-"+s+" <"+i+"."+(+n+1)+".0"):a=">="+i+"."+n+"."+o+" <"+i+"."+(+n+1)+".0",r("tilde return",a),a}))}(t,e)})).join(" ")}(t,e),r("tildes",t),t=function(t,e){return r("replaceXRanges",t,e),t.split(/\s+/).map((function(t){return function(t,e){t=t.trim();var i=e.loose?n[I]:n[k];return t.replace(i,(function(e,i,n,o,s,a){r("xRange",t,e,i,n,o,s,a);var u=st(n),h=u||st(o),c=h||st(s);return"="===i&&c&&(i=""),u?e=">"===i||"<"===i?"<0.0.0":"*":i&&c?(h&&(o=0),s=0,">"===i?(i=">=",h?(n=+n+1,o=0,s=0):(o=+o+1,s=0)):"<="===i&&(i="<",h?n=+n+1:o=+o+1),e=i+n+"."+o+"."+s):h?e=">="+n+".0.0 <"+(+n+1)+".0.0":c&&(e=">="+n+"."+o+".0 <"+n+"."+(+o+1)+".0"),r("xRange return",e),e}))}(t,e)})).join(" ")}(t,e),r("xrange",t),t=function(t,e){return r("replaceStars",t,e),t.trim().replace(n[H],"")}(t,e),r("stars",t),t}(t,this.options)}),this).join(" ").split(/\s+/);return this.options.loose&&(s=s.filter((function(t){return!!t.match(o)}))),s.map((function(t){return new it(t,this.options)}),this)},ot.prototype.intersects=function(t,e){if(!(t instanceof ot))throw new TypeError("a Range is required");return this.set.some((function(r){return r.every((function(r){return t.set.some((function(t){return t.every((function(t){return r.intersects(t,e)}))}))}))}))},e.toComparators=function(t,e){return new ot(t,e).set.map((function(t){return t.map((function(t){return t.value})).join(" ").trim().split(" ")}))},ot.prototype.test=function(t){if(!t)return!1;"string"==typeof t&&(t=new W(t,this.options));for(var e=0;e<this.set.length;e++)if(ut(this.set[e],t,this.options))return!0;return!1},e.satisfies=ht,e.maxSatisfying=function(t,e,r){var i=null,n=null;try{var o=new ot(e,r)}catch(t){return null}return t.forEach((function(t){o.test(t)&&(i&&-1!==n.compare(t)||(n=new W(i=t,r)))})),i},e.minSatisfying=function(t,e,r){var i=null,n=null;try{var o=new ot(e,r)}catch(t){return null}return t.forEach((function(t){o.test(t)&&(i&&1!==n.compare(t)||(n=new W(i=t,r)))})),i},e.minVersion=function(t,e){t=new ot(t,e);var r=new W("0.0.0");if(t.test(r))return r;if(r=new W("0.0.0-0"),t.test(r))return r;r=null;for(var i=0;i<t.set.length;++i)t.set[i].forEach((function(t){var e=new W(t.semver.version);switch(t.operator){case">":0===e.prerelease.length?e.patch++:e.prerelease.push(0),e.raw=e.format();case"":case">=":r&&!$(r,e)||(r=e);break;case"<":case"<=":break;default:throw new Error("Unexpected operation: "+t.operator)}}));return r&&t.test(r)?r:null},e.validRange=function(t,e){try{return new ot(t,e).range||"*"}catch(t){return null}},e.ltr=function(t,e,r){return ct(t,e,"<",r)},e.gtr=function(t,e,r){return ct(t,e,">",r)},e.outside=ct,e.prerelease=function(t,e){var r=z(t,e);return r&&r.prerelease.length?r.prerelease:null},e.intersects=function(t,e,r){return t=new ot(t,r),e=new ot(e,r),t.intersects(e)},e.coerce=function(t){if(t instanceof W)return t;if("string"!=typeof t)return null;var e=t.match(n[T]);return null==e?null:z(e[1]+"."+(e[2]||"0")+"."+(e[3]||"0"))}},24189:(t,e,r)=>{var i=r(89509).Buffer;function n(t,e){this._block=i.alloc(t),this._finalSize=e,this._blockSize=t,this._len=0}n.prototype.update=function(t,e){"string"==typeof t&&(e=e||"utf8",t=i.from(t,e));for(var r=this._block,n=this._blockSize,o=t.length,s=this._len,a=0;a<o;){for(var u=s%n,h=Math.min(o-a,n-u),c=0;c<h;c++)r[u+c]=t[a+c];a+=h,(s+=h)%n==0&&this._update(r)}return this._len+=o,this},n.prototype.digest=function(t){var e=this._len%this._blockSize;this._block[e]=128,this._block.fill(0,e+1),e>=this._finalSize&&(this._update(this._block),this._block.fill(0));var r=8*this._len;if(r<=4294967295)this._block.writeUInt32BE(r,this._blockSize-4);else{var i=(4294967295&r)>>>0,n=(r-i)/4294967296;this._block.writeUInt32BE(n,this._blockSize-8),this._block.writeUInt32BE(i,this._blockSize-4)}this._update(this._block);var o=this._hash();return t?o.toString(t):o},n.prototype._update=function(){throw new Error("_update must be implemented by subclass")},t.exports=n},89072:(t,e,r)=>{var i=t.exports=function(t){t=t.toLowerCase();var e=i[t];if(!e)throw new Error(t+" is not supported (we accept pull requests)");return new e};i.sha=r(74448),i.sha1=r(18336),i.sha224=r(48432),i.sha256=r(67499),i.sha384=r(51686),i.sha512=r(87816)},74448:(t,e,r)=>{var i=r(35717),n=r(24189),o=r(89509).Buffer,s=[1518500249,1859775393,-1894007588,-899497514],a=new Array(80);function u(){this.init(),this._w=a,n.call(this,64,56)}function h(t){return t<<30|t>>>2}function c(t,e,r,i){return 0===t?e&r|~e&i:2===t?e&r|e&i|r&i:e^r^i}i(u,n),u.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},u.prototype._update=function(t){for(var e,r=this._w,i=0|this._a,n=0|this._b,o=0|this._c,a=0|this._d,u=0|this._e,f=0;f<16;++f)r[f]=t.readInt32BE(4*f);for(;f<80;++f)r[f]=r[f-3]^r[f-8]^r[f-14]^r[f-16];for(var l=0;l<80;++l){var d=~~(l/20),p=0|((e=i)<<5|e>>>27)+c(d,n,o,a)+u+r[l]+s[d];u=a,a=o,o=h(n),n=i,i=p}this._a=i+this._a|0,this._b=n+this._b|0,this._c=o+this._c|0,this._d=a+this._d|0,this._e=u+this._e|0},u.prototype._hash=function(){var t=o.allocUnsafe(20);return t.writeInt32BE(0|this._a,0),t.writeInt32BE(0|this._b,4),t.writeInt32BE(0|this._c,8),t.writeInt32BE(0|this._d,12),t.writeInt32BE(0|this._e,16),t},t.exports=u},18336:(t,e,r)=>{var i=r(35717),n=r(24189),o=r(89509).Buffer,s=[1518500249,1859775393,-1894007588,-899497514],a=new Array(80);function u(){this.init(),this._w=a,n.call(this,64,56)}function h(t){return t<<5|t>>>27}function c(t){return t<<30|t>>>2}function f(t,e,r,i){return 0===t?e&r|~e&i:2===t?e&r|e&i|r&i:e^r^i}i(u,n),u.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},u.prototype._update=function(t){for(var e,r=this._w,i=0|this._a,n=0|this._b,o=0|this._c,a=0|this._d,u=0|this._e,l=0;l<16;++l)r[l]=t.readInt32BE(4*l);for(;l<80;++l)r[l]=(e=r[l-3]^r[l-8]^r[l-14]^r[l-16])<<1|e>>>31;for(var d=0;d<80;++d){var p=~~(d/20),g=h(i)+f(p,n,o,a)+u+r[d]+s[p]|0;u=a,a=o,o=c(n),n=i,i=g}this._a=i+this._a|0,this._b=n+this._b|0,this._c=o+this._c|0,this._d=a+this._d|0,this._e=u+this._e|0},u.prototype._hash=function(){var t=o.allocUnsafe(20);return t.writeInt32BE(0|this._a,0),t.writeInt32BE(0|this._b,4),t.writeInt32BE(0|this._c,8),t.writeInt32BE(0|this._d,12),t.writeInt32BE(0|this._e,16),t},t.exports=u},48432:(t,e,r)=>{var i=r(35717),n=r(67499),o=r(24189),s=r(89509).Buffer,a=new Array(64);function u(){this.init(),this._w=a,o.call(this,64,56)}i(u,n),u.prototype.init=function(){return this._a=3238371032,this._b=914150663,this._c=812702999,this._d=4144912697,this._e=4290775857,this._f=1750603025,this._g=1694076839,this._h=3204075428,this},u.prototype._hash=function(){var t=s.allocUnsafe(28);return t.writeInt32BE(this._a,0),t.writeInt32BE(this._b,4),t.writeInt32BE(this._c,8),t.writeInt32BE(this._d,12),t.writeInt32BE(this._e,16),t.writeInt32BE(this._f,20),t.writeInt32BE(this._g,24),t},t.exports=u},67499:(t,e,r)=>{var i=r(35717),n=r(24189),o=r(89509).Buffer,s=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],a=new Array(64);function u(){this.init(),this._w=a,n.call(this,64,56)}function h(t,e,r){return r^t&(e^r)}function c(t,e,r){return t&e|r&(t|e)}function f(t){return(t>>>2|t<<30)^(t>>>13|t<<19)^(t>>>22|t<<10)}function l(t){return(t>>>6|t<<26)^(t>>>11|t<<21)^(t>>>25|t<<7)}function d(t){return(t>>>7|t<<25)^(t>>>18|t<<14)^t>>>3}i(u,n),u.prototype.init=function(){return this._a=1779033703,this._b=3144134277,this._c=1013904242,this._d=2773480762,this._e=1359893119,this._f=2600822924,this._g=528734635,this._h=1541459225,this},u.prototype._update=function(t){for(var e,r=this._w,i=0|this._a,n=0|this._b,o=0|this._c,a=0|this._d,u=0|this._e,p=0|this._f,g=0|this._g,y=0|this._h,m=0;m<16;++m)r[m]=t.readInt32BE(4*m);for(;m<64;++m)r[m]=0|(((e=r[m-2])>>>17|e<<15)^(e>>>19|e<<13)^e>>>10)+r[m-7]+d(r[m-15])+r[m-16];for(var v=0;v<64;++v){var b=y+l(u)+h(u,p,g)+s[v]+r[v]|0,w=f(i)+c(i,n,o)|0;y=g,g=p,p=u,u=a+b|0,a=o,o=n,n=i,i=b+w|0}this._a=i+this._a|0,this._b=n+this._b|0,this._c=o+this._c|0,this._d=a+this._d|0,this._e=u+this._e|0,this._f=p+this._f|0,this._g=g+this._g|0,this._h=y+this._h|0},u.prototype._hash=function(){var t=o.allocUnsafe(32);return t.writeInt32BE(this._a,0),t.writeInt32BE(this._b,4),t.writeInt32BE(this._c,8),t.writeInt32BE(this._d,12),t.writeInt32BE(this._e,16),t.writeInt32BE(this._f,20),t.writeInt32BE(this._g,24),t.writeInt32BE(this._h,28),t},t.exports=u},51686:(t,e,r)=>{var i=r(35717),n=r(87816),o=r(24189),s=r(89509).Buffer,a=new Array(160);function u(){this.init(),this._w=a,o.call(this,128,112)}i(u,n),u.prototype.init=function(){return this._ah=3418070365,this._bh=1654270250,this._ch=2438529370,this._dh=355462360,this._eh=1731405415,this._fh=2394180231,this._gh=3675008525,this._hh=1203062813,this._al=3238371032,this._bl=914150663,this._cl=812702999,this._dl=4144912697,this._el=4290775857,this._fl=1750603025,this._gl=1694076839,this._hl=3204075428,this},u.prototype._hash=function(){var t=s.allocUnsafe(48);function e(e,r,i){t.writeInt32BE(e,i),t.writeInt32BE(r,i+4)}return e(this._ah,this._al,0),e(this._bh,this._bl,8),e(this._ch,this._cl,16),e(this._dh,this._dl,24),e(this._eh,this._el,32),e(this._fh,this._fl,40),t},t.exports=u},87816:(t,e,r)=>{var i=r(35717),n=r(24189),o=r(89509).Buffer,s=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591],a=new Array(160);function u(){this.init(),this._w=a,n.call(this,128,112)}function h(t,e,r){return r^t&(e^r)}function c(t,e,r){return t&e|r&(t|e)}function f(t,e){return(t>>>28|e<<4)^(e>>>2|t<<30)^(e>>>7|t<<25)}function l(t,e){return(t>>>14|e<<18)^(t>>>18|e<<14)^(e>>>9|t<<23)}function d(t,e){return(t>>>1|e<<31)^(t>>>8|e<<24)^t>>>7}function p(t,e){return(t>>>1|e<<31)^(t>>>8|e<<24)^(t>>>7|e<<25)}function g(t,e){return(t>>>19|e<<13)^(e>>>29|t<<3)^t>>>6}function y(t,e){return(t>>>19|e<<13)^(e>>>29|t<<3)^(t>>>6|e<<26)}function m(t,e){return t>>>0<e>>>0?1:0}i(u,n),u.prototype.init=function(){return this._ah=1779033703,this._bh=3144134277,this._ch=1013904242,this._dh=2773480762,this._eh=1359893119,this._fh=2600822924,this._gh=528734635,this._hh=1541459225,this._al=4089235720,this._bl=2227873595,this._cl=4271175723,this._dl=1595750129,this._el=2917565137,this._fl=725511199,this._gl=4215389547,this._hl=327033209,this},u.prototype._update=function(t){for(var e=this._w,r=0|this._ah,i=0|this._bh,n=0|this._ch,o=0|this._dh,a=0|this._eh,u=0|this._fh,v=0|this._gh,b=0|this._hh,w=0|this._al,_=0|this._bl,S=0|this._cl,E=0|this._dl,M=0|this._el,A=0|this._fl,C=0|this._gl,k=0|this._hl,I=0;I<32;I+=2)e[I]=t.readInt32BE(4*I),e[I+1]=t.readInt32BE(4*I+4);for(;I<160;I+=2){var T=e[I-30],R=e[I-30+1],B=d(T,R),x=p(R,T),F=g(T=e[I-4],R=e[I-4+1]),P=y(R,T),N=e[I-14],O=e[I-14+1],L=e[I-32],U=e[I-32+1],j=x+O|0,D=B+N+m(j,x)|0;D=(D=D+F+m(j=j+P|0,P)|0)+L+m(j=j+U|0,U)|0,e[I]=D,e[I+1]=j}for(var K=0;K<160;K+=2){D=e[K],j=e[K+1];var V=c(r,i,n),H=c(w,_,S),q=f(r,w),z=f(w,r),W=l(a,M),G=l(M,a),J=s[K],Z=s[K+1],$=h(a,u,v),Y=h(M,A,C),Q=k+G|0,X=b+W+m(Q,k)|0;X=(X=(X=X+$+m(Q=Q+Y|0,Y)|0)+J+m(Q=Q+Z|0,Z)|0)+D+m(Q=Q+j|0,j)|0;var tt=z+H|0,et=q+V+m(tt,z)|0;b=v,k=C,v=u,C=A,u=a,A=M,a=o+X+m(M=E+Q|0,E)|0,o=n,E=S,n=i,S=_,i=r,_=w,r=X+et+m(w=Q+tt|0,Q)|0}this._al=this._al+w|0,this._bl=this._bl+_|0,this._cl=this._cl+S|0,this._dl=this._dl+E|0,this._el=this._el+M|0,this._fl=this._fl+A|0,this._gl=this._gl+C|0,this._hl=this._hl+k|0,this._ah=this._ah+r+m(this._al,w)|0,this._bh=this._bh+i+m(this._bl,_)|0,this._ch=this._ch+n+m(this._cl,S)|0,this._dh=this._dh+o+m(this._dl,E)|0,this._eh=this._eh+a+m(this._el,M)|0,this._fh=this._fh+u+m(this._fl,A)|0,this._gh=this._gh+v+m(this._gl,C)|0,this._hh=this._hh+b+m(this._hl,k)|0},u.prototype._hash=function(){var t=o.allocUnsafe(64);function e(e,r,i){t.writeInt32BE(e,i),t.writeInt32BE(r,i+4)}return e(this._ah,this._al,0),e(this._bh,this._bl,8),e(this._ch,this._cl,16),e(this._dh,this._dl,24),e(this._eh,this._el,32),e(this._fh,this._fl,40),e(this._gh,this._gl,48),e(this._hh,this._hl,56),t},t.exports=u},42830:(t,e,r)=>{t.exports=n;var i=r(17187).EventEmitter;function n(){i.call(this)}r(35717)(n,i),n.Readable=r(56577),n.Writable=r(20323),n.Duplex=r(68656),n.Transform=r(94473),n.PassThrough=r(2366),n.finished=r(81086),n.pipeline=r(56472),n.Stream=n,n.prototype.pipe=function(t,e){var r=this;function n(e){t.writable&&!1===t.write(e)&&r.pause&&r.pause()}function o(){r.readable&&r.resume&&r.resume()}r.on("data",n),t.on("drain",o),t._isStdio||e&&!1===e.end||(r.on("end",a),r.on("close",u));var s=!1;function a(){s||(s=!0,t.end())}function u(){s||(s=!0,"function"==typeof t.destroy&&t.destroy())}function h(t){if(c(),0===i.listenerCount(this,"error"))throw t}function c(){r.removeListener("data",n),t.removeListener("drain",o),r.removeListener("end",a),r.removeListener("close",u),r.removeListener("error",h),t.removeListener("error",h),r.removeListener("end",c),r.removeListener("close",c),t.removeListener("close",c)}return r.on("error",h),t.on("error",h),r.on("end",c),r.on("close",c),t.on("close",c),t.emit("pipe",r),t}},58106:t=>{"use strict";var e={};function r(t,r,i){i||(i=Error);var n=function(t){var e,i;function n(e,i,n){return t.call(this,function(t,e,i){return"string"==typeof r?r:r(t,e,i)}(e,i,n))||this}return i=t,(e=n).prototype=Object.create(i.prototype),e.prototype.constructor=e,e.__proto__=i,n}(i);n.prototype.name=i.name,n.prototype.code=t,e[t]=n}function i(t,e){if(Array.isArray(t)){var r=t.length;return t=t.map((function(t){return String(t)})),r>2?"one of ".concat(e," ").concat(t.slice(0,r-1).join(", "),", or ")+t[r-1]:2===r?"one of ".concat(e," ").concat(t[0]," or ").concat(t[1]):"of ".concat(e," ").concat(t[0])}return"of ".concat(e," ").concat(String(t))}r("ERR_INVALID_OPT_VALUE",(function(t,e){return'The value "'+e+'" is invalid for option "'+t+'"'}),TypeError),r("ERR_INVALID_ARG_TYPE",(function(t,e,r){var n,o,s,a,u;if("string"==typeof e&&(o="not ",e.substr(0,o.length)===o)?(n="must not be",e=e.replace(/^not /,"")):n="must be",function(t,e,r){return(void 0===r||r>t.length)&&(r=t.length),t.substring(r-e.length,r)===e}(t," argument"))s="The ".concat(t," ").concat(n," ").concat(i(e,"type"));else{var h=("number"!=typeof u&&(u=0),u+".".length>(a=t).length||-1===a.indexOf(".",u)?"argument":"property");s='The "'.concat(t,'" ').concat(h," ").concat(n," ").concat(i(e,"type"))}return s+". Received type ".concat(typeof r)}),TypeError),r("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),r("ERR_METHOD_NOT_IMPLEMENTED",(function(t){return"The "+t+" method is not implemented"})),r("ERR_STREAM_PREMATURE_CLOSE","Premature close"),r("ERR_STREAM_DESTROYED",(function(t){return"Cannot call "+t+" after a stream was destroyed"})),r("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),r("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),r("ERR_STREAM_WRITE_AFTER_END","write after end"),r("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),r("ERR_UNKNOWN_ENCODING",(function(t){return"Unknown encoding: "+t}),TypeError),r("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),t.exports.q=e},68656:(t,e,r)=>{"use strict";var i=Object.keys||function(t){var e=[];for(var r in t)e.push(r);return e};t.exports=h;var n=r(56577),o=r(20323);r(35717)(h,n);for(var s=i(o.prototype),a=0;a<s.length;a++){var u=s[a];h.prototype[u]||(h.prototype[u]=o.prototype[u])}function h(t){if(!(this instanceof h))return new h(t);n.call(this,t),o.call(this,t),this.allowHalfOpen=!0,t&&(!1===t.readable&&(this.readable=!1),!1===t.writable&&(this.writable=!1),!1===t.allowHalfOpen&&(this.allowHalfOpen=!1,this.once("end",c)))}function c(){this._writableState.ended||process.nextTick(f,this)}function f(t){t.end()}Object.defineProperty(h.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(h.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(h.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(h.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&void 0!==this._writableState&&this._readableState.destroyed&&this._writableState.destroyed},set:function(t){void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed=t,this._writableState.destroyed=t)}})},2366:(t,e,r)=>{"use strict";t.exports=n;var i=r(94473);function n(t){if(!(this instanceof n))return new n(t);i.call(this,t)}r(35717)(n,i),n.prototype._transform=function(t,e,r){r(null,t)}},56577:(t,e,r)=>{"use strict";var i;t.exports=M,M.ReadableState=E,r(17187).EventEmitter;var n,o=function(t,e){return t.listeners(e).length},s=r(83194),a=r(48764).Buffer,u=r.g.Uint8Array||function(){},h=r(61758);n=h&&h.debuglog?h.debuglog("stream"):function(){};var c,f,l,d=r(39686),p=r(71029),g=r(30094).getHighWaterMark,y=r(58106).q,m=y.ERR_INVALID_ARG_TYPE,v=y.ERR_STREAM_PUSH_AFTER_EOF,b=y.ERR_METHOD_NOT_IMPLEMENTED,w=y.ERR_STREAM_UNSHIFT_AFTER_END_EVENT;r(35717)(M,s);var _=p.errorOrDestroy,S=["error","close","destroy","pause","resume"];function E(t,e,n){i=i||r(68656),t=t||{},"boolean"!=typeof n&&(n=e instanceof i),this.objectMode=!!t.objectMode,n&&(this.objectMode=this.objectMode||!!t.readableObjectMode),this.highWaterMark=g(this,t,"readableHighWaterMark",n),this.buffer=new d,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=!1!==t.emitClose,this.autoDestroy=!!t.autoDestroy,this.destroyed=!1,this.defaultEncoding=t.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,t.encoding&&(c||(c=r(32553).s),this.decoder=new c(t.encoding),this.encoding=t.encoding)}function M(t){if(i=i||r(68656),!(this instanceof M))return new M(t);var e=this instanceof i;this._readableState=new E(t,this,e),this.readable=!0,t&&("function"==typeof t.read&&(this._read=t.read),"function"==typeof t.destroy&&(this._destroy=t.destroy)),s.call(this)}function A(t,e,r,i,o){n("readableAddChunk",e);var s,h=t._readableState;if(null===e)h.reading=!1,function(t,e){if(n("onEofChunk"),!e.ended){if(e.decoder){var r=e.decoder.end();r&&r.length&&(e.buffer.push(r),e.length+=e.objectMode?1:r.length)}e.ended=!0,e.sync?T(t):(e.needReadable=!1,e.emittedReadable||(e.emittedReadable=!0,R(t)))}}(t,h);else if(o||(s=function(t,e){var r,i;return i=e,a.isBuffer(i)||i instanceof u||"string"==typeof e||void 0===e||t.objectMode||(r=new m("chunk",["string","Buffer","Uint8Array"],e)),r}(h,e)),s)_(t,s);else if(h.objectMode||e&&e.length>0)if("string"==typeof e||h.objectMode||Object.getPrototypeOf(e)===a.prototype||(e=function(t){return a.from(t)}(e)),i)h.endEmitted?_(t,new w):C(t,h,e,!0);else if(h.ended)_(t,new v);else{if(h.destroyed)return!1;h.reading=!1,h.decoder&&!r?(e=h.decoder.write(e),h.objectMode||0!==e.length?C(t,h,e,!1):B(t,h)):C(t,h,e,!1)}else i||(h.reading=!1,B(t,h));return!h.ended&&(h.length<h.highWaterMark||0===h.length)}function C(t,e,r,i){e.flowing&&0===e.length&&!e.sync?(e.awaitDrain=0,t.emit("data",r)):(e.length+=e.objectMode?1:r.length,i?e.buffer.unshift(r):e.buffer.push(r),e.needReadable&&T(t)),B(t,e)}Object.defineProperty(M.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&this._readableState.destroyed},set:function(t){this._readableState&&(this._readableState.destroyed=t)}}),M.prototype.destroy=p.destroy,M.prototype._undestroy=p.undestroy,M.prototype._destroy=function(t,e){e(t)},M.prototype.push=function(t,e){var r,i=this._readableState;return i.objectMode?r=!0:"string"==typeof t&&((e=e||i.defaultEncoding)!==i.encoding&&(t=a.from(t,e),e=""),r=!0),A(this,t,e,!1,r)},M.prototype.unshift=function(t){return A(this,t,null,!0,!1)},M.prototype.isPaused=function(){return!1===this._readableState.flowing},M.prototype.setEncoding=function(t){c||(c=r(32553).s);var e=new c(t);this._readableState.decoder=e,this._readableState.encoding=this._readableState.decoder.encoding;for(var i=this._readableState.buffer.head,n="";null!==i;)n+=e.write(i.data),i=i.next;return this._readableState.buffer.clear(),""!==n&&this._readableState.buffer.push(n),this._readableState.length=n.length,this};var k=1073741824;function I(t,e){return t<=0||0===e.length&&e.ended?0:e.objectMode?1:t!=t?e.flowing&&e.length?e.buffer.head.data.length:e.length:(t>e.highWaterMark&&(e.highWaterMark=function(t){return t>=k?t=k:(t--,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,t++),t}(t)),t<=e.length?t:e.ended?e.length:(e.needReadable=!0,0))}function T(t){var e=t._readableState;n("emitReadable",e.needReadable,e.emittedReadable),e.needReadable=!1,e.emittedReadable||(n("emitReadable",e.flowing),e.emittedReadable=!0,process.nextTick(R,t))}function R(t){var e=t._readableState;n("emitReadable_",e.destroyed,e.length,e.ended),e.destroyed||!e.length&&!e.ended||(t.emit("readable"),e.emittedReadable=!1),e.needReadable=!e.flowing&&!e.ended&&e.length<=e.highWaterMark,O(t)}function B(t,e){e.readingMore||(e.readingMore=!0,process.nextTick(x,t,e))}function x(t,e){for(;!e.reading&&!e.ended&&(e.length<e.highWaterMark||e.flowing&&0===e.length);){var r=e.length;if(n("maybeReadMore read 0"),t.read(0),r===e.length)break}e.readingMore=!1}function F(t){var e=t._readableState;e.readableListening=t.listenerCount("readable")>0,e.resumeScheduled&&!e.paused?e.flowing=!0:t.listenerCount("data")>0&&t.resume()}function P(t){n("readable nexttick read 0"),t.read(0)}function N(t,e){n("resume",e.reading),e.reading||t.read(0),e.resumeScheduled=!1,t.emit("resume"),O(t),e.flowing&&!e.reading&&t.read(0)}function O(t){var e=t._readableState;for(n("flow",e.flowing);e.flowing&&null!==t.read(););}function L(t,e){return 0===e.length?null:(e.objectMode?r=e.buffer.shift():!t||t>=e.length?(r=e.decoder?e.buffer.join(""):1===e.buffer.length?e.buffer.first():e.buffer.concat(e.length),e.buffer.clear()):r=e.buffer.consume(t,e.decoder),r);var r}function U(t){var e=t._readableState;n("endReadable",e.endEmitted),e.endEmitted||(e.ended=!0,process.nextTick(j,e,t))}function j(t,e){if(n("endReadableNT",t.endEmitted,t.length),!t.endEmitted&&0===t.length&&(t.endEmitted=!0,e.readable=!1,e.emit("end"),t.autoDestroy)){var r=e._writableState;(!r||r.autoDestroy&&r.finished)&&e.destroy()}}function D(t,e){for(var r=0,i=t.length;r<i;r++)if(t[r]===e)return r;return-1}M.prototype.read=function(t){n("read",t),t=parseInt(t,10);var e=this._readableState,r=t;if(0!==t&&(e.emittedReadable=!1),0===t&&e.needReadable&&((0!==e.highWaterMark?e.length>=e.highWaterMark:e.length>0)||e.ended))return n("read: emitReadable",e.length,e.ended),0===e.length&&e.ended?U(this):T(this),null;if(0===(t=I(t,e))&&e.ended)return 0===e.length&&U(this),null;var i,o=e.needReadable;return n("need readable",o),(0===e.length||e.length-t<e.highWaterMark)&&n("length less than watermark",o=!0),e.ended||e.reading?n("reading or ended",o=!1):o&&(n("do read"),e.reading=!0,e.sync=!0,0===e.length&&(e.needReadable=!0),this._read(e.highWaterMark),e.sync=!1,e.reading||(t=I(r,e))),null===(i=t>0?L(t,e):null)?(e.needReadable=e.length<=e.highWaterMark,t=0):(e.length-=t,e.awaitDrain=0),0===e.length&&(e.ended||(e.needReadable=!0),r!==t&&e.ended&&U(this)),null!==i&&this.emit("data",i),i},M.prototype._read=function(t){_(this,new b("_read()"))},M.prototype.pipe=function(t,e){var r=this,i=this._readableState;switch(i.pipesCount){case 0:i.pipes=t;break;case 1:i.pipes=[i.pipes,t];break;default:i.pipes.push(t)}i.pipesCount+=1,n("pipe count=%d opts=%j",i.pipesCount,e);var s=e&&!1===e.end||t===process.stdout||t===process.stderr?p:a;function a(){n("onend"),t.end()}i.endEmitted?process.nextTick(s):r.once("end",s),t.on("unpipe",(function e(o,s){n("onunpipe"),o===r&&s&&!1===s.hasUnpiped&&(s.hasUnpiped=!0,n("cleanup"),t.removeListener("close",l),t.removeListener("finish",d),t.removeListener("drain",u),t.removeListener("error",f),t.removeListener("unpipe",e),r.removeListener("end",a),r.removeListener("end",p),r.removeListener("data",c),h=!0,!i.awaitDrain||t._writableState&&!t._writableState.needDrain||u())}));var u=function(t){return function(){var e=t._readableState;n("pipeOnDrain",e.awaitDrain),e.awaitDrain&&e.awaitDrain--,0===e.awaitDrain&&o(t,"data")&&(e.flowing=!0,O(t))}}(r);t.on("drain",u);var h=!1;function c(e){n("ondata");var o=t.write(e);n("dest.write",o),!1===o&&((1===i.pipesCount&&i.pipes===t||i.pipesCount>1&&-1!==D(i.pipes,t))&&!h&&(n("false write response, pause",i.awaitDrain),i.awaitDrain++),r.pause())}function f(e){n("onerror",e),p(),t.removeListener("error",f),0===o(t,"error")&&_(t,e)}function l(){t.removeListener("finish",d),p()}function d(){n("onfinish"),t.removeListener("close",l),p()}function p(){n("unpipe"),r.unpipe(t)}return r.on("data",c),function(t,e,r){if("function"==typeof t.prependListener)return t.prependListener(e,r);t._events&&t._events.error?Array.isArray(t._events.error)?t._events.error.unshift(r):t._events.error=[r,t._events.error]:t.on(e,r)}(t,"error",f),t.once("close",l),t.once("finish",d),t.emit("pipe",r),i.flowing||(n("pipe resume"),r.resume()),t},M.prototype.unpipe=function(t){var e=this._readableState,r={hasUnpiped:!1};if(0===e.pipesCount)return this;if(1===e.pipesCount)return t&&t!==e.pipes||(t||(t=e.pipes),e.pipes=null,e.pipesCount=0,e.flowing=!1,t&&t.emit("unpipe",this,r)),this;if(!t){var i=e.pipes,n=e.pipesCount;e.pipes=null,e.pipesCount=0,e.flowing=!1;for(var o=0;o<n;o++)i[o].emit("unpipe",this,{hasUnpiped:!1});return this}var s=D(e.pipes,t);return-1===s||(e.pipes.splice(s,1),e.pipesCount-=1,1===e.pipesCount&&(e.pipes=e.pipes[0]),t.emit("unpipe",this,r)),this},M.prototype.on=function(t,e){var r=s.prototype.on.call(this,t,e),i=this._readableState;return"data"===t?(i.readableListening=this.listenerCount("readable")>0,!1!==i.flowing&&this.resume()):"readable"===t&&(i.endEmitted||i.readableListening||(i.readableListening=i.needReadable=!0,i.flowing=!1,i.emittedReadable=!1,n("on readable",i.length,i.reading),i.length?T(this):i.reading||process.nextTick(P,this))),r},M.prototype.addListener=M.prototype.on,M.prototype.removeListener=function(t,e){var r=s.prototype.removeListener.call(this,t,e);return"readable"===t&&process.nextTick(F,this),r},M.prototype.removeAllListeners=function(t){var e=s.prototype.removeAllListeners.apply(this,arguments);return"readable"!==t&&void 0!==t||process.nextTick(F,this),e},M.prototype.resume=function(){var t=this._readableState;return t.flowing||(n("resume"),t.flowing=!t.readableListening,function(t,e){e.resumeScheduled||(e.resumeScheduled=!0,process.nextTick(N,t,e))}(this,t)),t.paused=!1,this},M.prototype.pause=function(){return n("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(n("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},M.prototype.wrap=function(t){var e=this,r=this._readableState,i=!1;for(var o in t.on("end",(function(){if(n("wrapped end"),r.decoder&&!r.ended){var t=r.decoder.end();t&&t.length&&e.push(t)}e.push(null)})),t.on("data",(function(o){n("wrapped data"),r.decoder&&(o=r.decoder.write(o)),r.objectMode&&null==o||(r.objectMode||o&&o.length)&&(e.push(o)||(i=!0,t.pause()))})),t)void 0===this[o]&&"function"==typeof t[o]&&(this[o]=function(e){return function(){return t[e].apply(t,arguments)}}(o));for(var s=0;s<S.length;s++)t.on(S[s],this.emit.bind(this,S[s]));return this._read=function(e){n("wrapped _read",e),i&&(i=!1,t.resume())},this},"function"==typeof Symbol&&(M.prototype[Symbol.asyncIterator]=function(){return void 0===f&&(f=r(20828)),f(this)}),Object.defineProperty(M.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Object.defineProperty(M.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty(M.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(t){this._readableState&&(this._readableState.flowing=t)}}),M._fromList=L,Object.defineProperty(M.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}}),"function"==typeof Symbol&&(M.from=function(t,e){return void 0===l&&(l=r(31265)),l(M,t,e)})},94473:(t,e,r)=>{"use strict";t.exports=c;var i=r(58106).q,n=i.ERR_METHOD_NOT_IMPLEMENTED,o=i.ERR_MULTIPLE_CALLBACK,s=i.ERR_TRANSFORM_ALREADY_TRANSFORMING,a=i.ERR_TRANSFORM_WITH_LENGTH_0,u=r(68656);function h(t,e){var r=this._transformState;r.transforming=!1;var i=r.writecb;if(null===i)return this.emit("error",new o);r.writechunk=null,r.writecb=null,null!=e&&this.push(e),i(t);var n=this._readableState;n.reading=!1,(n.needReadable||n.length<n.highWaterMark)&&this._read(n.highWaterMark)}function c(t){if(!(this instanceof c))return new c(t);u.call(this,t),this._transformState={afterTransform:h.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,t&&("function"==typeof t.transform&&(this._transform=t.transform),"function"==typeof t.flush&&(this._flush=t.flush)),this.on("prefinish",f)}function f(){var t=this;"function"!=typeof this._flush||this._readableState.destroyed?l(this,null,null):this._flush((function(e,r){l(t,e,r)}))}function l(t,e,r){if(e)return t.emit("error",e);if(null!=r&&t.push(r),t._writableState.length)throw new a;if(t._transformState.transforming)throw new s;return t.push(null)}r(35717)(c,u),c.prototype.push=function(t,e){return this._transformState.needTransform=!1,u.prototype.push.call(this,t,e)},c.prototype._transform=function(t,e,r){r(new n("_transform()"))},c.prototype._write=function(t,e,r){var i=this._transformState;if(i.writecb=r,i.writechunk=t,i.writeencoding=e,!i.transforming){var n=this._readableState;(i.needTransform||n.needReadable||n.length<n.highWaterMark)&&this._read(n.highWaterMark)}},c.prototype._read=function(t){var e=this._transformState;null===e.writechunk||e.transforming?e.needTransform=!0:(e.transforming=!0,this._transform(e.writechunk,e.writeencoding,e.afterTransform))},c.prototype._destroy=function(t,e){u.prototype._destroy.call(this,t,(function(t){e(t)}))}},20323:(t,e,r)=>{"use strict";function i(t){var e=this;this.next=null,this.entry=null,this.finish=function(){!function(t,e,r){var i=t.entry;for(t.entry=null;i;){var n=i.callback;e.pendingcb--,n(undefined),i=i.next}e.corkedRequestsFree.next=t}(e,t)}}var n;t.exports=M,M.WritableState=E;var o,s={deprecate:r(94927)},a=r(83194),u=r(48764).Buffer,h=r.g.Uint8Array||function(){},c=r(71029),f=r(30094).getHighWaterMark,l=r(58106).q,d=l.ERR_INVALID_ARG_TYPE,p=l.ERR_METHOD_NOT_IMPLEMENTED,g=l.ERR_MULTIPLE_CALLBACK,y=l.ERR_STREAM_CANNOT_PIPE,m=l.ERR_STREAM_DESTROYED,v=l.ERR_STREAM_NULL_VALUES,b=l.ERR_STREAM_WRITE_AFTER_END,w=l.ERR_UNKNOWN_ENCODING,_=c.errorOrDestroy;function S(){}function E(t,e,o){n=n||r(68656),t=t||{},"boolean"!=typeof o&&(o=e instanceof n),this.objectMode=!!t.objectMode,o&&(this.objectMode=this.objectMode||!!t.writableObjectMode),this.highWaterMark=f(this,t,"writableHighWaterMark",o),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var s=!1===t.decodeStrings;this.decodeStrings=!s,this.defaultEncoding=t.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(t){!function(t,e){var r=t._writableState,i=r.sync,n=r.writecb;if("function"!=typeof n)throw new g;if(function(t){t.writing=!1,t.writecb=null,t.length-=t.writelen,t.writelen=0}(r),e)!function(t,e,r,i,n){--e.pendingcb,r?(process.nextTick(n,i),process.nextTick(R,t,e),t._writableState.errorEmitted=!0,_(t,i)):(n(i),t._writableState.errorEmitted=!0,_(t,i),R(t,e))}(t,r,i,e,n);else{var o=I(r)||t.destroyed;o||r.corked||r.bufferProcessing||!r.bufferedRequest||k(t,r),i?process.nextTick(C,t,r,o,n):C(t,r,o,n)}}(e,t)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!1!==t.emitClose,this.autoDestroy=!!t.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new i(this)}function M(t){var e=this instanceof(n=n||r(68656));if(!e&&!o.call(M,this))return new M(t);this._writableState=new E(t,this,e),this.writable=!0,t&&("function"==typeof t.write&&(this._write=t.write),"function"==typeof t.writev&&(this._writev=t.writev),"function"==typeof t.destroy&&(this._destroy=t.destroy),"function"==typeof t.final&&(this._final=t.final)),a.call(this)}function A(t,e,r,i,n,o,s){e.writelen=i,e.writecb=s,e.writing=!0,e.sync=!0,e.destroyed?e.onwrite(new m("write")):r?t._writev(n,e.onwrite):t._write(n,o,e.onwrite),e.sync=!1}function C(t,e,r,i){r||function(t,e){0===e.length&&e.needDrain&&(e.needDrain=!1,t.emit("drain"))}(t,e),e.pendingcb--,i(),R(t,e)}function k(t,e){e.bufferProcessing=!0;var r=e.bufferedRequest;if(t._writev&&r&&r.next){var n=e.bufferedRequestCount,o=new Array(n),s=e.corkedRequestsFree;s.entry=r;for(var a=0,u=!0;r;)o[a]=r,r.isBuf||(u=!1),r=r.next,a+=1;o.allBuffers=u,A(t,e,!0,e.length,o,"",s.finish),e.pendingcb++,e.lastBufferedRequest=null,s.next?(e.corkedRequestsFree=s.next,s.next=null):e.corkedRequestsFree=new i(e),e.bufferedRequestCount=0}else{for(;r;){var h=r.chunk,c=r.encoding,f=r.callback;if(A(t,e,!1,e.objectMode?1:h.length,h,c,f),r=r.next,e.bufferedRequestCount--,e.writing)break}null===r&&(e.lastBufferedRequest=null)}e.bufferedRequest=r,e.bufferProcessing=!1}function I(t){return t.ending&&0===t.length&&null===t.bufferedRequest&&!t.finished&&!t.writing}function T(t,e){t._final((function(r){e.pendingcb--,r&&_(t,r),e.prefinished=!0,t.emit("prefinish"),R(t,e)}))}function R(t,e){var r=I(e);if(r&&(function(t,e){e.prefinished||e.finalCalled||("function"!=typeof t._final||e.destroyed?(e.prefinished=!0,t.emit("prefinish")):(e.pendingcb++,e.finalCalled=!0,process.nextTick(T,t,e)))}(t,e),0===e.pendingcb&&(e.finished=!0,t.emit("finish"),e.autoDestroy))){var i=t._readableState;(!i||i.autoDestroy&&i.endEmitted)&&t.destroy()}return r}r(35717)(M,a),E.prototype.getBuffer=function(){for(var t=this.bufferedRequest,e=[];t;)e.push(t),t=t.next;return e},function(){try{Object.defineProperty(E.prototype,"buffer",{get:s.deprecate((function(){return this.getBuffer()}),"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(t){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(o=Function.prototype[Symbol.hasInstance],Object.defineProperty(M,Symbol.hasInstance,{value:function(t){return!!o.call(this,t)||this===M&&t&&t._writableState instanceof E}})):o=function(t){return t instanceof this},M.prototype.pipe=function(){_(this,new y)},M.prototype.write=function(t,e,r){var i,n=this._writableState,o=!1,s=!n.objectMode&&(i=t,u.isBuffer(i)||i instanceof h);return s&&!u.isBuffer(t)&&(t=function(t){return u.from(t)}(t)),"function"==typeof e&&(r=e,e=null),s?e="buffer":e||(e=n.defaultEncoding),"function"!=typeof r&&(r=S),n.ending?function(t,e){var r=new b;_(t,r),process.nextTick(e,r)}(this,r):(s||function(t,e,r,i){var n;return null===r?n=new v:"string"==typeof r||e.objectMode||(n=new d("chunk",["string","Buffer"],r)),!n||(_(t,n),process.nextTick(i,n),!1)}(this,n,t,r))&&(n.pendingcb++,o=function(t,e,r,i,n,o){if(!r){var s=function(t,e,r){return t.objectMode||!1===t.decodeStrings||"string"!=typeof e||(e=u.from(e,r)),e}(e,i,n);i!==s&&(r=!0,n="buffer",i=s)}var a=e.objectMode?1:i.length;e.length+=a;var h=e.length<e.highWaterMark;if(h||(e.needDrain=!0),e.writing||e.corked){var c=e.lastBufferedRequest;e.lastBufferedRequest={chunk:i,encoding:n,isBuf:r,callback:o,next:null},c?c.next=e.lastBufferedRequest:e.bufferedRequest=e.lastBufferedRequest,e.bufferedRequestCount+=1}else A(t,e,!1,a,i,n,o);return h}(this,n,s,t,e,r)),o},M.prototype.cork=function(){this._writableState.corked++},M.prototype.uncork=function(){var t=this._writableState;t.corked&&(t.corked--,t.writing||t.corked||t.bufferProcessing||!t.bufferedRequest||k(this,t))},M.prototype.setDefaultEncoding=function(t){if("string"==typeof t&&(t=t.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((t+"").toLowerCase())>-1))throw new w(t);return this._writableState.defaultEncoding=t,this},Object.defineProperty(M.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(M.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),M.prototype._write=function(t,e,r){r(new p("_write()"))},M.prototype._writev=null,M.prototype.end=function(t,e,r){var i=this._writableState;return"function"==typeof t?(r=t,t=null,e=null):"function"==typeof e&&(r=e,e=null),null!=t&&this.write(t,e),i.corked&&(i.corked=1,this.uncork()),i.ending||function(t,e,r){e.ending=!0,R(t,e),r&&(e.finished?process.nextTick(r):t.once("finish",r)),e.ended=!0,t.writable=!1}(this,i,r),this},Object.defineProperty(M.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(M.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(t){this._writableState&&(this._writableState.destroyed=t)}}),M.prototype.destroy=c.destroy,M.prototype._undestroy=c.undestroy,M.prototype._destroy=function(t,e){e(t)}},20828:(t,e,r)=>{"use strict";var i;function n(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var o=r(81086),s=Symbol("lastResolve"),a=Symbol("lastReject"),u=Symbol("error"),h=Symbol("ended"),c=Symbol("lastPromise"),f=Symbol("handlePromise"),l=Symbol("stream");function d(t,e){return{value:t,done:e}}function p(t){var e=t[s];if(null!==e){var r=t[l].read();null!==r&&(t[c]=null,t[s]=null,t[a]=null,e(d(r,!1)))}}function g(t){process.nextTick(p,t)}var y=Object.getPrototypeOf((function(){})),m=Object.setPrototypeOf((n(i={get stream(){return this[l]},next:function(){var t=this,e=this[u];if(null!==e)return Promise.reject(e);if(this[h])return Promise.resolve(d(void 0,!0));if(this[l].destroyed)return new Promise((function(e,r){process.nextTick((function(){t[u]?r(t[u]):e(d(void 0,!0))}))}));var r,i=this[c];if(i)r=new Promise(function(t,e){return function(r,i){t.then((function(){e[h]?r(d(void 0,!0)):e[f](r,i)}),i)}}(i,this));else{var n=this[l].read();if(null!==n)return Promise.resolve(d(n,!1));r=new Promise(this[f])}return this[c]=r,r}},Symbol.asyncIterator,(function(){return this})),n(i,"return",(function(){var t=this;return new Promise((function(e,r){t[l].destroy(null,(function(t){t?r(t):e(d(void 0,!0))}))}))})),i),y);t.exports=function(t){var e,r=Object.create(m,(n(e={},l,{value:t,writable:!0}),n(e,s,{value:null,writable:!0}),n(e,a,{value:null,writable:!0}),n(e,u,{value:null,writable:!0}),n(e,h,{value:t._readableState.endEmitted,writable:!0}),n(e,f,{value:function(t,e){var i=r[l].read();i?(r[c]=null,r[s]=null,r[a]=null,t(d(i,!1))):(r[s]=t,r[a]=e)},writable:!0}),e));return r[c]=null,o(t,(function(t){if(t&&"ERR_STREAM_PREMATURE_CLOSE"!==t.code){var e=r[a];return null!==e&&(r[c]=null,r[s]=null,r[a]=null,e(t)),void(r[u]=t)}var i=r[s];null!==i&&(r[c]=null,r[s]=null,r[a]=null,i(d(void 0,!0))),r[h]=!0})),t.on("readable",g.bind(null,r)),r}},39686:(t,e,r)=>{"use strict";function i(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,i)}return r}function n(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function o(t,e){for(var r=0;r<e.length;r++){var i=e[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}var s=r(48764).Buffer,a=r(61758).inspect,u=a&&a.custom||"inspect";t.exports=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.head=null,this.tail=null,this.length=0}var e,r;return e=t,(r=[{key:"push",value:function(t){var e={data:t,next:null};this.length>0?this.tail.next=e:this.head=e,this.tail=e,++this.length}},{key:"unshift",value:function(t){var e={data:t,next:this.head};0===this.length&&(this.tail=e),this.head=e,++this.length}},{key:"shift",value:function(){if(0!==this.length){var t=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,t}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(t){if(0===this.length)return"";for(var e=this.head,r=""+e.data;e=e.next;)r+=t+e.data;return r}},{key:"concat",value:function(t){if(0===this.length)return s.alloc(0);for(var e,r,i,n=s.allocUnsafe(t>>>0),o=this.head,a=0;o;)e=o.data,r=n,i=a,s.prototype.copy.call(e,r,i),a+=o.data.length,o=o.next;return n}},{key:"consume",value:function(t,e){var r;return t<this.head.data.length?(r=this.head.data.slice(0,t),this.head.data=this.head.data.slice(t)):r=t===this.head.data.length?this.shift():e?this._getString(t):this._getBuffer(t),r}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(t){var e=this.head,r=1,i=e.data;for(t-=i.length;e=e.next;){var n=e.data,o=t>n.length?n.length:t;if(o===n.length?i+=n:i+=n.slice(0,t),0==(t-=o)){o===n.length?(++r,e.next?this.head=e.next:this.head=this.tail=null):(this.head=e,e.data=n.slice(o));break}++r}return this.length-=r,i}},{key:"_getBuffer",value:function(t){var e=s.allocUnsafe(t),r=this.head,i=1;for(r.data.copy(e),t-=r.data.length;r=r.next;){var n=r.data,o=t>n.length?n.length:t;if(n.copy(e,e.length-t,0,o),0==(t-=o)){o===n.length?(++i,r.next?this.head=r.next:this.head=this.tail=null):(this.head=r,r.data=n.slice(o));break}++i}return this.length-=i,e}},{key:u,value:function(t,e){return a(this,function(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?i(Object(r),!0).forEach((function(e){n(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):i(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}({},e,{depth:0,customInspect:!1}))}}])&&o(e.prototype,r),t}()},71029:t=>{"use strict";function e(t,e){i(t,e),r(t)}function r(t){t._writableState&&!t._writableState.emitClose||t._readableState&&!t._readableState.emitClose||t.emit("close")}function i(t,e){t.emit("error",e)}t.exports={destroy:function(t,n){var o=this,s=this._readableState&&this._readableState.destroyed,a=this._writableState&&this._writableState.destroyed;return s||a?(n?n(t):t&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,process.nextTick(i,this,t)):process.nextTick(i,this,t)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(t||null,(function(t){!n&&t?o._writableState?o._writableState.errorEmitted?process.nextTick(r,o):(o._writableState.errorEmitted=!0,process.nextTick(e,o,t)):process.nextTick(e,o,t):n?(process.nextTick(r,o),n(t)):process.nextTick(r,o)})),this)},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)},errorOrDestroy:function(t,e){var r=t._readableState,i=t._writableState;r&&r.autoDestroy||i&&i.autoDestroy?t.destroy(e):t.emit("error",e)}}},81086:(t,e,r)=>{"use strict";var i=r(58106).q.ERR_STREAM_PREMATURE_CLOSE;function n(){}t.exports=function t(e,r,o){if("function"==typeof r)return t(e,null,r);r||(r={}),o=function(t){var e=!1;return function(){if(!e){e=!0;for(var r=arguments.length,i=new Array(r),n=0;n<r;n++)i[n]=arguments[n];t.apply(this,i)}}}(o||n);var s=r.readable||!1!==r.readable&&e.readable,a=r.writable||!1!==r.writable&&e.writable,u=function(){e.writable||c()},h=e._writableState&&e._writableState.finished,c=function(){a=!1,h=!0,s||o.call(e)},f=e._readableState&&e._readableState.endEmitted,l=function(){s=!1,f=!0,a||o.call(e)},d=function(t){o.call(e,t)},p=function(){var t;return s&&!f?(e._readableState&&e._readableState.ended||(t=new i),o.call(e,t)):a&&!h?(e._writableState&&e._writableState.ended||(t=new i),o.call(e,t)):void 0},g=function(){e.req.on("finish",c)};return function(t){return t.setHeader&&"function"==typeof t.abort}(e)?(e.on("complete",c),e.on("abort",p),e.req?g():e.on("request",g)):a&&!e._writableState&&(e.on("end",u),e.on("close",u)),e.on("end",l),e.on("finish",c),!1!==r.error&&e.on("error",d),e.on("close",p),function(){e.removeListener("complete",c),e.removeListener("abort",p),e.removeListener("request",g),e.req&&e.req.removeListener("finish",c),e.removeListener("end",u),e.removeListener("close",u),e.removeListener("finish",c),e.removeListener("end",l),e.removeListener("error",d),e.removeListener("close",p)}}},31265:t=>{t.exports=function(){throw new Error("Readable.from is not available in the browser")}},56472:(t,e,r)=>{"use strict";var i,n=r(58106).q,o=n.ERR_MISSING_ARGS,s=n.ERR_STREAM_DESTROYED;function a(t){if(t)throw t}function u(t,e,n,o){o=function(t){var e=!1;return function(){e||(e=!0,t.apply(void 0,arguments))}}(o);var a=!1;t.on("close",(function(){a=!0})),void 0===i&&(i=r(81086)),i(t,{readable:e,writable:n},(function(t){if(t)return o(t);a=!0,o()}));var u=!1;return function(e){if(!a&&!u)return u=!0,function(t){return t.setHeader&&"function"==typeof t.abort}(t)?t.abort():"function"==typeof t.destroy?t.destroy():void o(e||new s("pipe"))}}function h(t){t()}function c(t,e){return t.pipe(e)}function f(t){return t.length?"function"!=typeof t[t.length-1]?a:t.pop():a}t.exports=function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];var i,n=f(e);if(Array.isArray(e[0])&&(e=e[0]),e.length<2)throw new o("streams");var s=e.map((function(t,r){var o=r<e.length-1;return u(t,o,r>0,(function(t){i||(i=t),t&&s.forEach(h),o||(s.forEach(h),n(i))}))}));return e.reduce(c)}},30094:(t,e,r)=>{"use strict";var i=r(58106).q.ERR_INVALID_OPT_VALUE;t.exports={getHighWaterMark:function(t,e,r,n){var o=function(t,e,r){return null!=t.highWaterMark?t.highWaterMark:e?t[r]:null}(e,n,r);if(null!=o){if(!isFinite(o)||Math.floor(o)!==o||o<0)throw new i(n?r:"highWaterMark",o);return Math.floor(o)}return t.objectMode?16:16384}}},83194:(t,e,r)=>{t.exports=r(17187).EventEmitter},32553:(t,e,r)=>{"use strict";var i=r(89509).Buffer,n=i.isEncoding||function(t){switch((t=""+t)&&t.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function o(t){var e;switch(this.encoding=function(t){var e=function(t){if(!t)return"utf8";for(var e;;)switch(t){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return t;default:if(e)return;t=(""+t).toLowerCase(),e=!0}}(t);if("string"!=typeof e&&(i.isEncoding===n||!n(t)))throw new Error("Unknown encoding: "+t);return e||t}(t),this.encoding){case"utf16le":this.text=u,this.end=h,e=4;break;case"utf8":this.fillLast=a,e=4;break;case"base64":this.text=c,this.end=f,e=3;break;default:return this.write=l,void(this.end=d)}this.lastNeed=0,this.lastTotal=0,this.lastChar=i.allocUnsafe(e)}function s(t){return t<=127?0:t>>5==6?2:t>>4==14?3:t>>3==30?4:t>>6==2?-1:-2}function a(t){var e=this.lastTotal-this.lastNeed,r=function(t,e,r){if(128!=(192&e[0]))return t.lastNeed=0,"�";if(t.lastNeed>1&&e.length>1){if(128!=(192&e[1]))return t.lastNeed=1,"�";if(t.lastNeed>2&&e.length>2&&128!=(192&e[2]))return t.lastNeed=2,"�"}}(this,t);return void 0!==r?r:this.lastNeed<=t.length?(t.copy(this.lastChar,e,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(t.copy(this.lastChar,e,0,t.length),void(this.lastNeed-=t.length))}function u(t,e){if((t.length-e)%2==0){var r=t.toString("utf16le",e);if(r){var i=r.charCodeAt(r.length-1);if(i>=55296&&i<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=t[t.length-1],t.toString("utf16le",e,t.length-1)}function h(t){var e=t&&t.length?this.write(t):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return e+this.lastChar.toString("utf16le",0,r)}return e}function c(t,e){var r=(t.length-e)%3;return 0===r?t.toString("base64",e):(this.lastNeed=3-r,this.lastTotal=3,1===r?this.lastChar[0]=t[t.length-1]:(this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1]),t.toString("base64",e,t.length-r))}function f(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+this.lastChar.toString("base64",0,3-this.lastNeed):e}function l(t){return t.toString(this.encoding)}function d(t){return t&&t.length?this.write(t):""}e.s=o,o.prototype.write=function(t){if(0===t.length)return"";var e,r;if(this.lastNeed){if(void 0===(e=this.fillLast(t)))return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r<t.length?e?e+this.text(t,r):this.text(t,r):e||""},o.prototype.end=function(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+"�":e},o.prototype.text=function(t,e){var r=function(t,e,r){var i=e.length-1;if(i<r)return 0;var n=s(e[i]);return n>=0?(n>0&&(t.lastNeed=n-1),n):--i<r||-2===n?0:(n=s(e[i]))>=0?(n>0&&(t.lastNeed=n-2),n):--i<r||-2===n?0:(n=s(e[i]))>=0?(n>0&&(2===n?n=0:t.lastNeed=n-3),n):0}(this,t,e);if(!this.lastNeed)return t.toString("utf8",e);this.lastTotal=r;var i=t.length-(r-this.lastNeed);return t.copy(this.lastChar,0,i),t.toString("utf8",e,i)},o.prototype.fillLast=function(t){if(this.lastNeed<=t.length)return t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,t.length),this.lastNeed-=t.length}},62899:(t,e,r)=>{"use strict";var i;r.r(e),r.d(e,{Lifecycle:()=>n,autoInjectable:()=>B,container:()=>R,delay:()=>y,inject:()=>x,injectAll:()=>O,injectAllWithTransform:()=>L,injectWithTransform:()=>U,injectable:()=>F,instanceCachingFactory:()=>D,isClassProvider:()=>d,isFactoryProvider:()=>p,isNormalToken:()=>m,isTokenProvider:()=>w,isValueProvider:()=>_,predicateAwareClassFactory:()=>K,registry:()=>P,scoped:()=>j,singleton:()=>N}),function(t){t[t.Transient=0]="Transient",t[t.Singleton=1]="Singleton",t[t.ResolutionScoped=2]="ResolutionScoped",t[t.ContainerScoped=3]="ContainerScoped"}(i||(i={}));const n=i;var o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(t,e)};function s(t,e){function r(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}function a(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],i=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&i>=t.length&&(t=void 0),{value:t&&t[i++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function u(t,e){var r="function"==typeof Symbol&&t[Symbol.iterator];if(!r)return t;var i,n,o=r.call(t),s=[];try{for(;(void 0===e||e-- >0)&&!(i=o.next()).done;)s.push(i.value)}catch(t){n={error:t}}finally{try{i&&!i.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}return s}function h(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(u(arguments[e]));return t}var c="injectionTokens";function f(t){var e=Reflect.getMetadata("design:paramtypes",t)||[],r=Reflect.getOwnMetadata(c,t)||{};return Object.keys(r).forEach((function(t){e[+t]=r[t]})),e}function l(t,e){return function(r,i,n){var o=Reflect.getOwnMetadata(c,r)||{};o[n]=e?{token:t,transform:e.transformToken,transformArgs:e.args||[]}:t,Reflect.defineMetadata(c,o,r)}}function d(t){return!!t.useClass}function p(t){return!!t.useFactory}var g=function(){function t(t){this.wrap=t,this.reflectMethods=["get","getPrototypeOf","setPrototypeOf","getOwnPropertyDescriptor","defineProperty","has","set","deleteProperty","apply","construct","ownKeys"]}return t.prototype.createProxy=function(t){var e,r=this,i=!1;return new Proxy({},this.createHandler((function(){return i||(e=t(r.wrap()),i=!0),e})))},t.prototype.createHandler=function(t){var e={};return this.reflectMethods.forEach((function(r){e[r]=function(){for(var e=[],i=0;i<arguments.length;i++)e[i]=arguments[i];e[0]=t();var n=Reflect[r];return n.apply(void 0,h(e))}})),e},t}();function y(t){if(void 0===t)throw new Error("Attempt to `delay` undefined. Constructor must be wrapped in a callback");return new g(t)}function m(t){return"string"==typeof t||"symbol"==typeof t}function v(t){return"object"==typeof t&&"token"in t&&"multiple"in t}function b(t){return"object"==typeof t&&"token"in t&&"transform"in t}function w(t){return!!t.useToken}function _(t){return null!=t.useValue}const S=function(){function t(){this._registryMap=new Map}return t.prototype.entries=function(){return this._registryMap.entries()},t.prototype.getAll=function(t){return this.ensure(t),this._registryMap.get(t)},t.prototype.get=function(t){this.ensure(t);var e=this._registryMap.get(t);return e[e.length-1]||null},t.prototype.set=function(t,e){this.ensure(t),this._registryMap.get(t).push(e)},t.prototype.setAll=function(t,e){this._registryMap.set(t,e)},t.prototype.has=function(t){return this.ensure(t),this._registryMap.get(t).length>0},t.prototype.clear=function(){this._registryMap.clear()},t.prototype.ensure=function(t){this._registryMap.has(t)||this._registryMap.set(t,[])},t}(),E=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return s(e,t),e}(S),M=function(){this.scopedResolutions=new Map};function A(t,e,r){var i,n,o,s,a=u(t.toString().match(/constructor\(([\w, ]+)\)/)||[],2)[1];return i="Cannot inject the dependency "+(s=e,null===(o=void 0===a?null:a)?"at position #"+s:'"'+o.split(",")[s].trim()+'" at position #'+s)+' of "'+t.name+'" constructor. Reason:',void 0===n&&(n="    "),h([i],r.message.split("\n").map((function(t){return n+t}))).join("\n")}var C=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return s(e,t),e}(S),k=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return s(e,t),e}(S);const I=function(){this.preResolution=new C,this.postResolution=new k};var T=new Map,R=new(function(){function t(t){this.parent=t,this._registry=new E,this.interceptors=new I}return t.prototype.register=function(t,e,r){var i;if(void 0===r&&(r={lifecycle:n.Transient}),i=function(t){return d(t)||_(t)||w(t)||p(t)}(e)?e:{useClass:e},w(i))for(var o=[t],s=i;null!=s;){var a=s.useToken;if(o.includes(a))throw new Error("Token registration cycle detected! "+h(o,[a]).join(" -> "));o.push(a);var u=this._registry.get(a);s=u&&w(u.provider)?u.provider:null}if((r.lifecycle===n.Singleton||r.lifecycle==n.ContainerScoped||r.lifecycle==n.ResolutionScoped)&&(_(i)||p(i)))throw new Error('Cannot use lifecycle "'+n[r.lifecycle]+'" with ValueProviders or FactoryProviders');return this._registry.set(t,{provider:i,options:r}),this},t.prototype.registerType=function(t,e){return m(e)?this.register(t,{useToken:e}):this.register(t,{useClass:e})},t.prototype.registerInstance=function(t,e){return this.register(t,{useValue:e})},t.prototype.registerSingleton=function(t,e){if(m(t)){if(m(e))return this.register(t,{useToken:e},{lifecycle:n.Singleton});if(e)return this.register(t,{useClass:e},{lifecycle:n.Singleton});throw new Error('Cannot register a type name as a singleton without a "to" token')}var r=t;return e&&!m(e)&&(r=e),this.register(t,{useClass:r},{lifecycle:n.Singleton})},t.prototype.resolve=function(t,e){void 0===e&&(e=new M);var r=this.getRegistration(t);if(!r&&m(t))throw new Error('Attempted to resolve unregistered dependency token: "'+t.toString()+'"');if(this.executePreResolutionInterceptor(t,"Single"),r){var i=this.resolveRegistration(r,e);return this.executePostResolutionInterceptor(t,i,"Single"),i}if(function(t){return"function"==typeof t||t instanceof g}(t))return i=this.construct(t,e),this.executePostResolutionInterceptor(t,i,"Single"),i;throw new Error("Attempted to construct an undefined constructor. Could mean a circular dependency problem. Try using `delay` function.")},t.prototype.executePreResolutionInterceptor=function(t,e){var r,i;if(this.interceptors.preResolution.has(t)){var n=[];try{for(var o=a(this.interceptors.preResolution.getAll(t)),s=o.next();!s.done;s=o.next()){var u=s.value;"Once"!=u.options.frequency&&n.push(u),u.callback(t,e)}}catch(t){r={error:t}}finally{try{s&&!s.done&&(i=o.return)&&i.call(o)}finally{if(r)throw r.error}}this.interceptors.preResolution.setAll(t,n)}},t.prototype.executePostResolutionInterceptor=function(t,e,r){var i,n;if(this.interceptors.postResolution.has(t)){var o=[];try{for(var s=a(this.interceptors.postResolution.getAll(t)),u=s.next();!u.done;u=s.next()){var h=u.value;"Once"!=h.options.frequency&&o.push(h),h.callback(t,e,r)}}catch(t){i={error:t}}finally{try{u&&!u.done&&(n=s.return)&&n.call(s)}finally{if(i)throw i.error}}this.interceptors.postResolution.setAll(t,o)}},t.prototype.resolveRegistration=function(t,e){if(t.options.lifecycle===n.ResolutionScoped&&e.scopedResolutions.has(t))return e.scopedResolutions.get(t);var r,i=t.options.lifecycle===n.Singleton,o=t.options.lifecycle===n.ContainerScoped,s=i||o;return r=_(t.provider)?t.provider.useValue:w(t.provider)?s?t.instance||(t.instance=this.resolve(t.provider.useToken,e)):this.resolve(t.provider.useToken,e):d(t.provider)?s?t.instance||(t.instance=this.construct(t.provider.useClass,e)):this.construct(t.provider.useClass,e):p(t.provider)?t.provider.useFactory(this):this.construct(t.provider,e),t.options.lifecycle===n.ResolutionScoped&&e.scopedResolutions.set(t,r),r},t.prototype.resolveAll=function(t,e){var r=this;void 0===e&&(e=new M);var i=this.getAllRegistrations(t);if(!i&&m(t))throw new Error('Attempted to resolve unregistered dependency token: "'+t.toString()+'"');if(this.executePreResolutionInterceptor(t,"All"),i){var n=i.map((function(t){return r.resolveRegistration(t,e)}));return this.executePostResolutionInterceptor(t,n,"All"),n}var o=[this.construct(t,e)];return this.executePostResolutionInterceptor(t,o,"All"),o},t.prototype.isRegistered=function(t,e){return void 0===e&&(e=!1),this._registry.has(t)||e&&(this.parent||!1)&&this.parent.isRegistered(t,!0)},t.prototype.reset=function(){this._registry.clear(),this.interceptors.preResolution.clear(),this.interceptors.postResolution.clear()},t.prototype.clearInstances=function(){var t,e;try{for(var r=a(this._registry.entries()),i=r.next();!i.done;i=r.next()){var n=u(i.value,2),o=n[0],s=n[1];this._registry.setAll(o,s.filter((function(t){return!_(t.provider)})).map((function(t){return t.instance=void 0,t})))}}catch(e){t={error:e}}finally{try{i&&!i.done&&(e=r.return)&&e.call(r)}finally{if(t)throw t.error}}},t.prototype.createChildContainer=function(){var e,r,i=new t(this);try{for(var o=a(this._registry.entries()),s=o.next();!s.done;s=o.next()){var h=u(s.value,2),c=h[0],f=h[1];f.some((function(t){return t.options.lifecycle===n.ContainerScoped}))&&i._registry.setAll(c,f.map((function(t){return t.options.lifecycle===n.ContainerScoped?{provider:t.provider,options:t.options}:t})))}}catch(t){e={error:t}}finally{try{s&&!s.done&&(r=o.return)&&r.call(o)}finally{if(e)throw e.error}}return i},t.prototype.beforeResolution=function(t,e,r){void 0===r&&(r={frequency:"Always"}),this.interceptors.preResolution.set(t,{callback:e,options:r})},t.prototype.afterResolution=function(t,e,r){void 0===r&&(r={frequency:"Always"}),this.interceptors.postResolution.set(t,{callback:e,options:r})},t.prototype.getRegistration=function(t){return this.isRegistered(t)?this._registry.get(t):this.parent?this.parent.getRegistration(t):null},t.prototype.getAllRegistrations=function(t){return this.isRegistered(t)?this._registry.getAll(t):this.parent?this.parent.getAllRegistrations(t):null},t.prototype.construct=function(t,e){var r=this;if(t instanceof g)return t.createProxy((function(t){return r.resolve(t,e)}));var i=T.get(t);if(!i||0===i.length){if(0===t.length)return new t;throw new Error('TypeInfo not known for "'+t.name+'"')}var n=i.map(this.resolveParams(e,t));return new(t.bind.apply(t,h([void 0],n)))},t.prototype.resolveParams=function(t,e){var r=this;return function(i,n){var o,s,a;try{return v(i)?b(i)?i.multiple?(o=r.resolve(i.transform)).transform.apply(o,h([r.resolveAll(i.token)],i.transformArgs)):(s=r.resolve(i.transform)).transform.apply(s,h([r.resolve(i.token,t)],i.transformArgs)):i.multiple?r.resolveAll(i.token):r.resolve(i.token,t):b(i)?(a=r.resolve(i.transform,t)).transform.apply(a,h([r.resolve(i.token,t)],i.transformArgs)):r.resolve(i,t)}catch(t){throw new Error(A(e,n,t))}}},t}());const B=function(){return function(t){var e=f(t);return function(r){function i(){for(var i=[],n=0;n<arguments.length;n++)i[n]=arguments[n];return r.apply(this,h(i.concat(e.slice(i.length).map((function(e,r){var n,o,s;try{return v(e)?b(e)?e.multiple?(n=R.resolve(e.transform)).transform.apply(n,h([R.resolveAll(e.token)],e.transformArgs)):(o=R.resolve(e.transform)).transform.apply(o,h([R.resolve(e.token)],e.transformArgs)):e.multiple?R.resolveAll(e.token):R.resolve(e.token):b(e)?(s=R.resolve(e.transform)).transform.apply(s,h([R.resolve(e.token)],e.transformArgs)):R.resolve(e)}catch(e){var a=r+i.length;throw new Error(A(t,a,e))}})))))||this}return s(i,r),i}(t)}},x=function(t){return l(t)},F=function(){return function(t){T.set(t,f(t))}},P=function(t){return void 0===t&&(t=[]),function(e){return t.forEach((function(t){var e=t.token,r=t.options,i=function(t,e){var r={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(r[i]=t[i]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(i=Object.getOwnPropertySymbols(t);n<i.length;n++)e.indexOf(i[n])<0&&Object.prototype.propertyIsEnumerable.call(t,i[n])&&(r[i[n]]=t[i[n]])}return r}(t,["token","options"]);return R.register(e,i,r)})),e}},N=function(){return function(t){F()(t),R.registerSingleton(t)}},O=function(t){return l({token:t,multiple:!0})},L=function(t,e){for(var r=[],i=2;i<arguments.length;i++)r[i-2]=arguments[i];var n={token:t,multiple:!0,transform:e,transformArgs:r};return l(n)},U=function(t,e){for(var r=[],i=2;i<arguments.length;i++)r[i-2]=arguments[i];return l(t,{transformToken:e,args:r})};function j(t,e){return function(r){F()(r),R.register(e||r,r,{lifecycle:t})}}function D(t){var e;return function(r){return null==e&&(e=t(r)),e}}function K(t,e,r,i){var n,o;return void 0===i&&(i=!0),function(s){var a=t(s);return i&&o===a||(n=(o=a)?s.resolve(e):s.resolve(r)),n}}if("undefined"==typeof Reflect||!Reflect.getMetadata)throw new Error("tsyringe requires a reflect polyfill. Please add 'import \"reflect-metadata\"' to the top of your entry point.")},94927:(t,e,r)=>{function i(t){try{if(!r.g.localStorage)return!1}catch(t){return!1}var e=r.g.localStorage[t];return null!=e&&"true"===String(e).toLowerCase()}t.exports=function(t,e){if(i("noDeprecation"))return t;var r=!1;return function(){if(!r){if(i("throwDeprecation"))throw new Error(e);i("traceDeprecation")?console.trace(e):console.warn(e),r=!0}return t.apply(this,arguments)}}},20384:t=>{t.exports=function(t){return t&&"object"==typeof t&&"function"==typeof t.copy&&"function"==typeof t.fill&&"function"==typeof t.readUInt8}},55955:(t,e,r)=>{"use strict";var i=r(82584),n=r(48662),o=r(86430),s=r(85692);function a(t){return t.call.bind(t)}var u="undefined"!=typeof BigInt,h="undefined"!=typeof Symbol,c=a(Object.prototype.toString),f=a(Number.prototype.valueOf),l=a(String.prototype.valueOf),d=a(Boolean.prototype.valueOf);if(u)var p=a(BigInt.prototype.valueOf);if(h)var g=a(Symbol.prototype.valueOf);function y(t,e){if("object"!=typeof t)return!1;try{return e(t),!0}catch(t){return!1}}function m(t){return"[object Map]"===c(t)}function v(t){return"[object Set]"===c(t)}function b(t){return"[object WeakMap]"===c(t)}function w(t){return"[object WeakSet]"===c(t)}function _(t){return"[object ArrayBuffer]"===c(t)}function S(t){return"undefined"!=typeof ArrayBuffer&&(_.working?_(t):t instanceof ArrayBuffer)}function E(t){return"[object DataView]"===c(t)}function M(t){return"undefined"!=typeof DataView&&(E.working?E(t):t instanceof DataView)}function A(t){return"[object SharedArrayBuffer]"===c(t)}function C(t){return"undefined"!=typeof SharedArrayBuffer&&(A.working?A(t):t instanceof SharedArrayBuffer)}function k(t){return y(t,f)}function I(t){return y(t,l)}function T(t){return y(t,d)}function R(t){return u&&y(t,p)}function B(t){return h&&y(t,g)}e.isArgumentsObject=i,e.isGeneratorFunction=n,e.isTypedArray=s,e.isPromise=function(t){return"undefined"!=typeof Promise&&t instanceof Promise||null!==t&&"object"==typeof t&&"function"==typeof t.then&&"function"==typeof t.catch},e.isArrayBufferView=function(t){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(t):s(t)||M(t)},e.isUint8Array=function(t){return"Uint8Array"===o(t)},e.isUint8ClampedArray=function(t){return"Uint8ClampedArray"===o(t)},e.isUint16Array=function(t){return"Uint16Array"===o(t)},e.isUint32Array=function(t){return"Uint32Array"===o(t)},e.isInt8Array=function(t){return"Int8Array"===o(t)},e.isInt16Array=function(t){return"Int16Array"===o(t)},e.isInt32Array=function(t){return"Int32Array"===o(t)},e.isFloat32Array=function(t){return"Float32Array"===o(t)},e.isFloat64Array=function(t){return"Float64Array"===o(t)},e.isBigInt64Array=function(t){return"BigInt64Array"===o(t)},e.isBigUint64Array=function(t){return"BigUint64Array"===o(t)},m.working="undefined"!=typeof Map&&m(new Map),e.isMap=function(t){return"undefined"!=typeof Map&&(m.working?m(t):t instanceof Map)},v.working="undefined"!=typeof Set&&v(new Set),e.isSet=function(t){return"undefined"!=typeof Set&&(v.working?v(t):t instanceof Set)},b.working="undefined"!=typeof WeakMap&&b(new WeakMap),e.isWeakMap=function(t){return"undefined"!=typeof WeakMap&&(b.working?b(t):t instanceof WeakMap)},w.working="undefined"!=typeof WeakSet&&w(new WeakSet),e.isWeakSet=function(t){return w(t)},_.working="undefined"!=typeof ArrayBuffer&&_(new ArrayBuffer),e.isArrayBuffer=S,E.working="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof DataView&&E(new DataView(new ArrayBuffer(1),0,1)),e.isDataView=M,A.working="undefined"!=typeof SharedArrayBuffer&&A(new SharedArrayBuffer),e.isSharedArrayBuffer=C,e.isAsyncFunction=function(t){return"[object AsyncFunction]"===c(t)},e.isMapIterator=function(t){return"[object Map Iterator]"===c(t)},e.isSetIterator=function(t){return"[object Set Iterator]"===c(t)},e.isGeneratorObject=function(t){return"[object Generator]"===c(t)},e.isWebAssemblyCompiledModule=function(t){return"[object WebAssembly.Module]"===c(t)},e.isNumberObject=k,e.isStringObject=I,e.isBooleanObject=T,e.isBigIntObject=R,e.isSymbolObject=B,e.isBoxedPrimitive=function(t){return k(t)||I(t)||T(t)||R(t)||B(t)},e.isAnyArrayBuffer=function(t){return"undefined"!=typeof Uint8Array&&(S(t)||C(t))},["isProxy","isExternal","isModuleNamespaceObject"].forEach((function(t){Object.defineProperty(e,t,{enumerable:!1,value:function(){throw new Error(t+" is not supported in userland")}})}))},89539:(t,e,r)=>{var i=Object.getOwnPropertyDescriptors||function(t){for(var e=Object.keys(t),r={},i=0;i<e.length;i++)r[e[i]]=Object.getOwnPropertyDescriptor(t,e[i]);return r},n=/%[sdj%]/g;e.format=function(t){if(!v(t)){for(var e=[],r=0;r<arguments.length;r++)e.push(u(arguments[r]));return e.join(" ")}r=1;for(var i=arguments,o=i.length,s=String(t).replace(n,(function(t){if("%%"===t)return"%";if(r>=o)return t;switch(t){case"%s":return String(i[r++]);case"%d":return Number(i[r++]);case"%j":try{return JSON.stringify(i[r++])}catch(t){return"[Circular]"}default:return t}})),a=i[r];r<o;a=i[++r])y(a)||!_(a)?s+=" "+a:s+=" "+u(a);return s},e.deprecate=function(t,r){if("undefined"!=typeof process&&!0===process.noDeprecation)return t;if("undefined"==typeof process)return function(){return e.deprecate(t,r).apply(this,arguments)};var i=!1;return function(){if(!i){if(process.throwDeprecation)throw new Error(r);process.traceDeprecation?console.trace(r):console.error(r),i=!0}return t.apply(this,arguments)}};var o={},s=/^$/;if(process.env.NODE_DEBUG){var a=process.env.NODE_DEBUG;a=a.replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".*").replace(/,/g,"$|^").toUpperCase(),s=new RegExp("^"+a+"$","i")}function u(t,r){var i={seen:[],stylize:c};return arguments.length>=3&&(i.depth=arguments[2]),arguments.length>=4&&(i.colors=arguments[3]),g(r)?i.showHidden=r:r&&e._extend(i,r),b(i.showHidden)&&(i.showHidden=!1),b(i.depth)&&(i.depth=2),b(i.colors)&&(i.colors=!1),b(i.customInspect)&&(i.customInspect=!0),i.colors&&(i.stylize=h),f(i,t,i.depth)}function h(t,e){var r=u.styles[e];return r?"["+u.colors[r][0]+"m"+t+"["+u.colors[r][1]+"m":t}function c(t,e){return t}function f(t,r,i){if(t.customInspect&&r&&M(r.inspect)&&r.inspect!==e.inspect&&(!r.constructor||r.constructor.prototype!==r)){var n=r.inspect(i,t);return v(n)||(n=f(t,n,i)),n}var o=function(t,e){if(b(e))return t.stylize("undefined","undefined");if(v(e)){var r="'"+JSON.stringify(e).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return t.stylize(r,"string")}return m(e)?t.stylize(""+e,"number"):g(e)?t.stylize(""+e,"boolean"):y(e)?t.stylize("null","null"):void 0}(t,r);if(o)return o;var s=Object.keys(r),a=function(t){var e={};return t.forEach((function(t,r){e[t]=!0})),e}(s);if(t.showHidden&&(s=Object.getOwnPropertyNames(r)),E(r)&&(s.indexOf("message")>=0||s.indexOf("description")>=0))return l(r);if(0===s.length){if(M(r)){var u=r.name?": "+r.name:"";return t.stylize("[Function"+u+"]","special")}if(w(r))return t.stylize(RegExp.prototype.toString.call(r),"regexp");if(S(r))return t.stylize(Date.prototype.toString.call(r),"date");if(E(r))return l(r)}var h,c="",_=!1,A=["{","}"];return p(r)&&(_=!0,A=["[","]"]),M(r)&&(c=" [Function"+(r.name?": "+r.name:"")+"]"),w(r)&&(c=" "+RegExp.prototype.toString.call(r)),S(r)&&(c=" "+Date.prototype.toUTCString.call(r)),E(r)&&(c=" "+l(r)),0!==s.length||_&&0!=r.length?i<0?w(r)?t.stylize(RegExp.prototype.toString.call(r),"regexp"):t.stylize("[Object]","special"):(t.seen.push(r),h=_?function(t,e,r,i,n){for(var o=[],s=0,a=e.length;s<a;++s)T(e,String(s))?o.push(d(t,e,r,i,String(s),!0)):o.push("");return n.forEach((function(n){n.match(/^\d+$/)||o.push(d(t,e,r,i,n,!0))})),o}(t,r,i,a,s):s.map((function(e){return d(t,r,i,a,e,_)})),t.seen.pop(),function(t,e,r){return t.reduce((function(t,e){return e.indexOf("\n"),t+e.replace(/\u001b\[\d\d?m/g,"").length+1}),0)>60?r[0]+(""===e?"":e+"\n ")+" "+t.join(",\n  ")+" "+r[1]:r[0]+e+" "+t.join(", ")+" "+r[1]}(h,c,A)):A[0]+c+A[1]}function l(t){return"["+Error.prototype.toString.call(t)+"]"}function d(t,e,r,i,n,o){var s,a,u;if((u=Object.getOwnPropertyDescriptor(e,n)||{value:e[n]}).get?a=u.set?t.stylize("[Getter/Setter]","special"):t.stylize("[Getter]","special"):u.set&&(a=t.stylize("[Setter]","special")),T(i,n)||(s="["+n+"]"),a||(t.seen.indexOf(u.value)<0?(a=y(r)?f(t,u.value,null):f(t,u.value,r-1)).indexOf("\n")>-1&&(a=o?a.split("\n").map((function(t){return"  "+t})).join("\n").substr(2):"\n"+a.split("\n").map((function(t){return"   "+t})).join("\n")):a=t.stylize("[Circular]","special")),b(s)){if(o&&n.match(/^\d+$/))return a;(s=JSON.stringify(""+n)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(s=s.substr(1,s.length-2),s=t.stylize(s,"name")):(s=s.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),s=t.stylize(s,"string"))}return s+": "+a}function p(t){return Array.isArray(t)}function g(t){return"boolean"==typeof t}function y(t){return null===t}function m(t){return"number"==typeof t}function v(t){return"string"==typeof t}function b(t){return void 0===t}function w(t){return _(t)&&"[object RegExp]"===A(t)}function _(t){return"object"==typeof t&&null!==t}function S(t){return _(t)&&"[object Date]"===A(t)}function E(t){return _(t)&&("[object Error]"===A(t)||t instanceof Error)}function M(t){return"function"==typeof t}function A(t){return Object.prototype.toString.call(t)}function C(t){return t<10?"0"+t.toString(10):t.toString(10)}e.debuglog=function(t){if(t=t.toUpperCase(),!o[t])if(s.test(t)){var r=process.pid;o[t]=function(){var i=e.format.apply(e,arguments);console.error("%s %d: %s",t,r,i)}}else o[t]=function(){};return o[t]},e.inspect=u,u.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},u.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},e.types=r(55955),e.isArray=p,e.isBoolean=g,e.isNull=y,e.isNullOrUndefined=function(t){return null==t},e.isNumber=m,e.isString=v,e.isSymbol=function(t){return"symbol"==typeof t},e.isUndefined=b,e.isRegExp=w,e.types.isRegExp=w,e.isObject=_,e.isDate=S,e.types.isDate=S,e.isError=E,e.types.isNativeError=E,e.isFunction=M,e.isPrimitive=function(t){return null===t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||"symbol"==typeof t||void 0===t},e.isBuffer=r(20384);var k=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function I(){var t=new Date,e=[C(t.getHours()),C(t.getMinutes()),C(t.getSeconds())].join(":");return[t.getDate(),k[t.getMonth()],e].join(" ")}function T(t,e){return Object.prototype.hasOwnProperty.call(t,e)}e.log=function(){console.log("%s - %s",I(),e.format.apply(e,arguments))},e.inherits=r(35717),e._extend=function(t,e){if(!e||!_(e))return t;for(var r=Object.keys(e),i=r.length;i--;)t[r[i]]=e[r[i]];return t};var R="undefined"!=typeof Symbol?Symbol("util.promisify.custom"):void 0;function B(t,e){if(!t){var r=new Error("Promise was rejected with a falsy value");r.reason=t,t=r}return e(t)}e.promisify=function(t){if("function"!=typeof t)throw new TypeError('The "original" argument must be of type Function');if(R&&t[R]){var e;if("function"!=typeof(e=t[R]))throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(e,R,{value:e,enumerable:!1,writable:!1,configurable:!0}),e}function e(){for(var e,r,i=new Promise((function(t,i){e=t,r=i})),n=[],o=0;o<arguments.length;o++)n.push(arguments[o]);n.push((function(t,i){t?r(t):e(i)}));try{t.apply(this,n)}catch(t){r(t)}return i}return Object.setPrototypeOf(e,Object.getPrototypeOf(t)),R&&Object.defineProperty(e,R,{value:e,enumerable:!1,writable:!1,configurable:!0}),Object.defineProperties(e,i(t))},e.promisify.custom=R,e.callbackify=function(t){if("function"!=typeof t)throw new TypeError('The "original" argument must be of type Function');function e(){for(var e=[],r=0;r<arguments.length;r++)e.push(arguments[r]);var i=e.pop();if("function"!=typeof i)throw new TypeError("The last argument must be of type Function");var n=this,o=function(){return i.apply(n,arguments)};t.apply(this,e).then((function(t){process.nextTick(o.bind(null,null,t))}),(function(t){process.nextTick(B.bind(null,t,o))}))}return Object.setPrototypeOf(e,Object.getPrototypeOf(t)),Object.defineProperties(e,i(t)),e}},78410:(t,e,r)=>{"use strict";r.r(e),r.d(e,{NIL:()=>A,parse:()=>f,stringify:()=>s.Z,v1:()=>h,v3:()=>w,v4:()=>_.Z,v5:()=>M,validate:()=>c.Z,version:()=>C});var i,n,o=r(13653),s=r(3958),a=0,u=0;const h=function(t,e,r){var h=e&&r||0,c=e||new Array(16),f=(t=t||{}).node||i,l=void 0!==t.clockseq?t.clockseq:n;if(null==f||null==l){var d=t.random||(t.rng||o.Z)();null==f&&(f=i=[1|d[0],d[1],d[2],d[3],d[4],d[5]]),null==l&&(l=n=16383&(d[6]<<8|d[7]))}var p=void 0!==t.msecs?t.msecs:Date.now(),g=void 0!==t.nsecs?t.nsecs:u+1,y=p-a+(g-u)/1e4;if(y<0&&void 0===t.clockseq&&(l=l+1&16383),(y<0||p>a)&&void 0===t.nsecs&&(g=0),g>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");a=p,u=g,n=l;var m=(1e4*(268435455&(p+=122192928e5))+g)%4294967296;c[h++]=m>>>24&255,c[h++]=m>>>16&255,c[h++]=m>>>8&255,c[h++]=255&m;var v=p/4294967296*1e4&268435455;c[h++]=v>>>8&255,c[h++]=255&v,c[h++]=v>>>24&15|16,c[h++]=v>>>16&255,c[h++]=l>>>8|128,c[h++]=255&l;for(var b=0;b<6;++b)c[h+b]=f[b];return e||(0,s.Z)(c)};var c=r(27738);const f=function(t){if(!(0,c.Z)(t))throw TypeError("Invalid UUID");var e,r=new Uint8Array(16);return r[0]=(e=parseInt(t.slice(0,8),16))>>>24,r[1]=e>>>16&255,r[2]=e>>>8&255,r[3]=255&e,r[4]=(e=parseInt(t.slice(9,13),16))>>>8,r[5]=255&e,r[6]=(e=parseInt(t.slice(14,18),16))>>>8,r[7]=255&e,r[8]=(e=parseInt(t.slice(19,23),16))>>>8,r[9]=255&e,r[10]=(e=parseInt(t.slice(24,36),16))/1099511627776&255,r[11]=e/4294967296&255,r[12]=e>>>24&255,r[13]=e>>>16&255,r[14]=e>>>8&255,r[15]=255&e,r};function l(t,e,r){function i(t,i,n,o){if("string"==typeof t&&(t=function(t){t=unescape(encodeURIComponent(t));for(var e=[],r=0;r<t.length;++r)e.push(t.charCodeAt(r));return e}(t)),"string"==typeof i&&(i=f(i)),16!==i.length)throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");var a=new Uint8Array(16+t.length);if(a.set(i),a.set(t,i.length),(a=r(a))[6]=15&a[6]|e,a[8]=63&a[8]|128,n){o=o||0;for(var u=0;u<16;++u)n[o+u]=a[u];return n}return(0,s.Z)(a)}try{i.name=t}catch(t){}return i.DNS="6ba7b810-9dad-11d1-80b4-00c04fd430c8",i.URL="6ba7b811-9dad-11d1-80b4-00c04fd430c8",i}function d(t){return 14+(t+64>>>9<<4)+1}function p(t,e){var r=(65535&t)+(65535&e);return(t>>16)+(e>>16)+(r>>16)<<16|65535&r}function g(t,e,r,i,n,o){return p((s=p(p(e,t),p(i,o)))<<(a=n)|s>>>32-a,r);var s,a}function y(t,e,r,i,n,o,s){return g(e&r|~e&i,t,e,n,o,s)}function m(t,e,r,i,n,o,s){return g(e&i|r&~i,t,e,n,o,s)}function v(t,e,r,i,n,o,s){return g(e^r^i,t,e,n,o,s)}function b(t,e,r,i,n,o,s){return g(r^(e|~i),t,e,n,o,s)}const w=l("v3",48,(function(t){if("string"==typeof t){var e=unescape(encodeURIComponent(t));t=new Uint8Array(e.length);for(var r=0;r<e.length;++r)t[r]=e.charCodeAt(r)}return function(t){for(var e=[],r=32*t.length,i="0123456789abcdef",n=0;n<r;n+=8){var o=t[n>>5]>>>n%32&255,s=parseInt(i.charAt(o>>>4&15)+i.charAt(15&o),16);e.push(s)}return e}(function(t,e){t[e>>5]|=128<<e%32,t[d(e)-1]=e;for(var r=1732584193,i=-271733879,n=-1732584194,o=271733878,s=0;s<t.length;s+=16){var a=r,u=i,h=n,c=o;r=y(r,i,n,o,t[s],7,-680876936),o=y(o,r,i,n,t[s+1],12,-389564586),n=y(n,o,r,i,t[s+2],17,606105819),i=y(i,n,o,r,t[s+3],22,-1044525330),r=y(r,i,n,o,t[s+4],7,-176418897),o=y(o,r,i,n,t[s+5],12,1200080426),n=y(n,o,r,i,t[s+6],17,-1473231341),i=y(i,n,o,r,t[s+7],22,-45705983),r=y(r,i,n,o,t[s+8],7,1770035416),o=y(o,r,i,n,t[s+9],12,-1958414417),n=y(n,o,r,i,t[s+10],17,-42063),i=y(i,n,o,r,t[s+11],22,-1990404162),r=y(r,i,n,o,t[s+12],7,1804603682),o=y(o,r,i,n,t[s+13],12,-40341101),n=y(n,o,r,i,t[s+14],17,-1502002290),r=m(r,i=y(i,n,o,r,t[s+15],22,1236535329),n,o,t[s+1],5,-165796510),o=m(o,r,i,n,t[s+6],9,-1069501632),n=m(n,o,r,i,t[s+11],14,643717713),i=m(i,n,o,r,t[s],20,-373897302),r=m(r,i,n,o,t[s+5],5,-701558691),o=m(o,r,i,n,t[s+10],9,38016083),n=m(n,o,r,i,t[s+15],14,-660478335),i=m(i,n,o,r,t[s+4],20,-405537848),r=m(r,i,n,o,t[s+9],5,568446438),o=m(o,r,i,n,t[s+14],9,-1019803690),n=m(n,o,r,i,t[s+3],14,-187363961),i=m(i,n,o,r,t[s+8],20,1163531501),r=m(r,i,n,o,t[s+13],5,-1444681467),o=m(o,r,i,n,t[s+2],9,-51403784),n=m(n,o,r,i,t[s+7],14,1735328473),r=v(r,i=m(i,n,o,r,t[s+12],20,-1926607734),n,o,t[s+5],4,-378558),o=v(o,r,i,n,t[s+8],11,-2022574463),n=v(n,o,r,i,t[s+11],16,1839030562),i=v(i,n,o,r,t[s+14],23,-35309556),r=v(r,i,n,o,t[s+1],4,-1530992060),o=v(o,r,i,n,t[s+4],11,1272893353),n=v(n,o,r,i,t[s+7],16,-155497632),i=v(i,n,o,r,t[s+10],23,-1094730640),r=v(r,i,n,o,t[s+13],4,681279174),o=v(o,r,i,n,t[s],11,-358537222),n=v(n,o,r,i,t[s+3],16,-722521979),i=v(i,n,o,r,t[s+6],23,76029189),r=v(r,i,n,o,t[s+9],4,-640364487),o=v(o,r,i,n,t[s+12],11,-421815835),n=v(n,o,r,i,t[s+15],16,530742520),r=b(r,i=v(i,n,o,r,t[s+2],23,-995338651),n,o,t[s],6,-198630844),o=b(o,r,i,n,t[s+7],10,1126891415),n=b(n,o,r,i,t[s+14],15,-1416354905),i=b(i,n,o,r,t[s+5],21,-57434055),r=b(r,i,n,o,t[s+12],6,1700485571),o=b(o,r,i,n,t[s+3],10,-1894986606),n=b(n,o,r,i,t[s+10],15,-1051523),i=b(i,n,o,r,t[s+1],21,-2054922799),r=b(r,i,n,o,t[s+8],6,1873313359),o=b(o,r,i,n,t[s+15],10,-30611744),n=b(n,o,r,i,t[s+6],15,-1560198380),i=b(i,n,o,r,t[s+13],21,1309151649),r=b(r,i,n,o,t[s+4],6,-145523070),o=b(o,r,i,n,t[s+11],10,-1120210379),n=b(n,o,r,i,t[s+2],15,718787259),i=b(i,n,o,r,t[s+9],21,-343485551),r=p(r,a),i=p(i,u),n=p(n,h),o=p(o,c)}return[r,i,n,o]}(function(t){if(0===t.length)return[];for(var e=8*t.length,r=new Uint32Array(d(e)),i=0;i<e;i+=8)r[i>>5]|=(255&t[i/8])<<i%32;return r}(t),8*t.length))}));var _=r(72045);function S(t,e,r,i){switch(t){case 0:return e&r^~e&i;case 1:return e^r^i;case 2:return e&r^e&i^r&i;case 3:return e^r^i}}function E(t,e){return t<<e|t>>>32-e}const M=l("v5",80,(function(t){var e=[1518500249,1859775393,2400959708,3395469782],r=[1732584193,4023233417,2562383102,271733878,3285377520];if("string"==typeof t){var i=unescape(encodeURIComponent(t));t=[];for(var n=0;n<i.length;++n)t.push(i.charCodeAt(n))}else Array.isArray(t)||(t=Array.prototype.slice.call(t));t.push(128);for(var o=t.length/4+2,s=Math.ceil(o/16),a=new Array(s),u=0;u<s;++u){for(var h=new Uint32Array(16),c=0;c<16;++c)h[c]=t[64*u+4*c]<<24|t[64*u+4*c+1]<<16|t[64*u+4*c+2]<<8|t[64*u+4*c+3];a[u]=h}a[s-1][14]=8*(t.length-1)/Math.pow(2,32),a[s-1][14]=Math.floor(a[s-1][14]),a[s-1][15]=8*(t.length-1)&4294967295;for(var f=0;f<s;++f){for(var l=new Uint32Array(80),d=0;d<16;++d)l[d]=a[f][d];for(var p=16;p<80;++p)l[p]=E(l[p-3]^l[p-8]^l[p-14]^l[p-16],1);for(var g=r[0],y=r[1],m=r[2],v=r[3],b=r[4],w=0;w<80;++w){var _=Math.floor(w/20),M=E(g,5)+S(_,y,m,v)+b+e[_]+l[w]>>>0;b=v,v=m,m=E(y,30)>>>0,y=g,g=M}r[0]=r[0]+g>>>0,r[1]=r[1]+y>>>0,r[2]=r[2]+m>>>0,r[3]=r[3]+v>>>0,r[4]=r[4]+b>>>0}return[r[0]>>24&255,r[0]>>16&255,r[0]>>8&255,255&r[0],r[1]>>24&255,r[1]>>16&255,r[1]>>8&255,255&r[1],r[2]>>24&255,r[2]>>16&255,r[2]>>8&255,255&r[2],r[3]>>24&255,r[3]>>16&255,r[3]>>8&255,255&r[3],r[4]>>24&255,r[4]>>16&255,r[4]>>8&255,255&r[4]]})),A="00000000-0000-0000-0000-000000000000",C=function(t){if(!(0,c.Z)(t))throw TypeError("Invalid UUID");return parseInt(t.substr(14,1),16)}},13653:(t,e,r)=>{"use strict";var i;r.d(e,{Z:()=>o});var n=new Uint8Array(16);function o(){if(!i&&!(i="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto)))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return i(n)}},3958:(t,e,r)=>{"use strict";r.d(e,{Z:()=>s});for(var i=r(27738),n=[],o=0;o<256;++o)n.push((o+256).toString(16).substr(1));const s=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=(n[t[e+0]]+n[t[e+1]]+n[t[e+2]]+n[t[e+3]]+"-"+n[t[e+4]]+n[t[e+5]]+"-"+n[t[e+6]]+n[t[e+7]]+"-"+n[t[e+8]]+n[t[e+9]]+"-"+n[t[e+10]]+n[t[e+11]]+n[t[e+12]]+n[t[e+13]]+n[t[e+14]]+n[t[e+15]]).toLowerCase();if(!(0,i.Z)(r))throw TypeError("Stringified UUID is invalid");return r}},72045:(t,e,r)=>{"use strict";r.d(e,{Z:()=>o});var i=r(13653),n=r(3958);const o=function(t,e,r){var o=(t=t||{}).random||(t.rng||i.Z)();if(o[6]=15&o[6]|64,o[8]=63&o[8]|128,e){r=r||0;for(var s=0;s<16;++s)e[r+s]=o[s];return e}return(0,n.Z)(o)}},27738:(t,e,r)=>{"use strict";r.d(e,{Z:()=>n});const i=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i,n=function(t){return"string"==typeof t&&i.test(t)}},86430:(t,e,r)=>{"use strict";var i=r(49804),n=r(16314),o=r(21924),s=o("Object.prototype.toString"),a=r(41405)()&&"symbol"==typeof Symbol.toStringTag,u=n(),h=o("String.prototype.slice"),c={},f=r(94079),l=Object.getPrototypeOf;a&&f&&l&&i(u,(function(t){if("function"==typeof r.g[t]){var e=new r.g[t];if(!(Symbol.toStringTag in e))throw new EvalError("this engine has support for Symbol.toStringTag, but "+t+" does not have the property! Please report this.");var i=l(e),n=f(i,Symbol.toStringTag);if(!n){var o=l(i);n=f(o,Symbol.toStringTag)}c[t]=n.get}}));var d=r(85692);t.exports=function(t){return!!d(t)&&(a?function(t){var e=!1;return i(c,(function(r,i){if(!e)try{var n=r.call(t);n===i&&(e=n)}catch(t){}})),e}(t):h(s(t),8,-1))}},32574:()=>{},63906:()=>{},61758:()=>{}},e={};function r(i){if(e[i])return e[i].exports;var n=e[i]={id:i,loaded:!1,exports:{}};return t[i].call(n.exports,n,n.exports,r),n.loaded=!0,n.exports}r.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return r.d(e,{a:e}),e},r.d=(t,e)=>{for(var i in e)r.o(e,i)&&!r.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:e[i]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.nmd=t=>(t.paths=[],t.children||(t.children=[]),t),(()=>{"use strict";r(28660);var t=r(94305);function e(t){return Array.isArray?Array.isArray(t):"[object Array]"===u(t)}function i(t){return"string"==typeof t}function n(t){return"number"==typeof t}function o(t){return"object"==typeof t}function s(t){return null!=t}function a(t){return!t.trim().length}function u(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":Object.prototype.toString.call(t)}const h=Object.prototype.hasOwnProperty;class c{constructor(t){this._keys=[],this._keyMap={};let e=0;t.forEach((t=>{let r=f(t);e+=r.weight,this._keys.push(r),this._keyMap[r.id]=r,e+=r.weight})),this._keys.forEach((t=>{t.weight/=e}))}get(t){return this._keyMap[t]}keys(){return this._keys}toJSON(){return JSON.stringify(this._keys)}}function f(t){let r=null,n=null,o=null,s=1;if(i(t)||e(t))o=t,r=l(t),n=d(t);else{if(!h.call(t,"name"))throw new Error("Missing name property in key");const e=t.name;if(o=e,h.call(t,"weight")&&(s=t.weight,s<=0))throw new Error((t=>`Property 'weight' in key '${t}' must be a positive integer`)(e));r=l(e),n=d(e)}return{path:r,id:n,weight:s,src:o}}function l(t){return e(t)?t:t.split(".")}function d(t){return e(t)?t.join("."):t}var p={isCaseSensitive:!1,includeScore:!1,keys:[],shouldSort:!0,sortFn:(t,e)=>t.score===e.score?t.idx<e.idx?-1:1:t.score<e.score?-1:1,includeMatches:!1,findAllMatches:!1,minMatchCharLength:1,location:0,threshold:.6,distance:100,useExtendedSearch:!1,getFn:function(t,r){let a=[],h=!1;const c=(t,r,f)=>{if(s(t))if(r[f]){const l=t[r[f]];if(!s(l))return;if(f===r.length-1&&(i(l)||n(l)||function(t){return!0===t||!1===t||function(t){return o(t)&&null!==t}(t)&&"[object Boolean]"==u(t)}(l)))a.push(function(t){return null==t?"":function(t){if("string"==typeof t)return t;let e=t+"";return"0"==e&&1/t==-1/0?"-0":e}(t)}(l));else if(e(l)){h=!0;for(let t=0,e=l.length;t<e;t+=1)c(l[t],r,f+1)}else r.length&&c(l,r,f+1)}else a.push(t)};return c(t,i(r)?r.split("."):r,0),h?a:a[0]},ignoreLocation:!1,ignoreFieldNorm:!1};const g=/[^ ]+/g;class y{constructor({getFn:t=p.getFn}={}){this.norm=function(t=3){const e=new Map;return{get(r){const i=r.match(g).length;if(e.has(i))return e.get(i);const n=parseFloat((1/Math.sqrt(i)).toFixed(t));return e.set(i,n),n},clear(){e.clear()}}}(3),this.getFn=t,this.isCreated=!1,this.setIndexRecords()}setSources(t=[]){this.docs=t}setIndexRecords(t=[]){this.records=t}setKeys(t=[]){this.keys=t,this._keysMap={},t.forEach(((t,e)=>{this._keysMap[t.id]=e}))}create(){!this.isCreated&&this.docs.length&&(this.isCreated=!0,i(this.docs[0])?this.docs.forEach(((t,e)=>{this._addString(t,e)})):this.docs.forEach(((t,e)=>{this._addObject(t,e)})),this.norm.clear())}add(t){const e=this.size();i(t)?this._addString(t,e):this._addObject(t,e)}removeAt(t){this.records.splice(t,1);for(let e=t,r=this.size();e<r;e+=1)this.records[e].i-=1}getValueForItemAtKeyId(t,e){return t[this._keysMap[e]]}size(){return this.records.length}_addString(t,e){if(!s(t)||a(t))return;let r={v:t,i:e,n:this.norm.get(t)};this.records.push(r)}_addObject(t,r){let n={i:r,$:{}};this.keys.forEach(((r,o)=>{let u=this.getFn(t,r.path);if(s(u))if(e(u)){let t=[];const r=[{nestedArrIndex:-1,value:u}];for(;r.length;){const{nestedArrIndex:n,value:o}=r.pop();if(s(o))if(i(o)&&!a(o)){let e={v:o,i:n,n:this.norm.get(o)};t.push(e)}else e(o)&&o.forEach(((t,e)=>{r.push({nestedArrIndex:e,value:t})}))}n.$[o]=t}else if(!a(u)){let t={v:u,n:this.norm.get(u)};n.$[o]=t}})),this.records.push(n)}toJSON(){return{keys:this.keys,records:this.records}}}function m(t,e,{getFn:r=p.getFn}={}){const i=new y({getFn:r});return i.setKeys(t.map(f)),i.setSources(e),i.create(),i}function v(t,e){const r=t.matches;e.matches=[],s(r)&&r.forEach((t=>{if(!s(t.indices)||!t.indices.length)return;const{indices:r,value:i}=t;let n={indices:r,value:i};t.key&&(n.key=t.key.src),t.idx>-1&&(n.refIndex=t.idx),e.matches.push(n)}))}function b(t,e){e.score=t.score}function w(t,{errors:e=0,currentLocation:r=0,expectedLocation:i=0,distance:n=p.distance,ignoreLocation:o=p.ignoreLocation}={}){const s=e/t.length;if(o)return s;const a=Math.abs(i-r);return n?s+a/n:a?1:s}const _=32;function S(t){let e={};for(let r=0,i=t.length;r<i;r+=1){const n=t.charAt(r);e[n]=(e[n]||0)|1<<i-r-1}return e}class E{constructor(t,{location:e=p.location,threshold:r=p.threshold,distance:i=p.distance,includeMatches:n=p.includeMatches,findAllMatches:o=p.findAllMatches,minMatchCharLength:s=p.minMatchCharLength,isCaseSensitive:a=p.isCaseSensitive,ignoreLocation:u=p.ignoreLocation}={}){if(this.options={location:e,threshold:r,distance:i,includeMatches:n,findAllMatches:o,minMatchCharLength:s,isCaseSensitive:a,ignoreLocation:u},this.pattern=a?t:t.toLowerCase(),this.chunks=[],!this.pattern.length)return;const h=(t,e)=>{this.chunks.push({pattern:t,alphabet:S(t),startIndex:e})},c=this.pattern.length;if(c>_){let t=0;const e=c%_,r=c-e;for(;t<r;)h(this.pattern.substr(t,_),t),t+=_;if(e){const t=c-_;h(this.pattern.substr(t),t)}}else h(this.pattern,0)}searchIn(t){const{isCaseSensitive:e,includeMatches:r}=this.options;if(e||(t=t.toLowerCase()),this.pattern===t){let e={isMatch:!0,score:0};return r&&(e.indices=[[0,t.length-1]]),e}const{location:i,distance:n,threshold:o,findAllMatches:s,minMatchCharLength:a,ignoreLocation:u}=this.options;let h=[],c=0,f=!1;this.chunks.forEach((({pattern:e,alphabet:l,startIndex:d})=>{const{isMatch:g,score:y,indices:m}=function(t,e,r,{location:i=p.location,distance:n=p.distance,threshold:o=p.threshold,findAllMatches:s=p.findAllMatches,minMatchCharLength:a=p.minMatchCharLength,includeMatches:u=p.includeMatches,ignoreLocation:h=p.ignoreLocation}={}){if(e.length>_)throw new Error("Pattern length exceeds max of 32.");const c=e.length,f=t.length,l=Math.max(0,Math.min(i,f));let d=o,g=l;const y=a>1||u,m=y?Array(f):[];let v;for(;(v=t.indexOf(e,g))>-1;){let t=w(e,{currentLocation:v,expectedLocation:l,distance:n,ignoreLocation:h});if(d=Math.min(t,d),g=v+c,y){let t=0;for(;t<c;)m[v+t]=1,t+=1}}g=-1;let b=[],S=1,E=c+f;const M=1<<c-1;for(let i=0;i<c;i+=1){let o=0,a=E;for(;o<a;)w(e,{errors:i,currentLocation:l+a,expectedLocation:l,distance:n,ignoreLocation:h})<=d?o=a:E=a,a=Math.floor((E-o)/2+o);E=a;let u=Math.max(1,l-a+1),p=s?f:Math.min(l+a,f)+c,v=Array(p+2);v[p+1]=(1<<i)-1;for(let o=p;o>=u;o-=1){let s=o-1,a=r[t.charAt(s)];if(y&&(m[s]=+!!a),v[o]=(v[o+1]<<1|1)&a,i&&(v[o]|=(b[o+1]|b[o])<<1|1|b[o+1]),v[o]&M&&(S=w(e,{errors:i,currentLocation:s,expectedLocation:l,distance:n,ignoreLocation:h}),S<=d)){if(d=S,g=s,g<=l)break;u=Math.max(1,2*l-g)}}if(w(e,{errors:i+1,currentLocation:l,expectedLocation:l,distance:n,ignoreLocation:h})>d)break;b=v}const A={isMatch:g>=0,score:Math.max(.001,S)};if(y){const t=function(t=[],e=p.minMatchCharLength){let r=[],i=-1,n=-1,o=0;for(let s=t.length;o<s;o+=1){let s=t[o];s&&-1===i?i=o:s||-1===i||(n=o-1,n-i+1>=e&&r.push([i,n]),i=-1)}return t[o-1]&&o-i>=e&&r.push([i,o-1]),r}(m,a);t.length?u&&(A.indices=t):A.isMatch=!1}return A}(t,e,l,{location:i+d,distance:n,threshold:o,findAllMatches:s,minMatchCharLength:a,includeMatches:r,ignoreLocation:u});g&&(f=!0),c+=y,g&&m&&(h=[...h,...m])}));let l={isMatch:f,score:f?c/this.chunks.length:1};return f&&r&&(l.indices=h),l}}class M{constructor(t){this.pattern=t}static isMultiMatch(t){return A(t,this.multiRegex)}static isSingleMatch(t){return A(t,this.singleRegex)}search(){}}function A(t,e){const r=t.match(e);return r?r[1]:null}class C extends M{constructor(t,{location:e=p.location,threshold:r=p.threshold,distance:i=p.distance,includeMatches:n=p.includeMatches,findAllMatches:o=p.findAllMatches,minMatchCharLength:s=p.minMatchCharLength,isCaseSensitive:a=p.isCaseSensitive}={}){super(t),this._bitapSearch=new E(t,{location:e,threshold:r,distance:i,includeMatches:n,findAllMatches:o,minMatchCharLength:s,isCaseSensitive:a})}static get type(){return"fuzzy"}static get multiRegex(){return/^"(.*)"$/}static get singleRegex(){return/^(.*)$/}search(t){return this._bitapSearch.searchIn(t)}}class k extends M{constructor(t){super(t)}static get type(){return"include"}static get multiRegex(){return/^'"(.*)"$/}static get singleRegex(){return/^'(.*)$/}search(t){let e,r=0;const i=[],n=this.pattern.length;for(;(e=t.indexOf(this.pattern,r))>-1;)r=e+n,i.push([e,r-1]);const o=!!i.length;return{isMatch:o,score:o?1:0,indices:i}}}const I=[class extends M{constructor(t){super(t)}static get type(){return"exact"}static get multiRegex(){return/^="(.*)"$/}static get singleRegex(){return/^=(.*)$/}search(t){const e=t===this.pattern;return{isMatch:e,score:e?0:1,indices:[0,this.pattern.length-1]}}},k,class extends M{constructor(t){super(t)}static get type(){return"prefix-exact"}static get multiRegex(){return/^\^"(.*)"$/}static get singleRegex(){return/^\^(.*)$/}search(t){const e=t.startsWith(this.pattern);return{isMatch:e,score:e?0:1,indices:[0,this.pattern.length-1]}}},class extends M{constructor(t){super(t)}static get type(){return"inverse-prefix-exact"}static get multiRegex(){return/^!\^"(.*)"$/}static get singleRegex(){return/^!\^(.*)$/}search(t){const e=!t.startsWith(this.pattern);return{isMatch:e,score:e?0:1,indices:[0,t.length-1]}}},class extends M{constructor(t){super(t)}static get type(){return"inverse-suffix-exact"}static get multiRegex(){return/^!"(.*)"\$$/}static get singleRegex(){return/^!(.*)\$$/}search(t){const e=!t.endsWith(this.pattern);return{isMatch:e,score:e?0:1,indices:[0,t.length-1]}}},class extends M{constructor(t){super(t)}static get type(){return"suffix-exact"}static get multiRegex(){return/^"(.*)"\$$/}static get singleRegex(){return/^(.*)\$$/}search(t){const e=t.endsWith(this.pattern);return{isMatch:e,score:e?0:1,indices:[t.length-this.pattern.length,t.length-1]}}},class extends M{constructor(t){super(t)}static get type(){return"inverse-exact"}static get multiRegex(){return/^!"(.*)"$/}static get singleRegex(){return/^!(.*)$/}search(t){const e=-1===t.indexOf(this.pattern);return{isMatch:e,score:e?0:1,indices:[0,t.length-1]}}},C],T=I.length,R=/ +(?=([^\"]*\"[^\"]*\")*[^\"]*$)/,B=new Set([C.type,k.type]);const x=[];function F(t,e){for(let r=0,i=x.length;r<i;r+=1){let i=x[r];if(i.condition(t,e))return new i(t,e)}return new E(t,e)}const P="$and",N=t=>!(!t.$and&&!t.$or),O=t=>({[P]:Object.keys(t).map((e=>({[e]:t[e]})))});function L(t,r,{auto:n=!0}={}){const s=t=>{let a=Object.keys(t);const u=(t=>!!t.$path)(t);if(!u&&a.length>1&&!N(t))return s(O(t));if((t=>!e(t)&&o(t)&&!N(t))(t)){const e=u?t.$path:a[0],o=u?t.$val:t[e];if(!i(o))throw new Error((t=>`Invalid value for key ${t}`)(e));const s={keyId:d(e),pattern:o};return n&&(s.searcher=F(o,r)),s}let h={children:[],operator:a[0]};return a.forEach((r=>{const i=t[r];e(i)&&i.forEach((t=>{h.children.push(s(t))}))})),h};return N(t)||(t=O(t)),s(t)}class U{constructor(t,e={},r){this.options={...p,...e},this.options.useExtendedSearch,this._keyStore=new c(this.options.keys),this.setCollection(t,r)}setCollection(t,e){if(this._docs=t,e&&!(e instanceof y))throw new Error("Incorrect 'index' type");this._myIndex=e||m(this.options.keys,this._docs,{getFn:this.options.getFn})}add(t){s(t)&&(this._docs.push(t),this._myIndex.add(t))}remove(t=(()=>!1)){const e=[];for(let r=0,i=this._docs.length;r<i;r+=1){const n=this._docs[r];t(n,r)&&(this.removeAt(r),r-=1,i-=1,e.push(n))}return e}removeAt(t){this._docs.splice(t,1),this._myIndex.removeAt(t)}getIndex(){return this._myIndex}search(t,{limit:e=-1}={}){const{includeMatches:r,includeScore:o,shouldSort:s,sortFn:a,ignoreFieldNorm:u}=this.options;let h=i(t)?i(this._docs[0])?this._searchStringList(t):this._searchObjectList(t):this._searchLogical(t);return function(t,{ignoreFieldNorm:e=p.ignoreFieldNorm}){t.forEach((t=>{let r=1;t.matches.forEach((({key:t,norm:i,score:n})=>{const o=t?t.weight:null;r*=Math.pow(0===n&&o?Number.EPSILON:n,(o||1)*(e?1:i))})),t.score=r}))}(h,{ignoreFieldNorm:u}),s&&h.sort(a),n(e)&&e>-1&&(h=h.slice(0,e)),function(t,e,{includeMatches:r=p.includeMatches,includeScore:i=p.includeScore}={}){const n=[];return r&&n.push(v),i&&n.push(b),t.map((t=>{const{idx:r}=t,i={item:e[r],refIndex:r};return n.length&&n.forEach((e=>{e(t,i)})),i}))}(h,this._docs,{includeMatches:r,includeScore:o})}_searchStringList(t){const e=F(t,this.options),{records:r}=this._myIndex,i=[];return r.forEach((({v:t,i:r,n})=>{if(!s(t))return;const{isMatch:o,score:a,indices:u}=e.searchIn(t);o&&i.push({item:t,idx:r,matches:[{score:a,value:t,norm:n,indices:u}]})})),i}_searchLogical(t){const e=L(t,this.options),r=(t,e,i)=>{if(!t.children){const{keyId:r,searcher:n}=t,o=this._findMatches({key:this._keyStore.get(r),value:this._myIndex.getValueForItemAtKeyId(e,r),searcher:n});return o&&o.length?[{idx:i,item:e,matches:o}]:[]}switch(t.operator){case P:{const n=[];for(let o=0,s=t.children.length;o<s;o+=1){const s=t.children[o],a=r(s,e,i);if(!a.length)return[];n.push(...a)}return n}case"$or":{const n=[];for(let o=0,s=t.children.length;o<s;o+=1){const s=t.children[o],a=r(s,e,i);if(a.length){n.push(...a);break}}return n}}},i=this._myIndex.records,n={},o=[];return i.forEach((({$:t,i})=>{if(s(t)){let s=r(e,t,i);s.length&&(n[i]||(n[i]={idx:i,item:t,matches:[]},o.push(n[i])),s.forEach((({matches:t})=>{n[i].matches.push(...t)})))}})),o}_searchObjectList(t){const e=F(t,this.options),{keys:r,records:i}=this._myIndex,n=[];return i.forEach((({$:t,i})=>{if(!s(t))return;let o=[];r.forEach(((r,i)=>{o.push(...this._findMatches({key:r,value:t[i],searcher:e}))})),o.length&&n.push({idx:i,item:t,matches:o})})),n}_findMatches({key:t,value:r,searcher:i}){if(!s(r))return[];let n=[];if(e(r))r.forEach((({v:e,i:r,n:o})=>{if(!s(e))return;const{isMatch:a,score:u,indices:h}=i.searchIn(e);a&&n.push({score:u,key:t,value:e,idx:r,norm:o,indices:h})}));else{const{v:e,n:o}=r,{isMatch:s,score:a,indices:u}=i.searchIn(e);s&&n.push({score:a,key:t,value:e,norm:o,indices:u})}return n}}function j(t){if(!t.match(/^\..?\//))return new URL(t,document.baseURI).href;const e=new Error;if(!e.stack)return t;let r=e.stack.split("\n").filter((t=>t.includes(":")))[2].match(/[a-z]+:.*$/);if(!r)return t;const i=r[0].replace(/(\:[0-9]+){2}\)?$/,"");return new URL(t,i).href}U.version="6.4.2",U.createIndex=m,U.parseIndex=function(t,{getFn:e=p.getFn}={}){const{keys:r,records:i}=t,n=new y({getFn:e});return n.setKeys(r),n.setIndexRecords(i),n},U.config=p,U.parseQuery=L,function(...t){x.push(...t)}(class{constructor(t,{isCaseSensitive:e=p.isCaseSensitive,includeMatches:r=p.includeMatches,minMatchCharLength:i=p.minMatchCharLength,findAllMatches:n=p.findAllMatches,location:o=p.location,threshold:s=p.threshold,distance:a=p.distance}={}){this.query=null,this.options={isCaseSensitive:e,includeMatches:r,minMatchCharLength:i,findAllMatches:n,location:o,threshold:s,distance:a},this.pattern=e?t:t.toLowerCase(),this.query=function(t,e={}){return t.split("|").map((t=>{let r=t.trim().split(R).filter((t=>t&&!!t.trim())),i=[];for(let t=0,n=r.length;t<n;t+=1){const n=r[t];let o=!1,s=-1;for(;!o&&++s<T;){const t=I[s];let r=t.isMultiMatch(n);r&&(i.push(new t(r,e)),o=!0)}if(!o)for(s=-1;++s<T;){const t=I[s];let r=t.isSingleMatch(n);if(r){i.push(new t(r,e));break}}}return i}))}(this.pattern,this.options)}static condition(t,e){return e.useExtendedSearch}searchIn(t){const e=this.query;if(!e)return{isMatch:!1,score:1};const{includeMatches:r,isCaseSensitive:i}=this.options;t=i?t:t.toLowerCase();let n=0,o=[],s=0;for(let i=0,a=e.length;i<a;i+=1){const a=e[i];o.length=0,n=0;for(let e=0,i=a.length;e<i;e+=1){const i=a[e],{isMatch:u,indices:h,score:c}=i.search(t);if(!u){s=0,n=0,o.length=0;break}if(n+=1,s+=c,r){const t=i.constructor.type;B.has(t)?o=[...o,...h]:o.push(h)}}if(n){let t={isMatch:!0,score:s/n};return r&&(t.indices=o),t}}return{isMatch:!1,score:1}}}),function(...t){const e=[];for(let r of t){r=j(r);let t=Array.from(document.head.querySelectorAll("link")).find((t=>t.href===r));if(t)return t;t=document.createElement("link"),t.rel="stylesheet",t.href=r,document.head.appendChild(t),e.push(t)}}("https://cdn.skypack.dev/@startinblox/oidc@0.14/sib-auth.css");class D extends HTMLElement{constructor(){super(),this.provider=null,this.user=null,this.hide(),this.session=(0,t.handleIncomingRedirect)({restorePreviousSession:!0,url:window.location.href}).then((async t=>t&&t.isLoggedIn?(this.dispatchUserInfo(),t):(this.hasAttribute("auto-login")&&this.login(),null)))}connectedCallback(){this.install(),(0,t.onSessionRestore)((t=>{window.history.replaceState({},"",t),this.dispatchEvent(new CustomEvent("newUrl",{bubbles:!0}))}))}disconnectedCallback(){(0,t.logout)(),this.uninstall()}install(){this.bindUserObserver=new MutationObserver((t=>{t.forEach((t=>{if("attributes"!==t.type)t.addedNodes.forEach((t=>{t instanceof Element&&(t.hasAttribute("bind-user")&&this.applyUser(t),t.querySelectorAll("[bind-user]").length&&t.querySelectorAll("[bind-user]").forEach((t=>this.applyUser(t))))}));else{if(!t.target.hasAttribute("bind-user"))return;this.applyUser(t.target)}}))})),this.bindUserObserver.observe(document.body,{childList:!0,attributes:!0,characterData:!1,subtree:!0,attributeOldValue:!1,attributeFilter:["bind-user"]})}uninstall(){this.bindUserObserver.disconnect()}getProvider(t){return this.querySelector(`sib-auth-provider[data-id=${t}]`)}getFavoriteProvider(){const t=localStorage.getItem("oidc_favorite_provider");let e=this.getProvider(t);if(!e){const t=this.querySelectorAll("sib-auth-provider");1===t.length&&(e=t.item(0))}return e}getProviders(){return this.querySelectorAll("sib-auth-provider")}setFavoriteProvider(t){localStorage.setItem("oidc_favorite_provider",t)}async processState(){const{provider:t}=this.getState(),e=this.getProvider(t);e&&this.callProvider(e,"processState",this)}async dispatchUserInfo(){const t=async()=>{document.querySelectorAll("[bind-user]").forEach((t=>this.applyUser(t)))};"loading"===document.readyState?document.addEventListener("DOMContentLoaded",t):t()}async applyUser(t){const e=await this.getUserWebId();null!=e&&(t.getAttribute("data-src"===e)||t.setAttribute("data-src",e))}async getUserWebId(){const t=await this.session;return t?t.webId:null}async getUserIdToken(){await this.session;const e=await(0,t.fetch)(`${this.getFavoriteProvider().attributes["data-authority"].value}check-user`),r=await e.json();return r?`${r.Authorization}SEPARATOR${r.dpop}`:null}async getUser(){const t=await this.getUserWebId();return t?{"@id":t}:null}login(){const t=this.getFavoriteProvider();t?this.callProvider(t,"login",this):this.show()}logout(){(0,t.logout)().then((()=>this.dispatchUserInfo())).then((()=>window.location.reload()))}hide(){this.initialDisplayStyle=this.style.display,this.style.display="none",this.removeEventListener("click",this.hide)}show(){this.getProviders().forEach((t=>{t.onclick=()=>{this.setFavoriteProvider(t.id),this.callProvider(t,"login",this)}})),this.addEventListener("click",this.hide),this.style.display=this.initialDisplayStyle}async callProvider(t,e,...r){return await customElements.whenDefined("sib-auth-provider"),t[e](...r)}getFetch(){return t.fetch}}customElements.define("sib-auth",D);class K extends HTMLElement{constructor(){super(),this.id=null}async connectedCallback(){const{id:t}=this.dataset;this.id=t,this.render(this.dataset)}async login(){await(0,t.login)({oidcIssuer:this.dataset.authority,clientName:this.dataset.clientName,redirectUrl:window.location.href})}render({label:t,id:e}){this.innerHTML=`${t||e}`}}customElements.define("sib-auth-provider",K)})()})();
\ No newline at end of file
+(()=>{var e={991:(e,t,r)=>{"use strict";r.r(t),r.d(t,{CompactEncrypt:()=>be,CompactSign:()=>De,EmbeddedJWK:()=>Fe,EncryptJWT:()=>Xe,FlattenedEncrypt:()=>Se,FlattenedSign:()=>Oe,GeneralSign:()=>Ke,JOSEAlgNotAllowed:()=>o,JOSEError:()=>n,JOSENotSupported:()=>s,JWEDecryptionFailed:()=>a,JWEInvalid:()=>u,JWKInvalid:()=>l,JWKSInvalid:()=>d,JWKSMultipleMatchingKeys:()=>p,JWKSNoMatchingKey:()=>f,JWSInvalid:()=>c,JWSSignatureVerificationFailed:()=>g,JWTClaimValidationFailed:()=>i,JWTExpired:()=>y,JWTInvalid:()=>h,SignJWT:()=>Qe,UnsecuredJWT:()=>Ze,base64UrlDecode:()=>rt,base64UrlEncode:()=>tt,calculateThumbprint:()=>ke,compactDecrypt:()=>ye,compactVerify:()=>Ne,createRemoteJWKSet:()=>Ce,decodeProtectedHeader:()=>nt,flattenedDecrypt:()=>ge,flattenedVerify:()=>Me,fromKeyLike:()=>ve,generalDecrypt:()=>Ee,generalVerify:()=>Ve,generateKeyPair:()=>ot,generateSecret:()=>st,jwtDecrypt:()=>Ge,jwtVerify:()=>et,parseJwk:()=>se,random:()=>at});class n extends Error{constructor(e){super(e),this.code=n.code,this.name=this.constructor.name,Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}}n.code="ERR_JOSE_GENERIC";class i extends n{constructor(e,t="unspecified",r="unspecified"){super(e),this.code=i.code,this.claim=t,this.reason=r}}i.code="ERR_JWT_CLAIM_VALIDATION_FAILED";class o extends n{constructor(){super(...arguments),this.code=o.code}}o.code="ERR_JOSE_ALG_NOT_ALLOWED";class s extends n{constructor(){super(...arguments),this.code=s.code}}s.code="ERR_JOSE_NOT_SUPPORTED";class a extends n{constructor(){super(...arguments),this.code=a.code,this.message="decryption operation failed"}}a.code="ERR_JWE_DECRYPTION_FAILED";class u extends n{constructor(){super(...arguments),this.code=u.code}}u.code="ERR_JWE_INVALID";class c extends n{constructor(){super(...arguments),this.code=c.code}}c.code="ERR_JWS_INVALID";class h extends n{constructor(){super(...arguments),this.code=h.code}}h.code="ERR_JWT_INVALID";class l extends n{constructor(){super(...arguments),this.code=l.code}}l.code="ERR_JWK_INVALID";class d extends n{constructor(){super(...arguments),this.code=d.code}}d.code="ERR_JWKS_INVALID";class f extends n{constructor(){super(...arguments),this.code=f.code,this.message="no applicable key found in the JSON Web Key Set"}}f.code="ERR_JWKS_NO_MATCHING_KEY";class p extends n{constructor(){super(...arguments),this.code=p.code,this.message="multiple matching keys found in the JSON Web Key Set"}}p.code="ERR_JWKS_MULTIPLE_MATCHING_KEYS";class g extends n{constructor(){super(...arguments),this.code=g.code,this.message="signature verification failed"}}g.code="ERR_JWS_SIGNATURE_VERIFICATION_FAILED";class y extends i{constructor(){super(...arguments),this.code=y.code}}y.code="ERR_JWT_EXPIRED";const v=(...e)=>{const t=e.filter(Boolean);if(0===t.length||1===t.length)return!0;let r;for(const e of t){const t=Object.keys(e);if(r&&0!==r.size)for(const e of t){if(r.has(e))return!1;r.add(e)}else r=new Set(t)}return!0};function m(e){if("object"!=typeof(t=e)||null===t||"[object Object]"!==Object.prototype.toString.call(e))return!1;var t;if(null===Object.getPrototypeOf(e))return!0;let r=e;for(;null!==Object.getPrototypeOf(r);)r=Object.getPrototypeOf(r);return Object.getPrototypeOf(e)===r}const w=new TextEncoder,_=new TextDecoder,S=2**32;function b(...e){const t=e.reduce(((e,{length:t})=>e+t),0),r=new Uint8Array(t);let n=0;return e.forEach((e=>{r.set(e,n),n+=e.length})),r}function E(e,t){return b(w.encode(e),new Uint8Array([0]),t)}function F(e,t,r){if(t<0||t>=S)throw new RangeError(`value must be >= 0 and <= 4294967295. Received ${t}`);e.set([t>>>24,t>>>16,t>>>8,255&t],r)}function A(e){const t=Math.floor(e/S),r=e%S,n=new Uint8Array(8);return F(n,t,0),F(n,r,4),n}function k(e){const t=new Uint8Array(4);return F(t,e),t}function x(e){return b(k(e.length),e)}var P=function(){if("undefined"!=typeof globalThis)return globalThis;if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;throw new Error("unable to locate global object")}();const C=e=>{let t=e;"string"==typeof t&&(t=w.encode(t));const r=[];for(let e=0;e<t.length;e+=32768)r.push(String.fromCharCode.apply(null,t.subarray(e,e+32768)));return P.btoa(r.join("")).replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")},I=e=>{let t=e;t instanceof Uint8Array&&(t=_.decode(t)),t=t.replace(/-/g,"+").replace(/_/g,"/").replace(/\s/g,"");try{return new Uint8Array(P.atob(t).split("").map((e=>e.charCodeAt(0))))}catch(e){throw new TypeError("The input to be decoded is not correctly encoded.")}},T=new Map([["A128CBC-HS256",128],["A128GCM",96],["A128GCMKW",96],["A192CBC-HS384",128],["A192GCM",96],["A192GCMKW",96],["A256CBC-HS512",128],["A256GCM",96],["A256GCMKW",96]]),R=e=>t=>{const r=T.get(t);if(!r)throw new s(`Unsupported JWE Algorithm: ${t}`);return e(new Uint8Array(r>>3))},U=(e,t)=>{if(t.length<<3!==T.get(e))throw new u("Invalid Initialization Vector length")},O=(e,t)=>{let r;switch(e){case"A128CBC-HS256":case"A192CBC-HS384":case"A256CBC-HS512":if(r=parseInt(e.substr(-3),10),!(t instanceof Uint8Array))throw new TypeError(`${e} content encryption requires Uint8Array as key input`);break;case"A128GCM":case"A192GCM":case"A256GCM":r=parseInt(e.substr(1,3),10);break;default:throw new s(`Content Encryption Algorithm ${e} is not supported either by JOSE or your javascript runtime`)}if(t instanceof Uint8Array){if(t.length<<3!==r)throw new u("Invalid Content Encryption Key length")}else{if(void 0===t.algorithm)throw new TypeError("Invalid Content Encryption Key type");{const{length:e}=t.algorithm;if(e!==r)throw new u("Invalid Content Encryption Key length")}}};var D=P.crypto;function L(e){return void 0!==P.CryptoKey&&null!=e&&e instanceof P.CryptoKey}const H=async(e,t,r,n,i,o)=>{if(!(L(t)||t instanceof Uint8Array))throw new TypeError("invalid key input");return O(e,t),U(e,n),"CBC"===e.substr(4,3)?async function(e,t,r,n,i,o){const s=parseInt(e.substr(1,3),10),u=await D.subtle.importKey("raw",t.subarray(s>>3),"AES-CBC",!1,["decrypt"]),c=await D.subtle.importKey("raw",t.subarray(0,s>>3),{hash:{name:"SHA-"+(s<<1)},name:"HMAC"},!1,["sign"]),h=b(o,n,r,A(o.length<<3)),l=new Uint8Array((await D.subtle.sign("HMAC",c,h)).slice(0,s>>3));let d,f;try{d=((e,t)=>{if(!(e instanceof Uint8Array))throw new TypeError("First argument must be a buffer");if(!(t instanceof Uint8Array))throw new TypeError("Second argument must be a buffer");if(e.length!==t.length)throw new TypeError("Input buffers must have the same length");const r=e.length;let n=0,i=-1;for(;++i<r;)n|=e[i]^t[i];return 0===n})(i,l)}catch(e){}if(!d)throw new a;try{f=new Uint8Array(await D.subtle.decrypt({iv:n,name:"AES-CBC"},u,r))}catch(e){}if(!f)throw new a;return f}(e,t,r,n,i,o):async function(e,t,r,n,i){const o=e instanceof Uint8Array?await D.subtle.importKey("raw",e,"AES-GCM",!1,["decrypt"]):e;try{return new Uint8Array(await D.subtle.decrypt({additionalData:i,iv:r,name:"AES-GCM",tagLength:128},o,b(t,n)))}catch(e){throw new a}}(t,r,n,i,o)},M=async()=>{throw new s('JWE "zip" (Compression Algorithm) Header Parameter is not supported by your javascript runtime. You need to use the `inflateRaw` decrypt option to provide Inflate Raw implementation, e.g. using the "pako" module.')},N=async()=>{throw new s('JWE "zip" (Compression Algorithm) Header Parameter is not supported by your javascript runtime.')},j=[{hash:{name:"SHA-256"},name:"HMAC"},!0,["sign"]];function B(e,t){if(e.algorithm.length!==parseInt(t.substr(1,3),10))throw new TypeError(`invalid key size for alg: ${t}`)}function K(e,t){if(L(e))return e;if(e instanceof Uint8Array)return D.subtle.importKey("raw",e,"AES-KW",!0,[t]);throw new TypeError("invalid key input")}const V=async(e,t,r)=>{const n=await K(t,"wrapKey");B(n,e);const i=await D.subtle.importKey("raw",r,...j);return new Uint8Array(await D.subtle.wrapKey("raw",i,n,"AES-KW"))},W=async(e,t,r)=>{const n=await K(t,"unwrapKey");B(n,e);const i=await D.subtle.unwrapKey("raw",r,n,"AES-KW",...j);return new Uint8Array(await D.subtle.exportKey("raw",i))},J=async(e,t)=>{const r=`SHA-${e.substr(-3)}`;return new Uint8Array(await D.subtle.digest(r,t))},q=async(e,t,r,n,i=new Uint8Array(0),o=new Uint8Array(0))=>{if(!L(e))throw new TypeError("invalid key input");if(!L(t))throw new TypeError("invalid key input");const s=b(x(w.encode(r)),x(i),x(o),k(n));if(!t.usages.includes("deriveBits"))throw new TypeError('ECDH-ES private key "usages" must include "deriveBits"');const a=new Uint8Array(await D.subtle.deriveBits({name:"ECDH",public:e},t,Math.ceil(parseInt(t.algorithm.namedCurve.substr(-3),10)/8)<<3));return async function(e,t,r,n){const i=Math.ceil((r>>3)/32);let o;for(let r=1;r<=i;r++){const i=new Uint8Array(4+t.length+n.length);i.set(k(r)),i.set(t,4),i.set(n,4+t.length),o=o?b(o,await e("sha256",i)):await e("sha256",i)}return o=o.slice(0,r>>3),o}(J,a,n,s)},$=e=>{if(!L(e))throw new TypeError("invalid key input");return["P-256","P-384","P-521"].includes(e.algorithm.namedCurve)},z=D.getRandomValues.bind(D);function G(e){if(!(e instanceof Uint8Array)||e.length<8)throw new u("PBES2 Salt Input must be 8 or more octets")}function Y(e){if(e instanceof Uint8Array)return D.subtle.importKey("raw",e,"PBKDF2",!1,["deriveBits"]);if(L(e))return e;throw new TypeError("invalid key input")}const X=async(e,t,r,n=Math.floor(2049*Math.random())+2048,i=z(new Uint8Array(16)))=>{G(i);const o=E(e,i),s=parseInt(e.substr(13,3),10),a={hash:{name:`SHA-${e.substr(8,3)}`},iterations:n,name:"PBKDF2",salt:o},u={length:s,name:"AES-KW"},c=await Y(t);let h;if(c.usages.includes("deriveBits"))h=new Uint8Array(await D.subtle.deriveBits(a,c,s));else{if(!c.usages.includes("deriveKey"))throw new TypeError('PBKDF2 key "usages" must include "deriveBits" or "deriveKey"');h=await D.subtle.deriveKey(a,c,u,!1,["wrapKey"])}return{encryptedKey:await V(e.substr(-6),h,r),p2c:n,p2s:C(i)}},Q=async(e,t,r,n,i)=>{G(i);const o=E(e,i),s=parseInt(e.substr(13,3),10),a={hash:{name:`SHA-${e.substr(8,3)}`},iterations:n,name:"PBKDF2",salt:o},u={length:s,name:"AES-KW"},c=await Y(t);let h;if(c.usages.includes("deriveBits"))h=new Uint8Array(await D.subtle.deriveBits(a,c,s));else{if(!c.usages.includes("deriveKey"))throw new TypeError('PBKDF2 key "usages" must include "deriveBits" or "deriveKey"');h=await D.subtle.deriveKey(a,c,u,!1,["unwrapKey"])}return W(e.substr(-6),h,r)};function Z(e){switch(e){case"RSA-OAEP":case"RSA-OAEP-256":case"RSA-OAEP-384":case"RSA-OAEP-512":return"RSA-OAEP";default:throw new s(`alg ${e} is not supported either by JOSE or your javascript runtime`)}}var ee=(e,t)=>{if(e.startsWith("HS")){const r=parseInt(e.substr(-3),10),{length:n}=t.algorithm;if("number"!=typeof n||n<r)throw new TypeError(`${e} requires symmetric keys to be ${r} bits or larger`)}if(e.startsWith("RS")||e.startsWith("PS")){const{modulusLength:r}=t.algorithm;if("number"!=typeof r||r<2048)throw new TypeError(`${e} requires key modulusLength to be 2048 bits or larger`)}};const te=async(e,t,r,n,i)=>{if(!(L(r)||r instanceof Uint8Array))throw new TypeError("invalid key input");return O(e,r),U(e,n),"CBC"===e.substr(4,3)?async function(e,t,r,n,i){const o=parseInt(e.substr(1,3),10),s=await D.subtle.importKey("raw",r.subarray(o>>3),"AES-CBC",!1,["encrypt"]),a=await D.subtle.importKey("raw",r.subarray(0,o>>3),{hash:{name:"SHA-"+(o<<1)},name:"HMAC"},!1,["sign"]),u=new Uint8Array(await D.subtle.encrypt({iv:n,name:"AES-CBC"},s,t)),c=b(i,n,u,A(i.length<<3));return{ciphertext:u,tag:new Uint8Array((await D.subtle.sign("HMAC",a,c)).slice(0,o>>3))}}(e,t,r,n,i):async function(e,t,r,n){const i=t instanceof Uint8Array?await D.subtle.importKey("raw",t,"AES-GCM",!1,["encrypt"]):t,o=new Uint8Array(await D.subtle.encrypt({additionalData:n,iv:r,name:"AES-GCM",tagLength:128},i,e)),s=o.slice(-16);return{ciphertext:o.slice(0,-16),tag:s}}(t,r,n,i)},re=R(z),ne=new Map([["A128CBC-HS256",256],["A128GCM",128],["A192CBC-HS384",384],["A192GCM",192],["A256CBC-HS512",512],["A256GCM",256]]),ie=e=>t=>{const r=ne.get(t);if(!r)throw new s(`Unsupported JWE Algorithm: ${t}`);return e(new Uint8Array(r>>3))},oe=async e=>{var t,r;const{algorithm:n,keyUsages:i}=function(e){let t,r;switch(e.kty){case"oct":switch(e.alg){case"HS256":case"HS384":case"HS512":t={name:"HMAC",hash:{name:`SHA-${e.alg.substr(-3)}`}},r=["sign","verify"];break;case"A128CBC-HS256":case"A192CBC-HS384":case"A256CBC-HS512":throw new s(`${e.alg} keys cannot be imported as CryptoKey instances`);case"A128GCM":case"A192GCM":case"A256GCM":case"A128GCMKW":case"A192GCMKW":case"A256GCMKW":t={name:"AES-GCM"},r=["encrypt","decrypt"];break;case"A128KW":case"A192KW":case"A256KW":t={name:"AES-KW"},r=["wrapKey","unwrapKey"];break;case"PBES2-HS256+A128KW":case"PBES2-HS384+A192KW":case"PBES2-HS512+A256KW":t={name:"PBKDF2"},r=["deriveBits"];break;default:throw new s('unsupported or invalid JWK "alg" (Algorithm) Parameter value')}break;case"RSA":switch(e.alg){case"PS256":case"PS384":case"PS512":t={name:"RSA-PSS",hash:{name:`SHA-${e.alg.substr(-3)}`}},r=e.d?["sign"]:["verify"];break;case"RS256":case"RS384":case"RS512":t={name:"RSASSA-PKCS1-v1_5",hash:{name:`SHA-${e.alg.substr(-3)}`}},r=e.d?["sign"]:["verify"];break;case"RSA-OAEP":case"RSA-OAEP-256":case"RSA-OAEP-384":case"RSA-OAEP-512":t={name:"RSA-OAEP",hash:{name:`SHA-${parseInt(e.alg.substr(-3),10)||1}`}},r=e.d?["decrypt","unwrapKey"]:["encrypt","wrapKey"];break;default:throw new s('unsupported or invalid JWK "alg" (Algorithm) Parameter value')}break;case"EC":switch(e.alg){case"ES256":case"ES384":case"ES512":t={name:"ECDSA",namedCurve:e.crv},r=e.d?["sign"]:["verify"];break;case"ECDH-ES":case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":t={name:"ECDH",namedCurve:e.crv},r=e.d?["deriveBits"]:[];break;default:throw new s('unsupported or invalid JWK "alg" (Algorithm) Parameter value')}break;default:throw new s('unsupported or invalid JWK "kty" (Key Type) Parameter value')}return{algorithm:t,keyUsages:r}}(e);let o="jwk",a={...e};return delete a.alg,"PBKDF2"===n.name&&(o="raw",a=I(e.k)),D.subtle.importKey(o,a,n,null!==(t=e.ext)&&void 0!==t&&t,null!==(r=e.key_ops)&&void 0!==r?r:i)};async function se(e,t,r){if(!m(e))throw new TypeError("JWK must be an object");if(t||(t=e.alg),"string"!=typeof t||!t)throw new TypeError('"alg" argument is required when "jwk.alg" is not present');switch(e.kty){case"oct":if("string"!=typeof e.k||!e.k)throw new TypeError('missing "k" (Key Value) Parameter value');return null!=r||(r=!0!==e.ext),r?oe({...e,alg:t,ext:!1}):I(e.k);case"RSA":if(void 0!==e.oth)throw new s('RSA JWK "oth" (Other Primes Info) Parameter value is not supported');case"EC":case"OKP":return oe({...e,alg:t});default:throw new s('unsupported "kty" (Key Type) Parameter value')}}function ae(e){if(!e)throw new u("JWE Encrypted Key missing")}function ue(e,t,r){if(void 0===e[t])throw new u(`JOSE Header ${r} (${t}) missing`)}function ce(e,t,r,n,i){if(void 0!==i.crit&&void 0===n.crit)throw new e('"crit" (Critical) Header Parameter MUST be integrity protected');if(!n||void 0===n.crit)return new Set;if(!Array.isArray(n.crit)||0===n.crit.length||n.crit.some((e=>"string"!=typeof e||0===e.length)))throw new e('"crit" (Critical) Header Parameter MUST be an array of non-empty strings when present');let o;o=void 0!==r?new Map([...Object.entries(r),...t.entries()]):t;for(const t of n.crit){if(!o.has(t))throw new s(`Extension Header Parameter "${t}" is not recognized`);if(void 0===i[t])throw new e(`Extension Header Parameter "${t}" is missing`);if(o.get(t)&&void 0===n[t])throw new e(`Extension Header Parameter "${t}" MUST be integrity protected`)}return new Set(n.crit)}const he=(e,t)=>{if(void 0!==t&&(!Array.isArray(t)||t.some((e=>"string"!=typeof e))))throw new TypeError(`"${e}" option must be an array of strings`);if(t)return new Set(t)},le=ie(z),de=ce.bind(void 0,u,new Map),fe=he.bind(void 0,"keyManagementAlgorithms"),pe=he.bind(void 0,"contentEncryptionAlgorithms");async function ge(e,t,r){var n;if(!m(e))throw new u("Flattened JWE must be an object");if(void 0===e.protected&&void 0===e.header&&void 0===e.unprotected)throw new u("JOSE Header missing");if("string"!=typeof e.iv)throw new u("JWE Initialization Vector missing or incorrect type");if("string"!=typeof e.ciphertext)throw new u("JWE Ciphertext missing or incorrect type");if("string"!=typeof e.tag)throw new u("JWE Authentication Tag missing or incorrect type");if(void 0!==e.protected&&"string"!=typeof e.protected)throw new u("JWE Protected Header incorrect type");if(void 0!==e.encrypted_key&&"string"!=typeof e.encrypted_key)throw new u("JWE Encrypted Key incorrect type");if(void 0!==e.aad&&"string"!=typeof e.aad)throw new u("JWE AAD incorrect type");if(void 0!==e.header&&!m(e.header))throw new u("JWE Shared Unprotected Header incorrect type");if(void 0!==e.unprotected&&!m(e.unprotected))throw new u("JWE Per-Recipient Unprotected Header incorrect type");let i;if(e.protected){const t=I(e.protected);i=JSON.parse(_.decode(t))}if(!v(i,e.header,e.unprotected))throw new u("JWE Protected, JWE Unprotected Header, and JWE Per-Recipient Unprotected Header Parameter names must be disjoint");const a={...i,...e.header,...e.unprotected};if(de(null==r?void 0:r.crit,i,a),void 0!==a.zip){if(!i||!i.zip)throw new u('JWE "zip" (Compression Algorithm) Header MUST be integrity protected');if("DEF"!==a.zip)throw new s('unsupported JWE "zip" (Compression Algorithm) Header Parameter value')}const{alg:c,enc:h}=a;if("string"!=typeof c||!c)throw new u("missing JWE Algorithm (alg) in JWE Header");if("string"!=typeof h||!h)throw new u("missing JWE Encryption Algorithm (enc) in JWE Header");const l=r&&fe(r.keyManagementAlgorithms),d=r&&pe(r.contentEncryptionAlgorithms);if(l&&!l.has(c))throw new o('"alg" (Algorithm) Header Parameter not allowed');if(d&&!d.has(h))throw new o('"enc" (Encryption Algorithm) Header Parameter not allowed');let f,p;void 0!==e.encrypted_key&&(f=I(e.encrypted_key)),"function"==typeof t&&(t=await t(i,e));try{p=await async function(e,t,r,n){switch(e){case"dir":if(void 0!==r)throw new u("Encountered unexpected JWE Encrypted Key");return t;case"ECDH-ES":if(void 0!==r)throw new u("Encountered unexpected JWE Encrypted Key");case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":{if(ue(n,"epk","Ephemeral Public Key"),!$(t))throw new s("ECDH-ES with the provided key is not allowed or not supported by your javascript runtime");const i=await se(n.epk,e);let o,a;void 0!==n.apu&&(o=I(n.apu)),void 0!==n.apv&&(a=I(n.apv));const u=await q(i,t,"ECDH-ES"===e?n.enc:e,parseInt(e.substr(-5,3),10)||ne.get(n.enc),o,a);if("ECDH-ES"===e)return u;ae(r);const c=e.substr(-6);return W(c,u,r)}case"RSA1_5":case"RSA-OAEP":case"RSA-OAEP-256":case"RSA-OAEP-384":case"RSA-OAEP-512":return ae(r),(async(e,t,r)=>{if(!L(t))throw new TypeError("invalid key input");if(ee(e,t),t.usages.includes("decrypt"))return new Uint8Array(await D.subtle.decrypt(Z(e),t,r));if(t.usages.includes("unwrapKey")){const n=await D.subtle.unwrapKey("raw",r,t,Z(e),...j);return new Uint8Array(await D.subtle.exportKey("raw",n))}throw new TypeError('RSA-OAEP key "usages" must include "decrypt" or "unwrapKey" for this operation')})(e,t,r);case"PBES2-HS256+A128KW":case"PBES2-HS384+A192KW":case"PBES2-HS512+A256KW":{ae(r),ue(n,"p2c","PBES2 Count"),ue(n,"p2s","PBES2 Salt");const{p2c:i}=n,o=I(n.p2s);return Q(e,t,r,i,o)}case"A128KW":case"A192KW":case"A256KW":return ae(r),W(e,t,r);case"A128GCMKW":case"A192GCMKW":case"A256GCMKW":return ae(r),ue(n,"iv","Initialization Vector"),ue(n,"tag","Authentication Tag"),(async(e,t,r,n,i)=>{const o=e.substr(0,7);return H(o,t,r,n,i,new Uint8Array(0))})(e,t,r,I(n.iv),I(n.tag));default:throw new s('unsupported or invalid "alg" (JWE Algorithm) header value')}}(c,t,f,a)}catch(e){if(e instanceof TypeError)throw e;p=le(h)}const g=I(e.iv),y=I(e.tag),S=w.encode(null!==(n=e.protected)&&void 0!==n?n:"");let E;E=void 0!==e.aad?b(S,w.encode("."),w.encode(e.aad)):S;let F=await H(h,p,I(e.ciphertext),g,y,E);"DEF"===a.zip&&(F=await((null==r?void 0:r.inflateRaw)||M)(F));const A={plaintext:F};return void 0!==e.protected&&(A.protectedHeader=i),void 0!==e.aad&&(A.additionalAuthenticatedData=I(e.aad)),void 0!==e.unprotected&&(A.sharedUnprotectedHeader=e.unprotected),void 0!==e.header&&(A.unprotectedHeader=e.header),A}async function ye(e,t,r){if(e instanceof Uint8Array&&(e=_.decode(e)),"string"!=typeof e)throw new u("Compact JWE must be a string or Uint8Array");const{0:n,1:i,2:o,3:s,4:a,length:c}=e.split(".");if(5!==c)throw new u("Invalid Compact JWE");const h=await ge({ciphertext:s||void 0,iv:o||void 0,protected:n||void 0,tag:a||void 0,encrypted_key:i||void 0},t,r);return{plaintext:h.plaintext,protectedHeader:h.protectedHeader}}async function ve(e){return e instanceof Uint8Array?{kty:"oct",k:C(e)}:(async e=>{if(!L(e))throw new TypeError("invalid key input");if(!e.extractable)throw new TypeError("non-extractable CryptoKey cannot be exported as a JWK");const{ext:t,key_ops:r,alg:n,use:i,...o}=await D.subtle.exportKey("jwk",e);return o})(e)}const me=ie(z);const we=R(z),_e=ce.bind(void 0,u,new Map);class Se{constructor(e){this._plaintext=e}setKeyManagementParameters(e){if(this._keyManagementParameters)throw new TypeError("setKeyManagementParameters can only be called once");return this._keyManagementParameters=e,this}setProtectedHeader(e){if(this._protectedHeader)throw new TypeError("setProtectedHeader can only be called once");return this._protectedHeader=e,this}setSharedUnprotectedHeader(e){if(this._sharedUnprotectedHeader)throw new TypeError("setSharedUnprotectedHeader can only be called once");return this._sharedUnprotectedHeader=e,this}setUnprotectedHeader(e){if(this._unprotectedHeader)throw new TypeError("setUnprotectedHeader can only be called once");return this._unprotectedHeader=e,this}setAdditionalAuthenticatedData(e){return this._aad=e,this}setContentEncryptionKey(e){if(this._cek)throw new TypeError("setContentEncryptionKey can only be called once");return this._cek=e,this}setInitializationVector(e){if(this._iv)throw new TypeError("setInitializationVector can only be called once");return this._iv=e,this}async encrypt(e,t){if(!this._protectedHeader&&!this._unprotectedHeader&&!this._sharedUnprotectedHeader)throw new u("either setProtectedHeader, setUnprotectedHeader, or sharedUnprotectedHeader must be called before #encrypt()");if(!v(this._protectedHeader,this._unprotectedHeader,this._sharedUnprotectedHeader))throw new u("JWE Shared Protected, JWE Shared Unprotected and JWE Per-Recipient Header Parameter names must be disjoint");const r={...this._protectedHeader,...this._unprotectedHeader,...this._sharedUnprotectedHeader};if(_e(null==t?void 0:t.crit,this._protectedHeader,r),void 0!==r.zip){if(!this._protectedHeader||!this._protectedHeader.zip)throw new u('JWE "zip" (Compression Algorithm) Header MUST be integrity protected');if("DEF"!==r.zip)throw new s('unsupported JWE "zip" (Compression Algorithm) Header Parameter value')}const{alg:n,enc:i}=r;if("string"!=typeof n||!n)throw new u('JWE "alg" (Algorithm) Header Parameter missing or invalid');if("string"!=typeof i||!i)throw new u('JWE "enc" (Encryption Algorithm) Header Parameter missing or invalid');let o,a,c,h,l,d,f;if("dir"===n){if(this._cek)throw new TypeError("setContentEncryptionKey cannot be called when using Direct Encryption")}else if("ECDH-ES"===n&&this._cek)throw new TypeError("setContentEncryptionKey cannot be called when using Direct Key Agreement");{let t;({cek:a,encryptedKey:o,parameters:t}=await async function(e,t,r,n,i={}){let o,a,u;switch(e){case"dir":u=r;break;case"ECDH-ES":case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":{if(!$(r))throw new s("ECDH-ES with the provided key is not allowed or not supported by your javascript runtime");const{apu:c,apv:h}=i;let{epk:l}=i;l||(l=await(async e=>{if(!L(e))throw new TypeError("invalid key input");return(await D.subtle.generateKey({name:"ECDH",namedCurve:e.algorithm.namedCurve},!0,["deriveBits"])).privateKey})(r));const{x:d,y:f,crv:p,kty:g}=await ve(l),y=await q(r,l,"ECDH-ES"===e?t:e,parseInt(e.substr(-5,3),10)||ne.get(t),c,h);if(a={epk:{x:d,y:f,crv:p,kty:g}},c&&(a.apu=C(c)),h&&(a.apv=C(h)),"ECDH-ES"===e){u=y;break}u=n||me(t);const v=e.substr(-6);o=await V(v,y,u);break}case"RSA1_5":case"RSA-OAEP":case"RSA-OAEP-256":case"RSA-OAEP-384":case"RSA-OAEP-512":u=n||me(t),o=await(async(e,t,r)=>{if(!L(t))throw new TypeError("invalid key input");if(ee(e,t),t.usages.includes("encrypt"))return new Uint8Array(await D.subtle.encrypt(Z(e),t,r));if(t.usages.includes("wrapKey")){const n=await D.subtle.importKey("raw",r,...j);return new Uint8Array(await D.subtle.wrapKey("raw",n,t,Z(e)))}throw new TypeError('RSA-OAEP key "usages" must include "encrypt" or "wrapKey" for this operation')})(e,r,u);break;case"PBES2-HS256+A128KW":case"PBES2-HS384+A192KW":case"PBES2-HS512+A256KW":{u=n||me(t);const{p2c:s,p2s:c}=i;({encryptedKey:o,...a}=await X(e,r,u,s,c));break}case"A128KW":case"A192KW":case"A256KW":u=n||me(t),o=await V(e,r,u);break;case"A128GCMKW":case"A192GCMKW":case"A256GCMKW":{u=n||me(t);const{iv:s}=i;({encryptedKey:o,...a}=await(async(e,t,r,n)=>{const i=e.substr(0,7);n||(n=re(i));const{ciphertext:o,tag:s}=await te(i,r,t,n,new Uint8Array(0));return{encryptedKey:o,iv:C(n),tag:C(s)}})(e,r,u,s));break}default:throw new s('unsupported or invalid "alg" (JWE Algorithm) header value')}return{cek:u,encryptedKey:o,parameters:a}}(n,i,e,this._cek,this._keyManagementParameters)),t&&(this._protectedHeader?this._protectedHeader={...this._protectedHeader,...t}:this.setProtectedHeader(t))}if(this._iv||(this._iv=we(i)),h=this._protectedHeader?w.encode(C(JSON.stringify(this._protectedHeader))):w.encode(""),this._aad?(l=C(this._aad),c=b(h,w.encode("."),w.encode(l))):c=h,"DEF"===r.zip){const e=await((null==t?void 0:t.deflateRaw)||N)(this._plaintext);({ciphertext:d,tag:f}=await te(i,e,a,this._iv,c))}else({ciphertext:d,tag:f}=await te(i,this._plaintext,a,this._iv,c));const p={ciphertext:C(d),iv:C(this._iv),tag:C(f)};return o&&(p.encrypted_key=C(o)),l&&(p.aad=l),this._protectedHeader&&(p.protected=_.decode(h)),this._sharedUnprotectedHeader&&(p.unprotected=this._sharedUnprotectedHeader),this._unprotectedHeader&&(p.header=this._unprotectedHeader),p}}class be{constructor(e){this._flattened=new Se(e)}setContentEncryptionKey(e){return this._flattened.setContentEncryptionKey(e),this}setInitializationVector(e){return this._flattened.setInitializationVector(e),this}setProtectedHeader(e){return this._flattened.setProtectedHeader(e),this}setKeyManagementParameters(e){return this._flattened.setKeyManagementParameters(e),this}async encrypt(e,t){const r=await this._flattened.encrypt(e,t);return[r.protected,r.encrypted_key,r.iv,r.ciphertext,r.tag].join(".")}}async function Ee(e,t,r){if(!m(e))throw new u("General JWE must be an object");if(!Array.isArray(e.recipients)||!e.recipients.every(m))throw new u("JWE Recipients missing or incorrect type");for(const n of e.recipients)try{return await ge({aad:e.aad,ciphertext:e.ciphertext,encrypted_key:n.encrypted_key,header:n.header,iv:e.iv,protected:e.protected,tag:e.tag,unprotected:e.unprotected},t,r)}catch(e){}throw new a}async function Fe(e,t){const r={...e,...t.header};if(!m(r.jwk))throw new c('"jwk" (JSON Web Key) Header Parameter must be a JSON object');const n=await se(r.jwk,r.alg,!0);if("public"!==n.type)throw new c('"jwk" (JSON Web Key) Header Parameter must be a public key');return n}const Ae=(e,t)=>{if("string"!=typeof e||!e)throw new l(`${t} missing or invalid`)};async function ke(e,t="sha256"){if(!m(e))throw new TypeError("JWK must be an object");let r;switch(e.kty){case"EC":Ae(e.crv,'"crv" (Curve) Parameter'),Ae(e.x,'"x" (X Coordinate) Parameter'),Ae(e.y,'"y" (Y Coordinate) Parameter'),r={crv:e.crv,kty:e.kty,x:e.x,y:e.y};break;case"OKP":Ae(e.crv,'"crv" (Subtype of Key Pair) Parameter'),Ae(e.x,'"x" (Public Key) Parameter'),r={crv:e.crv,kty:e.kty,x:e.x};break;case"RSA":Ae(e.e,'"e" (Exponent) Parameter'),Ae(e.n,'"n" (Modulus) Parameter'),r={e:e.e,kty:e.kty,n:e.n};break;case"oct":Ae(e.k,'"k" (Key Value) Parameter'),r={k:e.k,kty:e.kty};break;default:throw new s('"kty" (Key Type) Parameter missing or unsupported')}const n=w.encode(JSON.stringify(r));return C(await J(t,n))}function xe(e){return m(e)}class Pe{constructor(e,t){if(this._cached=new WeakMap,!(e instanceof URL))throw new TypeError("url must be an instance of URL");this._url=new URL(e.href),this._options={agent:null==t?void 0:t.agent},this._timeoutDuration="number"==typeof(null==t?void 0:t.timeoutDuration)?null==t?void 0:t.timeoutDuration:5e3,this._cooldownDuration="number"==typeof(null==t?void 0:t.cooldownDuration)?null==t?void 0:t.cooldownDuration:3e4}coolingDown(){return void 0!==this._cooldownStarted&&Date.now()<this._cooldownStarted+this._cooldownDuration}async getKey(e){this._jwks||await this.reload();const t=this._jwks.keys.filter((t=>{let r=t.kty===function(e){switch(e.substr(0,2)){case"RS":case"PS":return"RSA";case"ES":return"EC";case"Ed":return"OKP";default:throw new s('Unsupported "alg" value for a JSON Web Key Set')}}(e.alg);if(r&&"string"==typeof e.kid&&(r=e.kid===t.kid),r&&"string"==typeof t.alg&&(r=e.alg===t.alg),r&&"string"==typeof t.use&&(r="sig"===t.use),r&&Array.isArray(t.key_ops)&&(r=t.key_ops.includes("verify")),r&&"EdDSA"===e.alg&&(r=["Ed25519","Ed448"].includes(t.crv)),r)switch(e.alg){case"ES256":r="P-256"===t.crv;break;case"ES256K":r="secp256k1"===t.crv;break;case"ES384":r="P-384"===t.crv;break;case"ES512":r="P-521"===t.crv}return r})),{0:r,length:n}=t;if(0===n){if(!1===this.coolingDown())return await this.reload(),this.getKey(e);throw new f}if(1!==n)throw new p;this._cached.has(r)||this._cached.set(r,{});const i=this._cached.get(r);if(void 0===i[e.alg]){const t=await se({...r,alg:e.alg});if("public"!==t.type)throw new d("JSON Web Key Set members must be public keys");i[e.alg]=t}return i[e.alg]}async reload(){this._pendingFetch||(this._pendingFetch=(async(e,t)=>{let r;"function"==typeof AbortController&&(r=new AbortController,setTimeout((()=>r.abort()),t));const i=await P.fetch(e.href,{signal:r?r.signal:void 0,redirect:"manual",referrerPolicy:"no-referrer",credentials:"omit",mode:"cors",method:"GET"});if(200!==i.status)throw new n("Expected 200 OK from the JSON Web Key Set HTTP response");try{return await i.json()}catch(e){throw new n("Failed to parse the JSON Web Key Set HTTP response as JSON")}})(this._url,this._timeoutDuration,this._options).then((e=>{if("object"!=typeof e||!e||!Array.isArray(e.keys)||!e.keys.every(xe))throw new d("JSON Web Key Set malformed");this._jwks={keys:e.keys},this._cooldownStarted=Date.now(),this._pendingFetch=void 0})).catch((e=>{throw this._pendingFetch=void 0,e}))),await this._pendingFetch}}function Ce(e,t){const r=new Pe(e,t);return r.getKey.bind(r)}function Ie(e){switch(e){case"HS256":return{hash:{name:"SHA-256"},name:"HMAC"};case"HS384":return{hash:{name:"SHA-384"},name:"HMAC"};case"HS512":return{hash:{name:"SHA-512"},name:"HMAC"};case"PS256":return{hash:{name:"SHA-256"},name:"RSA-PSS",saltLength:32};case"PS384":return{hash:{name:"SHA-384"},name:"RSA-PSS",saltLength:48};case"PS512":return{hash:{name:"SHA-512"},name:"RSA-PSS",saltLength:64};case"RS256":return{hash:{name:"SHA-256"},name:"RSASSA-PKCS1-v1_5"};case"RS384":return{hash:{name:"SHA-384"},name:"RSASSA-PKCS1-v1_5"};case"RS512":return{hash:{name:"SHA-512"},name:"RSASSA-PKCS1-v1_5"};case"ES256":return{hash:{name:"SHA-256"},name:"ECDSA",namedCurve:"P-256"};case"ES384":return{hash:{name:"SHA-384"},name:"ECDSA",namedCurve:"P-384"};case"ES512":return{hash:{name:"SHA-512"},name:"ECDSA",namedCurve:"P-521"};default:throw new s(`alg ${e} is not supported either by JOSE or your javascript runtime`)}}function Te(e,t,r){if(L(t))return t;if(t instanceof Uint8Array){if(!e.startsWith("HS"))throw new TypeError("symmetric keys are only applicable for HMAC-based algorithms");return D.subtle.importKey("raw",t,{hash:{name:`SHA-${e.substr(-3)}`},name:"HMAC"},!1,[r])}throw new TypeError("invalid key input")}const Re=(e,t)=>{if(e.startsWith("HS")||"dir"===e||e.startsWith("PBES2")||e.match(/^A\d{3}(?:GCM)KW$/)){if(t instanceof Uint8Array||"secret"===t.type)return;throw new TypeError('CryptoKey or KeyObject instances for symmetric algorithms must be of type "secret"')}if(t instanceof Uint8Array)throw new TypeError("CryptoKey or KeyObject instances must be used for asymmetric algorithms");if("secret"===t.type)throw new TypeError('CryptoKey or KeyObject instances for asymmetric algorithms must not be of type "secret"')},Ue=ce.bind(void 0,c,new Map([["b64",!0]]));class Oe{constructor(e){this._payload=e}setProtectedHeader(e){if(this._protectedHeader)throw new TypeError("setProtectedHeader can only be called once");return this._protectedHeader=e,this}setUnprotectedHeader(e){if(this._unprotectedHeader)throw new TypeError("setUnprotectedHeader can only be called once");return this._unprotectedHeader=e,this}async sign(e,t){if(!this._protectedHeader&&!this._unprotectedHeader)throw new c("either setProtectedHeader or setUnprotectedHeader must be called before #sign()");if(!v(this._protectedHeader,this._unprotectedHeader))throw new c("JWS Protected and JWS Unprotected Header Parameter names must be disjoint");const r={...this._protectedHeader,...this._unprotectedHeader};let n=!0;if(Ue(null==t?void 0:t.crit,this._protectedHeader,r).has("b64")&&(n=this._protectedHeader.b64,"boolean"!=typeof n))throw new c('The "b64" (base64url-encode payload) Header Parameter must be a boolean');const{alg:i}=r;if("string"!=typeof i||!i)throw new c('JWS "alg" (Algorithm) Header Parameter missing or invalid');Re(i,e);let o,s=this._payload;n&&(s=w.encode(C(s))),o=this._protectedHeader?w.encode(C(JSON.stringify(this._protectedHeader))):w.encode("");const a=b(o,w.encode("."),s),u=await(async(e,t,r)=>{const n=await Te(e,t,"sign");ee(e,n);const i=await D.subtle.sign(Ie(e),n,r);return new Uint8Array(i)})(i,e,a),h={signature:C(u)};return n&&(h.payload=_.decode(s)),this._unprotectedHeader&&(h.header=this._unprotectedHeader),this._protectedHeader&&(h.protected=_.decode(o)),h}}class De{constructor(e){this._flattened=new Oe(e)}setProtectedHeader(e){return this._flattened.setProtectedHeader(e),this}async sign(e,t){const r=await this._flattened.sign(e,t);if(void 0===r.payload)throw new TypeError("use the flattened module for creating JWS with b64: false");return`${r.protected}.${r.payload}.${r.signature}`}}const Le=ce.bind(void 0,c,new Map([["b64",!0]])),He=he.bind(void 0,"algorithms");async function Me(e,t,r){var n;if(!m(e))throw new c("Flattened JWS must be an object");if(void 0===e.protected&&void 0===e.header)throw new c('Flattened JWS must have either of the "protected" or "header" members');if(void 0!==e.protected&&"string"!=typeof e.protected)throw new c("JWS Protected Header incorrect type");if(void 0===e.payload)throw new c("JWS Payload missing");if("string"!=typeof e.signature)throw new c("JWS Signature missing or incorrect type");if(void 0!==e.header&&!m(e.header))throw new c("JWS Unprotected Header incorrect type");let i={};if(e.protected){const t=I(e.protected);i=JSON.parse(_.decode(t))}if(!v(i,e.header))throw new c("JWS Protected and JWS Unprotected Header Parameter names must be disjoint");const s={...i,...e.header};let a=!0;if(Le(null==r?void 0:r.crit,i,s).has("b64")&&(a=i.b64,"boolean"!=typeof a))throw new c('The "b64" (base64url-encode payload) Header Parameter must be a boolean');const{alg:u}=s;if("string"!=typeof u||!u)throw new c('JWS "alg" (Algorithm) Header Parameter missing or invalid');const h=r&&He(r.algorithms);if(h&&!h.has(u))throw new o('"alg" (Algorithm) Header Parameter not allowed');if(a){if("string"!=typeof e.payload)throw new c("JWS Payload must be a string")}else if("string"!=typeof e.payload&&!(e.payload instanceof Uint8Array))throw new c("JWS Payload must be a string or an Uint8Array instance");"function"==typeof t&&(t=await t(i,e)),Re(u,t);const l=b(w.encode(null!==(n=e.protected)&&void 0!==n?n:""),w.encode("."),"string"==typeof e.payload?w.encode(e.payload):e.payload),d=I(e.signature);if(!await(async(e,t,r,n)=>{const i=await Te(e,t,"verify");ee(e,i);const o=Ie(e);try{return await D.subtle.verify(o,i,r,n)}catch(e){return!1}})(u,t,d,l))throw new g;let f;f=a?I(e.payload):"string"==typeof e.payload?w.encode(e.payload):e.payload;const p={payload:f};return void 0!==e.protected&&(p.protectedHeader=i),void 0!==e.header&&(p.unprotectedHeader=e.header),p}async function Ne(e,t,r){if(e instanceof Uint8Array&&(e=_.decode(e)),"string"!=typeof e)throw new c("Compact JWS must be a string or Uint8Array");const{0:n,1:i,2:o,length:s}=e.split(".");if(3!==s)throw new c("Invalid Compact JWS");const a=await Me({payload:i||void 0,protected:n||void 0,signature:o||void 0},t,r);return{payload:a.payload,protectedHeader:a.protectedHeader}}const je=new WeakMap;class Be{setProtectedHeader(e){if(this._protectedHeader)throw new TypeError("setProtectedHeader can only be called once");return this._protectedHeader=e,this}setUnprotectedHeader(e){if(this._unprotectedHeader)throw new TypeError("setUnprotectedHeader can only be called once");return this._unprotectedHeader=e,this}set _protectedHeader(e){je.get(this).protectedHeader=e}get _protectedHeader(){return je.get(this).protectedHeader}set _unprotectedHeader(e){je.get(this).unprotectedHeader=e}get _unprotectedHeader(){return je.get(this).unprotectedHeader}}class Ke{constructor(e){this._signatures=[],this._payload=e}addSignature(e,t){const r=new Be;return je.set(r,{key:e,options:t}),this._signatures.push(r),r}async sign(){if(!this._signatures.length)throw new c("at least one signature must be added");const e={signatures:[]};return await Promise.all(this._signatures.map((async(t,r)=>{const{protectedHeader:n,unprotectedHeader:i,options:o,key:s}=je.get(t),a=new Oe(this._payload);n&&a.setProtectedHeader(n),i&&a.setUnprotectedHeader(i);const{payload:u,...h}=await a.sign(s,o);if("payload"in e&&e.payload!==u)throw new c(`index ${r} signature produced a different payload`);e.payload=u,e.signatures.push(h)}))),"payload"in e&&void 0===e.payload&&delete e.payload,e}}async function Ve(e,t,r){if(!m(e))throw new c("General JWS must be an object");if(!Array.isArray(e.signatures)||!e.signatures.every(m))throw new c("JWS Signatures missing or incorrect type");for(const n of e.signatures)try{return await Me({header:n.header,payload:e.payload,protected:n.protected,signature:n.signature},t,r)}catch(e){}throw new g}var We=e=>Math.floor(e.getTime()/1e3);const Je=/^(\d+|\d+\.\d+) ?(seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)$/i;var qe=e=>{const t=Je.exec(e);if(!t)throw new TypeError("invalid time period format");const r=parseFloat(t[1]);switch(t[2].toLowerCase()){case"sec":case"secs":case"second":case"seconds":case"s":return Math.round(r);case"minute":case"minutes":case"min":case"mins":case"m":return Math.round(60*r);case"hour":case"hours":case"hr":case"hrs":case"h":return Math.round(3600*r);case"day":case"days":case"d":return Math.round(86400*r);case"week":case"weeks":case"w":return Math.round(604800*r);default:return Math.round(31557600*r)}};const $e=e=>e.toLowerCase().replace(/^application\//,"");var ze=(e,t,r={})=>{const{typ:n}=r;if(n&&("string"!=typeof e.typ||$e(e.typ)!==$e(n)))throw new i('unexpected "typ" JWT header value',"typ","check_failed");let o;try{o=JSON.parse(_.decode(t))}catch(e){}if(!m(o))throw new h("JWT Claims Set must be a top-level JSON object");const{issuer:s}=r;if(s&&!(Array.isArray(s)?s:[s]).includes(o.iss))throw new i('unexpected "iss" claim value',"iss","check_failed");const{subject:a}=r;if(a&&o.sub!==a)throw new i('unexpected "sub" claim value',"sub","check_failed");const{audience:u}=r;if(u&&(l="string"==typeof u?[u]:u,!("string"==typeof(c=o.aud)?l.includes(c):Array.isArray(c)&&l.some(Set.prototype.has.bind(new Set(c))))))throw new i('unexpected "aud" claim value',"aud","check_failed");var c,l;let d;switch(typeof r.clockTolerance){case"string":d=qe(r.clockTolerance);break;case"number":d=r.clockTolerance;break;case"undefined":d=0;break;default:throw new TypeError("invalid clockTolerance option type")}const{currentDate:f}=r,p=We(f||new Date);if(void 0!==o.iat||r.maxTokenAge){if("number"!=typeof o.iat)throw new i('"iat" claim must be a number',"iat","invalid");if(void 0===o.exp&&o.iat>p+d)throw new i('"iat" claim timestamp check failed (it should be in the past)',"iat","check_failed")}if(void 0!==o.nbf){if("number"!=typeof o.nbf)throw new i('"nbf" claim must be a number',"nbf","invalid");if(o.nbf>p+d)throw new i('"nbf" claim timestamp check failed',"nbf","check_failed")}if(void 0!==o.exp){if("number"!=typeof o.exp)throw new i('"exp" claim must be a number',"exp","invalid");if(o.exp<=p-d)throw new y('"exp" claim timestamp check failed',"exp","check_failed")}if(r.maxTokenAge){const e=p-o.iat;if(e-d>("number"==typeof r.maxTokenAge?r.maxTokenAge:qe(r.maxTokenAge)))throw new y('"iat" claim timestamp check failed (too far in the past)',"iat","check_failed");if(e<0-d)throw new i('"iat" claim timestamp check failed (it should be in the past)',"iat","check_failed")}return o};async function Ge(e,t,r){const n=await ye(e,t,r),o=ze(n.protectedHeader,n.plaintext,r),{protectedHeader:s}=n;if(void 0!==s.iss&&s.iss!==o.iss)throw new i('replicated "iss" claim header parameter mismatch',"iss","mismatch");if(void 0!==s.sub&&s.sub!==o.sub)throw new i('replicated "sub" claim header parameter mismatch',"sub","mismatch");if(void 0!==s.aud&&JSON.stringify(s.aud)!==JSON.stringify(o.aud))throw new i('replicated "aud" claim header parameter mismatch',"aud","mismatch");return{payload:o,protectedHeader:s}}class Ye{constructor(e){if(!m(e))throw new TypeError("JWT Claims Set MUST be an object");this._payload=e}setIssuer(e){return this._payload={...this._payload,iss:e},this}setSubject(e){return this._payload={...this._payload,sub:e},this}setAudience(e){return this._payload={...this._payload,aud:e},this}setJti(e){return this._payload={...this._payload,jti:e},this}setNotBefore(e){return this._payload="number"==typeof e?{...this._payload,nbf:e}:{...this._payload,nbf:We(new Date)+qe(e)},this}setExpirationTime(e){return this._payload="number"==typeof e?{...this._payload,exp:e}:{...this._payload,exp:We(new Date)+qe(e)},this}setIssuedAt(e){return this._payload=void 0===e?{...this._payload,iat:We(new Date)}:{...this._payload,iat:e},this}}class Xe extends Ye{setProtectedHeader(e){if(this._protectedHeader)throw new TypeError("setProtectedHeader can only be called once");return this._protectedHeader=e,this}setKeyManagementParameters(e){if(this._keyManagementParameters)throw new TypeError("setKeyManagementParameters can only be called once");return this._keyManagementParameters=e,this}setContentEncryptionKey(e){if(this._cek)throw new TypeError("setContentEncryptionKey can only be called once");return this._cek=e,this}setInitializationVector(e){if(this._iv)throw new TypeError("setInitializationVector can only be called once");return this._iv=e,this}replicateIssuerAsHeader(){return this._replicateIssuerAsHeader=!0,this}replicateSubjectAsHeader(){return this._replicateSubjectAsHeader=!0,this}replicateAudienceAsHeader(){return this._replicateAudienceAsHeader=!0,this}async encrypt(e,t){const r=new be(w.encode(JSON.stringify(this._payload)));return this._replicateIssuerAsHeader&&(this._protectedHeader={...this._protectedHeader,iss:this._payload.iss}),this._replicateSubjectAsHeader&&(this._protectedHeader={...this._protectedHeader,sub:this._payload.sub}),this._replicateAudienceAsHeader&&(this._protectedHeader={...this._protectedHeader,aud:this._payload.aud}),r.setProtectedHeader(this._protectedHeader),this._iv&&r.setInitializationVector(this._iv),this._cek&&r.setContentEncryptionKey(this._cek),this._keyManagementParameters&&r.setKeyManagementParameters(this._keyManagementParameters),r.encrypt(e,t)}}class Qe extends Ye{setProtectedHeader(e){return this._protectedHeader=e,this}async sign(e,t){var r;const n=new De(w.encode(JSON.stringify(this._payload)));if(n.setProtectedHeader(this._protectedHeader),(null===(r=this._protectedHeader.crit)||void 0===r?void 0:r.includes("b64"))&&!1===this._protectedHeader.b64)throw new h("JWTs MUST NOT use unencoded payload");return n.sign(e,t)}}class Ze extends Ye{encode(){return`${C(JSON.stringify({alg:"none"}))}.${C(JSON.stringify(this._payload))}.`}static decode(e,t){if("string"!=typeof e)throw new h("Unsecured JWT must be a string");const{0:r,1:n,2:i,length:o}=e.split(".");if(3!==o||""!==i)throw new h("Invalid Unsecured JWT");let s;try{if(s=JSON.parse(_.decode(I(r))),"none"!==s.alg)throw new Error}catch(e){throw new h("Invalid Unsecured JWT")}return{payload:ze(s,I(n),t),header:s}}}async function et(e,t,r){var n;const i=await Ne(e,t,r);if((null===(n=i.protectedHeader.crit)||void 0===n?void 0:n.includes("b64"))&&!1===i.protectedHeader.b64)throw new h("JWTs MUST NOT use unencoded payload");return{payload:ze(i.protectedHeader,i.payload,r),protectedHeader:i.protectedHeader}}const tt=C,rt=I;function nt(e){let t;if("string"==typeof e){const r=e.split(".");3!==r.length&&5!==r.length||([t]=r)}else if("object"==typeof e&&e){if(!("protected"in e))throw new TypeError("Token does not contain a Protected Header");t=e.protected}try{if("string"!=typeof t||!t)throw new Error;const e=JSON.parse(_.decode(rt(t)));if(!m(e))throw new Error;return e}catch(e){throw new TypeError("Invalid Token or Protected Header formatting")}}function it(e){var t;const r=null!==(t=null==e?void 0:e.modulusLength)&&void 0!==t?t:2048;if("number"!=typeof r||r<2048)throw new s("invalid or unsupported modulusLength option provided, 2048 bits or larger keys must be used");return r}async function ot(e,t){return async function(e,t){var r,n;let i,o;switch(e){case"PS256":case"PS384":case"PS512":i={name:"RSA-PSS",hash:{name:`SHA-${e.substr(-3)}`},publicExponent:new Uint8Array([1,0,1]),modulusLength:it(t)},o=["sign","verify"];break;case"RS256":case"RS384":case"RS512":i={name:"RSASSA-PKCS1-v1_5",hash:{name:`SHA-${e.substr(-3)}`},publicExponent:new Uint8Array([1,0,1]),modulusLength:it(t)},o=["sign","verify"];break;case"RSA-OAEP":case"RSA-OAEP-256":case"RSA-OAEP-384":case"RSA-OAEP-512":i={name:"RSA-OAEP",hash:{name:`SHA-${parseInt(e.substr(-3),10)||1}`},publicExponent:new Uint8Array([1,0,1]),modulusLength:it(t)},o=["decrypt","unwrapKey","encrypt","wrapKey"];break;case"ES256":i={name:"ECDSA",namedCurve:"P-256"},o=["sign","verify"];break;case"ES384":i={name:"ECDSA",namedCurve:"P-384"},o=["sign","verify"];break;case"ES512":i={name:"ECDSA",namedCurve:"P-521"},o=["sign","verify"];break;case"ECDH-ES":case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":i={name:"ECDH",namedCurve:null!==(r=null==t?void 0:t.crv)&&void 0!==r?r:"P-256"},o=["deriveKey","deriveBits"];break;default:throw new s('unsupported or invalid JWK "alg" (Algorithm) Parameter value')}return D.subtle.generateKey(i,null!==(n=null==t?void 0:t.extractable)&&void 0!==n&&n,o)}(e,t)}async function st(e,t){return async function(e,t){var r;let n,i,o;switch(e){case"HS256":case"HS384":case"HS512":n=parseInt(e.substr(-3),10),i={name:"HMAC",hash:{name:`SHA-${e.substr(-3)}`},length:n},o=["sign","verify"];break;case"A128CBC-HS256":case"A192CBC-HS384":case"A256CBC-HS512":return n=parseInt(e.substr(-3),10),z(new Uint8Array(n>>3));case"A128KW":case"A192KW":case"A256KW":n=parseInt(e.substring(1,4),10),i={name:"AES-KW",length:n},o=["wrapKey","unwrapKey"];break;case"A128GCMKW":case"A192GCMKW":case"A256GCMKW":case"A128GCM":case"A192GCM":case"A256GCM":n=parseInt(e.substring(1,4),10),i={name:"AES-GCM",length:n},o=["encrypt","decrypt"];break;default:throw new s('unsupported or invalid JWK "alg" (Algorithm) Parameter value')}return D.subtle.generateKey(i,null!==(r=null==t?void 0:t.extractable)&&void 0!==r&&r,o)}(e,t)}const at=z},591:(e,t,r)=>{"use strict";r.r(t),r.d(t,{CordovaIFrameNavigator:()=>n.CordovaIFrameNavigator,CordovaPopupNavigator:()=>n.CordovaPopupNavigator,InMemoryWebStorage:()=>n.InMemoryWebStorage,Log:()=>n.Log,OidcClient:()=>n.OidcClient,SessionMonitor:()=>n.SessionMonitor,User:()=>n.User,UserManager:()=>n.UserManager,Version:()=>n.Version,WebStorageStateStore:()=>n.WebStorageStateStore,clearOidcPersistentStorage:()=>h,getBearerToken:()=>a,getDpopToken:()=>u,registerClient:()=>s,removeOidcQueryParam:()=>c});var n=r(671),i=r(835);const o=(e,t={})=>{const{sorted:r,skipIndex:n,ignorenull:i,skipBracket:o,useDot:s,whitespace:a="+"}=t,u=e=>String(e).replace(/[^ !'()~*]/gu,encodeURIComponent).replace(/ /g,a).replace(/[!'()~*]/g,(e=>`%${e.charCodeAt().toString(16).slice(-2).toUpperCase()}`)),c=(e,t=Object.keys(e))=>r?t.sort():t,h=e=>e.filter((e=>e)).join("&"),l=(e,t,r=typeof t,a=null)=>(t===a?a=i?a:u(e)+"="+a:/string|number|boolean/.test(r)?a=u(e)+"="+u(t):Array.isArray(t)?a=((e,t,r=(o?"":"[]"))=>t.length?h(t.map(((t,i)=>l(n?e+r:e+"["+i+"]",t)))):u(e+r))(e,t):t instanceof Set?a=((e,t)=>h(Array.from(t).map((t=>l(e,t)))))(e,t):"object"===r&&(a=((e,t)=>h(c(t).map((r=>l(s?`${e}.${r}`:`${e}[${r}]`,t[r])))))(e,t)),a);return e&&h(c(e).map((t=>l(t,e[t]))))};async function s(e,t){var r;if(!t.registrationEndpoint)throw new Error("Dynamic Registration could not be completed because the issuer has no registration endpoint.");if(!Array.isArray(t.idTokenSigningAlgValuesSupported))throw new Error("The OIDC issuer discovery profile is missing the 'id_token_signing_alg_values_supported' value, which is mandatory.");const n=(0,i.determineSigningAlg)(t.idTokenSigningAlgValuesSupported,i.PREFERRED_SIGNING_ALG),o={client_name:e.clientName,application_type:"web",redirect_uris:[null===(r=e.redirectUrl)||void 0===r?void 0:r.toString()],subject_type:"pairwise",token_endpoint_auth_method:"client_secret_basic",id_token_signed_response_alg:n},s={"Content-Type":"application/json"};e.registrationAccessToken&&(s.Authorization=`Bearer ${e.registrationAccessToken}`);const a=await fetch(t.registrationEndpoint.toString(),{method:"POST",headers:s,body:JSON.stringify(o)});if(a.ok){const t=await a.json();return function(e,t){if(void 0===e.client_id)throw new Error(`Dynamic client registration failed: no client_id has been found on ${JSON.stringify(e)}`);if(t.redirectUrl&&(void 0===e.redirect_uris||e.redirect_uris[0]!==t.redirectUrl.toString()))throw new Error(`Dynamic client registration failed: the returned redirect URIs ${JSON.stringify(e.redirect_uris)} don't match the provided ${JSON.stringify([t.redirectUrl.toString()])}`)}(t,e),{clientId:t.client_id,clientSecret:t.client_secret,idTokenSignedResponseAlg:t.id_token_signed_response_alg}}throw 400===a.status&&function(e,t){var r,n,i,o;if("invalid_redirect_uri"===e.error)throw new Error(`Dynamic client registration failed: the provided redirect uri [${null===(r=t.redirectUrl)||void 0===r?void 0:r.toString()}] is invalid - ${null!==(n=e.error_description)&&void 0!==n?n:""}`);if("invalid_client_metadata"===e.error)throw new Error(`Dynamic client registration failed: the provided client metadata ${JSON.stringify(t)} is invalid - ${null!==(i=e.error_description)&&void 0!==i?i:""}`);throw new Error(`Dynamic client registration failed: ${e.error} - ${null!==(o=e.error_description)&&void 0!==o?o:""}`)}(await a.json(),e),new Error(`Dynamic client registration failed: the server returned ${a.status} ${a.statusText} - ${await a.text()}`)}async function a(e){let t;try{const r=new n.OidcClient({response_mode:"query",loadUserInfo:!1});if(t=await r.processSigninResponse(e),void 0===r.settings.metadata)throw new Error("Cannot retrieve issuer metadata from client information in storage.");if(void 0===r.settings.metadata.jwks_uri)throw new Error("Missing some issuer metadata from client information in storage: 'jwks_uri' is undefined");if(void 0===r.settings.metadata.issuer)throw new Error("Missing some issuer metadata from client information in storage: 'issuer' is undefined");if(void 0===r.settings.client_id)throw new Error("Missing some client information in storage: 'client_id' is undefined");const o=await(0,i.getWebidFromTokenPayload)(t.id_token,r.settings.metadata.jwks_uri,r.settings.metadata.issuer,r.settings.client_id);return{accessToken:t.access_token,idToken:t.id_token,webId:o,refreshToken:t.refresh_token}}catch(t){throw new Error(`Problem handling Auth Code Grant (Flow) redirect - URL [${e}]: ${t}`)}}async function u(e,t,r){return async function(e,t,r,n){!function(e,t){if(t.grantType&&(!e.grantTypesSupported||!e.grantTypesSupported.includes(t.grantType)))throw new Error(`The issuer [${e.issuer}] does not support the [${t.grantType}] grant`);if(!e.tokenEndpoint)throw new Error(`This issuer [${e.issuer}] does not have a token endpoint`)}(e,r);const s={"content-type":"application/x-www-form-urlencoded"};let a;n&&(a=await(0,i.generateDpopKeyPair)(),s.DPoP=await(0,i.createDpopHeader)(e.tokenEndpoint,"POST",a)),t.clientSecret&&(s.Authorization=`Basic ${btoa(`${t.clientId}:${t.clientSecret}`)}`);const u={method:"POST",headers:s,body:o({grant_type:r.grantType,redirect_uri:r.redirectUrl,code:r.code,code_verifier:r.codeVerifier,client_id:t.clientId})},c=await await fetch(e.tokenEndpoint,u),h=function(e,t){if(void 0!==(r=e).error&&"string"==typeof r.error)throw new Error(`Token endpoint returned error [${e.error}]${function(e){return void 0!==e.error_description&&"string"==typeof e.error_description}(e)?`: ${e.error_description}`:""}${function(e){return void 0!==e.error_uri&&"string"==typeof e.error_uri}(e)?` (see ${e.error_uri})`:""}`);var r;if(!function(e){return void 0!==e.access_token&&"string"==typeof e.access_token}(e))throw new Error(`Invalid token endpoint response (missing the field 'access_token'): ${JSON.stringify(e)}`);if(!function(e){return void 0!==e.id_token&&"string"==typeof e.id_token}(e))throw new Error(`Invalid token endpoint response (missing the field 'id_token'): ${JSON.stringify(e)}.`);if(!function(e){return void 0!==e.token_type&&"string"==typeof e.token_type}(e))throw new Error(`Invalid token endpoint response (missing the field 'token_type'): ${JSON.stringify(e)}`);if(!function(e){return void 0===e.expires_in||"number"==typeof e.expires_in}(e))throw new Error(`Invalid token endpoint response (invalid field 'expires_in'): ${JSON.stringify(e)}`);if(!t&&"bearer"!==e.token_type.toLowerCase())throw new Error(`Invalid token endpoint response: requested a [Bearer] token, but got a 'token_type' value of [${e.token_type}].`);return e}(await c.json(),n),l=await(0,i.getWebidFromTokenPayload)(h.id_token,e.jwksUri,e.issuer,t.clientId);return{accessToken:h.access_token,idToken:h.id_token,refreshToken:(d=h,void 0!==d.refresh_token&&"string"==typeof d.refresh_token?h.refresh_token:void 0),webId:l,dpopKey:a,expiresIn:h.expires_in};var d}(e,t,r,!0)}function c(e){const t=new URL(e);return t.searchParams.delete("code"),t.searchParams.delete("state"),t.hash="",t.toString()}async function h(){const e=new n.OidcClient({response_mode:"query"});await e.clearStaleState(new n.WebStorageStateStore({}));const t=window.localStorage,r=[];for(let e=0;e<=t.length;e+=1){const n=t.key(e);n&&(n.match(/^oidc\..+$/)||n.match(/^solidClientAuthenticationUser:.+$/))&&r.push(n)}r.forEach((e=>t.removeItem(e)))}},143:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(835),i=r(591),o=r(991),s=r(783),a=(e,t)=>window.fetch(e,t);t.default=class{constructor(e,t,r,u,c){this.loginHandler=e,this.redirectHandler=t,this.logoutHandler=r,this.sessionInfoManager=u,this.issuerConfigFetcher=c,this.login=async e=>{var t,r;await this.sessionInfoManager.clear(e.sessionId);const n=i.removeOidcQueryParam(null!==(t=e.redirectUrl)&&void 0!==t?t:window.location.href);await this.loginHandler.handle({...e,redirectUrl:n,clientName:null!==(r=e.clientName)&&void 0!==r?r:e.clientId})},this.fetch=a,this.logout=async e=>{await this.logoutHandler.handle(e),this.fetch=a},this.getSessionInfo=async e=>this.sessionInfoManager.get(e),this.getAllSessionInfo=async()=>this.sessionInfoManager.getAll(),this.validateCurrentSession=async()=>{const e=window.localStorage.getItem(s.KEY_CURRENT_SESSION);if(null===e)return null;const t=await this.sessionInfoManager.get(e);if(void 0===t||void 0===t.idToken||void 0===t.clientAppId||void 0===t.issuer)return null;const r=await this.issuerConfigFetcher.fetchConfig(t.issuer);try{const e=await n.fetchJwks(r.jwksUri,r.issuer);return await o.jwtVerify(t.idToken,await o.parseJwk(e),{audience:t.clientAppId,issuer:r.issuer}),t}catch(e){}return null},this.handleIncomingRedirect=async e=>{const t=await this.redirectHandler.handle(e);this.fetch=t.fetch.bind(window);const r=new URL(e);return r.searchParams.delete("state"),r.searchParams.delete("code"),r.searchParams.delete("id_token"),r.searchParams.delete("access_token"),window.history.replaceState(null,"",r.toString()),{isLoggedIn:t.isLoggedIn,webId:t.webId,sessionId:t.sessionId,expirationDate:t.expirationDate}}}}},598:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Session=t.silentlyAuthenticate=void 0;const n=r(187),i=r(614),o=r(537),s=r(783),a=r(464);async function u(e,t,r={inIframe:!1}){var n;const i=await t.validateCurrentSession();return null!==i&&(window.localStorage.setItem(s.KEY_CURRENT_URL,window.location.href),await t.login({sessionId:e,prompt:"none",oidcIssuer:i.issuer,redirectUrl:i.redirectUrl,clientId:i.clientAppId,clientSecret:i.clientAppSecret,tokenType:null!==(n=i.tokenType)&&void 0!==n?n:"DPoP",inIframe:r.inIframe}),!0)}function c(e){return!!(null==e?void 0:e.isLoggedIn)}t.silentlyAuthenticate=u;class h extends n.EventEmitter{constructor(e={},t){super(),this.tokenRequestInProgress=!1,this.tmpFetchWithCookies=!1,this.login=async e=>{var t;return await this.clientAuthentication.login({sessionId:this.info.sessionId,...e,tokenType:null!==(t=e.tokenType)&&void 0!==t?t:"DPoP"}),new Promise((()=>{}))},this.fetch=async(e,t)=>this.clientAuthentication.fetch(e,{...t,credentials:this.tmpFetchWithCookies?"include":null==t?void 0:t.credentials}),this.logout=async()=>{await this.clientAuthentication.logout(this.info.sessionId),this.info.isLoggedIn=!1,this.tmpFetchWithCookies=!1,this.emit("logout")},this.handleIncomingRedirect=async(e={})=>{var t;if(this.info.isLoggedIn)return this.info;if(this.tokenRequestInProgress)return;const r="string"==typeof e?{url:e}:e,n=null!==(t=r.url)&&void 0!==t?t:window.location.href;if(null!==window.frameElement)return void a.postRedirectUrlToParent(n);!0!==r.useEssSession||!0===r.restorePreviousSession?window.localStorage.setItem("tmp-resource-server-session-enabled","false"):window.localStorage.setItem("tmp-resource-server-session-enabled","true");const i=window.localStorage.getItem("tmp-resource-server-session-info");if("string"==typeof i&&!0!==r.restorePreviousSession&&!0===r.useEssSession){const e=JSON.parse(i);if(function(e){var t;const r=Object.keys(null!==(t=e.sessions)&&void 0!==t?t:{});return"string"==typeof e.webId&&r.length>0&&"number"==typeof e.sessions[r[0]].expiration}(e)){const t=Object.keys(e.sessions),r=new URL(e.webId).hostname,n=t.find((e=>new URL(e).hostname===r)),i=null!=n?n:t[0];if(e.sessions[i].expiration-Date.now()>3e5)return this.info.isLoggedIn=!0,this.info.webId=e.webId,this.tmpFetchWithCookies=!0,this.info}}this.tokenRequestInProgress=!0;const o=await this.clientAuthentication.handleIncomingRedirect(n);if(c(o)){this.setSessionInfo(o);const e=window.localStorage.getItem(s.KEY_CURRENT_URL);null===e?this.emit("login"):(window.localStorage.removeItem(s.KEY_CURRENT_URL),this.emit("sessionRestore",e))}else if(!0===r.restorePreviousSession){const e=window.localStorage.getItem(s.KEY_CURRENT_SESSION);if(null!==e&&await u(e,this.clientAuthentication))return new Promise((()=>{}))}return this.tokenRequestInProgress=!1,o},e.clientAuthentication?this.clientAuthentication=e.clientAuthentication:e.secureStorage&&e.insecureStorage?this.clientAuthentication=o.getClientAuthenticationWithDependencies({secureStorage:e.secureStorage,insecureStorage:e.insecureStorage}):this.clientAuthentication=o.getClientAuthenticationWithDependencies({}),e.sessionInfo?this.info={sessionId:e.sessionInfo.sessionId,isLoggedIn:!1,webId:e.sessionInfo.webId}:this.info={sessionId:null!=t?t:i.v4(),isLoggedIn:!1},a.setupIframeListener((async e=>{const t=await this.clientAuthentication.handleIncomingRedirect(e);c(t)&&this.setSessionInfo(t)})),this.on("tokenRenewal",(()=>u(this.info.sessionId,this.clientAuthentication,{inIframe:!0})))}onLogin(e){this.on("login",e)}onLogout(e){this.on("logout",e)}onSessionRestore(e){this.on("sessionRestore",e)}setSessionInfo(e){this.info.isLoggedIn=e.isLoggedIn,this.info.webId=e.webId,this.info.sessionId=e.sessionId,this.info.expirationDate=e.expirationDate,"number"==typeof e.expirationDate&&setTimeout((async()=>{await this.logout()}),e.expirationDate-Date.now())}}t.Session=h},502:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.buildDpopFetch=t.buildBearerFetch=void 0;const n=r(835);async function i(e,t,r,i){var o;return{...i,headers:{...null==i?void 0:i.headers,Authorization:`DPoP ${t}`,DPoP:await n.createDpopHeader(e,null!==(o=null==i?void 0:i.method)&&void 0!==o?o:"get",r)},credentials:"include"}}t.buildBearerFetch=function(e){return(t,r)=>fetch(t,{...r,credentials:"include",headers:{...null==r?void 0:r.headers,Authorization:`Bearer ${e}`}})},t.buildDpopFetch=async function(e,t){return async(r,n)=>{const o=await fetch(r,await i(r.toString(),e,t,n)),s=!o.ok&&(a=o.status,![401,403].includes(a));var a;const u=o.url!==r;return o.ok||s||!u?o:fetch(o.url,await i(o.url,e,t,n))}}},783:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.KEY_CURRENT_URL=t.KEY_CURRENT_SESSION=void 0;const n=r(835);t.KEY_CURRENT_SESSION=`${n.SOLID_CLIENT_AUTHN_KEY_PREFIX}currentSession`,t.KEY_CURRENT_URL=`${n.SOLID_CLIENT_AUTHN_KEY_PREFIX}currentUrl`},814:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.onSessionRestore=t.onLogout=t.onLogin=t.handleIncomingRedirect=t.logout=t.login=t.fetch=t.getDefaultSession=void 0;const n=r(598);let i;function o(){return void 0===i&&(i=new n.Session),i}t.getDefaultSession=o,t.fetch=(...e)=>o().fetch(...e),t.login=(...e)=>o().login(...e),t.logout=(...e)=>o().logout(...e),t.handleIncomingRedirect=(...e)=>o().handleIncomingRedirect(...e),t.onLogin=(...e)=>o().onLogin(...e),t.onLogout=(...e)=>o().onLogout(...e),t.onSessionRestore=(...e)=>o().onSessionRestore(...e)},537:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.getClientAuthenticationWithDependencies=void 0;const i=r(835),o=n(r(437)),s=n(r(143)),a=n(r(18)),u=n(r(590)),c=n(r(377)),h=r(220),l=n(r(186)),d=r(624),f=r(520),p=n(r(912)),g=n(r(394)),y=n(r(536)),v=n(r(826));t.getClientAuthenticationWithDependencies=function(e){const t=new i.InMemoryStorage,r=e.secureStorage||t,n=e.insecureStorage||new g.default,m=new o.default(r,n),w=new c.default(m),_=new v.default(m),S=new d.SessionInfoManager(m),b=new a.default(m,new u.default(m,new y.default),w,_),E=new p.default([new f.AuthCodeRedirectHandler(m,S,w,_),new h.FallbackRedirectHandler]);return new s.default(b,E,new l.default(S),S,w)}},464:(e,t)=>{"use strict";let r;function n(){return void 0===r&&(r=window.document.createElement("iframe"),r.setAttribute("hidden","true"),r.setAttribute("sandbox","allow-scripts allow-same-origin")),r}Object.defineProperty(t,"__esModule",{value:!0}),t.postRedirectUrlToParent=t.setupIframeListener=t.redirectInIframe=void 0,t.redirectInIframe=function(e){const t=n();window.document.body.appendChild(t),t.src=e},t.setupIframeListener=function(e){"undefined"!=typeof window&&window.addEventListener("message",(async t=>{const r=n();t.origin===window.location.origin&&t.source===r.contentWindow&&"string"==typeof t.data.redirectUrl&&await e(t.data.redirectUrl),window.document.body.contains(r)&&window.document.body.removeChild(r)}))},t.postRedirectUrlToParent=function(e){window.top.postMessage({redirectUrl:e},window.location.origin)}},305: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]}),i=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}),t.InMemoryStorage=t.ConfigurationError=t.NotImplementedError=t.getClientAuthenticationWithDependencies=t.Session=void 0;var o=r(598);Object.defineProperty(t,"Session",{enumerable:!0,get:function(){return o.Session}});var s=r(537);Object.defineProperty(t,"getClientAuthenticationWithDependencies",{enumerable:!0,get:function(){return s.getClientAuthenticationWithDependencies}}),i(r(814),t);var a=r(835);Object.defineProperty(t,"NotImplementedError",{enumerable:!0,get:function(){return a.NotImplementedError}}),Object.defineProperty(t,"ConfigurationError",{enumerable:!0,get:function(){return a.ConfigurationError}}),Object.defineProperty(t,"InMemoryStorage",{enumerable:!0,get:function(){return a.InMemoryStorage}})},826:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(591);t.default=class{constructor(e){this.storageUtility=e}async getClient(e,t){var r;const[i,o]=await Promise.all([this.storageUtility.getForUser(e.sessionId,"clientId",{secure:!1}),this.storageUtility.getForUser(e.sessionId,"clientSecret",{secure:!1})]);if(i)return{clientId:i,clientSecret:o};const s={...e};s.registrationAccessToken=null!==(r=s.registrationAccessToken)&&void 0!==r?r:await this.storageUtility.getForUser(e.sessionId,"registrationAccessToken");try{const e=await n.registerClient(s,t),r={clientId:e.clientId};return e.clientSecret&&(r.clientSecret=e.clientSecret),e.idTokenSignedResponseAlg&&(r.idTokenSignedResponseAlg=e.idTokenSignedResponseAlg),await this.storageUtility.setForUser(s.sessionId,r,{secure:!1}),e}catch(e){throw new Error(`Client registration failed: [${e.toString()}]`)}}}},377:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.WELL_KNOWN_OPENID_CONFIG=void 0;const n=r(835),i=r(226);t.WELL_KNOWN_OPENID_CONFIG=".well-known/openid-configuration";const o={issuer:{toKey:"issuer",convertToUrl:!0},authorization_endpoint:{toKey:"authorizationEndpoint",convertToUrl:!0},token_endpoint:{toKey:"tokenEndpoint",convertToUrl:!0},userinfo_endpoint:{toKey:"userinfoEndpoint",convertToUrl:!0},jwks_uri:{toKey:"jwksUri",convertToUrl:!0},registration_endpoint:{toKey:"registrationEndpoint",convertToUrl:!0},scopes_supported:{toKey:"scopesSupported"},response_types_supported:{toKey:"responseTypesSupported"},response_modes_supported:{toKey:"responseModesSupported"},grant_types_supported:{toKey:"grantTypesSupported"},acr_values_supported:{toKey:"acrValuesSupported"},subject_types_supported:{toKey:"subjectTypesSupported"},id_token_signing_alg_values_supported:{toKey:"idTokenSigningAlgValuesSupported"},id_token_encryption_alg_values_supported:{toKey:"idTokenEncryptionAlgValuesSupported"},id_token_encryption_enc_values_supported:{toKey:"idTokenEncryptionEncValuesSupported"},userinfo_signing_alg_values_supported:{toKey:"userinfoSigningAlgValuesSupported"},userinfo_encryption_alg_values_supported:{toKey:"userinfoEncryptionAlgValuesSupported"},userinfo_encryption_enc_values_supported:{toKey:"userinfoEncryptionEncValuesSupported"},request_object_signing_alg_values_supported:{toKey:"requestObjectSigningAlgValuesSupported"},request_object_encryption_alg_values_supported:{toKey:"requestObjectEncryptionAlgValuesSupported"},request_object_encryption_enc_values_supported:{toKey:"requestObjectEncryptionEncValuesSupported"},token_endpoint_auth_methods_supported:{toKey:"tokenEndpointAuthMethodsSupported"},token_endpoint_auth_signing_alg_values_supported:{toKey:"tokenEndpointAuthSigningAlgValuesSupported"},display_values_supported:{toKey:"displayValuesSupported"},claim_types_supported:{toKey:"claimTypesSupported"},claims_supported:{toKey:"claimsSupported"},service_documentation:{toKey:"serviceDocumentation"},claims_locales_supported:{toKey:"claimsLocalesSupported"},ui_locales_supported:{toKey:"uiLocalesSupported"},claims_parameter_supported:{toKey:"claimsParameterSupported"},request_parameter_supported:{toKey:"requestParameterSupported"},request_uri_parameter_supported:{toKey:"requestUriParameterSupported"},require_request_uri_registration:{toKey:"requireRequestUriRegistration"},op_policy_uri:{toKey:"opPolicyUri",convertToUrl:!0},op_tos_uri:{toKey:"opTosUri",convertToUrl:!0},solid_oidc_supported:{toKey:"solidOidcSupported"}};class s{constructor(e){this.storageUtility=e}static getLocalStorageKey(e){return`issuerConfig:${e}`}async fetchConfig(e){let r;const a=i.appendToUrlPathname(e,t.WELL_KNOWN_OPENID_CONFIG),u=await window.fetch(a);try{r=function(e){const t={};return Object.keys(e).forEach((r=>{o[r]&&(t[o[r].toKey]=e[r])})),t}(await u.json())}catch(t){throw new n.ConfigurationError(`[${e.toString()}] has an invalid configuration: ${t.message}`)}return await this.storageUtility.set(s.getLocalStorageKey(e),JSON.stringify(r)),r}}t.default=s},18:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(835);function i(e){return"string"==typeof e.oidcIssuer}function o(e){return"string"==typeof e.redirectUrl}t.default=class{constructor(e,t,r,n){this.storageUtility=e,this.oidcHandler=t,this.issuerConfigFetcher=r,this.clientRegistrar=n}async canHandle(e){return i(e)&&o(e)}async handle(e){if(!i(e))throw new n.ConfigurationError(`OidcLoginHandler requires an OIDC issuer: missing property 'oidcIssuer' in ${JSON.stringify(e)}`);if(!o(e))throw new n.ConfigurationError(`OidcLoginHandler requires a redirect URL: missing property 'redirectUrl' in ${JSON.stringify(e)}`);const t=await this.issuerConfigFetcher.fetchConfig(e.oidcIssuer),r=await n.handleRegistration(e,t,this.storageUtility,this.clientRegistrar),s={issuer:t.issuer,dpop:"dpop"===e.tokenType.toLowerCase(),...e,issuerConfiguration:t,client:r};return this.oidcHandler.handle(s)}}},536:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(464);t.default=class{redirect(e,t){t&&t.handleRedirect?t.handleRedirect(e):t&&t.redirectByReplacingState?window.history.replaceState({},"",e):(null==t?void 0:t.redirectInIframe)?n.redirectInIframe(e):window.location.href=e}}},590:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(591);t.default=class{constructor(e,t){this.storageUtility=e,this.redirector=t}async canHandle(e){return!!(e.issuerConfiguration.grantTypesSupported&&e.issuerConfiguration.grantTypesSupported.indexOf("authorization_code")>-1)}async handle(e){const t={authority:e.issuer.toString(),client_id:e.client.clientId,client_secret:e.client.clientSecret,redirect_uri:e.redirectUrl.toString(),post_logout_redirect_uri:e.redirectUrl.toString(),response_type:"code",scope:"openid webid",filterProtocolClaims:!0,loadUserInfo:!1,code_verifier:!0,prompt:e.prompt},r=new n.OidcClient(t),{redirector:i}=this,o=this.storageUtility;try{const t=await r.createSigninRequest();await Promise.all([o.setForUser(t.state._id,{sessionId:e.sessionId}),o.setForUser(e.sessionId,{codeVerifier:t.state._code_verifier,issuer:e.issuer.toString(),redirectUrl:e.redirectUrl,dpop:e.dpop?"true":"false"})]),i.redirect(t.url.toString(),{handleRedirect:e.handleRedirect,redirectInIframe:e.inIframe})}catch(e){console.error(e)}}}},912:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(835);class i extends n.AggregateHandler{constructor(e){super(e)}}t.default=i},520:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AuthCodeRedirectHandler=t.DEFAULT_LIFESPAN=void 0;const n=r(591),i=r(502),o=r(783);t.DEFAULT_LIFESPAN=18e5,t.AuthCodeRedirectHandler=class{constructor(e,t,r,n){this.storageUtility=e,this.sessionInfoManager=t,this.issuerConfigFetcher=r,this.clientRegistrar=n}async canHandle(e){try{const t=new URL(e);return null!==t.searchParams.get("code")&&null!==t.searchParams.get("state")}catch(t){throw new Error(`[${e}] is not a valid URL, and cannot be used as a redirect URL: ${t.toString()}`)}}async handle(e){if(!await this.canHandle(e))throw new Error(`AuthCodeRedirectHandler cannot handle [${e}]: it is missing one of [code, state].`);const r=new URL(e),s=r.searchParams.get("state"),a=await this.storageUtility.getForUser(s,"sessionId",{errorIfNull:!0}),u="true"===await this.storageUtility.getForUser(a,"dpop"),c=await this.storageUtility.getForUser(a,"issuer",{errorIfNull:!0});window.localStorage.setItem(o.KEY_CURRENT_SESSION,a);const h=await this.issuerConfigFetcher.fetchConfig(c),l=await this.clientRegistrar.getClient({sessionId:a},h);let d,f;const p=Date.now();if(u){const e=await this.storageUtility.getForUser(a,"codeVerifier",{errorIfNull:!0}),t=await this.storageUtility.getForUser(a,"redirectUrl",{errorIfNull:!0});d=await n.getDpopToken(h,l,{grantType:"authorization_code",code:r.searchParams.get("code"),codeVerifier:e,redirectUrl:t}),f=await i.buildDpopFetch(d.accessToken,d.dpopKey)}else d=await n.getBearerToken(r.toString()),f=i.buildBearerFetch(d.accessToken);await this.storageUtility.setForUser(a,{refreshToken:"<Refresh token that *is* coming back in the redirect URL is not yet being parsed and provided by oidc-client-js in it's response object>",webId:d.webId,isLoggedIn:"true"},{secure:!0}),r.searchParams.delete("code"),await this.storageUtility.setForUser(a,{redirectUrl:r.toString(),idToken:d.idToken},{secure:!1}),"false"===window.localStorage.getItem("tmp-resource-server-session-enabled")||await async function(e,r,n){const i=new URL(e).origin;await r(e);try{if(200===(await r(`${i}/session`)).status)return void await n.storeResourceServerSessionInfo(e,i,Date.now()+t.DEFAULT_LIFESPAN);await n.clearResourceServerSessionInfo(i)}catch(e){await n.clearResourceServerSessionInfo(i)}}(d.webId,f,this.storageUtility);const g=await this.sessionInfoManager.get(a);if(!g)throw new Error(`Could not retrieve session: [${a}].`);return Object.assign(g,{fetch:f,expirationDate:"number"==typeof d.expiresIn?p+1e3*d.expiresIn:null})}}},220:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FallbackRedirectHandler=void 0;const n=r(624);t.FallbackRedirectHandler=class{async canHandle(e){try{return new URL(e),!0}catch(t){throw new Error(`[${e}] is not a valid URL, and cannot be used as a redirect URL: ${t.toString()}`)}}async handle(e){return n.getUnauthenticatedSession()}}},186:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=class{constructor(e){this.sessionInfoManager=e}async canHandle(){return!0}async handle(e){await this.sessionInfoManager.clear(e)}}},624:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SessionInfoManager=t.clear=t.getUnauthenticatedSession=void 0;const n=r(835),i=r(614),o=r(591);async function s(e,t){const r=await t.get("tmp-resource-server-session-info"),n=JSON.parse(null!=r?r:"{}"),{webId:i}=n;if(void 0!==i){const e=new URL(i).origin;await t.clearResourceServerSessionInfo(e)}await Promise.all([t.deleteAllUserData(e,{secure:!1}),t.deleteAllUserData(e,{secure:!0}),t.delete("clientKey",{secure:!1})]),await o.clearOidcPersistentStorage()}t.getUnauthenticatedSession=function(){return{isLoggedIn:!1,sessionId:i.v4(),fetch}},t.clear=s,t.SessionInfoManager=class{constructor(e){this.storageUtility=e}update(e,t){throw new Error("Not Implemented")}async get(e){var t;const r=await this.storageUtility.getForUser(e,"isLoggedIn",{secure:!0}),i=await this.storageUtility.getForUser(e,"webId",{secure:!0}),o=await this.storageUtility.getForUser(e,"clientId",{secure:!1}),s=await this.storageUtility.getForUser(e,"clientSecret",{secure:!1}),a=await this.storageUtility.getForUser(e,"idToken",{secure:!1}),u=await this.storageUtility.getForUser(e,"redirectUrl",{secure:!1}),c=await this.storageUtility.getForUser(e,"refreshToken",{secure:!0}),h=await this.storageUtility.getForUser(e,"issuer",{secure:!1}),l=null!==(t=await this.storageUtility.getForUser(e,"tokenType",{secure:!1}))&&void 0!==t?t:"DPoP";if(!n.isSupportedTokenType(l))throw new Error(`Tokens of type [${l}] are not supported.`);if(void 0!==o||void 0!==a||void 0!==r||void 0!==i||void 0!==c)return{sessionId:e,webId:i,isLoggedIn:"true"===r,redirectUrl:u,idToken:a,refreshToken:c,issuer:h,clientAppId:o,clientAppSecret:s,tokenType:l}}async getAll(){throw new Error("Not implemented")}async clear(e){return s(e,this.storageUtility)}async register(e){throw new Error("Not implemented")}async getRegisteredSessionIdAll(){throw new Error("Not implemented")}async clearAll(){throw new Error("Not implemented")}}},394:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=class{get storage(){return window.localStorage}async get(e){return this.storage.getItem(e)||void 0}async set(e,t){this.storage.setItem(e,t)}async delete(e){this.storage.removeItem(e)}}},437:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(835);class i extends n.StorageUtility{constructor(e,t){super(e,t)}}t.default=i},226:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.appendToUrlPathname=void 0,t.appendToUrlPathname=function(e,t){const r=new URL(e),n=r.pathname;return r.pathname=`${n}${n.endsWith("/")?"":"/"}${t.startsWith("/")?t.substring(1):t}`,r.toString()}},155:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.generateDpopKeyPair=t.createDpopHeader=void 0;const n=r(991),i=r(614);function o(e){const t=new URL(e);return t.hash="",t.username="",t.password="",t.toString()}t.createDpopHeader=async function(e,t,r){return new n.SignJWT({htu:o(e),htm:t.toUpperCase(),jti:i.v4()}).setProtectedHeader({alg:"ES256",jwk:r.publicKey,typ:"dpop+jwt"}).setIssuedAt().sign(r.privateKey,{})},t.generateDpopKeyPair=async function(){const{privateKey:e,publicKey:t}=await n.generateKeyPair("ES256"),r={privateKey:e,publicKey:await n.fromKeyLike(t)};return r.publicKey.alg="ES256",r}},672:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PREFERRED_SIGNING_ALG=t.SOLID_CLIENT_AUTHN_KEY_PREFIX=void 0,t.SOLID_CLIENT_AUTHN_KEY_PREFIX="solidClientAuthn:",t.PREFERRED_SIGNING_ALG=["ES256","RS256"]},117:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});class r extends Error{constructor(e){super(e)}}t.default=r},29:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});class r extends Error{constructor(e,t,n=!0){super("string"==typeof e?r.substituteParams(e,t):r.appendErrorIri(r.lookupErrorIri(e,t),e,n))}httpResponse(e,t=!0){return this.message=r.appendHttpResponseDetails(this.message,e,t),this.httpErrorResponse=e,this}hasHttpResponse(){return void 0!==this.httpErrorResponse}getHttpResponse(){return this.httpErrorResponse}getHttpStatusCode(){if(void 0===this.httpErrorResponse)throw new r("This InruptError was not provided with a HTTP response - so we can't get its HTTP Status Code.");return this.httpErrorResponse.status}getHttpStatusText(){if(void 0===this.httpErrorResponse)throw new r("This InruptError was not provided with a HTTP response - so we can't get its HTTP Status Text!");return this.httpErrorResponse.statusText}static determineIfVocabTerm(e){return void 0!==e.strict}static lookupErrorIri(e,t){if(r.determineIfVocabTerm(e)){const r=void 0===t?e.message:e.messageParams(...t);return void 0===r?`Looked up error message IRI [${e.value}], but found no message value.`:r}return`Error message looked up at: [${e.value}]${void 0===t?"":`, with params [${t.toString()}]`}`}static appendHttpResponseDetails(e,t,r){return r&&void 0!==t?`${e} HTTP details: status code [${t.status}], status text [${t.statusText}].`:e}static appendErrorIri(e,t,r){return r?`${e} Error IRI: [${t.value}].`:e}static substituteParams(e,t){let r=e;if(void 0!==t){const n=e.split("{{").length-1;if(n!==t.length)throw new Error(`Setting parameters on message [${e}], but it requires [${n}] params and we received [${t.length}].`);for(let e=0;e<t.length;e+=1){const n=`{{${e}}}`;r=r.replace(n,t[e])}}return r}}t.default=r},73:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});class r extends Error{constructor(e){super(`[${e}] is not implemented`)}}t.default=r},835: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]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)},o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.StorageUtilityGetResponse=t.StorageUtilityMock=t.mockStorageUtility=t.mockStorage=t.generateDpopKeyPair=t.createDpopHeader=t.NotImplementedError=t.ConfigurationError=t.InMemoryStorage=t.getSessionIdFromOauthState=t.saveSessionInfoToStorage=t.loadOidcContextFromStorage=t.StorageUtility=t.determineSigningAlg=t.handleRegistration=t.USER_SESSION_PREFIX=t.isSupportedTokenType=t.fetchJwks=t.getWebidFromTokenPayload=t.AggregateHandler=void 0,i(r(672),t);var s=r(24);Object.defineProperty(t,"AggregateHandler",{enumerable:!0,get:function(){return o(s).default}});var a=r(528);Object.defineProperty(t,"getWebidFromTokenPayload",{enumerable:!0,get:function(){return a.getWebidFromTokenPayload}}),Object.defineProperty(t,"fetchJwks",{enumerable:!0,get:function(){return a.fetchJwks}});var u=r(168);Object.defineProperty(t,"isSupportedTokenType",{enumerable:!0,get:function(){return u.isSupportedTokenType}});var c=r(645);Object.defineProperty(t,"USER_SESSION_PREFIX",{enumerable:!0,get:function(){return c.USER_SESSION_PREFIX}});var h=r(725);Object.defineProperty(t,"handleRegistration",{enumerable:!0,get:function(){return h.handleRegistration}}),Object.defineProperty(t,"determineSigningAlg",{enumerable:!0,get:function(){return h.determineSigningAlg}});var l=r(574);Object.defineProperty(t,"StorageUtility",{enumerable:!0,get:function(){return o(l).default}}),Object.defineProperty(t,"loadOidcContextFromStorage",{enumerable:!0,get:function(){return l.loadOidcContextFromStorage}}),Object.defineProperty(t,"saveSessionInfoToStorage",{enumerable:!0,get:function(){return l.saveSessionInfoToStorage}}),Object.defineProperty(t,"getSessionIdFromOauthState",{enumerable:!0,get:function(){return l.getSessionIdFromOauthState}});var d=r(244);Object.defineProperty(t,"InMemoryStorage",{enumerable:!0,get:function(){return o(d).default}});var f=r(117);Object.defineProperty(t,"ConfigurationError",{enumerable:!0,get:function(){return o(f).default}});var p=r(73);Object.defineProperty(t,"NotImplementedError",{enumerable:!0,get:function(){return o(p).default}});var g=r(155);Object.defineProperty(t,"createDpopHeader",{enumerable:!0,get:function(){return g.createDpopHeader}}),Object.defineProperty(t,"generateDpopKeyPair",{enumerable:!0,get:function(){return g.generateDpopKeyPair}});var y=r(478);Object.defineProperty(t,"mockStorage",{enumerable:!0,get:function(){return y.mockStorage}}),Object.defineProperty(t,"mockStorageUtility",{enumerable:!0,get:function(){return y.mockStorageUtility}}),Object.defineProperty(t,"StorageUtilityMock",{enumerable:!0,get:function(){return y.StorageUtilityMock}}),Object.defineProperty(t,"StorageUtilityGetResponse",{enumerable:!0,get:function(){return y.StorageUtilityGetResponse}})},725:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.handleRegistration=t.determineSigningAlg=void 0,t.determineSigningAlg=function(e,t){var r;return null!==(r=t.find((t=>e.includes(t))))&&void 0!==r?r:null},t.handleRegistration=async function(e,t,r,n){return void 0===e.clientId||"https://solidproject.org/TR/solid-oidc"!==t.solidOidcSupported&&function(e){try{return new URL(e),!0}catch(e){return!1}}(e.clientId)?n.getClient({sessionId:e.sessionId,clientName:e.clientName,redirectUrl:e.redirectUrl},t):(await r.setForUser(e.sessionId,{clientId:e.clientId}),e.clientSecret&&await r.setForUser(e.sessionId,{clientSecret:e.clientSecret}),e.clientName&&await r.setForUser(e.sessionId,{clientName:e.clientName}),{clientId:e.clientId,clientSecret:e.clientSecret,clientName:e.clientName})}},528:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getWebidFromTokenPayload=t.fetchJwks=void 0;const n=r(98),i=r(991);async function o(e,t){const r=await n.fetch(e);if(200!==r.status)throw new Error(`Could not fetch JWKS for [${t}] at [${e}]: ${r.status} ${r.statusText}`);let i;try{i=(await r.json()).keys[0]}catch(r){throw new Error(`Malformed JWKS for [${t}] at [${e}]: ${r.message}`)}return i}t.fetchJwks=o,t.getWebidFromTokenPayload=async function(e,t,r,n){const s=await o(t,r);let a;try{const{payload:t}=await i.jwtVerify(e,await i.parseJwk(s),{issuer:r,audience:n});a=t}catch(e){throw new Error(`ID token verification failed: ${e.stack}`)}if("string"==typeof a.webid)return a.webid;if("string"!=typeof a.sub)throw new Error(`The ID token ${JSON.stringify(a)} is invalid: it has no 'webid' claim and no 'sub' claim.`);try{return new URL(a.sub),a.sub}catch(e){throw new Error(`The ID token has no 'webid' claim, and its 'sub' claim of [${a.sub}] is invalid as a URL - error [${e}].`)}}},168:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isSupportedTokenType=void 0,t.isSupportedTokenType=function(e){return"string"==typeof e&&["DPoP","Bearer"].includes(e)}},645:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.USER_SESSION_PREFIX=void 0,t.USER_SESSION_PREFIX="solidClientAuthenticationUser"},244:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=class{constructor(){this.map={}}async get(e){return this.map[e]||void 0}async set(e,t){this.map[e]=t}async delete(e){delete this.map[e]}}},574:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.saveSessionInfoToStorage=t.loadOidcContextFromStorage=t.getSessionIdFromOauthState=void 0;const i=n(r(29));t.getSessionIdFromOauthState=async function(e,t){return e.getForUser(t,"sessionId")},t.loadOidcContextFromStorage=async function(e,t,r){try{const[n,i,o,s]=await Promise.all([t.getForUser(e,"issuer",{errorIfNull:!0}),t.getForUser(e,"codeVerifier"),t.getForUser(e,"redirectUrl"),t.getForUser(e,"dpop",{errorIfNull:!0})]);return{codeVerifier:i,redirectUrl:o,issuerConfig:await r.fetchConfig(n),dpop:"true"===s}}catch(t){throw new Error(`Failed to retrieve OIDC context from storage associated with session [${e}]: ${t.toString()}`)}},t.saveSessionInfoToStorage=async function(e,t,r,n,i,o,s){void 0!==o&&await e.setForUser(t,{refreshToken:o},{secure:s}),void 0!==r&&await e.setForUser(t,{idToken:r},{secure:s}),void 0!==n&&await e.setForUser(t,{webId:n},{secure:s}),void 0!==i&&await e.setForUser(t,{isLoggedIn:i},{secure:s})},t.default=class{constructor(e,t){this.secureStorage=e,this.insecureStorage=t,this.RESOURCE_SERVER_SESSION_INFORMATION_KEY="tmp-resource-server-session-info"}getKey(e){return`solidClientAuthenticationUser:${e}`}async getUserData(e,t){const r=await(t?this.secureStorage:this.insecureStorage).get(this.getKey(e));if(void 0===r)return{};try{return JSON.parse(r)}catch(n){throw new i.default(`Data for user [${e}] in [${t?"secure":"unsecure"}] storage is corrupted - expected valid JSON, but got: ${r}`)}}async setUserData(e,t,r){await(r?this.secureStorage:this.insecureStorage).set(this.getKey(e),JSON.stringify(t))}async get(e,t){const r=await((null==t?void 0:t.secure)?this.secureStorage:this.insecureStorage).get(e);if(void 0===r&&(null==t?void 0:t.errorIfNull))throw new i.default(`[${e}] is not stored`);return r}async set(e,t,r){return((null==r?void 0:r.secure)?this.secureStorage:this.insecureStorage).set(e,t)}async delete(e,t){return((null==t?void 0:t.secure)?this.secureStorage:this.insecureStorage).delete(e)}async getForUser(e,t,r){const n=await this.getUserData(e,null==r?void 0:r.secure);let o;if(n&&n[t]||(o=void 0),o=n[t],void 0===o&&(null==r?void 0:r.errorIfNull))throw new i.default(`Field [${t}] for user [${e}] is not stored`);return o||void 0}async setForUser(e,t,r){let n;try{n=await this.getUserData(e,null==r?void 0:r.secure)}catch(e){n={}}await this.setUserData(e,{...n,...t},null==r?void 0:r.secure)}async deleteForUser(e,t,r){const n=await this.getUserData(e,null==r?void 0:r.secure);delete n[t],await this.setUserData(e,n,null==r?void 0:r.secure)}async deleteAllUserData(e,t){await((null==t?void 0:t.secure)?this.secureStorage:this.insecureStorage).delete(this.getKey(e))}async storeResourceServerSessionInfo(e,t,r){var n;const i=JSON.parse(null!==(n=await this.insecureStorage.get(this.RESOURCE_SERVER_SESSION_INFORMATION_KEY))&&void 0!==n?n:"{}");i.webId!==e&&(i.sessions={}),i.webId=e,i.sessions[t]={expiration:r},await this.insecureStorage.set(this.RESOURCE_SERVER_SESSION_INFORMATION_KEY,JSON.stringify(i))}async clearResourceServerSessionInfo(e){var t;const r=JSON.parse(null!==(t=await this.insecureStorage.get(this.RESOURCE_SERVER_SESSION_INFORMATION_KEY))&&void 0!==t?t:"{}");void 0!==r.sessions&&(delete r.sessions[e],0===Object.keys(r.sessions).length?await this.insecureStorage.set(this.RESOURCE_SERVER_SESSION_INFORMATION_KEY,"{}"):await this.insecureStorage.set(this.RESOURCE_SERVER_SESSION_INFORMATION_KEY,JSON.stringify(r)))}}},478:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.mockStorageUtility=t.mockStorage=t.StorageUtilityMock=t.StorageUtilityGetResponse=void 0;const n=r(835);t.StorageUtilityGetResponse="getResponse",t.StorageUtilityMock={get:async(e,r)=>t.StorageUtilityGetResponse,set:async(e,t)=>{},delete:async e=>{},getForUser:async(e,r,n)=>t.StorageUtilityGetResponse,setForUser:async(e,t,r)=>{},deleteForUser:async(e,t,r)=>{},deleteAllUserData:async(e,t)=>{},storeResourceServerSessionInfo:async(e,t,r)=>{},clearResourceServerSessionInfo:async e=>{}},t.mockStorage=e=>{const t=e;return{get:async e=>{if(void 0!==t[e])return"string"==typeof t[e]?t[e]:JSON.stringify(t[e])},set:async(e,r)=>{t[e]=r},delete:async e=>{delete t[e]}}},t.mockStorageUtility=(e,r=!1)=>r?new n.StorageUtility(t.mockStorage(e),t.mockStorage({})):new n.StorageUtility(t.mockStorage({}),t.mockStorage(e))},24:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const i=n(r(29));t.default=class{constructor(e){this.handleables=e}async getProperHandler(e){const t=await Promise.all(this.handleables.map((t=>t.canHandle(...e))));for(let e=0;e<t.length;e+=1)if(t[e])return this.handleables[e];return null}async canHandle(...e){return null!==await this.getProperHandler(e)}async handle(...e){const t=await this.getProperHandler(e);if(t)return t.handle(...e);throw new i.default(`[${this.constructor.name}] cannot find a suitable handler for: ${e.map((e=>{try{return JSON.stringify(e)}catch(t){return e.toString()}})).join(", ")}`)}}},98:function(e,t){var r="undefined"!=typeof self?self:this,n=function(){function e(){this.fetch=!1,this.DOMException=r.DOMException}return e.prototype=r,new e}();!function(e){!function(t){var r="URLSearchParams"in e,n="Symbol"in e&&"iterator"in Symbol,i="FileReader"in e&&"Blob"in e&&function(){try{return new Blob,!0}catch(e){return!1}}(),o="FormData"in e,s="ArrayBuffer"in e;if(s)var a=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],u=ArrayBuffer.isView||function(e){return e&&a.indexOf(Object.prototype.toString.call(e))>-1};function c(e){if("string"!=typeof e&&(e=String(e)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(e))throw new TypeError("Invalid character in header field name");return e.toLowerCase()}function h(e){return"string"!=typeof e&&(e=String(e)),e}function l(e){var t={next:function(){var t=e.shift();return{done:void 0===t,value:t}}};return n&&(t[Symbol.iterator]=function(){return t}),t}function d(e){this.map={},e instanceof d?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 f(e){if(e.bodyUsed)return Promise.reject(new TypeError("Already read"));e.bodyUsed=!0}function p(e){return new Promise((function(t,r){e.onload=function(){t(e.result)},e.onerror=function(){r(e.error)}}))}function g(e){var t=new FileReader,r=p(t);return t.readAsArrayBuffer(e),r}function y(e){if(e.slice)return e.slice(0);var t=new Uint8Array(e.byteLength);return t.set(new Uint8Array(e)),t.buffer}function v(){return this.bodyUsed=!1,this._initBody=function(e){var t;this._bodyInit=e,e?"string"==typeof e?this._bodyText=e:i&&Blob.prototype.isPrototypeOf(e)?this._bodyBlob=e:o&&FormData.prototype.isPrototypeOf(e)?this._bodyFormData=e:r&&URLSearchParams.prototype.isPrototypeOf(e)?this._bodyText=e.toString():s&&i&&(t=e)&&DataView.prototype.isPrototypeOf(t)?(this._bodyArrayBuffer=y(e.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):s&&(ArrayBuffer.prototype.isPrototypeOf(e)||u(e))?this._bodyArrayBuffer=y(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):r&&URLSearchParams.prototype.isPrototypeOf(e)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},i&&(this.blob=function(){var e=f(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?f(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(g)}),this.text=function(){var e,t,r,n=f(this);if(n)return n;if(this._bodyBlob)return e=this._bodyBlob,r=p(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)},o&&(this.formData=function(){return this.text().then(_)}),this.json=function(){return this.text().then(JSON.parse)},this}d.prototype.append=function(e,t){e=c(e),t=h(t);var r=this.map[e];this.map[e]=r?r+", "+t:t},d.prototype.delete=function(e){delete this.map[c(e)]},d.prototype.get=function(e){return e=c(e),this.has(e)?this.map[e]:null},d.prototype.has=function(e){return this.map.hasOwnProperty(c(e))},d.prototype.set=function(e,t){this.map[c(e)]=h(t)},d.prototype.forEach=function(e,t){for(var r in this.map)this.map.hasOwnProperty(r)&&e.call(t,this.map[r],r,this)},d.prototype.keys=function(){var e=[];return this.forEach((function(t,r){e.push(r)})),l(e)},d.prototype.values=function(){var e=[];return this.forEach((function(t){e.push(t)})),l(e)},d.prototype.entries=function(){var e=[];return this.forEach((function(t,r){e.push([r,t])})),l(e)},n&&(d.prototype[Symbol.iterator]=d.prototype.entries);var m=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function w(e,t){var r,n,i=(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 d(e.headers)),this.method=e.method,this.mode=e.mode,this.signal=e.signal,i||null==e._bodyInit||(i=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 d(t.headers)),this.method=(n=(r=t.method||this.method||"GET").toUpperCase(),m.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)&&i)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(i)}function _(e){var t=new FormData;return e.trim().split("&").forEach((function(e){if(e){var r=e.split("="),n=r.shift().replace(/\+/g," "),i=r.join("=").replace(/\+/g," ");t.append(decodeURIComponent(n),decodeURIComponent(i))}})),t}function S(e,t){t||(t={}),this.type="default",this.status=void 0===t.status?200:t.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in t?t.statusText:"OK",this.headers=new d(t.headers),this.url=t.url||"",this._initBody(e)}w.prototype.clone=function(){return new w(this,{body:this._bodyInit})},v.call(w.prototype),v.call(S.prototype),S.prototype.clone=function(){return new S(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new d(this.headers),url:this.url})},S.error=function(){var e=new S(null,{status:0,statusText:""});return e.type="error",e};var b=[301,302,303,307,308];S.redirect=function(e,t){if(-1===b.indexOf(t))throw new RangeError("Invalid status code");return new S(null,{status:t,headers:{location:e}})},t.DOMException=e.DOMException;try{new t.DOMException}catch(e){t.DOMException=function(e,t){this.message=e,this.name=t;var r=Error(e);this.stack=r.stack},t.DOMException.prototype=Object.create(Error.prototype),t.DOMException.prototype.constructor=t.DOMException}function E(e,r){return new Promise((function(n,o){var s=new w(e,r);if(s.signal&&s.signal.aborted)return o(new t.DOMException("Aborted","AbortError"));var a=new XMLHttpRequest;function u(){a.abort()}a.onload=function(){var e,t,r={status:a.status,statusText:a.statusText,headers:(e=a.getAllResponseHeaders()||"",t=new d,e.replace(/\r?\n[\t ]+/g," ").split(/\r?\n/).forEach((function(e){var r=e.split(":"),n=r.shift().trim();if(n){var i=r.join(":").trim();t.append(n,i)}})),t)};r.url="responseURL"in a?a.responseURL:r.headers.get("X-Request-URL");var i="response"in a?a.response:a.responseText;n(new S(i,r))},a.onerror=function(){o(new TypeError("Network request failed"))},a.ontimeout=function(){o(new TypeError("Network request failed"))},a.onabort=function(){o(new t.DOMException("Aborted","AbortError"))},a.open(s.method,s.url,!0),"include"===s.credentials?a.withCredentials=!0:"omit"===s.credentials&&(a.withCredentials=!1),"responseType"in a&&i&&(a.responseType="blob"),s.headers.forEach((function(e,t){a.setRequestHeader(t,e)})),s.signal&&(s.signal.addEventListener("abort",u),a.onreadystatechange=function(){4===a.readyState&&s.signal.removeEventListener("abort",u)}),a.send(void 0===s._bodyInit?null:s._bodyInit)}))}E.polyfill=!0,e.fetch||(e.fetch=E,e.Headers=d,e.Request=w,e.Response=S),t.Headers=d,t.Request=w,t.Response=S,t.fetch=E,Object.defineProperty(t,"__esModule",{value:!0})}({})}(n),n.fetch.ponyfill=!0,delete n.fetch.polyfill;var i=n;(t=i.fetch).default=i.fetch,t.fetch=i.fetch,t.Headers=i.Headers,t.Request=i.Request,t.Response=i.Response,e.exports=t},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 i=Number.isNaN||function(e){return e!=e};function o(){o.init.call(this)}e.exports=o,e.exports.once=function(e,t){return new Promise((function(r,n){function i(){void 0!==o&&e.removeListener("error",o),r([].slice.call(arguments))}var o;"error"!==t&&(o=function(r){e.removeListener(t,i),n(r)},e.once("error",o)),e.once(t,i)}))},o.EventEmitter=o,o.prototype._events=void 0,o.prototype._eventsCount=0,o.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?o.defaultMaxListeners:e._maxListeners}function c(e,t,r,n){var i,o,s,c;if(a(r),void 0===(o=e._events)?(o=e._events=Object.create(null),e._eventsCount=0):(void 0!==o.newListener&&(e.emit("newListener",t,r.listener?r.listener:r),o=e._events),s=o[t]),void 0===s)s=o[t]=r,++e._eventsCount;else if("function"==typeof s?s=o[t]=n?[r,s]:[s,r]:n?s.unshift(r):s.push(r),(i=u(e))>0&&s.length>i&&!s.warned){s.warned=!0;var h=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");h.name="MaxListenersExceededWarning",h.emitter=e,h.type=t,h.count=s.length,c=h,console&&console.warn&&console.warn(c)}return e}function h(){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 l(e,t,r){var n={fired:!1,wrapFn:void 0,target:e,type:t,listener:r},i=h.bind(n);return i.listener=r,n.wrapFn=i,i}function d(e,t,r){var n=e._events;if(void 0===n)return[];var i=n[t];return void 0===i?[]:"function"==typeof i?r?[i.listener||i]:[i]: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}(i):p(i,i.length)}function f(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 p(e,t){for(var r=new Array(t),n=0;n<t;++n)r[n]=e[n];return r}Object.defineProperty(o,"defaultMaxListeners",{enumerable:!0,get:function(){return s},set:function(e){if("number"!=typeof e||e<0||i(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");s=e}}),o.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},o.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||i(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},o.prototype.getMaxListeners=function(){return u(this)},o.prototype.emit=function(e){for(var t=[],r=1;r<arguments.length;r++)t.push(arguments[r]);var i="error"===e,o=this._events;if(void 0!==o)i=i&&void 0===o.error;else if(!i)return!1;if(i){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=o[e];if(void 0===u)return!1;if("function"==typeof u)n(u,this,t);else{var c=u.length,h=p(u,c);for(r=0;r<c;++r)n(h[r],this,t)}return!0},o.prototype.addListener=function(e,t){return c(this,e,t,!1)},o.prototype.on=o.prototype.addListener,o.prototype.prependListener=function(e,t){return c(this,e,t,!0)},o.prototype.once=function(e,t){return a(t),this.on(e,l(this,e,t)),this},o.prototype.prependOnceListener=function(e,t){return a(t),this.prependListener(e,l(this,e,t)),this},o.prototype.removeListener=function(e,t){var r,n,i,o,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(i=-1,o=r.length-1;o>=0;o--)if(r[o]===t||r[o].listener===t){s=r[o].listener,i=o;break}if(i<0)return this;0===i?r.shift():function(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}(r,i),1===r.length&&(n[e]=r[0]),void 0!==n.removeListener&&this.emit("removeListener",e,s||t)}return this},o.prototype.off=o.prototype.removeListener,o.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 i,o=Object.keys(r);for(n=0;n<o.length;++n)"removeListener"!==(i=o[n])&&this.removeAllListeners(i);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},o.prototype.listeners=function(e){return d(this,e,!0)},o.prototype.rawListeners=function(e){return d(this,e,!1)},o.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):f.call(e,t)},o.prototype.listenerCount=f,o.prototype.eventNames=function(){return this._eventsCount>0?t(this._events):[]}},671:function(e){var t;t=function(){return function(e){var t={};function r(n){if(t[n])return t[n].exports;var i=t[n]={i:n,l:!1,exports:{}};return e[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)r.d(n,i,function(t){return e[t]}.bind(null,i));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=22)}([function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),i={debug:function(){},info:function(){},warn:function(){},error:function(){}},o=void 0,s=void 0;(t.Log=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}return e.reset=function(){s=3,o=i},e.debug=function(){if(s>=4){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];o.debug.apply(o,Array.from(t))}},e.info=function(){if(s>=3){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];o.info.apply(o,Array.from(t))}},e.warn=function(){if(s>=2){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];o.warn.apply(o,Array.from(t))}},e.error=function(){if(s>=1){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];o.error.apply(o,Array.from(t))}},n(e,null,[{key:"NONE",get:function(){return 0}},{key:"ERROR",get:function(){return 1}},{key:"WARN",get:function(){return 2}},{key:"INFO",get:function(){return 3}},{key:"DEBUG",get:function(){return 4}},{key:"level",get:function(){return s},set:function(e){if(!(0<=e&&e<=4))throw new Error("Invalid log level");s=e}},{key:"logger",get:function(){return o},set:function(e){if(!e.debug&&e.info&&(e.debug=e.info),!(e.debug&&e.info&&e.warn&&e.error))throw new Error("Invalid logger");o=e}}]),e}()).reset()},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),i={setInterval:function(e){function t(t,r){return e.apply(this,arguments)}return t.toString=function(){return e.toString()},t}((function(e,t){return setInterval(e,t)})),clearInterval:function(e){function t(t){return e.apply(this,arguments)}return t.toString=function(){return e.toString()},t}((function(e){return clearInterval(e)}))},o=!1,s=null;t.Global=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}return e._testing=function(){o=!0},e.setXMLHttpRequest=function(e){s=e},n(e,null,[{key:"location",get:function(){if(!o)return location}},{key:"localStorage",get:function(){if(!o&&"undefined"!=typeof window)return localStorage}},{key:"sessionStorage",get:function(){if(!o&&"undefined"!=typeof window)return sessionStorage}},{key:"XMLHttpRequest",get:function(){if(!o&&"undefined"!=typeof window)return s||XMLHttpRequest}},{key:"timer",get:function(){if(!o)return i}}]),e}()},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MetadataService=void 0;var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),i=r(0),o=r(7);function s(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var a=".well-known/openid-configuration";t.MetadataService=function(){function e(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:o.JsonService;if(s(this,e),!t)throw i.Log.error("MetadataService: No settings passed to MetadataService"),new Error("settings");this._settings=t,this._jsonService=new r(["application/jwk-set+json"])}return e.prototype.resetSigningKeys=function(){this._settings=this._settings||{},this._settings.signingKeys=void 0},e.prototype.getMetadata=function(){var e=this;return this._settings.metadata?(i.Log.debug("MetadataService.getMetadata: Returning metadata from settings"),Promise.resolve(this._settings.metadata)):this.metadataUrl?(i.Log.debug("MetadataService.getMetadata: getting metadata from",this.metadataUrl),this._jsonService.getJson(this.metadataUrl).then((function(t){i.Log.debug("MetadataService.getMetadata: json received");var r=e._settings.metadataSeed||{};return e._settings.metadata=Object.assign({},r,t),e._settings.metadata}))):(i.Log.error("MetadataService.getMetadata: No authority or metadataUrl configured on settings"),Promise.reject(new Error("No authority or metadataUrl configured on settings")))},e.prototype.getIssuer=function(){return this._getMetadataProperty("issuer")},e.prototype.getAuthorizationEndpoint=function(){return this._getMetadataProperty("authorization_endpoint")},e.prototype.getUserInfoEndpoint=function(){return this._getMetadataProperty("userinfo_endpoint")},e.prototype.getTokenEndpoint=function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return this._getMetadataProperty("token_endpoint",e)},e.prototype.getCheckSessionIframe=function(){return this._getMetadataProperty("check_session_iframe",!0)},e.prototype.getEndSessionEndpoint=function(){return this._getMetadataProperty("end_session_endpoint",!0)},e.prototype.getRevocationEndpoint=function(){return this._getMetadataProperty("revocation_endpoint",!0)},e.prototype.getKeysEndpoint=function(){return this._getMetadataProperty("jwks_uri",!0)},e.prototype._getMetadataProperty=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return i.Log.debug("MetadataService.getMetadataProperty for: "+e),this.getMetadata().then((function(r){if(i.Log.debug("MetadataService.getMetadataProperty: metadata recieved"),void 0===r[e]){if(!0===t)return void i.Log.warn("MetadataService.getMetadataProperty: Metadata does not contain optional property "+e);throw i.Log.error("MetadataService.getMetadataProperty: Metadata does not contain property "+e),new Error("Metadata does not contain property "+e)}return r[e]}))},e.prototype.getSigningKeys=function(){var e=this;return this._settings.signingKeys?(i.Log.debug("MetadataService.getSigningKeys: Returning signingKeys from settings"),Promise.resolve(this._settings.signingKeys)):this._getMetadataProperty("jwks_uri").then((function(t){return i.Log.debug("MetadataService.getSigningKeys: jwks_uri received",t),e._jsonService.getJson(t).then((function(t){if(i.Log.debug("MetadataService.getSigningKeys: key set received",t),!t.keys)throw i.Log.error("MetadataService.getSigningKeys: Missing keys on keyset"),new Error("Missing keys on keyset");return e._settings.signingKeys=t.keys,e._settings.signingKeys}))}))},n(e,[{key:"metadataUrl",get:function(){return this._metadataUrl||(this._settings.metadataUrl?this._metadataUrl=this._settings.metadataUrl:(this._metadataUrl=this._settings.authority,this._metadataUrl&&this._metadataUrl.indexOf(a)<0&&("/"!==this._metadataUrl[this._metadataUrl.length-1]&&(this._metadataUrl+="/"),this._metadataUrl+=a))),this._metadataUrl}}]),e}()},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.UrlUtility=void 0;var n=r(0),i=r(1);t.UrlUtility=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}return e.addQueryParam=function(e,t,r){return e.indexOf("?")<0&&(e+="?"),"?"!==e[e.length-1]&&(e+="&"),e+=encodeURIComponent(t),(e+="=")+encodeURIComponent(r)},e.parseUrlFragment=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"#",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:i.Global;"string"!=typeof e&&(e=r.location.href);var o=e.lastIndexOf(t);o>=0&&(e=e.substr(o+1)),"?"===t&&(o=e.indexOf("#"))>=0&&(e=e.substr(0,o));for(var s,a={},u=/([^&=]+)=([^&]*)/g,c=0;s=u.exec(e);)if(a[decodeURIComponent(s[1])]=decodeURIComponent(s[2].replace(/\+/g," ")),c++>50)return n.Log.error("UrlUtility.parseUrlFragment: response exceeded expected number of parameters",e),{error:"Response exceeded expected number of parameters"};for(var h in a)return a;return{}},e}()},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.JoseUtil=void 0;var n=r(26),i=function(e){return e&&e.__esModule?e:{default:e}}(r(33));t.JoseUtil=(0,i.default)({jws:n.jws,KeyUtil:n.KeyUtil,X509:n.X509,crypto:n.crypto,hextob64u:n.hextob64u,b64tohex:n.b64tohex,AllowedSigningAlgs:n.AllowedSigningAlgs})},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.OidcClientSettings=void 0;var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),o=r(0),s=r(23),a=r(6),u=r(24),c=r(2);function h(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var l=".well-known/openid-configuration",d="id_token",f="openid",p="client_secret_post";t.OidcClientSettings=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=t.authority,i=t.metadataUrl,o=t.metadata,l=t.signingKeys,g=t.metadataSeed,y=t.client_id,v=t.client_secret,m=t.response_type,w=void 0===m?d:m,_=t.scope,S=void 0===_?f:_,b=t.redirect_uri,E=t.post_logout_redirect_uri,F=t.client_authentication,A=void 0===F?p:F,k=t.prompt,x=t.display,P=t.max_age,C=t.ui_locales,I=t.acr_values,T=t.resource,R=t.response_mode,U=t.filterProtocolClaims,O=void 0===U||U,D=t.loadUserInfo,L=void 0===D||D,H=t.staleStateAge,M=void 0===H?900:H,N=t.clockSkew,j=void 0===N?300:N,B=t.clockService,K=void 0===B?new s.ClockService:B,V=t.userInfoJwtIssuer,W=void 0===V?"OP":V,J=t.mergeClaims,q=void 0!==J&&J,$=t.stateStore,z=void 0===$?new a.WebStorageStateStore:$,G=t.ResponseValidatorCtor,Y=void 0===G?u.ResponseValidator:G,X=t.MetadataServiceCtor,Q=void 0===X?c.MetadataService:X,Z=t.extraQueryParams,ee=void 0===Z?{}:Z,te=t.extraTokenParams,re=void 0===te?{}:te;h(this,e),this._authority=r,this._metadataUrl=i,this._metadata=o,this._metadataSeed=g,this._signingKeys=l,this._client_id=y,this._client_secret=v,this._response_type=w,this._scope=S,this._redirect_uri=b,this._post_logout_redirect_uri=E,this._client_authentication=A,this._prompt=k,this._display=x,this._max_age=P,this._ui_locales=C,this._acr_values=I,this._resource=T,this._response_mode=R,this._filterProtocolClaims=!!O,this._loadUserInfo=!!L,this._staleStateAge=M,this._clockSkew=j,this._clockService=K,this._userInfoJwtIssuer=W,this._mergeClaims=!!q,this._stateStore=z,this._validator=new Y(this),this._metadataService=new Q(this),this._extraQueryParams="object"===(void 0===ee?"undefined":n(ee))?ee:{},this._extraTokenParams="object"===(void 0===re?"undefined":n(re))?re:{}}return e.prototype.getEpochTime=function(){return this._clockService.getEpochTime()},i(e,[{key:"client_id",get:function(){return this._client_id},set:function(e){if(this._client_id)throw o.Log.error("OidcClientSettings.set_client_id: client_id has already been assigned."),new Error("client_id has already been assigned.");this._client_id=e}},{key:"client_secret",get:function(){return this._client_secret}},{key:"response_type",get:function(){return this._response_type}},{key:"scope",get:function(){return this._scope}},{key:"redirect_uri",get:function(){return this._redirect_uri}},{key:"post_logout_redirect_uri",get:function(){return this._post_logout_redirect_uri}},{key:"client_authentication",get:function(){return this._client_authentication}},{key:"prompt",get:function(){return this._prompt}},{key:"display",get:function(){return this._display}},{key:"max_age",get:function(){return this._max_age}},{key:"ui_locales",get:function(){return this._ui_locales}},{key:"acr_values",get:function(){return this._acr_values}},{key:"resource",get:function(){return this._resource}},{key:"response_mode",get:function(){return this._response_mode}},{key:"authority",get:function(){return this._authority},set:function(e){if(this._authority)throw o.Log.error("OidcClientSettings.set_authority: authority has already been assigned."),new Error("authority has already been assigned.");this._authority=e}},{key:"metadataUrl",get:function(){return this._metadataUrl||(this._metadataUrl=this.authority,this._metadataUrl&&this._metadataUrl.indexOf(l)<0&&("/"!==this._metadataUrl[this._metadataUrl.length-1]&&(this._metadataUrl+="/"),this._metadataUrl+=l)),this._metadataUrl}},{key:"metadata",get:function(){return this._metadata},set:function(e){this._metadata=e}},{key:"metadataSeed",get:function(){return this._metadataSeed},set:function(e){this._metadataSeed=e}},{key:"signingKeys",get:function(){return this._signingKeys},set:function(e){this._signingKeys=e}},{key:"filterProtocolClaims",get:function(){return this._filterProtocolClaims}},{key:"loadUserInfo",get:function(){return this._loadUserInfo}},{key:"staleStateAge",get:function(){return this._staleStateAge}},{key:"clockSkew",get:function(){return this._clockSkew}},{key:"userInfoJwtIssuer",get:function(){return this._userInfoJwtIssuer}},{key:"mergeClaims",get:function(){return this._mergeClaims}},{key:"stateStore",get:function(){return this._stateStore}},{key:"validator",get:function(){return this._validator}},{key:"metadataService",get:function(){return this._metadataService}},{key:"extraQueryParams",get:function(){return this._extraQueryParams},set:function(e){"object"===(void 0===e?"undefined":n(e))?this._extraQueryParams=e:this._extraQueryParams={}}},{key:"extraTokenParams",get:function(){return this._extraTokenParams},set:function(e){"object"===(void 0===e?"undefined":n(e))?this._extraTokenParams=e:this._extraTokenParams={}}}]),e}()},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.WebStorageStateStore=void 0;var n=r(0),i=r(1);function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}t.WebStorageStateStore=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=t.prefix,n=void 0===r?"oidc.":r,s=t.store,a=void 0===s?i.Global.localStorage:s;o(this,e),this._store=a,this._prefix=n}return e.prototype.set=function(e,t){return n.Log.debug("WebStorageStateStore.set",e),e=this._prefix+e,this._store.setItem(e,t),Promise.resolve()},e.prototype.get=function(e){n.Log.debug("WebStorageStateStore.get",e),e=this._prefix+e;var t=this._store.getItem(e);return Promise.resolve(t)},e.prototype.remove=function(e){n.Log.debug("WebStorageStateStore.remove",e),e=this._prefix+e;var t=this._store.getItem(e);return this._store.removeItem(e),Promise.resolve(t)},e.prototype.getAllKeys=function(){n.Log.debug("WebStorageStateStore.getAllKeys");for(var e=[],t=0;t<this._store.length;t++){var r=this._store.key(t);0===r.indexOf(this._prefix)&&e.push(r.substr(this._prefix.length))}return Promise.resolve(e)},e}()},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.JsonService=void 0;var n=r(0),i=r(1);function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}t.JsonService=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:i.Global.XMLHttpRequest,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;o(this,e),t&&Array.isArray(t)?this._contentTypes=t.slice():this._contentTypes=[],this._contentTypes.push("application/json"),n&&this._contentTypes.push("application/jwt"),this._XMLHttpRequest=r,this._jwtHandler=n}return e.prototype.getJson=function(e,t){var r=this;if(!e)throw n.Log.error("JsonService.getJson: No url passed"),new Error("url");return n.Log.debug("JsonService.getJson, url: ",e),new Promise((function(i,o){var s=new r._XMLHttpRequest;s.open("GET",e);var a=r._contentTypes,u=r._jwtHandler;s.onload=function(){if(n.Log.debug("JsonService.getJson: HTTP response received, status",s.status),200===s.status){var t=s.getResponseHeader("Content-Type");if(t){var r=a.find((function(e){if(t.startsWith(e))return!0}));if("application/jwt"==r)return void u(s).then(i,o);if(r)try{return void i(JSON.parse(s.responseText))}catch(e){return n.Log.error("JsonService.getJson: Error parsing JSON response",e.message),void o(e)}}o(Error("Invalid response Content-Type: "+t+", from URL: "+e))}else o(Error(s.statusText+" ("+s.status+")"))},s.onerror=function(){n.Log.error("JsonService.getJson: network error"),o(Error("Network Error"))},t&&(n.Log.debug("JsonService.getJson: token passed, setting Authorization header"),s.setRequestHeader("Authorization","Bearer "+t)),s.send()}))},e.prototype.postForm=function(e,t,r){var i=this;if(!e)throw n.Log.error("JsonService.postForm: No url passed"),new Error("url");return n.Log.debug("JsonService.postForm, url: ",e),new Promise((function(o,s){var a=new i._XMLHttpRequest;a.open("POST",e);var u=i._contentTypes;a.onload=function(){if(n.Log.debug("JsonService.postForm: HTTP response received, status",a.status),200!==a.status){if(400===a.status&&(r=a.getResponseHeader("Content-Type"))&&u.find((function(e){if(r.startsWith(e))return!0})))try{var t=JSON.parse(a.responseText);if(t&&t.error)return n.Log.error("JsonService.postForm: Error from server: ",t.error),void s(new Error(t.error))}catch(e){return n.Log.error("JsonService.postForm: Error parsing JSON response",e.message),void s(e)}s(Error(a.statusText+" ("+a.status+")"))}else{var r;if((r=a.getResponseHeader("Content-Type"))&&u.find((function(e){if(r.startsWith(e))return!0})))try{return void o(JSON.parse(a.responseText))}catch(e){return n.Log.error("JsonService.postForm: Error parsing JSON response",e.message),void s(e)}s(Error("Invalid response Content-Type: "+r+", from URL: "+e))}},a.onerror=function(){n.Log.error("JsonService.postForm: network error"),s(Error("Network Error"))};var c="";for(var h in t){var l=t[h];l&&(c.length>0&&(c+="&"),c+=encodeURIComponent(h),c+="=",c+=encodeURIComponent(l))}a.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),void 0!==r&&a.setRequestHeader("Authorization","Basic "+btoa(r)),a.send(c)}))},e}()},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SigninRequest=void 0;var n=r(0),i=r(3),o=r(13);t.SigninRequest=function(){function e(t){var r=t.url,s=t.client_id,a=t.redirect_uri,u=t.response_type,c=t.scope,h=t.authority,l=t.data,d=t.prompt,f=t.display,p=t.max_age,g=t.ui_locales,y=t.id_token_hint,v=t.login_hint,m=t.acr_values,w=t.resource,_=t.response_mode,S=t.request,b=t.request_uri,E=t.extraQueryParams,F=t.request_type,A=t.client_secret,k=t.extraTokenParams,x=t.skipUserInfo;if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),!r)throw n.Log.error("SigninRequest.ctor: No url passed"),new Error("url");if(!s)throw n.Log.error("SigninRequest.ctor: No client_id passed"),new Error("client_id");if(!a)throw n.Log.error("SigninRequest.ctor: No redirect_uri passed"),new Error("redirect_uri");if(!u)throw n.Log.error("SigninRequest.ctor: No response_type passed"),new Error("response_type");if(!c)throw n.Log.error("SigninRequest.ctor: No scope passed"),new Error("scope");if(!h)throw n.Log.error("SigninRequest.ctor: No authority passed"),new Error("authority");var P=e.isOidc(u),C=e.isCode(u);_||(_=e.isCode(u)?"query":null),this.state=new o.SigninState({nonce:P,data:l,client_id:s,authority:h,redirect_uri:a,code_verifier:C,request_type:F,response_mode:_,client_secret:A,scope:c,extraTokenParams:k,skipUserInfo:x}),r=i.UrlUtility.addQueryParam(r,"client_id",s),r=i.UrlUtility.addQueryParam(r,"redirect_uri",a),r=i.UrlUtility.addQueryParam(r,"response_type",u),r=i.UrlUtility.addQueryParam(r,"scope",c),r=i.UrlUtility.addQueryParam(r,"state",this.state.id),P&&(r=i.UrlUtility.addQueryParam(r,"nonce",this.state.nonce)),C&&(r=i.UrlUtility.addQueryParam(r,"code_challenge",this.state.code_challenge),r=i.UrlUtility.addQueryParam(r,"code_challenge_method","S256"));var I={prompt:d,display:f,max_age:p,ui_locales:g,id_token_hint:y,login_hint:v,acr_values:m,resource:w,request:S,request_uri:b,response_mode:_};for(var T in I)I[T]&&(r=i.UrlUtility.addQueryParam(r,T,I[T]));for(var R in E)r=i.UrlUtility.addQueryParam(r,R,E[R]);this.url=r}return e.isOidc=function(e){return!!e.split(/\s+/g).filter((function(e){return"id_token"===e}))[0]},e.isOAuth=function(e){return!!e.split(/\s+/g).filter((function(e){return"token"===e}))[0]},e.isCode=function(e){return!!e.split(/\s+/g).filter((function(e){return"code"===e}))[0]},e}()},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.State=void 0;var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),i=r(0),o=function(e){return e&&e.__esModule?e:{default:e}}(r(14));function s(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}t.State=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=t.id,n=t.data,i=t.created,a=t.request_type;s(this,e),this._id=r||(0,o.default)(),this._data=n,this._created="number"==typeof i&&i>0?i:parseInt(Date.now()/1e3),this._request_type=a}return e.prototype.toStorageString=function(){return i.Log.debug("State.toStorageString"),JSON.stringify({id:this.id,data:this.data,created:this.created,request_type:this.request_type})},e.fromStorageString=function(t){return i.Log.debug("State.fromStorageString"),new e(JSON.parse(t))},e.clearStaleState=function(t,r){var n=Date.now()/1e3-r;return t.getAllKeys().then((function(r){i.Log.debug("State.clearStaleState: got keys",r);for(var o=[],s=function(s){var a=r[s];u=t.get(a).then((function(r){var o=!1;if(r)try{var s=e.fromStorageString(r);i.Log.debug("State.clearStaleState: got item from key: ",a,s.created),s.created<=n&&(o=!0)}catch(e){i.Log.error("State.clearStaleState: Error parsing state for key",a,e.message),o=!0}else i.Log.debug("State.clearStaleState: no item in storage for key: ",a),o=!0;if(o)return i.Log.debug("State.clearStaleState: removed item for key: ",a),t.remove(a)})),o.push(u)},a=0;a<r.length;a++){var u;s(a)}return i.Log.debug("State.clearStaleState: waiting on promise count:",o.length),Promise.all(o)}))},n(e,[{key:"id",get:function(){return this._id}},{key:"data",get:function(){return this._data}},{key:"created",get:function(){return this._created}},{key:"request_type",get:function(){return this._request_type}}]),e}()},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.OidcClient=void 0;var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),i=r(0),o=r(5),s=r(12),a=r(8),u=r(34),c=r(35),h=r(36),l=r(13),d=r(9);function f(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}t.OidcClient=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};f(this,e),t instanceof o.OidcClientSettings?this._settings=t:this._settings=new o.OidcClientSettings(t)}return e.prototype.createSigninRequest=function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=t.response_type,n=t.scope,o=t.redirect_uri,s=t.data,u=t.state,c=t.prompt,h=t.display,l=t.max_age,d=t.ui_locales,f=t.id_token_hint,p=t.login_hint,g=t.acr_values,y=t.resource,v=t.request,m=t.request_uri,w=t.response_mode,_=t.extraQueryParams,S=t.extraTokenParams,b=t.request_type,E=t.skipUserInfo,F=arguments[1];i.Log.debug("OidcClient.createSigninRequest");var A=this._settings.client_id;r=r||this._settings.response_type,n=n||this._settings.scope,o=o||this._settings.redirect_uri,c=c||this._settings.prompt,h=h||this._settings.display,l=l||this._settings.max_age,d=d||this._settings.ui_locales,g=g||this._settings.acr_values,y=y||this._settings.resource,w=w||this._settings.response_mode,_=_||this._settings.extraQueryParams,S=S||this._settings.extraTokenParams;var k=this._settings.authority;return a.SigninRequest.isCode(r)&&"code"!==r?Promise.reject(new Error("OpenID Connect hybrid flow is not supported")):this._metadataService.getAuthorizationEndpoint().then((function(t){i.Log.debug("OidcClient.createSigninRequest: Received authorization endpoint",t);var x=new a.SigninRequest({url:t,client_id:A,redirect_uri:o,response_type:r,scope:n,data:s||u,authority:k,prompt:c,display:h,max_age:l,ui_locales:d,id_token_hint:f,login_hint:p,acr_values:g,resource:y,request:v,request_uri:m,extraQueryParams:_,extraTokenParams:S,request_type:b,response_mode:w,client_secret:e._settings.client_secret,skipUserInfo:E}),P=x.state;return(F=F||e._stateStore).set(P.id,P.toStorageString()).then((function(){return x}))}))},e.prototype.readSigninResponseState=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];i.Log.debug("OidcClient.readSigninResponseState");var n="query"===this._settings.response_mode||!this._settings.response_mode&&a.SigninRequest.isCode(this._settings.response_type),o=n?"?":"#",s=new u.SigninResponse(e,o);if(!s.state)return i.Log.error("OidcClient.readSigninResponseState: No state in response"),Promise.reject(new Error("No state in response"));t=t||this._stateStore;var c=r?t.remove.bind(t):t.get.bind(t);return c(s.state).then((function(e){if(!e)throw i.Log.error("OidcClient.readSigninResponseState: No matching state found in storage"),new Error("No matching state found in storage");return{state:l.SigninState.fromStorageString(e),response:s}}))},e.prototype.processSigninResponse=function(e,t){var r=this;return i.Log.debug("OidcClient.processSigninResponse"),this.readSigninResponseState(e,t,!0).then((function(e){var t=e.state,n=e.response;return i.Log.debug("OidcClient.processSigninResponse: Received state from storage; validating response"),r._validator.validateSigninResponse(t,n)}))},e.prototype.createSignoutRequest=function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=t.id_token_hint,n=t.data,o=t.state,s=t.post_logout_redirect_uri,a=t.extraQueryParams,u=t.request_type,h=arguments[1];return i.Log.debug("OidcClient.createSignoutRequest"),s=s||this._settings.post_logout_redirect_uri,a=a||this._settings.extraQueryParams,this._metadataService.getEndSessionEndpoint().then((function(t){if(!t)throw i.Log.error("OidcClient.createSignoutRequest: No end session endpoint url returned"),new Error("no end session endpoint");i.Log.debug("OidcClient.createSignoutRequest: Received end session endpoint",t);var l=new c.SignoutRequest({url:t,id_token_hint:r,post_logout_redirect_uri:s,data:n||o,extraQueryParams:a,request_type:u}),d=l.state;return d&&(i.Log.debug("OidcClient.createSignoutRequest: Signout request has state to persist"),(h=h||e._stateStore).set(d.id,d.toStorageString())),l}))},e.prototype.readSignoutResponseState=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];i.Log.debug("OidcClient.readSignoutResponseState");var n=new h.SignoutResponse(e);if(!n.state)return i.Log.debug("OidcClient.readSignoutResponseState: No state in response"),n.error?(i.Log.warn("OidcClient.readSignoutResponseState: Response was error: ",n.error),Promise.reject(new s.ErrorResponse(n))):Promise.resolve({state:void 0,response:n});var o=n.state;t=t||this._stateStore;var a=r?t.remove.bind(t):t.get.bind(t);return a(o).then((function(e){if(!e)throw i.Log.error("OidcClient.readSignoutResponseState: No matching state found in storage"),new Error("No matching state found in storage");return{state:d.State.fromStorageString(e),response:n}}))},e.prototype.processSignoutResponse=function(e,t){var r=this;return i.Log.debug("OidcClient.processSignoutResponse"),this.readSignoutResponseState(e,t,!0).then((function(e){var t=e.state,n=e.response;return t?(i.Log.debug("OidcClient.processSignoutResponse: Received state from storage; validating response"),r._validator.validateSignoutResponse(t,n)):(i.Log.debug("OidcClient.processSignoutResponse: No state from storage; skipping validating response"),n)}))},e.prototype.clearStaleState=function(e){return i.Log.debug("OidcClient.clearStaleState"),e=e||this._stateStore,d.State.clearStaleState(e,this.settings.staleStateAge)},n(e,[{key:"_stateStore",get:function(){return this.settings.stateStore}},{key:"_validator",get:function(){return this.settings.validator}},{key:"_metadataService",get:function(){return this.settings.metadataService}},{key:"settings",get:function(){return this._settings}},{key:"metadataService",get:function(){return this._metadataService}}]),e}()},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TokenClient=void 0;var n=r(7),i=r(2),o=r(0);function s(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}t.TokenClient=function(){function e(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:n.JsonService,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:i.MetadataService;if(s(this,e),!t)throw o.Log.error("TokenClient.ctor: No settings passed"),new Error("settings");this._settings=t,this._jsonService=new r,this._metadataService=new a(this._settings)}return e.prototype.exchangeCode=function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};(t=Object.assign({},t)).grant_type=t.grant_type||"authorization_code",t.client_id=t.client_id||this._settings.client_id,t.client_secret=t.client_secret||this._settings.client_secret,t.redirect_uri=t.redirect_uri||this._settings.redirect_uri;var r=void 0,n=t._client_authentication||this._settings._client_authentication;return delete t._client_authentication,t.code?t.redirect_uri?t.code_verifier?t.client_id?t.client_secret||"client_secret_basic"!=n?("client_secret_basic"==n&&(r=t.client_id+":"+t.client_secret,delete t.client_id,delete t.client_secret),this._metadataService.getTokenEndpoint(!1).then((function(n){return o.Log.debug("TokenClient.exchangeCode: Received token endpoint"),e._jsonService.postForm(n,t,r).then((function(e){return o.Log.debug("TokenClient.exchangeCode: response received"),e}))}))):(o.Log.error("TokenClient.exchangeCode: No client_secret passed"),Promise.reject(new Error("A client_secret is required"))):(o.Log.error("TokenClient.exchangeCode: No client_id passed"),Promise.reject(new Error("A client_id is required"))):(o.Log.error("TokenClient.exchangeCode: No code_verifier passed"),Promise.reject(new Error("A code_verifier is required"))):(o.Log.error("TokenClient.exchangeCode: No redirect_uri passed"),Promise.reject(new Error("A redirect_uri is required"))):(o.Log.error("TokenClient.exchangeCode: No code passed"),Promise.reject(new Error("A code is required")))},e.prototype.exchangeRefreshToken=function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};(t=Object.assign({},t)).grant_type=t.grant_type||"refresh_token",t.client_id=t.client_id||this._settings.client_id,t.client_secret=t.client_secret||this._settings.client_secret;var r=void 0,n=t._client_authentication||this._settings._client_authentication;return delete t._client_authentication,t.refresh_token?t.client_id?("client_secret_basic"==n&&(r=t.client_id+":"+t.client_secret,delete t.client_id,delete t.client_secret),this._metadataService.getTokenEndpoint(!1).then((function(n){return o.Log.debug("TokenClient.exchangeRefreshToken: Received token endpoint"),e._jsonService.postForm(n,t,r).then((function(e){return o.Log.debug("TokenClient.exchangeRefreshToken: response received"),e}))}))):(o.Log.error("TokenClient.exchangeRefreshToken: No client_id passed"),Promise.reject(new Error("A client_id is required"))):(o.Log.error("TokenClient.exchangeRefreshToken: No refresh_token passed"),Promise.reject(new Error("A refresh_token is required")))},e}()},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ErrorResponse=void 0;var n=r(0);function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}t.ErrorResponse=function(e){function t(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},s=r.error,a=r.error_description,u=r.error_uri,c=r.state,h=r.session_state;if(i(this,t),!s)throw n.Log.error("No error passed to ErrorResponse"),new Error("error");var l=o(this,e.call(this,a||s));return l.name="ErrorResponse",l.error=s,l.error_description=a,l.error_uri=u,l.state=c,l.session_state=h,l}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),t}(Error)},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SigninState=void 0;var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),i=r(0),o=r(9),s=r(4),a=function(e){return e&&e.__esModule?e:{default:e}}(r(14));function u(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function c(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}t.SigninState=function(e){function t(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=r.nonce,i=r.authority,o=r.client_id,h=r.redirect_uri,l=r.code_verifier,d=r.response_mode,f=r.client_secret,p=r.scope,g=r.extraTokenParams,y=r.skipUserInfo;u(this,t);var v=c(this,e.call(this,arguments[0]));if(!0===n?v._nonce=(0,a.default)():n&&(v._nonce=n),!0===l?v._code_verifier=(0,a.default)()+(0,a.default)()+(0,a.default)():l&&(v._code_verifier=l),v.code_verifier){var m=s.JoseUtil.hashString(v.code_verifier,"SHA256");v._code_challenge=s.JoseUtil.hexToBase64Url(m)}return v._redirect_uri=h,v._authority=i,v._client_id=o,v._response_mode=d,v._client_secret=f,v._scope=p,v._extraTokenParams=g,v._skipUserInfo=y,v}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),t.prototype.toStorageString=function(){return i.Log.debug("SigninState.toStorageString"),JSON.stringify({id:this.id,data:this.data,created:this.created,request_type:this.request_type,nonce:this.nonce,code_verifier:this.code_verifier,redirect_uri:this.redirect_uri,authority:this.authority,client_id:this.client_id,response_mode:this.response_mode,client_secret:this.client_secret,scope:this.scope,extraTokenParams:this.extraTokenParams,skipUserInfo:this.skipUserInfo})},t.fromStorageString=function(e){return i.Log.debug("SigninState.fromStorageString"),new t(JSON.parse(e))},n(t,[{key:"nonce",get:function(){return this._nonce}},{key:"authority",get:function(){return this._authority}},{key:"client_id",get:function(){return this._client_id}},{key:"redirect_uri",get:function(){return this._redirect_uri}},{key:"code_verifier",get:function(){return this._code_verifier}},{key:"code_challenge",get:function(){return this._code_challenge}},{key:"response_mode",get:function(){return this._response_mode}},{key:"client_secret",get:function(){return this._client_secret}},{key:"scope",get:function(){return this._scope}},{key:"extraTokenParams",get:function(){return this._extraTokenParams}},{key:"skipUserInfo",get:function(){return this._skipUserInfo}}]),t}(o.State)},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){return("undefined"!=n&&null!==n&&void 0!==n.getRandomValues?i:o)().replace(/-/g,"")};var n="undefined"!=typeof window?window.crypto||window.msCrypto:null;function i(){return([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g,(function(e){return(e^n.getRandomValues(new Uint8Array(1))[0]&15>>e/4).toString(16)}))}function o(){return([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g,(function(e){return(e^16*Math.random()>>e/4).toString(16)}))}e.exports=t.default},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.User=void 0;var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),i=r(0);t.User=function(){function e(t){var r=t.id_token,n=t.session_state,i=t.access_token,o=t.refresh_token,s=t.token_type,a=t.scope,u=t.profile,c=t.expires_at,h=t.state;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.id_token=r,this.session_state=n,this.access_token=i,this.refresh_token=o,this.token_type=s,this.scope=a,this.profile=u,this.expires_at=c,this.state=h}return e.prototype.toStorageString=function(){return i.Log.debug("User.toStorageString"),JSON.stringify({id_token:this.id_token,session_state:this.session_state,access_token:this.access_token,refresh_token:this.refresh_token,token_type:this.token_type,scope:this.scope,profile:this.profile,expires_at:this.expires_at})},e.fromStorageString=function(t){return i.Log.debug("User.fromStorageString"),new e(JSON.parse(t))},n(e,[{key:"expires_in",get:function(){if(this.expires_at){var e=parseInt(Date.now()/1e3);return this.expires_at-e}},set:function(e){var t=parseInt(e);if("number"==typeof t&&t>0){var r=parseInt(Date.now()/1e3);this.expires_at=r+t}}},{key:"expired",get:function(){var e=this.expires_in;if(void 0!==e)return e<=0}},{key:"scopes",get:function(){return(this.scope||"").split(" ")}}]),e}()},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AccessTokenEvents=void 0;var n=r(0),i=r(46);function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}t.AccessTokenEvents=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=t.accessTokenExpiringNotificationTime,n=void 0===r?60:r,s=t.accessTokenExpiringTimer,a=void 0===s?new i.Timer("Access token expiring"):s,u=t.accessTokenExpiredTimer,c=void 0===u?new i.Timer("Access token expired"):u;o(this,e),this._accessTokenExpiringNotificationTime=n,this._accessTokenExpiring=a,this._accessTokenExpired=c}return e.prototype.load=function(e){if(e.access_token&&void 0!==e.expires_in){var t=e.expires_in;if(n.Log.debug("AccessTokenEvents.load: access token present, remaining duration:",t),t>0){var r=t-this._accessTokenExpiringNotificationTime;r<=0&&(r=1),n.Log.debug("AccessTokenEvents.load: registering expiring timer in:",r),this._accessTokenExpiring.init(r)}else n.Log.debug("AccessTokenEvents.load: canceling existing expiring timer becase we're past expiration."),this._accessTokenExpiring.cancel();var i=t+1;n.Log.debug("AccessTokenEvents.load: registering expired timer in:",i),this._accessTokenExpired.init(i)}else this._accessTokenExpiring.cancel(),this._accessTokenExpired.cancel()},e.prototype.unload=function(){n.Log.debug("AccessTokenEvents.unload: canceling existing access token timers"),this._accessTokenExpiring.cancel(),this._accessTokenExpired.cancel()},e.prototype.addAccessTokenExpiring=function(e){this._accessTokenExpiring.addHandler(e)},e.prototype.removeAccessTokenExpiring=function(e){this._accessTokenExpiring.removeHandler(e)},e.prototype.addAccessTokenExpired=function(e){this._accessTokenExpired.addHandler(e)},e.prototype.removeAccessTokenExpired=function(e){this._accessTokenExpired.removeHandler(e)},e}()},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Event=void 0;var n=r(0);t.Event=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._name=t,this._callbacks=[]}return e.prototype.addHandler=function(e){this._callbacks.push(e)},e.prototype.removeHandler=function(e){var t=this._callbacks.findIndex((function(t){return t===e}));t>=0&&this._callbacks.splice(t,1)},e.prototype.raise=function(){n.Log.debug("Event: Raising event: "+this._name);for(var e=0;e<this._callbacks.length;e++){var t;(t=this._callbacks)[e].apply(t,arguments)}},e}()},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SessionMonitor=void 0;var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),i=r(0),o=r(19),s=r(1);function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}t.SessionMonitor=function(){function e(t){var r=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:o.CheckSessionIFrame,u=arguments.length>2&&void 0!==arguments[2]?arguments[2]:s.Global.timer;if(a(this,e),!t)throw i.Log.error("SessionMonitor.ctor: No user manager passed to SessionMonitor"),new Error("userManager");this._userManager=t,this._CheckSessionIFrameCtor=n,this._timer=u,this._userManager.events.addUserLoaded(this._start.bind(this)),this._userManager.events.addUserUnloaded(this._stop.bind(this)),Promise.resolve(this._userManager.getUser().then((function(e){e?r._start(e):r._settings.monitorAnonymousSession&&r._userManager.querySessionStatus().then((function(e){var t={session_state:e.session_state};e.sub&&e.sid&&(t.profile={sub:e.sub,sid:e.sid}),r._start(t)})).catch((function(e){i.Log.error("SessionMonitor ctor: error from querySessionStatus:",e.message)}))})).catch((function(e){i.Log.error("SessionMonitor ctor: error from getUser:",e.message)})))}return e.prototype._start=function(e){var t=this,r=e.session_state;r&&(e.profile?(this._sub=e.profile.sub,this._sid=e.profile.sid,i.Log.debug("SessionMonitor._start: session_state:",r,", sub:",this._sub)):(this._sub=void 0,this._sid=void 0,i.Log.debug("SessionMonitor._start: session_state:",r,", anonymous user")),this._checkSessionIFrame?this._checkSessionIFrame.start(r):this._metadataService.getCheckSessionIframe().then((function(e){if(e){i.Log.debug("SessionMonitor._start: Initializing check session iframe");var n=t._client_id,o=t._checkSessionInterval,s=t._stopCheckSessionOnError;t._checkSessionIFrame=new t._CheckSessionIFrameCtor(t._callback.bind(t),n,e,o,s),t._checkSessionIFrame.load().then((function(){t._checkSessionIFrame.start(r)}))}else i.Log.warn("SessionMonitor._start: No check session iframe found in the metadata")})).catch((function(e){i.Log.error("SessionMonitor._start: Error from getCheckSessionIframe:",e.message)})))},e.prototype._stop=function(){var e=this;if(this._sub=void 0,this._sid=void 0,this._checkSessionIFrame&&(i.Log.debug("SessionMonitor._stop"),this._checkSessionIFrame.stop()),this._settings.monitorAnonymousSession)var t=this._timer.setInterval((function(){e._timer.clearInterval(t),e._userManager.querySessionStatus().then((function(t){var r={session_state:t.session_state};t.sub&&t.sid&&(r.profile={sub:t.sub,sid:t.sid}),e._start(r)})).catch((function(e){i.Log.error("SessionMonitor: error from querySessionStatus:",e.message)}))}),1e3)},e.prototype._callback=function(){var e=this;this._userManager.querySessionStatus().then((function(t){var r=!0;t?t.sub===e._sub?(r=!1,e._checkSessionIFrame.start(t.session_state),t.sid===e._sid?i.Log.debug("SessionMonitor._callback: Same sub still logged in at OP, restarting check session iframe; session_state:",t.session_state):(i.Log.debug("SessionMonitor._callback: Same sub still logged in at OP, session state has changed, restarting check session iframe; session_state:",t.session_state),e._userManager.events._raiseUserSessionChanged())):i.Log.debug("SessionMonitor._callback: Different subject signed into OP:",t.sub):i.Log.debug("SessionMonitor._callback: Subject no longer signed into OP"),r&&(e._sub?(i.Log.debug("SessionMonitor._callback: SessionMonitor._callback; raising signed out event"),e._userManager.events._raiseUserSignedOut()):(i.Log.debug("SessionMonitor._callback: SessionMonitor._callback; raising signed in event"),e._userManager.events._raiseUserSignedIn()))})).catch((function(t){e._sub&&(i.Log.debug("SessionMonitor._callback: Error calling queryCurrentSigninSession; raising signed out event",t.message),e._userManager.events._raiseUserSignedOut())}))},n(e,[{key:"_settings",get:function(){return this._userManager.settings}},{key:"_metadataService",get:function(){return this._userManager.metadataService}},{key:"_client_id",get:function(){return this._settings.client_id}},{key:"_checkSessionInterval",get:function(){return this._settings.checkSessionInterval}},{key:"_stopCheckSessionOnError",get:function(){return this._settings.stopCheckSessionOnError}}]),e}()},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CheckSessionIFrame=void 0;var n=r(0);function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}t.CheckSessionIFrame=function(){function e(t,r,n,o){var s=!(arguments.length>4&&void 0!==arguments[4])||arguments[4];i(this,e),this._callback=t,this._client_id=r,this._url=n,this._interval=o||2e3,this._stopOnError=s;var a=n.indexOf("/",n.indexOf("//")+2);this._frame_origin=n.substr(0,a),this._frame=window.document.createElement("iframe"),this._frame.style.visibility="hidden",this._frame.style.position="absolute",this._frame.style.display="none",this._frame.width=0,this._frame.height=0,this._frame.src=n}return e.prototype.load=function(){var e=this;return new Promise((function(t){e._frame.onload=function(){t()},window.document.body.appendChild(e._frame),e._boundMessageEvent=e._message.bind(e),window.addEventListener("message",e._boundMessageEvent,!1)}))},e.prototype._message=function(e){e.origin===this._frame_origin&&e.source===this._frame.contentWindow&&("error"===e.data?(n.Log.error("CheckSessionIFrame: error message from check session op iframe"),this._stopOnError&&this.stop()):"changed"===e.data?(n.Log.debug("CheckSessionIFrame: changed message from check session op iframe"),this.stop(),this._callback()):n.Log.debug("CheckSessionIFrame: "+e.data+" message from check session op iframe"))},e.prototype.start=function(e){var t=this;if(this._session_state!==e){n.Log.debug("CheckSessionIFrame.start"),this.stop(),this._session_state=e;var r=function(){t._frame.contentWindow.postMessage(t._client_id+" "+t._session_state,t._frame_origin)};r(),this._timer=window.setInterval(r,this._interval)}},e.prototype.stop=function(){this._session_state=null,this._timer&&(n.Log.debug("CheckSessionIFrame.stop"),window.clearInterval(this._timer),this._timer=null)},e}()},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TokenRevocationClient=void 0;var n=r(0),i=r(2),o=r(1);function s(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var a="access_token",u="refresh_token";t.TokenRevocationClient=function(){function e(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:o.Global.XMLHttpRequest,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:i.MetadataService;if(s(this,e),!t)throw n.Log.error("TokenRevocationClient.ctor: No settings provided"),new Error("No settings provided.");this._settings=t,this._XMLHttpRequestCtor=r,this._metadataService=new a(this._settings)}return e.prototype.revoke=function(e,t){var r=this,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"access_token";if(!e)throw n.Log.error("TokenRevocationClient.revoke: No token provided"),new Error("No token provided.");if(i!==a&&i!=u)throw n.Log.error("TokenRevocationClient.revoke: Invalid token type"),new Error("Invalid token type.");return this._metadataService.getRevocationEndpoint().then((function(o){if(o){n.Log.debug("TokenRevocationClient.revoke: Revoking "+i);var s=r._settings.client_id,a=r._settings.client_secret;return r._revoke(o,s,a,e,i)}if(t)throw n.Log.error("TokenRevocationClient.revoke: Revocation not supported"),new Error("Revocation not supported")}))},e.prototype._revoke=function(e,t,r,i,o){var s=this;return new Promise((function(a,u){var c=new s._XMLHttpRequestCtor;c.open("POST",e),c.onload=function(){n.Log.debug("TokenRevocationClient.revoke: HTTP response received, status",c.status),200===c.status?a():u(Error(c.statusText+" ("+c.status+")"))},c.onerror=function(){n.Log.debug("TokenRevocationClient.revoke: Network Error."),u("Network Error")};var h="client_id="+encodeURIComponent(t);r&&(h+="&client_secret="+encodeURIComponent(r)),h+="&token_type_hint="+encodeURIComponent(o),h+="&token="+encodeURIComponent(i),c.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),c.send(h)}))},e}()},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CordovaPopupWindow=void 0;var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),i=r(0);t.CordovaPopupWindow=function(){function e(t){var r=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._promise=new Promise((function(e,t){r._resolve=e,r._reject=t})),this.features=t.popupWindowFeatures||"location=no,toolbar=no,zoom=no",this.target=t.popupWindowTarget||"_blank",this.redirect_uri=t.startUrl,i.Log.debug("CordovaPopupWindow.ctor: redirect_uri: "+this.redirect_uri)}return e.prototype._isInAppBrowserInstalled=function(e){return["cordova-plugin-inappbrowser","cordova-plugin-inappbrowser.inappbrowser","org.apache.cordova.inappbrowser"].some((function(t){return e.hasOwnProperty(t)}))},e.prototype.navigate=function(e){if(e&&e.url){if(!window.cordova)return this._error("cordova is undefined");var t=window.cordova.require("cordova/plugin_list").metadata;if(!1===this._isInAppBrowserInstalled(t))return this._error("InAppBrowser plugin not found");this._popup=cordova.InAppBrowser.open(e.url,this.target,this.features),this._popup?(i.Log.debug("CordovaPopupWindow.navigate: popup successfully created"),this._exitCallbackEvent=this._exitCallback.bind(this),this._loadStartCallbackEvent=this._loadStartCallback.bind(this),this._popup.addEventListener("exit",this._exitCallbackEvent,!1),this._popup.addEventListener("loadstart",this._loadStartCallbackEvent,!1)):this._error("Error opening popup window")}else this._error("No url provided");return this.promise},e.prototype._loadStartCallback=function(e){0===e.url.indexOf(this.redirect_uri)&&this._success({url:e.url})},e.prototype._exitCallback=function(e){this._error(e)},e.prototype._success=function(e){this._cleanup(),i.Log.debug("CordovaPopupWindow: Successful response from cordova popup window"),this._resolve(e)},e.prototype._error=function(e){this._cleanup(),i.Log.error(e),this._reject(new Error(e))},e.prototype.close=function(){this._cleanup()},e.prototype._cleanup=function(){this._popup&&(i.Log.debug("CordovaPopupWindow: cleaning up popup"),this._popup.removeEventListener("exit",this._exitCallbackEvent,!1),this._popup.removeEventListener("loadstart",this._loadStartCallbackEvent,!1),this._popup.close()),this._popup=null},n(e,[{key:"promise",get:function(){return this._promise}}]),e}()},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(0),i=r(10),o=r(5),s=r(6),a=r(37),u=r(38),c=r(16),h=r(2),l=r(48),d=r(49),f=r(19),p=r(20),g=r(18),y=r(1),v=r(15),m=r(50);t.default={Version:m.Version,Log:n.Log,OidcClient:i.OidcClient,OidcClientSettings:o.OidcClientSettings,WebStorageStateStore:s.WebStorageStateStore,InMemoryWebStorage:a.InMemoryWebStorage,UserManager:u.UserManager,AccessTokenEvents:c.AccessTokenEvents,MetadataService:h.MetadataService,CordovaPopupNavigator:l.CordovaPopupNavigator,CordovaIFrameNavigator:d.CordovaIFrameNavigator,CheckSessionIFrame:f.CheckSessionIFrame,TokenRevocationClient:p.TokenRevocationClient,SessionMonitor:g.SessionMonitor,Global:y.Global,User:v.User},e.exports=t.default},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ClockService=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}return e.prototype.getEpochTime=function(){return Promise.resolve(Date.now()/1e3|0)},e}()},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ResponseValidator=void 0;var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i=r(0),o=r(2),s=r(25),a=r(11),u=r(12),c=r(4);function h(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var l=["nonce","at_hash","iat","nbf","exp","aud","iss","c_hash"];t.ResponseValidator=function(){function e(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:o.MetadataService,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:s.UserInfoService,u=arguments.length>3&&void 0!==arguments[3]?arguments[3]:c.JoseUtil,l=arguments.length>4&&void 0!==arguments[4]?arguments[4]:a.TokenClient;if(h(this,e),!t)throw i.Log.error("ResponseValidator.ctor: No settings passed to ResponseValidator"),new Error("settings");this._settings=t,this._metadataService=new r(this._settings),this._userInfoService=new n(this._settings),this._joseUtil=u,this._tokenClient=new l(this._settings)}return e.prototype.validateSigninResponse=function(e,t){var r=this;return i.Log.debug("ResponseValidator.validateSigninResponse"),this._processSigninParams(e,t).then((function(t){return i.Log.debug("ResponseValidator.validateSigninResponse: state processed"),r._validateTokens(e,t).then((function(t){return i.Log.debug("ResponseValidator.validateSigninResponse: tokens validated"),r._processClaims(e,t).then((function(e){return i.Log.debug("ResponseValidator.validateSigninResponse: claims processed"),e}))}))}))},e.prototype.validateSignoutResponse=function(e,t){return e.id!==t.state?(i.Log.error("ResponseValidator.validateSignoutResponse: State does not match"),Promise.reject(new Error("State does not match"))):(i.Log.debug("ResponseValidator.validateSignoutResponse: state validated"),t.state=e.data,t.error?(i.Log.warn("ResponseValidator.validateSignoutResponse: Response was error",t.error),Promise.reject(new u.ErrorResponse(t))):Promise.resolve(t))},e.prototype._processSigninParams=function(e,t){if(e.id!==t.state)return i.Log.error("ResponseValidator._processSigninParams: State does not match"),Promise.reject(new Error("State does not match"));if(!e.client_id)return i.Log.error("ResponseValidator._processSigninParams: No client_id on state"),Promise.reject(new Error("No client_id on state"));if(!e.authority)return i.Log.error("ResponseValidator._processSigninParams: No authority on state"),Promise.reject(new Error("No authority on state"));if(this._settings.authority){if(this._settings.authority&&this._settings.authority!==e.authority)return i.Log.error("ResponseValidator._processSigninParams: authority mismatch on settings vs. signin state"),Promise.reject(new Error("authority mismatch on settings vs. signin state"))}else this._settings.authority=e.authority;if(this._settings.client_id){if(this._settings.client_id&&this._settings.client_id!==e.client_id)return i.Log.error("ResponseValidator._processSigninParams: client_id mismatch on settings vs. signin state"),Promise.reject(new Error("client_id mismatch on settings vs. signin state"))}else this._settings.client_id=e.client_id;return i.Log.debug("ResponseValidator._processSigninParams: state validated"),t.state=e.data,t.error?(i.Log.warn("ResponseValidator._processSigninParams: Response was error",t.error),Promise.reject(new u.ErrorResponse(t))):e.nonce&&!t.id_token?(i.Log.error("ResponseValidator._processSigninParams: Expecting id_token in response"),Promise.reject(new Error("No id_token in response"))):!e.nonce&&t.id_token?(i.Log.error("ResponseValidator._processSigninParams: Not expecting id_token in response"),Promise.reject(new Error("Unexpected id_token in response"))):e.code_verifier&&!t.code?(i.Log.error("ResponseValidator._processSigninParams: Expecting code in response"),Promise.reject(new Error("No code in response"))):!e.code_verifier&&t.code?(i.Log.error("ResponseValidator._processSigninParams: Not expecting code in response"),Promise.reject(new Error("Unexpected code in response"))):(t.scope||(t.scope=e.scope),Promise.resolve(t))},e.prototype._processClaims=function(e,t){var r=this;if(t.isOpenIdConnect){if(i.Log.debug("ResponseValidator._processClaims: response is OIDC, processing claims"),t.profile=this._filterProtocolClaims(t.profile),!0!==e.skipUserInfo&&this._settings.loadUserInfo&&t.access_token)return i.Log.debug("ResponseValidator._processClaims: loading user info"),this._userInfoService.getClaims(t.access_token).then((function(e){return i.Log.debug("ResponseValidator._processClaims: user info claims received from user info endpoint"),e.sub!==t.profile.sub?(i.Log.error("ResponseValidator._processClaims: sub from user info endpoint does not match sub in id_token"),Promise.reject(new Error("sub from user info endpoint does not match sub in id_token"))):(t.profile=r._mergeClaims(t.profile,e),i.Log.debug("ResponseValidator._processClaims: user info claims received, updated profile:",t.profile),t)}));i.Log.debug("ResponseValidator._processClaims: not loading user info")}else i.Log.debug("ResponseValidator._processClaims: response is not OIDC, not processing claims");return Promise.resolve(t)},e.prototype._mergeClaims=function(e,t){var r=Object.assign({},e);for(var i in t){var o=t[i];Array.isArray(o)||(o=[o]);for(var s=0;s<o.length;s++){var a=o[s];r[i]?Array.isArray(r[i])?r[i].indexOf(a)<0&&r[i].push(a):r[i]!==a&&("object"===(void 0===a?"undefined":n(a))&&this._settings.mergeClaims?r[i]=this._mergeClaims(r[i],a):r[i]=[r[i],a]):r[i]=a}}return r},e.prototype._filterProtocolClaims=function(e){i.Log.debug("ResponseValidator._filterProtocolClaims, incoming claims:",e);var t=Object.assign({},e);return this._settings._filterProtocolClaims?(l.forEach((function(e){delete t[e]})),i.Log.debug("ResponseValidator._filterProtocolClaims: protocol claims filtered",t)):i.Log.debug("ResponseValidator._filterProtocolClaims: protocol claims not filtered"),t},e.prototype._validateTokens=function(e,t){return t.code?(i.Log.debug("ResponseValidator._validateTokens: Validating code"),this._processCode(e,t)):t.id_token?t.access_token?(i.Log.debug("ResponseValidator._validateTokens: Validating id_token and access_token"),this._validateIdTokenAndAccessToken(e,t)):(i.Log.debug("ResponseValidator._validateTokens: Validating id_token"),this._validateIdToken(e,t)):(i.Log.debug("ResponseValidator._validateTokens: No code to process or id_token to validate"),Promise.resolve(t))},e.prototype._processCode=function(e,t){var r=this,o={client_id:e.client_id,client_secret:e.client_secret,code:t.code,redirect_uri:e.redirect_uri,code_verifier:e.code_verifier};return e.extraTokenParams&&"object"===n(e.extraTokenParams)&&Object.assign(o,e.extraTokenParams),this._tokenClient.exchangeCode(o).then((function(n){for(var o in n)t[o]=n[o];return t.id_token?(i.Log.debug("ResponseValidator._processCode: token response successful, processing id_token"),r._validateIdTokenAttributes(e,t)):(i.Log.debug("ResponseValidator._processCode: token response successful, returning response"),t)}))},e.prototype._validateIdTokenAttributes=function(e,t){var r=this;return this._metadataService.getIssuer().then((function(n){var o=e.client_id,s=r._settings.clockSkew;return i.Log.debug("ResponseValidator._validateIdTokenAttributes: Validaing JWT attributes; using clock skew (in seconds) of: ",s),r._settings.getEpochTime().then((function(a){return r._joseUtil.validateJwtAttributes(t.id_token,n,o,s,a).then((function(r){return e.nonce&&e.nonce!==r.nonce?(i.Log.error("ResponseValidator._validateIdTokenAttributes: Invalid nonce in id_token"),Promise.reject(new Error("Invalid nonce in id_token"))):r.sub?(t.profile=r,t):(i.Log.error("ResponseValidator._validateIdTokenAttributes: No sub present in id_token"),Promise.reject(new Error("No sub present in id_token")))}))}))}))},e.prototype._validateIdTokenAndAccessToken=function(e,t){var r=this;return this._validateIdToken(e,t).then((function(e){return r._validateAccessToken(e)}))},e.prototype._getSigningKeyForJwt=function(e){var t=this;return this._metadataService.getSigningKeys().then((function(r){var n=e.header.kid;if(!r)return i.Log.error("ResponseValidator._validateIdToken: No signing keys from metadata"),Promise.reject(new Error("No signing keys from metadata"));i.Log.debug("ResponseValidator._validateIdToken: Received signing keys");var o=void 0;if(n)o=r.filter((function(e){return e.kid===n}))[0];else{if((r=t._filterByAlg(r,e.header.alg)).length>1)return i.Log.error("ResponseValidator._validateIdToken: No kid found in id_token and more than one key found in metadata"),Promise.reject(new Error("No kid found in id_token and more than one key found in metadata"));o=r[0]}return Promise.resolve(o)}))},e.prototype._getSigningKeyForJwtWithSingleRetry=function(e){var t=this;return this._getSigningKeyForJwt(e).then((function(r){return r?Promise.resolve(r):(t._metadataService.resetSigningKeys(),t._getSigningKeyForJwt(e))}))},e.prototype._validateIdToken=function(e,t){var r=this;if(!e.nonce)return i.Log.error("ResponseValidator._validateIdToken: No nonce on state"),Promise.reject(new Error("No nonce on state"));var n=this._joseUtil.parseJwt(t.id_token);return n&&n.header&&n.payload?e.nonce!==n.payload.nonce?(i.Log.error("ResponseValidator._validateIdToken: Invalid nonce in id_token"),Promise.reject(new Error("Invalid nonce in id_token"))):this._metadataService.getIssuer().then((function(o){return i.Log.debug("ResponseValidator._validateIdToken: Received issuer"),r._getSigningKeyForJwtWithSingleRetry(n).then((function(s){if(!s)return i.Log.error("ResponseValidator._validateIdToken: No key matching kid or alg found in signing keys"),Promise.reject(new Error("No key matching kid or alg found in signing keys"));var a=e.client_id,u=r._settings.clockSkew;return i.Log.debug("ResponseValidator._validateIdToken: Validaing JWT; using clock skew (in seconds) of: ",u),r._joseUtil.validateJwt(t.id_token,s,o,a,u).then((function(){return i.Log.debug("ResponseValidator._validateIdToken: JWT validation successful"),n.payload.sub?(t.profile=n.payload,t):(i.Log.error("ResponseValidator._validateIdToken: No sub present in id_token"),Promise.reject(new Error("No sub present in id_token")))}))}))})):(i.Log.error("ResponseValidator._validateIdToken: Failed to parse id_token",n),Promise.reject(new Error("Failed to parse id_token")))},e.prototype._filterByAlg=function(e,t){var r=null;if(t.startsWith("RS"))r="RSA";else if(t.startsWith("PS"))r="PS";else{if(!t.startsWith("ES"))return i.Log.debug("ResponseValidator._filterByAlg: alg not supported: ",t),[];r="EC"}return i.Log.debug("ResponseValidator._filterByAlg: Looking for keys that match kty: ",r),e=e.filter((function(e){return e.kty===r})),i.Log.debug("ResponseValidator._filterByAlg: Number of keys that match kty: ",r,e.length),e},e.prototype._validateAccessToken=function(e){if(!e.profile)return i.Log.error("ResponseValidator._validateAccessToken: No profile loaded from id_token"),Promise.reject(new Error("No profile loaded from id_token"));if(!e.profile.at_hash)return i.Log.error("ResponseValidator._validateAccessToken: No at_hash in id_token"),Promise.reject(new Error("No at_hash in id_token"));if(!e.id_token)return i.Log.error("ResponseValidator._validateAccessToken: No id_token"),Promise.reject(new Error("No id_token"));var t=this._joseUtil.parseJwt(e.id_token);if(!t||!t.header)return i.Log.error("ResponseValidator._validateAccessToken: Failed to parse id_token",t),Promise.reject(new Error("Failed to parse id_token"));var r=t.header.alg;if(!r||5!==r.length)return i.Log.error("ResponseValidator._validateAccessToken: Unsupported alg:",r),Promise.reject(new Error("Unsupported alg: "+r));var n=r.substr(2,3);if(!n)return i.Log.error("ResponseValidator._validateAccessToken: Unsupported alg:",r,n),Promise.reject(new Error("Unsupported alg: "+r));if(256!==(n=parseInt(n))&&384!==n&&512!==n)return i.Log.error("ResponseValidator._validateAccessToken: Unsupported alg:",r,n),Promise.reject(new Error("Unsupported alg: "+r));var o="sha"+n,s=this._joseUtil.hashString(e.access_token,o);if(!s)return i.Log.error("ResponseValidator._validateAccessToken: access_token hash failed:",o),Promise.reject(new Error("Failed to validate at_hash"));var a=s.substr(0,s.length/2),u=this._joseUtil.hexToBase64Url(a);return u!==e.profile.at_hash?(i.Log.error("ResponseValidator._validateAccessToken: Failed to validate at_hash",u,e.profile.at_hash),Promise.reject(new Error("Failed to validate at_hash"))):(i.Log.debug("ResponseValidator._validateAccessToken: success"),Promise.resolve(e))},e}()},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.UserInfoService=void 0;var n=r(7),i=r(2),o=r(0),s=r(4);function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}t.UserInfoService=function(){function e(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:n.JsonService,u=arguments.length>2&&void 0!==arguments[2]?arguments[2]:i.MetadataService,c=arguments.length>3&&void 0!==arguments[3]?arguments[3]:s.JoseUtil;if(a(this,e),!t)throw o.Log.error("UserInfoService.ctor: No settings passed"),new Error("settings");this._settings=t,this._jsonService=new r(void 0,void 0,this._getClaimsFromJwt.bind(this)),this._metadataService=new u(this._settings),this._joseUtil=c}return e.prototype.getClaims=function(e){var t=this;return e?this._metadataService.getUserInfoEndpoint().then((function(r){return o.Log.debug("UserInfoService.getClaims: received userinfo url",r),t._jsonService.getJson(r,e).then((function(e){return o.Log.debug("UserInfoService.getClaims: claims received",e),e}))})):(o.Log.error("UserInfoService.getClaims: No token passed"),Promise.reject(new Error("A token is required")))},e.prototype._getClaimsFromJwt=function e(t){var r=this;try{var n=this._joseUtil.parseJwt(t.responseText);if(!n||!n.header||!n.payload)return o.Log.error("UserInfoService._getClaimsFromJwt: Failed to parse JWT",n),Promise.reject(new Error("Failed to parse id_token"));var i=n.header.kid,s=void 0;switch(this._settings.userInfoJwtIssuer){case"OP":s=this._metadataService.getIssuer();break;case"ANY":s=Promise.resolve(n.payload.iss);break;default:s=Promise.resolve(this._settings.userInfoJwtIssuer)}return s.then((function(e){return o.Log.debug("UserInfoService._getClaimsFromJwt: Received issuer:"+e),r._metadataService.getSigningKeys().then((function(s){if(!s)return o.Log.error("UserInfoService._getClaimsFromJwt: No signing keys from metadata"),Promise.reject(new Error("No signing keys from metadata"));o.Log.debug("UserInfoService._getClaimsFromJwt: Received signing keys");var a=void 0;if(i)a=s.filter((function(e){return e.kid===i}))[0];else{if((s=r._filterByAlg(s,n.header.alg)).length>1)return o.Log.error("UserInfoService._getClaimsFromJwt: No kid found in id_token and more than one key found in metadata"),Promise.reject(new Error("No kid found in id_token and more than one key found in metadata"));a=s[0]}if(!a)return o.Log.error("UserInfoService._getClaimsFromJwt: No key matching kid or alg found in signing keys"),Promise.reject(new Error("No key matching kid or alg found in signing keys"));var u=r._settings.client_id,c=r._settings.clockSkew;return o.Log.debug("UserInfoService._getClaimsFromJwt: Validaing JWT; using clock skew (in seconds) of: ",c),r._joseUtil.validateJwt(t.responseText,a,e,u,c,void 0,!0).then((function(){return o.Log.debug("UserInfoService._getClaimsFromJwt: JWT validation successful"),n.payload}))}))}))}catch(e){return o.Log.error("UserInfoService._getClaimsFromJwt: Error parsing JWT response",e.message),void reject(e)}},e.prototype._filterByAlg=function(e,t){var r=null;if(t.startsWith("RS"))r="RSA";else if(t.startsWith("PS"))r="PS";else{if(!t.startsWith("ES"))return o.Log.debug("UserInfoService._filterByAlg: alg not supported: ",t),[];r="EC"}return o.Log.debug("UserInfoService._filterByAlg: Looking for keys that match kty: ",r),e=e.filter((function(e){return e.kty===r})),o.Log.debug("UserInfoService._filterByAlg: Number of keys that match kty: ",r,e.length),e},e}()},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AllowedSigningAlgs=t.b64tohex=t.hextob64u=t.crypto=t.X509=t.KeyUtil=t.jws=void 0;var n=r(27);t.jws=n.jws,t.KeyUtil=n.KEYUTIL,t.X509=n.X509,t.crypto=n.crypto,t.hextob64u=n.hextob64u,t.b64tohex=n.b64tohex,t.AllowedSigningAlgs=["RS256","RS384","RS512","PS256","PS384","PS512","ES256","ES384","ES512"]},function(e,t,r){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0});var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n={userAgent:!1},i={};if(void 0===o)var o={};o.lang={extend:function(e,t,r){if(!t||!e)throw new Error("YAHOO.lang.extend failed, please check that all dependencies are included.");var i=function(){};if(i.prototype=t.prototype,e.prototype=new i,e.prototype.constructor=e,e.superclass=t.prototype,t.prototype.constructor==Object.prototype.constructor&&(t.prototype.constructor=t),r){var o;for(o in r)e.prototype[o]=r[o];var s=function(){},a=["toString","valueOf"];try{/MSIE/.test(n.userAgent)&&(s=function(e,t){for(o=0;o<a.length;o+=1){var r=a[o],n=t[r];"function"==typeof n&&n!=Object.prototype[r]&&(e[r]=n)}})}catch(e){}s(e.prototype,r)}}};var s,a,u,c,h,l,d,f,p,g,y,v=v||(s=Math,u=(a={}).lib={},c=u.Base=function(){function e(){}return{extend:function(t){e.prototype=this;var r=new e;return t&&r.mixIn(t),r.hasOwnProperty("init")||(r.init=function(){r.$super.init.apply(this,arguments)}),r.init.prototype=r,r.$super=this,r},create:function(){var e=this.extend();return e.init.apply(e,arguments),e},init:function(){},mixIn:function(e){for(var t in e)e.hasOwnProperty(t)&&(this[t]=e[t]);e.hasOwnProperty("toString")&&(this.toString=e.toString)},clone:function(){return this.init.prototype.extend(this)}}}(),h=u.WordArray=c.extend({init:function(e,t){e=this.words=e||[],this.sigBytes=null!=t?t:4*e.length},toString:function(e){return(e||d).stringify(this)},concat:function(e){var t=this.words,r=e.words,n=this.sigBytes,i=e.sigBytes;if(this.clamp(),n%4)for(var o=0;o<i;o++){var s=r[o>>>2]>>>24-o%4*8&255;t[n+o>>>2]|=s<<24-(n+o)%4*8}else for(o=0;o<i;o+=4)t[n+o>>>2]=r[o>>>2];return this.sigBytes+=i,this},clamp:function(){var e=this.words,t=this.sigBytes;e[t>>>2]&=4294967295<<32-t%4*8,e.length=s.ceil(t/4)},clone:function(){var e=c.clone.call(this);return e.words=this.words.slice(0),e},random:function(e){for(var t=[],r=0;r<e;r+=4)t.push(4294967296*s.random()|0);return new h.init(t,e)}}),l=a.enc={},d=l.Hex={stringify:function(e){for(var t=e.words,r=e.sigBytes,n=[],i=0;i<r;i++){var o=t[i>>>2]>>>24-i%4*8&255;n.push((o>>>4).toString(16)),n.push((15&o).toString(16))}return n.join("")},parse:function(e){for(var t=e.length,r=[],n=0;n<t;n+=2)r[n>>>3]|=parseInt(e.substr(n,2),16)<<24-n%8*4;return new h.init(r,t/2)}},f=l.Latin1={stringify:function(e){for(var t=e.words,r=e.sigBytes,n=[],i=0;i<r;i++){var o=t[i>>>2]>>>24-i%4*8&255;n.push(String.fromCharCode(o))}return n.join("")},parse:function(e){for(var t=e.length,r=[],n=0;n<t;n++)r[n>>>2]|=(255&e.charCodeAt(n))<<24-n%4*8;return new h.init(r,t)}},p=l.Utf8={stringify:function(e){try{return decodeURIComponent(escape(f.stringify(e)))}catch(e){throw new Error("Malformed UTF-8 data")}},parse:function(e){return f.parse(unescape(encodeURIComponent(e)))}},g=u.BufferedBlockAlgorithm=c.extend({reset:function(){this._data=new h.init,this._nDataBytes=0},_append:function(e){"string"==typeof e&&(e=p.parse(e)),this._data.concat(e),this._nDataBytes+=e.sigBytes},_process:function(e){var t=this._data,r=t.words,n=t.sigBytes,i=this.blockSize,o=n/(4*i),a=(o=e?s.ceil(o):s.max((0|o)-this._minBufferSize,0))*i,u=s.min(4*a,n);if(a){for(var c=0;c<a;c+=i)this._doProcessBlock(r,c);var l=r.splice(0,a);t.sigBytes-=u}return new h.init(l,u)},clone:function(){var e=c.clone.call(this);return e._data=this._data.clone(),e},_minBufferSize:0}),u.Hasher=g.extend({cfg:c.extend(),init:function(e){this.cfg=this.cfg.extend(e),this.reset()},reset:function(){g.reset.call(this),this._doReset()},update:function(e){return this._append(e),this._process(),this},finalize:function(e){return e&&this._append(e),this._doFinalize()},blockSize:16,_createHelper:function(e){return function(t,r){return new e.init(r).finalize(t)}},_createHmacHelper:function(e){return function(t,r){return new y.HMAC.init(e,r).finalize(t)}}}),y=a.algo={},a);!function(e){var t,r=(t=v).lib,n=r.Base,i=r.WordArray;(t=t.x64={}).Word=n.extend({init:function(e,t){this.high=e,this.low=t}}),t.WordArray=n.extend({init:function(e,t){e=this.words=e||[],this.sigBytes=null!=t?t:8*e.length},toX32:function(){for(var e=this.words,t=e.length,r=[],n=0;n<t;n++){var o=e[n];r.push(o.high),r.push(o.low)}return i.create(r,this.sigBytes)},clone:function(){for(var e=n.clone.call(this),t=e.words=this.words.slice(0),r=t.length,i=0;i<r;i++)t[i]=t[i].clone();return e}})}(),function(){var e=v,t=e.lib.WordArray;e.enc.Base64={stringify:function(e){var t=e.words,r=e.sigBytes,n=this._map;e.clamp(),e=[];for(var i=0;i<r;i+=3)for(var o=(t[i>>>2]>>>24-i%4*8&255)<<16|(t[i+1>>>2]>>>24-(i+1)%4*8&255)<<8|t[i+2>>>2]>>>24-(i+2)%4*8&255,s=0;4>s&&i+.75*s<r;s++)e.push(n.charAt(o>>>6*(3-s)&63));if(t=n.charAt(64))for(;e.length%4;)e.push(t);return e.join("")},parse:function(e){var r=e.length,n=this._map;(i=n.charAt(64))&&-1!=(i=e.indexOf(i))&&(r=i);for(var i=[],o=0,s=0;s<r;s++)if(s%4){var a=n.indexOf(e.charAt(s-1))<<s%4*2,u=n.indexOf(e.charAt(s))>>>6-s%4*2;i[o>>>2]|=(a|u)<<24-o%4*8,o++}return t.create(i,o)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="}}(),function(e){for(var t=v,r=(i=t.lib).WordArray,n=i.Hasher,i=t.algo,o=[],s=[],a=function(e){return 4294967296*(e-(0|e))|0},u=2,c=0;64>c;){var h;e:{h=u;for(var l=e.sqrt(h),d=2;d<=l;d++)if(!(h%d)){h=!1;break e}h=!0}h&&(8>c&&(o[c]=a(e.pow(u,.5))),s[c]=a(e.pow(u,1/3)),c++),u++}var f=[];i=i.SHA256=n.extend({_doReset:function(){this._hash=new r.init(o.slice(0))},_doProcessBlock:function(e,t){for(var r=this._hash.words,n=r[0],i=r[1],o=r[2],a=r[3],u=r[4],c=r[5],h=r[6],l=r[7],d=0;64>d;d++){if(16>d)f[d]=0|e[t+d];else{var p=f[d-15],g=f[d-2];f[d]=((p<<25|p>>>7)^(p<<14|p>>>18)^p>>>3)+f[d-7]+((g<<15|g>>>17)^(g<<13|g>>>19)^g>>>10)+f[d-16]}p=l+((u<<26|u>>>6)^(u<<21|u>>>11)^(u<<7|u>>>25))+(u&c^~u&h)+s[d]+f[d],g=((n<<30|n>>>2)^(n<<19|n>>>13)^(n<<10|n>>>22))+(n&i^n&o^i&o),l=h,h=c,c=u,u=a+p|0,a=o,o=i,i=n,n=p+g|0}r[0]=r[0]+n|0,r[1]=r[1]+i|0,r[2]=r[2]+o|0,r[3]=r[3]+a|0,r[4]=r[4]+u|0,r[5]=r[5]+c|0,r[6]=r[6]+h|0,r[7]=r[7]+l|0},_doFinalize:function(){var t=this._data,r=t.words,n=8*this._nDataBytes,i=8*t.sigBytes;return r[i>>>5]|=128<<24-i%32,r[14+(i+64>>>9<<4)]=e.floor(n/4294967296),r[15+(i+64>>>9<<4)]=n,t.sigBytes=4*r.length,this._process(),this._hash},clone:function(){var e=n.clone.call(this);return e._hash=this._hash.clone(),e}}),t.SHA256=n._createHelper(i),t.HmacSHA256=n._createHmacHelper(i)}(Math),function(){function e(){return n.create.apply(n,arguments)}for(var t=v,r=t.lib.Hasher,n=(o=t.x64).Word,i=o.WordArray,o=t.algo,s=[e(1116352408,3609767458),e(1899447441,602891725),e(3049323471,3964484399),e(3921009573,2173295548),e(961987163,4081628472),e(1508970993,3053834265),e(2453635748,2937671579),e(2870763221,3664609560),e(3624381080,2734883394),e(310598401,1164996542),e(607225278,1323610764),e(1426881987,3590304994),e(1925078388,4068182383),e(2162078206,991336113),e(2614888103,633803317),e(3248222580,3479774868),e(3835390401,2666613458),e(4022224774,944711139),e(264347078,2341262773),e(604807628,2007800933),e(770255983,1495990901),e(1249150122,1856431235),e(1555081692,3175218132),e(1996064986,2198950837),e(2554220882,3999719339),e(2821834349,766784016),e(2952996808,2566594879),e(3210313671,3203337956),e(3336571891,1034457026),e(3584528711,2466948901),e(113926993,3758326383),e(338241895,168717936),e(666307205,1188179964),e(773529912,1546045734),e(1294757372,1522805485),e(1396182291,2643833823),e(1695183700,2343527390),e(1986661051,1014477480),e(2177026350,1206759142),e(2456956037,344077627),e(2730485921,1290863460),e(2820302411,3158454273),e(3259730800,3505952657),e(3345764771,106217008),e(3516065817,3606008344),e(3600352804,1432725776),e(4094571909,1467031594),e(275423344,851169720),e(430227734,3100823752),e(506948616,1363258195),e(659060556,3750685593),e(883997877,3785050280),e(958139571,3318307427),e(1322822218,3812723403),e(1537002063,2003034995),e(1747873779,3602036899),e(1955562222,1575990012),e(2024104815,1125592928),e(2227730452,2716904306),e(2361852424,442776044),e(2428436474,593698344),e(2756734187,3733110249),e(3204031479,2999351573),e(3329325298,3815920427),e(3391569614,3928383900),e(3515267271,566280711),e(3940187606,3454069534),e(4118630271,4000239992),e(116418474,1914138554),e(174292421,2731055270),e(289380356,3203993006),e(460393269,320620315),e(685471733,587496836),e(852142971,1086792851),e(1017036298,365543100),e(1126000580,2618297676),e(1288033470,3409855158),e(1501505948,4234509866),e(1607167915,987167468),e(1816402316,1246189591)],a=[],u=0;80>u;u++)a[u]=e();o=o.SHA512=r.extend({_doReset:function(){this._hash=new i.init([new n.init(1779033703,4089235720),new n.init(3144134277,2227873595),new n.init(1013904242,4271175723),new n.init(2773480762,1595750129),new n.init(1359893119,2917565137),new n.init(2600822924,725511199),new n.init(528734635,4215389547),new n.init(1541459225,327033209)])},_doProcessBlock:function(e,t){for(var r=(l=this._hash.words)[0],n=l[1],i=l[2],o=l[3],u=l[4],c=l[5],h=l[6],l=l[7],d=r.high,f=r.low,p=n.high,g=n.low,y=i.high,v=i.low,m=o.high,w=o.low,_=u.high,S=u.low,b=c.high,E=c.low,F=h.high,A=h.low,k=l.high,x=l.low,P=d,C=f,I=p,T=g,R=y,U=v,O=m,D=w,L=_,H=S,M=b,N=E,j=F,B=A,K=k,V=x,W=0;80>W;W++){var J=a[W];if(16>W)var q=J.high=0|e[t+2*W],$=J.low=0|e[t+2*W+1];else{q=(($=(q=a[W-15]).high)>>>1|(z=q.low)<<31)^($>>>8|z<<24)^$>>>7;var z=(z>>>1|$<<31)^(z>>>8|$<<24)^(z>>>7|$<<25),G=(($=(G=a[W-2]).high)>>>19|(Y=G.low)<<13)^($<<3|Y>>>29)^$>>>6,Y=(Y>>>19|$<<13)^(Y<<3|$>>>29)^(Y>>>6|$<<26),X=($=a[W-7]).high,Q=(Z=a[W-16]).high,Z=Z.low;q=(q=(q=q+X+(($=z+$.low)>>>0<z>>>0?1:0))+G+(($+=Y)>>>0<Y>>>0?1:0))+Q+(($+=Z)>>>0<Z>>>0?1:0),J.high=q,J.low=$}X=L&M^~L&j,Z=H&N^~H&B,J=P&I^P&R^I&R;var ee=C&T^C&U^T&U,te=(z=(P>>>28|C<<4)^(P<<30|C>>>2)^(P<<25|C>>>7),G=(C>>>28|P<<4)^(C<<30|P>>>2)^(C<<25|P>>>7),(Y=s[W]).high),re=Y.low;Q=K+((L>>>14|H<<18)^(L>>>18|H<<14)^(L<<23|H>>>9))+((Y=V+((H>>>14|L<<18)^(H>>>18|L<<14)^(H<<23|L>>>9)))>>>0<V>>>0?1:0),K=j,V=B,j=M,B=N,M=L,N=H,L=O+(Q=(Q=(Q=Q+X+((Y+=Z)>>>0<Z>>>0?1:0))+te+((Y+=re)>>>0<re>>>0?1:0))+q+((Y+=$)>>>0<$>>>0?1:0))+((H=D+Y|0)>>>0<D>>>0?1:0)|0,O=R,D=U,R=I,U=T,I=P,T=C,P=Q+(J=z+J+(($=G+ee)>>>0<G>>>0?1:0))+((C=Y+$|0)>>>0<Y>>>0?1:0)|0}f=r.low=f+C,r.high=d+P+(f>>>0<C>>>0?1:0),g=n.low=g+T,n.high=p+I+(g>>>0<T>>>0?1:0),v=i.low=v+U,i.high=y+R+(v>>>0<U>>>0?1:0),w=o.low=w+D,o.high=m+O+(w>>>0<D>>>0?1:0),S=u.low=S+H,u.high=_+L+(S>>>0<H>>>0?1:0),E=c.low=E+N,c.high=b+M+(E>>>0<N>>>0?1:0),A=h.low=A+B,h.high=F+j+(A>>>0<B>>>0?1:0),x=l.low=x+V,l.high=k+K+(x>>>0<V>>>0?1:0)},_doFinalize:function(){var e=this._data,t=e.words,r=8*this._nDataBytes,n=8*e.sigBytes;return t[n>>>5]|=128<<24-n%32,t[30+(n+128>>>10<<5)]=Math.floor(r/4294967296),t[31+(n+128>>>10<<5)]=r,e.sigBytes=4*t.length,this._process(),this._hash.toX32()},clone:function(){var e=r.clone.call(this);return e._hash=this._hash.clone(),e},blockSize:32}),t.SHA512=r._createHelper(o),t.HmacSHA512=r._createHmacHelper(o)}(),function(){var e=v,t=(i=e.x64).Word,r=i.WordArray,n=(i=e.algo).SHA512,i=i.SHA384=n.extend({_doReset:function(){this._hash=new r.init([new t.init(3418070365,3238371032),new t.init(1654270250,914150663),new t.init(2438529370,812702999),new t.init(355462360,4144912697),new t.init(1731405415,4290775857),new t.init(2394180231,1750603025),new t.init(3675008525,1694076839),new t.init(1203062813,3204075428)])},_doFinalize:function(){var e=n._doFinalize.call(this);return e.sigBytes-=16,e}});e.SHA384=n._createHelper(i),e.HmacSHA384=n._createHmacHelper(i)}();var m,w="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";function _(e){var t,r,n="";for(t=0;t+3<=e.length;t+=3)r=parseInt(e.substring(t,t+3),16),n+=w.charAt(r>>6)+w.charAt(63&r);for(t+1==e.length?(r=parseInt(e.substring(t,t+1),16),n+=w.charAt(r<<2)):t+2==e.length&&(r=parseInt(e.substring(t,t+2),16),n+=w.charAt(r>>2)+w.charAt((3&r)<<4));(3&n.length)>0;)n+="=";return n}function S(e){var t,r,n,i="",o=0;for(t=0;t<e.length&&"="!=e.charAt(t);++t)(n=w.indexOf(e.charAt(t)))<0||(0==o?(i+=P(n>>2),r=3&n,o=1):1==o?(i+=P(r<<2|n>>4),r=15&n,o=2):2==o?(i+=P(r),i+=P(n>>2),r=3&n,o=3):(i+=P(r<<2|n>>4),i+=P(15&n),o=0));return 1==o&&(i+=P(r<<2)),i}function b(e){var t,r=S(e),n=new Array;for(t=0;2*t<r.length;++t)n[t]=parseInt(r.substring(2*t,2*t+2),16);return n}function E(e,t,r){null!=e&&("number"==typeof e?this.fromNumber(e,t,r):null==t&&"string"!=typeof e?this.fromString(e,256):this.fromString(e,t))}function F(){return new E(null)}"Microsoft Internet Explorer"==n.appName?(E.prototype.am=function(e,t,r,n,i,o){for(var s=32767&t,a=t>>15;--o>=0;){var u=32767&this[e],c=this[e++]>>15,h=a*u+c*s;i=((u=s*u+((32767&h)<<15)+r[n]+(1073741823&i))>>>30)+(h>>>15)+a*c+(i>>>30),r[n++]=1073741823&u}return i},m=30):"Netscape"!=n.appName?(E.prototype.am=function(e,t,r,n,i,o){for(;--o>=0;){var s=t*this[e++]+r[n]+i;i=Math.floor(s/67108864),r[n++]=67108863&s}return i},m=26):(E.prototype.am=function(e,t,r,n,i,o){for(var s=16383&t,a=t>>14;--o>=0;){var u=16383&this[e],c=this[e++]>>14,h=a*u+c*s;i=((u=s*u+((16383&h)<<14)+r[n]+i)>>28)+(h>>14)+a*c,r[n++]=268435455&u}return i},m=28),E.prototype.DB=m,E.prototype.DM=(1<<m)-1,E.prototype.DV=1<<m,E.prototype.FV=Math.pow(2,52),E.prototype.F1=52-m,E.prototype.F2=2*m-52;var A,k,x=new Array;for(A="0".charCodeAt(0),k=0;k<=9;++k)x[A++]=k;for(A="a".charCodeAt(0),k=10;k<36;++k)x[A++]=k;for(A="A".charCodeAt(0),k=10;k<36;++k)x[A++]=k;function P(e){return"0123456789abcdefghijklmnopqrstuvwxyz".charAt(e)}function C(e,t){var r=x[e.charCodeAt(t)];return null==r?-1:r}function I(e){var t=F();return t.fromInt(e),t}function T(e){var t,r=1;return 0!=(t=e>>>16)&&(e=t,r+=16),0!=(t=e>>8)&&(e=t,r+=8),0!=(t=e>>4)&&(e=t,r+=4),0!=(t=e>>2)&&(e=t,r+=2),0!=(t=e>>1)&&(e=t,r+=1),r}function R(e){this.m=e}function U(e){this.m=e,this.mp=e.invDigit(),this.mpl=32767&this.mp,this.mph=this.mp>>15,this.um=(1<<e.DB-15)-1,this.mt2=2*e.t}function O(e,t){return e&t}function D(e,t){return e|t}function L(e,t){return e^t}function H(e,t){return e&~t}function M(e){if(0==e)return-1;var t=0;return 0==(65535&e)&&(e>>=16,t+=16),0==(255&e)&&(e>>=8,t+=8),0==(15&e)&&(e>>=4,t+=4),0==(3&e)&&(e>>=2,t+=2),0==(1&e)&&++t,t}function N(e){for(var t=0;0!=e;)e&=e-1,++t;return t}function j(){}function B(e){return e}function K(e){this.r2=F(),this.q3=F(),E.ONE.dlShiftTo(2*e.t,this.r2),this.mu=this.r2.divide(e),this.m=e}R.prototype.convert=function(e){return e.s<0||e.compareTo(this.m)>=0?e.mod(this.m):e},R.prototype.revert=function(e){return e},R.prototype.reduce=function(e){e.divRemTo(this.m,null,e)},R.prototype.mulTo=function(e,t,r){e.multiplyTo(t,r),this.reduce(r)},R.prototype.sqrTo=function(e,t){e.squareTo(t),this.reduce(t)},U.prototype.convert=function(e){var t=F();return e.abs().dlShiftTo(this.m.t,t),t.divRemTo(this.m,null,t),e.s<0&&t.compareTo(E.ZERO)>0&&this.m.subTo(t,t),t},U.prototype.revert=function(e){var t=F();return e.copyTo(t),this.reduce(t),t},U.prototype.reduce=function(e){for(;e.t<=this.mt2;)e[e.t++]=0;for(var t=0;t<this.m.t;++t){var r=32767&e[t],n=r*this.mpl+((r*this.mph+(e[t]>>15)*this.mpl&this.um)<<15)&e.DM;for(e[r=t+this.m.t]+=this.m.am(0,n,e,t,0,this.m.t);e[r]>=e.DV;)e[r]-=e.DV,e[++r]++}e.clamp(),e.drShiftTo(this.m.t,e),e.compareTo(this.m)>=0&&e.subTo(this.m,e)},U.prototype.mulTo=function(e,t,r){e.multiplyTo(t,r),this.reduce(r)},U.prototype.sqrTo=function(e,t){e.squareTo(t),this.reduce(t)},E.prototype.copyTo=function(e){for(var t=this.t-1;t>=0;--t)e[t]=this[t];e.t=this.t,e.s=this.s},E.prototype.fromInt=function(e){this.t=1,this.s=e<0?-1:0,e>0?this[0]=e:e<-1?this[0]=e+this.DV:this.t=0},E.prototype.fromString=function(e,t){var r;if(16==t)r=4;else if(8==t)r=3;else if(256==t)r=8;else if(2==t)r=1;else if(32==t)r=5;else{if(4!=t)return void this.fromRadix(e,t);r=2}this.t=0,this.s=0;for(var n=e.length,i=!1,o=0;--n>=0;){var s=8==r?255&e[n]:C(e,n);s<0?"-"==e.charAt(n)&&(i=!0):(i=!1,0==o?this[this.t++]=s:o+r>this.DB?(this[this.t-1]|=(s&(1<<this.DB-o)-1)<<o,this[this.t++]=s>>this.DB-o):this[this.t-1]|=s<<o,(o+=r)>=this.DB&&(o-=this.DB))}8==r&&0!=(128&e[0])&&(this.s=-1,o>0&&(this[this.t-1]|=(1<<this.DB-o)-1<<o)),this.clamp(),i&&E.ZERO.subTo(this,this)},E.prototype.clamp=function(){for(var e=this.s&this.DM;this.t>0&&this[this.t-1]==e;)--this.t},E.prototype.dlShiftTo=function(e,t){var r;for(r=this.t-1;r>=0;--r)t[r+e]=this[r];for(r=e-1;r>=0;--r)t[r]=0;t.t=this.t+e,t.s=this.s},E.prototype.drShiftTo=function(e,t){for(var r=e;r<this.t;++r)t[r-e]=this[r];t.t=Math.max(this.t-e,0),t.s=this.s},E.prototype.lShiftTo=function(e,t){var r,n=e%this.DB,i=this.DB-n,o=(1<<i)-1,s=Math.floor(e/this.DB),a=this.s<<n&this.DM;for(r=this.t-1;r>=0;--r)t[r+s+1]=this[r]>>i|a,a=(this[r]&o)<<n;for(r=s-1;r>=0;--r)t[r]=0;t[s]=a,t.t=this.t+s+1,t.s=this.s,t.clamp()},E.prototype.rShiftTo=function(e,t){t.s=this.s;var r=Math.floor(e/this.DB);if(r>=this.t)t.t=0;else{var n=e%this.DB,i=this.DB-n,o=(1<<n)-1;t[0]=this[r]>>n;for(var s=r+1;s<this.t;++s)t[s-r-1]|=(this[s]&o)<<i,t[s-r]=this[s]>>n;n>0&&(t[this.t-r-1]|=(this.s&o)<<i),t.t=this.t-r,t.clamp()}},E.prototype.subTo=function(e,t){for(var r=0,n=0,i=Math.min(e.t,this.t);r<i;)n+=this[r]-e[r],t[r++]=n&this.DM,n>>=this.DB;if(e.t<this.t){for(n-=e.s;r<this.t;)n+=this[r],t[r++]=n&this.DM,n>>=this.DB;n+=this.s}else{for(n+=this.s;r<e.t;)n-=e[r],t[r++]=n&this.DM,n>>=this.DB;n-=e.s}t.s=n<0?-1:0,n<-1?t[r++]=this.DV+n:n>0&&(t[r++]=n),t.t=r,t.clamp()},E.prototype.multiplyTo=function(e,t){var r=this.abs(),n=e.abs(),i=r.t;for(t.t=i+n.t;--i>=0;)t[i]=0;for(i=0;i<n.t;++i)t[i+r.t]=r.am(0,n[i],t,i,0,r.t);t.s=0,t.clamp(),this.s!=e.s&&E.ZERO.subTo(t,t)},E.prototype.squareTo=function(e){for(var t=this.abs(),r=e.t=2*t.t;--r>=0;)e[r]=0;for(r=0;r<t.t-1;++r){var n=t.am(r,t[r],e,2*r,0,1);(e[r+t.t]+=t.am(r+1,2*t[r],e,2*r+1,n,t.t-r-1))>=t.DV&&(e[r+t.t]-=t.DV,e[r+t.t+1]=1)}e.t>0&&(e[e.t-1]+=t.am(r,t[r],e,2*r,0,1)),e.s=0,e.clamp()},E.prototype.divRemTo=function(e,t,r){var n=e.abs();if(!(n.t<=0)){var i=this.abs();if(i.t<n.t)return null!=t&&t.fromInt(0),void(null!=r&&this.copyTo(r));null==r&&(r=F());var o=F(),s=this.s,a=e.s,u=this.DB-T(n[n.t-1]);u>0?(n.lShiftTo(u,o),i.lShiftTo(u,r)):(n.copyTo(o),i.copyTo(r));var c=o.t,h=o[c-1];if(0!=h){var l=h*(1<<this.F1)+(c>1?o[c-2]>>this.F2:0),d=this.FV/l,f=(1<<this.F1)/l,p=1<<this.F2,g=r.t,y=g-c,v=null==t?F():t;for(o.dlShiftTo(y,v),r.compareTo(v)>=0&&(r[r.t++]=1,r.subTo(v,r)),E.ONE.dlShiftTo(c,v),v.subTo(o,o);o.t<c;)o[o.t++]=0;for(;--y>=0;){var m=r[--g]==h?this.DM:Math.floor(r[g]*d+(r[g-1]+p)*f);if((r[g]+=o.am(0,m,r,y,0,c))<m)for(o.dlShiftTo(y,v),r.subTo(v,r);r[g]<--m;)r.subTo(v,r)}null!=t&&(r.drShiftTo(c,t),s!=a&&E.ZERO.subTo(t,t)),r.t=c,r.clamp(),u>0&&r.rShiftTo(u,r),s<0&&E.ZERO.subTo(r,r)}}},E.prototype.invDigit=function(){if(this.t<1)return 0;var e=this[0];if(0==(1&e))return 0;var t=3&e;return(t=(t=(t=(t=t*(2-(15&e)*t)&15)*(2-(255&e)*t)&255)*(2-((65535&e)*t&65535))&65535)*(2-e*t%this.DV)%this.DV)>0?this.DV-t:-t},E.prototype.isEven=function(){return 0==(this.t>0?1&this[0]:this.s)},E.prototype.exp=function(e,t){if(e>4294967295||e<1)return E.ONE;var r=F(),n=F(),i=t.convert(this),o=T(e)-1;for(i.copyTo(r);--o>=0;)if(t.sqrTo(r,n),(e&1<<o)>0)t.mulTo(n,i,r);else{var s=r;r=n,n=s}return t.revert(r)},E.prototype.toString=function(e){if(this.s<0)return"-"+this.negate().toString(e);var t;if(16==e)t=4;else if(8==e)t=3;else if(2==e)t=1;else if(32==e)t=5;else{if(4!=e)return this.toRadix(e);t=2}var r,n=(1<<t)-1,i=!1,o="",s=this.t,a=this.DB-s*this.DB%t;if(s-- >0)for(a<this.DB&&(r=this[s]>>a)>0&&(i=!0,o=P(r));s>=0;)a<t?(r=(this[s]&(1<<a)-1)<<t-a,r|=this[--s]>>(a+=this.DB-t)):(r=this[s]>>(a-=t)&n,a<=0&&(a+=this.DB,--s)),r>0&&(i=!0),i&&(o+=P(r));return i?o:"0"},E.prototype.negate=function(){var e=F();return E.ZERO.subTo(this,e),e},E.prototype.abs=function(){return this.s<0?this.negate():this},E.prototype.compareTo=function(e){var t=this.s-e.s;if(0!=t)return t;var r=this.t;if(0!=(t=r-e.t))return this.s<0?-t:t;for(;--r>=0;)if(0!=(t=this[r]-e[r]))return t;return 0},E.prototype.bitLength=function(){return this.t<=0?0:this.DB*(this.t-1)+T(this[this.t-1]^this.s&this.DM)},E.prototype.mod=function(e){var t=F();return this.abs().divRemTo(e,null,t),this.s<0&&t.compareTo(E.ZERO)>0&&e.subTo(t,t),t},E.prototype.modPowInt=function(e,t){var r;return r=e<256||t.isEven()?new R(t):new U(t),this.exp(e,r)},E.ZERO=I(0),E.ONE=I(1),j.prototype.convert=B,j.prototype.revert=B,j.prototype.mulTo=function(e,t,r){e.multiplyTo(t,r)},j.prototype.sqrTo=function(e,t){e.squareTo(t)},K.prototype.convert=function(e){if(e.s<0||e.t>2*this.m.t)return e.mod(this.m);if(e.compareTo(this.m)<0)return e;var t=F();return e.copyTo(t),this.reduce(t),t},K.prototype.revert=function(e){return e},K.prototype.reduce=function(e){for(e.drShiftTo(this.m.t-1,this.r2),e.t>this.m.t+1&&(e.t=this.m.t+1,e.clamp()),this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3),this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);e.compareTo(this.r2)<0;)e.dAddOffset(1,this.m.t+1);for(e.subTo(this.r2,e);e.compareTo(this.m)>=0;)e.subTo(this.m,e)},K.prototype.mulTo=function(e,t,r){e.multiplyTo(t,r),this.reduce(r)},K.prototype.sqrTo=function(e,t){e.squareTo(t),this.reduce(t)};var V,W,J,q=[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509,521,523,541,547,557,563,569,571,577,587,593,599,601,607,613,617,619,631,641,643,647,653,659,661,673,677,683,691,701,709,719,727,733,739,743,751,757,761,769,773,787,797,809,811,821,823,827,829,839,853,857,859,863,877,881,883,887,907,911,919,929,937,941,947,953,967,971,977,983,991,997],$=(1<<26)/q[q.length-1];function z(){this.i=0,this.j=0,this.S=new Array}function G(){!function(e){W[J++]^=255&e,W[J++]^=e>>8&255,W[J++]^=e>>16&255,W[J++]^=e>>24&255,J>=256&&(J-=256)}((new Date).getTime())}if(E.prototype.chunkSize=function(e){return Math.floor(Math.LN2*this.DB/Math.log(e))},E.prototype.toRadix=function(e){if(null==e&&(e=10),0==this.signum()||e<2||e>36)return"0";var t=this.chunkSize(e),r=Math.pow(e,t),n=I(r),i=F(),o=F(),s="";for(this.divRemTo(n,i,o);i.signum()>0;)s=(r+o.intValue()).toString(e).substr(1)+s,i.divRemTo(n,i,o);return o.intValue().toString(e)+s},E.prototype.fromRadix=function(e,t){this.fromInt(0),null==t&&(t=10);for(var r=this.chunkSize(t),n=Math.pow(t,r),i=!1,o=0,s=0,a=0;a<e.length;++a){var u=C(e,a);u<0?"-"==e.charAt(a)&&0==this.signum()&&(i=!0):(s=t*s+u,++o>=r&&(this.dMultiply(n),this.dAddOffset(s,0),o=0,s=0))}o>0&&(this.dMultiply(Math.pow(t,o)),this.dAddOffset(s,0)),i&&E.ZERO.subTo(this,this)},E.prototype.fromNumber=function(e,t,r){if("number"==typeof t)if(e<2)this.fromInt(1);else for(this.fromNumber(e,r),this.testBit(e-1)||this.bitwiseTo(E.ONE.shiftLeft(e-1),D,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(t);)this.dAddOffset(2,0),this.bitLength()>e&&this.subTo(E.ONE.shiftLeft(e-1),this);else{var n=new Array,i=7&e;n.length=1+(e>>3),t.nextBytes(n),i>0?n[0]&=(1<<i)-1:n[0]=0,this.fromString(n,256)}},E.prototype.bitwiseTo=function(e,t,r){var n,i,o=Math.min(e.t,this.t);for(n=0;n<o;++n)r[n]=t(this[n],e[n]);if(e.t<this.t){for(i=e.s&this.DM,n=o;n<this.t;++n)r[n]=t(this[n],i);r.t=this.t}else{for(i=this.s&this.DM,n=o;n<e.t;++n)r[n]=t(i,e[n]);r.t=e.t}r.s=t(this.s,e.s),r.clamp()},E.prototype.changeBit=function(e,t){var r=E.ONE.shiftLeft(e);return this.bitwiseTo(r,t,r),r},E.prototype.addTo=function(e,t){for(var r=0,n=0,i=Math.min(e.t,this.t);r<i;)n+=this[r]+e[r],t[r++]=n&this.DM,n>>=this.DB;if(e.t<this.t){for(n+=e.s;r<this.t;)n+=this[r],t[r++]=n&this.DM,n>>=this.DB;n+=this.s}else{for(n+=this.s;r<e.t;)n+=e[r],t[r++]=n&this.DM,n>>=this.DB;n+=e.s}t.s=n<0?-1:0,n>0?t[r++]=n:n<-1&&(t[r++]=this.DV+n),t.t=r,t.clamp()},E.prototype.dMultiply=function(e){this[this.t]=this.am(0,e-1,this,0,0,this.t),++this.t,this.clamp()},E.prototype.dAddOffset=function(e,t){if(0!=e){for(;this.t<=t;)this[this.t++]=0;for(this[t]+=e;this[t]>=this.DV;)this[t]-=this.DV,++t>=this.t&&(this[this.t++]=0),++this[t]}},E.prototype.multiplyLowerTo=function(e,t,r){var n,i=Math.min(this.t+e.t,t);for(r.s=0,r.t=i;i>0;)r[--i]=0;for(n=r.t-this.t;i<n;++i)r[i+this.t]=this.am(0,e[i],r,i,0,this.t);for(n=Math.min(e.t,t);i<n;++i)this.am(0,e[i],r,i,0,t-i);r.clamp()},E.prototype.multiplyUpperTo=function(e,t,r){--t;var n=r.t=this.t+e.t-t;for(r.s=0;--n>=0;)r[n]=0;for(n=Math.max(t-this.t,0);n<e.t;++n)r[this.t+n-t]=this.am(t-n,e[n],r,0,0,this.t+n-t);r.clamp(),r.drShiftTo(1,r)},E.prototype.modInt=function(e){if(e<=0)return 0;var t=this.DV%e,r=this.s<0?e-1:0;if(this.t>0)if(0==t)r=this[0]%e;else for(var n=this.t-1;n>=0;--n)r=(t*r+this[n])%e;return r},E.prototype.millerRabin=function(e){var t=this.subtract(E.ONE),r=t.getLowestSetBit();if(r<=0)return!1;var n=t.shiftRight(r);(e=e+1>>1)>q.length&&(e=q.length);for(var i=F(),o=0;o<e;++o){i.fromInt(q[Math.floor(Math.random()*q.length)]);var s=i.modPow(n,this);if(0!=s.compareTo(E.ONE)&&0!=s.compareTo(t)){for(var a=1;a++<r&&0!=s.compareTo(t);)if(0==(s=s.modPowInt(2,this)).compareTo(E.ONE))return!1;if(0!=s.compareTo(t))return!1}}return!0},E.prototype.clone=function(){var e=F();return this.copyTo(e),e},E.prototype.intValue=function(){if(this.s<0){if(1==this.t)return this[0]-this.DV;if(0==this.t)return-1}else{if(1==this.t)return this[0];if(0==this.t)return 0}return(this[1]&(1<<32-this.DB)-1)<<this.DB|this[0]},E.prototype.byteValue=function(){return 0==this.t?this.s:this[0]<<24>>24},E.prototype.shortValue=function(){return 0==this.t?this.s:this[0]<<16>>16},E.prototype.signum=function(){return this.s<0?-1:this.t<=0||1==this.t&&this[0]<=0?0:1},E.prototype.toByteArray=function(){var e=this.t,t=new Array;t[0]=this.s;var r,n=this.DB-e*this.DB%8,i=0;if(e-- >0)for(n<this.DB&&(r=this[e]>>n)!=(this.s&this.DM)>>n&&(t[i++]=r|this.s<<this.DB-n);e>=0;)n<8?(r=(this[e]&(1<<n)-1)<<8-n,r|=this[--e]>>(n+=this.DB-8)):(r=this[e]>>(n-=8)&255,n<=0&&(n+=this.DB,--e)),0!=(128&r)&&(r|=-256),0==i&&(128&this.s)!=(128&r)&&++i,(i>0||r!=this.s)&&(t[i++]=r);return t},E.prototype.equals=function(e){return 0==this.compareTo(e)},E.prototype.min=function(e){return this.compareTo(e)<0?this:e},E.prototype.max=function(e){return this.compareTo(e)>0?this:e},E.prototype.and=function(e){var t=F();return this.bitwiseTo(e,O,t),t},E.prototype.or=function(e){var t=F();return this.bitwiseTo(e,D,t),t},E.prototype.xor=function(e){var t=F();return this.bitwiseTo(e,L,t),t},E.prototype.andNot=function(e){var t=F();return this.bitwiseTo(e,H,t),t},E.prototype.not=function(){for(var e=F(),t=0;t<this.t;++t)e[t]=this.DM&~this[t];return e.t=this.t,e.s=~this.s,e},E.prototype.shiftLeft=function(e){var t=F();return e<0?this.rShiftTo(-e,t):this.lShiftTo(e,t),t},E.prototype.shiftRight=function(e){var t=F();return e<0?this.lShiftTo(-e,t):this.rShiftTo(e,t),t},E.prototype.getLowestSetBit=function(){for(var e=0;e<this.t;++e)if(0!=this[e])return e*this.DB+M(this[e]);return this.s<0?this.t*this.DB:-1},E.prototype.bitCount=function(){for(var e=0,t=this.s&this.DM,r=0;r<this.t;++r)e+=N(this[r]^t);return e},E.prototype.testBit=function(e){var t=Math.floor(e/this.DB);return t>=this.t?0!=this.s:0!=(this[t]&1<<e%this.DB)},E.prototype.setBit=function(e){return this.changeBit(e,D)},E.prototype.clearBit=function(e){return this.changeBit(e,H)},E.prototype.flipBit=function(e){return this.changeBit(e,L)},E.prototype.add=function(e){var t=F();return this.addTo(e,t),t},E.prototype.subtract=function(e){var t=F();return this.subTo(e,t),t},E.prototype.multiply=function(e){var t=F();return this.multiplyTo(e,t),t},E.prototype.divide=function(e){var t=F();return this.divRemTo(e,t,null),t},E.prototype.remainder=function(e){var t=F();return this.divRemTo(e,null,t),t},E.prototype.divideAndRemainder=function(e){var t=F(),r=F();return this.divRemTo(e,t,r),new Array(t,r)},E.prototype.modPow=function(e,t){var r,n,i=e.bitLength(),o=I(1);if(i<=0)return o;r=i<18?1:i<48?3:i<144?4:i<768?5:6,n=i<8?new R(t):t.isEven()?new K(t):new U(t);var s=new Array,a=3,u=r-1,c=(1<<r)-1;if(s[1]=n.convert(this),r>1){var h=F();for(n.sqrTo(s[1],h);a<=c;)s[a]=F(),n.mulTo(h,s[a-2],s[a]),a+=2}var l,d,f=e.t-1,p=!0,g=F();for(i=T(e[f])-1;f>=0;){for(i>=u?l=e[f]>>i-u&c:(l=(e[f]&(1<<i+1)-1)<<u-i,f>0&&(l|=e[f-1]>>this.DB+i-u)),a=r;0==(1&l);)l>>=1,--a;if((i-=a)<0&&(i+=this.DB,--f),p)s[l].copyTo(o),p=!1;else{for(;a>1;)n.sqrTo(o,g),n.sqrTo(g,o),a-=2;a>0?n.sqrTo(o,g):(d=o,o=g,g=d),n.mulTo(g,s[l],o)}for(;f>=0&&0==(e[f]&1<<i);)n.sqrTo(o,g),d=o,o=g,g=d,--i<0&&(i=this.DB-1,--f)}return n.revert(o)},E.prototype.modInverse=function(e){var t=e.isEven();if(this.isEven()&&t||0==e.signum())return E.ZERO;for(var r=e.clone(),n=this.clone(),i=I(1),o=I(0),s=I(0),a=I(1);0!=r.signum();){for(;r.isEven();)r.rShiftTo(1,r),t?(i.isEven()&&o.isEven()||(i.addTo(this,i),o.subTo(e,o)),i.rShiftTo(1,i)):o.isEven()||o.subTo(e,o),o.rShiftTo(1,o);for(;n.isEven();)n.rShiftTo(1,n),t?(s.isEven()&&a.isEven()||(s.addTo(this,s),a.subTo(e,a)),s.rShiftTo(1,s)):a.isEven()||a.subTo(e,a),a.rShiftTo(1,a);r.compareTo(n)>=0?(r.subTo(n,r),t&&i.subTo(s,i),o.subTo(a,o)):(n.subTo(r,n),t&&s.subTo(i,s),a.subTo(o,a))}return 0!=n.compareTo(E.ONE)?E.ZERO:a.compareTo(e)>=0?a.subtract(e):a.signum()<0?(a.addTo(e,a),a.signum()<0?a.add(e):a):a},E.prototype.pow=function(e){return this.exp(e,new j)},E.prototype.gcd=function(e){var t=this.s<0?this.negate():this.clone(),r=e.s<0?e.negate():e.clone();if(t.compareTo(r)<0){var n=t;t=r,r=n}var i=t.getLowestSetBit(),o=r.getLowestSetBit();if(o<0)return t;for(i<o&&(o=i),o>0&&(t.rShiftTo(o,t),r.rShiftTo(o,r));t.signum()>0;)(i=t.getLowestSetBit())>0&&t.rShiftTo(i,t),(i=r.getLowestSetBit())>0&&r.rShiftTo(i,r),t.compareTo(r)>=0?(t.subTo(r,t),t.rShiftTo(1,t)):(r.subTo(t,r),r.rShiftTo(1,r));return o>0&&r.lShiftTo(o,r),r},E.prototype.isProbablePrime=function(e){var t,r=this.abs();if(1==r.t&&r[0]<=q[q.length-1]){for(t=0;t<q.length;++t)if(r[0]==q[t])return!0;return!1}if(r.isEven())return!1;for(t=1;t<q.length;){for(var n=q[t],i=t+1;i<q.length&&n<$;)n*=q[i++];for(n=r.modInt(n);t<i;)if(n%q[t++]==0)return!1}return r.millerRabin(e)},E.prototype.square=function(){var e=F();return this.squareTo(e),e},z.prototype.init=function(e){var t,r,n;for(t=0;t<256;++t)this.S[t]=t;for(r=0,t=0;t<256;++t)r=r+this.S[t]+e[t%e.length]&255,n=this.S[t],this.S[t]=this.S[r],this.S[r]=n;this.i=0,this.j=0},z.prototype.next=function(){var e;return this.i=this.i+1&255,this.j=this.j+this.S[this.i]&255,e=this.S[this.i],this.S[this.i]=this.S[this.j],this.S[this.j]=e,this.S[e+this.S[this.i]&255]},null==W){var Y;if(W=new Array,J=0,void 0!==i&&(void 0!==i.crypto||void 0!==i.msCrypto)){var X=i.crypto||i.msCrypto;if(X.getRandomValues){var Q=new Uint8Array(32);for(X.getRandomValues(Q),Y=0;Y<32;++Y)W[J++]=Q[Y]}else if("Netscape"==n.appName&&n.appVersion<"5"){var Z=i.crypto.random(32);for(Y=0;Y<Z.length;++Y)W[J++]=255&Z.charCodeAt(Y)}}for(;J<256;)Y=Math.floor(65536*Math.random()),W[J++]=Y>>>8,W[J++]=255&Y;J=0,G()}function ee(){if(null==V){for(G(),(V=new z).init(W),J=0;J<W.length;++J)W[J]=0;J=0}return V.next()}function te(){}function re(e,t){return new E(e,t)}function ne(e,t,r){for(var n="",i=0;n.length<t;)n+=r(String.fromCharCode.apply(String,e.concat([(4278190080&i)>>24,(16711680&i)>>16,(65280&i)>>8,255&i]))),i+=1;return n}function ie(){this.n=null,this.e=0,this.d=null,this.p=null,this.q=null,this.dmp1=null,this.dmq1=null,this.coeff=null}function oe(e,t){this.x=t,this.q=e}function se(e,t,r,n){this.curve=e,this.x=t,this.y=r,this.z=null==n?E.ONE:n,this.zinv=null}function ae(e,t,r){this.q=e,this.a=this.fromBigInteger(t),this.b=this.fromBigInteger(r),this.infinity=new se(this,null,null)}te.prototype.nextBytes=function(e){var t;for(t=0;t<e.length;++t)e[t]=ee()},ie.prototype.doPublic=function(e){return e.modPowInt(this.e,this.n)},ie.prototype.setPublic=function(e,t){if(this.isPublic=!0,this.isPrivate=!1,"string"!=typeof e)this.n=e,this.e=t;else{if(!(null!=e&&null!=t&&e.length>0&&t.length>0))throw"Invalid RSA public key";this.n=re(e,16),this.e=parseInt(t,16)}},ie.prototype.encrypt=function(e){var t=function(e,t){if(t<e.length+11)throw"Message too long for RSA";for(var r=new Array,n=e.length-1;n>=0&&t>0;){var i=e.charCodeAt(n--);i<128?r[--t]=i:i>127&&i<2048?(r[--t]=63&i|128,r[--t]=i>>6|192):(r[--t]=63&i|128,r[--t]=i>>6&63|128,r[--t]=i>>12|224)}r[--t]=0;for(var o=new te,s=new Array;t>2;){for(s[0]=0;0==s[0];)o.nextBytes(s);r[--t]=s[0]}return r[--t]=2,r[--t]=0,new E(r)}(e,this.n.bitLength()+7>>3);if(null==t)return null;var r=this.doPublic(t);if(null==r)return null;var n=r.toString(16);return 0==(1&n.length)?n:"0"+n},ie.prototype.encryptOAEP=function(e,t,r){var n=function(e,t,r,n){var i=ce.crypto.MessageDigest,o=ce.crypto.Util,s=null;if(r||(r="sha1"),"string"==typeof r&&(s=i.getCanonicalAlgName(r),n=i.getHashLength(s),r=function(e){return Ee(o.hashHex(Fe(e),s))}),e.length+2*n+2>t)throw"Message too long for RSA";var a,u="";for(a=0;a<t-e.length-2*n-2;a+=1)u+="\0";var c=r("")+u+""+e,h=new Array(n);(new te).nextBytes(h);var l=ne(h,c.length,r),d=[];for(a=0;a<c.length;a+=1)d[a]=c.charCodeAt(a)^l.charCodeAt(a);var f=ne(d,h.length,r),p=[0];for(a=0;a<h.length;a+=1)p[a+1]=h[a]^f.charCodeAt(a);return new E(p.concat(d))}(e,this.n.bitLength()+7>>3,t,r);if(null==n)return null;var i=this.doPublic(n);if(null==i)return null;var o=i.toString(16);return 0==(1&o.length)?o:"0"+o},ie.prototype.type="RSA",oe.prototype.equals=function(e){return e==this||this.q.equals(e.q)&&this.x.equals(e.x)},oe.prototype.toBigInteger=function(){return this.x},oe.prototype.negate=function(){return new oe(this.q,this.x.negate().mod(this.q))},oe.prototype.add=function(e){return new oe(this.q,this.x.add(e.toBigInteger()).mod(this.q))},oe.prototype.subtract=function(e){return new oe(this.q,this.x.subtract(e.toBigInteger()).mod(this.q))},oe.prototype.multiply=function(e){return new oe(this.q,this.x.multiply(e.toBigInteger()).mod(this.q))},oe.prototype.square=function(){return new oe(this.q,this.x.square().mod(this.q))},oe.prototype.divide=function(e){return new oe(this.q,this.x.multiply(e.toBigInteger().modInverse(this.q)).mod(this.q))},se.prototype.getX=function(){return null==this.zinv&&(this.zinv=this.z.modInverse(this.curve.q)),this.curve.fromBigInteger(this.x.toBigInteger().multiply(this.zinv).mod(this.curve.q))},se.prototype.getY=function(){return null==this.zinv&&(this.zinv=this.z.modInverse(this.curve.q)),this.curve.fromBigInteger(this.y.toBigInteger().multiply(this.zinv).mod(this.curve.q))},se.prototype.equals=function(e){return e==this||(this.isInfinity()?e.isInfinity():e.isInfinity()?this.isInfinity():!!e.y.toBigInteger().multiply(this.z).subtract(this.y.toBigInteger().multiply(e.z)).mod(this.curve.q).equals(E.ZERO)&&e.x.toBigInteger().multiply(this.z).subtract(this.x.toBigInteger().multiply(e.z)).mod(this.curve.q).equals(E.ZERO))},se.prototype.isInfinity=function(){return null==this.x&&null==this.y||this.z.equals(E.ZERO)&&!this.y.toBigInteger().equals(E.ZERO)},se.prototype.negate=function(){return new se(this.curve,this.x,this.y.negate(),this.z)},se.prototype.add=function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;var t=e.y.toBigInteger().multiply(this.z).subtract(this.y.toBigInteger().multiply(e.z)).mod(this.curve.q),r=e.x.toBigInteger().multiply(this.z).subtract(this.x.toBigInteger().multiply(e.z)).mod(this.curve.q);if(E.ZERO.equals(r))return E.ZERO.equals(t)?this.twice():this.curve.getInfinity();var n=new E("3"),i=this.x.toBigInteger(),o=this.y.toBigInteger(),s=(e.x.toBigInteger(),e.y.toBigInteger(),r.square()),a=s.multiply(r),u=i.multiply(s),c=t.square().multiply(this.z),h=c.subtract(u.shiftLeft(1)).multiply(e.z).subtract(a).multiply(r).mod(this.curve.q),l=u.multiply(n).multiply(t).subtract(o.multiply(a)).subtract(c.multiply(t)).multiply(e.z).add(t.multiply(a)).mod(this.curve.q),d=a.multiply(this.z).multiply(e.z).mod(this.curve.q);return new se(this.curve,this.curve.fromBigInteger(h),this.curve.fromBigInteger(l),d)},se.prototype.twice=function(){if(this.isInfinity())return this;if(0==this.y.toBigInteger().signum())return this.curve.getInfinity();var e=new E("3"),t=this.x.toBigInteger(),r=this.y.toBigInteger(),n=r.multiply(this.z),i=n.multiply(r).mod(this.curve.q),o=this.curve.a.toBigInteger(),s=t.square().multiply(e);E.ZERO.equals(o)||(s=s.add(this.z.square().multiply(o)));var a=(s=s.mod(this.curve.q)).square().subtract(t.shiftLeft(3).multiply(i)).shiftLeft(1).multiply(n).mod(this.curve.q),u=s.multiply(e).multiply(t).subtract(i.shiftLeft(1)).shiftLeft(2).multiply(i).subtract(s.square().multiply(s)).mod(this.curve.q),c=n.square().multiply(n).shiftLeft(3).mod(this.curve.q);return new se(this.curve,this.curve.fromBigInteger(a),this.curve.fromBigInteger(u),c)},se.prototype.multiply=function(e){if(this.isInfinity())return this;if(0==e.signum())return this.curve.getInfinity();var t,r=e,n=r.multiply(new E("3")),i=this.negate(),o=this,s=this.curve.q.subtract(e),a=s.multiply(new E("3")),u=new se(this.curve,this.x,this.y),c=u.negate();for(t=n.bitLength()-2;t>0;--t){o=o.twice();var h=n.testBit(t);h!=r.testBit(t)&&(o=o.add(h?this:i))}for(t=a.bitLength()-2;t>0;--t){u=u.twice();var l=a.testBit(t);l!=s.testBit(t)&&(u=u.add(l?u:c))}return o},se.prototype.multiplyTwo=function(e,t,r){var n;n=e.bitLength()>r.bitLength()?e.bitLength()-1:r.bitLength()-1;for(var i=this.curve.getInfinity(),o=this.add(t);n>=0;)i=i.twice(),e.testBit(n)?i=r.testBit(n)?i.add(o):i.add(this):r.testBit(n)&&(i=i.add(t)),--n;return i},ae.prototype.getQ=function(){return this.q},ae.prototype.getA=function(){return this.a},ae.prototype.getB=function(){return this.b},ae.prototype.equals=function(e){return e==this||this.q.equals(e.q)&&this.a.equals(e.a)&&this.b.equals(e.b)},ae.prototype.getInfinity=function(){return this.infinity},ae.prototype.fromBigInteger=function(e){return new oe(this.q,e)},ae.prototype.decodePointHex=function(e){switch(parseInt(e.substr(0,2),16)){case 0:return this.infinity;case 2:case 3:return null;case 4:case 6:case 7:var t=(e.length-2)/2,r=e.substr(2,t),n=e.substr(t+2,t);return new se(this,this.fromBigInteger(new E(r,16)),this.fromBigInteger(new E(n,16)));default:return null}},oe.prototype.getByteLength=function(){return Math.floor((this.toBigInteger().bitLength()+7)/8)},se.prototype.getEncoded=function(e){var t=function(e,t){var r=e.toByteArrayUnsigned();if(t<r.length)r=r.slice(r.length-t);else for(;t>r.length;)r.unshift(0);return r},r=this.getX().toBigInteger(),n=this.getY().toBigInteger(),i=t(r,32);return e?n.isEven()?i.unshift(2):i.unshift(3):(i.unshift(4),i=i.concat(t(n,32))),i},se.decodeFrom=function(e,t){t[0];var r=t.length-1,n=t.slice(1,1+r/2),i=t.slice(1+r/2,1+r);n.unshift(0),i.unshift(0);var o=new E(n),s=new E(i);return new se(e,e.fromBigInteger(o),e.fromBigInteger(s))},se.decodeFromHex=function(e,t){t.substr(0,2);var r=t.length-2,n=t.substr(2,r/2),i=t.substr(2+r/2,r/2),o=new E(n,16),s=new E(i,16);return new se(e,e.fromBigInteger(o),e.fromBigInteger(s))},se.prototype.add2D=function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;if(this.x.equals(e.x))return this.y.equals(e.y)?this.twice():this.curve.getInfinity();var t=e.x.subtract(this.x),r=e.y.subtract(this.y).divide(t),n=r.square().subtract(this.x).subtract(e.x),i=r.multiply(this.x.subtract(n)).subtract(this.y);return new se(this.curve,n,i)},se.prototype.twice2D=function(){if(this.isInfinity())return this;if(0==this.y.toBigInteger().signum())return this.curve.getInfinity();var e=this.curve.fromBigInteger(E.valueOf(2)),t=this.curve.fromBigInteger(E.valueOf(3)),r=this.x.square().multiply(t).add(this.curve.a).divide(this.y.multiply(e)),n=r.square().subtract(this.x.multiply(e)),i=r.multiply(this.x.subtract(n)).subtract(this.y);return new se(this.curve,n,i)},se.prototype.multiply2D=function(e){if(this.isInfinity())return this;if(0==e.signum())return this.curve.getInfinity();var t,r=e,n=r.multiply(new E("3")),i=this.negate(),o=this;for(t=n.bitLength()-2;t>0;--t){o=o.twice();var s=n.testBit(t);s!=r.testBit(t)&&(o=o.add2D(s?this:i))}return o},se.prototype.isOnCurve=function(){var e=this.getX().toBigInteger(),t=this.getY().toBigInteger(),r=this.curve.getA().toBigInteger(),n=this.curve.getB().toBigInteger(),i=this.curve.getQ(),o=t.multiply(t).mod(i),s=e.multiply(e).multiply(e).add(r.multiply(e)).add(n).mod(i);return o.equals(s)},se.prototype.toString=function(){return"("+this.getX().toBigInteger().toString()+","+this.getY().toBigInteger().toString()+")"},se.prototype.validate=function(){var e=this.curve.getQ();if(this.isInfinity())throw new Error("Point is at infinity.");var t=this.getX().toBigInteger(),r=this.getY().toBigInteger();if(t.compareTo(E.ONE)<0||t.compareTo(e.subtract(E.ONE))>0)throw new Error("x coordinate out of bounds");if(r.compareTo(E.ONE)<0||r.compareTo(e.subtract(E.ONE))>0)throw new Error("y coordinate out of bounds");if(!this.isOnCurve())throw new Error("Point is not on the curve.");if(this.multiply(e).isInfinity())throw new Error("Point is not a scalar multiple of G.");return!0};var ue=function(){var e=new RegExp('(?:false|true|null|[\\{\\}\\[\\]]|(?:-?\\b(?:0|[1-9][0-9]*)(?:\\.[0-9]+)?(?:[eE][+-]?[0-9]+)?\\b)|(?:"(?:[^\\0-\\x08\\x0a-\\x1f"\\\\]|\\\\(?:["/\\\\bfnrt]|u[0-9A-Fa-f]{4}))*"))',"g"),t=new RegExp("\\\\(?:([^u])|u(.{4}))","g"),n={'"':'"',"/":"/","\\":"\\",b:"\b",f:"\f",n:"\n",r:"\r",t:"\t"};function i(e,t,r){return t?n[t]:String.fromCharCode(parseInt(r,16))}var o=new String(""),s=Object.hasOwnProperty;return function(n,a){var u,c,h=n.match(e),l=h[0],d=!1;"{"===l?u={}:"["===l?u=[]:(u=[],d=!0);for(var f=[u],p=1-d,g=h.length;p<g;++p){var y;switch((l=h[p]).charCodeAt(0)){default:(y=f[0])[c||y.length]=+l,c=void 0;break;case 34:if(-1!==(l=l.substring(1,l.length-1)).indexOf("\\")&&(l=l.replace(t,i)),y=f[0],!c){if(!(y instanceof Array)){c=l||o;break}c=y.length}y[c]=l,c=void 0;break;case 91:y=f[0],f.unshift(y[c||y.length]=[]),c=void 0;break;case 93:f.shift();break;case 102:(y=f[0])[c||y.length]=!1,c=void 0;break;case 110:(y=f[0])[c||y.length]=null,c=void 0;break;case 116:(y=f[0])[c||y.length]=!0,c=void 0;break;case 123:y=f[0],f.unshift(y[c||y.length]={}),c=void 0;break;case 125:f.shift()}}if(d){if(1!==f.length)throw new Error;u=u[0]}else if(f.length)throw new Error;return a&&(u=function e(t,n){var i=t[n];if(i&&"object"===(void 0===i?"undefined":r(i))){var o=null;for(var u in i)if(s.call(i,u)&&i!==t){var c=e(i,u);void 0!==c?i[u]=c:(o||(o=[]),o.push(u))}if(o)for(var h=o.length;--h>=0;)delete i[o[h]]}return a.call(t,n,i)}({"":u},"")),u}}();void 0!==ce&&ce||(t.KJUR=ce={}),void 0!==ce.asn1&&ce.asn1||(ce.asn1={}),ce.asn1.ASN1Util=new function(){this.integerToByteHex=function(e){var t=e.toString(16);return t.length%2==1&&(t="0"+t),t},this.bigIntToMinTwosComplementsHex=function(e){var t=e.toString(16);if("-"!=t.substr(0,1))t.length%2==1?t="0"+t:t.match(/^[0-7]/)||(t="00"+t);else{var r=t.substr(1).length;r%2==1?r+=1:t.match(/^[0-7]/)||(r+=2);for(var n="",i=0;i<r;i++)n+="f";t=new E(n,16).xor(e).add(E.ONE).toString(16).replace(/^-/,"")}return t},this.getPEMStringFromHex=function(e,t){return Pe(e,t)},this.newObject=function(e){var t=ce.asn1,r=t.ASN1Object,n=t.DERBoolean,i=t.DERInteger,o=t.DERBitString,s=t.DEROctetString,a=t.DERNull,u=t.DERObjectIdentifier,c=t.DEREnumerated,h=t.DERUTF8String,l=t.DERNumericString,d=t.DERPrintableString,f=t.DERTeletexString,p=t.DERIA5String,g=t.DERUTCTime,y=t.DERGeneralizedTime,v=t.DERVisibleString,m=t.DERBMPString,w=t.DERSequence,_=t.DERSet,S=t.DERTaggedObject,b=t.ASN1Util.newObject;if(e instanceof t.ASN1Object)return e;var E=Object.keys(e);if(1!=E.length)throw new Error("key of param shall be only one.");var F=E[0];if(-1==":asn1:bool:int:bitstr:octstr:null:oid:enum:utf8str:numstr:prnstr:telstr:ia5str:utctime:gentime:visstr:bmpstr:seq:set:tag:".indexOf(":"+F+":"))throw new Error("undefined key: "+F);if("bool"==F)return new n(e[F]);if("int"==F)return new i(e[F]);if("bitstr"==F)return new o(e[F]);if("octstr"==F)return new s(e[F]);if("null"==F)return new a(e[F]);if("oid"==F)return new u(e[F]);if("enum"==F)return new c(e[F]);if("utf8str"==F)return new h(e[F]);if("numstr"==F)return new l(e[F]);if("prnstr"==F)return new d(e[F]);if("telstr"==F)return new f(e[F]);if("ia5str"==F)return new p(e[F]);if("utctime"==F)return new g(e[F]);if("gentime"==F)return new y(e[F]);if("visstr"==F)return new v(e[F]);if("bmpstr"==F)return new m(e[F]);if("asn1"==F)return new r(e[F]);if("seq"==F){for(var A=e[F],k=[],x=0;x<A.length;x++){var P=b(A[x]);k.push(P)}return new w({array:k})}if("set"==F){for(A=e[F],k=[],x=0;x<A.length;x++)P=b(A[x]),k.push(P);return new _({array:k})}if("tag"==F){var C=e[F];if("[object Array]"===Object.prototype.toString.call(C)&&3==C.length){var I=b(C[2]);return new S({tag:C[0],explicit:C[1],obj:I})}return new S(C)}},this.jsonToASN1HEX=function(e){return this.newObject(e).getEncodedHex()}},ce.asn1.ASN1Util.oidHexToInt=function(e){for(var t="",r=parseInt(e.substr(0,2),16),n=(t=Math.floor(r/40)+"."+r%40,""),i=2;i<e.length;i+=2){var o=("00000000"+parseInt(e.substr(i,2),16).toString(2)).slice(-8);n+=o.substr(1,7),"0"==o.substr(0,1)&&(t=t+"."+new E(n,2).toString(10),n="")}return t},ce.asn1.ASN1Util.oidIntToHex=function(e){var t=function(e){var t=e.toString(16);return 1==t.length&&(t="0"+t),t},r=function(e){var r="",n=new E(e,10).toString(2),i=7-n.length%7;7==i&&(i=0);for(var o="",s=0;s<i;s++)o+="0";for(n=o+n,s=0;s<n.length-1;s+=7){var a=n.substr(s,7);s!=n.length-7&&(a="1"+a),r+=t(parseInt(a,2))}return r};if(!e.match(/^[0-9.]+$/))throw"malformed oid string: "+e;var n="",i=e.split("."),o=40*parseInt(i[0])+parseInt(i[1]);n+=t(o),i.splice(0,2);for(var s=0;s<i.length;s++)n+=r(i[s]);return n},ce.asn1.ASN1Object=function(e){this.params=null,this.getLengthHexFromValue=function(){if(void 0===this.hV||null==this.hV)throw new Error("this.hV is null or undefined");if(this.hV.length%2==1)throw new Error("value hex must be even length: n="+"".length+",v="+this.hV);var e=this.hV.length/2,t=e.toString(16);if(t.length%2==1&&(t="0"+t),e<128)return t;var r=t.length/2;if(r>15)throw"ASN.1 length too long to represent by 8x: n = "+e.toString(16);return(128+r).toString(16)+t},this.getEncodedHex=function(){return(null==this.hTLV||this.isModified)&&(this.hV=this.getFreshValueHex(),this.hL=this.getLengthHexFromValue(),this.hTLV=this.hT+this.hL+this.hV,this.isModified=!1),this.hTLV},this.getValueHex=function(){return this.getEncodedHex(),this.hV},this.getFreshValueHex=function(){return""},this.setByParam=function(e){this.params=e},null!=e&&null!=e.tlv&&(this.hTLV=e.tlv,this.isModified=!1)},ce.asn1.DERAbstractString=function(e){ce.asn1.DERAbstractString.superclass.constructor.call(this),this.getString=function(){return this.s},this.setString=function(e){this.hTLV=null,this.isModified=!0,this.s=e,this.hV=Se(this.s).toLowerCase()},this.setStringHex=function(e){this.hTLV=null,this.isModified=!0,this.s=null,this.hV=e},this.getFreshValueHex=function(){return this.hV},void 0!==e&&("string"==typeof e?this.setString(e):void 0!==e.str?this.setString(e.str):void 0!==e.hex&&this.setStringHex(e.hex))},o.lang.extend(ce.asn1.DERAbstractString,ce.asn1.ASN1Object),ce.asn1.DERAbstractTime=function(e){ce.asn1.DERAbstractTime.superclass.constructor.call(this),this.localDateToUTC=function(e){var t=e.getTime()+6e4*e.getTimezoneOffset();return new Date(t)},this.formatDate=function(e,t,r){var n=this.zeroPadding,i=this.localDateToUTC(e),o=String(i.getFullYear());"utc"==t&&(o=o.substr(2,2));var s=o+n(String(i.getMonth()+1),2)+n(String(i.getDate()),2)+n(String(i.getHours()),2)+n(String(i.getMinutes()),2)+n(String(i.getSeconds()),2);if(!0===r){var a=i.getMilliseconds();if(0!=a){var u=n(String(a),3);s=s+"."+(u=u.replace(/[0]+$/,""))}}return s+"Z"},this.zeroPadding=function(e,t){return e.length>=t?e:new Array(t-e.length+1).join("0")+e},this.getString=function(){return this.s},this.setString=function(e){this.hTLV=null,this.isModified=!0,this.s=e,this.hV=ye(e)},this.setByDateValue=function(e,t,r,n,i,o){var s=new Date(Date.UTC(e,t-1,r,n,i,o,0));this.setByDate(s)},this.getFreshValueHex=function(){return this.hV}},o.lang.extend(ce.asn1.DERAbstractTime,ce.asn1.ASN1Object),ce.asn1.DERAbstractStructured=function(e){ce.asn1.DERAbstractString.superclass.constructor.call(this),this.setByASN1ObjectArray=function(e){this.hTLV=null,this.isModified=!0,this.asn1Array=e},this.appendASN1Object=function(e){this.hTLV=null,this.isModified=!0,this.asn1Array.push(e)},this.asn1Array=new Array,void 0!==e&&void 0!==e.array&&(this.asn1Array=e.array)},o.lang.extend(ce.asn1.DERAbstractStructured,ce.asn1.ASN1Object),ce.asn1.DERBoolean=function(e){ce.asn1.DERBoolean.superclass.constructor.call(this),this.hT="01",this.hTLV=0==e?"010100":"0101ff"},o.lang.extend(ce.asn1.DERBoolean,ce.asn1.ASN1Object),ce.asn1.DERInteger=function(e){ce.asn1.DERInteger.superclass.constructor.call(this),this.hT="02",this.setByBigInteger=function(e){this.hTLV=null,this.isModified=!0,this.hV=ce.asn1.ASN1Util.bigIntToMinTwosComplementsHex(e)},this.setByInteger=function(e){var t=new E(String(e),10);this.setByBigInteger(t)},this.setValueHex=function(e){this.hV=e},this.getFreshValueHex=function(){return this.hV},void 0!==e&&(void 0!==e.bigint?this.setByBigInteger(e.bigint):void 0!==e.int?this.setByInteger(e.int):"number"==typeof e?this.setByInteger(e):void 0!==e.hex&&this.setValueHex(e.hex))},o.lang.extend(ce.asn1.DERInteger,ce.asn1.ASN1Object),ce.asn1.DERBitString=function(e){if(void 0!==e&&void 0!==e.obj){var t=ce.asn1.ASN1Util.newObject(e.obj);e.hex="00"+t.getEncodedHex()}ce.asn1.DERBitString.superclass.constructor.call(this),this.hT="03",this.setHexValueIncludingUnusedBits=function(e){this.hTLV=null,this.isModified=!0,this.hV=e},this.setUnusedBitsAndHexValue=function(e,t){if(e<0||7<e)throw"unused bits shall be from 0 to 7: u = "+e;var r="0"+e;this.hTLV=null,this.isModified=!0,this.hV=r+t},this.setByBinaryString=function(e){var t=8-(e=e.replace(/0+$/,"")).length%8;8==t&&(t=0);for(var r=0;r<=t;r++)e+="0";var n="";for(r=0;r<e.length-1;r+=8){var i=e.substr(r,8),o=parseInt(i,2).toString(16);1==o.length&&(o="0"+o),n+=o}this.hTLV=null,this.isModified=!0,this.hV="0"+t+n},this.setByBooleanArray=function(e){for(var t="",r=0;r<e.length;r++)1==e[r]?t+="1":t+="0";this.setByBinaryString(t)},this.newFalseArray=function(e){for(var t=new Array(e),r=0;r<e;r++)t[r]=!1;return t},this.getFreshValueHex=function(){return this.hV},void 0!==e&&("string"==typeof e&&e.toLowerCase().match(/^[0-9a-f]+$/)?this.setHexValueIncludingUnusedBits(e):void 0!==e.hex?this.setHexValueIncludingUnusedBits(e.hex):void 0!==e.bin?this.setByBinaryString(e.bin):void 0!==e.array&&this.setByBooleanArray(e.array))},o.lang.extend(ce.asn1.DERBitString,ce.asn1.ASN1Object),ce.asn1.DEROctetString=function(e){if(void 0!==e&&void 0!==e.obj){var t=ce.asn1.ASN1Util.newObject(e.obj);e.hex=t.getEncodedHex()}ce.asn1.DEROctetString.superclass.constructor.call(this,e),this.hT="04"},o.lang.extend(ce.asn1.DEROctetString,ce.asn1.DERAbstractString),ce.asn1.DERNull=function(){ce.asn1.DERNull.superclass.constructor.call(this),this.hT="05",this.hTLV="0500"},o.lang.extend(ce.asn1.DERNull,ce.asn1.ASN1Object),ce.asn1.DERObjectIdentifier=function(e){ce.asn1.DERObjectIdentifier.superclass.constructor.call(this),this.hT="06",this.setValueHex=function(e){this.hTLV=null,this.isModified=!0,this.s=null,this.hV=e},this.setValueOidString=function(e){var t=function(e){var t=function(e){var t=e.toString(16);return 1==t.length&&(t="0"+t),t},r=function(e){var r="",n=parseInt(e,10).toString(2),i=7-n.length%7;7==i&&(i=0);for(var o="",s=0;s<i;s++)o+="0";for(n=o+n,s=0;s<n.length-1;s+=7){var a=n.substr(s,7);s!=n.length-7&&(a="1"+a),r+=t(parseInt(a,2))}return r};try{if(!e.match(/^[0-9.]+$/))return null;var n="",i=e.split("."),o=40*parseInt(i[0],10)+parseInt(i[1],10);n+=t(o),i.splice(0,2);for(var s=0;s<i.length;s++)n+=r(i[s]);return n}catch(e){return null}}(e);if(null==t)throw new Error("malformed oid string: "+e);this.hTLV=null,this.isModified=!0,this.s=null,this.hV=t},this.setValueName=function(e){var t=ce.asn1.x509.OID.name2oid(e);if(""===t)throw new Error("DERObjectIdentifier oidName undefined: "+e);this.setValueOidString(t)},this.setValueNameOrOid=function(e){e.match(/^[0-2].[0-9.]+$/)?this.setValueOidString(e):this.setValueName(e)},this.getFreshValueHex=function(){return this.hV},this.setByParam=function(e){"string"==typeof e?this.setValueNameOrOid(e):void 0!==e.oid?this.setValueNameOrOid(e.oid):void 0!==e.name?this.setValueNameOrOid(e.name):void 0!==e.hex&&this.setValueHex(e.hex)},void 0!==e&&this.setByParam(e)},o.lang.extend(ce.asn1.DERObjectIdentifier,ce.asn1.ASN1Object),ce.asn1.DEREnumerated=function(e){ce.asn1.DEREnumerated.superclass.constructor.call(this),this.hT="0a",this.setByBigInteger=function(e){this.hTLV=null,this.isModified=!0,this.hV=ce.asn1.ASN1Util.bigIntToMinTwosComplementsHex(e)},this.setByInteger=function(e){var t=new E(String(e),10);this.setByBigInteger(t)},this.setValueHex=function(e){this.hV=e},this.getFreshValueHex=function(){return this.hV},void 0!==e&&(void 0!==e.int?this.setByInteger(e.int):"number"==typeof e?this.setByInteger(e):void 0!==e.hex&&this.setValueHex(e.hex))},o.lang.extend(ce.asn1.DEREnumerated,ce.asn1.ASN1Object),ce.asn1.DERUTF8String=function(e){ce.asn1.DERUTF8String.superclass.constructor.call(this,e),this.hT="0c"},o.lang.extend(ce.asn1.DERUTF8String,ce.asn1.DERAbstractString),ce.asn1.DERNumericString=function(e){ce.asn1.DERNumericString.superclass.constructor.call(this,e),this.hT="12"},o.lang.extend(ce.asn1.DERNumericString,ce.asn1.DERAbstractString),ce.asn1.DERPrintableString=function(e){ce.asn1.DERPrintableString.superclass.constructor.call(this,e),this.hT="13"},o.lang.extend(ce.asn1.DERPrintableString,ce.asn1.DERAbstractString),ce.asn1.DERTeletexString=function(e){ce.asn1.DERTeletexString.superclass.constructor.call(this,e),this.hT="14"},o.lang.extend(ce.asn1.DERTeletexString,ce.asn1.DERAbstractString),ce.asn1.DERIA5String=function(e){ce.asn1.DERIA5String.superclass.constructor.call(this,e),this.hT="16"},o.lang.extend(ce.asn1.DERIA5String,ce.asn1.DERAbstractString),ce.asn1.DERVisibleString=function(e){ce.asn1.DERIA5String.superclass.constructor.call(this,e),this.hT="1a"},o.lang.extend(ce.asn1.DERVisibleString,ce.asn1.DERAbstractString),ce.asn1.DERBMPString=function(e){ce.asn1.DERBMPString.superclass.constructor.call(this,e),this.hT="1e"},o.lang.extend(ce.asn1.DERBMPString,ce.asn1.DERAbstractString),ce.asn1.DERUTCTime=function(e){ce.asn1.DERUTCTime.superclass.constructor.call(this,e),this.hT="17",this.setByDate=function(e){this.hTLV=null,this.isModified=!0,this.date=e,this.s=this.formatDate(this.date,"utc"),this.hV=ye(this.s)},this.getFreshValueHex=function(){return void 0===this.date&&void 0===this.s&&(this.date=new Date,this.s=this.formatDate(this.date,"utc"),this.hV=ye(this.s)),this.hV},void 0!==e&&(void 0!==e.str?this.setString(e.str):"string"==typeof e&&e.match(/^[0-9]{12}Z$/)?this.setString(e):void 0!==e.hex?this.setStringHex(e.hex):void 0!==e.date&&this.setByDate(e.date))},o.lang.extend(ce.asn1.DERUTCTime,ce.asn1.DERAbstractTime),ce.asn1.DERGeneralizedTime=function(e){ce.asn1.DERGeneralizedTime.superclass.constructor.call(this,e),this.hT="18",this.withMillis=!1,this.setByDate=function(e){this.hTLV=null,this.isModified=!0,this.date=e,this.s=this.formatDate(this.date,"gen",this.withMillis),this.hV=ye(this.s)},this.getFreshValueHex=function(){return void 0===this.date&&void 0===this.s&&(this.date=new Date,this.s=this.formatDate(this.date,"gen",this.withMillis),this.hV=ye(this.s)),this.hV},void 0!==e&&(void 0!==e.str?this.setString(e.str):"string"==typeof e&&e.match(/^[0-9]{14}Z$/)?this.setString(e):void 0!==e.hex?this.setStringHex(e.hex):void 0!==e.date&&this.setByDate(e.date),!0===e.millis&&(this.withMillis=!0))},o.lang.extend(ce.asn1.DERGeneralizedTime,ce.asn1.DERAbstractTime),ce.asn1.DERSequence=function(e){ce.asn1.DERSequence.superclass.constructor.call(this,e),this.hT="30",this.getFreshValueHex=function(){for(var e="",t=0;t<this.asn1Array.length;t++)e+=this.asn1Array[t].getEncodedHex();return this.hV=e,this.hV}},o.lang.extend(ce.asn1.DERSequence,ce.asn1.DERAbstractStructured),ce.asn1.DERSet=function(e){ce.asn1.DERSet.superclass.constructor.call(this,e),this.hT="31",this.sortFlag=!0,this.getFreshValueHex=function(){for(var e=new Array,t=0;t<this.asn1Array.length;t++){var r=this.asn1Array[t];e.push(r.getEncodedHex())}return 1==this.sortFlag&&e.sort(),this.hV=e.join(""),this.hV},void 0!==e&&void 0!==e.sortflag&&0==e.sortflag&&(this.sortFlag=!1)},o.lang.extend(ce.asn1.DERSet,ce.asn1.DERAbstractStructured),ce.asn1.DERTaggedObject=function(e){ce.asn1.DERTaggedObject.superclass.constructor.call(this);var t=ce.asn1;this.hT="a0",this.hV="",this.isExplicit=!0,this.asn1Object=null,this.setASN1Object=function(e,t,r){this.hT=t,this.isExplicit=e,this.asn1Object=r,this.isExplicit?(this.hV=this.asn1Object.getEncodedHex(),this.hTLV=null,this.isModified=!0):(this.hV=null,this.hTLV=r.getEncodedHex(),this.hTLV=this.hTLV.replace(/^../,t),this.isModified=!1)},this.getFreshValueHex=function(){return this.hV},this.setByParam=function(e){null!=e.tag&&(this.hT=e.tag),null!=e.explicit&&(this.isExplicit=e.explicit),null!=e.tage&&(this.hT=e.tage,this.isExplicit=!0),null!=e.tagi&&(this.hT=e.tagi,this.isExplicit=!1),null!=e.obj&&(e.obj instanceof t.ASN1Object?(this.asn1Object=e.obj,this.setASN1Object(this.isExplicit,this.hT,this.asn1Object)):"object"==r(e.obj)&&(this.asn1Object=t.ASN1Util.newObject(e.obj),this.setASN1Object(this.isExplicit,this.hT,this.asn1Object)))},null!=e&&this.setByParam(e)},o.lang.extend(ce.asn1.DERTaggedObject,ce.asn1.ASN1Object);var ce,he,le,de=new function(){};function fe(e){for(var t=new Array,r=0;r<e.length;r++)t[r]=e.charCodeAt(r);return t}function pe(e){for(var t="",r=0;r<e.length;r++)t+=String.fromCharCode(e[r]);return t}function ge(e){for(var t="",r=0;r<e.length;r++){var n=e[r].toString(16);1==n.length&&(n="0"+n),t+=n}return t}function ye(e){return ge(fe(e))}function ve(e){return(e=(e=e.replace(/\=/g,"")).replace(/\+/g,"-")).replace(/\//g,"_")}function me(e){return e.length%4==2?e+="==":e.length%4==3&&(e+="="),(e=e.replace(/-/g,"+")).replace(/_/g,"/")}function we(e){return e.length%2==1&&(e="0"+e),ve(_(e))}function _e(e){return S(me(e))}function Se(e){return Re(He(e))}function be(e){return decodeURIComponent(Ue(e))}function Ee(e){for(var t="",r=0;r<e.length-1;r+=2)t+=String.fromCharCode(parseInt(e.substr(r,2),16));return t}function Fe(e){for(var t="",r=0;r<e.length;r++)t+=("0"+e.charCodeAt(r).toString(16)).slice(-2);return t}function Ae(e){return _(e)}function ke(e){return Ae(e).replace(/(.{64})/g,"$1\r\n").replace(/\r\n$/,"")}function xe(e){return S(e.replace(/[^0-9A-Za-z\/+=]*/g,""))}function Pe(e,t){return"-----BEGIN "+t+"-----\r\n"+ke(e)+"\r\n-----END "+t+"-----\r\n"}function Ce(e,t){if(-1==e.indexOf("-----BEGIN "))throw"can't find PEM header: "+t;return xe(e=void 0!==t?(e=e.replace(new RegExp("^[^]*-----BEGIN "+t+"-----"),"")).replace(new RegExp("-----END "+t+"-----[^]*$"),""):(e=e.replace(/^[^]*-----BEGIN [^-]+-----/,"")).replace(/-----END [^-]+-----[^]*$/,""))}function Ie(e){var t,r,n,i,o,s,a,u,c,h,l;if(l=e.match(/^(\d{2}|\d{4})(\d\d)(\d\d)(\d\d)(\d\d)(\d\d)(|\.\d+)Z$/))return u=l[1],t=parseInt(u),2===u.length&&(50<=t&&t<100?t=1900+t:0<=t&&t<50&&(t=2e3+t)),r=parseInt(l[2])-1,n=parseInt(l[3]),i=parseInt(l[4]),o=parseInt(l[5]),s=parseInt(l[6]),a=0,""!==(c=l[7])&&(h=(c.substr(1)+"00").substr(0,3),a=parseInt(h)),Date.UTC(t,r,n,i,o,s,a);throw"unsupported zulu format: "+e}function Te(e){return~~(Ie(e)/1e3)}function Re(e){return e.replace(/%/g,"")}function Ue(e){return e.replace(/(..)/g,"%$1")}function Oe(e){var t="malformed IPv6 address";if(!e.match(/^[0-9A-Fa-f:]+$/))throw t;var r=(e=e.toLowerCase()).split(":").length-1;if(r<2)throw t;var n=":".repeat(7-r+2),i=(e=e.replace("::",n)).split(":");if(8!=i.length)throw t;for(var o=0;o<8;o++)i[o]=("0000"+i[o]).slice(-4);return i.join("")}function De(e){if(!e.match(/^[0-9A-Fa-f]{32}$/))throw"malformed IPv6 address octet";for(var t=(e=e.toLowerCase()).match(/.{1,4}/g),r=0;r<8;r++)t[r]=t[r].replace(/^0+/,""),""==t[r]&&(t[r]="0");var n=(e=":"+t.join(":")+":").match(/:(0:){2,}/g);if(null===n)return e.slice(1,-1);var i="";for(r=0;r<n.length;r++)n[r].length>i.length&&(i=n[r]);return(e=e.replace(i,"::")).slice(1,-1)}function Le(e){var t="malformed hex value";if(!e.match(/^([0-9A-Fa-f][0-9A-Fa-f]){1,}$/))throw t;if(8!=e.length)return 32==e.length?De(e):e;try{return parseInt(e.substr(0,2),16)+"."+parseInt(e.substr(2,2),16)+"."+parseInt(e.substr(4,2),16)+"."+parseInt(e.substr(6,2),16)}catch(e){throw t}}function He(e){for(var t=encodeURIComponent(e),r="",n=0;n<t.length;n++)"%"==t[n]?(r+=t.substr(n,3),n+=2):r=r+"%"+ye(t[n]);return r}function Me(e){return!(e.length%2!=0||!e.match(/^[0-9a-f]+$/)&&!e.match(/^[0-9A-F]+$/))}function Ne(e){return e.length%2==1?"0"+e:e.substr(0,1)>"7"?"00"+e:e}de.getLblen=function(e,t){if("8"!=e.substr(t+2,1))return 1;var r=parseInt(e.substr(t+3,1));return 0==r?-1:0<r&&r<10?r+1:-2},de.getL=function(e,t){var r=de.getLblen(e,t);return r<1?"":e.substr(t+2,2*r)},de.getVblen=function(e,t){var r;return""==(r=de.getL(e,t))?-1:("8"===r.substr(0,1)?new E(r.substr(2),16):new E(r,16)).intValue()},de.getVidx=function(e,t){var r=de.getLblen(e,t);return r<0?r:t+2*(r+1)},de.getV=function(e,t){var r=de.getVidx(e,t),n=de.getVblen(e,t);return e.substr(r,2*n)},de.getTLV=function(e,t){return e.substr(t,2)+de.getL(e,t)+de.getV(e,t)},de.getTLVblen=function(e,t){return 2+2*de.getLblen(e,t)+2*de.getVblen(e,t)},de.getNextSiblingIdx=function(e,t){return de.getVidx(e,t)+2*de.getVblen(e,t)},de.getChildIdx=function(e,t){var r,n,i,o=de,s=[];r=o.getVidx(e,t),n=2*o.getVblen(e,t),"03"==e.substr(t,2)&&(r+=2,n-=2),i=0;for(var a=r;i<=n;){var u=o.getTLVblen(e,a);if((i+=u)<=n&&s.push(a),a+=u,i>=n)break}return s},de.getNthChildIdx=function(e,t,r){return de.getChildIdx(e,t)[r]},de.getIdxbyList=function(e,t,r,n){var i,o,s=de;return 0==r.length?void 0!==n&&e.substr(t,2)!==n?-1:t:(i=r.shift())>=(o=s.getChildIdx(e,t)).length?-1:s.getIdxbyList(e,o[i],r,n)},de.getIdxbyListEx=function(e,t,r,n){var i,o,s=de;if(0==r.length)return void 0!==n&&e.substr(t,2)!==n?-1:t;i=r.shift(),o=s.getChildIdx(e,t);for(var a=0,u=0;u<o.length;u++){var c=e.substr(o[u],2);if("number"==typeof i&&!s.isContextTag(c)&&a==i||"string"==typeof i&&s.isContextTag(c,i))return s.getIdxbyListEx(e,o[u],r,n);s.isContextTag(c)||a++}return-1},de.getTLVbyList=function(e,t,r,n){var i=de,o=i.getIdxbyList(e,t,r,n);return-1==o||o>=e.length?null:i.getTLV(e,o)},de.getTLVbyListEx=function(e,t,r,n){var i=de,o=i.getIdxbyListEx(e,t,r,n);return-1==o?null:i.getTLV(e,o)},de.getVbyList=function(e,t,r,n,i){var o,s,a=de;return-1==(o=a.getIdxbyList(e,t,r,n))||o>=e.length?null:(s=a.getV(e,o),!0===i&&(s=s.substr(2)),s)},de.getVbyListEx=function(e,t,r,n,i){var o,s,a=de;return-1==(o=a.getIdxbyListEx(e,t,r,n))?null:(s=a.getV(e,o),"03"==e.substr(o,2)&&!1!==i&&(s=s.substr(2)),s)},de.getInt=function(e,t,r){null==r&&(r=-1);try{var n=e.substr(t,2);if("02"!=n&&"03"!=n)return r;var i=de.getV(e,t);return"02"==n?parseInt(i,16):function(e){try{var t=e.substr(0,2);if("00"==t)return parseInt(e.substr(2),16);var r=parseInt(t,16),n=e.substr(2),i=parseInt(n,16).toString(2);return"0"==i&&(i="00000000"),i=i.slice(0,0-r),parseInt(i,2)}catch(e){return-1}}(i)}catch(e){return r}},de.getOID=function(e,t,r){null==r&&(r=null);try{return"06"!=e.substr(t,2)?r:function(e){if(!Me(e))return null;try{var t=[],r=e.substr(0,2),n=parseInt(r,16);t[0]=new String(Math.floor(n/40)),t[1]=new String(n%40);for(var i=e.substr(2),o=[],s=0;s<i.length/2;s++)o.push(parseInt(i.substr(2*s,2),16));var a=[],u="";for(s=0;s<o.length;s++)128&o[s]?u+=je((127&o[s]).toString(2),7):(u+=je((127&o[s]).toString(2),7),a.push(new String(parseInt(u,2))),u="");var c=t.join(".");return a.length>0&&(c=c+"."+a.join(".")),c}catch(e){return null}}(de.getV(e,t))}catch(e){return r}},de.getOIDName=function(e,t,r){null==r&&(r=null);try{var n=de.getOID(e,t,r);if(n==r)return r;var i=ce.asn1.x509.OID.oid2name(n);return""==i?n:i}catch(e){return r}},de.getString=function(e,t,r){null==r&&(r=null);try{return Ee(de.getV(e,t))}catch(e){return r}},de.hextooidstr=function(e){var t=function(e,t){return e.length>=t?e:new Array(t-e.length+1).join("0")+e},r=[],n=e.substr(0,2),i=parseInt(n,16);r[0]=new String(Math.floor(i/40)),r[1]=new String(i%40);for(var o=e.substr(2),s=[],a=0;a<o.length/2;a++)s.push(parseInt(o.substr(2*a,2),16));var u=[],c="";for(a=0;a<s.length;a++)128&s[a]?c+=t((127&s[a]).toString(2),7):(c+=t((127&s[a]).toString(2),7),u.push(new String(parseInt(c,2))),c="");var h=r.join(".");return u.length>0&&(h=h+"."+u.join(".")),h},de.dump=function(e,t,r,n){var i=de,o=i.getV,s=i.dump,a=i.getChildIdx,u=e;e instanceof ce.asn1.ASN1Object&&(u=e.getEncodedHex());var c=function(e,t){return e.length<=2*t?e:e.substr(0,t)+"..(total "+e.length/2+"bytes).."+e.substr(e.length-t,t)};void 0===t&&(t={ommit_long_octet:32}),void 0===r&&(r=0),void 0===n&&(n="");var h,l=t.ommit_long_octet;if("01"==(h=u.substr(r,2)))return"00"==(d=o(u,r))?n+"BOOLEAN FALSE\n":n+"BOOLEAN TRUE\n";if("02"==h)return n+"INTEGER "+c(d=o(u,r),l)+"\n";if("03"==h){var d=o(u,r);return i.isASN1HEX(d.substr(2))?(S=n+"BITSTRING, encapsulates\n")+s(d.substr(2),t,0,n+"  "):n+"BITSTRING "+c(d,l)+"\n"}if("04"==h)return d=o(u,r),i.isASN1HEX(d)?(S=n+"OCTETSTRING, encapsulates\n")+s(d,t,0,n+"  "):n+"OCTETSTRING "+c(d,l)+"\n";if("05"==h)return n+"NULL\n";if("06"==h){var f=o(u,r),p=ce.asn1.ASN1Util.oidHexToInt(f),g=ce.asn1.x509.OID.oid2name(p),y=p.replace(/\./g," ");return""!=g?n+"ObjectIdentifier "+g+" ("+y+")\n":n+"ObjectIdentifier ("+y+")\n"}if("0a"==h)return n+"ENUMERATED "+parseInt(o(u,r))+"\n";if("0c"==h)return n+"UTF8String '"+be(o(u,r))+"'\n";if("13"==h)return n+"PrintableString '"+be(o(u,r))+"'\n";if("14"==h)return n+"TeletexString '"+be(o(u,r))+"'\n";if("16"==h)return n+"IA5String '"+be(o(u,r))+"'\n";if("17"==h)return n+"UTCTime "+be(o(u,r))+"\n";if("18"==h)return n+"GeneralizedTime "+be(o(u,r))+"\n";if("1a"==h)return n+"VisualString '"+be(o(u,r))+"'\n";if("1e"==h)return n+"BMPString '"+be(o(u,r))+"'\n";if("30"==h){if("3000"==u.substr(r,4))return n+"SEQUENCE {}\n";S=n+"SEQUENCE\n";var v=t;if((2==(_=a(u,r)).length||3==_.length)&&"06"==u.substr(_[0],2)&&"04"==u.substr(_[_.length-1],2)){g=i.oidname(o(u,_[0]));var m=JSON.parse(JSON.stringify(t));m.x509ExtName=g,v=m}for(var w=0;w<_.length;w++)S+=s(u,v,_[w],n+"  ");return S}if("31"==h){S=n+"SET\n";var _=a(u,r);for(w=0;w<_.length;w++)S+=s(u,t,_[w],n+"  ");return S}if(0!=(128&(h=parseInt(h,16)))){var S,b=31&h;if(0!=(32&h)){for(S=n+"["+b+"]\n",_=a(u,r),w=0;w<_.length;w++)S+=s(u,t,_[w],n+"  ");return S}return d=o(u,r),de.isASN1HEX(d)?(S=n+"["+b+"]\n")+s(d,t,0,n+"  "):(("68747470"==d.substr(0,8)||"subjectAltName"===t.x509ExtName&&2==b)&&(d=be(d)),n+"["+b+"] "+d+"\n")}return n+"UNKNOWN("+h+") "+o(u,r)+"\n"},de.isContextTag=function(e,t){var r,n;e=e.toLowerCase();try{r=parseInt(e,16)}catch(e){return-1}if(void 0===t)return 128==(192&r);try{return null!=t.match(/^\[[0-9]+\]$/)&&!((n=parseInt(t.substr(1,t.length-1),10))>31)&&128==(192&r)&&(31&r)==n}catch(e){return!1}},de.isASN1HEX=function(e){var t=de;if(e.length%2==1)return!1;var r=t.getVblen(e,0),n=e.substr(0,2),i=t.getL(e,0);return e.length-n.length-i.length==2*r},de.checkStrictDER=function(e,t,r,n,i){var o=de;if(void 0===r){if("string"!=typeof e)throw new Error("not hex string");if(e=e.toLowerCase(),!ce.lang.String.isHex(e))throw new Error("not hex string");r=e.length,i=(n=e.length/2)<128?1:Math.ceil(n.toString(16))+1}if(o.getL(e,t).length>2*i)throw new Error("L of TLV too long: idx="+t);var s=o.getVblen(e,t);if(s>n)throw new Error("value of L too long than hex: idx="+t);var a=o.getTLV(e,t),u=a.length-2-o.getL(e,t).length;if(u!==2*s)throw new Error("V string length and L's value not the same:"+u+"/"+2*s);if(0===t&&e.length!=a.length)throw new Error("total length and TLV length unmatch:"+e.length+"!="+a.length);var c=e.substr(t,2);if("02"===c){var h=o.getVidx(e,t);if("00"==e.substr(h,2)&&e.charCodeAt(h+2)<56)throw new Error("not least zeros for DER INTEGER")}if(32&parseInt(c,16)){for(var l=o.getVblen(e,t),d=0,f=o.getChildIdx(e,t),p=0;p<f.length;p++)d+=o.getTLV(e,f[p]).length,o.checkStrictDER(e,f[p],r,n,i);if(2*l!=d)throw new Error("sum of children's TLV length and L unmatch: "+2*l+"!="+d)}},de.oidname=function(e){var t=ce.asn1;ce.lang.String.isHex(e)&&(e=t.ASN1Util.oidHexToInt(e));var r=t.x509.OID.oid2name(e);return""===r&&(r=e),r},void 0!==ce&&ce||(t.KJUR=ce={}),void 0!==ce.lang&&ce.lang||(ce.lang={}),ce.lang.String=function(){},"function"==typeof e?(t.utf8tob64u=he=function(t){return ve(e.from(t,"utf8").toString("base64"))},t.b64utoutf8=le=function(t){return e.from(me(t),"base64").toString("utf8")}):(t.utf8tob64u=he=function(e){return we(Re(He(e)))},t.b64utoutf8=le=function(e){return decodeURIComponent(Ue(_e(e)))}),ce.lang.String.isInteger=function(e){return!!e.match(/^[0-9]+$/)||!!e.match(/^-[0-9]+$/)},ce.lang.String.isHex=function(e){return Me(e)},ce.lang.String.isBase64=function(e){return!(!(e=e.replace(/\s+/g,"")).match(/^[0-9A-Za-z+\/]+={0,3}$/)||e.length%4!=0)},ce.lang.String.isBase64URL=function(e){return!e.match(/[+/=]/)&&(e=me(e),ce.lang.String.isBase64(e))},ce.lang.String.isIntegerArray=function(e){return!!(e=e.replace(/\s+/g,"")).match(/^\[[0-9,]+\]$/)},ce.lang.String.isPrintable=function(e){return null!==e.match(/^[0-9A-Za-z '()+,-./:=?]*$/)},ce.lang.String.isIA5=function(e){return null!==e.match(/^[\x20-\x21\x23-\x7f]*$/)},ce.lang.String.isMail=function(e){return null!==e.match(/^[A-Za-z0-9]{1}[A-Za-z0-9_.-]*@{1}[A-Za-z0-9_.-]{1,}\.[A-Za-z0-9]{1,}$/)};var je=function(e,t,r){return null==r&&(r="0"),e.length>=t?e:new Array(t-e.length+1).join(r)+e};void 0!==ce&&ce||(t.KJUR=ce={}),void 0!==ce.crypto&&ce.crypto||(ce.crypto={}),ce.crypto.Util=new function(){this.DIGESTINFOHEAD={sha1:"3021300906052b0e03021a05000414",sha224:"302d300d06096086480165030402040500041c",sha256:"3031300d060960864801650304020105000420",sha384:"3041300d060960864801650304020205000430",sha512:"3051300d060960864801650304020305000440",md2:"3020300c06082a864886f70d020205000410",md5:"3020300c06082a864886f70d020505000410",ripemd160:"3021300906052b2403020105000414"},this.DEFAULTPROVIDER={md5:"cryptojs",sha1:"cryptojs",sha224:"cryptojs",sha256:"cryptojs",sha384:"cryptojs",sha512:"cryptojs",ripemd160:"cryptojs",hmacmd5:"cryptojs",hmacsha1:"cryptojs",hmacsha224:"cryptojs",hmacsha256:"cryptojs",hmacsha384:"cryptojs",hmacsha512:"cryptojs",hmacripemd160:"cryptojs",MD5withRSA:"cryptojs/jsrsa",SHA1withRSA:"cryptojs/jsrsa",SHA224withRSA:"cryptojs/jsrsa",SHA256withRSA:"cryptojs/jsrsa",SHA384withRSA:"cryptojs/jsrsa",SHA512withRSA:"cryptojs/jsrsa",RIPEMD160withRSA:"cryptojs/jsrsa",MD5withECDSA:"cryptojs/jsrsa",SHA1withECDSA:"cryptojs/jsrsa",SHA224withECDSA:"cryptojs/jsrsa",SHA256withECDSA:"cryptojs/jsrsa",SHA384withECDSA:"cryptojs/jsrsa",SHA512withECDSA:"cryptojs/jsrsa",RIPEMD160withECDSA:"cryptojs/jsrsa",SHA1withDSA:"cryptojs/jsrsa",SHA224withDSA:"cryptojs/jsrsa",SHA256withDSA:"cryptojs/jsrsa",MD5withRSAandMGF1:"cryptojs/jsrsa",SHAwithRSAandMGF1:"cryptojs/jsrsa",SHA1withRSAandMGF1:"cryptojs/jsrsa",SHA224withRSAandMGF1:"cryptojs/jsrsa",SHA256withRSAandMGF1:"cryptojs/jsrsa",SHA384withRSAandMGF1:"cryptojs/jsrsa",SHA512withRSAandMGF1:"cryptojs/jsrsa",RIPEMD160withRSAandMGF1:"cryptojs/jsrsa"},this.CRYPTOJSMESSAGEDIGESTNAME={md5:v.algo.MD5,sha1:v.algo.SHA1,sha224:v.algo.SHA224,sha256:v.algo.SHA256,sha384:v.algo.SHA384,sha512:v.algo.SHA512,ripemd160:v.algo.RIPEMD160},this.getDigestInfoHex=function(e,t){if(void 0===this.DIGESTINFOHEAD[t])throw"alg not supported in Util.DIGESTINFOHEAD: "+t;return this.DIGESTINFOHEAD[t]+e},this.getPaddedDigestInfoHex=function(e,t,r){var n=this.getDigestInfoHex(e,t),i=r/4;if(n.length+22>i)throw"key is too short for SigAlg: keylen="+r+","+t;for(var o="0001",s="00"+n,a="",u=i-o.length-s.length,c=0;c<u;c+=2)a+="ff";return o+a+s},this.hashString=function(e,t){return new ce.crypto.MessageDigest({alg:t}).digestString(e)},this.hashHex=function(e,t){return new ce.crypto.MessageDigest({alg:t}).digestHex(e)},this.sha1=function(e){return this.hashString(e,"sha1")},this.sha256=function(e){return this.hashString(e,"sha256")},this.sha256Hex=function(e){return this.hashHex(e,"sha256")},this.sha512=function(e){return this.hashString(e,"sha512")},this.sha512Hex=function(e){return this.hashHex(e,"sha512")},this.isKey=function(e){return e instanceof ie||e instanceof ce.crypto.DSA||e instanceof ce.crypto.ECDSA}},ce.crypto.Util.md5=function(e){return new ce.crypto.MessageDigest({alg:"md5",prov:"cryptojs"}).digestString(e)},ce.crypto.Util.ripemd160=function(e){return new ce.crypto.MessageDigest({alg:"ripemd160",prov:"cryptojs"}).digestString(e)},ce.crypto.Util.SECURERANDOMGEN=new te,ce.crypto.Util.getRandomHexOfNbytes=function(e){var t=new Array(e);return ce.crypto.Util.SECURERANDOMGEN.nextBytes(t),ge(t)},ce.crypto.Util.getRandomBigIntegerOfNbytes=function(e){return new E(ce.crypto.Util.getRandomHexOfNbytes(e),16)},ce.crypto.Util.getRandomHexOfNbits=function(e){var t=e%8,r=new Array((e-t)/8+1);return ce.crypto.Util.SECURERANDOMGEN.nextBytes(r),r[0]=(255<<t&255^255)&r[0],ge(r)},ce.crypto.Util.getRandomBigIntegerOfNbits=function(e){return new E(ce.crypto.Util.getRandomHexOfNbits(e),16)},ce.crypto.Util.getRandomBigIntegerZeroToMax=function(e){for(var t=e.bitLength();;){var r=ce.crypto.Util.getRandomBigIntegerOfNbits(t);if(-1!=e.compareTo(r))return r}},ce.crypto.Util.getRandomBigIntegerMinToMax=function(e,t){var r=e.compareTo(t);if(1==r)throw"biMin is greater than biMax";if(0==r)return e;var n=t.subtract(e);return ce.crypto.Util.getRandomBigIntegerZeroToMax(n).add(e)},ce.crypto.MessageDigest=function(e){this.setAlgAndProvider=function(e,t){if(null!==(e=ce.crypto.MessageDigest.getCanonicalAlgName(e))&&void 0===t&&(t=ce.crypto.Util.DEFAULTPROVIDER[e]),-1!=":md5:sha1:sha224:sha256:sha384:sha512:ripemd160:".indexOf(e)&&"cryptojs"==t){try{this.md=ce.crypto.Util.CRYPTOJSMESSAGEDIGESTNAME[e].create()}catch(t){throw"setAlgAndProvider hash alg set fail alg="+e+"/"+t}this.updateString=function(e){this.md.update(e)},this.updateHex=function(e){var t=v.enc.Hex.parse(e);this.md.update(t)},this.digest=function(){return this.md.finalize().toString(v.enc.Hex)},this.digestString=function(e){return this.updateString(e),this.digest()},this.digestHex=function(e){return this.updateHex(e),this.digest()}}if(-1!=":sha256:".indexOf(e)&&"sjcl"==t){try{this.md=new sjcl.hash.sha256}catch(t){throw"setAlgAndProvider hash alg set fail alg="+e+"/"+t}this.updateString=function(e){this.md.update(e)},this.updateHex=function(e){var t=sjcl.codec.hex.toBits(e);this.md.update(t)},this.digest=function(){var e=this.md.finalize();return sjcl.codec.hex.fromBits(e)},this.digestString=function(e){return this.updateString(e),this.digest()},this.digestHex=function(e){return this.updateHex(e),this.digest()}}},this.updateString=function(e){throw"updateString(str) not supported for this alg/prov: "+this.algName+"/"+this.provName},this.updateHex=function(e){throw"updateHex(hex) not supported for this alg/prov: "+this.algName+"/"+this.provName},this.digest=function(){throw"digest() not supported for this alg/prov: "+this.algName+"/"+this.provName},this.digestString=function(e){throw"digestString(str) not supported for this alg/prov: "+this.algName+"/"+this.provName},this.digestHex=function(e){throw"digestHex(hex) not supported for this alg/prov: "+this.algName+"/"+this.provName},void 0!==e&&void 0!==e.alg&&(this.algName=e.alg,void 0===e.prov&&(this.provName=ce.crypto.Util.DEFAULTPROVIDER[this.algName]),this.setAlgAndProvider(this.algName,this.provName))},ce.crypto.MessageDigest.getCanonicalAlgName=function(e){return"string"==typeof e&&(e=(e=e.toLowerCase()).replace(/-/,"")),e},ce.crypto.MessageDigest.getHashLength=function(e){var t=ce.crypto.MessageDigest,r=t.getCanonicalAlgName(e);if(void 0===t.HASHLENGTH[r])throw"not supported algorithm: "+e;return t.HASHLENGTH[r]},ce.crypto.MessageDigest.HASHLENGTH={md5:16,sha1:20,sha224:28,sha256:32,sha384:48,sha512:64,ripemd160:20},ce.crypto.Mac=function(e){this.setAlgAndProvider=function(e,t){if(null==(e=e.toLowerCase())&&(e="hmacsha1"),"hmac"!=(e=e.toLowerCase()).substr(0,4))throw"setAlgAndProvider unsupported HMAC alg: "+e;void 0===t&&(t=ce.crypto.Util.DEFAULTPROVIDER[e]),this.algProv=e+"/"+t;var r=e.substr(4);if(-1!=":md5:sha1:sha224:sha256:sha384:sha512:ripemd160:".indexOf(r)&&"cryptojs"==t){try{var n=ce.crypto.Util.CRYPTOJSMESSAGEDIGESTNAME[r];this.mac=v.algo.HMAC.create(n,this.pass)}catch(e){throw"setAlgAndProvider hash alg set fail hashAlg="+r+"/"+e}this.updateString=function(e){this.mac.update(e)},this.updateHex=function(e){var t=v.enc.Hex.parse(e);this.mac.update(t)},this.doFinal=function(){return this.mac.finalize().toString(v.enc.Hex)},this.doFinalString=function(e){return this.updateString(e),this.doFinal()},this.doFinalHex=function(e){return this.updateHex(e),this.doFinal()}}},this.updateString=function(e){throw"updateString(str) not supported for this alg/prov: "+this.algProv},this.updateHex=function(e){throw"updateHex(hex) not supported for this alg/prov: "+this.algProv},this.doFinal=function(){throw"digest() not supported for this alg/prov: "+this.algProv},this.doFinalString=function(e){throw"digestString(str) not supported for this alg/prov: "+this.algProv},this.doFinalHex=function(e){throw"digestHex(hex) not supported for this alg/prov: "+this.algProv},this.setPassword=function(e){if("string"==typeof e){var t=e;return e.length%2!=1&&e.match(/^[0-9A-Fa-f]+$/)||(t=Fe(e)),void(this.pass=v.enc.Hex.parse(t))}if("object"!=(void 0===e?"undefined":r(e)))throw"KJUR.crypto.Mac unsupported password type: "+e;if(t=null,void 0!==e.hex){if(e.hex.length%2!=0||!e.hex.match(/^[0-9A-Fa-f]+$/))throw"Mac: wrong hex password: "+e.hex;t=e.hex}if(void 0!==e.utf8&&(t=Se(e.utf8)),void 0!==e.rstr&&(t=Fe(e.rstr)),void 0!==e.b64&&(t=S(e.b64)),void 0!==e.b64u&&(t=_e(e.b64u)),null==t)throw"KJUR.crypto.Mac unsupported password type: "+e;this.pass=v.enc.Hex.parse(t)},void 0!==e&&(void 0!==e.pass&&this.setPassword(e.pass),void 0!==e.alg&&(this.algName=e.alg,void 0===e.prov&&(this.provName=ce.crypto.Util.DEFAULTPROVIDER[this.algName]),this.setAlgAndProvider(this.algName,this.provName)))},ce.crypto.Signature=function(e){var t=null;if(this._setAlgNames=function(){var e=this.algName.match(/^(.+)with(.+)$/);e&&(this.mdAlgName=e[1].toLowerCase(),this.pubkeyAlgName=e[2].toLowerCase(),"rsaandmgf1"==this.pubkeyAlgName&&"sha"==this.mdAlgName&&(this.mdAlgName="sha1"))},this._zeroPaddingOfSignature=function(e,t){for(var r="",n=t/4-e.length,i=0;i<n;i++)r+="0";return r+e},this.setAlgAndProvider=function(e,t){if(this._setAlgNames(),"cryptojs/jsrsa"!=t)throw new Error("provider not supported: "+t);if(-1!=":md5:sha1:sha224:sha256:sha384:sha512:ripemd160:".indexOf(this.mdAlgName)){try{this.md=new ce.crypto.MessageDigest({alg:this.mdAlgName})}catch(e){throw new Error("setAlgAndProvider hash alg set fail alg="+this.mdAlgName+"/"+e)}this.init=function(e,t){var r=null;try{r=void 0===t?Be.getKey(e):Be.getKey(e,t)}catch(e){throw"init failed:"+e}if(!0===r.isPrivate)this.prvKey=r,this.state="SIGN";else{if(!0!==r.isPublic)throw"init failed.:"+r;this.pubKey=r,this.state="VERIFY"}},this.updateString=function(e){this.md.updateString(e)},this.updateHex=function(e){this.md.updateHex(e)},this.sign=function(){if(this.sHashHex=this.md.digest(),void 0===this.prvKey&&void 0!==this.ecprvhex&&void 0!==this.eccurvename&&void 0!==ce.crypto.ECDSA&&(this.prvKey=new ce.crypto.ECDSA({curve:this.eccurvename,prv:this.ecprvhex})),this.prvKey instanceof ie&&"rsaandmgf1"===this.pubkeyAlgName)this.hSign=this.prvKey.signWithMessageHashPSS(this.sHashHex,this.mdAlgName,this.pssSaltLen);else if(this.prvKey instanceof ie&&"rsa"===this.pubkeyAlgName)this.hSign=this.prvKey.signWithMessageHash(this.sHashHex,this.mdAlgName);else if(this.prvKey instanceof ce.crypto.ECDSA)this.hSign=this.prvKey.signWithMessageHash(this.sHashHex);else{if(!(this.prvKey instanceof ce.crypto.DSA))throw"Signature: unsupported private key alg: "+this.pubkeyAlgName;this.hSign=this.prvKey.signWithMessageHash(this.sHashHex)}return this.hSign},this.signString=function(e){return this.updateString(e),this.sign()},this.signHex=function(e){return this.updateHex(e),this.sign()},this.verify=function(e){if(this.sHashHex=this.md.digest(),void 0===this.pubKey&&void 0!==this.ecpubhex&&void 0!==this.eccurvename&&void 0!==ce.crypto.ECDSA&&(this.pubKey=new ce.crypto.ECDSA({curve:this.eccurvename,pub:this.ecpubhex})),this.pubKey instanceof ie&&"rsaandmgf1"===this.pubkeyAlgName)return this.pubKey.verifyWithMessageHashPSS(this.sHashHex,e,this.mdAlgName,this.pssSaltLen);if(this.pubKey instanceof ie&&"rsa"===this.pubkeyAlgName)return this.pubKey.verifyWithMessageHash(this.sHashHex,e);if(void 0!==ce.crypto.ECDSA&&this.pubKey instanceof ce.crypto.ECDSA)return this.pubKey.verifyWithMessageHash(this.sHashHex,e);if(void 0!==ce.crypto.DSA&&this.pubKey instanceof ce.crypto.DSA)return this.pubKey.verifyWithMessageHash(this.sHashHex,e);throw"Signature: unsupported public key alg: "+this.pubkeyAlgName}}},this.init=function(e,t){throw"init(key, pass) not supported for this alg:prov="+this.algProvName},this.updateString=function(e){throw"updateString(str) not supported for this alg:prov="+this.algProvName},this.updateHex=function(e){throw"updateHex(hex) not supported for this alg:prov="+this.algProvName},this.sign=function(){throw"sign() not supported for this alg:prov="+this.algProvName},this.signString=function(e){throw"digestString(str) not supported for this alg:prov="+this.algProvName},this.signHex=function(e){throw"digestHex(hex) not supported for this alg:prov="+this.algProvName},this.verify=function(e){throw"verify(hSigVal) not supported for this alg:prov="+this.algProvName},this.initParams=e,void 0!==e&&(void 0!==e.alg&&(this.algName=e.alg,void 0===e.prov?this.provName=ce.crypto.Util.DEFAULTPROVIDER[this.algName]:this.provName=e.prov,this.algProvName=this.algName+":"+this.provName,this.setAlgAndProvider(this.algName,this.provName),this._setAlgNames()),void 0!==e.psssaltlen&&(this.pssSaltLen=e.psssaltlen),void 0!==e.prvkeypem)){if(void 0!==e.prvkeypas)throw"both prvkeypem and prvkeypas parameters not supported";try{t=Be.getKey(e.prvkeypem),this.init(t)}catch(e){throw"fatal error to load pem private key: "+e}}},ce.crypto.Cipher=function(e){},ce.crypto.Cipher.encrypt=function(e,t,r){if(t instanceof ie&&t.isPublic){var n=ce.crypto.Cipher.getAlgByKeyAndName(t,r);if("RSA"===n)return t.encrypt(e);if("RSAOAEP"===n)return t.encryptOAEP(e,"sha1");var i=n.match(/^RSAOAEP(\d+)$/);if(null!==i)return t.encryptOAEP(e,"sha"+i[1]);throw"Cipher.encrypt: unsupported algorithm for RSAKey: "+r}throw"Cipher.encrypt: unsupported key or algorithm"},ce.crypto.Cipher.decrypt=function(e,t,r){if(t instanceof ie&&t.isPrivate){var n=ce.crypto.Cipher.getAlgByKeyAndName(t,r);if("RSA"===n)return t.decrypt(e);if("RSAOAEP"===n)return t.decryptOAEP(e,"sha1");var i=n.match(/^RSAOAEP(\d+)$/);if(null!==i)return t.decryptOAEP(e,"sha"+i[1]);throw"Cipher.decrypt: unsupported algorithm for RSAKey: "+r}throw"Cipher.decrypt: unsupported key or algorithm"},ce.crypto.Cipher.getAlgByKeyAndName=function(e,t){if(e instanceof ie){if(-1!=":RSA:RSAOAEP:RSAOAEP224:RSAOAEP256:RSAOAEP384:RSAOAEP512:".indexOf(t))return t;if(null==t)return"RSA";throw"getAlgByKeyAndName: not supported algorithm name for RSAKey: "+t}throw"getAlgByKeyAndName: not supported algorithm name: "+t},ce.crypto.OID=new function(){this.oidhex2name={"2a864886f70d010101":"rsaEncryption","2a8648ce3d0201":"ecPublicKey","2a8648ce380401":"dsa","2a8648ce3d030107":"secp256r1","2b8104001f":"secp192k1","2b81040021":"secp224r1","2b8104000a":"secp256k1","2b81040023":"secp521r1","2b81040022":"secp384r1","2a8648ce380403":"SHA1withDSA","608648016503040301":"SHA224withDSA","608648016503040302":"SHA256withDSA"}},void 0!==ce&&ce||(t.KJUR=ce={}),void 0!==ce.crypto&&ce.crypto||(ce.crypto={}),ce.crypto.ECDSA=function(e){var t=Error,n=E,i=se,o=ce.crypto.ECDSA,s=ce.crypto.ECParameterDB,a=o.getName,u=de,c=u.getVbyListEx,h=u.isASN1HEX,l=new te;this.type="EC",this.isPrivate=!1,this.isPublic=!1,this.getBigRandom=function(e){return new n(e.bitLength(),l).mod(e.subtract(n.ONE)).add(n.ONE)},this.setNamedCurve=function(e){this.ecparams=s.getByName(e),this.prvKeyHex=null,this.pubKeyHex=null,this.curveName=e},this.setPrivateKeyHex=function(e){this.isPrivate=!0,this.prvKeyHex=e},this.setPublicKeyHex=function(e){this.isPublic=!0,this.pubKeyHex=e},this.getPublicKeyXYHex=function(){var e=this.pubKeyHex;if("04"!==e.substr(0,2))throw"this method supports uncompressed format(04) only";var t=this.ecparams.keylen/4;if(e.length!==2+2*t)throw"malformed public key hex length";var r={};return r.x=e.substr(2,t),r.y=e.substr(2+t),r},this.getShortNISTPCurveName=function(){var e=this.curveName;return"secp256r1"===e||"NIST P-256"===e||"P-256"===e||"prime256v1"===e?"P-256":"secp384r1"===e||"NIST P-384"===e||"P-384"===e?"P-384":null},this.generateKeyPairHex=function(){var e=this.ecparams.n,t=this.getBigRandom(e),r=this.ecparams.G.multiply(t),n=r.getX().toBigInteger(),i=r.getY().toBigInteger(),o=this.ecparams.keylen/4,s=("0000000000"+t.toString(16)).slice(-o),a="04"+("0000000000"+n.toString(16)).slice(-o)+("0000000000"+i.toString(16)).slice(-o);return this.setPrivateKeyHex(s),this.setPublicKeyHex(a),{ecprvhex:s,ecpubhex:a}},this.signWithMessageHash=function(e){return this.signHex(e,this.prvKeyHex)},this.signHex=function(e,t){var r=new n(t,16),i=this.ecparams.n,s=new n(e.substring(0,this.ecparams.keylen/4),16);do{var a=this.getBigRandom(i),u=this.ecparams.G.multiply(a).getX().toBigInteger().mod(i)}while(u.compareTo(n.ZERO)<=0);var c=a.modInverse(i).multiply(s.add(r.multiply(u))).mod(i);return o.biRSSigToASN1Sig(u,c)},this.sign=function(e,t){var r=t,i=this.ecparams.n,o=n.fromByteArrayUnsigned(e);do{var s=this.getBigRandom(i),a=this.ecparams.G.multiply(s).getX().toBigInteger().mod(i)}while(a.compareTo(E.ZERO)<=0);var u=s.modInverse(i).multiply(o.add(r.multiply(a))).mod(i);return this.serializeSig(a,u)},this.verifyWithMessageHash=function(e,t){return this.verifyHex(e,t,this.pubKeyHex)},this.verifyHex=function(e,t,r){try{var s,a,u=o.parseSigHex(t);s=u.r,a=u.s;var c=i.decodeFromHex(this.ecparams.curve,r),h=new n(e.substring(0,this.ecparams.keylen/4),16);return this.verifyRaw(h,s,a,c)}catch(e){return!1}},this.verify=function(e,t,o){var s,a,u;if(Bitcoin.Util.isArray(t)){var c=this.parseSig(t);s=c.r,a=c.s}else{if("object"!==(void 0===t?"undefined":r(t))||!t.r||!t.s)throw"Invalid value for signature";s=t.r,a=t.s}if(o instanceof se)u=o;else{if(!Bitcoin.Util.isArray(o))throw"Invalid format for pubkey value, must be byte array or ECPointFp";u=i.decodeFrom(this.ecparams.curve,o)}var h=n.fromByteArrayUnsigned(e);return this.verifyRaw(h,s,a,u)},this.verifyRaw=function(e,t,r,i){var o=this.ecparams.n,s=this.ecparams.G;if(t.compareTo(n.ONE)<0||t.compareTo(o)>=0)return!1;if(r.compareTo(n.ONE)<0||r.compareTo(o)>=0)return!1;var a=r.modInverse(o),u=e.multiply(a).mod(o),c=t.multiply(a).mod(o);return s.multiply(u).add(i.multiply(c)).getX().toBigInteger().mod(o).equals(t)},this.serializeSig=function(e,t){var r=e.toByteArraySigned(),n=t.toByteArraySigned(),i=[];return i.push(2),i.push(r.length),(i=i.concat(r)).push(2),i.push(n.length),(i=i.concat(n)).unshift(i.length),i.unshift(48),i},this.parseSig=function(e){var t;if(48!=e[0])throw new Error("Signature not a valid DERSequence");if(2!=e[t=2])throw new Error("First element in signature must be a DERInteger");var r=e.slice(t+2,t+2+e[t+1]);if(2!=e[t+=2+e[t+1]])throw new Error("Second element in signature must be a DERInteger");var i=e.slice(t+2,t+2+e[t+1]);return t+=2+e[t+1],{r:n.fromByteArrayUnsigned(r),s:n.fromByteArrayUnsigned(i)}},this.parseSigCompact=function(e){if(65!==e.length)throw"Signature has the wrong length";var t=e[0]-27;if(t<0||t>7)throw"Invalid signature type";var r=this.ecparams.n;return{r:n.fromByteArrayUnsigned(e.slice(1,33)).mod(r),s:n.fromByteArrayUnsigned(e.slice(33,65)).mod(r),i:t}},this.readPKCS5PrvKeyHex=function(e){if(!1===h(e))throw new Error("not ASN.1 hex string");var t,r,n;try{t=c(e,0,["[0]",0],"06"),r=c(e,0,[1],"04");try{n=c(e,0,["[1]",0],"03")}catch(e){}}catch(e){throw new Error("malformed PKCS#1/5 plain ECC private key")}if(this.curveName=a(t),void 0===this.curveName)throw"unsupported curve name";this.setNamedCurve(this.curveName),this.setPublicKeyHex(n),this.setPrivateKeyHex(r),this.isPublic=!1},this.readPKCS8PrvKeyHex=function(e){if(!1===h(e))throw new t("not ASN.1 hex string");var r,n,i;try{c(e,0,[1,0],"06"),r=c(e,0,[1,1],"06"),n=c(e,0,[2,0,1],"04");try{i=c(e,0,[2,0,"[1]",0],"03")}catch(e){}}catch(e){throw new t("malformed PKCS#8 plain ECC private key")}if(this.curveName=a(r),void 0===this.curveName)throw new t("unsupported curve name");this.setNamedCurve(this.curveName),this.setPublicKeyHex(i),this.setPrivateKeyHex(n),this.isPublic=!1},this.readPKCS8PubKeyHex=function(e){if(!1===h(e))throw new t("not ASN.1 hex string");var r,n;try{c(e,0,[0,0],"06"),r=c(e,0,[0,1],"06"),n=c(e,0,[1],"03")}catch(e){throw new t("malformed PKCS#8 ECC public key")}if(this.curveName=a(r),null===this.curveName)throw new t("unsupported curve name");this.setNamedCurve(this.curveName),this.setPublicKeyHex(n)},this.readCertPubKeyHex=function(e,r){if(!1===h(e))throw new t("not ASN.1 hex string");var n,i;try{n=c(e,0,[0,5,0,1],"06"),i=c(e,0,[0,5,1],"03")}catch(e){throw new t("malformed X.509 certificate ECC public key")}if(this.curveName=a(n),null===this.curveName)throw new t("unsupported curve name");this.setNamedCurve(this.curveName),this.setPublicKeyHex(i)},void 0!==e&&void 0!==e.curve&&(this.curveName=e.curve),void 0===this.curveName&&(this.curveName="secp256r1"),this.setNamedCurve(this.curveName),void 0!==e&&(void 0!==e.prv&&this.setPrivateKeyHex(e.prv),void 0!==e.pub&&this.setPublicKeyHex(e.pub))},ce.crypto.ECDSA.parseSigHex=function(e){var t=ce.crypto.ECDSA.parseSigHexInHexRS(e);return{r:new E(t.r,16),s:new E(t.s,16)}},ce.crypto.ECDSA.parseSigHexInHexRS=function(e){var t=de,r=t.getChildIdx,n=t.getV;if(t.checkStrictDER(e,0),"30"!=e.substr(0,2))throw new Error("signature is not a ASN.1 sequence");var i=r(e,0);if(2!=i.length)throw new Error("signature shall have two elements");var o=i[0],s=i[1];if("02"!=e.substr(o,2))throw new Error("1st item not ASN.1 integer");if("02"!=e.substr(s,2))throw new Error("2nd item not ASN.1 integer");return{r:n(e,o),s:n(e,s)}},ce.crypto.ECDSA.asn1SigToConcatSig=function(e){var t=ce.crypto.ECDSA.parseSigHexInHexRS(e),r=t.r,n=t.s;if("00"==r.substr(0,2)&&r.length%32==2&&(r=r.substr(2)),"00"==n.substr(0,2)&&n.length%32==2&&(n=n.substr(2)),r.length%32==30&&(r="00"+r),n.length%32==30&&(n="00"+n),r.length%32!=0)throw"unknown ECDSA sig r length error";if(n.length%32!=0)throw"unknown ECDSA sig s length error";return r+n},ce.crypto.ECDSA.concatSigToASN1Sig=function(e){if(e.length/2*8%128!=0)throw"unknown ECDSA concatinated r-s sig  length error";var t=e.substr(0,e.length/2),r=e.substr(e.length/2);return ce.crypto.ECDSA.hexRSSigToASN1Sig(t,r)},ce.crypto.ECDSA.hexRSSigToASN1Sig=function(e,t){var r=new E(e,16),n=new E(t,16);return ce.crypto.ECDSA.biRSSigToASN1Sig(r,n)},ce.crypto.ECDSA.biRSSigToASN1Sig=function(e,t){var r=ce.asn1,n=new r.DERInteger({bigint:e}),i=new r.DERInteger({bigint:t});return new r.DERSequence({array:[n,i]}).getEncodedHex()},ce.crypto.ECDSA.getName=function(e){return"2b8104001f"===e?"secp192k1":"2a8648ce3d030107"===e?"secp256r1":"2b8104000a"===e?"secp256k1":"2b81040021"===e?"secp224r1":"2b81040022"===e?"secp384r1":-1!=="|secp256r1|NIST P-256|P-256|prime256v1|".indexOf(e)?"secp256r1":-1!=="|secp256k1|".indexOf(e)?"secp256k1":-1!=="|secp224r1|NIST P-224|P-224|".indexOf(e)?"secp224r1":-1!=="|secp384r1|NIST P-384|P-384|".indexOf(e)?"secp384r1":null},void 0!==ce&&ce||(t.KJUR=ce={}),void 0!==ce.crypto&&ce.crypto||(ce.crypto={}),ce.crypto.ECParameterDB=new function(){var e={},t={};function r(e){return new E(e,16)}this.getByName=function(r){var n=r;if(void 0!==t[n]&&(n=t[r]),void 0!==e[n])return e[n];throw"unregistered EC curve name: "+n},this.regist=function(n,i,o,s,a,u,c,h,l,d,f,p){e[n]={};var g=r(o),y=r(s),v=r(a),m=r(u),w=r(c),_=new ae(g,y,v),S=_.decodePointHex("04"+h+l);e[n].name=n,e[n].keylen=i,e[n].curve=_,e[n].G=S,e[n].n=m,e[n].h=w,e[n].oid=f,e[n].info=p;for(var b=0;b<d.length;b++)t[d[b]]=n}},ce.crypto.ECParameterDB.regist("secp128r1",128,"FFFFFFFDFFFFFFFFFFFFFFFFFFFFFFFF","FFFFFFFDFFFFFFFFFFFFFFFFFFFFFFFC","E87579C11079F43DD824993C2CEE5ED3","FFFFFFFE0000000075A30D1B9038A115","1","161FF7528B899B2D0C28607CA52C5B86","CF5AC8395BAFEB13C02DA292DDED7A83",[],"","secp128r1 : SECG curve over a 128 bit prime field"),ce.crypto.ECParameterDB.regist("secp160k1",160,"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFAC73","0","7","0100000000000000000001B8FA16DFAB9ACA16B6B3","1","3B4C382CE37AA192A4019E763036F4F5DD4D7EBB","938CF935318FDCED6BC28286531733C3F03C4FEE",[],"","secp160k1 : SECG curve over a 160 bit prime field"),ce.crypto.ECParameterDB.regist("secp160r1",160,"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF7FFFFFFF","FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF7FFFFFFC","1C97BEFC54BD7A8B65ACF89F81D4D4ADC565FA45","0100000000000000000001F4C8F927AED3CA752257","1","4A96B5688EF573284664698968C38BB913CBFC82","23A628553168947D59DCC912042351377AC5FB32",[],"","secp160r1 : SECG curve over a 160 bit prime field"),ce.crypto.ECParameterDB.regist("secp192k1",192,"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFEE37","0","3","FFFFFFFFFFFFFFFFFFFFFFFE26F2FC170F69466A74DEFD8D","1","DB4FF10EC057E9AE26B07D0280B7F4341DA5D1B1EAE06C7D","9B2F2F6D9C5628A7844163D015BE86344082AA88D95E2F9D",[]),ce.crypto.ECParameterDB.regist("secp192r1",192,"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFFFFFFFFFF","FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFFFFFFFFFC","64210519E59C80E70FA7E9AB72243049FEB8DEECC146B9B1","FFFFFFFFFFFFFFFFFFFFFFFF99DEF836146BC9B1B4D22831","1","188DA80EB03090F67CBF20EB43A18800F4FF0AFD82FF1012","07192B95FFC8DA78631011ED6B24CDD573F977A11E794811",[]),ce.crypto.ECParameterDB.regist("secp224r1",224,"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF000000000000000000000001","FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFFFFFFFFFFFFFFFFFE","B4050A850C04B3ABF54132565044B0B7D7BFD8BA270B39432355FFB4","FFFFFFFFFFFFFFFFFFFFFFFFFFFF16A2E0B8F03E13DD29455C5C2A3D","1","B70E0CBD6BB4BF7F321390B94A03C1D356C21122343280D6115C1D21","BD376388B5F723FB4C22DFE6CD4375A05A07476444D5819985007E34",[]),ce.crypto.ECParameterDB.regist("secp256k1",256,"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFC2F","0","7","FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141","1","79BE667EF9DCBBAC55A06295CE870B07029BFCDB2DCE28D959F2815B16F81798","483ADA7726A3C4655DA4FBFC0E1108A8FD17B448A68554199C47D08FFB10D4B8",[]),ce.crypto.ECParameterDB.regist("secp256r1",256,"FFFFFFFF00000001000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFF","FFFFFFFF00000001000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFC","5AC635D8AA3A93E7B3EBBD55769886BC651D06B0CC53B0F63BCE3C3E27D2604B","FFFFFFFF00000000FFFFFFFFFFFFFFFFBCE6FAADA7179E84F3B9CAC2FC632551","1","6B17D1F2E12C4247F8BCE6E563A440F277037D812DEB33A0F4A13945D898C296","4FE342E2FE1A7F9B8EE7EB4A7C0F9E162BCE33576B315ECECBB6406837BF51F5",["NIST P-256","P-256","prime256v1"]),ce.crypto.ECParameterDB.regist("secp384r1",384,"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFF0000000000000000FFFFFFFF","FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFF0000000000000000FFFFFFFC","B3312FA7E23EE7E4988E056BE3F82D19181D9C6EFE8141120314088F5013875AC656398D8A2ED19D2A85C8EDD3EC2AEF","FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFC7634D81F4372DDF581A0DB248B0A77AECEC196ACCC52973","1","AA87CA22BE8B05378EB1C71EF320AD746E1D3B628BA79B9859F741E082542A385502F25DBF55296C3A545E3872760AB7","3617de4a96262c6f5d9e98bf9292dc29f8f41dbd289a147ce9da3113b5f0b8c00a60b1ce1d7e819d7a431d7c90ea0e5f",["NIST P-384","P-384"]),ce.crypto.ECParameterDB.regist("secp521r1",521,"1FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF","1FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFC","051953EB9618E1C9A1F929A21A0B68540EEA2DA725B99B315F3B8B489918EF109E156193951EC7E937B1652C0BD3BB1BF073573DF883D2C34F1EF451FD46B503F00","1FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA51868783BF2F966B7FCC0148F709A5D03BB5C9B8899C47AEBB6FB71E91386409","1","C6858E06B70404E9CD9E3ECB662395B4429C648139053FB521F828AF606B4D3DBAA14B5E77EFE75928FE1DC127A2FFA8DE3348B3C1856A429BF97E7E31C2E5BD66","011839296a789a3bc0045c8a5fb42c7d1bd998f54449579b446817afbd17273e662c97ee72995ef42640c550b9013fad0761353c7086a272c24088be94769fd16650",["NIST P-521","P-521"]);var Be=function(){var e=function(e,r,n){return t(v.AES,e,r,n)},t=function(e,t,r,n){var i=v.enc.Hex.parse(t),o=v.enc.Hex.parse(r),s=v.enc.Hex.parse(n),a={};a.key=o,a.iv=s,a.ciphertext=i;var u=e.decrypt(a,o,{iv:s});return v.enc.Hex.stringify(u)},r=function(e,t,r){return n(v.AES,e,t,r)},n=function(e,t,r,n){var i=v.enc.Hex.parse(t),o=v.enc.Hex.parse(r),s=v.enc.Hex.parse(n),a=e.encrypt(i,o,{iv:s}),u=v.enc.Hex.parse(a.toString());return v.enc.Base64.stringify(u)},i={"AES-256-CBC":{proc:e,eproc:r,keylen:32,ivlen:16},"AES-192-CBC":{proc:e,eproc:r,keylen:24,ivlen:16},"AES-128-CBC":{proc:e,eproc:r,keylen:16,ivlen:16},"DES-EDE3-CBC":{proc:function(e,r,n){return t(v.TripleDES,e,r,n)},eproc:function(e,t,r){return n(v.TripleDES,e,t,r)},keylen:24,ivlen:8},"DES-CBC":{proc:function(e,r,n){return t(v.DES,e,r,n)},eproc:function(e,t,r){return n(v.DES,e,t,r)},keylen:8,ivlen:8}},o=function(e){var t={},r=e.match(new RegExp("DEK-Info: ([^,]+),([0-9A-Fa-f]+)","m"));r&&(t.cipher=r[1],t.ivsalt=r[2]);var n=e.match(new RegExp("-----BEGIN ([A-Z]+) PRIVATE KEY-----"));n&&(t.type=n[1]);var i=-1,o=0;-1!=e.indexOf("\r\n\r\n")&&(i=e.indexOf("\r\n\r\n"),o=2),-1!=e.indexOf("\n\n")&&(i=e.indexOf("\n\n"),o=1);var s=e.indexOf("-----END");if(-1!=i&&-1!=s){var a=e.substring(i+2*o,s-o);a=a.replace(/\s+/g,""),t.data=a}return t},s=function(e,t,r){for(var n=r.substring(0,16),o=v.enc.Hex.parse(n),s=v.enc.Utf8.parse(t),a=i[e].keylen+i[e].ivlen,u="",c=null;;){var h=v.algo.MD5.create();if(null!=c&&h.update(c),h.update(s),h.update(o),c=h.finalize(),(u+=v.enc.Hex.stringify(c)).length>=2*a)break}var l={};return l.keyhex=u.substr(0,2*i[e].keylen),l.ivhex=u.substr(2*i[e].keylen,2*i[e].ivlen),l},a=function(e,t,r,n){var o=v.enc.Base64.parse(e),s=v.enc.Hex.stringify(o);return(0,i[t].proc)(s,r,n)};return{version:"1.0.0",parsePKCS5PEM:function(e){return o(e)},getKeyAndUnusedIvByPasscodeAndIvsalt:function(e,t,r){return s(e,t,r)},decryptKeyB64:function(e,t,r,n){return a(e,t,r,n)},getDecryptedKeyHex:function(e,t){var r=o(e),n=(r.type,r.cipher),i=r.ivsalt,u=r.data,c=s(n,t,i).keyhex;return a(u,n,c,i)},getEncryptedPKCS5PEMFromPrvKeyHex:function(e,t,r,n,o){var a="";if(void 0!==n&&null!=n||(n="AES-256-CBC"),void 0===i[n])throw"KEYUTIL unsupported algorithm: "+n;return void 0!==o&&null!=o||(o=function(e){var t=v.lib.WordArray.random(e);return v.enc.Hex.stringify(t)}(i[n].ivlen).toUpperCase()),a="-----BEGIN "+e+" PRIVATE KEY-----\r\n",a+="Proc-Type: 4,ENCRYPTED\r\n",a+="DEK-Info: "+n+","+o+"\r\n",a+="\r\n",(a+=function(e,t,r,n){return(0,i[t].eproc)(e,r,n)}(t,n,s(n,r,o).keyhex,o).replace(/(.{64})/g,"$1\r\n"))+"\r\n-----END "+e+" PRIVATE KEY-----\r\n"},parseHexOfEncryptedPKCS8:function(e){var t=de,r=t.getChildIdx,n=t.getV,i={},o=r(e,0);if(2!=o.length)throw"malformed format: SEQUENCE(0).items != 2: "+o.length;i.ciphertext=n(e,o[1]);var s=r(e,o[0]);if(2!=s.length)throw"malformed format: SEQUENCE(0.0).items != 2: "+s.length;if("2a864886f70d01050d"!=n(e,s[0]))throw"this only supports pkcs5PBES2";var a=r(e,s[1]);if(2!=s.length)throw"malformed format: SEQUENCE(0.0.1).items != 2: "+a.length;var u=r(e,a[1]);if(2!=u.length)throw"malformed format: SEQUENCE(0.0.1.1).items != 2: "+u.length;if("2a864886f70d0307"!=n(e,u[0]))throw"this only supports TripleDES";i.encryptionSchemeAlg="TripleDES",i.encryptionSchemeIV=n(e,u[1]);var c=r(e,a[0]);if(2!=c.length)throw"malformed format: SEQUENCE(0.0.1.0).items != 2: "+c.length;if("2a864886f70d01050c"!=n(e,c[0]))throw"this only supports pkcs5PBKDF2";var h=r(e,c[1]);if(h.length<2)throw"malformed format: SEQUENCE(0.0.1.0.1).items < 2: "+h.length;i.pbkdf2Salt=n(e,h[0]);var l=n(e,h[1]);try{i.pbkdf2Iter=parseInt(l,16)}catch(e){throw"malformed format pbkdf2Iter: "+l}return i},getPBKDF2KeyHexFromParam:function(e,t){var r=v.enc.Hex.parse(e.pbkdf2Salt),n=e.pbkdf2Iter,i=v.PBKDF2(t,r,{keySize:6,iterations:n});return v.enc.Hex.stringify(i)},_getPlainPKCS8HexFromEncryptedPKCS8PEM:function(e,t){var r=Ce(e,"ENCRYPTED PRIVATE KEY"),n=this.parseHexOfEncryptedPKCS8(r),i=Be.getPBKDF2KeyHexFromParam(n,t),o={};o.ciphertext=v.enc.Hex.parse(n.ciphertext);var s=v.enc.Hex.parse(i),a=v.enc.Hex.parse(n.encryptionSchemeIV),u=v.TripleDES.decrypt(o,s,{iv:a});return v.enc.Hex.stringify(u)},getKeyFromEncryptedPKCS8PEM:function(e,t){var r=this._getPlainPKCS8HexFromEncryptedPKCS8PEM(e,t);return this.getKeyFromPlainPrivatePKCS8Hex(r)},parsePlainPrivatePKCS8Hex:function(e){var t=de,r=t.getChildIdx,n=t.getV,i={algparam:null};if("30"!=e.substr(0,2))throw"malformed plain PKCS8 private key(code:001)";var o=r(e,0);if(3!=o.length)throw"malformed plain PKCS8 private key(code:002)";if("30"!=e.substr(o[1],2))throw"malformed PKCS8 private key(code:003)";var s=r(e,o[1]);if(2!=s.length)throw"malformed PKCS8 private key(code:004)";if("06"!=e.substr(s[0],2))throw"malformed PKCS8 private key(code:005)";if(i.algoid=n(e,s[0]),"06"==e.substr(s[1],2)&&(i.algparam=n(e,s[1])),"04"!=e.substr(o[2],2))throw"malformed PKCS8 private key(code:006)";return i.keyidx=t.getVidx(e,o[2]),i},getKeyFromPlainPrivatePKCS8PEM:function(e){var t=Ce(e,"PRIVATE KEY");return this.getKeyFromPlainPrivatePKCS8Hex(t)},getKeyFromPlainPrivatePKCS8Hex:function(e){var t,r=this.parsePlainPrivatePKCS8Hex(e);if("2a864886f70d010101"==r.algoid)t=new ie;else if("2a8648ce380401"==r.algoid)t=new ce.crypto.DSA;else{if("2a8648ce3d0201"!=r.algoid)throw"unsupported private key algorithm";t=new ce.crypto.ECDSA}return t.readPKCS8PrvKeyHex(e),t},_getKeyFromPublicPKCS8Hex:function(e){var t,r=de.getVbyList(e,0,[0,0],"06");if("2a864886f70d010101"===r)t=new ie;else if("2a8648ce380401"===r)t=new ce.crypto.DSA;else{if("2a8648ce3d0201"!==r)throw"unsupported PKCS#8 public key hex";t=new ce.crypto.ECDSA}return t.readPKCS8PubKeyHex(e),t},parsePublicRawRSAKeyHex:function(e){var t=de,r=t.getChildIdx,n=t.getV,i={};if("30"!=e.substr(0,2))throw"malformed RSA key(code:001)";var o=r(e,0);if(2!=o.length)throw"malformed RSA key(code:002)";if("02"!=e.substr(o[0],2))throw"malformed RSA key(code:003)";if(i.n=n(e,o[0]),"02"!=e.substr(o[1],2))throw"malformed RSA key(code:004)";return i.e=n(e,o[1]),i},parsePublicPKCS8Hex:function(e){var t=de,r=t.getChildIdx,n=t.getV,i={algparam:null},o=r(e,0);if(2!=o.length)throw"outer DERSequence shall have 2 elements: "+o.length;var s=o[0];if("30"!=e.substr(s,2))throw"malformed PKCS8 public key(code:001)";var a=r(e,s);if(2!=a.length)throw"malformed PKCS8 public key(code:002)";if("06"!=e.substr(a[0],2))throw"malformed PKCS8 public key(code:003)";if(i.algoid=n(e,a[0]),"06"==e.substr(a[1],2)?i.algparam=n(e,a[1]):"30"==e.substr(a[1],2)&&(i.algparam={},i.algparam.p=t.getVbyList(e,a[1],[0],"02"),i.algparam.q=t.getVbyList(e,a[1],[1],"02"),i.algparam.g=t.getVbyList(e,a[1],[2],"02")),"03"!=e.substr(o[1],2))throw"malformed PKCS8 public key(code:004)";return i.key=n(e,o[1]).substr(2),i}}}();Be.getKey=function(e,t,r){var n,i=(v=de).getChildIdx,o=(v.getV,v.getVbyList),s=ce.crypto,a=s.ECDSA,u=s.DSA,c=ie,h=Ce,l=Be;if(void 0!==c&&e instanceof c)return e;if(void 0!==a&&e instanceof a)return e;if(void 0!==u&&e instanceof u)return e;if(void 0!==e.curve&&void 0!==e.xy&&void 0===e.d)return new a({pub:e.xy,curve:e.curve});if(void 0!==e.curve&&void 0!==e.d)return new a({prv:e.d,curve:e.curve});if(void 0===e.kty&&void 0!==e.n&&void 0!==e.e&&void 0===e.d)return(C=new c).setPublic(e.n,e.e),C;if(void 0===e.kty&&void 0!==e.n&&void 0!==e.e&&void 0!==e.d&&void 0!==e.p&&void 0!==e.q&&void 0!==e.dp&&void 0!==e.dq&&void 0!==e.co&&void 0===e.qi)return(C=new c).setPrivateEx(e.n,e.e,e.d,e.p,e.q,e.dp,e.dq,e.co),C;if(void 0===e.kty&&void 0!==e.n&&void 0!==e.e&&void 0!==e.d&&void 0===e.p)return(C=new c).setPrivate(e.n,e.e,e.d),C;if(void 0!==e.p&&void 0!==e.q&&void 0!==e.g&&void 0!==e.y&&void 0===e.x)return(C=new u).setPublic(e.p,e.q,e.g,e.y),C;if(void 0!==e.p&&void 0!==e.q&&void 0!==e.g&&void 0!==e.y&&void 0!==e.x)return(C=new u).setPrivate(e.p,e.q,e.g,e.y,e.x),C;if("RSA"===e.kty&&void 0!==e.n&&void 0!==e.e&&void 0===e.d)return(C=new c).setPublic(_e(e.n),_e(e.e)),C;if("RSA"===e.kty&&void 0!==e.n&&void 0!==e.e&&void 0!==e.d&&void 0!==e.p&&void 0!==e.q&&void 0!==e.dp&&void 0!==e.dq&&void 0!==e.qi)return(C=new c).setPrivateEx(_e(e.n),_e(e.e),_e(e.d),_e(e.p),_e(e.q),_e(e.dp),_e(e.dq),_e(e.qi)),C;if("RSA"===e.kty&&void 0!==e.n&&void 0!==e.e&&void 0!==e.d)return(C=new c).setPrivate(_e(e.n),_e(e.e),_e(e.d)),C;if("EC"===e.kty&&void 0!==e.crv&&void 0!==e.x&&void 0!==e.y&&void 0===e.d){var d=(P=new a({curve:e.crv})).ecparams.keylen/4,f="04"+("0000000000"+_e(e.x)).slice(-d)+("0000000000"+_e(e.y)).slice(-d);return P.setPublicKeyHex(f),P}if("EC"===e.kty&&void 0!==e.crv&&void 0!==e.x&&void 0!==e.y&&void 0!==e.d){d=(P=new a({curve:e.crv})).ecparams.keylen/4,f="04"+("0000000000"+_e(e.x)).slice(-d)+("0000000000"+_e(e.y)).slice(-d);var p=("0000000000"+_e(e.d)).slice(-d);return P.setPublicKeyHex(f),P.setPrivateKeyHex(p),P}if("pkcs5prv"===r){var g,y=e,v=de;if(9===(g=i(y,0)).length)(C=new c).readPKCS5PrvKeyHex(y);else if(6===g.length)(C=new u).readPKCS5PrvKeyHex(y);else{if(!(g.length>2&&"04"===y.substr(g[1],2)))throw"unsupported PKCS#1/5 hexadecimal key";(C=new a).readPKCS5PrvKeyHex(y)}return C}if("pkcs8prv"===r)return l.getKeyFromPlainPrivatePKCS8Hex(e);if("pkcs8pub"===r)return l._getKeyFromPublicPKCS8Hex(e);if("x509pub"===r)return qe.getPublicKeyFromCertHex(e);if(-1!=e.indexOf("-END CERTIFICATE-",0)||-1!=e.indexOf("-END X509 CERTIFICATE-",0)||-1!=e.indexOf("-END TRUSTED CERTIFICATE-",0))return qe.getPublicKeyFromCertPEM(e);if(-1!=e.indexOf("-END PUBLIC KEY-")){var m=Ce(e,"PUBLIC KEY");return l._getKeyFromPublicPKCS8Hex(m)}if(-1!=e.indexOf("-END RSA PRIVATE KEY-")&&-1==e.indexOf("4,ENCRYPTED")){var w=h(e,"RSA PRIVATE KEY");return l.getKey(w,null,"pkcs5prv")}if(-1!=e.indexOf("-END DSA PRIVATE KEY-")&&-1==e.indexOf("4,ENCRYPTED")){var _=o(n=h(e,"DSA PRIVATE KEY"),0,[1],"02"),S=o(n,0,[2],"02"),b=o(n,0,[3],"02"),F=o(n,0,[4],"02"),A=o(n,0,[5],"02");return(C=new u).setPrivate(new E(_,16),new E(S,16),new E(b,16),new E(F,16),new E(A,16)),C}if(-1!=e.indexOf("-END EC PRIVATE KEY-")&&-1==e.indexOf("4,ENCRYPTED"))return w=h(e,"EC PRIVATE KEY"),l.getKey(w,null,"pkcs5prv");if(-1!=e.indexOf("-END PRIVATE KEY-"))return l.getKeyFromPlainPrivatePKCS8PEM(e);if(-1!=e.indexOf("-END RSA PRIVATE KEY-")&&-1!=e.indexOf("4,ENCRYPTED")){var k=l.getDecryptedKeyHex(e,t),x=new ie;return x.readPKCS5PrvKeyHex(k),x}if(-1!=e.indexOf("-END EC PRIVATE KEY-")&&-1!=e.indexOf("4,ENCRYPTED")){var P,C=o(n=l.getDecryptedKeyHex(e,t),0,[1],"04"),I=o(n,0,[2,0],"06"),T=o(n,0,[3,0],"03").substr(2);if(void 0===ce.crypto.OID.oidhex2name[I])throw"undefined OID(hex) in KJUR.crypto.OID: "+I;return(P=new a({curve:ce.crypto.OID.oidhex2name[I]})).setPublicKeyHex(T),P.setPrivateKeyHex(C),P.isPublic=!1,P}if(-1!=e.indexOf("-END DSA PRIVATE KEY-")&&-1!=e.indexOf("4,ENCRYPTED"))return _=o(n=l.getDecryptedKeyHex(e,t),0,[1],"02"),S=o(n,0,[2],"02"),b=o(n,0,[3],"02"),F=o(n,0,[4],"02"),A=o(n,0,[5],"02"),(C=new u).setPrivate(new E(_,16),new E(S,16),new E(b,16),new E(F,16),new E(A,16)),C;if(-1!=e.indexOf("-END ENCRYPTED PRIVATE KEY-"))return l.getKeyFromEncryptedPKCS8PEM(e,t);throw new Error("not supported argument")},Be.generateKeypair=function(e,t){if("RSA"==e){var r=t;(s=new ie).generate(r,"10001"),s.isPrivate=!0,s.isPublic=!0;var n=new ie,i=s.n.toString(16),o=s.e.toString(16);return n.setPublic(i,o),n.isPrivate=!1,n.isPublic=!0,(a={}).prvKeyObj=s,a.pubKeyObj=n,a}if("EC"==e){var s,a,u=t,c=new ce.crypto.ECDSA({curve:u}).generateKeyPairHex();return(s=new ce.crypto.ECDSA({curve:u})).setPublicKeyHex(c.ecpubhex),s.setPrivateKeyHex(c.ecprvhex),s.isPrivate=!0,s.isPublic=!1,(n=new ce.crypto.ECDSA({curve:u})).setPublicKeyHex(c.ecpubhex),n.isPrivate=!1,n.isPublic=!0,(a={}).prvKeyObj=s,a.pubKeyObj=n,a}throw"unknown algorithm: "+e},Be.getPEM=function(e,t,r,n,i,o){var s=ce,a=s.asn1,u=a.DERObjectIdentifier,c=a.DERInteger,h=a.ASN1Util.newObject,l=a.x509.SubjectPublicKeyInfo,d=s.crypto,f=d.DSA,p=d.ECDSA,g=ie;function y(e){return h({seq:[{int:0},{int:{bigint:e.n}},{int:e.e},{int:{bigint:e.d}},{int:{bigint:e.p}},{int:{bigint:e.q}},{int:{bigint:e.dmp1}},{int:{bigint:e.dmq1}},{int:{bigint:e.coeff}}]})}function m(e){return h({seq:[{int:1},{octstr:{hex:e.prvKeyHex}},{tag:["a0",!0,{oid:{name:e.curveName}}]},{tag:["a1",!0,{bitstr:{hex:"00"+e.pubKeyHex}}]}]})}function w(e){return h({seq:[{int:0},{int:{bigint:e.p}},{int:{bigint:e.q}},{int:{bigint:e.g}},{int:{bigint:e.y}},{int:{bigint:e.x}}]})}if((void 0!==g&&e instanceof g||void 0!==f&&e instanceof f||void 0!==p&&e instanceof p)&&1==e.isPublic&&(void 0===t||"PKCS8PUB"==t))return Pe(E=new l(e).getEncodedHex(),"PUBLIC KEY");if("PKCS1PRV"==t&&void 0!==g&&e instanceof g&&(void 0===r||null==r)&&1==e.isPrivate)return Pe(E=y(e).getEncodedHex(),"RSA PRIVATE KEY");if("PKCS1PRV"==t&&void 0!==p&&e instanceof p&&(void 0===r||null==r)&&1==e.isPrivate){var _=new u({name:e.curveName}).getEncodedHex(),S=m(e).getEncodedHex(),b="";return(b+=Pe(_,"EC PARAMETERS"))+Pe(S,"EC PRIVATE KEY")}if("PKCS1PRV"==t&&void 0!==f&&e instanceof f&&(void 0===r||null==r)&&1==e.isPrivate)return Pe(E=w(e).getEncodedHex(),"DSA PRIVATE KEY");if("PKCS5PRV"==t&&void 0!==g&&e instanceof g&&void 0!==r&&null!=r&&1==e.isPrivate){var E=y(e).getEncodedHex();return void 0===n&&(n="DES-EDE3-CBC"),this.getEncryptedPKCS5PEMFromPrvKeyHex("RSA",E,r,n,o)}if("PKCS5PRV"==t&&void 0!==p&&e instanceof p&&void 0!==r&&null!=r&&1==e.isPrivate)return E=m(e).getEncodedHex(),void 0===n&&(n="DES-EDE3-CBC"),this.getEncryptedPKCS5PEMFromPrvKeyHex("EC",E,r,n,o);if("PKCS5PRV"==t&&void 0!==f&&e instanceof f&&void 0!==r&&null!=r&&1==e.isPrivate)return E=w(e).getEncodedHex(),void 0===n&&(n="DES-EDE3-CBC"),this.getEncryptedPKCS5PEMFromPrvKeyHex("DSA",E,r,n,o);var F=function(e,t){var r=A(e,t);return new h({seq:[{seq:[{oid:{name:"pkcs5PBES2"}},{seq:[{seq:[{oid:{name:"pkcs5PBKDF2"}},{seq:[{octstr:{hex:r.pbkdf2Salt}},{int:r.pbkdf2Iter}]}]},{seq:[{oid:{name:"des-EDE3-CBC"}},{octstr:{hex:r.encryptionSchemeIV}}]}]}]},{octstr:{hex:r.ciphertext}}]}).getEncodedHex()},A=function(e,t){var r=v.lib.WordArray.random(8),n=v.lib.WordArray.random(8),i=v.PBKDF2(t,r,{keySize:6,iterations:100}),o=v.enc.Hex.parse(e),s=v.TripleDES.encrypt(o,i,{iv:n})+"",a={};return a.ciphertext=s,a.pbkdf2Salt=v.enc.Hex.stringify(r),a.pbkdf2Iter=100,a.encryptionSchemeAlg="DES-EDE3-CBC",a.encryptionSchemeIV=v.enc.Hex.stringify(n),a};if("PKCS8PRV"==t&&null!=g&&e instanceof g&&1==e.isPrivate){var k=y(e).getEncodedHex();return E=h({seq:[{int:0},{seq:[{oid:{name:"rsaEncryption"}},{null:!0}]},{octstr:{hex:k}}]}).getEncodedHex(),void 0===r||null==r?Pe(E,"PRIVATE KEY"):Pe(S=F(E,r),"ENCRYPTED PRIVATE KEY")}if("PKCS8PRV"==t&&void 0!==p&&e instanceof p&&1==e.isPrivate)return k=new h({seq:[{int:1},{octstr:{hex:e.prvKeyHex}},{tag:["a1",!0,{bitstr:{hex:"00"+e.pubKeyHex}}]}]}).getEncodedHex(),E=h({seq:[{int:0},{seq:[{oid:{name:"ecPublicKey"}},{oid:{name:e.curveName}}]},{octstr:{hex:k}}]}).getEncodedHex(),void 0===r||null==r?Pe(E,"PRIVATE KEY"):Pe(S=F(E,r),"ENCRYPTED PRIVATE KEY");if("PKCS8PRV"==t&&void 0!==f&&e instanceof f&&1==e.isPrivate)return k=new c({bigint:e.x}).getEncodedHex(),E=h({seq:[{int:0},{seq:[{oid:{name:"dsa"}},{seq:[{int:{bigint:e.p}},{int:{bigint:e.q}},{int:{bigint:e.g}}]}]},{octstr:{hex:k}}]}).getEncodedHex(),void 0===r||null==r?Pe(E,"PRIVATE KEY"):Pe(S=F(E,r),"ENCRYPTED PRIVATE KEY");throw new Error("unsupported object nor format")},Be.getKeyFromCSRPEM=function(e){var t=Ce(e,"CERTIFICATE REQUEST");return Be.getKeyFromCSRHex(t)},Be.getKeyFromCSRHex=function(e){var t=Be.parseCSRHex(e);return Be.getKey(t.p8pubkeyhex,null,"pkcs8pub")},Be.parseCSRHex=function(e){var t=de,r=t.getChildIdx,n=t.getTLV,i={},o=e;if("30"!=o.substr(0,2))throw"malformed CSR(code:001)";var s=r(o,0);if(s.length<1)throw"malformed CSR(code:002)";if("30"!=o.substr(s[0],2))throw"malformed CSR(code:003)";var a=r(o,s[0]);if(a.length<3)throw"malformed CSR(code:004)";return i.p8pubkeyhex=n(o,a[2]),i},Be.getKeyID=function(e){var t=Be,r=de;"string"==typeof e&&-1!=e.indexOf("BEGIN ")&&(e=t.getKey(e));var n=Ce(t.getPEM(e)),i=r.getIdxbyList(n,0,[1]),o=r.getV(n,i).substring(2);return ce.crypto.Util.hashHex(o,"sha1")},Be.getJWKFromKey=function(e){var t={};if(e instanceof ie&&e.isPrivate)return t.kty="RSA",t.n=we(e.n.toString(16)),t.e=we(e.e.toString(16)),t.d=we(e.d.toString(16)),t.p=we(e.p.toString(16)),t.q=we(e.q.toString(16)),t.dp=we(e.dmp1.toString(16)),t.dq=we(e.dmq1.toString(16)),t.qi=we(e.coeff.toString(16)),t;if(e instanceof ie&&e.isPublic)return t.kty="RSA",t.n=we(e.n.toString(16)),t.e=we(e.e.toString(16)),t;if(e instanceof ce.crypto.ECDSA&&e.isPrivate){if("P-256"!==(n=e.getShortNISTPCurveName())&&"P-384"!==n)throw"unsupported curve name for JWT: "+n;var r=e.getPublicKeyXYHex();return t.kty="EC",t.crv=n,t.x=we(r.x),t.y=we(r.y),t.d=we(e.prvKeyHex),t}if(e instanceof ce.crypto.ECDSA&&e.isPublic){var n;if("P-256"!==(n=e.getShortNISTPCurveName())&&"P-384"!==n)throw"unsupported curve name for JWT: "+n;return r=e.getPublicKeyXYHex(),t.kty="EC",t.crv=n,t.x=we(r.x),t.y=we(r.y),t}throw"not supported key object"},ie.getPosArrayOfChildrenFromHex=function(e){return de.getChildIdx(e,0)},ie.getHexValueArrayOfChildrenFromHex=function(e){var t,r=de.getV,n=r(e,(t=ie.getPosArrayOfChildrenFromHex(e))[0]),i=r(e,t[1]),o=r(e,t[2]),s=r(e,t[3]),a=r(e,t[4]),u=r(e,t[5]),c=r(e,t[6]),h=r(e,t[7]),l=r(e,t[8]);return(t=new Array).push(n,i,o,s,a,u,c,h,l),t},ie.prototype.readPrivateKeyFromPEMString=function(e){var t=Ce(e),r=ie.getHexValueArrayOfChildrenFromHex(t);this.setPrivateEx(r[1],r[2],r[3],r[4],r[5],r[6],r[7],r[8])},ie.prototype.readPKCS5PrvKeyHex=function(e){var t=ie.getHexValueArrayOfChildrenFromHex(e);this.setPrivateEx(t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8])},ie.prototype.readPKCS8PrvKeyHex=function(e){var t,r,n,i,o,s,a,u,c=de,h=c.getVbyListEx;if(!1===c.isASN1HEX(e))throw new Error("not ASN.1 hex string");try{t=h(e,0,[2,0,1],"02"),r=h(e,0,[2,0,2],"02"),n=h(e,0,[2,0,3],"02"),i=h(e,0,[2,0,4],"02"),o=h(e,0,[2,0,5],"02"),s=h(e,0,[2,0,6],"02"),a=h(e,0,[2,0,7],"02"),u=h(e,0,[2,0,8],"02")}catch(e){throw new Error("malformed PKCS#8 plain RSA private key")}this.setPrivateEx(t,r,n,i,o,s,a,u)},ie.prototype.readPKCS5PubKeyHex=function(e){var t=de,r=t.getV;if(!1===t.isASN1HEX(e))throw new Error("keyHex is not ASN.1 hex string");var n=t.getChildIdx(e,0);if(2!==n.length||"02"!==e.substr(n[0],2)||"02"!==e.substr(n[1],2))throw new Error("wrong hex for PKCS#5 public key");var i=r(e,n[0]),o=r(e,n[1]);this.setPublic(i,o)},ie.prototype.readPKCS8PubKeyHex=function(e){var t=de;if(!1===t.isASN1HEX(e))throw new Error("not ASN.1 hex string");if("06092a864886f70d010101"!==t.getTLVbyListEx(e,0,[0,0]))throw new Error("not PKCS8 RSA public key");var r=t.getTLVbyListEx(e,0,[1,0]);this.readPKCS5PubKeyHex(r)},ie.prototype.readCertPubKeyHex=function(e,t){var r,n;(r=new qe).readCertHex(e),n=r.getPublicKeyHex(),this.readPKCS8PubKeyHex(n)};var Ke=new RegExp("[^0-9a-f]","gi");function Ve(e,t){for(var r="",n=t/4-e.length,i=0;i<n;i++)r+="0";return r+e}function We(e,t,r){for(var n="",i=0;n.length<t;)n+=Ee(r(Fe(e+String.fromCharCode.apply(String,[(4278190080&i)>>24,(16711680&i)>>16,(65280&i)>>8,255&i])))),i+=1;return n}function Je(e){for(var t in ce.crypto.Util.DIGESTINFOHEAD){var r=ce.crypto.Util.DIGESTINFOHEAD[t],n=r.length;if(e.substring(0,n)==r)return[t,e.substring(n)]}return[]}function qe(e){var t,r=de,n=r.getChildIdx,i=r.getV,o=r.getTLV,s=r.getVbyList,a=r.getVbyListEx,u=r.getTLVbyList,c=r.getTLVbyListEx,h=r.getIdxbyList,l=r.getIdxbyListEx,d=r.getVidx,f=r.oidname,p=r.hextooidstr,g=qe,y=Ce;try{t=ce.asn1.x509.AlgorithmIdentifier.PSSNAME2ASN1TLV}catch(e){}this.HEX2STAG={"0c":"utf8",13:"prn",16:"ia5","1a":"vis","1e":"bmp"},this.hex=null,this.version=0,this.foffset=0,this.aExtInfo=null,this.getVersion=function(){return null===this.hex||0!==this.version?this.version:"a003020102"!==u(this.hex,0,[0,0])?(this.version=1,this.foffset=-1,1):(this.version=3,3)},this.getSerialNumberHex=function(){return a(this.hex,0,[0,0],"02")},this.getSignatureAlgorithmField=function(){var e=c(this.hex,0,[0,1]);return this.getAlgorithmIdentifierName(e)},this.getAlgorithmIdentifierName=function(e){for(var r in t)if(e===t[r])return r;return f(a(e,0,[0],"06"))},this.getIssuer=function(){return this.getX500Name(this.getIssuerHex())},this.getIssuerHex=function(){return u(this.hex,0,[0,3+this.foffset],"30")},this.getIssuerString=function(){return g.hex2dn(this.getIssuerHex())},this.getSubject=function(){return this.getX500Name(this.getSubjectHex())},this.getSubjectHex=function(){return u(this.hex,0,[0,5+this.foffset],"30")},this.getSubjectString=function(){return g.hex2dn(this.getSubjectHex())},this.getNotBefore=function(){var e=s(this.hex,0,[0,4+this.foffset,0]);return e=e.replace(/(..)/g,"%$1"),decodeURIComponent(e)},this.getNotAfter=function(){var e=s(this.hex,0,[0,4+this.foffset,1]);return e=e.replace(/(..)/g,"%$1"),decodeURIComponent(e)},this.getPublicKeyHex=function(){return r.getTLVbyList(this.hex,0,[0,6+this.foffset],"30")},this.getPublicKeyIdx=function(){return h(this.hex,0,[0,6+this.foffset],"30")},this.getPublicKeyContentIdx=function(){var e=this.getPublicKeyIdx();return h(this.hex,e,[1,0],"30")},this.getPublicKey=function(){return Be.getKey(this.getPublicKeyHex(),null,"pkcs8pub")},this.getSignatureAlgorithmName=function(){var e=u(this.hex,0,[1],"30");return this.getAlgorithmIdentifierName(e)},this.getSignatureValueHex=function(){return s(this.hex,0,[2],"03",!0)},this.verifySignature=function(e){var t=this.getSignatureAlgorithmField(),r=this.getSignatureValueHex(),n=u(this.hex,0,[0],"30"),i=new ce.crypto.Signature({alg:t});return i.init(e),i.updateHex(n),i.verify(r)},this.parseExt=function(e){var t,o,a;if(void 0===e){if(a=this.hex,3!==this.version)return-1;t=h(a,0,[0,7,0],"30"),o=n(a,t)}else{a=Ce(e);var u=h(a,0,[0,3,0,0],"06");if("2a864886f70d01090e"!=i(a,u))return void(this.aExtInfo=new Array);t=h(a,0,[0,3,0,1,0],"30"),o=n(a,t),this.hex=a}this.aExtInfo=new Array;for(var c=0;c<o.length;c++){var l={critical:!1},f=0;3===n(a,o[c]).length&&(l.critical=!0,f=1),l.oid=r.hextooidstr(s(a,o[c],[0],"06"));var p=h(a,o[c],[1+f]);l.vidx=d(a,p),this.aExtInfo.push(l)}},this.getExtInfo=function(e){var t=this.aExtInfo,r=e;if(e.match(/^[0-9.]+$/)||(r=ce.asn1.x509.OID.name2oid(e)),""!==r)for(var n=0;n<t.length;n++)if(t[n].oid===r)return t[n]},this.getExtBasicConstraints=function(e,t){if(void 0===e&&void 0===t){var r=this.getExtInfo("basicConstraints");if(void 0===r)return;e=o(this.hex,r.vidx),t=r.critical}var n={extname:"basicConstraints"};if(t&&(n.critical=!0),"3000"===e)return n;if("30030101ff"===e)return n.cA=!0,n;if("30060101ff02"===e.substr(0,12)){var s=i(e,10),a=parseInt(s,16);return n.cA=!0,n.pathLen=a,n}throw new Error("hExtV parse error: "+e)},this.getExtKeyUsage=function(e,t){if(void 0===e&&void 0===t){var r=this.getExtInfo("keyUsage");if(void 0===r)return;e=o(this.hex,r.vidx),t=r.critical}var n={extname:"keyUsage"};return t&&(n.critical=!0),n.names=this.getExtKeyUsageString(e).split(","),n},this.getExtKeyUsageBin=function(e){if(void 0===e){var t=this.getExtInfo("keyUsage");if(void 0===t)return"";e=o(this.hex,t.vidx)}if(8!=e.length&&10!=e.length)throw new Error("malformed key usage value: "+e);var r="000000000000000"+parseInt(e.substr(6),16).toString(2);return 8==e.length&&(r=r.slice(-8)),10==e.length&&(r=r.slice(-16)),""==(r=r.replace(/0+$/,""))&&(r="0"),r},this.getExtKeyUsageString=function(e){for(var t=this.getExtKeyUsageBin(e),r=new Array,n=0;n<t.length;n++)"1"==t.substr(n,1)&&r.push(qe.KEYUSAGE_NAME[n]);return r.join(",")},this.getExtSubjectKeyIdentifier=function(e,t){if(void 0===e&&void 0===t){var r=this.getExtInfo("subjectKeyIdentifier");if(void 0===r)return;e=o(this.hex,r.vidx),t=r.critical}var n={extname:"subjectKeyIdentifier"};t&&(n.critical=!0);var s=i(e,0);return n.kid={hex:s},n},this.getExtAuthorityKeyIdentifier=function(e,t){if(void 0===e&&void 0===t){var r=this.getExtInfo("authorityKeyIdentifier");if(void 0===r)return;e=o(this.hex,r.vidx),t=r.critical}var s={extname:"authorityKeyIdentifier"};t&&(s.critical=!0);for(var a=n(e,0),u=0;u<a.length;u++){var c=e.substr(a[u],2);if("80"===c&&(s.kid={hex:i(e,a[u])}),"a1"===c){var h=o(e,a[u]),l=this.getGeneralNames(h);s.issuer=l[0].dn}"82"===c&&(s.sn={hex:i(e,a[u])})}return s},this.getExtExtKeyUsage=function(e,t){if(void 0===e&&void 0===t){var r=this.getExtInfo("extKeyUsage");if(void 0===r)return;e=o(this.hex,r.vidx),t=r.critical}var s={extname:"extKeyUsage",array:[]};t&&(s.critical=!0);for(var a=n(e,0),u=0;u<a.length;u++)s.array.push(f(i(e,a[u])));return s},this.getExtExtKeyUsageName=function(){var e=this.getExtInfo("extKeyUsage");if(void 0===e)return e;var t=new Array,r=o(this.hex,e.vidx);if(""===r)return t;for(var s=n(r,0),a=0;a<s.length;a++)t.push(f(i(r,s[a])));return t},this.getExtSubjectAltName=function(e,t){if(void 0===e&&void 0===t){var r=this.getExtInfo("subjectAltName");if(void 0===r)return;e=o(this.hex,r.vidx),t=r.critical}var n={extname:"subjectAltName",array:[]};return t&&(n.critical=!0),n.array=this.getGeneralNames(e),n},this.getExtIssuerAltName=function(e,t){if(void 0===e&&void 0===t){var r=this.getExtInfo("issuerAltName");if(void 0===r)return;e=o(this.hex,r.vidx),t=r.critical}var n={extname:"issuerAltName",array:[]};return t&&(n.critical=!0),n.array=this.getGeneralNames(e),n},this.getGeneralNames=function(e){for(var t=n(e,0),r=[],i=0;i<t.length;i++){var s=this.getGeneralName(o(e,t[i]));void 0!==s&&r.push(s)}return r},this.getGeneralName=function(e){var t=e.substr(0,2),r=i(e,0),n=Ee(r);return"81"==t?{rfc822:n}:"82"==t?{dns:n}:"86"==t?{uri:n}:"87"==t?{ip:Le(r)}:"a4"==t?{dn:this.getX500Name(r)}:void 0},this.getExtSubjectAltName2=function(){var e,t,r,s=this.getExtInfo("subjectAltName");if(void 0===s)return s;for(var a=new Array,u=o(this.hex,s.vidx),c=n(u,0),h=0;h<c.length;h++)r=u.substr(c[h],2),e=i(u,c[h]),"81"===r&&(t=be(e),a.push(["MAIL",t])),"82"===r&&(t=be(e),a.push(["DNS",t])),"84"===r&&(t=qe.hex2dn(e,0),a.push(["DN",t])),"86"===r&&(t=be(e),a.push(["URI",t])),"87"===r&&(t=Le(e),a.push(["IP",t]));return a},this.getExtCRLDistributionPoints=function(e,t){if(void 0===e&&void 0===t){var r=this.getExtInfo("cRLDistributionPoints");if(void 0===r)return;e=o(this.hex,r.vidx),t=r.critical}var i={extname:"cRLDistributionPoints",array:[]};t&&(i.critical=!0);for(var s=n(e,0),a=0;a<s.length;a++){var u=o(e,s[a]);i.array.push(this.getDistributionPoint(u))}return i},this.getDistributionPoint=function(e){for(var t={},r=n(e,0),i=0;i<r.length;i++){var s=e.substr(r[i],2),a=o(e,r[i]);"a0"==s&&(t.dpname=this.getDistributionPointName(a))}return t},this.getDistributionPointName=function(e){for(var t={},r=n(e,0),i=0;i<r.length;i++){var s=e.substr(r[i],2),a=o(e,r[i]);"a0"==s&&(t.full=this.getGeneralNames(a))}return t},this.getExtCRLDistributionPointsURI=function(){var e=this.getExtInfo("cRLDistributionPoints");if(void 0===e)return e;for(var t=new Array,r=n(this.hex,e.vidx),i=0;i<r.length;i++)try{var o=be(s(this.hex,r[i],[0,0,0],"86"));t.push(o)}catch(e){}return t},this.getExtAIAInfo=function(){var e=this.getExtInfo("authorityInfoAccess");if(void 0===e)return e;for(var t={ocsp:[],caissuer:[]},r=n(this.hex,e.vidx),i=0;i<r.length;i++){var o=s(this.hex,r[i],[0],"06"),a=s(this.hex,r[i],[1],"86");"2b06010505073001"===o&&t.ocsp.push(be(a)),"2b06010505073002"===o&&t.caissuer.push(be(a))}return t},this.getExtAuthorityInfoAccess=function(e,t){if(void 0===e&&void 0===t){var r=this.getExtInfo("authorityInfoAccess");if(void 0===r)return;e=o(this.hex,r.vidx),t=r.critical}var i={extname:"authorityInfoAccess",array:[]};t&&(i.critical=!0);for(var u=n(e,0),c=0;c<u.length;c++){var h=a(e,u[c],[0],"06"),l=be(s(e,u[c],[1],"86"));if("2b06010505073001"==h)i.array.push({ocsp:l});else{if("2b06010505073002"!=h)throw new Error("unknown method: "+h);i.array.push({caissuer:l})}}return i},this.getExtCertificatePolicies=function(e,t){if(void 0===e&&void 0===t){var r=this.getExtInfo("certificatePolicies");if(void 0===r)return;e=o(this.hex,r.vidx),t=r.critical}var i={extname:"certificatePolicies",array:[]};t&&(i.critical=!0);for(var s=n(e,0),a=0;a<s.length;a++){var u=o(e,s[a]),c=this.getPolicyInformation(u);i.array.push(c)}return i},this.getPolicyInformation=function(e){var t={},r=s(e,0,[0],"06");t.policyoid=f(r);var i=l(e,0,[1],"30");if(-1!=i){t.array=[];for(var a=n(e,i),u=0;u<a.length;u++){var c=o(e,a[u]),h=this.getPolicyQualifierInfo(c);t.array.push(h)}}return t},this.getPolicyQualifierInfo=function(e){var t={},r=s(e,0,[0],"06");if("2b06010505070201"===r){var n=a(e,0,[1],"16");t.cps=Ee(n)}else if("2b06010505070202"===r){var i=u(e,0,[1],"30");t.unotice=this.getUserNotice(i)}return t},this.getUserNotice=function(e){for(var t={},r=n(e,0),i=0;i<r.length;i++){var s=o(e,r[i]);"30"!=s.substr(0,2)&&(t.exptext=this.getDisplayText(s))}return t},this.getDisplayText=function(e){var t={};return t.type={"0c":"utf8",16:"ia5","1a":"vis","1e":"bmp"}[e.substr(0,2)],t.str=Ee(i(e,0)),t},this.getExtCRLNumber=function(e,t){var r={extname:"cRLNumber"};if(t&&(r.critical=!0),"02"==e.substr(0,2))return r.num={hex:i(e,0)},r;throw new Error("hExtV parse error: "+e)},this.getExtCRLReason=function(e,t){var r={extname:"cRLReason"};if(t&&(r.critical=!0),"0a"==e.substr(0,2))return r.code=parseInt(i(e,0),16),r;throw new Error("hExtV parse error: "+e)},this.getExtOcspNonce=function(e,t){var r={extname:"ocspNonce"};t&&(r.critical=!0);var n=i(e,0);return r.hex=n,r},this.getExtOcspNoCheck=function(e,t){var r={extname:"ocspNoCheck"};return t&&(r.critical=!0),r},this.getExtAdobeTimeStamp=function(e,t){if(void 0===e&&void 0===t){var r=this.getExtInfo("adobeTimeStamp");if(void 0===r)return;e=o(this.hex,r.vidx),t=r.critical}var i={extname:"adobeTimeStamp"};t&&(i.critical=!0);var s=n(e,0);if(s.length>1){var a=o(e,s[1]),u=this.getGeneralName(a);null!=u.uri&&(i.uri=u.uri)}if(s.length>2){var c=o(e,s[2]);"0101ff"==c&&(i.reqauth=!0),"010100"==c&&(i.reqauth=!1)}return i},this.getX500NameRule=function(e){for(var t=null,r=[],n=0;n<e.length;n++)for(var i=e[n],o=0;o<i.length;o++)r.push(i[o]);for(n=0;n<r.length;n++){var s=r[n],a=s.ds,u=s.value,c=s.type;if("prn"!=a&&"utf8"!=a&&"ia5"!=a)return"mixed";if("ia5"==a){if("CN"!=c)return"mixed";if(ce.lang.String.isMail(u))continue;return"mixed"}if("C"==c){if("prn"==a)continue;return"mixed"}if(null==t)t=a;else if(t!==a)return"mixed"}return null==t?"prn":t},this.getX500Name=function(e){var t=this.getX500NameArray(e);return{array:t,str:this.dnarraytostr(t)}},this.getX500NameArray=function(e){for(var t=[],r=n(e,0),i=0;i<r.length;i++)t.push(this.getRDN(o(e,r[i])));return t},this.getRDN=function(e){for(var t=[],r=n(e,0),i=0;i<r.length;i++)t.push(this.getAttrTypeAndValue(o(e,r[i])));return t},this.getAttrTypeAndValue=function(e){var t={type:null,value:null,ds:null},r=n(e,0),i=s(e,r[0],[],"06"),o=s(e,r[1],[]),a=ce.asn1.ASN1Util.oidHexToInt(i);return t.type=ce.asn1.x509.OID.oid2atype(a),t.value=Ee(o),t.ds=this.HEX2STAG[e.substr(r[1],2)],t},this.readCertPEM=function(e){this.readCertHex(y(e))},this.readCertHex=function(e){this.hex=e,this.getVersion();try{h(this.hex,0,[0,7],"a3"),this.parseExt()}catch(e){}},this.getParam=function(){var e={};return e.version=this.getVersion(),e.serial={hex:this.getSerialNumberHex()},e.sigalg=this.getSignatureAlgorithmField(),e.issuer=this.getIssuer(),e.notbefore=this.getNotBefore(),e.notafter=this.getNotAfter(),e.subject=this.getSubject(),e.sbjpubkey=Pe(this.getPublicKeyHex(),"PUBLIC KEY"),this.aExtInfo.length>0&&(e.ext=this.getExtParamArray()),e.sighex=this.getSignatureValueHex(),e},this.getExtParamArray=function(e){null==e&&-1!=l(this.hex,0,[0,"[3]"])&&(e=c(this.hex,0,[0,"[3]",0],"30"));for(var t=[],r=n(e,0),i=0;i<r.length;i++){var s=o(e,r[i]),a=this.getExtParam(s);null!=a&&t.push(a)}return t},this.getExtParam=function(e){var t=n(e,0).length;if(2!=t&&3!=t)throw new Error("wrong number elements in Extension: "+t+" "+e);var r=p(s(e,0,[0],"06")),i=!1;3==t&&"0101ff"==u(e,0,[1])&&(i=!0);var o=u(e,0,[t-1,0]),a=void 0;if("2.5.29.14"==r?a=this.getExtSubjectKeyIdentifier(o,i):"2.5.29.15"==r?a=this.getExtKeyUsage(o,i):"2.5.29.17"==r?a=this.getExtSubjectAltName(o,i):"2.5.29.18"==r?a=this.getExtIssuerAltName(o,i):"2.5.29.19"==r?a=this.getExtBasicConstraints(o,i):"2.5.29.31"==r?a=this.getExtCRLDistributionPoints(o,i):"2.5.29.32"==r?a=this.getExtCertificatePolicies(o,i):"2.5.29.35"==r?a=this.getExtAuthorityKeyIdentifier(o,i):"2.5.29.37"==r?a=this.getExtExtKeyUsage(o,i):"1.3.6.1.5.5.7.1.1"==r?a=this.getExtAuthorityInfoAccess(o,i):"2.5.29.20"==r?a=this.getExtCRLNumber(o,i):"2.5.29.21"==r?a=this.getExtCRLReason(o,i):"1.3.6.1.5.5.7.48.1.2"==r?a=this.getExtOcspNonce(o,i):"1.3.6.1.5.5.7.48.1.5"==r?a=this.getExtOcspNoCheck(o,i):"1.2.840.113583.1.1.9.1"==r&&(a=this.getExtAdobeTimeStamp(o,i)),null!=a)return a;var c={extname:r,extn:o};return i&&(c.critical=!0),c},this.findExt=function(e,t){for(var r=0;r<e.length;r++)if(e[r].extname==t)return e[r];return null},this.updateExtCDPFullURI=function(e,t){var r=this.findExt(e,"cRLDistributionPoints");if(null!=r&&null!=r.array)for(var n=r.array,i=0;i<n.length;i++)if(null!=n[i].dpname&&null!=n[i].dpname.full)for(var o=n[i].dpname.full,s=0;s<o.length;s++){var a=o[i];null!=a.uri&&(a.uri=t)}},this.updateExtAIAOCSP=function(e,t){var r=this.findExt(e,"authorityInfoAccess");if(null!=r&&null!=r.array)for(var n=r.array,i=0;i<n.length;i++)null!=n[i].ocsp&&(n[i].ocsp=t)},this.updateExtAIACAIssuer=function(e,t){var r=this.findExt(e,"authorityInfoAccess");if(null!=r&&null!=r.array)for(var n=r.array,i=0;i<n.length;i++)null!=n[i].caissuer&&(n[i].caissuer=t)},this.dnarraytostr=function(e){return"/"+e.map((function(e){return function(e){return e.map((function(e){return function(e){return e.type+"="+e.value}(e)})).join("+")}(e)})).join("/")},this.getInfo=function(){var e,t,r,n=function(e){return JSON.stringify(e.array).replace(/[\[\]\{\}\"]/g,"")},i=function(e){for(var t="",r=e.array,n=0;n<r.length;n++){var i=r[n];if(t+="    policy oid: "+i.policyoid+"\n",void 0!==i.array)for(var o=0;o<i.array.length;o++){var s=i.array[o];void 0!==s.cps&&(t+="    cps: "+s.cps+"\n")}}return t},o=function(e){for(var t="",r=e.array,n=0;n<r.length;n++){var i=r[n];try{void 0!==i.dpname.full[0].uri&&(t+="    "+i.dpname.full[0].uri+"\n")}catch(e){}try{void 0!==i.dname.full[0].dn.hex&&(t+="    "+qe.hex2dn(i.dpname.full[0].dn.hex)+"\n")}catch(e){}}return t},s=function(e){for(var t="",r=e.array,n=0;n<r.length;n++){var i=r[n];void 0!==i.caissuer&&(t+="    caissuer: "+i.caissuer+"\n"),void 0!==i.ocsp&&(t+="    ocsp: "+i.ocsp+"\n")}return t};if(e="Basic Fields\n",e+="  serial number: "+this.getSerialNumberHex()+"\n",e+="  signature algorithm: "+this.getSignatureAlgorithmField()+"\n",e+="  issuer: "+this.getIssuerString()+"\n",e+="  notBefore: "+this.getNotBefore()+"\n",e+="  notAfter: "+this.getNotAfter()+"\n",e+="  subject: "+this.getSubjectString()+"\n",e+="  subject public key info: \n",e+="    key algorithm: "+(t=this.getPublicKey()).type+"\n","RSA"===t.type&&(e+="    n="+Ne(t.n.toString(16)).substr(0,16)+"...\n",e+="    e="+Ne(t.e.toString(16))+"\n"),null!=(r=this.aExtInfo)){e+="X509v3 Extensions:\n";for(var a=0;a<r.length;a++){var u=r[a],c=ce.asn1.x509.OID.oid2name(u.oid);""===c&&(c=u.oid);var h="";if(!0===u.critical&&(h="CRITICAL"),e+="  "+c+" "+h+":\n","basicConstraints"===c){var l=this.getExtBasicConstraints();void 0===l.cA?e+="    {}\n":(e+="    cA=true",void 0!==l.pathLen&&(e+=", pathLen="+l.pathLen),e+="\n")}else if("keyUsage"===c)e+="    "+this.getExtKeyUsageString()+"\n";else if("subjectKeyIdentifier"===c)e+="    "+this.getExtSubjectKeyIdentifier().kid.hex+"\n";else if("authorityKeyIdentifier"===c){var d=this.getExtAuthorityKeyIdentifier();void 0!==d.kid&&(e+="    kid="+d.kid.hex+"\n")}else"extKeyUsage"===c?e+="    "+this.getExtExtKeyUsage().array.join(", ")+"\n":"subjectAltName"===c?e+="    "+n(this.getExtSubjectAltName())+"\n":"cRLDistributionPoints"===c?e+=o(this.getExtCRLDistributionPoints()):"authorityInfoAccess"===c?e+=s(this.getExtAuthorityInfoAccess()):"certificatePolicies"===c&&(e+=i(this.getExtCertificatePolicies()))}}return(e+="signature algorithm: "+this.getSignatureAlgorithmName()+"\n")+"signature: "+this.getSignatureValueHex().substr(0,16)+"...\n"},"string"==typeof e&&(-1!=e.indexOf("-----BEGIN")?this.readCertPEM(e):ce.lang.String.isHex(e)&&this.readCertHex(e))}ie.prototype.sign=function(e,t){var r=function(e){return ce.crypto.Util.hashString(e,t)}(e);return this.signWithMessageHash(r,t)},ie.prototype.signWithMessageHash=function(e,t){var r=re(ce.crypto.Util.getPaddedDigestInfoHex(e,t,this.n.bitLength()),16);return Ve(this.doPrivate(r).toString(16),this.n.bitLength())},ie.prototype.signPSS=function(e,t,r){var n=function(e){return ce.crypto.Util.hashHex(e,t)}(Fe(e));return void 0===r&&(r=-1),this.signWithMessageHashPSS(n,t,r)},ie.prototype.signWithMessageHashPSS=function(e,t,r){var n,i=Ee(e),o=i.length,s=this.n.bitLength()-1,a=Math.ceil(s/8),u=function(e){return ce.crypto.Util.hashHex(e,t)};if(-1===r||void 0===r)r=o;else if(-2===r)r=a-o-2;else if(r<-2)throw new Error("invalid salt length");if(a<o+r+2)throw new Error("data too long");var c="";r>0&&(c=new Array(r),(new te).nextBytes(c),c=String.fromCharCode.apply(String,c));var h=Ee(u(Fe("\0\0\0\0\0\0\0\0"+i+c))),l=[];for(n=0;n<a-r-o-2;n+=1)l[n]=0;var d=String.fromCharCode.apply(String,l)+""+c,f=We(h,d.length,u),p=[];for(n=0;n<d.length;n+=1)p[n]=d.charCodeAt(n)^f.charCodeAt(n);var g=65280>>8*a-s&255;for(p[0]&=~g,n=0;n<o;n++)p.push(h.charCodeAt(n));return p.push(188),Ve(this.doPrivate(new E(p)).toString(16),this.n.bitLength())},ie.prototype.verify=function(e,t){var r=re(t=(t=t.replace(Ke,"")).replace(/[ \n]+/g,""),16);if(r.bitLength()>this.n.bitLength())return 0;var n=Je(this.doPublic(r).toString(16).replace(/^1f+00/,""));if(0==n.length)return!1;var i=n[0];return n[1]==function(e){return ce.crypto.Util.hashString(e,i)}(e)},ie.prototype.verifyWithMessageHash=function(e,t){if(t.length!=Math.ceil(this.n.bitLength()/4))return!1;var r=re(t,16);if(r.bitLength()>this.n.bitLength())return 0;var n=Je(this.doPublic(r).toString(16).replace(/^1f+00/,""));return 0!=n.length&&(n[0],n[1]==e)},ie.prototype.verifyPSS=function(e,t,r,n){var i=function(e){return ce.crypto.Util.hashHex(e,r)}(Fe(e));return void 0===n&&(n=-1),this.verifyWithMessageHashPSS(i,t,r,n)},ie.prototype.verifyWithMessageHashPSS=function(e,t,r,n){if(t.length!=Math.ceil(this.n.bitLength()/4))return!1;var i,o=new E(t,16),s=function(e){return ce.crypto.Util.hashHex(e,r)},a=Ee(e),u=a.length,c=this.n.bitLength()-1,h=Math.ceil(c/8);if(-1===n||void 0===n)n=u;else if(-2===n)n=h-u-2;else if(n<-2)throw new Error("invalid salt length");if(h<u+n+2)throw new Error("data too long");var l=this.doPublic(o).toByteArray();for(i=0;i<l.length;i+=1)l[i]&=255;for(;l.length<h;)l.unshift(0);if(188!==l[h-1])throw new Error("encoded message does not end in 0xbc");var d=(l=String.fromCharCode.apply(String,l)).substr(0,h-u-1),f=l.substr(d.length,u),p=65280>>8*h-c&255;if(0!=(d.charCodeAt(0)&p))throw new Error("bits beyond keysize not zero");var g=We(f,d.length,s),y=[];for(i=0;i<d.length;i+=1)y[i]=d.charCodeAt(i)^g.charCodeAt(i);y[0]&=~p;var v=h-u-n-2;for(i=0;i<v;i+=1)if(0!==y[i])throw new Error("leftmost octets not zero");if(1!==y[v])throw new Error("0x01 marker not found");return f===Ee(s(Fe("\0\0\0\0\0\0\0\0"+a+String.fromCharCode.apply(String,y.slice(-n)))))},ie.SALT_LEN_HLEN=-1,ie.SALT_LEN_MAX=-2,ie.SALT_LEN_RECOVER=-2,qe.hex2dn=function(e,t){if(void 0===t&&(t=0),"30"!==e.substr(t,2))throw new Error("malformed DN");for(var r=new Array,n=de.getChildIdx(e,t),i=0;i<n.length;i++)r.push(qe.hex2rdn(e,n[i]));return"/"+(r=r.map((function(e){return e.replace("/","\\/")}))).join("/")},qe.hex2rdn=function(e,t){if(void 0===t&&(t=0),"31"!==e.substr(t,2))throw new Error("malformed RDN");for(var r=new Array,n=de.getChildIdx(e,t),i=0;i<n.length;i++)r.push(qe.hex2attrTypeValue(e,n[i]));return(r=r.map((function(e){return e.replace("+","\\+")}))).join("+")},qe.hex2attrTypeValue=function(e,t){var r=de,n=r.getV;if(void 0===t&&(t=0),"30"!==e.substr(t,2))throw new Error("malformed attribute type and value");var i=r.getChildIdx(e,t);2!==i.length||e.substr(i[0],2);var o=n(e,i[0]),s=ce.asn1.ASN1Util.oidHexToInt(o);return ce.asn1.x509.OID.oid2atype(s)+"="+Ee(n(e,i[1]))},qe.getPublicKeyFromCertHex=function(e){var t=new qe;return t.readCertHex(e),t.getPublicKey()},qe.getPublicKeyFromCertPEM=function(e){var t=new qe;return t.readCertPEM(e),t.getPublicKey()},qe.getPublicKeyInfoPropOfCertPEM=function(e){var t,r,n=de.getVbyList,i={algparam:null};return(t=new qe).readCertPEM(e),r=t.getPublicKeyHex(),i.keyhex=n(r,0,[1],"03").substr(2),i.algoid=n(r,0,[0,0],"06"),"2a8648ce3d0201"===i.algoid&&(i.algparam=n(r,0,[0,1],"06")),i},qe.KEYUSAGE_NAME=["digitalSignature","nonRepudiation","keyEncipherment","dataEncipherment","keyAgreement","keyCertSign","cRLSign","encipherOnly","decipherOnly"],void 0!==ce&&ce||(t.KJUR=ce={}),void 0!==ce.jws&&ce.jws||(ce.jws={}),ce.jws.JWS=function(){var e=ce.jws.JWS.isSafeJSONString;this.parseJWS=function(t,r){if(void 0===this.parsedJWS||!r&&void 0===this.parsedJWS.sigvalH){var n=t.match(/^([^.]+)\.([^.]+)\.([^.]+)$/);if(null==n)throw"JWS signature is not a form of 'Head.Payload.SigValue'.";var i=n[1],o=n[2],s=n[3],a=i+"."+o;if(this.parsedJWS={},this.parsedJWS.headB64U=i,this.parsedJWS.payloadB64U=o,this.parsedJWS.sigvalB64U=s,this.parsedJWS.si=a,!r){var u=_e(s),c=re(u,16);this.parsedJWS.sigvalH=u,this.parsedJWS.sigvalBI=c}var h=le(i),l=le(o);if(this.parsedJWS.headS=h,this.parsedJWS.payloadS=l,!e(h,this.parsedJWS,"headP"))throw"malformed JSON string for JWS Head: "+h}}},ce.jws.JWS.sign=function(e,t,n,i,o){var s,a,u,c=ce,h=c.jws.JWS,l=h.readSafeJSONString,d=h.isSafeJSONString,f=c.crypto,p=(f.ECDSA,f.Mac),g=f.Signature,y=JSON;if("string"!=typeof t&&"object"!=(void 0===t?"undefined":r(t)))throw"spHeader must be JSON string or object: "+t;if("object"==(void 0===t?"undefined":r(t))&&(a=t,s=y.stringify(a)),"string"==typeof t){if(!d(s=t))throw"JWS Head is not safe JSON string: "+s;a=l(s)}if(u=n,"object"==(void 0===n?"undefined":r(n))&&(u=y.stringify(n)),""!=e&&null!=e||void 0===a.alg||(e=a.alg),""!=e&&null!=e&&void 0===a.alg&&(a.alg=e,s=y.stringify(a)),e!==a.alg)throw"alg and sHeader.alg doesn't match: "+e+"!="+a.alg;var v=null;if(void 0===h.jwsalg2sigalg[e])throw"unsupported alg name: "+e;v=h.jwsalg2sigalg[e];var m=he(s)+"."+he(u),w="";if("Hmac"==v.substr(0,4)){if(void 0===i)throw"mac key shall be specified for HS* alg";var _=new p({alg:v,prov:"cryptojs",pass:i});_.updateString(m),w=_.doFinal()}else if(-1!=v.indexOf("withECDSA")){(b=new g({alg:v})).init(i,o),b.updateString(m);var S=b.sign();w=ce.crypto.ECDSA.asn1SigToConcatSig(S)}else{var b;"none"!=v&&((b=new g({alg:v})).init(i,o),b.updateString(m),w=b.sign())}return m+"."+we(w)},ce.jws.JWS.verify=function(e,t,n){var i,o=ce,s=o.jws.JWS,a=s.readSafeJSONString,u=o.crypto,c=u.ECDSA,h=u.Mac,l=u.Signature;void 0!==r(ie)&&(i=ie);var d=e.split(".");if(3!==d.length)return!1;var f,p=d[0]+"."+d[1],g=_e(d[2]),y=a(le(d[0])),v=null;if(void 0===y.alg)throw"algorithm not specified in header";if(f=(v=y.alg).substr(0,2),null!=n&&"[object Array]"===Object.prototype.toString.call(n)&&n.length>0&&-1==(":"+n.join(":")+":").indexOf(":"+v+":"))throw"algorithm '"+v+"' not accepted in the list";if("none"!=v&&null===t)throw"key shall be specified to verify.";if("string"==typeof t&&-1!=t.indexOf("-----BEGIN ")&&(t=Be.getKey(t)),!("RS"!=f&&"PS"!=f||t instanceof i))throw"key shall be a RSAKey obj for RS* and PS* algs";if("ES"==f&&!(t instanceof c))throw"key shall be a ECDSA obj for ES* algs";var m=null;if(void 0===s.jwsalg2sigalg[y.alg])throw"unsupported alg name: "+v;if("none"==(m=s.jwsalg2sigalg[v]))throw"not supported";if("Hmac"==m.substr(0,4)){if(void 0===t)throw"hexadecimal key shall be specified for HMAC";var w=new h({alg:m,pass:t});return w.updateString(p),g==w.doFinal()}if(-1!=m.indexOf("withECDSA")){var _,S=null;try{S=c.concatSigToASN1Sig(g)}catch(e){return!1}return(_=new l({alg:m})).init(t),_.updateString(p),_.verify(S)}return(_=new l({alg:m})).init(t),_.updateString(p),_.verify(g)},ce.jws.JWS.parse=function(e){var t,r,n,i=e.split("."),o={};if(2!=i.length&&3!=i.length)throw"malformed sJWS: wrong number of '.' splitted elements";return t=i[0],r=i[1],3==i.length&&(n=i[2]),o.headerObj=ce.jws.JWS.readSafeJSONString(le(t)),o.payloadObj=ce.jws.JWS.readSafeJSONString(le(r)),o.headerPP=JSON.stringify(o.headerObj,null,"  "),null==o.payloadObj?o.payloadPP=le(r):o.payloadPP=JSON.stringify(o.payloadObj,null,"  "),void 0!==n&&(o.sigHex=_e(n)),o},ce.jws.JWS.verifyJWT=function(e,t,n){var i=ce.jws,o=i.JWS,s=o.readSafeJSONString,a=o.inArray,u=o.includedArray,c=e.split("."),h=c[0],l=c[1],d=(_e(c[2]),s(le(h))),f=s(le(l));if(void 0===d.alg)return!1;if(void 0===n.alg)throw"acceptField.alg shall be specified";if(!a(d.alg,n.alg))return!1;if(void 0!==f.iss&&"object"===r(n.iss)&&!a(f.iss,n.iss))return!1;if(void 0!==f.sub&&"object"===r(n.sub)&&!a(f.sub,n.sub))return!1;if(void 0!==f.aud&&"object"===r(n.aud))if("string"==typeof f.aud){if(!a(f.aud,n.aud))return!1}else if("object"==r(f.aud)&&!u(f.aud,n.aud))return!1;var p=i.IntDate.getNow();return void 0!==n.verifyAt&&"number"==typeof n.verifyAt&&(p=n.verifyAt),void 0!==n.gracePeriod&&"number"==typeof n.gracePeriod||(n.gracePeriod=0),!(void 0!==f.exp&&"number"==typeof f.exp&&f.exp+n.gracePeriod<p||void 0!==f.nbf&&"number"==typeof f.nbf&&p<f.nbf-n.gracePeriod||void 0!==f.iat&&"number"==typeof f.iat&&p<f.iat-n.gracePeriod||void 0!==f.jti&&void 0!==n.jti&&f.jti!==n.jti||!o.verify(e,t,n.alg))},ce.jws.JWS.includedArray=function(e,t){var n=ce.jws.JWS.inArray;if(null===e)return!1;if("object"!==(void 0===e?"undefined":r(e)))return!1;if("number"!=typeof e.length)return!1;for(var i=0;i<e.length;i++)if(!n(e[i],t))return!1;return!0},ce.jws.JWS.inArray=function(e,t){if(null===t)return!1;if("object"!==(void 0===t?"undefined":r(t)))return!1;if("number"!=typeof t.length)return!1;for(var n=0;n<t.length;n++)if(t[n]==e)return!0;return!1},ce.jws.JWS.jwsalg2sigalg={HS256:"HmacSHA256",HS384:"HmacSHA384",HS512:"HmacSHA512",RS256:"SHA256withRSA",RS384:"SHA384withRSA",RS512:"SHA512withRSA",ES256:"SHA256withECDSA",ES384:"SHA384withECDSA",PS256:"SHA256withRSAandMGF1",PS384:"SHA384withRSAandMGF1",PS512:"SHA512withRSAandMGF1",none:"none"},ce.jws.JWS.isSafeJSONString=function(e,t,n){var i=null;try{return"object"!=(void 0===(i=ue(e))?"undefined":r(i))||i.constructor===Array?0:(t&&(t[n]=i),1)}catch(e){return 0}},ce.jws.JWS.readSafeJSONString=function(e){var t=null;try{return"object"!=(void 0===(t=ue(e))?"undefined":r(t))||t.constructor===Array?null:t}catch(e){return null}},ce.jws.JWS.getEncodedSignatureValueFromJWS=function(e){var t=e.match(/^[^.]+\.[^.]+\.([^.]+)$/);if(null==t)throw"JWS signature is not a form of 'Head.Payload.SigValue'.";return t[1]},ce.jws.JWS.getJWKthumbprint=function(e){if("RSA"!==e.kty&&"EC"!==e.kty&&"oct"!==e.kty)throw"unsupported algorithm for JWK Thumprint";var t="{";if("RSA"===e.kty){if("string"!=typeof e.n||"string"!=typeof e.e)throw"wrong n and e value for RSA key";t+='"e":"'+e.e+'",',t+='"kty":"'+e.kty+'",',t+='"n":"'+e.n+'"}'}else if("EC"===e.kty){if("string"!=typeof e.crv||"string"!=typeof e.x||"string"!=typeof e.y)throw"wrong crv, x and y value for EC key";t+='"crv":"'+e.crv+'",',t+='"kty":"'+e.kty+'",',t+='"x":"'+e.x+'",',t+='"y":"'+e.y+'"}'}else if("oct"===e.kty){if("string"!=typeof e.k)throw"wrong k value for oct(symmetric) key";t+='"kty":"'+e.kty+'",',t+='"k":"'+e.k+'"}'}var r=Fe(t);return we(ce.crypto.Util.hashHex(r,"sha256"))},ce.jws.IntDate={},ce.jws.IntDate.get=function(e){var t=ce.jws.IntDate,r=t.getNow,n=t.getZulu;if("now"==e)return r();if("now + 1hour"==e)return r()+3600;if("now + 1day"==e)return r()+86400;if("now + 1month"==e)return r()+2592e3;if("now + 1year"==e)return r()+31536e3;if(e.match(/Z$/))return n(e);if(e.match(/^[0-9]+$/))return parseInt(e);throw"unsupported format: "+e},ce.jws.IntDate.getZulu=function(e){return Te(e)},ce.jws.IntDate.getNow=function(){return~~(new Date/1e3)},ce.jws.IntDate.intDate2UTCString=function(e){return new Date(1e3*e).toUTCString()},ce.jws.IntDate.intDate2Zulu=function(e){var t=new Date(1e3*e);return("0000"+t.getUTCFullYear()).slice(-4)+("00"+(t.getUTCMonth()+1)).slice(-2)+("00"+t.getUTCDate()).slice(-2)+("00"+t.getUTCHours()).slice(-2)+("00"+t.getUTCMinutes()).slice(-2)+("00"+t.getUTCSeconds()).slice(-2)+"Z"},t.SecureRandom=te,t.rng_seed_time=G,t.BigInteger=E,t.RSAKey=ie;var $e=ce.crypto.EDSA;t.EDSA=$e;var ze=ce.crypto.DSA;t.DSA=ze;var Ge=ce.crypto.Signature;t.Signature=Ge;var Ye=ce.crypto.MessageDigest;t.MessageDigest=Ye;var Xe=ce.crypto.Mac;t.Mac=Xe;var Qe=ce.crypto.Cipher;t.Cipher=Qe,t.KEYUTIL=Be,t.ASN1HEX=de,t.X509=qe,t.CryptoJS=v,t.b64tohex=S,t.b64toBA=b,t.stoBA=fe,t.BAtos=pe,t.BAtohex=ge,t.stohex=ye,t.stob64=function(e){return _(ye(e))},t.stob64u=function(e){return ve(_(ye(e)))},t.b64utos=function(e){return pe(b(me(e)))},t.b64tob64u=ve,t.b64utob64=me,t.hex2b64=_,t.hextob64u=we,t.b64utohex=_e,t.utf8tob64u=he,t.b64utoutf8=le,t.utf8tob64=function(e){return _(Re(He(e)))},t.b64toutf8=function(e){return decodeURIComponent(Ue(S(e)))},t.utf8tohex=Se,t.hextoutf8=be,t.hextorstr=Ee,t.rstrtohex=Fe,t.hextob64=Ae,t.hextob64nl=ke,t.b64nltohex=xe,t.hextopem=Pe,t.pemtohex=Ce,t.hextoArrayBuffer=function(e){if(e.length%2!=0)throw"input is not even length";if(null==e.match(/^[0-9A-Fa-f]+$/))throw"input is not hexadecimal";for(var t=new ArrayBuffer(e.length/2),r=new DataView(t),n=0;n<e.length/2;n++)r.setUint8(n,parseInt(e.substr(2*n,2),16));return t},t.ArrayBuffertohex=function(e){for(var t="",r=new DataView(e),n=0;n<e.byteLength;n++)t+=("00"+r.getUint8(n).toString(16)).slice(-2);return t},t.zulutomsec=Ie,t.zulutosec=Te,t.zulutodate=function(e){return new Date(Ie(e))},t.datetozulu=function(e,t,r){var n,i=e.getUTCFullYear();if(t){if(i<1950||2049<i)throw"not proper year for UTCTime: "+i;n=(""+i).slice(-2)}else n=("000"+i).slice(-4);if(n+=("0"+(e.getUTCMonth()+1)).slice(-2),n+=("0"+e.getUTCDate()).slice(-2),n+=("0"+e.getUTCHours()).slice(-2),n+=("0"+e.getUTCMinutes()).slice(-2),n+=("0"+e.getUTCSeconds()).slice(-2),r){var o=e.getUTCMilliseconds();0!==o&&(n+="."+(o=(o=("00"+o).slice(-3)).replace(/0+$/g,"")))}return n+"Z"},t.uricmptohex=Re,t.hextouricmp=Ue,t.ipv6tohex=Oe,t.hextoipv6=De,t.hextoip=Le,t.iptohex=function(e){var t="malformed IP address";if(!(e=e.toLowerCase(e)).match(/^[0-9.]+$/)){if(e.match(/^[0-9a-f:]+$/)&&-1!==e.indexOf(":"))return Oe(e);throw t}var r=e.split(".");if(4!==r.length)throw t;var n="";try{for(var i=0;i<4;i++)n+=("0"+parseInt(r[i]).toString(16)).slice(-2);return n}catch(e){throw t}},t.encodeURIComponentAll=He,t.newline_toUnix=function(e){return e.replace(/\r\n/gm,"\n")},t.newline_toDos=function(e){return(e=e.replace(/\r\n/gm,"\n")).replace(/\n/gm,"\r\n")},t.hextoposhex=Ne,t.intarystrtohex=function(e){e=(e=(e=e.replace(/^\s*\[\s*/,"")).replace(/\s*\]\s*$/,"")).replace(/\s*/g,"");try{return e.split(/,/).map((function(e,t,r){var n=parseInt(e);if(n<0||255<n)throw"integer not in range 0-255";return("00"+n.toString(16)).slice(-2)})).join("")}catch(e){throw"malformed integer array string: "+e}},t.strdiffidx=function(e,t){var r=e.length;e.length>t.length&&(r=t.length);for(var n=0;n<r;n++)if(e.charCodeAt(n)!=t.charCodeAt(n))return n;return e.length!=t.length?r:-1},t.KJUR=ce;var Ze=ce.crypto;t.crypto=Ze;var et=ce.asn1;t.asn1=et;var tt=ce.jws;t.jws=tt;var rt=ce.lang;t.lang=rt}).call(this,r(28).Buffer)},function(e,t,r){"use strict";(function(e){var n=r(30),i=r(31),o=r(32);function s(){return u.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function a(e,t){if(s()<t)throw new RangeError("Invalid typed array length");return u.TYPED_ARRAY_SUPPORT?(e=new Uint8Array(t)).__proto__=u.prototype:(null===e&&(e=new u(t)),e.length=t),e}function u(e,t,r){if(!(u.TYPED_ARRAY_SUPPORT||this instanceof u))return new u(e,t,r);if("number"==typeof e){if("string"==typeof t)throw new Error("If encoding is specified then the first argument must be a string");return l(this,e)}return c(this,e,t,r)}function c(e,t,r,n){if("number"==typeof t)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&t instanceof ArrayBuffer?function(e,t,r,n){if(t.byteLength,r<0||t.byteLength<r)throw new RangeError("'offset' is out of bounds");if(t.byteLength<r+(n||0))throw new RangeError("'length' is out of bounds");return t=void 0===r&&void 0===n?new Uint8Array(t):void 0===n?new Uint8Array(t,r):new Uint8Array(t,r,n),u.TYPED_ARRAY_SUPPORT?(e=t).__proto__=u.prototype:e=d(e,t),e}(e,t,r,n):"string"==typeof t?function(e,t,r){if("string"==typeof r&&""!==r||(r="utf8"),!u.isEncoding(r))throw new TypeError('"encoding" must be a valid string encoding');var n=0|p(t,r),i=(e=a(e,n)).write(t,r);return i!==n&&(e=e.slice(0,i)),e}(e,t,r):function(e,t){if(u.isBuffer(t)){var r=0|f(t.length);return 0===(e=a(e,r)).length||t.copy(e,0,0,r),e}if(t){if("undefined"!=typeof ArrayBuffer&&t.buffer instanceof ArrayBuffer||"length"in t)return"number"!=typeof t.length||function(e){return e!=e}(t.length)?a(e,0):d(e,t);if("Buffer"===t.type&&o(t.data))return d(e,t.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(e,t)}function h(e){if("number"!=typeof e)throw new TypeError('"size" argument must be a number');if(e<0)throw new RangeError('"size" argument must not be negative')}function l(e,t){if(h(t),e=a(e,t<0?0:0|f(t)),!u.TYPED_ARRAY_SUPPORT)for(var r=0;r<t;++r)e[r]=0;return e}function d(e,t){var r=t.length<0?0:0|f(t.length);e=a(e,r);for(var n=0;n<r;n+=1)e[n]=255&t[n];return e}function f(e){if(e>=s())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s().toString(16)+" bytes");return 0|e}function p(e,t){if(u.isBuffer(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var r=e.length;if(0===r)return 0;for(var n=!1;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return B(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return K(e).length;default:if(n)return B(e).length;t=(""+t).toLowerCase(),n=!0}}function g(e,t,r){var n=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return I(this,t,r);case"utf8":case"utf-8":return k(this,t,r);case"ascii":return P(this,t,r);case"latin1":case"binary":return C(this,t,r);case"base64":return A(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return T(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function y(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}function v(e,t,r,n,i){if(0===e.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,isNaN(r)&&(r=i?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(i)return-1;r=e.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof t&&(t=u.from(t,n)),u.isBuffer(t))return 0===t.length?-1:m(e,t,r,n,i);if("number"==typeof t)return t&=255,u.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):m(e,[t],r,n,i);throw new TypeError("val must be string, number or Buffer")}function m(e,t,r,n,i){var o,s=1,a=e.length,u=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return-1;s=2,a/=2,u/=2,r/=2}function c(e,t){return 1===s?e[t]:e.readUInt16BE(t*s)}if(i){var h=-1;for(o=r;o<a;o++)if(c(e,o)===c(t,-1===h?0:o-h)){if(-1===h&&(h=o),o-h+1===u)return h*s}else-1!==h&&(o-=o-h),h=-1}else for(r+u>a&&(r=a-u),o=r;o>=0;o--){for(var l=!0,d=0;d<u;d++)if(c(e,o+d)!==c(t,d)){l=!1;break}if(l)return o}return-1}function w(e,t,r,n){r=Number(r)||0;var i=e.length-r;n?(n=Number(n))>i&&(n=i):n=i;var o=t.length;if(o%2!=0)throw new TypeError("Invalid hex string");n>o/2&&(n=o/2);for(var s=0;s<n;++s){var a=parseInt(t.substr(2*s,2),16);if(isNaN(a))return s;e[r+s]=a}return s}function _(e,t,r,n){return V(B(t,e.length-r),e,r,n)}function S(e,t,r,n){return V(function(e){for(var t=[],r=0;r<e.length;++r)t.push(255&e.charCodeAt(r));return t}(t),e,r,n)}function b(e,t,r,n){return S(e,t,r,n)}function E(e,t,r,n){return V(K(t),e,r,n)}function F(e,t,r,n){return V(function(e,t){for(var r,n,i,o=[],s=0;s<e.length&&!((t-=2)<0);++s)n=(r=e.charCodeAt(s))>>8,i=r%256,o.push(i),o.push(n);return o}(t,e.length-r),e,r,n)}function A(e,t,r){return 0===t&&r===e.length?n.fromByteArray(e):n.fromByteArray(e.slice(t,r))}function k(e,t,r){r=Math.min(e.length,r);for(var n=[],i=t;i<r;){var o,s,a,u,c=e[i],h=null,l=c>239?4:c>223?3:c>191?2:1;if(i+l<=r)switch(l){case 1:c<128&&(h=c);break;case 2:128==(192&(o=e[i+1]))&&(u=(31&c)<<6|63&o)>127&&(h=u);break;case 3:o=e[i+1],s=e[i+2],128==(192&o)&&128==(192&s)&&(u=(15&c)<<12|(63&o)<<6|63&s)>2047&&(u<55296||u>57343)&&(h=u);break;case 4:o=e[i+1],s=e[i+2],a=e[i+3],128==(192&o)&&128==(192&s)&&128==(192&a)&&(u=(15&c)<<18|(63&o)<<12|(63&s)<<6|63&a)>65535&&u<1114112&&(h=u)}null===h?(h=65533,l=1):h>65535&&(h-=65536,n.push(h>>>10&1023|55296),h=56320|1023&h),n.push(h),i+=l}return function(e){var t=e.length;if(t<=x)return String.fromCharCode.apply(String,e);for(var r="",n=0;n<t;)r+=String.fromCharCode.apply(String,e.slice(n,n+=x));return r}(n)}t.Buffer=u,t.SlowBuffer=function(e){return+e!=e&&(e=0),u.alloc(+e)},t.INSPECT_MAX_BYTES=50,u.TYPED_ARRAY_SUPPORT=void 0!==e.TYPED_ARRAY_SUPPORT?e.TYPED_ARRAY_SUPPORT:function(){try{var e=new Uint8Array(1);return e.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===e.foo()&&"function"==typeof e.subarray&&0===e.subarray(1,1).byteLength}catch(e){return!1}}(),t.kMaxLength=s(),u.poolSize=8192,u._augment=function(e){return e.__proto__=u.prototype,e},u.from=function(e,t,r){return c(null,e,t,r)},u.TYPED_ARRAY_SUPPORT&&(u.prototype.__proto__=Uint8Array.prototype,u.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&u[Symbol.species]===u&&Object.defineProperty(u,Symbol.species,{value:null,configurable:!0})),u.alloc=function(e,t,r){return function(e,t,r,n){return h(t),t<=0?a(e,t):void 0!==r?"string"==typeof n?a(e,t).fill(r,n):a(e,t).fill(r):a(e,t)}(null,e,t,r)},u.allocUnsafe=function(e){return l(null,e)},u.allocUnsafeSlow=function(e){return l(null,e)},u.isBuffer=function(e){return!(null==e||!e._isBuffer)},u.compare=function(e,t){if(!u.isBuffer(e)||!u.isBuffer(t))throw new TypeError("Arguments must be Buffers");if(e===t)return 0;for(var r=e.length,n=t.length,i=0,o=Math.min(r,n);i<o;++i)if(e[i]!==t[i]){r=e[i],n=t[i];break}return r<n?-1:n<r?1:0},u.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},u.concat=function(e,t){if(!o(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return u.alloc(0);var r;if(void 0===t)for(t=0,r=0;r<e.length;++r)t+=e[r].length;var n=u.allocUnsafe(t),i=0;for(r=0;r<e.length;++r){var s=e[r];if(!u.isBuffer(s))throw new TypeError('"list" argument must be an Array of Buffers');s.copy(n,i),i+=s.length}return n},u.byteLength=p,u.prototype._isBuffer=!0,u.prototype.swap16=function(){var e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<e;t+=2)y(this,t,t+1);return this},u.prototype.swap32=function(){var e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<e;t+=4)y(this,t,t+3),y(this,t+1,t+2);return this},u.prototype.swap64=function(){var e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<e;t+=8)y(this,t,t+7),y(this,t+1,t+6),y(this,t+2,t+5),y(this,t+3,t+4);return this},u.prototype.toString=function(){var e=0|this.length;return 0===e?"":0===arguments.length?k(this,0,e):g.apply(this,arguments)},u.prototype.equals=function(e){if(!u.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===u.compare(this,e)},u.prototype.inspect=function(){var e="",r=t.INSPECT_MAX_BYTES;return this.length>0&&(e=this.toString("hex",0,r).match(/.{2}/g).join(" "),this.length>r&&(e+=" ... ")),"<Buffer "+e+">"},u.prototype.compare=function(e,t,r,n,i){if(!u.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),t<0||r>e.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&t>=r)return 0;if(n>=i)return-1;if(t>=r)return 1;if(this===e)return 0;for(var o=(i>>>=0)-(n>>>=0),s=(r>>>=0)-(t>>>=0),a=Math.min(o,s),c=this.slice(n,i),h=e.slice(t,r),l=0;l<a;++l)if(c[l]!==h[l]){o=c[l],s=h[l];break}return o<s?-1:s<o?1:0},u.prototype.includes=function(e,t,r){return-1!==this.indexOf(e,t,r)},u.prototype.indexOf=function(e,t,r){return v(this,e,t,r,!0)},u.prototype.lastIndexOf=function(e,t,r){return v(this,e,t,r,!1)},u.prototype.write=function(e,t,r,n){if(void 0===t)n="utf8",r=this.length,t=0;else if(void 0===r&&"string"==typeof t)n=t,r=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t|=0,isFinite(r)?(r|=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}var i=this.length-t;if((void 0===r||r>i)&&(r=i),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var o=!1;;)switch(n){case"hex":return w(this,e,t,r);case"utf8":case"utf-8":return _(this,e,t,r);case"ascii":return S(this,e,t,r);case"latin1":case"binary":return b(this,e,t,r);case"base64":return E(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return F(this,e,t,r);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}},u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var x=4096;function P(e,t,r){var n="";r=Math.min(e.length,r);for(var i=t;i<r;++i)n+=String.fromCharCode(127&e[i]);return n}function C(e,t,r){var n="";r=Math.min(e.length,r);for(var i=t;i<r;++i)n+=String.fromCharCode(e[i]);return n}function I(e,t,r){var n=e.length;(!t||t<0)&&(t=0),(!r||r<0||r>n)&&(r=n);for(var i="",o=t;o<r;++o)i+=j(e[o]);return i}function T(e,t,r){for(var n=e.slice(t,r),i="",o=0;o<n.length;o+=2)i+=String.fromCharCode(n[o]+256*n[o+1]);return i}function R(e,t,r){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>r)throw new RangeError("Trying to access beyond buffer length")}function U(e,t,r,n,i,o){if(!u.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||t<o)throw new RangeError('"value" argument is out of bounds');if(r+n>e.length)throw new RangeError("Index out of range")}function O(e,t,r,n){t<0&&(t=65535+t+1);for(var i=0,o=Math.min(e.length-r,2);i<o;++i)e[r+i]=(t&255<<8*(n?i:1-i))>>>8*(n?i:1-i)}function D(e,t,r,n){t<0&&(t=4294967295+t+1);for(var i=0,o=Math.min(e.length-r,4);i<o;++i)e[r+i]=t>>>8*(n?i:3-i)&255}function L(e,t,r,n,i,o){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function H(e,t,r,n,o){return o||L(e,0,r,4),i.write(e,t,r,n,23,4),r+4}function M(e,t,r,n,o){return o||L(e,0,r,8),i.write(e,t,r,n,52,8),r+8}u.prototype.slice=function(e,t){var r,n=this.length;if((e=~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),(t=void 0===t?n:~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),t<e&&(t=e),u.TYPED_ARRAY_SUPPORT)(r=this.subarray(e,t)).__proto__=u.prototype;else{var i=t-e;r=new u(i,void 0);for(var o=0;o<i;++o)r[o]=this[o+e]}return r},u.prototype.readUIntLE=function(e,t,r){e|=0,t|=0,r||R(e,t,this.length);for(var n=this[e],i=1,o=0;++o<t&&(i*=256);)n+=this[e+o]*i;return n},u.prototype.readUIntBE=function(e,t,r){e|=0,t|=0,r||R(e,t,this.length);for(var n=this[e+--t],i=1;t>0&&(i*=256);)n+=this[e+--t]*i;return n},u.prototype.readUInt8=function(e,t){return t||R(e,1,this.length),this[e]},u.prototype.readUInt16LE=function(e,t){return t||R(e,2,this.length),this[e]|this[e+1]<<8},u.prototype.readUInt16BE=function(e,t){return t||R(e,2,this.length),this[e]<<8|this[e+1]},u.prototype.readUInt32LE=function(e,t){return t||R(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},u.prototype.readUInt32BE=function(e,t){return t||R(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},u.prototype.readIntLE=function(e,t,r){e|=0,t|=0,r||R(e,t,this.length);for(var n=this[e],i=1,o=0;++o<t&&(i*=256);)n+=this[e+o]*i;return n>=(i*=128)&&(n-=Math.pow(2,8*t)),n},u.prototype.readIntBE=function(e,t,r){e|=0,t|=0,r||R(e,t,this.length);for(var n=t,i=1,o=this[e+--n];n>0&&(i*=256);)o+=this[e+--n]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*t)),o},u.prototype.readInt8=function(e,t){return t||R(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},u.prototype.readInt16LE=function(e,t){t||R(e,2,this.length);var r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},u.prototype.readInt16BE=function(e,t){t||R(e,2,this.length);var r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},u.prototype.readInt32LE=function(e,t){return t||R(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},u.prototype.readInt32BE=function(e,t){return t||R(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},u.prototype.readFloatLE=function(e,t){return t||R(e,4,this.length),i.read(this,e,!0,23,4)},u.prototype.readFloatBE=function(e,t){return t||R(e,4,this.length),i.read(this,e,!1,23,4)},u.prototype.readDoubleLE=function(e,t){return t||R(e,8,this.length),i.read(this,e,!0,52,8)},u.prototype.readDoubleBE=function(e,t){return t||R(e,8,this.length),i.read(this,e,!1,52,8)},u.prototype.writeUIntLE=function(e,t,r,n){e=+e,t|=0,r|=0,n||U(this,e,t,r,Math.pow(2,8*r)-1,0);var i=1,o=0;for(this[t]=255&e;++o<r&&(i*=256);)this[t+o]=e/i&255;return t+r},u.prototype.writeUIntBE=function(e,t,r,n){e=+e,t|=0,r|=0,n||U(this,e,t,r,Math.pow(2,8*r)-1,0);var i=r-1,o=1;for(this[t+i]=255&e;--i>=0&&(o*=256);)this[t+i]=e/o&255;return t+r},u.prototype.writeUInt8=function(e,t,r){return e=+e,t|=0,r||U(this,e,t,1,255,0),u.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},u.prototype.writeUInt16LE=function(e,t,r){return e=+e,t|=0,r||U(this,e,t,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):O(this,e,t,!0),t+2},u.prototype.writeUInt16BE=function(e,t,r){return e=+e,t|=0,r||U(this,e,t,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):O(this,e,t,!1),t+2},u.prototype.writeUInt32LE=function(e,t,r){return e=+e,t|=0,r||U(this,e,t,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):D(this,e,t,!0),t+4},u.prototype.writeUInt32BE=function(e,t,r){return e=+e,t|=0,r||U(this,e,t,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):D(this,e,t,!1),t+4},u.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t|=0,!n){var i=Math.pow(2,8*r-1);U(this,e,t,r,i-1,-i)}var o=0,s=1,a=0;for(this[t]=255&e;++o<r&&(s*=256);)e<0&&0===a&&0!==this[t+o-1]&&(a=1),this[t+o]=(e/s>>0)-a&255;return t+r},u.prototype.writeIntBE=function(e,t,r,n){if(e=+e,t|=0,!n){var i=Math.pow(2,8*r-1);U(this,e,t,r,i-1,-i)}var o=r-1,s=1,a=0;for(this[t+o]=255&e;--o>=0&&(s*=256);)e<0&&0===a&&0!==this[t+o+1]&&(a=1),this[t+o]=(e/s>>0)-a&255;return t+r},u.prototype.writeInt8=function(e,t,r){return e=+e,t|=0,r||U(this,e,t,1,127,-128),u.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},u.prototype.writeInt16LE=function(e,t,r){return e=+e,t|=0,r||U(this,e,t,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):O(this,e,t,!0),t+2},u.prototype.writeInt16BE=function(e,t,r){return e=+e,t|=0,r||U(this,e,t,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):O(this,e,t,!1),t+2},u.prototype.writeInt32LE=function(e,t,r){return e=+e,t|=0,r||U(this,e,t,4,2147483647,-2147483648),u.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):D(this,e,t,!0),t+4},u.prototype.writeInt32BE=function(e,t,r){return e=+e,t|=0,r||U(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):D(this,e,t,!1),t+4},u.prototype.writeFloatLE=function(e,t,r){return H(this,e,t,!0,r)},u.prototype.writeFloatBE=function(e,t,r){return H(this,e,t,!1,r)},u.prototype.writeDoubleLE=function(e,t,r){return M(this,e,t,!0,r)},u.prototype.writeDoubleBE=function(e,t,r){return M(this,e,t,!1,r)},u.prototype.copy=function(e,t,r,n){if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n<r&&(n=r),n===r)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t<n-r&&(n=e.length-t+r);var i,o=n-r;if(this===e&&r<t&&t<n)for(i=o-1;i>=0;--i)e[i+t]=this[i+r];else if(o<1e3||!u.TYPED_ARRAY_SUPPORT)for(i=0;i<o;++i)e[i+t]=this[i+r];else Uint8Array.prototype.set.call(e,this.subarray(r,r+o),t);return o},u.prototype.fill=function(e,t,r,n){if("string"==typeof e){if("string"==typeof t?(n=t,t=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),1===e.length){var i=e.charCodeAt(0);i<256&&(e=i)}if(void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!u.isEncoding(n))throw new TypeError("Unknown encoding: "+n)}else"number"==typeof e&&(e&=255);if(t<0||this.length<t||this.length<r)throw new RangeError("Out of range index");if(r<=t)return this;var o;if(t>>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(o=t;o<r;++o)this[o]=e;else{var s=u.isBuffer(e)?e:B(new u(e,n).toString()),a=s.length;for(o=0;o<r-t;++o)this[o+t]=s[o%a]}return this};var N=/[^+\/0-9A-Za-z-_]/g;function j(e){return e<16?"0"+e.toString(16):e.toString(16)}function B(e,t){var r;t=t||1/0;for(var n=e.length,i=null,o=[],s=0;s<n;++s){if((r=e.charCodeAt(s))>55295&&r<57344){if(!i){if(r>56319){(t-=3)>-1&&o.push(239,191,189);continue}if(s+1===n){(t-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(t-=3)>-1&&o.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((t-=1)<0)break;o.push(r)}else if(r<2048){if((t-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function K(e){return n.toByteArray(function(e){if((e=function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}(e).replace(N,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function V(e,t,r,n){for(var i=0;i<n&&!(i+r>=t.length||i>=e.length);++i)t[i+r]=e[i];return i}}).call(this,r(29))},function(e,t){var r;r=function(){return this}();try{r=r||new Function("return this")()}catch(e){"object"==typeof window&&(r=window)}e.exports=r},function(e,t,r){"use strict";t.byteLength=function(e){var t=c(e),r=t[0],n=t[1];return 3*(r+n)/4-n},t.toByteArray=function(e){var t,r,n=c(e),s=n[0],a=n[1],u=new o(function(e,t,r){return 3*(t+r)/4-r}(0,s,a)),h=0,l=a>0?s-4:s;for(r=0;r<l;r+=4)t=i[e.charCodeAt(r)]<<18|i[e.charCodeAt(r+1)]<<12|i[e.charCodeAt(r+2)]<<6|i[e.charCodeAt(r+3)],u[h++]=t>>16&255,u[h++]=t>>8&255,u[h++]=255&t;return 2===a&&(t=i[e.charCodeAt(r)]<<2|i[e.charCodeAt(r+1)]>>4,u[h++]=255&t),1===a&&(t=i[e.charCodeAt(r)]<<10|i[e.charCodeAt(r+1)]<<4|i[e.charCodeAt(r+2)]>>2,u[h++]=t>>8&255,u[h++]=255&t),u},t.fromByteArray=function(e){for(var t,r=e.length,i=r%3,o=[],s=16383,a=0,u=r-i;a<u;a+=s)o.push(h(e,a,a+s>u?u:a+s));return 1===i?(t=e[r-1],o.push(n[t>>2]+n[t<<4&63]+"==")):2===i&&(t=(e[r-2]<<8)+e[r-1],o.push(n[t>>10]+n[t>>4&63]+n[t<<2&63]+"=")),o.join("")};for(var n=[],i=[],o="undefined"!=typeof Uint8Array?Uint8Array:Array,s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0,u=s.length;a<u;++a)n[a]=s[a],i[s.charCodeAt(a)]=a;function c(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 h(e,t,r){for(var i,o,s=[],a=t;a<r;a+=3)i=(e[a]<<16&16711680)+(e[a+1]<<8&65280)+(255&e[a+2]),s.push(n[(o=i)>>18&63]+n[o>>12&63]+n[o>>6&63]+n[63&o]);return s.join("")}i["-".charCodeAt(0)]=62,i["_".charCodeAt(0)]=63},function(e,t){t.read=function(e,t,r,n,i){var o,s,a=8*i-n-1,u=(1<<a)-1,c=u>>1,h=-7,l=r?i-1:0,d=r?-1:1,f=e[t+l];for(l+=d,o=f&(1<<-h)-1,f>>=-h,h+=a;h>0;o=256*o+e[t+l],l+=d,h-=8);for(s=o&(1<<-h)-1,o>>=-h,h+=n;h>0;s=256*s+e[t+l],l+=d,h-=8);if(0===o)o=1-c;else{if(o===u)return s?NaN:1/0*(f?-1:1);s+=Math.pow(2,n),o-=c}return(f?-1:1)*s*Math.pow(2,o-n)},t.write=function(e,t,r,n,i,o){var s,a,u,c=8*o-i-1,h=(1<<c)-1,l=h>>1,d=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,f=n?0:o-1,p=n?1:-1,g=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(a=isNaN(t)?1:0,s=h):(s=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-s))<1&&(s--,u*=2),(t+=s+l>=1?d/u:d*Math.pow(2,1-l))*u>=2&&(s++,u/=2),s+l>=h?(a=0,s=h):s+l>=1?(a=(t*u-1)*Math.pow(2,i),s+=l):(a=t*Math.pow(2,l-1)*Math.pow(2,i),s=0));i>=8;e[r+f]=255&a,f+=p,a/=256,i-=8);for(s=s<<i|a,c+=i;c>0;e[r+f]=255&s,f+=p,s/=256,c-=8);e[r+f-p]|=128*g}},function(e,t){var r={}.toString;e.exports=Array.isArray||function(e){return"[object Array]"==r.call(e)}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t=e.jws,r=e.KeyUtil,i=e.X509,o=e.crypto,s=e.hextob64u,a=e.b64tohex,u=e.AllowedSigningAlgs;return function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}return e.parseJwt=function e(r){n.Log.debug("JoseUtil.parseJwt");try{var i=t.JWS.parse(r);return{header:i.headerObj,payload:i.payloadObj}}catch(e){n.Log.error(e)}},e.validateJwt=function(t,o,s,u,c,h,l){n.Log.debug("JoseUtil.validateJwt");try{if("RSA"===o.kty)if(o.e&&o.n)o=r.getKey(o);else{if(!o.x5c||!o.x5c.length)return n.Log.error("JoseUtil.validateJwt: RSA key missing key material",o),Promise.reject(new Error("RSA key missing key material"));var d=a(o.x5c[0]);o=i.getPublicKeyFromCertHex(d)}else{if("EC"!==o.kty)return n.Log.error("JoseUtil.validateJwt: Unsupported key type",o&&o.kty),Promise.reject(new Error(o.kty));if(!(o.crv&&o.x&&o.y))return n.Log.error("JoseUtil.validateJwt: EC key missing key material",o),Promise.reject(new Error("EC key missing key material"));o=r.getKey(o)}return e._validateJwt(t,o,s,u,c,h,l)}catch(e){return n.Log.error(e&&e.message||e),Promise.reject("JWT validation failed")}},e.validateJwtAttributes=function(t,r,i,o,s,a){o||(o=0),s||(s=parseInt(Date.now()/1e3));var u=e.parseJwt(t).payload;if(!u.iss)return n.Log.error("JoseUtil._validateJwt: issuer was not provided"),Promise.reject(new Error("issuer was not provided"));if(u.iss!==r)return n.Log.error("JoseUtil._validateJwt: Invalid issuer in token",u.iss),Promise.reject(new Error("Invalid issuer in token: "+u.iss));if(!u.aud)return n.Log.error("JoseUtil._validateJwt: aud was not provided"),Promise.reject(new Error("aud was not provided"));if(!(u.aud===i||Array.isArray(u.aud)&&u.aud.indexOf(i)>=0))return n.Log.error("JoseUtil._validateJwt: Invalid audience in token",u.aud),Promise.reject(new Error("Invalid audience in token: "+u.aud));if(u.azp&&u.azp!==i)return n.Log.error("JoseUtil._validateJwt: Invalid azp in token",u.azp),Promise.reject(new Error("Invalid azp in token: "+u.azp));if(!a){var c=s+o,h=s-o;if(!u.iat)return n.Log.error("JoseUtil._validateJwt: iat was not provided"),Promise.reject(new Error("iat was not provided"));if(c<u.iat)return n.Log.error("JoseUtil._validateJwt: iat is in the future",u.iat),Promise.reject(new Error("iat is in the future: "+u.iat));if(u.nbf&&c<u.nbf)return n.Log.error("JoseUtil._validateJwt: nbf is in the future",u.nbf),Promise.reject(new Error("nbf is in the future: "+u.nbf));if(!u.exp)return n.Log.error("JoseUtil._validateJwt: exp was not provided"),Promise.reject(new Error("exp was not provided"));if(u.exp<h)return n.Log.error("JoseUtil._validateJwt: exp is in the past",u.exp),Promise.reject(new Error("exp is in the past:"+u.exp))}return Promise.resolve(u)},e._validateJwt=function(r,i,o,s,a,c,h){return e.validateJwtAttributes(r,o,s,a,c,h).then((function(e){try{return t.JWS.verify(r,i,u)?e:(n.Log.error("JoseUtil._validateJwt: signature validation failed"),Promise.reject(new Error("signature validation failed")))}catch(e){return n.Log.error(e&&e.message||e),Promise.reject(new Error("signature validation failed"))}}))},e.hashString=function e(t,r){try{return o.Util.hashString(t,r)}catch(e){n.Log.error(e)}},e.hexToBase64Url=function e(t){try{return s(t)}catch(e){n.Log.error(e)}},e}()};var n=r(0);e.exports=t.default},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SigninResponse=void 0;var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),i=r(3);function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}t.SigninResponse=function(){function e(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"#";o(this,e);var n=i.UrlUtility.parseUrlFragment(t,r);this.error=n.error,this.error_description=n.error_description,this.error_uri=n.error_uri,this.code=n.code,this.state=n.state,this.id_token=n.id_token,this.session_state=n.session_state,this.access_token=n.access_token,this.token_type=n.token_type,this.scope=n.scope,this.profile=void 0,this.expires_in=n.expires_in}return n(e,[{key:"expires_in",get:function(){if(this.expires_at){var e=parseInt(Date.now()/1e3);return this.expires_at-e}},set:function(e){var t=parseInt(e);if("number"==typeof t&&t>0){var r=parseInt(Date.now()/1e3);this.expires_at=r+t}}},{key:"expired",get:function(){var e=this.expires_in;if(void 0!==e)return e<=0}},{key:"scopes",get:function(){return(this.scope||"").split(" ")}},{key:"isOpenIdConnect",get:function(){return this.scopes.indexOf("openid")>=0||!!this.id_token}}]),e}()},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SignoutRequest=void 0;var n=r(0),i=r(3),o=r(9);t.SignoutRequest=function e(t){var r=t.url,s=t.id_token_hint,a=t.post_logout_redirect_uri,u=t.data,c=t.extraQueryParams,h=t.request_type;if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),!r)throw n.Log.error("SignoutRequest.ctor: No url passed"),new Error("url");for(var l in s&&(r=i.UrlUtility.addQueryParam(r,"id_token_hint",s)),a&&(r=i.UrlUtility.addQueryParam(r,"post_logout_redirect_uri",a),u&&(this.state=new o.State({data:u,request_type:h}),r=i.UrlUtility.addQueryParam(r,"state",this.state.id))),c)r=i.UrlUtility.addQueryParam(r,l,c[l]);this.url=r}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SignoutResponse=void 0;var n=r(3);t.SignoutResponse=function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e);var r=n.UrlUtility.parseUrlFragment(t,"?");this.error=r.error,this.error_description=r.error_description,this.error_uri=r.error_uri,this.state=r.state}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.InMemoryWebStorage=void 0;var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),i=r(0);t.InMemoryWebStorage=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._data={}}return e.prototype.getItem=function(e){return i.Log.debug("InMemoryWebStorage.getItem",e),this._data[e]},e.prototype.setItem=function(e,t){i.Log.debug("InMemoryWebStorage.setItem",e),this._data[e]=t},e.prototype.removeItem=function(e){i.Log.debug("InMemoryWebStorage.removeItem",e),delete this._data[e]},e.prototype.key=function(e){return Object.getOwnPropertyNames(this._data)[e]},n(e,[{key:"length",get:function(){return Object.getOwnPropertyNames(this._data).length}}]),e}()},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.UserManager=void 0;var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),i=r(0),o=r(10),s=r(39),a=r(15),u=r(45),c=r(47),h=r(18),l=r(8),d=r(20),f=r(11),p=r(4);function g(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function y(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}t.UserManager=function(e){function t(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:c.SilentRenewService,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:h.SessionMonitor,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:d.TokenRevocationClient,l=arguments.length>4&&void 0!==arguments[4]?arguments[4]:f.TokenClient,v=arguments.length>5&&void 0!==arguments[5]?arguments[5]:p.JoseUtil;g(this,t),r instanceof s.UserManagerSettings||(r=new s.UserManagerSettings(r));var m=y(this,e.call(this,r));return m._events=new u.UserManagerEvents(r),m._silentRenewService=new n(m),m.settings.automaticSilentRenew&&(i.Log.debug("UserManager.ctor: automaticSilentRenew is configured, setting up silent renew"),m.startSilentRenew()),m.settings.monitorSession&&(i.Log.debug("UserManager.ctor: monitorSession is configured, setting up session monitor"),m._sessionMonitor=new o(m)),m._tokenRevocationClient=new a(m._settings),m._tokenClient=new l(m._settings),m._joseUtil=v,m}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),t.prototype.getUser=function(){var e=this;return this._loadUser().then((function(t){return t?(i.Log.info("UserManager.getUser: user loaded"),e._events.load(t,!1),t):(i.Log.info("UserManager.getUser: user not found in storage"),null)}))},t.prototype.removeUser=function(){var e=this;return this.storeUser(null).then((function(){i.Log.info("UserManager.removeUser: user removed from storage"),e._events.unload()}))},t.prototype.signinRedirect=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};(e=Object.assign({},e)).request_type="si:r";var t={useReplaceToNavigate:e.useReplaceToNavigate};return this._signinStart(e,this._redirectNavigator,t).then((function(){i.Log.info("UserManager.signinRedirect: successful")}))},t.prototype.signinRedirectCallback=function(e){return this._signinEnd(e||this._redirectNavigator.url).then((function(e){return e.profile&&e.profile.sub?i.Log.info("UserManager.signinRedirectCallback: successful, signed in sub: ",e.profile.sub):i.Log.info("UserManager.signinRedirectCallback: no sub"),e}))},t.prototype.signinPopup=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};(e=Object.assign({},e)).request_type="si:p";var t=e.redirect_uri||this.settings.popup_redirect_uri||this.settings.redirect_uri;return t?(e.redirect_uri=t,e.display="popup",this._signin(e,this._popupNavigator,{startUrl:t,popupWindowFeatures:e.popupWindowFeatures||this.settings.popupWindowFeatures,popupWindowTarget:e.popupWindowTarget||this.settings.popupWindowTarget}).then((function(e){return e&&(e.profile&&e.profile.sub?i.Log.info("UserManager.signinPopup: signinPopup successful, signed in sub: ",e.profile.sub):i.Log.info("UserManager.signinPopup: no sub")),e}))):(i.Log.error("UserManager.signinPopup: No popup_redirect_uri or redirect_uri configured"),Promise.reject(new Error("No popup_redirect_uri or redirect_uri configured")))},t.prototype.signinPopupCallback=function(e){return this._signinCallback(e,this._popupNavigator).then((function(e){return e&&(e.profile&&e.profile.sub?i.Log.info("UserManager.signinPopupCallback: successful, signed in sub: ",e.profile.sub):i.Log.info("UserManager.signinPopupCallback: no sub")),e})).catch((function(e){i.Log.error(e.message)}))},t.prototype.signinSilent=function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return t=Object.assign({},t),this._loadUser().then((function(r){return r&&r.refresh_token?(t.refresh_token=r.refresh_token,e._useRefreshToken(t)):(t.request_type="si:s",t.id_token_hint=t.id_token_hint||e.settings.includeIdTokenInSilentRenew&&r&&r.id_token,r&&e._settings.validateSubOnSilentRenew&&(i.Log.debug("UserManager.signinSilent, subject prior to silent renew: ",r.profile.sub),t.current_sub=r.profile.sub),e._signinSilentIframe(t))}))},t.prototype._useRefreshToken=function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this._tokenClient.exchangeRefreshToken(t).then((function(t){return t?t.access_token?e._loadUser().then((function(r){if(r){var n=Promise.resolve();return t.id_token&&(n=e._validateIdTokenFromTokenRefreshToken(r.profile,t.id_token)),n.then((function(){return i.Log.debug("UserManager._useRefreshToken: refresh token response success"),r.id_token=t.id_token||r.id_token,r.access_token=t.access_token,r.refresh_token=t.refresh_token||r.refresh_token,r.expires_in=t.expires_in,e.storeUser(r).then((function(){return e._events.load(r),r}))}))}return null})):(i.Log.error("UserManager._useRefreshToken: No access token returned from token endpoint"),Promise.reject("No access token returned from token endpoint")):(i.Log.error("UserManager._useRefreshToken: No response returned from token endpoint"),Promise.reject("No response returned from token endpoint"))}))},t.prototype._validateIdTokenFromTokenRefreshToken=function(e,t){var r=this;return this._metadataService.getIssuer().then((function(n){return r.settings.getEpochTime().then((function(o){return r._joseUtil.validateJwtAttributes(t,n,r._settings.client_id,r._settings.clockSkew,o).then((function(t){return t?t.sub!==e.sub?(i.Log.error("UserManager._validateIdTokenFromTokenRefreshToken: sub in id_token does not match current sub"),Promise.reject(new Error("sub in id_token does not match current sub"))):t.auth_time&&t.auth_time!==e.auth_time?(i.Log.error("UserManager._validateIdTokenFromTokenRefreshToken: auth_time in id_token does not match original auth_time"),Promise.reject(new Error("auth_time in id_token does not match original auth_time"))):t.azp&&t.azp!==e.azp?(i.Log.error("UserManager._validateIdTokenFromTokenRefreshToken: azp in id_token does not match original azp"),Promise.reject(new Error("azp in id_token does not match original azp"))):!t.azp&&e.azp?(i.Log.error("UserManager._validateIdTokenFromTokenRefreshToken: azp not in id_token, but present in original id_token"),Promise.reject(new Error("azp not in id_token, but present in original id_token"))):void 0:(i.Log.error("UserManager._validateIdTokenFromTokenRefreshToken: Failed to validate id_token"),Promise.reject(new Error("Failed to validate id_token")))}))}))}))},t.prototype._signinSilentIframe=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.redirect_uri||this.settings.silent_redirect_uri||this.settings.redirect_uri;return t?(e.redirect_uri=t,e.prompt=e.prompt||"none",this._signin(e,this._iframeNavigator,{startUrl:t,silentRequestTimeout:e.silentRequestTimeout||this.settings.silentRequestTimeout}).then((function(e){return e&&(e.profile&&e.profile.sub?i.Log.info("UserManager.signinSilent: successful, signed in sub: ",e.profile.sub):i.Log.info("UserManager.signinSilent: no sub")),e}))):(i.Log.error("UserManager.signinSilent: No silent_redirect_uri configured"),Promise.reject(new Error("No silent_redirect_uri configured")))},t.prototype.signinSilentCallback=function(e){return this._signinCallback(e,this._iframeNavigator).then((function(e){return e&&(e.profile&&e.profile.sub?i.Log.info("UserManager.signinSilentCallback: successful, signed in sub: ",e.profile.sub):i.Log.info("UserManager.signinSilentCallback: no sub")),e}))},t.prototype.signinCallback=function(e){var t=this;return this.readSigninResponseState(e).then((function(r){var n=r.state;return r.response,"si:r"===n.request_type?t.signinRedirectCallback(e):"si:p"===n.request_type?t.signinPopupCallback(e):"si:s"===n.request_type?t.signinSilentCallback(e):Promise.reject(new Error("invalid response_type in state"))}))},t.prototype.signoutCallback=function(e,t){var r=this;return this.readSignoutResponseState(e).then((function(n){var i=n.state,o=n.response;return i?"so:r"===i.request_type?r.signoutRedirectCallback(e):"so:p"===i.request_type?r.signoutPopupCallback(e,t):Promise.reject(new Error("invalid response_type in state")):o}))},t.prototype.querySessionStatus=function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};(t=Object.assign({},t)).request_type="si:s";var r=t.redirect_uri||this.settings.silent_redirect_uri||this.settings.redirect_uri;return r?(t.redirect_uri=r,t.prompt="none",t.response_type=t.response_type||this.settings.query_status_response_type,t.scope=t.scope||"openid",t.skipUserInfo=!0,this._signinStart(t,this._iframeNavigator,{startUrl:r,silentRequestTimeout:t.silentRequestTimeout||this.settings.silentRequestTimeout}).then((function(t){return e.processSigninResponse(t.url).then((function(e){if(i.Log.debug("UserManager.querySessionStatus: got signin response"),e.session_state&&e.profile.sub)return i.Log.info("UserManager.querySessionStatus: querySessionStatus success for sub: ",e.profile.sub),{session_state:e.session_state,sub:e.profile.sub,sid:e.profile.sid};i.Log.info("querySessionStatus successful, user not authenticated")})).catch((function(t){if(t.session_state&&e.settings.monitorAnonymousSession&&("login_required"==t.message||"consent_required"==t.message||"interaction_required"==t.message||"account_selection_required"==t.message))return i.Log.info("UserManager.querySessionStatus: querySessionStatus success for anonymous user"),{session_state:t.session_state};throw t}))}))):(i.Log.error("UserManager.querySessionStatus: No silent_redirect_uri configured"),Promise.reject(new Error("No silent_redirect_uri configured")))},t.prototype._signin=function(e,t){var r=this,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this._signinStart(e,t,n).then((function(t){return r._signinEnd(t.url,e)}))},t.prototype._signinStart=function(e,t){var r=this,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return t.prepare(n).then((function(t){return i.Log.debug("UserManager._signinStart: got navigator window handle"),r.createSigninRequest(e).then((function(e){return i.Log.debug("UserManager._signinStart: got signin request"),n.url=e.url,n.id=e.state.id,t.navigate(n)})).catch((function(e){throw t.close&&(i.Log.debug("UserManager._signinStart: Error after preparing navigator, closing navigator window"),t.close()),e}))}))},t.prototype._signinEnd=function(e){var t=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.processSigninResponse(e).then((function(e){i.Log.debug("UserManager._signinEnd: got signin response");var n=new a.User(e);if(r.current_sub){if(r.current_sub!==n.profile.sub)return i.Log.debug("UserManager._signinEnd: current user does not match user returned from signin. sub from signin: ",n.profile.sub),Promise.reject(new Error("login_required"));i.Log.debug("UserManager._signinEnd: current user matches user returned from signin")}return t.storeUser(n).then((function(){return i.Log.debug("UserManager._signinEnd: user stored"),t._events.load(n),n}))}))},t.prototype._signinCallback=function(e,t){i.Log.debug("UserManager._signinCallback");var r="query"===this._settings.response_mode||!this._settings.response_mode&&l.SigninRequest.isCode(this._settings.response_type)?"?":"#";return t.callback(e,void 0,r)},t.prototype.signoutRedirect=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};(e=Object.assign({},e)).request_type="so:r";var t=e.post_logout_redirect_uri||this.settings.post_logout_redirect_uri;t&&(e.post_logout_redirect_uri=t);var r={useReplaceToNavigate:e.useReplaceToNavigate};return this._signoutStart(e,this._redirectNavigator,r).then((function(){i.Log.info("UserManager.signoutRedirect: successful")}))},t.prototype.signoutRedirectCallback=function(e){return this._signoutEnd(e||this._redirectNavigator.url).then((function(e){return i.Log.info("UserManager.signoutRedirectCallback: successful"),e}))},t.prototype.signoutPopup=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};(e=Object.assign({},e)).request_type="so:p";var t=e.post_logout_redirect_uri||this.settings.popup_post_logout_redirect_uri||this.settings.post_logout_redirect_uri;return e.post_logout_redirect_uri=t,e.display="popup",e.post_logout_redirect_uri&&(e.state=e.state||{}),this._signout(e,this._popupNavigator,{startUrl:t,popupWindowFeatures:e.popupWindowFeatures||this.settings.popupWindowFeatures,popupWindowTarget:e.popupWindowTarget||this.settings.popupWindowTarget}).then((function(){i.Log.info("UserManager.signoutPopup: successful")}))},t.prototype.signoutPopupCallback=function(e,t){return void 0===t&&"boolean"==typeof e&&(t=e,e=null),this._popupNavigator.callback(e,t,"?").then((function(){i.Log.info("UserManager.signoutPopupCallback: successful")}))},t.prototype._signout=function(e,t){var r=this,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this._signoutStart(e,t,n).then((function(e){return r._signoutEnd(e.url)}))},t.prototype._signoutStart=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=this,r=arguments[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return r.prepare(n).then((function(r){return i.Log.debug("UserManager._signoutStart: got navigator window handle"),t._loadUser().then((function(o){return i.Log.debug("UserManager._signoutStart: loaded current user from storage"),(t._settings.revokeAccessTokenOnSignout?t._revokeInternal(o):Promise.resolve()).then((function(){var s=e.id_token_hint||o&&o.id_token;return s&&(i.Log.debug("UserManager._signoutStart: Setting id_token into signout request"),e.id_token_hint=s),t.removeUser().then((function(){return i.Log.debug("UserManager._signoutStart: user removed, creating signout request"),t.createSignoutRequest(e).then((function(e){return i.Log.debug("UserManager._signoutStart: got signout request"),n.url=e.url,e.state&&(n.id=e.state.id),r.navigate(n)}))}))}))})).catch((function(e){throw r.close&&(i.Log.debug("UserManager._signoutStart: Error after preparing navigator, closing navigator window"),r.close()),e}))}))},t.prototype._signoutEnd=function(e){return this.processSignoutResponse(e).then((function(e){return i.Log.debug("UserManager._signoutEnd: got signout response"),e}))},t.prototype.revokeAccessToken=function(){var e=this;return this._loadUser().then((function(t){return e._revokeInternal(t,!0).then((function(r){if(r)return i.Log.debug("UserManager.revokeAccessToken: removing token properties from user and re-storing"),t.access_token=null,t.refresh_token=null,t.expires_at=null,t.token_type=null,e.storeUser(t).then((function(){i.Log.debug("UserManager.revokeAccessToken: user stored"),e._events.load(t)}))}))})).then((function(){i.Log.info("UserManager.revokeAccessToken: access token revoked successfully")}))},t.prototype._revokeInternal=function(e,t){var r=this;if(e){var n=e.access_token,o=e.refresh_token;return this._revokeAccessTokenInternal(n,t).then((function(e){return r._revokeRefreshTokenInternal(o,t).then((function(t){return e||t||i.Log.debug("UserManager.revokeAccessToken: no need to revoke due to no token(s), or JWT format"),e||t}))}))}return Promise.resolve(!1)},t.prototype._revokeAccessTokenInternal=function(e,t){return!e||e.indexOf(".")>=0?Promise.resolve(!1):this._tokenRevocationClient.revoke(e,t).then((function(){return!0}))},t.prototype._revokeRefreshTokenInternal=function(e,t){return e?this._tokenRevocationClient.revoke(e,t,"refresh_token").then((function(){return!0})):Promise.resolve(!1)},t.prototype.startSilentRenew=function(){this._silentRenewService.start()},t.prototype.stopSilentRenew=function(){this._silentRenewService.stop()},t.prototype._loadUser=function(){return this._userStore.get(this._userStoreKey).then((function(e){return e?(i.Log.debug("UserManager._loadUser: user storageString loaded"),a.User.fromStorageString(e)):(i.Log.debug("UserManager._loadUser: no user storageString"),null)}))},t.prototype.storeUser=function(e){if(e){i.Log.debug("UserManager.storeUser: storing user");var t=e.toStorageString();return this._userStore.set(this._userStoreKey,t)}return i.Log.debug("storeUser.storeUser: removing user"),this._userStore.remove(this._userStoreKey)},n(t,[{key:"_redirectNavigator",get:function(){return this.settings.redirectNavigator}},{key:"_popupNavigator",get:function(){return this.settings.popupNavigator}},{key:"_iframeNavigator",get:function(){return this.settings.iframeNavigator}},{key:"_userStore",get:function(){return this.settings.userStore}},{key:"events",get:function(){return this._events}},{key:"_userStoreKey",get:function(){return"user:"+this.settings.authority+":"+this.settings.client_id}}]),t}(o.OidcClient)},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.UserManagerSettings=void 0;var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),i=(r(0),r(5)),o=r(40),s=r(41),a=r(43),u=r(6),c=r(1),h=r(8);function l(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function d(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}t.UserManagerSettings=function(e){function t(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=r.popup_redirect_uri,i=r.popup_post_logout_redirect_uri,f=r.popupWindowFeatures,p=r.popupWindowTarget,g=r.silent_redirect_uri,y=r.silentRequestTimeout,v=r.automaticSilentRenew,m=void 0!==v&&v,w=r.validateSubOnSilentRenew,_=void 0!==w&&w,S=r.includeIdTokenInSilentRenew,b=void 0===S||S,E=r.monitorSession,F=void 0===E||E,A=r.monitorAnonymousSession,k=void 0!==A&&A,x=r.checkSessionInterval,P=void 0===x?2e3:x,C=r.stopCheckSessionOnError,I=void 0===C||C,T=r.query_status_response_type,R=r.revokeAccessTokenOnSignout,U=void 0!==R&&R,O=r.accessTokenExpiringNotificationTime,D=void 0===O?60:O,L=r.redirectNavigator,H=void 0===L?new o.RedirectNavigator:L,M=r.popupNavigator,N=void 0===M?new s.PopupNavigator:M,j=r.iframeNavigator,B=void 0===j?new a.IFrameNavigator:j,K=r.userStore,V=void 0===K?new u.WebStorageStateStore({store:c.Global.sessionStorage}):K;l(this,t);var W=d(this,e.call(this,arguments[0]));return W._popup_redirect_uri=n,W._popup_post_logout_redirect_uri=i,W._popupWindowFeatures=f,W._popupWindowTarget=p,W._silent_redirect_uri=g,W._silentRequestTimeout=y,W._automaticSilentRenew=m,W._validateSubOnSilentRenew=_,W._includeIdTokenInSilentRenew=b,W._accessTokenExpiringNotificationTime=D,W._monitorSession=F,W._monitorAnonymousSession=k,W._checkSessionInterval=P,W._stopCheckSessionOnError=I,T?W._query_status_response_type=T:arguments[0]&&arguments[0].response_type?W._query_status_response_type=h.SigninRequest.isOidc(arguments[0].response_type)?"id_token":"code":W._query_status_response_type="id_token",W._revokeAccessTokenOnSignout=U,W._redirectNavigator=H,W._popupNavigator=N,W._iframeNavigator=B,W._userStore=V,W}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),n(t,[{key:"popup_redirect_uri",get:function(){return this._popup_redirect_uri}},{key:"popup_post_logout_redirect_uri",get:function(){return this._popup_post_logout_redirect_uri}},{key:"popupWindowFeatures",get:function(){return this._popupWindowFeatures}},{key:"popupWindowTarget",get:function(){return this._popupWindowTarget}},{key:"silent_redirect_uri",get:function(){return this._silent_redirect_uri}},{key:"silentRequestTimeout",get:function(){return this._silentRequestTimeout}},{key:"automaticSilentRenew",get:function(){return this._automaticSilentRenew}},{key:"validateSubOnSilentRenew",get:function(){return this._validateSubOnSilentRenew}},{key:"includeIdTokenInSilentRenew",get:function(){return this._includeIdTokenInSilentRenew}},{key:"accessTokenExpiringNotificationTime",get:function(){return this._accessTokenExpiringNotificationTime}},{key:"monitorSession",get:function(){return this._monitorSession}},{key:"monitorAnonymousSession",get:function(){return this._monitorAnonymousSession}},{key:"checkSessionInterval",get:function(){return this._checkSessionInterval}},{key:"stopCheckSessionOnError",get:function(){return this._stopCheckSessionOnError}},{key:"query_status_response_type",get:function(){return this._query_status_response_type}},{key:"revokeAccessTokenOnSignout",get:function(){return this._revokeAccessTokenOnSignout}},{key:"redirectNavigator",get:function(){return this._redirectNavigator}},{key:"popupNavigator",get:function(){return this._popupNavigator}},{key:"iframeNavigator",get:function(){return this._iframeNavigator}},{key:"userStore",get:function(){return this._userStore}}]),t}(i.OidcClientSettings)},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.RedirectNavigator=void 0;var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),i=r(0);t.RedirectNavigator=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}return e.prototype.prepare=function(){return Promise.resolve(this)},e.prototype.navigate=function(e){return e&&e.url?(e.useReplaceToNavigate?window.location.replace(e.url):window.location=e.url,Promise.resolve()):(i.Log.error("RedirectNavigator.navigate: No url provided"),Promise.reject(new Error("No url provided")))},n(e,[{key:"url",get:function(){return window.location.href}}]),e}()},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PopupNavigator=void 0;var n=r(0),i=r(42);t.PopupNavigator=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}return e.prototype.prepare=function(e){var t=new i.PopupWindow(e);return Promise.resolve(t)},e.prototype.callback=function e(t,r,o){n.Log.debug("PopupNavigator.callback");try{return i.PopupWindow.notifyOpener(t,r,o),Promise.resolve()}catch(e){return Promise.reject(e)}},e}()},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PopupWindow=void 0;var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),i=r(0),o=r(3);t.PopupWindow=function(){function e(t){var r=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._promise=new Promise((function(e,t){r._resolve=e,r._reject=t}));var n=t.popupWindowTarget||"_blank",o=t.popupWindowFeatures||"location=no,toolbar=no,width=500,height=500,left=100,top=100;";this._popup=window.open("",n,o),this._popup&&(i.Log.debug("PopupWindow.ctor: popup successfully created"),this._checkForPopupClosedTimer=window.setInterval(this._checkForPopupClosed.bind(this),500))}return e.prototype.navigate=function(e){return this._popup?e&&e.url?(i.Log.debug("PopupWindow.navigate: Setting URL in popup"),this._id=e.id,this._id&&(window["popupCallback_"+e.id]=this._callback.bind(this)),this._popup.focus(),this._popup.window.location=e.url):(this._error("PopupWindow.navigate: no url provided"),this._error("No url provided")):this._error("PopupWindow.navigate: Error opening popup window"),this.promise},e.prototype._success=function(e){i.Log.debug("PopupWindow.callback: Successful response from popup window"),this._cleanup(),this._resolve(e)},e.prototype._error=function(e){i.Log.error("PopupWindow.error: ",e),this._cleanup(),this._reject(new Error(e))},e.prototype.close=function(){this._cleanup(!1)},e.prototype._cleanup=function(e){i.Log.debug("PopupWindow.cleanup"),window.clearInterval(this._checkForPopupClosedTimer),this._checkForPopupClosedTimer=null,delete window["popupCallback_"+this._id],this._popup&&!e&&this._popup.close(),this._popup=null},e.prototype._checkForPopupClosed=function(){this._popup&&!this._popup.closed||this._error("Popup window closed")},e.prototype._callback=function(e,t){this._cleanup(t),e?(i.Log.debug("PopupWindow.callback success"),this._success({url:e})):(i.Log.debug("PopupWindow.callback: Invalid response from popup"),this._error("Invalid response from popup"))},e.notifyOpener=function(e,t,r){if(window.opener){if(e=e||window.location.href){var n=o.UrlUtility.parseUrlFragment(e,r);if(n.state){var s="popupCallback_"+n.state,a=window.opener[s];a?(i.Log.debug("PopupWindow.notifyOpener: passing url message to opener"),a(e,t)):i.Log.warn("PopupWindow.notifyOpener: no matching callback found on opener")}else i.Log.warn("PopupWindow.notifyOpener: no state found in response url")}}else i.Log.warn("PopupWindow.notifyOpener: no window.opener. Can't complete notification.")},n(e,[{key:"promise",get:function(){return this._promise}}]),e}()},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.IFrameNavigator=void 0;var n=r(0),i=r(44);t.IFrameNavigator=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}return e.prototype.prepare=function(e){var t=new i.IFrameWindow(e);return Promise.resolve(t)},e.prototype.callback=function e(t){n.Log.debug("IFrameNavigator.callback");try{return i.IFrameWindow.notifyParent(t),Promise.resolve()}catch(e){return Promise.reject(e)}},e}()},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.IFrameWindow=void 0;var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),i=r(0);t.IFrameWindow=function(){function e(t){var r=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._promise=new Promise((function(e,t){r._resolve=e,r._reject=t})),this._boundMessageEvent=this._message.bind(this),window.addEventListener("message",this._boundMessageEvent,!1),this._frame=window.document.createElement("iframe"),this._frame.style.visibility="hidden",this._frame.style.position="absolute",this._frame.width=0,this._frame.height=0,window.document.body.appendChild(this._frame)}return e.prototype.navigate=function(e){if(e&&e.url){var t=e.silentRequestTimeout||1e4;i.Log.debug("IFrameWindow.navigate: Using timeout of:",t),this._timer=window.setTimeout(this._timeout.bind(this),t),this._frame.src=e.url}else this._error("No url provided");return this.promise},e.prototype._success=function(e){this._cleanup(),i.Log.debug("IFrameWindow: Successful response from frame window"),this._resolve(e)},e.prototype._error=function(e){this._cleanup(),i.Log.error(e),this._reject(new Error(e))},e.prototype.close=function(){this._cleanup()},e.prototype._cleanup=function(){this._frame&&(i.Log.debug("IFrameWindow: cleanup"),window.removeEventListener("message",this._boundMessageEvent,!1),window.clearTimeout(this._timer),window.document.body.removeChild(this._frame),this._timer=null,this._frame=null,this._boundMessageEvent=null)},e.prototype._timeout=function(){i.Log.debug("IFrameWindow.timeout"),this._error("Frame window timed out")},e.prototype._message=function(e){if(i.Log.debug("IFrameWindow.message"),this._timer&&e.origin===this._origin&&e.source===this._frame.contentWindow&&"string"==typeof e.data&&(e.data.startsWith("http://")||e.data.startsWith("https://"))){var t=e.data;t?this._success({url:t}):this._error("Invalid response from frame")}},e.notifyParent=function(e){i.Log.debug("IFrameWindow.notifyParent"),(e=e||window.location.href)&&(i.Log.debug("IFrameWindow.notifyParent: posting url message to parent"),window.parent.postMessage(e,location.protocol+"//"+location.host))},n(e,[{key:"promise",get:function(){return this._promise}},{key:"_origin",get:function(){return location.protocol+"//"+location.host}}]),e}()},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.UserManagerEvents=void 0;var n=r(0),i=r(16),o=r(17);t.UserManagerEvents=function(e){function t(r){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,e.call(this,r));return n._userLoaded=new o.Event("User loaded"),n._userUnloaded=new o.Event("User unloaded"),n._silentRenewError=new o.Event("Silent renew error"),n._userSignedIn=new o.Event("User signed in"),n._userSignedOut=new o.Event("User signed out"),n._userSessionChanged=new o.Event("User session changed"),n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),t.prototype.load=function(t){var r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];n.Log.debug("UserManagerEvents.load"),e.prototype.load.call(this,t),r&&this._userLoaded.raise(t)},t.prototype.unload=function(){n.Log.debug("UserManagerEvents.unload"),e.prototype.unload.call(this),this._userUnloaded.raise()},t.prototype.addUserLoaded=function(e){this._userLoaded.addHandler(e)},t.prototype.removeUserLoaded=function(e){this._userLoaded.removeHandler(e)},t.prototype.addUserUnloaded=function(e){this._userUnloaded.addHandler(e)},t.prototype.removeUserUnloaded=function(e){this._userUnloaded.removeHandler(e)},t.prototype.addSilentRenewError=function(e){this._silentRenewError.addHandler(e)},t.prototype.removeSilentRenewError=function(e){this._silentRenewError.removeHandler(e)},t.prototype._raiseSilentRenewError=function(e){n.Log.debug("UserManagerEvents._raiseSilentRenewError",e.message),this._silentRenewError.raise(e)},t.prototype.addUserSignedIn=function(e){this._userSignedIn.addHandler(e)},t.prototype.removeUserSignedIn=function(e){this._userSignedIn.removeHandler(e)},t.prototype._raiseUserSignedIn=function(){n.Log.debug("UserManagerEvents._raiseUserSignedIn"),this._userSignedIn.raise()},t.prototype.addUserSignedOut=function(e){this._userSignedOut.addHandler(e)},t.prototype.removeUserSignedOut=function(e){this._userSignedOut.removeHandler(e)},t.prototype._raiseUserSignedOut=function(){n.Log.debug("UserManagerEvents._raiseUserSignedOut"),this._userSignedOut.raise()},t.prototype.addUserSessionChanged=function(e){this._userSessionChanged.addHandler(e)},t.prototype.removeUserSessionChanged=function(e){this._userSessionChanged.removeHandler(e)},t.prototype._raiseUserSessionChanged=function(){n.Log.debug("UserManagerEvents._raiseUserSessionChanged"),this._userSessionChanged.raise()},t}(i.AccessTokenEvents)},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Timer=void 0;var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),i=r(0),o=r(1),s=r(17);function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function u(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}t.Timer=function(e){function t(r){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:o.Global.timer,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0;a(this,t);var s=u(this,e.call(this,r));return s._timer=n,s._nowFunc=i||function(){return Date.now()/1e3},s}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),t.prototype.init=function(e){e<=0&&(e=1),e=parseInt(e);var t=this.now+e;if(this.expiration===t&&this._timerHandle)i.Log.debug("Timer.init timer "+this._name+" skipping initialization since already initialized for expiration:",this.expiration);else{this.cancel(),i.Log.debug("Timer.init timer "+this._name+" for duration:",e),this._expiration=t;var r=5;e<r&&(r=e),this._timerHandle=this._timer.setInterval(this._callback.bind(this),1e3*r)}},t.prototype.cancel=function(){this._timerHandle&&(i.Log.debug("Timer.cancel: ",this._name),this._timer.clearInterval(this._timerHandle),this._timerHandle=null)},t.prototype._callback=function(){var t=this._expiration-this.now;i.Log.debug("Timer.callback; "+this._name+" timer expires in:",t),this._expiration<=this.now&&(this.cancel(),e.prototype.raise.call(this))},n(t,[{key:"now",get:function(){return parseInt(this._nowFunc())}},{key:"expiration",get:function(){return this._expiration}}]),t}(s.Event)},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SilentRenewService=void 0;var n=r(0);t.SilentRenewService=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._userManager=t}return e.prototype.start=function(){this._callback||(this._callback=this._tokenExpiring.bind(this),this._userManager.events.addAccessTokenExpiring(this._callback),this._userManager.getUser().then((function(e){})).catch((function(e){n.Log.error("SilentRenewService.start: Error from getUser:",e.message)})))},e.prototype.stop=function(){this._callback&&(this._userManager.events.removeAccessTokenExpiring(this._callback),delete this._callback)},e.prototype._tokenExpiring=function(){var e=this;this._userManager.signinSilent().then((function(e){n.Log.debug("SilentRenewService._tokenExpiring: Silent token renewal successful")}),(function(t){n.Log.error("SilentRenewService._tokenExpiring: Error from signinSilent:",t.message),e._userManager.events._raiseSilentRenewError(t)}))},e}()},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CordovaPopupNavigator=void 0;var n=r(21);t.CordovaPopupNavigator=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}return e.prototype.prepare=function(e){var t=new n.CordovaPopupWindow(e);return Promise.resolve(t)},e}()},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CordovaIFrameNavigator=void 0;var n=r(21);t.CordovaIFrameNavigator=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}return e.prototype.prepare=function(e){e.popupWindowFeatures="hidden=yes";var t=new n.CordovaPopupWindow(e);return Promise.resolve(t)},e}()},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Version="1.11.5"}])},e.exports=t()},660:(e,t,r)=>{var n;!function(e){!function(t){var n="object"==typeof r.g?r.g:"object"==typeof self?self:"object"==typeof this?this:Function("return this;")(),i=o(e);function o(e,t){return function(r,n){"function"!=typeof e[r]&&Object.defineProperty(e,r,{configurable:!0,writable:!0,value:n}),t&&t(r,n)}}void 0===n.Reflect?n.Reflect=e:i=o(n.Reflect,i),function(e){var t=Object.prototype.hasOwnProperty,r="function"==typeof Symbol,n=r&&void 0!==Symbol.toPrimitive?Symbol.toPrimitive:"@@toPrimitive",i=r&&void 0!==Symbol.iterator?Symbol.iterator:"@@iterator",o="function"==typeof Object.create,s={__proto__:[]}instanceof Array,a=!o&&!s,u={create:o?function(){return D(Object.create(null))}:s?function(){return D({__proto__:null})}:function(){return D({})},has:a?function(e,r){return t.call(e,r)}:function(e,t){return t in e},get:a?function(e,r){return t.call(e,r)?e[r]:void 0}:function(e,t){return e[t]}},c=Object.getPrototypeOf(Function),h="object"==typeof process&&process.env&&"true"===process.env.REFLECT_METADATA_USE_MAP_POLYFILL,l=h||"function"!=typeof Map||"function"!=typeof Map.prototype.entries?function(){var e={},t=[],r=function(){function e(e,t,r){this._index=0,this._keys=e,this._values=t,this._selector=r}return e.prototype["@@iterator"]=function(){return this},e.prototype[i]=function(){return this},e.prototype.next=function(){var e=this._index;if(e>=0&&e<this._keys.length){var r=this._selector(this._keys[e],this._values[e]);return e+1>=this._keys.length?(this._index=-1,this._keys=t,this._values=t):this._index++,{value:r,done:!1}}return{value:void 0,done:!0}},e.prototype.throw=function(e){throw this._index>=0&&(this._index=-1,this._keys=t,this._values=t),e},e.prototype.return=function(e){return this._index>=0&&(this._index=-1,this._keys=t,this._values=t),{value:e,done:!0}},e}();return function(){function t(){this._keys=[],this._values=[],this._cacheKey=e,this._cacheIndex=-2}return Object.defineProperty(t.prototype,"size",{get:function(){return this._keys.length},enumerable:!0,configurable:!0}),t.prototype.has=function(e){return this._find(e,!1)>=0},t.prototype.get=function(e){var t=this._find(e,!1);return t>=0?this._values[t]:void 0},t.prototype.set=function(e,t){var r=this._find(e,!0);return this._values[r]=t,this},t.prototype.delete=function(t){var r=this._find(t,!1);if(r>=0){for(var n=this._keys.length,i=r+1;i<n;i++)this._keys[i-1]=this._keys[i],this._values[i-1]=this._values[i];return this._keys.length--,this._values.length--,t===this._cacheKey&&(this._cacheKey=e,this._cacheIndex=-2),!0}return!1},t.prototype.clear=function(){this._keys.length=0,this._values.length=0,this._cacheKey=e,this._cacheIndex=-2},t.prototype.keys=function(){return new r(this._keys,this._values,n)},t.prototype.values=function(){return new r(this._keys,this._values,o)},t.prototype.entries=function(){return new r(this._keys,this._values,s)},t.prototype["@@iterator"]=function(){return this.entries()},t.prototype[i]=function(){return this.entries()},t.prototype._find=function(e,t){return this._cacheKey!==e&&(this._cacheIndex=this._keys.indexOf(this._cacheKey=e)),this._cacheIndex<0&&t&&(this._cacheIndex=this._keys.length,this._keys.push(e),this._values.push(void 0)),this._cacheIndex},t}();function n(e,t){return e}function o(e,t){return t}function s(e,t){return[e,t]}}():Map,d=h||"function"!=typeof Set||"function"!=typeof Set.prototype.entries?function(){function e(){this._map=new l}return Object.defineProperty(e.prototype,"size",{get:function(){return this._map.size},enumerable:!0,configurable:!0}),e.prototype.has=function(e){return this._map.has(e)},e.prototype.add=function(e){return this._map.set(e,e),this},e.prototype.delete=function(e){return this._map.delete(e)},e.prototype.clear=function(){this._map.clear()},e.prototype.keys=function(){return this._map.keys()},e.prototype.values=function(){return this._map.values()},e.prototype.entries=function(){return this._map.entries()},e.prototype["@@iterator"]=function(){return this.keys()},e.prototype[i]=function(){return this.keys()},e}():Set,f=new(h||"function"!=typeof WeakMap?function(){var e=u.create(),r=n();return function(){function e(){this._key=n()}return e.prototype.has=function(e){var t=i(e,!1);return void 0!==t&&u.has(t,this._key)},e.prototype.get=function(e){var t=i(e,!1);return void 0!==t?u.get(t,this._key):void 0},e.prototype.set=function(e,t){return i(e,!0)[this._key]=t,this},e.prototype.delete=function(e){var t=i(e,!1);return void 0!==t&&delete t[this._key]},e.prototype.clear=function(){this._key=n()},e}();function n(){var t;do{t="@@WeakMap@@"+s()}while(u.has(e,t));return e[t]=!0,t}function i(e,n){if(!t.call(e,r)){if(!n)return;Object.defineProperty(e,r,{value:u.create()})}return e[r]}function o(e,t){for(var r=0;r<t;++r)e[r]=255*Math.random()|0;return e}function s(){var e,t=(e=16,"function"==typeof Uint8Array?"undefined"!=typeof crypto?crypto.getRandomValues(new Uint8Array(e)):"undefined"!=typeof msCrypto?msCrypto.getRandomValues(new Uint8Array(e)):o(new Uint8Array(e),e):o(new Array(e),e));t[6]=79&t[6]|64,t[8]=191&t[8]|128;for(var r="",n=0;n<16;++n){var i=t[n];4!==n&&6!==n&&8!==n||(r+="-"),i<16&&(r+="0"),r+=i.toString(16).toLowerCase()}return r}}():WeakMap);function p(e,t,r){var n=f.get(e);if(E(n)){if(!r)return;n=new l,f.set(e,n)}var i=n.get(t);if(E(i)){if(!r)return;i=new l,n.set(t,i)}return i}function g(e,t,r){if(y(e,t,r))return!0;var n=O(t);return!F(n)&&g(e,n,r)}function y(e,t,r){var n=p(t,r,!1);return!E(n)&&!!n.has(e)}function v(e,t,r){if(y(e,t,r))return m(e,t,r);var n=O(t);return F(n)?void 0:v(e,n,r)}function m(e,t,r){var n=p(t,r,!1);if(!E(n))return n.get(e)}function w(e,t,r,n){p(r,n,!0).set(e,t)}function _(e,t){var r=S(e,t),n=O(e);if(null===n)return r;var i=_(n,t);if(i.length<=0)return r;if(r.length<=0)return i;for(var o=new d,s=[],a=0,u=r;a<u.length;a++){var c=u[a];o.has(c)||(o.add(c),s.push(c))}for(var h=0,l=i;h<l.length;h++)c=l[h],o.has(c)||(o.add(c),s.push(c));return s}function S(e,t){var r=[],n=p(e,t,!1);if(E(n))return r;for(var o=function(e){var t=T(e,i);if(!C(t))throw new TypeError;var r=t.call(e);if(!A(r))throw new TypeError;return r}(n.keys()),s=0;;){var a=R(o);if(!a)return r.length=s,r;var u=a.value;try{r[s]=u}catch(e){try{U(o)}finally{throw e}}s++}}function b(e){if(null===e)return 1;switch(typeof e){case"undefined":return 0;case"boolean":return 2;case"string":return 3;case"symbol":return 4;case"number":return 5;case"object":return null===e?1:6;default:return 6}}function E(e){return void 0===e}function F(e){return null===e}function A(e){return"object"==typeof e?null!==e:"function"==typeof e}function k(e,t){switch(b(e)){case 0:case 1:case 2:case 3:case 4:case 5:return e}var r=3===t?"string":5===t?"number":"default",i=T(e,n);if(void 0!==i){var o=i.call(e,r);if(A(o))throw new TypeError;return o}return function(e,t){if("string"===t){var r=e.toString;if(C(r)&&!A(i=r.call(e)))return i;if(C(n=e.valueOf)&&!A(i=n.call(e)))return i}else{var n;if(C(n=e.valueOf)&&!A(i=n.call(e)))return i;var i,o=e.toString;if(C(o)&&!A(i=o.call(e)))return i}throw new TypeError}(e,"default"===r?"number":r)}function x(e){var t=k(e,3);return"symbol"==typeof t?t:function(e){return""+e}(t)}function P(e){return Array.isArray?Array.isArray(e):e instanceof Object?e instanceof Array:"[object Array]"===Object.prototype.toString.call(e)}function C(e){return"function"==typeof e}function I(e){return"function"==typeof e}function T(e,t){var r=e[t];if(null!=r){if(!C(r))throw new TypeError;return r}}function R(e){var t=e.next();return!t.done&&t}function U(e){var t=e.return;t&&t.call(e)}function O(e){var t=Object.getPrototypeOf(e);if("function"!=typeof e||e===c)return t;if(t!==c)return t;var r=e.prototype,n=r&&Object.getPrototypeOf(r);if(null==n||n===Object.prototype)return t;var i=n.constructor;return"function"!=typeof i||i===e?t:i}function D(e){return e.__=void 0,delete e.__,e}e("decorate",(function(e,t,r,n){if(E(r)){if(!P(e))throw new TypeError;if(!I(t))throw new TypeError;return function(e,t){for(var r=e.length-1;r>=0;--r){var n=(0,e[r])(t);if(!E(n)&&!F(n)){if(!I(n))throw new TypeError;t=n}}return t}(e,t)}if(!P(e))throw new TypeError;if(!A(t))throw new TypeError;if(!A(n)&&!E(n)&&!F(n))throw new TypeError;return F(n)&&(n=void 0),function(e,t,r,n){for(var i=e.length-1;i>=0;--i){var o=(0,e[i])(t,r,n);if(!E(o)&&!F(o)){if(!A(o))throw new TypeError;n=o}}return n}(e,t,r=x(r),n)})),e("metadata",(function(e,t){return function(r,n){if(!A(r))throw new TypeError;if(!E(n)&&!function(e){switch(b(e)){case 3:case 4:return!0;default:return!1}}(n))throw new TypeError;w(e,t,r,n)}})),e("defineMetadata",(function(e,t,r,n){if(!A(r))throw new TypeError;return E(n)||(n=x(n)),w(e,t,r,n)})),e("hasMetadata",(function(e,t,r){if(!A(t))throw new TypeError;return E(r)||(r=x(r)),g(e,t,r)})),e("hasOwnMetadata",(function(e,t,r){if(!A(t))throw new TypeError;return E(r)||(r=x(r)),y(e,t,r)})),e("getMetadata",(function(e,t,r){if(!A(t))throw new TypeError;return E(r)||(r=x(r)),v(e,t,r)})),e("getOwnMetadata",(function(e,t,r){if(!A(t))throw new TypeError;return E(r)||(r=x(r)),m(e,t,r)})),e("getMetadataKeys",(function(e,t){if(!A(e))throw new TypeError;return E(t)||(t=x(t)),_(e,t)})),e("getOwnMetadataKeys",(function(e,t){if(!A(e))throw new TypeError;return E(t)||(t=x(t)),S(e,t)})),e("deleteMetadata",(function(e,t,r){if(!A(t))throw new TypeError;E(r)||(r=x(r));var n=p(t,r,!1);if(E(n))return!1;if(!n.delete(e))return!1;if(n.size>0)return!0;var i=f.get(t);return i.delete(r),i.size>0||f.delete(t),!0}))}(i)}()}(n||(n={}))},614:(e,t,r)=>{"use strict";var n;r.r(t),r.d(t,{NIL:()=>I,parse:()=>y,stringify:()=>h,v1:()=>g,v3:()=>A,v4:()=>k,v5:()=>C,validate:()=>a,version:()=>T});var i=new Uint8Array(16);function o(){if(!n&&!(n="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto)))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return n(i)}const s=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i,a=function(e){return"string"==typeof e&&s.test(e)};for(var u=[],c=0;c<256;++c)u.push((c+256).toString(16).substr(1));const h=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=(u[e[t+0]]+u[e[t+1]]+u[e[t+2]]+u[e[t+3]]+"-"+u[e[t+4]]+u[e[t+5]]+"-"+u[e[t+6]]+u[e[t+7]]+"-"+u[e[t+8]]+u[e[t+9]]+"-"+u[e[t+10]]+u[e[t+11]]+u[e[t+12]]+u[e[t+13]]+u[e[t+14]]+u[e[t+15]]).toLowerCase();if(!a(r))throw TypeError("Stringified UUID is invalid");return r};var l,d,f=0,p=0;const g=function(e,t,r){var n=t&&r||0,i=t||new Array(16),s=(e=e||{}).node||l,a=void 0!==e.clockseq?e.clockseq:d;if(null==s||null==a){var u=e.random||(e.rng||o)();null==s&&(s=l=[1|u[0],u[1],u[2],u[3],u[4],u[5]]),null==a&&(a=d=16383&(u[6]<<8|u[7]))}var c=void 0!==e.msecs?e.msecs:Date.now(),g=void 0!==e.nsecs?e.nsecs:p+1,y=c-f+(g-p)/1e4;if(y<0&&void 0===e.clockseq&&(a=a+1&16383),(y<0||c>f)&&void 0===e.nsecs&&(g=0),g>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");f=c,p=g,d=a;var v=(1e4*(268435455&(c+=122192928e5))+g)%4294967296;i[n++]=v>>>24&255,i[n++]=v>>>16&255,i[n++]=v>>>8&255,i[n++]=255&v;var m=c/4294967296*1e4&268435455;i[n++]=m>>>8&255,i[n++]=255&m,i[n++]=m>>>24&15|16,i[n++]=m>>>16&255,i[n++]=a>>>8|128,i[n++]=255&a;for(var w=0;w<6;++w)i[n+w]=s[w];return t||h(i)},y=function(e){if(!a(e))throw TypeError("Invalid UUID");var t,r=new Uint8Array(16);return r[0]=(t=parseInt(e.slice(0,8),16))>>>24,r[1]=t>>>16&255,r[2]=t>>>8&255,r[3]=255&t,r[4]=(t=parseInt(e.slice(9,13),16))>>>8,r[5]=255&t,r[6]=(t=parseInt(e.slice(14,18),16))>>>8,r[7]=255&t,r[8]=(t=parseInt(e.slice(19,23),16))>>>8,r[9]=255&t,r[10]=(t=parseInt(e.slice(24,36),16))/1099511627776&255,r[11]=t/4294967296&255,r[12]=t>>>24&255,r[13]=t>>>16&255,r[14]=t>>>8&255,r[15]=255&t,r};function v(e,t,r){function n(e,n,i,o){if("string"==typeof e&&(e=function(e){e=unescape(encodeURIComponent(e));for(var t=[],r=0;r<e.length;++r)t.push(e.charCodeAt(r));return t}(e)),"string"==typeof n&&(n=y(n)),16!==n.length)throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");var s=new Uint8Array(16+e.length);if(s.set(n),s.set(e,n.length),(s=r(s))[6]=15&s[6]|t,s[8]=63&s[8]|128,i){o=o||0;for(var a=0;a<16;++a)i[o+a]=s[a];return i}return h(s)}try{n.name=e}catch(e){}return n.DNS="6ba7b810-9dad-11d1-80b4-00c04fd430c8",n.URL="6ba7b811-9dad-11d1-80b4-00c04fd430c8",n}function m(e){return 14+(e+64>>>9<<4)+1}function w(e,t){var r=(65535&e)+(65535&t);return(e>>16)+(t>>16)+(r>>16)<<16|65535&r}function _(e,t,r,n,i,o){return w((s=w(w(t,e),w(n,o)))<<(a=i)|s>>>32-a,r);var s,a}function S(e,t,r,n,i,o,s){return _(t&r|~t&n,e,t,i,o,s)}function b(e,t,r,n,i,o,s){return _(t&n|r&~n,e,t,i,o,s)}function E(e,t,r,n,i,o,s){return _(t^r^n,e,t,i,o,s)}function F(e,t,r,n,i,o,s){return _(r^(t|~n),e,t,i,o,s)}const A=v("v3",48,(function(e){if("string"==typeof e){var t=unescape(encodeURIComponent(e));e=new Uint8Array(t.length);for(var r=0;r<t.length;++r)e[r]=t.charCodeAt(r)}return function(e){for(var t=[],r=32*e.length,n="0123456789abcdef",i=0;i<r;i+=8){var o=e[i>>5]>>>i%32&255,s=parseInt(n.charAt(o>>>4&15)+n.charAt(15&o),16);t.push(s)}return t}(function(e,t){e[t>>5]|=128<<t%32,e[m(t)-1]=t;for(var r=1732584193,n=-271733879,i=-1732584194,o=271733878,s=0;s<e.length;s+=16){var a=r,u=n,c=i,h=o;r=S(r,n,i,o,e[s],7,-680876936),o=S(o,r,n,i,e[s+1],12,-389564586),i=S(i,o,r,n,e[s+2],17,606105819),n=S(n,i,o,r,e[s+3],22,-1044525330),r=S(r,n,i,o,e[s+4],7,-176418897),o=S(o,r,n,i,e[s+5],12,1200080426),i=S(i,o,r,n,e[s+6],17,-1473231341),n=S(n,i,o,r,e[s+7],22,-45705983),r=S(r,n,i,o,e[s+8],7,1770035416),o=S(o,r,n,i,e[s+9],12,-1958414417),i=S(i,o,r,n,e[s+10],17,-42063),n=S(n,i,o,r,e[s+11],22,-1990404162),r=S(r,n,i,o,e[s+12],7,1804603682),o=S(o,r,n,i,e[s+13],12,-40341101),i=S(i,o,r,n,e[s+14],17,-1502002290),r=b(r,n=S(n,i,o,r,e[s+15],22,1236535329),i,o,e[s+1],5,-165796510),o=b(o,r,n,i,e[s+6],9,-1069501632),i=b(i,o,r,n,e[s+11],14,643717713),n=b(n,i,o,r,e[s],20,-373897302),r=b(r,n,i,o,e[s+5],5,-701558691),o=b(o,r,n,i,e[s+10],9,38016083),i=b(i,o,r,n,e[s+15],14,-660478335),n=b(n,i,o,r,e[s+4],20,-405537848),r=b(r,n,i,o,e[s+9],5,568446438),o=b(o,r,n,i,e[s+14],9,-1019803690),i=b(i,o,r,n,e[s+3],14,-187363961),n=b(n,i,o,r,e[s+8],20,1163531501),r=b(r,n,i,o,e[s+13],5,-1444681467),o=b(o,r,n,i,e[s+2],9,-51403784),i=b(i,o,r,n,e[s+7],14,1735328473),r=E(r,n=b(n,i,o,r,e[s+12],20,-1926607734),i,o,e[s+5],4,-378558),o=E(o,r,n,i,e[s+8],11,-2022574463),i=E(i,o,r,n,e[s+11],16,1839030562),n=E(n,i,o,r,e[s+14],23,-35309556),r=E(r,n,i,o,e[s+1],4,-1530992060),o=E(o,r,n,i,e[s+4],11,1272893353),i=E(i,o,r,n,e[s+7],16,-155497632),n=E(n,i,o,r,e[s+10],23,-1094730640),r=E(r,n,i,o,e[s+13],4,681279174),o=E(o,r,n,i,e[s],11,-358537222),i=E(i,o,r,n,e[s+3],16,-722521979),n=E(n,i,o,r,e[s+6],23,76029189),r=E(r,n,i,o,e[s+9],4,-640364487),o=E(o,r,n,i,e[s+12],11,-421815835),i=E(i,o,r,n,e[s+15],16,530742520),r=F(r,n=E(n,i,o,r,e[s+2],23,-995338651),i,o,e[s],6,-198630844),o=F(o,r,n,i,e[s+7],10,1126891415),i=F(i,o,r,n,e[s+14],15,-1416354905),n=F(n,i,o,r,e[s+5],21,-57434055),r=F(r,n,i,o,e[s+12],6,1700485571),o=F(o,r,n,i,e[s+3],10,-1894986606),i=F(i,o,r,n,e[s+10],15,-1051523),n=F(n,i,o,r,e[s+1],21,-2054922799),r=F(r,n,i,o,e[s+8],6,1873313359),o=F(o,r,n,i,e[s+15],10,-30611744),i=F(i,o,r,n,e[s+6],15,-1560198380),n=F(n,i,o,r,e[s+13],21,1309151649),r=F(r,n,i,o,e[s+4],6,-145523070),o=F(o,r,n,i,e[s+11],10,-1120210379),i=F(i,o,r,n,e[s+2],15,718787259),n=F(n,i,o,r,e[s+9],21,-343485551),r=w(r,a),n=w(n,u),i=w(i,c),o=w(o,h)}return[r,n,i,o]}(function(e){if(0===e.length)return[];for(var t=8*e.length,r=new Uint32Array(m(t)),n=0;n<t;n+=8)r[n>>5]|=(255&e[n/8])<<n%32;return r}(e),8*e.length))})),k=function(e,t,r){var n=(e=e||{}).random||(e.rng||o)();if(n[6]=15&n[6]|64,n[8]=63&n[8]|128,t){r=r||0;for(var i=0;i<16;++i)t[r+i]=n[i];return t}return h(n)};function x(e,t,r,n){switch(e){case 0:return t&r^~t&n;case 1:return t^r^n;case 2:return t&r^t&n^r&n;case 3:return t^r^n}}function P(e,t){return e<<t|e>>>32-t}const C=v("v5",80,(function(e){var t=[1518500249,1859775393,2400959708,3395469782],r=[1732584193,4023233417,2562383102,271733878,3285377520];if("string"==typeof e){var n=unescape(encodeURIComponent(e));e=[];for(var i=0;i<n.length;++i)e.push(n.charCodeAt(i))}else Array.isArray(e)||(e=Array.prototype.slice.call(e));e.push(128);for(var o=e.length/4+2,s=Math.ceil(o/16),a=new Array(s),u=0;u<s;++u){for(var c=new Uint32Array(16),h=0;h<16;++h)c[h]=e[64*u+4*h]<<24|e[64*u+4*h+1]<<16|e[64*u+4*h+2]<<8|e[64*u+4*h+3];a[u]=c}a[s-1][14]=8*(e.length-1)/Math.pow(2,32),a[s-1][14]=Math.floor(a[s-1][14]),a[s-1][15]=8*(e.length-1)&4294967295;for(var l=0;l<s;++l){for(var d=new Uint32Array(80),f=0;f<16;++f)d[f]=a[l][f];for(var p=16;p<80;++p)d[p]=P(d[p-3]^d[p-8]^d[p-14]^d[p-16],1);for(var g=r[0],y=r[1],v=r[2],m=r[3],w=r[4],_=0;_<80;++_){var S=Math.floor(_/20),b=P(g,5)+x(S,y,v,m)+w+t[S]+d[_]>>>0;w=m,m=v,v=P(y,30)>>>0,y=g,g=b}r[0]=r[0]+g>>>0,r[1]=r[1]+y>>>0,r[2]=r[2]+v>>>0,r[3]=r[3]+m>>>0,r[4]=r[4]+w>>>0}return[r[0]>>24&255,r[0]>>16&255,r[0]>>8&255,255&r[0],r[1]>>24&255,r[1]>>16&255,r[1]>>8&255,255&r[1],r[2]>>24&255,r[2]>>16&255,r[2]>>8&255,255&r[2],r[3]>>24&255,r[3]>>16&255,r[3]>>8&255,255&r[3],r[4]>>24&255,r[4]>>16&255,r[4]>>8&255,255&r[4]]})),I="00000000-0000-0000-0000-000000000000",T=function(e){if(!a(e))throw TypeError("Invalid UUID");return parseInt(e.substr(14,1),16)}}},t={};function r(n){if(t[n])return t[n].exports;var i=t[n]={exports:{}};return e[n].call(i.exports,i,i.exports,r),i.exports}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.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),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})},(()=>{"use strict";r(660);var e=r(305);function t(e){return Array.isArray?Array.isArray(e):"[object Array]"===u(e)}function n(e){return"string"==typeof e}function i(e){return"number"==typeof e}function o(e){return"object"==typeof e}function s(e){return null!=e}function a(e){return!e.trim().length}function u(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":Object.prototype.toString.call(e)}const c=Object.prototype.hasOwnProperty;class h{constructor(e){this._keys=[],this._keyMap={};let t=0;e.forEach((e=>{let r=l(e);t+=r.weight,this._keys.push(r),this._keyMap[r.id]=r,t+=r.weight})),this._keys.forEach((e=>{e.weight/=t}))}get(e){return this._keyMap[e]}keys(){return this._keys}toJSON(){return JSON.stringify(this._keys)}}function l(e){let r=null,i=null,o=null,s=1;if(n(e)||t(e))o=e,r=d(e),i=f(e);else{if(!c.call(e,"name"))throw new Error("Missing name property in key");const t=e.name;if(o=t,c.call(e,"weight")&&(s=e.weight,s<=0))throw new Error((e=>`Property 'weight' in key '${e}' must be a positive integer`)(t));r=d(t),i=f(t)}return{path:r,id:i,weight:s,src:o}}function d(e){return t(e)?e:e.split(".")}function f(e){return t(e)?e.join("."):e}var p={isCaseSensitive:!1,includeScore:!1,keys:[],shouldSort:!0,sortFn:(e,t)=>e.score===t.score?e.idx<t.idx?-1:1:e.score<t.score?-1:1,includeMatches:!1,findAllMatches:!1,minMatchCharLength:1,location:0,threshold:.6,distance:100,useExtendedSearch:!1,getFn:function(e,r){let a=[],c=!1;const h=(e,r,l)=>{if(s(e))if(r[l]){const d=e[r[l]];if(!s(d))return;if(l===r.length-1&&(n(d)||i(d)||function(e){return!0===e||!1===e||function(e){return o(e)&&null!==e}(e)&&"[object Boolean]"==u(e)}(d)))a.push(function(e){return null==e?"":function(e){if("string"==typeof e)return e;let t=e+"";return"0"==t&&1/e==-1/0?"-0":t}(e)}(d));else if(t(d)){c=!0;for(let e=0,t=d.length;e<t;e+=1)h(d[e],r,l+1)}else r.length&&h(d,r,l+1)}else a.push(e)};return h(e,n(r)?r.split("."):r,0),c?a:a[0]},ignoreLocation:!1,ignoreFieldNorm:!1};const g=/[^ ]+/g;class y{constructor({getFn:e=p.getFn}={}){this.norm=function(e=3){const t=new Map;return{get(r){const n=r.match(g).length;if(t.has(n))return t.get(n);const i=parseFloat((1/Math.sqrt(n)).toFixed(e));return t.set(n,i),i},clear(){t.clear()}}}(3),this.getFn=e,this.isCreated=!1,this.setIndexRecords()}setSources(e=[]){this.docs=e}setIndexRecords(e=[]){this.records=e}setKeys(e=[]){this.keys=e,this._keysMap={},e.forEach(((e,t)=>{this._keysMap[e.id]=t}))}create(){!this.isCreated&&this.docs.length&&(this.isCreated=!0,n(this.docs[0])?this.docs.forEach(((e,t)=>{this._addString(e,t)})):this.docs.forEach(((e,t)=>{this._addObject(e,t)})),this.norm.clear())}add(e){const t=this.size();n(e)?this._addString(e,t):this._addObject(e,t)}removeAt(e){this.records.splice(e,1);for(let t=e,r=this.size();t<r;t+=1)this.records[t].i-=1}getValueForItemAtKeyId(e,t){return e[this._keysMap[t]]}size(){return this.records.length}_addString(e,t){if(!s(e)||a(e))return;let r={v:e,i:t,n:this.norm.get(e)};this.records.push(r)}_addObject(e,r){let i={i:r,$:{}};this.keys.forEach(((r,o)=>{let u=this.getFn(e,r.path);if(s(u))if(t(u)){let e=[];const r=[{nestedArrIndex:-1,value:u}];for(;r.length;){const{nestedArrIndex:i,value:o}=r.pop();if(s(o))if(n(o)&&!a(o)){let t={v:o,i,n:this.norm.get(o)};e.push(t)}else t(o)&&o.forEach(((e,t)=>{r.push({nestedArrIndex:t,value:e})}))}i.$[o]=e}else if(!a(u)){let e={v:u,n:this.norm.get(u)};i.$[o]=e}})),this.records.push(i)}toJSON(){return{keys:this.keys,records:this.records}}}function v(e,t,{getFn:r=p.getFn}={}){const n=new y({getFn:r});return n.setKeys(e.map(l)),n.setSources(t),n.create(),n}function m(e,t){const r=e.matches;t.matches=[],s(r)&&r.forEach((e=>{if(!s(e.indices)||!e.indices.length)return;const{indices:r,value:n}=e;let i={indices:r,value:n};e.key&&(i.key=e.key.src),e.idx>-1&&(i.refIndex=e.idx),t.matches.push(i)}))}function w(e,t){t.score=e.score}function _(e,{errors:t=0,currentLocation:r=0,expectedLocation:n=0,distance:i=p.distance,ignoreLocation:o=p.ignoreLocation}={}){const s=t/e.length;if(o)return s;const a=Math.abs(n-r);return i?s+a/i:a?1:s}const S=32;function b(e){let t={};for(let r=0,n=e.length;r<n;r+=1){const i=e.charAt(r);t[i]=(t[i]||0)|1<<n-r-1}return t}class E{constructor(e,{location:t=p.location,threshold:r=p.threshold,distance:n=p.distance,includeMatches:i=p.includeMatches,findAllMatches:o=p.findAllMatches,minMatchCharLength:s=p.minMatchCharLength,isCaseSensitive:a=p.isCaseSensitive,ignoreLocation:u=p.ignoreLocation}={}){if(this.options={location:t,threshold:r,distance:n,includeMatches:i,findAllMatches:o,minMatchCharLength:s,isCaseSensitive:a,ignoreLocation:u},this.pattern=a?e:e.toLowerCase(),this.chunks=[],!this.pattern.length)return;const c=(e,t)=>{this.chunks.push({pattern:e,alphabet:b(e),startIndex:t})},h=this.pattern.length;if(h>S){let e=0;const t=h%S,r=h-t;for(;e<r;)c(this.pattern.substr(e,S),e),e+=S;if(t){const e=h-S;c(this.pattern.substr(e),e)}}else c(this.pattern,0)}searchIn(e){const{isCaseSensitive:t,includeMatches:r}=this.options;if(t||(e=e.toLowerCase()),this.pattern===e){let t={isMatch:!0,score:0};return r&&(t.indices=[[0,e.length-1]]),t}const{location:n,distance:i,threshold:o,findAllMatches:s,minMatchCharLength:a,ignoreLocation:u}=this.options;let c=[],h=0,l=!1;this.chunks.forEach((({pattern:t,alphabet:d,startIndex:f})=>{const{isMatch:g,score:y,indices:v}=function(e,t,r,{location:n=p.location,distance:i=p.distance,threshold:o=p.threshold,findAllMatches:s=p.findAllMatches,minMatchCharLength:a=p.minMatchCharLength,includeMatches:u=p.includeMatches,ignoreLocation:c=p.ignoreLocation}={}){if(t.length>S)throw new Error("Pattern length exceeds max of 32.");const h=t.length,l=e.length,d=Math.max(0,Math.min(n,l));let f=o,g=d;const y=a>1||u,v=y?Array(l):[];let m;for(;(m=e.indexOf(t,g))>-1;){let e=_(t,{currentLocation:m,expectedLocation:d,distance:i,ignoreLocation:c});if(f=Math.min(e,f),g=m+h,y){let e=0;for(;e<h;)v[m+e]=1,e+=1}}g=-1;let w=[],b=1,E=h+l;const F=1<<h-1;for(let n=0;n<h;n+=1){let o=0,a=E;for(;o<a;)_(t,{errors:n,currentLocation:d+a,expectedLocation:d,distance:i,ignoreLocation:c})<=f?o=a:E=a,a=Math.floor((E-o)/2+o);E=a;let u=Math.max(1,d-a+1),p=s?l:Math.min(d+a,l)+h,m=Array(p+2);m[p+1]=(1<<n)-1;for(let o=p;o>=u;o-=1){let s=o-1,a=r[e.charAt(s)];if(y&&(v[s]=+!!a),m[o]=(m[o+1]<<1|1)&a,n&&(m[o]|=(w[o+1]|w[o])<<1|1|w[o+1]),m[o]&F&&(b=_(t,{errors:n,currentLocation:s,expectedLocation:d,distance:i,ignoreLocation:c}),b<=f)){if(f=b,g=s,g<=d)break;u=Math.max(1,2*d-g)}}if(_(t,{errors:n+1,currentLocation:d,expectedLocation:d,distance:i,ignoreLocation:c})>f)break;w=m}const A={isMatch:g>=0,score:Math.max(.001,b)};if(y){const e=function(e=[],t=p.minMatchCharLength){let r=[],n=-1,i=-1,o=0;for(let s=e.length;o<s;o+=1){let s=e[o];s&&-1===n?n=o:s||-1===n||(i=o-1,i-n+1>=t&&r.push([n,i]),n=-1)}return e[o-1]&&o-n>=t&&r.push([n,o-1]),r}(v,a);e.length?u&&(A.indices=e):A.isMatch=!1}return A}(e,t,d,{location:n+f,distance:i,threshold:o,findAllMatches:s,minMatchCharLength:a,includeMatches:r,ignoreLocation:u});g&&(l=!0),h+=y,g&&v&&(c=[...c,...v])}));let d={isMatch:l,score:l?h/this.chunks.length:1};return l&&r&&(d.indices=c),d}}class F{constructor(e){this.pattern=e}static isMultiMatch(e){return A(e,this.multiRegex)}static isSingleMatch(e){return A(e,this.singleRegex)}search(){}}function A(e,t){const r=e.match(t);return r?r[1]:null}class k extends F{constructor(e,{location:t=p.location,threshold:r=p.threshold,distance:n=p.distance,includeMatches:i=p.includeMatches,findAllMatches:o=p.findAllMatches,minMatchCharLength:s=p.minMatchCharLength,isCaseSensitive:a=p.isCaseSensitive}={}){super(e),this._bitapSearch=new E(e,{location:t,threshold:r,distance:n,includeMatches:i,findAllMatches:o,minMatchCharLength:s,isCaseSensitive:a})}static get type(){return"fuzzy"}static get multiRegex(){return/^"(.*)"$/}static get singleRegex(){return/^(.*)$/}search(e){return this._bitapSearch.searchIn(e)}}class x extends F{constructor(e){super(e)}static get type(){return"include"}static get multiRegex(){return/^'"(.*)"$/}static get singleRegex(){return/^'(.*)$/}search(e){let t,r=0;const n=[],i=this.pattern.length;for(;(t=e.indexOf(this.pattern,r))>-1;)r=t+i,n.push([t,r-1]);const o=!!n.length;return{isMatch:o,score:o?1:0,indices:n}}}const P=[class extends F{constructor(e){super(e)}static get type(){return"exact"}static get multiRegex(){return/^="(.*)"$/}static get singleRegex(){return/^=(.*)$/}search(e){const t=e===this.pattern;return{isMatch:t,score:t?0:1,indices:[0,this.pattern.length-1]}}},x,class extends F{constructor(e){super(e)}static get type(){return"prefix-exact"}static get multiRegex(){return/^\^"(.*)"$/}static get singleRegex(){return/^\^(.*)$/}search(e){const t=e.startsWith(this.pattern);return{isMatch:t,score:t?0:1,indices:[0,this.pattern.length-1]}}},class extends F{constructor(e){super(e)}static get type(){return"inverse-prefix-exact"}static get multiRegex(){return/^!\^"(.*)"$/}static get singleRegex(){return/^!\^(.*)$/}search(e){const t=!e.startsWith(this.pattern);return{isMatch:t,score:t?0:1,indices:[0,e.length-1]}}},class extends F{constructor(e){super(e)}static get type(){return"inverse-suffix-exact"}static get multiRegex(){return/^!"(.*)"\$$/}static get singleRegex(){return/^!(.*)\$$/}search(e){const t=!e.endsWith(this.pattern);return{isMatch:t,score:t?0:1,indices:[0,e.length-1]}}},class extends F{constructor(e){super(e)}static get type(){return"suffix-exact"}static get multiRegex(){return/^"(.*)"\$$/}static get singleRegex(){return/^(.*)\$$/}search(e){const t=e.endsWith(this.pattern);return{isMatch:t,score:t?0:1,indices:[e.length-this.pattern.length,e.length-1]}}},class extends F{constructor(e){super(e)}static get type(){return"inverse-exact"}static get multiRegex(){return/^!"(.*)"$/}static get singleRegex(){return/^!(.*)$/}search(e){const t=-1===e.indexOf(this.pattern);return{isMatch:t,score:t?0:1,indices:[0,e.length-1]}}},k],C=P.length,I=/ +(?=([^\"]*\"[^\"]*\")*[^\"]*$)/,T=new Set([k.type,x.type]);const R=[];function U(e,t){for(let r=0,n=R.length;r<n;r+=1){let n=R[r];if(n.condition(e,t))return new n(e,t)}return new E(e,t)}const O="$and",D=e=>!(!e.$and&&!e.$or),L=e=>({[O]:Object.keys(e).map((t=>({[t]:e[t]})))});function H(e,r,{auto:i=!0}={}){const s=e=>{let a=Object.keys(e);const u=(e=>!!e.$path)(e);if(!u&&a.length>1&&!D(e))return s(L(e));if((e=>!t(e)&&o(e)&&!D(e))(e)){const t=u?e.$path:a[0],o=u?e.$val:e[t];if(!n(o))throw new Error((e=>`Invalid value for key ${e}`)(t));const s={keyId:f(t),pattern:o};return i&&(s.searcher=U(o,r)),s}let c={children:[],operator:a[0]};return a.forEach((r=>{const n=e[r];t(n)&&n.forEach((e=>{c.children.push(s(e))}))})),c};return D(e)||(e=L(e)),s(e)}class M{constructor(e,t={},r){this.options={...p,...t},this.options.useExtendedSearch,this._keyStore=new h(this.options.keys),this.setCollection(e,r)}setCollection(e,t){if(this._docs=e,t&&!(t instanceof y))throw new Error("Incorrect 'index' type");this._myIndex=t||v(this.options.keys,this._docs,{getFn:this.options.getFn})}add(e){s(e)&&(this._docs.push(e),this._myIndex.add(e))}remove(e=(()=>!1)){const t=[];for(let r=0,n=this._docs.length;r<n;r+=1){const i=this._docs[r];e(i,r)&&(this.removeAt(r),r-=1,n-=1,t.push(i))}return t}removeAt(e){this._docs.splice(e,1),this._myIndex.removeAt(e)}getIndex(){return this._myIndex}search(e,{limit:t=-1}={}){const{includeMatches:r,includeScore:o,shouldSort:s,sortFn:a,ignoreFieldNorm:u}=this.options;let c=n(e)?n(this._docs[0])?this._searchStringList(e):this._searchObjectList(e):this._searchLogical(e);return function(e,{ignoreFieldNorm:t=p.ignoreFieldNorm}){e.forEach((e=>{let r=1;e.matches.forEach((({key:e,norm:n,score:i})=>{const o=e?e.weight:null;r*=Math.pow(0===i&&o?Number.EPSILON:i,(o||1)*(t?1:n))})),e.score=r}))}(c,{ignoreFieldNorm:u}),s&&c.sort(a),i(t)&&t>-1&&(c=c.slice(0,t)),function(e,t,{includeMatches:r=p.includeMatches,includeScore:n=p.includeScore}={}){const i=[];return r&&i.push(m),n&&i.push(w),e.map((e=>{const{idx:r}=e,n={item:t[r],refIndex:r};return i.length&&i.forEach((t=>{t(e,n)})),n}))}(c,this._docs,{includeMatches:r,includeScore:o})}_searchStringList(e){const t=U(e,this.options),{records:r}=this._myIndex,n=[];return r.forEach((({v:e,i:r,n:i})=>{if(!s(e))return;const{isMatch:o,score:a,indices:u}=t.searchIn(e);o&&n.push({item:e,idx:r,matches:[{score:a,value:e,norm:i,indices:u}]})})),n}_searchLogical(e){const t=H(e,this.options),r=(e,t,n)=>{if(!e.children){const{keyId:r,searcher:i}=e,o=this._findMatches({key:this._keyStore.get(r),value:this._myIndex.getValueForItemAtKeyId(t,r),searcher:i});return o&&o.length?[{idx:n,item:t,matches:o}]:[]}switch(e.operator){case O:{const i=[];for(let o=0,s=e.children.length;o<s;o+=1){const s=e.children[o],a=r(s,t,n);if(!a.length)return[];i.push(...a)}return i}case"$or":{const i=[];for(let o=0,s=e.children.length;o<s;o+=1){const s=e.children[o],a=r(s,t,n);if(a.length){i.push(...a);break}}return i}}},n=this._myIndex.records,i={},o=[];return n.forEach((({$:e,i:n})=>{if(s(e)){let s=r(t,e,n);s.length&&(i[n]||(i[n]={idx:n,item:e,matches:[]},o.push(i[n])),s.forEach((({matches:e})=>{i[n].matches.push(...e)})))}})),o}_searchObjectList(e){const t=U(e,this.options),{keys:r,records:n}=this._myIndex,i=[];return n.forEach((({$:e,i:n})=>{if(!s(e))return;let o=[];r.forEach(((r,n)=>{o.push(...this._findMatches({key:r,value:e[n],searcher:t}))})),o.length&&i.push({idx:n,item:e,matches:o})})),i}_findMatches({key:e,value:r,searcher:n}){if(!s(r))return[];let i=[];if(t(r))r.forEach((({v:t,i:r,n:o})=>{if(!s(t))return;const{isMatch:a,score:u,indices:c}=n.searchIn(t);a&&i.push({score:u,key:e,value:t,idx:r,norm:o,indices:c})}));else{const{v:t,n:o}=r,{isMatch:s,score:a,indices:u}=n.searchIn(t);s&&i.push({score:a,key:e,value:t,norm:o,indices:u})}return i}}function N(e){if(!e.match(/^\..?\//))return new URL(e,document.baseURI).href;const t=new Error;if(!t.stack)return e;let r=t.stack.split("\n").filter((e=>e.includes(":")))[2].match(/[a-z]+:.*$/);if(!r)return e;const n=r[0].replace(/(\:[0-9]+){2}\)?$/,"");return new URL(e,n).href}M.version="6.4.2",M.createIndex=v,M.parseIndex=function(e,{getFn:t=p.getFn}={}){const{keys:r,records:n}=e,i=new y({getFn:t});return i.setKeys(r),i.setIndexRecords(n),i},M.config=p,M.parseQuery=H,function(...e){R.push(...e)}(class{constructor(e,{isCaseSensitive:t=p.isCaseSensitive,includeMatches:r=p.includeMatches,minMatchCharLength:n=p.minMatchCharLength,findAllMatches:i=p.findAllMatches,location:o=p.location,threshold:s=p.threshold,distance:a=p.distance}={}){this.query=null,this.options={isCaseSensitive:t,includeMatches:r,minMatchCharLength:n,findAllMatches:i,location:o,threshold:s,distance:a},this.pattern=t?e:e.toLowerCase(),this.query=function(e,t={}){return e.split("|").map((e=>{let r=e.trim().split(I).filter((e=>e&&!!e.trim())),n=[];for(let e=0,i=r.length;e<i;e+=1){const i=r[e];let o=!1,s=-1;for(;!o&&++s<C;){const e=P[s];let r=e.isMultiMatch(i);r&&(n.push(new e(r,t)),o=!0)}if(!o)for(s=-1;++s<C;){const e=P[s];let r=e.isSingleMatch(i);if(r){n.push(new e(r,t));break}}}return n}))}(this.pattern,this.options)}static condition(e,t){return t.useExtendedSearch}searchIn(e){const t=this.query;if(!t)return{isMatch:!1,score:1};const{includeMatches:r,isCaseSensitive:n}=this.options;e=n?e:e.toLowerCase();let i=0,o=[],s=0;for(let n=0,a=t.length;n<a;n+=1){const a=t[n];o.length=0,i=0;for(let t=0,n=a.length;t<n;t+=1){const n=a[t],{isMatch:u,indices:c,score:h}=n.search(e);if(!u){s=0,i=0,o.length=0;break}if(i+=1,s+=h,r){const e=n.constructor.type;T.has(e)?o=[...o,...c]:o.push(c)}}if(i){let e={isMatch:!0,score:s/i};return r&&(e.indices=o),e}}return{isMatch:!1,score:1}}}),function(...e){const t=[];for(let r of e){r=N(r);let e=Array.from(document.head.querySelectorAll("link")).find((e=>e.href===r));if(e)return e;e=document.createElement("link"),e.rel="stylesheet",e.href=r,document.head.appendChild(e),t.push(e)}}("https://cdn.skypack.dev/@startinblox/oidc@0.14/sib-auth.css");class j extends HTMLElement{constructor(){super(),this.provider=null,this.user=null,this.hide(),this.session=(0,e.handleIncomingRedirect)({restorePreviousSession:!0,url:window.location.href}).then((async e=>e&&e.isLoggedIn?(this.dispatchUserInfo(),e):(this.hasAttribute("auto-login")&&this.login(),null)))}connectedCallback(){this.install(),(0,e.onSessionRestore)((e=>{window.history.replaceState({},"",e),this.dispatchEvent(new CustomEvent("newUrl",{bubbles:!0}))}))}disconnectedCallback(){(0,e.logout)(),this.uninstall()}install(){this.bindUserObserver=new MutationObserver((e=>{e.forEach((e=>{if("attributes"!==e.type)e.addedNodes.forEach((e=>{e instanceof Element&&(e.hasAttribute("bind-user")&&this.applyUser(e),e.querySelectorAll("[bind-user]").length&&e.querySelectorAll("[bind-user]").forEach((e=>this.applyUser(e))))}));else{if(!e.target.hasAttribute("bind-user"))return;this.applyUser(e.target)}}))})),this.bindUserObserver.observe(document.body,{childList:!0,attributes:!0,characterData:!1,subtree:!0,attributeOldValue:!1,attributeFilter:["bind-user"]})}uninstall(){this.bindUserObserver.disconnect()}getProvider(e){return this.querySelector(`sib-auth-provider[data-id=${e}]`)}getFavoriteProvider(){const e=localStorage.getItem("oidc_favorite_provider");let t=this.getProvider(e);if(!t){const e=this.querySelectorAll("sib-auth-provider");1===e.length&&(t=e.item(0))}return t}getProviders(){return this.querySelectorAll("sib-auth-provider")}setFavoriteProvider(e){localStorage.setItem("oidc_favorite_provider",e)}async processState(){const{provider:e}=this.getState(),t=this.getProvider(e);t&&this.callProvider(t,"processState",this)}async dispatchUserInfo(){const e=async()=>{document.querySelectorAll("[bind-user]").forEach((e=>this.applyUser(e)))};"loading"===document.readyState?document.addEventListener("DOMContentLoaded",e):e()}async applyUser(e){const t=await this.getUserWebId();null!=t&&(e.getAttribute("data-src"===t)||e.setAttribute("data-src",t))}async getUserWebId(){const e=await this.session;return e?e.webId:null}async getUserIdToken(){await this.session;const t=await(0,e.fetch)(`${this.getFavoriteProvider().attributes["data-authority"].value}check-user`),r=await t.json();return r?`${r.Authorization}SEPARATOR${r.dpop}`:null}async getUser(){const e=await this.getUserWebId();return e?{"@id":e}:null}login(){const e=this.getFavoriteProvider();e?this.callProvider(e,"login",this):this.show()}logout(){(0,e.logout)().then((()=>this.dispatchUserInfo())).then((()=>window.location.reload()))}hide(){this.initialDisplayStyle=this.style.display,this.style.display="none",this.removeEventListener("click",this.hide)}show(){this.getProviders().forEach((e=>{e.onclick=()=>{this.setFavoriteProvider(e.id),this.callProvider(e,"login",this)}})),this.addEventListener("click",this.hide),this.style.display=this.initialDisplayStyle}async callProvider(e,t,...r){return await customElements.whenDefined("sib-auth-provider"),e[t](...r)}getFetch(){return e.fetch}}customElements.define("sib-auth",j);class B extends HTMLElement{constructor(){super(),this.id=null}async connectedCallback(){const{id:e}=this.dataset;this.id=e,this.render(this.dataset)}async login(){await(0,e.login)({oidcIssuer:this.dataset.authority,clientName:this.dataset.clientName,redirectUrl:window.location.href})}render({label:e,id:t}){this.innerHTML=`${e||t}`}}customElements.define("sib-auth-provider",B)})()})();
\ No newline at end of file
diff --git a/dist/index.js.LICENSE.txt b/dist/index.js.LICENSE.txt
index b2435ba08c8b7f9c247515b6525e6b243d557b61..6a016d1a79ad6080e8caec7a7b73686f1beee6f9 100644
--- a/dist/index.js.LICENSE.txt
+++ b/dist/index.js.LICENSE.txt
@@ -1,11 +1,3 @@
-/*!
- * @overview es6-promise - a tiny implementation of Promises/A+.
- * @copyright Copyright (c) 2014 Yehuda Katz, Tom Dale, Stefan Penner and contributors (Conversion to ES6 API by Jake Archibald)
- * @license   Licensed under MIT license
- *            See https://raw.githubusercontent.com/stefanpenner/es6-promise/master/LICENSE
- * @version   v4.2.8+1e68dce6
- */
-
 /*!
  * The buffer module from node.js, for the browser.
  *
@@ -13,314 +5,6 @@
  * @license  MIT
  */
 
-/*!
- * The buffer module from node.js, for the browser.
- *
- * @author   Feross Aboukhadijeh <https://feross.org>
- * @license  MIT
- */
-
-/*!
- * algorithms/aes-cbc-hmac-sha2.js - AES-CBC-HMAC-SHA2 Composited Encryption
- *
- * Copyright (c) 2015 Cisco Systems, Inc.  See LICENSE file.
- */
-
-/*!
- * algorithms/aes-gcm.js - AES-GCM Encryption and Key-Wrapping
- *
- * Copyright (c) 2015 Cisco Systems, Inc.  See LICENSE file.
- */
-
-/*!
- * algorithms/aes-kw.js - AES-KW Key-Wrapping
- *
- * Copyright (c) 2015 Cisco Systems, Inc.  See LICENSE file.
- */
-
-/*!
- * algorithms/concat.js - Concat Key Derivation
- *
- * Copyright (c) 2015 Cisco Systems, Inc.  See LICENSE file.
- */
-
-/*!
- * algorithms/constants.js - Constants used in Cryptographic Algorithms
- *
- * Copyright (c) 2015 Cisco Systems, Inc.  See LICENSE file.
- */
-
-/*!
- * algorithms/dir.js - Direct key mode
- *
- * Copyright (c) 2015 Cisco Systems, Inc.  See LICENSE file.
- */
-
-/*!
- * algorithms/ec-util.js - Elliptic Curve Utility Functions
- *
- * Copyright (c) 2015 Cisco Systems, Inc.  See LICENSE file.
- */
-
-/*!
- * algorithms/ecdh.js - Elliptic Curve Diffie-Hellman algorithms
- *
- * Copyright (c) 2015 Cisco Systems, Inc.  See LICENSE file.
- */
-
-/*!
- * algorithms/ecdsa.js - Elliptic Curve Digitial Signature Algorithms
- *
- * Copyright (c) 2015 Cisco Systems, Inc.  See LICENSE file.
- */
-
-/*!
- * algorithms/helpers.js - Internal functions and fields used in Cryptographic
- * Algorithms
- *
- * Copyright (c) 2015 Cisco Systems, Inc.  See LICENSE file.
- */
-
-/*!
- * algorithms/hkdf.js - HMAC-based Extract-and-Expand Key Derivation
- *
- * Copyright (c) 2015 Cisco Systems, Inc.  See LICENSE file.
- */
-
-/*!
- * algorithms/hmac.js - HMAC-based "signatures"
- *
- * Copyright (c) 2015 Cisco Systems, Inc.  See LICENSE file.
- */
-
-/*!
- * algorithms/index.js - Cryptographic Algorithms Entry Point
- *
- * Copyright (c) 2015 Cisco Systems, Inc.  See LICENSE file.
- */
-
-/*!
- * algorithms/pbes2.js - Password-Based Encryption (v2) Algorithms
- *
- * Copyright (c) 2015 Cisco Systems, Inc.  See LICENSE file.
- */
-
-/*!
- * algorithms/rsa-util.js - RSA Utility Functions
- *
- * Copyright (c) 2015 Cisco Systems, Inc.  See LICENSE file.
- */
-
-/*!
- * algorithms/rsaes.js - RSA Signatures
- *
- * Copyright (c) 2015 Cisco Systems, Inc.  See LICENSE file.
- */
-
-/*!
- * algorithms/rsassa.js - RSA Signatures
- *
- * Copyright (c) 2015 Cisco Systems, Inc.  See LICENSE file.
- */
-
-/*!
- * algorithms/sha.js - Cryptographic Secure Hash Algorithms, versions 1 and 2
- *
- * Copyright (c) 2015 Cisco Systems, Inc.  See LICENSE file.
- */
-
-/*!
- * deps/ciphermodes/gcm/helpers.js - AES-GCM Helper Functions
- *
- * Copyright (c) 2015 Cisco Systems, Inc.  See LICENSE file.
- */
-
-/*!
- * deps/ciphermodes/gcm/index.js - AES-GCM implementation Entry Point
- *
- * Copyright (c) 2015 Cisco Systems, Inc.  See LICENSE file.
- */
-
-/*!
- * deps/ciphermodes/gcm/multipliers.js - AES-GCM Multipliers
- *
- * Copyright (c) 2015 Cisco Systems, Inc.  See LICENSE file.
- */
-
-/*!
- * deps/ciphermodes/helpers.js - Cipher Helper Functions
- *
- * Copyright (c) 2015 Cisco Systems, Inc.  See LICENSE file.
- */
-
-/*!
- * deps/ciphermodes/pack.js - Pack/Unpack Functions
- *
- * Copyright (c) 2015 Cisco Systems, Inc.  See LICENSE file.
- */
-
-/*!
- * deps/forge.js - Forge Package Customization
- *
- * Copyright (c) 2015 Cisco Systems, Inc.  See LICENSE file.
- */
-
-/*!
- * index.js - Main Entry Point
- *
- * Copyright (c) 2015 Cisco Systems, Inc. See LICENSE file.
- */
-
-/*!
- * jwe/decrypt.js - Decrypt from a JWE
- *
- * Copyright (c) 2015 Cisco Systems, Inc. See LICENSE file.
- */
-
-/*!
- * jwe/defaults.js - Defaults for JWEs
- *
- * Copyright (c) 2015 Cisco Systems, Inc. See LICENSE file.
- */
-
-/*!
- * jwe/encrypt.js - Encrypt to a JWE
- *
- * Copyright (c) 2015 Cisco Systems, Inc. See LICENSE file.
- */
-
-/*!
- * jwe/helpers.js - JWE Internal Helper Functions
- *
- * Copyright (c) 2015 Cisco Systems, Inc. See LICENSE file.
- */
-
-/*!
- * jwe/index.js - JSON Web Encryption (JWE) Entry Point
- *
- * Copyright (c) 2015 Cisco Systems, Inc. See LICENSE file.
- */
-
-/*!
- * jwk/basekey.js - JWK Key Base Class Implementation
- *
- * Copyright (c) 2015 Cisco Systems, Inc. See LICENSE file.
- */
-
-/*!
- * jwk/constants.js - Constants for JWKs
- *
- * Copyright (c) 2015 Cisco Systems, Inc. See LICENSE file.
- */
-
-/*!
- * jwk/helpers.js - JWK Internal Helper Functions and Constants
- *
- * Copyright (c) 2015 Cisco Systems, Inc. See LICENSE file.
- */
-
-/*!
- * jwk/index.js - JSON Web Key (JWK) Entry Point
- *
- * Copyright (c) 2015 Cisco Systems, Inc. See LICENSE file.
- */
-
-/*!
- * jwk/keystore.js - JWK KeyStore Implementation
- *
- * Copyright (c) 2015 Cisco Systems, Inc. See LICENSE file.
- */
-
-/*!
- * jwk/octkey.js - Symmetric Octet Key Representation
- *
- * Copyright (c) 2015 Cisco Systems, Inc. See LICENSE file.
- */
-
-/*!
- * jwk/rsa.js - RSA Key Representation
- *
- * Copyright (c) 2015 Cisco Systems, Inc. See LICENSE file.
- */
-
-/*!
- * jws/defaults.js - Defaults for JWSs
- *
- * Copyright (c) 2015 Cisco Systems, Inc. See LICENSE file.
- */
-
-/*!
- * jws/helpers.js - JWS Internal Helper Functions
- *
- * Copyright (c) 2015 Cisco Systems, Inc. See LICENSE file.
- */
-
-/*!
- * jws/index.js - JSON Web Signature (JWS) Entry Point
- *
- * Copyright (c) 2015 Cisco Systems, Inc. See LICENSE file.
- */
-
-/*!
- * jws/sign.js - Sign to JWS
- *
- * Copyright (c) 2015 Cisco Systems, Inc. See LICENSE file.
- */
-
-/*!
- * jws/verify.js - Verifies from a JWS
- *
- * Copyright (c) 2015 Cisco Systems, Inc. See LICENSE file.
- */
-
-/*!
- * parse/compact.js - JOSE Compact Serialization Parser
- *
- * Copyright (c) 2015 Cisco Systems, Inc. See LICENSE file.
- */
-
-/*!
- * parse/compact.js - JOSE JSON Serialization Parser
- *
- * Copyright (c) 2015 Cisco Systems, Inc. See LICENSE file.
- */
-
-/*!
- * parse/index.js - JOSE Parser Entry Point
- *
- * Copyright (c) 2015 Cisco Systems, Inc. See LICENSE file.
- */
-
-/*!
- * util/algconfig.js - Functions for managing algorithm set options
- *
- * Copyright (c) 2015 Cisco Systems, Inc. See LICENSE file.
- */
-
-/*!
- * util/base64url.js - Implementation of web-safe Base64 Encoder/Decoder
- *
- * Copyright (c) 2015 Cisco Systems, Inc. See LICENSE file.
- */
-
-/*!
- * util/databuffer.js - Forge-compatible Buffer based on Node.js Buffers
- *
- * Copyright (c) 2015 Cisco Systems, Inc. See LICENSE file.
- */
-
-/*!
- * util/index.js - Utilities Entry Point
- *
- * Copyright (c) 2015 Cisco Systems, Inc. See LICENSE file.
- */
-
-/*!
- * util/utf8.js - Implementation of UTF-8 Encoder/Decoder
- *
- * Copyright (c) 2015 Cisco Systems, Inc. See LICENSE file.
- */
-
 /*!
 Copyright (c) 2011, Yahoo! Inc. All rights reserved.
 Code licensed under the BSD License:
@@ -349,21 +33,6 @@ See the Apache Version 2.0 License for specific language governing permissions
 and limitations under the License.
 ***************************************************************************** */
 
-/*! *****************************************************************************
-Copyright (c) Microsoft Corporation.
-
-Permission to use, copy, modify, and/or distribute this software for any
-purpose with or without fee is hereby granted.
-
-THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
-REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
-AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
-INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
-LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
-OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
-PERFORMANCE OF THIS SOFTWARE.
-***************************************************************************** */
-
 /*! CryptoJS v3.1.2 core-fix.js
  * code.google.com/p/crypto-js
  * (c) 2009-2013 by Jeff Mott. All rights reserved.
@@ -377,5 +46,3 @@ PERFORMANCE OF THIS SOFTWARE.
  */
 
 /*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */
-
-/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
diff --git a/package-lock.json b/package-lock.json
index a2b3a0bf5d3376e4b18314c2b8f84ed65404bfd1..79f40aa35a17bccba151e70a1e8fdaeaed79e2bc 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -149,62 +149,55 @@
         }
       }
     },
+    "@inrupt/jose-legacy-modules": {
+      "version": "0.0.3-3.13.0",
+      "resolved": "https://registry.npmjs.org/@inrupt/jose-legacy-modules/-/jose-legacy-modules-0.0.3-3.13.0.tgz",
+      "integrity": "sha512-r5+0/cF8BSpSslqC++/Fv7vJi6xAklWQDip2xIF5v/iIEYBjH7kVubqqil9uWz92npT2+SUolPBcNFcVAT9qdw==",
+      "requires": {
+        "jose": "3.13.0"
+      }
+    },
     "@inrupt/oidc-client-ext": {
-      "version": "1.8.2",
-      "resolved": "https://registry.npmjs.org/@inrupt/oidc-client-ext/-/oidc-client-ext-1.8.2.tgz",
-      "integrity": "sha512-/5nl0ilxN0rhxY6VxIaQWjf9v3VZta5AiPXRSH3IzRqHh/l3xaTA6iWfM03QWQj12qnQIXYs9rh2UUDnhyUwVA==",
-      "requires": {
-        "@inrupt/solid-client-authn-core": "^1.8.2",
-        "@types/form-urlencoded": "^4.4.0",
-        "@types/jsonwebtoken": "^8.5.0",
-        "@types/node-jose": "^1.1.5",
+      "version": "1.9.1",
+      "resolved": "https://registry.npmjs.org/@inrupt/oidc-client-ext/-/oidc-client-ext-1.9.1.tgz",
+      "integrity": "sha512-A4O0/75My1UyUqvBajxudBHcg6p+cJGVpiTl4d2y+wc7LiNIympU10ky8MwNXUg4hHVZkwMQB2VM7pwO7oX5Eg==",
+      "requires": {
+        "@inrupt/jose-legacy-modules": "0.0.3-3.13.0",
+        "@inrupt/solid-client-authn-core": "^1.9.1",
         "@types/uuid": "^8.3.0",
         "form-urlencoded": "~6.0.3",
-        "jose": "^2.0.4",
-        "jsonwebtoken": "^8.5.1",
-        "node-jose": "^2.0.0",
         "oidc-client": "^1.11.3",
         "uuid": "^8.3.1"
       }
     },
     "@inrupt/solid-client-authn-browser": {
-      "version": "1.8.2",
-      "resolved": "https://registry.npmjs.org/@inrupt/solid-client-authn-browser/-/solid-client-authn-browser-1.8.2.tgz",
-      "integrity": "sha512-DzgF2iv2yuew4O2pbj7i48oNl4xnTgjzrzNQCdlyvMbTCestI+sVt6QAJfHEUC299urS/9yelvtys+P+fPqJFg==",
+      "version": "1.9.1",
+      "resolved": "https://registry.npmjs.org/@inrupt/solid-client-authn-browser/-/solid-client-authn-browser-1.9.1.tgz",
+      "integrity": "sha512-akQ6zJ1+861g9d9SD2E7Fo5BfvEv16FLeuj/tUI/41Q1WCNvVNq+5F2XD3t2nwGrVpk703QcwbptTY5kH5T7Ow==",
       "requires": {
-        "@inrupt/oidc-client-ext": "^1.8.2",
-        "@inrupt/solid-client-authn-core": "^1.8.2",
-        "@types/form-urlencoded": "^4.4.0",
+        "@inrupt/jose-legacy-modules": "0.0.3-3.13.0",
+        "@inrupt/oidc-client-ext": "^1.9.1",
+        "@inrupt/solid-client-authn-core": "^1.9.1",
         "@types/lodash.clonedeep": "^4.5.6",
         "@types/node": "^15.0.1",
         "@types/uuid": "^8.3.0",
-        "assert": "^2.0.0",
-        "browserify-zlib": "^0.2.0",
-        "buffer": "^6.0.3",
-        "crypto-browserify": "^3.12.0",
-        "form-urlencoded": "^6.0.3",
-        "jose": "^2.0.5",
         "lodash.clonedeep": "^4.5.0",
-        "os-browserify": "^0.3.0",
-        "reflect-metadata": "^0.1.13",
-        "stream-browserify": "^3.0.0",
-        "tsyringe": "^4.4.0",
-        "util": "^0.12.3",
         "uuid": "^8.3.1"
       },
       "dependencies": {
         "@types/node": {
-          "version": "15.12.2",
-          "resolved": "https://registry.npmjs.org/@types/node/-/node-15.12.2.tgz",
-          "integrity": "sha512-zjQ69G564OCIWIOHSXyQEEDpdpGl+G348RAKY0XXy9Z5kU9Vzv1GMNnkar/ZJ8dzXB3COzD9Mo9NtRZ4xfgUww=="
+          "version": "15.14.1",
+          "resolved": "https://registry.npmjs.org/@types/node/-/node-15.14.1.tgz",
+          "integrity": "sha512-wF6hazbsnwaW3GhK4jFuw5NaLDQVRQ6pWQUGAUrJzxixFkTaODSiAKMPXuHwPEPkAKQWHAzj6uJ5h+3zU9gQxg=="
         }
       }
     },
     "@inrupt/solid-client-authn-core": {
-      "version": "1.8.2",
-      "resolved": "https://registry.npmjs.org/@inrupt/solid-client-authn-core/-/solid-client-authn-core-1.8.2.tgz",
-      "integrity": "sha512-34oJfgNu/UpZKmSmTCROCKMD9S977l5IwLKaK9BssjeSny0Xe/fjp8UyLRz3rs+RdG+yAGvSAW8+Cj3ctLQ8xA==",
+      "version": "1.9.1",
+      "resolved": "https://registry.npmjs.org/@inrupt/solid-client-authn-core/-/solid-client-authn-core-1.9.1.tgz",
+      "integrity": "sha512-w3hAJPmlJhyl0LMf8GWI+pObphlki9Z2IjxXMXTd3v1sTERuZjjv45LkkctUUC8liErun4VYpcfvXJvsJHTONQ==",
       "requires": {
+        "@inrupt/jose-legacy-modules": "0.0.3-3.13.0",
         "@inrupt/solid-common-vocab": "^0.5.3",
         "@types/lodash.clonedeep": "^4.5.6",
         "@types/uuid": "^8.3.0",
@@ -221,11 +214,6 @@
         "@types/rdf-js": "4.0.0"
       }
     },
-    "@panva/asn1.js": {
-      "version": "1.0.0",
-      "resolved": "https://registry.npmjs.org/@panva/asn1.js/-/asn1.js-1.0.0.tgz",
-      "integrity": "sha512-UdkG3mLEqXgnlKsWanWcgb6dOjUzJ+XC5f+aWw30qrtjxeNUSfKX1cd5FBzOaXQumoe9nIqeZUvrRJS03HCCtw=="
-    },
     "@startinblox/core": {
       "version": "0.15.6",
       "resolved": "https://registry.npmjs.org/@startinblox/core/-/core-0.15.6.tgz",
@@ -257,14 +245,6 @@
       "integrity": "sha512-laIjwTQaD+5DukBZaygQ79K1Z0jb1bPEMRrkXSLjtCcZm+abyp5YbrqpSLzD42FwWW6gK/aS4NYpJ804nG2brg==",
       "dev": true
     },
-    "@types/form-urlencoded": {
-      "version": "4.4.0",
-      "resolved": "https://registry.npmjs.org/@types/form-urlencoded/-/form-urlencoded-4.4.0.tgz",
-      "integrity": "sha512-HgXuKd4MX4L6dl+cIRYnPQPPLBxcIQwktT7DnqatIR9LKDdXQlwH0euOpJ08HUoEFZa5/nb93+EK80Py4Napug==",
-      "requires": {
-        "form-urlencoded": "*"
-      }
-    },
     "@types/json-schema": {
       "version": "7.0.7",
       "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.7.tgz",
@@ -277,14 +257,6 @@
       "integrity": "sha1-7ihweulOEdK4J7y+UnC86n8+ce4=",
       "dev": true
     },
-    "@types/jsonwebtoken": {
-      "version": "8.5.1",
-      "resolved": "https://registry.npmjs.org/@types/jsonwebtoken/-/jsonwebtoken-8.5.1.tgz",
-      "integrity": "sha512-rNAPdomlIUX0i0cg2+I+Q1wOUr531zHBQ+cV/28PJ39bSPKjahatZZ2LMuhiguETkCgLVzfruw/ZvNMNkKoSzw==",
-      "requires": {
-        "@types/node": "*"
-      }
-    },
     "@types/lodash": {
       "version": "4.14.170",
       "resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.14.170.tgz",
@@ -303,14 +275,6 @@
       "resolved": "https://registry.npmjs.org/@types/node/-/node-14.14.25.tgz",
       "integrity": "sha512-EPpXLOVqDvisVxtlbvzfyqSsFeQxltFbluZNRndIb8tr9KiBnYNLzrc1N3pyKUCww2RNrfHDViqDWWE1LCJQtQ=="
     },
-    "@types/node-jose": {
-      "version": "1.1.6",
-      "resolved": "https://registry.npmjs.org/@types/node-jose/-/node-jose-1.1.6.tgz",
-      "integrity": "sha512-iAr2hvnqg7ZktBjdbeT1yhXzIZcwp6C564mEsnr45ty+wE2AeSxIlNM9rGhhtQDdOWl6Kg3IbadgzA9/VWwnXw==",
-      "requires": {
-        "@types/node": "*"
-      }
-    },
     "@types/rdf-js": {
       "version": "4.0.0",
       "resolved": "https://registry.npmjs.org/@types/rdf-js/-/rdf-js-4.0.0.tgz",
@@ -320,9 +284,9 @@
       }
     },
     "@types/uuid": {
-      "version": "8.3.0",
-      "resolved": "https://registry.npmjs.org/@types/uuid/-/uuid-8.3.0.tgz",
-      "integrity": "sha512-eQ9qFW/fhfGJF8WKHGEHZEyVWfZxrT+6CLIJGBcZPfxUh/+BnEj+UCGYMlr9qZuX/2AltsvwrGqp0LhEW8D0zQ=="
+      "version": "8.3.1",
+      "resolved": "https://registry.npmjs.org/@types/uuid/-/uuid-8.3.1.tgz",
+      "integrity": "sha512-Y2mHTRAbqfFkpjldbkHGY8JIzRN6XqYRliG8/24FcHm2D2PwW24fl5xMRTVGdrb7iMrwCaIEbLWerGIkXuFWVg=="
     },
     "@webassemblyjs/ast": {
       "version": "1.11.0",
@@ -575,7 +539,8 @@
     "array-filter": {
       "version": "1.0.0",
       "resolved": "https://registry.npmjs.org/array-filter/-/array-filter-1.0.0.tgz",
-      "integrity": "sha1-uveeYubvTCpMC4MSMtr/7CUfnYM="
+      "integrity": "sha1-uveeYubvTCpMC4MSMtr/7CUfnYM=",
+      "dev": true
     },
     "array-flatten": {
       "version": "1.1.1",
@@ -611,6 +576,7 @@
       "version": "5.4.1",
       "resolved": "https://registry.npmjs.org/asn1.js/-/asn1.js-5.4.1.tgz",
       "integrity": "sha512-+I//4cYPccV8LdmBLiX8CYvf9Sp3vQsrqu2QNXRcrbiWvcx/UdlFiqUJJzxRQxgsZmvhXhn4cSKeSmoFjVdupA==",
+      "dev": true,
       "requires": {
         "bn.js": "^4.0.0",
         "inherits": "^2.0.1",
@@ -621,21 +587,11 @@
         "bn.js": {
           "version": "4.11.9",
           "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.9.tgz",
-          "integrity": "sha512-E6QoYqCKZfgatHTdHzs1RRKP7ip4vvm+EyRUeE2RF0NblwVvb0p6jSVeNTOFxPn26QXN2o6SMfNxKp6kU8zQaw=="
+          "integrity": "sha512-E6QoYqCKZfgatHTdHzs1RRKP7ip4vvm+EyRUeE2RF0NblwVvb0p6jSVeNTOFxPn26QXN2o6SMfNxKp6kU8zQaw==",
+          "dev": true
         }
       }
     },
-    "assert": {
-      "version": "2.0.0",
-      "resolved": "https://registry.npmjs.org/assert/-/assert-2.0.0.tgz",
-      "integrity": "sha512-se5Cd+js9dXJnu6Ag2JFc00t+HmHOen+8Q+L7O9zI0PqQXr20uk2J0XQqMxZEeo5U50o8Nvmmx7dZrl+Ufr35A==",
-      "requires": {
-        "es6-object-assign": "^1.1.0",
-        "is-nan": "^1.2.1",
-        "object-is": "^1.0.1",
-        "util": "^0.12.0"
-      }
-    },
     "astral-regex": {
       "version": "2.0.0",
       "resolved": "https://registry.npmjs.org/astral-regex/-/astral-regex-2.0.0.tgz",
@@ -646,6 +602,7 @@
       "version": "1.0.2",
       "resolved": "https://registry.npmjs.org/available-typed-arrays/-/available-typed-arrays-1.0.2.tgz",
       "integrity": "sha512-XWX3OX8Onv97LMk/ftVyBibpGwY5a8SmuxZPzeOxqmuEqUCOM9ZE+uIaD1VNJ5QnvU2UQusvmKbuM1FR8QWGfQ==",
+      "dev": true,
       "requires": {
         "array-filter": "^1.0.0"
       }
@@ -675,15 +632,11 @@
       "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz",
       "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA=="
     },
-    "base64url": {
-      "version": "3.0.1",
-      "resolved": "https://registry.npmjs.org/base64url/-/base64url-3.0.1.tgz",
-      "integrity": "sha512-ir1UPr3dkwexU7FdV8qBBbNDRUhMmIekYMFZfi+C/sLNnRESKPl23nB9b2pltqfOQNnGzsDdId90AEtG5tCx4A=="
-    },
     "bn.js": {
       "version": "5.1.3",
       "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-5.1.3.tgz",
-      "integrity": "sha512-GkTiFpjFtUzU9CbMeJ5iazkCzGL3jrhzerzZIuqLABjbwRaFt33I9tUdSNryIptM+RxDet6OKm2WnLXzW51KsQ=="
+      "integrity": "sha512-GkTiFpjFtUzU9CbMeJ5iazkCzGL3jrhzerzZIuqLABjbwRaFt33I9tUdSNryIptM+RxDet6OKm2WnLXzW51KsQ==",
+      "dev": true
     },
     "body-parser": {
       "version": "1.19.0",
@@ -733,12 +686,14 @@
     "brorand": {
       "version": "1.1.0",
       "resolved": "https://registry.npmjs.org/brorand/-/brorand-1.1.0.tgz",
-      "integrity": "sha1-EsJe/kCkXjwyPrhnWgoM5XsiNx8="
+      "integrity": "sha1-EsJe/kCkXjwyPrhnWgoM5XsiNx8=",
+      "dev": true
     },
     "browserify-aes": {
       "version": "1.2.0",
       "resolved": "https://registry.npmjs.org/browserify-aes/-/browserify-aes-1.2.0.tgz",
       "integrity": "sha512-+7CHXqGuspUn/Sl5aO7Ea0xWGAtETPXNSAjHo48JfLdPWcMng33Xe4znFvQweqc/uzk5zSOI3H52CYnjCfb5hA==",
+      "dev": true,
       "requires": {
         "buffer-xor": "^1.0.3",
         "cipher-base": "^1.0.0",
@@ -752,6 +707,7 @@
       "version": "1.0.1",
       "resolved": "https://registry.npmjs.org/browserify-cipher/-/browserify-cipher-1.0.1.tgz",
       "integrity": "sha512-sPhkz0ARKbf4rRQt2hTpAHqn47X3llLkUGn+xEJzLjwY8LRs2p0v7ljvI5EyoRO/mexrNunNECisZs+gw2zz1w==",
+      "dev": true,
       "requires": {
         "browserify-aes": "^1.0.4",
         "browserify-des": "^1.0.0",
@@ -762,6 +718,7 @@
       "version": "1.0.2",
       "resolved": "https://registry.npmjs.org/browserify-des/-/browserify-des-1.0.2.tgz",
       "integrity": "sha512-BioO1xf3hFwz4kc6iBhI3ieDFompMhrMlnDFC4/0/vd5MokpuAc3R+LYbwTA9A5Yc9pq9UYPqffKpW2ObuwX5A==",
+      "dev": true,
       "requires": {
         "cipher-base": "^1.0.1",
         "des.js": "^1.0.0",
@@ -773,6 +730,7 @@
       "version": "4.1.0",
       "resolved": "https://registry.npmjs.org/browserify-rsa/-/browserify-rsa-4.1.0.tgz",
       "integrity": "sha512-AdEER0Hkspgno2aR97SAf6vi0y0k8NuOpGnVH3O99rcA5Q6sh8QxcngtHuJ6uXwnfAXNM4Gn1Gb7/MV1+Ymbog==",
+      "dev": true,
       "requires": {
         "bn.js": "^5.0.0",
         "randombytes": "^2.0.1"
@@ -782,6 +740,7 @@
       "version": "4.2.1",
       "resolved": "https://registry.npmjs.org/browserify-sign/-/browserify-sign-4.2.1.tgz",
       "integrity": "sha512-/vrA5fguVAKKAVTNJjgSm1tRQDHUU6DbwO9IROu/0WAzC8PKhucDSh18J0RMvVeHAn5puMd+QHC2erPRNf8lmg==",
+      "dev": true,
       "requires": {
         "bn.js": "^5.1.1",
         "browserify-rsa": "^4.0.1",
@@ -798,6 +757,7 @@
           "version": "3.6.0",
           "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz",
           "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==",
+          "dev": true,
           "requires": {
             "inherits": "^2.0.3",
             "string_decoder": "^1.1.1",
@@ -807,18 +767,11 @@
         "safe-buffer": {
           "version": "5.2.1",
           "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz",
-          "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ=="
+          "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==",
+          "dev": true
         }
       }
     },
-    "browserify-zlib": {
-      "version": "0.2.0",
-      "resolved": "https://registry.npmjs.org/browserify-zlib/-/browserify-zlib-0.2.0.tgz",
-      "integrity": "sha512-Z942RysHXmJrhqk88FmKBVq/v5tqmSkDz7p54G/MGyjMnCFFnC79XWNbg+Vta8W6Wb2qtSZTSxIGkJrRpCFEiA==",
-      "requires": {
-        "pako": "~1.0.5"
-      }
-    },
     "browserslist": {
       "version": "4.16.6",
       "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.16.6.tgz",
@@ -844,16 +797,12 @@
       "version": "6.0.3",
       "resolved": "https://registry.npmjs.org/buffer/-/buffer-6.0.3.tgz",
       "integrity": "sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA==",
+      "dev": true,
       "requires": {
         "base64-js": "^1.3.1",
         "ieee754": "^1.2.1"
       }
     },
-    "buffer-equal-constant-time": {
-      "version": "1.0.1",
-      "resolved": "https://registry.npmjs.org/buffer-equal-constant-time/-/buffer-equal-constant-time-1.0.1.tgz",
-      "integrity": "sha1-+OcRMvf/5uAaXJaXpMbz5I1cyBk="
-    },
     "buffer-from": {
       "version": "1.1.1",
       "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.1.tgz",
@@ -863,7 +812,8 @@
     "buffer-xor": {
       "version": "1.0.3",
       "resolved": "https://registry.npmjs.org/buffer-xor/-/buffer-xor-1.0.3.tgz",
-      "integrity": "sha1-JuYe0UIvtw3ULm42cp7VHYVf6Nk="
+      "integrity": "sha1-JuYe0UIvtw3ULm42cp7VHYVf6Nk=",
+      "dev": true
     },
     "bytes": {
       "version": "3.1.0",
@@ -875,6 +825,7 @@
       "version": "1.0.2",
       "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.2.tgz",
       "integrity": "sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==",
+      "dev": true,
       "requires": {
         "function-bind": "^1.1.1",
         "get-intrinsic": "^1.0.2"
@@ -916,6 +867,7 @@
       "version": "1.0.4",
       "resolved": "https://registry.npmjs.org/cipher-base/-/cipher-base-1.0.4.tgz",
       "integrity": "sha512-Kkht5ye6ZGmwv40uUDZztayT2ThLQGfnj/T71N/XzeZeo3nf8foyW7zGTsPYkEya3m5f3cAypH+qe7YOrM1U2Q==",
+      "dev": true,
       "requires": {
         "inherits": "^2.0.1",
         "safe-buffer": "^5.0.1"
@@ -1005,14 +957,15 @@
       "dev": true
     },
     "core-js": {
-      "version": "3.14.0",
-      "resolved": "https://registry.npmjs.org/core-js/-/core-js-3.14.0.tgz",
-      "integrity": "sha512-3s+ed8er9ahK+zJpp9ZtuVcDoFzHNiZsPbNAAE4KXgrRHbjSqqNN6xGSXq6bq7TZIbKj4NLrLb6bJ5i+vSVjHA=="
+      "version": "3.15.2",
+      "resolved": "https://registry.npmjs.org/core-js/-/core-js-3.15.2.tgz",
+      "integrity": "sha512-tKs41J7NJVuaya8DxIOCnl8QuPHx5/ZVbFo1oKgVl1qHFBBrDctzQGtuLjPpRdNTWmKPH6oEvgN/MUID+l485Q=="
     },
     "create-ecdh": {
       "version": "4.0.4",
       "resolved": "https://registry.npmjs.org/create-ecdh/-/create-ecdh-4.0.4.tgz",
       "integrity": "sha512-mf+TCx8wWc9VpuxfP2ht0iSISLZnt0JgWlrOKZiNqyUZWnjIaCIVNQArMHnCZKfEYRg6IM7A+NeJoN8gf/Ws0A==",
+      "dev": true,
       "requires": {
         "bn.js": "^4.1.0",
         "elliptic": "^6.5.3"
@@ -1021,7 +974,8 @@
         "bn.js": {
           "version": "4.11.9",
           "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.9.tgz",
-          "integrity": "sha512-E6QoYqCKZfgatHTdHzs1RRKP7ip4vvm+EyRUeE2RF0NblwVvb0p6jSVeNTOFxPn26QXN2o6SMfNxKp6kU8zQaw=="
+          "integrity": "sha512-E6QoYqCKZfgatHTdHzs1RRKP7ip4vvm+EyRUeE2RF0NblwVvb0p6jSVeNTOFxPn26QXN2o6SMfNxKp6kU8zQaw==",
+          "dev": true
         }
       }
     },
@@ -1029,6 +983,7 @@
       "version": "1.2.0",
       "resolved": "https://registry.npmjs.org/create-hash/-/create-hash-1.2.0.tgz",
       "integrity": "sha512-z00bCGNHDG8mHAkP7CtT1qVu+bFQUPjYq/4Iv3C3kWjTFV10zIjfSoeqXo9Asws8gwSHDGj/hl2u4OGIjapeCg==",
+      "dev": true,
       "requires": {
         "cipher-base": "^1.0.1",
         "inherits": "^2.0.1",
@@ -1041,6 +996,7 @@
       "version": "1.1.7",
       "resolved": "https://registry.npmjs.org/create-hmac/-/create-hmac-1.1.7.tgz",
       "integrity": "sha512-MJG9liiZ+ogc4TzUwuvbER1JRdgvUFSB5+VR/g5h82fGaIRWMWddtKBHi7/sVhfjQZ6SehlyhvQYrcYkaUIpLg==",
+      "dev": true,
       "requires": {
         "cipher-base": "^1.0.3",
         "create-hash": "^1.1.0",
@@ -1073,6 +1029,7 @@
       "version": "3.12.0",
       "resolved": "https://registry.npmjs.org/crypto-browserify/-/crypto-browserify-3.12.0.tgz",
       "integrity": "sha512-fz4spIh+znjO2VjL+IdhEpRJ3YN6sMzITSBijk6FK2UvTqruSQW+/cCZTSNsMiZNvUeq0CqurF+dAbyiGOY6Wg==",
+      "dev": true,
       "requires": {
         "browserify-cipher": "^1.0.0",
         "browserify-sign": "^4.0.0",
@@ -1111,6 +1068,7 @@
       "version": "1.1.3",
       "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.3.tgz",
       "integrity": "sha512-3MqfYKj2lLzdMSf8ZIZE/V+Zuy+BgD6f164e8K2w7dgnpKArBDerGYpM46IYYcjnkdPNMjPk9A6VFB8+3SKlXQ==",
+      "dev": true,
       "requires": {
         "object-keys": "^1.0.12"
       }
@@ -1125,6 +1083,7 @@
       "version": "1.0.1",
       "resolved": "https://registry.npmjs.org/des.js/-/des.js-1.0.1.tgz",
       "integrity": "sha512-Q0I4pfFrv2VPd34/vfLrFOoRmlYj3OV50i7fskps1jZWK1kApMWWT9G6RRUeYedLcBDIhnSDaUvJMb3AhUlaEA==",
+      "dev": true,
       "requires": {
         "inherits": "^2.0.1",
         "minimalistic-assert": "^1.0.0"
@@ -1140,6 +1099,7 @@
       "version": "5.0.3",
       "resolved": "https://registry.npmjs.org/diffie-hellman/-/diffie-hellman-5.0.3.tgz",
       "integrity": "sha512-kqag/Nl+f3GwyK25fhUMYj81BUOrZ9IuJsjIcDE5icNM9FJHAVm3VcUDxdLPoQtTuUylWm6ZIknYJwwaPxsUzg==",
+      "dev": true,
       "requires": {
         "bn.js": "^4.1.0",
         "miller-rabin": "^4.0.0",
@@ -1149,7 +1109,8 @@
         "bn.js": {
           "version": "4.11.9",
           "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.9.tgz",
-          "integrity": "sha512-E6QoYqCKZfgatHTdHzs1RRKP7ip4vvm+EyRUeE2RF0NblwVvb0p6jSVeNTOFxPn26QXN2o6SMfNxKp6kU8zQaw=="
+          "integrity": "sha512-E6QoYqCKZfgatHTdHzs1RRKP7ip4vvm+EyRUeE2RF0NblwVvb0p6jSVeNTOFxPn26QXN2o6SMfNxKp6kU8zQaw==",
+          "dev": true
         }
       }
     },
@@ -1162,14 +1123,6 @@
         "esutils": "^2.0.2"
       }
     },
-    "ecdsa-sig-formatter": {
-      "version": "1.0.11",
-      "resolved": "https://registry.npmjs.org/ecdsa-sig-formatter/-/ecdsa-sig-formatter-1.0.11.tgz",
-      "integrity": "sha512-nagl3RYrbNv6kQkeJIpt6NJZy8twLB/2vtz6yN9Z4vRKHN4/QZJIEbqohALSgwKdnksuY3k5Addp5lg8sVoVcQ==",
-      "requires": {
-        "safe-buffer": "^5.0.1"
-      }
-    },
     "ee-first": {
       "version": "1.1.1",
       "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz",
@@ -1186,6 +1139,7 @@
       "version": "6.5.4",
       "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.5.4.tgz",
       "integrity": "sha512-iLhC6ULemrljPZb+QutR5TQGB+pdW6KGD5RSegS+8sorOZT+rdQFbsQFJgvN3eRqNALqJer4oQ16YvJHlU8hzQ==",
+      "dev": true,
       "requires": {
         "bn.js": "^4.11.9",
         "brorand": "^1.1.0",
@@ -1199,7 +1153,8 @@
         "bn.js": {
           "version": "4.11.9",
           "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.9.tgz",
-          "integrity": "sha512-E6QoYqCKZfgatHTdHzs1RRKP7ip4vvm+EyRUeE2RF0NblwVvb0p6jSVeNTOFxPn26QXN2o6SMfNxKp6kU8zQaw=="
+          "integrity": "sha512-E6QoYqCKZfgatHTdHzs1RRKP7ip4vvm+EyRUeE2RF0NblwVvb0p6jSVeNTOFxPn26QXN2o6SMfNxKp6kU8zQaw==",
+          "dev": true
         }
       }
     },
@@ -1253,6 +1208,7 @@
       "version": "1.18.0-next.2",
       "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.18.0-next.2.tgz",
       "integrity": "sha512-Ih4ZMFHEtZupnUh6497zEL4y2+w8+1ljnCyaTa+adcoafI1GOvMwFlDjBLfWR7y9VLfrjRJe9ocuHY1PSR9jjw==",
+      "dev": true,
       "requires": {
         "call-bind": "^1.0.2",
         "es-to-primitive": "^1.2.1",
@@ -1280,22 +1236,13 @@
       "version": "1.2.1",
       "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.2.1.tgz",
       "integrity": "sha512-QCOllgZJtaUo9miYBcLChTUaHNjJF3PYs1VidD7AwiEj1kYxKeQTctLAezAOH5ZKRH0g2IgPn6KwB4IT8iRpvA==",
+      "dev": true,
       "requires": {
         "is-callable": "^1.1.4",
         "is-date-object": "^1.0.1",
         "is-symbol": "^1.0.2"
       }
     },
-    "es6-object-assign": {
-      "version": "1.1.0",
-      "resolved": "https://registry.npmjs.org/es6-object-assign/-/es6-object-assign-1.1.0.tgz",
-      "integrity": "sha1-wsNYJlYkfDnqEHyx5mUrb58kUjw="
-    },
-    "es6-promise": {
-      "version": "4.2.8",
-      "resolved": "https://registry.npmjs.org/es6-promise/-/es6-promise-4.2.8.tgz",
-      "integrity": "sha512-HJDGx5daxeIvxdBxvG2cb9g4tEvwIk3i8+nhX0yGrYmZUzbkdg8QbDevheDB8gd0//uPj4c1EQua8Q+MViT0/w=="
-    },
     "escalade": {
       "version": "3.1.1",
       "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz",
@@ -1651,6 +1598,7 @@
       "version": "1.0.3",
       "resolved": "https://registry.npmjs.org/evp_bytestokey/-/evp_bytestokey-1.0.3.tgz",
       "integrity": "sha512-/f2Go4TognH/KvCISP7OUsHn85hT9nUkxxA9BEWxFn+Oj9o8ZNLm/40hdlgSLyuOimsrTKLUMEorQexp/aPQeA==",
+      "dev": true,
       "requires": {
         "md5.js": "^1.3.4",
         "safe-buffer": "^5.1.1"
@@ -1827,7 +1775,8 @@
     "foreach": {
       "version": "2.0.5",
       "resolved": "https://registry.npmjs.org/foreach/-/foreach-2.0.5.tgz",
-      "integrity": "sha1-C+4AUBiusmDQo6865ljdATbsG5k="
+      "integrity": "sha1-C+4AUBiusmDQo6865ljdATbsG5k=",
+      "dev": true
     },
     "form-urlencoded": {
       "version": "6.0.4",
@@ -1855,7 +1804,8 @@
     "function-bind": {
       "version": "1.1.1",
       "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz",
-      "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A=="
+      "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==",
+      "dev": true
     },
     "functional-red-black-tree": {
       "version": "1.0.1",
@@ -1867,6 +1817,7 @@
       "version": "1.1.1",
       "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.1.1.tgz",
       "integrity": "sha512-kWZrnVM42QCiEA2Ig1bG8zjoIMOgxWwYCEeNdwY6Tv/cOSeGpcoX4pXHfKUxNKVoArnrEr2e9srnAxxGIraS9Q==",
+      "dev": true,
       "requires": {
         "function-bind": "^1.1.1",
         "has": "^1.0.3",
@@ -1924,6 +1875,7 @@
       "version": "1.0.3",
       "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz",
       "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==",
+      "dev": true,
       "requires": {
         "function-bind": "^1.1.1"
       }
@@ -1937,12 +1889,14 @@
     "has-symbols": {
       "version": "1.0.1",
       "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.1.tgz",
-      "integrity": "sha512-PLcsoqu++dmEIZB+6totNFKq/7Do+Z0u4oT0zKOJNl3lYK6vGwwu2hjHs+68OEZbTjiUE9bgOABXbP/GvrS0Kg=="
+      "integrity": "sha512-PLcsoqu++dmEIZB+6totNFKq/7Do+Z0u4oT0zKOJNl3lYK6vGwwu2hjHs+68OEZbTjiUE9bgOABXbP/GvrS0Kg==",
+      "dev": true
     },
     "hash-base": {
       "version": "3.1.0",
       "resolved": "https://registry.npmjs.org/hash-base/-/hash-base-3.1.0.tgz",
       "integrity": "sha512-1nmYp/rhMDiE7AYkDw+lLwlAzz0AntGIe51F3RfFfEqyQ3feY2eI/NcwC6umIQVOASPMsWJLJScWKSSvzL9IVA==",
+      "dev": true,
       "requires": {
         "inherits": "^2.0.4",
         "readable-stream": "^3.6.0",
@@ -1953,6 +1907,7 @@
           "version": "3.6.0",
           "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz",
           "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==",
+          "dev": true,
           "requires": {
             "inherits": "^2.0.3",
             "string_decoder": "^1.1.1",
@@ -1962,7 +1917,8 @@
         "safe-buffer": {
           "version": "5.2.1",
           "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz",
-          "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ=="
+          "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==",
+          "dev": true
         }
       }
     },
@@ -1970,6 +1926,7 @@
       "version": "1.1.7",
       "resolved": "https://registry.npmjs.org/hash.js/-/hash.js-1.1.7.tgz",
       "integrity": "sha512-taOaskGt4z4SOANNseOviYDvjEJinIkRgmp7LbKP2YTTmVxWBl87s/uzK9r+44BclBSp2X7K1hqeNfz9JbBeXA==",
+      "dev": true,
       "requires": {
         "inherits": "^2.0.3",
         "minimalistic-assert": "^1.0.1"
@@ -1979,6 +1936,7 @@
       "version": "1.0.1",
       "resolved": "https://registry.npmjs.org/hmac-drbg/-/hmac-drbg-1.0.1.tgz",
       "integrity": "sha1-0nRXAQJabHdabFRXk+1QL8DGSaE=",
+      "dev": true,
       "requires": {
         "hash.js": "^1.0.3",
         "minimalistic-assert": "^1.0.0",
@@ -2030,7 +1988,8 @@
     "ieee754": {
       "version": "1.2.1",
       "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz",
-      "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA=="
+      "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==",
+      "dev": true
     },
     "ignore": {
       "version": "4.0.6",
@@ -2137,7 +2096,8 @@
     "inherits": {
       "version": "2.0.4",
       "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz",
-      "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ=="
+      "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==",
+      "dev": true
     },
     "interpret": {
       "version": "2.2.0",
@@ -2155,6 +2115,7 @@
       "version": "1.1.0",
       "resolved": "https://registry.npmjs.org/is-arguments/-/is-arguments-1.1.0.tgz",
       "integrity": "sha512-1Ij4lOMPl/xB5kBDn7I+b2ttPMKa8szhEIrXDuXQD/oe3HJLTLhqhgGspwgyGd6MOywBUqVvYicF72lkgDnIHg==",
+      "dev": true,
       "requires": {
         "call-bind": "^1.0.0"
       }
@@ -2168,7 +2129,8 @@
     "is-callable": {
       "version": "1.2.3",
       "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.3.tgz",
-      "integrity": "sha512-J1DcMe8UYTBSrKezuIUTUwjXsho29693unXM2YhJUTR2txK/eG47bvNa/wipPFmZFgr/N6f1GA66dv0mEyTIyQ=="
+      "integrity": "sha512-J1DcMe8UYTBSrKezuIUTUwjXsho29693unXM2YhJUTR2txK/eG47bvNa/wipPFmZFgr/N6f1GA66dv0mEyTIyQ==",
+      "dev": true
     },
     "is-core-module": {
       "version": "2.2.0",
@@ -2182,7 +2144,8 @@
     "is-date-object": {
       "version": "1.0.2",
       "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.2.tgz",
-      "integrity": "sha512-USlDT524woQ08aoZFzh3/Z6ch9Y/EWXEHQ/AaRN0SkKq4t2Jw2R2339tSXmwuVoY7LLlBCbOIlx2myP/L5zk0g=="
+      "integrity": "sha512-USlDT524woQ08aoZFzh3/Z6ch9Y/EWXEHQ/AaRN0SkKq4t2Jw2R2339tSXmwuVoY7LLlBCbOIlx2myP/L5zk0g==",
+      "dev": true
     },
     "is-extglob": {
       "version": "2.1.1",
@@ -2199,7 +2162,8 @@
     "is-generator-function": {
       "version": "1.0.8",
       "resolved": "https://registry.npmjs.org/is-generator-function/-/is-generator-function-1.0.8.tgz",
-      "integrity": "sha512-2Omr/twNtufVZFr1GhxjOMFPAj2sjc/dKaIqBhvo4qciXfJmITGH6ZGd8eZYNHza8t1y0e01AuqRhJwfWp26WQ=="
+      "integrity": "sha512-2Omr/twNtufVZFr1GhxjOMFPAj2sjc/dKaIqBhvo4qciXfJmITGH6ZGd8eZYNHza8t1y0e01AuqRhJwfWp26WQ==",
+      "dev": true
     },
     "is-glob": {
       "version": "4.0.1",
@@ -2210,19 +2174,11 @@
         "is-extglob": "^2.1.1"
       }
     },
-    "is-nan": {
-      "version": "1.3.2",
-      "resolved": "https://registry.npmjs.org/is-nan/-/is-nan-1.3.2.tgz",
-      "integrity": "sha512-E+zBKpQ2t6MEo1VsonYmluk9NxGrbzpeeLC2xIViuO2EjU2xsXsBPwTr3Ykv9l08UYEVEdWeRZNouaZqF6RN0w==",
-      "requires": {
-        "call-bind": "^1.0.0",
-        "define-properties": "^1.1.3"
-      }
-    },
     "is-negative-zero": {
       "version": "2.0.1",
       "resolved": "https://registry.npmjs.org/is-negative-zero/-/is-negative-zero-2.0.1.tgz",
-      "integrity": "sha512-2z6JzQvZRa9A2Y7xC6dQQm4FSTSTNWjKIYYTt4246eMTJmIo0Q+ZyOsU66X8lxK1AbB92dFeglPLrhwpeRKO6w=="
+      "integrity": "sha512-2z6JzQvZRa9A2Y7xC6dQQm4FSTSTNWjKIYYTt4246eMTJmIo0Q+ZyOsU66X8lxK1AbB92dFeglPLrhwpeRKO6w==",
+      "dev": true
     },
     "is-plain-object": {
       "version": "2.0.4",
@@ -2237,6 +2193,7 @@
       "version": "1.1.2",
       "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.1.2.tgz",
       "integrity": "sha512-axvdhb5pdhEVThqJzYXwMlVuZwC+FF2DpcOhTS+y/8jVq4trxyPgfcwIxIKiyeuLlSQYKkmUaPQJ8ZE4yNKXDg==",
+      "dev": true,
       "requires": {
         "call-bind": "^1.0.2",
         "has-symbols": "^1.0.1"
@@ -2258,6 +2215,7 @@
       "version": "1.0.3",
       "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.3.tgz",
       "integrity": "sha512-OwijhaRSgqvhm/0ZdAcXNZt9lYdKFpcRDT5ULUuYXPoT794UNOdU+gpT6Rzo7b4V2HUl/op6GqY894AZwv9faQ==",
+      "dev": true,
       "requires": {
         "has-symbols": "^1.0.1"
       }
@@ -2266,6 +2224,7 @@
       "version": "1.1.4",
       "resolved": "https://registry.npmjs.org/is-typed-array/-/is-typed-array-1.1.4.tgz",
       "integrity": "sha512-ILaRgn4zaSrVNXNGtON6iFNotXW3hAPF3+0fB1usg2jFlWqo5fEDdmJkz0zBfoi7Dgskr8Khi2xZ8cXqZEfXNA==",
+      "dev": true,
       "requires": {
         "available-typed-arrays": "^1.0.2",
         "call-bind": "^1.0.0",
@@ -2321,12 +2280,9 @@
       }
     },
     "jose": {
-      "version": "2.0.5",
-      "resolved": "https://registry.npmjs.org/jose/-/jose-2.0.5.tgz",
-      "integrity": "sha512-BAiDNeDKTMgk4tvD0BbxJ8xHEHBZgpeRZ1zGPPsitSyMgjoMWiLGYAE7H7NpP5h0lPppQajQs871E8NHUrzVPA==",
-      "requires": {
-        "@panva/asn1.js": "^1.0.0"
-      }
+      "version": "3.13.0",
+      "resolved": "https://registry.npmjs.org/jose/-/jose-3.13.0.tgz",
+      "integrity": "sha512-tTZayOvpOX8y/W7FuCL6Sma9sElbA80ImDck86a6ge70lyBpQngx557PtP9Aro4SLEOPtZVVxM1P/boPzy+m7A=="
     },
     "js-tokens": {
       "version": "4.0.0",
@@ -2368,42 +2324,6 @@
       "integrity": "sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE=",
       "dev": true
     },
-    "jsonwebtoken": {
-      "version": "8.5.1",
-      "resolved": "https://registry.npmjs.org/jsonwebtoken/-/jsonwebtoken-8.5.1.tgz",
-      "integrity": "sha512-XjwVfRS6jTMsqYs0EsuJ4LGxXV14zQybNd4L2r0UvbVnSF9Af8x7p5MzbJ90Ioz/9TI41/hTCvznF/loiSzn8w==",
-      "requires": {
-        "jws": "^3.2.2",
-        "lodash.includes": "^4.3.0",
-        "lodash.isboolean": "^3.0.3",
-        "lodash.isinteger": "^4.0.4",
-        "lodash.isnumber": "^3.0.3",
-        "lodash.isplainobject": "^4.0.6",
-        "lodash.isstring": "^4.0.1",
-        "lodash.once": "^4.0.0",
-        "ms": "^2.1.1",
-        "semver": "^5.6.0"
-      }
-    },
-    "jwa": {
-      "version": "1.4.1",
-      "resolved": "https://registry.npmjs.org/jwa/-/jwa-1.4.1.tgz",
-      "integrity": "sha512-qiLX/xhEEFKUAJ6FiBMbes3w9ATzyk5W7Hvzpa/SLYdxNtng+gcurvrI7TbACjIXlsJyr05/S1oUhZrc63evQA==",
-      "requires": {
-        "buffer-equal-constant-time": "1.0.1",
-        "ecdsa-sig-formatter": "1.0.11",
-        "safe-buffer": "^5.0.1"
-      }
-    },
-    "jws": {
-      "version": "3.2.2",
-      "resolved": "https://registry.npmjs.org/jws/-/jws-3.2.2.tgz",
-      "integrity": "sha512-YHlZCB6lMTllWDtSPHz/ZXTsi8S00usEV6v1tjq8tOUZzw7DpSDWVXjXDre6ed1w/pd495ODpHZYSdkRTsa0HA==",
-      "requires": {
-        "jwa": "^1.4.1",
-        "safe-buffer": "^5.0.1"
-      }
-    },
     "kind-of": {
       "version": "6.0.3",
       "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz",
@@ -2459,53 +2379,14 @@
     "lodash": {
       "version": "4.17.21",
       "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz",
-      "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg=="
+      "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==",
+      "dev": true
     },
     "lodash.clonedeep": {
       "version": "4.5.0",
       "resolved": "https://registry.npmjs.org/lodash.clonedeep/-/lodash.clonedeep-4.5.0.tgz",
       "integrity": "sha1-4j8/nE+Pvd6HJSnBBxhXoIblzO8="
     },
-    "lodash.includes": {
-      "version": "4.3.0",
-      "resolved": "https://registry.npmjs.org/lodash.includes/-/lodash.includes-4.3.0.tgz",
-      "integrity": "sha1-YLuYqHy5I8aMoeUTJUgzFISfVT8="
-    },
-    "lodash.isboolean": {
-      "version": "3.0.3",
-      "resolved": "https://registry.npmjs.org/lodash.isboolean/-/lodash.isboolean-3.0.3.tgz",
-      "integrity": "sha1-bC4XHbKiV82WgC/UOwGyDV9YcPY="
-    },
-    "lodash.isinteger": {
-      "version": "4.0.4",
-      "resolved": "https://registry.npmjs.org/lodash.isinteger/-/lodash.isinteger-4.0.4.tgz",
-      "integrity": "sha1-YZwK89A/iwTDH1iChAt3sRzWg0M="
-    },
-    "lodash.isnumber": {
-      "version": "3.0.3",
-      "resolved": "https://registry.npmjs.org/lodash.isnumber/-/lodash.isnumber-3.0.3.tgz",
-      "integrity": "sha1-POdoEMWSjQM1IwGsKHMX8RwLH/w="
-    },
-    "lodash.isplainobject": {
-      "version": "4.0.6",
-      "resolved": "https://registry.npmjs.org/lodash.isplainobject/-/lodash.isplainobject-4.0.6.tgz",
-      "integrity": "sha1-fFJqUtibRcRcxpC4gWO+BJf1UMs="
-    },
-    "lodash.isstring": {
-      "version": "4.0.1",
-      "resolved": "https://registry.npmjs.org/lodash.isstring/-/lodash.isstring-4.0.1.tgz",
-      "integrity": "sha1-1SfftUVuynzJu5XV2ur4i6VKVFE="
-    },
-    "lodash.once": {
-      "version": "4.1.1",
-      "resolved": "https://registry.npmjs.org/lodash.once/-/lodash.once-4.1.1.tgz",
-      "integrity": "sha1-DdOXEhPHxW34gJd9UEyI+0cal6w="
-    },
-    "long": {
-      "version": "4.0.0",
-      "resolved": "https://registry.npmjs.org/long/-/long-4.0.0.tgz",
-      "integrity": "sha512-XsP+KhQif4bjX1kbuSiySJFNAehNxgLb6hPRGJ9QsUr8ajHkuXGdrHmFUTUUXhDwVX2R5bY4JNZEwbUiMhV+MA=="
-    },
     "lru-cache": {
       "version": "6.0.0",
       "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz",
@@ -2519,6 +2400,7 @@
       "version": "1.3.5",
       "resolved": "https://registry.npmjs.org/md5.js/-/md5.js-1.3.5.tgz",
       "integrity": "sha512-xitP+WxNPcTTOgnTJcrhM0xvdPepipPSf3I8EIpGKeFLjt3PlJLIDG3u8EX53ZIubkb+5U2+3rELYpEhHhzdkg==",
+      "dev": true,
       "requires": {
         "hash-base": "^3.0.0",
         "inherits": "^2.0.1",
@@ -2553,6 +2435,7 @@
       "version": "4.0.1",
       "resolved": "https://registry.npmjs.org/miller-rabin/-/miller-rabin-4.0.1.tgz",
       "integrity": "sha512-115fLhvZVqWwHPbClyntxEVfVDfl9DLLTuJvq3g2O/Oxi8AiNouAHvDSzHS0viUJc+V5vm3eq91Xwqn9dp4jRA==",
+      "dev": true,
       "requires": {
         "bn.js": "^4.0.0",
         "brorand": "^1.0.1"
@@ -2561,7 +2444,8 @@
         "bn.js": {
           "version": "4.11.9",
           "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.9.tgz",
-          "integrity": "sha512-E6QoYqCKZfgatHTdHzs1RRKP7ip4vvm+EyRUeE2RF0NblwVvb0p6jSVeNTOFxPn26QXN2o6SMfNxKp6kU8zQaw=="
+          "integrity": "sha512-E6QoYqCKZfgatHTdHzs1RRKP7ip4vvm+EyRUeE2RF0NblwVvb0p6jSVeNTOFxPn26QXN2o6SMfNxKp6kU8zQaw==",
+          "dev": true
         }
       }
     },
@@ -2595,12 +2479,14 @@
     "minimalistic-assert": {
       "version": "1.0.1",
       "resolved": "https://registry.npmjs.org/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz",
-      "integrity": "sha512-UtJcAD4yEaGtjPezWuO9wC4nwUnVH/8/Im3yEHQP4b67cXlD/Qr9hdITCU1xDbSEXg2XKNaP8jsReV7vQd00/A=="
+      "integrity": "sha512-UtJcAD4yEaGtjPezWuO9wC4nwUnVH/8/Im3yEHQP4b67cXlD/Qr9hdITCU1xDbSEXg2XKNaP8jsReV7vQd00/A==",
+      "dev": true
     },
     "minimalistic-crypto-utils": {
       "version": "1.0.1",
       "resolved": "https://registry.npmjs.org/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz",
-      "integrity": "sha1-9sAMHAsIIkblxNmd+4x8CDsrWCo="
+      "integrity": "sha1-9sAMHAsIIkblxNmd+4x8CDsrWCo=",
+      "dev": true
     },
     "minimatch": {
       "version": "3.0.4",
@@ -2620,7 +2506,8 @@
     "ms": {
       "version": "2.1.2",
       "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz",
-      "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w=="
+      "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==",
+      "dev": true
     },
     "natural-compare": {
       "version": "1.4.0",
@@ -2645,43 +2532,6 @@
       "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.1.tgz",
       "integrity": "sha512-V4aYg89jEoVRxRb2fJdAg8FHvI7cEyYdVAh94HH0UIK8oJxUfkjlDQN9RbMx+bEjP7+ggMiFRprSti032Oipxw=="
     },
-    "node-forge": {
-      "version": "0.10.0",
-      "resolved": "https://registry.npmjs.org/node-forge/-/node-forge-0.10.0.tgz",
-      "integrity": "sha512-PPmu8eEeG9saEUvI97fm4OYxXVB6bFvyNTyiUOBichBpFG8A1Ljw3bY62+5oOjDEMHRnd0Y7HQ+x7uzxOzC6JA=="
-    },
-    "node-jose": {
-      "version": "2.0.0",
-      "resolved": "https://registry.npmjs.org/node-jose/-/node-jose-2.0.0.tgz",
-      "integrity": "sha512-j8zoFze1gijl8+DK/dSXXqX7+o2lMYv1XS+ptnXgGV/eloQaqq1YjNtieepbKs9jBS4WTnMOqyKSaQuunJzx0A==",
-      "requires": {
-        "base64url": "^3.0.1",
-        "buffer": "^5.5.0",
-        "es6-promise": "^4.2.8",
-        "lodash": "^4.17.15",
-        "long": "^4.0.0",
-        "node-forge": "^0.10.0",
-        "pako": "^1.0.11",
-        "process": "^0.11.10",
-        "uuid": "^3.3.3"
-      },
-      "dependencies": {
-        "buffer": {
-          "version": "5.7.1",
-          "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.7.1.tgz",
-          "integrity": "sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==",
-          "requires": {
-            "base64-js": "^1.3.1",
-            "ieee754": "^1.1.13"
-          }
-        },
-        "uuid": {
-          "version": "3.4.0",
-          "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.4.0.tgz",
-          "integrity": "sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A=="
-        }
-      }
-    },
     "node-releases": {
       "version": "1.1.73",
       "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-1.1.73.tgz",
@@ -2712,26 +2562,20 @@
     "object-inspect": {
       "version": "1.9.0",
       "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.9.0.tgz",
-      "integrity": "sha512-i3Bp9iTqwhaLZBxGkRfo5ZbE07BQRT7MGu8+nNgwW9ItGp1TzCTw2DLEoWwjClxBjOFI/hWljTAmYGCEwmtnOw=="
-    },
-    "object-is": {
-      "version": "1.1.5",
-      "resolved": "https://registry.npmjs.org/object-is/-/object-is-1.1.5.tgz",
-      "integrity": "sha512-3cyDsyHgtmi7I7DfSSI2LDp6SK2lwvtbg0p0R1e0RvTqF5ceGx+K2dfSjm1bKDMVCFEDAQvy+o8c6a7VujOddw==",
-      "requires": {
-        "call-bind": "^1.0.2",
-        "define-properties": "^1.1.3"
-      }
+      "integrity": "sha512-i3Bp9iTqwhaLZBxGkRfo5ZbE07BQRT7MGu8+nNgwW9ItGp1TzCTw2DLEoWwjClxBjOFI/hWljTAmYGCEwmtnOw==",
+      "dev": true
     },
     "object-keys": {
       "version": "1.1.1",
       "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz",
-      "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA=="
+      "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==",
+      "dev": true
     },
     "object.assign": {
       "version": "4.1.2",
       "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.2.tgz",
       "integrity": "sha512-ixT2L5THXsApyiUPYKmW+2EHpXXe5Ii3M+f4e+aJFAHao5amFRW6J0OO6c/LU8Be47utCx2GL89hxGB6XSmKuQ==",
+      "dev": true,
       "requires": {
         "call-bind": "^1.0.0",
         "define-properties": "^1.1.3",
@@ -2816,11 +2660,6 @@
         "word-wrap": "^1.2.3"
       }
     },
-    "os-browserify": {
-      "version": "0.3.0",
-      "resolved": "https://registry.npmjs.org/os-browserify/-/os-browserify-0.3.0.tgz",
-      "integrity": "sha1-hUNzx/XCMVkU/Jv8a9gjj92h7Cc="
-    },
     "p-limit": {
       "version": "1.3.0",
       "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-1.3.0.tgz",
@@ -2845,11 +2684,6 @@
       "integrity": "sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M=",
       "dev": true
     },
-    "pako": {
-      "version": "1.0.11",
-      "resolved": "https://registry.npmjs.org/pako/-/pako-1.0.11.tgz",
-      "integrity": "sha512-4hLB8Py4zZce5s4yd9XzopqwVv/yGNhV1Bl8NTmCq1763HeK2+EwVTv+leGeL13Dnh2wfbqowVPXCIO0z4taYw=="
-    },
     "parent-module": {
       "version": "1.0.1",
       "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz",
@@ -2863,6 +2697,7 @@
       "version": "5.1.6",
       "resolved": "https://registry.npmjs.org/parse-asn1/-/parse-asn1-5.1.6.tgz",
       "integrity": "sha512-RnZRo1EPU6JBnra2vGHj0yhp6ebyjBZpmUCLHWiFhxlzvBCCpAuZ7elsBp1PVAbQN0/04VD/19rfzlBSwLstMw==",
+      "dev": true,
       "requires": {
         "asn1.js": "^5.2.0",
         "browserify-aes": "^1.0.0",
@@ -2937,6 +2772,7 @@
       "version": "3.1.1",
       "resolved": "https://registry.npmjs.org/pbkdf2/-/pbkdf2-3.1.1.tgz",
       "integrity": "sha512-4Ejy1OPxi9f2tt1rRV7Go7zmfDQ+ZectEQz3VGUQhgq62HtIRPDyG/JtnwIxs6x3uNMwo2V7q1fMvKjb+Tnpqg==",
+      "dev": true,
       "requires": {
         "create-hash": "^1.1.2",
         "create-hmac": "^1.1.4",
@@ -2960,11 +2796,6 @@
       "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==",
       "dev": true
     },
-    "process": {
-      "version": "0.11.10",
-      "resolved": "https://registry.npmjs.org/process/-/process-0.11.10.tgz",
-      "integrity": "sha1-czIwDoQBYb2j5podHZGn1LwW8YI="
-    },
     "progress": {
       "version": "2.0.3",
       "resolved": "https://registry.npmjs.org/progress/-/progress-2.0.3.tgz",
@@ -2985,6 +2816,7 @@
       "version": "4.0.3",
       "resolved": "https://registry.npmjs.org/public-encrypt/-/public-encrypt-4.0.3.tgz",
       "integrity": "sha512-zVpa8oKZSz5bTMTFClc1fQOnyyEzpl5ozpi1B5YcvBrdohMjH2rfsBtyXcuNuwjsDIXmBYlF2N5FlJYhR29t8Q==",
+      "dev": true,
       "requires": {
         "bn.js": "^4.1.0",
         "browserify-rsa": "^4.0.0",
@@ -2997,7 +2829,8 @@
         "bn.js": {
           "version": "4.11.9",
           "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.9.tgz",
-          "integrity": "sha512-E6QoYqCKZfgatHTdHzs1RRKP7ip4vvm+EyRUeE2RF0NblwVvb0p6jSVeNTOFxPn26QXN2o6SMfNxKp6kU8zQaw=="
+          "integrity": "sha512-E6QoYqCKZfgatHTdHzs1RRKP7ip4vvm+EyRUeE2RF0NblwVvb0p6jSVeNTOFxPn26QXN2o6SMfNxKp6kU8zQaw==",
+          "dev": true
         }
       }
     },
@@ -3025,6 +2858,7 @@
       "version": "1.0.4",
       "resolved": "https://registry.npmjs.org/randomfill/-/randomfill-1.0.4.tgz",
       "integrity": "sha512-87lcbR8+MhcWcUiQ+9e+Rwx8MyR2P7qnt15ynUlbm3TU/fjbgz4GsvfSUDTemtCCtVCqb4ZcEFlyPNTh9bBTLw==",
+      "dev": true,
       "requires": {
         "randombytes": "^2.0.5",
         "safe-buffer": "^5.1.0"
@@ -3141,6 +2975,7 @@
       "version": "2.0.2",
       "resolved": "https://registry.npmjs.org/ripemd160/-/ripemd160-2.0.2.tgz",
       "integrity": "sha512-ii4iagi25WusVoiC4B4lq7pbXfAp3D9v5CwfkY33vffw2+pkDjY1D8GaN7spsxvCSx8dkPqOZCEZyfxcmJG2IA==",
+      "dev": true,
       "requires": {
         "hash-base": "^3.0.0",
         "inherits": "^2.0.1"
@@ -3154,7 +2989,8 @@
     "safer-buffer": {
       "version": "2.1.2",
       "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz",
-      "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg=="
+      "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==",
+      "dev": true
     },
     "schema-utils": {
       "version": "3.0.0",
@@ -3170,7 +3006,8 @@
     "semver": {
       "version": "5.7.1",
       "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz",
-      "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ=="
+      "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==",
+      "dev": true
     },
     "send": {
       "version": "0.17.1",
@@ -3248,6 +3085,7 @@
       "version": "2.4.11",
       "resolved": "https://registry.npmjs.org/sha.js/-/sha.js-2.4.11.tgz",
       "integrity": "sha512-QMEp5B7cftE7APOjk5Y6xgrbWu+WkLVQwk8JNjZ8nKRciZaByEW6MubieAiToS7+dwvrjGhH8jRXz3MVd0AYqQ==",
+      "dev": true,
       "requires": {
         "inherits": "^2.0.1",
         "safe-buffer": "^5.0.1"
@@ -3398,6 +3236,7 @@
       "version": "3.0.0",
       "resolved": "https://registry.npmjs.org/stream-browserify/-/stream-browserify-3.0.0.tgz",
       "integrity": "sha512-H73RAHsVBapbim0tU2JwwOiXUj+fikfiaoYAKHF3VJfA0pe2BCzkhAHBlLG6REzE+2WNZcxOXjK7lkso+9euLA==",
+      "dev": true,
       "requires": {
         "inherits": "~2.0.4",
         "readable-stream": "^3.5.0"
@@ -3407,6 +3246,7 @@
           "version": "3.6.0",
           "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz",
           "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==",
+          "dev": true,
           "requires": {
             "inherits": "^2.0.3",
             "string_decoder": "^1.1.1",
@@ -3430,6 +3270,7 @@
       "version": "1.0.3",
       "resolved": "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.3.tgz",
       "integrity": "sha512-ayH0pB+uf0U28CtjlLvL7NaohvR1amUvVZk+y3DYb0Ey2PUV5zPkkKy9+U1ndVEIXO8hNg18eIv9Jntbii+dKw==",
+      "dev": true,
       "requires": {
         "call-bind": "^1.0.0",
         "define-properties": "^1.1.3"
@@ -3439,6 +3280,7 @@
       "version": "1.0.3",
       "resolved": "https://registry.npmjs.org/string.prototype.trimstart/-/string.prototype.trimstart-1.0.3.tgz",
       "integrity": "sha512-oBIBUy5lea5tt0ovtOFiEQaBkoBBkyJhZXzJYrSmDo5IUUqbOPvVezuRs/agBIdZ2p2Eo1FD6bD9USyBLfl3xg==",
+      "dev": true,
       "requires": {
         "call-bind": "^1.0.0",
         "define-properties": "^1.1.3"
@@ -3448,6 +3290,7 @@
       "version": "1.1.1",
       "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz",
       "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==",
+      "dev": true,
       "requires": {
         "safe-buffer": "~5.1.0"
       }
@@ -3635,15 +3478,8 @@
     "tslib": {
       "version": "1.14.1",
       "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz",
-      "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg=="
-    },
-    "tsyringe": {
-      "version": "4.5.0",
-      "resolved": "https://registry.npmjs.org/tsyringe/-/tsyringe-4.5.0.tgz",
-      "integrity": "sha512-XvYgdUxkmGQfpCkKyr/ybJx71OLSnNec1SO0xdohMjaS2UOEyKi76YfKx92XUXgc1TocypHENg6y4wCyYyMKag==",
-      "requires": {
-        "tslib": "^1.9.3"
-      }
+      "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==",
+      "dev": true
     },
     "type-check": {
       "version": "0.4.0",
@@ -3689,6 +3525,7 @@
       "version": "0.12.3",
       "resolved": "https://registry.npmjs.org/util/-/util-0.12.3.tgz",
       "integrity": "sha512-I8XkoQwE+fPQEhy9v012V+TSdH2kp9ts29i20TaaDUXsg7x/onePbhFJUExBfv/2ay1ZOp/Vsm3nDlmnFGSAog==",
+      "dev": true,
       "requires": {
         "inherits": "^2.0.3",
         "is-arguments": "^1.0.4",
@@ -3701,7 +3538,8 @@
     "util-deprecate": {
       "version": "1.0.2",
       "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz",
-      "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8="
+      "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=",
+      "dev": true
     },
     "utils-merge": {
       "version": "1.0.1",
@@ -3848,6 +3686,7 @@
       "version": "1.1.4",
       "resolved": "https://registry.npmjs.org/which-typed-array/-/which-typed-array-1.1.4.tgz",
       "integrity": "sha512-49E0SpUe90cjpoc7BOJwyPHRqSAd12c10Qm2amdEZrJPCY2NDxaW01zHITrem+rnETY3dwrbH3UUrUwagfCYDA==",
+      "dev": true,
       "requires": {
         "available-typed-arrays": "^1.0.2",
         "call-bind": "^1.0.0",
diff --git a/package.json b/package.json
index 1ff5ab9d24594239fc0d680871c4f0a52871adca..b4dd8bbc2d5707f527ca59216bf6e5e04cc3c734 100644
--- a/package.json
+++ b/package.json
@@ -55,7 +55,7 @@
     "access": "public"
   },
   "dependencies": {
-    "@inrupt/solid-client-authn-browser": "^1.8.2",
+    "@inrupt/solid-client-authn-browser": "^1.9.1",
     "@startinblox/core": "^0.15.6",
     "reflect-metadata": "^0.1.13"
   },