require('./sourcemap-register.js');(()=>{var Ae={7351:function(Ae,Se,Ce){"use strict";var qe=this&&this.__createBinding||(Object.create?function(Ae,Se,Ce,qe){if(qe===undefined)qe=Ce;Object.defineProperty(Ae,qe,{enumerable:true,get:function(){return Se[Ce]}})}:function(Ae,Se,Ce,qe){if(qe===undefined)qe=Ce;Ae[qe]=Se[Ce]});var Fe=this&&this.__setModuleDefault||(Object.create?function(Ae,Se){Object.defineProperty(Ae,"default",{enumerable:true,value:Se})}:function(Ae,Se){Ae["default"]=Se});var $e=this&&this.__importStar||function(Ae){if(Ae&&Ae.__esModule)return Ae;var Se={};if(Ae!=null)for(var Ce in Ae)if(Ce!=="default"&&Object.hasOwnProperty.call(Ae,Ce))qe(Se,Ae,Ce);Fe(Se,Ae);return Se};Object.defineProperty(Se,"__esModule",{value:true});Se.issue=Se.issueCommand=void 0;const rt=$e(Ce(2037));const it=Ce(5278);function issueCommand(Ae,Se,Ce){const qe=new Command(Ae,Se,Ce);process.stdout.write(qe.toString()+rt.EOL)}Se.issueCommand=issueCommand;function issue(Ae,Se=""){issueCommand(Ae,{},Se)}Se.issue=issue;const nt="::";class Command{constructor(Ae,Se,Ce){if(!Ae){Ae="missing.command"}this.command=Ae;this.properties=Se;this.message=Ce}toString(){let Ae=nt+this.command;if(this.properties&&Object.keys(this.properties).length>0){Ae+=" ";let Se=true;for(const Ce in this.properties){if(this.properties.hasOwnProperty(Ce)){const qe=this.properties[Ce];if(qe){if(Se){Se=false}else{Ae+=","}Ae+=`${Ce}=${escapeProperty(qe)}`}}}}Ae+=`${nt}${escapeData(this.message)}`;return Ae}}function escapeData(Ae){return it.toCommandValue(Ae).replace(/%/g,"%25").replace(/\r/g,"%0D").replace(/\n/g,"%0A")}function escapeProperty(Ae){return it.toCommandValue(Ae).replace(/%/g,"%25").replace(/\r/g,"%0D").replace(/\n/g,"%0A").replace(/:/g,"%3A").replace(/,/g,"%2C")}},2186:function(Ae,Se,Ce){"use strict";var qe=this&&this.__createBinding||(Object.create?function(Ae,Se,Ce,qe){if(qe===undefined)qe=Ce;Object.defineProperty(Ae,qe,{enumerable:true,get:function(){return Se[Ce]}})}:function(Ae,Se,Ce,qe){if(qe===undefined)qe=Ce;Ae[qe]=Se[Ce]});var Fe=this&&this.__setModuleDefault||(Object.create?function(Ae,Se){Object.defineProperty(Ae,"default",{enumerable:true,value:Se})}:function(Ae,Se){Ae["default"]=Se});var $e=this&&this.__importStar||function(Ae){if(Ae&&Ae.__esModule)return Ae;var Se={};if(Ae!=null)for(var Ce in Ae)if(Ce!=="default"&&Object.hasOwnProperty.call(Ae,Ce))qe(Se,Ae,Ce);Fe(Se,Ae);return Se};var rt=this&&this.__awaiter||function(Ae,Se,Ce,qe){function adopt(Ae){return Ae instanceof Ce?Ae:new Ce((function(Se){Se(Ae)}))}return new(Ce||(Ce=Promise))((function(Ce,Fe){function fulfilled(Ae){try{step(qe.next(Ae))}catch(Ae){Fe(Ae)}}function rejected(Ae){try{step(qe["throw"](Ae))}catch(Ae){Fe(Ae)}}function step(Ae){Ae.done?Ce(Ae.value):adopt(Ae.value).then(fulfilled,rejected)}step((qe=qe.apply(Ae,Se||[])).next())}))};Object.defineProperty(Se,"__esModule",{value:true});Se.getIDToken=Se.getState=Se.saveState=Se.group=Se.endGroup=Se.startGroup=Se.info=Se.notice=Se.warning=Se.error=Se.debug=Se.isDebug=Se.setFailed=Se.setCommandEcho=Se.setOutput=Se.getBooleanInput=Se.getMultilineInput=Se.getInput=Se.addPath=Se.setSecret=Se.exportVariable=Se.ExitCode=void 0;const it=Ce(7351);const nt=Ce(717);const st=Ce(5278);const ut=$e(Ce(2037));const ht=$e(Ce(1017));const ft=Ce(8041);var yt;(function(Ae){Ae[Ae["Success"]=0]="Success";Ae[Ae["Failure"]=1]="Failure"})(yt=Se.ExitCode||(Se.ExitCode={}));function exportVariable(Ae,Se){const Ce=st.toCommandValue(Se);process.env[Ae]=Ce;const qe=process.env["GITHUB_ENV"]||"";if(qe){return nt.issueFileCommand("ENV",nt.prepareKeyValueMessage(Ae,Se))}it.issueCommand("set-env",{name:Ae},Ce)}Se.exportVariable=exportVariable;function setSecret(Ae){it.issueCommand("add-mask",{},Ae)}Se.setSecret=setSecret;function addPath(Ae){const Se=process.env["GITHUB_PATH"]||"";if(Se){nt.issueFileCommand("PATH",Ae)}else{it.issueCommand("add-path",{},Ae)}process.env["PATH"]=`${Ae}${ht.delimiter}${process.env["PATH"]}`}Se.addPath=addPath;function getInput(Ae,Se){const Ce=process.env[`INPUT_${Ae.replace(/ /g,"_").toUpperCase()}`]||"";if(Se&&Se.required&&!Ce){throw new Error(`Input required and not supplied: ${Ae}`)}if(Se&&Se.trimWhitespace===false){return Ce}return Ce.trim()}Se.getInput=getInput;function getMultilineInput(Ae,Se){const Ce=getInput(Ae,Se).split("\n").filter((Ae=>Ae!==""));if(Se&&Se.trimWhitespace===false){return Ce}return Ce.map((Ae=>Ae.trim()))}Se.getMultilineInput=getMultilineInput;function getBooleanInput(Ae,Se){const Ce=["true","True","TRUE"];const qe=["false","False","FALSE"];const Fe=getInput(Ae,Se);if(Ce.includes(Fe))return true;if(qe.includes(Fe))return false;throw new TypeError(`Input does not meet YAML 1.2 "Core Schema" specification: ${Ae}\n`+`Support boolean input list: \`true | True | TRUE | false | False | FALSE\``)}Se.getBooleanInput=getBooleanInput;function setOutput(Ae,Se){const Ce=process.env["GITHUB_OUTPUT"]||"";if(Ce){return nt.issueFileCommand("OUTPUT",nt.prepareKeyValueMessage(Ae,Se))}process.stdout.write(ut.EOL);it.issueCommand("set-output",{name:Ae},st.toCommandValue(Se))}Se.setOutput=setOutput;function setCommandEcho(Ae){it.issue("echo",Ae?"on":"off")}Se.setCommandEcho=setCommandEcho;function setFailed(Ae){process.exitCode=yt.Failure;error(Ae)}Se.setFailed=setFailed;function isDebug(){return process.env["RUNNER_DEBUG"]==="1"}Se.isDebug=isDebug;function debug(Ae){it.issueCommand("debug",{},Ae)}Se.debug=debug;function error(Ae,Se={}){it.issueCommand("error",st.toCommandProperties(Se),Ae instanceof Error?Ae.toString():Ae)}Se.error=error;function warning(Ae,Se={}){it.issueCommand("warning",st.toCommandProperties(Se),Ae instanceof Error?Ae.toString():Ae)}Se.warning=warning;function notice(Ae,Se={}){it.issueCommand("notice",st.toCommandProperties(Se),Ae instanceof Error?Ae.toString():Ae)}Se.notice=notice;function info(Ae){process.stdout.write(Ae+ut.EOL)}Se.info=info;function startGroup(Ae){it.issue("group",Ae)}Se.startGroup=startGroup;function endGroup(){it.issue("endgroup")}Se.endGroup=endGroup;function group(Ae,Se){return rt(this,void 0,void 0,(function*(){startGroup(Ae);let Ce;try{Ce=yield Se()}finally{endGroup()}return Ce}))}Se.group=group;function saveState(Ae,Se){const Ce=process.env["GITHUB_STATE"]||"";if(Ce){return nt.issueFileCommand("STATE",nt.prepareKeyValueMessage(Ae,Se))}it.issueCommand("save-state",{name:Ae},st.toCommandValue(Se))}Se.saveState=saveState;function getState(Ae){return process.env[`STATE_${Ae}`]||""}Se.getState=getState;function getIDToken(Ae){return rt(this,void 0,void 0,(function*(){return yield ft.OidcClient.getIDToken(Ae)}))}Se.getIDToken=getIDToken;var vt=Ce(1327);Object.defineProperty(Se,"summary",{enumerable:true,get:function(){return vt.summary}});var _t=Ce(1327);Object.defineProperty(Se,"markdownSummary",{enumerable:true,get:function(){return _t.markdownSummary}});var Ct=Ce(2981);Object.defineProperty(Se,"toPosixPath",{enumerable:true,get:function(){return Ct.toPosixPath}});Object.defineProperty(Se,"toWin32Path",{enumerable:true,get:function(){return Ct.toWin32Path}});Object.defineProperty(Se,"toPlatformPath",{enumerable:true,get:function(){return Ct.toPlatformPath}})},717:function(Ae,Se,Ce){"use strict";var qe=this&&this.__createBinding||(Object.create?function(Ae,Se,Ce,qe){if(qe===undefined)qe=Ce;Object.defineProperty(Ae,qe,{enumerable:true,get:function(){return Se[Ce]}})}:function(Ae,Se,Ce,qe){if(qe===undefined)qe=Ce;Ae[qe]=Se[Ce]});var Fe=this&&this.__setModuleDefault||(Object.create?function(Ae,Se){Object.defineProperty(Ae,"default",{enumerable:true,value:Se})}:function(Ae,Se){Ae["default"]=Se});var $e=this&&this.__importStar||function(Ae){if(Ae&&Ae.__esModule)return Ae;var Se={};if(Ae!=null)for(var Ce in Ae)if(Ce!=="default"&&Object.hasOwnProperty.call(Ae,Ce))qe(Se,Ae,Ce);Fe(Se,Ae);return Se};Object.defineProperty(Se,"__esModule",{value:true});Se.prepareKeyValueMessage=Se.issueFileCommand=void 0;const rt=$e(Ce(7147));const it=$e(Ce(2037));const nt=Ce(5840);const st=Ce(5278);function issueFileCommand(Ae,Se){const Ce=process.env[`GITHUB_${Ae}`];if(!Ce){throw new Error(`Unable to find environment variable for file command ${Ae}`)}if(!rt.existsSync(Ce)){throw new Error(`Missing file at path: ${Ce}`)}rt.appendFileSync(Ce,`${st.toCommandValue(Se)}${it.EOL}`,{encoding:"utf8"})}Se.issueFileCommand=issueFileCommand;function prepareKeyValueMessage(Ae,Se){const Ce=`ghadelimiter_${nt.v4()}`;const qe=st.toCommandValue(Se);if(Ae.includes(Ce)){throw new Error(`Unexpected input: name should not contain the delimiter "${Ce}"`)}if(qe.includes(Ce)){throw new Error(`Unexpected input: value should not contain the delimiter "${Ce}"`)}return`${Ae}<<${Ce}${it.EOL}${qe}${it.EOL}${Ce}`}Se.prepareKeyValueMessage=prepareKeyValueMessage},8041:function(Ae,Se,Ce){"use strict";var qe=this&&this.__awaiter||function(Ae,Se,Ce,qe){function adopt(Ae){return Ae instanceof Ce?Ae:new Ce((function(Se){Se(Ae)}))}return new(Ce||(Ce=Promise))((function(Ce,Fe){function fulfilled(Ae){try{step(qe.next(Ae))}catch(Ae){Fe(Ae)}}function rejected(Ae){try{step(qe["throw"](Ae))}catch(Ae){Fe(Ae)}}function step(Ae){Ae.done?Ce(Ae.value):adopt(Ae.value).then(fulfilled,rejected)}step((qe=qe.apply(Ae,Se||[])).next())}))};Object.defineProperty(Se,"__esModule",{value:true});Se.OidcClient=void 0;const Fe=Ce(6255);const $e=Ce(5526);const rt=Ce(2186);class OidcClient{static createHttpClient(Ae=true,Se=10){const Ce={allowRetries:Ae,maxRetries:Se};return new Fe.HttpClient("actions/oidc-client",[new $e.BearerCredentialHandler(OidcClient.getRequestToken())],Ce)}static getRequestToken(){const Ae=process.env["ACTIONS_ID_TOKEN_REQUEST_TOKEN"];if(!Ae){throw new Error("Unable to get ACTIONS_ID_TOKEN_REQUEST_TOKEN env variable")}return Ae}static getIDTokenUrl(){const Ae=process.env["ACTIONS_ID_TOKEN_REQUEST_URL"];if(!Ae){throw new Error("Unable to get ACTIONS_ID_TOKEN_REQUEST_URL env variable")}return Ae}static getCall(Ae){var Se;return qe(this,void 0,void 0,(function*(){const Ce=OidcClient.createHttpClient();const qe=yield Ce.getJson(Ae).catch((Ae=>{throw new Error(`Failed to get ID Token. \n \n Error Code : ${Ae.statusCode}\n \n Error Message: ${Ae.message}`)}));const Fe=(Se=qe.result)===null||Se===void 0?void 0:Se.value;if(!Fe){throw new Error("Response json body do not have ID Token field")}return Fe}))}static getIDToken(Ae){return qe(this,void 0,void 0,(function*(){try{let Se=OidcClient.getIDTokenUrl();if(Ae){const Ce=encodeURIComponent(Ae);Se=`${Se}&audience=${Ce}`}rt.debug(`ID token url is ${Se}`);const Ce=yield OidcClient.getCall(Se);rt.setSecret(Ce);return Ce}catch(Ae){throw new Error(`Error message: ${Ae.message}`)}}))}}Se.OidcClient=OidcClient},2981:function(Ae,Se,Ce){"use strict";var qe=this&&this.__createBinding||(Object.create?function(Ae,Se,Ce,qe){if(qe===undefined)qe=Ce;Object.defineProperty(Ae,qe,{enumerable:true,get:function(){return Se[Ce]}})}:function(Ae,Se,Ce,qe){if(qe===undefined)qe=Ce;Ae[qe]=Se[Ce]});var Fe=this&&this.__setModuleDefault||(Object.create?function(Ae,Se){Object.defineProperty(Ae,"default",{enumerable:true,value:Se})}:function(Ae,Se){Ae["default"]=Se});var $e=this&&this.__importStar||function(Ae){if(Ae&&Ae.__esModule)return Ae;var Se={};if(Ae!=null)for(var Ce in Ae)if(Ce!=="default"&&Object.hasOwnProperty.call(Ae,Ce))qe(Se,Ae,Ce);Fe(Se,Ae);return Se};Object.defineProperty(Se,"__esModule",{value:true});Se.toPlatformPath=Se.toWin32Path=Se.toPosixPath=void 0;const rt=$e(Ce(1017));function toPosixPath(Ae){return Ae.replace(/[\\]/g,"/")}Se.toPosixPath=toPosixPath;function toWin32Path(Ae){return Ae.replace(/[/]/g,"\\")}Se.toWin32Path=toWin32Path;function toPlatformPath(Ae){return Ae.replace(/[/\\]/g,rt.sep)}Se.toPlatformPath=toPlatformPath},1327:function(Ae,Se,Ce){"use strict";var qe=this&&this.__awaiter||function(Ae,Se,Ce,qe){function adopt(Ae){return Ae instanceof Ce?Ae:new Ce((function(Se){Se(Ae)}))}return new(Ce||(Ce=Promise))((function(Ce,Fe){function fulfilled(Ae){try{step(qe.next(Ae))}catch(Ae){Fe(Ae)}}function rejected(Ae){try{step(qe["throw"](Ae))}catch(Ae){Fe(Ae)}}function step(Ae){Ae.done?Ce(Ae.value):adopt(Ae.value).then(fulfilled,rejected)}step((qe=qe.apply(Ae,Se||[])).next())}))};Object.defineProperty(Se,"__esModule",{value:true});Se.summary=Se.markdownSummary=Se.SUMMARY_DOCS_URL=Se.SUMMARY_ENV_VAR=void 0;const Fe=Ce(2037);const $e=Ce(7147);const{access:rt,appendFile:it,writeFile:nt}=$e.promises;Se.SUMMARY_ENV_VAR="GITHUB_STEP_SUMMARY";Se.SUMMARY_DOCS_URL="https://docs.github.com/actions/using-workflows/workflow-commands-for-github-actions#adding-a-job-summary";class Summary{constructor(){this._buffer=""}filePath(){return qe(this,void 0,void 0,(function*(){if(this._filePath){return this._filePath}const Ae=process.env[Se.SUMMARY_ENV_VAR];if(!Ae){throw new Error(`Unable to find environment variable for $${Se.SUMMARY_ENV_VAR}. Check if your runtime environment supports job summaries.`)}try{yield rt(Ae,$e.constants.R_OK|$e.constants.W_OK)}catch(Se){throw new Error(`Unable to access summary file: '${Ae}'. Check if the file has correct read/write permissions.`)}this._filePath=Ae;return this._filePath}))}wrap(Ae,Se,Ce={}){const qe=Object.entries(Ce).map((([Ae,Se])=>` ${Ae}="${Se}"`)).join("");if(!Se){return`<${Ae}${qe}>`}return`<${Ae}${qe}>${Se}`}write(Ae){return qe(this,void 0,void 0,(function*(){const Se=!!(Ae===null||Ae===void 0?void 0:Ae.overwrite);const Ce=yield this.filePath();const qe=Se?nt:it;yield qe(Ce,this._buffer,{encoding:"utf8"});return this.emptyBuffer()}))}clear(){return qe(this,void 0,void 0,(function*(){return this.emptyBuffer().write({overwrite:true})}))}stringify(){return this._buffer}isEmptyBuffer(){return this._buffer.length===0}emptyBuffer(){this._buffer="";return this}addRaw(Ae,Se=false){this._buffer+=Ae;return Se?this.addEOL():this}addEOL(){return this.addRaw(Fe.EOL)}addCodeBlock(Ae,Se){const Ce=Object.assign({},Se&&{lang:Se});const qe=this.wrap("pre",this.wrap("code",Ae),Ce);return this.addRaw(qe).addEOL()}addList(Ae,Se=false){const Ce=Se?"ol":"ul";const qe=Ae.map((Ae=>this.wrap("li",Ae))).join("");const Fe=this.wrap(Ce,qe);return this.addRaw(Fe).addEOL()}addTable(Ae){const Se=Ae.map((Ae=>{const Se=Ae.map((Ae=>{if(typeof Ae==="string"){return this.wrap("td",Ae)}const{header:Se,data:Ce,colspan:qe,rowspan:Fe}=Ae;const $e=Se?"th":"td";const rt=Object.assign(Object.assign({},qe&&{colspan:qe}),Fe&&{rowspan:Fe});return this.wrap($e,Ce,rt)})).join("");return this.wrap("tr",Se)})).join("");const Ce=this.wrap("table",Se);return this.addRaw(Ce).addEOL()}addDetails(Ae,Se){const Ce=this.wrap("details",this.wrap("summary",Ae)+Se);return this.addRaw(Ce).addEOL()}addImage(Ae,Se,Ce){const{width:qe,height:Fe}=Ce||{};const $e=Object.assign(Object.assign({},qe&&{width:qe}),Fe&&{height:Fe});const rt=this.wrap("img",null,Object.assign({src:Ae,alt:Se},$e));return this.addRaw(rt).addEOL()}addHeading(Ae,Se){const Ce=`h${Se}`;const qe=["h1","h2","h3","h4","h5","h6"].includes(Ce)?Ce:"h1";const Fe=this.wrap(qe,Ae);return this.addRaw(Fe).addEOL()}addSeparator(){const Ae=this.wrap("hr",null);return this.addRaw(Ae).addEOL()}addBreak(){const Ae=this.wrap("br",null);return this.addRaw(Ae).addEOL()}addQuote(Ae,Se){const Ce=Object.assign({},Se&&{cite:Se});const qe=this.wrap("blockquote",Ae,Ce);return this.addRaw(qe).addEOL()}addLink(Ae,Se){const Ce=this.wrap("a",Ae,{href:Se});return this.addRaw(Ce).addEOL()}}const st=new Summary;Se.markdownSummary=st;Se.summary=st},5278:(Ae,Se)=>{"use strict";Object.defineProperty(Se,"__esModule",{value:true});Se.toCommandProperties=Se.toCommandValue=void 0;function toCommandValue(Ae){if(Ae===null||Ae===undefined){return""}else if(typeof Ae==="string"||Ae instanceof String){return Ae}return JSON.stringify(Ae)}Se.toCommandValue=toCommandValue;function toCommandProperties(Ae){if(!Object.keys(Ae).length){return{}}return{title:Ae.title,file:Ae.file,line:Ae.startLine,endLine:Ae.endLine,col:Ae.startColumn,endColumn:Ae.endColumn}}Se.toCommandProperties=toCommandProperties},1514:function(Ae,Se,Ce){"use strict";var qe=this&&this.__createBinding||(Object.create?function(Ae,Se,Ce,qe){if(qe===undefined)qe=Ce;Object.defineProperty(Ae,qe,{enumerable:true,get:function(){return Se[Ce]}})}:function(Ae,Se,Ce,qe){if(qe===undefined)qe=Ce;Ae[qe]=Se[Ce]});var Fe=this&&this.__setModuleDefault||(Object.create?function(Ae,Se){Object.defineProperty(Ae,"default",{enumerable:true,value:Se})}:function(Ae,Se){Ae["default"]=Se});var $e=this&&this.__importStar||function(Ae){if(Ae&&Ae.__esModule)return Ae;var Se={};if(Ae!=null)for(var Ce in Ae)if(Ce!=="default"&&Object.hasOwnProperty.call(Ae,Ce))qe(Se,Ae,Ce);Fe(Se,Ae);return Se};var rt=this&&this.__awaiter||function(Ae,Se,Ce,qe){function adopt(Ae){return Ae instanceof Ce?Ae:new Ce((function(Se){Se(Ae)}))}return new(Ce||(Ce=Promise))((function(Ce,Fe){function fulfilled(Ae){try{step(qe.next(Ae))}catch(Ae){Fe(Ae)}}function rejected(Ae){try{step(qe["throw"](Ae))}catch(Ae){Fe(Ae)}}function step(Ae){Ae.done?Ce(Ae.value):adopt(Ae.value).then(fulfilled,rejected)}step((qe=qe.apply(Ae,Se||[])).next())}))};Object.defineProperty(Se,"__esModule",{value:true});Se.getExecOutput=Se.exec=void 0;const it=Ce(1576);const nt=$e(Ce(8159));function exec(Ae,Se,Ce){return rt(this,void 0,void 0,(function*(){const qe=nt.argStringToArray(Ae);if(qe.length===0){throw new Error(`Parameter 'commandLine' cannot be null or empty.`)}const Fe=qe[0];Se=qe.slice(1).concat(Se||[]);const $e=new nt.ToolRunner(Fe,Se,Ce);return $e.exec()}))}Se.exec=exec;function getExecOutput(Ae,Se,Ce){var qe,Fe;return rt(this,void 0,void 0,(function*(){let $e="";let rt="";const nt=new it.StringDecoder("utf8");const st=new it.StringDecoder("utf8");const ut=(qe=Ce===null||Ce===void 0?void 0:Ce.listeners)===null||qe===void 0?void 0:qe.stdout;const ht=(Fe=Ce===null||Ce===void 0?void 0:Ce.listeners)===null||Fe===void 0?void 0:Fe.stderr;const stdErrListener=Ae=>{rt+=st.write(Ae);if(ht){ht(Ae)}};const stdOutListener=Ae=>{$e+=nt.write(Ae);if(ut){ut(Ae)}};const ft=Object.assign(Object.assign({},Ce===null||Ce===void 0?void 0:Ce.listeners),{stdout:stdOutListener,stderr:stdErrListener});const yt=yield exec(Ae,Se,Object.assign(Object.assign({},Ce),{listeners:ft}));$e+=nt.end();rt+=st.end();return{exitCode:yt,stdout:$e,stderr:rt}}))}Se.getExecOutput=getExecOutput},8159:function(Ae,Se,Ce){"use strict";var qe=this&&this.__createBinding||(Object.create?function(Ae,Se,Ce,qe){if(qe===undefined)qe=Ce;Object.defineProperty(Ae,qe,{enumerable:true,get:function(){return Se[Ce]}})}:function(Ae,Se,Ce,qe){if(qe===undefined)qe=Ce;Ae[qe]=Se[Ce]});var Fe=this&&this.__setModuleDefault||(Object.create?function(Ae,Se){Object.defineProperty(Ae,"default",{enumerable:true,value:Se})}:function(Ae,Se){Ae["default"]=Se});var $e=this&&this.__importStar||function(Ae){if(Ae&&Ae.__esModule)return Ae;var Se={};if(Ae!=null)for(var Ce in Ae)if(Ce!=="default"&&Object.hasOwnProperty.call(Ae,Ce))qe(Se,Ae,Ce);Fe(Se,Ae);return Se};var rt=this&&this.__awaiter||function(Ae,Se,Ce,qe){function adopt(Ae){return Ae instanceof Ce?Ae:new Ce((function(Se){Se(Ae)}))}return new(Ce||(Ce=Promise))((function(Ce,Fe){function fulfilled(Ae){try{step(qe.next(Ae))}catch(Ae){Fe(Ae)}}function rejected(Ae){try{step(qe["throw"](Ae))}catch(Ae){Fe(Ae)}}function step(Ae){Ae.done?Ce(Ae.value):adopt(Ae.value).then(fulfilled,rejected)}step((qe=qe.apply(Ae,Se||[])).next())}))};Object.defineProperty(Se,"__esModule",{value:true});Se.argStringToArray=Se.ToolRunner=void 0;const it=$e(Ce(2037));const nt=$e(Ce(2361));const st=$e(Ce(2081));const ut=$e(Ce(1017));const ht=$e(Ce(7436));const ft=$e(Ce(1962));const yt=Ce(9512);const vt=process.platform==="win32";class ToolRunner extends nt.EventEmitter{constructor(Ae,Se,Ce){super();if(!Ae){throw new Error("Parameter 'toolPath' cannot be null or empty.")}this.toolPath=Ae;this.args=Se||[];this.options=Ce||{}}_debug(Ae){if(this.options.listeners&&this.options.listeners.debug){this.options.listeners.debug(Ae)}}_getCommandString(Ae,Se){const Ce=this._getSpawnFileName();const qe=this._getSpawnArgs(Ae);let Fe=Se?"":"[command]";if(vt){if(this._isCmdFile()){Fe+=Ce;for(const Ae of qe){Fe+=` ${Ae}`}}else if(Ae.windowsVerbatimArguments){Fe+=`"${Ce}"`;for(const Ae of qe){Fe+=` ${Ae}`}}else{Fe+=this._windowsQuoteCmdArg(Ce);for(const Ae of qe){Fe+=` ${this._windowsQuoteCmdArg(Ae)}`}}}else{Fe+=Ce;for(const Ae of qe){Fe+=` ${Ae}`}}return Fe}_processLineBuffer(Ae,Se,Ce){try{let qe=Se+Ae.toString();let Fe=qe.indexOf(it.EOL);while(Fe>-1){const Ae=qe.substring(0,Fe);Ce(Ae);qe=qe.substring(Fe+it.EOL.length);Fe=qe.indexOf(it.EOL)}return qe}catch(Ae){this._debug(`error processing line. Failed with error ${Ae}`);return""}}_getSpawnFileName(){if(vt){if(this._isCmdFile()){return process.env["COMSPEC"]||"cmd.exe"}}return this.toolPath}_getSpawnArgs(Ae){if(vt){if(this._isCmdFile()){let Se=`/D /S /C "${this._windowsQuoteCmdArg(this.toolPath)}`;for(const Ce of this.args){Se+=" ";Se+=Ae.windowsVerbatimArguments?Ce:this._windowsQuoteCmdArg(Ce)}Se+='"';return[Se]}}return this.args}_endsWith(Ae,Se){return Ae.endsWith(Se)}_isCmdFile(){const Ae=this.toolPath.toUpperCase();return this._endsWith(Ae,".CMD")||this._endsWith(Ae,".BAT")}_windowsQuoteCmdArg(Ae){if(!this._isCmdFile()){return this._uvQuoteCmdArg(Ae)}if(!Ae){return'""'}const Se=[" ","\t","&","(",")","[","]","{","}","^","=",";","!","'","+",",","`","~","|","<",">",'"'];let Ce=false;for(const qe of Ae){if(Se.some((Ae=>Ae===qe))){Ce=true;break}}if(!Ce){return Ae}let qe='"';let Fe=true;for(let Se=Ae.length;Se>0;Se--){qe+=Ae[Se-1];if(Fe&&Ae[Se-1]==="\\"){qe+="\\"}else if(Ae[Se-1]==='"'){Fe=true;qe+='"'}else{Fe=false}}qe+='"';return qe.split("").reverse().join("")}_uvQuoteCmdArg(Ae){if(!Ae){return'""'}if(!Ae.includes(" ")&&!Ae.includes("\t")&&!Ae.includes('"')){return Ae}if(!Ae.includes('"')&&!Ae.includes("\\")){return`"${Ae}"`}let Se='"';let Ce=true;for(let qe=Ae.length;qe>0;qe--){Se+=Ae[qe-1];if(Ce&&Ae[qe-1]==="\\"){Se+="\\"}else if(Ae[qe-1]==='"'){Ce=true;Se+="\\"}else{Ce=false}}Se+='"';return Se.split("").reverse().join("")}_cloneExecOptions(Ae){Ae=Ae||{};const Se={cwd:Ae.cwd||process.cwd(),env:Ae.env||process.env,silent:Ae.silent||false,windowsVerbatimArguments:Ae.windowsVerbatimArguments||false,failOnStdErr:Ae.failOnStdErr||false,ignoreReturnCode:Ae.ignoreReturnCode||false,delay:Ae.delay||1e4};Se.outStream=Ae.outStream||process.stdout;Se.errStream=Ae.errStream||process.stderr;return Se}_getSpawnOptions(Ae,Se){Ae=Ae||{};const Ce={};Ce.cwd=Ae.cwd;Ce.env=Ae.env;Ce["windowsVerbatimArguments"]=Ae.windowsVerbatimArguments||this._isCmdFile();if(Ae.windowsVerbatimArguments){Ce.argv0=`"${Se}"`}return Ce}exec(){return rt(this,void 0,void 0,(function*(){if(!ft.isRooted(this.toolPath)&&(this.toolPath.includes("/")||vt&&this.toolPath.includes("\\"))){this.toolPath=ut.resolve(process.cwd(),this.options.cwd||process.cwd(),this.toolPath)}this.toolPath=yield ht.which(this.toolPath,true);return new Promise(((Ae,Se)=>rt(this,void 0,void 0,(function*(){this._debug(`exec tool: ${this.toolPath}`);this._debug("arguments:");for(const Ae of this.args){this._debug(` ${Ae}`)}const Ce=this._cloneExecOptions(this.options);if(!Ce.silent&&Ce.outStream){Ce.outStream.write(this._getCommandString(Ce)+it.EOL)}const qe=new ExecState(Ce,this.toolPath);qe.on("debug",(Ae=>{this._debug(Ae)}));if(this.options.cwd&&!(yield ft.exists(this.options.cwd))){return Se(new Error(`The cwd: ${this.options.cwd} does not exist!`))}const Fe=this._getSpawnFileName();const $e=st.spawn(Fe,this._getSpawnArgs(Ce),this._getSpawnOptions(this.options,Fe));let rt="";if($e.stdout){$e.stdout.on("data",(Ae=>{if(this.options.listeners&&this.options.listeners.stdout){this.options.listeners.stdout(Ae)}if(!Ce.silent&&Ce.outStream){Ce.outStream.write(Ae)}rt=this._processLineBuffer(Ae,rt,(Ae=>{if(this.options.listeners&&this.options.listeners.stdline){this.options.listeners.stdline(Ae)}}))}))}let nt="";if($e.stderr){$e.stderr.on("data",(Ae=>{qe.processStderr=true;if(this.options.listeners&&this.options.listeners.stderr){this.options.listeners.stderr(Ae)}if(!Ce.silent&&Ce.errStream&&Ce.outStream){const Se=Ce.failOnStdErr?Ce.errStream:Ce.outStream;Se.write(Ae)}nt=this._processLineBuffer(Ae,nt,(Ae=>{if(this.options.listeners&&this.options.listeners.errline){this.options.listeners.errline(Ae)}}))}))}$e.on("error",(Ae=>{qe.processError=Ae.message;qe.processExited=true;qe.processClosed=true;qe.CheckComplete()}));$e.on("exit",(Ae=>{qe.processExitCode=Ae;qe.processExited=true;this._debug(`Exit code ${Ae} received from tool '${this.toolPath}'`);qe.CheckComplete()}));$e.on("close",(Ae=>{qe.processExitCode=Ae;qe.processExited=true;qe.processClosed=true;this._debug(`STDIO streams have closed for tool '${this.toolPath}'`);qe.CheckComplete()}));qe.on("done",((Ce,qe)=>{if(rt.length>0){this.emit("stdline",rt)}if(nt.length>0){this.emit("errline",nt)}$e.removeAllListeners();if(Ce){Se(Ce)}else{Ae(qe)}}));if(this.options.input){if(!$e.stdin){throw new Error("child process missing stdin")}$e.stdin.end(this.options.input)}}))))}))}}Se.ToolRunner=ToolRunner;function argStringToArray(Ae){const Se=[];let Ce=false;let qe=false;let Fe="";function append(Ae){if(qe&&Ae!=='"'){Fe+="\\"}Fe+=Ae;qe=false}for(let $e=0;$e0){Se.push(Fe);Fe=""}continue}append(rt)}if(Fe.length>0){Se.push(Fe.trim())}return Se}Se.argStringToArray=argStringToArray;class ExecState extends nt.EventEmitter{constructor(Ae,Se){super();this.processClosed=false;this.processError="";this.processExitCode=0;this.processExited=false;this.processStderr=false;this.delay=1e4;this.done=false;this.timeout=null;if(!Se){throw new Error("toolPath must not be empty")}this.options=Ae;this.toolPath=Se;if(Ae.delay){this.delay=Ae.delay}}CheckComplete(){if(this.done){return}if(this.processClosed){this._setResult()}else if(this.processExited){this.timeout=yt.setTimeout(ExecState.HandleTimeout,this.delay,this)}}_debug(Ae){this.emit("debug",Ae)}_setResult(){let Ae;if(this.processExited){if(this.processError){Ae=new Error(`There was an error when attempting to execute the process '${this.toolPath}'. This may indicate the process failed to start. Error: ${this.processError}`)}else if(this.processExitCode!==0&&!this.options.ignoreReturnCode){Ae=new Error(`The process '${this.toolPath}' failed with exit code ${this.processExitCode}`)}else if(this.processStderr&&this.options.failOnStdErr){Ae=new Error(`The process '${this.toolPath}' failed because one or more lines were written to the STDERR stream`)}}if(this.timeout){clearTimeout(this.timeout);this.timeout=null}this.done=true;this.emit("done",Ae,this.processExitCode)}static HandleTimeout(Ae){if(Ae.done){return}if(!Ae.processClosed&&Ae.processExited){const Se=`The STDIO streams did not close within ${Ae.delay/1e3} seconds of the exit event from process '${Ae.toolPath}'. This may indicate a child process inherited the STDIO streams and has not yet exited.`;Ae._debug(Se)}Ae._setResult()}}},5526:function(Ae,Se){"use strict";var Ce=this&&this.__awaiter||function(Ae,Se,Ce,qe){function adopt(Ae){return Ae instanceof Ce?Ae:new Ce((function(Se){Se(Ae)}))}return new(Ce||(Ce=Promise))((function(Ce,Fe){function fulfilled(Ae){try{step(qe.next(Ae))}catch(Ae){Fe(Ae)}}function rejected(Ae){try{step(qe["throw"](Ae))}catch(Ae){Fe(Ae)}}function step(Ae){Ae.done?Ce(Ae.value):adopt(Ae.value).then(fulfilled,rejected)}step((qe=qe.apply(Ae,Se||[])).next())}))};Object.defineProperty(Se,"__esModule",{value:true});Se.PersonalAccessTokenCredentialHandler=Se.BearerCredentialHandler=Se.BasicCredentialHandler=void 0;class BasicCredentialHandler{constructor(Ae,Se){this.username=Ae;this.password=Se}prepareRequest(Ae){if(!Ae.headers){throw Error("The request has no headers")}Ae.headers["Authorization"]=`Basic ${Buffer.from(`${this.username}:${this.password}`).toString("base64")}`}canHandleAuthentication(){return false}handleAuthentication(){return Ce(this,void 0,void 0,(function*(){throw new Error("not implemented")}))}}Se.BasicCredentialHandler=BasicCredentialHandler;class BearerCredentialHandler{constructor(Ae){this.token=Ae}prepareRequest(Ae){if(!Ae.headers){throw Error("The request has no headers")}Ae.headers["Authorization"]=`Bearer ${this.token}`}canHandleAuthentication(){return false}handleAuthentication(){return Ce(this,void 0,void 0,(function*(){throw new Error("not implemented")}))}}Se.BearerCredentialHandler=BearerCredentialHandler;class PersonalAccessTokenCredentialHandler{constructor(Ae){this.token=Ae}prepareRequest(Ae){if(!Ae.headers){throw Error("The request has no headers")}Ae.headers["Authorization"]=`Basic ${Buffer.from(`PAT:${this.token}`).toString("base64")}`}canHandleAuthentication(){return false}handleAuthentication(){return Ce(this,void 0,void 0,(function*(){throw new Error("not implemented")}))}}Se.PersonalAccessTokenCredentialHandler=PersonalAccessTokenCredentialHandler},6255:function(Ae,Se,Ce){"use strict";var qe=this&&this.__createBinding||(Object.create?function(Ae,Se,Ce,qe){if(qe===undefined)qe=Ce;Object.defineProperty(Ae,qe,{enumerable:true,get:function(){return Se[Ce]}})}:function(Ae,Se,Ce,qe){if(qe===undefined)qe=Ce;Ae[qe]=Se[Ce]});var Fe=this&&this.__setModuleDefault||(Object.create?function(Ae,Se){Object.defineProperty(Ae,"default",{enumerable:true,value:Se})}:function(Ae,Se){Ae["default"]=Se});var $e=this&&this.__importStar||function(Ae){if(Ae&&Ae.__esModule)return Ae;var Se={};if(Ae!=null)for(var Ce in Ae)if(Ce!=="default"&&Object.hasOwnProperty.call(Ae,Ce))qe(Se,Ae,Ce);Fe(Se,Ae);return Se};var rt=this&&this.__awaiter||function(Ae,Se,Ce,qe){function adopt(Ae){return Ae instanceof Ce?Ae:new Ce((function(Se){Se(Ae)}))}return new(Ce||(Ce=Promise))((function(Ce,Fe){function fulfilled(Ae){try{step(qe.next(Ae))}catch(Ae){Fe(Ae)}}function rejected(Ae){try{step(qe["throw"](Ae))}catch(Ae){Fe(Ae)}}function step(Ae){Ae.done?Ce(Ae.value):adopt(Ae.value).then(fulfilled,rejected)}step((qe=qe.apply(Ae,Se||[])).next())}))};Object.defineProperty(Se,"__esModule",{value:true});Se.HttpClient=Se.isHttps=Se.HttpClientResponse=Se.HttpClientError=Se.getProxyUrl=Se.MediaTypes=Se.Headers=Se.HttpCodes=void 0;const it=$e(Ce(3685));const nt=$e(Ce(5687));const st=$e(Ce(9835));const ut=$e(Ce(4294));var ht;(function(Ae){Ae[Ae["OK"]=200]="OK";Ae[Ae["MultipleChoices"]=300]="MultipleChoices";Ae[Ae["MovedPermanently"]=301]="MovedPermanently";Ae[Ae["ResourceMoved"]=302]="ResourceMoved";Ae[Ae["SeeOther"]=303]="SeeOther";Ae[Ae["NotModified"]=304]="NotModified";Ae[Ae["UseProxy"]=305]="UseProxy";Ae[Ae["SwitchProxy"]=306]="SwitchProxy";Ae[Ae["TemporaryRedirect"]=307]="TemporaryRedirect";Ae[Ae["PermanentRedirect"]=308]="PermanentRedirect";Ae[Ae["BadRequest"]=400]="BadRequest";Ae[Ae["Unauthorized"]=401]="Unauthorized";Ae[Ae["PaymentRequired"]=402]="PaymentRequired";Ae[Ae["Forbidden"]=403]="Forbidden";Ae[Ae["NotFound"]=404]="NotFound";Ae[Ae["MethodNotAllowed"]=405]="MethodNotAllowed";Ae[Ae["NotAcceptable"]=406]="NotAcceptable";Ae[Ae["ProxyAuthenticationRequired"]=407]="ProxyAuthenticationRequired";Ae[Ae["RequestTimeout"]=408]="RequestTimeout";Ae[Ae["Conflict"]=409]="Conflict";Ae[Ae["Gone"]=410]="Gone";Ae[Ae["TooManyRequests"]=429]="TooManyRequests";Ae[Ae["InternalServerError"]=500]="InternalServerError";Ae[Ae["NotImplemented"]=501]="NotImplemented";Ae[Ae["BadGateway"]=502]="BadGateway";Ae[Ae["ServiceUnavailable"]=503]="ServiceUnavailable";Ae[Ae["GatewayTimeout"]=504]="GatewayTimeout"})(ht=Se.HttpCodes||(Se.HttpCodes={}));var ft;(function(Ae){Ae["Accept"]="accept";Ae["ContentType"]="content-type"})(ft=Se.Headers||(Se.Headers={}));var yt;(function(Ae){Ae["ApplicationJson"]="application/json"})(yt=Se.MediaTypes||(Se.MediaTypes={}));function getProxyUrl(Ae){const Se=st.getProxyUrl(new URL(Ae));return Se?Se.href:""}Se.getProxyUrl=getProxyUrl;const vt=[ht.MovedPermanently,ht.ResourceMoved,ht.SeeOther,ht.TemporaryRedirect,ht.PermanentRedirect];const _t=[ht.BadGateway,ht.ServiceUnavailable,ht.GatewayTimeout];const Ct=["OPTIONS","GET","DELETE","HEAD"];const Rt=10;const Ut=5;class HttpClientError extends Error{constructor(Ae,Se){super(Ae);this.name="HttpClientError";this.statusCode=Se;Object.setPrototypeOf(this,HttpClientError.prototype)}}Se.HttpClientError=HttpClientError;class HttpClientResponse{constructor(Ae){this.message=Ae}readBody(){return rt(this,void 0,void 0,(function*(){return new Promise((Ae=>rt(this,void 0,void 0,(function*(){let Se=Buffer.alloc(0);this.message.on("data",(Ae=>{Se=Buffer.concat([Se,Ae])}));this.message.on("end",(()=>{Ae(Se.toString())}))}))))}))}}Se.HttpClientResponse=HttpClientResponse;function isHttps(Ae){const Se=new URL(Ae);return Se.protocol==="https:"}Se.isHttps=isHttps;class HttpClient{constructor(Ae,Se,Ce){this._ignoreSslError=false;this._allowRedirects=true;this._allowRedirectDowngrade=false;this._maxRedirects=50;this._allowRetries=false;this._maxRetries=1;this._keepAlive=false;this._disposed=false;this.userAgent=Ae;this.handlers=Se||[];this.requestOptions=Ce;if(Ce){if(Ce.ignoreSslError!=null){this._ignoreSslError=Ce.ignoreSslError}this._socketTimeout=Ce.socketTimeout;if(Ce.allowRedirects!=null){this._allowRedirects=Ce.allowRedirects}if(Ce.allowRedirectDowngrade!=null){this._allowRedirectDowngrade=Ce.allowRedirectDowngrade}if(Ce.maxRedirects!=null){this._maxRedirects=Math.max(Ce.maxRedirects,0)}if(Ce.keepAlive!=null){this._keepAlive=Ce.keepAlive}if(Ce.allowRetries!=null){this._allowRetries=Ce.allowRetries}if(Ce.maxRetries!=null){this._maxRetries=Ce.maxRetries}}}options(Ae,Se){return rt(this,void 0,void 0,(function*(){return this.request("OPTIONS",Ae,null,Se||{})}))}get(Ae,Se){return rt(this,void 0,void 0,(function*(){return this.request("GET",Ae,null,Se||{})}))}del(Ae,Se){return rt(this,void 0,void 0,(function*(){return this.request("DELETE",Ae,null,Se||{})}))}post(Ae,Se,Ce){return rt(this,void 0,void 0,(function*(){return this.request("POST",Ae,Se,Ce||{})}))}patch(Ae,Se,Ce){return rt(this,void 0,void 0,(function*(){return this.request("PATCH",Ae,Se,Ce||{})}))}put(Ae,Se,Ce){return rt(this,void 0,void 0,(function*(){return this.request("PUT",Ae,Se,Ce||{})}))}head(Ae,Se){return rt(this,void 0,void 0,(function*(){return this.request("HEAD",Ae,null,Se||{})}))}sendStream(Ae,Se,Ce,qe){return rt(this,void 0,void 0,(function*(){return this.request(Ae,Se,Ce,qe)}))}getJson(Ae,Se={}){return rt(this,void 0,void 0,(function*(){Se[ft.Accept]=this._getExistingOrDefaultHeader(Se,ft.Accept,yt.ApplicationJson);const Ce=yield this.get(Ae,Se);return this._processResponse(Ce,this.requestOptions)}))}postJson(Ae,Se,Ce={}){return rt(this,void 0,void 0,(function*(){const qe=JSON.stringify(Se,null,2);Ce[ft.Accept]=this._getExistingOrDefaultHeader(Ce,ft.Accept,yt.ApplicationJson);Ce[ft.ContentType]=this._getExistingOrDefaultHeader(Ce,ft.ContentType,yt.ApplicationJson);const Fe=yield this.post(Ae,qe,Ce);return this._processResponse(Fe,this.requestOptions)}))}putJson(Ae,Se,Ce={}){return rt(this,void 0,void 0,(function*(){const qe=JSON.stringify(Se,null,2);Ce[ft.Accept]=this._getExistingOrDefaultHeader(Ce,ft.Accept,yt.ApplicationJson);Ce[ft.ContentType]=this._getExistingOrDefaultHeader(Ce,ft.ContentType,yt.ApplicationJson);const Fe=yield this.put(Ae,qe,Ce);return this._processResponse(Fe,this.requestOptions)}))}patchJson(Ae,Se,Ce={}){return rt(this,void 0,void 0,(function*(){const qe=JSON.stringify(Se,null,2);Ce[ft.Accept]=this._getExistingOrDefaultHeader(Ce,ft.Accept,yt.ApplicationJson);Ce[ft.ContentType]=this._getExistingOrDefaultHeader(Ce,ft.ContentType,yt.ApplicationJson);const Fe=yield this.patch(Ae,qe,Ce);return this._processResponse(Fe,this.requestOptions)}))}request(Ae,Se,Ce,qe){return rt(this,void 0,void 0,(function*(){if(this._disposed){throw new Error("Client has already been disposed.")}const Fe=new URL(Se);let $e=this._prepareRequest(Ae,Fe,qe);const rt=this._allowRetries&&Ct.includes(Ae)?this._maxRetries+1:1;let it=0;let nt;do{nt=yield this.requestRaw($e,Ce);if(nt&&nt.message&&nt.message.statusCode===ht.Unauthorized){let Ae;for(const Se of this.handlers){if(Se.canHandleAuthentication(nt)){Ae=Se;break}}if(Ae){return Ae.handleAuthentication(this,$e,Ce)}else{return nt}}let Se=this._maxRedirects;while(nt.message.statusCode&&vt.includes(nt.message.statusCode)&&this._allowRedirects&&Se>0){const rt=nt.message.headers["location"];if(!rt){break}const it=new URL(rt);if(Fe.protocol==="https:"&&Fe.protocol!==it.protocol&&!this._allowRedirectDowngrade){throw new Error("Redirect from HTTPS to HTTP protocol. This downgrade is not allowed for security reasons. If you want to allow this behavior, set the allowRedirectDowngrade option to true.")}yield nt.readBody();if(it.hostname!==Fe.hostname){for(const Ae in qe){if(Ae.toLowerCase()==="authorization"){delete qe[Ae]}}}$e=this._prepareRequest(Ae,it,qe);nt=yield this.requestRaw($e,Ce);Se--}if(!nt.message.statusCode||!_t.includes(nt.message.statusCode)){return nt}it+=1;if(it{function callbackForResult(Ae,Se){if(Ae){qe(Ae)}else if(!Se){qe(new Error("Unknown error"))}else{Ce(Se)}}this.requestRawWithCallback(Ae,Se,callbackForResult)}))}))}requestRawWithCallback(Ae,Se,Ce){if(typeof Se==="string"){if(!Ae.options.headers){Ae.options.headers={}}Ae.options.headers["Content-Length"]=Buffer.byteLength(Se,"utf8")}let qe=false;function handleResult(Ae,Se){if(!qe){qe=true;Ce(Ae,Se)}}const Fe=Ae.httpModule.request(Ae.options,(Ae=>{const Se=new HttpClientResponse(Ae);handleResult(undefined,Se)}));let $e;Fe.on("socket",(Ae=>{$e=Ae}));Fe.setTimeout(this._socketTimeout||3*6e4,(()=>{if($e){$e.end()}handleResult(new Error(`Request timeout: ${Ae.options.path}`))}));Fe.on("error",(function(Ae){handleResult(Ae)}));if(Se&&typeof Se==="string"){Fe.write(Se,"utf8")}if(Se&&typeof Se!=="string"){Se.on("close",(function(){Fe.end()}));Se.pipe(Fe)}else{Fe.end()}}getAgent(Ae){const Se=new URL(Ae);return this._getAgent(Se)}_prepareRequest(Ae,Se,Ce){const qe={};qe.parsedUrl=Se;const Fe=qe.parsedUrl.protocol==="https:";qe.httpModule=Fe?nt:it;const $e=Fe?443:80;qe.options={};qe.options.host=qe.parsedUrl.hostname;qe.options.port=qe.parsedUrl.port?parseInt(qe.parsedUrl.port):$e;qe.options.path=(qe.parsedUrl.pathname||"")+(qe.parsedUrl.search||"");qe.options.method=Ae;qe.options.headers=this._mergeHeaders(Ce);if(this.userAgent!=null){qe.options.headers["user-agent"]=this.userAgent}qe.options.agent=this._getAgent(qe.parsedUrl);if(this.handlers){for(const Ae of this.handlers){Ae.prepareRequest(qe.options)}}return qe}_mergeHeaders(Ae){if(this.requestOptions&&this.requestOptions.headers){return Object.assign({},lowercaseKeys(this.requestOptions.headers),lowercaseKeys(Ae||{}))}return lowercaseKeys(Ae||{})}_getExistingOrDefaultHeader(Ae,Se,Ce){let qe;if(this.requestOptions&&this.requestOptions.headers){qe=lowercaseKeys(this.requestOptions.headers)[Se]}return Ae[Se]||qe||Ce}_getAgent(Ae){let Se;const Ce=st.getProxyUrl(Ae);const qe=Ce&&Ce.hostname;if(this._keepAlive&&qe){Se=this._proxyAgent}if(this._keepAlive&&!qe){Se=this._agent}if(Se){return Se}const Fe=Ae.protocol==="https:";let $e=100;if(this.requestOptions){$e=this.requestOptions.maxSockets||it.globalAgent.maxSockets}if(Ce&&Ce.hostname){const Ae={maxSockets:$e,keepAlive:this._keepAlive,proxy:Object.assign(Object.assign({},(Ce.username||Ce.password)&&{proxyAuth:`${Ce.username}:${Ce.password}`}),{host:Ce.hostname,port:Ce.port})};let qe;const rt=Ce.protocol==="https:";if(Fe){qe=rt?ut.httpsOverHttps:ut.httpsOverHttp}else{qe=rt?ut.httpOverHttps:ut.httpOverHttp}Se=qe(Ae);this._proxyAgent=Se}if(this._keepAlive&&!Se){const Ae={keepAlive:this._keepAlive,maxSockets:$e};Se=Fe?new nt.Agent(Ae):new it.Agent(Ae);this._agent=Se}if(!Se){Se=Fe?nt.globalAgent:it.globalAgent}if(Fe&&this._ignoreSslError){Se.options=Object.assign(Se.options||{},{rejectUnauthorized:false})}return Se}_performExponentialBackoff(Ae){return rt(this,void 0,void 0,(function*(){Ae=Math.min(Rt,Ae);const Se=Ut*Math.pow(2,Ae);return new Promise((Ae=>setTimeout((()=>Ae()),Se)))}))}_processResponse(Ae,Se){return rt(this,void 0,void 0,(function*(){return new Promise(((Ce,qe)=>rt(this,void 0,void 0,(function*(){const Fe=Ae.message.statusCode||0;const $e={statusCode:Fe,result:null,headers:{}};if(Fe===ht.NotFound){Ce($e)}function dateTimeDeserializer(Ae,Se){if(typeof Se==="string"){const Ae=new Date(Se);if(!isNaN(Ae.valueOf())){return Ae}}return Se}let rt;let it;try{it=yield Ae.readBody();if(it&&it.length>0){if(Se&&Se.deserializeDates){rt=JSON.parse(it,dateTimeDeserializer)}else{rt=JSON.parse(it)}$e.result=rt}$e.headers=Ae.message.headers}catch(Ae){}if(Fe>299){let Ae;if(rt&&rt.message){Ae=rt.message}else if(it&&it.length>0){Ae=it}else{Ae=`Failed request: (${Fe})`}const Se=new HttpClientError(Ae,Fe);Se.result=$e.result;qe(Se)}else{Ce($e)}}))))}))}}Se.HttpClient=HttpClient;const lowercaseKeys=Ae=>Object.keys(Ae).reduce(((Se,Ce)=>(Se[Ce.toLowerCase()]=Ae[Ce],Se)),{})},9835:(Ae,Se)=>{"use strict";Object.defineProperty(Se,"__esModule",{value:true});Se.checkBypass=Se.getProxyUrl=void 0;function getProxyUrl(Ae){const Se=Ae.protocol==="https:";if(checkBypass(Ae)){return undefined}const Ce=(()=>{if(Se){return process.env["https_proxy"]||process.env["HTTPS_PROXY"]}else{return process.env["http_proxy"]||process.env["HTTP_PROXY"]}})();if(Ce){return new URL(Ce)}else{return undefined}}Se.getProxyUrl=getProxyUrl;function checkBypass(Ae){if(!Ae.hostname){return false}const Se=process.env["no_proxy"]||process.env["NO_PROXY"]||"";if(!Se){return false}let Ce;if(Ae.port){Ce=Number(Ae.port)}else if(Ae.protocol==="http:"){Ce=80}else if(Ae.protocol==="https:"){Ce=443}const qe=[Ae.hostname.toUpperCase()];if(typeof Ce==="number"){qe.push(`${qe[0]}:${Ce}`)}for(const Ae of Se.split(",").map((Ae=>Ae.trim().toUpperCase())).filter((Ae=>Ae))){if(qe.some((Se=>Se===Ae))){return true}}return false}Se.checkBypass=checkBypass},1962:function(Ae,Se,Ce){"use strict";var qe=this&&this.__awaiter||function(Ae,Se,Ce,qe){function adopt(Ae){return Ae instanceof Ce?Ae:new Ce((function(Se){Se(Ae)}))}return new(Ce||(Ce=Promise))((function(Ce,Fe){function fulfilled(Ae){try{step(qe.next(Ae))}catch(Ae){Fe(Ae)}}function rejected(Ae){try{step(qe["throw"](Ae))}catch(Ae){Fe(Ae)}}function step(Ae){Ae.done?Ce(Ae.value):adopt(Ae.value).then(fulfilled,rejected)}step((qe=qe.apply(Ae,Se||[])).next())}))};var Fe;Object.defineProperty(Se,"__esModule",{value:true});const $e=Ce(9491);const rt=Ce(7147);const it=Ce(1017);Fe=rt.promises,Se.chmod=Fe.chmod,Se.copyFile=Fe.copyFile,Se.lstat=Fe.lstat,Se.mkdir=Fe.mkdir,Se.readdir=Fe.readdir,Se.readlink=Fe.readlink,Se.rename=Fe.rename,Se.rmdir=Fe.rmdir,Se.stat=Fe.stat,Se.symlink=Fe.symlink,Se.unlink=Fe.unlink;Se.IS_WINDOWS=process.platform==="win32";function exists(Ae){return qe(this,void 0,void 0,(function*(){try{yield Se.stat(Ae)}catch(Ae){if(Ae.code==="ENOENT"){return false}throw Ae}return true}))}Se.exists=exists;function isDirectory(Ae,Ce=false){return qe(this,void 0,void 0,(function*(){const qe=Ce?yield Se.stat(Ae):yield Se.lstat(Ae);return qe.isDirectory()}))}Se.isDirectory=isDirectory;function isRooted(Ae){Ae=normalizeSeparators(Ae);if(!Ae){throw new Error('isRooted() parameter "p" cannot be empty')}if(Se.IS_WINDOWS){return Ae.startsWith("\\")||/^[A-Z]:/i.test(Ae)}return Ae.startsWith("/")}Se.isRooted=isRooted;function mkdirP(Ae,Ce=1e3,Fe=1){return qe(this,void 0,void 0,(function*(){$e.ok(Ae,"a path argument must be provided");Ae=it.resolve(Ae);if(Fe>=Ce)return Se.mkdir(Ae);try{yield Se.mkdir(Ae);return}catch(qe){switch(qe.code){case"ENOENT":{yield mkdirP(it.dirname(Ae),Ce,Fe+1);yield Se.mkdir(Ae);return}default:{let Ce;try{Ce=yield Se.stat(Ae)}catch(Ae){throw qe}if(!Ce.isDirectory())throw qe}}}}))}Se.mkdirP=mkdirP;function tryGetExecutablePath(Ae,Ce){return qe(this,void 0,void 0,(function*(){let qe=undefined;try{qe=yield Se.stat(Ae)}catch(Se){if(Se.code!=="ENOENT"){console.log(`Unexpected error attempting to determine if executable file exists '${Ae}': ${Se}`)}}if(qe&&qe.isFile()){if(Se.IS_WINDOWS){const Se=it.extname(Ae).toUpperCase();if(Ce.some((Ae=>Ae.toUpperCase()===Se))){return Ae}}else{if(isUnixExecutable(qe)){return Ae}}}const Fe=Ae;for(const $e of Ce){Ae=Fe+$e;qe=undefined;try{qe=yield Se.stat(Ae)}catch(Se){if(Se.code!=="ENOENT"){console.log(`Unexpected error attempting to determine if executable file exists '${Ae}': ${Se}`)}}if(qe&&qe.isFile()){if(Se.IS_WINDOWS){try{const Ce=it.dirname(Ae);const qe=it.basename(Ae).toUpperCase();for(const Fe of yield Se.readdir(Ce)){if(qe===Fe.toUpperCase()){Ae=it.join(Ce,Fe);break}}}catch(Se){console.log(`Unexpected error attempting to determine the actual case of the file '${Ae}': ${Se}`)}return Ae}else{if(isUnixExecutable(qe)){return Ae}}}}return""}))}Se.tryGetExecutablePath=tryGetExecutablePath;function normalizeSeparators(Ae){Ae=Ae||"";if(Se.IS_WINDOWS){Ae=Ae.replace(/\//g,"\\");return Ae.replace(/\\\\+/g,"\\")}return Ae.replace(/\/\/+/g,"/")}function isUnixExecutable(Ae){return(Ae.mode&1)>0||(Ae.mode&8)>0&&Ae.gid===process.getgid()||(Ae.mode&64)>0&&Ae.uid===process.getuid()}},7436:function(Ae,Se,Ce){"use strict";var qe=this&&this.__awaiter||function(Ae,Se,Ce,qe){function adopt(Ae){return Ae instanceof Ce?Ae:new Ce((function(Se){Se(Ae)}))}return new(Ce||(Ce=Promise))((function(Ce,Fe){function fulfilled(Ae){try{step(qe.next(Ae))}catch(Ae){Fe(Ae)}}function rejected(Ae){try{step(qe["throw"](Ae))}catch(Ae){Fe(Ae)}}function step(Ae){Ae.done?Ce(Ae.value):adopt(Ae.value).then(fulfilled,rejected)}step((qe=qe.apply(Ae,Se||[])).next())}))};Object.defineProperty(Se,"__esModule",{value:true});const Fe=Ce(2081);const $e=Ce(1017);const rt=Ce(3837);const it=Ce(1962);const nt=rt.promisify(Fe.exec);function cp(Ae,Se,Ce={}){return qe(this,void 0,void 0,(function*(){const{force:qe,recursive:Fe}=readCopyOptions(Ce);const rt=(yield it.exists(Se))?yield it.stat(Se):null;if(rt&&rt.isFile()&&!qe){return}const nt=rt&&rt.isDirectory()?$e.join(Se,$e.basename(Ae)):Se;if(!(yield it.exists(Ae))){throw new Error(`no such file or directory: ${Ae}`)}const st=yield it.stat(Ae);if(st.isDirectory()){if(!Fe){throw new Error(`Failed to copy. ${Ae} is a directory, but tried to copy without recursive flag.`)}else{yield cpDirRecursive(Ae,nt,0,qe)}}else{if($e.relative(Ae,nt)===""){throw new Error(`'${nt}' and '${Ae}' are the same file`)}yield copyFile(Ae,nt,qe)}}))}Se.cp=cp;function mv(Ae,Se,Ce={}){return qe(this,void 0,void 0,(function*(){if(yield it.exists(Se)){let qe=true;if(yield it.isDirectory(Se)){Se=$e.join(Se,$e.basename(Ae));qe=yield it.exists(Se)}if(qe){if(Ce.force==null||Ce.force){yield rmRF(Se)}else{throw new Error("Destination already exists")}}}yield mkdirP($e.dirname(Se));yield it.rename(Ae,Se)}))}Se.mv=mv;function rmRF(Ae){return qe(this,void 0,void 0,(function*(){if(it.IS_WINDOWS){try{if(yield it.isDirectory(Ae,true)){yield nt(`rd /s /q "${Ae}"`)}else{yield nt(`del /f /a "${Ae}"`)}}catch(Ae){if(Ae.code!=="ENOENT")throw Ae}try{yield it.unlink(Ae)}catch(Ae){if(Ae.code!=="ENOENT")throw Ae}}else{let Se=false;try{Se=yield it.isDirectory(Ae)}catch(Ae){if(Ae.code!=="ENOENT")throw Ae;return}if(Se){yield nt(`rm -rf "${Ae}"`)}else{yield it.unlink(Ae)}}}))}Se.rmRF=rmRF;function mkdirP(Ae){return qe(this,void 0,void 0,(function*(){yield it.mkdirP(Ae)}))}Se.mkdirP=mkdirP;function which(Ae,Se){return qe(this,void 0,void 0,(function*(){if(!Ae){throw new Error("parameter 'tool' is required")}if(Se){const Se=yield which(Ae,false);if(!Se){if(it.IS_WINDOWS){throw new Error(`Unable to locate executable file: ${Ae}. Please verify either the file path exists or the file can be found within a directory specified by the PATH environment variable. Also verify the file has a valid extension for an executable file.`)}else{throw new Error(`Unable to locate executable file: ${Ae}. Please verify either the file path exists or the file can be found within a directory specified by the PATH environment variable. Also check the file mode to verify the file is executable.`)}}}try{const Se=[];if(it.IS_WINDOWS&&process.env.PATHEXT){for(const Ae of process.env.PATHEXT.split($e.delimiter)){if(Ae){Se.push(Ae)}}}if(it.isRooted(Ae)){const Ce=yield it.tryGetExecutablePath(Ae,Se);if(Ce){return Ce}return""}if(Ae.includes("/")||it.IS_WINDOWS&&Ae.includes("\\")){return""}const Ce=[];if(process.env.PATH){for(const Ae of process.env.PATH.split($e.delimiter)){if(Ae){Ce.push(Ae)}}}for(const qe of Ce){const Ce=yield it.tryGetExecutablePath(qe+$e.sep+Ae,Se);if(Ce){return Ce}}return""}catch(Ae){throw new Error(`which failed with message ${Ae.message}`)}}))}Se.which=which;function readCopyOptions(Ae){const Se=Ae.force==null?true:Ae.force;const Ce=Boolean(Ae.recursive);return{force:Se,recursive:Ce}}function cpDirRecursive(Ae,Se,Ce,Fe){return qe(this,void 0,void 0,(function*(){if(Ce>=255)return;Ce++;yield mkdirP(Se);const qe=yield it.readdir(Ae);for(const $e of qe){const qe=`${Ae}/${$e}`;const rt=`${Se}/${$e}`;const nt=yield it.lstat(qe);if(nt.isDirectory()){yield cpDirRecursive(qe,rt,Ce,Fe)}else{yield copyFile(qe,rt,Fe)}}yield it.chmod(Se,(yield it.stat(Ae)).mode)}))}function copyFile(Ae,Se,Ce){return qe(this,void 0,void 0,(function*(){if((yield it.lstat(Ae)).isSymbolicLink()){try{yield it.lstat(Se);yield it.unlink(Se)}catch(Ae){if(Ae.code==="EPERM"){yield it.chmod(Se,"0666");yield it.unlink(Se)}}const Ce=yield it.readlink(Ae);yield it.symlink(Ce,Se,it.IS_WINDOWS?"junction":null)}else if(!(yield it.exists(Se))||Ce){yield it.copyFile(Ae,Se)}}))}},2764:Ae=>{"use strict";Ae.exports=addressparser;function addressparser(Ae){var Se=new Tokenizer(Ae);var Ce=Se.tokenize();var qe=[];var Fe=[];var $e=[];Ce.forEach((function(Ae){if(Ae.type==="operator"&&(Ae.value===","||Ae.value===";")){if(Fe.length){qe.push(Fe)}Fe=[]}else{Fe.push(Ae)}}));if(Fe.length){qe.push(Fe)}qe.forEach((function(Ae){Ae=_handleAddress(Ae);if(Ae.length){$e=$e.concat(Ae)}}));return $e}function _handleAddress(Ae){var Se;var Ce=false;var qe="text";var Fe;var $e=[];var rt={address:[],comment:[],group:[],text:[]};var it;var nt;for(it=0,nt=Ae.length;it=0;it--){if(rt.text[it].match(/^[^@\s]+@[^@\s]+$/)){rt.address=rt.text.splice(it,1);break}}var _regexHandler=function(Ae){if(!rt.address.length){rt.address=[Ae.trim()];return" "}else{return Ae}};if(!rt.address.length){for(it=rt.text.length-1;it>=0;it--){rt.text[it]=rt.text[it].replace(/\s*\b[^@\s]+@[^\s]+\b\s*/,_regexHandler).trim();if(rt.address.length){break}}}}if(!rt.text.length&&rt.comment.length){rt.text=rt.comment;rt.comment=[]}if(rt.address.length>1){rt.text=rt.text.concat(rt.address.splice(1))}rt.text=rt.text.join(" ");rt.address=rt.address.join(" ");if(!rt.address&&Ce){return[]}else{Fe={address:rt.address||rt.text||"",name:rt.text||rt.address||""};if(Fe.address===Fe.name){if((Fe.address||"").match(/@/)){Fe.name=""}else{Fe.address=""}}$e.push(Fe)}}return $e}function Tokenizer(Ae){this.str=(Ae||"").toString();this.operatorCurrent="";this.operatorExpecting="";this.node=null;this.escaped=false;this.list=[]}Tokenizer.prototype.operators={'"':'"',"(":")","<":">",",":"",":":";",";":""};Tokenizer.prototype.tokenize=function(){var Ae,Se=[];for(var Ce=0,qe=this.str.length;Ce{"use strict";const qe=Se;qe.bignum=Ce(6641);qe.define=Ce(5245).define;qe.base=Ce(8096);qe.constants=Ce(3371);qe.decoders=Ce(4952);qe.encoders=Ce(9083)},5245:(Ae,Se,Ce)=>{"use strict";const qe=Ce(9083);const Fe=Ce(4952);const $e=Ce(4124);const rt=Se;rt.define=function define(Ae,Se){return new Entity(Ae,Se)};function Entity(Ae,Se){this.name=Ae;this.body=Se;this.decoders={};this.encoders={}}Entity.prototype._createNamed=function createNamed(Ae){const Se=this.name;function Generated(Ae){this._initNamed(Ae,Se)}$e(Generated,Ae);Generated.prototype._initNamed=function _initNamed(Se,Ce){Ae.call(this,Se,Ce)};return new Generated(this)};Entity.prototype._getDecoder=function _getDecoder(Ae){Ae=Ae||"der";if(!this.decoders.hasOwnProperty(Ae))this.decoders[Ae]=this._createNamed(Fe[Ae]);return this.decoders[Ae]};Entity.prototype.decode=function decode(Ae,Se,Ce){return this._getDecoder(Se).decode(Ae,Ce)};Entity.prototype._getEncoder=function _getEncoder(Ae){Ae=Ae||"der";if(!this.encoders.hasOwnProperty(Ae))this.encoders[Ae]=this._createNamed(qe[Ae]);return this.encoders[Ae]};Entity.prototype.encode=function encode(Ae,Se,Ce){return this._getEncoder(Se).encode(Ae,Ce)}},5298:(Ae,Se,Ce)=>{"use strict";const qe=Ce(4124);const Fe=Ce(3744).b;const $e=Ce(5118).Buffer;function DecoderBuffer(Ae,Se){Fe.call(this,Se);if(!$e.isBuffer(Ae)){this.error("Input not Buffer");return}this.base=Ae;this.offset=0;this.length=Ae.length}qe(DecoderBuffer,Fe);Se.C=DecoderBuffer;DecoderBuffer.isDecoderBuffer=function isDecoderBuffer(Ae){if(Ae instanceof DecoderBuffer){return true}const Se=typeof Ae==="object"&&$e.isBuffer(Ae.base)&&Ae.constructor.name==="DecoderBuffer"&&typeof Ae.offset==="number"&&typeof Ae.length==="number"&&typeof Ae.save==="function"&&typeof Ae.restore==="function"&&typeof Ae.isEmpty==="function"&&typeof Ae.readUInt8==="function"&&typeof Ae.skip==="function"&&typeof Ae.raw==="function";return Se};DecoderBuffer.prototype.save=function save(){return{offset:this.offset,reporter:Fe.prototype.save.call(this)}};DecoderBuffer.prototype.restore=function restore(Ae){const Se=new DecoderBuffer(this.base);Se.offset=Ae.offset;Se.length=this.offset;this.offset=Ae.offset;Fe.prototype.restore.call(this,Ae.reporter);return Se};DecoderBuffer.prototype.isEmpty=function isEmpty(){return this.offset===this.length};DecoderBuffer.prototype.readUInt8=function readUInt8(Ae){if(this.offset+1<=this.length)return this.base.readUInt8(this.offset++,true);else return this.error(Ae||"DecoderBuffer overrun")};DecoderBuffer.prototype.skip=function skip(Ae,Se){if(!(this.offset+Ae<=this.length))return this.error(Se||"DecoderBuffer overrun");const Ce=new DecoderBuffer(this.base);Ce._reporterState=this._reporterState;Ce.offset=this.offset;Ce.length=this.offset+Ae;this.offset+=Ae;return Ce};DecoderBuffer.prototype.raw=function raw(Ae){return this.base.slice(Ae?Ae.offset:this.offset,this.length)};function EncoderBuffer(Ae,Se){if(Array.isArray(Ae)){this.length=0;this.value=Ae.map((function(Ae){if(!EncoderBuffer.isEncoderBuffer(Ae))Ae=new EncoderBuffer(Ae,Se);this.length+=Ae.length;return Ae}),this)}else if(typeof Ae==="number"){if(!(0<=Ae&&Ae<=255))return Se.error("non-byte EncoderBuffer value");this.value=Ae;this.length=1}else if(typeof Ae==="string"){this.value=Ae;this.length=$e.byteLength(Ae)}else if($e.isBuffer(Ae)){this.value=Ae;this.length=Ae.length}else{return Se.error("Unsupported type: "+typeof Ae)}}Se.R=EncoderBuffer;EncoderBuffer.isEncoderBuffer=function isEncoderBuffer(Ae){if(Ae instanceof EncoderBuffer){return true}const Se=typeof Ae==="object"&&Ae.constructor.name==="EncoderBuffer"&&typeof Ae.length==="number"&&typeof Ae.join==="function";return Se};EncoderBuffer.prototype.join=function join(Ae,Se){if(!Ae)Ae=$e.alloc(this.length);if(!Se)Se=0;if(this.length===0)return Ae;if(Array.isArray(this.value)){this.value.forEach((function(Ce){Ce.join(Ae,Se);Se+=Ce.length}))}else{if(typeof this.value==="number")Ae[Se]=this.value;else if(typeof this.value==="string")Ae.write(this.value,Se);else if($e.isBuffer(this.value))this.value.copy(Ae,Se);Se+=this.length}return Ae}},8096:(Ae,Se,Ce)=>{"use strict";const qe=Se;qe.Reporter=Ce(3744).b;qe.DecoderBuffer=Ce(5298).C;qe.EncoderBuffer=Ce(5298).R;qe.Node=Ce(842)},842:(Ae,Se,Ce)=>{"use strict";const qe=Ce(3744).b;const Fe=Ce(5298).R;const $e=Ce(5298).C;const rt=Ce(910);const it=["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"];const nt=["key","obj","use","optional","explicit","implicit","def","choice","any","contains"].concat(it);const st=["_peekTag","_decodeTag","_use","_decodeStr","_decodeObjid","_decodeTime","_decodeNull","_decodeInt","_decodeBool","_decodeList","_encodeComposite","_encodeStr","_encodeObjid","_encodeTime","_encodeNull","_encodeInt","_encodeBool"];function Node(Ae,Se,Ce){const qe={};this._baseState=qe;qe.name=Ce;qe.enc=Ae;qe.parent=Se||null;qe.children=null;qe.tag=null;qe.args=null;qe.reverseArgs=null;qe.choice=null;qe.optional=false;qe.any=false;qe.obj=false;qe.use=null;qe.useDecoder=null;qe.key=null;qe["default"]=null;qe.explicit=null;qe.implicit=null;qe.contains=null;if(!qe.parent){qe.children=[];this._wrap()}}Ae.exports=Node;const ut=["enc","parent","children","tag","args","reverseArgs","choice","optional","any","obj","use","alteredUse","key","default","explicit","implicit","contains"];Node.prototype.clone=function clone(){const Ae=this._baseState;const Se={};ut.forEach((function(Ce){Se[Ce]=Ae[Ce]}));const Ce=new this.constructor(Se.parent);Ce._baseState=Se;return Ce};Node.prototype._wrap=function wrap(){const Ae=this._baseState;nt.forEach((function(Se){this[Se]=function _wrappedMethod(){const Ce=new this.constructor(this);Ae.children.push(Ce);return Ce[Se].apply(Ce,arguments)}}),this)};Node.prototype._init=function init(Ae){const Se=this._baseState;rt(Se.parent===null);Ae.call(this);Se.children=Se.children.filter((function(Ae){return Ae._baseState.parent===this}),this);rt.equal(Se.children.length,1,"Root node can have only one child")};Node.prototype._useArgs=function useArgs(Ae){const Se=this._baseState;const Ce=Ae.filter((function(Ae){return Ae instanceof this.constructor}),this);Ae=Ae.filter((function(Ae){return!(Ae instanceof this.constructor)}),this);if(Ce.length!==0){rt(Se.children===null);Se.children=Ce;Ce.forEach((function(Ae){Ae._baseState.parent=this}),this)}if(Ae.length!==0){rt(Se.args===null);Se.args=Ae;Se.reverseArgs=Ae.map((function(Ae){if(typeof Ae!=="object"||Ae.constructor!==Object)return Ae;const Se={};Object.keys(Ae).forEach((function(Ce){if(Ce==(Ce|0))Ce|=0;const qe=Ae[Ce];Se[qe]=Ce}));return Se}))}};st.forEach((function(Ae){Node.prototype[Ae]=function _overrided(){const Se=this._baseState;throw new Error(Ae+" not implemented for encoding: "+Se.enc)}}));it.forEach((function(Ae){Node.prototype[Ae]=function _tagMethod(){const Se=this._baseState;const Ce=Array.prototype.slice.call(arguments);rt(Se.tag===null);Se.tag=Ae;this._useArgs(Ce);return this}}));Node.prototype.use=function use(Ae){rt(Ae);const Se=this._baseState;rt(Se.use===null);Se.use=Ae;return this};Node.prototype.optional=function optional(){const Ae=this._baseState;Ae.optional=true;return this};Node.prototype.def=function def(Ae){const Se=this._baseState;rt(Se["default"]===null);Se["default"]=Ae;Se.optional=true;return this};Node.prototype.explicit=function explicit(Ae){const Se=this._baseState;rt(Se.explicit===null&&Se.implicit===null);Se.explicit=Ae;return this};Node.prototype.implicit=function implicit(Ae){const Se=this._baseState;rt(Se.explicit===null&&Se.implicit===null);Se.implicit=Ae;return this};Node.prototype.obj=function obj(){const Ae=this._baseState;const Se=Array.prototype.slice.call(arguments);Ae.obj=true;if(Se.length!==0)this._useArgs(Se);return this};Node.prototype.key=function key(Ae){const Se=this._baseState;rt(Se.key===null);Se.key=Ae;return this};Node.prototype.any=function any(){const Ae=this._baseState;Ae.any=true;return this};Node.prototype.choice=function choice(Ae){const Se=this._baseState;rt(Se.choice===null);Se.choice=Ae;this._useArgs(Object.keys(Ae).map((function(Se){return Ae[Se]})));return this};Node.prototype.contains=function contains(Ae){const Se=this._baseState;rt(Se.use===null);Se.contains=Ae;return this};Node.prototype._decode=function decode(Ae,Se){const Ce=this._baseState;if(Ce.parent===null)return Ae.wrapResult(Ce.children[0]._decode(Ae,Se));let qe=Ce["default"];let Fe=true;let rt=null;if(Ce.key!==null)rt=Ae.enterKey(Ce.key);if(Ce.optional){let qe=null;if(Ce.explicit!==null)qe=Ce.explicit;else if(Ce.implicit!==null)qe=Ce.implicit;else if(Ce.tag!==null)qe=Ce.tag;if(qe===null&&!Ce.any){const qe=Ae.save();try{if(Ce.choice===null)this._decodeGeneric(Ce.tag,Ae,Se);else this._decodeChoice(Ae,Se);Fe=true}catch(Ae){Fe=false}Ae.restore(qe)}else{Fe=this._peekTag(Ae,qe,Ce.any);if(Ae.isError(Fe))return Fe}}let it;if(Ce.obj&&Fe)it=Ae.enterObject();if(Fe){if(Ce.explicit!==null){const Se=this._decodeTag(Ae,Ce.explicit);if(Ae.isError(Se))return Se;Ae=Se}const Fe=Ae.offset;if(Ce.use===null&&Ce.choice===null){let Se;if(Ce.any)Se=Ae.save();const Fe=this._decodeTag(Ae,Ce.implicit!==null?Ce.implicit:Ce.tag,Ce.any);if(Ae.isError(Fe))return Fe;if(Ce.any)qe=Ae.raw(Se);else Ae=Fe}if(Se&&Se.track&&Ce.tag!==null)Se.track(Ae.path(),Fe,Ae.length,"tagged");if(Se&&Se.track&&Ce.tag!==null)Se.track(Ae.path(),Ae.offset,Ae.length,"content");if(Ce.any){}else if(Ce.choice===null){qe=this._decodeGeneric(Ce.tag,Ae,Se)}else{qe=this._decodeChoice(Ae,Se)}if(Ae.isError(qe))return qe;if(!Ce.any&&Ce.choice===null&&Ce.children!==null){Ce.children.forEach((function decodeChildren(Ce){Ce._decode(Ae,Se)}))}if(Ce.contains&&(Ce.tag==="octstr"||Ce.tag==="bitstr")){const Fe=new $e(qe);qe=this._getUse(Ce.contains,Ae._reporterState.obj)._decode(Fe,Se)}}if(Ce.obj&&Fe)qe=Ae.leaveObject(it);if(Ce.key!==null&&(qe!==null||Fe===true))Ae.leaveKey(rt,Ce.key,qe);else if(rt!==null)Ae.exitKey(rt);return qe};Node.prototype._decodeGeneric=function decodeGeneric(Ae,Se,Ce){const qe=this._baseState;if(Ae==="seq"||Ae==="set")return null;if(Ae==="seqof"||Ae==="setof")return this._decodeList(Se,Ae,qe.args[0],Ce);else if(/str$/.test(Ae))return this._decodeStr(Se,Ae,Ce);else if(Ae==="objid"&&qe.args)return this._decodeObjid(Se,qe.args[0],qe.args[1],Ce);else if(Ae==="objid")return this._decodeObjid(Se,null,null,Ce);else if(Ae==="gentime"||Ae==="utctime")return this._decodeTime(Se,Ae,Ce);else if(Ae==="null_")return this._decodeNull(Se,Ce);else if(Ae==="bool")return this._decodeBool(Se,Ce);else if(Ae==="objDesc")return this._decodeStr(Se,Ae,Ce);else if(Ae==="int"||Ae==="enum")return this._decodeInt(Se,qe.args&&qe.args[0],Ce);if(qe.use!==null){return this._getUse(qe.use,Se._reporterState.obj)._decode(Se,Ce)}else{return Se.error("unknown tag: "+Ae)}};Node.prototype._getUse=function _getUse(Ae,Se){const Ce=this._baseState;Ce.useDecoder=this._use(Ae,Se);rt(Ce.useDecoder._baseState.parent===null);Ce.useDecoder=Ce.useDecoder._baseState.children[0];if(Ce.implicit!==Ce.useDecoder._baseState.implicit){Ce.useDecoder=Ce.useDecoder.clone();Ce.useDecoder._baseState.implicit=Ce.implicit}return Ce.useDecoder};Node.prototype._decodeChoice=function decodeChoice(Ae,Se){const Ce=this._baseState;let qe=null;let Fe=false;Object.keys(Ce.choice).some((function($e){const rt=Ae.save();const it=Ce.choice[$e];try{const Ce=it._decode(Ae,Se);if(Ae.isError(Ce))return false;qe={type:$e,value:Ce};Fe=true}catch(Se){Ae.restore(rt);return false}return true}),this);if(!Fe)return Ae.error("Choice not matched");return qe};Node.prototype._createEncoderBuffer=function createEncoderBuffer(Ae){return new Fe(Ae,this.reporter)};Node.prototype._encode=function encode(Ae,Se,Ce){const qe=this._baseState;if(qe["default"]!==null&&qe["default"]===Ae)return;const Fe=this._encodeValue(Ae,Se,Ce);if(Fe===undefined)return;if(this._skipDefault(Fe,Se,Ce))return;return Fe};Node.prototype._encodeValue=function encode(Ae,Se,Ce){const Fe=this._baseState;if(Fe.parent===null)return Fe.children[0]._encode(Ae,Se||new qe);let $e=null;this.reporter=Se;if(Fe.optional&&Ae===undefined){if(Fe["default"]!==null)Ae=Fe["default"];else return}let rt=null;let it=false;if(Fe.any){$e=this._createEncoderBuffer(Ae)}else if(Fe.choice){$e=this._encodeChoice(Ae,Se)}else if(Fe.contains){rt=this._getUse(Fe.contains,Ce)._encode(Ae,Se);it=true}else if(Fe.children){rt=Fe.children.map((function(Ce){if(Ce._baseState.tag==="null_")return Ce._encode(null,Se,Ae);if(Ce._baseState.key===null)return Se.error("Child should have a key");const qe=Se.enterKey(Ce._baseState.key);if(typeof Ae!=="object")return Se.error("Child expected, but input is not object");const Fe=Ce._encode(Ae[Ce._baseState.key],Se,Ae);Se.leaveKey(qe);return Fe}),this).filter((function(Ae){return Ae}));rt=this._createEncoderBuffer(rt)}else{if(Fe.tag==="seqof"||Fe.tag==="setof"){if(!(Fe.args&&Fe.args.length===1))return Se.error("Too many args for : "+Fe.tag);if(!Array.isArray(Ae))return Se.error("seqof/setof, but data is not Array");const Ce=this.clone();Ce._baseState.implicit=null;rt=this._createEncoderBuffer(Ae.map((function(Ce){const qe=this._baseState;return this._getUse(qe.args[0],Ae)._encode(Ce,Se)}),Ce))}else if(Fe.use!==null){$e=this._getUse(Fe.use,Ce)._encode(Ae,Se)}else{rt=this._encodePrimitive(Fe.tag,Ae);it=true}}if(!Fe.any&&Fe.choice===null){const Ae=Fe.implicit!==null?Fe.implicit:Fe.tag;const Ce=Fe.implicit===null?"universal":"context";if(Ae===null){if(Fe.use===null)Se.error("Tag could be omitted only for .use()")}else{if(Fe.use===null)$e=this._encodeComposite(Ae,it,Ce,rt)}}if(Fe.explicit!==null)$e=this._encodeComposite(Fe.explicit,false,"context",$e);return $e};Node.prototype._encodeChoice=function encodeChoice(Ae,Se){const Ce=this._baseState;const qe=Ce.choice[Ae.type];if(!qe){rt(false,Ae.type+" not found in "+JSON.stringify(Object.keys(Ce.choice)))}return qe._encode(Ae.value,Se)};Node.prototype._encodePrimitive=function encodePrimitive(Ae,Se){const Ce=this._baseState;if(/str$/.test(Ae))return this._encodeStr(Se,Ae);else if(Ae==="objid"&&Ce.args)return this._encodeObjid(Se,Ce.reverseArgs[0],Ce.args[1]);else if(Ae==="objid")return this._encodeObjid(Se,null,null);else if(Ae==="gentime"||Ae==="utctime")return this._encodeTime(Se,Ae);else if(Ae==="null_")return this._encodeNull();else if(Ae==="int"||Ae==="enum")return this._encodeInt(Se,Ce.args&&Ce.reverseArgs[0]);else if(Ae==="bool")return this._encodeBool(Se);else if(Ae==="objDesc")return this._encodeStr(Se,Ae);else throw new Error("Unsupported tag: "+Ae)};Node.prototype._isNumstr=function isNumstr(Ae){return/^[0-9 ]*$/.test(Ae)};Node.prototype._isPrintstr=function isPrintstr(Ae){return/^[A-Za-z0-9 '()+,-./:=?]*$/.test(Ae)}},3744:(Ae,Se,Ce)=>{"use strict";const qe=Ce(4124);function Reporter(Ae){this._reporterState={obj:null,path:[],options:Ae||{},errors:[]}}Se.b=Reporter;Reporter.prototype.isError=function isError(Ae){return Ae instanceof ReporterError};Reporter.prototype.save=function save(){const Ae=this._reporterState;return{obj:Ae.obj,pathLen:Ae.path.length}};Reporter.prototype.restore=function restore(Ae){const Se=this._reporterState;Se.obj=Ae.obj;Se.path=Se.path.slice(0,Ae.pathLen)};Reporter.prototype.enterKey=function enterKey(Ae){return this._reporterState.path.push(Ae)};Reporter.prototype.exitKey=function exitKey(Ae){const Se=this._reporterState;Se.path=Se.path.slice(0,Ae-1)};Reporter.prototype.leaveKey=function leaveKey(Ae,Se,Ce){const qe=this._reporterState;this.exitKey(Ae);if(qe.obj!==null)qe.obj[Se]=Ce};Reporter.prototype.path=function path(){return this._reporterState.path.join("/")};Reporter.prototype.enterObject=function enterObject(){const Ae=this._reporterState;const Se=Ae.obj;Ae.obj={};return Se};Reporter.prototype.leaveObject=function leaveObject(Ae){const Se=this._reporterState;const Ce=Se.obj;Se.obj=Ae;return Ce};Reporter.prototype.error=function error(Ae){let Se;const Ce=this._reporterState;const qe=Ae instanceof ReporterError;if(qe){Se=Ae}else{Se=new ReporterError(Ce.path.map((function(Ae){return"["+JSON.stringify(Ae)+"]"})).join(""),Ae.message||Ae,Ae.stack)}if(!Ce.options.partial)throw Se;if(!qe)Ce.errors.push(Se);return Se};Reporter.prototype.wrapResult=function wrapResult(Ae){const Se=this._reporterState;if(!Se.options.partial)return Ae;return{result:this.isError(Ae)?null:Ae,errors:Se.errors}};function ReporterError(Ae,Se){this.path=Ae;this.rethrow(Se)}qe(ReporterError,Error);ReporterError.prototype.rethrow=function rethrow(Ae){this.message=Ae+" at: "+(this.path||"(shallow)");if(Error.captureStackTrace)Error.captureStackTrace(this,ReporterError);if(!this.stack){try{throw new Error(this.message)}catch(Ae){this.stack=Ae.stack}}return this}},1188:(Ae,Se)=>{"use strict";function reverse(Ae){const Se={};Object.keys(Ae).forEach((function(Ce){if((Ce|0)==Ce)Ce=Ce|0;const qe=Ae[Ce];Se[qe]=Ce}));return Se}Se.tagClass={0:"universal",1:"application",2:"context",3:"private"};Se.tagClassByName=reverse(Se.tagClass);Se.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"};Se.tagByName=reverse(Se.tag)},3371:(Ae,Se,Ce)=>{"use strict";const qe=Se;qe._reverse=function reverse(Ae){const Se={};Object.keys(Ae).forEach((function(Ce){if((Ce|0)==Ce)Ce=Ce|0;const qe=Ae[Ce];Se[qe]=Ce}));return Se};qe.der=Ce(1188)},3332:(Ae,Se,Ce)=>{"use strict";const qe=Ce(4124);const Fe=Ce(6641);const $e=Ce(5298).C;const rt=Ce(842);const it=Ce(1188);function DERDecoder(Ae){this.enc="der";this.name=Ae.name;this.entity=Ae;this.tree=new DERNode;this.tree._init(Ae.body)}Ae.exports=DERDecoder;DERDecoder.prototype.decode=function decode(Ae,Se){if(!$e.isDecoderBuffer(Ae)){Ae=new $e(Ae,Se)}return this.tree._decode(Ae,Se)};function DERNode(Ae){rt.call(this,"der",Ae)}qe(DERNode,rt);DERNode.prototype._peekTag=function peekTag(Ae,Se,Ce){if(Ae.isEmpty())return false;const qe=Ae.save();const Fe=derDecodeTag(Ae,'Failed to peek tag: "'+Se+'"');if(Ae.isError(Fe))return Fe;Ae.restore(qe);return Fe.tag===Se||Fe.tagStr===Se||Fe.tagStr+"of"===Se||Ce};DERNode.prototype._decodeTag=function decodeTag(Ae,Se,Ce){const qe=derDecodeTag(Ae,'Failed to decode tag of "'+Se+'"');if(Ae.isError(qe))return qe;let Fe=derDecodeLen(Ae,qe.primitive,'Failed to get length of "'+Se+'"');if(Ae.isError(Fe))return Fe;if(!Ce&&qe.tag!==Se&&qe.tagStr!==Se&&qe.tagStr+"of"!==Se){return Ae.error('Failed to match tag: "'+Se+'"')}if(qe.primitive||Fe!==null)return Ae.skip(Fe,'Failed to match body of: "'+Se+'"');const $e=Ae.save();const rt=this._skipUntilEnd(Ae,'Failed to skip indefinite length body: "'+this.tag+'"');if(Ae.isError(rt))return rt;Fe=Ae.offset-$e.offset;Ae.restore($e);return Ae.skip(Fe,'Failed to match body of: "'+Se+'"')};DERNode.prototype._skipUntilEnd=function skipUntilEnd(Ae,Se){for(;;){const Ce=derDecodeTag(Ae,Se);if(Ae.isError(Ce))return Ce;const qe=derDecodeLen(Ae,Ce.primitive,Se);if(Ae.isError(qe))return qe;let Fe;if(Ce.primitive||qe!==null)Fe=Ae.skip(qe);else Fe=this._skipUntilEnd(Ae,Se);if(Ae.isError(Fe))return Fe;if(Ce.tagStr==="end")break}};DERNode.prototype._decodeList=function decodeList(Ae,Se,Ce,qe){const Fe=[];while(!Ae.isEmpty()){const Se=this._peekTag(Ae,"end");if(Ae.isError(Se))return Se;const $e=Ce.decode(Ae,"der",qe);if(Ae.isError($e)&&Se)break;Fe.push($e)}return Fe};DERNode.prototype._decodeStr=function decodeStr(Ae,Se){if(Se==="bitstr"){const Se=Ae.readUInt8();if(Ae.isError(Se))return Se;return{unused:Se,data:Ae.raw()}}else if(Se==="bmpstr"){const Se=Ae.raw();if(Se.length%2===1)return Ae.error("Decoding of string type: bmpstr length mismatch");let Ce="";for(let Ae=0;Ae>6];const Fe=(Ce&32)===0;if((Ce&31)===31){let qe=Ce;Ce=0;while((qe&128)===128){qe=Ae.readUInt8(Se);if(Ae.isError(qe))return qe;Ce<<=7;Ce|=qe&127}}else{Ce&=31}const $e=it.tag[Ce];return{cls:qe,primitive:Fe,tag:Ce,tagStr:$e}}function derDecodeLen(Ae,Se,Ce){let qe=Ae.readUInt8(Ce);if(Ae.isError(qe))return qe;if(!Se&&qe===128)return null;if((qe&128)===0){return qe}const Fe=qe&127;if(Fe>4)return Ae.error("length octect is too long");qe=0;for(let Se=0;Se{"use strict";const qe=Se;qe.der=Ce(3332);qe.pem=Ce(8361)},8361:(Ae,Se,Ce)=>{"use strict";const qe=Ce(4124);const Fe=Ce(5118).Buffer;const $e=Ce(3332);function PEMDecoder(Ae){$e.call(this,Ae);this.enc="pem"}qe(PEMDecoder,$e);Ae.exports=PEMDecoder;PEMDecoder.prototype.decode=function decode(Ae,Se){const Ce=Ae.toString().split(/[\r\n]+/g);const qe=Se.label.toUpperCase();const rt=/^-----(BEGIN|END) ([^-]+)-----$/;let it=-1;let nt=-1;for(let Ae=0;Ae{"use strict";const qe=Ce(4124);const Fe=Ce(5118).Buffer;const $e=Ce(842);const rt=Ce(1188);function DEREncoder(Ae){this.enc="der";this.name=Ae.name;this.entity=Ae;this.tree=new DERNode;this.tree._init(Ae.body)}Ae.exports=DEREncoder;DEREncoder.prototype.encode=function encode(Ae,Se){return this.tree._encode(Ae,Se).join()};function DERNode(Ae){$e.call(this,"der",Ae)}qe(DERNode,$e);DERNode.prototype._encodeComposite=function encodeComposite(Ae,Se,Ce,qe){const $e=encodeTag(Ae,Se,Ce,this.reporter);if(qe.length<128){const Ae=Fe.alloc(2);Ae[0]=$e;Ae[1]=qe.length;return this._createEncoderBuffer([Ae,qe])}let rt=1;for(let Ae=qe.length;Ae>=256;Ae>>=8)rt++;const it=Fe.alloc(1+1+rt);it[0]=$e;it[1]=128|rt;for(let Ae=1+rt,Se=qe.length;Se>0;Ae--,Se>>=8)it[Ae]=Se&255;return this._createEncoderBuffer([it,qe])};DERNode.prototype._encodeStr=function encodeStr(Ae,Se){if(Se==="bitstr"){return this._createEncoderBuffer([Ae.unused|0,Ae.data])}else if(Se==="bmpstr"){const Se=Fe.alloc(Ae.length*2);for(let Ce=0;Ce=40)return this.reporter.error("Second objid identifier OOB");Ae.splice(0,2,Ae[0]*40+Ae[1])}let qe=0;for(let Se=0;Se=128;Ce>>=7)qe++}const $e=Fe.alloc(qe);let rt=$e.length-1;for(let Se=Ae.length-1;Se>=0;Se--){let Ce=Ae[Se];$e[rt--]=Ce&127;while((Ce>>=7)>0)$e[rt--]=128|Ce&127}return this._createEncoderBuffer($e)};function two(Ae){if(Ae<10)return"0"+Ae;else return Ae}DERNode.prototype._encodeTime=function encodeTime(Ae,Se){let Ce;const qe=new Date(Ae);if(Se==="gentime"){Ce=[two(qe.getUTCFullYear()),two(qe.getUTCMonth()+1),two(qe.getUTCDate()),two(qe.getUTCHours()),two(qe.getUTCMinutes()),two(qe.getUTCSeconds()),"Z"].join("")}else if(Se==="utctime"){Ce=[two(qe.getUTCFullYear()%100),two(qe.getUTCMonth()+1),two(qe.getUTCDate()),two(qe.getUTCHours()),two(qe.getUTCMinutes()),two(qe.getUTCSeconds()),"Z"].join("")}else{this.reporter.error("Encoding "+Se+" time is not supported yet")}return this._encodeStr(Ce,"octstr")};DERNode.prototype._encodeNull=function encodeNull(){return this._createEncoderBuffer("")};DERNode.prototype._encodeInt=function encodeInt(Ae,Se){if(typeof Ae==="string"){if(!Se)return this.reporter.error("String int or enum given, but no values map");if(!Se.hasOwnProperty(Ae)){return this.reporter.error("Values map doesn't contain: "+JSON.stringify(Ae))}Ae=Se[Ae]}if(typeof Ae!=="number"&&!Fe.isBuffer(Ae)){const Se=Ae.toArray();if(!Ae.sign&&Se[0]&128){Se.unshift(0)}Ae=Fe.from(Se)}if(Fe.isBuffer(Ae)){let Se=Ae.length;if(Ae.length===0)Se++;const Ce=Fe.alloc(Se);Ae.copy(Ce);if(Ae.length===0)Ce[0]=0;return this._createEncoderBuffer(Ce)}if(Ae<128)return this._createEncoderBuffer(Ae);if(Ae<256)return this._createEncoderBuffer([0,Ae]);let Ce=1;for(let Se=Ae;Se>=256;Se>>=8)Ce++;const qe=new Array(Ce);for(let Se=qe.length-1;Se>=0;Se--){qe[Se]=Ae&255;Ae>>=8}if(qe[0]&128){qe.unshift(0)}return this._createEncoderBuffer(Fe.from(qe))};DERNode.prototype._encodeBool=function encodeBool(Ae){return this._createEncoderBuffer(Ae?255:0)};DERNode.prototype._use=function use(Ae,Se){if(typeof Ae==="function")Ae=Ae(Se);return Ae._getEncoder("der").tree};DERNode.prototype._skipDefault=function skipDefault(Ae,Se,Ce){const qe=this._baseState;let Fe;if(qe["default"]===null)return false;const $e=Ae.join();if(qe.defaultBuffer===undefined)qe.defaultBuffer=this._encodeValue(qe["default"],Se,Ce).join();if($e.length!==qe.defaultBuffer.length)return false;for(Fe=0;Fe<$e.length;Fe++)if($e[Fe]!==qe.defaultBuffer[Fe])return false;return true};function encodeTag(Ae,Se,Ce,qe){let Fe;if(Ae==="seqof")Ae="seq";else if(Ae==="setof")Ae="set";if(rt.tagByName.hasOwnProperty(Ae))Fe=rt.tagByName[Ae];else if(typeof Ae==="number"&&(Ae|0)===Ae)Fe=Ae;else return qe.error("Unknown tag: "+Ae);if(Fe>=31)return qe.error("Multi-octet tag encoding unsupported");if(!Se)Fe|=32;Fe|=rt.tagClassByName[Ce||"universal"]<<6;return Fe}},9083:(Ae,Se,Ce)=>{"use strict";const qe=Se;qe.der=Ce(5769);qe.pem=Ce(279)},279:(Ae,Se,Ce)=>{"use strict";const qe=Ce(4124);const Fe=Ce(5769);function PEMEncoder(Ae){Fe.call(this,Ae);this.enc="pem"}qe(PEMEncoder,Fe);Ae.exports=PEMEncoder;PEMEncoder.prototype.encode=function encode(Ae,Se){const Ce=Fe.prototype.encode.call(this,Ae);const qe=Ce.toString("base64");const $e=["-----BEGIN "+Se.label+"-----"];for(let Ae=0;Ae0)return Ae;return Se};BN.min=function min(Ae,Se){if(Ae.cmp(Se)<0)return Ae;return Se};BN.prototype._init=function init(Ae,Se,Ce){if(typeof Ae==="number"){return this._initNumber(Ae,Se,Ce)}if(typeof Ae==="object"){return this._initArray(Ae,Se,Ce)}if(Se==="hex"){Se=16}assert(Se===(Se|0)&&Se>=2&&Se<=36);Ae=Ae.toString().replace(/\s+/g,"");var qe=0;if(Ae[0]==="-"){qe++}if(Se===16){this._parseHex(Ae,qe)}else{this._parseBase(Ae,Se,qe)}if(Ae[0]==="-"){this.negative=1}this.strip();if(Ce!=="le")return;this._initArray(this.toArray(),Se,Ce)};BN.prototype._initNumber=function _initNumber(Ae,Se,Ce){if(Ae<0){this.negative=1;Ae=-Ae}if(Ae<67108864){this.words=[Ae&67108863];this.length=1}else if(Ae<4503599627370496){this.words=[Ae&67108863,Ae/67108864&67108863];this.length=2}else{assert(Ae<9007199254740992);this.words=[Ae&67108863,Ae/67108864&67108863,1];this.length=3}if(Ce!=="le")return;this._initArray(this.toArray(),Se,Ce)};BN.prototype._initArray=function _initArray(Ae,Se,Ce){assert(typeof Ae.length==="number");if(Ae.length<=0){this.words=[0];this.length=1;return this}this.length=Math.ceil(Ae.length/3);this.words=new Array(this.length);for(var qe=0;qe=0;qe-=3){$e=Ae[qe]|Ae[qe-1]<<8|Ae[qe-2]<<16;this.words[Fe]|=$e<>>26-rt&67108863;rt+=24;if(rt>=26){rt-=26;Fe++}}}else if(Ce==="le"){for(qe=0,Fe=0;qe>>26-rt&67108863;rt+=24;if(rt>=26){rt-=26;Fe++}}}return this.strip()};function parseHex(Ae,Se,Ce){var qe=0;var Fe=Math.min(Ae.length,Ce);for(var $e=Se;$e=49&&rt<=54){qe|=rt-49+10}else if(rt>=17&&rt<=22){qe|=rt-17+10}else{qe|=rt&15}}return qe}BN.prototype._parseHex=function _parseHex(Ae,Se){this.length=Math.ceil((Ae.length-Se)/6);this.words=new Array(this.length);for(var Ce=0;Ce=Se;Ce-=6){Fe=parseHex(Ae,Ce,Ce+6);this.words[qe]|=Fe<<$e&67108863;this.words[qe+1]|=Fe>>>26-$e&4194303;$e+=24;if($e>=26){$e-=26;qe++}}if(Ce+6!==Se){Fe=parseHex(Ae,Se,Ce+6);this.words[qe]|=Fe<<$e&67108863;this.words[qe+1]|=Fe>>>26-$e&4194303}this.strip()};function parseBase(Ae,Se,Ce,qe){var Fe=0;var $e=Math.min(Ae.length,Ce);for(var rt=Se;rt<$e;rt++){var it=Ae.charCodeAt(rt)-48;Fe*=qe;if(it>=49){Fe+=it-49+10}else if(it>=17){Fe+=it-17+10}else{Fe+=it}}return Fe}BN.prototype._parseBase=function _parseBase(Ae,Se,Ce){this.words=[0];this.length=1;for(var qe=0,Fe=1;Fe<=67108863;Fe*=Se){qe++}qe--;Fe=Fe/Se|0;var $e=Ae.length-Ce;var rt=$e%qe;var it=Math.min($e,$e-rt)+Ce;var nt=0;for(var st=Ce;st1&&this.words[this.length-1]===0){this.length--}return this._normSign()};BN.prototype._normSign=function _normSign(){if(this.length===1&&this.words[0]===0){this.negative=0}return this};BN.prototype.inspect=function inspect(){return(this.red?""};var Fe=["","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"];var $e=[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];var rt=[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];BN.prototype.toString=function toString(Ae,Se){Ae=Ae||10;Se=Se|0||1;var Ce;if(Ae===16||Ae==="hex"){Ce="";var qe=0;var it=0;for(var nt=0;nt>>24-qe&16777215;if(it!==0||nt!==this.length-1){Ce=Fe[6-ut.length]+ut+Ce}else{Ce=ut+Ce}qe+=2;if(qe>=26){qe-=26;nt--}}if(it!==0){Ce=it.toString(16)+Ce}while(Ce.length%Se!==0){Ce="0"+Ce}if(this.negative!==0){Ce="-"+Ce}return Ce}if(Ae===(Ae|0)&&Ae>=2&&Ae<=36){var ht=$e[Ae];var ft=rt[Ae];Ce="";var yt=this.clone();yt.negative=0;while(!yt.isZero()){var vt=yt.modn(ft).toString(Ae);yt=yt.idivn(ft);if(!yt.isZero()){Ce=Fe[ht-vt.length]+vt+Ce}else{Ce=vt+Ce}}if(this.isZero()){Ce="0"+Ce}while(Ce.length%Se!==0){Ce="0"+Ce}if(this.negative!==0){Ce="-"+Ce}return Ce}assert(false,"Base should be between 2 and 36")};BN.prototype.toNumber=function toNumber(){var Ae=this.words[0];if(this.length===2){Ae+=this.words[1]*67108864}else if(this.length===3&&this.words[2]===1){Ae+=4503599627370496+this.words[1]*67108864}else if(this.length>2){assert(false,"Number can only safely store up to 53 bits")}return this.negative!==0?-Ae:Ae};BN.prototype.toJSON=function toJSON(){return this.toString(16)};BN.prototype.toBuffer=function toBuffer(Ae,Se){assert(typeof qe!=="undefined");return this.toArrayLike(qe,Ae,Se)};BN.prototype.toArray=function toArray(Ae,Se){return this.toArrayLike(Array,Ae,Se)};BN.prototype.toArrayLike=function toArrayLike(Ae,Se,Ce){var qe=this.byteLength();var Fe=Ce||Math.max(1,qe);assert(qe<=Fe,"byte array longer than desired length");assert(Fe>0,"Requested array length <= 0");this.strip();var $e=Se==="le";var rt=new Ae(Fe);var it,nt;var st=this.clone();if(!$e){for(nt=0;nt=4096){Ce+=13;Se>>>=13}if(Se>=64){Ce+=7;Se>>>=7}if(Se>=8){Ce+=4;Se>>>=4}if(Se>=2){Ce+=2;Se>>>=2}return Ce+Se}}BN.prototype._zeroBits=function _zeroBits(Ae){if(Ae===0)return 26;var Se=Ae;var Ce=0;if((Se&8191)===0){Ce+=13;Se>>>=13}if((Se&127)===0){Ce+=7;Se>>>=7}if((Se&15)===0){Ce+=4;Se>>>=4}if((Se&3)===0){Ce+=2;Se>>>=2}if((Se&1)===0){Ce++}return Ce};BN.prototype.bitLength=function bitLength(){var Ae=this.words[this.length-1];var Se=this._countBits(Ae);return(this.length-1)*26+Se};function toBitArray(Ae){var Se=new Array(Ae.bitLength());for(var Ce=0;Ce>>Fe}return Se}BN.prototype.zeroBits=function zeroBits(){if(this.isZero())return 0;var Ae=0;for(var Se=0;SeAe.length)return this.clone().ior(Ae);return Ae.clone().ior(this)};BN.prototype.uor=function uor(Ae){if(this.length>Ae.length)return this.clone().iuor(Ae);return Ae.clone().iuor(this)};BN.prototype.iuand=function iuand(Ae){var Se;if(this.length>Ae.length){Se=Ae}else{Se=this}for(var Ce=0;CeAe.length)return this.clone().iand(Ae);return Ae.clone().iand(this)};BN.prototype.uand=function uand(Ae){if(this.length>Ae.length)return this.clone().iuand(Ae);return Ae.clone().iuand(this)};BN.prototype.iuxor=function iuxor(Ae){var Se;var Ce;if(this.length>Ae.length){Se=this;Ce=Ae}else{Se=Ae;Ce=this}for(var qe=0;qeAe.length)return this.clone().ixor(Ae);return Ae.clone().ixor(this)};BN.prototype.uxor=function uxor(Ae){if(this.length>Ae.length)return this.clone().iuxor(Ae);return Ae.clone().iuxor(this)};BN.prototype.inotn=function inotn(Ae){assert(typeof Ae==="number"&&Ae>=0);var Se=Math.ceil(Ae/26)|0;var Ce=Ae%26;this._expand(Se);if(Ce>0){Se--}for(var qe=0;qe0){this.words[qe]=~this.words[qe]&67108863>>26-Ce}return this.strip()};BN.prototype.notn=function notn(Ae){return this.clone().inotn(Ae)};BN.prototype.setn=function setn(Ae,Se){assert(typeof Ae==="number"&&Ae>=0);var Ce=Ae/26|0;var qe=Ae%26;this._expand(Ce+1);if(Se){this.words[Ce]=this.words[Ce]|1<Ae.length){Ce=this;qe=Ae}else{Ce=Ae;qe=this}var Fe=0;for(var $e=0;$e>>26}for(;Fe!==0&&$e>>26}this.length=Ce.length;if(Fe!==0){this.words[this.length]=Fe;this.length++}else if(Ce!==this){for(;$eAe.length)return this.clone().iadd(Ae);return Ae.clone().iadd(this)};BN.prototype.isub=function isub(Ae){if(Ae.negative!==0){Ae.negative=0;var Se=this.iadd(Ae);Ae.negative=1;return Se._normSign()}else if(this.negative!==0){this.negative=0;this.iadd(Ae);this.negative=1;return this._normSign()}var Ce=this.cmp(Ae);if(Ce===0){this.negative=0;this.length=1;this.words[0]=0;return this}var qe,Fe;if(Ce>0){qe=this;Fe=Ae}else{qe=Ae;Fe=this}var $e=0;for(var rt=0;rt>26;this.words[rt]=Se&67108863}for(;$e!==0&&rt>26;this.words[rt]=Se&67108863}if($e===0&&rt>>26;var ht=nt&67108863;var ft=Math.min(st,Se.length-1);for(var yt=Math.max(0,st-Ae.length+1);yt<=ft;yt++){var vt=st-yt|0;Fe=Ae.words[vt]|0;$e=Se.words[yt]|0;rt=Fe*$e+ht;ut+=rt/67108864|0;ht=rt&67108863}Ce.words[st]=ht|0;nt=ut|0}if(nt!==0){Ce.words[st]=nt|0}else{Ce.length--}return Ce.strip()}var it=function comb10MulTo(Ae,Se,Ce){var qe=Ae.words;var Fe=Se.words;var $e=Ce.words;var rt=0;var it;var nt;var st;var ut=qe[0]|0;var ht=ut&8191;var ft=ut>>>13;var yt=qe[1]|0;var vt=yt&8191;var _t=yt>>>13;var Ct=qe[2]|0;var Rt=Ct&8191;var Ut=Ct>>>13;var It=qe[3]|0;var Ot=It&8191;var Nt=It>>>13;var jt=qe[4]|0;var Ft=jt&8191;var Lt=jt>>>13;var Ht=qe[5]|0;var Wt=Ht&8191;var Gt=Ht>>>13;var $t=qe[6]|0;var Vt=$t&8191;var Qt=$t>>>13;var Zt=qe[7]|0;var Xt=Zt&8191;var er=Zt>>>13;var tr=qe[8]|0;var rr=tr&8191;var ir=tr>>>13;var nr=qe[9]|0;var sr=nr&8191;var ar=nr>>>13;var cr=Fe[0]|0;var ur=cr&8191;var hr=cr>>>13;var dr=Fe[1]|0;var lr=dr&8191;var fr=dr>>>13;var yr=Fe[2]|0;var Cr=yr&8191;var Dr=yr>>>13;var Rr=Fe[3]|0;var Kr=Rr&8191;var Tr=Rr>>>13;var Ur=Fe[4]|0;var Ir=Ur&8191;var Or=Ur>>>13;var Nr=Fe[5]|0;var jr=Nr&8191;var Lr=Nr>>>13;var Hr=Fe[6]|0;var Qr=Hr&8191;var ti=Hr>>>13;var ri=Fe[7]|0;var ii=ri&8191;var oi=ri>>>13;var ci=Fe[8]|0;var di=ci&8191;var li=ci>>>13;var fi=Fe[9]|0;var pi=fi&8191;var yi=fi>>>13;Ce.negative=Ae.negative^Se.negative;Ce.length=19;it=Math.imul(ht,ur);nt=Math.imul(ht,hr);nt=nt+Math.imul(ft,ur)|0;st=Math.imul(ft,hr);var mi=(rt+it|0)+((nt&8191)<<13)|0;rt=(st+(nt>>>13)|0)+(mi>>>26)|0;mi&=67108863;it=Math.imul(vt,ur);nt=Math.imul(vt,hr);nt=nt+Math.imul(_t,ur)|0;st=Math.imul(_t,hr);it=it+Math.imul(ht,lr)|0;nt=nt+Math.imul(ht,fr)|0;nt=nt+Math.imul(ft,lr)|0;st=st+Math.imul(ft,fr)|0;var vi=(rt+it|0)+((nt&8191)<<13)|0;rt=(st+(nt>>>13)|0)+(vi>>>26)|0;vi&=67108863;it=Math.imul(Rt,ur);nt=Math.imul(Rt,hr);nt=nt+Math.imul(Ut,ur)|0;st=Math.imul(Ut,hr);it=it+Math.imul(vt,lr)|0;nt=nt+Math.imul(vt,fr)|0;nt=nt+Math.imul(_t,lr)|0;st=st+Math.imul(_t,fr)|0;it=it+Math.imul(ht,Cr)|0;nt=nt+Math.imul(ht,Dr)|0;nt=nt+Math.imul(ft,Cr)|0;st=st+Math.imul(ft,Dr)|0;var wi=(rt+it|0)+((nt&8191)<<13)|0;rt=(st+(nt>>>13)|0)+(wi>>>26)|0;wi&=67108863;it=Math.imul(Ot,ur);nt=Math.imul(Ot,hr);nt=nt+Math.imul(Nt,ur)|0;st=Math.imul(Nt,hr);it=it+Math.imul(Rt,lr)|0;nt=nt+Math.imul(Rt,fr)|0;nt=nt+Math.imul(Ut,lr)|0;st=st+Math.imul(Ut,fr)|0;it=it+Math.imul(vt,Cr)|0;nt=nt+Math.imul(vt,Dr)|0;nt=nt+Math.imul(_t,Cr)|0;st=st+Math.imul(_t,Dr)|0;it=it+Math.imul(ht,Kr)|0;nt=nt+Math.imul(ht,Tr)|0;nt=nt+Math.imul(ft,Kr)|0;st=st+Math.imul(ft,Tr)|0;var ki=(rt+it|0)+((nt&8191)<<13)|0;rt=(st+(nt>>>13)|0)+(ki>>>26)|0;ki&=67108863;it=Math.imul(Ft,ur);nt=Math.imul(Ft,hr);nt=nt+Math.imul(Lt,ur)|0;st=Math.imul(Lt,hr);it=it+Math.imul(Ot,lr)|0;nt=nt+Math.imul(Ot,fr)|0;nt=nt+Math.imul(Nt,lr)|0;st=st+Math.imul(Nt,fr)|0;it=it+Math.imul(Rt,Cr)|0;nt=nt+Math.imul(Rt,Dr)|0;nt=nt+Math.imul(Ut,Cr)|0;st=st+Math.imul(Ut,Dr)|0;it=it+Math.imul(vt,Kr)|0;nt=nt+Math.imul(vt,Tr)|0;nt=nt+Math.imul(_t,Kr)|0;st=st+Math.imul(_t,Tr)|0;it=it+Math.imul(ht,Ir)|0;nt=nt+Math.imul(ht,Or)|0;nt=nt+Math.imul(ft,Ir)|0;st=st+Math.imul(ft,Or)|0;var Si=(rt+it|0)+((nt&8191)<<13)|0;rt=(st+(nt>>>13)|0)+(Si>>>26)|0;Si&=67108863;it=Math.imul(Wt,ur);nt=Math.imul(Wt,hr);nt=nt+Math.imul(Gt,ur)|0;st=Math.imul(Gt,hr);it=it+Math.imul(Ft,lr)|0;nt=nt+Math.imul(Ft,fr)|0;nt=nt+Math.imul(Lt,lr)|0;st=st+Math.imul(Lt,fr)|0;it=it+Math.imul(Ot,Cr)|0;nt=nt+Math.imul(Ot,Dr)|0;nt=nt+Math.imul(Nt,Cr)|0;st=st+Math.imul(Nt,Dr)|0;it=it+Math.imul(Rt,Kr)|0;nt=nt+Math.imul(Rt,Tr)|0;nt=nt+Math.imul(Ut,Kr)|0;st=st+Math.imul(Ut,Tr)|0;it=it+Math.imul(vt,Ir)|0;nt=nt+Math.imul(vt,Or)|0;nt=nt+Math.imul(_t,Ir)|0;st=st+Math.imul(_t,Or)|0;it=it+Math.imul(ht,jr)|0;nt=nt+Math.imul(ht,Lr)|0;nt=nt+Math.imul(ft,jr)|0;st=st+Math.imul(ft,Lr)|0;var Ei=(rt+it|0)+((nt&8191)<<13)|0;rt=(st+(nt>>>13)|0)+(Ei>>>26)|0;Ei&=67108863;it=Math.imul(Vt,ur);nt=Math.imul(Vt,hr);nt=nt+Math.imul(Qt,ur)|0;st=Math.imul(Qt,hr);it=it+Math.imul(Wt,lr)|0;nt=nt+Math.imul(Wt,fr)|0;nt=nt+Math.imul(Gt,lr)|0;st=st+Math.imul(Gt,fr)|0;it=it+Math.imul(Ft,Cr)|0;nt=nt+Math.imul(Ft,Dr)|0;nt=nt+Math.imul(Lt,Cr)|0;st=st+Math.imul(Lt,Dr)|0;it=it+Math.imul(Ot,Kr)|0;nt=nt+Math.imul(Ot,Tr)|0;nt=nt+Math.imul(Nt,Kr)|0;st=st+Math.imul(Nt,Tr)|0;it=it+Math.imul(Rt,Ir)|0;nt=nt+Math.imul(Rt,Or)|0;nt=nt+Math.imul(Ut,Ir)|0;st=st+Math.imul(Ut,Or)|0;it=it+Math.imul(vt,jr)|0;nt=nt+Math.imul(vt,Lr)|0;nt=nt+Math.imul(_t,jr)|0;st=st+Math.imul(_t,Lr)|0;it=it+Math.imul(ht,Qr)|0;nt=nt+Math.imul(ht,ti)|0;nt=nt+Math.imul(ft,Qr)|0;st=st+Math.imul(ft,ti)|0;var Mi=(rt+it|0)+((nt&8191)<<13)|0;rt=(st+(nt>>>13)|0)+(Mi>>>26)|0;Mi&=67108863;it=Math.imul(Xt,ur);nt=Math.imul(Xt,hr);nt=nt+Math.imul(er,ur)|0;st=Math.imul(er,hr);it=it+Math.imul(Vt,lr)|0;nt=nt+Math.imul(Vt,fr)|0;nt=nt+Math.imul(Qt,lr)|0;st=st+Math.imul(Qt,fr)|0;it=it+Math.imul(Wt,Cr)|0;nt=nt+Math.imul(Wt,Dr)|0;nt=nt+Math.imul(Gt,Cr)|0;st=st+Math.imul(Gt,Dr)|0;it=it+Math.imul(Ft,Kr)|0;nt=nt+Math.imul(Ft,Tr)|0;nt=nt+Math.imul(Lt,Kr)|0;st=st+Math.imul(Lt,Tr)|0;it=it+Math.imul(Ot,Ir)|0;nt=nt+Math.imul(Ot,Or)|0;nt=nt+Math.imul(Nt,Ir)|0;st=st+Math.imul(Nt,Or)|0;it=it+Math.imul(Rt,jr)|0;nt=nt+Math.imul(Rt,Lr)|0;nt=nt+Math.imul(Ut,jr)|0;st=st+Math.imul(Ut,Lr)|0;it=it+Math.imul(vt,Qr)|0;nt=nt+Math.imul(vt,ti)|0;nt=nt+Math.imul(_t,Qr)|0;st=st+Math.imul(_t,ti)|0;it=it+Math.imul(ht,ii)|0;nt=nt+Math.imul(ht,oi)|0;nt=nt+Math.imul(ft,ii)|0;st=st+Math.imul(ft,oi)|0;var Pi=(rt+it|0)+((nt&8191)<<13)|0;rt=(st+(nt>>>13)|0)+(Pi>>>26)|0;Pi&=67108863;it=Math.imul(rr,ur);nt=Math.imul(rr,hr);nt=nt+Math.imul(ir,ur)|0;st=Math.imul(ir,hr);it=it+Math.imul(Xt,lr)|0;nt=nt+Math.imul(Xt,fr)|0;nt=nt+Math.imul(er,lr)|0;st=st+Math.imul(er,fr)|0;it=it+Math.imul(Vt,Cr)|0;nt=nt+Math.imul(Vt,Dr)|0;nt=nt+Math.imul(Qt,Cr)|0;st=st+Math.imul(Qt,Dr)|0;it=it+Math.imul(Wt,Kr)|0;nt=nt+Math.imul(Wt,Tr)|0;nt=nt+Math.imul(Gt,Kr)|0;st=st+Math.imul(Gt,Tr)|0;it=it+Math.imul(Ft,Ir)|0;nt=nt+Math.imul(Ft,Or)|0;nt=nt+Math.imul(Lt,Ir)|0;st=st+Math.imul(Lt,Or)|0;it=it+Math.imul(Ot,jr)|0;nt=nt+Math.imul(Ot,Lr)|0;nt=nt+Math.imul(Nt,jr)|0;st=st+Math.imul(Nt,Lr)|0;it=it+Math.imul(Rt,Qr)|0;nt=nt+Math.imul(Rt,ti)|0;nt=nt+Math.imul(Ut,Qr)|0;st=st+Math.imul(Ut,ti)|0;it=it+Math.imul(vt,ii)|0;nt=nt+Math.imul(vt,oi)|0;nt=nt+Math.imul(_t,ii)|0;st=st+Math.imul(_t,oi)|0;it=it+Math.imul(ht,di)|0;nt=nt+Math.imul(ht,li)|0;nt=nt+Math.imul(ft,di)|0;st=st+Math.imul(ft,li)|0;var xi=(rt+it|0)+((nt&8191)<<13)|0;rt=(st+(nt>>>13)|0)+(xi>>>26)|0;xi&=67108863;it=Math.imul(sr,ur);nt=Math.imul(sr,hr);nt=nt+Math.imul(ar,ur)|0;st=Math.imul(ar,hr);it=it+Math.imul(rr,lr)|0;nt=nt+Math.imul(rr,fr)|0;nt=nt+Math.imul(ir,lr)|0;st=st+Math.imul(ir,fr)|0;it=it+Math.imul(Xt,Cr)|0;nt=nt+Math.imul(Xt,Dr)|0;nt=nt+Math.imul(er,Cr)|0;st=st+Math.imul(er,Dr)|0;it=it+Math.imul(Vt,Kr)|0;nt=nt+Math.imul(Vt,Tr)|0;nt=nt+Math.imul(Qt,Kr)|0;st=st+Math.imul(Qt,Tr)|0;it=it+Math.imul(Wt,Ir)|0;nt=nt+Math.imul(Wt,Or)|0;nt=nt+Math.imul(Gt,Ir)|0;st=st+Math.imul(Gt,Or)|0;it=it+Math.imul(Ft,jr)|0;nt=nt+Math.imul(Ft,Lr)|0;nt=nt+Math.imul(Lt,jr)|0;st=st+Math.imul(Lt,Lr)|0;it=it+Math.imul(Ot,Qr)|0;nt=nt+Math.imul(Ot,ti)|0;nt=nt+Math.imul(Nt,Qr)|0;st=st+Math.imul(Nt,ti)|0;it=it+Math.imul(Rt,ii)|0;nt=nt+Math.imul(Rt,oi)|0;nt=nt+Math.imul(Ut,ii)|0;st=st+Math.imul(Ut,oi)|0;it=it+Math.imul(vt,di)|0;nt=nt+Math.imul(vt,li)|0;nt=nt+Math.imul(_t,di)|0;st=st+Math.imul(_t,li)|0;it=it+Math.imul(ht,pi)|0;nt=nt+Math.imul(ht,yi)|0;nt=nt+Math.imul(ft,pi)|0;st=st+Math.imul(ft,yi)|0;var Ci=(rt+it|0)+((nt&8191)<<13)|0;rt=(st+(nt>>>13)|0)+(Ci>>>26)|0;Ci&=67108863;it=Math.imul(sr,lr);nt=Math.imul(sr,fr);nt=nt+Math.imul(ar,lr)|0;st=Math.imul(ar,fr);it=it+Math.imul(rr,Cr)|0;nt=nt+Math.imul(rr,Dr)|0;nt=nt+Math.imul(ir,Cr)|0;st=st+Math.imul(ir,Dr)|0;it=it+Math.imul(Xt,Kr)|0;nt=nt+Math.imul(Xt,Tr)|0;nt=nt+Math.imul(er,Kr)|0;st=st+Math.imul(er,Tr)|0;it=it+Math.imul(Vt,Ir)|0;nt=nt+Math.imul(Vt,Or)|0;nt=nt+Math.imul(Qt,Ir)|0;st=st+Math.imul(Qt,Or)|0;it=it+Math.imul(Wt,jr)|0;nt=nt+Math.imul(Wt,Lr)|0;nt=nt+Math.imul(Gt,jr)|0;st=st+Math.imul(Gt,Lr)|0;it=it+Math.imul(Ft,Qr)|0;nt=nt+Math.imul(Ft,ti)|0;nt=nt+Math.imul(Lt,Qr)|0;st=st+Math.imul(Lt,ti)|0;it=it+Math.imul(Ot,ii)|0;nt=nt+Math.imul(Ot,oi)|0;nt=nt+Math.imul(Nt,ii)|0;st=st+Math.imul(Nt,oi)|0;it=it+Math.imul(Rt,di)|0;nt=nt+Math.imul(Rt,li)|0;nt=nt+Math.imul(Ut,di)|0;st=st+Math.imul(Ut,li)|0;it=it+Math.imul(vt,pi)|0;nt=nt+Math.imul(vt,yi)|0;nt=nt+Math.imul(_t,pi)|0;st=st+Math.imul(_t,yi)|0;var Di=(rt+it|0)+((nt&8191)<<13)|0;rt=(st+(nt>>>13)|0)+(Di>>>26)|0;Di&=67108863;it=Math.imul(sr,Cr);nt=Math.imul(sr,Dr);nt=nt+Math.imul(ar,Cr)|0;st=Math.imul(ar,Dr);it=it+Math.imul(rr,Kr)|0;nt=nt+Math.imul(rr,Tr)|0;nt=nt+Math.imul(ir,Kr)|0;st=st+Math.imul(ir,Tr)|0;it=it+Math.imul(Xt,Ir)|0;nt=nt+Math.imul(Xt,Or)|0;nt=nt+Math.imul(er,Ir)|0;st=st+Math.imul(er,Or)|0;it=it+Math.imul(Vt,jr)|0;nt=nt+Math.imul(Vt,Lr)|0;nt=nt+Math.imul(Qt,jr)|0;st=st+Math.imul(Qt,Lr)|0;it=it+Math.imul(Wt,Qr)|0;nt=nt+Math.imul(Wt,ti)|0;nt=nt+Math.imul(Gt,Qr)|0;st=st+Math.imul(Gt,ti)|0;it=it+Math.imul(Ft,ii)|0;nt=nt+Math.imul(Ft,oi)|0;nt=nt+Math.imul(Lt,ii)|0;st=st+Math.imul(Lt,oi)|0;it=it+Math.imul(Ot,di)|0;nt=nt+Math.imul(Ot,li)|0;nt=nt+Math.imul(Nt,di)|0;st=st+Math.imul(Nt,li)|0;it=it+Math.imul(Rt,pi)|0;nt=nt+Math.imul(Rt,yi)|0;nt=nt+Math.imul(Ut,pi)|0;st=st+Math.imul(Ut,yi)|0;var Ki=(rt+it|0)+((nt&8191)<<13)|0;rt=(st+(nt>>>13)|0)+(Ki>>>26)|0;Ki&=67108863;it=Math.imul(sr,Kr);nt=Math.imul(sr,Tr);nt=nt+Math.imul(ar,Kr)|0;st=Math.imul(ar,Tr);it=it+Math.imul(rr,Ir)|0;nt=nt+Math.imul(rr,Or)|0;nt=nt+Math.imul(ir,Ir)|0;st=st+Math.imul(ir,Or)|0;it=it+Math.imul(Xt,jr)|0;nt=nt+Math.imul(Xt,Lr)|0;nt=nt+Math.imul(er,jr)|0;st=st+Math.imul(er,Lr)|0;it=it+Math.imul(Vt,Qr)|0;nt=nt+Math.imul(Vt,ti)|0;nt=nt+Math.imul(Qt,Qr)|0;st=st+Math.imul(Qt,ti)|0;it=it+Math.imul(Wt,ii)|0;nt=nt+Math.imul(Wt,oi)|0;nt=nt+Math.imul(Gt,ii)|0;st=st+Math.imul(Gt,oi)|0;it=it+Math.imul(Ft,di)|0;nt=nt+Math.imul(Ft,li)|0;nt=nt+Math.imul(Lt,di)|0;st=st+Math.imul(Lt,li)|0;it=it+Math.imul(Ot,pi)|0;nt=nt+Math.imul(Ot,yi)|0;nt=nt+Math.imul(Nt,pi)|0;st=st+Math.imul(Nt,yi)|0;var Ti=(rt+it|0)+((nt&8191)<<13)|0;rt=(st+(nt>>>13)|0)+(Ti>>>26)|0;Ti&=67108863;it=Math.imul(sr,Ir);nt=Math.imul(sr,Or);nt=nt+Math.imul(ar,Ir)|0;st=Math.imul(ar,Or);it=it+Math.imul(rr,jr)|0;nt=nt+Math.imul(rr,Lr)|0;nt=nt+Math.imul(ir,jr)|0;st=st+Math.imul(ir,Lr)|0;it=it+Math.imul(Xt,Qr)|0;nt=nt+Math.imul(Xt,ti)|0;nt=nt+Math.imul(er,Qr)|0;st=st+Math.imul(er,ti)|0;it=it+Math.imul(Vt,ii)|0;nt=nt+Math.imul(Vt,oi)|0;nt=nt+Math.imul(Qt,ii)|0;st=st+Math.imul(Qt,oi)|0;it=it+Math.imul(Wt,di)|0;nt=nt+Math.imul(Wt,li)|0;nt=nt+Math.imul(Gt,di)|0;st=st+Math.imul(Gt,li)|0;it=it+Math.imul(Ft,pi)|0;nt=nt+Math.imul(Ft,yi)|0;nt=nt+Math.imul(Lt,pi)|0;st=st+Math.imul(Lt,yi)|0;var Ui=(rt+it|0)+((nt&8191)<<13)|0;rt=(st+(nt>>>13)|0)+(Ui>>>26)|0;Ui&=67108863;it=Math.imul(sr,jr);nt=Math.imul(sr,Lr);nt=nt+Math.imul(ar,jr)|0;st=Math.imul(ar,Lr);it=it+Math.imul(rr,Qr)|0;nt=nt+Math.imul(rr,ti)|0;nt=nt+Math.imul(ir,Qr)|0;st=st+Math.imul(ir,ti)|0;it=it+Math.imul(Xt,ii)|0;nt=nt+Math.imul(Xt,oi)|0;nt=nt+Math.imul(er,ii)|0;st=st+Math.imul(er,oi)|0;it=it+Math.imul(Vt,di)|0;nt=nt+Math.imul(Vt,li)|0;nt=nt+Math.imul(Qt,di)|0;st=st+Math.imul(Qt,li)|0;it=it+Math.imul(Wt,pi)|0;nt=nt+Math.imul(Wt,yi)|0;nt=nt+Math.imul(Gt,pi)|0;st=st+Math.imul(Gt,yi)|0;var Ni=(rt+it|0)+((nt&8191)<<13)|0;rt=(st+(nt>>>13)|0)+(Ni>>>26)|0;Ni&=67108863;it=Math.imul(sr,Qr);nt=Math.imul(sr,ti);nt=nt+Math.imul(ar,Qr)|0;st=Math.imul(ar,ti);it=it+Math.imul(rr,ii)|0;nt=nt+Math.imul(rr,oi)|0;nt=nt+Math.imul(ir,ii)|0;st=st+Math.imul(ir,oi)|0;it=it+Math.imul(Xt,di)|0;nt=nt+Math.imul(Xt,li)|0;nt=nt+Math.imul(er,di)|0;st=st+Math.imul(er,li)|0;it=it+Math.imul(Vt,pi)|0;nt=nt+Math.imul(Vt,yi)|0;nt=nt+Math.imul(Qt,pi)|0;st=st+Math.imul(Qt,yi)|0;var zi=(rt+it|0)+((nt&8191)<<13)|0;rt=(st+(nt>>>13)|0)+(zi>>>26)|0;zi&=67108863;it=Math.imul(sr,ii);nt=Math.imul(sr,oi);nt=nt+Math.imul(ar,ii)|0;st=Math.imul(ar,oi);it=it+Math.imul(rr,di)|0;nt=nt+Math.imul(rr,li)|0;nt=nt+Math.imul(ir,di)|0;st=st+Math.imul(ir,li)|0;it=it+Math.imul(Xt,pi)|0;nt=nt+Math.imul(Xt,yi)|0;nt=nt+Math.imul(er,pi)|0;st=st+Math.imul(er,yi)|0;var ji=(rt+it|0)+((nt&8191)<<13)|0;rt=(st+(nt>>>13)|0)+(ji>>>26)|0;ji&=67108863;it=Math.imul(sr,di);nt=Math.imul(sr,li);nt=nt+Math.imul(ar,di)|0;st=Math.imul(ar,li);it=it+Math.imul(rr,pi)|0;nt=nt+Math.imul(rr,yi)|0;nt=nt+Math.imul(ir,pi)|0;st=st+Math.imul(ir,yi)|0;var qi=(rt+it|0)+((nt&8191)<<13)|0;rt=(st+(nt>>>13)|0)+(qi>>>26)|0;qi&=67108863;it=Math.imul(sr,pi);nt=Math.imul(sr,yi);nt=nt+Math.imul(ar,pi)|0;st=Math.imul(ar,yi);var Wi=(rt+it|0)+((nt&8191)<<13)|0;rt=(st+(nt>>>13)|0)+(Wi>>>26)|0;Wi&=67108863;$e[0]=mi;$e[1]=vi;$e[2]=wi;$e[3]=ki;$e[4]=Si;$e[5]=Ei;$e[6]=Mi;$e[7]=Pi;$e[8]=xi;$e[9]=Ci;$e[10]=Di;$e[11]=Ki;$e[12]=Ti;$e[13]=Ui;$e[14]=Ni;$e[15]=zi;$e[16]=ji;$e[17]=qi;$e[18]=Wi;if(rt!==0){$e[19]=rt;Ce.length++}return Ce};if(!Math.imul){it=smallMulTo}function bigMulTo(Ae,Se,Ce){Ce.negative=Se.negative^Ae.negative;Ce.length=Ae.length+Se.length;var qe=0;var Fe=0;for(var $e=0;$e>>26)|0;Fe+=rt>>>26;rt&=67108863}Ce.words[$e]=it;qe=rt;rt=Fe}if(qe!==0){Ce.words[$e]=qe}else{Ce.length--}return Ce.strip()}function jumboMulTo(Ae,Se,Ce){var qe=new FFTM;return qe.mulp(Ae,Se,Ce)}BN.prototype.mulTo=function mulTo(Ae,Se){var Ce;var qe=this.length+Ae.length;if(this.length===10&&Ae.length===10){Ce=it(this,Ae,Se)}else if(qe<63){Ce=smallMulTo(this,Ae,Se)}else if(qe<1024){Ce=bigMulTo(this,Ae,Se)}else{Ce=jumboMulTo(this,Ae,Se)}return Ce};function FFTM(Ae,Se){this.x=Ae;this.y=Se}FFTM.prototype.makeRBT=function makeRBT(Ae){var Se=new Array(Ae);var Ce=BN.prototype._countBits(Ae)-1;for(var qe=0;qe>=1}return qe};FFTM.prototype.permute=function permute(Ae,Se,Ce,qe,Fe,$e){for(var rt=0;rt<$e;rt++){qe[rt]=Se[Ae[rt]];Fe[rt]=Ce[Ae[rt]]}};FFTM.prototype.transform=function transform(Ae,Se,Ce,qe,Fe,$e){this.permute($e,Ae,Se,Ce,qe,Fe);for(var rt=1;rt>>1){Fe++}return 1<>>13;Ce[2*$e+1]=Fe&8191;Fe=Fe>>>13}for($e=2*Se;$e>=26;Se+=qe/67108864|0;Se+=Fe>>>26;this.words[Ce]=Fe&67108863}if(Se!==0){this.words[Ce]=Se;this.length++}return this};BN.prototype.muln=function muln(Ae){return this.clone().imuln(Ae)};BN.prototype.sqr=function sqr(){return this.mul(this)};BN.prototype.isqr=function isqr(){return this.imul(this.clone())};BN.prototype.pow=function pow(Ae){var Se=toBitArray(Ae);if(Se.length===0)return new BN(1);var Ce=this;for(var qe=0;qe=0);var Se=Ae%26;var Ce=(Ae-Se)/26;var qe=67108863>>>26-Se<<26-Se;var Fe;if(Se!==0){var $e=0;for(Fe=0;Fe>>26-Se}if($e){this.words[Fe]=$e;this.length++}}if(Ce!==0){for(Fe=this.length-1;Fe>=0;Fe--){this.words[Fe+Ce]=this.words[Fe]}for(Fe=0;Fe=0);var qe;if(Se){qe=(Se-Se%26)/26}else{qe=0}var Fe=Ae%26;var $e=Math.min((Ae-Fe)/26,this.length);var rt=67108863^67108863>>>Fe<$e){this.length-=$e;for(nt=0;nt=0&&(st!==0||nt>=qe);nt--){var ut=this.words[nt]|0;this.words[nt]=st<<26-Fe|ut>>>Fe;st=ut&rt}if(it&&st!==0){it.words[it.length++]=st}if(this.length===0){this.words[0]=0;this.length=1}return this.strip()};BN.prototype.ishrn=function ishrn(Ae,Se,Ce){assert(this.negative===0);return this.iushrn(Ae,Se,Ce)};BN.prototype.shln=function shln(Ae){return this.clone().ishln(Ae)};BN.prototype.ushln=function ushln(Ae){return this.clone().iushln(Ae)};BN.prototype.shrn=function shrn(Ae){return this.clone().ishrn(Ae)};BN.prototype.ushrn=function ushrn(Ae){return this.clone().iushrn(Ae)};BN.prototype.testn=function testn(Ae){assert(typeof Ae==="number"&&Ae>=0);var Se=Ae%26;var Ce=(Ae-Se)/26;var qe=1<=0);var Se=Ae%26;var Ce=(Ae-Se)/26;assert(this.negative===0,"imaskn works only with positive numbers");if(this.length<=Ce){return this}if(Se!==0){Ce++}this.length=Math.min(Ce,this.length);if(Se!==0){var qe=67108863^67108863>>>Se<=67108864;Se++){this.words[Se]-=67108864;if(Se===this.length-1){this.words[Se+1]=1}else{this.words[Se+1]++}}this.length=Math.max(this.length,Se+1);return this};BN.prototype.isubn=function isubn(Ae){assert(typeof Ae==="number");assert(Ae<67108864);if(Ae<0)return this.iaddn(-Ae);if(this.negative!==0){this.negative=0;this.iaddn(Ae);this.negative=1;return this}this.words[0]-=Ae;if(this.length===1&&this.words[0]<0){this.words[0]=-this.words[0];this.negative=1}else{for(var Se=0;Se>26)-(it/67108864|0);this.words[Fe+Ce]=$e&67108863}for(;Fe>26;this.words[Fe+Ce]=$e&67108863}if(rt===0)return this.strip();assert(rt===-1);rt=0;for(Fe=0;Fe>26;this.words[Fe]=$e&67108863}this.negative=1;return this.strip()};BN.prototype._wordDiv=function _wordDiv(Ae,Se){var Ce=this.length-Ae.length;var qe=this.clone();var Fe=Ae;var $e=Fe.words[Fe.length-1]|0;var rt=this._countBits($e);Ce=26-rt;if(Ce!==0){Fe=Fe.ushln(Ce);qe.iushln(Ce);$e=Fe.words[Fe.length-1]|0}var it=qe.length-Fe.length;var nt;if(Se!=="mod"){nt=new BN(null);nt.length=it+1;nt.words=new Array(nt.length);for(var st=0;st=0;ht--){var ft=(qe.words[Fe.length+ht]|0)*67108864+(qe.words[Fe.length+ht-1]|0);ft=Math.min(ft/$e|0,67108863);qe._ishlnsubmul(Fe,ft,ht);while(qe.negative!==0){ft--;qe.negative=0;qe._ishlnsubmul(Fe,1,ht);if(!qe.isZero()){qe.negative^=1}}if(nt){nt.words[ht]=ft}}if(nt){nt.strip()}qe.strip();if(Se!=="div"&&Ce!==0){qe.iushrn(Ce)}return{div:nt||null,mod:qe}};BN.prototype.divmod=function divmod(Ae,Se,Ce){assert(!Ae.isZero());if(this.isZero()){return{div:new BN(0),mod:new BN(0)}}var qe,Fe,$e;if(this.negative!==0&&Ae.negative===0){$e=this.neg().divmod(Ae,Se);if(Se!=="mod"){qe=$e.div.neg()}if(Se!=="div"){Fe=$e.mod.neg();if(Ce&&Fe.negative!==0){Fe.iadd(Ae)}}return{div:qe,mod:Fe}}if(this.negative===0&&Ae.negative!==0){$e=this.divmod(Ae.neg(),Se);if(Se!=="mod"){qe=$e.div.neg()}return{div:qe,mod:$e.mod}}if((this.negative&Ae.negative)!==0){$e=this.neg().divmod(Ae.neg(),Se);if(Se!=="div"){Fe=$e.mod.neg();if(Ce&&Fe.negative!==0){Fe.isub(Ae)}}return{div:$e.div,mod:Fe}}if(Ae.length>this.length||this.cmp(Ae)<0){return{div:new BN(0),mod:this}}if(Ae.length===1){if(Se==="div"){return{div:this.divn(Ae.words[0]),mod:null}}if(Se==="mod"){return{div:null,mod:new BN(this.modn(Ae.words[0]))}}return{div:this.divn(Ae.words[0]),mod:new BN(this.modn(Ae.words[0]))}}return this._wordDiv(Ae,Se)};BN.prototype.div=function div(Ae){return this.divmod(Ae,"div",false).div};BN.prototype.mod=function mod(Ae){return this.divmod(Ae,"mod",false).mod};BN.prototype.umod=function umod(Ae){return this.divmod(Ae,"mod",true).mod};BN.prototype.divRound=function divRound(Ae){var Se=this.divmod(Ae);if(Se.mod.isZero())return Se.div;var Ce=Se.div.negative!==0?Se.mod.isub(Ae):Se.mod;var qe=Ae.ushrn(1);var Fe=Ae.andln(1);var $e=Ce.cmp(qe);if($e<0||Fe===1&&$e===0)return Se.div;return Se.div.negative!==0?Se.div.isubn(1):Se.div.iaddn(1)};BN.prototype.modn=function modn(Ae){assert(Ae<=67108863);var Se=(1<<26)%Ae;var Ce=0;for(var qe=this.length-1;qe>=0;qe--){Ce=(Se*Ce+(this.words[qe]|0))%Ae}return Ce};BN.prototype.idivn=function idivn(Ae){assert(Ae<=67108863);var Se=0;for(var Ce=this.length-1;Ce>=0;Ce--){var qe=(this.words[Ce]|0)+Se*67108864;this.words[Ce]=qe/Ae|0;Se=qe%Ae}return this.strip()};BN.prototype.divn=function divn(Ae){return this.clone().idivn(Ae)};BN.prototype.egcd=function egcd(Ae){assert(Ae.negative===0);assert(!Ae.isZero());var Se=this;var Ce=Ae.clone();if(Se.negative!==0){Se=Se.umod(Ae)}else{Se=Se.clone()}var qe=new BN(1);var Fe=new BN(0);var $e=new BN(0);var rt=new BN(1);var it=0;while(Se.isEven()&&Ce.isEven()){Se.iushrn(1);Ce.iushrn(1);++it}var nt=Ce.clone();var st=Se.clone();while(!Se.isZero()){for(var ut=0,ht=1;(Se.words[0]&ht)===0&&ut<26;++ut,ht<<=1);if(ut>0){Se.iushrn(ut);while(ut-- >0){if(qe.isOdd()||Fe.isOdd()){qe.iadd(nt);Fe.isub(st)}qe.iushrn(1);Fe.iushrn(1)}}for(var ft=0,yt=1;(Ce.words[0]&yt)===0&&ft<26;++ft,yt<<=1);if(ft>0){Ce.iushrn(ft);while(ft-- >0){if($e.isOdd()||rt.isOdd()){$e.iadd(nt);rt.isub(st)}$e.iushrn(1);rt.iushrn(1)}}if(Se.cmp(Ce)>=0){Se.isub(Ce);qe.isub($e);Fe.isub(rt)}else{Ce.isub(Se);$e.isub(qe);rt.isub(Fe)}}return{a:$e,b:rt,gcd:Ce.iushln(it)}};BN.prototype._invmp=function _invmp(Ae){assert(Ae.negative===0);assert(!Ae.isZero());var Se=this;var Ce=Ae.clone();if(Se.negative!==0){Se=Se.umod(Ae)}else{Se=Se.clone()}var qe=new BN(1);var Fe=new BN(0);var $e=Ce.clone();while(Se.cmpn(1)>0&&Ce.cmpn(1)>0){for(var rt=0,it=1;(Se.words[0]&it)===0&&rt<26;++rt,it<<=1);if(rt>0){Se.iushrn(rt);while(rt-- >0){if(qe.isOdd()){qe.iadd($e)}qe.iushrn(1)}}for(var nt=0,st=1;(Ce.words[0]&st)===0&&nt<26;++nt,st<<=1);if(nt>0){Ce.iushrn(nt);while(nt-- >0){if(Fe.isOdd()){Fe.iadd($e)}Fe.iushrn(1)}}if(Se.cmp(Ce)>=0){Se.isub(Ce);qe.isub(Fe)}else{Ce.isub(Se);Fe.isub(qe)}}var ut;if(Se.cmpn(1)===0){ut=qe}else{ut=Fe}if(ut.cmpn(0)<0){ut.iadd(Ae)}return ut};BN.prototype.gcd=function gcd(Ae){if(this.isZero())return Ae.abs();if(Ae.isZero())return this.abs();var Se=this.clone();var Ce=Ae.clone();Se.negative=0;Ce.negative=0;for(var qe=0;Se.isEven()&&Ce.isEven();qe++){Se.iushrn(1);Ce.iushrn(1)}do{while(Se.isEven()){Se.iushrn(1)}while(Ce.isEven()){Ce.iushrn(1)}var Fe=Se.cmp(Ce);if(Fe<0){var $e=Se;Se=Ce;Ce=$e}else if(Fe===0||Ce.cmpn(1)===0){break}Se.isub(Ce)}while(true);return Ce.iushln(qe)};BN.prototype.invm=function invm(Ae){return this.egcd(Ae).a.umod(Ae)};BN.prototype.isEven=function isEven(){return(this.words[0]&1)===0};BN.prototype.isOdd=function isOdd(){return(this.words[0]&1)===1};BN.prototype.andln=function andln(Ae){return this.words[0]&Ae};BN.prototype.bincn=function bincn(Ae){assert(typeof Ae==="number");var Se=Ae%26;var Ce=(Ae-Se)/26;var qe=1<>>26;rt&=67108863;this.words[$e]=rt}if(Fe!==0){this.words[$e]=Fe;this.length++}return this};BN.prototype.isZero=function isZero(){return this.length===1&&this.words[0]===0};BN.prototype.cmpn=function cmpn(Ae){var Se=Ae<0;if(this.negative!==0&&!Se)return-1;if(this.negative===0&&Se)return 1;this.strip();var Ce;if(this.length>1){Ce=1}else{if(Se){Ae=-Ae}assert(Ae<=67108863,"Number is too big");var qe=this.words[0]|0;Ce=qe===Ae?0:qeAe.length)return 1;if(this.length=0;Ce--){var qe=this.words[Ce]|0;var Fe=Ae.words[Ce]|0;if(qe===Fe)continue;if(qeFe){Se=1}break}return Se};BN.prototype.gtn=function gtn(Ae){return this.cmpn(Ae)===1};BN.prototype.gt=function gt(Ae){return this.cmp(Ae)===1};BN.prototype.gten=function gten(Ae){return this.cmpn(Ae)>=0};BN.prototype.gte=function gte(Ae){return this.cmp(Ae)>=0};BN.prototype.ltn=function ltn(Ae){return this.cmpn(Ae)===-1};BN.prototype.lt=function lt(Ae){return this.cmp(Ae)===-1};BN.prototype.lten=function lten(Ae){return this.cmpn(Ae)<=0};BN.prototype.lte=function lte(Ae){return this.cmp(Ae)<=0};BN.prototype.eqn=function eqn(Ae){return this.cmpn(Ae)===0};BN.prototype.eq=function eq(Ae){return this.cmp(Ae)===0};BN.red=function red(Ae){return new Red(Ae)};BN.prototype.toRed=function toRed(Ae){assert(!this.red,"Already a number in reduction context");assert(this.negative===0,"red works only with positives");return Ae.convertTo(this)._forceRed(Ae)};BN.prototype.fromRed=function fromRed(){assert(this.red,"fromRed works only with numbers in reduction context");return this.red.convertFrom(this)};BN.prototype._forceRed=function _forceRed(Ae){this.red=Ae;return this};BN.prototype.forceRed=function forceRed(Ae){assert(!this.red,"Already a number in reduction context");return this._forceRed(Ae)};BN.prototype.redAdd=function redAdd(Ae){assert(this.red,"redAdd works only with red numbers");return this.red.add(this,Ae)};BN.prototype.redIAdd=function redIAdd(Ae){assert(this.red,"redIAdd works only with red numbers");return this.red.iadd(this,Ae)};BN.prototype.redSub=function redSub(Ae){assert(this.red,"redSub works only with red numbers");return this.red.sub(this,Ae)};BN.prototype.redISub=function redISub(Ae){assert(this.red,"redISub works only with red numbers");return this.red.isub(this,Ae)};BN.prototype.redShl=function redShl(Ae){assert(this.red,"redShl works only with red numbers");return this.red.shl(this,Ae)};BN.prototype.redMul=function redMul(Ae){assert(this.red,"redMul works only with red numbers");this.red._verify2(this,Ae);return this.red.mul(this,Ae)};BN.prototype.redIMul=function redIMul(Ae){assert(this.red,"redMul works only with red numbers");this.red._verify2(this,Ae);return this.red.imul(this,Ae)};BN.prototype.redSqr=function redSqr(){assert(this.red,"redSqr works only with red numbers");this.red._verify1(this);return this.red.sqr(this)};BN.prototype.redISqr=function redISqr(){assert(this.red,"redISqr works only with red numbers");this.red._verify1(this);return this.red.isqr(this)};BN.prototype.redSqrt=function redSqrt(){assert(this.red,"redSqrt works only with red numbers");this.red._verify1(this);return this.red.sqrt(this)};BN.prototype.redInvm=function redInvm(){assert(this.red,"redInvm works only with red numbers");this.red._verify1(this);return this.red.invm(this)};BN.prototype.redNeg=function redNeg(){assert(this.red,"redNeg works only with red numbers");this.red._verify1(this);return this.red.neg(this)};BN.prototype.redPow=function redPow(Ae){assert(this.red&&!Ae.red,"redPow(normalNum)");this.red._verify1(this);return this.red.pow(this,Ae)};var nt={k256:null,p224:null,p192:null,p25519:null};function MPrime(Ae,Se){this.name=Ae;this.p=new BN(Se,16);this.n=this.p.bitLength();this.k=new BN(1).iushln(this.n).isub(this.p);this.tmp=this._tmp()}MPrime.prototype._tmp=function _tmp(){var Ae=new BN(null);Ae.words=new Array(Math.ceil(this.n/13));return Ae};MPrime.prototype.ireduce=function ireduce(Ae){var Se=Ae;var Ce;do{this.split(Se,this.tmp);Se=this.imulK(Se);Se=Se.iadd(this.tmp);Ce=Se.bitLength()}while(Ce>this.n);var qe=Ce0){Se.isub(this.p)}else{if(Se.strip!==undefined){Se.strip()}else{Se._strip()}}return Se};MPrime.prototype.split=function split(Ae,Se){Ae.iushrn(this.n,0,Se)};MPrime.prototype.imulK=function imulK(Ae){return Ae.imul(this.k)};function K256(){MPrime.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}inherits(K256,MPrime);K256.prototype.split=function split(Ae,Se){var Ce=4194303;var qe=Math.min(Ae.length,9);for(var Fe=0;Fe>>22;$e=rt}$e>>>=22;Ae.words[Fe-10]=$e;if($e===0&&Ae.length>10){Ae.length-=10}else{Ae.length-=9}};K256.prototype.imulK=function imulK(Ae){Ae.words[Ae.length]=0;Ae.words[Ae.length+1]=0;Ae.length+=2;var Se=0;for(var Ce=0;Ce>>=26;Ae.words[Ce]=Fe;Se=qe}if(Se!==0){Ae.words[Ae.length++]=Se}return Ae};BN._prime=function prime(Ae){if(nt[Ae])return nt[Ae];var prime;if(Ae==="k256"){prime=new K256}else if(Ae==="p224"){prime=new P224}else if(Ae==="p192"){prime=new P192}else if(Ae==="p25519"){prime=new P25519}else{throw new Error("Unknown prime "+Ae)}nt[Ae]=prime;return prime};function Red(Ae){if(typeof Ae==="string"){var Se=BN._prime(Ae);this.m=Se.p;this.prime=Se}else{assert(Ae.gtn(1),"modulus must be greater than 1");this.m=Ae;this.prime=null}}Red.prototype._verify1=function _verify1(Ae){assert(Ae.negative===0,"red works only with positives");assert(Ae.red,"red works only with red numbers")};Red.prototype._verify2=function _verify2(Ae,Se){assert((Ae.negative|Se.negative)===0,"red works only with positives");assert(Ae.red&&Ae.red===Se.red,"red works only with red numbers")};Red.prototype.imod=function imod(Ae){if(this.prime)return this.prime.ireduce(Ae)._forceRed(this);return Ae.umod(this.m)._forceRed(this)};Red.prototype.neg=function neg(Ae){if(Ae.isZero()){return Ae.clone()}return this.m.sub(Ae)._forceRed(this)};Red.prototype.add=function add(Ae,Se){this._verify2(Ae,Se);var Ce=Ae.add(Se);if(Ce.cmp(this.m)>=0){Ce.isub(this.m)}return Ce._forceRed(this)};Red.prototype.iadd=function iadd(Ae,Se){this._verify2(Ae,Se);var Ce=Ae.iadd(Se);if(Ce.cmp(this.m)>=0){Ce.isub(this.m)}return Ce};Red.prototype.sub=function sub(Ae,Se){this._verify2(Ae,Se);var Ce=Ae.sub(Se);if(Ce.cmpn(0)<0){Ce.iadd(this.m)}return Ce._forceRed(this)};Red.prototype.isub=function isub(Ae,Se){this._verify2(Ae,Se);var Ce=Ae.isub(Se);if(Ce.cmpn(0)<0){Ce.iadd(this.m)}return Ce};Red.prototype.shl=function shl(Ae,Se){this._verify1(Ae);return this.imod(Ae.ushln(Se))};Red.prototype.imul=function imul(Ae,Se){this._verify2(Ae,Se);return this.imod(Ae.imul(Se))};Red.prototype.mul=function mul(Ae,Se){this._verify2(Ae,Se);return this.imod(Ae.mul(Se))};Red.prototype.isqr=function isqr(Ae){return this.imul(Ae,Ae.clone())};Red.prototype.sqr=function sqr(Ae){return this.mul(Ae,Ae)};Red.prototype.sqrt=function sqrt(Ae){if(Ae.isZero())return Ae.clone();var Se=this.m.andln(3);assert(Se%2===1);if(Se===3){var Ce=this.m.add(new BN(1)).iushrn(2);return this.pow(Ae,Ce)}var qe=this.m.subn(1);var Fe=0;while(!qe.isZero()&&qe.andln(1)===0){Fe++;qe.iushrn(1)}assert(!qe.isZero());var $e=new BN(1).toRed(this);var rt=$e.redNeg();var it=this.m.subn(1).iushrn(1);var nt=this.m.bitLength();nt=new BN(2*nt*nt).toRed(this);while(this.pow(nt,it).cmp(rt)!==0){nt.redIAdd(rt)}var st=this.pow(nt,qe);var ut=this.pow(Ae,qe.addn(1).iushrn(1));var ht=this.pow(Ae,qe);var ft=Fe;while(ht.cmp($e)!==0){var yt=ht;for(var vt=0;yt.cmp($e)!==0;vt++){yt=yt.redSqr()}assert(vt=0;Fe--){var st=Se.words[Fe];for(var ut=nt-1;ut>=0;ut--){var ht=st>>ut&1;if($e!==qe[0]){$e=this.sqr($e)}if(ht===0&&rt===0){it=0;continue}rt<<=1;rt|=ht;it++;if(it!==Ce&&(Fe!==0||ut!==0))continue;$e=this.mul($e,qe[rt]);it=0;rt=0}nt=26}return $e};Red.prototype.convertTo=function convertTo(Ae){var Se=Ae.umod(this.m);return Se===Ae?Se.clone():Se};Red.prototype.convertFrom=function convertFrom(Ae){var Se=Ae.clone();Se.red=null;return Se};BN.mont=function mont(Ae){return new Mont(Ae)};function Mont(Ae){Red.call(this,Ae);this.shift=this.m.bitLength();if(this.shift%26!==0){this.shift+=26-this.shift%26}this.r=new BN(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)}inherits(Mont,Red);Mont.prototype.convertTo=function convertTo(Ae){return this.imod(Ae.ushln(this.shift))};Mont.prototype.convertFrom=function convertFrom(Ae){var Se=this.imod(Ae.mul(this.rinv));Se.red=null;return Se};Mont.prototype.imul=function imul(Ae,Se){if(Ae.isZero()||Se.isZero()){Ae.words[0]=0;Ae.length=1;return Ae}var Ce=Ae.imul(Se);var qe=Ce.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m);var Fe=Ce.isub(qe).iushrn(this.shift);var $e=Fe;if(Fe.cmp(this.m)>=0){$e=Fe.isub(this.m)}else if(Fe.cmpn(0)<0){$e=Fe.iadd(this.m)}return $e._forceRed(this)};Mont.prototype.mul=function mul(Ae,Se){if(Ae.isZero()||Se.isZero())return new BN(0)._forceRed(this);var Ce=Ae.mul(Se);var qe=Ce.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m);var Fe=Ce.isub(qe).iushrn(this.shift);var $e=Fe;if(Fe.cmp(this.m)>=0){$e=Fe.isub(this.m)}else if(Fe.cmpn(0)<0){$e=Fe.iadd(this.m)}return $e._forceRed(this)};Mont.prototype.invm=function invm(Ae){var Se=this.imod(Ae._invmp(this.m).mul(this.r2));return Se._forceRed(this)}})(false||Ae,this)},4124:(Ae,Se,Ce)=>{try{var qe=Ce(3837);if(typeof qe.inherits!=="function")throw"";Ae.exports=qe.inherits}catch(Se){Ae.exports=Ce(8544)}},8544:Ae=>{if(typeof Object.create==="function"){Ae.exports=function inherits(Ae,Se){if(Se){Ae.super_=Se;Ae.prototype=Object.create(Se.prototype,{constructor:{value:Ae,enumerable:false,writable:true,configurable:true}})}}}else{Ae.exports=function inherits(Ae,Se){if(Se){Ae.super_=Se;var TempCtor=function(){};TempCtor.prototype=Se.prototype;Ae.prototype=new TempCtor;Ae.prototype.constructor=Ae}}}},910:Ae=>{Ae.exports=assert;function assert(Ae,Se){if(!Ae)throw new Error(Se||"Assertion failed")}assert.equal=function assertEqual(Ae,Se,Ce){if(Ae!=Se)throw new Error(Ce||"Assertion failed: "+Ae+" != "+Se)}},7946:(Ae,Se,Ce)=>{"use strict"; /*! OpenPGP.js v5.11.0 - 2023-10-25 - this is LGPL licensed code, see LICENSE/our website https://openpgpjs.org/ for more information. */const qe="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};Object.defineProperty(Se,"__esModule",{value:!0});var Fe=Ce(4300),$e=Ce(2781),rt=Ce(6113),it=Ce(9796),nt=Ce(2037),st=Ce(3837),ut=Ce(4293);function c(Ae){return Ae&&"object"==typeof Ae&&"default"in Ae?Ae:{default:Ae}}var ht=c(Fe),ft=c($e),yt=c(rt),vt=c(it),_t=c(nt),Ct=c(st),Rt=c(ut);const Ut=Symbol("doneWritingPromise"),It=Symbol("doneWritingResolve"),Ot=Symbol("doneWritingReject"),Nt=Symbol("readingIndex");class v extends Array{constructor(){super(),this[Ut]=new Promise(((Ae,Se)=>{this[It]=Ae,this[Ot]=Se})),this[Ut].catch((()=>{}))}}function _(Ae){return Ae&&Ae.getReader&&Array.isArray(Ae)}function k(Ae){if(!_(Ae)){const Se=Ae.getWriter(),Ce=Se.releaseLock;return Se.releaseLock=()=>{Se.closed.catch((function(){})),Ce.call(Se)},Se}this.stream=Ae}v.prototype.getReader=function(){return void 0===this[Nt]&&(this[Nt]=0),{read:async()=>(await this[Ut],this[Nt]===this.length?{value:void 0,done:!0}:{value:this[this[Nt]++],done:!1})}},v.prototype.readToEnd=async function(Ae){await this[Ut];const Se=Ae(this.slice(this[Nt]));return this.length=0,Se},v.prototype.clone=function(){const Ae=new v;return Ae[Ut]=this[Ut].then((()=>{Ae.push(...this)})),Ae},k.prototype.write=async function(Ae){this.stream.push(Ae)},k.prototype.close=async function(){this.stream[It]()},k.prototype.abort=async function(Ae){return this.stream[Ot](Ae),Ae},k.prototype.releaseLock=function(){};const jt="object"==typeof qe.process&&"object"==typeof qe.process.versions,Ft=jt&&ft.default.Readable;function E(Ae){return _(Ae)?"array":qe.ReadableStream&&qe.ReadableStream.prototype.isPrototypeOf(Ae)?"web":Xt&&Xt.prototype.isPrototypeOf(Ae)?"ponyfill":Ft&&Ft.prototype.isPrototypeOf(Ae)?"node":!(!Ae||!Ae.getReader)&&"web-like"}function P(Ae){return Uint8Array.prototype.isPrototypeOf(Ae)}function x(Ae){if(1===Ae.length)return Ae[0];let Se=0;for(let Ce=0;Ce{Se||(Lt.isBuffer(qe)&&(qe=new Uint8Array(qe.buffer,qe.byteOffset,qe.byteLength)),Ce.enqueue(qe),Ae.pause())})),Ae.on("end",(()=>{Se||Ce.close()})),Ae.on("error",(Ae=>Ce.error(Ae)))},pull(){Ae.resume()},cancel(Ce){Se=!0,Ae.destroy(Ce)}})};class e extends Ht{constructor(Ae,Se){super(Se),this._reader=W(Ae)}async _read(Ae){try{for(;;){const{done:Ae,value:Se}=await this._reader.read();if(Ae){this.push(null);break}if(!this.push(Se))break}}catch(Ae){this.destroy(Ae)}}async _destroy(Ae,Se){this._reader.cancel(Ae).then(Se,Se)}}Gt=function(Ae,Se){return new e(Ae,Se)}}const $t=new WeakSet,Vt=Symbol("externalBuffer");function I(Ae){if(this.stream=Ae,Ae[Vt]&&(this[Vt]=Ae[Vt].slice()),_(Ae)){const Se=Ae.getReader();return this._read=Se.read.bind(Se),this._releaseLock=()=>{},void(this._cancel=async()=>{})}let Se=E(Ae);if("node"===Se&&(Ae=Wt(Ae)),Se){const Se=Ae.getReader();return this._read=Se.read.bind(Se),this._releaseLock=()=>{Se.closed.catch((function(){})),Se.releaseLock()},void(this._cancel=Se.cancel.bind(Se))}let Ce=!1;this._read=async()=>Ce||$t.has(Ae)?{value:void 0,done:!0}:(Ce=!0,{value:Ae,done:!1}),this._releaseLock=()=>{if(Ce)try{$t.add(Ae)}catch(Ae){}}}I.prototype.read=async function(){if(this[Vt]&&this[Vt].length){return{done:!1,value:this[Vt].shift()}}return this._read()},I.prototype.releaseLock=function(){this[Vt]&&(this.stream[Vt]=this[Vt]),this._releaseLock()},I.prototype.cancel=function(Ae){return this._cancel(Ae)},I.prototype.readLine=async function(){let Ae,Se=[];for(;!Ae;){let{done:Ce,value:qe}=await this.read();if(qe+="",Ce)return Se.length?H(Se):void 0;const Fe=qe.indexOf("\n")+1;Fe&&(Ae=H(Se.concat(qe.substr(0,Fe))),Se=[]),Fe!==qe.length&&Se.push(qe.substr(Fe))}return this.unshift(...Se),Ae},I.prototype.readByte=async function(){const{done:Ae,value:Se}=await this.read();if(Ae)return;const Ce=Se[0];return this.unshift(re(Se,1)),Ce},I.prototype.readBytes=async function(Ae){const Se=[];let Ce=0;for(;;){const{done:qe,value:Fe}=await this.read();if(qe)return Se.length?H(Se):void 0;if(Se.push(Fe),Ce+=Fe.length,Ce>=Ae){const Ce=H(Se);return this.unshift(re(Ce,Ae)),re(Ce,0,Ae)}}},I.prototype.peekBytes=async function(Ae){const Se=await this.readBytes(Ae);return this.unshift(Se),Se},I.prototype.unshift=function(...Ae){this[Vt]||(this[Vt]=[]),1===Ae.length&&P(Ae[0])&&this[Vt].length&&Ae[0].length&&this[Vt][0].byteOffset>=Ae[0].length?this[Vt][0]=new Uint8Array(this[Vt][0].buffer,this[Vt][0].byteOffset-Ae[0].length,this[Vt][0].byteLength+Ae[0].length):this[Vt].unshift(...Ae.filter((Ae=>Ae&&Ae.length)))},I.prototype.readToEnd=async function(Ae=H){const Se=[];for(;;){const{done:Ae,value:Ce}=await this.read();if(Ae)break;Se.push(Ce)}return Ae(Se)};let Qt,Zt,{ReadableStream:Xt,WritableStream:er,TransformStream:tr}=qe;async function O(){if(tr)return;const[Ae,Se]=await Promise.all([Promise.resolve().then((function(){return sm})),Promise.resolve().then((function(){return dm}))]);({ReadableStream:Xt,WritableStream:er,TransformStream:tr}=Ae);const{createReadableStreamWrapper:Ce}=Se;qe.ReadableStream&&Xt!==qe.ReadableStream&&(Qt=Ce(Xt),Zt=Ce(qe.ReadableStream))}const rr=jt&&ht.default.Buffer;function N(Ae){let Se=E(Ae);return"node"===Se?Wt(Ae):"web"===Se&&Qt?Qt(Ae):Se?Ae:new Xt({start(Se){Se.enqueue(Ae),Se.close()}})}function j(Ae){if(E(Ae))return Ae;const Se=new v;return(async()=>{const Ce=G(Se);await Ce.write(Ae),await Ce.close()})(),Se}function H(Ae){return Ae.some((Ae=>E(Ae)&&!_(Ae)))?function(Ae){Ae=Ae.map(N);const Se=Z((async function(Ae){await Promise.all(qe.map((Se=>ne(Se,Ae))))}));let Ce=Promise.resolve();const qe=Ae.map(((qe,Fe)=>Y(qe,((qe,$e)=>(Ce=Ce.then((()=>V(qe,Se.writable,{preventClose:Fe!==Ae.length-1}))),Ce)))));return Se.readable}(Ae):Ae.some((Ae=>_(Ae)))?function(Ae){const Se=new v;let Ce=Promise.resolve();return Ae.forEach(((qe,Fe)=>(Ce=Ce.then((()=>V(qe,Se,{preventClose:Fe!==Ae.length-1}))),Ce))),Se}(Ae):"string"==typeof Ae[0]?Ae.join(""):rr&&rr.isBuffer(Ae[0])?rr.concat(Ae):x(Ae)}function W(Ae){return new I(Ae)}function G(Ae){return new k(Ae)}async function V(Ae,Se,{preventClose:Ce=!1,preventAbort:qe=!1,preventCancel:Fe=!1}={}){if(E(Ae)&&!_(Ae)){Ae=N(Ae);try{if(Ae[Vt]){const Ce=G(Se);for(let Se=0;Se{Se=Ae})),Se=null)},close:Ce.close.bind(Ce),abort:Ce.error.bind(Ce)})}}function X(Ae,Se=(()=>{}),Ce=(()=>{})){if(_(Ae)){const qe=new v;return(async()=>{const Fe=G(qe);try{const qe=await ie(Ae),$e=Se(qe),rt=Ce();let it;it=void 0!==$e&&void 0!==rt?H([$e,rt]):void 0!==$e?$e:rt,await Fe.write(it),await Fe.close()}catch(Ae){await Fe.abort(Ae)}})(),qe}if(E(Ae))return $(Ae,{async transform(Ae,Ce){try{const qe=await Se(Ae);void 0!==qe&&Ce.enqueue(qe)}catch(Ae){Ce.error(Ae)}},async flush(Ae){try{const Se=await Ce();void 0!==Se&&Ae.enqueue(Se)}catch(Se){Ae.error(Se)}}});const qe=Se(Ae),Fe=Ce();return void 0!==qe&&void 0!==Fe?H([qe,Fe]):void 0!==qe?qe:Fe}function Y(Ae,Se){if(E(Ae)&&!_(Ae)){let Ce;const qe=new tr({start(Ae){Ce=Ae}}),Fe=V(Ae,qe.writable),$e=Z((async function(Ae){Ce.error(Ae),await Fe,await new Promise(setTimeout)}));return Se(qe.readable,$e.writable),$e.readable}Ae=j(Ae);const Ce=new v;return Se(Ae,Ce),Ce}function Q(Ae,Se){let Ce;const qe=Y(Ae,((Ae,Fe)=>{const $e=W(Ae);$e.remainder=()=>($e.releaseLock(),V(Ae,Fe),qe),Ce=Se($e)}));return Ce}function J(Ae){if(_(Ae))return Ae.clone();if(E(Ae)){const Se=function(Ae){if(_(Ae))throw Error("ArrayStream cannot be tee()d, use clone() instead");if(E(Ae)){const Se=N(Ae).tee();return Se[0][Vt]=Se[1][Vt]=Ae[Vt],Se}return[re(Ae),re(Ae)]}(Ae);return te(Ae,Se[0]),Se[1]}return re(Ae)}function ee(Ae){return _(Ae)?J(Ae):E(Ae)?new Xt({start(Se){const Ce=Y(Ae,(async(Ae,Ce)=>{const qe=W(Ae),Fe=G(Ce);try{for(;;){await Fe.ready;const{done:Ce,value:$e}=await qe.read();if(Ce){try{Se.close()}catch(Ae){}return void await Fe.close()}try{Se.enqueue($e)}catch(Ae){}await Fe.write($e)}}catch(Ae){Se.error(Ae),await Fe.abort(Ae)}}));te(Ae,Ce)}}):re(Ae)}function te(Ae,Se){Object.entries(Object.getOwnPropertyDescriptors(Ae.constructor.prototype)).forEach((([Ce,qe])=>{"constructor"!==Ce&&(qe.value?qe.value=qe.value.bind(Se):qe.get=qe.get.bind(Se),Object.defineProperty(Ae,Ce,qe))}))}function re(Ae,Se=0,Ce=1/0){if(_(Ae))throw Error("Not implemented");if(E(Ae)){if(Se>=0&&Ce>=0){let qe=0;return $(Ae,{transform(Ae,Fe){qe=Se&&Fe.enqueue(re(Ae,Math.max(Se-qe,0),Ce-qe)),qe+=Ae.length):Fe.terminate()}})}if(Se<0&&(Ce<0||Ce===1/0)){let qe=[];return X(Ae,(Ae=>{Ae.length>=-Se?qe=[Ae]:qe.push(Ae)}),(()=>re(H(qe),Se,Ce)))}if(0===Se&&Ce<0){let qe;return X(Ae,(Ae=>{const Fe=qe?H([qe,Ae]):Ae;if(Fe.length>=-Ce)return qe=re(Fe,Ce),re(Fe,Se,Ce);qe=Fe}))}return console.warn(`stream.slice(input, ${Se}, ${Ce}) not implemented efficiently.`),ae((async()=>re(await ie(Ae),Se,Ce)))}return Ae[Vt]&&(Ae=H(Ae[Vt].concat([Ae]))),!P(Ae)||rr&&rr.isBuffer(Ae)?Ae.slice(Se,Ce):(Ce===1/0&&(Ce=Ae.length),Ae.subarray(Se,Ce))}async function ie(Ae,Se=H){return _(Ae)?Ae.readToEnd(Se):E(Ae)?W(Ae).readToEnd(Se):Ae}async function ne(Ae,Se){if(E(Ae)){if(Ae.cancel)return Ae.cancel(Se);if(Ae.destroy)return Ae.destroy(Se),await new Promise(setTimeout),Se}}function ae(Ae){const Se=new v;return(async()=>{const Ce=G(Se);try{await Ce.write(await Ae()),await Ce.close()}catch(Ae){await Ce.abort(Ae)}})(),Se}class se{constructor(Ae){if(void 0===Ae)throw Error("Invalid BigInteger input");if(Ae instanceof Uint8Array){const Se=Ae,Ce=Array(Se.length);for(let Ae=0;AeBigInt(0);){const Ae=Ce&BigInt(1);Ce>>=BigInt(1);const $e=Fe*qe%Se.value;Fe=Ae?$e:Fe,qe=qe*qe%Se.value}return new se(Fe)}modInv(Ae){const{gcd:Se,x:Ce}=this._egcd(Ae);if(!Se.isOne())throw Error("Inverse does not exist");return Ce.add(Ae).mod(Ae)}_egcd(Ae){let Se=BigInt(0),Ce=BigInt(1),qe=BigInt(1),Fe=BigInt(0),$e=this.value;for(Ae=Ae.value;Ae!==BigInt(0);){const rt=$e/Ae;let it=Se;Se=qe-rt*Se,qe=it,it=Ce,Ce=Fe-rt*Ce,Fe=it,it=Ae,Ae=$e%Ae,$e=it}return{x:new se(qe),y:new se(Fe),gcd:new se($e)}}gcd(Ae){let Se=this.value;for(Ae=Ae.value;Ae!==BigInt(0);){const Ce=Ae;Ae=Se%Ae,Se=Ce}return new se(Se)}ileftShift(Ae){return this.value<<=Ae.value,this}leftShift(Ae){return this.clone().ileftShift(Ae)}irightShift(Ae){return this.value>>=Ae.value,this}rightShift(Ae){return this.clone().irightShift(Ae)}equal(Ae){return this.value===Ae.value}lt(Ae){return this.valueAe.value}gte(Ae){return this.value>=Ae.value}isZero(){return this.value===BigInt(0)}isOne(){return this.value===BigInt(1)}isNegative(){return this.valueNumber.MAX_SAFE_INTEGER)throw Error("Number can only safely store up to 53 bits");return Ae}getBit(Ae){return(this.value>>BigInt(Ae)&BigInt(1))===BigInt(0)?0:1}bitLength(){const Ae=new se(0),Se=new se(1),Ce=new se(-1),qe=this.isNegative()?Ce:Ae;let Fe=1;const $e=this.clone();for(;!$e.irightShift(Se).equal(qe);)Fe++;return Fe}byteLength(){const Ae=new se(0),Se=new se(-1),Ce=this.isNegative()?Se:Ae,qe=new se(8);let Fe=1;const $e=this.clone();for(;!$e.irightShift(qe).equal(Ce);)Fe++;return Fe}toUint8Array(Ae="be",Se){let Ce=this.value.toString(16);Ce.length%2==1&&(Ce="0"+Ce);const qe=Ce.length/2,Fe=new Uint8Array(Se||qe),$e=Se?Se-qe:0;let rt=0;for(;rt"undefined"!=typeof BigInt;const ir=Symbol("byValue");var nr={curve:{p256:"p256","P-256":"p256",secp256r1:"p256",prime256v1:"p256","1.2.840.10045.3.1.7":"p256","2a8648ce3d030107":"p256","2A8648CE3D030107":"p256",p384:"p384","P-384":"p384",secp384r1:"p384","1.3.132.0.34":"p384","2b81040022":"p384","2B81040022":"p384",p521:"p521","P-521":"p521",secp521r1:"p521","1.3.132.0.35":"p521","2b81040023":"p521","2B81040023":"p521",secp256k1:"secp256k1","1.3.132.0.10":"secp256k1","2b8104000a":"secp256k1","2B8104000A":"secp256k1",ed25519Legacy:"ed25519",ED25519:"ed25519",ed25519:"ed25519",Ed25519:"ed25519","1.3.6.1.4.1.11591.15.1":"ed25519","2b06010401da470f01":"ed25519","2B06010401DA470F01":"ed25519",curve25519Legacy:"curve25519",X25519:"curve25519",cv25519:"curve25519",curve25519:"curve25519",Curve25519:"curve25519","1.3.6.1.4.1.3029.1.5.1":"curve25519","2b060104019755010501":"curve25519","2B060104019755010501":"curve25519",brainpoolP256r1:"brainpoolP256r1","1.3.36.3.3.2.8.1.1.7":"brainpoolP256r1","2b2403030208010107":"brainpoolP256r1","2B2403030208010107":"brainpoolP256r1",brainpoolP384r1:"brainpoolP384r1","1.3.36.3.3.2.8.1.1.11":"brainpoolP384r1","2b240303020801010b":"brainpoolP384r1","2B240303020801010B":"brainpoolP384r1",brainpoolP512r1:"brainpoolP512r1","1.3.36.3.3.2.8.1.1.13":"brainpoolP512r1","2b240303020801010d":"brainpoolP512r1","2B240303020801010D":"brainpoolP512r1"},s2k:{simple:0,salted:1,iterated:3,gnu:101},publicKey:{rsaEncryptSign:1,rsaEncrypt:2,rsaSign:3,elgamal:16,dsa:17,ecdh:18,ecdsa:19,eddsaLegacy:22,ed25519Legacy:22,eddsa:22,aedh:23,aedsa:24,x25519:25,x448:26,ed25519:27,ed448:28},symmetric:{plaintext:0,idea:1,tripledes:2,cast5:3,blowfish:4,aes128:7,aes192:8,aes256:9,twofish:10},compression:{uncompressed:0,zip:1,zlib:2,bzip2:3},hash:{md5:1,sha1:2,ripemd:3,sha256:8,sha384:9,sha512:10,sha224:11},webHash:{"SHA-1":2,"SHA-256":8,"SHA-384":9,"SHA-512":10},aead:{eax:1,ocb:2,experimentalGCM:100},packet:{publicKeyEncryptedSessionKey:1,signature:2,symEncryptedSessionKey:3,onePassSignature:4,secretKey:5,publicKey:6,secretSubkey:7,compressedData:8,symmetricallyEncryptedData:9,marker:10,literalData:11,trust:12,userID:13,publicSubkey:14,userAttribute:17,symEncryptedIntegrityProtectedData:18,modificationDetectionCode:19,aeadEncryptedData:20},literal:{binary:98,text:116,utf8:117,mime:109},signature:{binary:0,text:1,standalone:2,certGeneric:16,certPersona:17,certCasual:18,certPositive:19,certRevocation:48,subkeyBinding:24,keyBinding:25,key:31,keyRevocation:32,subkeyRevocation:40,timestamp:64,thirdParty:80},signatureSubpacket:{signatureCreationTime:2,signatureExpirationTime:3,exportableCertification:4,trustSignature:5,regularExpression:6,revocable:7,keyExpirationTime:9,placeholderBackwardsCompatibility:10,preferredSymmetricAlgorithms:11,revocationKey:12,issuer:16,notationData:20,preferredHashAlgorithms:21,preferredCompressionAlgorithms:22,keyServerPreferences:23,preferredKeyServer:24,primaryUserID:25,policyURI:26,keyFlags:27,signersUserID:28,reasonForRevocation:29,features:30,signatureTarget:31,embeddedSignature:32,issuerFingerprint:33,preferredAEADAlgorithms:34},keyFlags:{certifyKeys:1,signData:2,encryptCommunication:4,encryptStorage:8,splitPrivateKey:16,authentication:32,sharedPrivateKey:128},armor:{multipartSection:0,multipartLast:1,signed:2,message:3,publicKey:4,privateKey:5,signature:6},reasonForRevocation:{noReason:0,keySuperseded:1,keyCompromised:2,keyRetired:3,userIDInvalid:32},features:{modificationDetection:1,aead:2,v5Keys:4},write:function(Ae,Se){if("number"==typeof Se&&(Se=this.read(Ae,Se)),void 0!==Ae[Se])return Ae[Se];throw Error("Invalid enum value.")},read:function(Ae,Se){if(Ae[ir]||(Ae[ir]=[],Object.entries(Ae).forEach((([Se,Ce])=>{Ae[ir][Ce]=Se}))),void 0!==Ae[ir][Se])return Ae[ir][Se];throw Error("Invalid enum value.")}};const sr=(()=>{try{return"development"===process.env.NODE_ENV}catch(Ae){}return!1})(),ar={isString:function(Ae){return"string"==typeof Ae||Ae instanceof String},isArray:function(Ae){return Ae instanceof Array},isUint8Array:P,isStream:E,readNumber:function(Ae){let Se=0;for(let Ce=0;Ce>8*(Se-qe-1)&255;return Ce},readDate:function(Ae){const Se=ar.readNumber(Ae);return new Date(1e3*Se)},writeDate:function(Ae){const Se=Math.floor(Ae.getTime()/1e3);return ar.writeNumber(Se,4)},normalizeDate:function(Ae=Date.now()){return null===Ae||Ae===1/0?Ae:new Date(1e3*Math.floor(+Ae/1e3))},readMPI:function(Ae){const Se=(Ae[0]<<8|Ae[1])+7>>>3;return Ae.subarray(2,2+Se)},leftPad(Ae,Se){const Ce=new Uint8Array(Se),qe=Se-Ae.length;return Ce.set(Ae,qe),Ce},uint8ArrayToMPI:function(Ae){const Se=ar.uint8ArrayBitLength(Ae);if(0===Se)throw Error("Zero MPI");const Ce=Ae.subarray(Ae.length-Math.ceil(Se/8)),qe=new Uint8Array([(65280&Se)>>8,255&Se]);return ar.concatUint8Array([qe,Ce])},uint8ArrayBitLength:function(Ae){let Se;for(Se=0;Se>1);for(let Ce=0;Ce>1;Ce++)Se[Ce]=parseInt(Ae.substr(Ce<<1,2),16);return Se},uint8ArrayToHex:function(Ae){const Se=[],Ce=Ae.length;let qe,Fe=0;for(;Fe{if(!ar.isString(Ae))throw Error("stringToUint8Array: Data must be in the form of a string");const Se=new Uint8Array(Ae.length);for(let Ce=0;Cer("",!0)))},decodeUTF8:function(Ae){const Se=new TextDecoder("utf-8");function r(Ae,Ce=!1){return Se.decode(Ae,{stream:!Ce})}return X(Ae,r,(()=>r(new Uint8Array,!0)))},concat:H,concatUint8Array:x,equalsUint8Array:function(Ae,Se){if(!ar.isUint8Array(Ae)||!ar.isUint8Array(Se))throw Error("Data must be in the form of a Uint8Array");if(Ae.length!==Se.length)return!1;for(let Ce=0;Ce>>16;return 0!==Ce&&(Ae=Ce,Se+=16),Ce=Ae>>8,0!==Ce&&(Ae=Ce,Se+=8),Ce=Ae>>4,0!==Ce&&(Ae=Ce,Se+=4),Ce=Ae>>2,0!==Ce&&(Ae=Ce,Se+=2),Ce=Ae>>1,0!==Ce&&(Ae=Ce,Se+=1),Se},double:function(Ae){const Se=new Uint8Array(Ae.length),Ce=Ae.length-1;for(let qe=0;qe>7;return Se[Ce]=Ae[Ce]<<1^135*(Ae[0]>>7),Se},shiftRight:function(Ae,Se){if(Se)for(let Ce=Ae.length-1;Ce>=0;Ce--)Ae[Ce]>>=Se,Ce>0&&(Ae[Ce]|=Ae[Ce-1]<<8-Se);return Ae},getWebCrypto:function(){return void 0!==qe&&qe.crypto&&qe.crypto.subtle},getBigInteger:async function(){if(oe())return se;{const{default:Ae}=await Promise.resolve().then((function(){return ym}));return Ae}},getNodeCrypto:function(){return yt.default},getNodeZlib:function(){return vt.default},getNodeBuffer:function(){return(ht.default||{}).Buffer},getHardwareConcurrency:function(){if("undefined"!=typeof navigator)return navigator.hardwareConcurrency||1;return _t.default.cpus().length},isEmailAddress:function(Ae){if(!ar.isString(Ae))return!1;return/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+([a-zA-Z]{2,}[0-9]*|xn--[a-zA-Z\-0-9]+)))$/.test(Ae)},canonicalizeEOL:function(Ae){let Se=!1;return X(Ae,(Ae=>{let Ce;Se&&(Ae=ar.concatUint8Array([new Uint8Array([13]),Ae])),13===Ae[Ae.length-1]?(Se=!0,Ae=Ae.subarray(0,-1)):Se=!1;const qe=[];for(let Se=0;Ce=Ae.indexOf(10,Se)+1,Ce;Se=Ce)13!==Ae[Ce-2]&&qe.push(Ce);if(!qe.length)return Ae;const Fe=new Uint8Array(Ae.length+qe.length);let $e=0;for(let Se=0;SeSe?new Uint8Array([13]):void 0))},nativeEOL:function(Ae){let Se=!1;return X(Ae,(Ae=>{let Ce;13===(Ae=Se&&10!==Ae[0]?ar.concatUint8Array([new Uint8Array([13]),Ae]):new Uint8Array(Ae))[Ae.length-1]?(Se=!0,Ae=Ae.subarray(0,-1)):Se=!1;let qe=0;for(let Se=0;Se!==Ae.length;Se=Ce){Ce=Ae.indexOf(13,Se)+1,Ce||(Ce=Ae.length);const Fe=Ce-(10===Ae[Ce]?1:0);Se&&Ae.copyWithin(qe,Se,Fe),qe+=Fe-Se}return Ae.subarray(0,qe)}),(()=>Se?new Uint8Array([13]):void 0))},removeTrailingSpaces:function(Ae){return Ae.split("\n").map((Ae=>{let Se=Ae.length-1;for(;Se>=0&&(" "===Ae[Se]||"\t"===Ae[Se]||"\r"===Ae[Se]);Se--);return Ae.substr(0,Se+1)})).join("\n")},wrapError:function(Ae,Se){if(!Se)return Error(Ae);try{Se.message=Ae+": "+Se.message}catch(Ae){}return Se},constructAllowedPackets:function(Ae){const Se={};return Ae.forEach((Ae=>{if(!Ae.tag)throw Error("Invalid input: expected a packet class");Se[Ae.tag]=Ae})),Se},anyPromise:function(Ae){return new Promise((async(Se,Ce)=>{let qe;await Promise.all(Ae.map((async Ae=>{try{Se(await Ae)}catch(Ae){qe=Ae}}))),Ce(qe)}))},selectUint8Array:function(Ae,Se,Ce){const qe=Math.max(Se.length,Ce.length),Fe=new Uint8Array(qe);let $e=0;for(let qe=0;qe{Se=ar.concatUint8Array([Se,Ae]);const Ce=[],qe=Math.floor(Se.length/45),Fe=45*qe,$e=ur(Se.subarray(0,Fe));for(let Ae=0;AeSe.length?ur(Se)+"\n":""))}function be(Ae){let Se="";return X(Ae,(Ae=>{Se+=Ae;let Ce=0;const qe=[" ","\t","\r","\n"];for(let Ae=0;Ae0&&(Fe-Ce)%4!=0;Fe--)qe.includes(Se[Fe])&&Ce--;const $e=hr(Se.substr(0,Fe));return Se=Se.substr(Fe),$e}),(()=>hr(Se)))}function ge(Ae){return be(Ae.replace(/-/g,"+").replace(/_/g,"/"))}function me(Ae,Se){let Ce=ye(Ae).replace(/[\r\n]/g,"");return Se&&(Ce=Ce.replace(/[+]/g,"-").replace(/[/]/g,"_").replace(/[=]/g,"")),Ce}cr?(ur=Ae=>cr.from(Ae).toString("base64"),hr=Ae=>{const Se=cr.from(Ae,"base64");return new Uint8Array(Se.buffer,Se.byteOffset,Se.byteLength)}):(ur=Ae=>btoa(ar.uint8ArrayToString(Ae)),hr=Ae=>ar.stringToUint8Array(atob(Ae)));var dr={preferredHashAlgorithm:nr.hash.sha256,preferredSymmetricAlgorithm:nr.symmetric.aes256,preferredCompressionAlgorithm:nr.compression.uncompressed,deflateLevel:6,aeadProtect:!1,preferredAEADAlgorithm:nr.aead.eax,aeadChunkSizeByte:12,v5Keys:!1,s2kIterationCountByte:224,allowUnauthenticatedMessages:!1,allowUnauthenticatedStream:!1,checksumRequired:!1,minRSABits:2047,passwordCollisionCheck:!1,revocationsExpire:!1,allowInsecureDecryptionWithSigningKeys:!1,allowInsecureVerificationWithReformattedKeys:!1,constantTimePKCS1Decryption:!1,constantTimePKCS1DecryptionSupportedSymmetricAlgorithms:new Set([nr.symmetric.aes128,nr.symmetric.aes192,nr.symmetric.aes256]),minBytesForWebCrypto:1e3,ignoreUnsupportedPackets:!0,ignoreMalformedPackets:!1,additionalAllowedPackets:[],showVersion:!1,showComment:!1,versionString:"OpenPGP.js 5.11.0",commentString:"https://openpgpjs.org",maxUserIDLength:5120,knownNotations:[],useIndutnyElliptic:!0,rejectHashAlgorithms:new Set([nr.hash.md5,nr.hash.ripemd]),rejectMessageHashAlgorithms:new Set([nr.hash.md5,nr.hash.ripemd,nr.hash.sha1]),rejectPublicKeyAlgorithms:new Set([nr.publicKey.elgamal,nr.publicKey.dsa]),rejectCurves:new Set([nr.curve.secp256k1])};function ve(Ae){const Se=Ae.match(/^-----BEGIN PGP (MESSAGE, PART \d+\/\d+|MESSAGE, PART \d+|SIGNED MESSAGE|MESSAGE|PUBLIC KEY BLOCK|PRIVATE KEY BLOCK|SIGNATURE)-----$/m);if(!Se)throw Error("Unknown ASCII armor type");return/MESSAGE, PART \d+\/\d+/.test(Se[1])?nr.armor.multipartSection:/MESSAGE, PART \d+/.test(Se[1])?nr.armor.multipartLast:/SIGNED MESSAGE/.test(Se[1])?nr.armor.signed:/MESSAGE/.test(Se[1])?nr.armor.message:/PUBLIC KEY BLOCK/.test(Se[1])?nr.armor.publicKey:/PRIVATE KEY BLOCK/.test(Se[1])?nr.armor.privateKey:/SIGNATURE/.test(Se[1])?nr.armor.signature:void 0}function _e(Ae,Se){let Ce="";return Se.showVersion&&(Ce+="Version: "+Se.versionString+"\n"),Se.showComment&&(Ce+="Comment: "+Se.commentString+"\n"),Ae&&(Ce+="Comment: "+Ae+"\n"),Ce+="\n",Ce}function ke(Ae){return ye(function(Ae){let Se=13501623;return X(Ae,(Ae=>{const Ce=fr?Math.floor(Ae.length/4):0,qe=new Uint32Array(Ae.buffer,Ae.byteOffset,Ce);for(let Ae=0;Ae>24&255]^lr[1][Se>>16&255]^lr[2][Se>>8&255]^lr[3][Se>>0&255];for(let qe=4*Ce;qe>8^lr[0][255&Se^Ae[qe]]}),(()=>new Uint8Array([Se,Se>>8,Se>>16])))}(Ae))}const lr=[Array(255),Array(255),Array(255),Array(255)];for(let Ae=0;Ae<=255;Ae++){let Se=Ae<<16;for(let Ae=0;Ae<8;Ae++)Se=Se<<1^(0!=(8388608&Se)?8801531:0);lr[0][Ae]=(16711680&Se)>>16|65280&Se|(255&Se)<<16}for(let Ae=0;Ae<=255;Ae++)lr[1][Ae]=lr[0][Ae]>>8^lr[0][255&lr[0][Ae]];for(let Ae=0;Ae<=255;Ae++)lr[2][Ae]=lr[1][Ae]>>8^lr[0][255&lr[1][Ae]];for(let Ae=0;Ae<=255;Ae++)lr[3][Ae]=lr[2][Ae]>>8^lr[0][255&lr[2][Ae]];const fr=function(){const Ae=new ArrayBuffer(2);return new DataView(Ae).setInt16(0,255,!0),255===new Int16Array(Ae)[0]}();function Ee(Ae){for(let Se=0;Se=0&&qe!==Ae.length-1&&(Se=Ae.slice(0,qe),Ce=Ae.slice(qe+1).substr(0,4)),{body:Se,checksum:Ce}}function xe(Ae,Se=dr){return new Promise((async(Ce,qe)=>{try{const Fe=/^-----[^-]+-----$/m,$e=/^[ \f\r\t\u00a0\u2000-\u200a\u202f\u205f\u3000]*$/;let rt;const it=[];let nt,st,ut,ht=it,ft=[],yt=be(Y(Ae,(async(Ae,Se)=>{const vt=W(Ae);try{for(;;){let Ae=await vt.readLine();if(void 0===Ae)throw Error("Misformed armored text");if(Ae=ar.removeTrailingSpaces(Ae.replace(/[\r\n]/g,"")),rt)if(nt)st||2!==rt||(Fe.test(Ae)?(ft=ft.join("\r\n"),st=!0,Ee(ht),ht=[],nt=!1):ft.push(Ae.replace(/^- /,"")));else if(Fe.test(Ae)&&qe(Error("Mandatory blank line missing between armor headers and armor data")),$e.test(Ae)){if(Ee(ht),nt=!0,st||2!==rt){Ce({text:ft,data:yt,headers:it,type:rt});break}}else ht.push(Ae);else Fe.test(Ae)&&(rt=ve(Ae))}}catch(Ae){return void qe(Ae)}const _t=G(Se);try{for(;;){await _t.ready;const{done:Ae,value:Se}=await vt.read();if(Ae)throw Error("Misformed armored text");const Ce=Se+"";if(-1!==Ce.indexOf("=")||-1!==Ce.indexOf("-")){let Ae=await vt.readToEnd();Ae.length||(Ae=""),Ae=Ce+Ae,Ae=ar.removeTrailingSpaces(Ae.replace(/\r/g,""));const Se=Ae.split(Fe);if(1===Se.length)throw Error("Misformed armored text");const qe=Pe(Se[0].slice(0,-1));ut=qe.checksum,await _t.write(qe.body);break}await _t.write(Ce)}await _t.ready,await _t.close()}catch(Ae){await _t.abort(Ae)}})));yt=Y(yt,(async(Ae,Ce)=>{const qe=ie(ke(ee(Ae)));qe.catch((()=>{})),await V(Ae,Ce,{preventClose:!0});const Fe=G(Ce);try{const Ae=(await qe).replace("\n","");if(ut!==Ae&&(ut||Se.checksumRequired))throw Error("Ascii armor integrity check failed");await Fe.ready,await Fe.close()}catch(Ae){await Fe.abort(Ae)}}))}catch(Ae){qe(Ae)}})).then((async Ae=>(_(Ae.data)&&(Ae.data=await ie(Ae.data)),Ae)))}function Me(Ae,Se,Ce,qe,Fe,$e=dr){let rt,it;Ae===nr.armor.signed&&(rt=Se.text,it=Se.hash,Se=Se.data);const nt=ee(Se),st=[];switch(Ae){case nr.armor.multipartSection:st.push("-----BEGIN PGP MESSAGE, PART "+Ce+"/"+qe+"-----\n"),st.push(_e(Fe,$e)),st.push(ye(Se)),st.push("=",ke(nt)),st.push("-----END PGP MESSAGE, PART "+Ce+"/"+qe+"-----\n");break;case nr.armor.multipartLast:st.push("-----BEGIN PGP MESSAGE, PART "+Ce+"-----\n"),st.push(_e(Fe,$e)),st.push(ye(Se)),st.push("=",ke(nt)),st.push("-----END PGP MESSAGE, PART "+Ce+"-----\n");break;case nr.armor.signed:st.push("-----BEGIN PGP SIGNED MESSAGE-----\n"),st.push("Hash: "+it+"\n\n"),st.push(rt.replace(/^-/gm,"- -")),st.push("\n-----BEGIN PGP SIGNATURE-----\n"),st.push(_e(Fe,$e)),st.push(ye(Se)),st.push("=",ke(nt)),st.push("-----END PGP SIGNATURE-----\n");break;case nr.armor.message:st.push("-----BEGIN PGP MESSAGE-----\n"),st.push(_e(Fe,$e)),st.push(ye(Se)),st.push("=",ke(nt)),st.push("-----END PGP MESSAGE-----\n");break;case nr.armor.publicKey:st.push("-----BEGIN PGP PUBLIC KEY BLOCK-----\n"),st.push(_e(Fe,$e)),st.push(ye(Se)),st.push("=",ke(nt)),st.push("-----END PGP PUBLIC KEY BLOCK-----\n");break;case nr.armor.privateKey:st.push("-----BEGIN PGP PRIVATE KEY BLOCK-----\n"),st.push(_e(Fe,$e)),st.push(ye(Se)),st.push("=",ke(nt)),st.push("-----END PGP PRIVATE KEY BLOCK-----\n");break;case nr.armor.signature:st.push("-----BEGIN PGP SIGNATURE-----\n"),st.push(_e(Fe,$e)),st.push(ye(Se)),st.push("=",ke(nt)),st.push("-----END PGP SIGNATURE-----\n")}return ar.concat(st)}class Ke{constructor(){this.bytes=""}read(Ae){return this.bytes=ar.uint8ArrayToString(Ae.subarray(0,8)),this.bytes.length}write(){return ar.stringToUint8Array(this.bytes)}toHex(){return ar.uint8ArrayToHex(ar.stringToUint8Array(this.bytes))}equals(Ae,Se=!1){return Se&&(Ae.isWildcard()||this.isWildcard())||this.bytes===Ae.bytes}isNull(){return""===this.bytes}isWildcard(){return/^0+$/.test(this.toHex())}static mapToHex(Ae){return Ae.toHex()}static fromID(Ae){const Se=new Ke;return Se.read(ar.hexToUint8Array(Ae)),Se}static wildcard(){const Ae=new Ke;return Ae.read(new Uint8Array(8)),Ae}}var yr=function(){var Ae,Se,Ce=!1;function i(Ce,qe){var Fe=Ae[(Se[Ce]+Se[qe])%255];return 0!==Ce&&0!==qe||(Fe=0),Fe}var qe,Fe,$e,rt,it=!1;function u(){function u(Ce){var qe,Fe,$e;for(Fe=$e=function(Ce){var qe=Ae[255-Se[Ce]];return 0===Ce&&(qe=0),qe}(Ce),qe=0;qe<4;qe++)$e^=Fe=255&(Fe<<1|Fe>>>7);return $e^=99}Ce||function(){Ae=[],Se=[];var qe,Fe,$e=1;for(qe=0;qe<255;qe++)Ae[qe]=$e,Fe=128&$e,$e<<=1,$e&=255,128===Fe&&($e^=27),$e^=Ae[qe],Se[Ae[qe]]=qe;Ae[255]=Ae[0],Se[0]=0,Ce=!0}(),qe=[],Fe=[],$e=[[],[],[],[]],rt=[[],[],[],[]];for(var nt=0;nt<256;nt++){var st=u(nt);qe[nt]=st,Fe[st]=nt,$e[0][nt]=i(2,st)<<24|st<<16|st<<8|i(3,st),rt[0][st]=i(14,nt)<<24|i(9,nt)<<16|i(13,nt)<<8|i(11,nt);for(var ut=1;ut<4;ut++)$e[ut][nt]=$e[ut-1][nt]>>>8|$e[ut-1][nt]<<24,rt[ut][st]=rt[ut-1][st]>>>8|rt[ut-1][st]<<24}it=!0}var h=function(Ae,Se){it||u();var Ce=new Uint32Array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,U,R,I];var Gt=[K,B];return{set_rounds:T,set_state:z,set_iv:q,set_nonce:F,set_mask:O,set_counter:L,get_state:N,get_iv:j,gcm_init:H,cipher:W,mac:G}}({Uint8Array:Uint8Array,Uint32Array:Uint32Array},Ae,Se);return st.set_key=function(Ae,Se,Fe,$e,it,nt,ut,ht,ft){var yt=Ce.subarray(0,60),vt=Ce.subarray(256,316);yt.set([Se,Fe,$e,it,nt,ut,ht,ft]);for(var _t=Ae,Ct=1;_t<4*Ae+28;_t++){var Rt=yt[_t-1];(_t%Ae==0||8===Ae&&_t%Ae==4)&&(Rt=qe[Rt>>>24]<<24^qe[Rt>>>16&255]<<16^qe[Rt>>>8&255]<<8^qe[255&Rt]),_t%Ae==0&&(Rt=Rt<<8^Rt>>>24^Ct<<24,Ct=Ct<<1^(128&Ct?27:0)),yt[_t]=yt[_t-Ae]^Rt}for(var Ut=0;Ut<_t;Ut+=4)for(var It=0;It<4;It++){Rt=yt[_t-(4+Ut)+(4-It)%4];vt[Ut+It]=Ut<4||Ut>=_t-4?Rt:rt[0][qe[Rt>>>24]]^rt[1][qe[Rt>>>16&255]]^rt[2][qe[Rt>>>8&255]]^rt[3][qe[255&Rt]]}st.set_rounds(Ae+5)},st};return h.ENC={ECB:0,CBC:2,CFB:4,OFB:6,CTR:7},h.DEC={ECB:1,CBC:3,CFB:5,OFB:6,CTR:7},h.MAC={CBC:0,GCM:1},h.HEAP_DATA=16384,h}();function De(Ae){return Ae instanceof Uint8Array}function Ue(Ae,Se){const Ce=Ae?Ae.byteLength:Se||65536;if(4095&Ce||Ce<=0)throw Error("heap size must be a positive integer and a multiple of 4096");return Ae=Ae||new Uint8Array(new ArrayBuffer(Ce))}function Re(Ae,Se,Ce,qe,Fe){const $e=Ae.length-Se,rt=$eAe+Se.length),0),Ce=new Uint8Array(Se);let qe=0;for(let Se=0;Se>2,Fe.getUint32(0),Fe.getUint32(4),Fe.getUint32(8),Fe.getUint32(12),qe>16?Fe.getUint32(16):0,qe>16?Fe.getUint32(20):0,qe>24?Fe.getUint32(24):0,qe>24?Fe.getUint32(28):0),void 0!==Se){if(16!==Se.length)throw new Te("illegal iv size");let Ae=new DataView(Se.buffer,Se.byteOffset,Se.byteLength);Ce.set_iv(Ae.getUint32(0),Ae.getUint32(4),Ae.getUint32(8),Ae.getUint32(12))}else Ce.set_iv(0,0,0,0)}AES_Encrypt_process(Ae){if(!De(Ae))throw new TypeError("data isn't of expected type");let{heap:Se,asm:Ce}=this.acquire_asm(),qe=yr.ENC[this.mode],Fe=yr.HEAP_DATA,$e=this.pos,rt=this.len,it=0,nt=Ae.length||0,st=0,ut=0,ht=new Uint8Array(rt+nt&-16);for(;nt>0;)ut=Re(Se,$e+rt,Ae,it,nt),rt+=ut,it+=ut,nt-=ut,ut=Ce.cipher(qe,Fe+$e,rt),ut&&ht.set(Se.subarray($e,$e+ut),st),st+=ut,ut0;)ft=Re(Se,$e+rt,Ae,it,nt),rt+=ft,it+=ft,nt-=ft,ft=Ce.cipher(qe,Fe+$e,rt-(nt?0:ht)),ft&&yt.set(Se.subarray($e,$e+ft),st),st+=ft,ft0){if($e%16){if(this.hasOwnProperty("padding"))throw new Te("data length must be a multiple of the block size");$e+=16-$e%16}if(Se.cipher(Ce,qe+Fe,$e),this.hasOwnProperty("padding")&&this.padding){let Se=Ae[Fe+rt-1];if(Se<1||Se>16||Se>rt)throw new ze("bad padding");let Ce=0;for(let qe=Se;qe>1;qe--)Ce|=Se^Ae[Fe+rt-qe];if(Ce)throw new ze("bad padding");rt-=Se}}const it=new Uint8Array(rt);return rt>0&&it.set(Ae.subarray(Fe,Fe+rt)),this.pos=0,this.len=0,this.release_asm(),it}}class Le{static encrypt(Ae,Se,Ce=!1){return new Le(Se,Ce).encrypt(Ae)}static decrypt(Ae,Se,Ce=!1){return new Le(Se,Ce).decrypt(Ae)}constructor(Ae,Se=!1,Ce){this.aes=Ce||new Oe(Ae,void 0,Se,"ECB")}encrypt(Ae){return Ie(this.aes.AES_Encrypt_process(Ae),this.aes.AES_Encrypt_finish())}decrypt(Ae){return Ie(this.aes.AES_Decrypt_process(Ae),this.aes.AES_Decrypt_finish())}}function Ne(Ae){const t=function(Ae){const Se=new Le(Ae);this.encrypt=function(Ae){return Se.encrypt(Ae)},this.decrypt=function(Ae){return Se.decrypt(Ae)}};return t.blockSize=t.prototype.blockSize=16,t.keySize=t.prototype.keySize=Ae/8,t}function je(Ae,Se,Ce,qe,Fe,$e){const rt=[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],it=[-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],nt=[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],st=[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],ut=[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],ht=[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],ft=[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],yt=[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];let vt,_t,Ct,Rt,Ut,It,Ot,Nt,jt,Ft,Lt,Ht,Wt,Gt,$t=0,Vt=Se.length;const Qt=32===Ae.length?3:9;Nt=3===Qt?Ce?[0,32,2]:[30,-2,-2]:Ce?[0,32,2,62,30,-2,64,96,2]:[94,62,-2,32,64,2,30,-2,-2],Ce&&(Se=function(Ae,Se){const Ce=8-Ae.length%8;let qe;if(2===Se&&Ce<8)qe=32;else if(1===Se)qe=Ce;else{if(Se||!(Ce<8)){if(8===Ce)return Ae;throw Error("des: invalid padding")}qe=0}const Fe=new Uint8Array(Ae.length+Ce);for(let Se=0;Se>>4^Ot),Ot^=Ct,It^=Ct<<4,Ct=65535&(It>>>16^Ot),Ot^=Ct,It^=Ct<<16,Ct=858993459&(Ot>>>2^It),It^=Ct,Ot^=Ct<<2,Ct=16711935&(Ot>>>8^It),It^=Ct,Ot^=Ct<<8,Ct=1431655765&(It>>>1^Ot),Ot^=Ct,It^=Ct<<1,It=It<<1|It>>>31,Ot=Ot<<1|Ot>>>31,_t=0;_t>>4|Ot<<28)^Ae[vt+1],Ct=It,It=Ot,Ot=Ct^(it[Rt>>>24&63]|st[Rt>>>16&63]|ht[Rt>>>8&63]|yt[63&Rt]|rt[Ut>>>24&63]|nt[Ut>>>16&63]|ut[Ut>>>8&63]|ft[63&Ut]);Ct=It,It=Ot,Ot=Ct}It=It>>>1|It<<31,Ot=Ot>>>1|Ot<<31,Ct=1431655765&(It>>>1^Ot),Ot^=Ct,It^=Ct<<1,Ct=16711935&(Ot>>>8^It),It^=Ct,Ot^=Ct<<8,Ct=858993459&(Ot>>>2^It),It^=Ct,Ot^=Ct<<2,Ct=65535&(It>>>16^Ot),Ot^=Ct,It^=Ct<<16,Ct=252645135&(It>>>4^Ot),Ot^=Ct,It^=Ct<<4,1===qe&&(Ce?(jt=It,Lt=Ot):(It^=Ft,Ot^=Ht)),Zt[Xt++]=It>>>24,Zt[Xt++]=It>>>16&255,Zt[Xt++]=It>>>8&255,Zt[Xt++]=255&It,Zt[Xt++]=Ot>>>24,Zt[Xt++]=Ot>>>16&255,Zt[Xt++]=Ot>>>8&255,Zt[Xt++]=255&Ot}return Ce||(Zt=function(Ae,Se){let Ce,qe=null;if(2===Se)Ce=32;else if(1===Se)qe=Ae[Ae.length-1];else{if(Se)throw Error("des: invalid padding");Ce=0}if(!qe){for(qe=1;Ae[Ae.length-qe]===Ce;)qe++;qe--}return Ae.subarray(0,Ae.length-qe)}(Zt,$e)),Zt}function He(Ae){const Se=[0,4,536870912,536870916,65536,65540,536936448,536936452,512,516,536871424,536871428,66048,66052,536936960,536936964],Ce=[0,1,1048576,1048577,67108864,67108865,68157440,68157441,256,257,1048832,1048833,67109120,67109121,68157696,68157697],qe=[0,8,2048,2056,16777216,16777224,16779264,16779272,0,8,2048,2056,16777216,16777224,16779264,16779272],Fe=[0,2097152,134217728,136314880,8192,2105344,134225920,136323072,131072,2228224,134348800,136445952,139264,2236416,134356992,136454144],$e=[0,262144,16,262160,0,262144,16,262160,4096,266240,4112,266256,4096,266240,4112,266256],rt=[0,1024,32,1056,0,1024,32,1056,33554432,33555456,33554464,33555488,33554432,33555456,33554464,33555488],it=[0,268435456,524288,268959744,2,268435458,524290,268959746,0,268435456,524288,268959744,2,268435458,524290,268959746],nt=[0,65536,2048,67584,536870912,536936448,536872960,536938496,131072,196608,133120,198656,537001984,537067520,537004032,537069568],st=[0,262144,0,262144,2,262146,2,262146,33554432,33816576,33554432,33816576,33554434,33816578,33554434,33816578],ut=[0,268435456,8,268435464,0,268435456,8,268435464,1024,268436480,1032,268436488,1024,268436480,1032,268436488],ht=[0,32,0,32,1048576,1048608,1048576,1048608,8192,8224,8192,8224,1056768,1056800,1056768,1056800],ft=[0,16777216,512,16777728,2097152,18874368,2097664,18874880,67108864,83886080,67109376,83886592,69206016,85983232,69206528,85983744],yt=[0,4096,134217728,134221824,524288,528384,134742016,134746112,16,4112,134217744,134221840,524304,528400,134742032,134746128],vt=[0,4,256,260,0,4,256,260,1,5,257,261,1,5,257,261],_t=Ae.length>8?3:1,Ct=Array(32*_t),Rt=[0,0,1,1,1,1,1,1,0,1,1,1,1,1,1,0];let Ut,It,Ot,Nt=0,jt=0;for(let Ft=0;Ft<_t;Ft++){let _t=Ae[Nt++]<<24|Ae[Nt++]<<16|Ae[Nt++]<<8|Ae[Nt++],Ft=Ae[Nt++]<<24|Ae[Nt++]<<16|Ae[Nt++]<<8|Ae[Nt++];Ot=252645135&(_t>>>4^Ft),Ft^=Ot,_t^=Ot<<4,Ot=65535&(Ft>>>-16^_t),_t^=Ot,Ft^=Ot<<-16,Ot=858993459&(_t>>>2^Ft),Ft^=Ot,_t^=Ot<<2,Ot=65535&(Ft>>>-16^_t),_t^=Ot,Ft^=Ot<<-16,Ot=1431655765&(_t>>>1^Ft),Ft^=Ot,_t^=Ot<<1,Ot=16711935&(Ft>>>8^_t),_t^=Ot,Ft^=Ot<<8,Ot=1431655765&(_t>>>1^Ft),Ft^=Ot,_t^=Ot<<1,Ot=_t<<8|Ft>>>20&240,_t=Ft<<24|Ft<<8&16711680|Ft>>>8&65280|Ft>>>24&240,Ft=Ot;for(let Ae=0;Ae<16;Ae++)Rt[Ae]?(_t=_t<<2|_t>>>26,Ft=Ft<<2|Ft>>>26):(_t=_t<<1|_t>>>27,Ft=Ft<<1|Ft>>>27),_t&=-15,Ft&=-15,Ut=Se[_t>>>28]|Ce[_t>>>24&15]|qe[_t>>>20&15]|Fe[_t>>>16&15]|$e[_t>>>12&15]|rt[_t>>>8&15]|it[_t>>>4&15],It=nt[Ft>>>28]|st[Ft>>>24&15]|ut[Ft>>>20&15]|ht[Ft>>>16&15]|ft[Ft>>>12&15]|yt[Ft>>>8&15]|vt[Ft>>>4&15],Ot=65535&(It>>>16^Ut),Ct[jt++]=Ut^Ot,Ct[jt++]=It^Ot<<16}return Ct}function We(Ae){this.key=[];for(let Se=0;Se<3;Se++)this.key.push(new Uint8Array(Ae.subarray(8*Se,8*Se+8)));this.encrypt=function(Ae){return je(He(this.key[2]),je(He(this.key[1]),je(He(this.key[0]),Ae,!0,0,null,null),!1,0,null,null),!0,0,null,null)}}function Ge(){this.BlockSize=8,this.KeySize=16,this.setKey=function(Ae){if(this.masking=Array(16),this.rotate=Array(16),this.reset(),Ae.length!==this.KeySize)throw Error("CAST-128: keys must be 16 bytes");return this.keySchedule(Ae),!0},this.reset=function(){for(let Ae=0;Ae<16;Ae++)this.masking[Ae]=0,this.rotate[Ae]=0},this.getBlockSize=function(){return this.BlockSize},this.encrypt=function(Ae){const Se=Array(Ae.length);for(let Ce=0;Ce>>24&255,Se[Ce+1]=$e>>>16&255,Se[Ce+2]=$e>>>8&255,Se[Ce+3]=255&$e,Se[Ce+4]=Fe>>>24&255,Se[Ce+5]=Fe>>>16&255,Se[Ce+6]=Fe>>>8&255,Se[Ce+7]=255&Fe}return Se},this.decrypt=function(Ae){const Se=Array(Ae.length);for(let Ce=0;Ce>>24&255,Se[Ce+1]=$e>>>16&255,Se[Ce+2]=$e>>>8&255,Se[Ce+3]=255&$e,Se[Ce+4]=Fe>>>24&255,Se[Ce+5]=Fe>>16&255,Se[Ce+6]=Fe>>8&255,Se[Ce+7]=255&Fe}return Se};const Ae=[,,,,];Ae[0]=[,,,,],Ae[0][0]=[4,0,13,15,12,14,8],Ae[0][1]=[5,2,16,18,17,19,10],Ae[0][2]=[6,3,23,22,21,20,9],Ae[0][3]=[7,1,26,25,27,24,11],Ae[1]=[,,,,],Ae[1][0]=[0,6,21,23,20,22,16],Ae[1][1]=[1,4,0,2,1,3,18],Ae[1][2]=[2,5,7,6,5,4,17],Ae[1][3]=[3,7,10,9,11,8,19],Ae[2]=[,,,,],Ae[2][0]=[4,0,13,15,12,14,8],Ae[2][1]=[5,2,16,18,17,19,10],Ae[2][2]=[6,3,23,22,21,20,9],Ae[2][3]=[7,1,26,25,27,24,11],Ae[3]=[,,,,],Ae[3][0]=[0,6,21,23,20,22,16],Ae[3][1]=[1,4,0,2,1,3,18],Ae[3][2]=[2,5,7,6,5,4,17],Ae[3][3]=[3,7,10,9,11,8,19];const Se=[,,,,];function r(Ae,Se,qe){const Fe=Se+Ae,$e=Fe<>>32-qe;return(Ce[0][$e>>>24]^Ce[1][$e>>>16&255])-Ce[2][$e>>>8&255]+Ce[3][255&$e]}function i(Ae,Se,qe){const Fe=Se^Ae,$e=Fe<>>32-qe;return Ce[0][$e>>>24]-Ce[1][$e>>>16&255]+Ce[2][$e>>>8&255]^Ce[3][255&$e]}function n(Ae,Se,qe){const Fe=Se-Ae,$e=Fe<>>32-qe;return(Ce[0][$e>>>24]+Ce[1][$e>>>16&255]^Ce[2][$e>>>8&255])-Ce[3][255&$e]}Se[0]=[,,,,],Se[0][0]=[24,25,23,22,18],Se[0][1]=[26,27,21,20,22],Se[0][2]=[28,29,19,18,25],Se[0][3]=[30,31,17,16,28],Se[1]=[,,,,],Se[1][0]=[3,2,12,13,8],Se[1][1]=[1,0,14,15,13],Se[1][2]=[7,6,8,9,3],Se[1][3]=[5,4,10,11,7],Se[2]=[,,,,],Se[2][0]=[19,18,28,29,25],Se[2][1]=[17,16,30,31,28],Se[2][2]=[23,22,24,25,18],Se[2][3]=[21,20,26,27,22],Se[3]=[,,,,],Se[3][0]=[8,9,7,6,3],Se[3][1]=[10,11,5,4,7],Se[3][2]=[12,13,3,2,8],Se[3][3]=[14,15,1,0,13],this.keySchedule=function(qe){const Fe=[,,,,,,,,],$e=Array(32);let rt;for(let Ae=0;Ae<4;Ae++)rt=4*Ae,Fe[Ae]=qe[rt]<<24|qe[rt+1]<<16|qe[rt+2]<<8|qe[rt+3];const it=[6,7,4,5];let nt,st=0;for(let qe=0;qe<2;qe++)for(let qe=0;qe<4;qe++){for(rt=0;rt<4;rt++){const Se=Ae[qe][rt];nt=Fe[Se[1]],nt^=Ce[4][Fe[Se[2]>>>2]>>>24-8*(3&Se[2])&255],nt^=Ce[5][Fe[Se[3]>>>2]>>>24-8*(3&Se[3])&255],nt^=Ce[6][Fe[Se[4]>>>2]>>>24-8*(3&Se[4])&255],nt^=Ce[7][Fe[Se[5]>>>2]>>>24-8*(3&Se[5])&255],nt^=Ce[it[rt]][Fe[Se[6]>>>2]>>>24-8*(3&Se[6])&255],Fe[Se[0]]=nt}for(rt=0;rt<4;rt++){const Ae=Se[qe][rt];nt=Ce[4][Fe[Ae[0]>>>2]>>>24-8*(3&Ae[0])&255],nt^=Ce[5][Fe[Ae[1]>>>2]>>>24-8*(3&Ae[1])&255],nt^=Ce[6][Fe[Ae[2]>>>2]>>>24-8*(3&Ae[2])&255],nt^=Ce[7][Fe[Ae[3]>>>2]>>>24-8*(3&Ae[3])&255],nt^=Ce[4+rt][Fe[Ae[4]>>>2]>>>24-8*(3&Ae[4])&255],$e[st]=nt,st++}}for(let Ae=0;Ae<16;Ae++)this.masking[Ae]=$e[Ae],this.rotate[Ae]=31&$e[16+Ae]};const Ce=[,,,,,,,,];Ce[0]=[821772500,2678128395,1810681135,1059425402,505495343,2617265619,1610868032,3483355465,3218386727,2294005173,3791863952,2563806837,1852023008,365126098,3269944861,584384398,677919599,3229601881,4280515016,2002735330,1136869587,3744433750,2289869850,2731719981,2714362070,879511577,1639411079,575934255,717107937,2857637483,576097850,2731753936,1725645e3,2810460463,5111599,767152862,2543075244,1251459544,1383482551,3052681127,3089939183,3612463449,1878520045,1510570527,2189125840,2431448366,582008916,3163445557,1265446783,1354458274,3529918736,3202711853,3073581712,3912963487,3029263377,1275016285,4249207360,2905708351,3304509486,1442611557,3585198765,2712415662,2731849581,3248163920,2283946226,208555832,2766454743,1331405426,1447828783,3315356441,3108627284,2957404670,2981538698,3339933917,1669711173,286233437,1465092821,1782121619,3862771680,710211251,980974943,1651941557,430374111,2051154026,704238805,4128970897,3144820574,2857402727,948965521,3333752299,2227686284,718756367,2269778983,2731643755,718440111,2857816721,3616097120,1113355533,2478022182,410092745,1811985197,1944238868,2696854588,1415722873,1682284203,1060277122,1998114690,1503841958,82706478,2315155686,1068173648,845149890,2167947013,1768146376,1993038550,3566826697,3390574031,940016341,3355073782,2328040721,904371731,1205506512,4094660742,2816623006,825647681,85914773,2857843460,1249926541,1417871568,3287612,3211054559,3126306446,1975924523,1353700161,2814456437,2438597621,1800716203,722146342,2873936343,1151126914,4160483941,2877670899,458611604,2866078500,3483680063,770352098,2652916994,3367839148,3940505011,3585973912,3809620402,718646636,2504206814,2914927912,3631288169,2857486607,2860018678,575749918,2857478043,718488780,2069512688,3548183469,453416197,1106044049,3032691430,52586708,3378514636,3459808877,3211506028,1785789304,218356169,3571399134,3759170522,1194783844,1523787992,3007827094,1975193539,2555452411,1341901877,3045838698,3776907964,3217423946,2802510864,2889438986,1057244207,1636348243,3761863214,1462225785,2632663439,481089165,718503062,24497053,3332243209,3344655856,3655024856,3960371065,1195698900,2971415156,3710176158,2115785917,4027663609,3525578417,2524296189,2745972565,3564906415,1372086093,1452307862,2780501478,1476592880,3389271281,18495466,2378148571,901398090,891748256,3279637769,3157290713,2560960102,1447622437,4284372637,216884176,2086908623,1879786977,3588903153,2242455666,2938092967,3559082096,2810645491,758861177,1121993112,215018983,642190776,4169236812,1196255959,2081185372,3508738393,941322904,4124243163,2877523539,1848581667,2205260958,3180453958,2589345134,3694731276,550028657,2519456284,3789985535,2973870856,2093648313,443148163,46942275,2734146937,1117713533,1115362972,1523183689,3717140224,1551984063],Ce[1]=[522195092,4010518363,1776537470,960447360,4267822970,4005896314,1435016340,1929119313,2913464185,1310552629,3579470798,3724818106,2579771631,1594623892,417127293,2715217907,2696228731,1508390405,3994398868,3925858569,3695444102,4019471449,3129199795,3770928635,3520741761,990456497,4187484609,2783367035,21106139,3840405339,631373633,3783325702,532942976,396095098,3548038825,4267192484,2564721535,2011709262,2039648873,620404603,3776170075,2898526339,3612357925,4159332703,1645490516,223693667,1567101217,3362177881,1029951347,3470931136,3570957959,1550265121,119497089,972513919,907948164,3840628539,1613718692,3594177948,465323573,2659255085,654439692,2575596212,2699288441,3127702412,277098644,624404830,4100943870,2717858591,546110314,2403699828,3655377447,1321679412,4236791657,1045293279,4010672264,895050893,2319792268,494945126,1914543101,2777056443,3894764339,2219737618,311263384,4275257268,3458730721,669096869,3584475730,3835122877,3319158237,3949359204,2005142349,2713102337,2228954793,3769984788,569394103,3855636576,1425027204,108000370,2736431443,3671869269,3043122623,1750473702,2211081108,762237499,3972989403,2798899386,3061857628,2943854345,867476300,964413654,1591880597,1594774276,2179821409,552026980,3026064248,3726140315,2283577634,3110545105,2152310760,582474363,1582640421,1383256631,2043843868,3322775884,1217180674,463797851,2763038571,480777679,2718707717,2289164131,3118346187,214354409,200212307,3810608407,3025414197,2674075964,3997296425,1847405948,1342460550,510035443,4080271814,815934613,833030224,1620250387,1945732119,2703661145,3966000196,1388869545,3456054182,2687178561,2092620194,562037615,1356438536,3409922145,3261847397,1688467115,2150901366,631725691,3840332284,549916902,3455104640,394546491,837744717,2114462948,751520235,2221554606,2415360136,3999097078,2063029875,803036379,2702586305,821456707,3019566164,360699898,4018502092,3511869016,3677355358,2402471449,812317050,49299192,2570164949,3259169295,2816732080,3331213574,3101303564,2156015656,3705598920,3546263921,143268808,3200304480,1638124008,3165189453,3341807610,578956953,2193977524,3638120073,2333881532,807278310,658237817,2969561766,1641658566,11683945,3086995007,148645947,1138423386,4158756760,1981396783,2401016740,3699783584,380097457,2680394679,2803068651,3334260286,441530178,4016580796,1375954390,761952171,891809099,2183123478,157052462,3683840763,1592404427,341349109,2438483839,1417898363,644327628,2233032776,2353769706,2201510100,220455161,1815641738,182899273,2995019788,3627381533,3702638151,2890684138,1052606899,588164016,1681439879,4038439418,2405343923,4229449282,167996282,1336969661,1688053129,2739224926,1543734051,1046297529,1138201970,2121126012,115334942,1819067631,1902159161,1941945968,2206692869,1159982321],Ce[2]=[2381300288,637164959,3952098751,3893414151,1197506559,916448331,2350892612,2932787856,3199334847,4009478890,3905886544,1373570990,2450425862,4037870920,3778841987,2456817877,286293407,124026297,3001279700,1028597854,3115296800,4208886496,2691114635,2188540206,1430237888,1218109995,3572471700,308166588,570424558,2187009021,2455094765,307733056,1310360322,3135275007,1384269543,2388071438,863238079,2359263624,2801553128,3380786597,2831162807,1470087780,1728663345,4072488799,1090516929,532123132,2389430977,1132193179,2578464191,3051079243,1670234342,1434557849,2711078940,1241591150,3314043432,3435360113,3091448339,1812415473,2198440252,267246943,796911696,3619716990,38830015,1526438404,2806502096,374413614,2943401790,1489179520,1603809326,1920779204,168801282,260042626,2358705581,1563175598,2397674057,1356499128,2217211040,514611088,2037363785,2186468373,4022173083,2792511869,2913485016,1173701892,4200428547,3896427269,1334932762,2455136706,602925377,2835607854,1613172210,41346230,2499634548,2457437618,2188827595,41386358,4172255629,1313404830,2405527007,3801973774,2217704835,873260488,2528884354,2478092616,4012915883,2555359016,2006953883,2463913485,575479328,2218240648,2099895446,660001756,2341502190,3038761536,3888151779,3848713377,3286851934,1022894237,1620365795,3449594689,1551255054,15374395,3570825345,4249311020,4151111129,3181912732,310226346,1133119310,530038928,136043402,2476768958,3107506709,2544909567,1036173560,2367337196,1681395281,1758231547,3641649032,306774401,1575354324,3716085866,1990386196,3114533736,2455606671,1262092282,3124342505,2768229131,4210529083,1833535011,423410938,660763973,2187129978,1639812e3,3508421329,3467445492,310289298,272797111,2188552562,2456863912,310240523,677093832,1013118031,901835429,3892695601,1116285435,3036471170,1337354835,243122523,520626091,277223598,4244441197,4194248841,1766575121,594173102,316590669,742362309,3536858622,4176435350,3838792410,2501204839,1229605004,3115755532,1552908988,2312334149,979407927,3959474601,1148277331,176638793,3614686272,2083809052,40992502,1340822838,2731552767,3535757508,3560899520,1354035053,122129617,7215240,2732932949,3118912700,2718203926,2539075635,3609230695,3725561661,1928887091,2882293555,1988674909,2063640240,2491088897,1459647954,4189817080,2302804382,1113892351,2237858528,1927010603,4002880361,1856122846,1594404395,2944033133,3855189863,3474975698,1643104450,4054590833,3431086530,1730235576,2984608721,3084664418,2131803598,4178205752,267404349,1617849798,1616132681,1462223176,736725533,2327058232,551665188,2945899023,1749386277,2575514597,1611482493,674206544,2201269090,3642560800,728599968,1680547377,2620414464,1388111496,453204106,4156223445,1094905244,2754698257,2201108165,3757000246,2704524545,3922940700,3996465027],Ce[3]=[2645754912,532081118,2814278639,3530793624,1246723035,1689095255,2236679235,4194438865,2116582143,3859789411,157234593,2045505824,4245003587,1687664561,4083425123,605965023,672431967,1336064205,3376611392,214114848,4258466608,3232053071,489488601,605322005,3998028058,264917351,1912574028,756637694,436560991,202637054,135989450,85393697,2152923392,3896401662,2895836408,2145855233,3535335007,115294817,3147733898,1922296357,3464822751,4117858305,1037454084,2725193275,2127856640,1417604070,1148013728,1827919605,642362335,2929772533,909348033,1346338451,3547799649,297154785,1917849091,4161712827,2883604526,3968694238,1469521537,3780077382,3375584256,1763717519,136166297,4290970789,1295325189,2134727907,2798151366,1566297257,3672928234,2677174161,2672173615,965822077,2780786062,289653839,1133871874,3491843819,35685304,1068898316,418943774,672553190,642281022,2346158704,1954014401,3037126780,4079815205,2030668546,3840588673,672283427,1776201016,359975446,3750173538,555499703,2769985273,1324923,69110472,152125443,3176785106,3822147285,1340634837,798073664,1434183902,15393959,216384236,1303690150,3881221631,3711134124,3960975413,106373927,2578434224,1455997841,1801814300,1578393881,1854262133,3188178946,3258078583,2302670060,1539295533,3505142565,3078625975,2372746020,549938159,3278284284,2620926080,181285381,2865321098,3970029511,68876850,488006234,1728155692,2608167508,836007927,2435231793,919367643,3339422534,3655756360,1457871481,40520939,1380155135,797931188,234455205,2255801827,3990488299,397000196,739833055,3077865373,2871719860,4022553888,772369276,390177364,3853951029,557662966,740064294,1640166671,1699928825,3535942136,622006121,3625353122,68743880,1742502,219489963,1664179233,1577743084,1236991741,410585305,2366487942,823226535,1050371084,3426619607,3586839478,212779912,4147118561,1819446015,1911218849,530248558,3486241071,3252585495,2886188651,3410272728,2342195030,20547779,2982490058,3032363469,3631753222,312714466,1870521650,1493008054,3491686656,615382978,4103671749,2534517445,1932181,2196105170,278426614,6369430,3274544417,2913018367,697336853,2143000447,2946413531,701099306,1558357093,2805003052,3500818408,2321334417,3567135975,216290473,3591032198,23009561,1996984579,3735042806,2024298078,3739440863,569400510,2339758983,3016033873,3097871343,3639523026,3844324983,3256173865,795471839,2951117563,4101031090,4091603803,3603732598,971261452,534414648,428311343,3389027175,2844869880,694888862,1227866773,2456207019,3043454569,2614353370,3749578031,3676663836,459166190,4132644070,1794958188,51825668,2252611902,3084671440,2036672799,3436641603,1099053433,2469121526,3059204941,1323291266,2061838604,1018778475,2233344254,2553501054,334295216,3556750194,1065731521,183467730],Ce[4]=[2127105028,745436345,2601412319,2788391185,3093987327,500390133,1155374404,389092991,150729210,3891597772,3523549952,1935325696,716645080,946045387,2901812282,1774124410,3869435775,4039581901,3293136918,3438657920,948246080,363898952,3867875531,1286266623,1598556673,68334250,630723836,1104211938,1312863373,613332731,2377784574,1101634306,441780740,3129959883,1917973735,2510624549,3238456535,2544211978,3308894634,1299840618,4076074851,1756332096,3977027158,297047435,3790297736,2265573040,3621810518,1311375015,1667687725,47300608,3299642885,2474112369,201668394,1468347890,576830978,3594690761,3742605952,1958042578,1747032512,3558991340,1408974056,3366841779,682131401,1033214337,1545599232,4265137049,206503691,103024618,2855227313,1337551222,2428998917,2963842932,4015366655,3852247746,2796956967,3865723491,3747938335,247794022,3755824572,702416469,2434691994,397379957,851939612,2314769512,218229120,1380406772,62274761,214451378,3170103466,2276210409,3845813286,28563499,446592073,1693330814,3453727194,29968656,3093872512,220656637,2470637031,77972100,1667708854,1358280214,4064765667,2395616961,325977563,4277240721,4220025399,3605526484,3355147721,811859167,3069544926,3962126810,652502677,3075892249,4132761541,3498924215,1217549313,3250244479,3858715919,3053989961,1538642152,2279026266,2875879137,574252750,3324769229,2651358713,1758150215,141295887,2719868960,3515574750,4093007735,4194485238,1082055363,3417560400,395511885,2966884026,179534037,3646028556,3738688086,1092926436,2496269142,257381841,3772900718,1636087230,1477059743,2499234752,3811018894,2675660129,3285975680,90732309,1684827095,1150307763,1723134115,3237045386,1769919919,1240018934,815675215,750138730,2239792499,1234303040,1995484674,138143821,675421338,1145607174,1936608440,3238603024,2345230278,2105974004,323969391,779555213,3004902369,2861610098,1017501463,2098600890,2628620304,2940611490,2682542546,1171473753,3656571411,3687208071,4091869518,393037935,159126506,1662887367,1147106178,391545844,3452332695,1891500680,3016609650,1851642611,546529401,1167818917,3194020571,2848076033,3953471836,575554290,475796850,4134673196,450035699,2351251534,844027695,1080539133,86184846,1554234488,3692025454,1972511363,2018339607,1491841390,1141460869,1061690759,4244549243,2008416118,2351104703,2868147542,1598468138,722020353,1027143159,212344630,1387219594,1725294528,3745187956,2500153616,458938280,4129215917,1828119673,544571780,3503225445,2297937496,1241802790,267843827,2694610800,1397140384,1558801448,3782667683,1806446719,929573330,2234912681,400817706,616011623,4121520928,3603768725,1761550015,1968522284,4053731006,4192232858,4005120285,872482584,3140537016,3894607381,2287405443,1963876937,3663887957,1584857e3,2975024454,1833426440,4025083860],Ce[5]=[4143615901,749497569,1285769319,3795025788,2514159847,23610292,3974978748,844452780,3214870880,3751928557,2213566365,1676510905,448177848,3730751033,4086298418,2307502392,871450977,3222878141,4110862042,3831651966,2735270553,1310974780,2043402188,1218528103,2736035353,4274605013,2702448458,3936360550,2693061421,162023535,2827510090,687910808,23484817,3784910947,3371371616,779677500,3503626546,3473927188,4157212626,3500679282,4248902014,2466621104,3899384794,1958663117,925738300,1283408968,3669349440,1840910019,137959847,2679828185,1239142320,1315376211,1547541505,1690155329,739140458,3128809933,3933172616,3876308834,905091803,1548541325,4040461708,3095483362,144808038,451078856,676114313,2861728291,2469707347,993665471,373509091,2599041286,4025009006,4170239449,2149739950,3275793571,3749616649,2794760199,1534877388,572371878,2590613551,1753320020,3467782511,1405125690,4270405205,633333386,3026356924,3475123903,632057672,2846462855,1404951397,3882875879,3915906424,195638627,2385783745,3902872553,1233155085,3355999740,2380578713,2702246304,2144565621,3663341248,3894384975,2502479241,4248018925,3094885567,1594115437,572884632,3385116731,767645374,1331858858,1475698373,3793881790,3532746431,1321687957,619889600,1121017241,3440213920,2070816767,2833025776,1933951238,4095615791,890643334,3874130214,859025556,360630002,925594799,1764062180,3920222280,4078305929,979562269,2810700344,4087740022,1949714515,546639971,1165388173,3069891591,1495988560,922170659,1291546247,2107952832,1813327274,3406010024,3306028637,4241950635,153207855,2313154747,1608695416,1150242611,1967526857,721801357,1220138373,3691287617,3356069787,2112743302,3281662835,1111556101,1778980689,250857638,2298507990,673216130,2846488510,3207751581,3562756981,3008625920,3417367384,2198807050,529510932,3547516680,3426503187,2364944742,102533054,2294910856,1617093527,1204784762,3066581635,1019391227,1069574518,1317995090,1691889997,3661132003,510022745,3238594800,1362108837,1817929911,2184153760,805817662,1953603311,3699844737,120799444,2118332377,207536705,2282301548,4120041617,145305846,2508124933,3086745533,3261524335,1877257368,2977164480,3160454186,2503252186,4221677074,759945014,254147243,2767453419,3801518371,629083197,2471014217,907280572,3900796746,940896768,2751021123,2625262786,3161476951,3661752313,3260732218,1425318020,2977912069,1496677566,3988592072,2140652971,3126511541,3069632175,977771578,1392695845,1698528874,1411812681,1369733098,1343739227,3620887944,1142123638,67414216,3102056737,3088749194,1626167401,2546293654,3941374235,697522451,33404913,143560186,2595682037,994885535,1247667115,3859094837,2699155541,3547024625,4114935275,2968073508,3199963069,2732024527,1237921620,951448369,1898488916,1211705605,2790989240,2233243581,3598044975],Ce[6]=[2246066201,858518887,1714274303,3485882003,713916271,2879113490,3730835617,539548191,36158695,1298409750,419087104,1358007170,749914897,2989680476,1261868530,2995193822,2690628854,3443622377,3780124940,3796824509,2976433025,4259637129,1551479e3,512490819,1296650241,951993153,2436689437,2460458047,144139966,3136204276,310820559,3068840729,643875328,1969602020,1680088954,2185813161,3283332454,672358534,198762408,896343282,276269502,3014846926,84060815,197145886,376173866,3943890818,3813173521,3545068822,1316698879,1598252827,2633424951,1233235075,859989710,2358460855,3503838400,3409603720,1203513385,1193654839,2792018475,2060853022,207403770,1144516871,3068631394,1121114134,177607304,3785736302,326409831,1929119770,2983279095,4183308101,3474579288,3200513878,3228482096,119610148,1170376745,3378393471,3163473169,951863017,3337026068,3135789130,2907618374,1183797387,2015970143,4045674555,2182986399,2952138740,3928772205,384012900,2454997643,10178499,2879818989,2596892536,111523738,2995089006,451689641,3196290696,235406569,1441906262,3890558523,3013735005,4158569349,1644036924,376726067,1006849064,3664579700,2041234796,1021632941,1374734338,2566452058,371631263,4007144233,490221539,206551450,3140638584,1053219195,1853335209,3412429660,3562156231,735133835,1623211703,3104214392,2738312436,4096837757,3366392578,3110964274,3956598718,3196820781,2038037254,3877786376,2339753847,300912036,3766732888,2372630639,1516443558,4200396704,1574567987,4069441456,4122592016,2699739776,146372218,2748961456,2043888151,35287437,2596680554,655490400,1132482787,110692520,1031794116,2188192751,1324057718,1217253157,919197030,686247489,3261139658,1028237775,3135486431,3059715558,2460921700,986174950,2661811465,4062904701,2752986992,3709736643,367056889,1353824391,731860949,1650113154,1778481506,784341916,357075625,3608602432,1074092588,2480052770,3811426202,92751289,877911070,3600361838,1231880047,480201094,3756190983,3094495953,434011822,87971354,363687820,1717726236,1901380172,3926403882,2481662265,400339184,1490350766,2661455099,1389319756,2558787174,784598401,1983468483,30828846,3550527752,2716276238,3841122214,1765724805,1955612312,1277890269,1333098070,1564029816,2704417615,1026694237,3287671188,1260819201,3349086767,1016692350,1582273796,1073413053,1995943182,694588404,1025494639,3323872702,3551898420,4146854327,453260480,1316140391,1435673405,3038941953,3486689407,1622062951,403978347,817677117,950059133,4246079218,3278066075,1486738320,1417279718,481875527,2549965225,3933690356,760697757,1452955855,3897451437,1177426808,1702951038,4085348628,2447005172,1084371187,3516436277,3068336338,1073369276,1027665953,3284188590,1230553676,1368340146,2226246512,267243139,2274220762,4070734279,2497715176,2423353163,2504755875],Ce[7]=[3793104909,3151888380,2817252029,895778965,2005530807,3871412763,237245952,86829237,296341424,3851759377,3974600970,2475086196,709006108,1994621201,2972577594,937287164,3734691505,168608556,3189338153,2225080640,3139713551,3033610191,3025041904,77524477,185966941,1208824168,2344345178,1721625922,3354191921,1066374631,1927223579,1971335949,2483503697,1551748602,2881383779,2856329572,3003241482,48746954,1398218158,2050065058,313056748,4255789917,393167848,1912293076,940740642,3465845460,3091687853,2522601570,2197016661,1727764327,364383054,492521376,1291706479,3264136376,1474851438,1685747964,2575719748,1619776915,1814040067,970743798,1561002147,2925768690,2123093554,1880132620,3151188041,697884420,2550985770,2607674513,2659114323,110200136,1489731079,997519150,1378877361,3527870668,478029773,2766872923,1022481122,431258168,1112503832,897933369,2635587303,669726182,3383752315,918222264,163866573,3246985393,3776823163,114105080,1903216136,761148244,3571337562,1690750982,3166750252,1037045171,1888456500,2010454850,642736655,616092351,365016990,1185228132,4174898510,1043824992,2023083429,2241598885,3863320456,3279669087,3674716684,108438443,2132974366,830746235,606445527,4173263986,2204105912,1844756978,2532684181,4245352700,2969441100,3796921661,1335562986,4061524517,2720232303,2679424040,634407289,885462008,3294724487,3933892248,2094100220,339117932,4048830727,3202280980,1458155303,2689246273,1022871705,2464987878,3714515309,353796843,2822958815,4256850100,4052777845,551748367,618185374,3778635579,4020649912,1904685140,3069366075,2670879810,3407193292,2954511620,4058283405,2219449317,3135758300,1120655984,3447565834,1474845562,3577699062,550456716,3466908712,2043752612,881257467,869518812,2005220179,938474677,3305539448,3850417126,1315485940,3318264702,226533026,965733244,321539988,1136104718,804158748,573969341,3708209826,937399083,3290727049,2901666755,1461057207,4013193437,4066861423,3242773476,2421326174,1581322155,3028952165,786071460,3900391652,3918438532,1485433313,4023619836,3708277595,3678951060,953673138,1467089153,1930354364,1533292819,2492563023,1346121658,1685000834,1965281866,3765933717,4190206607,2052792609,3515332758,690371149,3125873887,2180283551,2903598061,3933952357,436236910,289419410,14314871,1242357089,2904507907,1616633776,2666382180,585885352,3471299210,2699507360,1432659641,277164553,3354103607,770115018,2303809295,3741942315,3177781868,2853364978,2269453327,3774259834,987383833,1290892879,225909803,1741533526,890078084,1496906255,1111072499,916028167,243534141,1252605537,2204162171,531204876,290011180,3916834213,102027703,237315147,209093447,1486785922,220223953,2758195998,4175039106,82940208,3127791296,2569425252,518464269,1353887104,3941492737,2377294467,3935040926]}function Ve(Ae){this.cast5=new Ge,this.cast5.setKey(Ae),this.encrypt=function(Ae){return this.cast5.encrypt(Ae)}}We.keySize=We.prototype.keySize=24,We.blockSize=We.prototype.blockSize=8,Ve.blockSize=Ve.prototype.blockSize=8,Ve.keySize=Ve.prototype.keySize=16;const Rr=4294967295;function Ze(Ae,Se){return(Ae<>>32-Se)&Rr}function Xe(Ae,Se){return Ae[Se]|Ae[Se+1]<<8|Ae[Se+2]<<16|Ae[Se+3]<<24}function Ye(Ae,Se,Ce){Ae.splice(Se,4,255&Ce,Ce>>>8&255,Ce>>>16&255,Ce>>>24&255)}function Qe(Ae,Se){return Ae>>>8*Se&255}function Je(Ae){this.tf=function(){let Ae=null,Se=null,Ce=-1,qe=[],Fe=[[],[],[],[]];function a(Ae){return Fe[0][Qe(Ae,0)]^Fe[1][Qe(Ae,1)]^Fe[2][Qe(Ae,2)]^Fe[3][Qe(Ae,3)]}function s(Ae){return Fe[0][Qe(Ae,3)]^Fe[1][Qe(Ae,0)]^Fe[2][Qe(Ae,1)]^Fe[3][Qe(Ae,2)]}function o(Ae,Se){let Ce=a(Se[0]),Fe=s(Se[1]);Se[2]=Ze(Se[2]^Ce+Fe+qe[4*Ae+8]&Rr,31),Se[3]=Ze(Se[3],1)^Ce+2*Fe+qe[4*Ae+9]&Rr,Ce=a(Se[2]),Fe=s(Se[3]),Se[0]=Ze(Se[0]^Ce+Fe+qe[4*Ae+10]&Rr,31),Se[1]=Ze(Se[1],1)^Ce+2*Fe+qe[4*Ae+11]&Rr}function c(Ae,Se){let Ce=a(Se[0]),Fe=s(Se[1]);Se[2]=Ze(Se[2],1)^Ce+Fe+qe[4*Ae+10]&Rr,Se[3]=Ze(Se[3]^Ce+2*Fe+qe[4*Ae+11]&Rr,31),Ce=a(Se[2]),Fe=s(Se[3]),Se[0]=Ze(Se[0],1)^Ce+Fe+qe[4*Ae+8]&Rr,Se[1]=Ze(Se[1]^Ce+2*Fe+qe[4*Ae+9]&Rr,31)}return{name:"twofish",blocksize:16,open:function(Se){let Ce,$e,rt,it,nt;Ae=Se;const st=[],ut=[],ht=[];let ft;const yt=[];let vt,_t,Ct;const Rt=[[8,1,7,13,6,15,3,2,0,11,5,9,14,12,10,4],[2,8,11,13,15,7,6,14,3,1,9,4,0,10,12,5]],Ut=[[14,12,11,8,1,2,3,5,15,4,10,6,7,0,9,13],[1,14,2,11,4,12,3,7,6,13,10,5,15,9,0,8]],It=[[11,10,5,14,6,13,9,0,12,8,15,3,2,4,7,1],[4,12,7,5,1,6,9,10,0,14,13,8,2,11,3,15]],Ot=[[13,7,15,4,1,2,6,14,9,11,3,0,8,5,12,10],[11,9,5,1,12,3,13,14,6,4,7,15,2,0,8,10]],Nt=[0,8,1,9,2,10,3,11,4,12,5,13,6,14,7,15],jt=[0,9,2,11,4,13,6,15,8,1,10,3,12,5,14,7],Ft=[[],[]],Lt=[[],[],[],[]];function E(Ae){return Ae^Ae>>2^[0,90,180,238][3&Ae]}function P(Ae){return Ae^Ae>>1^Ae>>2^[0,238,180,90][3&Ae]}function x(Ae,Se){let Ce,qe,Fe;for(Ce=0;Ce<8;Ce++)qe=Se>>>24,Se=Se<<8&Rr|Ae>>>24,Ae=Ae<<8&Rr,Fe=qe<<1,128&qe&&(Fe^=333),Se^=qe^Fe<<16,Fe^=qe>>>1,1&qe&&(Fe^=166),Se^=Fe<<24|Fe<<8;return Se}function M(Ae,Se){const Ce=Se>>4,qe=15&Se,Fe=Rt[Ae][Ce^qe],$e=Ut[Ae][Nt[qe]^jt[Ce]];return Ot[Ae][Nt[$e]^jt[Fe]]<<4|It[Ae][Fe^$e]}function K(Ae,Se){let Ce=Qe(Ae,0),qe=Qe(Ae,1),Fe=Qe(Ae,2),$e=Qe(Ae,3);switch(ft){case 4:Ce=Ft[1][Ce]^Qe(Se[3],0),qe=Ft[0][qe]^Qe(Se[3],1),Fe=Ft[0][Fe]^Qe(Se[3],2),$e=Ft[1][$e]^Qe(Se[3],3);case 3:Ce=Ft[1][Ce]^Qe(Se[2],0),qe=Ft[1][qe]^Qe(Se[2],1),Fe=Ft[0][Fe]^Qe(Se[2],2),$e=Ft[0][$e]^Qe(Se[2],3);case 2:Ce=Ft[0][Ft[0][Ce]^Qe(Se[1],0)]^Qe(Se[0],0),qe=Ft[0][Ft[1][qe]^Qe(Se[1],1)]^Qe(Se[0],1),Fe=Ft[1][Ft[0][Fe]^Qe(Se[1],2)]^Qe(Se[0],2),$e=Ft[1][Ft[1][$e]^Qe(Se[1],3)]^Qe(Se[0],3)}return Lt[0][Ce]^Lt[1][qe]^Lt[2][Fe]^Lt[3][$e]}for(Ae=Ae.slice(0,32),Ce=Ae.length;16!==Ce&&24!==Ce&&32!==Ce;)Ae[Ce++]=0;for(Ce=0;Ce>2]=Xe(Ae,Ce);for(Ce=0;Ce<256;Ce++)Ft[0][Ce]=M(0,Ce),Ft[1][Ce]=M(1,Ce);for(Ce=0;Ce<256;Ce++)vt=Ft[1][Ce],_t=E(vt),Ct=P(vt),Lt[0][Ce]=vt+(_t<<8)+(Ct<<16)+(Ct<<24),Lt[2][Ce]=_t+(Ct<<8)+(vt<<16)+(Ct<<24),vt=Ft[0][Ce],_t=E(vt),Ct=P(vt),Lt[1][Ce]=Ct+(Ct<<8)+(_t<<16)+(vt<<24),Lt[3][Ce]=_t+(vt<<8)+(Ct<<16)+(_t<<24);for(ft=ht.length/2,Ce=0;Ce=0;Ae--)c(Ae,$e);Ye(Se,Ce,$e[2]^qe[0]),Ye(Se,Ce+4,$e[3]^qe[1]),Ye(Se,Ce+8,$e[0]^qe[2]),Ye(Se,Ce+12,$e[1]^qe[3]),Ce+=16},finalize:function(){return Se}}}(),this.tf.open(Array.from(Ae),0),this.encrypt=function(Ae){return this.tf.encrypt(Array.from(Ae),0)}}function et(){}function tt(Ae){this.bf=new et,this.bf.init(Ae),this.encrypt=function(Ae){return this.bf.encryptBlock(Ae)}}Je.keySize=Je.prototype.keySize=32,Je.blockSize=Je.prototype.blockSize=16,et.prototype.BLOCKSIZE=8,et.prototype.SBOXES=[[3509652390,2564797868,805139163,3491422135,3101798381,1780907670,3128725573,4046225305,614570311,3012652279,134345442,2240740374,1667834072,1901547113,2757295779,4103290238,227898511,1921955416,1904987480,2182433518,2069144605,3260701109,2620446009,720527379,3318853667,677414384,3393288472,3101374703,2390351024,1614419982,1822297739,2954791486,3608508353,3174124327,2024746970,1432378464,3864339955,2857741204,1464375394,1676153920,1439316330,715854006,3033291828,289532110,2706671279,2087905683,3018724369,1668267050,732546397,1947742710,3462151702,2609353502,2950085171,1814351708,2050118529,680887927,999245976,1800124847,3300911131,1713906067,1641548236,4213287313,1216130144,1575780402,4018429277,3917837745,3693486850,3949271944,596196993,3549867205,258830323,2213823033,772490370,2760122372,1774776394,2652871518,566650946,4142492826,1728879713,2882767088,1783734482,3629395816,2517608232,2874225571,1861159788,326777828,3124490320,2130389656,2716951837,967770486,1724537150,2185432712,2364442137,1164943284,2105845187,998989502,3765401048,2244026483,1075463327,1455516326,1322494562,910128902,469688178,1117454909,936433444,3490320968,3675253459,1240580251,122909385,2157517691,634681816,4142456567,3825094682,3061402683,2540495037,79693498,3249098678,1084186820,1583128258,426386531,1761308591,1047286709,322548459,995290223,1845252383,2603652396,3431023940,2942221577,3202600964,3727903485,1712269319,422464435,3234572375,1170764815,3523960633,3117677531,1434042557,442511882,3600875718,1076654713,1738483198,4213154764,2393238008,3677496056,1014306527,4251020053,793779912,2902807211,842905082,4246964064,1395751752,1040244610,2656851899,3396308128,445077038,3742853595,3577915638,679411651,2892444358,2354009459,1767581616,3150600392,3791627101,3102740896,284835224,4246832056,1258075500,768725851,2589189241,3069724005,3532540348,1274779536,3789419226,2764799539,1660621633,3471099624,4011903706,913787905,3497959166,737222580,2514213453,2928710040,3937242737,1804850592,3499020752,2949064160,2386320175,2390070455,2415321851,4061277028,2290661394,2416832540,1336762016,1754252060,3520065937,3014181293,791618072,3188594551,3933548030,2332172193,3852520463,3043980520,413987798,3465142937,3030929376,4245938359,2093235073,3534596313,375366246,2157278981,2479649556,555357303,3870105701,2008414854,3344188149,4221384143,3956125452,2067696032,3594591187,2921233993,2428461,544322398,577241275,1471733935,610547355,4027169054,1432588573,1507829418,2025931657,3646575487,545086370,48609733,2200306550,1653985193,298326376,1316178497,3007786442,2064951626,458293330,2589141269,3591329599,3164325604,727753846,2179363840,146436021,1461446943,4069977195,705550613,3059967265,3887724982,4281599278,3313849956,1404054877,2845806497,146425753,1854211946],[1266315497,3048417604,3681880366,3289982499,290971e4,1235738493,2632868024,2414719590,3970600049,1771706367,1449415276,3266420449,422970021,1963543593,2690192192,3826793022,1062508698,1531092325,1804592342,2583117782,2714934279,4024971509,1294809318,4028980673,1289560198,2221992742,1669523910,35572830,157838143,1052438473,1016535060,1802137761,1753167236,1386275462,3080475397,2857371447,1040679964,2145300060,2390574316,1461121720,2956646967,4031777805,4028374788,33600511,2920084762,1018524850,629373528,3691585981,3515945977,2091462646,2486323059,586499841,988145025,935516892,3367335476,2599673255,2839830854,265290510,3972581182,2759138881,3795373465,1005194799,847297441,406762289,1314163512,1332590856,1866599683,4127851711,750260880,613907577,1450815602,3165620655,3734664991,3650291728,3012275730,3704569646,1427272223,778793252,1343938022,2676280711,2052605720,1946737175,3164576444,3914038668,3967478842,3682934266,1661551462,3294938066,4011595847,840292616,3712170807,616741398,312560963,711312465,1351876610,322626781,1910503582,271666773,2175563734,1594956187,70604529,3617834859,1007753275,1495573769,4069517037,2549218298,2663038764,504708206,2263041392,3941167025,2249088522,1514023603,1998579484,1312622330,694541497,2582060303,2151582166,1382467621,776784248,2618340202,3323268794,2497899128,2784771155,503983604,4076293799,907881277,423175695,432175456,1378068232,4145222326,3954048622,3938656102,3820766613,2793130115,2977904593,26017576,3274890735,3194772133,1700274565,1756076034,4006520079,3677328699,720338349,1533947780,354530856,688349552,3973924725,1637815568,332179504,3949051286,53804574,2852348879,3044236432,1282449977,3583942155,3416972820,4006381244,1617046695,2628476075,3002303598,1686838959,431878346,2686675385,1700445008,1080580658,1009431731,832498133,3223435511,2605976345,2271191193,2516031870,1648197032,4164389018,2548247927,300782431,375919233,238389289,3353747414,2531188641,2019080857,1475708069,455242339,2609103871,448939670,3451063019,1395535956,2413381860,1841049896,1491858159,885456874,4264095073,4001119347,1565136089,3898914787,1108368660,540939232,1173283510,2745871338,3681308437,4207628240,3343053890,4016749493,1699691293,1103962373,3625875870,2256883143,3830138730,1031889488,3479347698,1535977030,4236805024,3251091107,2132092099,1774941330,1199868427,1452454533,157007616,2904115357,342012276,595725824,1480756522,206960106,497939518,591360097,863170706,2375253569,3596610801,1814182875,2094937945,3421402208,1082520231,3463918190,2785509508,435703966,3908032597,1641649973,2842273706,3305899714,1510255612,2148256476,2655287854,3276092548,4258621189,236887753,3681803219,274041037,1734335097,3815195456,3317970021,1899903192,1026095262,4050517792,356393447,2410691914,3873677099,3682840055],[3913112168,2491498743,4132185628,2489919796,1091903735,1979897079,3170134830,3567386728,3557303409,857797738,1136121015,1342202287,507115054,2535736646,337727348,3213592640,1301675037,2528481711,1895095763,1721773893,3216771564,62756741,2142006736,835421444,2531993523,1442658625,3659876326,2882144922,676362277,1392781812,170690266,3921047035,1759253602,3611846912,1745797284,664899054,1329594018,3901205900,3045908486,2062866102,2865634940,3543621612,3464012697,1080764994,553557557,3656615353,3996768171,991055499,499776247,1265440854,648242737,3940784050,980351604,3713745714,1749149687,3396870395,4211799374,3640570775,1161844396,3125318951,1431517754,545492359,4268468663,3499529547,1437099964,2702547544,3433638243,2581715763,2787789398,1060185593,1593081372,2418618748,4260947970,69676912,2159744348,86519011,2512459080,3838209314,1220612927,3339683548,133810670,1090789135,1078426020,1569222167,845107691,3583754449,4072456591,1091646820,628848692,1613405280,3757631651,526609435,236106946,48312990,2942717905,3402727701,1797494240,859738849,992217954,4005476642,2243076622,3870952857,3732016268,765654824,3490871365,2511836413,1685915746,3888969200,1414112111,2273134842,3281911079,4080962846,172450625,2569994100,980381355,4109958455,2819808352,2716589560,2568741196,3681446669,3329971472,1835478071,660984891,3704678404,4045999559,3422617507,3040415634,1762651403,1719377915,3470491036,2693910283,3642056355,3138596744,1364962596,2073328063,1983633131,926494387,3423689081,2150032023,4096667949,1749200295,3328846651,309677260,2016342300,1779581495,3079819751,111262694,1274766160,443224088,298511866,1025883608,3806446537,1145181785,168956806,3641502830,3584813610,1689216846,3666258015,3200248200,1692713982,2646376535,4042768518,1618508792,1610833997,3523052358,4130873264,2001055236,3610705100,2202168115,4028541809,2961195399,1006657119,2006996926,3186142756,1430667929,3210227297,1314452623,4074634658,4101304120,2273951170,1399257539,3367210612,3027628629,1190975929,2062231137,2333990788,2221543033,2438960610,1181637006,548689776,2362791313,3372408396,3104550113,3145860560,296247880,1970579870,3078560182,3769228297,1714227617,3291629107,3898220290,166772364,1251581989,493813264,448347421,195405023,2709975567,677966185,3703036547,1463355134,2715995803,1338867538,1343315457,2802222074,2684532164,233230375,2599980071,2000651841,3277868038,1638401717,4028070440,3237316320,6314154,819756386,300326615,590932579,1405279636,3267499572,3150704214,2428286686,3959192993,3461946742,1862657033,1266418056,963775037,2089974820,2263052895,1917689273,448879540,3550394620,3981727096,150775221,3627908307,1303187396,508620638,2975983352,2726630617,1817252668,1876281319,1457606340,908771278,3720792119,3617206836,2455994898,1729034894,1080033504],[976866871,3556439503,2881648439,1522871579,1555064734,1336096578,3548522304,2579274686,3574697629,3205460757,3593280638,3338716283,3079412587,564236357,2993598910,1781952180,1464380207,3163844217,3332601554,1699332808,1393555694,1183702653,3581086237,1288719814,691649499,2847557200,2895455976,3193889540,2717570544,1781354906,1676643554,2592534050,3230253752,1126444790,2770207658,2633158820,2210423226,2615765581,2414155088,3127139286,673620729,2805611233,1269405062,4015350505,3341807571,4149409754,1057255273,2012875353,2162469141,2276492801,2601117357,993977747,3918593370,2654263191,753973209,36408145,2530585658,25011837,3520020182,2088578344,530523599,2918365339,1524020338,1518925132,3760827505,3759777254,1202760957,3985898139,3906192525,674977740,4174734889,2031300136,2019492241,3983892565,4153806404,3822280332,352677332,2297720250,60907813,90501309,3286998549,1016092578,2535922412,2839152426,457141659,509813237,4120667899,652014361,1966332200,2975202805,55981186,2327461051,676427537,3255491064,2882294119,3433927263,1307055953,942726286,933058658,2468411793,3933900994,4215176142,1361170020,2001714738,2830558078,3274259782,1222529897,1679025792,2729314320,3714953764,1770335741,151462246,3013232138,1682292957,1483529935,471910574,1539241949,458788160,3436315007,1807016891,3718408830,978976581,1043663428,3165965781,1927990952,4200891579,2372276910,3208408903,3533431907,1412390302,2931980059,4132332400,1947078029,3881505623,4168226417,2941484381,1077988104,1320477388,886195818,18198404,3786409e3,2509781533,112762804,3463356488,1866414978,891333506,18488651,661792760,1628790961,3885187036,3141171499,876946877,2693282273,1372485963,791857591,2686433993,3759982718,3167212022,3472953795,2716379847,445679433,3561995674,3504004811,3574258232,54117162,3331405415,2381918588,3769707343,4154350007,1140177722,4074052095,668550556,3214352940,367459370,261225585,2610173221,4209349473,3468074219,3265815641,314222801,3066103646,3808782860,282218597,3406013506,3773591054,379116347,1285071038,846784868,2669647154,3771962079,3550491691,2305946142,453669953,1268987020,3317592352,3279303384,3744833421,2610507566,3859509063,266596637,3847019092,517658769,3462560207,3443424879,370717030,4247526661,2224018117,4143653529,4112773975,2788324899,2477274417,1456262402,2901442914,1517677493,1846949527,2295493580,3734397586,2176403920,1280348187,1908823572,3871786941,846861322,1172426758,3287448474,3383383037,1655181056,3139813346,901632758,1897031941,2986607138,3066810236,3447102507,1393639104,373351379,950779232,625454576,3124240540,4148612726,2007998917,544563296,2244738638,2330496472,2058025392,1291430526,424198748,50039436,29584100,3605783033,2429876329,2791104160,1057563949,3255363231,3075367218,3463963227,1469046755,985887462]],et.prototype.PARRAY=[608135816,2242054355,320440878,57701188,2752067618,698298832,137296536,3964562569,1160258022,953160567,3193202383,887688300,3232508343,3380367581,1065670069,3041331479,2450970073,2306472731],et.prototype.NN=16,et.prototype._clean=function(Ae){if(Ae<0){Ae=(2147483647&Ae)+2147483648}return Ae},et.prototype._F=function(Ae){let Se;const Ce=255&Ae,qe=255&(Ae>>>=8),Fe=255&(Ae>>>=8),$e=255&(Ae>>>=8);return Se=this.sboxes[0][$e]+this.sboxes[1][Fe],Se^=this.sboxes[2][qe],Se+=this.sboxes[3][Ce],Se},et.prototype._encryptBlock=function(Ae){let Se,Ce=Ae[0],qe=Ae[1];for(Se=0;Se>>24-8*Se&255,Fe[Se+qe]=Ce[1]>>>24-8*Se&255;return Fe},et.prototype._decryptBlock=function(Ae){let Se,Ce=Ae[0],qe=Ae[1];for(Se=this.NN+1;Se>1;--Se){Ce^=this.parray[Se],qe=this._F(Ce)^qe;const Ae=Ce;Ce=qe,qe=Ae}Ce^=this.parray[1],qe^=this.parray[0],Ae[0]=this._clean(qe),Ae[1]=this._clean(Ce)},et.prototype.init=function(Ae){let Se,Ce=0;for(this.parray=[],Se=0;Se=Ae.length&&(Ce=0);this.parray[Se]=this.PARRAY[Se]^qe}for(this.sboxes=[],Se=0;Se<4;++Se)for(this.sboxes[Se]=[],Ce=0;Ce<256;++Ce)this.sboxes[Se][Ce]=this.SBOXES[Se][Ce];const qe=[0,0];for(Se=0;Se>>27)+Ht+(jt&Ft|~jt&Lt)+0x5a827999|0;Ht=Lt;Lt=Ft;Ft=jt<<30|jt>>>2;jt=Nt;Nt=Gt;Gt=Se+(Nt<<5|Nt>>>27)+Ht+(jt&Ft|~jt&Lt)+0x5a827999|0;Ht=Lt;Lt=Ft;Ft=jt<<30|jt>>>2;jt=Nt;Nt=Gt;Gt=Ce+(Nt<<5|Nt>>>27)+Ht+(jt&Ft|~jt&Lt)+0x5a827999|0;Ht=Lt;Lt=Ft;Ft=jt<<30|jt>>>2;jt=Nt;Nt=Gt;Gt=nt+(Nt<<5|Nt>>>27)+Ht+(jt&Ft|~jt&Lt)+0x5a827999|0;Ht=Lt;Lt=Ft;Ft=jt<<30|jt>>>2;jt=Nt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ot[Ae|10]=$e>>>8&255;Ot[Ae|11]=$e&255;Ot[Ae|12]=rt>>>24;Ot[Ae|13]=rt>>>16&255;Ot[Ae|14]=rt>>>8&255;Ot[Ae|15]=rt&255;Ot[Ae|16]=it>>>24;Ot[Ae|17]=it>>>16&255;Ot[Ae|18]=it>>>8&255;Ot[Ae|19]=it&255}function S(){qe=0x67452301;Fe=0xefcdab89;$e=0x98badcfe;rt=0x10325476;it=0xc3d2e1f0;nt=st=0}function E(Ae,Se,Ce,ut,ht,ft,yt){Ae=Ae|0;Se=Se|0;Ce=Ce|0;ut=ut|0;ht=ht|0;ft=ft|0;yt=yt|0;qe=Ae;Fe=Se;$e=Ce;rt=ut;it=ht;nt=ft;st=yt}function P(Ae,Se){Ae=Ae|0;Se=Se|0;var Ce=0;if(Ae&63)return-1;while((Se|0)>=64){k(Ae);Ae=Ae+64|0;Se=Se-64|0;Ce=Ce+64|0}nt=nt+Ce|0;if(nt>>>0>>0)st=st+1|0;return Ce|0}function x(Ae,Se,Ce){Ae=Ae|0;Se=Se|0;Ce=Ce|0;var qe=0,Fe=0;if(Ae&63)return-1;if(~Ce)if(Ce&31)return-1;if((Se|0)>=64){qe=P(Ae,Se)|0;if((qe|0)==-1)return-1;Ae=Ae+qe|0;Se=Se-qe|0}qe=qe+Se|0;nt=nt+Se|0;if(nt>>>0>>0)st=st+1|0;Ot[Ae|Se]=0x80;if((Se|0)>=56){for(Fe=Se+1|0;(Fe|0)<64;Fe=Fe+1|0)Ot[Ae|Fe]=0x00;k(Ae);Se=0;Ot[Ae|0]=0}for(Fe=Se+1|0;(Fe|0)<59;Fe=Fe+1|0)Ot[Ae|Fe]=0;Ot[Ae|56]=st>>>21&255;Ot[Ae|57]=st>>>13&255;Ot[Ae|58]=st>>>5&255;Ot[Ae|59]=st<<3&255|nt>>>29;Ot[Ae|60]=nt>>>21&255;Ot[Ae|61]=nt>>>13&255;Ot[Ae|62]=nt>>>5&255;Ot[Ae|63]=nt<<3&255;k(Ae);if(~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,st){Ae=Ae|0;Se=Se|0;Ce=Ce|0;nt=nt|0;st=st|0;var ut=0,ht=0,ft=0,yt=0,vt=0,_t=0,Ct=0,Rt=0,Ut=0,It=0;if(Ae&63)return-1;if(~st)if(st&31)return-1;Ot[Ae+Se|0]=Ce>>>24;Ot[Ae+Se+1|0]=Ce>>>16&255;Ot[Ae+Se+2|0]=Ce>>>8&255;Ot[Ae+Se+3|0]=Ce&255;D(Ae,Se+4|0,-1)|0;ut=_t=qe,ht=Ct=Fe,ft=Rt=$e,yt=Ut=rt,vt=It=it;nt=nt-1|0;while((nt|0)>0){M();_(_t,Ct,Rt,Ut,It,0x80000000,0,0,0,0,0,0,0,0,0,672);_t=qe,Ct=Fe,Rt=$e,Ut=rt,It=it;K();_(_t,Ct,Rt,Ut,It,0x80000000,0,0,0,0,0,0,0,0,0,672);_t=qe,Ct=Fe,Rt=$e,Ut=rt,It=it;ut=ut^qe;ht=ht^Fe;ft=ft^$e;yt=yt^rt;vt=vt^it;nt=nt-1|0}qe=ut;Fe=ht;$e=ft;rt=yt;it=vt;if(~st)A(st);return 0}return{reset:S,init:E,process:P,finish:x,hmac_reset:M,hmac_init:C,hmac_finish:D,pbkdf2_generate_block:U}};class ct{constructor(){this.pos=0,this.len=0}reset(){const{asm:Ae}=this.acquire_asm();return this.result=null,this.pos=0,this.len=0,Ae.reset(),this}process(Ae){if(null!==this.result)throw new Be("state must be reset before processing new data");const{asm:Se,heap:Ce}=this.acquire_asm();let qe=this.pos,Fe=this.len,$e=0,rt=Ae.length,it=0;for(;rt>0;)it=Re(Ce,qe+Fe,Ae,$e,rt),Fe+=it,$e+=it,rt-=it,it=Se.process(qe,Fe),qe+=it,Fe-=it,Fe||(qe=0);return this.pos=qe,this.len=Fe,this}finish(){if(null!==this.result)throw new Be("state must be reset before processing new data");const{asm:Ae,heap:Se}=this.acquire_asm();return Ae.finish(this.pos,this.len,0),this.result=new Uint8Array(this.HASH_SIZE),this.result.set(Se.subarray(0,this.HASH_SIZE)),this.pos=0,this.len=0,this.release_asm(),this}}const Or=[],Nr=[];class dt extends ct{constructor(){super(),this.NAME="sha1",this.BLOCK_SIZE=64,this.HASH_SIZE=20,this.acquire_asm()}acquire_asm(){return void 0!==this.heap&&void 0!==this.asm||(this.heap=Or.pop()||Ue(),this.asm=Nr.pop()||ot({Uint8Array:Uint8Array},null,this.heap.buffer),this.reset()),{heap:this.heap,asm:this.asm}}release_asm(){void 0!==this.heap&&void 0!==this.asm&&(Or.push(this.heap),Nr.push(this.asm)),this.heap=void 0,this.asm=void 0}static bytes(Ae){return(new dt).process(Ae).finish().result}}dt.NAME="sha1",dt.heap_pool=[],dt.asm_pool=[],dt.asm_function=ot;const jr=[],Lr=[];class pt extends ct{constructor(){super(),this.NAME="sha256",this.BLOCK_SIZE=64,this.HASH_SIZE=32,this.acquire_asm()}acquire_asm(){return void 0!==this.heap&&void 0!==this.asm||(this.heap=jr.pop()||Ue(),this.asm=Lr.pop()||function(Ae,Se,Ce){"use asm";var qe=0,Fe=0,$e=0,rt=0,it=0,nt=0,st=0,ut=0,ht=0,ft=0,yt=0,vt=0,_t=0,Ct=0,Rt=0,Ut=0,It=0,Ot=0,Nt=0,jt=0,Ft=0,Lt=0,Ht=0,Wt=0,Gt=0,$t=0,Vt=new Ae.Uint8Array(Ce);function C(Ae,Se,Ce,ht,ft,yt,vt,_t,Ct,Rt,Ut,It,Ot,Nt,jt,Ft){Ae=Ae|0;Se=Se|0;Ce=Ce|0;ht=ht|0;ft=ft|0;yt=yt|0;vt=vt|0;_t=_t|0;Ct=Ct|0;Rt=Rt|0;Ut=Ut|0;It=It|0;Ot=Ot|0;Nt=Nt|0;jt=jt|0;Ft=Ft|0;var Lt=0,Ht=0,Wt=0,Gt=0,$t=0,Vt=0,Qt=0,Zt=0;Lt=qe;Ht=Fe;Wt=$e;Gt=rt;$t=it;Vt=nt;Qt=st;Zt=ut;Zt=Ae+Zt+($t>>>6^$t>>>11^$t>>>25^$t<<26^$t<<21^$t<<7)+(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-1|0;while((ht|0)>0){z();C(Nt,jt,Ft,Lt,Ht,Wt,Gt,$t,0x80000000,0,0,0,0,0,0,768);Nt=qe,jt=Fe,Ft=$e,Lt=rt,Ht=it,Wt=nt,Gt=st,$t=ut;q();C(Nt,jt,Ft,Lt,Ht,Wt,Gt,$t,0x80000000,0,0,0,0,0,0,768);Nt=qe,jt=Fe,Ft=$e,Lt=rt,Ht=it,Wt=nt,Gt=st,$t=ut;yt=yt^qe;vt=vt^Fe;_t=_t^$e;Ct=Ct^rt;Rt=Rt^it;Ut=Ut^nt;It=It^st;Ot=Ot^ut;ht=ht-1|0}qe=yt;Fe=vt;$e=_t;rt=Ct;it=Rt;nt=Ut;st=It;ut=Ot;if(~ft)U(ft);return 0}return{reset:R,init:I,process:B,finish:T,hmac_reset:z,hmac_init:F,hmac_finish:O,pbkdf2_generate_block:L}}({Uint8Array:Uint8Array},null,this.heap.buffer),this.reset()),{heap:this.heap,asm:this.asm}}release_asm(){void 0!==this.heap&&void 0!==this.asm&&(jr.push(this.heap),Lr.push(this.asm)),this.heap=void 0,this.asm=void 0}static bytes(Ae){return(new pt).process(Ae).finish().result}}pt.NAME="sha256";var Hr=bt;function bt(Ae,Se){if(!Ae)throw Error(Se||"Assertion failed")}bt.equal=function(Ae,Se,Ce){if(Ae!=Se)throw Error(Ce||"Assertion failed: "+Ae+" != "+Se)};var Qr=void 0!==qe?qe:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function mt(Ae,Se){return Ae(Se={exports:{}},Se.exports),Se.exports}function wt(){throw Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}var ti=mt((function(Ae){Ae.exports="function"==typeof Object.create?function(Ae,Se){Ae.super_=Se,Ae.prototype=Object.create(Se.prototype,{constructor:{value:Ae,enumerable:!1,writable:!0,configurable:!0}})}:function(Ae,Se){Ae.super_=Se;var r=function(){};r.prototype=Se.prototype,Ae.prototype=new r,Ae.prototype.constructor=Ae}})),ri=mt((function(Ae){try{var Se=Ct.default;if("function"!=typeof Se.inherits)throw"";Ae.exports=Se.inherits}catch(Se){Ae.exports=ti}}));var kt=function(Ae,Se){if(Array.isArray(Ae))return Ae.slice();if(!Ae)return[];var Ce=[];if("string"==typeof Ae)if(Se){if("hex"===Se)for((Ae=Ae.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(Ae="0"+Ae),qe=0;qe>8,rt=255&Fe;$e?Ce.push($e,rt):Ce.push(rt)}else for(qe=0;qe>>24|Ae>>>8&65280|Ae<<8&16711680|(255&Ae)<<24)>>>0}var Et=function(Ae,Se){for(var Ce="",qe=0;qe>>0}return $e};var Kt=function(Ae,Se){for(var Ce=Array(4*Ae.length),qe=0,Fe=0;qe>>24,Ce[Fe+1]=$e>>>16&255,Ce[Fe+2]=$e>>>8&255,Ce[Fe+3]=255&$e):(Ce[Fe+3]=$e>>>24,Ce[Fe+2]=$e>>>16&255,Ce[Fe+1]=$e>>>8&255,Ce[Fe]=255&$e)}return Ce};var ii={inherits:ri,toArray:kt,toHex:At,htonl:St,toHex32:Et,zero2:Pt,zero8:xt,join32:Mt,split32:Kt,rotr32:function(Ae,Se){return Ae>>>Se|Ae<<32-Se},rotl32:function(Ae,Se){return Ae<>>32-Se},sum32:function(Ae,Se){return Ae+Se>>>0},sum32_3:function(Ae,Se,Ce){return Ae+Se+Ce>>>0},sum32_4:function(Ae,Se,Ce,qe){return Ae+Se+Ce+qe>>>0},sum32_5:function(Ae,Se,Ce,qe,Fe){return Ae+Se+Ce+qe+Fe>>>0},sum64:function(Ae,Se,Ce,qe){var Fe=Ae[Se],$e=qe+Ae[Se+1]>>>0,rt=($e>>0,Ae[Se+1]=$e},sum64_hi:function(Ae,Se,Ce,qe){return(Se+qe>>>0>>0},sum64_lo:function(Ae,Se,Ce,qe){return Se+qe>>>0},sum64_4_hi:function(Ae,Se,Ce,qe,Fe,$e,rt,it){var nt=0,st=Se;return nt+=(st=st+qe>>>0)>>0)<$e?1:0,Ae+Ce+Fe+rt+(nt+=(st=st+it>>>0)>>0},sum64_4_lo:function(Ae,Se,Ce,qe,Fe,$e,rt,it){return Se+qe+$e+it>>>0},sum64_5_hi:function(Ae,Se,Ce,qe,Fe,$e,rt,it,nt,st){var ut=0,ht=Se;return ut+=(ht=ht+qe>>>0)>>0)<$e?1:0,ut+=(ht=ht+it>>>0)>>0)>>0},sum64_5_lo:function(Ae,Se,Ce,qe,Fe,$e,rt,it,nt,st){return Se+qe+$e+it+st>>>0},rotr64_hi:function(Ae,Se,Ce){return(Se<<32-Ce|Ae>>>Ce)>>>0},rotr64_lo:function(Ae,Se,Ce){return(Ae<<32-Ce|Se>>>Ce)>>>0},shr64_hi:function(Ae,Se,Ce){return Ae>>>Ce},shr64_lo:function(Ae,Se,Ce){return(Ae<<32-Ce|Se>>>Ce)>>>0}};function Dt(){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}var oi=Dt;Dt.prototype.update=function(Ae,Se){if(Ae=ii.toArray(Ae,Se),this.pending?this.pending=this.pending.concat(Ae):this.pending=Ae,this.pendingTotal+=Ae.length,this.pending.length>=this._delta8){var Ce=(Ae=this.pending).length%this._delta8;this.pending=Ae.slice(Ae.length-Ce,Ae.length),0===this.pending.length&&(this.pending=null),Ae=ii.join32(Ae,0,Ae.length-Ce,this.endian);for(var qe=0;qe>>24&255,qe[Fe++]=Ae>>>16&255,qe[Fe++]=Ae>>>8&255,qe[Fe++]=255&Ae}else for(qe[Fe++]=255&Ae,qe[Fe++]=Ae>>>8&255,qe[Fe++]=Ae>>>16&255,qe[Fe++]=Ae>>>24&255,qe[Fe++]=0,qe[Fe++]=0,qe[Fe++]=0,qe[Fe++]=0,$e=8;$e>>3},g1_256:function(Ae){return di(Ae,17)^di(Ae,19)^Ae>>>10}},fi=ii.sum32,pi=ii.sum32_4,yi=ii.sum32_5,mi=li.ch32,vi=li.maj32,wi=li.s0_256,ki=li.s1_256,Si=li.g0_256,Ei=li.g1_256,Mi=ci.BlockHash,Pi=[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 Yt(){if(!(this instanceof Yt))return new Yt;Mi.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=Pi,this.W=Array(64)}ii.inherits(Yt,Mi);var xi=Yt;function Jt(){if(!(this instanceof Jt))return new Jt;xi.call(this),this.h=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]}Yt.blockSize=512,Yt.outSize=256,Yt.hmacStrength=192,Yt.padLength=64,Yt.prototype._update=function(Ae,Se){for(var Ce=this.W,qe=0;qe<16;qe++)Ce[qe]=Ae[Se+qe];for(;qe>>32-Fe,Ce)}function Vr(Ae,Se,Ce,qe,Fe,$e,rt){return Gr(Se&Ce|~Se&qe,Ae,Se,Fe,$e,rt)}function $r(Ae,Se,Ce,qe,Fe,$e,rt){return Gr(Se&qe|Ce&~qe,Ae,Se,Fe,$e,rt)}function Zr(Ae,Se,Ce,qe,Fe,$e,rt){return Gr(Se^Ce^qe,Ae,Se,Fe,$e,rt)}function Xr(Ae,Se,Ce,qe,Fe,$e,rt){return Gr(Ce^(Se|~qe),Ae,Se,Fe,$e,rt)}function Yr(Ae){const Se=[];let Ce;for(Ce=0;Ce<64;Ce+=4)Se[Ce>>2]=Ae.charCodeAt(Ce)+(Ae.charCodeAt(Ce+1)<<8)+(Ae.charCodeAt(Ce+2)<<16)+(Ae.charCodeAt(Ce+3)<<24);return Se}const vn="0123456789abcdef".split("");function Jr(Ae){let Se="",Ce=0;for(;Ce<4;Ce++)Se+=vn[Ae>>8*Ce+4&15]+vn[Ae>>8*Ce&15];return Se}function ei(Ae,Se){return Ae+Se&4294967295}const wn=ar.getWebCrypto(),Bn=ar.getNodeCrypto(),Tn=Bn&&Bn.getHashes();function ni(Ae){if(Bn&&Tn.includes(Ae))return async function(Se){const Ce=Bn.createHash(Ae);return X(Se,(Ae=>{Ce.update(Ae)}),(()=>new Uint8Array(Ce.digest())))}}function ai(Ae,Se){return async function(Ce,qe=dr){if(_(Ce)&&(Ce=await ie(Ce)),!ar.isStream(Ce)&&wn&&Se&&Ce.length>=qe.minBytesForWebCrypto)return new Uint8Array(await wn.digest(Se,Ce));const Fe=Ae();return X(Ce,(Ae=>{Fe.update(Ae)}),(()=>new Uint8Array(Fe.digest())))}}function si(Ae,Se){return async function(Ce,qe=dr){if(_(Ce)&&(Ce=await ie(Ce)),ar.isStream(Ce)){const Se=new Ae;return X(Ce,(Ae=>{Se.process(Ae)}),(()=>Se.finish().result))}return wn&&Se&&Ce.length>=qe.minBytesForWebCrypto?new Uint8Array(await wn.digest(Se,Ce)):Ae.bytes(Ce)}}const In={md5:ni("md5")||async function(Ae){const Se=function(Ae){const Se=Ae.length,Ce=[1732584193,-271733879,-1732584194,271733878];let qe;for(qe=64;qe<=Ae.length;qe+=64)Wr(Ce,Yr(Ae.substring(qe-64,qe)));Ae=Ae.substring(qe-64);const Fe=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];for(qe=0;qe>2]|=Ae.charCodeAt(qe)<<(qe%4<<3);if(Fe[qe>>2]|=128<<(qe%4<<3),qe>55)for(Wr(Ce,Fe),qe=0;qe<16;qe++)Fe[qe]=0;return Fe[14]=8*Se,Wr(Ce,Fe),Ce}(ar.uint8ArrayToString(Ae));return ar.hexToUint8Array(function(Ae){for(let Se=0;Senew Uint8Array($e.update(Ae))))}(Ae,Se,Ce,qe);if(ar.isAES(Ae))return function(Ae,Se,Ce,qe,Fe){if(ar.getWebCrypto()&&24!==Se.length&&!ar.isStream(Ce)&&Ce.length>=3e3*Fe.minBytesForWebCrypto)return async function(Ae,Se,Ce,qe){const Fe="AES-CBC",$e=await qn.importKey("raw",Se,{name:Fe},!1,["encrypt"]),{blockSize:rt}=hi(Ae),it=ar.concatUint8Array([new Uint8Array(rt),Ce]),nt=new Uint8Array(await qn.encrypt({name:Fe,iv:qe},$e,it)).subarray(0,Ce.length);return function(Ae,Se){for(let Ce=0;Ce$e.aes.AES_Encrypt_process(Ae)),(()=>$e.aes.AES_Encrypt_finish()))}(Ae,Se,Ce,qe,Fe);const rt=new(hi(Ae))(Se),it=rt.blockSize,nt=qe.slice();let st=new Uint8Array;const h=Ae=>{Ae&&(st=ar.concatUint8Array([st,Ae]));const Se=new Uint8Array(st.length);let Ce,qe=0;for(;Ae?st.length>=it:st.length;){const Ae=rt.encrypt(nt);for(Ce=0;Cenew Uint8Array($e.update(Ae))))}(Ae,Se,Ce,qe);if(ar.isAES(Ae))return function(Ae,Se,Ce,qe){if(ar.isStream(Ce)){const Ae=new ui(Se,qe);return X(Ce,(Se=>Ae.aes.AES_Decrypt_process(Se)),(()=>Ae.aes.AES_Decrypt_finish()))}return ui.decrypt(Ce,Se,qe)}(0,Se,Ce,qe);const $e=new(hi(Ae))(Se),rt=$e.blockSize;let it=qe,nt=new Uint8Array;const u=Ae=>{Ae&&(nt=ar.concatUint8Array([nt,Ae]));const Se=new Uint8Array(nt.length);let Ce,qe=0;for(;Ae?nt.length>=rt:nt.length;){const Ae=$e.encrypt(it);for(it=nt.subarray(0,rt),Ce=0;Ce48)throw new Te("illegal counter size");let Ae=Math.pow(2,Ce)-1;qe.set_mask(0,0,Ae/4294967296|0,0|Ae)}else Ce=48,qe.set_mask(0,0,65535,4294967295);if(void 0===Ae)throw Error("nonce is required");{let Se=Ae.length;if(!Se||Se>16)throw new Te("illegal nonce size");let Ce=new DataView(new ArrayBuffer(16));new Uint8Array(Ce.buffer).set(Ae),qe.set_nonce(Ce.getUint32(0),Ce.getUint32(4),Ce.getUint32(8),Ce.getUint32(12))}if(void 0!==Se){if(Se<0||Se>=Math.pow(2,Ce))throw new Te("illegal counter value");qe.set_counter(0,0,Se/4294967296|0,0|Se)}}}class gi{static encrypt(Ae,Se,Ce=!0,qe){return new gi(Se,qe,Ce).encrypt(Ae)}static decrypt(Ae,Se,Ce=!0,qe){return new gi(Se,qe,Ce).decrypt(Ae)}constructor(Ae,Se,Ce=!0,qe){this.aes=qe||new Oe(Ae,Se,Ce,"CBC")}encrypt(Ae){return Ie(this.aes.AES_Encrypt_process(Ae),this.aes.AES_Encrypt_finish())}decrypt(Ae){return Ie(this.aes.AES_Decrypt_process(Ae),this.aes.AES_Decrypt_finish())}}const Zn=ar.getWebCrypto(),Xn=ar.getNodeCrypto(),Yn=16;function _i(Ae,Se){const Ce=Ae.length-Yn;for(let qe=0;qe>3),17+(st>>3)),8-(7&st)).subarray(1),yt=new Uint8Array(us),vt=new Uint8Array(Se.length+ds);let _t,Ct=0;for(_t=0;_t16)throw new Te("illegal tagSize value");const it=Se.length||0,nt=new Uint8Array(16);12!==it?(this._gcm_mac_process(Se),rt[0]=0,rt[1]=0,rt[2]=0,rt[3]=0,rt[4]=0,rt[5]=0,rt[6]=0,rt[7]=0,rt[8]=0,rt[9]=0,rt[10]=0,rt[11]=it>>>29,rt[12]=it>>>21&255,rt[13]=it>>>13&255,rt[14]=it>>>5&255,rt[15]=it<<3&255,$e.mac(yr.MAC.GCM,yr.HEAP_DATA,16),$e.get_iv(yr.HEAP_DATA),$e.set_iv(0,0,0,0),nt.set(rt.subarray(0,16))):(nt.set(Se),nt[15]=1);const st=new DataView(nt.buffer);if(this.gamma0=st.getUint32(12),$e.set_nonce(st.getUint32(0),st.getUint32(4),st.getUint32(8),0),$e.set_mask(0,0,0,4294967295),void 0!==Ce){if(Ce.length>ys)throw new Te("illegal adata length");Ce.length?(this.adata=Ce,this._gcm_mac_process(Ce)):this.adata=void 0}else this.adata=void 0;if(this.counter<1||this.counter>4294967295)throw new RangeError("counter must be a positive 32-bit integer");$e.set_counter(0,0,0,this.gamma0+this.counter|0)}static encrypt(Ae,Se,Ce,qe,Fe){return new Gi(Se,Ce,qe,Fe).encrypt(Ae)}static decrypt(Ae,Se,Ce,qe,Fe){return new Gi(Se,Ce,qe,Fe).decrypt(Ae)}encrypt(Ae){return this.AES_GCM_encrypt(Ae)}decrypt(Ae){return this.AES_GCM_decrypt(Ae)}AES_GCM_Encrypt_process(Ae){let Se=0,Ce=Ae.length||0,{asm:qe,heap:Fe}=this.aes.acquire_asm(),$e=this.counter,rt=this.aes.pos,it=this.aes.len,nt=0,st=it+Ce&-16,ut=0;if(($e-1<<4)+it+Ce>ys)throw new RangeError("counter overflow");const ht=new Uint8Array(st);for(;Ce>0;)ut=Re(Fe,rt+it,Ae,Se,Ce),it+=ut,Se+=ut,Ce-=ut,ut=qe.cipher(yr.ENC.CTR,yr.HEAP_DATA+rt,it),ut=qe.mac(yr.MAC.GCM,yr.HEAP_DATA+rt,ut),ut&&ht.set(Fe.subarray(rt,rt+ut),nt),$e+=ut>>>4,nt+=ut,ut>>29,Se[4]=st>>>21,Se[5]=st>>>13&255,Se[6]=st>>>5&255,Se[7]=st<<3&255,Se[8]=Se[9]=Se[10]=0,Se[11]=ut>>>29,Se[12]=ut>>>21&255,Se[13]=ut>>>13&255,Se[14]=ut>>>5&255,Se[15]=ut<<3&255,Ae.mac(yr.MAC.GCM,yr.HEAP_DATA,16),Ae.get_iv(yr.HEAP_DATA),Ae.set_counter(0,0,0,this.gamma0),Ae.cipher(yr.ENC.CTR,yr.HEAP_DATA,16),it.set(Se.subarray(0,qe),rt),this.counter=1,this.aes.pos=0,this.aes.len=0,it}AES_GCM_Decrypt_process(Ae){let Se=0,Ce=Ae.length||0,{asm:qe,heap:Fe}=this.aes.acquire_asm(),$e=this.counter,rt=this.tagSize,it=this.aes.pos,nt=this.aes.len,st=0,ut=nt+Ce>rt?nt+Ce-rt&-16:0,ht=nt+Ce-ut,ft=0;if(($e-1<<4)+nt+Ce>ys)throw new RangeError("counter overflow");const yt=new Uint8Array(ut);for(;Ce>ht;)ft=Re(Fe,it+nt,Ae,Se,Ce-ht),nt+=ft,Se+=ft,Ce-=ft,ft=qe.mac(yr.MAC.GCM,yr.HEAP_DATA+it,ft),ft=qe.cipher(yr.DEC.CTR,yr.HEAP_DATA+it,ft),ft&&yt.set(Fe.subarray(it,it+ft),st),$e+=ft>>>4,st+=ft,it=0,nt=0;return Ce>0&&(nt+=Re(Fe,0,Ae,Se,Ce)),this.counter=$e,this.aes.pos=it,this.aes.len=nt,yt}AES_GCM_Decrypt_finish(){let{asm:Ae,heap:Se}=this.aes.acquire_asm(),Ce=this.tagSize,qe=this.adata,Fe=this.counter,$e=this.aes.pos,rt=this.aes.len,it=rt-Ce;if(rt>>29,Se[4]=ht>>>21,Se[5]=ht>>>13&255,Se[6]=ht>>>5&255,Se[7]=ht<<3&255,Se[8]=Se[9]=Se[10]=0,Se[11]=ft>>>29,Se[12]=ft>>>21&255,Se[13]=ft>>>13&255,Se[14]=ft>>>5&255,Se[15]=ft<<3&255,Ae.mac(yr.MAC.GCM,yr.HEAP_DATA,16),Ae.get_iv(yr.HEAP_DATA),Ae.set_counter(0,0,0,this.gamma0),Ae.cipher(yr.ENC.CTR,yr.HEAP_DATA,16);let yt=0;for(let Ae=0;Ae0;){for($e=Re(Ce,0,Ae,qe,Fe),qe+=$e,Fe-=$e;15&$e;)Ce[$e++]=0;Se.mac(yr.MAC.GCM,yr.HEAP_DATA,$e)}}}const ms=ar.getWebCrypto(),gs=ar.getNodeCrypto(),bs=ar.getNodeBuffer(),vs=16,ws="AES-GCM";async function Qi(Ae,Se){if(Ae!==nr.symmetric.aes128&&Ae!==nr.symmetric.aes192&&Ae!==nr.symmetric.aes256)throw Error("GCM mode supports only AES cipher");if(ar.getNodeCrypto())return{encrypt:async function(Ae,Ce,qe=new Uint8Array){const Fe=new gs.createCipheriv("aes-"+8*Se.length+"-gcm",Se,Ce);Fe.setAAD(qe);const $e=bs.concat([Fe.update(Ae),Fe.final(),Fe.getAuthTag()]);return new Uint8Array($e)},decrypt:async function(Ae,Ce,qe=new Uint8Array){const Fe=new gs.createDecipheriv("aes-"+8*Se.length+"-gcm",Se,Ce);Fe.setAAD(qe),Fe.setAuthTag(Ae.slice(Ae.length-vs,Ae.length));const $e=bs.concat([Fe.update(Ae.slice(0,Ae.length-vs)),Fe.final()]);return new Uint8Array($e)}};if(ar.getWebCrypto()&&24!==Se.length){const Ae=await ms.importKey("raw",Se,{name:ws},!1,["encrypt","decrypt"]);return{encrypt:async function(Ce,qe,Fe=new Uint8Array){if(!Ce.length)return Gi.encrypt(Ce,Se,qe,Fe);const $e=await ms.encrypt({name:ws,iv:qe,additionalData:Fe,tagLength:8*vs},Ae,Ce);return new Uint8Array($e)},decrypt:async function(Ce,qe,Fe=new Uint8Array){if(Ce.length===vs)return Gi.decrypt(Ce,Se,qe,Fe);const $e=await ms.decrypt({name:ws,iv:qe,additionalData:Fe,tagLength:8*vs},Ae,Ce);return new Uint8Array($e)}}}return{encrypt:async function(Ae,Ce,qe){return Gi.encrypt(Ae,Se,Ce,qe)},decrypt:async function(Ae,Ce,qe){return Gi.decrypt(Ae,Se,Ce,qe)}}}Qi.getNonce=function(Ae,Se){const Ce=Ae.slice();for(let Ae=0;Ae>>8)-1}(Ae,Se,Ce,qe,32)}function p(Ae,Se){var Ce;for(Ce=0;Ce<16;Ce++)Ae[Ce]=0|Se[Ce]}function y(Ae){var Se,Ce,qe=1;for(Se=0;Se<16;Se++)Ce=Ae[Se]+qe+65535,qe=Math.floor(Ce/65536),Ae[Se]=Ce-65536*qe;Ae[0]+=qe-1+37*(qe-1)}function b(Ae,Se,Ce){for(var qe,Fe=~(Ce-1),$e=0;$e<16;$e++)qe=Fe&(Ae[$e]^Se[$e]),Ae[$e]^=qe,Se[$e]^=qe}function g(Ae,Se){var Ce,qe,Fe,$e=t(),rt=t();for(Ce=0;Ce<16;Ce++)rt[Ce]=Se[Ce];for(y(rt),y(rt),y(rt),qe=0;qe<2;qe++){for($e[0]=rt[0]-65517,Ce=1;Ce<15;Ce++)$e[Ce]=rt[Ce]-65535-($e[Ce-1]>>16&1),$e[Ce-1]&=65535;$e[15]=rt[15]-32767-($e[14]>>16&1),Fe=$e[15]>>16&1,$e[14]&=65535,b(rt,$e,1-Fe)}for(Ce=0;Ce<16;Ce++)Ae[2*Ce]=255&rt[Ce],Ae[2*Ce+1]=rt[Ce]>>8}function m(Ae,Se){var Ce=new Uint8Array(32),qe=new Uint8Array(32);return g(Ce,Ae),g(qe,Se),l(Ce,0,qe,0)}function w(Ae){var Se=new Uint8Array(32);return g(Se,Ae),1&Se[0]}function v(Ae,Se){var Ce;for(Ce=0;Ce<16;Ce++)Ae[Ce]=Se[2*Ce]+(Se[2*Ce+1]<<8);Ae[15]&=32767}function _(Ae,Se,Ce){for(var qe=0;qe<16;qe++)Ae[qe]=Se[qe]+Ce[qe]}function k(Ae,Se,Ce){for(var qe=0;qe<16;qe++)Ae[qe]=Se[qe]-Ce[qe]}function A(Ae,Se,Ce){var qe,Fe,$e=0,rt=0,it=0,nt=0,st=0,ut=0,ht=0,ft=0,yt=0,vt=0,_t=0,Ct=0,Rt=0,Ut=0,It=0,Ot=0,Nt=0,jt=0,Ft=0,Lt=0,Ht=0,Wt=0,Gt=0,$t=0,Vt=0,Qt=0,Zt=0,Xt=0,er=0,tr=0,rr=0,ir=Ce[0],nr=Ce[1],sr=Ce[2],ar=Ce[3],cr=Ce[4],ur=Ce[5],hr=Ce[6],dr=Ce[7],lr=Ce[8],fr=Ce[9],yr=Ce[10],Cr=Ce[11],Dr=Ce[12],Rr=Ce[13],Kr=Ce[14],Tr=Ce[15];$e+=(qe=Se[0])*ir,rt+=qe*nr,it+=qe*sr,nt+=qe*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Fe=Math.floor(qe/65536)),st=(qe=st+Fe+65535)-65536*(Fe=Math.floor(qe/65536)),ut=(qe=ut+Fe+65535)-65536*(Fe=Math.floor(qe/65536)),ht=(qe=ht+Fe+65535)-65536*(Fe=Math.floor(qe/65536)),ft=(qe=ft+Fe+65535)-65536*(Fe=Math.floor(qe/65536)),yt=(qe=yt+Fe+65535)-65536*(Fe=Math.floor(qe/65536)),vt=(qe=vt+Fe+65535)-65536*(Fe=Math.floor(qe/65536)),_t=(qe=_t+Fe+65535)-65536*(Fe=Math.floor(qe/65536)),Ct=(qe=Ct+Fe+65535)-65536*(Fe=Math.floor(qe/65536)),Rt=(qe=Rt+Fe+65535)-65536*(Fe=Math.floor(qe/65536)),Ut=(qe=Ut+Fe+65535)-65536*(Fe=Math.floor(qe/65536)),It=(qe=It+Fe+65535)-65536*(Fe=Math.floor(qe/65536)),Ot=(qe=Ot+Fe+65535)-65536*(Fe=Math.floor(qe/65536)),$e=(qe=($e+=Fe-1+37*(Fe-1))+(Fe=1)+65535)-65536*(Fe=Math.floor(qe/65536)),rt=(qe=rt+Fe+65535)-65536*(Fe=Math.floor(qe/65536)),it=(qe=it+Fe+65535)-65536*(Fe=Math.floor(qe/65536)),nt=(qe=nt+Fe+65535)-65536*(Fe=Math.floor(qe/65536)),st=(qe=st+Fe+65535)-65536*(Fe=Math.floor(qe/65536)),ut=(qe=ut+Fe+65535)-65536*(Fe=Math.floor(qe/65536)),ht=(qe=ht+Fe+65535)-65536*(Fe=Math.floor(qe/65536)),ft=(qe=ft+Fe+65535)-65536*(Fe=Math.floor(qe/65536)),yt=(qe=yt+Fe+65535)-65536*(Fe=Math.floor(qe/65536)),vt=(qe=vt+Fe+65535)-65536*(Fe=Math.floor(qe/65536)),_t=(qe=_t+Fe+65535)-65536*(Fe=Math.floor(qe/65536)),Ct=(qe=Ct+Fe+65535)-65536*(Fe=Math.floor(qe/65536)),Rt=(qe=Rt+Fe+65535)-65536*(Fe=Math.floor(qe/65536)),Ut=(qe=Ut+Fe+65535)-65536*(Fe=Math.floor(qe/65536)),It=(qe=It+Fe+65535)-65536*(Fe=Math.floor(qe/65536)),Ot=(qe=Ot+Fe+65535)-65536*(Fe=Math.floor(qe/65536)),$e+=Fe-1+37*(Fe-1),Ae[0]=$e,Ae[1]=rt,Ae[2]=it,Ae[3]=nt,Ae[4]=st,Ae[5]=ut,Ae[6]=ht,Ae[7]=ft,Ae[8]=yt,Ae[9]=vt,Ae[10]=_t,Ae[11]=Ct,Ae[12]=Rt,Ae[13]=Ut,Ae[14]=It,Ae[15]=Ot}function S(Ae,Se){A(Ae,Se,Se)}function E(Ae,Se){var Ce,qe=t();for(Ce=0;Ce<16;Ce++)qe[Ce]=Se[Ce];for(Ce=253;Ce>=0;Ce--)S(qe,qe),2!==Ce&&4!==Ce&&A(qe,qe,Se);for(Ce=0;Ce<16;Ce++)Ae[Ce]=qe[Ce]}function P(Ae,Se,Ce){var qe,$e,rt=new Uint8Array(32),it=new Float64Array(80),nt=t(),st=t(),ut=t(),ht=t(),ft=t(),yt=t();for($e=0;$e<31;$e++)rt[$e]=Se[$e];for(rt[31]=127&Se[31]|64,rt[0]&=248,v(it,Ce),$e=0;$e<16;$e++)st[$e]=it[$e],ht[$e]=nt[$e]=ut[$e]=0;for(nt[0]=ht[0]=1,$e=254;$e>=0;--$e)b(nt,st,qe=rt[$e>>>3]>>>(7&$e)&1),b(ut,ht,qe),_(ft,nt,ut),k(nt,nt,ut),_(ut,st,ht),k(st,st,ht),S(ht,ft),S(yt,nt),A(nt,ut,nt),A(ut,st,ft),_(ft,nt,ut),k(nt,nt,ut),S(st,nt),k(ut,ht,yt),A(nt,ut,Fe),_(nt,nt,ht),A(ut,ut,nt),A(nt,ht,yt),A(ht,st,it),S(st,ft),b(nt,st,qe),b(ut,ht,qe);for($e=0;$e<16;$e++)it[$e+16]=nt[$e],it[$e+32]=ut[$e],it[$e+48]=st[$e],it[$e+64]=ht[$e];var vt=it.subarray(32),_t=it.subarray(16);return E(vt,vt),A(_t,_t,vt),g(Ae,_t),0}function x(Ae,Ce){return P(Ae,Ce,Se)}function M(Ae,Se){var Ce=t(),qe=t(),Fe=t(),$e=t(),it=t(),nt=t(),st=t(),ut=t(),ht=t();k(Ce,Ae[1],Ae[0]),k(ht,Se[1],Se[0]),A(Ce,Ce,ht),_(qe,Ae[0],Ae[1]),_(ht,Se[0],Se[1]),A(qe,qe,ht),A(Fe,Ae[3],Se[3]),A(Fe,Fe,rt),A($e,Ae[2],Se[2]),_($e,$e,$e),k(it,qe,Ce),k(nt,$e,Fe),_(st,$e,Fe),_(ut,qe,Ce),A(Ae[0],it,nt),A(Ae[1],ut,st),A(Ae[2],st,nt),A(Ae[3],it,ut)}function K(Ae,Se,Ce){var qe;for(qe=0;qe<4;qe++)b(Ae[qe],Se[qe],Ce)}function C(Ae,Se){var Ce=t(),qe=t(),Fe=t();E(Fe,Se[2]),A(Ce,Se[0],Fe),A(qe,Se[1],Fe),g(Ae,qe),Ae[31]^=w(Ce)<<7}function D(Ae,Se,Fe){var $e,rt;for(p(Ae[0],Ce),p(Ae[1],qe),p(Ae[2],qe),p(Ae[3],Ce),rt=255;rt>=0;--rt)K(Ae,Se,$e=Fe[rt/8|0]>>(7&rt)&1),M(Se,Ae),M(Ae,Ae),K(Ae,Se,$e)}function U(Ae,Se){var Ce=[t(),t(),t(),t()];p(Ce[0],it),p(Ce[1],nt),p(Ce[2],qe),A(Ce[3],it,nt),D(Ae,Ce,Se)}function R(Se,Ce,qe){var Fe,$e,rt=[t(),t(),t(),t()];for(qe||r(Ce,32),(Fe=Ae.hash(Ce.subarray(0,32)))[0]&=248,Fe[31]&=127,Fe[31]|=64,U(rt,Fe),C(Se,rt),$e=0;$e<32;$e++)Ce[$e+32]=Se[$e];return 0}var ut=new Float64Array([237,211,245,92,26,99,18,88,214,156,247,162,222,249,222,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16]);function B(Ae,Se){var Ce,qe,Fe,$e;for(qe=63;qe>=32;--qe){for(Ce=0,Fe=qe-32,$e=qe-12;Fe<$e;++Fe)Se[Fe]+=Ce-16*Se[qe]*ut[Fe-(qe-32)],Ce=Math.floor((Se[Fe]+128)/256),Se[Fe]-=256*Ce;Se[Fe]+=Ce,Se[qe]=0}for(Ce=0,Fe=0;Fe<32;Fe++)Se[Fe]+=Ce-(Se[31]>>4)*ut[Fe],Ce=Se[Fe]>>8,Se[Fe]&=255;for(Fe=0;Fe<32;Fe++)Se[Fe]-=Ce*ut[Fe];for(qe=0;qe<32;qe++)Se[qe+1]+=Se[qe]>>8,Ae[qe]=255&Se[qe]}function T(Ae){var Se,Ce=new Float64Array(64);for(Se=0;Se<64;Se++)Ce[Se]=Ae[Se];for(Se=0;Se<64;Se++)Ae[Se]=0;B(Ae,Ce)}function z(Ae,Se){var Fe=t(),rt=t(),it=t(),nt=t(),ut=t(),ht=t(),ft=t();return p(Ae[2],qe),v(Ae[1],Se),S(it,Ae[1]),A(nt,it,$e),k(it,it,Ae[2]),_(nt,Ae[2],nt),S(ut,nt),S(ht,ut),A(ft,ht,ut),A(Fe,ft,it),A(Fe,Fe,nt),function(Ae,Se){var Ce,qe=t();for(Ce=0;Ce<16;Ce++)qe[Ce]=Se[Ce];for(Ce=250;Ce>=0;Ce--)S(qe,qe),1!==Ce&&A(qe,qe,Se);for(Ce=0;Ce<16;Ce++)Ae[Ce]=qe[Ce]}(Fe,Fe),A(Fe,Fe,it),A(Fe,Fe,nt),A(Fe,Fe,nt),A(Ae[0],Fe,nt),S(rt,Ae[0]),A(rt,rt,nt),m(rt,it)&&A(Ae[0],Ae[0],st),S(rt,Ae[0]),A(rt,rt,nt),m(rt,it)?-1:(w(Ae[0])===Se[31]>>7&&k(Ae[0],Ce,Ae[0]),A(Ae[3],Ae[0],Ae[1]),0)}var ht=64;function F(){for(var Ae=0;Ae=0},Ae.sign.keyPair=function(){var Ae=new Uint8Array(32),Se=new Uint8Array(64);return R(Ae,Se),{publicKey:Ae,secretKey:Se}},Ae.sign.keyPair.fromSecretKey=function(Ae){if(F(Ae),64!==Ae.length)throw Error("bad secret key size");for(var Se=new Uint8Array(32),Ce=0;CeAe&&(nt.imod($e.leftShift(Fe)).iadd($e),st=nt.mod(rt).toNumber())}while(!await on(nt,Se,Ce));return nt}async function on(Ae,Se,Ce){return!(Se&&!Ae.dec().gcd(Se).isOne())&&(!!await async function(Ae){const Se=await ar.getBigInteger();return Es.every((Ce=>0!==Ae.mod(new Se(Ce))))}(Ae)&&(!!await async function(Ae,Se){const Ce=await ar.getBigInteger();return Se=Se||new Ce(2),Se.modExp(Ae.dec(),Ae).isOne()}(Ae)&&!!await async function(Ae,Se,Ce){const qe=await ar.getBigInteger(),Fe=Ae.bitLength();Se||(Se=Math.max(1,Fe/48|0));const $e=Ae.dec();let rt=0;for(;!$e.getBit(rt);)rt++;const it=Ae.rightShift(new qe(rt));for(;Se>0;Se--){let Se,Fe=(Ce?Ce():await nn(new qe(2),$e)).modExp(it,Ae);if(!Fe.isOne()&&!Fe.equal($e)){for(Se=1;SeSe-11)throw Error("Message too long");const qe=function(Ae){const Se=new Uint8Array(Ae);let Ce=0;for(;Ce=8&!qe;if(Se)return ar.selectUint8Array(rt,$e,Se);if(rt)return $e;throw Error("Decryption error")}async function fn(Ae,Se,Ce){let qe;if(Se.length!==zn.getHashByteLength(Ae))throw Error("Invalid hash length");const Fe=new Uint8Array(Ms[Ae].length);for(qe=0;qe{Cs.generateKeyPair("rsa",Ce,((Ce,qe,Fe)=>{Ce?Se(Ce):Ae(Rs.decode(Fe,"der"))}))}));return{n:qe.modulus.toArrayLike(Uint8Array),e:qe.publicExponent.toArrayLike(Uint8Array),d:qe.privateExponent.toArrayLike(Uint8Array),p:qe.prime2.toArrayLike(Uint8Array),q:qe.prime1.toArrayLike(Uint8Array),u:qe.coefficient.toArrayLike(Uint8Array)}}let Ce,qe,Fe;do{qe=await sn(Ae-(Ae>>1),Se,40),Ce=await sn(Ae>>1,Se,40),Fe=Ce.mul(qe)}while(Fe.bitLength()!==Ae);const $e=Ce.dec().imul(qe.dec());return qe.lt(Ce)&&([Ce,qe]=[qe,Ce]),{n:Fe.toUint8Array(),e:Se.toUint8Array(),d:Se.modInv($e).toUint8Array(),p:Ce.toUint8Array(),q:qe.toUint8Array(),u:Ce.modInv(qe).toUint8Array()}},validateParams:async function(Ae,Se,Ce,qe,Fe,$e){const rt=await ar.getBigInteger();if(Ae=new rt(Ae),qe=new rt(qe),Fe=new rt(Fe),!qe.mul(Fe).equal(Ae))return!1;const it=new rt(2);if($e=new rt($e),!qe.mul($e).mod(Fe).isOne())return!1;Se=new rt(Se),Ce=new rt(Ce);const nt=new rt(Math.floor(Ae.bitLength()/3)),st=await nn(it,it.leftShift(nt)),ut=st.mul(Ce).mul(Se);return!(!ut.mod(qe.dec()).equal(st)||!ut.mod(Fe.dec()).equal(st))}});var Ts=Object.freeze({__proto__:null,encrypt:async function(Ae,Se,Ce,qe){const Fe=await ar.getBigInteger();Se=new Fe(Se),Ce=new Fe(Ce),qe=new Fe(qe);const $e=new Fe(hn(Ae,Se.byteLength())),rt=await nn(new Fe(1),Se.dec());return{c1:Ce.modExp(rt,Se).toUint8Array(),c2:qe.modExp(rt,Se).imul($e).imod(Se).toUint8Array()}},decrypt:async function(Ae,Se,Ce,qe,Fe){const $e=await ar.getBigInteger();return Ae=new $e(Ae),Se=new $e(Se),Ce=new $e(Ce),qe=new $e(qe),dn(Ae.modExp(qe,Ce).modInv(Ce).imul(Se).imod(Ce).toUint8Array("be",Ce.byteLength()),Fe)},validateParams:async function(Ae,Se,Ce,qe){const Fe=await ar.getBigInteger();Ae=new Fe(Ae),Se=new Fe(Se),Ce=new Fe(Ce);const $e=new Fe(1);if(Se.lte($e)||Se.gte(Ae))return!1;const rt=new Fe(Ae.bitLength()),it=new Fe(1023);if(rt.lt(it))return!1;if(!Se.modExp(Ae.dec(),Ae).isOne())return!1;let nt=Se;const st=new Fe(1),ut=new Fe(2).leftShift(new Fe(17));for(;st.lt(ut);){if(nt=nt.mul(Se).imod(Ae),nt.isOne())return!1;st.iinc()}qe=new Fe(qe);const ht=new Fe(2),ft=await nn(ht.leftShift(rt.dec()),ht.leftShift(rt)),yt=Ae.dec().imul(ft).iadd(qe);return!!Ce.equal(Se.modExp(yt,Ae))}});class _n{constructor(Ae){if(Ae instanceof _n)this.oid=Ae.oid;else if(ar.isArray(Ae)||ar.isUint8Array(Ae)){if(6===(Ae=new Uint8Array(Ae))[0]){if(Ae[1]!==Ae.length-2)throw Error("Length mismatch in DER encoded oid");Ae=Ae.subarray(2)}this.oid=Ae}else this.oid=""}read(Ae){if(Ae.length>=1){const Se=Ae[0];if(Ae.length>=1+Se)return this.oid=Ae.subarray(1,1+Se),1+this.oid.length}throw Error("Invalid oid")}write(){return ar.concatUint8Array([new Uint8Array([this.oid.length]),this.oid])}toHex(){return ar.uint8ArrayToHex(this.oid)}getName(){const Ae=this.toHex();if(nr.curve[Ae])return nr.write(nr.curve,Ae);throw Error("Unknown curve object identifier.")}}function kn(Ae,Se){return Ae.keyPair({priv:Se})}function An(Ae,Se){const Ce=Ae.keyPair({pub:Se});if(!0!==Ce.validate().result)throw Error("Invalid elliptic public key");return Ce}async function Sn(Ae){if(!dr.useIndutnyElliptic)throw Error("This curve is only supported in the full build of OpenPGP.js");const{default:Se}=await Promise.resolve().then((function(){return og}));return new Se.ec(Ae)}function En(Ae){let Se,Ce=0;const qe=Ae[0];return qe<192?([Ce]=Ae,Se=1):qe<255?(Ce=(Ae[0]-192<<8)+Ae[1]+192,Se=2):255===qe&&(Ce=ar.readNumber(Ae.subarray(1,5)),Se=5),{len:Ce,offset:Se}}function Pn(Ae){return Ae<192?new Uint8Array([Ae]):Ae>191&&Ae<8384?new Uint8Array([192+(Ae-192>>8),Ae-192&255]):ar.concatUint8Array([new Uint8Array([255]),ar.writeNumber(Ae,4)])}function xn(Ae){if(Ae<0||Ae>30)throw Error("Partial Length power must be between 1 and 30");return new Uint8Array([224+Ae])}function Mn(Ae){return new Uint8Array([192|Ae])}function Kn(Ae,Se){return ar.concatUint8Array([Mn(Ae),Pn(Se)])}function Cn(Ae){return[nr.packet.literalData,nr.packet.compressedData,nr.packet.symmetricallyEncryptedData,nr.packet.symEncryptedIntegrityProtectedData,nr.packet.aeadEncryptedData].includes(Ae)}async function Dn(Ae,Se){const Ce=W(Ae);let qe,Fe;try{const $e=await Ce.peekBytes(2);if(!$e||$e.length<2||0==(128&$e[0]))throw Error("Error during parsing. This message / key probably does not conform to a valid OpenPGP format.");const rt=await Ce.readByte();let it,nt,st=-1,ut=-1;ut=0,0!=(64&rt)&&(ut=1),ut?st=63&rt:(st=(63&rt)>>2,nt=3&rt);const ht=Cn(st);let ft,yt=null;if(ht){if("array"===ar.isStream(Ae)){const Ae=new v;qe=G(Ae),yt=Ae}else{const Ae=new tr;qe=G(Ae.writable),yt=Ae.readable}Fe=Se({tag:st,packet:yt})}else yt=[];do{if(ut){const Ae=await Ce.readByte();if(ft=!1,Ae<192)it=Ae;else if(Ae>=192&&Ae<224)it=(Ae-192<<8)+await Ce.readByte()+192;else if(Ae>223&&Ae<255){if(it=1<<(31&Ae),ft=!0,!ht)throw new TypeError("This packet type does not support partial lengths.")}else it=await Ce.readByte()<<24|await Ce.readByte()<<16|await Ce.readByte()<<8|await Ce.readByte()}else switch(nt){case 0:it=await Ce.readByte();break;case 1:it=await Ce.readByte()<<8|await Ce.readByte();break;case 2:it=await Ce.readByte()<<24|await Ce.readByte()<<16|await Ce.readByte()<<8|await Ce.readByte();break;default:it=1/0}if(it>0){let Ae=0;for(;;){qe&&await qe.ready;const{done:Se,value:Fe}=await Ce.read();if(Se){if(it===1/0)break;throw Error("Unexpected end of packet")}const $e=it===1/0?Fe:Fe.subarray(0,it-Ae);if(qe?await qe.write($e):yt.push($e),Ae+=Fe.length,Ae>=it){Ce.unshift(Fe.subarray(it-Ae+Fe.length));break}}}}while(ft);const vt=await Ce.peekBytes(ht?1/0:2);return qe?(await qe.ready,await qe.close()):(yt=ar.concatUint8Array(yt),await Se({tag:st,packet:yt})),!vt||!vt.length}catch(Ae){if(qe)return await qe.abort(Ae),!0;throw Ae}finally{qe&&await Fe,Ce.releaseLock()}}class Un extends Error{constructor(...Ae){super(...Ae),Error.captureStackTrace&&Error.captureStackTrace(this,Un),this.name="UnsupportedError"}}class Rn{constructor(Ae,Se){this.tag=Ae,this.rawContent=Se}write(){return this.rawContent}}const Us=ar.getWebCrypto(),Is=ar.getNodeCrypto(),Os={p256:"P-256",p384:"P-384",p521:"P-521"},Ns=Is?Is.getCurves():[],zs=Is?{secp256k1:Ns.includes("secp256k1")?"secp256k1":void 0,p256:Ns.includes("prime256v1")?"prime256v1":void 0,p384:Ns.includes("secp384r1")?"secp384r1":void 0,p521:Ns.includes("secp521r1")?"secp521r1":void 0,ed25519:Ns.includes("ED25519")?"ED25519":void 0,curve25519:Ns.includes("X25519")?"X25519":void 0,brainpoolP256r1:Ns.includes("brainpoolP256r1")?"brainpoolP256r1":void 0,brainpoolP384r1:Ns.includes("brainpoolP384r1")?"brainpoolP384r1":void 0,brainpoolP512r1:Ns.includes("brainpoolP512r1")?"brainpoolP512r1":void 0}:{},qs={p256:{oid:[6,8,42,134,72,206,61,3,1,7],keyType:nr.publicKey.ecdsa,hash:nr.hash.sha256,cipher:nr.symmetric.aes128,node:zs.p256,web:Os.p256,payloadSize:32,sharedSize:256},p384:{oid:[6,5,43,129,4,0,34],keyType:nr.publicKey.ecdsa,hash:nr.hash.sha384,cipher:nr.symmetric.aes192,node:zs.p384,web:Os.p384,payloadSize:48,sharedSize:384},p521:{oid:[6,5,43,129,4,0,35],keyType:nr.publicKey.ecdsa,hash:nr.hash.sha512,cipher:nr.symmetric.aes256,node:zs.p521,web:Os.p521,payloadSize:66,sharedSize:528},secp256k1:{oid:[6,5,43,129,4,0,10],keyType:nr.publicKey.ecdsa,hash:nr.hash.sha256,cipher:nr.symmetric.aes128,node:zs.secp256k1,payloadSize:32},ed25519:{oid:[6,9,43,6,1,4,1,218,71,15,1],keyType:nr.publicKey.eddsaLegacy,hash:nr.hash.sha512,node:!1,payloadSize:32},curve25519:{oid:[6,10,43,6,1,4,1,151,85,1,5,1],keyType:nr.publicKey.ecdh,hash:nr.hash.sha256,cipher:nr.symmetric.aes128,node:!1,payloadSize:32},brainpoolP256r1:{oid:[6,9,43,36,3,3,2,8,1,1,7],keyType:nr.publicKey.ecdsa,hash:nr.hash.sha256,cipher:nr.symmetric.aes128,node:zs.brainpoolP256r1,payloadSize:32},brainpoolP384r1:{oid:[6,9,43,36,3,3,2,8,1,1,11],keyType:nr.publicKey.ecdsa,hash:nr.hash.sha384,cipher:nr.symmetric.aes192,node:zs.brainpoolP384r1,payloadSize:48},brainpoolP512r1:{oid:[6,9,43,36,3,3,2,8,1,1,13],keyType:nr.publicKey.ecdsa,hash:nr.hash.sha512,cipher:nr.symmetric.aes256,node:zs.brainpoolP512r1,payloadSize:64}};class On{constructor(Ae,Se){try{(ar.isArray(Ae)||ar.isUint8Array(Ae))&&(Ae=new _n(Ae)),Ae instanceof _n&&(Ae=Ae.getName()),this.name=nr.write(nr.curve,Ae)}catch(Ae){throw new Un("Unknown curve")}Se=Se||qs[this.name],this.keyType=Se.keyType,this.oid=Se.oid,this.hash=Se.hash,this.cipher=Se.cipher,this.node=Se.node&&qs[this.name],this.web=Se.web&&qs[this.name],this.payloadSize=Se.payloadSize,this.web&&ar.getWebCrypto()?this.type="web":this.node&&ar.getNodeCrypto()?this.type="node":"curve25519"===this.name?this.type="curve25519":"ed25519"===this.name&&(this.type="ed25519")}async genKeyPair(){let Ae;switch(this.type){case"web":try{return await async function(Ae){const Se=await Us.generateKey({name:"ECDSA",namedCurve:Os[Ae]},!0,["sign","verify"]),Ce=await Us.exportKey("jwk",Se.privateKey),qe=await Us.exportKey("jwk",Se.publicKey);return{publicKey:Nn(qe),privateKey:ge(Ce.d)}}(this.name)}catch(Ae){ar.printDebugError("Browser did not support generating ec key "+Ae.message);break}case"node":return async function(Ae){const Se=Is.createECDH(zs[Ae]);return await Se.generateKeys(),{publicKey:new Uint8Array(Se.getPublicKey()),privateKey:new Uint8Array(Se.getPrivateKey())}}(this.name);case"curve25519":{const Se=rn(32);Se[0]=127&Se[0]|64,Se[31]&=248;const Ce=Se.slice().reverse();Ae=ks.box.keyPair.fromSecretKey(Ce);return{publicKey:ar.concatUint8Array([new Uint8Array([64]),Ae.publicKey]),privateKey:Se}}case"ed25519":{const Ae=rn(32),Se=ks.sign.keyPair.fromSeed(Ae);return{publicKey:ar.concatUint8Array([new Uint8Array([64]),Se.publicKey]),privateKey:Ae}}}const Se=await Sn(this.name);return Ae=await Se.genKeyPair({entropy:ar.uint8ArrayToString(rn(32))}),{publicKey:new Uint8Array(Ae.getPublic("array",!1)),privateKey:Ae.getPrivate().toArrayLike(Uint8Array)}}}async function Ln(Ae,Se,Ce,qe){const Fe={p256:!0,p384:!0,p521:!0,secp256k1:!0,curve25519:Ae===nr.publicKey.ecdh,brainpoolP256r1:!0,brainpoolP384r1:!0,brainpoolP512r1:!0},$e=Se.getName();if(!Fe[$e])return!1;if("curve25519"===$e){qe=qe.slice().reverse();const{publicKey:Ae}=ks.box.keyPair.fromSecretKey(qe);Ce=new Uint8Array(Ce);const Se=new Uint8Array([64,...Ae]);return!!ar.equalsUint8Array(Se,Ce)}const rt=await Sn($e);try{Ce=An(rt,Ce).getPublic()}catch(Ae){return!1}return!!kn(rt,qe).getPublic().eq(Ce)}function Nn(Ae){const Se=ge(Ae.x),Ce=ge(Ae.y),qe=new Uint8Array(Se.length+Ce.length+1);return qe[0]=4,qe.set(Se,1),qe.set(Ce,Se.length+1),qe}function jn(Ae,Se,Ce){const qe=Ae,Fe=Ce.slice(1,qe+1),$e=Ce.slice(qe+1,2*qe+1);return{kty:"EC",crv:Se,x:me(Fe,!0),y:me($e,!0),ext:!0}}function Hn(Ae,Se,Ce,qe){const Fe=jn(Ae,Se,Ce);return Fe.d=me(qe,!0),Fe}const Ls=ar.getWebCrypto(),ea=ar.getNodeCrypto();async function Vn(Ae,Se,Ce,qe,Fe,$e){const rt=new On(Ae);if(Ce&&!ar.isStream(Ce)){const $e={publicKey:qe,privateKey:Fe};switch(rt.type){case"web":try{return await async function(Ae,Se,Ce,qe){const Fe=Ae.payloadSize,$e=Hn(Ae.payloadSize,Os[Ae.name],qe.publicKey,qe.privateKey),rt=await Ls.importKey("jwk",$e,{name:"ECDSA",namedCurve:Os[Ae.name],hash:{name:nr.read(nr.webHash,Ae.hash)}},!1,["sign"]),it=new Uint8Array(await Ls.sign({name:"ECDSA",namedCurve:Os[Ae.name],hash:{name:nr.read(nr.webHash,Se)}},rt,Ce));return{r:it.slice(0,Fe),s:it.slice(Fe,Fe<<1)}}(rt,Se,Ce,$e)}catch(Ae){if("p521"!==rt.name&&("DataError"===Ae.name||"OperationError"===Ae.name))throw Ae;ar.printDebugError("Browser did not support signing: "+Ae.message)}break;case"node":{const Ae=await async function(Ae,Se,Ce,qe){const Fe=ea.createSign(nr.read(nr.hash,Se));Fe.write(Ce),Fe.end();const $e=ca.encode({version:1,parameters:Ae.oid,privateKey:Array.from(qe.privateKey),publicKey:{unused:0,data:Array.from(qe.publicKey)}},"pem",{label:"EC PRIVATE KEY"});return ia.decode(Fe.sign($e),"der")}(rt,Se,Ce,$e);return{r:Ae.r.toArrayLike(Uint8Array),s:Ae.s.toArrayLike(Uint8Array)}}}}return async function(Ae,Se,Ce){const qe=await Sn(Ae.name),Fe=kn(qe,Ce),$e=Fe.sign(Se);return{r:$e.r.toArrayLike(Uint8Array),s:$e.s.toArrayLike(Uint8Array)}}(rt,$e,Fe)}async function $n(Ae,Se,Ce,qe,Fe,$e){const rt=new On(Ae);if(qe&&!ar.isStream(qe))switch(rt.type){case"web":try{return await async function(Ae,Se,{r:Ce,s:qe},Fe,$e){const rt=jn(Ae.payloadSize,Os[Ae.name],$e),it=await Ls.importKey("jwk",rt,{name:"ECDSA",namedCurve:Os[Ae.name],hash:{name:nr.read(nr.webHash,Ae.hash)}},!1,["verify"]),nt=ar.concatUint8Array([Ce,qe]).buffer;return Ls.verify({name:"ECDSA",namedCurve:Os[Ae.name],hash:{name:nr.read(nr.webHash,Se)}},it,nt,Fe)}(rt,Se,Ce,qe,Fe)}catch(Ae){if("p521"!==rt.name&&("DataError"===Ae.name||"OperationError"===Ae.name))throw Ae;ar.printDebugError("Browser did not support verifying: "+Ae.message)}break;case"node":return async function(Ae,Se,{r:Ce,s:qe},Fe,$e){const{default:rt}=await Promise.resolve().then((function(){return fm})),it=ea.createVerify(nr.read(nr.hash,Se));it.write(Fe),it.end();const nt=la.encode({algorithm:{algorithm:[1,2,840,10045,2,1],parameters:Ae.oid},subjectPublicKey:{unused:0,data:Array.from($e)}},"pem",{label:"PUBLIC KEY"}),st=ia.encode({r:new rt(Ce),s:new rt(qe)},"der");try{return it.verify(nt,st)}catch(Ae){return!1}}(rt,Se,Ce,qe,Fe)}return async function(Ae,Se,Ce,qe){const Fe=await Sn(Ae.name),$e=An(Fe,qe);return $e.verify(Ce,Se)}(rt,Ce,void 0===Se?qe:$e,Fe)}const ta=ea?Rt.default:void 0,ia=ea?ta.define("ECDSASignature",(function(){this.seq().obj(this.key("r").int(),this.key("s").int())})):void 0,ca=ea?ta.define("ECPrivateKey",(function(){this.seq().obj(this.key("version").int(),this.key("privateKey").octstr(),this.key("parameters").explicit(0).optional().any(),this.key("publicKey").explicit(1).optional().bitstr())})):void 0,da=ea?ta.define("AlgorithmIdentifier",(function(){this.seq().obj(this.key("algorithm").objid(),this.key("parameters").optional().any())})):void 0,la=ea?ta.define("SubjectPublicKeyInfo",(function(){this.seq().obj(this.key("algorithm").use(da),this.key("subjectPublicKey").bitstr())})):void 0;var fa=Object.freeze({__proto__:null,sign:Vn,verify:$n,validateParams:async function(Ae,Se,Ce){const qe=new On(Ae);if(qe.keyType!==nr.publicKey.ecdsa)return!1;switch(qe.type){case"web":case"node":{const qe=rn(8),Fe=nr.hash.sha256,$e=await zn.digest(Fe,qe);try{const rt=await Vn(Ae,Fe,qe,Se,Ce,$e);return await $n(Ae,Fe,rt,qe,Se,$e)}catch(Ae){return!1}}default:return Ln(nr.publicKey.ecdsa,Ae,Se,Ce)}}});ks.hash=Ae=>new Uint8Array(Yi().update(Ae).digest());var ma=Object.freeze({__proto__:null,sign:async function(Ae,Se,Ce,qe,Fe,$e){if(zn.getHashByteLength(Se)new Uint8Array(Yi().update(Ae).digest());var va=Object.freeze({__proto__:null,generate:async function(Ae){if(Ae===nr.publicKey.ed25519){const Ae=rn(32),{publicKey:Se}=ks.sign.keyPair.fromSeed(Ae);return{A:Se,seed:Ae}}throw Error("Unsupported EdDSA algorithm")},sign:async function(Ae,Se,Ce,qe,Fe,$e){if(zn.getHashByteLength(Se)=0;--Ae)for(let Se=it-1;Se>=0;--Se)nt[1]=it*Ae+(Se+1),st[0]=$e[0]^nt[0],st[1]=$e[1]^nt[1],st[2]=rt[2*Se],st[3]=rt[2*Se+1],st=sa(Ce.decrypt(oa(st))),$e=st.subarray(0,2),rt[2*Se]=st[2],rt[2*Se+1]=st[3];if($e[0]===qe[0]&&$e[1]===qe[1])return oa(rt);throw Error("Key Data Integrity failed")}function sa(Ae){const{length:Se}=Ae,Ce=function(Ae){if(ar.isString(Ae)){const{length:Se}=Ae,Ce=new ArrayBuffer(Se),qe=new Uint8Array(Ce);for(let Ce=0;Ce0){const Ce=Ae[Se-1];if(Ce>=1){const qe=Ae.subarray(Se-Ce),Fe=new Uint8Array(Ce).fill(Ce);if(ar.equalsUint8Array(qe,Fe))return Ae.subarray(0,Se-Ce)}}throw Error("Invalid padding")}var _a=Object.freeze({__proto__:null,encode:ua,decode:ha});const Aa=ar.getWebCrypto(),Sa=ar.getNodeCrypto();function pa(Ae,Se,Ce,qe){return ar.concatUint8Array([Se.write(),new Uint8Array([Ae]),Ce.write(),ar.stringToUint8Array("Anonymous Sender "),qe.subarray(0,20)])}async function ya(Ae,Se,Ce,qe,Fe=!1,$e=!1){let rt;if(Fe){for(rt=0;rt=0&&0===Se[rt];rt--);Se=Se.subarray(0,rt+1)}return(await zn.digest(Ae,ar.concatUint8Array([new Uint8Array([0,0,0,1]),Se,qe]))).subarray(0,Ce)}async function ba(Ae,Se){switch(Ae.type){case"curve25519":{const Ce=rn(32),{secretKey:qe,sharedKey:Fe}=await ga(Ae,Se,null,Ce);let{publicKey:$e}=ks.box.keyPair.fromSecretKey(qe);return $e=ar.concatUint8Array([new Uint8Array([64]),$e]),{publicKey:$e,sharedKey:Fe}}case"web":if(Ae.web&&ar.getWebCrypto())try{return await async function(Ae,Se){const Ce=jn(Ae.payloadSize,Ae.web.web,Se);let qe=Aa.generateKey({name:"ECDH",namedCurve:Ae.web.web},!0,["deriveKey","deriveBits"]),Fe=Aa.importKey("jwk",Ce,{name:"ECDH",namedCurve:Ae.web.web},!1,[]);[qe,Fe]=await Promise.all([qe,Fe]);let $e=Aa.deriveBits({name:"ECDH",namedCurve:Ae.web.web,public:Fe},qe.privateKey,Ae.web.sharedSize),rt=Aa.exportKey("jwk",qe.publicKey);[$e,rt]=await Promise.all([$e,rt]);const it=new Uint8Array($e),nt=new Uint8Array(Nn(rt));return{publicKey:nt,sharedKey:it}}(Ae,Se)}catch(Ae){ar.printDebugError(Ae)}break;case"node":return async function(Ae,Se){const Ce=Sa.createECDH(Ae.node.node);Ce.generateKeys();const qe=new Uint8Array(Ce.computeSecret(Se)),Fe=new Uint8Array(Ce.getPublicKey());return{publicKey:Fe,sharedKey:qe}}(Ae,Se)}return async function(Ae,Se){const Ce=await Sn(Ae.name),qe=await Ae.genKeyPair();Se=An(Ce,Se);const Fe=kn(Ce,qe.privateKey),$e=qe.publicKey,rt=Fe.derive(Se.getPublic()),it=Ce.curve.p.byteLength(),nt=rt.toArrayLike(Uint8Array,"be",it);return{publicKey:$e,sharedKey:nt}}(Ae,Se)}async function ga(Ae,Se,Ce,qe){if(qe.length!==Ae.payloadSize){const Se=new Uint8Array(Ae.payloadSize);Se.set(qe,Ae.payloadSize-qe.length),qe=Se}switch(Ae.type){case"curve25519":{const Ae=qe.slice().reverse();return{secretKey:Ae,sharedKey:ks.scalarMult(Ae,Se.subarray(1))}}case"web":if(Ae.web&&ar.getWebCrypto())try{return await async function(Ae,Se,Ce,qe){const Fe=Hn(Ae.payloadSize,Ae.web.web,Ce,qe);let $e=Aa.importKey("jwk",Fe,{name:"ECDH",namedCurve:Ae.web.web},!0,["deriveKey","deriveBits"]);const rt=jn(Ae.payloadSize,Ae.web.web,Se);let it=Aa.importKey("jwk",rt,{name:"ECDH",namedCurve:Ae.web.web},!0,[]);[$e,it]=await Promise.all([$e,it]);let nt=Aa.deriveBits({name:"ECDH",namedCurve:Ae.web.web,public:it},$e,Ae.web.sharedSize),st=Aa.exportKey("jwk",$e);[nt,st]=await Promise.all([nt,st]);const ut=new Uint8Array(nt);return{secretKey:ge(st.d),sharedKey:ut}}(Ae,Se,Ce,qe)}catch(Ae){ar.printDebugError(Ae)}break;case"node":return async function(Ae,Se,Ce){const qe=Sa.createECDH(Ae.node.node);qe.setPrivateKey(Ce);const Fe=new Uint8Array(qe.computeSecret(Se));return{secretKey:new Uint8Array(qe.getPrivateKey()),sharedKey:Fe}}(Ae,Se,qe)}return async function(Ae,Se,Ce){const qe=await Sn(Ae.name);Se=An(qe,Se),Ce=kn(qe,Ce);const Fe=new Uint8Array(Ce.getPrivate()),$e=Ce.derive(Se.getPublic()),rt=qe.curve.p.byteLength(),it=$e.toArrayLike(Uint8Array,"be",rt);return{secretKey:Fe,sharedKey:it}}(Ae,Se,qe)}var Ea=Object.freeze({__proto__:null,validateParams:async function(Ae,Se,Ce){return Ln(nr.publicKey.ecdh,Ae,Se,Ce)},encrypt:async function(Ae,Se,Ce,qe,Fe){const $e=ua(Ce),rt=new On(Ae),{publicKey:it,sharedKey:nt}=await ba(rt,qe),st=pa(nr.publicKey.ecdh,Ae,Se,Fe),{keySize:ut}=hi(Se.cipher);return{publicKey:it,wrappedKey:na(await ya(Se.hash,nt,ut,st),$e)}},decrypt:async function(Ae,Se,Ce,qe,Fe,$e,rt){const it=new On(Ae),{sharedKey:nt}=await ga(it,Ce,Fe,$e),st=pa(nr.publicKey.ecdh,Ae,Se,rt),{keySize:ut}=hi(Se.cipher);let ht;for(let Ce=0;Ce<3;Ce++)try{return ha(aa(await ya(Se.hash,nt,ut,st,1===Ce,2===Ce),qe))}catch(Ae){ht=Ae}throw ht}});const Ma=ar.getWebCrypto(),Pa=ar.getNodeCrypto(),xa=Pa&&Pa.webcrypto&&Pa.webcrypto.subtle;async function ka(Ae,Se,Ce,qe,Fe){const $e=nr.read(nr.webHash,Ae);if(!$e)throw Error("Hash algo not supported with HKDF");if(Ma||xa){const Ae=Ma||xa,rt=await Ae.importKey("raw",Se,"HKDF",!1,["deriveBits"]),it=await Ae.deriveBits({name:"HKDF",hash:$e,salt:Ce,info:qe},rt,8*Fe);return new Uint8Array(it)}if(Pa){const $e=nr.read(nr.hash,Ae),s=(Ae,Se)=>Pa.createHmac($e,Ae).update(Se).digest(),rt=s(Ce,Se),it=rt.length,nt=Math.ceil(Fe/it),st=new Uint8Array(nt*it),ut=new Uint8Array(it+qe.length+1);ut.set(qe,it);for(let Ae=0;Ae0?ut:ut.subarray(it));ut.set(Se,0),st.set(Se,Ae*it)}return st.subarray(0,Fe)}throw Error("No HKDF implementation available")}const Ra={x25519:ar.encodeUTF8("OpenPGP X25519")};var Ba=Object.freeze({__proto__:null,generate:async function(Ae){if(Ae===nr.publicKey.x25519){const Ae=rn(32),{publicKey:Se}=ks.box.keyPair.fromSecretKey(Ae);return{A:Se,k:Ae}}throw Error("Unsupported ECDH algorithm")},validateParams:async function(Ae,Se,Ce){if(Ae===nr.publicKey.x25519){const{publicKey:Ae}=ks.box.keyPair.fromSecretKey(Ce);return ar.equalsUint8Array(Se,Ae)}return!1},encrypt:async function(Ae,Se,Ce){if(Ae===nr.publicKey.x25519){const Ae=rn(32),qe=ks.scalarMult(Ae,Ce),{publicKey:Fe}=ks.box.keyPair.fromSecretKey(Ae),$e=ar.concatUint8Array([Fe,Ce,qe]),{keySize:rt}=hi(nr.symmetric.aes128);return{ephemeralPublicKey:Fe,wrappedKey:na(await ka(nr.hash.sha256,$e,new Uint8Array,Ra.x25519,rt),Se)}}throw Error("Unsupported ECDH algorithm")},decrypt:async function(Ae,Se,Ce,qe,Fe){if(Ae===nr.publicKey.x25519){const Ae=ks.scalarMult(Fe,Se),$e=ar.concatUint8Array([Se,qe,Ae]),{keySize:rt}=hi(nr.symmetric.aes128);return aa(await ka(nr.hash.sha256,$e,new Uint8Array,Ra.x25519,rt),Ce)}throw Error("Unsupported ECDH algorithm")}}),Ia=Object.freeze({__proto__:null,CurveWithOID:On,ecdh:Ea,ecdhX:Ba,ecdsa:fa,eddsaLegacy:ma,eddsa:va,generate:async function(Ae){const Se=await ar.getBigInteger();Ae=new On(Ae);const Ce=await Ae.genKeyPair(),qe=new Se(Ce.publicKey).toUint8Array(),Fe=new Se(Ce.privateKey).toUint8Array("be",Ae.payloadSize);return{oid:Ae.oid,Q:qe,secret:Fe,hash:Ae.hash,cipher:Ae.cipher}},getPreferredHashAlgo:function(Ae){return qs[nr.write(nr.curve,Ae.toHex())].hash}});var Oa=Object.freeze({__proto__:null,sign:async function(Ae,Se,Ce,qe,Fe,$e){const rt=await ar.getBigInteger(),it=new rt(1);let nt,st,ut,ht;qe=new rt(qe),Fe=new rt(Fe),Ce=new rt(Ce),$e=new rt($e),Ce=Ce.mod(qe),$e=$e.mod(Fe);const ft=new rt(Se.subarray(0,Fe.byteLength())).mod(Fe);for(;;){if(nt=await nn(it,Fe),st=Ce.modExp(nt,qe).imod(Fe),st.isZero())continue;const Ae=$e.mul(st).imod(Fe);if(ht=ft.add(Ae).imod(Fe),ut=nt.modInv(Fe).imul(ht).imod(Fe),!ut.isZero())break}return{r:st.toUint8Array("be",Fe.byteLength()),s:ut.toUint8Array("be",Fe.byteLength())}},verify:async function(Ae,Se,Ce,qe,Fe,$e,rt,it){const nt=await ar.getBigInteger(),st=new nt(0);if(Se=new nt(Se),Ce=new nt(Ce),$e=new nt($e),rt=new nt(rt),Fe=new nt(Fe),it=new nt(it),Se.lte(st)||Se.gte(rt)||Ce.lte(st)||Ce.gte(rt))return ar.printDebug("invalid DSA Signature"),!1;const ut=new nt(qe.subarray(0,rt.byteLength())).imod(rt),ht=Ce.modInv(rt);if(ht.isZero())return ar.printDebug("invalid DSA Signature"),!1;Fe=Fe.mod($e),it=it.mod($e);const ft=ut.mul(ht).imod(rt),yt=Se.mul(ht).imod(rt),vt=Fe.modExp(ft,$e),_t=it.modExp(yt,$e);return vt.mul(_t).imod($e).imod(rt).equal(Se)},validateParams:async function(Ae,Se,Ce,qe,Fe){const $e=await ar.getBigInteger();Ae=new $e(Ae),Se=new $e(Se),Ce=new $e(Ce),qe=new $e(qe);const rt=new $e(1);if(Ce.lte(rt)||Ce.gte(Ae))return!1;if(!Ae.dec().mod(Se).isZero())return!1;if(!Ce.modExp(Se,Ae).isOne())return!1;const it=new $e(Se.bitLength()),nt=new $e(150);if(it.lt(nt)||!await on(Se,null,32))return!1;Fe=new $e(Fe);const st=new $e(2),ut=await nn(st.leftShift(it.dec()),st.leftShift(it)),ht=Se.mul(ut).add(Fe);return!!qe.equal(Ce.modExp(ht,Ae))}}),Na={rsa:Ks,elgamal:Ts,elliptic:Ia,dsa:Oa,nacl:ks};var za=Object.freeze({__proto__:null,parseSignatureParams:function(Ae,Se){let Ce=0;switch(Ae){case nr.publicKey.rsaEncryptSign:case nr.publicKey.rsaEncrypt:case nr.publicKey.rsaSign:return{s:ar.readMPI(Se.subarray(Ce))};case nr.publicKey.dsa:case nr.publicKey.ecdsa:{const Ae=ar.readMPI(Se.subarray(Ce));Ce+=Ae.length+2;return{r:Ae,s:ar.readMPI(Se.subarray(Ce))}}case nr.publicKey.eddsaLegacy:{let Ae=ar.readMPI(Se.subarray(Ce));Ce+=Ae.length+2,Ae=ar.leftPad(Ae,32);let qe=ar.readMPI(Se.subarray(Ce));return qe=ar.leftPad(qe,32),{r:Ae,s:qe}}case nr.publicKey.ed25519:{const Ae=Se.subarray(Ce,Ce+64);return Ce+=Ae.length,{RS:Ae}}default:throw new Un("Unknown signature algorithm.")}},verify:async function(Ae,Se,Ce,qe,Fe,$e){switch(Ae){case nr.publicKey.rsaEncryptSign:case nr.publicKey.rsaEncrypt:case nr.publicKey.rsaSign:{const{n:Ae,e:rt}=qe,it=ar.leftPad(Ce.s,Ae.length);return Na.rsa.verify(Se,Fe,it,Ae,rt,$e)}case nr.publicKey.dsa:{const{g:Ae,p:Fe,q:rt,y:it}=qe,{r:nt,s:st}=Ce;return Na.dsa.verify(Se,nt,st,$e,Ae,Fe,rt,it)}case nr.publicKey.ecdsa:{const{oid:Ae,Q:rt}=qe,it=new Na.elliptic.CurveWithOID(Ae).payloadSize,nt=ar.leftPad(Ce.r,it),st=ar.leftPad(Ce.s,it);return Na.elliptic.ecdsa.verify(Ae,Se,{r:nt,s:st},Fe,rt,$e)}case nr.publicKey.eddsaLegacy:{const{oid:Ae,Q:rt}=qe;return Na.elliptic.eddsaLegacy.verify(Ae,Se,Ce,Fe,rt,$e)}case nr.publicKey.ed25519:{const{A:rt}=qe;return Na.elliptic.eddsa.verify(Ae,Se,Ce,Fe,rt,$e)}default:throw Error("Unknown signature algorithm.")}},sign:async function(Ae,Se,Ce,qe,Fe,$e){if(!Ce||!qe)throw Error("Missing key parameters");switch(Ae){case nr.publicKey.rsaEncryptSign:case nr.publicKey.rsaEncrypt:case nr.publicKey.rsaSign:{const{n:Ae,e:rt}=Ce,{d:it,p:nt,q:st,u:ut}=qe;return{s:await Na.rsa.sign(Se,Fe,Ae,rt,it,nt,st,ut,$e)}}case nr.publicKey.dsa:{const{g:Ae,p:Fe,q:rt}=Ce,{x:it}=qe;return Na.dsa.sign(Se,$e,Ae,Fe,rt,it)}case nr.publicKey.elgamal:throw Error("Signing with Elgamal is not defined in the OpenPGP standard.");case nr.publicKey.ecdsa:{const{oid:Ae,Q:rt}=Ce,{d:it}=qe;return Na.elliptic.ecdsa.sign(Ae,Se,Fe,rt,it,$e)}case nr.publicKey.eddsaLegacy:{const{oid:Ae,Q:rt}=Ce,{seed:it}=qe;return Na.elliptic.eddsaLegacy.sign(Ae,Se,Fe,rt,it,$e)}case nr.publicKey.ed25519:{const{A:rt}=Ce,{seed:it}=qe;return Na.elliptic.eddsa.sign(Ae,Se,Fe,rt,it,$e)}default:throw Error("Unknown signature algorithm.")}}});class Ka{constructor(Ae){Ae&&(this.data=Ae)}read(Ae){if(Ae.length>=1){const Se=Ae[0];if(Ae.length>=1+Se)return this.data=Ae.subarray(1,1+Se),1+this.data.length}throw Error("Invalid symmetric key")}write(){return ar.concatUint8Array([new Uint8Array([this.data.length]),this.data])}}class Ca{constructor(Ae){if(Ae){const{hash:Se,cipher:Ce}=Ae;this.hash=Se,this.cipher=Ce}else this.hash=null,this.cipher=null}read(Ae){if(Ae.length<4||3!==Ae[0]||1!==Ae[1])throw new Un("Cannot read KDFParams");return this.hash=Ae[2],this.cipher=Ae[3],4}write(){return new Uint8Array([3,1,this.hash,this.cipher])}}class Da{static fromObject({wrappedKey:Ae,algorithm:Se}){const Ce=new Da;return Ce.wrappedKey=Ae,Ce.algorithm=Se,Ce}read(Ae){let Se=0,Ce=Ae[Se++];this.algorithm=Ce%2?Ae[Se++]:null,Ce-=Ce%2,this.wrappedKey=Ae.subarray(Se,Se+Ce),Se+=Ce}write(){return ar.concatUint8Array([this.algorithm?new Uint8Array([this.wrappedKey.length+1,this.algorithm]):new Uint8Array([this.wrappedKey.length]),this.wrappedKey])}}function Ua(Ae){try{Ae.getName()}catch(Ae){throw new Un("Unknown curve OID")}}var ja=Object.freeze({__proto__:null,publicKeyEncrypt:async function(Ae,Se,Ce,qe,Fe){switch(Ae){case nr.publicKey.rsaEncrypt:case nr.publicKey.rsaEncryptSign:{const{n:Ae,e:Se}=Ce;return{c:await Na.rsa.encrypt(qe,Ae,Se)}}case nr.publicKey.elgamal:{const{p:Ae,g:Se,y:Fe}=Ce;return Na.elgamal.encrypt(qe,Ae,Se,Fe)}case nr.publicKey.ecdh:{const{oid:Ae,Q:Se,kdfParams:$e}=Ce,{publicKey:rt,wrappedKey:it}=await Na.elliptic.ecdh.encrypt(Ae,$e,qe,Se,Fe);return{V:rt,C:new Ka(it)}}case nr.publicKey.x25519:{if(!ar.isAES(Se))throw Error("X25519 keys can only encrypt AES session keys");const{A:Fe}=Ce,{ephemeralPublicKey:$e,wrappedKey:rt}=await Na.elliptic.ecdhX.encrypt(Ae,qe,Fe);return{ephemeralPublicKey:$e,C:Da.fromObject({algorithm:Se,wrappedKey:rt})}}default:return[]}},publicKeyDecrypt:async function(Ae,Se,Ce,qe,Fe,$e){switch(Ae){case nr.publicKey.rsaEncryptSign:case nr.publicKey.rsaEncrypt:{const{c:Ae}=qe,{n:Fe,e:rt}=Se,{d:it,p:nt,q:st,u:ut}=Ce;return Na.rsa.decrypt(Ae,Fe,rt,it,nt,st,ut,$e)}case nr.publicKey.elgamal:{const{c1:Ae,c2:Fe}=qe,rt=Se.p,it=Ce.x;return Na.elgamal.decrypt(Ae,Fe,rt,it,$e)}case nr.publicKey.ecdh:{const{oid:Ae,Q:$e,kdfParams:rt}=Se,{d:it}=Ce,{V:nt,C:st}=qe;return Na.elliptic.ecdh.decrypt(Ae,rt,nt,st.data,$e,it,Fe)}case nr.publicKey.x25519:{const{A:Fe}=Se,{k:$e}=Ce,{ephemeralPublicKey:rt,C:it}=qe;if(!ar.isAES(it.algorithm))throw Error("AES session key expected");return Na.elliptic.ecdhX.decrypt(Ae,rt,it.wrappedKey,Fe,$e)}default:throw Error("Unknown public key encryption algorithm.")}},parsePublicKeyParams:function(Ae,Se){let Ce=0;switch(Ae){case nr.publicKey.rsaEncrypt:case nr.publicKey.rsaEncryptSign:case nr.publicKey.rsaSign:{const Ae=ar.readMPI(Se.subarray(Ce));Ce+=Ae.length+2;const qe=ar.readMPI(Se.subarray(Ce));return Ce+=qe.length+2,{read:Ce,publicParams:{n:Ae,e:qe}}}case nr.publicKey.dsa:{const Ae=ar.readMPI(Se.subarray(Ce));Ce+=Ae.length+2;const qe=ar.readMPI(Se.subarray(Ce));Ce+=qe.length+2;const Fe=ar.readMPI(Se.subarray(Ce));Ce+=Fe.length+2;const $e=ar.readMPI(Se.subarray(Ce));return Ce+=$e.length+2,{read:Ce,publicParams:{p:Ae,q:qe,g:Fe,y:$e}}}case nr.publicKey.elgamal:{const Ae=ar.readMPI(Se.subarray(Ce));Ce+=Ae.length+2;const qe=ar.readMPI(Se.subarray(Ce));Ce+=qe.length+2;const Fe=ar.readMPI(Se.subarray(Ce));return Ce+=Fe.length+2,{read:Ce,publicParams:{p:Ae,g:qe,y:Fe}}}case nr.publicKey.ecdsa:{const Ae=new _n;Ce+=Ae.read(Se),Ua(Ae);const qe=ar.readMPI(Se.subarray(Ce));return Ce+=qe.length+2,{read:Ce,publicParams:{oid:Ae,Q:qe}}}case nr.publicKey.eddsaLegacy:{const Ae=new _n;Ce+=Ae.read(Se),Ua(Ae);let qe=ar.readMPI(Se.subarray(Ce));return Ce+=qe.length+2,qe=ar.leftPad(qe,33),{read:Ce,publicParams:{oid:Ae,Q:qe}}}case nr.publicKey.ecdh:{const Ae=new _n;Ce+=Ae.read(Se),Ua(Ae);const qe=ar.readMPI(Se.subarray(Ce));Ce+=qe.length+2;const Fe=new Ca;return Ce+=Fe.read(Se.subarray(Ce)),{read:Ce,publicParams:{oid:Ae,Q:qe,kdfParams:Fe}}}case nr.publicKey.ed25519:case nr.publicKey.x25519:{const Ae=Se.subarray(Ce,Ce+32);return Ce+=Ae.length,{read:Ce,publicParams:{A:Ae}}}default:throw new Un("Unknown public key encryption algorithm.")}},parsePrivateKeyParams:function(Ae,Se,Ce){let qe=0;switch(Ae){case nr.publicKey.rsaEncrypt:case nr.publicKey.rsaEncryptSign:case nr.publicKey.rsaSign:{const Ae=ar.readMPI(Se.subarray(qe));qe+=Ae.length+2;const Ce=ar.readMPI(Se.subarray(qe));qe+=Ce.length+2;const Fe=ar.readMPI(Se.subarray(qe));qe+=Fe.length+2;const $e=ar.readMPI(Se.subarray(qe));return qe+=$e.length+2,{read:qe,privateParams:{d:Ae,p:Ce,q:Fe,u:$e}}}case nr.publicKey.dsa:case nr.publicKey.elgamal:{const Ae=ar.readMPI(Se.subarray(qe));return qe+=Ae.length+2,{read:qe,privateParams:{x:Ae}}}case nr.publicKey.ecdsa:case nr.publicKey.ecdh:{const Ae=new On(Ce.oid);let Fe=ar.readMPI(Se.subarray(qe));return qe+=Fe.length+2,Fe=ar.leftPad(Fe,Ae.payloadSize),{read:qe,privateParams:{d:Fe}}}case nr.publicKey.eddsaLegacy:{const Ae=new On(Ce.oid);let Fe=ar.readMPI(Se.subarray(qe));return qe+=Fe.length+2,Fe=ar.leftPad(Fe,Ae.payloadSize),{read:qe,privateParams:{seed:Fe}}}case nr.publicKey.ed25519:{const Ae=Se.subarray(qe,qe+32);return qe+=Ae.length,{read:qe,privateParams:{seed:Ae}}}case nr.publicKey.x25519:{const Ae=Se.subarray(qe,qe+32);return qe+=Ae.length,{read:qe,privateParams:{k:Ae}}}default:throw new Un("Unknown public key encryption algorithm.")}},parseEncSessionKeyParams:function(Ae,Se){let Ce=0;switch(Ae){case nr.publicKey.rsaEncrypt:case nr.publicKey.rsaEncryptSign:return{c:ar.readMPI(Se.subarray(Ce))};case nr.publicKey.elgamal:{const Ae=ar.readMPI(Se.subarray(Ce));Ce+=Ae.length+2;return{c1:Ae,c2:ar.readMPI(Se.subarray(Ce))}}case nr.publicKey.ecdh:{const Ae=ar.readMPI(Se.subarray(Ce));Ce+=Ae.length+2;const qe=new Ka;return qe.read(Se.subarray(Ce)),{V:Ae,C:qe}}case nr.publicKey.x25519:{const Ae=Se.subarray(Ce,Ce+32);Ce+=Ae.length;const qe=new Da;return qe.read(Se.subarray(Ce)),{ephemeralPublicKey:Ae,C:qe}}default:throw new Un("Unknown public key encryption algorithm.")}},serializeParams:function(Ae,Se){const Ce=new Set([nr.publicKey.ed25519,nr.publicKey.x25519]),qe=Object.keys(Se).map((qe=>{const Fe=Se[qe];return ar.isUint8Array(Fe)?Ce.has(Ae)?Fe:ar.uint8ArrayToMPI(Fe):Fe.write()}));return ar.concatUint8Array(qe)},generateParams:function(Ae,Se,Ce){switch(Ae){case nr.publicKey.rsaEncrypt:case nr.publicKey.rsaEncryptSign:case nr.publicKey.rsaSign:return Na.rsa.generate(Se,65537).then((({n:Ae,e:Se,d:Ce,p:qe,q:Fe,u:$e})=>({privateParams:{d:Ce,p:qe,q:Fe,u:$e},publicParams:{n:Ae,e:Se}})));case nr.publicKey.ecdsa:return Na.elliptic.generate(Ce).then((({oid:Ae,Q:Se,secret:Ce})=>({privateParams:{d:Ce},publicParams:{oid:new _n(Ae),Q:Se}})));case nr.publicKey.eddsaLegacy:return Na.elliptic.generate(Ce).then((({oid:Ae,Q:Se,secret:Ce})=>({privateParams:{seed:Ce},publicParams:{oid:new _n(Ae),Q:Se}})));case nr.publicKey.ecdh:return Na.elliptic.generate(Ce).then((({oid:Ae,Q:Se,secret:Ce,hash:qe,cipher:Fe})=>({privateParams:{d:Ce},publicParams:{oid:new _n(Ae),Q:Se,kdfParams:new Ca({hash:qe,cipher:Fe})}})));case nr.publicKey.ed25519:return Na.elliptic.eddsa.generate(Ae).then((({A:Ae,seed:Se})=>({privateParams:{seed:Se},publicParams:{A:Ae}})));case nr.publicKey.x25519:return Na.elliptic.ecdhX.generate(Ae).then((({A:Ae,k:Se})=>({privateParams:{k:Se},publicParams:{A:Ae}})));case nr.publicKey.dsa:case nr.publicKey.elgamal:throw Error("Unsupported algorithm for key generation.");default:throw Error("Unknown public key algorithm.")}},validateParams:async function(Ae,Se,Ce){if(!Se||!Ce)throw Error("Missing key parameters");switch(Ae){case nr.publicKey.rsaEncrypt:case nr.publicKey.rsaEncryptSign:case nr.publicKey.rsaSign:{const{n:Ae,e:qe}=Se,{d:Fe,p:$e,q:rt,u:it}=Ce;return Na.rsa.validateParams(Ae,qe,Fe,$e,rt,it)}case nr.publicKey.dsa:{const{p:Ae,q:qe,g:Fe,y:$e}=Se,{x:rt}=Ce;return Na.dsa.validateParams(Ae,qe,Fe,$e,rt)}case nr.publicKey.elgamal:{const{p:Ae,g:qe,y:Fe}=Se,{x:$e}=Ce;return Na.elgamal.validateParams(Ae,qe,Fe,$e)}case nr.publicKey.ecdsa:case nr.publicKey.ecdh:{const qe=Na.elliptic[nr.read(nr.publicKey,Ae)],{oid:Fe,Q:$e}=Se,{d:rt}=Ce;return qe.validateParams(Fe,$e,rt)}case nr.publicKey.eddsaLegacy:{const{Q:Ae,oid:qe}=Se,{seed:Fe}=Ce;return Na.elliptic.eddsaLegacy.validateParams(qe,Ae,Fe)}case nr.publicKey.ed25519:{const{A:qe}=Se,{seed:Fe}=Ce;return Na.elliptic.eddsa.validateParams(Ae,qe,Fe)}case nr.publicKey.x25519:{const{A:qe}=Se,{k:Fe}=Ce;return Na.elliptic.ecdhX.validateParams(Ae,qe,Fe)}default:throw Error("Unknown public key algorithm.")}},getPrefixRandom:async function(Ae){const{blockSize:Se}=hi(Ae),Ce=await rn(Se),qe=new Uint8Array([Ce[Ce.length-2],Ce[Ce.length-1]]);return ar.concat([Ce,qe])},generateSessionKey:function(Ae){const{keySize:Se}=hi(Ae);return rn(Se)},getAEADMode:function(Ae){const Se=nr.read(nr.aead,Ae);return _s[Se]},getCipher:hi,getPreferredCurveHashAlgo:function(Ae,Se){switch(Ae){case nr.publicKey.ecdsa:case nr.publicKey.eddsaLegacy:return Na.elliptic.getPreferredHashAlgo(Se);case nr.publicKey.ed25519:return Na.elliptic.eddsa.getPreferredHashAlgo(Ae);default:throw Error("Unknown elliptic signing algo")}}});const qa={cipher:Ir,hash:zn,mode:_s,publicKey:Na,signature:za,random:Ss,pkcs1:Ps,pkcs5:_a,aesKW:wa};Object.assign(qa,ja);var Fa="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Int32Array;function Ta(Ae,Se){return Ae.length===Se?Ae:Ae.subarray?Ae.subarray(0,Se):(Ae.length=Se,Ae)}const La={arraySet:function(Ae,Se,Ce,qe,Fe){if(Se.subarray&&Ae.subarray)Ae.set(Se.subarray(Ce,Ce+qe),Fe);else for(let $e=0;$e=0;)Ae[Se]=0}const Do=0,Ko=1,Wo=2,Zo=29,Jo=256,ec=Jo+1+Zo,rc=30,ic=19,nc=2*ec+1,sc=15,ac=16,oc=7,cc=256,uc=16,hc=17,dc=18,lc=[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],pc=[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],yc=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],mc=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],gc=Array(2*(ec+2));fs(gc);const bc=Array(2*rc);fs(bc);const vc=Array(512);fs(vc);const wc=Array(256);fs(wc);const _c=Array(Zo);fs(_c);const kc=Array(rc);function Fs(Ae,Se,Ce,qe,Fe){this.static_tree=Ae,this.extra_bits=Se,this.extra_base=Ce,this.elems=qe,this.max_length=Fe,this.has_stree=Ae&&Ae.length}let Ac,Sc,Ec;function js(Ae,Se){this.dyn_tree=Ae,this.max_code=0,this.stat_desc=Se}function Hs(Ae){return Ae<256?vc[Ae]:vc[256+(Ae>>>7)]}function Ws(Ae,Se){Ae.pending_buf[Ae.pending++]=255&Se,Ae.pending_buf[Ae.pending++]=Se>>>8&255}function Gs(Ae,Se,Ce){Ae.bi_valid>ac-Ce?(Ae.bi_buf|=Se<>ac-Ae.bi_valid,Ae.bi_valid+=Ce-ac):(Ae.bi_buf|=Se<>>=1,Ce<<=1}while(--Se>0);return Ce>>>1}function Zs(Ae,Se,Ce){const qe=Array(sc+1);let Fe,$e,rt=0;for(Fe=1;Fe<=sc;Fe++)qe[Fe]=rt=rt+Ce[Fe-1]<<1;for($e=0;$e<=Se;$e++){const Se=Ae[2*$e+1];0!==Se&&(Ae[2*$e]=$s(qe[Se]++,Se))}}function Xs(Ae){let Se;for(Se=0;Se8?Ws(Ae,Ae.bi_buf):Ae.bi_valid>0&&(Ae.pending_buf[Ae.pending++]=Ae.bi_buf),Ae.bi_buf=0,Ae.bi_valid=0}function Qs(Ae,Se,Ce,qe){const Fe=2*Se,$e=2*Ce;return Ae[Fe]>1;rt>=1;rt--)Js(Ae,Ce,rt);nt=$e;do{rt=Ae.heap[1],Ae.heap[1]=Ae.heap[Ae.heap_len--],Js(Ae,Ce,1),it=Ae.heap[1],Ae.heap[--Ae.heap_max]=rt,Ae.heap[--Ae.heap_max]=it,Ce[2*nt]=Ce[2*rt]+Ce[2*it],Ae.depth[nt]=(Ae.depth[rt]>=Ae.depth[it]?Ae.depth[rt]:Ae.depth[it])+1,Ce[2*rt+1]=Ce[2*it+1]=nt,Ae.heap[1]=nt++,Js(Ae,Ce,1)}while(Ae.heap_len>=2);Ae.heap[--Ae.heap_max]=Ae.heap[1],function(Ae,Se){const Ce=Se.dyn_tree,qe=Se.max_code,Fe=Se.stat_desc.static_tree,$e=Se.stat_desc.has_stree,rt=Se.stat_desc.extra_bits,it=Se.stat_desc.extra_base,nt=Se.stat_desc.max_length;let st,ut,ht,ft,yt,vt,_t=0;for(ft=0;ft<=sc;ft++)Ae.bl_count[ft]=0;for(Ce[2*Ae.heap[Ae.heap_max]+1]=0,st=Ae.heap_max+1;stnt&&(ft=nt,_t++),Ce[2*ut+1]=ft,ut>qe||(Ae.bl_count[ft]++,yt=0,ut>=it&&(yt=rt[ut-it]),vt=Ce[2*ut],Ae.opt_len+=vt*(ft+yt),$e&&(Ae.static_len+=vt*(Fe[2*ut+1]+yt)));if(0!==_t){do{for(ft=nt-1;0===Ae.bl_count[ft];)ft--;Ae.bl_count[ft]--,Ae.bl_count[ft+1]+=2,Ae.bl_count[nt]--,_t-=2}while(_t>0);for(ft=nt;0!==ft;ft--)for(ut=Ae.bl_count[ft];0!==ut;)ht=Ae.heap[--st],ht>qe||(Ce[2*ht+1]!==ft&&(Ae.opt_len+=(ft-Ce[2*ht+1])*Ce[2*ht],Ce[2*ht+1]=ft),ut--)}}(Ae,Se),Zs(Ce,st,Ae.bl_count)}function ro(Ae,Se,Ce){let qe,Fe,$e=-1,rt=Se[1],it=0,nt=7,st=4;for(0===rt&&(nt=138,st=3),Se[2*(Ce+1)+1]=65535,qe=0;qe<=Ce;qe++)Fe=rt,rt=Se[2*(qe+1)+1],++it>=7;qe=8&&(Ae.pending_buf[Ae.pending++]=255&Ae.bi_buf,Ae.bi_buf>>=8,Ae.bi_valid-=8)}(Ae)}function co(Ae,Se,Ce,qe){let Fe,$e,rt=0;Ae.level>0?(Ae.strm.data_type===xo&&(Ae.strm.data_type=function(Ae){let Se,Ce=4093624447;for(Se=0;Se<=31;Se++,Ce>>>=1)if(1&Ce&&0!==Ae.dyn_ltree[2*Se])return Mo;if(0!==Ae.dyn_ltree[18]||0!==Ae.dyn_ltree[20]||0!==Ae.dyn_ltree[26])return Po;for(Se=32;Se=3&&0===Ae.bl_tree[2*mc[Se]+1];Se--);return Ae.opt_len+=3*(Se+1)+5+5+4,Se}(Ae),Fe=Ae.opt_len+3+7>>>3,$e=Ae.static_len+3+7>>>3,$e<=Fe&&(Fe=$e)):Fe=$e=Ce+5,Ce+4<=Fe&&-1!==Se?so(Ae,Se,Ce,qe):Ae.strategy===Eo||$e===Fe?(Gs(Ae,(Ko<<1)+(qe?1:0),3),eo(Ae,gc,bc)):(Gs(Ae,(Wo<<1)+(qe?1:0),3),function(Ae,Se,Ce,qe){let Fe;for(Gs(Ae,Se-257,5),Gs(Ae,Ce-1,5),Gs(Ae,qe-4,4),Fe=0;Fe>>8&255,Ae.pending_buf[Ae.d_buf+2*Ae.last_lit+1]=255&Se,Ae.pending_buf[Ae.l_buf+Ae.last_lit]=255&Ce,Ae.last_lit++,0===Se?Ae.dyn_ltree[2*Ce]++:(Ae.matches++,Se--,Ae.dyn_ltree[2*(wc[Ce]+Jo+1)]++,Ae.dyn_dtree[2*Hs(Se)]++),Ae.last_lit===Ae.lit_bufsize-1}function ho(Ae,Se,Ce,qe){let Fe=65535&Ae|0,$e=Ae>>>16&65535|0,rt=0;for(;0!==Ce;){rt=Ce>2e3?2e3:Ce,Ce-=rt;do{Fe=Fe+Se[qe++]|0,$e=$e+Fe|0}while(--rt);Fe%=65521,$e%=65521}return Fe|$e<<16|0}const Pc=function(){let Ae;const Se=[];for(let Ce=0;Ce<256;Ce++){Ae=Ce;for(let Se=0;Se<8;Se++)Ae=1&Ae?3988292384^Ae>>>1:Ae>>>1;Se[Ce]=Ae}return Se}();function lo(Ae,Se,Ce,qe){const Fe=Pc,$e=qe+Ce;Ae^=-1;for(let Ce=qe;Ce<$e;Ce++)Ae=Ae>>>8^Fe[255&(Ae^Se[Ce])];return-1^Ae}var xc={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"};const Cc=9,Dc=3,Rc=258,Bc=Rc+Dc+1,Kc=32,Tc=42,Uc=69,Ic=73,Oc=91,Nc=103,zc=113,jc=666,qc=1,Fc=2,Lc=3,Hc=4,Wc=3;function Uo(Ae,Se){return Ae.msg=xc[Se],Se}function Ro(Ae){return(Ae<<1)-(Ae>4?9:0)}function Io(Ae){let Se=Ae.length;for(;--Se>=0;)Ae[Se]=0}function Bo(Ae){const Se=Ae.state;let Ce=Se.pending;Ce>Ae.avail_out&&(Ce=Ae.avail_out),0!==Ce&&(Qa(Ae.output,Se.pending_buf,Se.pending_out,Ce,Ae.next_out),Ae.next_out+=Ce,Se.pending_out+=Ce,Ae.total_out+=Ce,Ae.avail_out-=Ce,Se.pending-=Ce,0===Se.pending&&(Se.pending_out=0))}function To(Ae,Se){co(Ae,Ae.block_start>=0?Ae.block_start:-1,Ae.strstart-Ae.block_start,Se),Ae.block_start=Ae.strstart,Bo(Ae.strm)}function zo(Ae,Se){Ae.pending_buf[Ae.pending++]=Se}function qo(Ae,Se){Ae.pending_buf[Ae.pending++]=Se>>>8&255,Ae.pending_buf[Ae.pending++]=255&Se}function Fo(Ae,Se,Ce,qe){let Fe=Ae.avail_in;return Fe>qe&&(Fe=qe),0===Fe?0:(Ae.avail_in-=Fe,Qa(Se,Ae.input,Ae.next_in,Fe,Ce),1===Ae.state.wrap?Ae.adler=ho(Ae.adler,Se,Fe,Ce):2===Ae.state.wrap&&(Ae.adler=lo(Ae.adler,Se,Fe,Ce)),Ae.next_in+=Fe,Ae.total_in+=Fe,Fe)}function Oo(Ae,Se){let Ce,qe,Fe=Ae.max_chain_length,$e=Ae.strstart,rt=Ae.prev_length,it=Ae.nice_match;const nt=Ae.strstart>Ae.w_size-Bc?Ae.strstart-(Ae.w_size-Bc):0,st=Ae.window,ut=Ae.w_mask,ht=Ae.prev,ft=Ae.strstart+Rc;let yt=st[$e+rt-1],vt=st[$e+rt];Ae.prev_length>=Ae.good_match&&(Fe>>=2),it>Ae.lookahead&&(it=Ae.lookahead);do{if(Ce=Se,st[Ce+rt]===vt&&st[Ce+rt-1]===yt&&st[Ce]===st[$e]&&st[++Ce]===st[$e+1]){$e+=2,Ce++;do{}while(st[++$e]===st[++Ce]&&st[++$e]===st[++Ce]&&st[++$e]===st[++Ce]&&st[++$e]===st[++Ce]&&st[++$e]===st[++Ce]&&st[++$e]===st[++Ce]&&st[++$e]===st[++Ce]&&st[++$e]===st[++Ce]&&$ert){if(Ae.match_start=Se,rt=qe,qe>=it)break;yt=st[$e+rt-1],vt=st[$e+rt]}}}while((Se=ht[Se&ut])>nt&&0!=--Fe);return rt<=Ae.lookahead?rt:Ae.lookahead}function Lo(Ae){const Se=Ae.w_size;let Ce,qe,Fe,$e,rt;do{if($e=Ae.window_size-Ae.lookahead-Ae.strstart,Ae.strstart>=Se+(Se-Bc)){Qa(Ae.window,Ae.window,Se,Se,0),Ae.match_start-=Se,Ae.strstart-=Se,Ae.block_start-=Se,qe=Ae.hash_size,Ce=qe;do{Fe=Ae.head[--Ce],Ae.head[Ce]=Fe>=Se?Fe-Se:0}while(--qe);qe=Se,Ce=qe;do{Fe=Ae.prev[--Ce],Ae.prev[Ce]=Fe>=Se?Fe-Se:0}while(--qe);$e+=Se}if(0===Ae.strm.avail_in)break;if(qe=Fo(Ae.strm,Ae.window,Ae.strstart+Ae.lookahead,$e),Ae.lookahead+=qe,Ae.lookahead+Ae.insert>=Dc)for(rt=Ae.strstart-Ae.insert,Ae.ins_h=Ae.window[rt],Ae.ins_h=(Ae.ins_h<=Dc&&(Ae.ins_h=(Ae.ins_h<=Dc)if(qe=uo(Ae,Ae.strstart-Ae.match_start,Ae.match_length-Dc),Ae.lookahead-=Ae.match_length,Ae.match_length<=Ae.max_lazy_match&&Ae.lookahead>=Dc){Ae.match_length--;do{Ae.strstart++,Ae.ins_h=(Ae.ins_h<=Dc&&(Ae.ins_h=(Ae.ins_h<4096)&&(Ae.match_length=Dc-1)),Ae.prev_length>=Dc&&Ae.match_length<=Ae.prev_length){Fe=Ae.strstart+Ae.lookahead-Dc,qe=uo(Ae,Ae.strstart-1-Ae.prev_match,Ae.prev_length-Dc),Ae.lookahead-=Ae.prev_length-1,Ae.prev_length-=2;do{++Ae.strstart<=Fe&&(Ae.ins_h=(Ae.ins_h<Ae.pending_buf_size-5&&(Ce=Ae.pending_buf_size-5);;){if(Ae.lookahead<=1){if(Lo(Ae),0===Ae.lookahead&&Se===Za)return qc;if(0===Ae.lookahead)break}Ae.strstart+=Ae.lookahead,Ae.lookahead=0;const qe=Ae.block_start+Ce;if((0===Ae.strstart||Ae.strstart>=qe)&&(Ae.lookahead=Ae.strstart-qe,Ae.strstart=qe,To(Ae,!1),0===Ae.strm.avail_out))return qc;if(Ae.strstart-Ae.block_start>=Ae.w_size-Bc&&(To(Ae,!1),0===Ae.strm.avail_out))return qc}return Ae.insert=0,Se===no?(To(Ae,!0),0===Ae.strm.avail_out?Lc:Hc):(Ae.strstart>Ae.block_start&&(To(Ae,!1),Ae.strm.avail_out),qc)})),new Ho(4,4,8,4,No),new Ho(4,5,16,8,No),new Ho(4,6,32,32,No),new Ho(4,4,16,16,jo),new Ho(8,16,32,32,jo),new Ho(8,16,128,128,jo),new Ho(8,32,128,256,jo),new Ho(32,128,258,1024,jo),new Ho(32,258,258,4096,jo)];class Go{constructor(){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=Co,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 Ga(1146),this.dyn_dtree=new Ga(122),this.bl_tree=new Ga(78),Io(this.dyn_ltree),Io(this.dyn_dtree),Io(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Ga(16),this.heap=new Ga(573),Io(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Ga(573),Io(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 Vo(Ae){const Se=function(Ae){let Se;return Ae&&Ae.state?(Ae.total_in=Ae.total_out=0,Ae.data_type=xo,Se=Ae.state,Se.pending=0,Se.pending_out=0,Se.wrap<0&&(Se.wrap=-Se.wrap),Se.status=Se.wrap?Tc:zc,Ae.adler=2===Se.wrap?0:1,Se.last_flush=Za,ao(Se),yo):Uo(Ae,bo)}(Ae);return Se===yo&&function(Ae){Ae.window_size=2*Ae.w_size,Io(Ae.head),Ae.max_lazy_match=Gc[Ae.level].max_lazy,Ae.good_match=Gc[Ae.level].good_length,Ae.nice_match=Gc[Ae.level].nice_length,Ae.max_chain_length=Gc[Ae.level].max_chain,Ae.strstart=0,Ae.block_start=0,Ae.lookahead=0,Ae.insert=0,Ae.match_length=Ae.prev_length=Dc-1,Ae.match_available=0,Ae.ins_h=0}(Ae.state),Se}function $o(Ae,Se){let Ce,qe,Fe,$e;if(!Ae||!Ae.state||Se>fo||Se<0)return Ae?Uo(Ae,bo):bo;if(qe=Ae.state,!Ae.output||!Ae.input&&0!==Ae.avail_in||qe.status===jc&&Se!==no)return Uo(Ae,0===Ae.avail_out?wo:bo);if(qe.strm=Ae,Ce=qe.last_flush,qe.last_flush=Se,qe.status===Tc)if(2===qe.wrap)Ae.adler=0,zo(qe,31),zo(qe,139),zo(qe,8),qe.gzhead?(zo(qe,(qe.gzhead.text?1:0)+(qe.gzhead.hcrc?2:0)+(qe.gzhead.extra?4:0)+(qe.gzhead.name?8:0)+(qe.gzhead.comment?16:0)),zo(qe,255&qe.gzhead.time),zo(qe,qe.gzhead.time>>8&255),zo(qe,qe.gzhead.time>>16&255),zo(qe,qe.gzhead.time>>24&255),zo(qe,9===qe.level?2:qe.strategy>=Ao||qe.level<2?4:0),zo(qe,255&qe.gzhead.os),qe.gzhead.extra&&qe.gzhead.extra.length&&(zo(qe,255&qe.gzhead.extra.length),zo(qe,qe.gzhead.extra.length>>8&255)),qe.gzhead.hcrc&&(Ae.adler=lo(Ae.adler,qe.pending_buf,qe.pending,0)),qe.gzindex=0,qe.status=Uc):(zo(qe,0),zo(qe,0),zo(qe,0),zo(qe,0),zo(qe,0),zo(qe,9===qe.level?2:qe.strategy>=Ao||qe.level<2?4:0),zo(qe,Wc),qe.status=zc);else{let Se=Co+(qe.w_bits-8<<4)<<8,Ce=-1;Ce=qe.strategy>=Ao||qe.level<2?0:qe.level<6?1:6===qe.level?2:3,Se|=Ce<<6,0!==qe.strstart&&(Se|=Kc),Se+=31-Se%31,qe.status=zc,qo(qe,Se),0!==qe.strstart&&(qo(qe,Ae.adler>>>16),qo(qe,65535&Ae.adler)),Ae.adler=1}if(qe.status===Uc)if(qe.gzhead.extra){for(Fe=qe.pending;qe.gzindex<(65535&qe.gzhead.extra.length)&&(qe.pending!==qe.pending_buf_size||(qe.gzhead.hcrc&&qe.pending>Fe&&(Ae.adler=lo(Ae.adler,qe.pending_buf,qe.pending-Fe,Fe)),Bo(Ae),Fe=qe.pending,qe.pending!==qe.pending_buf_size));)zo(qe,255&qe.gzhead.extra[qe.gzindex]),qe.gzindex++;qe.gzhead.hcrc&&qe.pending>Fe&&(Ae.adler=lo(Ae.adler,qe.pending_buf,qe.pending-Fe,Fe)),qe.gzindex===qe.gzhead.extra.length&&(qe.gzindex=0,qe.status=Ic)}else qe.status=Ic;if(qe.status===Ic)if(qe.gzhead.name){Fe=qe.pending;do{if(qe.pending===qe.pending_buf_size&&(qe.gzhead.hcrc&&qe.pending>Fe&&(Ae.adler=lo(Ae.adler,qe.pending_buf,qe.pending-Fe,Fe)),Bo(Ae),Fe=qe.pending,qe.pending===qe.pending_buf_size)){$e=1;break}$e=qe.gzindexFe&&(Ae.adler=lo(Ae.adler,qe.pending_buf,qe.pending-Fe,Fe)),0===$e&&(qe.gzindex=0,qe.status=Oc)}else qe.status=Oc;if(qe.status===Oc)if(qe.gzhead.comment){Fe=qe.pending;do{if(qe.pending===qe.pending_buf_size&&(qe.gzhead.hcrc&&qe.pending>Fe&&(Ae.adler=lo(Ae.adler,qe.pending_buf,qe.pending-Fe,Fe)),Bo(Ae),Fe=qe.pending,qe.pending===qe.pending_buf_size)){$e=1;break}$e=qe.gzindexFe&&(Ae.adler=lo(Ae.adler,qe.pending_buf,qe.pending-Fe,Fe)),0===$e&&(qe.status=Nc)}else qe.status=Nc;if(qe.status===Nc&&(qe.gzhead.hcrc?(qe.pending+2>qe.pending_buf_size&&Bo(Ae),qe.pending+2<=qe.pending_buf_size&&(zo(qe,255&Ae.adler),zo(qe,Ae.adler>>8&255),Ae.adler=0,qe.status=zc)):qe.status=zc),0!==qe.pending){if(Bo(Ae),0===Ae.avail_out)return qe.last_flush=-1,yo}else if(0===Ae.avail_in&&Ro(Se)<=Ro(Ce)&&Se!==no)return Uo(Ae,wo);if(qe.status===jc&&0!==Ae.avail_in)return Uo(Ae,wo);if(0!==Ae.avail_in||0!==qe.lookahead||Se!==Za&&qe.status!==jc){var rt=qe.strategy===Ao?function(Ae,Se){let Ce;for(;;){if(0===Ae.lookahead&&(Lo(Ae),0===Ae.lookahead)){if(Se===Za)return qc;break}if(Ae.match_length=0,Ce=uo(Ae,0,Ae.window[Ae.strstart]),Ae.lookahead--,Ae.strstart++,Ce&&(To(Ae,!1),0===Ae.strm.avail_out))return qc}return Ae.insert=0,Se===no?(To(Ae,!0),0===Ae.strm.avail_out?Lc:Hc):Ae.last_lit&&(To(Ae,!1),0===Ae.strm.avail_out)?qc:Fc}(qe,Se):qe.strategy===So?function(Ae,Se){let Ce,qe,Fe,$e;const rt=Ae.window;for(;;){if(Ae.lookahead<=Rc){if(Lo(Ae),Ae.lookahead<=Rc&&Se===Za)return qc;if(0===Ae.lookahead)break}if(Ae.match_length=0,Ae.lookahead>=Dc&&Ae.strstart>0&&(Fe=Ae.strstart-1,qe=rt[Fe],qe===rt[++Fe]&&qe===rt[++Fe]&&qe===rt[++Fe])){$e=Ae.strstart+Rc;do{}while(qe===rt[++Fe]&&qe===rt[++Fe]&&qe===rt[++Fe]&&qe===rt[++Fe]&&qe===rt[++Fe]&&qe===rt[++Fe]&&qe===rt[++Fe]&&qe===rt[++Fe]&&Fe<$e);Ae.match_length=Rc-($e-Fe),Ae.match_length>Ae.lookahead&&(Ae.match_length=Ae.lookahead)}if(Ae.match_length>=Dc?(Ce=uo(Ae,1,Ae.match_length-Dc),Ae.lookahead-=Ae.match_length,Ae.strstart+=Ae.match_length,Ae.match_length=0):(Ce=uo(Ae,0,Ae.window[Ae.strstart]),Ae.lookahead--,Ae.strstart++),Ce&&(To(Ae,!1),0===Ae.strm.avail_out))return qc}return Ae.insert=0,Se===no?(To(Ae,!0),0===Ae.strm.avail_out?Lc:Hc):Ae.last_lit&&(To(Ae,!1),0===Ae.strm.avail_out)?qc:Fc}(qe,Se):Gc[qe.level].func(qe,Se);if(rt!==Lc&&rt!==Hc||(qe.status=jc),rt===qc||rt===Lc)return 0===Ae.avail_out&&(qe.last_flush=-1),yo;if(rt===Fc&&(Se===Xa?oo(qe):Se!==fo&&(so(qe,0,0,!1),Se===Ja&&(Io(qe.head),0===qe.lookahead&&(qe.strstart=0,qe.block_start=0,qe.insert=0))),Bo(Ae),0===Ae.avail_out))return qe.last_flush=-1,yo}return Se!==no?yo:qe.wrap<=0?mo:(2===qe.wrap?(zo(qe,255&Ae.adler),zo(qe,Ae.adler>>8&255),zo(qe,Ae.adler>>16&255),zo(qe,Ae.adler>>24&255),zo(qe,255&Ae.total_in),zo(qe,Ae.total_in>>8&255),zo(qe,Ae.total_in>>16&255),zo(qe,Ae.total_in>>24&255)):(qo(qe,Ae.adler>>>16),qo(qe,65535&Ae.adler)),Bo(Ae),qe.wrap>0&&(qe.wrap=-qe.wrap),0!==qe.pending?yo:mo)}try{String.fromCharCode.call(null,0)}catch(qe){}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(qe){}const Vc=new Wa(256);for(let Ae=0;Ae<256;Ae++)Vc[Ae]=Ae>=252?6:Ae>=248?5:Ae>=240?4:Ae>=224?3:Ae>=192?2:1;function Xo(Ae){let Se,Ce,qe,Fe,$e=0;const rt=Ae.length;for(qe=0;qe>>6,it[Fe++]=128|63&Se):Se<65536?(it[Fe++]=224|Se>>>12,it[Fe++]=128|Se>>>6&63,it[Fe++]=128|63&Se):(it[Fe++]=240|Se>>>18,it[Fe++]=128|Se>>>12&63,it[Fe++]=128|Se>>>6&63,it[Fe++]=128|63&Se);return it}Vc[254]=Vc[254]=1;class Yo{constructor(){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}}class Qo{constructor(Ae){this.options={level:_o,method:Co,chunkSize:16384,windowBits:15,memLevel:8,strategy:0,...Ae||{}};const Se=this.options;Se.raw&&Se.windowBits>0?Se.windowBits=-Se.windowBits:Se.gzip&&Se.windowBits>0&&Se.windowBits<16&&(Se.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new Yo,this.strm.avail_out=0;var Ce,qe,Fe=function(Ae,Se,Ce,qe,Fe,$e){if(!Ae)return bo;let rt=1;if(Se===_o&&(Se=6),qe<0?(rt=0,qe=-qe):qe>15&&(rt=2,qe-=16),Fe<1||Fe>Cc||Ce!==Co||qe<8||qe>15||Se<0||Se>9||$e<0||$e>Eo)return Uo(Ae,bo);8===qe&&(qe=9);const it=new Go;return Ae.state=it,it.strm=Ae,it.wrap=rt,it.gzhead=null,it.w_bits=qe,it.w_size=1<=Ce.w_size&&(0===$e&&(Io(Ce.head),Ce.strstart=0,Ce.block_start=0,Ce.insert=0),st=new Wa(Ce.w_size),Qa(st,Se,ut-Ce.w_size,Ce.w_size,0),Se=st,ut=Ce.w_size),rt=Ae.avail_in,it=Ae.next_in,nt=Ae.input,Ae.avail_in=ut,Ae.next_in=0,Ae.input=Se,Lo(Ce);Ce.lookahead>=Dc;){qe=Ce.strstart,Fe=Ce.lookahead-(Dc-1);do{Ce.ins_h=(Ce.ins_h<0||0===Ce.avail_out)&&Fe!==mo);return $e===no?(Fe=function(Ae){let Se;return Ae&&Ae.state?(Se=Ae.state.status,Se!==Tc&&Se!==Uc&&Se!==Ic&&Se!==Oc&&Se!==Nc&&Se!==zc&&Se!==jc?Uo(Ae,bo):(Ae.state=null,Se===zc?Uo(Ae,vo):yo)):bo}(this.strm),this.onEnd(Fe),this.ended=!0,Fe===yo):$e!==Ya||(this.onEnd(yo),Ce.avail_out=0,!0)}onData(Ae){this.chunks.push(Ae)}onEnd(Ae){Ae===yo&&(this.result=Va(this.chunks)),this.chunks=[],this.err=Ae,this.msg=this.strm.msg}}const Qc=30,Jc=12;function tc(Ae,Se){let Ce,qe,Fe,$e,rt,it,nt,st,ut,ht;const ft=Ae.state;Ce=Ae.next_in;const yt=Ae.input,vt=Ce+(Ae.avail_in-5);qe=Ae.next_out;const _t=Ae.output,Ct=qe-(Se-Ae.avail_out),Rt=qe+(Ae.avail_out-257),Ut=ft.dmax,It=ft.wsize,Ot=ft.whave,Nt=ft.wnext,jt=ft.window;Fe=ft.hold,$e=ft.bits;const Ft=ft.lencode,Lt=ft.distcode,Ht=(1<>>24,Fe>>>=it,$e-=it,it=rt>>>16&255,0===it)_t[qe++]=65535&rt;else{if(!(16&it)){if(0==(64&it)){rt=Ft[(65535&rt)+(Fe&(1<>>=it,$e-=it),$e<15&&(Fe+=yt[Ce++]<<$e,$e+=8,Fe+=yt[Ce++]<<$e,$e+=8),rt=Lt[Fe&Wt];r:for(;;){if(it=rt>>>24,Fe>>>=it,$e-=it,it=rt>>>16&255,!(16&it)){if(0==(64&it)){rt=Lt[(65535&rt)+(Fe&(1<Ut){Ae.msg="invalid distance too far back",ft.mode=Qc;break e}if(Fe>>>=it,$e-=it,it=qe-Ct,st>it){if(it=st-it,it>Ot&&ft.sane){Ae.msg="invalid distance too far back",ft.mode=Qc;break e}if(ut=0,ht=jt,0===Nt){if(ut+=It-it,it2;)_t[qe++]=ht[ut++],_t[qe++]=ht[ut++],_t[qe++]=ht[ut++],nt-=3;nt&&(_t[qe++]=ht[ut++],nt>1&&(_t[qe++]=ht[ut++]))}else{ut=qe-st;do{_t[qe++]=_t[ut++],_t[qe++]=_t[ut++],_t[qe++]=_t[ut++],nt-=3}while(nt>2);nt&&(_t[qe++]=_t[ut++],nt>1&&(_t[qe++]=_t[ut++]))}break}}break}}while(Ce>3,Ce-=nt,$e-=nt<<3,Fe&=(1<<$e)-1,Ae.next_in=Ce,Ae.next_out=qe,Ae.avail_in=Ce=1&&0===Wt[Rt];Rt--);if(Ut>Rt&&(Ut=Rt),0===Rt)return Fe[$e++]=20971520,Fe[$e++]=20971520,it.bits=1,0;for(Ct=1;Ct0&&(Ae===du||1!==Rt))return-1;for(Gt[1]=0,vt=1;vtou||Ae===fu&&jt>uu)return 1;for(;;){$t=vt-Ot,rt[_t]yt?(Vt=Zt[Xt+rt[_t]],Qt=Lt[Ht+rt[_t]]):(Vt=96,Qt=0),st=1<>Ot)+ut]=$t<<24|Vt<<16|Qt|0}while(0!==ut);for(st=1<>=1;if(0!==st?(Ft&=st-1,Ft+=st):Ft=0,_t++,0==--Wt[vt]){if(vt===Rt)break;vt=Se[Ce+rt[_t]]}if(vt>Ut&&(Ft&er)!==ht){for(0===Ot&&(Ot=Ut),ft+=Ct,It=vt-Ot,Nt=1<ou||Ae===fu&&jt>uu)return 1;ht=Ft&er,Fe[ht]=Ut<<24|It<<16|ft-$e|0}}return 0!==Ft&&(Fe[ft+Ft]=vt-Ot<<24|64<<16|0),it.bits=Ut,0}const Cu=0,Uu=1,zu=2,qu=1,Fu=2,Lu=3,$u=4,eh=5,ih=6,Ah=7,Sh=8,Eh=9,Rh=10,Kh=11,Uh=12,Ih=13,jh=14,qh=15,Zh=16,Yh=17,Jh=18,ed=19,td=20,rd=21,id=22,ld=23,Ed=24,Md=25,Pd=26,xd=27,Cd=28,Kd=29,Zd=30,Yd=852,ul=592;function $c(Ae){return(Ae>>>24&255)+(Ae>>>8&65280)+((65280&Ae)<<8)+((255&Ae)<<24)}class Zc{constructor(){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 Ga(320),this.work=new Ga(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}}function Xc(Ae){let Se;return Ae&&Ae.state?(Se=Ae.state,Se.wsize=0,Se.whave=0,Se.wnext=0,function(Ae){let Se;return Ae&&Ae.state?(Se=Ae.state,Ae.total_in=Ae.total_out=Se.total=0,Ae.msg="",Se.wrap&&(Ae.adler=1&Se.wrap),Se.mode=qu,Se.last=0,Se.havedict=0,Se.dmax=32768,Se.head=null,Se.hold=0,Se.bits=0,Se.lencode=Se.lendyn=new $a(Yd),Se.distcode=Se.distdyn=new $a(ul),Se.sane=1,Se.back=-1,yo):bo}(Ae)):bo}function Yc(Ae,Se){let Ce,qe;return Ae?(qe=new Zc,Ae.state=qe,qe.window=null,Ce=function(Ae,Se){let Ce,qe;return Ae&&Ae.state?(qe=Ae.state,Se<0?(Ce=0,Se=-Se):(Ce=1+(Se>>4),Se<48&&(Se&=15)),Se&&(Se<8||Se>15)?bo:(null!==qe.window&&qe.wbits!==Se&&(qe.window=null),qe.wrap=Ce,qe.wbits=Se,Xc(Ae))):bo}(Ae,Se),Ce!==yo&&(Ae.state=null),Ce):bo}let Cl,Dl,ef=!0;function tu(Ae){if(ef){let Se;for(Cl=new $a(512),Dl=new $a(32),Se=0;Se<144;)Ae.lens[Se++]=8;for(;Se<256;)Ae.lens[Se++]=9;for(;Se<280;)Ae.lens[Se++]=7;for(;Se<288;)Ae.lens[Se++]=8;for(fc(Uu,Ae.lens,0,288,Cl,0,Ae.work,{bits:9}),Se=0;Se<32;)Ae.lens[Se++]=5;fc(zu,Ae.lens,0,32,Dl,0,Ae.work,{bits:5}),ef=!1}Ae.lencode=Cl,Ae.lenbits=9,Ae.distcode=Dl,Ae.distbits=5}function ru(Ae,Se,Ce,qe){let Fe;const $e=Ae.state;return null===$e.window&&($e.wsize=1<<$e.wbits,$e.wnext=0,$e.whave=0,$e.window=new Wa($e.wsize)),qe>=$e.wsize?(Qa($e.window,Se,Ce-$e.wsize,$e.wsize,0),$e.wnext=0,$e.whave=$e.wsize):(Fe=$e.wsize-$e.wnext,Fe>qe&&(Fe=qe),Qa($e.window,Se,Ce-qe,Fe,$e.wnext),(qe-=Fe)?(Qa($e.window,Se,Ce-qe,qe,0),$e.wnext=qe,$e.whave=$e.wsize):($e.wnext+=Fe,$e.wnext===$e.wsize&&($e.wnext=0),$e.whave<$e.wsize&&($e.whave+=Fe))),0}function iu(Ae,Se){let Ce,qe,Fe,$e,rt,it,nt,st,ut,ht,ft,yt,vt,_t,Ct,Rt,Ut,It,Ot,Nt,jt,Ft,Lt,Ht,Wt=0,Gt=new Wa(4);const $t=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!Ae||!Ae.state||!Ae.output||!Ae.input&&0!==Ae.avail_in)return bo;Ce=Ae.state,Ce.mode===Uh&&(Ce.mode=Ih),rt=Ae.next_out,Fe=Ae.output,nt=Ae.avail_out,$e=Ae.next_in,qe=Ae.input,it=Ae.avail_in,st=Ce.hold,ut=Ce.bits,ht=it,ft=nt,Ft=yo;e:for(;;)switch(Ce.mode){case qu:if(0===Ce.wrap){Ce.mode=Ih;break}for(;ut<16;){if(0===it)break e;it--,st+=qe[$e++]<>>8&255,Ce.check=lo(Ce.check,Gt,2,0),st=0,ut=0,Ce.mode=Fu;break}if(Ce.flags=0,Ce.head&&(Ce.head.done=!1),!(1&Ce.wrap)||(((255&st)<<8)+(st>>8))%31){Ae.msg="incorrect header check",Ce.mode=Zd;break}if((15&st)!==Co){Ae.msg="unknown compression method",Ce.mode=Zd;break}if(st>>>=4,ut-=4,jt=8+(15&st),0===Ce.wbits)Ce.wbits=jt;else if(jt>Ce.wbits){Ae.msg="invalid window size",Ce.mode=Zd;break}Ce.dmax=1<>8&1),512&Ce.flags&&(Gt[0]=255&st,Gt[1]=st>>>8&255,Ce.check=lo(Ce.check,Gt,2,0)),st=0,ut=0,Ce.mode=Lu;case Lu:for(;ut<32;){if(0===it)break e;it--,st+=qe[$e++]<>>8&255,Gt[2]=st>>>16&255,Gt[3]=st>>>24&255,Ce.check=lo(Ce.check,Gt,4,0)),st=0,ut=0,Ce.mode=$u;case $u:for(;ut<16;){if(0===it)break e;it--,st+=qe[$e++]<>8),512&Ce.flags&&(Gt[0]=255&st,Gt[1]=st>>>8&255,Ce.check=lo(Ce.check,Gt,2,0)),st=0,ut=0,Ce.mode=eh;case eh:if(1024&Ce.flags){for(;ut<16;){if(0===it)break e;it--,st+=qe[$e++]<>>8&255,Ce.check=lo(Ce.check,Gt,2,0)),st=0,ut=0}else Ce.head&&(Ce.head.extra=null);Ce.mode=ih;case ih:if(1024&Ce.flags&&(yt=Ce.length,yt>it&&(yt=it),yt&&(Ce.head&&(jt=Ce.head.extra_len-Ce.length,Ce.head.extra||(Ce.head.extra=Array(Ce.head.extra_len)),Qa(Ce.head.extra,qe,$e,yt,jt)),512&Ce.flags&&(Ce.check=lo(Ce.check,qe,yt,$e)),it-=yt,$e+=yt,Ce.length-=yt),Ce.length))break e;Ce.length=0,Ce.mode=Ah;case Ah:if(2048&Ce.flags){if(0===it)break e;yt=0;do{jt=qe[$e+yt++],Ce.head&&jt&&Ce.length<65536&&(Ce.head.name+=String.fromCharCode(jt))}while(jt&&yt>9&1,Ce.head.done=!0),Ae.adler=Ce.check=0,Ce.mode=Uh;break;case Rh:for(;ut<32;){if(0===it)break e;it--,st+=qe[$e++]<>>=7&ut,ut-=7&ut,Ce.mode=xd;break}for(;ut<3;){if(0===it)break e;it--,st+=qe[$e++]<>>=1,ut-=1,3&st){case 0:Ce.mode=jh;break;case 1:if(tu(Ce),Ce.mode=td,Se===po){st>>>=2,ut-=2;break e}break;case 2:Ce.mode=Yh;break;case 3:Ae.msg="invalid block type",Ce.mode=Zd}st>>>=2,ut-=2;break;case jh:for(st>>>=7&ut,ut-=7&ut;ut<32;){if(0===it)break e;it--,st+=qe[$e++]<>>16^65535)){Ae.msg="invalid stored block lengths",Ce.mode=Zd;break}if(Ce.length=65535&st,st=0,ut=0,Ce.mode=qh,Se===po)break e;case qh:Ce.mode=Zh;case Zh:if(yt=Ce.length,yt){if(yt>it&&(yt=it),yt>nt&&(yt=nt),0===yt)break e;Qa(Fe,qe,$e,yt,rt),it-=yt,$e+=yt,nt-=yt,rt+=yt,Ce.length-=yt;break}Ce.mode=Uh;break;case Yh:for(;ut<14;){if(0===it)break e;it--,st+=qe[$e++]<>>=5,ut-=5,Ce.ndist=1+(31&st),st>>>=5,ut-=5,Ce.ncode=4+(15&st),st>>>=4,ut-=4,Ce.nlen>286||Ce.ndist>30){Ae.msg="too many length or distance symbols",Ce.mode=Zd;break}Ce.have=0,Ce.mode=Jh;case Jh:for(;Ce.have>>=3,ut-=3}for(;Ce.have<19;)Ce.lens[$t[Ce.have++]]=0;if(Ce.lencode=Ce.lendyn,Ce.lenbits=7,Lt={bits:Ce.lenbits},Ft=fc(Cu,Ce.lens,0,19,Ce.lencode,0,Ce.work,Lt),Ce.lenbits=Lt.bits,Ft){Ae.msg="invalid code lengths set",Ce.mode=Zd;break}Ce.have=0,Ce.mode=ed;case ed:for(;Ce.have>>24,Rt=Wt>>>16&255,Ut=65535&Wt,!(Ct<=ut);){if(0===it)break e;it--,st+=qe[$e++]<>>=Ct,ut-=Ct,Ce.lens[Ce.have++]=Ut;else{if(16===Ut){for(Ht=Ct+2;ut>>=Ct,ut-=Ct,0===Ce.have){Ae.msg="invalid bit length repeat",Ce.mode=Zd;break}jt=Ce.lens[Ce.have-1],yt=3+(3&st),st>>>=2,ut-=2}else if(17===Ut){for(Ht=Ct+3;ut>>=Ct,ut-=Ct,jt=0,yt=3+(7&st),st>>>=3,ut-=3}else{for(Ht=Ct+7;ut>>=Ct,ut-=Ct,jt=0,yt=11+(127&st),st>>>=7,ut-=7}if(Ce.have+yt>Ce.nlen+Ce.ndist){Ae.msg="invalid bit length repeat",Ce.mode=Zd;break}for(;yt--;)Ce.lens[Ce.have++]=jt}}if(Ce.mode===Zd)break;if(0===Ce.lens[256]){Ae.msg="invalid code -- missing end-of-block",Ce.mode=Zd;break}if(Ce.lenbits=9,Lt={bits:Ce.lenbits},Ft=fc(Uu,Ce.lens,0,Ce.nlen,Ce.lencode,0,Ce.work,Lt),Ce.lenbits=Lt.bits,Ft){Ae.msg="invalid literal/lengths set",Ce.mode=Zd;break}if(Ce.distbits=6,Ce.distcode=Ce.distdyn,Lt={bits:Ce.distbits},Ft=fc(zu,Ce.lens,Ce.nlen,Ce.ndist,Ce.distcode,0,Ce.work,Lt),Ce.distbits=Lt.bits,Ft){Ae.msg="invalid distances set",Ce.mode=Zd;break}if(Ce.mode=td,Se===po)break e;case td:Ce.mode=rd;case rd:if(it>=6&&nt>=258){Ae.next_out=rt,Ae.avail_out=nt,Ae.next_in=$e,Ae.avail_in=it,Ce.hold=st,Ce.bits=ut,tc(Ae,ft),rt=Ae.next_out,Fe=Ae.output,nt=Ae.avail_out,$e=Ae.next_in,qe=Ae.input,it=Ae.avail_in,st=Ce.hold,ut=Ce.bits,Ce.mode===Uh&&(Ce.back=-1);break}for(Ce.back=0;Wt=Ce.lencode[st&(1<>>24,Rt=Wt>>>16&255,Ut=65535&Wt,!(Ct<=ut);){if(0===it)break e;it--,st+=qe[$e++]<>It)],Ct=Wt>>>24,Rt=Wt>>>16&255,Ut=65535&Wt,!(It+Ct<=ut);){if(0===it)break e;it--,st+=qe[$e++]<>>=It,ut-=It,Ce.back+=It}if(st>>>=Ct,ut-=Ct,Ce.back+=Ct,Ce.length=Ut,0===Rt){Ce.mode=Pd;break}if(32&Rt){Ce.back=-1,Ce.mode=Uh;break}if(64&Rt){Ae.msg="invalid literal/length code",Ce.mode=Zd;break}Ce.extra=15&Rt,Ce.mode=id;case id:if(Ce.extra){for(Ht=Ce.extra;ut>>=Ce.extra,ut-=Ce.extra,Ce.back+=Ce.extra}Ce.was=Ce.length,Ce.mode=ld;case ld:for(;Wt=Ce.distcode[st&(1<>>24,Rt=Wt>>>16&255,Ut=65535&Wt,!(Ct<=ut);){if(0===it)break e;it--,st+=qe[$e++]<>It)],Ct=Wt>>>24,Rt=Wt>>>16&255,Ut=65535&Wt,!(It+Ct<=ut);){if(0===it)break e;it--,st+=qe[$e++]<>>=It,ut-=It,Ce.back+=It}if(st>>>=Ct,ut-=Ct,Ce.back+=Ct,64&Rt){Ae.msg="invalid distance code",Ce.mode=Zd;break}Ce.offset=Ut,Ce.extra=15&Rt,Ce.mode=Ed;case Ed:if(Ce.extra){for(Ht=Ce.extra;ut>>=Ce.extra,ut-=Ce.extra,Ce.back+=Ce.extra}if(Ce.offset>Ce.dmax){Ae.msg="invalid distance too far back",Ce.mode=Zd;break}Ce.mode=Md;case Md:if(0===nt)break e;if(yt=ft-nt,Ce.offset>yt){if(yt=Ce.offset-yt,yt>Ce.whave&&Ce.sane){Ae.msg="invalid distance too far back",Ce.mode=Zd;break}yt>Ce.wnext?(yt-=Ce.wnext,vt=Ce.wsize-yt):vt=Ce.wnext-yt,yt>Ce.length&&(yt=Ce.length),_t=Ce.window}else _t=Fe,vt=rt-Ce.offset,yt=Ce.length;yt>nt&&(yt=nt),nt-=yt,Ce.length-=yt;do{Fe[rt++]=_t[vt++]}while(--yt);0===Ce.length&&(Ce.mode=rd);break;case Pd:if(0===nt)break e;Fe[rt++]=Ce.length,nt--,Ce.mode=rd;break;case xd:if(Ce.wrap){for(;ut<32;){if(0===it)break e;it--,st|=qe[$e++]<=0&&Se.windowBits<16&&(Se.windowBits=-Se.windowBits,0===Se.windowBits&&(Se.windowBits=-15)),!(Se.windowBits>=0&&Se.windowBits<16)||Ae&&Ae.windowBits||(Se.windowBits+=32),Se.windowBits>15&&Se.windowBits<48&&0==(15&Se.windowBits)&&(Se.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new Yo,this.strm.avail_out=0;let Ce=Yc(this.strm,Se.windowBits);if(Ce!==yo)throw Error(xc[Ce]);if(this.header=new au,function(Ae,Se){let Ce;Ae&&Ae.state&&(Ce=Ae.state,0==(2&Ce.wrap)||(Ce.head=Se,Se.done=!1))}(this.strm,this.header),Se.dictionary&&("string"==typeof Se.dictionary?Se.dictionary=Xo(Se.dictionary):Se.dictionary instanceof ArrayBuffer&&(Se.dictionary=new Uint8Array(Se.dictionary)),Se.raw&&(Ce=nu(this.strm,Se.dictionary),Ce!==yo)))throw Error(xc[Ce])}push(Ae,Se){const{strm:Ce,options:{chunkSize:qe,dictionary:Fe}}=this;let $e,rt,it=!1;if(this.ended)return!1;rt=Se===~~Se?Se:!0===Se?no:Za,"string"==typeof Ae?Ce.input=function(Ae){const Se=new Wa(Ae.length);for(let Ce=0,qe=Se.length;Ce0||0===Ce.avail_out)&&$e!==mo);return $e===mo&&(rt=no),rt===no?($e=function(Ae){if(!Ae||!Ae.state)return bo;const Se=Ae.state;return Se.window&&(Se.window=null),Ae.state=null,yo}(this.strm),this.onEnd($e),this.ended=!0,$e===yo):rt!==Ya||(this.onEnd(yo),Ce.avail_out=0,!0)}onData(Ae){this.chunks.push(Ae)}onEnd(Ae){Ae===yo&&(this.result=Va(this.chunks)),this.chunks=[],this.err=Ae,this.msg=this.strm.msg}}var Cp=[0,1,3,7,15,31,63,127,255],cu=function(Ae){this.stream=Ae,this.bitOffset=0,this.curByte=0,this.hasByte=!1};cu.prototype._ensureByte=function(){this.hasByte||(this.curByte=this.stream.readByte(),this.hasByte=!0)},cu.prototype.read=function(Ae){for(var Se=0;Ae>0;){this._ensureByte();var Ce=8-this.bitOffset;if(Ae>=Ce)Se<<=Ce,Se|=Cp[Ce]&this.curByte,this.hasByte=!1,this.bitOffset=0,Ae-=Ce;else{Se<<=Ae;var qe=Ce-Ae;Se|=(this.curByte&Cp[Ae]<>qe,this.bitOffset+=Ae,Ae=0}}return Se},cu.prototype.seek=function(Ae){var Se=Ae%8,Ce=(Ae-Se)/8;this.bitOffset=Se,this.stream.seek(Ce),this.hasByte=!1},cu.prototype.pi=function(){var Ae,Se=new Uint8Array(6);for(Ae=0;Ae("00"+Ae.toString(16)).slice(-2))).join("")}(Se)};var jp=cu,hu=function(){};hu.prototype.readByte=function(){throw Error("abstract method readByte() not implemented")},hu.prototype.read=function(Ae,Se,Ce){for(var qe=0;qe>>0},this.updateCRC=function(Se){Ae=Ae<<8^Hp[255&(Ae>>>24^Se)]},this.updateCRCRun=function(Se,Ce){for(;Ce-- >0;)Ae=Ae<<8^Hp[255&(Ae>>>24^Se)]}}),pu=function(Ae,Se){var Ce,qe=Ae[Se];for(Ce=Se;Ce>0;Ce--)Ae[Ce]=Ae[Ce-1];return Ae[0]=qe,qe},Qp={OK:0,LAST_BLOCK:-1,NOT_BZIP_DATA:-2,UNEXPECTED_INPUT_EOF:-3,UNEXPECTED_OUTPUT_EOF:-4,DATA_ERROR:-5,OUT_OF_MEMORY:-6,OBSOLETE_INPUT:-7,END_OF_BLOCK:-8},Xp={};Xp[Qp.LAST_BLOCK]="Bad file checksum",Xp[Qp.NOT_BZIP_DATA]="Not bzip data",Xp[Qp.UNEXPECTED_INPUT_EOF]="Unexpected input EOF",Xp[Qp.UNEXPECTED_OUTPUT_EOF]="Unexpected output EOF",Xp[Qp.DATA_ERROR]="Data error",Xp[Qp.OUT_OF_MEMORY]="Out of memory",Xp[Qp.OBSOLETE_INPUT]="Obsolete (pre 0.9.5) bzip format not supported.";var gu=function(Ae,Se){var Ce=Xp[Ae]||"unknown error";Se&&(Ce+=": "+Se);var qe=new TypeError(Ce);throw qe.errorCode=Ae,qe},mu=function(Ae,Se){this.writePos=this.writeCurrent=this.writeCount=0,this._start_bunzip(Ae,Se)};mu.prototype._init_block=function(){return this._get_next_block()?(this.blockCRC=new $p,!0):(this.writeCount=-1,!1)},mu.prototype._start_bunzip=function(Ae,Se){var Ce=new Uint8Array(4);4===Ae.read(Ce,0,4)&&"BZh"===String.fromCharCode(Ce[0],Ce[1],Ce[2])||gu(Qp.NOT_BZIP_DATA,"bad magic");var qe=Ce[3]-48;(qe<1||qe>9)&&gu(Qp.NOT_BZIP_DATA,"level out of range"),this.reader=new jp(Ae),this.dbufSize=1e5*qe,this.nextoutput=0,this.outputStream=Se,this.streamCRC=0},mu.prototype._get_next_block=function(){var Ae,Se,Ce,qe=this.reader,Fe=qe.pi();if("177245385090"===Fe)return!1;"314159265359"!==Fe&&gu(Qp.NOT_BZIP_DATA),this.targetBlockCRC=qe.read(32)>>>0,this.streamCRC=(this.targetBlockCRC^(this.streamCRC<<1|this.streamCRC>>>31))>>>0,qe.read(1)&&gu(Qp.OBSOLETE_INPUT);var $e=qe.read(24);$e>this.dbufSize&&gu(Qp.DATA_ERROR,"initial position out of bounds");var rt=qe.read(16),it=new Uint8Array(256),nt=0;for(Ae=0;Ae<16;Ae++)if(rt&1<<15-Ae){var st=16*Ae;for(Ce=qe.read(16),Se=0;Se<16;Se++)Ce&1<<15-Se&&(it[nt++]=st+Se)}var ut=qe.read(3);(ut<2||ut>6)&&gu(Qp.DATA_ERROR);var ht=qe.read(15);0===ht&&gu(Qp.DATA_ERROR);var ft=new Uint8Array(256);for(Ae=0;Ae=ut&&gu(Qp.DATA_ERROR);yt[Ae]=pu(ft,Se)}var vt,_t=nt+2,Ct=[];for(Se=0;Se20)&&gu(Qp.DATA_ERROR),qe.read(1);)qe.read(1)?rt--:rt++;It[Ae]=rt}for(Rt=Ut=It[0],Ae=1;Ae<_t;Ae++)It[Ae]>Ut?Ut=It[Ae]:It[Ae]=ht&&gu(Qp.DATA_ERROR),vt=Ct[yt[Wt++]]),Ae=vt.minLen,Se=qe.read(Ae);Ae>vt.maxLen&&gu(Qp.DATA_ERROR),!(Se<=vt.limit[Ae]);Ae++)Se=Se<<1|qe.read(1);((Se-=vt.base[Ae])<0||Se>=258)&&gu(Qp.DATA_ERROR);var $t=vt.permute[Se];if(0!==$t&&1!==$t){if(Lt)for(Lt=0,Ht+rt>this.dbufSize&&gu(Qp.DATA_ERROR),jt[Ft=it[ft[0]]]+=rt;rt--;)Gt[Ht++]=Ft;if($t>nt)break;Ht>=this.dbufSize&&gu(Qp.DATA_ERROR),jt[Ft=it[Ft=pu(ft,Ae=$t-1)]]++,Gt[Ht++]=Ft}else Lt||(Lt=1,rt=0),rt+=0===$t?Lt:2*Lt,Lt<<=1}for(($e<0||$e>=Ht)&&gu(Qp.DATA_ERROR),Se=0,Ae=0;Ae<256;Ae++)Ce=Se+jt[Ae],jt[Ae]=Se,Se=Ce;for(Ae=0;Ae>=8,Zt=-1),this.writePos=Vt,this.writeCurrent=Qt,this.writeCount=Ht,this.writeRun=Zt,!0},mu.prototype._read_bunzip=function(Ae,Se){var Ce,qe,Fe;if(this.writeCount<0)return 0;var $e=this.dbuf,rt=this.writePos,it=this.writeCurrent,nt=this.writeCount;this.outputsize;for(var st=this.writeRun;nt;){for(nt--,qe=it,it=255&(rt=$e[rt]),rt>>=8,3==st++?(Ce=it,Fe=qe,it=-1):(Ce=1,Fe=it),this.blockCRC.updateCRCRun(Fe,Ce);Ce--;)this.outputStream.writeByte(Fe),this.nextoutput++;it!=qe&&(st=0)}return this.writeCount=nt,this.blockCRC.getCRC()!==this.targetBlockCRC&&gu(Qp.DATA_ERROR,"Bad block CRC (got "+this.blockCRC.getCRC().toString(16)+" expected "+this.targetBlockCRC.toString(16)+")"),this.nextoutput};var wu=function(Ae){if("readByte"in Ae)return Ae;var Se=new Gp;return Se.pos=0,Se.readByte=function(){return Ae[this.pos++]},Se.seek=function(Ae){this.pos=Ae},Se.eof=function(){return this.pos>=Ae.length},Se},vu=function(Ae){var Se=new Gp,Ce=!0;if(Ae)if("number"==typeof Ae)Se.buffer=new Uint8Array(Ae),Ce=!1;else{if("writeByte"in Ae)return Ae;Se.buffer=Ae,Ce=!1}else Se.buffer=new Uint8Array(16384);return Se.pos=0,Se.writeByte=function(Ae){if(Ce&&this.pos>=this.buffer.length){var Se=new Uint8Array(2*this.buffer.length);Se.set(this.buffer),this.buffer=Se}this.buffer[this.pos++]=Ae},Se.getBuffer=function(){if(this.pos!==this.buffer.length){if(!Ce)throw new TypeError("outputsize does not match decoded input");var Ae=new Uint8Array(this.pos);Ae.set(this.buffer.subarray(0,this.pos)),this.buffer=Ae}return this.buffer},Se._coerced=!0,Se};var _u=function(Ae,Se,Ce){for(var qe=wu(Ae),Fe=vu(Se),$e=new mu(qe,Fe);!("eof"in qe)||!qe.eof();)if($e._init_block())$e._read_bunzip();else{var rt=$e.reader.read(32)>>>0;if(rt!==$e.streamCRC&&gu(Qp.DATA_ERROR,"Bad stream CRC (got "+$e.streamCRC.toString(16)+" expected "+rt.toString(16)+")"),!Ce||!("eof"in qe)||qe.eof())break;$e._start_bunzip(qe,Fe)}if("getBuffer"in Fe)return Fe.getBuffer()};class ku{static get tag(){return nr.packet.literalData}constructor(Ae=new Date){this.format=nr.literal.utf8,this.date=ar.normalizeDate(Ae),this.text=null,this.data=null,this.filename=""}setText(Ae,Se=nr.literal.utf8){this.format=Se,this.text=Ae,this.data=null}getText(Ae=!1){return(null===this.text||ar.isStream(this.text))&&(this.text=ar.decodeUTF8(ar.nativeEOL(this.getBytes(Ae)))),this.text}setBytes(Ae,Se){this.format=Se,this.data=Ae,this.text=null}getBytes(Ae=!1){return null===this.data&&(this.data=ar.canonicalizeEOL(ar.encodeUTF8(this.text))),Ae?ee(this.data):this.data}setFilename(Ae){this.filename=Ae}getFilename(){return this.filename}async read(Ae){await Q(Ae,(async Ae=>{const Se=await Ae.readByte(),Ce=await Ae.readByte();this.filename=ar.decodeUTF8(await Ae.readBytes(Ce)),this.date=ar.readDate(await Ae.readBytes(4));let qe=Ae.remainder();_(qe)&&(qe=await ie(qe)),this.setBytes(qe,Se)}))}writeHeader(){const Ae=ar.encodeUTF8(this.filename),Se=new Uint8Array([Ae.length]),Ce=new Uint8Array([this.format]),qe=ar.writeDate(this.date);return ar.concatUint8Array([Ce,Se,Ae,qe])}write(){const Ae=this.writeHeader(),Se=this.getBytes();return ar.concat([Ae,Se])}}const Yp=Symbol("verified"),Jp=new Set([nr.signatureSubpacket.issuer,nr.signatureSubpacket.issuerFingerprint,nr.signatureSubpacket.embeddedSignature]);class Eu{static get tag(){return nr.packet.signature}constructor(){this.version=null,this.signatureType=null,this.hashAlgorithm=null,this.publicKeyAlgorithm=null,this.signatureData=null,this.unhashedSubpackets=[],this.signedHashValue=null,this.created=null,this.signatureExpirationTime=null,this.signatureNeverExpires=!0,this.exportable=null,this.trustLevel=null,this.trustAmount=null,this.regularExpression=null,this.revocable=null,this.keyExpirationTime=null,this.keyNeverExpires=null,this.preferredSymmetricAlgorithms=null,this.revocationKeyClass=null,this.revocationKeyAlgorithm=null,this.revocationKeyFingerprint=null,this.issuerKeyID=new Ke,this.rawNotations=[],this.notations={},this.preferredHashAlgorithms=null,this.preferredCompressionAlgorithms=null,this.keyServerPreferences=null,this.preferredKeyServer=null,this.isPrimaryUserID=null,this.policyURI=null,this.keyFlags=null,this.signersUserID=null,this.reasonForRevocationFlag=null,this.reasonForRevocationString=null,this.features=null,this.signatureTargetPublicKeyAlgorithm=null,this.signatureTargetHashAlgorithm=null,this.signatureTargetHash=null,this.embeddedSignature=null,this.issuerKeyVersion=null,this.issuerFingerprint=null,this.preferredAEADAlgorithms=null,this.revoked=null,this[Yp]=null}read(Ae){let Se=0;if(this.version=Ae[Se++],4!==this.version&&5!==this.version)throw new Un(`Version ${this.version} of the signature packet is unsupported.`);if(this.signatureType=Ae[Se++],this.publicKeyAlgorithm=Ae[Se++],this.hashAlgorithm=Ae[Se++],Se+=this.readSubPackets(Ae.subarray(Se,Ae.length),!0),!this.created)throw Error("Missing signature creation time subpacket.");this.signatureData=Ae.subarray(0,Se),Se+=this.readSubPackets(Ae.subarray(Se,Ae.length),!1),this.signedHashValue=Ae.subarray(Se,Se+2),Se+=2,this.params=qa.signature.parseSignatureParams(this.publicKeyAlgorithm,Ae.subarray(Se,Ae.length))}writeParams(){return this.params instanceof Promise?ae((async()=>qa.serializeParams(this.publicKeyAlgorithm,await this.params))):qa.serializeParams(this.publicKeyAlgorithm,this.params)}write(){const Ae=[];return Ae.push(this.signatureData),Ae.push(this.writeUnhashedSubPackets()),Ae.push(this.signedHashValue),Ae.push(this.writeParams()),ar.concat(Ae)}async sign(Ae,Se,Ce=new Date,qe=!1){5===Ae.version?this.version=5:this.version=4;const Fe=[new Uint8Array([this.version,this.signatureType,this.publicKeyAlgorithm,this.hashAlgorithm])];this.created=ar.normalizeDate(Ce),this.issuerKeyVersion=Ae.version,this.issuerFingerprint=Ae.getFingerprintBytes(),this.issuerKeyID=Ae.getKeyID(),Fe.push(this.writeHashedSubPackets()),this.unhashedSubpackets=[],this.signatureData=ar.concat(Fe);const $e=this.toHash(this.signatureType,Se,qe),rt=await this.hash(this.signatureType,Se,$e,qe);this.signedHashValue=re(J(rt),0,2);const o=async()=>qa.signature.sign(this.publicKeyAlgorithm,this.hashAlgorithm,Ae.publicParams,Ae.privateParams,$e,await ie(rt));ar.isStream(rt)?this.params=o():(this.params=await o(),this[Yp]=!0)}writeHashedSubPackets(){const Ae=nr.signatureSubpacket,Se=[];let Ce;if(null===this.created)throw Error("Missing signature creation time");Se.push(Pu(Ae.signatureCreationTime,!0,ar.writeDate(this.created))),null!==this.signatureExpirationTime&&Se.push(Pu(Ae.signatureExpirationTime,!0,ar.writeNumber(this.signatureExpirationTime,4))),null!==this.exportable&&Se.push(Pu(Ae.exportableCertification,!0,new Uint8Array([this.exportable?1:0]))),null!==this.trustLevel&&(Ce=new Uint8Array([this.trustLevel,this.trustAmount]),Se.push(Pu(Ae.trustSignature,!0,Ce))),null!==this.regularExpression&&Se.push(Pu(Ae.regularExpression,!0,this.regularExpression)),null!==this.revocable&&Se.push(Pu(Ae.revocable,!0,new Uint8Array([this.revocable?1:0]))),null!==this.keyExpirationTime&&Se.push(Pu(Ae.keyExpirationTime,!0,ar.writeNumber(this.keyExpirationTime,4))),null!==this.preferredSymmetricAlgorithms&&(Ce=ar.stringToUint8Array(ar.uint8ArrayToString(this.preferredSymmetricAlgorithms)),Se.push(Pu(Ae.preferredSymmetricAlgorithms,!1,Ce))),null!==this.revocationKeyClass&&(Ce=new Uint8Array([this.revocationKeyClass,this.revocationKeyAlgorithm]),Ce=ar.concat([Ce,this.revocationKeyFingerprint]),Se.push(Pu(Ae.revocationKey,!1,Ce))),this.issuerKeyID.isNull()||5===this.issuerKeyVersion||Se.push(Pu(Ae.issuer,!0,this.issuerKeyID.write())),this.rawNotations.forEach((({name:qe,value:Fe,humanReadable:$e,critical:rt})=>{Ce=[new Uint8Array([$e?128:0,0,0,0])];const it=ar.encodeUTF8(qe);Ce.push(ar.writeNumber(it.length,2)),Ce.push(ar.writeNumber(Fe.length,2)),Ce.push(it),Ce.push(Fe),Ce=ar.concat(Ce),Se.push(Pu(Ae.notationData,rt,Ce))})),null!==this.preferredHashAlgorithms&&(Ce=ar.stringToUint8Array(ar.uint8ArrayToString(this.preferredHashAlgorithms)),Se.push(Pu(Ae.preferredHashAlgorithms,!1,Ce))),null!==this.preferredCompressionAlgorithms&&(Ce=ar.stringToUint8Array(ar.uint8ArrayToString(this.preferredCompressionAlgorithms)),Se.push(Pu(Ae.preferredCompressionAlgorithms,!1,Ce))),null!==this.keyServerPreferences&&(Ce=ar.stringToUint8Array(ar.uint8ArrayToString(this.keyServerPreferences)),Se.push(Pu(Ae.keyServerPreferences,!1,Ce))),null!==this.preferredKeyServer&&Se.push(Pu(Ae.preferredKeyServer,!1,ar.encodeUTF8(this.preferredKeyServer))),null!==this.isPrimaryUserID&&Se.push(Pu(Ae.primaryUserID,!1,new Uint8Array([this.isPrimaryUserID?1:0]))),null!==this.policyURI&&Se.push(Pu(Ae.policyURI,!1,ar.encodeUTF8(this.policyURI))),null!==this.keyFlags&&(Ce=ar.stringToUint8Array(ar.uint8ArrayToString(this.keyFlags)),Se.push(Pu(Ae.keyFlags,!0,Ce))),null!==this.signersUserID&&Se.push(Pu(Ae.signersUserID,!1,ar.encodeUTF8(this.signersUserID))),null!==this.reasonForRevocationFlag&&(Ce=ar.stringToUint8Array(String.fromCharCode(this.reasonForRevocationFlag)+this.reasonForRevocationString),Se.push(Pu(Ae.reasonForRevocation,!0,Ce))),null!==this.features&&(Ce=ar.stringToUint8Array(ar.uint8ArrayToString(this.features)),Se.push(Pu(Ae.features,!1,Ce))),null!==this.signatureTargetPublicKeyAlgorithm&&(Ce=[new Uint8Array([this.signatureTargetPublicKeyAlgorithm,this.signatureTargetHashAlgorithm])],Ce.push(ar.stringToUint8Array(this.signatureTargetHash)),Ce=ar.concat(Ce),Se.push(Pu(Ae.signatureTarget,!0,Ce))),null!==this.embeddedSignature&&Se.push(Pu(Ae.embeddedSignature,!0,this.embeddedSignature.write())),null!==this.issuerFingerprint&&(Ce=[new Uint8Array([this.issuerKeyVersion]),this.issuerFingerprint],Ce=ar.concat(Ce),Se.push(Pu(Ae.issuerFingerprint,5===this.version,Ce))),null!==this.preferredAEADAlgorithms&&(Ce=ar.stringToUint8Array(ar.uint8ArrayToString(this.preferredAEADAlgorithms)),Se.push(Pu(Ae.preferredAEADAlgorithms,!1,Ce)));const qe=ar.concat(Se),Fe=ar.writeNumber(qe.length,2);return ar.concat([Fe,qe])}writeUnhashedSubPackets(){const Ae=[];this.unhashedSubpackets.forEach((Se=>{Ae.push(Pn(Se.length)),Ae.push(Se)}));const Se=ar.concat(Ae),Ce=ar.writeNumber(Se.length,2);return ar.concat([Ce,Se])}readSubPacket(Ae,Se=!0){let Ce=0;const qe=!!(128&Ae[Ce]),Fe=127&Ae[Ce];if(Se||(this.unhashedSubpackets.push(Ae.subarray(Ce,Ae.length)),Jp.has(Fe)))switch(Ce++,Fe){case nr.signatureSubpacket.signatureCreationTime:this.created=ar.readDate(Ae.subarray(Ce,Ae.length));break;case nr.signatureSubpacket.signatureExpirationTime:{const Se=ar.readNumber(Ae.subarray(Ce,Ae.length));this.signatureNeverExpires=0===Se,this.signatureExpirationTime=Se;break}case nr.signatureSubpacket.exportableCertification:this.exportable=1===Ae[Ce++];break;case nr.signatureSubpacket.trustSignature:this.trustLevel=Ae[Ce++],this.trustAmount=Ae[Ce++];break;case nr.signatureSubpacket.regularExpression:this.regularExpression=Ae[Ce];break;case nr.signatureSubpacket.revocable:this.revocable=1===Ae[Ce++];break;case nr.signatureSubpacket.keyExpirationTime:{const Se=ar.readNumber(Ae.subarray(Ce,Ae.length));this.keyExpirationTime=Se,this.keyNeverExpires=0===Se;break}case nr.signatureSubpacket.preferredSymmetricAlgorithms:this.preferredSymmetricAlgorithms=[...Ae.subarray(Ce,Ae.length)];break;case nr.signatureSubpacket.revocationKey:this.revocationKeyClass=Ae[Ce++],this.revocationKeyAlgorithm=Ae[Ce++],this.revocationKeyFingerprint=Ae.subarray(Ce,Ce+20);break;case nr.signatureSubpacket.issuer:this.issuerKeyID.read(Ae.subarray(Ce,Ae.length));break;case nr.signatureSubpacket.notationData:{const Se=!!(128&Ae[Ce]);Ce+=4;const Fe=ar.readNumber(Ae.subarray(Ce,Ce+2));Ce+=2;const $e=ar.readNumber(Ae.subarray(Ce,Ce+2));Ce+=2;const rt=ar.decodeUTF8(Ae.subarray(Ce,Ce+Fe)),it=Ae.subarray(Ce+Fe,Ce+Fe+$e);this.rawNotations.push({name:rt,humanReadable:Se,value:it,critical:qe}),Se&&(this.notations[rt]=ar.decodeUTF8(it));break}case nr.signatureSubpacket.preferredHashAlgorithms:this.preferredHashAlgorithms=[...Ae.subarray(Ce,Ae.length)];break;case nr.signatureSubpacket.preferredCompressionAlgorithms:this.preferredCompressionAlgorithms=[...Ae.subarray(Ce,Ae.length)];break;case nr.signatureSubpacket.keyServerPreferences:this.keyServerPreferences=[...Ae.subarray(Ce,Ae.length)];break;case nr.signatureSubpacket.preferredKeyServer:this.preferredKeyServer=ar.decodeUTF8(Ae.subarray(Ce,Ae.length));break;case nr.signatureSubpacket.primaryUserID:this.isPrimaryUserID=0!==Ae[Ce++];break;case nr.signatureSubpacket.policyURI:this.policyURI=ar.decodeUTF8(Ae.subarray(Ce,Ae.length));break;case nr.signatureSubpacket.keyFlags:this.keyFlags=[...Ae.subarray(Ce,Ae.length)];break;case nr.signatureSubpacket.signersUserID:this.signersUserID=ar.decodeUTF8(Ae.subarray(Ce,Ae.length));break;case nr.signatureSubpacket.reasonForRevocation:this.reasonForRevocationFlag=Ae[Ce++],this.reasonForRevocationString=ar.decodeUTF8(Ae.subarray(Ce,Ae.length));break;case nr.signatureSubpacket.features:this.features=[...Ae.subarray(Ce,Ae.length)];break;case nr.signatureSubpacket.signatureTarget:{this.signatureTargetPublicKeyAlgorithm=Ae[Ce++],this.signatureTargetHashAlgorithm=Ae[Ce++];const Se=qa.getHashByteLength(this.signatureTargetHashAlgorithm);this.signatureTargetHash=ar.uint8ArrayToString(Ae.subarray(Ce,Ce+Se));break}case nr.signatureSubpacket.embeddedSignature:this.embeddedSignature=new Eu,this.embeddedSignature.read(Ae.subarray(Ce,Ae.length));break;case nr.signatureSubpacket.issuerFingerprint:this.issuerKeyVersion=Ae[Ce++],this.issuerFingerprint=Ae.subarray(Ce,Ae.length),5===this.issuerKeyVersion?this.issuerKeyID.read(this.issuerFingerprint):this.issuerKeyID.read(this.issuerFingerprint.subarray(-8));break;case nr.signatureSubpacket.preferredAEADAlgorithms:this.preferredAEADAlgorithms=[...Ae.subarray(Ce,Ae.length)];break;default:{const Ae=Error("Unknown signature subpacket type "+Fe);if(qe)throw Ae;ar.printDebug(Ae)}}}readSubPackets(Ae,Se=!0,Ce){const qe=ar.readNumber(Ae.subarray(0,2));let Fe=2;for(;Fe<2+qe;){const qe=En(Ae.subarray(Fe,Ae.length));Fe+=qe.offset,this.readSubPacket(Ae.subarray(Fe,Fe+qe.len),Se,Ce),Fe+=qe.len}return Fe}toSign(Ae,Se){const Ce=nr.signature;switch(Ae){case Ce.binary:return null!==Se.text?ar.encodeUTF8(Se.getText(!0)):Se.getBytes(!0);case Ce.text:{const Ae=Se.getBytes(!0);return ar.canonicalizeEOL(Ae)}case Ce.standalone:return new Uint8Array(0);case Ce.certGeneric:case Ce.certPersona:case Ce.certCasual:case Ce.certPositive:case Ce.certRevocation:{let Ae,qe;if(Se.userID)qe=180,Ae=Se.userID;else{if(!Se.userAttribute)throw Error("Either a userID or userAttribute packet needs to be supplied for certification.");qe=209,Ae=Se.userAttribute}const Fe=Ae.write();return ar.concat([this.toSign(Ce.key,Se),new Uint8Array([qe]),ar.writeNumber(Fe.length,4),Fe])}case Ce.subkeyBinding:case Ce.subkeyRevocation:case Ce.keyBinding:return ar.concat([this.toSign(Ce.key,Se),this.toSign(Ce.key,{key:Se.bind})]);case Ce.key:if(void 0===Se.key)throw Error("Key packet is required for this signature.");return Se.key.writeForHash(this.version);case Ce.keyRevocation:return this.toSign(Ce.key,Se);case Ce.timestamp:return new Uint8Array(0);case Ce.thirdParty:throw Error("Not implemented");default:throw Error("Unknown signature type.")}}calculateTrailer(Ae,Se){let Ce=0;return X(J(this.signatureData),(Ae=>{Ce+=Ae.length}),(()=>{const qe=[];return 5!==this.version||this.signatureType!==nr.signature.binary&&this.signatureType!==nr.signature.text||(Se?qe.push(new Uint8Array(6)):qe.push(Ae.writeHeader())),qe.push(new Uint8Array([this.version,255])),5===this.version&&qe.push(new Uint8Array(4)),qe.push(ar.writeNumber(Ce,4)),ar.concat(qe)}))}toHash(Ae,Se,Ce=!1){const qe=this.toSign(Ae,Se);return ar.concat([qe,this.signatureData,this.calculateTrailer(Se,Ce)])}async hash(Ae,Se,Ce,qe=!1){return Ce||(Ce=this.toHash(Ae,Se,qe)),qa.hash.digest(this.hashAlgorithm,Ce)}async verify(Ae,Se,Ce,qe=new Date,Fe=!1,$e=dr){if(!this.issuerKeyID.equals(Ae.getKeyID()))throw Error("Signature was not issued by the given public key");if(this.publicKeyAlgorithm!==Ae.algorithm)throw Error("Public key algorithm used to sign signature does not match issuer key algorithm.");const rt=Se===nr.signature.binary||Se===nr.signature.text;if(!(this[Yp]&&!rt)){let qe,$e;if(this.hashed?$e=await this.hashed:(qe=this.toHash(Se,Ce,Fe),$e=await this.hash(Se,Ce,qe)),$e=await ie($e),this.signedHashValue[0]!==$e[0]||this.signedHashValue[1]!==$e[1])throw Error("Signed digest did not match");if(this.params=await this.params,this[Yp]=await qa.signature.verify(this.publicKeyAlgorithm,this.hashAlgorithm,this.params,Ae.publicParams,qe,$e),!this[Yp])throw Error("Signature verification failed")}const it=ar.normalizeDate(qe);if(it&&this.created>it)throw Error("Signature creation time is in the future");if(it&&it>=this.getExpirationTime())throw Error("Signature is expired");if($e.rejectHashAlgorithms.has(this.hashAlgorithm))throw Error("Insecure hash algorithm: "+nr.read(nr.hash,this.hashAlgorithm).toUpperCase());if($e.rejectMessageHashAlgorithms.has(this.hashAlgorithm)&&[nr.signature.binary,nr.signature.text].includes(this.signatureType))throw Error("Insecure message hash algorithm: "+nr.read(nr.hash,this.hashAlgorithm).toUpperCase());if(this.rawNotations.forEach((({name:Ae,critical:Se})=>{if(Se&&$e.knownNotations.indexOf(Ae)<0)throw Error("Unknown critical notation: "+Ae)})),null!==this.revocationKeyClass)throw Error("This key is intended to be revoked with an authorized key, which OpenPGP.js does not support.")}isExpired(Ae=new Date){const Se=ar.normalizeDate(Ae);return null!==Se&&!(this.created<=Se&&SeEu.prototype.calculateTrailer.apply(await this.correspondingSig,Ae)))}async verify(){const Ae=await this.correspondingSig;if(!Ae||Ae.constructor.tag!==nr.packet.signature)throw Error("Corresponding signature packet missing");if(Ae.signatureType!==this.signatureType||Ae.hashAlgorithm!==this.hashAlgorithm||Ae.publicKeyAlgorithm!==this.publicKeyAlgorithm||!Ae.issuerKeyID.equals(this.issuerKeyID))throw Error("Corresponding signature packet does not match one-pass signature packet");return Ae.hashed=this.hashed,Ae.verify.apply(Ae,arguments)}}function Mu(Ae,Se){if(!Se[Ae]){let Ce;try{Ce=nr.read(nr.packet,Ae)}catch(Se){throw new Un("Unknown packet type with tag: "+Ae)}throw Error("Packet not allowed in this context: "+Ce)}return new Se[Ae]}xu.prototype.hash=Eu.prototype.hash,xu.prototype.toHash=Eu.prototype.toHash,xu.prototype.toSign=Eu.prototype.toSign;class Ku extends Array{static async fromBinary(Ae,Se,Ce=dr){const qe=new Ku;return await qe.read(Ae,Se,Ce),qe}async read(Ae,Se,Ce=dr){Ce.additionalAllowedPackets.length&&(Se={...Se,...ar.constructAllowedPackets(Ce.additionalAllowedPackets)}),this.stream=Y(Ae,(async(Ae,qe)=>{const Fe=G(qe);try{for(;;){await Fe.ready;if(await Dn(Ae,(async Ae=>{try{if(Ae.tag===nr.packet.marker||Ae.tag===nr.packet.trust)return;const qe=Mu(Ae.tag,Se);qe.packets=new Ku,qe.fromStream=ar.isStream(Ae.packet),await qe.read(Ae.packet,Ce),await Fe.write(qe)}catch(Se){const qe=!Ce.ignoreUnsupportedPackets&&Se instanceof Un,$e=!(Ce.ignoreMalformedPackets||Se instanceof Un);if(qe||$e||Cn(Ae.tag))await Fe.abort(Se);else{const Se=new Rn(Ae.tag,Ae.packet);await Fe.write(Se)}ar.printDebugError(Se)}})))return await Fe.ready,void await Fe.close()}}catch(Ae){await Fe.abort(Ae)}}));const qe=W(this.stream);for(;;){const{done:Ae,value:Se}=await qe.read();if(Ae?this.stream=null:this.push(Se),Ae||Cn(Se.constructor.tag))break}qe.releaseLock()}write(){const Ae=[];for(let Se=0;Se{if(Se.push(Ae),Fe+=Ae.length,Fe>=$e){const Ae=Math.min(Math.log(Fe)/Math.LN2|0,30),Ce=2**Ae,qe=ar.concat([xn(Ae)].concat(Se));return Se=[qe.subarray(1+Ce)],Fe=Se[0].length,qe.subarray(0,1+Ce)}}),(()=>ar.concat([Pn(Fe)].concat(Se)))))}else{if(ar.isStream(qe)){let Se=0;Ae.push(X(J(qe),(Ae=>{Se+=Ae.length}),(()=>Kn(Ce,Se))))}else Ae.push(Kn(Ce,qe.length));Ae.push(qe)}}return ar.concat(Ae)}filterByTag(...Ae){const Se=new Ku,r=Ae=>Se=>Ae===Se;for(let Ce=0;CeSe.constructor.tag===Ae))}indexOfTag(...Ae){const Se=[],Ce=this,i=Ae=>Se=>Ae===Se;for(let qe=0;qe{this.algorithm=await Ae.readByte(),this.compressed=Ae.remainder(),await this.decompress(Se)}))}write(){return null===this.compressed&&this.compress(),ar.concat([new Uint8Array([this.algorithm]),this.compressed])}async decompress(Ae=dr){const Se=nr.read(nr.compression,this.algorithm),Ce=ny[Se];if(!Ce)throw Error(Se+" decompression not supported");this.packets=await Ku.fromBinary(Ce(this.compressed),ty,Ae)}compress(){const Ae=nr.read(nr.compression,this.algorithm),Se=iy[Ae];if(!Se)throw Error(Ae+" compression not supported");this.compressed=Se(this.packets.write(),this.deflateLevel)}}const ry=ar.getNodeZlib();function Ru(Ae){return Ae}function Iu(Ae,Se,Ce={}){return function(qe){return!ar.isStream(qe)||_(qe)?ae((()=>ie(qe).then((Se=>new Promise(((qe,Fe)=>{Ae(Se,Ce,((Ae,Se)=>{if(Ae)return Fe(Ae);qe(Se)}))})))))):Wt(Gt(qe).pipe(Se(Ce)))}}function Bu(Ae,Se={}){return function(Ce){const qe=new Ae(Se);return X(Ce,(Ae=>{if(Ae.length)return qe.push(Ae,Ya),qe.result}),(()=>{if(Ae===Qo)return qe.push([],no),qe.result}))}}function Tu(Ae){return function(Se){return ae((async()=>Ae(await ie(Se))))}}const iy=ry?{zip:(Ae,Se)=>Iu(ry.deflateRaw,ry.createDeflateRaw,{level:Se})(Ae),zlib:(Ae,Se)=>Iu(ry.deflate,ry.createDeflate,{level:Se})(Ae)}:{zip:(Ae,Se)=>Bu(Qo,{raw:!0,level:Se})(Ae),zlib:(Ae,Se)=>Bu(Qo,{level:Se})(Ae)},ny=ry?{uncompressed:Ru,zip:Iu(ry.inflateRaw,ry.createInflateRaw),zlib:Iu(ry.inflate,ry.createInflate),bzip2:Tu(_u)}:{uncompressed:Ru,zip:Bu(su,{raw:!0}),zlib:Bu(su),bzip2:Tu(_u)},oy=ar.constructAllowedPackets([ku,Du,xu,Eu]);class Ou{static get tag(){return nr.packet.symEncryptedIntegrityProtectedData}constructor(){this.version=1,this.encrypted=null,this.packets=null}async read(Ae){await Q(Ae,(async Ae=>{const Se=await Ae.readByte();if(1!==Se)throw new Un(`Version ${Se} of the SEIP packet is unsupported.`);this.encrypted=Ae.remainder()}))}write(){return ar.concat([new Uint8Array([1]),this.encrypted])}async encrypt(Ae,Se,Ce=dr){const{blockSize:qe}=qa.getCipher(Ae);let Fe=this.packets.write();_(Fe)&&(Fe=await ie(Fe));const $e=await qa.getPrefixRandom(Ae),rt=new Uint8Array([211,20]),it=ar.concat([$e,Fe,rt]),nt=await qa.hash.sha1(ee(it)),st=ar.concat([it,nt]);return this.encrypted=await qa.mode.cfb.encrypt(Ae,Se,st,new Uint8Array(qe),Ce),!0}async decrypt(Ae,Se,Ce=dr){const{blockSize:qe}=qa.getCipher(Ae);let Fe=J(this.encrypted);_(Fe)&&(Fe=await ie(Fe));const $e=await qa.mode.cfb.decrypt(Ae,Se,Fe,new Uint8Array(qe)),rt=re(ee($e),-20),it=re($e,0,-20),nt=Promise.all([ie(await qa.hash.sha1(ee(it))),ie(rt)]).then((([Ae,Se])=>{if(!ar.equalsUint8Array(Ae,Se))throw Error("Modification detected.");return new Uint8Array})),st=re(it,qe+2);let ut=re(st,0,-2);return ut=H([ut,ae((()=>nt))]),ar.isStream(Fe)&&Ce.allowUnauthenticatedStream||(ut=await ie(ut)),this.packets=await Ku.fromBinary(ut,oy,Ce),!0}}const cy=ar.constructAllowedPackets([ku,Du,xu,Eu]);class Nu{static get tag(){return nr.packet.aeadEncryptedData}constructor(){this.version=1,this.cipherAlgorithm=null,this.aeadAlgorithm=nr.aead.eax,this.chunkSizeByte=null,this.iv=null,this.encrypted=null,this.packets=null}async read(Ae){await Q(Ae,(async Ae=>{const Se=await Ae.readByte();if(1!==Se)throw new Un(`Version ${Se} of the AEAD-encrypted data packet is not supported.`);this.cipherAlgorithm=await Ae.readByte(),this.aeadAlgorithm=await Ae.readByte(),this.chunkSizeByte=await Ae.readByte();const Ce=qa.getAEADMode(this.aeadAlgorithm);this.iv=await Ae.readBytes(Ce.ivLength),this.encrypted=Ae.remainder()}))}write(){return ar.concat([new Uint8Array([this.version,this.cipherAlgorithm,this.aeadAlgorithm,this.chunkSizeByte]),this.iv,this.encrypted])}async decrypt(Ae,Se,Ce=dr){this.packets=await Ku.fromBinary(await this.crypt("decrypt",Se,J(this.encrypted)),cy,Ce)}async encrypt(Ae,Se,Ce=dr){this.cipherAlgorithm=Ae;const{ivLength:qe}=qa.getAEADMode(this.aeadAlgorithm);this.iv=qa.random.getRandomBytes(qe),this.chunkSizeByte=Ce.aeadChunkSizeByte;const Fe=this.packets.write();this.encrypted=await this.crypt("encrypt",Se,Fe)}async crypt(Ae,Se,Ce){const qe=qa.getAEADMode(this.aeadAlgorithm),Fe=await qe(this.cipherAlgorithm,Se),$e="decrypt"===Ae?qe.tagLength:0,rt="encrypt"===Ae?qe.tagLength:0,it=2**(this.chunkSizeByte+6)+$e,nt=new ArrayBuffer(21),st=new Uint8Array(nt,0,13),ut=new Uint8Array(nt),ht=new DataView(nt),ft=new Uint8Array(nt,5,8);st.set([192|Nu.tag,this.version,this.cipherAlgorithm,this.aeadAlgorithm,this.chunkSizeByte],0);let yt=0,vt=Promise.resolve(),_t=0,Ct=0;const Rt=this.iv;return Y(Ce,(async(Se,Ce)=>{if("array"!==ar.isStream(Se)){const Ae=new tr({},{highWaterMark:ar.getHardwareConcurrency()*2**(this.chunkSizeByte+6),size:Ae=>Ae.length});V(Ae.readable,Ce),Ce=Ae.writable}const nt=W(Se),Ut=G(Ce);try{for(;;){let Se=await nt.readBytes(it+$e)||new Uint8Array;const Ce=Se.subarray(Se.length-$e);let It,Ot;if(Se=Se.subarray(0,Se.length-$e),!yt||Se.length?(nt.unshift(Ce),It=Fe[Ae](Se,qe.getNonce(Rt,ft),st),Ct+=Se.length-$e+rt):(ht.setInt32(17,_t),It=Fe[Ae](Ce,qe.getNonce(Rt,ft),ut),Ct+=rt,Ot=!0),_t+=Se.length-$e,vt=vt.then((()=>It)).then((async Ae=>{await Ut.ready,await Ut.write(Ae),Ct-=Ae.length})).catch((Ae=>Ut.abort(Ae))),(Ot||Ct>Ut.desiredSize)&&await vt,Ot){await Ut.close();break}ht.setInt32(9,++yt)}}catch(Ae){await Ut.abort(Ae)}}))}}class ju{static get tag(){return nr.packet.publicKeyEncryptedSessionKey}constructor(){this.version=3,this.publicKeyID=new Ke,this.publicKeyAlgorithm=null,this.sessionKey=null,this.sessionKeyAlgorithm=null,this.encrypted={}}read(Ae){let Se=0;if(this.version=Ae[Se++],3!==this.version)throw new Un(`Version ${this.version} of the PKESK packet is unsupported.`);Se+=this.publicKeyID.read(Ae.subarray(Se)),this.publicKeyAlgorithm=Ae[Se++],this.encrypted=qa.parseEncSessionKeyParams(this.publicKeyAlgorithm,Ae.subarray(Se),this.version),this.publicKeyAlgorithm===nr.publicKey.x25519&&(this.sessionKeyAlgorithm=nr.write(nr.symmetric,this.encrypted.C.algorithm))}write(){const Ae=[new Uint8Array([this.version]),this.publicKeyID.write(),new Uint8Array([this.publicKeyAlgorithm]),qa.serializeParams(this.publicKeyAlgorithm,this.encrypted)];return ar.concatUint8Array(Ae)}async encrypt(Ae){const Se=nr.write(nr.publicKey,this.publicKeyAlgorithm),Ce=Hu(this.version,Se,this.sessionKeyAlgorithm,this.sessionKey);this.encrypted=await qa.publicKeyEncrypt(Se,this.sessionKeyAlgorithm,Ae.publicParams,Ce,Ae.getFingerprintBytes())}async decrypt(Ae,Se){if(this.publicKeyAlgorithm!==Ae.algorithm)throw Error("Decryption error");const Ce=Se?Hu(this.version,this.publicKeyAlgorithm,Se.sessionKeyAlgorithm,Se.sessionKey):null,qe=await qa.publicKeyDecrypt(this.publicKeyAlgorithm,Ae.publicParams,Ae.privateParams,this.encrypted,Ae.getFingerprintBytes(),Ce),{sessionKey:Fe,sessionKeyAlgorithm:$e}=function(Ae,Se,Ce,qe){switch(Se){case nr.publicKey.rsaEncrypt:case nr.publicKey.rsaEncryptSign:case nr.publicKey.elgamal:case nr.publicKey.ecdh:{const Ae=Ce.subarray(0,Ce.length-2),Se=Ce.subarray(Ce.length-2),Fe=ar.writeChecksum(Ae.subarray(Ae.length%8)),$e=Fe[0]===Se[0]&Fe[1]===Se[1],rt={sessionKeyAlgorithm:Ae[0],sessionKey:Ae.subarray(1)};if(qe){const Ae=$e&rt.sessionKeyAlgorithm===qe.sessionKeyAlgorithm&rt.sessionKey.length===qe.sessionKey.length;return{sessionKey:ar.selectUint8Array(Ae,rt.sessionKey,qe.sessionKey),sessionKeyAlgorithm:ar.selectUint8(Ae,rt.sessionKeyAlgorithm,qe.sessionKeyAlgorithm)}}if($e&&nr.read(nr.symmetric,rt.sessionKeyAlgorithm))return rt;throw Error("Decryption error")}case nr.publicKey.x25519:return{sessionKey:Ce};default:throw Error("Unsupported public key algorithm")}}(this.version,this.publicKeyAlgorithm,qe,Se);this.publicKeyAlgorithm!==nr.publicKey.x25519&&(this.sessionKeyAlgorithm=$e),this.sessionKey=Fe}}function Hu(Ae,Se,Ce,qe){switch(Se){case nr.publicKey.rsaEncrypt:case nr.publicKey.rsaEncryptSign:case nr.publicKey.elgamal:case nr.publicKey.ecdh:return ar.concatUint8Array([new Uint8Array([Ce]),qe,ar.writeChecksum(qe.subarray(qe.length%8))]);case nr.publicKey.x25519:return qe;default:throw Error("Unsupported public key algorithm")}}class Wu{constructor(Ae=dr){this.algorithm=nr.hash.sha256,this.type="iterated",this.c=Ae.s2kIterationCountByte,this.salt=null}getCount(){return 16+(15&this.c)<<6+(this.c>>4)}read(Ae){let Se=0;try{this.type=nr.read(nr.s2k,Ae[Se++])}catch(Ae){throw new Un("Unknown S2K type.")}switch(this.algorithm=Ae[Se++],this.type){case"simple":break;case"salted":this.salt=Ae.subarray(Se,Se+8),Se+=8;break;case"iterated":this.salt=Ae.subarray(Se,Se+8),Se+=8,this.c=Ae[Se++];break;case"gnu":if("GNU"!==ar.uint8ArrayToString(Ae.subarray(Se,Se+3)))throw new Un("Unknown s2k type.");Se+=3;if(1001!==1e3+Ae[Se++])throw new Un("Unknown s2k gnu protection mode.");this.type="gnu-dummy";break;default:throw new Un("Unknown s2k type.")}return Se}write(){if("gnu-dummy"===this.type)return new Uint8Array([101,0,...ar.stringToUint8Array("GNU"),1]);const Ae=[new Uint8Array([nr.write(nr.s2k,this.type),this.algorithm])];switch(this.type){case"simple":break;case"salted":Ae.push(this.salt);break;case"iterated":Ae.push(this.salt),Ae.push(new Uint8Array([this.c]));break;case"gnu":throw Error("GNU s2k type not supported.");default:throw Error("Unknown s2k type.")}return ar.concatUint8Array(Ae)}async produceKey(Ae,Se){Ae=ar.encodeUTF8(Ae);const Ce=[];let qe=0,Fe=0;for(;qe{this.privateParams[Ae].fill(0),delete this.privateParams[Ae]})),this.privateParams=null,this.isEncrypted=!0)}}async function Ju(Ae,Se,Ce){const{keySize:qe}=qa.getCipher(Ce);return Ae.produceKey(Se,qe)}var hy=mt((function(Ae){!function(Se){function r(Ae){function t(){return Ce0&&(Se.semantic=" "),Se}}function b(Ae,Se){return function(){var Ce,qe,Fe,$e,rt;for($e=r(),Ce=s("star"),Fe=0,rt=void 0===Se?0:Se;null!==(qe=Ae());)Fe+=1,c(Ce,qe);return Fe>=rt?Ce:(n($e),null)}}function g(Ae){return Ae.charCodeAt(0)>=128}function m(){return o("cr",h("\r")())}function w(){return o("crlf",d(m,k)())}function v(){return o("dquote",h('"')())}function _(){return o("htab",h("\t")())}function k(){return o("lf",h("\n")())}function A(){return o("sp",h(" ")())}function S(){return o("vchar",u((function(Se){var Ce=Se.charCodeAt(0),qe=33<=Ce&&Ce<=126;return Ae.rfc6532&&(qe=qe||g(Se)),qe})))}function E(){return o("wsp",f(A,_)())}function P(){var Ae=o("quoted-pair",f(d(h("\\"),f(S,E)),ie)());return null===Ae?null:(Ae.semantic=Ae.semantic[1],Ae)}function x(){return o("fws",f(ae,d(l(d(b(E),p(w))),b(E,1)))())}function M(){return o("ctext",f((function(){return u((function(Se){var Ce=Se.charCodeAt(0),qe=33<=Ce&&Ce<=39||42<=Ce&&Ce<=91||93<=Ce&&Ce<=126;return Ae.rfc6532&&(qe=qe||g(Se)),qe}))}),te)())}function K(){return o("ccontent",f(M,P,C)())}function C(){return o("comment",d(h("("),b(d(l(x),K)),l(x),h(")"))())}function D(){return o("cfws",f(d(b(d(l(x),C),1),l(x)),x)())}function U(){return o("atext",u((function(Se){var Ce="a"<=Se&&Se<="z"||"A"<=Se&&Se<="Z"||"0"<=Se&&Se<="9"||["!","#","$","%","&","'","*","+","-","/","=","?","^","_","`","{","|","}","~"].indexOf(Se)>=0;return Ae.rfc6532&&(Ce=Ce||g(Se)),Ce})))}function R(){return o("atom",d(y(l(D)),b(U,1),y(l(D)))())}function I(){var Ae,Se;return null===(Ae=o("dot-atom-text",b(U,1)()))||null!==(Se=b(d(h("."),b(U,1)))())&&c(Ae,Se),Ae}function B(){return o("dot-atom",d(p(l(D)),I,p(l(D)))())}function T(){return o("qtext",f((function(){return u((function(Se){var Ce=Se.charCodeAt(0),qe=33===Ce||35<=Ce&&Ce<=91||93<=Ce&&Ce<=126;return Ae.rfc6532&&(qe=qe||g(Se)),qe}))}),re)())}function z(){return o("qcontent",f(T,P)())}function q(){return o("quoted-string",d(p(l(D)),p(v),b(d(l(y(x)),z)),l(p(x)),p(v),p(l(D)))())}function F(){return o("word",f(R,q)())}function O(){return o("address",f(L,H)())}function L(){return o("mailbox",f(N,J)())}function N(){return o("name-addr",d(l(W),j)())}function j(){return o("angle-addr",f(d(p(l(D)),h("<"),J,h(">"),p(l(D))),se)())}function H(){return o("group",d(W,h(":"),l($),h(";"),p(l(D)))())}function W(){return o("display-name",(null!==(Ae=o("phrase",f(ne,b(F,1))()))&&(Ae.semantic=function(Ae){return Ae.replace(/([ \t]|\r\n)+/g," ").replace(/^\s*/,"").replace(/\s*$/,"")}(Ae.semantic)),Ae));var Ae}function G(){return o("mailbox-list",f(d(L,b(d(h(","),L))),ue)())}function V(){return o("address-list",f(d(O,b(d(h(","),O))),he)())}function $(){return o("group-list",f(G,p(D),de)())}function Z(){return o("local-part",f(fe,B,q)())}function X(){return o("dtext",f((function(){return u((function(Se){var Ce=Se.charCodeAt(0),qe=33<=Ce&&Ce<=90||94<=Ce&&Ce<=126;return Ae.rfc6532&&(qe=qe||g(Se)),qe}))}),pe)())}function Y(){return o("domain-literal",d(p(l(D)),h("["),b(d(l(x),X)),l(x),h("]"),p(l(D)))())}function Q(){return o("domain",(Se=f(le,B,Y)(),Ae.rejectTLD&&Se&&Se.semantic&&Se.semantic.indexOf(".")<0?null:(Se&&(Se.semantic=Se.semantic.replace(/\s+/g,"")),Se)));var Se}function J(){return o("addr-spec",d(Z,h("@"),Q)())}function ee(){return Ae.strict?null:o("obs-NO-WS-CTL",u((function(Ae){var Se=Ae.charCodeAt(0);return 1<=Se&&Se<=8||11===Se||12===Se||14<=Se&&Se<=31||127===Se})))}function te(){return Ae.strict?null:o("obs-ctext",ee())}function re(){return Ae.strict?null:o("obs-qtext",ee())}function ie(){return Ae.strict?null:o("obs-qp",d(h("\\"),f(h("\0"),ee,k,m))())}function ne(){return Ae.strict?null:Ae.atInDisplayName?o("obs-phrase",d(F,b(f(F,h("."),h("@"),y(D))))()):o("obs-phrase",d(F,b(f(F,h("."),y(D))))())}function ae(){return Ae.strict?null:o("obs-FWS",b(d(p(l(w)),E),1)())}function se(){return Ae.strict?null:o("obs-angle-addr",d(p(l(D)),h("<"),oe,J,h(">"),p(l(D)))())}function oe(){return Ae.strict?null:o("obs-route",d(ce,h(":"))())}function ce(){return Ae.strict?null:o("obs-domain-list",d(b(f(p(D),h(","))),h("@"),Q,b(d(h(","),p(l(D)),l(d(h("@"),Q)))))())}function ue(){return Ae.strict?null:o("obs-mbox-list",d(b(d(p(l(D)),h(","))),L,b(d(h(","),l(d(L,p(D))))))())}function he(){return Ae.strict?null:o("obs-addr-list",d(b(d(p(l(D)),h(","))),O,b(d(h(","),l(d(O,p(D))))))())}function de(){return Ae.strict?null:o("obs-group-list",d(b(d(p(l(D)),h(",")),1),p(l(D)))())}function fe(){return Ae.strict?null:o("obs-local-part",d(F,b(d(h("."),F)))())}function le(){return Ae.strict?null:o("obs-domain",d(R,b(d(h("."),R)))())}function pe(){return Ae.strict?null:o("obs-dtext",f(ee,P)())}function ye(Ae,Se){var Ce,qe,Fe;if(null==Se)return null;for(qe=[Se];qe.length>0;){if((Fe=qe.pop()).name===Ae)return Fe;for(Ce=Fe.children.length-1;Ce>=0;Ce-=1)qe.push(Fe.children[Ce])}return null}function be(Ae,Se){var Ce,qe,Fe,$e,rt;if(null==Se)return null;for(qe=[Se],$e=[],rt={},Ce=0;Ce0;)if((Fe=qe.pop()).name in rt)$e.push(Fe);else for(Ce=Fe.children.length-1;Ce>=0;Ce-=1)qe.push(Fe.children[Ce]);return $e}function ge(Se){var Ce,qe,Fe,$e,rt;if(null===Se)return null;for(Ce=[],qe=be(["group","mailbox"],Se),Fe=0;Fe1)return null;return Se.addresses&&Se.addresses[0]}(rt):Ae.simple?rt&&rt.addresses:rt}function me(Ae){var Se,Ce=ye("display-name",Ae),qe=[],Fe=be(["mailbox"],Ae);for(Se=0;Se0;)for((Fe=qe.pop()).name===Ae&&$e.push(Fe),Ce=Fe.children.length-1;Ce>=0;Ce-=1)qe.push(Fe.children[Ce]);return $e}("cfws",Ae),Fe=be(["comment"],Ae),$e=ye("local-part",Ce),rt=ye("domain",Ce);return{node:Ae,parts:{name:Se,address:Ce,local:$e,domain:rt,comments:qe},type:Ae.name,name:ve(Se),address:ve(Ce),local:ve($e),domain:ve(rt),comments:_e(Fe),groupName:ve(Ae.groupName)}}function ve(Ae){return null!=Ae?Ae.semantic:null}function _e(Ae){var Se="";if(Ae)for(var Ce=0;Ce`),Se.userID=Ce.join(" "),Se}read(Ae,Se=dr){const Ce=ar.decodeUTF8(Ae);if(Ce.length>Se.maxUserIDLength)throw Error("User ID string is too long");try{const{name:Ae,address:Se,comments:qe}=hy.parseOneAddress({input:Ce,atInDisplayName:!0});this.comment=qe.replace(/^\(|\)$/g,""),this.name=Ae,this.email=Se}catch(Ae){}this.userID=Ce}write(){return ar.encodeUTF8(this.userID)}equals(Ae){return Ae&&Ae.userID===this.userID}}class rh extends Qu{static get tag(){return nr.packet.secretSubkey}constructor(Ae=new Date,Se=dr){super(Ae,Se)}}const dy=ar.constructAllowedPackets([Eu]);class nh{constructor(Ae){this.packets=Ae||new Ku}write(){return this.packets.write()}armor(Ae=dr){return Me(nr.armor.signature,this.write(),void 0,void 0,void 0,Ae)}getSigningKeyIDs(){return this.packets.map((Ae=>Ae.issuerKeyID))}}async function ah(Ae,Se){const Ce=new rh(Ae.date,Se);return Ce.packets=null,Ce.algorithm=nr.write(nr.publicKey,Ae.algorithm),await Ce.generate(Ae.rsaBits,Ae.curve),await Ce.computeFingerprintAndKeyID(),Ce}async function sh(Ae,Se){const Ce=new Qu(Ae.date,Se);return Ce.packets=null,Ce.algorithm=nr.write(nr.publicKey,Ae.algorithm),await Ce.generate(Ae.rsaBits,Ae.curve,Ae.config),await Ce.computeFingerprintAndKeyID(),Ce}async function oh(Ae,Se,Ce,qe,Fe=new Date,$e){let rt,it;for(let nt=Ae.length-1;nt>=0;nt--)try{(!rt||Ae[nt].created>=rt.created)&&(await Ae[nt].verify(Se,Ce,qe,Fe,void 0,$e),rt=Ae[nt])}catch(Ae){it=Ae}if(!rt)throw ar.wrapError(`Could not find valid ${nr.read(nr.signature,Ce)} signature in key ${Se.getKeyID().toHex()}`.replace("certGeneric ","self-").replace(/([a-z])([A-Z])/g,((Ae,Se,Ce)=>Se+" "+Ce.toLowerCase())),it);return rt}function ch(Ae,Se,Ce=new Date){const qe=ar.normalizeDate(Ce);if(null!==qe){const Ce=yh(Ae,Se);return!(Ae.created<=qe&&qe0&&($e.keyExpirationTime=Ce.keyExpirationTime,$e.keyNeverExpires=!1);return await fh(Fe,null,Se,$e,Ce.date,void 0,void 0,void 0,qe)}async function hh(Ae,Se,Ce=new Date,qe={},Fe){let $e=Fe.preferredHashAlgorithm,rt=$e;if(Ae){const Se=await Ae.getPrimaryUser(Ce,qe,Fe);Se.selfCertification.preferredHashAlgorithms&&([rt]=Se.selfCertification.preferredHashAlgorithms,$e=qa.hash.getHashByteLength($e)<=qa.hash.getHashByteLength(rt)?rt:$e)}switch(Se.algorithm){case nr.publicKey.ecdsa:case nr.publicKey.eddsaLegacy:case nr.publicKey.ed25519:rt=qa.getPreferredCurveHashAlgo(Se.algorithm,Se.publicParams.oid)}return qa.hash.getHashByteLength($e)<=qa.hash.getHashByteLength(rt)?rt:$e}async function dh(Ae,Se=[],Ce=new Date,qe=[],Fe=dr){const $e={symmetric:nr.symmetric.aes128,aead:nr.aead.eax,compression:nr.compression.uncompressed}[Ae],rt={symmetric:Fe.preferredSymmetricAlgorithm,aead:Fe.preferredAEADAlgorithm,compression:Fe.preferredCompressionAlgorithm}[Ae],it={symmetric:"preferredSymmetricAlgorithms",aead:"preferredAEADAlgorithms",compression:"preferredCompressionAlgorithms"}[Ae],nt=await Promise.all(Se.map((async function(Ae,Se){const $e=(await Ae.getPrimaryUser(Ce,qe[Se],Fe)).selfCertification[it];return!!$e&&$e.indexOf(rt)>=0})));return nt.every(Boolean)?rt:$e}async function fh(Ae,Se,Ce,qe,Fe,$e,rt=[],it=!1,nt){if(Ce.isDummy())throw Error("Cannot sign with a gnu-dummy key.");if(!Ce.isDecrypted())throw Error("Signing key is not decrypted.");const st=new Eu;return Object.assign(st,qe),st.publicKeyAlgorithm=Ce.algorithm,st.hashAlgorithm=await hh(Se,Ce,Fe,$e,nt),st.rawNotations=rt,await st.sign(Ce,Ae,Fe,it),st}async function lh(Ae,Se,Ce,qe=new Date,Fe){(Ae=Ae[Ce])&&(Se[Ce].length?await Promise.all(Ae.map((async function(Ae){Ae.isExpired(qe)||Fe&&!await Fe(Ae)||Se[Ce].some((function(Se){return ar.equalsUint8Array(Se.writeParams(),Ae.writeParams())}))||Se[Ce].push(Ae)}))):Se[Ce]=Ae)}async function ph(Ae,Se,Ce,qe,Fe,$e,rt=new Date,it){$e=$e||Ae;const nt=[];return await Promise.all(qe.map((async function(Ae){try{Fe&&!Ae.issuerKeyID.equals(Fe.issuerKeyID)||(await Ae.verify($e,Se,Ce,it.revocationsExpire?rt:null,!1,it),nt.push(Ae.issuerKeyID))}catch(Ae){}}))),Fe?(Fe.revoked=!!nt.some((Ae=>Ae.equals(Fe.issuerKeyID)))||(Fe.revoked||!1),Fe.revoked):nt.length>0}function yh(Ae,Se){let Ce;return!1===Se.keyNeverExpires&&(Ce=Ae.created.getTime()+1e3*Se.keyExpirationTime),Ce?new Date(Ce):1/0}function bh(Ae,Se={}){switch(Ae.type=Ae.type||Se.type,Ae.curve=Ae.curve||Se.curve,Ae.rsaBits=Ae.rsaBits||Se.rsaBits,Ae.keyExpirationTime=void 0!==Ae.keyExpirationTime?Ae.keyExpirationTime:Se.keyExpirationTime,Ae.passphrase=ar.isString(Ae.passphrase)?Ae.passphrase:Se.passphrase,Ae.date=Ae.date||Se.date,Ae.sign=Ae.sign||!1,Ae.type){case"ecc":try{Ae.curve=nr.write(nr.curve,Ae.curve)}catch(Ae){throw Error("Unknown curve")}Ae.curve!==nr.curve.ed25519Legacy&&Ae.curve!==nr.curve.curve25519Legacy||(Ae.curve=Ae.sign?nr.curve.ed25519Legacy:nr.curve.curve25519Legacy),Ae.sign?Ae.algorithm=Ae.curve===nr.curve.ed25519Legacy?nr.publicKey.eddsaLegacy:nr.publicKey.ecdsa:Ae.algorithm=nr.publicKey.ecdh;break;case"rsa":Ae.algorithm=nr.publicKey.rsaEncryptSign;break;default:throw Error("Unsupported key type "+Ae.type)}return Ae}function gh(Ae,Se){const Ce=Ae.algorithm;return Ce!==nr.publicKey.rsaEncrypt&&Ce!==nr.publicKey.elgamal&&Ce!==nr.publicKey.ecdh&&Ce!==nr.publicKey.x25519&&(!Se.keyFlags||0!=(Se.keyFlags[0]&nr.keyFlags.signData))}function mh(Ae,Se){const Ce=Ae.algorithm;return Ce!==nr.publicKey.dsa&&Ce!==nr.publicKey.rsaSign&&Ce!==nr.publicKey.ecdsa&&Ce!==nr.publicKey.eddsaLegacy&&Ce!==nr.publicKey.ed25519&&(!Se.keyFlags||0!=(Se.keyFlags[0]&nr.keyFlags.encryptCommunication)||0!=(Se.keyFlags[0]&nr.keyFlags.encryptStorage))}function wh(Ae,Se){return!!Se.allowInsecureDecryptionWithSigningKeys||(!Ae.keyFlags||0!=(Ae.keyFlags[0]&nr.keyFlags.encryptCommunication)||0!=(Ae.keyFlags[0]&nr.keyFlags.encryptStorage))}function vh(Ae,Se){const Ce=nr.write(nr.publicKey,Ae.algorithm),qe=Ae.getAlgorithmInfo();if(Se.rejectPublicKeyAlgorithms.has(Ce))throw Error(qe.algorithm+" keys are considered too weak.");switch(Ce){case nr.publicKey.rsaEncryptSign:case nr.publicKey.rsaSign:case nr.publicKey.rsaEncrypt:if(qe.bitsAe.getKeys(it).length>0));return 0===nt.length?null:(await Promise.all(nt.map((async Se=>{const $e=await Se.getSigningKey(it,Ae.created,void 0,qe);if(Ae.revoked||await Fe.isRevoked(Ae,$e.keyPacket,Ce,qe))throw Error("User certificate is revoked");try{await Ae.verify($e.keyPacket,nr.signature.certGeneric,rt,Ce,void 0,qe)}catch(Ae){throw ar.wrapError("User certificate is invalid",Ae)}}))),!0)}async verifyAllCertifications(Ae,Se=new Date,Ce){const qe=this,Fe=this.selfCertifications.concat(this.otherCertifications);return Promise.all(Fe.map((async Fe=>({keyID:Fe.issuerKeyID,valid:await qe.verifyCertificate(Fe,Ae,Se,Ce).catch((()=>!1))}))))}async verify(Ae=new Date,Se){if(!this.selfCertifications.length)throw Error("No self-certifications found");const Ce=this,qe=this.mainKey.keyPacket,Fe={userID:this.userID,userAttribute:this.userAttribute,key:qe};let $e;for(let rt=this.selfCertifications.length-1;rt>=0;rt--)try{const $e=this.selfCertifications[rt];if($e.revoked||await Ce.isRevoked($e,void 0,Ae,Se))throw Error("Self-certification is revoked");try{await $e.verify(qe,nr.signature.certGeneric,Fe,Ae,void 0,Se)}catch(Ae){throw ar.wrapError("Self-certification is invalid",Ae)}return!0}catch(Ae){$e=Ae}throw $e}async update(Ae,Se,Ce){const qe=this.mainKey.keyPacket,Fe={userID:this.userID,userAttribute:this.userAttribute,key:qe};await lh(Ae,this,"selfCertifications",Se,(async function(Ae){try{return await Ae.verify(qe,nr.signature.certGeneric,Fe,Se,!1,Ce),!0}catch(Ae){return!1}})),await lh(Ae,this,"otherCertifications",Se),await lh(Ae,this,"revocationSignatures",Se,(function(Ae){return ph(qe,nr.signature.certRevocation,Fe,[Ae],void 0,void 0,Se,Ce)}))}async revoke(Ae,{flag:Se=nr.reasonForRevocation.noReason,string:Ce=""}={},qe=new Date,Fe=dr){const $e={userID:this.userID,userAttribute:this.userAttribute,key:Ae},rt=new _h($e.userID||$e.userAttribute,this.mainKey);return rt.revocationSignatures.push(await fh($e,null,Ae,{signatureType:nr.signature.certRevocation,reasonForRevocationFlag:nr.write(nr.reasonForRevocation,Se),reasonForRevocationString:Ce},qe,void 0,void 0,!1,Fe)),await rt.update(this),rt}}class kh{constructor(Ae,Se){this.keyPacket=Ae,this.bindingSignatures=[],this.revocationSignatures=[],this.mainKey=Se}toPacketList(){const Ae=new Ku;return Ae.push(this.keyPacket),Ae.push(...this.revocationSignatures),Ae.push(...this.bindingSignatures),Ae}clone(){const Ae=new kh(this.keyPacket,this.mainKey);return Ae.bindingSignatures=[...this.bindingSignatures],Ae.revocationSignatures=[...this.revocationSignatures],Ae}async isRevoked(Ae,Se,Ce=new Date,qe=dr){const Fe=this.mainKey.keyPacket;return ph(Fe,nr.signature.subkeyRevocation,{key:Fe,bind:this.keyPacket},this.revocationSignatures,Ae,Se,Ce,qe)}async verify(Ae=new Date,Se=dr){const Ce=this.mainKey.keyPacket,qe={key:Ce,bind:this.keyPacket},Fe=await oh(this.bindingSignatures,Ce,nr.signature.subkeyBinding,qe,Ae,Se);if(Fe.revoked||await this.isRevoked(Fe,null,Ae,Se))throw Error("Subkey is revoked");if(ch(this.keyPacket,Fe,Ae))throw Error("Subkey is expired");return Fe}async getExpirationTime(Ae=new Date,Se=dr){const Ce=this.mainKey.keyPacket,qe={key:Ce,bind:this.keyPacket};let Fe;try{Fe=await oh(this.bindingSignatures,Ce,nr.signature.subkeyBinding,qe,Ae,Se)}catch(Ae){return null}const $e=yh(this.keyPacket,Fe),rt=Fe.getExpirationTime();return $eFe.bindingSignatures[Se].created&&(Fe.bindingSignatures[Se]=Ae),!1;try{return await Ae.verify(qe,nr.signature.subkeyBinding,$e,Se,void 0,Ce),!0}catch(Ae){return!1}})),await lh(Ae,this,"revocationSignatures",Se,(function(Ae){return ph(qe,nr.signature.subkeyRevocation,$e,[Ae],void 0,void 0,Se,Ce)}))}async revoke(Ae,{flag:Se=nr.reasonForRevocation.noReason,string:Ce=""}={},qe=new Date,Fe=dr){const $e={key:Ae,bind:this.keyPacket},rt=new kh(this.keyPacket,this.mainKey);return rt.revocationSignatures.push(await fh($e,null,Ae,{signatureType:nr.signature.subkeyRevocation,reasonForRevocationFlag:nr.write(nr.reasonForRevocation,Se),reasonForRevocationString:Ce},qe,void 0,void 0,!1,Fe)),await rt.update(this),rt}hasSameFingerprintAs(Ae){return this.keyPacket.hasSameFingerprintAs(Ae.keyPacket||Ae)}}["getKeyID","getFingerprint","getAlgorithmInfo","getCreationTime","isDecrypted"].forEach((Ae=>{kh.prototype[Ae]=function(){return this.keyPacket[Ae]()}}));const ly=ar.constructAllowedPackets([Eu]),yy=new Set([nr.packet.publicKey,nr.packet.privateKey]),gy=new Set([nr.packet.publicKey,nr.packet.privateKey,nr.packet.publicSubkey,nr.packet.privateSubkey]);class Ph{packetListToStructure(Ae,Se=new Set){let Ce,qe,Fe,$e;for(const rt of Ae){if(rt instanceof Rn){gy.has(rt.tag)&&!$e&&($e=yy.has(rt.tag)?yy:gy);continue}const Ae=rt.constructor.tag;if($e){if(!$e.has(Ae))continue;$e=null}if(Se.has(Ae))throw Error("Unexpected packet type: "+Ae);switch(Ae){case nr.packet.publicKey:case nr.packet.secretKey:if(this.keyPacket)throw Error("Key block contains multiple keys");if(this.keyPacket=rt,qe=this.getKeyID(),!qe)throw Error("Missing Key ID");break;case nr.packet.userID:case nr.packet.userAttribute:Ce=new _h(rt,this),this.users.push(Ce);break;case nr.packet.publicSubkey:case nr.packet.secretSubkey:Ce=null,Fe=new kh(rt,this),this.subkeys.push(Fe);break;case nr.packet.signature:switch(rt.signatureType){case nr.signature.certGeneric:case nr.signature.certPersona:case nr.signature.certCasual:case nr.signature.certPositive:if(!Ce){ar.printDebug("Dropping certification signatures without preceding user packet");continue}rt.issuerKeyID.equals(qe)?Ce.selfCertifications.push(rt):Ce.otherCertifications.push(rt);break;case nr.signature.certRevocation:Ce?Ce.revocationSignatures.push(rt):this.directSignatures.push(rt);break;case nr.signature.key:this.directSignatures.push(rt);break;case nr.signature.subkeyBinding:if(!Fe){ar.printDebug("Dropping subkey binding signature without preceding subkey packet");continue}Fe.bindingSignatures.push(rt);break;case nr.signature.keyRevocation:this.revocationSignatures.push(rt);break;case nr.signature.subkeyRevocation:if(!Fe){ar.printDebug("Dropping subkey revocation signature without preceding subkey packet");continue}Fe.revocationSignatures.push(rt)}}}}toPacketList(){const Ae=new Ku;return Ae.push(this.keyPacket),Ae.push(...this.revocationSignatures),Ae.push(...this.directSignatures),this.users.map((Se=>Ae.push(...Se.toPacketList()))),this.subkeys.map((Se=>Ae.push(...Se.toPacketList()))),Ae}clone(Ae=!1){const Se=new this.constructor(this.toPacketList());return Ae&&Se.getKeys().forEach((Ae=>{if(Ae.keyPacket=Object.create(Object.getPrototypeOf(Ae.keyPacket),Object.getOwnPropertyDescriptors(Ae.keyPacket)),!Ae.keyPacket.isDecrypted())return;const Se={};Object.keys(Ae.keyPacket.privateParams).forEach((Ce=>{Se[Ce]=new Uint8Array(Ae.keyPacket.privateParams[Ce])})),Ae.keyPacket.privateParams=Se})),Se}getSubkeys(Ae=null){return this.subkeys.filter((Se=>!Ae||Se.getKeyID().equals(Ae,!0)))}getKeys(Ae=null){const Se=[];return Ae&&!this.getKeyID().equals(Ae,!0)||Se.push(this),Se.concat(this.getSubkeys(Ae))}getKeyIDs(){return this.getKeys().map((Ae=>Ae.getKeyID()))}getUserIDs(){return this.users.map((Ae=>Ae.userID?Ae.userID.userID:null)).filter((Ae=>null!==Ae))}write(){return this.toPacketList().write()}async getSigningKey(Ae=null,Se=new Date,Ce={},qe=dr){await this.verifyPrimaryKey(Se,Ce,qe);const Fe=this.keyPacket,$e=this.subkeys.slice().sort(((Ae,Se)=>Se.keyPacket.created-Ae.keyPacket.created));let rt;for(const Ce of $e)if(!Ae||Ce.getKeyID().equals(Ae))try{await Ce.verify(Se,qe);const Ae={key:Fe,bind:Ce.keyPacket},$e=await oh(Ce.bindingSignatures,Fe,nr.signature.subkeyBinding,Ae,Se,qe);if(!gh(Ce.keyPacket,$e))continue;if(!$e.embeddedSignature)throw Error("Missing embedded signature");return await oh([$e.embeddedSignature],Ce.keyPacket,nr.signature.keyBinding,Ae,Se,qe),vh(Ce.keyPacket,qe),Ce}catch(Ae){rt=Ae}try{const $e=await this.getPrimaryUser(Se,Ce,qe);if((!Ae||Fe.getKeyID().equals(Ae))&&gh(Fe,$e.selfCertification))return vh(Fe,qe),this}catch(Ae){rt=Ae}throw ar.wrapError("Could not find valid signing key packet in key "+this.getKeyID().toHex(),rt)}async getEncryptionKey(Ae,Se=new Date,Ce={},qe=dr){await this.verifyPrimaryKey(Se,Ce,qe);const Fe=this.keyPacket,$e=this.subkeys.slice().sort(((Ae,Se)=>Se.keyPacket.created-Ae.keyPacket.created));let rt;for(const Ce of $e)if(!Ae||Ce.getKeyID().equals(Ae))try{await Ce.verify(Se,qe);const Ae={key:Fe,bind:Ce.keyPacket},$e=await oh(Ce.bindingSignatures,Fe,nr.signature.subkeyBinding,Ae,Se,qe);if(mh(Ce.keyPacket,$e))return vh(Ce.keyPacket,qe),Ce}catch(Ae){rt=Ae}try{const $e=await this.getPrimaryUser(Se,Ce,qe);if((!Ae||Fe.getKeyID().equals(Ae))&&mh(Fe,$e.selfCertification))return vh(Fe,qe),this}catch(Ae){rt=Ae}throw ar.wrapError("Could not find valid encryption key packet in key "+this.getKeyID().toHex(),rt)}async isRevoked(Ae,Se,Ce=new Date,qe=dr){return ph(this.keyPacket,nr.signature.keyRevocation,{key:this.keyPacket},this.revocationSignatures,Ae,Se,Ce,qe)}async verifyPrimaryKey(Ae=new Date,Se={},Ce=dr){const qe=this.keyPacket;if(await this.isRevoked(null,null,Ae,Ce))throw Error("Primary key is revoked");const{selfCertification:Fe}=await this.getPrimaryUser(Ae,Se,Ce);if(ch(qe,Fe,Ae))throw Error("Primary key is expired");const $e=await oh(this.directSignatures,qe,nr.signature.key,{key:qe},Ae,Ce).catch((()=>{}));if($e&&ch(qe,$e,Ae))throw Error("Primary key is expired")}async getExpirationTime(Ae,Se=dr){let Ce;try{const{selfCertification:qe}=await this.getPrimaryUser(null,Ae,Se),Fe=yh(this.keyPacket,qe),$e=qe.getExpirationTime(),rt=await oh(this.directSignatures,this.keyPacket,nr.signature.key,{key:this.keyPacket},null,Se).catch((()=>{}));if(rt){const Ae=yh(this.keyPacket,rt);Ce=Math.min(Fe,$e,Ae)}else Ce=Fe<$e?Fe:$e}catch(Ae){Ce=null}return ar.normalizeDate(Ce)}async getPrimaryUser(Ae=new Date,Se={},Ce=dr){const qe=this.keyPacket,Fe=[];let $e;for(let rt=0;rtAe.subkeys.some((Ae=>Se.hasSameFingerprintAs(Ae)))))))throw Error("Cannot update public key with private key if subkeys mismatch");return Ae.update(this,Ce)}const qe=this.clone();return await lh(Ae,qe,"revocationSignatures",Se,(Fe=>ph(qe.keyPacket,nr.signature.keyRevocation,qe,[Fe],null,Ae.keyPacket,Se,Ce))),await lh(Ae,qe,"directSignatures",Se),await Promise.all(Ae.users.map((async Ae=>{const Fe=qe.users.filter((Se=>Ae.userID&&Ae.userID.equals(Se.userID)||Ae.userAttribute&&Ae.userAttribute.equals(Se.userAttribute)));if(Fe.length>0)await Promise.all(Fe.map((qe=>qe.update(Ae,Se,Ce))));else{const Se=Ae.clone();Se.mainKey=qe,qe.users.push(Se)}}))),await Promise.all(Ae.subkeys.map((async Ae=>{const Fe=qe.subkeys.filter((Se=>Se.hasSameFingerprintAs(Ae)));if(Fe.length>0)await Promise.all(Fe.map((qe=>qe.update(Ae,Se,Ce))));else{const Se=Ae.clone();Se.mainKey=qe,qe.subkeys.push(Se)}}))),qe}async getRevocationCertificate(Ae=new Date,Se=dr){const Ce={key:this.keyPacket},qe=await oh(this.revocationSignatures,this.keyPacket,nr.signature.keyRevocation,Ce,Ae,Se),Fe=new Ku;return Fe.push(qe),Me(nr.armor.publicKey,Fe.write(),null,null,"This is a revocation certificate")}async applyRevocationCertificate(Ae,Se=new Date,Ce=dr){const qe=await xe(Ae,Ce),Fe=(await Ku.fromBinary(qe.data,ly,Ce)).findPacket(nr.packet.signature);if(!Fe||Fe.signatureType!==nr.signature.keyRevocation)throw Error("Could not find revocation signature packet");if(!Fe.issuerKeyID.equals(this.getKeyID()))throw Error("Revocation signature does not match key");try{await Fe.verify(this.keyPacket,nr.signature.keyRevocation,{key:this.keyPacket},Se,void 0,Ce)}catch(Ae){throw ar.wrapError("Could not verify revocation signature",Ae)}const $e=this.clone();return $e.revocationSignatures.push(Fe),$e}async signPrimaryUser(Ae,Se,Ce,qe=dr){const{index:Fe,user:$e}=await this.getPrimaryUser(Se,Ce,qe),rt=await $e.certify(Ae,Se,qe),it=this.clone();return it.users[Fe]=rt,it}async signAllUsers(Ae,Se=new Date,Ce=dr){const qe=this.clone();return qe.users=await Promise.all(this.users.map((function(qe){return qe.certify(Ae,Se,Ce)}))),qe}async verifyPrimaryUser(Ae,Se=new Date,Ce,qe=dr){const Fe=this.keyPacket,{user:$e}=await this.getPrimaryUser(Se,Ce,qe);return Ae?await $e.verifyAllCertifications(Ae,Se,qe):[{keyID:Fe.getKeyID(),valid:await $e.verify(Se,qe).catch((()=>!1))}]}async verifyAllUsers(Ae,Se=new Date,Ce=dr){const qe=this.keyPacket,Fe=[];return await Promise.all(this.users.map((async $e=>{const rt=Ae?await $e.verifyAllCertifications(Ae,Se,Ce):[{keyID:qe.getKeyID(),valid:await $e.verify(Se,Ce).catch((()=>!1))}];Fe.push(...rt.map((Ae=>({userID:$e.userID?$e.userID.userID:null,userAttribute:$e.userAttribute,keyID:Ae.keyID,valid:Ae.valid}))))}))),Fe}}["getKeyID","getFingerprint","getAlgorithmInfo","getCreationTime","hasSameFingerprintAs"].forEach((Ae=>{Ph.prototype[Ae]=kh.prototype[Ae]}));class xh extends Ph{constructor(Ae){if(super(),this.keyPacket=null,this.revocationSignatures=[],this.directSignatures=[],this.users=[],this.subkeys=[],Ae&&(this.packetListToStructure(Ae,new Set([nr.packet.secretKey,nr.packet.secretSubkey])),!this.keyPacket))throw Error("Invalid key: missing public-key packet")}isPrivate(){return!1}toPublic(){return this}armor(Ae=dr){return Me(nr.armor.publicKey,this.toPacketList().write(),void 0,void 0,void 0,Ae)}}class Mh extends xh{constructor(Ae){if(super(),this.packetListToStructure(Ae,new Set([nr.packet.publicKey,nr.packet.publicSubkey])),!this.keyPacket)throw Error("Invalid key: missing private-key packet")}isPrivate(){return!0}toPublic(){const Ae=new Ku,Se=this.toPacketList();for(const Ce of Se)switch(Ce.constructor.tag){case nr.packet.secretKey:{const Se=Vu.fromSecretKeyPacket(Ce);Ae.push(Se);break}case nr.packet.secretSubkey:{const Se=Xu.fromSecretSubkeyPacket(Ce);Ae.push(Se);break}default:Ae.push(Ce)}return new xh(Ae)}armor(Ae=dr){return Me(nr.armor.privateKey,this.toPacketList().write(),void 0,void 0,void 0,Ae)}async getDecryptionKeys(Ae,Se=new Date,Ce={},qe=dr){const Fe=this.keyPacket,$e=[];for(let Ce=0;CeAe.isDecrypted()))}async validate(Ae=dr){if(!this.isPrivate())throw Error("Cannot validate a public key");let Se;if(this.keyPacket.isDummy()){const Ce=await this.getSigningKey(null,null,void 0,{...Ae,rejectPublicKeyAlgorithms:new Set,minRSABits:0});Ce&&!Ce.keyPacket.isDummy()&&(Se=Ce.keyPacket)}else Se=this.keyPacket;if(Se)return Se.validate();{const Ae=this.getKeys(),Se=Ae.map((Ae=>Ae.keyPacket.isDummy())).every(Boolean);if(Se)throw Error("Cannot validate an all-gnu-dummy key");return Promise.all(Ae.map((async Ae=>Ae.keyPacket.validate())))}}clearPrivateParams(){this.getKeys().forEach((({keyPacket:Ae})=>{Ae.isDecrypted()&&Ae.clearPrivateParams()}))}async revoke({flag:Ae=nr.reasonForRevocation.noReason,string:Se=""}={},Ce=new Date,qe=dr){if(!this.isPrivate())throw Error("Need private key for revoking");const Fe={key:this.keyPacket},$e=this.clone();return $e.revocationSignatures.push(await fh(Fe,null,this.keyPacket,{signatureType:nr.signature.keyRevocation,reasonForRevocationFlag:nr.write(nr.reasonForRevocation,Ae),reasonForRevocationString:Se},Ce,void 0,void 0,void 0,qe)),$e}async addSubkey(Ae={}){const Se={...dr,...Ae.config};if(Ae.passphrase)throw Error("Subkey could not be encrypted here, please encrypt whole key");if(Ae.rsaBitsAe!==Se))]}const $e=th.fromObject(Se),rt={};rt.userID=$e,rt.key=Ae;const it={};it.signatureType=nr.signature.certGeneric,it.keyFlags=[nr.keyFlags.certifyKeys|nr.keyFlags.signData],it.preferredSymmetricAlgorithms=a([nr.symmetric.aes256,nr.symmetric.aes128,nr.symmetric.aes192],qe.preferredSymmetricAlgorithm),qe.aeadProtect&&(it.preferredAEADAlgorithms=a([nr.aead.eax,nr.aead.ocb],qe.preferredAEADAlgorithm)),it.preferredHashAlgorithms=a([nr.hash.sha256,nr.hash.sha512],qe.preferredHashAlgorithm),it.preferredCompressionAlgorithms=a([nr.compression.zlib,nr.compression.zip,nr.compression.uncompressed],qe.preferredCompressionAlgorithm),0===Fe&&(it.isPrimaryUserID=!0),it.features=[0],it.features[0]|=nr.features.modificationDetection,qe.aeadProtect&&(it.features[0]|=nr.features.aead),qe.v5Keys&&(it.features[0]|=nr.features.v5Keys),Ce.keyExpirationTime>0&&(it.keyExpirationTime=Ce.keyExpirationTime,it.keyNeverExpires=!1);return{userIDPacket:$e,signaturePacket:await fh(rt,null,Ae,it,Ce.date,void 0,void 0,void 0,qe)}}))).then((Ae=>{Ae.forEach((({userIDPacket:Ae,signaturePacket:Se})=>{Fe.push(Ae),Fe.push(Se)}))})),await Promise.all(Se.map((async function(Se,Fe){const $e=Ce.subkeys[Fe];return{secretSubkeyPacket:Se,subkeySignaturePacket:await uh(Se,Ae,$e,qe)}}))).then((Ae=>{Ae.forEach((({secretSubkeyPacket:Ae,subkeySignaturePacket:Se})=>{Fe.push(Ae),Fe.push(Se)}))}));const $e={key:Ae};return Fe.push(await fh($e,null,Ae,{signatureType:nr.signature.keyRevocation,reasonForRevocationFlag:nr.reasonForRevocation.noReason,reasonForRevocationString:""},Ce.date,void 0,void 0,void 0,qe)),Ce.passphrase&&Ae.clearPrivateParams(),await Promise.all(Se.map((async function(Ae,Se){Ce.subkeys[Se].passphrase&&Ae.clearPrivateParams()}))),new Mh(Fe)}const Ay=ar.constructAllowedPackets([ku,Du,Nu,Ou,Zu,ju,Gu,xu,Eu]),Ey=ar.constructAllowedPackets([Gu]),My=ar.constructAllowedPackets([Eu]);class Bh{constructor(Ae){this.packets=Ae||new Ku}getEncryptionKeyIDs(){const Ae=[];return this.packets.filterByTag(nr.packet.publicKeyEncryptedSessionKey).forEach((function(Se){Ae.push(Se.publicKeyID)})),Ae}getSigningKeyIDs(){const Ae=this.unwrapCompressed(),Se=Ae.packets.filterByTag(nr.packet.onePassSignature);if(Se.length>0)return Se.map((Ae=>Ae.issuerKeyID));return Ae.packets.filterByTag(nr.packet.signature).map((Ae=>Ae.issuerKeyID))}async decrypt(Ae,Se,Ce,qe=new Date,Fe=dr){const $e=Ce||await this.decryptSessionKeys(Ae,Se,qe,Fe),rt=this.packets.filterByTag(nr.packet.symmetricallyEncryptedData,nr.packet.symEncryptedIntegrityProtectedData,nr.packet.aeadEncryptedData);if(0===rt.length)throw Error("No encrypted data found");const it=rt[0];let nt=null;const st=Promise.all($e.map((async({algorithm:Ae,data:Se})=>{if(!ar.isUint8Array(Se)||!ar.isString(Ae))throw Error("Invalid session key for decryption.");try{const Ce=nr.write(nr.symmetric,Ae);await it.decrypt(Ce,Se,Fe)}catch(Ae){ar.printDebugError(Ae),nt=Ae}})));if(ne(it.encrypted),it.encrypted=null,await st,!it.packets||!it.packets.length)throw nt||Error("Decryption failed.");const ut=new Bh(it.packets);return it.packets=new Ku,ut}async decryptSessionKeys(Ae,Se,Ce=new Date,qe=dr){let Fe,$e=[];if(Se){const Ae=this.packets.filterByTag(nr.packet.symEncryptedSessionKey);if(0===Ae.length)throw Error("No symmetrically encrypted session key packet found.");await Promise.all(Se.map((async function(Se,Ce){let Fe;Fe=Ce?await Ku.fromBinary(Ae.write(),Ey,qe):Ae,await Promise.all(Fe.map((async function(Ae){try{await Ae.decrypt(Se),$e.push(Ae)}catch(Ae){ar.printDebugError(Ae)}})))})))}else{if(!Ae)throw Error("No key or password specified.");{const Se=this.packets.filterByTag(nr.packet.publicKeyEncryptedSessionKey);if(0===Se.length)throw Error("No public key encrypted session key packet found.");await Promise.all(Se.map((async function(Se){await Promise.all(Ae.map((async function(Ae){let rt=[nr.symmetric.aes256,nr.symmetric.aes128,nr.symmetric.tripledes,nr.symmetric.cast5];try{const Se=await Ae.getPrimaryUser(Ce,void 0,qe);Se.selfCertification.preferredSymmetricAlgorithms&&(rt=rt.concat(Se.selfCertification.preferredSymmetricAlgorithms))}catch(Ae){}const it=(await Ae.getDecryptionKeys(Se.publicKeyID,null,void 0,qe)).map((Ae=>Ae.keyPacket));await Promise.all(it.map((async function(Ae){if(!Ae||Ae.isDummy())return;if(!Ae.isDecrypted())throw Error("Decryption key is not decrypted.");if(qe.constantTimePKCS1Decryption&&(Se.publicKeyAlgorithm===nr.publicKey.rsaEncrypt||Se.publicKeyAlgorithm===nr.publicKey.rsaEncryptSign||Se.publicKeyAlgorithm===nr.publicKey.rsaSign||Se.publicKeyAlgorithm===nr.publicKey.elgamal)){const Ce=Se.write();await Promise.all(Array.from(qe.constantTimePKCS1DecryptionSupportedSymmetricAlgorithms).map((async Se=>{const qe=new ju;qe.read(Ce);const rt={sessionKeyAlgorithm:Se,sessionKey:qa.generateSessionKey(Se)};try{await qe.decrypt(Ae,rt),$e.push(qe)}catch(Ae){ar.printDebugError(Ae),Fe=Ae}})))}else try{if(await Se.decrypt(Ae),!rt.includes(nr.write(nr.symmetric,Se.sessionKeyAlgorithm)))throw Error("A non-preferred symmetric algorithm was used.");$e.push(Se)}catch(Ae){ar.printDebugError(Ae),Fe=Ae}})))}))),ne(Se.encrypted),Se.encrypted=null})))}}if($e.length>0){if($e.length>1){const Ae=new Set;$e=$e.filter((Se=>{const Ce=Se.sessionKeyAlgorithm+ar.uint8ArrayToString(Se.sessionKey);return!Ae.has(Ce)&&(Ae.add(Ce),!0)}))}return $e.map((Ae=>({data:Ae.sessionKey,algorithm:nr.read(nr.symmetric,Ae.sessionKeyAlgorithm)})))}throw Fe||Error("Session key decryption failed.")}getLiteralData(){const Ae=this.unwrapCompressed().packets.findPacket(nr.packet.literalData);return Ae&&Ae.getBytes()||null}getFilename(){const Ae=this.unwrapCompressed().packets.findPacket(nr.packet.literalData);return Ae&&Ae.getFilename()||null}getText(){const Ae=this.unwrapCompressed().packets.findPacket(nr.packet.literalData);return Ae?Ae.getText():null}static async generateSessionKey(Ae=[],Se=new Date,Ce=[],qe=dr){const Fe=await dh("symmetric",Ae,Se,Ce,qe),$e=nr.read(nr.symmetric,Fe),rt=qe.aeadProtect&&await async function(Ae,Se=new Date,Ce=[],qe=dr){let Fe=!0;return await Promise.all(Ae.map((async function(Ae,$e){const rt=await Ae.getPrimaryUser(Se,Ce[$e],qe);rt.selfCertification.features&&rt.selfCertification.features[0]&nr.features.aead||(Fe=!1)}))),Fe}(Ae,Se,Ce,qe)?nr.read(nr.aead,await dh("aead",Ae,Se,Ce,qe)):void 0;await Promise.all(Ae.map((Ae=>Ae.getEncryptionKey().catch((()=>null)).then((Ae=>{if(Ae&&Ae.keyPacket.algorithm===nr.publicKey.x25519&&!ar.isAES(Fe))throw Error("Could not generate a session key compatible with the given `encryptionKeys`: X22519 keys can only be used to encrypt AES session keys; change `config.preferredSymmetricAlgorithm` accordingly.")})))));return{data:qa.generateSessionKey(Fe),algorithm:$e,aeadAlgorithm:rt}}async encrypt(Ae,Se,Ce,qe=!1,Fe=[],$e=new Date,rt=[],it=dr){if(Ce){if(!ar.isUint8Array(Ce.data)||!ar.isString(Ce.algorithm))throw Error("Invalid session key for encryption.")}else if(Ae&&Ae.length)Ce=await Bh.generateSessionKey(Ae,$e,rt,it);else{if(!Se||!Se.length)throw Error("No keys, passwords, or session key provided.");Ce=await Bh.generateSessionKey(void 0,void 0,void 0,it)}const{data:nt,algorithm:st,aeadAlgorithm:ut}=Ce,ht=await Bh.encryptSessionKey(nt,st,ut,Ae,Se,qe,Fe,$e,rt,it);let ft;ut?(ft=new Nu,ft.aeadAlgorithm=nr.write(nr.aead,ut)):ft=new Ou,ft.packets=this.packets;const yt=nr.write(nr.symmetric,st);return await ft.encrypt(yt,nt,it),ht.packets.push(ft),ft.packets=new Ku,ht}static async encryptSessionKey(Ae,Se,Ce,qe,Fe,$e=!1,rt=[],it=new Date,nt=[],st=dr){const ut=new Ku,ht=nr.write(nr.symmetric,Se),ft=Ce&&nr.write(nr.aead,Ce);if(qe){const Se=await Promise.all(qe.map((async function(Se,Ce){const qe=await Se.getEncryptionKey(rt[Ce],it,nt,st),Fe=new ju;return Fe.publicKeyID=$e?Ke.wildcard():qe.getKeyID(),Fe.publicKeyAlgorithm=qe.keyPacket.algorithm,Fe.sessionKey=Ae,Fe.sessionKeyAlgorithm=ht,await Fe.encrypt(qe.keyPacket),delete Fe.sessionKey,Fe})));ut.push(...Se)}if(Fe){const t=async function(Ae,Se){try{return await Ae.decrypt(Se),1}catch(Ae){return 0}},r=(Ae,Se)=>Ae+Se,i=async function(Ae,Se,Ce,qe){const $e=new Gu(st);if($e.sessionKey=Ae,$e.sessionKeyAlgorithm=Se,Ce&&($e.aeadAlgorithm=Ce),await $e.encrypt(qe,st),st.passwordCollisionCheck){if(1!==(await Promise.all(Fe.map((Ae=>t($e,Ae))))).reduce(r))return i(Ae,Se,qe)}return delete $e.sessionKey,$e},Se=await Promise.all(Fe.map((Se=>i(Ae,ht,ft,Se))));ut.push(...Se)}return new Bh(ut)}async sign(Ae=[],Se=null,Ce=[],qe=new Date,Fe=[],$e=[],rt=dr){const it=new Ku,nt=this.packets.findPacket(nr.packet.literalData);if(!nt)throw Error("No literal data packet to sign.");let st,ut;const ht=null===nt.text?nr.signature.binary:nr.signature.text;if(Se)for(ut=Se.packets.filterByTag(nr.packet.signature),st=ut.length-1;st>=0;st--){const Se=ut[st],Ce=new xu;Ce.signatureType=Se.signatureType,Ce.hashAlgorithm=Se.hashAlgorithm,Ce.publicKeyAlgorithm=Se.publicKeyAlgorithm,Ce.issuerKeyID=Se.issuerKeyID,Ae.length||0!==st||(Ce.flags=1),it.push(Ce)}return await Promise.all(Array.from(Ae).reverse().map((async function(Se,$e){if(!Se.isPrivate())throw Error("Need private key for signing");const it=Ce[Ae.length-1-$e],nt=await Se.getSigningKey(it,qe,Fe,rt),st=new xu;return st.signatureType=ht,st.hashAlgorithm=await hh(Se,nt.keyPacket,qe,Fe,rt),st.publicKeyAlgorithm=nt.keyPacket.algorithm,st.issuerKeyID=nt.getKeyID(),$e===Ae.length-1&&(st.flags=1),st}))).then((Ae=>{Ae.forEach((Ae=>it.push(Ae)))})),it.push(nt),it.push(...await Th(nt,Ae,Se,Ce,qe,Fe,$e,!1,rt)),new Bh(it)}compress(Ae,Se=dr){if(Ae===nr.compression.uncompressed)return this;const Ce=new Du(Se);Ce.algorithm=Ae,Ce.packets=this.packets;const qe=new Ku;return qe.push(Ce),new Bh(qe)}async signDetached(Ae=[],Se=null,Ce=[],qe=new Date,Fe=[],$e=[],rt=dr){const it=this.packets.findPacket(nr.packet.literalData);if(!it)throw Error("No literal data packet to sign.");return new nh(await Th(it,Ae,Se,Ce,qe,Fe,$e,!0,rt))}async verify(Ae,Se=new Date,Ce=dr){const qe=this.unwrapCompressed(),Fe=qe.packets.filterByTag(nr.packet.literalData);if(1!==Fe.length)throw Error("Can only verify message with one literal data packet.");_(qe.packets.stream)&&qe.packets.push(...await ie(qe.packets.stream,(Ae=>Ae||[])));const $e=qe.packets.filterByTag(nr.packet.onePassSignature).reverse(),rt=qe.packets.filterByTag(nr.packet.signature);return $e.length&&!rt.length&&ar.isStream(qe.packets.stream)&&!_(qe.packets.stream)?(await Promise.all($e.map((async Ae=>{Ae.correspondingSig=new Promise(((Se,Ce)=>{Ae.correspondingSigResolve=Se,Ae.correspondingSigReject=Ce})),Ae.signatureData=ae((async()=>(await Ae.correspondingSig).signatureData)),Ae.hashed=ie(await Ae.hash(Ae.signatureType,Fe[0],void 0,!1)),Ae.hashed.catch((()=>{}))}))),qe.packets.stream=Y(qe.packets.stream,(async(Ae,Se)=>{const Ce=W(Ae),qe=G(Se);try{for(let Ae=0;Ae<$e.length;Ae++){const{value:Se}=await Ce.read();$e[Ae].correspondingSigResolve(Se)}await Ce.readToEnd(),await qe.ready,await qe.close()}catch(Ae){$e.forEach((Se=>{Se.correspondingSigReject(Ae)})),await qe.abort(Ae)}})),zh($e,Fe,Ae,Se,!1,Ce)):zh(rt,Fe,Ae,Se,!1,Ce)}verifyDetached(Ae,Se,Ce=new Date,qe=dr){const Fe=this.unwrapCompressed().packets.filterByTag(nr.packet.literalData);if(1!==Fe.length)throw Error("Can only verify message with one literal data packet.");return zh(Ae.packets.filterByTag(nr.packet.signature),Fe,Se,Ce,!0,qe)}unwrapCompressed(){const Ae=this.packets.filterByTag(nr.packet.compressedData);return Ae.length?new Bh(Ae[0].packets):this}async appendSignature(Ae,Se=dr){await this.packets.read(ar.isUint8Array(Ae)?Ae:(await xe(Ae)).data,My,Se)}write(){return this.packets.write()}armor(Ae=dr){return Me(nr.armor.message,this.write(),null,null,null,Ae)}}async function Th(Ae,Se,Ce=null,qe=[],Fe=new Date,$e=[],rt=[],it=!1,nt=dr){const st=new Ku,ut=null===Ae.text?nr.signature.binary:nr.signature.text;if(await Promise.all(Se.map((async(Se,Ce)=>{const st=$e[Ce];if(!Se.isPrivate())throw Error("Need private key for signing");const ht=await Se.getSigningKey(qe[Ce],Fe,st,nt);return fh(Ae,Se,ht.keyPacket,{signatureType:ut},Fe,st,rt,it,nt)}))).then((Ae=>{st.push(...Ae)})),Ce){const Ae=Ce.packets.filterByTag(nr.packet.signature);st.push(...Ae)}return st}async function zh(Ae,Se,Ce,qe=new Date,Fe=!1,$e=dr){return Promise.all(Ae.filter((function(Ae){return["text","binary"].includes(nr.read(nr.signature,Ae.signatureType))})).map((async function(Ae){return async function(Ae,Se,Ce,qe=new Date,Fe=!1,$e=dr){let rt,it;for(const Se of Ce){const Ce=Se.getKeys(Ae.issuerKeyID);if(Ce.length>0){rt=Se,it=Ce[0];break}}const nt=Ae instanceof xu?Ae.correspondingSig:Ae,st={keyID:Ae.issuerKeyID,verified:(async()=>{if(!it)throw Error("Could not find signing key with key ID "+Ae.issuerKeyID.toHex());await Ae.verify(it.keyPacket,Ae.signatureType,Se[0],qe,Fe,$e);const Ce=await nt;if(it.getCreationTime()>Ce.created)throw Error("Key is newer than the signature");try{await rt.getSigningKey(it.getKeyID(),Ce.created,void 0,$e)}catch(Ae){if(!$e.allowInsecureVerificationWithReformattedKeys||!Ae.message.match(/Signature creation time is in the future/))throw Ae;await rt.getSigningKey(it.getKeyID(),qe,void 0,$e)}return!0})(),signature:(async()=>{const Ae=await nt,Se=new Ku;return Ae&&Se.push(Ae),new nh(Se)})()};return st.signature.catch((()=>{})),st.verified.catch((()=>{})),st}(Ae,Se,Ce,qe,Fe,$e)})))}const xy=ar.constructAllowedPackets([Eu]);class Fh{constructor(Ae,Se){if(this.text=ar.removeTrailingSpaces(Ae).replace(/\r?\n/g,"\r\n"),Se&&!(Se instanceof nh))throw Error("Invalid signature input");this.signature=Se||new nh(new Ku)}getSigningKeyIDs(){const Ae=[];return this.signature.packets.forEach((function(Se){Ae.push(Se.issuerKeyID)})),Ae}async sign(Ae,Se=null,Ce=[],qe=new Date,Fe=[],$e=[],rt=dr){const it=new ku;it.setText(this.text);const nt=new nh(await Th(it,Ae,Se,Ce,qe,Fe,$e,!0,rt));return new Fh(this.text,nt)}verify(Ae,Se=new Date,Ce=dr){const qe=this.signature.packets.filterByTag(nr.packet.signature),Fe=new ku;return Fe.setText(this.text),zh(qe,[Fe],Ae,Se,!0,Ce)}getText(){return this.text.replace(/\r\n/g,"\n")}armor(Ae=dr){let Se=this.signature.packets.map((function(Ae){return nr.read(nr.hash,Ae.hashAlgorithm).toUpperCase()}));Se=Se.filter((function(Ae,Se,Ce){return Ce.indexOf(Ae)===Se}));const Ce={hash:Se.join(),text:this.text,data:this.signature.packets.write()};return Me(nr.armor.signed,Ce,void 0,void 0,void 0,Ae)}}function Oh(Ae){if(!(Ae instanceof Bh))throw Error("Parameter [message] needs to be of type Message")}function Lh(Ae){if(!(Ae instanceof Fh||Ae instanceof Bh))throw Error("Parameter [message] needs to be of type Message or CleartextMessage")}function Nh(Ae){if("armored"!==Ae&&"binary"!==Ae&&"object"!==Ae)throw Error("Unsupported format "+Ae)}const Cy=Object.keys(dr).length;function Hh(Ae){const Se=Object.keys(Ae);if(Se.length!==Cy)for(const Ae of Se)if(void 0===dr[Ae])throw Error("Unknown config property: "+Ae)}function Wh(Ae){return Ae&&!ar.isArray(Ae)&&(Ae=[Ae]),Ae}async function Gh(Ae,Se,Ce="utf8"){const qe=ar.isStream(Ae);return"array"===qe?ie(Ae):"node"===Se?(Ae=Gt(Ae),"binary"!==Ce&&Ae.setEncoding(Ce),Ae):"web"===Se&&"ponyfill"===qe?Zt(Ae):Ae}function Vh(Ae,Se){Ae.data=Y(Se.packets.stream,(async(Se,Ce)=>{await V(Ae.data,Ce,{preventClose:!0});const qe=G(Ce);try{await ie(Se,(Ae=>Ae)),await qe.close()}catch(Ae){await qe.abort(Ae)}}))}function $h(Ae,Se,Ce){switch(Se){case"object":return Ae;case"armored":return Ae.armor(Ce);case"binary":return Ae.write();default:throw Error("Unsupported format "+Se)}}const Dy="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?Symbol:Ae=>`Symbol(${Ae})`;function Xh(){}const Ry="undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:void 0;function Qh(Ae){return"object"==typeof Ae&&null!==Ae||"function"==typeof Ae}const By=Xh,Ky=Promise,Ty=Promise.prototype.then,Uy=Promise.resolve.bind(Ky),Oy=Promise.reject.bind(Ky);function nd(Ae){return new Ky(Ae)}function ad(Ae){return Uy(Ae)}function sd(Ae){return Oy(Ae)}function od(Ae,Se,Ce){return Ty.call(Ae,Se,Ce)}function cd(Ae,Se,Ce){od(od(Ae,Se,Ce),void 0,By)}function ud(Ae,Se){cd(Ae,Se)}function hd(Ae,Se){cd(Ae,void 0,Se)}function dd(Ae,Se,Ce){return od(Ae,Se,Ce)}function fd(Ae){od(Ae,void 0,By)}const jy=(()=>{const Ae=Ry&&Ry.queueMicrotask;if("function"==typeof Ae)return Ae;const Se=ad(void 0);return Ae=>od(Se,Ae)})();function pd(Ae,Se,Ce){if("function"!=typeof Ae)throw new TypeError("Argument is not a function");return Function.prototype.apply.call(Ae,Se,Ce)}function yd(Ae,Se,Ce){try{return ad(pd(Ae,Se,Ce))}catch(Ae){return sd(Ae)}}class bd{constructor(){this._cursor=0,this._size=0,this._front={_elements:[],_next:void 0},this._back=this._front,this._cursor=0,this._size=0}get length(){return this._size}push(Ae){const Se=this._back;let Ce=Se;16383===Se._elements.length&&(Ce={_elements:[],_next:void 0}),Se._elements.push(Ae),Ce!==Se&&(this._back=Ce,Se._next=Ce),++this._size}shift(){const Ae=this._front;let Se=Ae;const Ce=this._cursor;let qe=Ce+1;const Fe=Ae._elements,$e=Fe[Ce];return 16384===qe&&(Se=Ae._next,qe=0),--this._size,this._cursor=qe,Ae!==Se&&(this._front=Se),Fe[Ce]=void 0,$e}forEach(Ae){let Se=this._cursor,Ce=this._front,qe=Ce._elements;for(;!(Se===qe.length&&void 0===Ce._next||Se===qe.length&&(Ce=Ce._next,qe=Ce._elements,Se=0,0===qe.length));)Ae(qe[Se]),++Se}peek(){const Ae=this._front,Se=this._cursor;return Ae._elements[Se]}}function gd(Ae,Se){Ae._ownerReadableStream=Se,Se._reader=Ae,"readable"===Se._state?_d(Ae):"closed"===Se._state?function(Ae){_d(Ae),Sd(Ae)}(Ae):kd(Ae,Se._storedError)}function md(Ae,Se){return rp(Ae._ownerReadableStream,Se)}function wd(Ae){"readable"===Ae._ownerReadableStream._state?Ad(Ae,new TypeError("Reader was released and can no longer be used to monitor the stream's closedness")):function(Ae,Se){kd(Ae,Se)}(Ae,new TypeError("Reader was released and can no longer be used to monitor the stream's closedness")),Ae._ownerReadableStream._reader=void 0,Ae._ownerReadableStream=void 0}function vd(Ae){return new TypeError("Cannot "+Ae+" a stream using a released reader")}function _d(Ae){Ae._closedPromise=nd(((Se,Ce)=>{Ae._closedPromise_resolve=Se,Ae._closedPromise_reject=Ce}))}function kd(Ae,Se){_d(Ae),Ad(Ae,Se)}function Ad(Ae,Se){void 0!==Ae._closedPromise_reject&&(fd(Ae._closedPromise),Ae._closedPromise_reject(Se),Ae._closedPromise_resolve=void 0,Ae._closedPromise_reject=void 0)}function Sd(Ae){void 0!==Ae._closedPromise_resolve&&(Ae._closedPromise_resolve(void 0),Ae._closedPromise_resolve=void 0,Ae._closedPromise_reject=void 0)}const qy=Dy("[[AbortSteps]]"),Fy=Dy("[[ErrorSteps]]"),Ly=Dy("[[CancelSteps]]"),Hy=Dy("[[PullSteps]]"),Gy=Number.isFinite||function(Ae){return"number"==typeof Ae&&isFinite(Ae)},Vy=Math.trunc||function(Ae){return Ae<0?Math.ceil(Ae):Math.floor(Ae)};function Dd(Ae,Se){if(void 0!==Ae&&("object"!=typeof(Ce=Ae)&&"function"!=typeof Ce))throw new TypeError(Se+" is not an object.");var Ce}function Ud(Ae,Se){if("function"!=typeof Ae)throw new TypeError(Se+" is not a function.")}function Rd(Ae,Se){if(!function(Ae){return"object"==typeof Ae&&null!==Ae||"function"==typeof Ae}(Ae))throw new TypeError(Se+" is not an object.")}function Id(Ae,Se,Ce){if(void 0===Ae)throw new TypeError(`Parameter ${Se} is required in '${Ce}'.`)}function Bd(Ae,Se,Ce){if(void 0===Ae)throw new TypeError(`${Se} is required in '${Ce}'.`)}function Td(Ae){return Number(Ae)}function zd(Ae){return 0===Ae?0:Ae}function qd(Ae,Se){const Ce=Number.MAX_SAFE_INTEGER;let qe=Number(Ae);if(qe=zd(qe),!Gy(qe))throw new TypeError(Se+" is not a finite number");if(qe=function(Ae){return zd(Vy(Ae))}(qe),qe<0||qe>Ce)throw new TypeError(`${Se} is outside the accepted range of 0 to ${Ce}, inclusive`);return Gy(qe)&&0!==qe?qe:0}function Fd(Ae,Se){if(!ep(Ae))throw new TypeError(Se+" is not a ReadableStream.")}function Od(Ae){return new Wd(Ae)}function Ld(Ae,Se){Ae._reader._readRequests.push(Se)}function Nd(Ae,Se,Ce){const qe=Ae._reader._readRequests.shift();Ce?qe._closeSteps():qe._chunkSteps(Se)}function jd(Ae){return Ae._reader._readRequests.length}function Hd(Ae){const Se=Ae._reader;return void 0!==Se&&!!Gd(Se)}class Wd{constructor(Ae){if(Id(Ae,1,"ReadableStreamDefaultReader"),Fd(Ae,"First parameter"),tp(Ae))throw new TypeError("This stream has already been locked for exclusive reading by another reader");gd(this,Ae),this._readRequests=new bd}get closed(){return Gd(this)?this._closedPromise:sd($d("closed"))}cancel(Ae=undefined){return Gd(this)?void 0===this._ownerReadableStream?sd(vd("cancel")):md(this,Ae):sd($d("cancel"))}read(){if(!Gd(this))return sd($d("read"));if(void 0===this._ownerReadableStream)return sd(vd("read from"));let Ae,Se;const Ce=nd(((Ce,qe)=>{Ae=Ce,Se=qe}));return Vd(this,{_chunkSteps:Se=>Ae({value:Se,done:!1}),_closeSteps:()=>Ae({value:void 0,done:!0}),_errorSteps:Ae=>Se(Ae)}),Ce}releaseLock(){if(!Gd(this))throw $d("releaseLock");if(void 0!==this._ownerReadableStream){if(this._readRequests.length>0)throw new TypeError("Tried to release a reader lock when that reader has pending read() calls un-settled");wd(this)}}}function Gd(Ae){return!!Qh(Ae)&&!!Object.prototype.hasOwnProperty.call(Ae,"_readRequests")}function Vd(Ae,Se){const Ce=Ae._ownerReadableStream;Ce._disturbed=!0,"closed"===Ce._state?Se._closeSteps():"errored"===Ce._state?Se._errorSteps(Ce._storedError):Ce._readableStreamController[Hy](Se)}function $d(Ae){return new TypeError(`ReadableStreamDefaultReader.prototype.${Ae} can only be used on a ReadableStreamDefaultReader`)}let Zy;Object.defineProperties(Wd.prototype,{cancel:{enumerable:!0},read:{enumerable:!0},releaseLock:{enumerable:!0},closed:{enumerable:!0}}),"symbol"==typeof Dy.toStringTag&&Object.defineProperty(Wd.prototype,Dy.toStringTag,{value:"ReadableStreamDefaultReader",configurable:!0}),"symbol"==typeof Dy.asyncIterator&&(Zy={[Dy.asyncIterator](){return this}},Object.defineProperty(Zy,Dy.asyncIterator,{enumerable:!1}));class Xd{constructor(Ae,Se){this._ongoingPromise=void 0,this._isFinished=!1,this._reader=Ae,this._preventCancel=Se}next(){const e=()=>this._nextSteps();return this._ongoingPromise=this._ongoingPromise?dd(this._ongoingPromise,e,e):e(),this._ongoingPromise}return(Ae){const t=()=>this._returnSteps(Ae);return this._ongoingPromise?dd(this._ongoingPromise,t,t):t()}_nextSteps(){if(this._isFinished)return Promise.resolve({value:void 0,done:!0});const Ae=this._reader;if(void 0===Ae._ownerReadableStream)return sd(vd("iterate"));let Se,Ce;const qe=nd(((Ae,qe)=>{Se=Ae,Ce=qe}));return Vd(Ae,{_chunkSteps:Ae=>{this._ongoingPromise=void 0,jy((()=>Se({value:Ae,done:!1})))},_closeSteps:()=>{this._ongoingPromise=void 0,this._isFinished=!0,wd(Ae),Se({value:void 0,done:!0})},_errorSteps:Se=>{this._ongoingPromise=void 0,this._isFinished=!0,wd(Ae),Ce(Se)}}),qe}_returnSteps(Ae){if(this._isFinished)return Promise.resolve({value:Ae,done:!0});this._isFinished=!0;const Se=this._reader;if(void 0===Se._ownerReadableStream)return sd(vd("finish iterating"));if(!this._preventCancel){const Ce=md(Se,Ae);return wd(Se),dd(Ce,(()=>({value:Ae,done:!0})))}return wd(Se),ad({value:Ae,done:!0})}}const em={next(){return Qd(this)?this._asyncIteratorImpl.next():sd(Jd("next"))},return(Ae){return Qd(this)?this._asyncIteratorImpl.return(Ae):sd(Jd("return"))}};function Qd(Ae){return!!Qh(Ae)&&!!Object.prototype.hasOwnProperty.call(Ae,"_asyncIteratorImpl")}function Jd(Ae){return new TypeError(`ReadableStreamAsyncIterator.${Ae} can only be used on a ReadableSteamAsyncIterator`)}void 0!==Zy&&Object.setPrototypeOf(em,Zy);const tm=Number.isNaN||function(Ae){return Ae!=Ae};function tf(Ae){return!!function(Ae){if("number"!=typeof Ae)return!1;if(tm(Ae))return!1;if(Ae<0)return!1;return!0}(Ae)&&Ae!==1/0}function rf(Ae){const Se=Ae._queue.shift();return Ae._queueTotalSize-=Se.size,Ae._queueTotalSize<0&&(Ae._queueTotalSize=0),Se.value}function nf(Ae,Se,Ce){if(!tf(Ce=Number(Ce)))throw new RangeError("Size must be a finite, non-NaN, non-negative number.");Ae._queue.push({value:Se,size:Ce}),Ae._queueTotalSize+=Ce}function af(Ae){Ae._queue=new bd,Ae._queueTotalSize=0}function sf(Ae){return Ae.slice()}class of{constructor(){throw new TypeError("Illegal constructor")}get view(){if(!hf(this))throw Pf("view");return this._view}respond(Ae){if(!hf(this))throw Pf("respond");if(Id(Ae,1,"respond"),Ae=qd(Ae,"First parameter"),void 0===this._associatedReadableByteStreamController)throw new TypeError("This BYOB request has been invalidated");this._view.buffer,function(Ae,Se){if(Se=Number(Se),!tf(Se))throw new RangeError("bytesWritten must be a finite");vf(Ae,Se)}(this._associatedReadableByteStreamController,Ae)}respondWithNewView(Ae){if(!hf(this))throw Pf("respondWithNewView");if(Id(Ae,1,"respondWithNewView"),!ArrayBuffer.isView(Ae))throw new TypeError("You can only respond with array buffer views");if(0===Ae.byteLength)throw new TypeError("chunk must have non-zero byteLength");if(0===Ae.buffer.byteLength)throw new TypeError("chunk's buffer must have non-zero byteLength");if(void 0===this._associatedReadableByteStreamController)throw new TypeError("This BYOB request has been invalidated");!function(Ae,Se){const Ce=Ae._pendingPullIntos.peek();if(Ce.byteOffset+Ce.bytesFilled!==Se.byteOffset)throw new RangeError("The region specified by view does not match byobRequest");if(Ce.byteLength!==Se.byteLength)throw new RangeError("The buffer of view has different capacity than byobRequest");Ce.buffer=Se.buffer,vf(Ae,Se.byteLength)}(this._associatedReadableByteStreamController,Ae)}}Object.defineProperties(of.prototype,{respond:{enumerable:!0},respondWithNewView:{enumerable:!0},view:{enumerable:!0}}),"symbol"==typeof Dy.toStringTag&&Object.defineProperty(of.prototype,Dy.toStringTag,{value:"ReadableStreamBYOBRequest",configurable:!0});class cf{constructor(){throw new TypeError("Illegal constructor")}get byobRequest(){if(!uf(this))throw xf("byobRequest");if(null===this._byobRequest&&this._pendingPullIntos.length>0){const Ae=this._pendingPullIntos.peek(),Se=new Uint8Array(Ae.buffer,Ae.byteOffset+Ae.bytesFilled,Ae.byteLength-Ae.bytesFilled),Ce=Object.create(of.prototype);!function(Ae,Se,Ce){Ae._associatedReadableByteStreamController=Se,Ae._view=Ce}(Ce,this,Se),this._byobRequest=Ce}return this._byobRequest}get desiredSize(){if(!uf(this))throw xf("desiredSize");return Sf(this)}close(){if(!uf(this))throw xf("close");if(this._closeRequested)throw new TypeError("The stream has already been closed; do not close it again!");const Ae=this._controlledReadableByteStream._state;if("readable"!==Ae)throw new TypeError(`The stream (in ${Ae} state) is not in the readable state and cannot be closed`);!function(Ae){const Se=Ae._controlledReadableByteStream;if(Ae._closeRequested||"readable"!==Se._state)return;if(Ae._queueTotalSize>0)return void(Ae._closeRequested=!0);if(Ae._pendingPullIntos.length>0){if(Ae._pendingPullIntos.peek().bytesFilled>0){const Se=new TypeError("Insufficient bytes to fill elements in the given buffer");throw Af(Ae,Se),Se}}kf(Ae),ip(Se)}(this)}enqueue(Ae){if(!uf(this))throw xf("enqueue");if(Id(Ae,1,"enqueue"),!ArrayBuffer.isView(Ae))throw new TypeError("chunk must be an array buffer view");if(0===Ae.byteLength)throw new TypeError("chunk must have non-zero byteLength");if(0===Ae.buffer.byteLength)throw new TypeError("chunk's buffer must have non-zero byteLength");if(this._closeRequested)throw new TypeError("stream is closed or draining");const Se=this._controlledReadableByteStream._state;if("readable"!==Se)throw new TypeError(`The stream (in ${Se} state) is not in the readable state and cannot be enqueued to`);!function(Ae,Se){const Ce=Ae._controlledReadableByteStream;if(Ae._closeRequested||"readable"!==Ce._state)return;const qe=Se.buffer,Fe=Se.byteOffset,$e=Se.byteLength,rt=qe;if(Hd(Ce))if(0===jd(Ce))pf(Ae,rt,Fe,$e);else{Nd(Ce,new Uint8Array(rt,Fe,$e),!1)}else Cf(Ce)?(pf(Ae,rt,Fe,$e),wf(Ae)):pf(Ae,rt,Fe,$e);df(Ae)}(this,Ae)}error(Ae=undefined){if(!uf(this))throw xf("error");Af(this,Ae)}[Ly](Ae){if(this._pendingPullIntos.length>0){this._pendingPullIntos.peek().bytesFilled=0}af(this);const Se=this._cancelAlgorithm(Ae);return kf(this),Se}[Hy](Ae){const Se=this._controlledReadableByteStream;if(this._queueTotalSize>0){const Se=this._queue.shift();this._queueTotalSize-=Se.byteLength,gf(this);const Ce=new Uint8Array(Se.buffer,Se.byteOffset,Se.byteLength);return void Ae._chunkSteps(Ce)}const Ce=this._autoAllocateChunkSize;if(void 0!==Ce){let qe;try{qe=new ArrayBuffer(Ce)}catch(Se){return void Ae._errorSteps(Se)}const Fe={buffer:qe,byteOffset:0,byteLength:Ce,bytesFilled:0,elementSize:1,viewConstructor:Uint8Array,readerType:"default"};this._pendingPullIntos.push(Fe)}Ld(Se,Ae),df(this)}}function uf(Ae){return!!Qh(Ae)&&!!Object.prototype.hasOwnProperty.call(Ae,"_controlledReadableByteStream")}function hf(Ae){return!!Qh(Ae)&&!!Object.prototype.hasOwnProperty.call(Ae,"_associatedReadableByteStreamController")}function df(Ae){const Se=function(Ae){const Se=Ae._controlledReadableByteStream;if("readable"!==Se._state)return!1;if(Ae._closeRequested)return!1;if(!Ae._started)return!1;if(Hd(Se)&&jd(Se)>0)return!0;if(Cf(Se)&&Kf(Se)>0)return!0;const Ce=Sf(Ae);if(Ce>0)return!0;return!1}(Ae);if(!Se)return;if(Ae._pulling)return void(Ae._pullAgain=!0);Ae._pulling=!0;cd(Ae._pullAlgorithm(),(()=>{Ae._pulling=!1,Ae._pullAgain&&(Ae._pullAgain=!1,df(Ae))}),(Se=>{Af(Ae,Se)}))}function ff(Ae,Se){let Ce=!1;"closed"===Ae._state&&(Ce=!0);const qe=lf(Se);"default"===Se.readerType?Nd(Ae,qe,Ce):function(Ae,Se,Ce){const qe=Ae._reader,Fe=qe._readIntoRequests.shift();Ce?Fe._closeSteps(Se):Fe._chunkSteps(Se)}(Ae,qe,Ce)}function lf(Ae){const Se=Ae.bytesFilled,Ce=Ae.elementSize;return new Ae.viewConstructor(Ae.buffer,Ae.byteOffset,Se/Ce)}function pf(Ae,Se,Ce,qe){Ae._queue.push({buffer:Se,byteOffset:Ce,byteLength:qe}),Ae._queueTotalSize+=qe}function yf(Ae,Se){const Ce=Se.elementSize,qe=Se.bytesFilled-Se.bytesFilled%Ce,Fe=Math.min(Ae._queueTotalSize,Se.byteLength-Se.bytesFilled),$e=Se.bytesFilled+Fe,rt=$e-$e%Ce;let it=Fe,nt=!1;rt>qe&&(it=rt-Se.bytesFilled,nt=!0);const st=Ae._queue;for(;it>0;){const Ce=st.peek(),qe=Math.min(it,Ce.byteLength),Fe=Se.byteOffset+Se.bytesFilled;ut=Se.buffer,ht=Fe,ft=Ce.buffer,yt=Ce.byteOffset,vt=qe,new Uint8Array(ut).set(new Uint8Array(ft,yt,vt),ht),Ce.byteLength===qe?st.shift():(Ce.byteOffset+=qe,Ce.byteLength-=qe),Ae._queueTotalSize-=qe,bf(Ae,qe,Se),it-=qe}var ut,ht,ft,yt,vt;return nt}function bf(Ae,Se,Ce){mf(Ae),Ce.bytesFilled+=Se}function gf(Ae){0===Ae._queueTotalSize&&Ae._closeRequested?(kf(Ae),ip(Ae._controlledReadableByteStream)):df(Ae)}function mf(Ae){null!==Ae._byobRequest&&(Ae._byobRequest._associatedReadableByteStreamController=void 0,Ae._byobRequest._view=null,Ae._byobRequest=null)}function wf(Ae){for(;Ae._pendingPullIntos.length>0;){if(0===Ae._queueTotalSize)return;const Se=Ae._pendingPullIntos.peek();yf(Ae,Se)&&(_f(Ae),ff(Ae._controlledReadableByteStream,Se))}}function vf(Ae,Se){const Ce=Ae._pendingPullIntos.peek();if("closed"===Ae._controlledReadableByteStream._state){if(0!==Se)throw new TypeError("bytesWritten must be 0 when calling respond() on a closed stream");!function(Ae,Se){Se.buffer=Se.buffer;const Ce=Ae._controlledReadableByteStream;if(Cf(Ce))for(;Kf(Ce)>0;)ff(Ce,_f(Ae))}(Ae,Ce)}else!function(Ae,Se,Ce){if(Ce.bytesFilled+Se>Ce.byteLength)throw new RangeError("bytesWritten out of range");if(bf(Ae,Se,Ce),Ce.bytesFilled0){const Se=Ce.byteOffset+Ce.bytesFilled,Fe=Ce.buffer.slice(Se-qe,Se);pf(Ae,Fe,0,Fe.byteLength)}Ce.buffer=Ce.buffer,Ce.bytesFilled-=qe,ff(Ae._controlledReadableByteStream,Ce),wf(Ae)}(Ae,Se,Ce);df(Ae)}function _f(Ae){const Se=Ae._pendingPullIntos.shift();return mf(Ae),Se}function kf(Ae){Ae._pullAlgorithm=void 0,Ae._cancelAlgorithm=void 0}function Af(Ae,Se){const Ce=Ae._controlledReadableByteStream;"readable"===Ce._state&&(!function(Ae){mf(Ae),Ae._pendingPullIntos=new bd}(Ae),af(Ae),kf(Ae),np(Ce,Se))}function Sf(Ae){const Se=Ae._controlledReadableByteStream._state;return"errored"===Se?null:"closed"===Se?0:Ae._strategyHWM-Ae._queueTotalSize}function Ef(Ae,Se,Ce){const qe=Object.create(cf.prototype);let n=()=>{},a=()=>ad(void 0),s=()=>ad(void 0);void 0!==Se.start&&(n=()=>Se.start(qe)),void 0!==Se.pull&&(a=()=>Se.pull(qe)),void 0!==Se.cancel&&(s=Ae=>Se.cancel(Ae));const Fe=Se.autoAllocateChunkSize;if(0===Fe)throw new TypeError("autoAllocateChunkSize must be greater than 0");!function(Ae,Se,Ce,qe,Fe,$e,rt){Se._controlledReadableByteStream=Ae,Se._pullAgain=!1,Se._pulling=!1,Se._byobRequest=null,Se._queue=Se._queueTotalSize=void 0,af(Se),Se._closeRequested=!1,Se._started=!1,Se._strategyHWM=$e,Se._pullAlgorithm=qe,Se._cancelAlgorithm=Fe,Se._autoAllocateChunkSize=rt,Se._pendingPullIntos=new bd,Ae._readableStreamController=Se,cd(ad(Ce()),(()=>{Se._started=!0,df(Se)}),(Ae=>{Af(Se,Ae)}))}(Ae,qe,n,a,s,Ce,Fe)}function Pf(Ae){return new TypeError(`ReadableStreamBYOBRequest.prototype.${Ae} can only be used on a ReadableStreamBYOBRequest`)}function xf(Ae){return new TypeError(`ReadableByteStreamController.prototype.${Ae} can only be used on a ReadableByteStreamController`)}function Mf(Ae,Se){Ae._reader._readIntoRequests.push(Se)}function Kf(Ae){return Ae._reader._readIntoRequests.length}function Cf(Ae){const Se=Ae._reader;return void 0!==Se&&!!Uf(Se)}Object.defineProperties(cf.prototype,{close:{enumerable:!0},enqueue:{enumerable:!0},error:{enumerable:!0},byobRequest:{enumerable:!0},desiredSize:{enumerable:!0}}),"symbol"==typeof Dy.toStringTag&&Object.defineProperty(cf.prototype,Dy.toStringTag,{value:"ReadableByteStreamController",configurable:!0});class Df{constructor(Ae){if(Id(Ae,1,"ReadableStreamBYOBReader"),Fd(Ae,"First parameter"),tp(Ae))throw new TypeError("This stream has already been locked for exclusive reading by another reader");if(!uf(Ae._readableStreamController))throw new TypeError("Cannot construct a ReadableStreamBYOBReader for a stream not constructed with a byte source");gd(this,Ae),this._readIntoRequests=new bd}get closed(){return Uf(this)?this._closedPromise:sd(Rf("closed"))}cancel(Ae=undefined){return Uf(this)?void 0===this._ownerReadableStream?sd(vd("cancel")):md(this,Ae):sd(Rf("cancel"))}read(Ae){if(!Uf(this))return sd(Rf("read"));if(!ArrayBuffer.isView(Ae))return sd(new TypeError("view must be an array buffer view"));if(0===Ae.byteLength)return sd(new TypeError("view must have non-zero byteLength"));if(0===Ae.buffer.byteLength)return sd(new TypeError("view's buffer must have non-zero byteLength"));if(void 0===this._ownerReadableStream)return sd(vd("read from"));let Se,Ce;const qe=nd(((Ae,qe)=>{Se=Ae,Ce=qe}));return function(Ae,Se,Ce){const qe=Ae._ownerReadableStream;qe._disturbed=!0,"errored"===qe._state?Ce._errorSteps(qe._storedError):function(Ae,Se,Ce){const qe=Ae._controlledReadableByteStream;let Fe=1;Se.constructor!==DataView&&(Fe=Se.constructor.BYTES_PER_ELEMENT);const $e=Se.constructor,rt={buffer:Se.buffer,byteOffset:Se.byteOffset,byteLength:Se.byteLength,bytesFilled:0,elementSize:Fe,viewConstructor:$e,readerType:"byob"};if(Ae._pendingPullIntos.length>0)return Ae._pendingPullIntos.push(rt),void Mf(qe,Ce);if("closed"!==qe._state){if(Ae._queueTotalSize>0){if(yf(Ae,rt)){const Se=lf(rt);return gf(Ae),void Ce._chunkSteps(Se)}if(Ae._closeRequested){const Se=new TypeError("Insufficient bytes to fill elements in the given buffer");return Af(Ae,Se),void Ce._errorSteps(Se)}}Ae._pendingPullIntos.push(rt),Mf(qe,Ce),df(Ae)}else{const Ae=new $e(rt.buffer,rt.byteOffset,0);Ce._closeSteps(Ae)}}(qe._readableStreamController,Se,Ce)}(this,Ae,{_chunkSteps:Ae=>Se({value:Ae,done:!1}),_closeSteps:Ae=>Se({value:Ae,done:!0}),_errorSteps:Ae=>Ce(Ae)}),qe}releaseLock(){if(!Uf(this))throw Rf("releaseLock");if(void 0!==this._ownerReadableStream){if(this._readIntoRequests.length>0)throw new TypeError("Tried to release a reader lock when that reader has pending read() calls un-settled");wd(this)}}}function Uf(Ae){return!!Qh(Ae)&&!!Object.prototype.hasOwnProperty.call(Ae,"_readIntoRequests")}function Rf(Ae){return new TypeError(`ReadableStreamBYOBReader.prototype.${Ae} can only be used on a ReadableStreamBYOBReader`)}function If(Ae,Se){const{highWaterMark:Ce}=Ae;if(void 0===Ce)return Se;if(tm(Ce)||Ce<0)throw new RangeError("Invalid highWaterMark");return Ce}function Bf(Ae){const{size:Se}=Ae;return Se||(()=>1)}function Tf(Ae,Se){Dd(Ae,Se);const Ce=null==Ae?void 0:Ae.highWaterMark,qe=null==Ae?void 0:Ae.size;return{highWaterMark:void 0===Ce?void 0:Td(Ce),size:void 0===qe?void 0:zf(qe,Se+" has member 'size' that")}}function zf(Ae,Se){return Ud(Ae,Se),Se=>Td(Ae(Se))}function qf(Ae,Se,Ce){return Ud(Ae,Ce),Ce=>yd(Ae,Se,[Ce])}function Ff(Ae,Se,Ce){return Ud(Ae,Ce),()=>yd(Ae,Se,[])}function Of(Ae,Se,Ce){return Ud(Ae,Ce),Ce=>pd(Ae,Se,[Ce])}function Lf(Ae,Se,Ce){return Ud(Ae,Ce),(Ce,qe)=>yd(Ae,Se,[Ce,qe])}function Nf(Ae,Se){if(!Gf(Ae))throw new TypeError(Se+" is not a WritableStream.")}Object.defineProperties(Df.prototype,{cancel:{enumerable:!0},read:{enumerable:!0},releaseLock:{enumerable:!0},closed:{enumerable:!0}}),"symbol"==typeof Dy.toStringTag&&Object.defineProperty(Df.prototype,Dy.toStringTag,{value:"ReadableStreamBYOBReader",configurable:!0});class jf{constructor(Ae={},Se={}){void 0===Ae?Ae=null:Rd(Ae,"First parameter");const Ce=Tf(Se,"Second parameter"),qe=function(Ae,Se){Dd(Ae,Se);const Ce=null==Ae?void 0:Ae.abort,qe=null==Ae?void 0:Ae.close,Fe=null==Ae?void 0:Ae.start,$e=null==Ae?void 0:Ae.type,rt=null==Ae?void 0:Ae.write;return{abort:void 0===Ce?void 0:qf(Ce,Ae,Se+" has member 'abort' that"),close:void 0===qe?void 0:Ff(qe,Ae,Se+" has member 'close' that"),start:void 0===Fe?void 0:Of(Fe,Ae,Se+" has member 'start' that"),write:void 0===rt?void 0:Lf(rt,Ae,Se+" has member 'write' that"),type:$e}}(Ae,"First parameter");Wf(this);if(void 0!==qe.type)throw new RangeError("Invalid type is specified");const Fe=Bf(Ce);!function(Ae,Se,Ce,qe){const Fe=Object.create(hl.prototype);let a=()=>{},s=()=>ad(void 0),o=()=>ad(void 0),c=()=>ad(void 0);void 0!==Se.start&&(a=()=>Se.start(Fe));void 0!==Se.write&&(s=Ae=>Se.write(Ae,Fe));void 0!==Se.close&&(o=()=>Se.close());void 0!==Se.abort&&(c=Ae=>Se.abort(Ae));dl(Ae,Fe,a,s,o,c,Ce,qe)}(this,qe,If(Ce,1),Fe)}get locked(){if(!Gf(this))throw ml("locked");return Vf(this)}abort(Ae=undefined){return Gf(this)?Vf(this)?sd(new TypeError("Cannot abort a stream that already has a writer")):$f(this,Ae):sd(ml("abort"))}close(){return Gf(this)?Vf(this)?sd(new TypeError("Cannot close a stream that already has a writer")):Jf(this)?sd(new TypeError("Cannot close an already-closing stream")):Zf(this):sd(ml("close"))}getWriter(){if(!Gf(this))throw ml("getWriter");return Hf(this)}}function Hf(Ae){return new rl(Ae)}function Wf(Ae){Ae._state="writable",Ae._storedError=void 0,Ae._writer=void 0,Ae._writableStreamController=void 0,Ae._writeRequests=new bd,Ae._inFlightWriteRequest=void 0,Ae._closeRequest=void 0,Ae._inFlightCloseRequest=void 0,Ae._pendingAbortRequest=void 0,Ae._backpressure=!1}function Gf(Ae){return!!Qh(Ae)&&!!Object.prototype.hasOwnProperty.call(Ae,"_writableStreamController")}function Vf(Ae){return void 0!==Ae._writer}function $f(Ae,Se){const Ce=Ae._state;if("closed"===Ce||"errored"===Ce)return ad(void 0);if(void 0!==Ae._pendingAbortRequest)return Ae._pendingAbortRequest._promise;let qe=!1;"erroring"===Ce&&(qe=!0,Se=void 0);const Fe=nd(((Ce,Fe)=>{Ae._pendingAbortRequest={_promise:void 0,_resolve:Ce,_reject:Fe,_reason:Se,_wasAlreadyErroring:qe}}));return Ae._pendingAbortRequest._promise=Fe,qe||Yf(Ae,Se),Fe}function Zf(Ae){const Se=Ae._state;if("closed"===Se||"errored"===Se)return sd(new TypeError(`The stream (in ${Se} state) is not in the writable state and cannot be closed`));const Ce=nd(((Se,Ce)=>{const qe={_resolve:Se,_reject:Ce};Ae._closeRequest=qe})),qe=Ae._writer;var Fe;return void 0!==qe&&Ae._backpressure&&"writable"===Se&&Kl(qe),nf(Fe=Ae._writableStreamController,rm,0),pl(Fe),Ce}function Xf(Ae,Se){"writable"!==Ae._state?Qf(Ae):Yf(Ae,Se)}function Yf(Ae,Se){const Ce=Ae._writableStreamController;Ae._state="erroring",Ae._storedError=Se;const qe=Ae._writer;void 0!==qe&&sl(qe,Se),!function(Ae){if(void 0===Ae._inFlightWriteRequest&&void 0===Ae._inFlightCloseRequest)return!1;return!0}(Ae)&&Ce._started&&Qf(Ae)}function Qf(Ae){Ae._state="errored",Ae._writableStreamController[Fy]();const Se=Ae._storedError;if(Ae._writeRequests.forEach((Ae=>{Ae._reject(Se)})),Ae._writeRequests=new bd,void 0===Ae._pendingAbortRequest)return void el(Ae);const Ce=Ae._pendingAbortRequest;if(Ae._pendingAbortRequest=void 0,Ce._wasAlreadyErroring)return Ce._reject(Se),void el(Ae);cd(Ae._writableStreamController[qy](Ce._reason),(()=>{Ce._resolve(),el(Ae)}),(Se=>{Ce._reject(Se),el(Ae)}))}function Jf(Ae){return void 0!==Ae._closeRequest||void 0!==Ae._inFlightCloseRequest}function el(Ae){void 0!==Ae._closeRequest&&(Ae._closeRequest._reject(Ae._storedError),Ae._closeRequest=void 0);const Se=Ae._writer;void 0!==Se&&Al(Se,Ae._storedError)}function tl(Ae,Se){const Ce=Ae._writer;void 0!==Ce&&Se!==Ae._backpressure&&(Se?function(Ae){El(Ae)}(Ce):Kl(Ce)),Ae._backpressure=Se}Object.defineProperties(jf.prototype,{abort:{enumerable:!0},close:{enumerable:!0},getWriter:{enumerable:!0},locked:{enumerable:!0}}),"symbol"==typeof Dy.toStringTag&&Object.defineProperty(jf.prototype,Dy.toStringTag,{value:"WritableStream",configurable:!0});class rl{constructor(Ae){if(Id(Ae,1,"WritableStreamDefaultWriter"),Nf(Ae,"First parameter"),Vf(Ae))throw new TypeError("This stream has already been locked for exclusive writing by another writer");this._ownerWritableStream=Ae,Ae._writer=this;const Se=Ae._state;if("writable"===Se)!Jf(Ae)&&Ae._backpressure?El(this):xl(this),_l(this);else if("erroring"===Se)Pl(this,Ae._storedError),_l(this);else if("closed"===Se)xl(this),_l(Ce=this),Sl(Ce);else{const Se=Ae._storedError;Pl(this,Se),kl(this,Se)}var Ce}get closed(){return il(this)?this._closedPromise:sd(wl("closed"))}get desiredSize(){if(!il(this))throw wl("desiredSize");if(void 0===this._ownerWritableStream)throw vl("desiredSize");return function(Ae){const Se=Ae._ownerWritableStream,Ce=Se._state;if("errored"===Ce||"erroring"===Ce)return null;if("closed"===Ce)return 0;return ll(Se._writableStreamController)}(this)}get ready(){return il(this)?this._readyPromise:sd(wl("ready"))}abort(Ae=undefined){return il(this)?void 0===this._ownerWritableStream?sd(vl("abort")):function(Ae,Se){const Ce=Ae._ownerWritableStream;return $f(Ce,Se)}(this,Ae):sd(wl("abort"))}close(){if(!il(this))return sd(wl("close"));const Ae=this._ownerWritableStream;return void 0===Ae?sd(vl("close")):Jf(Ae)?sd(new TypeError("Cannot close an already-closing stream")):nl(this)}releaseLock(){if(!il(this))throw wl("releaseLock");void 0!==this._ownerWritableStream&&ol(this)}write(Ae=undefined){return il(this)?void 0===this._ownerWritableStream?sd(vl("write to")):cl(this,Ae):sd(wl("write"))}}function il(Ae){return!!Qh(Ae)&&!!Object.prototype.hasOwnProperty.call(Ae,"_ownerWritableStream")}function nl(Ae){return Zf(Ae._ownerWritableStream)}function al(Ae,Se){"pending"===Ae._closedPromiseState?Al(Ae,Se):function(Ae,Se){kl(Ae,Se)}(Ae,Se)}function sl(Ae,Se){"pending"===Ae._readyPromiseState?Ml(Ae,Se):function(Ae,Se){Pl(Ae,Se)}(Ae,Se)}function ol(Ae){const Se=Ae._ownerWritableStream,Ce=new TypeError("Writer was released and can no longer be used to monitor the stream's closedness");sl(Ae,Ce),al(Ae,Ce),Se._writer=void 0,Ae._ownerWritableStream=void 0}function cl(Ae,Se){const Ce=Ae._ownerWritableStream,qe=Ce._writableStreamController,Fe=function(Ae,Se){try{return Ae._strategySizeAlgorithm(Se)}catch(Se){return yl(Ae,Se),1}}(qe,Se);if(Ce!==Ae._ownerWritableStream)return sd(vl("write to"));const $e=Ce._state;if("errored"===$e)return sd(Ce._storedError);if(Jf(Ce)||"closed"===$e)return sd(new TypeError("The stream is closing or closed and cannot be written to"));if("erroring"===$e)return sd(Ce._storedError);const rt=function(Ae){return nd(((Se,Ce)=>{const qe={_resolve:Se,_reject:Ce};Ae._writeRequests.push(qe)}))}(Ce);return function(Ae,Se,Ce){try{nf(Ae,Se,Ce)}catch(Se){return void yl(Ae,Se)}const qe=Ae._controlledWritableStream;if(!Jf(qe)&&"writable"===qe._state){tl(qe,bl(Ae))}pl(Ae)}(qe,Se,Fe),rt}Object.defineProperties(rl.prototype,{abort:{enumerable:!0},close:{enumerable:!0},releaseLock:{enumerable:!0},write:{enumerable:!0},closed:{enumerable:!0},desiredSize:{enumerable:!0},ready:{enumerable:!0}}),"symbol"==typeof Dy.toStringTag&&Object.defineProperty(rl.prototype,Dy.toStringTag,{value:"WritableStreamDefaultWriter",configurable:!0});const rm={};class hl{constructor(){throw new TypeError("Illegal constructor")}error(Ae=undefined){if(!function(Ae){if(!Qh(Ae))return!1;if(!Object.prototype.hasOwnProperty.call(Ae,"_controlledWritableStream"))return!1;return!0}(this))throw new TypeError("WritableStreamDefaultController.prototype.error can only be used on a WritableStreamDefaultController");"writable"===this._controlledWritableStream._state&&gl(this,Ae)}[qy](Ae){const Se=this._abortAlgorithm(Ae);return fl(this),Se}[Fy](){af(this)}}function dl(Ae,Se,Ce,qe,Fe,$e,rt,it){Se._controlledWritableStream=Ae,Ae._writableStreamController=Se,Se._queue=void 0,Se._queueTotalSize=void 0,af(Se),Se._started=!1,Se._strategySizeAlgorithm=it,Se._strategyHWM=rt,Se._writeAlgorithm=qe,Se._closeAlgorithm=Fe,Se._abortAlgorithm=$e;const nt=bl(Se);tl(Ae,nt);cd(ad(Ce()),(()=>{Se._started=!0,pl(Se)}),(Ce=>{Se._started=!0,Xf(Ae,Ce)}))}function fl(Ae){Ae._writeAlgorithm=void 0,Ae._closeAlgorithm=void 0,Ae._abortAlgorithm=void 0,Ae._strategySizeAlgorithm=void 0}function ll(Ae){return Ae._strategyHWM-Ae._queueTotalSize}function pl(Ae){const Se=Ae._controlledWritableStream;if(!Ae._started)return;if(void 0!==Se._inFlightWriteRequest)return;if("erroring"===Se._state)return void Qf(Se);if(0===Ae._queue.length)return;const Ce=Ae._queue.peek().value;Ce===rm?function(Ae){const Se=Ae._controlledWritableStream;(function(Ae){Ae._inFlightCloseRequest=Ae._closeRequest,Ae._closeRequest=void 0})(Se),rf(Ae);const Ce=Ae._closeAlgorithm();fl(Ae),cd(Ce,(()=>{!function(Ae){Ae._inFlightCloseRequest._resolve(void 0),Ae._inFlightCloseRequest=void 0,"erroring"===Ae._state&&(Ae._storedError=void 0,void 0!==Ae._pendingAbortRequest&&(Ae._pendingAbortRequest._resolve(),Ae._pendingAbortRequest=void 0)),Ae._state="closed";const Se=Ae._writer;void 0!==Se&&Sl(Se)}(Se)}),(Ae=>{!function(Ae,Se){Ae._inFlightCloseRequest._reject(Se),Ae._inFlightCloseRequest=void 0,void 0!==Ae._pendingAbortRequest&&(Ae._pendingAbortRequest._reject(Se),Ae._pendingAbortRequest=void 0),Xf(Ae,Se)}(Se,Ae)}))}(Ae):function(Ae,Se){const Ce=Ae._controlledWritableStream;!function(Ae){Ae._inFlightWriteRequest=Ae._writeRequests.shift()}(Ce);const qe=Ae._writeAlgorithm(Se);cd(qe,(()=>{!function(Ae){Ae._inFlightWriteRequest._resolve(void 0),Ae._inFlightWriteRequest=void 0}(Ce);const Se=Ce._state;if(rf(Ae),!Jf(Ce)&&"writable"===Se){const Se=bl(Ae);tl(Ce,Se)}pl(Ae)}),(Se=>{"writable"===Ce._state&&fl(Ae),function(Ae,Se){Ae._inFlightWriteRequest._reject(Se),Ae._inFlightWriteRequest=void 0,Xf(Ae,Se)}(Ce,Se)}))}(Ae,Ce)}function yl(Ae,Se){"writable"===Ae._controlledWritableStream._state&&gl(Ae,Se)}function bl(Ae){return ll(Ae)<=0}function gl(Ae,Se){const Ce=Ae._controlledWritableStream;fl(Ae),Yf(Ce,Se)}function ml(Ae){return new TypeError(`WritableStream.prototype.${Ae} can only be used on a WritableStream`)}function wl(Ae){return new TypeError(`WritableStreamDefaultWriter.prototype.${Ae} can only be used on a WritableStreamDefaultWriter`)}function vl(Ae){return new TypeError("Cannot "+Ae+" a stream using a released writer")}function _l(Ae){Ae._closedPromise=nd(((Se,Ce)=>{Ae._closedPromise_resolve=Se,Ae._closedPromise_reject=Ce,Ae._closedPromiseState="pending"}))}function kl(Ae,Se){_l(Ae),Al(Ae,Se)}function Al(Ae,Se){void 0!==Ae._closedPromise_reject&&(fd(Ae._closedPromise),Ae._closedPromise_reject(Se),Ae._closedPromise_resolve=void 0,Ae._closedPromise_reject=void 0,Ae._closedPromiseState="rejected")}function Sl(Ae){void 0!==Ae._closedPromise_resolve&&(Ae._closedPromise_resolve(void 0),Ae._closedPromise_resolve=void 0,Ae._closedPromise_reject=void 0,Ae._closedPromiseState="resolved")}function El(Ae){Ae._readyPromise=nd(((Se,Ce)=>{Ae._readyPromise_resolve=Se,Ae._readyPromise_reject=Ce})),Ae._readyPromiseState="pending"}function Pl(Ae,Se){El(Ae),Ml(Ae,Se)}function xl(Ae){El(Ae),Kl(Ae)}function Ml(Ae,Se){void 0!==Ae._readyPromise_reject&&(fd(Ae._readyPromise),Ae._readyPromise_reject(Se),Ae._readyPromise_resolve=void 0,Ae._readyPromise_reject=void 0,Ae._readyPromiseState="rejected")}function Kl(Ae){void 0!==Ae._readyPromise_resolve&&(Ae._readyPromise_resolve(void 0),Ae._readyPromise_resolve=void 0,Ae._readyPromise_reject=void 0,Ae._readyPromiseState="fulfilled")}Object.defineProperties(hl.prototype,{error:{enumerable:!0}}),"symbol"==typeof Dy.toStringTag&&Object.defineProperty(hl.prototype,Dy.toStringTag,{value:"WritableStreamDefaultController",configurable:!0});const im="undefined"!=typeof DOMException?DOMException:void 0;const nm=function(Ae){if("function"!=typeof Ae&&"object"!=typeof Ae)return!1;try{return new Ae,!0}catch(Ae){return!1}}(im)?im:function(){const e=function(Ae,Se){this.message=Ae||"",this.name=Se||"Error",Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)};return Object.defineProperty(e.prototype=Object.create(Error.prototype),"constructor",{value:e,writable:!0,configurable:!0}),e}();function Ul(Ae,Se,Ce,qe,Fe,$e){const rt=Od(Ae),it=Hf(Se);Ae._disturbed=!0;let nt=!1,st=ad(void 0);return nd(((ut,ht)=>{let ft;if(void 0!==$e){if(ft=()=>{const Ce=new nm("Aborted","AbortError"),$e=[];qe||$e.push((()=>"writable"===Se._state?$f(Se,Ce):ad(void 0))),Fe||$e.push((()=>"readable"===Ae._state?rp(Ae,Ce):ad(void 0))),y((()=>Promise.all($e.map((Ae=>Ae())))),!0,Ce)},$e.aborted)return void ft();$e.addEventListener("abort",ft)}if(p(Ae,rt._closedPromise,(Ae=>{qe?b(!0,Ae):y((()=>$f(Se,Ae)),!0,Ae)})),p(Se,it._closedPromise,(Se=>{Fe?b(!0,Se):y((()=>rp(Ae,Se)),!0,Se)})),function(Ae,Se,Ce){"closed"===Ae._state?Ce():ud(Se,Ce)}(Ae,rt._closedPromise,(()=>{Ce?b():y((()=>function(Ae){const Se=Ae._ownerWritableStream,Ce=Se._state;return Jf(Se)||"closed"===Ce?ad(void 0):"errored"===Ce?sd(Se._storedError):nl(Ae)}(it)))})),Jf(Se)||"closed"===Se._state){const Se=new TypeError("the destination writable stream closed before all data could be piped to it");Fe?b(!0,Se):y((()=>rp(Ae,Se)),!0,Se)}function l(){const Ae=st;return od(st,(()=>Ae!==st?l():void 0))}function p(Ae,Se,Ce){"errored"===Ae._state?Ce(Ae._storedError):hd(Se,Ce)}function y(Ae,Ce,qe){function n(){cd(Ae(),(()=>g(Ce,qe)),(Ae=>g(!0,Ae)))}nt||(nt=!0,"writable"!==Se._state||Jf(Se)?n():ud(l(),n))}function b(Ae,Ce){nt||(nt=!0,"writable"!==Se._state||Jf(Se)?g(Ae,Ce):ud(l(),(()=>g(Ae,Ce))))}function g(Ae,Se){ol(it),wd(rt),void 0!==$e&&$e.removeEventListener("abort",ft),Ae?ht(Se):ut(void 0)}fd(nd(((Ae,Se)=>{!function r(Ce){Ce?Ae():od(nt?ad(!0):od(it._readyPromise,(()=>nd(((Ae,Se)=>{Vd(rt,{_chunkSteps:Se=>{st=od(cl(it,Se),void 0,Xh),Ae(!1)},_closeSteps:()=>Ae(!0),_errorSteps:Se})})))),r,Se)}(!1)})))}))}class Rl{constructor(){throw new TypeError("Illegal constructor")}get desiredSize(){if(!Il(this))throw Hl("desiredSize");return Ll(this)}close(){if(!Il(this))throw Hl("close");if(!Nl(this))throw new TypeError("The stream is not in a state that permits close");ql(this)}enqueue(Ae=undefined){if(!Il(this))throw Hl("enqueue");if(!Nl(this))throw new TypeError("The stream is not in a state that permits enqueue");return Fl(this,Ae)}error(Ae=undefined){if(!Il(this))throw Hl("error");Ol(this,Ae)}[Ly](Ae){af(this);const Se=this._cancelAlgorithm(Ae);return zl(this),Se}[Hy](Ae){const Se=this._controlledReadableStream;if(this._queue.length>0){const Ce=rf(this);this._closeRequested&&0===this._queue.length?(zl(this),ip(Se)):Bl(this),Ae._chunkSteps(Ce)}else Ld(Se,Ae),Bl(this)}}function Il(Ae){return!!Qh(Ae)&&!!Object.prototype.hasOwnProperty.call(Ae,"_controlledReadableStream")}function Bl(Ae){if(!Tl(Ae))return;if(Ae._pulling)return void(Ae._pullAgain=!0);Ae._pulling=!0;cd(Ae._pullAlgorithm(),(()=>{Ae._pulling=!1,Ae._pullAgain&&(Ae._pullAgain=!1,Bl(Ae))}),(Se=>{Ol(Ae,Se)}))}function Tl(Ae){const Se=Ae._controlledReadableStream;if(!Nl(Ae))return!1;if(!Ae._started)return!1;if(tp(Se)&&jd(Se)>0)return!0;return Ll(Ae)>0}function zl(Ae){Ae._pullAlgorithm=void 0,Ae._cancelAlgorithm=void 0,Ae._strategySizeAlgorithm=void 0}function ql(Ae){if(!Nl(Ae))return;const Se=Ae._controlledReadableStream;Ae._closeRequested=!0,0===Ae._queue.length&&(zl(Ae),ip(Se))}function Fl(Ae,Se){if(!Nl(Ae))return;const Ce=Ae._controlledReadableStream;if(tp(Ce)&&jd(Ce)>0)Nd(Ce,Se,!1);else{let Ce;try{Ce=Ae._strategySizeAlgorithm(Se)}catch(Se){throw Ol(Ae,Se),Se}try{nf(Ae,Se,Ce)}catch(Se){throw Ol(Ae,Se),Se}}Bl(Ae)}function Ol(Ae,Se){const Ce=Ae._controlledReadableStream;"readable"===Ce._state&&(af(Ae),zl(Ae),np(Ce,Se))}function Ll(Ae){const Se=Ae._controlledReadableStream._state;return"errored"===Se?null:"closed"===Se?0:Ae._strategyHWM-Ae._queueTotalSize}function Nl(Ae){const Se=Ae._controlledReadableStream._state;return!Ae._closeRequested&&"readable"===Se}function jl(Ae,Se,Ce,qe,Fe,$e,rt){Se._controlledReadableStream=Ae,Se._queue=void 0,Se._queueTotalSize=void 0,af(Se),Se._started=!1,Se._closeRequested=!1,Se._pullAgain=!1,Se._pulling=!1,Se._strategySizeAlgorithm=rt,Se._strategyHWM=$e,Se._pullAlgorithm=qe,Se._cancelAlgorithm=Fe,Ae._readableStreamController=Se;cd(ad(Ce()),(()=>{Se._started=!0,Bl(Se)}),(Ae=>{Ol(Se,Ae)}))}function Hl(Ae){return new TypeError(`ReadableStreamDefaultController.prototype.${Ae} can only be used on a ReadableStreamDefaultController`)}function Wl(Ae,Se,Ce){return Ud(Ae,Ce),Ce=>yd(Ae,Se,[Ce])}function Gl(Ae,Se,Ce){return Ud(Ae,Ce),Ce=>yd(Ae,Se,[Ce])}function Vl(Ae,Se,Ce){return Ud(Ae,Ce),Ce=>pd(Ae,Se,[Ce])}function $l(Ae,Se){if("bytes"!==(Ae=""+Ae))throw new TypeError(`${Se} '${Ae}' is not a valid enumeration value for ReadableStreamType`);return Ae}function Zl(Ae,Se){if("byob"!==(Ae=""+Ae))throw new TypeError(`${Se} '${Ae}' is not a valid enumeration value for ReadableStreamReaderMode`);return Ae}function Xl(Ae,Se){Dd(Ae,Se);const Ce=null==Ae?void 0:Ae.preventAbort,qe=null==Ae?void 0:Ae.preventCancel,Fe=null==Ae?void 0:Ae.preventClose,$e=null==Ae?void 0:Ae.signal;return void 0!==$e&&function(Ae,Se){if(!function(Ae){if("object"!=typeof Ae||null===Ae)return!1;try{return"boolean"==typeof Ae.aborted}catch(Ae){return!1}}(Ae))throw new TypeError(Se+" is not an AbortSignal.")}($e,Se+" has member 'signal' that"),{preventAbort:!!Ce,preventCancel:!!qe,preventClose:!!Fe,signal:$e}}Object.defineProperties(Rl.prototype,{close:{enumerable:!0},enqueue:{enumerable:!0},error:{enumerable:!0},desiredSize:{enumerable:!0}}),"symbol"==typeof Dy.toStringTag&&Object.defineProperty(Rl.prototype,Dy.toStringTag,{value:"ReadableStreamDefaultController",configurable:!0});class Yl{constructor(Ae={},Se={}){void 0===Ae?Ae=null:Rd(Ae,"First parameter");const Ce=Tf(Se,"Second parameter"),qe=function(Ae,Se){Dd(Ae,Se);const Ce=Ae,qe=null==Ce?void 0:Ce.autoAllocateChunkSize,Fe=null==Ce?void 0:Ce.cancel,$e=null==Ce?void 0:Ce.pull,rt=null==Ce?void 0:Ce.start,it=null==Ce?void 0:Ce.type;return{autoAllocateChunkSize:void 0===qe?void 0:qd(qe,Se+" has member 'autoAllocateChunkSize' that"),cancel:void 0===Fe?void 0:Wl(Fe,Ce,Se+" has member 'cancel' that"),pull:void 0===$e?void 0:Gl($e,Ce,Se+" has member 'pull' that"),start:void 0===rt?void 0:Vl(rt,Ce,Se+" has member 'start' that"),type:void 0===it?void 0:$l(it,Se+" has member 'type' that")}}(Ae,"First parameter");if(Jl(this),"bytes"===qe.type){if(void 0!==Ce.size)throw new RangeError("The strategy for a byte stream cannot have a size function");Ef(this,qe,If(Ce,0))}else{const Ae=Bf(Ce);!function(Ae,Se,Ce,qe){const Fe=Object.create(Rl.prototype);let a=()=>{},s=()=>ad(void 0),o=()=>ad(void 0);void 0!==Se.start&&(a=()=>Se.start(Fe)),void 0!==Se.pull&&(s=()=>Se.pull(Fe)),void 0!==Se.cancel&&(o=Ae=>Se.cancel(Ae)),jl(Ae,Fe,a,s,o,Ce,qe)}(this,qe,If(Ce,1),Ae)}}get locked(){if(!ep(this))throw ap("locked");return tp(this)}cancel(Ae=undefined){return ep(this)?tp(this)?sd(new TypeError("Cannot cancel a stream that already has a reader")):rp(this,Ae):sd(ap("cancel"))}getReader(Ae=undefined){if(!ep(this))throw ap("getReader");const Se=function(Ae,Se){Dd(Ae,Se);const Ce=null==Ae?void 0:Ae.mode;return{mode:void 0===Ce?void 0:Zl(Ce,Se+" has member 'mode' that")}}(Ae,"First parameter");return void 0===Se.mode?Od(this):function(Ae){return new Df(Ae)}(this)}pipeThrough(Ae,Se={}){if(!ep(this))throw ap("pipeThrough");Id(Ae,1,"pipeThrough");const Ce=function(Ae,Se){Dd(Ae,Se);const Ce=null==Ae?void 0:Ae.readable;Bd(Ce,"readable","ReadableWritablePair"),Fd(Ce,Se+" has member 'readable' that");const qe=null==Ae?void 0:Ae.writable;return Bd(qe,"writable","ReadableWritablePair"),Nf(qe,Se+" has member 'writable' that"),{readable:Ce,writable:qe}}(Ae,"First parameter"),qe=Xl(Se,"Second parameter");if(tp(this))throw new TypeError("ReadableStream.prototype.pipeThrough cannot be used on a locked ReadableStream");if(Vf(Ce.writable))throw new TypeError("ReadableStream.prototype.pipeThrough cannot be used on a locked WritableStream");return fd(Ul(this,Ce.writable,qe.preventClose,qe.preventAbort,qe.preventCancel,qe.signal)),Ce.readable}pipeTo(Ae,Se={}){if(!ep(this))return sd(ap("pipeTo"));if(void 0===Ae)return sd("Parameter 1 is required in 'pipeTo'.");if(!Gf(Ae))return sd(new TypeError("ReadableStream.prototype.pipeTo's first argument must be a WritableStream"));let Ce;try{Ce=Xl(Se,"Second parameter")}catch(Ae){return sd(Ae)}return tp(this)?sd(new TypeError("ReadableStream.prototype.pipeTo cannot be used on a locked ReadableStream")):Vf(Ae)?sd(new TypeError("ReadableStream.prototype.pipeTo cannot be used on a locked WritableStream")):Ul(this,Ae,Ce.preventClose,Ce.preventAbort,Ce.preventCancel,Ce.signal)}tee(){if(!ep(this))throw ap("tee");const Ae=function(Ae,Se){const Ce=Od(Ae);let qe,Fe,$e,rt,it,nt=!1,st=!1,ut=!1;const ht=nd((Ae=>{it=Ae}));function f(){return nt||(nt=!0,Vd(Ce,{_chunkSteps:Ae=>{jy((()=>{nt=!1;const Se=Ae,Ce=Ae;st||Fl($e._readableStreamController,Se),ut||Fl(rt._readableStreamController,Ce)}))},_closeSteps:()=>{nt=!1,st||ql($e._readableStreamController),ut||ql(rt._readableStreamController),st&&ut||it(void 0)},_errorSteps:()=>{nt=!1}})),ad(void 0)}function l(){}return $e=Ql(l,f,(function(Se){if(st=!0,qe=Se,ut){const Se=sf([qe,Fe]),Ce=rp(Ae,Se);it(Ce)}return ht})),rt=Ql(l,f,(function(Se){if(ut=!0,Fe=Se,st){const Se=sf([qe,Fe]),Ce=rp(Ae,Se);it(Ce)}return ht})),hd(Ce._closedPromise,(Ae=>{Ol($e._readableStreamController,Ae),Ol(rt._readableStreamController,Ae),st&&ut||it(void 0)})),[$e,rt]}(this);return sf(Ae)}values(Ae=undefined){if(!ep(this))throw ap("values");return function(Ae,Se){const Ce=Od(Ae),qe=new Xd(Ce,Se),Fe=Object.create(em);return Fe._asyncIteratorImpl=qe,Fe}(this,function(Ae,Se){return Dd(Ae,Se),{preventCancel:!!(null==Ae?void 0:Ae.preventCancel)}}(Ae,"First parameter").preventCancel)}}function Ql(Ae,Se,Ce,qe=1,Fe=(()=>1)){const $e=Object.create(Yl.prototype);Jl($e);return jl($e,Object.create(Rl.prototype),Ae,Se,Ce,qe,Fe),$e}function Jl(Ae){Ae._state="readable",Ae._reader=void 0,Ae._storedError=void 0,Ae._disturbed=!1}function ep(Ae){return!!Qh(Ae)&&!!Object.prototype.hasOwnProperty.call(Ae,"_readableStreamController")}function tp(Ae){return void 0!==Ae._reader}function rp(Ae,Se){if(Ae._disturbed=!0,"closed"===Ae._state)return ad(void 0);if("errored"===Ae._state)return sd(Ae._storedError);ip(Ae);return dd(Ae._readableStreamController[Ly](Se),Xh)}function ip(Ae){Ae._state="closed";const Se=Ae._reader;void 0!==Se&&(Sd(Se),Gd(Se)&&(Se._readRequests.forEach((Ae=>{Ae._closeSteps()})),Se._readRequests=new bd))}function np(Ae,Se){Ae._state="errored",Ae._storedError=Se;const Ce=Ae._reader;void 0!==Ce&&(Ad(Ce,Se),Gd(Ce)?(Ce._readRequests.forEach((Ae=>{Ae._errorSteps(Se)})),Ce._readRequests=new bd):(Ce._readIntoRequests.forEach((Ae=>{Ae._errorSteps(Se)})),Ce._readIntoRequests=new bd))}function ap(Ae){return new TypeError(`ReadableStream.prototype.${Ae} can only be used on a ReadableStream`)}function sp(Ae,Se){Dd(Ae,Se);const Ce=null==Ae?void 0:Ae.highWaterMark;return Bd(Ce,"highWaterMark","QueuingStrategyInit"),{highWaterMark:Td(Ce)}}Object.defineProperties(Yl.prototype,{cancel:{enumerable:!0},getReader:{enumerable:!0},pipeThrough:{enumerable:!0},pipeTo:{enumerable:!0},tee:{enumerable:!0},values:{enumerable:!0},locked:{enumerable:!0}}),"symbol"==typeof Dy.toStringTag&&Object.defineProperty(Yl.prototype,Dy.toStringTag,{value:"ReadableStream",configurable:!0}),"symbol"==typeof Dy.asyncIterator&&Object.defineProperty(Yl.prototype,Dy.asyncIterator,{value:Yl.prototype.values,writable:!0,configurable:!0});const op=function(Ae){return Ae.byteLength};class cp{constructor(Ae){Id(Ae,1,"ByteLengthQueuingStrategy"),Ae=sp(Ae,"First parameter"),this._byteLengthQueuingStrategyHighWaterMark=Ae.highWaterMark}get highWaterMark(){if(!hp(this))throw up("highWaterMark");return this._byteLengthQueuingStrategyHighWaterMark}get size(){if(!hp(this))throw up("size");return op}}function up(Ae){return new TypeError(`ByteLengthQueuingStrategy.prototype.${Ae} can only be used on a ByteLengthQueuingStrategy`)}function hp(Ae){return!!Qh(Ae)&&!!Object.prototype.hasOwnProperty.call(Ae,"_byteLengthQueuingStrategyHighWaterMark")}Object.defineProperties(cp.prototype,{highWaterMark:{enumerable:!0},size:{enumerable:!0}}),"symbol"==typeof Dy.toStringTag&&Object.defineProperty(cp.prototype,Dy.toStringTag,{value:"ByteLengthQueuingStrategy",configurable:!0});const dp=function(){return 1};class fp{constructor(Ae){Id(Ae,1,"CountQueuingStrategy"),Ae=sp(Ae,"First parameter"),this._countQueuingStrategyHighWaterMark=Ae.highWaterMark}get highWaterMark(){if(!pp(this))throw lp("highWaterMark");return this._countQueuingStrategyHighWaterMark}get size(){if(!pp(this))throw lp("size");return dp}}function lp(Ae){return new TypeError(`CountQueuingStrategy.prototype.${Ae} can only be used on a CountQueuingStrategy`)}function pp(Ae){return!!Qh(Ae)&&!!Object.prototype.hasOwnProperty.call(Ae,"_countQueuingStrategyHighWaterMark")}function yp(Ae,Se,Ce){return Ud(Ae,Ce),Ce=>yd(Ae,Se,[Ce])}function bp(Ae,Se,Ce){return Ud(Ae,Ce),Ce=>pd(Ae,Se,[Ce])}function gp(Ae,Se,Ce){return Ud(Ae,Ce),(Ce,qe)=>yd(Ae,Se,[Ce,qe])}Object.defineProperties(fp.prototype,{highWaterMark:{enumerable:!0},size:{enumerable:!0}}),"symbol"==typeof Dy.toStringTag&&Object.defineProperty(fp.prototype,Dy.toStringTag,{value:"CountQueuingStrategy",configurable:!0});class mp{constructor(Ae={},Se={},Ce={}){void 0===Ae&&(Ae=null);const qe=Tf(Se,"Second parameter"),Fe=Tf(Ce,"Third parameter"),$e=function(Ae,Se){Dd(Ae,Se);const Ce=null==Ae?void 0:Ae.flush,qe=null==Ae?void 0:Ae.readableType,Fe=null==Ae?void 0:Ae.start,$e=null==Ae?void 0:Ae.transform,rt=null==Ae?void 0:Ae.writableType;return{flush:void 0===Ce?void 0:yp(Ce,Ae,Se+" has member 'flush' that"),readableType:qe,start:void 0===Fe?void 0:bp(Fe,Ae,Se+" has member 'start' that"),transform:void 0===$e?void 0:gp($e,Ae,Se+" has member 'transform' that"),writableType:rt}}(Ae,"First parameter");if(void 0!==$e.readableType)throw new RangeError("Invalid readableType specified");if(void 0!==$e.writableType)throw new RangeError("Invalid writableType specified");const rt=If(Fe,0),it=Bf(Fe),nt=If(qe,1),st=Bf(qe);let ut;!function(Ae,Se,Ce,qe,Fe,$e){function s(){return Se}function o(Se){return function(Ae,Se){const Ce=Ae._transformStreamController;if(Ae._backpressure){return dd(Ae._backpressureChangePromise,(()=>{const qe=Ae._writable;if("erroring"===qe._state)throw qe._storedError;return xp(Ce,Se)}))}return xp(Ce,Se)}(Ae,Se)}function c(Se){return function(Ae,Se){return vp(Ae,Se),ad(void 0)}(Ae,Se)}function u(){return function(Ae){const Se=Ae._readable,Ce=Ae._transformStreamController,qe=Ce._flushAlgorithm();return Ep(Ce),dd(qe,(()=>{if("errored"===Se._state)throw Se._storedError;ql(Se._readableStreamController)}),(Ce=>{throw vp(Ae,Ce),Se._storedError}))}(Ae)}function h(){return function(Ae){return kp(Ae,!1),Ae._backpressureChangePromise}(Ae)}function d(Se){return _p(Ae,Se),ad(void 0)}Ae._writable=function(Ae,Se,Ce,qe,Fe=1,$e=(()=>1)){const rt=Object.create(jf.prototype);return Wf(rt),dl(rt,Object.create(hl.prototype),Ae,Se,Ce,qe,Fe,$e),rt}(s,o,u,c,Ce,qe),Ae._readable=Ql(s,h,d,Fe,$e),Ae._backpressure=void 0,Ae._backpressureChangePromise=void 0,Ae._backpressureChangePromise_resolve=void 0,kp(Ae,!0),Ae._transformStreamController=void 0}(this,nd((Ae=>{ut=Ae})),nt,st,rt,it),function(Ae,Se){const Ce=Object.create(Ap.prototype);let i=Ae=>{try{return Pp(Ce,Ae),ad(void 0)}catch(Ae){return sd(Ae)}},n=()=>ad(void 0);void 0!==Se.transform&&(i=Ae=>Se.transform(Ae,Ce));void 0!==Se.flush&&(n=()=>Se.flush(Ce));!function(Ae,Se,Ce,qe){Se._controlledTransformStream=Ae,Ae._transformStreamController=Se,Se._transformAlgorithm=Ce,Se._flushAlgorithm=qe}(Ae,Ce,i,n)}(this,$e),void 0!==$e.start?ut($e.start(this._transformStreamController)):ut(void 0)}get readable(){if(!wp(this))throw Kp("readable");return this._readable}get writable(){if(!wp(this))throw Kp("writable");return this._writable}}function wp(Ae){return!!Qh(Ae)&&!!Object.prototype.hasOwnProperty.call(Ae,"_transformStreamController")}function vp(Ae,Se){Ol(Ae._readable._readableStreamController,Se),_p(Ae,Se)}function _p(Ae,Se){Ep(Ae._transformStreamController),yl(Ae._writable._writableStreamController,Se),Ae._backpressure&&kp(Ae,!1)}function kp(Ae,Se){void 0!==Ae._backpressureChangePromise&&Ae._backpressureChangePromise_resolve(),Ae._backpressureChangePromise=nd((Se=>{Ae._backpressureChangePromise_resolve=Se})),Ae._backpressure=Se}Object.defineProperties(mp.prototype,{readable:{enumerable:!0},writable:{enumerable:!0}}),"symbol"==typeof Dy.toStringTag&&Object.defineProperty(mp.prototype,Dy.toStringTag,{value:"TransformStream",configurable:!0});class Ap{constructor(){throw new TypeError("Illegal constructor")}get desiredSize(){if(!Sp(this))throw Mp("desiredSize");return Ll(this._controlledTransformStream._readable._readableStreamController)}enqueue(Ae=undefined){if(!Sp(this))throw Mp("enqueue");Pp(this,Ae)}error(Ae=undefined){if(!Sp(this))throw Mp("error");var Se;Se=Ae,vp(this._controlledTransformStream,Se)}terminate(){if(!Sp(this))throw Mp("terminate");!function(Ae){const Se=Ae._controlledTransformStream,Ce=Se._readable._readableStreamController;ql(Ce);_p(Se,new TypeError("TransformStream terminated"))}(this)}}function Sp(Ae){return!!Qh(Ae)&&!!Object.prototype.hasOwnProperty.call(Ae,"_controlledTransformStream")}function Ep(Ae){Ae._transformAlgorithm=void 0,Ae._flushAlgorithm=void 0}function Pp(Ae,Se){const Ce=Ae._controlledTransformStream,qe=Ce._readable._readableStreamController;if(!Nl(qe))throw new TypeError("Readable side is not in a state that permits enqueue");try{Fl(qe,Se)}catch(Ae){throw _p(Ce,Ae),Ce._readable._storedError}const Fe=function(Ae){return!Tl(Ae)}(qe);Fe!==Ce._backpressure&&kp(Ce,!0)}function xp(Ae,Se){return dd(Ae._transformAlgorithm(Se),void 0,(Se=>{throw vp(Ae._controlledTransformStream,Se),Se}))}function Mp(Ae){return new TypeError(`TransformStreamDefaultController.prototype.${Ae} can only be used on a TransformStreamDefaultController`)}function Kp(Ae){return new TypeError(`TransformStream.prototype.${Ae} can only be used on a TransformStream`)}Object.defineProperties(Ap.prototype,{enqueue:{enumerable:!0},error:{enumerable:!0},terminate:{enumerable:!0},desiredSize:{enumerable:!0}}),"symbol"==typeof Dy.toStringTag&&Object.defineProperty(Ap.prototype,Dy.toStringTag,{value:"TransformStreamDefaultController",configurable:!0});var sm=Object.freeze({__proto__:null,ByteLengthQueuingStrategy:cp,CountQueuingStrategy:fp,ReadableByteStreamController:cf,ReadableStream:Yl,ReadableStreamBYOBReader:Df,ReadableStreamBYOBRequest:of,ReadableStreamDefaultController:Rl,ReadableStreamDefaultReader:Wd,TransformStream:mp,TransformStreamDefaultController:Ap,WritableStream:jf,WritableStreamDefaultController:hl,WritableStreamDefaultWriter:rl}),Dp=function(Ae,Se){return Dp=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(Ae,Se){Ae.__proto__=Se}||function(Ae,Se){for(var Ce in Se)Object.prototype.hasOwnProperty.call(Se,Ce)&&(Ae[Ce]=Se[Ce])},Dp(Ae,Se) /*! ***************************************************************************** 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. ***************************************************************************** */};function Up(Ae,Se){if("function"!=typeof Se&&null!==Se)throw new TypeError("Class extends value "+Se+" is not a constructor or null");function r(){this.constructor=Ae}Dp(Ae,Se),Ae.prototype=null===Se?Object.create(Se):(r.prototype=Se.prototype,new r)}function Rp(Ae){if(!Ae)throw new TypeError("Assertion failed")}function Ip(){}function Bp(Ae){return"object"==typeof Ae&&null!==Ae||"function"==typeof Ae}function Tp(Ae){if("function"!=typeof Ae)return!1;var Se=!1;try{new Ae({start:function(){Se=!0}})}catch(Ae){}return Se}function zp(Ae){return!!Bp(Ae)&&"function"==typeof Ae.getReader}function qp(Ae){return!!Bp(Ae)&&"function"==typeof Ae.getWriter}function Fp(Ae){return!!Bp(Ae)&&(!!zp(Ae.readable)&&!!qp(Ae.writable))}function Op(Ae){try{return Ae.getReader({mode:"byob"}).releaseLock(),!0}catch(Ae){return!1}}function Lp(Ae,Se){var Ce=(void 0===Se?{}:Se).type;return Rp(zp(Ae)),Rp(!1===Ae.locked),"bytes"===(Ce=Np(Ce))?new cm(Ae):new om(Ae)}function Np(Ae){var Se=Ae+"";if("bytes"===Se)return Se;if(void 0===Ae)return Ae;throw new RangeError("Invalid type is specified")}var am=function(){function e(Ae){this._underlyingReader=void 0,this._readerMode=void 0,this._readableStreamController=void 0,this._pendingRead=void 0,this._underlyingStream=Ae,this._attachDefaultReader()}return e.prototype.start=function(Ae){this._readableStreamController=Ae},e.prototype.cancel=function(Ae){return Rp(void 0!==this._underlyingReader),this._underlyingReader.cancel(Ae)},e.prototype._attachDefaultReader=function(){if("default"!==this._readerMode){this._detachReader();var Ae=this._underlyingStream.getReader();this._readerMode="default",this._attachReader(Ae)}},e.prototype._attachReader=function(Ae){var Se=this;Rp(void 0===this._underlyingReader),this._underlyingReader=Ae;var Ce=this._underlyingReader.closed;Ce&&Ce.then((function(){return Se._finishPendingRead()})).then((function(){Ae===Se._underlyingReader&&Se._readableStreamController.close()}),(function(Ce){Ae===Se._underlyingReader&&Se._readableStreamController.error(Ce)})).catch(Ip)},e.prototype._detachReader=function(){void 0!==this._underlyingReader&&(this._underlyingReader.releaseLock(),this._underlyingReader=void 0,this._readerMode=void 0)},e.prototype._pullWithDefaultReader=function(){var Ae=this;this._attachDefaultReader();var Se=this._underlyingReader.read().then((function(Se){var Ce=Ae._readableStreamController;Se.done?Ae._tryClose():Ce.enqueue(Se.value)}));return this._setPendingRead(Se),Se},e.prototype._tryClose=function(){try{this._readableStreamController.close()}catch(Ae){}},e.prototype._setPendingRead=function(Ae){var Se,Ce=this,i=function(){Ce._pendingRead===Se&&(Ce._pendingRead=void 0)};this._pendingRead=Se=Ae.then(i,i)},e.prototype._finishPendingRead=function(){var Ae=this;if(this._pendingRead){var t=function(){return Ae._finishPendingRead()};return this._pendingRead.then(t,t)}},e}(),om=function(Ae){function t(){return null!==Ae&&Ae.apply(this,arguments)||this}return Up(t,Ae),t.prototype.pull=function(){return this._pullWithDefaultReader()},t}(am);function Wp(Ae){return new Uint8Array(Ae.buffer,Ae.byteOffset,Ae.byteLength)}var cm=function(Ae){function t(Se){var Ce=this,qe=Op(Se);return(Ce=Ae.call(this,Se)||this)._supportsByob=qe,Ce}return Up(t,Ae),Object.defineProperty(t.prototype,"type",{get:function(){return"bytes"},enumerable:!1,configurable:!0}),t.prototype._attachByobReader=function(){if("byob"!==this._readerMode){Rp(this._supportsByob),this._detachReader();var Ae=this._underlyingStream.getReader({mode:"byob"});this._readerMode="byob",this._attachReader(Ae)}},t.prototype.pull=function(){if(this._supportsByob){var Ae=this._readableStreamController.byobRequest;if(Ae)return this._pullWithByobRequest(Ae)}return this._pullWithDefaultReader()},t.prototype._pullWithByobRequest=function(Ae){var Se=this;this._attachByobReader();var Ce=new Uint8Array(Ae.view.byteLength),qe=this._underlyingReader.read(Ce).then((function(Ce){var qe,Fe,$e;Se._readableStreamController,Ce.done?(Se._tryClose(),Ae.respond(0)):(qe=Ce.value,Fe=Ae.view,$e=Wp(qe),Wp(Fe).set($e,0),Ae.respond(Ce.value.byteLength))}));return this._setPendingRead(qe),qe},t}(am);function Vp(Ae){Rp(qp(Ae)),Rp(!1===Ae.locked);var Se=Ae.getWriter();return new um(Se)}var um=function(){function e(Ae){var Se=this;this._writableStreamController=void 0,this._pendingWrite=void 0,this._state="writable",this._storedError=void 0,this._underlyingWriter=Ae,this._errorPromise=new Promise((function(Ae,Ce){Se._errorPromiseReject=Ce})),this._errorPromise.catch(Ip)}return e.prototype.start=function(Ae){var Se=this;this._writableStreamController=Ae,this._underlyingWriter.closed.then((function(){Se._state="closed"})).catch((function(Ae){return Se._finishErroring(Ae)}))},e.prototype.write=function(Ae){var Se=this,Ce=this._underlyingWriter;if(null===Ce.desiredSize)return Ce.ready;var qe=Ce.write(Ae);qe.catch((function(Ae){return Se._finishErroring(Ae)})),Ce.ready.catch((function(Ae){return Se._startErroring(Ae)}));var Fe=Promise.race([qe,this._errorPromise]);return this._setPendingWrite(Fe),Fe},e.prototype.close=function(){var Ae=this;return void 0===this._pendingWrite?this._underlyingWriter.close():this._finishPendingWrite().then((function(){return Ae.close()}))},e.prototype.abort=function(Ae){if("errored"!==this._state)return this._underlyingWriter.abort(Ae)},e.prototype._setPendingWrite=function(Ae){var Se,Ce=this,i=function(){Ce._pendingWrite===Se&&(Ce._pendingWrite=void 0)};this._pendingWrite=Se=Ae.then(i,i)},e.prototype._finishPendingWrite=function(){var Ae=this;if(void 0===this._pendingWrite)return Promise.resolve();var t=function(){return Ae._finishPendingWrite()};return this._pendingWrite.then(t,t)},e.prototype._startErroring=function(Ae){var Se=this;if("writable"===this._state){this._state="erroring",this._storedError=Ae;var r=function(){return Se._finishErroring(Ae)};void 0===this._pendingWrite?r():this._finishPendingWrite().then(r,r),this._writableStreamController.error(Ae)}},e.prototype._finishErroring=function(Ae){"writable"===this._state&&this._startErroring(Ae),"erroring"===this._state&&(this._state="errored",this._errorPromiseReject(this._storedError))},e}();function Zp(Ae){Rp(Fp(Ae));var Se=Ae.readable,Ce=Ae.writable;Rp(!1===Se.locked),Rp(!1===Ce.locked);var qe,Fe=Se.getReader();try{qe=Ce.getWriter()}catch(Ae){throw Fe.releaseLock(),Ae}return new hm(Fe,qe)}var hm=function(){function e(Ae,Se){var Ce=this;this._transformStreamController=void 0,this._onRead=function(Ae){if(!Ae.done)return Ce._transformStreamController.enqueue(Ae.value),Ce._reader.read().then(Ce._onRead)},this._onError=function(Ae){Ce._flushReject(Ae),Ce._transformStreamController.error(Ae),Ce._reader.cancel(Ae).catch(Ip),Ce._writer.abort(Ae).catch(Ip)},this._onTerminate=function(){Ce._flushResolve(),Ce._transformStreamController.terminate();var Ae=new TypeError("TransformStream terminated");Ce._writer.abort(Ae).catch(Ip)},this._reader=Ae,this._writer=Se,this._flushPromise=new Promise((function(Ae,Se){Ce._flushResolve=Ae,Ce._flushReject=Se}))}return e.prototype.start=function(Ae){this._transformStreamController=Ae,this._reader.read().then(this._onRead).then(this._onTerminate,this._onError);var Se=this._reader.closed;Se&&Se.then(this._onTerminate,this._onError)},e.prototype.transform=function(Ae){return this._writer.write(Ae)},e.prototype.flush=function(){var Ae=this;return this._writer.close().then((function(){return Ae._flushPromise}))},e}(),dm=Object.freeze({__proto__:null,createReadableStreamWrapper:function(Ae){Rp(function(Ae){return!!Tp(Ae)&&!!zp(new Ae)}(Ae));var Se=function(Ae){try{return new Ae({type:"bytes"}),!0}catch(Ae){return!1}}(Ae);return function(Ce,qe){var Fe=(void 0===qe?{}:qe).type;if("bytes"!==(Fe=Np(Fe))||Se||(Fe=void 0),Ce.constructor===Ae&&("bytes"!==Fe||Op(Ce)))return Ce;if("bytes"===Fe){var $e=Lp(Ce,{type:Fe});return new Ae($e)}$e=Lp(Ce);return new Ae($e)}},createTransformStreamWrapper:function(Ae){return Rp(function(Ae){return!!Tp(Ae)&&!!Fp(new Ae)}(Ae)),function(Se){if(Se.constructor===Ae)return Se;var Ce=Zp(Se);return new Ae(Ce)}},createWrappingReadableSource:Lp,createWrappingTransformer:Zp,createWrappingWritableSink:Vp,createWritableStreamWrapper:function(Ae){return Rp(function(Ae){return!!Tp(Ae)&&!!qp(new Ae)}(Ae)),function(Se){if(Se.constructor===Ae)return Se;var Ce=Vp(Se);return new Ae(Ce)}}}),lm=mt((function(Ae){!function(Ae,Se){function r(Ae,Se){if(!Ae)throw Error(Se||"Assertion failed")}function i(Ae,Se){Ae.super_=Se;var r=function(){};r.prototype=Se.prototype,Ae.prototype=new r,Ae.prototype.constructor=Ae}function n(Ae,Se,Ce){if(n.isBN(Ae))return Ae;this.negative=0,this.words=null,this.length=0,this.red=null,null!==Ae&&("le"!==Se&&"be"!==Se||(Ce=Se,Se=10),this._init(Ae||0,Se||10,Ce||"be"))}var Ce;"object"==typeof Ae?Ae.exports=n:Se.BN=n,n.BN=n,n.wordSize=26;try{Ce=ht.default.Buffer}catch(Ae){}function s(Ae,Se,Ce){for(var qe=0,Fe=Math.min(Ae.length,Ce),$e=Se;$e=49&&rt<=54?rt-49+10:rt>=17&&rt<=22?rt-17+10:15&rt}return qe}function o(Ae,Se,Ce,qe){for(var Fe=0,$e=Math.min(Ae.length,Ce),rt=Se;rt<$e;rt++){var it=Ae.charCodeAt(rt)-48;Fe*=qe,Fe+=it>=49?it-49+10:it>=17?it-17+10:it}return Fe}n.isBN=function(Ae){return Ae instanceof n||null!==Ae&&"object"==typeof Ae&&Ae.constructor.wordSize===n.wordSize&&Array.isArray(Ae.words)},n.max=function(Ae,Se){return Ae.cmp(Se)>0?Ae:Se},n.min=function(Ae,Se){return Ae.cmp(Se)<0?Ae:Se},n.prototype._init=function(Ae,Se,Ce){if("number"==typeof Ae)return this._initNumber(Ae,Se,Ce);if("object"==typeof Ae)return this._initArray(Ae,Se,Ce);"hex"===Se&&(Se=16),r(Se===(0|Se)&&Se>=2&&Se<=36);var qe=0;"-"===(Ae=Ae.toString().replace(/\s+/g,""))[0]&&qe++,16===Se?this._parseHex(Ae,qe):this._parseBase(Ae,Se,qe),"-"===Ae[0]&&(this.negative=1),this.strip(),"le"===Ce&&this._initArray(this.toArray(),Se,Ce)},n.prototype._initNumber=function(Ae,Se,Ce){Ae<0&&(this.negative=1,Ae=-Ae),Ae<67108864?(this.words=[67108863&Ae],this.length=1):Ae<4503599627370496?(this.words=[67108863&Ae,Ae/67108864&67108863],this.length=2):(r(Ae<9007199254740992),this.words=[67108863&Ae,Ae/67108864&67108863,1],this.length=3),"le"===Ce&&this._initArray(this.toArray(),Se,Ce)},n.prototype._initArray=function(Ae,Se,Ce){if(r("number"==typeof Ae.length),Ae.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(Ae.length/3),this.words=Array(this.length);for(var qe=0;qe=0;qe-=3)$e=Ae[qe]|Ae[qe-1]<<8|Ae[qe-2]<<16,this.words[Fe]|=$e<>>26-rt&67108863,(rt+=24)>=26&&(rt-=26,Fe++);else if("le"===Ce)for(qe=0,Fe=0;qe>>26-rt&67108863,(rt+=24)>=26&&(rt-=26,Fe++);return this.strip()},n.prototype._parseHex=function(Ae,Se){this.length=Math.ceil((Ae.length-Se)/6),this.words=Array(this.length);for(var Ce=0;Ce=Se;Ce-=6)Fe=s(Ae,Ce,Ce+6),this.words[qe]|=Fe<<$e&67108863,this.words[qe+1]|=Fe>>>26-$e&4194303,($e+=24)>=26&&($e-=26,qe++);Ce+6!==Se&&(Fe=s(Ae,Se,Ce+6),this.words[qe]|=Fe<<$e&67108863,this.words[qe+1]|=Fe>>>26-$e&4194303),this.strip()},n.prototype._parseBase=function(Ae,Se,Ce){this.words=[0],this.length=1;for(var qe=0,Fe=1;Fe<=67108863;Fe*=Se)qe++;qe--,Fe=Fe/Se|0;for(var $e=Ae.length-Ce,rt=$e%qe,it=Math.min($e,$e-rt)+Ce,nt=0,st=Ce;st1&&0===this.words[this.length-1];)this.length--;return this._normSign()},n.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},n.prototype.inspect=function(){return(this.red?""};var qe=["","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"],Fe=[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],$e=[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 f(Ae,Se,Ce){Ce.negative=Se.negative^Ae.negative;var qe=Ae.length+Se.length|0;Ce.length=qe,qe=qe-1|0;var Fe=0|Ae.words[0],$e=0|Se.words[0],rt=Fe*$e,it=67108863&rt,nt=rt/67108864|0;Ce.words[0]=it;for(var st=1;st>>26,ht=67108863&nt,ft=Math.min(st,Se.length-1),yt=Math.max(0,st-Ae.length+1);yt<=ft;yt++){var vt=st-yt|0;ut+=(rt=(Fe=0|Ae.words[vt])*($e=0|Se.words[yt])+ht)/67108864|0,ht=67108863&rt}Ce.words[st]=0|ht,nt=0|ut}return 0!==nt?Ce.words[st]=0|nt:Ce.length--,Ce.strip()}n.prototype.toString=function(Ae,Se){var Ce;if(Se=0|Se||1,16===(Ae=Ae||10)||"hex"===Ae){Ce="";for(var rt=0,it=0,nt=0;nt>>24-rt&16777215)||nt!==this.length-1?qe[6-ut.length]+ut+Ce:ut+Ce,(rt+=2)>=26&&(rt-=26,nt--)}for(0!==it&&(Ce=it.toString(16)+Ce);Ce.length%Se!=0;)Ce="0"+Ce;return 0!==this.negative&&(Ce="-"+Ce),Ce}if(Ae===(0|Ae)&&Ae>=2&&Ae<=36){var ht=Fe[Ae],ft=$e[Ae];Ce="";var yt=this.clone();for(yt.negative=0;!yt.isZero();){var vt=yt.modn(ft).toString(Ae);Ce=(yt=yt.idivn(ft)).isZero()?vt+Ce:qe[ht-vt.length]+vt+Ce}for(this.isZero()&&(Ce="0"+Ce);Ce.length%Se!=0;)Ce="0"+Ce;return 0!==this.negative&&(Ce="-"+Ce),Ce}r(!1,"Base should be between 2 and 36")},n.prototype.toNumber=function(){var Ae=this.words[0];return 2===this.length?Ae+=67108864*this.words[1]:3===this.length&&1===this.words[2]?Ae+=4503599627370496+67108864*this.words[1]:this.length>2&&r(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-Ae:Ae},n.prototype.toJSON=function(){return this.toString(16)},n.prototype.toBuffer=function(Ae,Se){return r(void 0!==Ce),this.toArrayLike(Ce,Ae,Se)},n.prototype.toArray=function(Ae,Se){return this.toArrayLike(Array,Ae,Se)},n.prototype.toArrayLike=function(Ae,Se,Ce){var qe=this.byteLength(),Fe=Ce||Math.max(1,qe);r(qe<=Fe,"byte array longer than desired length"),r(Fe>0,"Requested array length <= 0"),this.strip();var $e,rt,it="le"===Se,nt=new Ae(Fe),st=this.clone();if(it){for(rt=0;!st.isZero();rt++)$e=st.andln(255),st.iushrn(8),nt[rt]=$e;for(;rt=4096&&(Ce+=13,Se>>>=13),Se>=64&&(Ce+=7,Se>>>=7),Se>=8&&(Ce+=4,Se>>>=4),Se>=2&&(Ce+=2,Se>>>=2),Ce+Se},n.prototype._zeroBits=function(Ae){if(0===Ae)return 26;var Se=Ae,Ce=0;return 0==(8191&Se)&&(Ce+=13,Se>>>=13),0==(127&Se)&&(Ce+=7,Se>>>=7),0==(15&Se)&&(Ce+=4,Se>>>=4),0==(3&Se)&&(Ce+=2,Se>>>=2),0==(1&Se)&&Ce++,Ce},n.prototype.bitLength=function(){var Ae=this.words[this.length-1],Se=this._countBits(Ae);return 26*(this.length-1)+Se},n.prototype.zeroBits=function(){if(this.isZero())return 0;for(var Ae=0,Se=0;SeAe.length?this.clone().ior(Ae):Ae.clone().ior(this)},n.prototype.uor=function(Ae){return this.length>Ae.length?this.clone().iuor(Ae):Ae.clone().iuor(this)},n.prototype.iuand=function(Ae){var Se;Se=this.length>Ae.length?Ae:this;for(var Ce=0;CeAe.length?this.clone().iand(Ae):Ae.clone().iand(this)},n.prototype.uand=function(Ae){return this.length>Ae.length?this.clone().iuand(Ae):Ae.clone().iuand(this)},n.prototype.iuxor=function(Ae){var Se,Ce;this.length>Ae.length?(Se=this,Ce=Ae):(Se=Ae,Ce=this);for(var qe=0;qeAe.length?this.clone().ixor(Ae):Ae.clone().ixor(this)},n.prototype.uxor=function(Ae){return this.length>Ae.length?this.clone().iuxor(Ae):Ae.clone().iuxor(this)},n.prototype.inotn=function(Ae){r("number"==typeof Ae&&Ae>=0);var Se=0|Math.ceil(Ae/26),Ce=Ae%26;this._expand(Se),Ce>0&&Se--;for(var qe=0;qe0&&(this.words[qe]=~this.words[qe]&67108863>>26-Ce),this.strip()},n.prototype.notn=function(Ae){return this.clone().inotn(Ae)},n.prototype.setn=function(Ae,Se){r("number"==typeof Ae&&Ae>=0);var Ce=Ae/26|0,qe=Ae%26;return this._expand(Ce+1),this.words[Ce]=Se?this.words[Ce]|1<Ae.length?(Ce=this,qe=Ae):(Ce=Ae,qe=this);for(var Fe=0,$e=0;$e>>26;for(;0!==Fe&&$e>>26;if(this.length=Ce.length,0!==Fe)this.words[this.length]=Fe,this.length++;else if(Ce!==this)for(;$eAe.length?this.clone().iadd(Ae):Ae.clone().iadd(this)},n.prototype.isub=function(Ae){if(0!==Ae.negative){Ae.negative=0;var Se=this.iadd(Ae);return Ae.negative=1,Se._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(Ae),this.negative=1,this._normSign();var Ce,qe,Fe=this.cmp(Ae);if(0===Fe)return this.negative=0,this.length=1,this.words[0]=0,this;Fe>0?(Ce=this,qe=Ae):(Ce=Ae,qe=this);for(var $e=0,rt=0;rt>26,this.words[rt]=67108863&Se;for(;0!==$e&&rt>26,this.words[rt]=67108863&Se;if(0===$e&&rt>>13,yt=0|rt[1],vt=8191&yt,_t=yt>>>13,Ct=0|rt[2],Rt=8191&Ct,Ut=Ct>>>13,It=0|rt[3],Ot=8191&It,Nt=It>>>13,jt=0|rt[4],Ft=8191&jt,Lt=jt>>>13,Ht=0|rt[5],Wt=8191&Ht,Gt=Ht>>>13,$t=0|rt[6],Vt=8191&$t,Qt=$t>>>13,Zt=0|rt[7],Xt=8191&Zt,er=Zt>>>13,tr=0|rt[8],rr=8191&tr,ir=tr>>>13,nr=0|rt[9],sr=8191&nr,ar=nr>>>13,cr=0|it[0],ur=8191&cr,hr=cr>>>13,dr=0|it[1],lr=8191&dr,fr=dr>>>13,yr=0|it[2],Cr=8191&yr,Dr=yr>>>13,Rr=0|it[3],Kr=8191&Rr,Tr=Rr>>>13,Ur=0|it[4],Ir=8191&Ur,Or=Ur>>>13,Nr=0|it[5],jr=8191&Nr,Lr=Nr>>>13,Hr=0|it[6],Qr=8191&Hr,ti=Hr>>>13,ri=0|it[7],ii=8191&ri,oi=ri>>>13,ci=0|it[8],di=8191&ci,li=ci>>>13,fi=0|it[9],pi=8191&fi,yi=fi>>>13;Ce.negative=Ae.negative^Se.negative,Ce.length=19;var mi=(st+(qe=Math.imul(ht,ur))|0)+((8191&(Fe=(Fe=Math.imul(ht,hr))+Math.imul(ft,ur)|0))<<13)|0;st=(($e=Math.imul(ft,hr))+(Fe>>>13)|0)+(mi>>>26)|0,mi&=67108863,qe=Math.imul(vt,ur),Fe=(Fe=Math.imul(vt,hr))+Math.imul(_t,ur)|0,$e=Math.imul(_t,hr);var vi=(st+(qe=qe+Math.imul(ht,lr)|0)|0)+((8191&(Fe=(Fe=Fe+Math.imul(ht,fr)|0)+Math.imul(ft,lr)|0))<<13)|0;st=(($e=$e+Math.imul(ft,fr)|0)+(Fe>>>13)|0)+(vi>>>26)|0,vi&=67108863,qe=Math.imul(Rt,ur),Fe=(Fe=Math.imul(Rt,hr))+Math.imul(Ut,ur)|0,$e=Math.imul(Ut,hr),qe=qe+Math.imul(vt,lr)|0,Fe=(Fe=Fe+Math.imul(vt,fr)|0)+Math.imul(_t,lr)|0,$e=$e+Math.imul(_t,fr)|0;var wi=(st+(qe=qe+Math.imul(ht,Cr)|0)|0)+((8191&(Fe=(Fe=Fe+Math.imul(ht,Dr)|0)+Math.imul(ft,Cr)|0))<<13)|0;st=(($e=$e+Math.imul(ft,Dr)|0)+(Fe>>>13)|0)+(wi>>>26)|0,wi&=67108863,qe=Math.imul(Ot,ur),Fe=(Fe=Math.imul(Ot,hr))+Math.imul(Nt,ur)|0,$e=Math.imul(Nt,hr),qe=qe+Math.imul(Rt,lr)|0,Fe=(Fe=Fe+Math.imul(Rt,fr)|0)+Math.imul(Ut,lr)|0,$e=$e+Math.imul(Ut,fr)|0,qe=qe+Math.imul(vt,Cr)|0,Fe=(Fe=Fe+Math.imul(vt,Dr)|0)+Math.imul(_t,Cr)|0,$e=$e+Math.imul(_t,Dr)|0;var ki=(st+(qe=qe+Math.imul(ht,Kr)|0)|0)+((8191&(Fe=(Fe=Fe+Math.imul(ht,Tr)|0)+Math.imul(ft,Kr)|0))<<13)|0;st=(($e=$e+Math.imul(ft,Tr)|0)+(Fe>>>13)|0)+(ki>>>26)|0,ki&=67108863,qe=Math.imul(Ft,ur),Fe=(Fe=Math.imul(Ft,hr))+Math.imul(Lt,ur)|0,$e=Math.imul(Lt,hr),qe=qe+Math.imul(Ot,lr)|0,Fe=(Fe=Fe+Math.imul(Ot,fr)|0)+Math.imul(Nt,lr)|0,$e=$e+Math.imul(Nt,fr)|0,qe=qe+Math.imul(Rt,Cr)|0,Fe=(Fe=Fe+Math.imul(Rt,Dr)|0)+Math.imul(Ut,Cr)|0,$e=$e+Math.imul(Ut,Dr)|0,qe=qe+Math.imul(vt,Kr)|0,Fe=(Fe=Fe+Math.imul(vt,Tr)|0)+Math.imul(_t,Kr)|0,$e=$e+Math.imul(_t,Tr)|0;var Si=(st+(qe=qe+Math.imul(ht,Ir)|0)|0)+((8191&(Fe=(Fe=Fe+Math.imul(ht,Or)|0)+Math.imul(ft,Ir)|0))<<13)|0;st=(($e=$e+Math.imul(ft,Or)|0)+(Fe>>>13)|0)+(Si>>>26)|0,Si&=67108863,qe=Math.imul(Wt,ur),Fe=(Fe=Math.imul(Wt,hr))+Math.imul(Gt,ur)|0,$e=Math.imul(Gt,hr),qe=qe+Math.imul(Ft,lr)|0,Fe=(Fe=Fe+Math.imul(Ft,fr)|0)+Math.imul(Lt,lr)|0,$e=$e+Math.imul(Lt,fr)|0,qe=qe+Math.imul(Ot,Cr)|0,Fe=(Fe=Fe+Math.imul(Ot,Dr)|0)+Math.imul(Nt,Cr)|0,$e=$e+Math.imul(Nt,Dr)|0,qe=qe+Math.imul(Rt,Kr)|0,Fe=(Fe=Fe+Math.imul(Rt,Tr)|0)+Math.imul(Ut,Kr)|0,$e=$e+Math.imul(Ut,Tr)|0,qe=qe+Math.imul(vt,Ir)|0,Fe=(Fe=Fe+Math.imul(vt,Or)|0)+Math.imul(_t,Ir)|0,$e=$e+Math.imul(_t,Or)|0;var Ei=(st+(qe=qe+Math.imul(ht,jr)|0)|0)+((8191&(Fe=(Fe=Fe+Math.imul(ht,Lr)|0)+Math.imul(ft,jr)|0))<<13)|0;st=(($e=$e+Math.imul(ft,Lr)|0)+(Fe>>>13)|0)+(Ei>>>26)|0,Ei&=67108863,qe=Math.imul(Vt,ur),Fe=(Fe=Math.imul(Vt,hr))+Math.imul(Qt,ur)|0,$e=Math.imul(Qt,hr),qe=qe+Math.imul(Wt,lr)|0,Fe=(Fe=Fe+Math.imul(Wt,fr)|0)+Math.imul(Gt,lr)|0,$e=$e+Math.imul(Gt,fr)|0,qe=qe+Math.imul(Ft,Cr)|0,Fe=(Fe=Fe+Math.imul(Ft,Dr)|0)+Math.imul(Lt,Cr)|0,$e=$e+Math.imul(Lt,Dr)|0,qe=qe+Math.imul(Ot,Kr)|0,Fe=(Fe=Fe+Math.imul(Ot,Tr)|0)+Math.imul(Nt,Kr)|0,$e=$e+Math.imul(Nt,Tr)|0,qe=qe+Math.imul(Rt,Ir)|0,Fe=(Fe=Fe+Math.imul(Rt,Or)|0)+Math.imul(Ut,Ir)|0,$e=$e+Math.imul(Ut,Or)|0,qe=qe+Math.imul(vt,jr)|0,Fe=(Fe=Fe+Math.imul(vt,Lr)|0)+Math.imul(_t,jr)|0,$e=$e+Math.imul(_t,Lr)|0;var Mi=(st+(qe=qe+Math.imul(ht,Qr)|0)|0)+((8191&(Fe=(Fe=Fe+Math.imul(ht,ti)|0)+Math.imul(ft,Qr)|0))<<13)|0;st=(($e=$e+Math.imul(ft,ti)|0)+(Fe>>>13)|0)+(Mi>>>26)|0,Mi&=67108863,qe=Math.imul(Xt,ur),Fe=(Fe=Math.imul(Xt,hr))+Math.imul(er,ur)|0,$e=Math.imul(er,hr),qe=qe+Math.imul(Vt,lr)|0,Fe=(Fe=Fe+Math.imul(Vt,fr)|0)+Math.imul(Qt,lr)|0,$e=$e+Math.imul(Qt,fr)|0,qe=qe+Math.imul(Wt,Cr)|0,Fe=(Fe=Fe+Math.imul(Wt,Dr)|0)+Math.imul(Gt,Cr)|0,$e=$e+Math.imul(Gt,Dr)|0,qe=qe+Math.imul(Ft,Kr)|0,Fe=(Fe=Fe+Math.imul(Ft,Tr)|0)+Math.imul(Lt,Kr)|0,$e=$e+Math.imul(Lt,Tr)|0,qe=qe+Math.imul(Ot,Ir)|0,Fe=(Fe=Fe+Math.imul(Ot,Or)|0)+Math.imul(Nt,Ir)|0,$e=$e+Math.imul(Nt,Or)|0,qe=qe+Math.imul(Rt,jr)|0,Fe=(Fe=Fe+Math.imul(Rt,Lr)|0)+Math.imul(Ut,jr)|0,$e=$e+Math.imul(Ut,Lr)|0,qe=qe+Math.imul(vt,Qr)|0,Fe=(Fe=Fe+Math.imul(vt,ti)|0)+Math.imul(_t,Qr)|0,$e=$e+Math.imul(_t,ti)|0;var Pi=(st+(qe=qe+Math.imul(ht,ii)|0)|0)+((8191&(Fe=(Fe=Fe+Math.imul(ht,oi)|0)+Math.imul(ft,ii)|0))<<13)|0;st=(($e=$e+Math.imul(ft,oi)|0)+(Fe>>>13)|0)+(Pi>>>26)|0,Pi&=67108863,qe=Math.imul(rr,ur),Fe=(Fe=Math.imul(rr,hr))+Math.imul(ir,ur)|0,$e=Math.imul(ir,hr),qe=qe+Math.imul(Xt,lr)|0,Fe=(Fe=Fe+Math.imul(Xt,fr)|0)+Math.imul(er,lr)|0,$e=$e+Math.imul(er,fr)|0,qe=qe+Math.imul(Vt,Cr)|0,Fe=(Fe=Fe+Math.imul(Vt,Dr)|0)+Math.imul(Qt,Cr)|0,$e=$e+Math.imul(Qt,Dr)|0,qe=qe+Math.imul(Wt,Kr)|0,Fe=(Fe=Fe+Math.imul(Wt,Tr)|0)+Math.imul(Gt,Kr)|0,$e=$e+Math.imul(Gt,Tr)|0,qe=qe+Math.imul(Ft,Ir)|0,Fe=(Fe=Fe+Math.imul(Ft,Or)|0)+Math.imul(Lt,Ir)|0,$e=$e+Math.imul(Lt,Or)|0,qe=qe+Math.imul(Ot,jr)|0,Fe=(Fe=Fe+Math.imul(Ot,Lr)|0)+Math.imul(Nt,jr)|0,$e=$e+Math.imul(Nt,Lr)|0,qe=qe+Math.imul(Rt,Qr)|0,Fe=(Fe=Fe+Math.imul(Rt,ti)|0)+Math.imul(Ut,Qr)|0,$e=$e+Math.imul(Ut,ti)|0,qe=qe+Math.imul(vt,ii)|0,Fe=(Fe=Fe+Math.imul(vt,oi)|0)+Math.imul(_t,ii)|0,$e=$e+Math.imul(_t,oi)|0;var xi=(st+(qe=qe+Math.imul(ht,di)|0)|0)+((8191&(Fe=(Fe=Fe+Math.imul(ht,li)|0)+Math.imul(ft,di)|0))<<13)|0;st=(($e=$e+Math.imul(ft,li)|0)+(Fe>>>13)|0)+(xi>>>26)|0,xi&=67108863,qe=Math.imul(sr,ur),Fe=(Fe=Math.imul(sr,hr))+Math.imul(ar,ur)|0,$e=Math.imul(ar,hr),qe=qe+Math.imul(rr,lr)|0,Fe=(Fe=Fe+Math.imul(rr,fr)|0)+Math.imul(ir,lr)|0,$e=$e+Math.imul(ir,fr)|0,qe=qe+Math.imul(Xt,Cr)|0,Fe=(Fe=Fe+Math.imul(Xt,Dr)|0)+Math.imul(er,Cr)|0,$e=$e+Math.imul(er,Dr)|0,qe=qe+Math.imul(Vt,Kr)|0,Fe=(Fe=Fe+Math.imul(Vt,Tr)|0)+Math.imul(Qt,Kr)|0,$e=$e+Math.imul(Qt,Tr)|0,qe=qe+Math.imul(Wt,Ir)|0,Fe=(Fe=Fe+Math.imul(Wt,Or)|0)+Math.imul(Gt,Ir)|0,$e=$e+Math.imul(Gt,Or)|0,qe=qe+Math.imul(Ft,jr)|0,Fe=(Fe=Fe+Math.imul(Ft,Lr)|0)+Math.imul(Lt,jr)|0,$e=$e+Math.imul(Lt,Lr)|0,qe=qe+Math.imul(Ot,Qr)|0,Fe=(Fe=Fe+Math.imul(Ot,ti)|0)+Math.imul(Nt,Qr)|0,$e=$e+Math.imul(Nt,ti)|0,qe=qe+Math.imul(Rt,ii)|0,Fe=(Fe=Fe+Math.imul(Rt,oi)|0)+Math.imul(Ut,ii)|0,$e=$e+Math.imul(Ut,oi)|0,qe=qe+Math.imul(vt,di)|0,Fe=(Fe=Fe+Math.imul(vt,li)|0)+Math.imul(_t,di)|0,$e=$e+Math.imul(_t,li)|0;var Ci=(st+(qe=qe+Math.imul(ht,pi)|0)|0)+((8191&(Fe=(Fe=Fe+Math.imul(ht,yi)|0)+Math.imul(ft,pi)|0))<<13)|0;st=(($e=$e+Math.imul(ft,yi)|0)+(Fe>>>13)|0)+(Ci>>>26)|0,Ci&=67108863,qe=Math.imul(sr,lr),Fe=(Fe=Math.imul(sr,fr))+Math.imul(ar,lr)|0,$e=Math.imul(ar,fr),qe=qe+Math.imul(rr,Cr)|0,Fe=(Fe=Fe+Math.imul(rr,Dr)|0)+Math.imul(ir,Cr)|0,$e=$e+Math.imul(ir,Dr)|0,qe=qe+Math.imul(Xt,Kr)|0,Fe=(Fe=Fe+Math.imul(Xt,Tr)|0)+Math.imul(er,Kr)|0,$e=$e+Math.imul(er,Tr)|0,qe=qe+Math.imul(Vt,Ir)|0,Fe=(Fe=Fe+Math.imul(Vt,Or)|0)+Math.imul(Qt,Ir)|0,$e=$e+Math.imul(Qt,Or)|0,qe=qe+Math.imul(Wt,jr)|0,Fe=(Fe=Fe+Math.imul(Wt,Lr)|0)+Math.imul(Gt,jr)|0,$e=$e+Math.imul(Gt,Lr)|0,qe=qe+Math.imul(Ft,Qr)|0,Fe=(Fe=Fe+Math.imul(Ft,ti)|0)+Math.imul(Lt,Qr)|0,$e=$e+Math.imul(Lt,ti)|0,qe=qe+Math.imul(Ot,ii)|0,Fe=(Fe=Fe+Math.imul(Ot,oi)|0)+Math.imul(Nt,ii)|0,$e=$e+Math.imul(Nt,oi)|0,qe=qe+Math.imul(Rt,di)|0,Fe=(Fe=Fe+Math.imul(Rt,li)|0)+Math.imul(Ut,di)|0,$e=$e+Math.imul(Ut,li)|0;var Di=(st+(qe=qe+Math.imul(vt,pi)|0)|0)+((8191&(Fe=(Fe=Fe+Math.imul(vt,yi)|0)+Math.imul(_t,pi)|0))<<13)|0;st=(($e=$e+Math.imul(_t,yi)|0)+(Fe>>>13)|0)+(Di>>>26)|0,Di&=67108863,qe=Math.imul(sr,Cr),Fe=(Fe=Math.imul(sr,Dr))+Math.imul(ar,Cr)|0,$e=Math.imul(ar,Dr),qe=qe+Math.imul(rr,Kr)|0,Fe=(Fe=Fe+Math.imul(rr,Tr)|0)+Math.imul(ir,Kr)|0,$e=$e+Math.imul(ir,Tr)|0,qe=qe+Math.imul(Xt,Ir)|0,Fe=(Fe=Fe+Math.imul(Xt,Or)|0)+Math.imul(er,Ir)|0,$e=$e+Math.imul(er,Or)|0,qe=qe+Math.imul(Vt,jr)|0,Fe=(Fe=Fe+Math.imul(Vt,Lr)|0)+Math.imul(Qt,jr)|0,$e=$e+Math.imul(Qt,Lr)|0,qe=qe+Math.imul(Wt,Qr)|0,Fe=(Fe=Fe+Math.imul(Wt,ti)|0)+Math.imul(Gt,Qr)|0,$e=$e+Math.imul(Gt,ti)|0,qe=qe+Math.imul(Ft,ii)|0,Fe=(Fe=Fe+Math.imul(Ft,oi)|0)+Math.imul(Lt,ii)|0,$e=$e+Math.imul(Lt,oi)|0,qe=qe+Math.imul(Ot,di)|0,Fe=(Fe=Fe+Math.imul(Ot,li)|0)+Math.imul(Nt,di)|0,$e=$e+Math.imul(Nt,li)|0;var Ki=(st+(qe=qe+Math.imul(Rt,pi)|0)|0)+((8191&(Fe=(Fe=Fe+Math.imul(Rt,yi)|0)+Math.imul(Ut,pi)|0))<<13)|0;st=(($e=$e+Math.imul(Ut,yi)|0)+(Fe>>>13)|0)+(Ki>>>26)|0,Ki&=67108863,qe=Math.imul(sr,Kr),Fe=(Fe=Math.imul(sr,Tr))+Math.imul(ar,Kr)|0,$e=Math.imul(ar,Tr),qe=qe+Math.imul(rr,Ir)|0,Fe=(Fe=Fe+Math.imul(rr,Or)|0)+Math.imul(ir,Ir)|0,$e=$e+Math.imul(ir,Or)|0,qe=qe+Math.imul(Xt,jr)|0,Fe=(Fe=Fe+Math.imul(Xt,Lr)|0)+Math.imul(er,jr)|0,$e=$e+Math.imul(er,Lr)|0,qe=qe+Math.imul(Vt,Qr)|0,Fe=(Fe=Fe+Math.imul(Vt,ti)|0)+Math.imul(Qt,Qr)|0,$e=$e+Math.imul(Qt,ti)|0,qe=qe+Math.imul(Wt,ii)|0,Fe=(Fe=Fe+Math.imul(Wt,oi)|0)+Math.imul(Gt,ii)|0,$e=$e+Math.imul(Gt,oi)|0,qe=qe+Math.imul(Ft,di)|0,Fe=(Fe=Fe+Math.imul(Ft,li)|0)+Math.imul(Lt,di)|0,$e=$e+Math.imul(Lt,li)|0;var Ti=(st+(qe=qe+Math.imul(Ot,pi)|0)|0)+((8191&(Fe=(Fe=Fe+Math.imul(Ot,yi)|0)+Math.imul(Nt,pi)|0))<<13)|0;st=(($e=$e+Math.imul(Nt,yi)|0)+(Fe>>>13)|0)+(Ti>>>26)|0,Ti&=67108863,qe=Math.imul(sr,Ir),Fe=(Fe=Math.imul(sr,Or))+Math.imul(ar,Ir)|0,$e=Math.imul(ar,Or),qe=qe+Math.imul(rr,jr)|0,Fe=(Fe=Fe+Math.imul(rr,Lr)|0)+Math.imul(ir,jr)|0,$e=$e+Math.imul(ir,Lr)|0,qe=qe+Math.imul(Xt,Qr)|0,Fe=(Fe=Fe+Math.imul(Xt,ti)|0)+Math.imul(er,Qr)|0,$e=$e+Math.imul(er,ti)|0,qe=qe+Math.imul(Vt,ii)|0,Fe=(Fe=Fe+Math.imul(Vt,oi)|0)+Math.imul(Qt,ii)|0,$e=$e+Math.imul(Qt,oi)|0,qe=qe+Math.imul(Wt,di)|0,Fe=(Fe=Fe+Math.imul(Wt,li)|0)+Math.imul(Gt,di)|0,$e=$e+Math.imul(Gt,li)|0;var Ui=(st+(qe=qe+Math.imul(Ft,pi)|0)|0)+((8191&(Fe=(Fe=Fe+Math.imul(Ft,yi)|0)+Math.imul(Lt,pi)|0))<<13)|0;st=(($e=$e+Math.imul(Lt,yi)|0)+(Fe>>>13)|0)+(Ui>>>26)|0,Ui&=67108863,qe=Math.imul(sr,jr),Fe=(Fe=Math.imul(sr,Lr))+Math.imul(ar,jr)|0,$e=Math.imul(ar,Lr),qe=qe+Math.imul(rr,Qr)|0,Fe=(Fe=Fe+Math.imul(rr,ti)|0)+Math.imul(ir,Qr)|0,$e=$e+Math.imul(ir,ti)|0,qe=qe+Math.imul(Xt,ii)|0,Fe=(Fe=Fe+Math.imul(Xt,oi)|0)+Math.imul(er,ii)|0,$e=$e+Math.imul(er,oi)|0,qe=qe+Math.imul(Vt,di)|0,Fe=(Fe=Fe+Math.imul(Vt,li)|0)+Math.imul(Qt,di)|0,$e=$e+Math.imul(Qt,li)|0;var Ni=(st+(qe=qe+Math.imul(Wt,pi)|0)|0)+((8191&(Fe=(Fe=Fe+Math.imul(Wt,yi)|0)+Math.imul(Gt,pi)|0))<<13)|0;st=(($e=$e+Math.imul(Gt,yi)|0)+(Fe>>>13)|0)+(Ni>>>26)|0,Ni&=67108863,qe=Math.imul(sr,Qr),Fe=(Fe=Math.imul(sr,ti))+Math.imul(ar,Qr)|0,$e=Math.imul(ar,ti),qe=qe+Math.imul(rr,ii)|0,Fe=(Fe=Fe+Math.imul(rr,oi)|0)+Math.imul(ir,ii)|0,$e=$e+Math.imul(ir,oi)|0,qe=qe+Math.imul(Xt,di)|0,Fe=(Fe=Fe+Math.imul(Xt,li)|0)+Math.imul(er,di)|0,$e=$e+Math.imul(er,li)|0;var zi=(st+(qe=qe+Math.imul(Vt,pi)|0)|0)+((8191&(Fe=(Fe=Fe+Math.imul(Vt,yi)|0)+Math.imul(Qt,pi)|0))<<13)|0;st=(($e=$e+Math.imul(Qt,yi)|0)+(Fe>>>13)|0)+(zi>>>26)|0,zi&=67108863,qe=Math.imul(sr,ii),Fe=(Fe=Math.imul(sr,oi))+Math.imul(ar,ii)|0,$e=Math.imul(ar,oi),qe=qe+Math.imul(rr,di)|0,Fe=(Fe=Fe+Math.imul(rr,li)|0)+Math.imul(ir,di)|0,$e=$e+Math.imul(ir,li)|0;var ji=(st+(qe=qe+Math.imul(Xt,pi)|0)|0)+((8191&(Fe=(Fe=Fe+Math.imul(Xt,yi)|0)+Math.imul(er,pi)|0))<<13)|0;st=(($e=$e+Math.imul(er,yi)|0)+(Fe>>>13)|0)+(ji>>>26)|0,ji&=67108863,qe=Math.imul(sr,di),Fe=(Fe=Math.imul(sr,li))+Math.imul(ar,di)|0,$e=Math.imul(ar,li);var qi=(st+(qe=qe+Math.imul(rr,pi)|0)|0)+((8191&(Fe=(Fe=Fe+Math.imul(rr,yi)|0)+Math.imul(ir,pi)|0))<<13)|0;st=(($e=$e+Math.imul(ir,yi)|0)+(Fe>>>13)|0)+(qi>>>26)|0,qi&=67108863;var Wi=(st+(qe=Math.imul(sr,pi))|0)+((8191&(Fe=(Fe=Math.imul(sr,yi))+Math.imul(ar,pi)|0))<<13)|0;return st=(($e=Math.imul(ar,yi))+(Fe>>>13)|0)+(Wi>>>26)|0,Wi&=67108863,nt[0]=mi,nt[1]=vi,nt[2]=wi,nt[3]=ki,nt[4]=Si,nt[5]=Ei,nt[6]=Mi,nt[7]=Pi,nt[8]=xi,nt[9]=Ci,nt[10]=Di,nt[11]=Ki,nt[12]=Ti,nt[13]=Ui,nt[14]=Ni,nt[15]=zi,nt[16]=ji,nt[17]=qi,nt[18]=Wi,0!==st&&(nt[19]=st,Ce.length++),Ce};function p(Ae,Se,Ce){return(new y).mulp(Ae,Se,Ce)}function y(Ae,Se){this.x=Ae,this.y=Se}Math.imul||(l=f),n.prototype.mulTo=function(Ae,Se){var Ce,qe=this.length+Ae.length;return Ce=10===this.length&&10===Ae.length?l(this,Ae,Se):qe<63?f(this,Ae,Se):qe<1024?function(Ae,Se,Ce){Ce.negative=Se.negative^Ae.negative,Ce.length=Ae.length+Se.length;for(var qe=0,Fe=0,$e=0;$e>>26)|0)>>>26,rt&=67108863}Ce.words[$e]=it,qe=rt,rt=Fe}return 0!==qe?Ce.words[$e]=qe:Ce.length--,Ce.strip()}(this,Ae,Se):p(this,Ae,Se),Ce},y.prototype.makeRBT=function(Ae){for(var Se=Array(Ae),Ce=n.prototype._countBits(Ae)-1,qe=0;qe>=1;return qe},y.prototype.permute=function(Ae,Se,Ce,qe,Fe,$e){for(var rt=0;rt<$e;rt++)qe[rt]=Se[Ae[rt]],Fe[rt]=Ce[Ae[rt]]},y.prototype.transform=function(Ae,Se,Ce,qe,Fe,$e){this.permute($e,Ae,Se,Ce,qe,Fe);for(var rt=1;rt>>=1)Fe++;return 1<>>=13,Ce[2*$e+1]=8191&Fe,Fe>>>=13;for($e=2*Se;$e>=26,Se+=qe/67108864|0,Se+=Fe>>>26,this.words[Ce]=67108863&Fe}return 0!==Se&&(this.words[Ce]=Se,this.length++),this},n.prototype.muln=function(Ae){return this.clone().imuln(Ae)},n.prototype.sqr=function(){return this.mul(this)},n.prototype.isqr=function(){return this.imul(this.clone())},n.prototype.pow=function(Ae){var Se=function(Ae){for(var Se=Array(Ae.bitLength()),Ce=0;Ce>>Fe}return Se}(Ae);if(0===Se.length)return new n(1);for(var Ce=this,qe=0;qe=0);var Se,Ce=Ae%26,qe=(Ae-Ce)/26,Fe=67108863>>>26-Ce<<26-Ce;if(0!==Ce){var $e=0;for(Se=0;Se>>26-Ce}$e&&(this.words[Se]=$e,this.length++)}if(0!==qe){for(Se=this.length-1;Se>=0;Se--)this.words[Se+qe]=this.words[Se];for(Se=0;Se=0),qe=Se?(Se-Se%26)/26:0;var Fe=Ae%26,$e=Math.min((Ae-Fe)/26,this.length),rt=67108863^67108863>>>Fe<$e)for(this.length-=$e,nt=0;nt=0&&(0!==st||nt>=qe);nt--){var ut=0|this.words[nt];this.words[nt]=st<<26-Fe|ut>>>Fe,st=ut&rt}return it&&0!==st&&(it.words[it.length++]=st),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},n.prototype.ishrn=function(Ae,Se,Ce){return r(0===this.negative),this.iushrn(Ae,Se,Ce)},n.prototype.shln=function(Ae){return this.clone().ishln(Ae)},n.prototype.ushln=function(Ae){return this.clone().iushln(Ae)},n.prototype.shrn=function(Ae){return this.clone().ishrn(Ae)},n.prototype.ushrn=function(Ae){return this.clone().iushrn(Ae)},n.prototype.testn=function(Ae){r("number"==typeof Ae&&Ae>=0);var Se=Ae%26,Ce=(Ae-Se)/26,qe=1<=0);var Se=Ae%26,Ce=(Ae-Se)/26;if(r(0===this.negative,"imaskn works only with positive numbers"),this.length<=Ce)return this;if(0!==Se&&Ce++,this.length=Math.min(Ce,this.length),0!==Se){var qe=67108863^67108863>>>Se<=67108864;Se++)this.words[Se]-=67108864,Se===this.length-1?this.words[Se+1]=1:this.words[Se+1]++;return this.length=Math.max(this.length,Se+1),this},n.prototype.isubn=function(Ae){if(r("number"==typeof Ae),r(Ae<67108864),Ae<0)return this.iaddn(-Ae);if(0!==this.negative)return this.negative=0,this.iaddn(Ae),this.negative=1,this;if(this.words[0]-=Ae,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var Se=0;Se>26)-(it/67108864|0),this.words[qe+Ce]=67108863&Fe}for(;qe>26,this.words[qe+Ce]=67108863&Fe;if(0===rt)return this.strip();for(r(-1===rt),rt=0,qe=0;qe>26,this.words[qe]=67108863&Fe;return this.negative=1,this.strip()},n.prototype._wordDiv=function(Ae,Se){var Ce=(this.length,Ae.length),qe=this.clone(),Fe=Ae,$e=0|Fe.words[Fe.length-1];0!==(Ce=26-this._countBits($e))&&(Fe=Fe.ushln(Ce),qe.iushln(Ce),$e=0|Fe.words[Fe.length-1]);var rt,it=qe.length-Fe.length;if("mod"!==Se){(rt=new n(null)).length=it+1,rt.words=Array(rt.length);for(var nt=0;nt=0;ut--){var ht=67108864*(0|qe.words[Fe.length+ut])+(0|qe.words[Fe.length+ut-1]);for(ht=Math.min(ht/$e|0,67108863),qe._ishlnsubmul(Fe,ht,ut);0!==qe.negative;)ht--,qe.negative=0,qe._ishlnsubmul(Fe,1,ut),qe.isZero()||(qe.negative^=1);rt&&(rt.words[ut]=ht)}return rt&&rt.strip(),qe.strip(),"div"!==Se&&0!==Ce&&qe.iushrn(Ce),{div:rt||null,mod:qe}},n.prototype.divmod=function(Ae,Se,Ce){return r(!Ae.isZero()),this.isZero()?{div:new n(0),mod:new n(0)}:0!==this.negative&&0===Ae.negative?($e=this.neg().divmod(Ae,Se),"mod"!==Se&&(qe=$e.div.neg()),"div"!==Se&&(Fe=$e.mod.neg(),Ce&&0!==Fe.negative&&Fe.iadd(Ae)),{div:qe,mod:Fe}):0===this.negative&&0!==Ae.negative?($e=this.divmod(Ae.neg(),Se),"mod"!==Se&&(qe=$e.div.neg()),{div:qe,mod:$e.mod}):0!=(this.negative&Ae.negative)?($e=this.neg().divmod(Ae.neg(),Se),"div"!==Se&&(Fe=$e.mod.neg(),Ce&&0!==Fe.negative&&Fe.isub(Ae)),{div:$e.div,mod:Fe}):Ae.length>this.length||this.cmp(Ae)<0?{div:new n(0),mod:this}:1===Ae.length?"div"===Se?{div:this.divn(Ae.words[0]),mod:null}:"mod"===Se?{div:null,mod:new n(this.modn(Ae.words[0]))}:{div:this.divn(Ae.words[0]),mod:new n(this.modn(Ae.words[0]))}:this._wordDiv(Ae,Se);var qe,Fe,$e},n.prototype.div=function(Ae){return this.divmod(Ae,"div",!1).div},n.prototype.mod=function(Ae){return this.divmod(Ae,"mod",!1).mod},n.prototype.umod=function(Ae){return this.divmod(Ae,"mod",!0).mod},n.prototype.divRound=function(Ae){var Se=this.divmod(Ae);if(Se.mod.isZero())return Se.div;var Ce=0!==Se.div.negative?Se.mod.isub(Ae):Se.mod,qe=Ae.ushrn(1),Fe=Ae.andln(1),$e=Ce.cmp(qe);return $e<0||1===Fe&&0===$e?Se.div:0!==Se.div.negative?Se.div.isubn(1):Se.div.iaddn(1)},n.prototype.modn=function(Ae){r(Ae<=67108863);for(var Se=(1<<26)%Ae,Ce=0,qe=this.length-1;qe>=0;qe--)Ce=(Se*Ce+(0|this.words[qe]))%Ae;return Ce},n.prototype.idivn=function(Ae){r(Ae<=67108863);for(var Se=0,Ce=this.length-1;Ce>=0;Ce--){var qe=(0|this.words[Ce])+67108864*Se;this.words[Ce]=qe/Ae|0,Se=qe%Ae}return this.strip()},n.prototype.divn=function(Ae){return this.clone().idivn(Ae)},n.prototype.egcd=function(Ae){r(0===Ae.negative),r(!Ae.isZero());var Se=this,Ce=Ae.clone();Se=0!==Se.negative?Se.umod(Ae):Se.clone();for(var qe=new n(1),Fe=new n(0),$e=new n(0),rt=new n(1),it=0;Se.isEven()&&Ce.isEven();)Se.iushrn(1),Ce.iushrn(1),++it;for(var nt=Ce.clone(),st=Se.clone();!Se.isZero();){for(var ut=0,ht=1;0==(Se.words[0]&ht)&&ut<26;++ut,ht<<=1);if(ut>0)for(Se.iushrn(ut);ut-- >0;)(qe.isOdd()||Fe.isOdd())&&(qe.iadd(nt),Fe.isub(st)),qe.iushrn(1),Fe.iushrn(1);for(var ft=0,yt=1;0==(Ce.words[0]&yt)&&ft<26;++ft,yt<<=1);if(ft>0)for(Ce.iushrn(ft);ft-- >0;)($e.isOdd()||rt.isOdd())&&($e.iadd(nt),rt.isub(st)),$e.iushrn(1),rt.iushrn(1);Se.cmp(Ce)>=0?(Se.isub(Ce),qe.isub($e),Fe.isub(rt)):(Ce.isub(Se),$e.isub(qe),rt.isub(Fe))}return{a:$e,b:rt,gcd:Ce.iushln(it)}},n.prototype._invmp=function(Ae){r(0===Ae.negative),r(!Ae.isZero());var Se=this,Ce=Ae.clone();Se=0!==Se.negative?Se.umod(Ae):Se.clone();for(var qe,Fe=new n(1),$e=new n(0),rt=Ce.clone();Se.cmpn(1)>0&&Ce.cmpn(1)>0;){for(var it=0,nt=1;0==(Se.words[0]&nt)&&it<26;++it,nt<<=1);if(it>0)for(Se.iushrn(it);it-- >0;)Fe.isOdd()&&Fe.iadd(rt),Fe.iushrn(1);for(var st=0,ut=1;0==(Ce.words[0]&ut)&&st<26;++st,ut<<=1);if(st>0)for(Ce.iushrn(st);st-- >0;)$e.isOdd()&&$e.iadd(rt),$e.iushrn(1);Se.cmp(Ce)>=0?(Se.isub(Ce),Fe.isub($e)):(Ce.isub(Se),$e.isub(Fe))}return(qe=0===Se.cmpn(1)?Fe:$e).cmpn(0)<0&&qe.iadd(Ae),qe},n.prototype.gcd=function(Ae){if(this.isZero())return Ae.abs();if(Ae.isZero())return this.abs();var Se=this.clone(),Ce=Ae.clone();Se.negative=0,Ce.negative=0;for(var qe=0;Se.isEven()&&Ce.isEven();qe++)Se.iushrn(1),Ce.iushrn(1);for(;;){for(;Se.isEven();)Se.iushrn(1);for(;Ce.isEven();)Ce.iushrn(1);var Fe=Se.cmp(Ce);if(Fe<0){var $e=Se;Se=Ce,Ce=$e}else if(0===Fe||0===Ce.cmpn(1))break;Se.isub(Ce)}return Ce.iushln(qe)},n.prototype.invm=function(Ae){return this.egcd(Ae).a.umod(Ae)},n.prototype.isEven=function(){return 0==(1&this.words[0])},n.prototype.isOdd=function(){return 1==(1&this.words[0])},n.prototype.andln=function(Ae){return this.words[0]&Ae},n.prototype.bincn=function(Ae){r("number"==typeof Ae);var Se=Ae%26,Ce=(Ae-Se)/26,qe=1<>>26,rt&=67108863,this.words[$e]=rt}return 0!==Fe&&(this.words[$e]=Fe,this.length++),this},n.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},n.prototype.cmpn=function(Ae){var Se,Ce=Ae<0;if(0!==this.negative&&!Ce)return-1;if(0===this.negative&&Ce)return 1;if(this.strip(),this.length>1)Se=1;else{Ce&&(Ae=-Ae),r(Ae<=67108863,"Number is too big");var qe=0|this.words[0];Se=qe===Ae?0:qeAe.length)return 1;if(this.length=0;Ce--){var qe=0|this.words[Ce],Fe=0|Ae.words[Ce];if(qe!==Fe){qeFe&&(Se=1);break}}return Se},n.prototype.gtn=function(Ae){return 1===this.cmpn(Ae)},n.prototype.gt=function(Ae){return 1===this.cmp(Ae)},n.prototype.gten=function(Ae){return this.cmpn(Ae)>=0},n.prototype.gte=function(Ae){return this.cmp(Ae)>=0},n.prototype.ltn=function(Ae){return-1===this.cmpn(Ae)},n.prototype.lt=function(Ae){return-1===this.cmp(Ae)},n.prototype.lten=function(Ae){return this.cmpn(Ae)<=0},n.prototype.lte=function(Ae){return this.cmp(Ae)<=0},n.prototype.eqn=function(Ae){return 0===this.cmpn(Ae)},n.prototype.eq=function(Ae){return 0===this.cmp(Ae)},n.red=function(Ae){return new k(Ae)},n.prototype.toRed=function(Ae){return r(!this.red,"Already a number in reduction context"),r(0===this.negative,"red works only with positives"),Ae.convertTo(this)._forceRed(Ae)},n.prototype.fromRed=function(){return r(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},n.prototype._forceRed=function(Ae){return this.red=Ae,this},n.prototype.forceRed=function(Ae){return r(!this.red,"Already a number in reduction context"),this._forceRed(Ae)},n.prototype.redAdd=function(Ae){return r(this.red,"redAdd works only with red numbers"),this.red.add(this,Ae)},n.prototype.redIAdd=function(Ae){return r(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,Ae)},n.prototype.redSub=function(Ae){return r(this.red,"redSub works only with red numbers"),this.red.sub(this,Ae)},n.prototype.redISub=function(Ae){return r(this.red,"redISub works only with red numbers"),this.red.isub(this,Ae)},n.prototype.redShl=function(Ae){return r(this.red,"redShl works only with red numbers"),this.red.shl(this,Ae)},n.prototype.redMul=function(Ae){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,Ae),this.red.mul(this,Ae)},n.prototype.redIMul=function(Ae){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,Ae),this.red.imul(this,Ae)},n.prototype.redSqr=function(){return r(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},n.prototype.redISqr=function(){return r(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},n.prototype.redSqrt=function(){return r(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},n.prototype.redInvm=function(){return r(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},n.prototype.redNeg=function(){return r(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},n.prototype.redPow=function(Ae){return r(this.red&&!Ae.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,Ae)};var rt={k256:null,p224:null,p192:null,p25519:null};function g(Ae,Se){this.name=Ae,this.p=new n(Se,16),this.n=this.p.bitLength(),this.k=new n(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function m(){g.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function w(){g.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function v(){g.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function _(){g.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function k(Ae){if("string"==typeof Ae){var Se=n._prime(Ae);this.m=Se.p,this.prime=Se}else r(Ae.gtn(1),"modulus must be greater than 1"),this.m=Ae,this.prime=null}function A(Ae){k.call(this,Ae),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new n(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)}g.prototype._tmp=function(){var Ae=new n(null);return Ae.words=Array(Math.ceil(this.n/13)),Ae},g.prototype.ireduce=function(Ae){var Se,Ce=Ae;do{this.split(Ce,this.tmp),Se=(Ce=(Ce=this.imulK(Ce)).iadd(this.tmp)).bitLength()}while(Se>this.n);var qe=Se0?Ce.isub(this.p):Ce.strip(),Ce},g.prototype.split=function(Ae,Se){Ae.iushrn(this.n,0,Se)},g.prototype.imulK=function(Ae){return Ae.imul(this.k)},i(m,g),m.prototype.split=function(Ae,Se){for(var Ce=4194303,qe=Math.min(Ae.length,9),Fe=0;Fe>>22,$e=rt}$e>>>=22,Ae.words[Fe-10]=$e,0===$e&&Ae.length>10?Ae.length-=10:Ae.length-=9},m.prototype.imulK=function(Ae){Ae.words[Ae.length]=0,Ae.words[Ae.length+1]=0,Ae.length+=2;for(var Se=0,Ce=0;Ce>>=26,Ae.words[Ce]=Fe,Se=qe}return 0!==Se&&(Ae.words[Ae.length++]=Se),Ae},n._prime=function(Ae){if(rt[Ae])return rt[Ae];var Se;if("k256"===Ae)Se=new m;else if("p224"===Ae)Se=new w;else if("p192"===Ae)Se=new v;else{if("p25519"!==Ae)throw Error("Unknown prime "+Ae);Se=new _}return rt[Ae]=Se,Se},k.prototype._verify1=function(Ae){r(0===Ae.negative,"red works only with positives"),r(Ae.red,"red works only with red numbers")},k.prototype._verify2=function(Ae,Se){r(0==(Ae.negative|Se.negative),"red works only with positives"),r(Ae.red&&Ae.red===Se.red,"red works only with red numbers")},k.prototype.imod=function(Ae){return this.prime?this.prime.ireduce(Ae)._forceRed(this):Ae.umod(this.m)._forceRed(this)},k.prototype.neg=function(Ae){return Ae.isZero()?Ae.clone():this.m.sub(Ae)._forceRed(this)},k.prototype.add=function(Ae,Se){this._verify2(Ae,Se);var Ce=Ae.add(Se);return Ce.cmp(this.m)>=0&&Ce.isub(this.m),Ce._forceRed(this)},k.prototype.iadd=function(Ae,Se){this._verify2(Ae,Se);var Ce=Ae.iadd(Se);return Ce.cmp(this.m)>=0&&Ce.isub(this.m),Ce},k.prototype.sub=function(Ae,Se){this._verify2(Ae,Se);var Ce=Ae.sub(Se);return Ce.cmpn(0)<0&&Ce.iadd(this.m),Ce._forceRed(this)},k.prototype.isub=function(Ae,Se){this._verify2(Ae,Se);var Ce=Ae.isub(Se);return Ce.cmpn(0)<0&&Ce.iadd(this.m),Ce},k.prototype.shl=function(Ae,Se){return this._verify1(Ae),this.imod(Ae.ushln(Se))},k.prototype.imul=function(Ae,Se){return this._verify2(Ae,Se),this.imod(Ae.imul(Se))},k.prototype.mul=function(Ae,Se){return this._verify2(Ae,Se),this.imod(Ae.mul(Se))},k.prototype.isqr=function(Ae){return this.imul(Ae,Ae.clone())},k.prototype.sqr=function(Ae){return this.mul(Ae,Ae)},k.prototype.sqrt=function(Ae){if(Ae.isZero())return Ae.clone();var Se=this.m.andln(3);if(r(Se%2==1),3===Se){var Ce=this.m.add(new n(1)).iushrn(2);return this.pow(Ae,Ce)}for(var qe=this.m.subn(1),Fe=0;!qe.isZero()&&0===qe.andln(1);)Fe++,qe.iushrn(1);r(!qe.isZero());var $e=new n(1).toRed(this),rt=$e.redNeg(),it=this.m.subn(1).iushrn(1),nt=this.m.bitLength();for(nt=new n(2*nt*nt).toRed(this);0!==this.pow(nt,it).cmp(rt);)nt.redIAdd(rt);for(var st=this.pow(nt,qe),ut=this.pow(Ae,qe.addn(1).iushrn(1)),ht=this.pow(Ae,qe),ft=Fe;0!==ht.cmp($e);){for(var yt=ht,vt=0;0!==yt.cmp($e);vt++)yt=yt.redSqr();r(vt=0;qe--){for(var nt=Se.words[qe],st=it-1;st>=0;st--){var ut=nt>>st&1;Fe!==Ce[0]&&(Fe=this.sqr(Fe)),0!==ut||0!==$e?($e<<=1,$e|=ut,(4===++rt||0===qe&&0===st)&&(Fe=this.mul(Fe,Ce[$e]),rt=0,$e=0)):rt=0}it=26}return Fe},k.prototype.convertTo=function(Ae){var Se=Ae.umod(this.m);return Se===Ae?Se.clone():Se},k.prototype.convertFrom=function(Ae){var Se=Ae.clone();return Se.red=null,Se},n.mont=function(Ae){return new A(Ae)},i(A,k),A.prototype.convertTo=function(Ae){return this.imod(Ae.ushln(this.shift))},A.prototype.convertFrom=function(Ae){var Se=this.imod(Ae.mul(this.rinv));return Se.red=null,Se},A.prototype.imul=function(Ae,Se){if(Ae.isZero()||Se.isZero())return Ae.words[0]=0,Ae.length=1,Ae;var Ce=Ae.imul(Se),qe=Ce.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),Fe=Ce.isub(qe).iushrn(this.shift),$e=Fe;return Fe.cmp(this.m)>=0?$e=Fe.isub(this.m):Fe.cmpn(0)<0&&($e=Fe.iadd(this.m)),$e._forceRed(this)},A.prototype.mul=function(Ae,Se){if(Ae.isZero()||Se.isZero())return new n(0)._forceRed(this);var Ce=Ae.mul(Se),qe=Ce.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),Fe=Ce.isub(qe).iushrn(this.shift),$e=Fe;return Fe.cmp(this.m)>=0?$e=Fe.isub(this.m):Fe.cmpn(0)<0&&($e=Fe.iadd(this.m)),$e._forceRed(this)},A.prototype.invm=function(Ae){return this.imod(Ae._invmp(this.m).mul(this.r2))._forceRed(this)}}(Ae,Qr)})),fm=Object.freeze({__proto__:null,default:lm,__moduleExports:lm});class ey{constructor(Ae){if(void 0===Ae)throw Error("Invalid BigInteger input");this.value=new lm(Ae)}clone(){const Ae=new ey(null);return this.value.copy(Ae.value),Ae}iinc(){return this.value.iadd(new lm(1)),this}inc(){return this.clone().iinc()}idec(){return this.value.isub(new lm(1)),this}dec(){return this.clone().idec()}iadd(Ae){return this.value.iadd(Ae.value),this}add(Ae){return this.clone().iadd(Ae)}isub(Ae){return this.value.isub(Ae.value),this}sub(Ae){return this.clone().isub(Ae)}imul(Ae){return this.value.imul(Ae.value),this}mul(Ae){return this.clone().imul(Ae)}imod(Ae){return this.value=this.value.umod(Ae.value),this}mod(Ae){return this.clone().imod(Ae)}modExp(Ae,Se){const Ce=Se.isEven()?lm.red(Se.value):lm.mont(Se.value),qe=this.clone();return qe.value=qe.value.toRed(Ce).redPow(Ae.value).fromRed(),qe}modInv(Ae){if(!this.gcd(Ae).isOne())throw Error("Inverse does not exist");return new ey(this.value.invm(Ae.value))}gcd(Ae){return new ey(this.value.gcd(Ae.value))}ileftShift(Ae){return this.value.ishln(Ae.value.toNumber()),this}leftShift(Ae){return this.clone().ileftShift(Ae)}irightShift(Ae){return this.value.ishrn(Ae.value.toNumber()),this}rightShift(Ae){return this.clone().irightShift(Ae)}equal(Ae){return this.value.eq(Ae.value)}lt(Ae){return this.value.lt(Ae.value)}lte(Ae){return this.value.lte(Ae.value)}gt(Ae){return this.value.gt(Ae.value)}gte(Ae){return this.value.gte(Ae.value)}isZero(){return this.value.isZero()}isOne(){return this.value.eq(new lm(1))}isNegative(){return this.value.isNeg()}isEven(){return this.value.isEven()}abs(){const Ae=this.clone();return Ae.value=Ae.value.abs(),Ae}toString(){return this.value.toString()}toNumber(){return this.value.toNumber()}getBit(Ae){return this.value.testn(Ae)?1:0}bitLength(){return this.value.bitLength()}byteLength(){return this.value.byteLength()}toUint8Array(Ae="be",Se){return this.value.toArrayLike(Uint8Array,Ae,Se)}}var pm,ym=Object.freeze({__proto__:null,default:ey}),mm=mt((function(Ae,Se){var Ce=Se;function i(Ae){return 1===Ae.length?"0"+Ae:Ae}function n(Ae){for(var Se="",Ce=0;Ce>8,rt=255&Fe;$e?Ce.push($e,rt):Ce.push(rt)}return Ce},Ce.zero2=i,Ce.toHex=n,Ce.encode=function(Ae,Se){return"hex"===Se?n(Ae):Ae}})),gm=mt((function(Ae,Se){var Ce=Se;Ce.assert=Hr,Ce.toArray=mm.toArray,Ce.zero2=mm.zero2,Ce.toHex=mm.toHex,Ce.encode=mm.encode,Ce.getNAF=function(Ae,Se){for(var Ce=[],qe=1<=0;){var $e;if(Fe.isOdd()){var rt=Fe.andln(qe-1);$e=rt>(qe>>1)-1?(qe>>1)-rt:rt,Fe.isubn($e)}else $e=0;Ce.push($e);for(var it=0!==Fe.cmpn(0)&&0===Fe.andln(qe-1)?Se+1:1,nt=1;nt0||Se.cmpn(-Fe)>0;){var $e,rt,it,nt=Ae.andln(3)+qe&3,st=Se.andln(3)+Fe&3;if(3===nt&&(nt=-1),3===st&&(st=-1),0==(1&nt))$e=0;else $e=3!==(it=Ae.andln(7)+qe&7)&&5!==it||2!==st?nt:-nt;if(Ce[0].push($e),0==(1&st))rt=0;else rt=3!==(it=Se.andln(7)+Fe&7)&&5!==it||2!==nt?st:-st;Ce[1].push(rt),2*qe===$e+1&&(qe=1-qe),2*Fe===rt+1&&(Fe=1-Fe),Ae.iushrn(1),Se.iushrn(1)}return Ce},Ce.cachedProperty=function(Ae,Se,Ce){var qe="_"+Se;Ae.prototype[Se]=function(){return void 0!==this[qe]?this[qe]:this[qe]=Ce.call(this)}},Ce.parseBytes=function(Ae){return"string"==typeof Ae?Ce.toArray(Ae,"hex"):Ae},Ce.intFromLE=function(Ae){return new lm(Ae,"hex","le")}})),ay=function(Ae){return pm||(pm=new sy(null)),pm.generate(Ae)};function sy(Ae){this.rand=Ae}var bm=sy;if(sy.prototype.generate=function(Ae){return this._rand(Ae)},sy.prototype._rand=function(Ae){if(this.rand.getBytes)return this.rand.getBytes(Ae);for(var Se=new Uint8Array(Ae),Ce=0;Ce0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}var Am=fy;function py(Ae,Se){this.curve=Ae,this.type=Se,this.precomputed=null}fy.prototype.point=function(){throw Error("Not implemented")},fy.prototype.validate=function(){throw Error("Not implemented")},fy.prototype._fixedNafMul=function(Ae,Se){km(Ae.precomputed);var Ce=Ae._getDoubles(),qe=wm(Se,1),Fe=(1<=rt;Se--)it=(it<<1)+qe[Se];$e.push(it)}for(var nt=this.jpoint(null,null,null),st=this.jpoint(null,null,null),ut=Fe;ut>0;ut--){for(rt=0;rt<$e.length;rt++){(it=$e[rt])===ut?st=st.mixedAdd(Ce.points[rt]):it===-ut&&(st=st.mixedAdd(Ce.points[rt].neg()))}nt=nt.add(st)}return nt.toP()},fy.prototype._wnafMul=function(Ae,Se){var Ce=4,qe=Ae._getNAFPoints(Ce);Ce=qe.wnd;for(var Fe=qe.points,$e=wm(Se,Ce),rt=this.jpoint(null,null,null),it=$e.length-1;it>=0;it--){for(Se=0;it>=0&&0===$e[it];it--)Se++;if(it>=0&&Se++,rt=rt.dblp(Se),it<0)break;var nt=$e[it];km(0!==nt),rt="affine"===Ae.type?nt>0?rt.mixedAdd(Fe[nt-1>>1]):rt.mixedAdd(Fe[-nt-1>>1].neg()):nt>0?rt.add(Fe[nt-1>>1]):rt.add(Fe[-nt-1>>1].neg())}return"affine"===Ae.type?rt.toP():rt},fy.prototype._wnafMulAdd=function(Ae,Se,Ce,qe,Fe){for(var $e=this._wnafT1,rt=this._wnafT2,it=this._wnafT3,nt=0,st=0;st=1;st-=2){var ht=st-1,ft=st;if(1===$e[ht]&&1===$e[ft]){var yt=[Se[ht],null,null,Se[ft]];0===Se[ht].y.cmp(Se[ft].y)?(yt[1]=Se[ht].add(Se[ft]),yt[2]=Se[ht].toJ().mixedAdd(Se[ft].neg())):0===Se[ht].y.cmp(Se[ft].y.redNeg())?(yt[1]=Se[ht].toJ().mixedAdd(Se[ft]),yt[2]=Se[ht].add(Se[ft].neg())):(yt[1]=Se[ht].toJ().mixedAdd(Se[ft]),yt[2]=Se[ht].toJ().mixedAdd(Se[ft].neg()));var vt=[-3,-1,-5,-7,0,7,5,1,3],_t=_m(Ce[ht],Ce[ft]);nt=Math.max(_t[0].length,nt),it[ht]=Array(nt),it[ft]=Array(nt);for(var Ct=0;Ct=0;st--){for(var Nt=0;st>=0;){var jt=!0;for(Ct=0;Ct=0&&Nt++,It=It.dblp(Nt),st<0)break;for(Ct=0;Ct0?Ft=rt[Ct][Lt-1>>1]:Lt<0&&(Ft=rt[Ct][-Lt-1>>1].neg()),It="affine"===Ft.type?It.mixedAdd(Ft):It.add(Ft))}}for(st=0;st=Math.ceil((Ae.bitLength()+1)/Se.step)},py.prototype._getDoubles=function(Ae,Se){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var Ce=[this],qe=this,Fe=0;Fe=0&&($e=Se,rt=Ce),qe.negative&&(qe=qe.neg(),Fe=Fe.neg()),$e.negative&&($e=$e.neg(),rt=rt.neg()),[{a:qe,b:Fe},{a:$e,b:rt}]},by.prototype._endoSplit=function(Ae){var Se=this.endo.basis,Ce=Se[0],qe=Se[1],Fe=qe.b.mul(Ae).divRound(this.n),$e=Ce.b.neg().mul(Ae).divRound(this.n),rt=Fe.mul(Ce.a),it=$e.mul(qe.a),nt=Fe.mul(Ce.b),st=$e.mul(qe.b);return{k1:Ae.sub(rt).sub(it),k2:nt.add(st).neg()}},by.prototype.pointFromX=function(Ae,Se){(Ae=new lm(Ae,16)).red||(Ae=Ae.toRed(this.red));var Ce=Ae.redSqr().redMul(Ae).redIAdd(Ae.redMul(this.a)).redIAdd(this.b),qe=Ce.redSqrt();if(0!==qe.redSqr().redSub(Ce).cmp(this.zero))throw Error("invalid point");var Fe=qe.fromRed().isOdd();return(Se&&!Fe||!Se&&Fe)&&(qe=qe.redNeg()),this.point(Ae,qe)},by.prototype.validate=function(Ae){if(Ae.inf)return!0;var Se=Ae.x,Ce=Ae.y,qe=this.a.redMul(Se),Fe=Se.redSqr().redMul(Se).redIAdd(qe).redIAdd(this.b);return 0===Ce.redSqr().redISub(Fe).cmpn(0)},by.prototype._endoWnafMulAdd=function(Ae,Se,Ce){for(var qe=this._endoWnafT1,Fe=this._endoWnafT2,$e=0;$e":""},my.prototype.isInfinity=function(){return this.inf},my.prototype.add=function(Ae){if(this.inf)return Ae;if(Ae.inf)return this;if(this.eq(Ae))return this.dbl();if(this.neg().eq(Ae))return this.curve.point(null,null);if(0===this.x.cmp(Ae.x))return this.curve.point(null,null);var Se=this.y.redSub(Ae.y);0!==Se.cmpn(0)&&(Se=Se.redMul(this.x.redSub(Ae.x).redInvm()));var Ce=Se.redSqr().redISub(this.x).redISub(Ae.x),qe=Se.redMul(this.x.redSub(Ce)).redISub(this.y);return this.curve.point(Ce,qe)},my.prototype.dbl=function(){if(this.inf)return this;var Ae=this.y.redAdd(this.y);if(0===Ae.cmpn(0))return this.curve.point(null,null);var Se=this.curve.a,Ce=this.x.redSqr(),qe=Ae.redInvm(),Fe=Ce.redAdd(Ce).redIAdd(Ce).redIAdd(Se).redMul(qe),$e=Fe.redSqr().redISub(this.x.redAdd(this.x)),rt=Fe.redMul(this.x.redSub($e)).redISub(this.y);return this.curve.point($e,rt)},my.prototype.getX=function(){return this.x.fromRed()},my.prototype.getY=function(){return this.y.fromRed()},my.prototype.mul=function(Ae){return Ae=new lm(Ae,16),this.isInfinity()?this:this._hasDoubles(Ae)?this.curve._fixedNafMul(this,Ae):this.curve.endo?this.curve._endoWnafMulAdd([this],[Ae]):this.curve._wnafMul(this,Ae)},my.prototype.mulAdd=function(Ae,Se,Ce){var qe=[this,Se],Fe=[Ae,Ce];return this.curve.endo?this.curve._endoWnafMulAdd(qe,Fe):this.curve._wnafMulAdd(1,qe,Fe,2)},my.prototype.jmulAdd=function(Ae,Se,Ce){var qe=[this,Se],Fe=[Ae,Ce];return this.curve.endo?this.curve._endoWnafMulAdd(qe,Fe,!0):this.curve._wnafMulAdd(1,qe,Fe,2,!0)},my.prototype.eq=function(Ae){return this===Ae||this.inf===Ae.inf&&(this.inf||0===this.x.cmp(Ae.x)&&0===this.y.cmp(Ae.y))},my.prototype.neg=function(Ae){if(this.inf)return this;var Se=this.curve.point(this.x,this.y.redNeg());if(Ae&&this.precomputed){var Ce=this.precomputed,i=function(Ae){return Ae.neg()};Se.precomputed={naf:Ce.naf&&{wnd:Ce.naf.wnd,points:Ce.naf.points.map(i)},doubles:Ce.doubles&&{step:Ce.doubles.step,points:Ce.doubles.points.map(i)}}}return Se},my.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},ri(wy,Am.BasePoint),by.prototype.jpoint=function(Ae,Se,Ce){return new wy(this,Ae,Se,Ce)},wy.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var Ae=this.z.redInvm(),Se=Ae.redSqr(),Ce=this.x.redMul(Se),qe=this.y.redMul(Se).redMul(Ae);return this.curve.point(Ce,qe)},wy.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},wy.prototype.add=function(Ae){if(this.isInfinity())return Ae;if(Ae.isInfinity())return this;var Se=Ae.z.redSqr(),Ce=this.z.redSqr(),qe=this.x.redMul(Se),Fe=Ae.x.redMul(Ce),$e=this.y.redMul(Se.redMul(Ae.z)),rt=Ae.y.redMul(Ce.redMul(this.z)),it=qe.redSub(Fe),nt=$e.redSub(rt);if(0===it.cmpn(0))return 0!==nt.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var st=it.redSqr(),ut=st.redMul(it),ht=qe.redMul(st),ft=nt.redSqr().redIAdd(ut).redISub(ht).redISub(ht),yt=nt.redMul(ht.redISub(ft)).redISub($e.redMul(ut)),vt=this.z.redMul(Ae.z).redMul(it);return this.curve.jpoint(ft,yt,vt)},wy.prototype.mixedAdd=function(Ae){if(this.isInfinity())return Ae.toJ();if(Ae.isInfinity())return this;var Se=this.z.redSqr(),Ce=this.x,qe=Ae.x.redMul(Se),Fe=this.y,$e=Ae.y.redMul(Se).redMul(this.z),rt=Ce.redSub(qe),it=Fe.redSub($e);if(0===rt.cmpn(0))return 0!==it.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var nt=rt.redSqr(),st=nt.redMul(rt),ut=Ce.redMul(nt),ht=it.redSqr().redIAdd(st).redISub(ut).redISub(ut),ft=it.redMul(ut.redISub(ht)).redISub(Fe.redMul(st)),yt=this.z.redMul(rt);return this.curve.jpoint(ht,ft,yt)},wy.prototype.dblp=function(Ae){if(0===Ae)return this;if(this.isInfinity())return this;if(!Ae)return this.dbl();if(this.curve.zeroA||this.curve.threeA){for(var Se=this,Ce=0;Ce=0)return!1;if(Ce.redIAdd(Fe),0===this.x.cmp(Ce))return!0}},wy.prototype.inspect=function(){return this.isInfinity()?"":""},wy.prototype.isInfinity=function(){return 0===this.z.cmpn(0)},ri(vy,Am);var Mm=vy;function ky(Ae,Se,Ce){Am.BasePoint.call(this,Ae,"projective"),null===Se&&null===Ce?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new lm(Se,16),this.z=new lm(Ce,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}vy.prototype.validate=function(Ae){var Se=Ae.normalize().x,Ce=Se.redSqr(),qe=Ce.redMul(Se).redAdd(Ce.redMul(this.a)).redAdd(Se);return 0===qe.redSqrt().redSqr().cmp(qe)},ri(ky,Am.BasePoint),vy.prototype.decodePoint=function(Ae,Se){if(33===(Ae=gm.toArray(Ae,Se)).length&&64===Ae[0]&&(Ae=Ae.slice(1,33).reverse()),32!==Ae.length)throw Error("Unknown point compression format");return this.point(Ae,1)},vy.prototype.point=function(Ae,Se){return new ky(this,Ae,Se)},vy.prototype.pointFromJSON=function(Ae){return ky.fromJSON(this,Ae)},ky.prototype.precompute=function(){},ky.prototype._encode=function(Ae){var Se=this.curve.p.byteLength();return Ae?[64].concat(this.getX().toArray("le",Se)):this.getX().toArray("be",Se)},ky.fromJSON=function(Ae,Se){return new ky(Ae,Se[0],Se[1]||Ae.one)},ky.prototype.inspect=function(){return this.isInfinity()?"":""},ky.prototype.isInfinity=function(){return 0===this.z.cmpn(0)},ky.prototype.dbl=function(){var Ae=this.x.redAdd(this.z).redSqr(),Se=this.x.redSub(this.z).redSqr(),Ce=Ae.redSub(Se),qe=Ae.redMul(Se),Fe=Ce.redMul(Se.redAdd(this.curve.a24.redMul(Ce)));return this.curve.point(qe,Fe)},ky.prototype.add=function(){throw Error("Not supported on Montgomery curve")},ky.prototype.diffAdd=function(Ae,Se){var Ce=this.x.redAdd(this.z),qe=this.x.redSub(this.z),Fe=Ae.x.redAdd(Ae.z),$e=Ae.x.redSub(Ae.z).redMul(Ce),rt=Fe.redMul(qe),it=Se.z.redMul($e.redAdd(rt).redSqr()),nt=Se.x.redMul($e.redISub(rt).redSqr());return this.curve.point(it,nt)},ky.prototype.mul=function(Ae){for(var Se=(Ae=new lm(Ae,16)).clone(),Ce=this,qe=this.curve.point(null,null),Fe=[];0!==Se.cmpn(0);Se.iushrn(1))Fe.push(Se.andln(1));for(var $e=Fe.length-1;$e>=0;$e--)0===Fe[$e]?(Ce=Ce.diffAdd(qe,this),qe=qe.dbl()):(qe=Ce.diffAdd(qe,this),Ce=Ce.dbl());return qe},ky.prototype.mulAdd=function(){throw Error("Not supported on Montgomery curve")},ky.prototype.jumlAdd=function(){throw Error("Not supported on Montgomery curve")},ky.prototype.eq=function(Ae){return 0===this.getX().cmp(Ae.getX())},ky.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},ky.prototype.getX=function(){return this.normalize(),this.x.fromRed()};var Pm=gm.assert;function Sy(Ae){this.twisted=1!=(0|Ae.a),this.mOneA=this.twisted&&-1==(0|Ae.a),this.extended=this.mOneA,Am.call(this,"edwards",Ae),this.a=new lm(Ae.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new lm(Ae.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new lm(Ae.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),Pm(!this.twisted||0===this.c.fromRed().cmpn(1)),this.oneC=1==(0|Ae.c)}ri(Sy,Am);var xm=Sy;function Py(Ae,Se,Ce,qe,Fe){Am.BasePoint.call(this,Ae,"projective"),null===Se&&null===Ce&&null===qe?(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 lm(Se,16),this.y=new lm(Ce,16),this.z=qe?new lm(qe,16):this.curve.one,this.t=Fe&&new lm(Fe,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()))))}Sy.prototype._mulA=function(Ae){return this.mOneA?Ae.redNeg():this.a.redMul(Ae)},Sy.prototype._mulC=function(Ae){return this.oneC?Ae:this.c.redMul(Ae)},Sy.prototype.jpoint=function(Ae,Se,Ce,qe){return this.point(Ae,Se,Ce,qe)},Sy.prototype.pointFromX=function(Ae,Se){(Ae=new lm(Ae,16)).red||(Ae=Ae.toRed(this.red));var Ce=Ae.redSqr(),qe=this.c2.redSub(this.a.redMul(Ce)),Fe=this.one.redSub(this.c2.redMul(this.d).redMul(Ce)),$e=qe.redMul(Fe.redInvm()),rt=$e.redSqrt();if(0!==rt.redSqr().redSub($e).cmp(this.zero))throw Error("invalid point");var it=rt.fromRed().isOdd();return(Se&&!it||!Se&&it)&&(rt=rt.redNeg()),this.point(Ae,rt)},Sy.prototype.pointFromY=function(Ae,Se){(Ae=new lm(Ae,16)).red||(Ae=Ae.toRed(this.red));var Ce=Ae.redSqr(),qe=Ce.redSub(this.c2),Fe=Ce.redMul(this.d).redMul(this.c2).redSub(this.a),$e=qe.redMul(Fe.redInvm());if(0===$e.cmp(this.zero)){if(Se)throw Error("invalid point");return this.point(this.zero,Ae)}var rt=$e.redSqrt();if(0!==rt.redSqr().redSub($e).cmp(this.zero))throw Error("invalid point");return rt.fromRed().isOdd()!==Se&&(rt=rt.redNeg()),this.point(rt,Ae)},Sy.prototype.validate=function(Ae){if(Ae.isInfinity())return!0;Ae.normalize();var Se=Ae.x.redSqr(),Ce=Ae.y.redSqr(),qe=Se.redMul(this.a).redAdd(Ce),Fe=this.c2.redMul(this.one.redAdd(this.d.redMul(Se).redMul(Ce)));return 0===qe.cmp(Fe)},ri(Py,Am.BasePoint),Sy.prototype.pointFromJSON=function(Ae){return Py.fromJSON(this,Ae)},Sy.prototype.point=function(Ae,Se,Ce,qe){return new Py(this,Ae,Se,Ce,qe)},Py.fromJSON=function(Ae,Se){return new Py(Ae,Se[0],Se[1],Se[2])},Py.prototype.inspect=function(){return this.isInfinity()?"":""},Py.prototype.isInfinity=function(){return 0===this.x.cmpn(0)&&(0===this.y.cmp(this.z)||this.zOne&&0===this.y.cmp(this.curve.c))},Py.prototype._extDbl=function(){var Ae=this.x.redSqr(),Se=this.y.redSqr(),Ce=this.z.redSqr();Ce=Ce.redIAdd(Ce);var qe=this.curve._mulA(Ae),Fe=this.x.redAdd(this.y).redSqr().redISub(Ae).redISub(Se),$e=qe.redAdd(Se),rt=$e.redSub(Ce),it=qe.redSub(Se),nt=Fe.redMul(rt),st=$e.redMul(it),ut=Fe.redMul(it),ht=rt.redMul($e);return this.curve.point(nt,st,ht,ut)},Py.prototype._projDbl=function(){var Ae,Se,Ce,qe=this.x.redAdd(this.y).redSqr(),Fe=this.x.redSqr(),$e=this.y.redSqr();if(this.curve.twisted){var rt=(st=this.curve._mulA(Fe)).redAdd($e);if(this.zOne)Ae=qe.redSub(Fe).redSub($e).redMul(rt.redSub(this.curve.two)),Se=rt.redMul(st.redSub($e)),Ce=rt.redSqr().redSub(rt).redSub(rt);else{var it=this.z.redSqr(),nt=rt.redSub(it).redISub(it);Ae=qe.redSub(Fe).redISub($e).redMul(nt),Se=rt.redMul(st.redSub($e)),Ce=rt.redMul(nt)}}else{var st=Fe.redAdd($e);it=this.curve._mulC(this.z).redSqr(),nt=st.redSub(it).redSub(it);Ae=this.curve._mulC(qe.redISub(st)).redMul(nt),Se=this.curve._mulC(st).redMul(Fe.redISub($e)),Ce=st.redMul(nt)}return this.curve.point(Ae,Se,Ce)},Py.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},Py.prototype._extAdd=function(Ae){var Se=this.y.redSub(this.x).redMul(Ae.y.redSub(Ae.x)),Ce=this.y.redAdd(this.x).redMul(Ae.y.redAdd(Ae.x)),qe=this.t.redMul(this.curve.dd).redMul(Ae.t),Fe=this.z.redMul(Ae.z.redAdd(Ae.z)),$e=Ce.redSub(Se),rt=Fe.redSub(qe),it=Fe.redAdd(qe),nt=Ce.redAdd(Se),st=$e.redMul(rt),ut=it.redMul(nt),ht=$e.redMul(nt),ft=rt.redMul(it);return this.curve.point(st,ut,ft,ht)},Py.prototype._projAdd=function(Ae){var Se,Ce,qe=this.z.redMul(Ae.z),Fe=qe.redSqr(),$e=this.x.redMul(Ae.x),rt=this.y.redMul(Ae.y),it=this.curve.d.redMul($e).redMul(rt),nt=Fe.redSub(it),st=Fe.redAdd(it),ut=this.x.redAdd(this.y).redMul(Ae.x.redAdd(Ae.y)).redISub($e).redISub(rt),ht=qe.redMul(nt).redMul(ut);return this.curve.twisted?(Se=qe.redMul(st).redMul(rt.redSub(this.curve._mulA($e))),Ce=nt.redMul(st)):(Se=qe.redMul(st).redMul(rt.redSub($e)),Ce=this.curve._mulC(nt).redMul(st)),this.curve.point(ht,Se,Ce)},Py.prototype.add=function(Ae){return this.isInfinity()?Ae:Ae.isInfinity()?this:this.curve.extended?this._extAdd(Ae):this._projAdd(Ae)},Py.prototype.mul=function(Ae){return this._hasDoubles(Ae)?this.curve._fixedNafMul(this,Ae):this.curve._wnafMul(this,Ae)},Py.prototype.mulAdd=function(Ae,Se,Ce){return this.curve._wnafMulAdd(1,[this,Se],[Ae,Ce],2,!1)},Py.prototype.jmulAdd=function(Ae,Se,Ce){return this.curve._wnafMulAdd(1,[this,Se],[Ae,Ce],2,!0)},Py.prototype.normalize=function(){if(this.zOne)return this;var Ae=this.z.redInvm();return this.x=this.x.redMul(Ae),this.y=this.y.redMul(Ae),this.t&&(this.t=this.t.redMul(Ae)),this.z=this.curve.one,this.zOne=!0,this},Py.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},Py.prototype.getX=function(){return this.normalize(),this.x.fromRed()},Py.prototype.getY=function(){return this.normalize(),this.y.fromRed()},Py.prototype.eq=function(Ae){return this===Ae||0===this.getX().cmp(Ae.getX())&&0===this.getY().cmp(Ae.getY())},Py.prototype.eqXToP=function(Ae){var Se=Ae.toRed(this.curve.red).redMul(this.z);if(0===this.x.cmp(Se))return!0;for(var Ce=Ae.clone(),qe=this.curve.redN.redMul(this.z);;){if(Ce.iadd(this.curve.n),Ce.cmp(this.curve.p)>=0)return!1;if(Se.redIAdd(qe),0===this.x.cmp(Se))return!0}},Py.prototype.toP=Py.prototype.normalize,Py.prototype.mixedAdd=Py.prototype.add;var Cm=mt((function(Ae,Se){var Ce=Se;Ce.base=Am,Ce.short=Em,Ce.mont=Mm,Ce.edwards=xm})),Dm=ii.rotl32,Rm=ii.sum32,Bm=ii.sum32_5,Km=li.ft_1,Tm=ci.BlockHash,Um=[1518500249,1859775393,2400959708,3395469782];function Iy(){if(!(this instanceof Iy))return new Iy;Tm.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=Array(80)}ii.inherits(Iy,Tm);var Im=Iy;Iy.blockSize=512,Iy.outSize=160,Iy.hmacStrength=80,Iy.padLength=64,Iy.prototype._update=function(Ae,Se){for(var Ce=this.W,qe=0;qe<16;qe++)Ce[qe]=Ae[Se+qe];for(;qethis.blockSize&&(Ae=(new this.Hash).update(Ae).digest()),Hr(Ae.length<=this.blockSize);for(var Se=Ae.length;Se=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(Se,Ce,qe)}var Fm=Ny;Ny.prototype._init=function(Ae,Se,Ce){var qe=Ae.concat(Se).concat(Ce);this.K=Array(this.outLen/8),this.V=Array(this.outLen/8);for(var Fe=0;Fe=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(Ae.concat(Ce||[])),this._reseed=1},Ny.prototype.generate=function(Ae,Se,Ce,qe){if(this._reseed>this.reseedInterval)throw Error("Reseed is required");"string"!=typeof Se&&(qe=Ce,Ce=Se,Se=null),Ce&&(Ce=mm.toArray(Ce,qe||"hex"),this._update(Ce));for(var Fe=[];Fe.length"};var Wm=gm.assert;function $y(Ae,Se){if(Ae instanceof $y)return Ae;this._importDER(Ae,Se)||(Wm(Ae.r&&Ae.s,"Signature without r or s"),this.r=new lm(Ae.r,16),this.s=new lm(Ae.s,16),void 0===Ae.recoveryParam?this.recoveryParam=null:this.recoveryParam=Ae.recoveryParam)}var Gm=$y;function Xy(){this.place=0}function Yy(Ae,Se){var Ce=Ae[Se.place++];if(!(128&Ce))return Ce;for(var qe=15&Ce,Fe=0,$e=0,rt=Se.place;$e>>3);for(Ae.push(128|Ce);--Ce;)Ae.push(Se>>>(Ce<<3)&255);Ae.push(Se)}}$y.prototype._importDER=function(Ae,Se){Ae=gm.toArray(Ae,Se);var Ce=new Xy;if(48!==Ae[Ce.place++])return!1;if(Yy(Ae,Ce)+Ce.place!==Ae.length)return!1;if(2!==Ae[Ce.place++])return!1;var qe=Yy(Ae,Ce),Fe=Ae.slice(Ce.place,qe+Ce.place);if(Ce.place+=qe,2!==Ae[Ce.place++])return!1;var $e=Yy(Ae,Ce);if(Ae.length!==$e+Ce.place)return!1;var rt=Ae.slice(Ce.place,$e+Ce.place);return 0===Fe[0]&&128&Fe[1]&&(Fe=Fe.slice(1)),0===rt[0]&&128&rt[1]&&(rt=rt.slice(1)),this.r=new lm(Fe),this.s=new lm(rt),this.recoveryParam=null,!0},$y.prototype.toDER=function(Ae){var Se=this.r.toArray(),Ce=this.s.toArray();for(128&Se[0]&&(Se=[0].concat(Se)),128&Ce[0]&&(Ce=[0].concat(Ce)),Se=Qy(Se),Ce=Qy(Ce);!(Ce[0]||128&Ce[1]);)Ce=Ce.slice(1);var qe=[2];Jy(qe,Se.length),(qe=qe.concat(Se)).push(2),Jy(qe,Ce.length);var Fe=qe.concat(Ce),$e=[48];return Jy($e,Fe.length),$e=$e.concat(Fe),gm.encode($e,Ae)};var $m=gm.assert;function tb(Ae){if(!(this instanceof tb))return new tb(Ae);"string"==typeof Ae&&($m(qm.hasOwnProperty(Ae),"Unknown curve "+Ae),Ae=qm[Ae]),Ae instanceof qm.PresetCurve&&(Ae={curve:Ae}),this.curve=Ae.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=Ae.curve.g,this.g.precompute(Ae.curve.n.bitLength()+1),this.hash=Ae.hash||Ae.curve.hash}var Vm=tb;tb.prototype.keyPair=function(Ae){return new Hm(this,Ae)},tb.prototype.keyFromPrivate=function(Ae,Se){return Hm.fromPrivate(this,Ae,Se)},tb.prototype.keyFromPublic=function(Ae,Se){return Hm.fromPublic(this,Ae,Se)},tb.prototype.genKeyPair=function(Ae){Ae||(Ae={});var Se=new Fm({hash:this.hash,pers:Ae.pers,persEnc:Ae.persEnc||"utf8",entropy:Ae.entropy||ay(this.hash.hmacStrength),entropyEnc:Ae.entropy&&Ae.entropyEnc||"utf8",nonce:this.n.toArray()});if("mont"===this.curve.type){var Ce=new lm(Se.generate(32));return this.keyFromPrivate(Ce)}for(var qe=this.n.byteLength(),Fe=this.n.sub(new lm(2));;){if(!((Ce=new lm(Se.generate(qe))).cmp(Fe)>0))return Ce.iaddn(1),this.keyFromPrivate(Ce)}},tb.prototype._truncateToN=function(Ae,Se,Ce){var qe=(Ce=Ce||8*Ae.byteLength())-this.n.bitLength();return qe>0&&(Ae=Ae.ushrn(qe)),!Se&&Ae.cmp(this.n)>=0?Ae.sub(this.n):Ae},tb.prototype.truncateMsg=function(Ae){var Se;return Ae instanceof Uint8Array?(Se=8*Ae.byteLength,Ae=this._truncateToN(new lm(Ae,16),!1,Se)):"string"==typeof Ae?(Se=4*Ae.length,Ae=this._truncateToN(new lm(Ae,16),!1,Se)):Ae=this._truncateToN(new lm(Ae,16)),Ae},tb.prototype.sign=function(Ae,Se,Ce,qe){"object"==typeof Ce&&(qe=Ce,Ce=null),qe||(qe={}),Se=this.keyFromPrivate(Se,Ce),Ae=this.truncateMsg(Ae);for(var Fe=this.n.byteLength(),$e=Se.getPrivate().toArray("be",Fe),rt=Ae.toArray("be",Fe),it=new Fm({hash:this.hash,entropy:$e,nonce:rt,pers:qe.pers,persEnc:qe.persEnc||"utf8"}),nt=this.n.sub(new lm(1)),st=0;;st++){var ut=qe.k?qe.k(st):new lm(it.generate(this.n.byteLength()));if(!((ut=this._truncateToN(ut,!0)).cmpn(1)<=0||ut.cmp(nt)>=0)){var ht=this.g.mul(ut);if(!ht.isInfinity()){var ft=ht.getX(),yt=ft.umod(this.n);if(0!==yt.cmpn(0)){var vt=ut.invm(this.n).mul(yt.mul(Se.getPrivate()).iadd(Ae));if(0!==(vt=vt.umod(this.n)).cmpn(0)){var _t=(ht.getY().isOdd()?1:0)|(0!==ft.cmp(yt)?2:0);return qe.canonical&&vt.cmp(this.nh)>0&&(vt=this.n.sub(vt),_t^=1),new Gm({r:yt,s:vt,recoveryParam:_t})}}}}}},tb.prototype.verify=function(Ae,Se,Ce,qe){return Ce=this.keyFromPublic(Ce,qe),Se=new Gm(Se,"hex"),this._verify(this.truncateMsg(Ae),Se,Ce)||this._verify(this._truncateToN(new lm(Ae,16)),Se,Ce)},tb.prototype._verify=function(Ae,Se,Ce){var qe=Se.r,Fe=Se.s;if(qe.cmpn(1)<0||qe.cmp(this.n)>=0)return!1;if(Fe.cmpn(1)<0||Fe.cmp(this.n)>=0)return!1;var $e,rt=Fe.invm(this.n),it=rt.mul(Ae).umod(this.n),nt=rt.mul(qe).umod(this.n);return this.curve._maxwellTrick?!($e=this.g.jmulAdd(it,Ce.getPublic(),nt)).isInfinity()&&$e.eqXToP(qe):!($e=this.g.mulAdd(it,Ce.getPublic(),nt)).isInfinity()&&0===$e.getX().umod(this.n).cmp(qe)},tb.prototype.recoverPubKey=function(Ae,Se,Ce,qe){$m((3&Ce)===Ce,"The recovery param is more than two bits"),Se=new Gm(Se,qe);var Fe=this.n,$e=new lm(Ae),rt=Se.r,it=Se.s,nt=1&Ce,st=Ce>>1;if(rt.cmp(this.curve.p.umod(this.curve.n))>=0&&st)throw Error("Unable to find sencond key candinate");rt=st?this.curve.pointFromX(rt.add(this.curve.n),nt):this.curve.pointFromX(rt,nt);var ut=Se.r.invm(Fe),ht=Fe.sub($e).mul(ut).umod(Fe),ft=it.mul(ut).umod(Fe);return this.g.mulAdd(ht,rt,ft)},tb.prototype.getKeyRecoveryParam=function(Ae,Se,Ce,qe){if(null!==(Se=new Gm(Se,qe)).recoveryParam)return Se.recoveryParam;for(var Fe=0;Fe<4;Fe++){var $e;try{$e=this.recoverPubKey(Ae,Se,Fe)}catch(Ae){continue}if($e.eq(Ce))return Fe}throw Error("Unable to find valid recovery factor")};var Qm=gm.assert,Zm=gm.parseBytes,Xm=gm.cachedProperty;function sb(Ae,Se){if(this.eddsa=Ae,Se.hasOwnProperty("secret")&&(this._secret=Zm(Se.secret)),Ae.isPoint(Se.pub))this._pub=Se.pub;else if(this._pubBytes=Zm(Se.pub),this._pubBytes&&33===this._pubBytes.length&&64===this._pubBytes[0]&&(this._pubBytes=this._pubBytes.slice(1,33)),this._pubBytes&&32!==this._pubBytes.length)throw Error("Unknown point compression format")}sb.fromPublic=function(Ae,Se){return Se instanceof sb?Se:new sb(Ae,{pub:Se})},sb.fromSecret=function(Ae,Se){return Se instanceof sb?Se:new sb(Ae,{secret:Se})},sb.prototype.secret=function(){return this._secret},Xm(sb,"pubBytes",(function(){return this.eddsa.encodePoint(this.pub())})),Xm(sb,"pub",(function(){return this._pubBytes?this.eddsa.decodePoint(this._pubBytes):this.eddsa.g.mul(this.priv())})),Xm(sb,"privBytes",(function(){var Ae=this.eddsa,Se=this.hash(),Ce=Ae.encodingLength-1,qe=Se.slice(0,Ae.encodingLength);return qe[0]&=248,qe[Ce]&=127,qe[Ce]|=64,qe})),Xm(sb,"priv",(function(){return this.eddsa.decodeInt(this.privBytes())})),Xm(sb,"hash",(function(){return this.eddsa.hash().update(this.secret()).digest()})),Xm(sb,"messagePrefix",(function(){return this.hash().slice(this.eddsa.encodingLength)})),sb.prototype.sign=function(Ae){return Qm(this._secret,"KeyPair can only verify"),this.eddsa.sign(Ae,this)},sb.prototype.verify=function(Ae,Se){return this.eddsa.verify(Ae,Se,this)},sb.prototype.getSecret=function(Ae){return Qm(this._secret,"KeyPair is public only"),gm.encode(this.secret(),Ae)},sb.prototype.getPublic=function(Ae,Se){return gm.encode((Se?[64]:[]).concat(this.pubBytes()),Ae)};var Ym=sb,Jm=gm.assert,eg=gm.cachedProperty,tg=gm.parseBytes;function db(Ae,Se){this.eddsa=Ae,"object"!=typeof Se&&(Se=tg(Se)),Array.isArray(Se)&&(Se={R:Se.slice(0,Ae.encodingLength),S:Se.slice(Ae.encodingLength)}),Jm(Se.R&&Se.S,"Signature without R or S"),Ae.isPoint(Se.R)&&(this._R=Se.R),Se.S instanceof lm&&(this._S=Se.S),this._Rencoded=Array.isArray(Se.R)?Se.R:Se.Rencoded,this._Sencoded=Array.isArray(Se.S)?Se.S:Se.Sencoded}eg(db,"S",(function(){return this.eddsa.decodeInt(this.Sencoded())})),eg(db,"R",(function(){return this.eddsa.decodePoint(this.Rencoded())})),eg(db,"Rencoded",(function(){return this.eddsa.encodePoint(this.R())})),eg(db,"Sencoded",(function(){return this.eddsa.encodeInt(this.S())})),db.prototype.toBytes=function(){return this.Rencoded().concat(this.Sencoded())},db.prototype.toHex=function(){return gm.encode(this.toBytes(),"hex").toUpperCase()};var rg=db,ig=gm.assert,ng=gm.parseBytes;function yb(Ae){if(ig("ed25519"===Ae,"only tested with ed25519 so far"),!(this instanceof yb))return new yb(Ae);Ae=qm[Ae].curve;this.curve=Ae,this.g=Ae.g,this.g.precompute(Ae.n.bitLength()+1),this.pointClass=Ae.point().constructor,this.encodingLength=Math.ceil(Ae.n.bitLength()/8),this.hash=zm.sha512}var sg=yb;yb.prototype.sign=function(Ae,Se){Ae=ng(Ae);var Ce=this.keyFromSecret(Se),qe=this.hashInt(Ce.messagePrefix(),Ae),Fe=this.g.mul(qe),$e=this.encodePoint(Fe),rt=this.hashInt($e,Ce.pubBytes(),Ae).mul(Ce.priv()),it=qe.add(rt).umod(this.curve.n);return this.makeSignature({R:Fe,S:it,Rencoded:$e})},yb.prototype.verify=function(Ae,Se,Ce){Ae=ng(Ae),Se=this.makeSignature(Se);var qe=this.keyFromPublic(Ce),Fe=this.hashInt(Se.Rencoded(),qe.pubBytes(),Ae),$e=this.g.mul(Se.S());return Se.R().add(qe.pub().mul(Fe)).eq($e)},yb.prototype.hashInt=function(){for(var Ae=this.hash(),Se=0;Se0)throw Error("Unknown option: "+Ce.join(", "));return new Fh(Ae)},Se.createMessage=async function({text:Ae,binary:Se,filename:Ce,date:qe=new Date,format:Fe=(void 0!==Ae?"utf8":"binary"),...$e}){let rt=void 0!==Ae?Ae:Se;if(void 0===rt)throw Error("createMessage: must pass options object containing `text` or `binary`");if(Ae&&!ar.isString(Ae)&&!ar.isStream(Ae))throw Error("createMessage: options.text must be a string or stream");if(Se&&!ar.isUint8Array(Se)&&!ar.isStream(Se))throw Error("createMessage: options.binary must be a Uint8Array or stream");const it=Object.keys($e);if(it.length>0)throw Error("Unknown option: "+it.join(", "));const nt=ar.isStream(rt);nt&&(await O(),rt=N(rt));const st=new ku(qe);void 0!==Ae?st.setText(rt,nr.write(nr.literal,Fe)):st.setBytes(rt,nr.write(nr.literal,Fe)),void 0!==Ce&&st.setFilename(Ce);const ut=new Ku;ut.push(st);const ht=new Bh(ut);return ht.fromStream=nt,ht},Se.decrypt=async function({message:Ae,decryptionKeys:Se,passwords:Ce,sessionKeys:qe,verificationKeys:Fe,expectSigned:$e=!1,format:rt="utf8",signature:it=null,date:nt=new Date,config:st,...ut}){if(Hh(st={...dr,...st}),Oh(Ae),Fe=Wh(Fe),Se=Wh(Se),Ce=Wh(Ce),qe=Wh(qe),ut.privateKeys)throw Error("The `privateKeys` option has been removed from openpgp.decrypt, pass `decryptionKeys` instead");if(ut.publicKeys)throw Error("The `publicKeys` option has been removed from openpgp.decrypt, pass `verificationKeys` instead");const ht=Object.keys(ut);if(ht.length>0)throw Error("Unknown option: "+ht.join(", "));try{const ut=await Ae.decrypt(Se,Ce,qe,nt,st);Fe||(Fe=[]);const ht={};if(ht.signatures=it?await ut.verifyDetached(it,Fe,nt,st):await ut.verify(Fe,nt,st),ht.data="binary"===rt?ut.getLiteralData():ut.getText(),ht.filename=ut.getFilename(),Vh(ht,Ae),$e){if(0===Fe.length)throw Error("Verification keys are required to verify message signatures");if(0===ht.signatures.length)throw Error("Message is not signed");ht.data=H([ht.data,ae((async()=>{await ar.anyPromise(ht.signatures.map((Ae=>Ae.verified)))}))])}return ht.data=await Gh(ht.data,Ae.fromStream,rt),ht}catch(Ae){throw ar.wrapError("Error decrypting message",Ae)}},Se.decryptKey=async function({privateKey:Ae,passphrase:Se,config:Ce,...qe}){Hh(Ce={...dr,...Ce});const Fe=Object.keys(qe);if(Fe.length>0)throw Error("Unknown option: "+Fe.join(", "));if(!Ae.isPrivate())throw Error("Cannot decrypt a public key");const $e=Ae.clone(!0),rt=ar.isArray(Se)?Se:[Se];try{return await Promise.all($e.getKeys().map((Ae=>ar.anyPromise(rt.map((Se=>Ae.keyPacket.decrypt(Se))))))),await $e.validate(Ce),$e}catch(Ae){throw $e.clearPrivateParams(),ar.wrapError("Error decrypting private key",Ae)}},Se.decryptSessionKeys=async function({message:Ae,decryptionKeys:Se,passwords:Ce,date:qe=new Date,config:Fe,...$e}){if(Hh(Fe={...dr,...Fe}),Oh(Ae),Se=Wh(Se),Ce=Wh(Ce),$e.privateKeys)throw Error("The `privateKeys` option has been removed from openpgp.decryptSessionKeys, pass `decryptionKeys` instead");const rt=Object.keys($e);if(rt.length>0)throw Error("Unknown option: "+rt.join(", "));try{return await Ae.decryptSessionKeys(Se,Ce,qe,Fe)}catch(Ae){throw ar.wrapError("Error decrypting session keys",Ae)}},Se.encrypt=async function({message:Ae,encryptionKeys:Se,signingKeys:Ce,passwords:qe,sessionKey:Fe,format:$e="armored",signature:rt=null,wildcard:it=!1,signingKeyIDs:nt=[],encryptionKeyIDs:st=[],date:ut=new Date,signingUserIDs:ht=[],encryptionUserIDs:ft=[],signatureNotations:yt=[],config:vt,..._t}){if(Hh(vt={...dr,...vt}),Oh(Ae),Nh($e),Se=Wh(Se),Ce=Wh(Ce),qe=Wh(qe),nt=Wh(nt),st=Wh(st),ht=Wh(ht),ft=Wh(ft),yt=Wh(yt),_t.detached)throw Error("The `detached` option has been removed from openpgp.encrypt, separately call openpgp.sign instead. Don't forget to remove the `privateKeys` option as well.");if(_t.publicKeys)throw Error("The `publicKeys` option has been removed from openpgp.encrypt, pass `encryptionKeys` instead");if(_t.privateKeys)throw Error("The `privateKeys` option has been removed from openpgp.encrypt, pass `signingKeys` instead");if(void 0!==_t.armor)throw Error("The `armor` option has been removed from openpgp.encrypt, pass `format` instead.");const Ct=Object.keys(_t);if(Ct.length>0)throw Error("Unknown option: "+Ct.join(", "));Ce||(Ce=[]);const Rt=Ae.fromStream;try{if((Ce.length||rt)&&(Ae=await Ae.sign(Ce,rt,nt,ut,ht,yt,vt)),Ae=Ae.compress(await dh("compression",Se,ut,ft,vt),vt),Ae=await Ae.encrypt(Se,qe,Fe,it,st,ut,ft,vt),"object"===$e)return Ae;const _t="armored"===$e;return Gh(_t?Ae.armor(vt):Ae.write(),Rt,_t?"utf8":"binary")}catch(Ae){throw ar.wrapError("Error encrypting message",Ae)}},Se.encryptKey=async function({privateKey:Ae,passphrase:Se,config:Ce,...qe}){Hh(Ce={...dr,...Ce});const Fe=Object.keys(qe);if(Fe.length>0)throw Error("Unknown option: "+Fe.join(", "));if(!Ae.isPrivate())throw Error("Cannot encrypt a public key");const $e=Ae.clone(!0),rt=$e.getKeys(),it=ar.isArray(Se)?Se:Array(rt.length).fill(Se);if(it.length!==rt.length)throw Error("Invalid number of passphrases given for key encryption");try{return await Promise.all(rt.map((async(Ae,Se)=>{const{keyPacket:qe}=Ae;await qe.encrypt(it[Se],Ce),qe.clearPrivateParams()}))),$e}catch(Ae){throw $e.clearPrivateParams(),ar.wrapError("Error encrypting private key",Ae)}},Se.encryptSessionKey=async function({data:Ae,algorithm:Se,aeadAlgorithm:Ce,encryptionKeys:qe,passwords:Fe,format:$e="armored",wildcard:rt=!1,encryptionKeyIDs:it=[],date:nt=new Date,encryptionUserIDs:st=[],config:ut,...ht}){if(Hh(ut={...dr,...ut}),function(Ae,Se){if(!ar.isUint8Array(Ae))throw Error("Parameter ["+(Se||"data")+"] must be of type Uint8Array")}(Ae),function(Ae,Se){if(!ar.isString(Ae))throw Error("Parameter ["+(Se||"data")+"] must be of type String")}(Se,"algorithm"),Nh($e),qe=Wh(qe),Fe=Wh(Fe),it=Wh(it),st=Wh(st),ht.publicKeys)throw Error("The `publicKeys` option has been removed from openpgp.encryptSessionKey, pass `encryptionKeys` instead");const ft=Object.keys(ht);if(ft.length>0)throw Error("Unknown option: "+ft.join(", "));if(!(qe&&0!==qe.length||Fe&&0!==Fe.length))throw Error("No encryption keys or passwords provided.");try{return $h(await Bh.encryptSessionKey(Ae,Se,Ce,qe,Fe,rt,it,nt,st,ut),$e,ut)}catch(Ae){throw ar.wrapError("Error encrypting session key",Ae)}},Se.enums=nr,Se.generateKey=async function({userIDs:Ae=[],passphrase:Se,type:Ce="ecc",rsaBits:qe=4096,curve:Fe="curve25519",keyExpirationTime:$e=0,date:rt=new Date,subkeys:it=[{}],format:nt="armored",config:st,...ut}){Hh(st={...dr,...st}),Ae=Wh(Ae);const ht=Object.keys(ut);if(ht.length>0)throw Error("Unknown option: "+ht.join(", "));if(0===Ae.length)throw Error("UserIDs are required for key generation");if("rsa"===Ce&&qebh(Ae.subkeys[Ce],Ae)));let Ce=[sh(Ae,Se)];Ce=Ce.concat(Ae.subkeys.map((Ae=>ah(Ae,Se))));const qe=await Promise.all(Ce),Fe=await Dh(qe[0],qe.slice(1),Ae,Se),$e=await Fe.getRevocationCertificate(Ae.date,Se);return Fe.revocationSignatures=[],{key:Fe,revocationCertificate:$e}}(ft,st);return Ae.getKeys().forEach((({keyPacket:Ae})=>vh(Ae,st))),{privateKey:$h(Ae,nt,st),publicKey:$h(Ae.toPublic(),nt,st),revocationCertificate:Se}}catch(Ae){throw ar.wrapError("Error generating keypair",Ae)}},Se.generateSessionKey=async function({encryptionKeys:Ae,date:Se=new Date,encryptionUserIDs:Ce=[],config:qe,...Fe}){if(Hh(qe={...dr,...qe}),Ae=Wh(Ae),Ce=Wh(Ce),Fe.publicKeys)throw Error("The `publicKeys` option has been removed from openpgp.generateSessionKey, pass `encryptionKeys` instead");const $e=Object.keys(Fe);if($e.length>0)throw Error("Unknown option: "+$e.join(", "));try{return await Bh.generateSessionKey(Ae,Se,Ce,qe)}catch(Ae){throw ar.wrapError("Error generating session key",Ae)}},Se.readCleartextMessage=async function({cleartextMessage:Ae,config:Se,...Ce}){if(Se={...dr,...Se},!Ae)throw Error("readCleartextMessage: must pass options object containing `cleartextMessage`");if(!ar.isString(Ae))throw Error("readCleartextMessage: options.cleartextMessage must be a string");const qe=Object.keys(Ce);if(qe.length>0)throw Error("Unknown option: "+qe.join(", "));const Fe=await xe(Ae);if(Fe.type!==nr.armor.signed)throw Error("No cleartext signed message.");const $e=await Ku.fromBinary(Fe.data,xy,Se);!function(Ae,Se){const r=function(Ae){const r=Ae=>Se=>Ae.hashAlgorithm===Se;for(let Ce=0;Ce0)throw Error("Unknown option: "+Fe.join(", "));let $e;if(Ae){const{type:Se,data:qe}=await xe(Ae,Ce);if(Se!==nr.armor.publicKey&&Se!==nr.armor.privateKey)throw Error("Armored text not of type key");$e=qe}else $e=Se;return Ch(await Ku.fromBinary($e,_y,Ce))},Se.readKeys=async function({armoredKeys:Ae,binaryKeys:Se,config:Ce,...qe}){Ce={...dr,...Ce};let Fe=Ae||Se;if(!Fe)throw Error("readKeys: must pass options object containing `armoredKeys` or `binaryKeys`");if(Ae&&!ar.isString(Ae))throw Error("readKeys: options.armoredKeys must be a string");if(Se&&!ar.isUint8Array(Se))throw Error("readKeys: options.binaryKeys must be a Uint8Array");const $e=Object.keys(qe);if($e.length>0)throw Error("Unknown option: "+$e.join(", "));if(Ae){const{type:Se,data:qe}=await xe(Ae,Ce);if(Se!==nr.armor.publicKey&&Se!==nr.armor.privateKey)throw Error("Armored text not of type key");Fe=qe}const rt=[],it=await Ku.fromBinary(Fe,_y,Ce),nt=it.indexOfTag(nr.packet.publicKey,nr.packet.secretKey);if(0===nt.length)throw Error("No key packet found");for(let Ae=0;Ae0)throw Error("Unknown option: "+$e.join(", "));const rt=ar.isStream(Fe);if(rt&&(await O(),Fe=N(Fe)),Ae){const{type:Ae,data:Se}=await xe(Fe,Ce);if(Ae!==nr.armor.message)throw Error("Armored text not of type message");Fe=Se}const it=await Ku.fromBinary(Fe,Ay,Ce),nt=new Bh(it);return nt.fromStream=rt,nt},Se.readPrivateKey=async function({armoredKey:Ae,binaryKey:Se,config:Ce,...qe}){if(Ce={...dr,...Ce},!Ae&&!Se)throw Error("readPrivateKey: must pass options object containing `armoredKey` or `binaryKey`");if(Ae&&!ar.isString(Ae))throw Error("readPrivateKey: options.armoredKey must be a string");if(Se&&!ar.isUint8Array(Se))throw Error("readPrivateKey: options.binaryKey must be a Uint8Array");const Fe=Object.keys(qe);if(Fe.length>0)throw Error("Unknown option: "+Fe.join(", "));let $e;if(Ae){const{type:Se,data:qe}=await xe(Ae,Ce);if(Se!==nr.armor.privateKey)throw Error("Armored text not of type private key");$e=qe}else $e=Se;const rt=await Ku.fromBinary($e,_y,Ce);return new Mh(rt)},Se.readPrivateKeys=async function({armoredKeys:Ae,binaryKeys:Se,config:Ce}){Ce={...dr,...Ce};let qe=Ae||Se;if(!qe)throw Error("readPrivateKeys: must pass options object containing `armoredKeys` or `binaryKeys`");if(Ae&&!ar.isString(Ae))throw Error("readPrivateKeys: options.armoredKeys must be a string");if(Se&&!ar.isUint8Array(Se))throw Error("readPrivateKeys: options.binaryKeys must be a Uint8Array");if(Ae){const{type:Se,data:Fe}=await xe(Ae,Ce);if(Se!==nr.armor.privateKey)throw Error("Armored text not of type private key");qe=Fe}const Fe=[],$e=await Ku.fromBinary(qe,_y,Ce),rt=$e.indexOfTag(nr.packet.secretKey);if(0===rt.length)throw Error("No secret key packet found");for(let Ae=0;Ae0)throw Error("Unknown option: "+$e.join(", "));if(Ae){const{type:Ae,data:Se}=await xe(Fe,Ce);if(Ae!==nr.armor.signature)throw Error("Armored text not of type signature");Fe=Se}const rt=await Ku.fromBinary(Fe,dy,Ce);return new nh(rt)},Se.reformatKey=async function({privateKey:Ae,userIDs:Se=[],passphrase:Ce,keyExpirationTime:qe=0,date:Fe,format:$e="armored",config:rt,...it}){Hh(rt={...dr,...rt}),Se=Wh(Se);const nt=Object.keys(it);if(nt.length>0)throw Error("Unknown option: "+nt.join(", "));if(0===Se.length)throw Error("UserIDs are required for key reformat");const st={privateKey:Ae,userIDs:Se,passphrase:Ce,keyExpirationTime:qe,date:Fe};try{const{key:Ae,revocationCertificate:Se}=await async function(Ae,Se){Ae=o(Ae);const{privateKey:Ce}=Ae;if(!Ce.isPrivate())throw Error("Cannot reformat a public key");if(Ce.keyPacket.isDummy())throw Error("Cannot reformat a gnu-dummy primary key");if(!Ce.getKeys().every((({keyPacket:Ae})=>Ae.isDecrypted())))throw Error("Key is not decrypted");const qe=Ce.keyPacket;Ae.subkeys||(Ae.subkeys=await Promise.all(Ce.subkeys.map((async Ae=>{const Ce=Ae.keyPacket,Fe={key:qe,bind:Ce},$e=await oh(Ae.bindingSignatures,qe,nr.signature.subkeyBinding,Fe,null,Se).catch((()=>({})));return{sign:$e.keyFlags&&$e.keyFlags[0]&nr.keyFlags.signData}}))));const Fe=Ce.subkeys.map((Ae=>Ae.keyPacket));if(Ae.subkeys.length!==Fe.length)throw Error("Number of subkey options does not match number of subkeys");Ae.subkeys=Ae.subkeys.map((Se=>o(Se,Ae)));const $e=await Dh(qe,Fe,Ae,Se),rt=await $e.getRevocationCertificate(Ae.date,Se);return $e.revocationSignatures=[],{key:$e,revocationCertificate:rt};function o(Ae,Se={}){return Ae.keyExpirationTime=Ae.keyExpirationTime||Se.keyExpirationTime,Ae.passphrase=ar.isString(Ae.passphrase)?Ae.passphrase:Se.passphrase,Ae.date=Ae.date||Se.date,Ae}}(st,rt);return{privateKey:$h(Ae,$e,rt),publicKey:$h(Ae.toPublic(),$e,rt),revocationCertificate:Se}}catch(Ae){throw ar.wrapError("Error reformatting keypair",Ae)}},Se.revokeKey=async function({key:Ae,revocationCertificate:Se,reasonForRevocation:Ce,date:qe=new Date,format:Fe="armored",config:$e,...rt}){Hh($e={...dr,...$e});const it=Object.keys(rt);if(it.length>0)throw Error("Unknown option: "+it.join(", "));try{const rt=Se?await Ae.applyRevocationCertificate(Se,qe,$e):await Ae.revoke(Ce,qe,$e);return rt.isPrivate()?{privateKey:$h(rt,Fe,$e),publicKey:$h(rt.toPublic(),Fe,$e)}:{privateKey:null,publicKey:$h(rt,Fe,$e)}}catch(Ae){throw ar.wrapError("Error revoking key",Ae)}},Se.sign=async function({message:Ae,signingKeys:Se,format:Ce="armored",detached:qe=!1,signingKeyIDs:Fe=[],date:$e=new Date,signingUserIDs:rt=[],signatureNotations:it=[],config:nt,...st}){if(Hh(nt={...dr,...nt}),Lh(Ae),Nh(Ce),Se=Wh(Se),Fe=Wh(Fe),rt=Wh(rt),it=Wh(it),st.privateKeys)throw Error("The `privateKeys` option has been removed from openpgp.sign, pass `signingKeys` instead");if(void 0!==st.armor)throw Error("The `armor` option has been removed from openpgp.sign, pass `format` instead.");const ut=Object.keys(st);if(ut.length>0)throw Error("Unknown option: "+ut.join(", "));if(Ae instanceof Fh&&"binary"===Ce)throw Error("Cannot return signed cleartext message in binary format");if(Ae instanceof Fh&&qe)throw Error("Cannot detach-sign a cleartext message");if(!Se||0===Se.length)throw Error("No signing keys provided");try{let st;if(st=qe?await Ae.signDetached(Se,void 0,Fe,$e,rt,it,nt):await Ae.sign(Se,void 0,Fe,$e,rt,it,nt),"object"===Ce)return st;const ut="armored"===Ce;return st=ut?st.armor(nt):st.write(),qe&&(st=Y(Ae.packets.write(),(async(Ae,Se)=>{await Promise.all([V(st,Se),ie(Ae).catch((()=>{}))])}))),Gh(st,Ae.fromStream,ut?"utf8":"binary")}catch(Ae){throw ar.wrapError("Error signing message",Ae)}},Se.unarmor=xe,Se.verify=async function({message:Ae,verificationKeys:Se,expectSigned:Ce=!1,format:qe="utf8",signature:Fe=null,date:$e=new Date,config:rt,...it}){if(Hh(rt={...dr,...rt}),Lh(Ae),Se=Wh(Se),it.publicKeys)throw Error("The `publicKeys` option has been removed from openpgp.verify, pass `verificationKeys` instead");const nt=Object.keys(it);if(nt.length>0)throw Error("Unknown option: "+nt.join(", "));if(Ae instanceof Fh&&"binary"===qe)throw Error("Can't return cleartext message data as binary");if(Ae instanceof Fh&&Fe)throw Error("Can't verify detached cleartext signature");try{const it={};if(it.signatures=Fe?await Ae.verifyDetached(Fe,Se,$e,rt):await Ae.verify(Se,$e,rt),it.data="binary"===qe?Ae.getLiteralData():Ae.getText(),Ae.fromStream&&Vh(it,Ae),Ce){if(0===it.signatures.length)throw Error("Message is not signed");it.data=H([it.data,ae((async()=>{await ar.anyPromise(it.signatures.map((Ae=>Ae.verified)))}))])}return it.data=await Gh(it.data,Ae.fromStream,qe),it}catch(Ae){throw ar.wrapError("Error verifying signed message",Ae)}}},5118:(Ae,Se,Ce)=>{"use strict";var qe=Ce(4300);var Fe=qe.Buffer;var $e={};var rt;for(rt in qe){if(!qe.hasOwnProperty(rt))continue;if(rt==="SlowBuffer"||rt==="Buffer")continue;$e[rt]=qe[rt]}var it=$e.Buffer={};for(rt in Fe){if(!Fe.hasOwnProperty(rt))continue;if(rt==="allocUnsafe"||rt==="allocUnsafeSlow")continue;it[rt]=Fe[rt]}$e.Buffer.prototype=Fe.prototype;if(!it.from||it.from===Uint8Array.from){it.from=function(Ae,Se,Ce){if(typeof Ae==="number"){throw new TypeError('The "value" argument must not be of type number. Received type '+typeof Ae)}if(Ae&&typeof Ae.length==="undefined"){throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof Ae)}return Fe(Ae,Se,Ce)}}if(!it.alloc){it.alloc=function(Ae,Se,Ce){if(typeof Ae!=="number"){throw new TypeError('The "size" argument must be of type number. Received type '+typeof Ae)}if(Ae<0||Ae>=2*(1<<30)){throw new RangeError('The value "'+Ae+'" is invalid for option "size"')}var qe=Fe(Ae);if(!Se||Se.length===0){qe.fill(0)}else if(typeof Ce==="string"){qe.fill(Se,Ce)}else{qe.fill(Se)}return qe}}if(!$e.kStringMaxLength){try{$e.kStringMaxLength=process.binding("buffer").kStringMaxLength}catch(Ae){}}if(!$e.constants){$e.constants={MAX_LENGTH:$e.kMaxLength};if($e.kStringMaxLength){$e.constants.MAX_STRING_LENGTH=$e.kStringMaxLength}}Ae.exports=$e},4294:(Ae,Se,Ce)=>{Ae.exports=Ce(4219)},4219:(Ae,Se,Ce)=>{"use strict";var qe=Ce(1808);var Fe=Ce(4404);var $e=Ce(3685);var rt=Ce(5687);var it=Ce(2361);var nt=Ce(9491);var st=Ce(3837);Se.httpOverHttp=httpOverHttp;Se.httpsOverHttp=httpsOverHttp;Se.httpOverHttps=httpOverHttps;Se.httpsOverHttps=httpsOverHttps;function httpOverHttp(Ae){var Se=new TunnelingAgent(Ae);Se.request=$e.request;return Se}function httpsOverHttp(Ae){var Se=new TunnelingAgent(Ae);Se.request=$e.request;Se.createSocket=createSecureSocket;Se.defaultPort=443;return Se}function httpOverHttps(Ae){var Se=new TunnelingAgent(Ae);Se.request=rt.request;return Se}function httpsOverHttps(Ae){var Se=new TunnelingAgent(Ae);Se.request=rt.request;Se.createSocket=createSecureSocket;Se.defaultPort=443;return Se}function TunnelingAgent(Ae){var Se=this;Se.options=Ae||{};Se.proxyOptions=Se.options.proxy||{};Se.maxSockets=Se.options.maxSockets||$e.Agent.defaultMaxSockets;Se.requests=[];Se.sockets=[];Se.on("free",(function onFree(Ae,Ce,qe,Fe){var $e=toOptions(Ce,qe,Fe);for(var rt=0,it=Se.requests.length;rt=this.maxSockets){Fe.requests.push($e);return}Fe.createSocket($e,(function(Se){Se.on("free",onFree);Se.on("close",onCloseOrRemove);Se.on("agentRemove",onCloseOrRemove);Ae.onSocket(Se);function onFree(){Fe.emit("free",Se,$e)}function onCloseOrRemove(Ae){Fe.removeSocket(Se);Se.removeListener("free",onFree);Se.removeListener("close",onCloseOrRemove);Se.removeListener("agentRemove",onCloseOrRemove)}}))};TunnelingAgent.prototype.createSocket=function createSocket(Ae,Se){var Ce=this;var qe={};Ce.sockets.push(qe);var Fe=mergeOptions({},Ce.proxyOptions,{method:"CONNECT",path:Ae.host+":"+Ae.port,agent:false,headers:{host:Ae.host+":"+Ae.port}});if(Ae.localAddress){Fe.localAddress=Ae.localAddress}if(Fe.proxyAuth){Fe.headers=Fe.headers||{};Fe.headers["Proxy-Authorization"]="Basic "+new Buffer(Fe.proxyAuth).toString("base64")}ut("making CONNECT request");var $e=Ce.request(Fe);$e.useChunkedEncodingByDefault=false;$e.once("response",onResponse);$e.once("upgrade",onUpgrade);$e.once("connect",onConnect);$e.once("error",onError);$e.end();function onResponse(Ae){Ae.upgrade=true}function onUpgrade(Ae,Se,Ce){process.nextTick((function(){onConnect(Ae,Se,Ce)}))}function onConnect(Fe,rt,it){$e.removeAllListeners();rt.removeAllListeners();if(Fe.statusCode!==200){ut("tunneling socket could not be established, statusCode=%d",Fe.statusCode);rt.destroy();var nt=new Error("tunneling socket could not be established, "+"statusCode="+Fe.statusCode);nt.code="ECONNRESET";Ae.request.emit("error",nt);Ce.removeSocket(qe);return}if(it.length>0){ut("got illegal response body from proxy");rt.destroy();var nt=new Error("got illegal response body from proxy");nt.code="ECONNRESET";Ae.request.emit("error",nt);Ce.removeSocket(qe);return}ut("tunneling connection has established");Ce.sockets[Ce.sockets.indexOf(qe)]=rt;return Se(rt)}function onError(Se){$e.removeAllListeners();ut("tunneling socket could not be established, cause=%s\n",Se.message,Se.stack);var Fe=new Error("tunneling socket could not be established, "+"cause="+Se.message);Fe.code="ECONNRESET";Ae.request.emit("error",Fe);Ce.removeSocket(qe)}};TunnelingAgent.prototype.removeSocket=function removeSocket(Ae){var Se=this.sockets.indexOf(Ae);if(Se===-1){return}this.sockets.splice(Se,1);var Ce=this.requests.shift();if(Ce){this.createSocket(Ce,(function(Ae){Ce.request.onSocket(Ae)}))}};function createSecureSocket(Ae,Se){var Ce=this;TunnelingAgent.prototype.createSocket.call(Ce,Ae,(function(qe){var $e=Ae.request.getHeader("host");var rt=mergeOptions({},Ce.options,{socket:qe,servername:$e?$e.replace(/:.*$/,""):Ae.host});var it=Fe.connect(0,rt);Ce.sockets[Ce.sockets.indexOf(qe)]=it;Se(it)}))}function toOptions(Ae,Se,Ce){if(typeof Ae==="string"){return{host:Ae,port:Se,localAddress:Ce}}return Ae}function mergeOptions(Ae){for(var Se=1,Ce=arguments.length;Se{"use strict";Object.defineProperty(Se,"__esModule",{value:true});Object.defineProperty(Se,"v1",{enumerable:true,get:function(){return qe.default}});Object.defineProperty(Se,"v3",{enumerable:true,get:function(){return Fe.default}});Object.defineProperty(Se,"v4",{enumerable:true,get:function(){return $e.default}});Object.defineProperty(Se,"v5",{enumerable:true,get:function(){return rt.default}});Object.defineProperty(Se,"NIL",{enumerable:true,get:function(){return it.default}});Object.defineProperty(Se,"version",{enumerable:true,get:function(){return nt.default}});Object.defineProperty(Se,"validate",{enumerable:true,get:function(){return st.default}});Object.defineProperty(Se,"stringify",{enumerable:true,get:function(){return ut.default}});Object.defineProperty(Se,"parse",{enumerable:true,get:function(){return ht.default}});var qe=_interopRequireDefault(Ce(8628));var Fe=_interopRequireDefault(Ce(6409));var $e=_interopRequireDefault(Ce(5122));var rt=_interopRequireDefault(Ce(9120));var it=_interopRequireDefault(Ce(5332));var nt=_interopRequireDefault(Ce(1595));var st=_interopRequireDefault(Ce(6900));var ut=_interopRequireDefault(Ce(8950));var ht=_interopRequireDefault(Ce(2746));function _interopRequireDefault(Ae){return Ae&&Ae.__esModule?Ae:{default:Ae}}},4569:(Ae,Se,Ce)=>{"use strict";Object.defineProperty(Se,"__esModule",{value:true});Se["default"]=void 0;var qe=_interopRequireDefault(Ce(6113));function _interopRequireDefault(Ae){return Ae&&Ae.__esModule?Ae:{default:Ae}}function md5(Ae){if(Array.isArray(Ae)){Ae=Buffer.from(Ae)}else if(typeof Ae==="string"){Ae=Buffer.from(Ae,"utf8")}return qe.default.createHash("md5").update(Ae).digest()}var Fe=md5;Se["default"]=Fe},5332:(Ae,Se)=>{"use strict";Object.defineProperty(Se,"__esModule",{value:true});Se["default"]=void 0;var Ce="00000000-0000-0000-0000-000000000000";Se["default"]=Ce},2746:(Ae,Se,Ce)=>{"use strict";Object.defineProperty(Se,"__esModule",{value:true});Se["default"]=void 0;var qe=_interopRequireDefault(Ce(6900));function _interopRequireDefault(Ae){return Ae&&Ae.__esModule?Ae:{default:Ae}}function parse(Ae){if(!(0,qe.default)(Ae)){throw TypeError("Invalid UUID")}let Se;const Ce=new Uint8Array(16);Ce[0]=(Se=parseInt(Ae.slice(0,8),16))>>>24;Ce[1]=Se>>>16&255;Ce[2]=Se>>>8&255;Ce[3]=Se&255;Ce[4]=(Se=parseInt(Ae.slice(9,13),16))>>>8;Ce[5]=Se&255;Ce[6]=(Se=parseInt(Ae.slice(14,18),16))>>>8;Ce[7]=Se&255;Ce[8]=(Se=parseInt(Ae.slice(19,23),16))>>>8;Ce[9]=Se&255;Ce[10]=(Se=parseInt(Ae.slice(24,36),16))/1099511627776&255;Ce[11]=Se/4294967296&255;Ce[12]=Se>>>24&255;Ce[13]=Se>>>16&255;Ce[14]=Se>>>8&255;Ce[15]=Se&255;return Ce}var Fe=parse;Se["default"]=Fe},814:(Ae,Se)=>{"use strict";Object.defineProperty(Se,"__esModule",{value:true});Se["default"]=void 0;var Ce=/^(?:[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;Se["default"]=Ce},807:(Ae,Se,Ce)=>{"use strict";Object.defineProperty(Se,"__esModule",{value:true});Se["default"]=rng;var qe=_interopRequireDefault(Ce(6113));function _interopRequireDefault(Ae){return Ae&&Ae.__esModule?Ae:{default:Ae}}const Fe=new Uint8Array(256);let $e=Fe.length;function rng(){if($e>Fe.length-16){qe.default.randomFillSync(Fe);$e=0}return Fe.slice($e,$e+=16)}},5274:(Ae,Se,Ce)=>{"use strict";Object.defineProperty(Se,"__esModule",{value:true});Se["default"]=void 0;var qe=_interopRequireDefault(Ce(6113));function _interopRequireDefault(Ae){return Ae&&Ae.__esModule?Ae:{default:Ae}}function sha1(Ae){if(Array.isArray(Ae)){Ae=Buffer.from(Ae)}else if(typeof Ae==="string"){Ae=Buffer.from(Ae,"utf8")}return qe.default.createHash("sha1").update(Ae).digest()}var Fe=sha1;Se["default"]=Fe},8950:(Ae,Se,Ce)=>{"use strict";Object.defineProperty(Se,"__esModule",{value:true});Se["default"]=void 0;var qe=_interopRequireDefault(Ce(6900));function _interopRequireDefault(Ae){return Ae&&Ae.__esModule?Ae:{default:Ae}}const Fe=[];for(let Ae=0;Ae<256;++Ae){Fe.push((Ae+256).toString(16).substr(1))}function stringify(Ae,Se=0){const Ce=(Fe[Ae[Se+0]]+Fe[Ae[Se+1]]+Fe[Ae[Se+2]]+Fe[Ae[Se+3]]+"-"+Fe[Ae[Se+4]]+Fe[Ae[Se+5]]+"-"+Fe[Ae[Se+6]]+Fe[Ae[Se+7]]+"-"+Fe[Ae[Se+8]]+Fe[Ae[Se+9]]+"-"+Fe[Ae[Se+10]]+Fe[Ae[Se+11]]+Fe[Ae[Se+12]]+Fe[Ae[Se+13]]+Fe[Ae[Se+14]]+Fe[Ae[Se+15]]).toLowerCase();if(!(0,qe.default)(Ce)){throw TypeError("Stringified UUID is invalid")}return Ce}var $e=stringify;Se["default"]=$e},8628:(Ae,Se,Ce)=>{"use strict";Object.defineProperty(Se,"__esModule",{value:true});Se["default"]=void 0;var qe=_interopRequireDefault(Ce(807));var Fe=_interopRequireDefault(Ce(8950));function _interopRequireDefault(Ae){return Ae&&Ae.__esModule?Ae:{default:Ae}}let $e;let rt;let it=0;let nt=0;function v1(Ae,Se,Ce){let st=Se&&Ce||0;const ut=Se||new Array(16);Ae=Ae||{};let ht=Ae.node||$e;let ft=Ae.clockseq!==undefined?Ae.clockseq:rt;if(ht==null||ft==null){const Se=Ae.random||(Ae.rng||qe.default)();if(ht==null){ht=$e=[Se[0]|1,Se[1],Se[2],Se[3],Se[4],Se[5]]}if(ft==null){ft=rt=(Se[6]<<8|Se[7])&16383}}let yt=Ae.msecs!==undefined?Ae.msecs:Date.now();let vt=Ae.nsecs!==undefined?Ae.nsecs:nt+1;const _t=yt-it+(vt-nt)/1e4;if(_t<0&&Ae.clockseq===undefined){ft=ft+1&16383}if((_t<0||yt>it)&&Ae.nsecs===undefined){vt=0}if(vt>=1e4){throw new Error("uuid.v1(): Can't create more than 10M uuids/sec")}it=yt;nt=vt;rt=ft;yt+=122192928e5;const Ct=((yt&268435455)*1e4+vt)%4294967296;ut[st++]=Ct>>>24&255;ut[st++]=Ct>>>16&255;ut[st++]=Ct>>>8&255;ut[st++]=Ct&255;const Rt=yt/4294967296*1e4&268435455;ut[st++]=Rt>>>8&255;ut[st++]=Rt&255;ut[st++]=Rt>>>24&15|16;ut[st++]=Rt>>>16&255;ut[st++]=ft>>>8|128;ut[st++]=ft&255;for(let Ae=0;Ae<6;++Ae){ut[st+Ae]=ht[Ae]}return Se||(0,Fe.default)(ut)}var st=v1;Se["default"]=st},6409:(Ae,Se,Ce)=>{"use strict";Object.defineProperty(Se,"__esModule",{value:true});Se["default"]=void 0;var qe=_interopRequireDefault(Ce(5998));var Fe=_interopRequireDefault(Ce(4569));function _interopRequireDefault(Ae){return Ae&&Ae.__esModule?Ae:{default:Ae}}const $e=(0,qe.default)("v3",48,Fe.default);var rt=$e;Se["default"]=rt},5998:(Ae,Se,Ce)=>{"use strict";Object.defineProperty(Se,"__esModule",{value:true});Se["default"]=_default;Se.URL=Se.DNS=void 0;var qe=_interopRequireDefault(Ce(8950));var Fe=_interopRequireDefault(Ce(2746));function _interopRequireDefault(Ae){return Ae&&Ae.__esModule?Ae:{default:Ae}}function stringToBytes(Ae){Ae=unescape(encodeURIComponent(Ae));const Se=[];for(let Ce=0;Ce{"use strict";Object.defineProperty(Se,"__esModule",{value:true});Se["default"]=void 0;var qe=_interopRequireDefault(Ce(807));var Fe=_interopRequireDefault(Ce(8950));function _interopRequireDefault(Ae){return Ae&&Ae.__esModule?Ae:{default:Ae}}function v4(Ae,Se,Ce){Ae=Ae||{};const $e=Ae.random||(Ae.rng||qe.default)();$e[6]=$e[6]&15|64;$e[8]=$e[8]&63|128;if(Se){Ce=Ce||0;for(let Ae=0;Ae<16;++Ae){Se[Ce+Ae]=$e[Ae]}return Se}return(0,Fe.default)($e)}var $e=v4;Se["default"]=$e},9120:(Ae,Se,Ce)=>{"use strict";Object.defineProperty(Se,"__esModule",{value:true});Se["default"]=void 0;var qe=_interopRequireDefault(Ce(5998));var Fe=_interopRequireDefault(Ce(5274));function _interopRequireDefault(Ae){return Ae&&Ae.__esModule?Ae:{default:Ae}}const $e=(0,qe.default)("v5",80,Fe.default);var rt=$e;Se["default"]=rt},6900:(Ae,Se,Ce)=>{"use strict";Object.defineProperty(Se,"__esModule",{value:true});Se["default"]=void 0;var qe=_interopRequireDefault(Ce(814));function _interopRequireDefault(Ae){return Ae&&Ae.__esModule?Ae:{default:Ae}}function validate(Ae){return typeof Ae==="string"&&qe.default.test(Ae)}var Fe=validate;Se["default"]=Fe},1595:(Ae,Se,Ce)=>{"use strict";Object.defineProperty(Se,"__esModule",{value:true});Se["default"]=void 0;var qe=_interopRequireDefault(Ce(6900));function _interopRequireDefault(Ae){return Ae&&Ae.__esModule?Ae:{default:Ae}}function version(Ae){if(!(0,qe.default)(Ae)){throw TypeError("Invalid UUID")}return parseInt(Ae.substr(14,1),16)}var Fe=version;Se["default"]=Fe},8954:function(Ae,Se,Ce){"use strict";var qe=this&&this.__createBinding||(Object.create?function(Ae,Se,Ce,qe){if(qe===undefined)qe=Ce;var Fe=Object.getOwnPropertyDescriptor(Se,Ce);if(!Fe||("get"in Fe?!Se.__esModule:Fe.writable||Fe.configurable)){Fe={enumerable:true,get:function(){return Se[Ce]}}}Object.defineProperty(Ae,qe,Fe)}:function(Ae,Se,Ce,qe){if(qe===undefined)qe=Ce;Ae[qe]=Se[Ce]});var Fe=this&&this.__setModuleDefault||(Object.create?function(Ae,Se){Object.defineProperty(Ae,"default",{enumerable:true,value:Se})}:function(Ae,Se){Ae["default"]=Se});var $e=this&&this.__importStar||function(Ae){if(Ae&&Ae.__esModule)return Ae;var Se={};if(Ae!=null)for(var Ce in Ae)if(Ce!=="default"&&Object.prototype.hasOwnProperty.call(Ae,Ce))qe(Se,Ae,Ce);Fe(Se,Ae);return Se};var rt=this&&this.__awaiter||function(Ae,Se,Ce,qe){function adopt(Ae){return Ae instanceof Ce?Ae:new Ce((function(Se){Se(Ae)}))}return new(Ce||(Ce=Promise))((function(Ce,Fe){function fulfilled(Ae){try{step(qe.next(Ae))}catch(Ae){Fe(Ae)}}function rejected(Ae){try{step(qe["throw"](Ae))}catch(Ae){Fe(Ae)}}function step(Ae){Ae.done?Ce(Ae.value):adopt(Ae.value).then(fulfilled,rejected)}step((qe=qe.apply(Ae,Se||[])).next())}))};Object.defineProperty(Se,"__esModule",{value:true});Se.getInputs=void 0;const it=$e(Ce(2186));function getInputs(){return rt(this,void 0,void 0,(function*(){return{gpgPrivateKey:it.getInput("gpg_private_key",{required:true}),passphrase:it.getInput("passphrase"),trustLevel:it.getInput("trust_level"),gitConfigGlobal:it.getBooleanInput("git_config_global"),gitUserSigningkey:it.getBooleanInput("git_user_signingkey"),gitCommitGpgsign:it.getBooleanInput("git_commit_gpgsign"),gitTagGpgsign:it.getBooleanInput("git_tag_gpgsign"),gitPushGpgsign:it.getInput("git_push_gpgsign")||"if-asked",gitCommitterName:it.getInput("git_committer_name"),gitCommitterEmail:it.getInput("git_committer_email"),workdir:it.getInput("workdir")||".",fingerprint:it.getInput("fingerprint")}}))}Se.getInputs=getInputs},6350:function(Ae,Se,Ce){"use strict";var qe=this&&this.__createBinding||(Object.create?function(Ae,Se,Ce,qe){if(qe===undefined)qe=Ce;var Fe=Object.getOwnPropertyDescriptor(Se,Ce);if(!Fe||("get"in Fe?!Se.__esModule:Fe.writable||Fe.configurable)){Fe={enumerable:true,get:function(){return Se[Ce]}}}Object.defineProperty(Ae,qe,Fe)}:function(Ae,Se,Ce,qe){if(qe===undefined)qe=Ce;Ae[qe]=Se[Ce]});var Fe=this&&this.__setModuleDefault||(Object.create?function(Ae,Se){Object.defineProperty(Ae,"default",{enumerable:true,value:Se})}:function(Ae,Se){Ae["default"]=Se});var $e=this&&this.__importStar||function(Ae){if(Ae&&Ae.__esModule)return Ae;var Se={};if(Ae!=null)for(var Ce in Ae)if(Ce!=="default"&&Object.prototype.hasOwnProperty.call(Ae,Ce))qe(Se,Ae,Ce);Fe(Se,Ae);return Se};var rt=this&&this.__awaiter||function(Ae,Se,Ce,qe){function adopt(Ae){return Ae instanceof Ce?Ae:new Ce((function(Se){Se(Ae)}))}return new(Ce||(Ce=Promise))((function(Ce,Fe){function fulfilled(Ae){try{step(qe.next(Ae))}catch(Ae){Fe(Ae)}}function rejected(Ae){try{step(qe["throw"](Ae))}catch(Ae){Fe(Ae)}}function step(Ae){Ae.done?Ce(Ae.value):adopt(Ae.value).then(fulfilled,rejected)}step((qe=qe.apply(Ae,Se||[])).next())}))};Object.defineProperty(Se,"__esModule",{value:true});Se.setConfig=void 0;const it=$e(Ce(1514));const git=(Ae=[])=>rt(void 0,void 0,void 0,(function*(){return yield it.getExecOutput(`git`,Ae,{ignoreReturnCode:true,silent:true}).then((Ae=>{if(Ae.stderr.length>0&&Ae.exitCode!=0){throw new Error(Ae.stderr)}return Ae.stdout.trim()}))}));function setConfig(Ae,Se,Ce){return rt(this,void 0,void 0,(function*(){const qe=["config"];if(Ce){qe.push("--global")}qe.push(Ae,Se);yield git(qe)}))}Se.setConfig=setConfig},3759:function(Ae,Se,Ce){"use strict";var qe=this&&this.__createBinding||(Object.create?function(Ae,Se,Ce,qe){if(qe===undefined)qe=Ce;var Fe=Object.getOwnPropertyDescriptor(Se,Ce);if(!Fe||("get"in Fe?!Se.__esModule:Fe.writable||Fe.configurable)){Fe={enumerable:true,get:function(){return Se[Ce]}}}Object.defineProperty(Ae,qe,Fe)}:function(Ae,Se,Ce,qe){if(qe===undefined)qe=Ce;Ae[qe]=Se[Ce]});var Fe=this&&this.__setModuleDefault||(Object.create?function(Ae,Se){Object.defineProperty(Ae,"default",{enumerable:true,value:Se})}:function(Ae,Se){Ae["default"]=Se});var $e=this&&this.__importStar||function(Ae){if(Ae&&Ae.__esModule)return Ae;var Se={};if(Ae!=null)for(var Ce in Ae)if(Ce!=="default"&&Object.prototype.hasOwnProperty.call(Ae,Ce))qe(Se,Ae,Ce);Fe(Se,Ae);return Se};var rt=this&&this.__awaiter||function(Ae,Se,Ce,qe){function adopt(Ae){return Ae instanceof Ce?Ae:new Ce((function(Se){Se(Ae)}))}return new(Ce||(Ce=Promise))((function(Ce,Fe){function fulfilled(Ae){try{step(qe.next(Ae))}catch(Ae){Fe(Ae)}}function rejected(Ae){try{step(qe["throw"](Ae))}catch(Ae){Fe(Ae)}}function step(Ae){Ae.done?Ce(Ae.value):adopt(Ae.value).then(fulfilled,rejected)}step((qe=qe.apply(Ae,Se||[])).next())}))};Object.defineProperty(Se,"__esModule",{value:true});Se.killAgent=Se.deleteKey=Se.setTrustLevel=Se.presetPassphrase=Se.configureAgent=Se.getKeygrip=Se.parseKeygripFromGpgColonsOutput=Se.getKeygrips=Se.importKey=Se.getDirs=Se.getVersion=Se.getHome=Se.agentConfig=void 0;const it=$e(Ce(1514));const nt=$e(Ce(7147));const st=$e(Ce(1017));const ut=$e(Ce(2037));const ht=$e(Ce(5728));Se.agentConfig=`default-cache-ttl 21600\nmax-cache-ttl 31536000\nallow-preset-passphrase`;const gpgConnectAgent=Ae=>rt(void 0,void 0,void 0,(function*(){return yield it.getExecOutput(`gpg-connect-agent "${Ae}" /bye`,[],{ignoreReturnCode:true,silent:true}).then((Ae=>{if(Ae.stderr.length>0&&Ae.exitCode!=0){throw new Error(Ae.stderr)}for(const Se of Ae.stdout.replace(/\r/g,"").trim().split(/\n/g)){if(Se.startsWith("ERR")){throw new Error(Se)}}return Ae.stdout.trim()}))}));const getHome=()=>rt(void 0,void 0,void 0,(function*(){let Ae="";if(process.env.GNUPGHOME){Ae=process.env.GNUPGHOME}else if(ut.platform()=="win32"&&!process.env.HOME&&process.env.USERPROFILE){Ae=st.join(process.env.USERPROFILE,".gnupg")}else if(process.env.HOME){Ae=st.join(process.env.HOME,".gnupg")}else{Ae=(yield(0,Se.getDirs)()).homedir}if(Ae.length==0){throw new Error("Unable to determine GnuPG home directory")}if(!nt.existsSync(Ae)){nt.mkdirSync(Ae,{recursive:true})}return Ae}));Se.getHome=getHome;const getVersion=()=>rt(void 0,void 0,void 0,(function*(){return yield it.getExecOutput("gpg",["--version"],{ignoreReturnCode:true,silent:true}).then((Ae=>{if(Ae.stderr.length>0&&Ae.exitCode!=0){throw new Error(Ae.stderr)}let Se="";let Ce="";for(const qe of Ae.stdout.replace(/\r/g,"").trim().split(/\n/g)){if(qe.startsWith("gpg (GnuPG) ")){Se=qe.substr("gpg (GnuPG) ".length).trim()}else if(qe.startsWith("gpg (GnuPG/MacGPG2) ")){Se=qe.substr("gpg (GnuPG/MacGPG2) ".length).trim()}else if(qe.startsWith("libgcrypt ")){Ce=qe.substr("libgcrypt ".length).trim()}}return{gnupg:Se,libgcrypt:Ce}}))}));Se.getVersion=getVersion;const getDirs=()=>rt(void 0,void 0,void 0,(function*(){return yield it.getExecOutput("gpgconf",["--list-dirs"],{ignoreReturnCode:true,silent:true}).then((Ae=>{if(Ae.stderr.length>0&&Ae.exitCode!=0){throw new Error(Ae.stderr)}let Se="";let Ce="";let qe="";let Fe="";for(const $e of Ae.stdout.replace(/\r/g,"").trim().split(/\n/g)){if($e.startsWith("libdir:")){Se=$e.substr("libdir:".length).replace("%3a",":").trim()}else if($e.startsWith("libexecdir:")){Ce=$e.substr("libexecdir:".length).replace("%3a",":").trim()}else if($e.startsWith("datadir:")){qe=$e.substr("datadir:".length).replace("%3a",":").trim()}else if($e.startsWith("homedir:")){Fe=$e.substr("homedir:".length).replace("%3a",":").trim()}}return{libdir:Se,libexecdir:Ce,datadir:qe,homedir:Fe}}))}));Se.getDirs=getDirs;const importKey=Ae=>rt(void 0,void 0,void 0,(function*(){const Se=nt.mkdtempSync(st.join(ut.tmpdir(),"ghaction-import-gpg-"));const Ce=`${Se}/key.pgp`;nt.writeFileSync(Ce,(yield ht.isArmored(Ae))?Ae:Buffer.from(Ae,"base64").toString(),{mode:384});return yield it.getExecOutput("gpg",["--import","--batch","--yes",Ce],{ignoreReturnCode:true,silent:true}).then((Ae=>{if(Ae.stderr.length>0&&Ae.exitCode!=0){throw new Error(Ae.stderr)}if(Ae.stderr!=""){return Ae.stderr.trim()}return Ae.stdout.trim()})).finally((()=>{nt.unlinkSync(Ce)}))}));Se.importKey=importKey;const getKeygrips=Ae=>rt(void 0,void 0,void 0,(function*(){return yield it.getExecOutput("gpg",["--batch","--with-colons","--with-keygrip","--list-secret-keys",Ae],{ignoreReturnCode:true,silent:true}).then((Ae=>{const Se=[];for(const Ce of Ae.stdout.replace(/\r/g,"").trim().split(/\n/g)){if(Ce.startsWith("grp")){Se.push(Ce.replace(/(grp|:)/g,"").trim())}}return Se}))}));Se.getKeygrips=getKeygrips;const parseKeygripFromGpgColonsOutput=(Ae,Se)=>{let Ce="";let qe=false;const Fe=Ae.replace(/\r/g,"").trim().split(/\n/g);for(const Ae of Fe){if(Ae.startsWith(`fpr:`)&&Ae.includes(`:${Se}:`)){qe=true;continue}if(Ae.startsWith("grp:")&&qe){Ce=Ae.replace(/(grp|:)/g,"").trim();break}}return Ce};Se.parseKeygripFromGpgColonsOutput=parseKeygripFromGpgColonsOutput;const getKeygrip=Ae=>rt(void 0,void 0,void 0,(function*(){return yield it.getExecOutput("gpg",["--batch","--with-colons","--with-keygrip","--list-secret-keys",Ae],{ignoreReturnCode:true,silent:true}).then((Ce=>(0,Se.parseKeygripFromGpgColonsOutput)(Ce.stdout,Ae)))}));Se.getKeygrip=getKeygrip;const configureAgent=(Ae,Se)=>rt(void 0,void 0,void 0,(function*(){const Ce=st.join(Ae,"gpg-agent.conf");yield nt.writeFile(Ce,Se,(function(Ae){if(Ae)throw Ae}));yield gpgConnectAgent("RELOADAGENT")}));Se.configureAgent=configureAgent;const presetPassphrase=(Ae,Se)=>rt(void 0,void 0,void 0,(function*(){const Ce=Buffer.from(Se,"utf8").toString("hex").toUpperCase();yield gpgConnectAgent(`PRESET_PASSPHRASE ${Ae} -1 ${Ce}`);return yield gpgConnectAgent(`KEYINFO ${Ae}`)}));Se.presetPassphrase=presetPassphrase;const setTrustLevel=(Ae,Se)=>rt(void 0,void 0,void 0,(function*(){yield it.getExecOutput("gpg",["--batch","--no-tty","--command-fd","0","--edit-key",Ae],{ignoreReturnCode:true,silent:true,input:Buffer.from(`trust\n${Se}\ny\nquit\n`)}).then((Ae=>{if(Ae.stderr.length>0&&Ae.exitCode!=0){throw new Error(Ae.stderr)}}))}));Se.setTrustLevel=setTrustLevel;const deleteKey=Ae=>rt(void 0,void 0,void 0,(function*(){yield it.getExecOutput("gpg",["--batch","--yes","--delete-secret-keys",Ae],{ignoreReturnCode:true,silent:true}).then((Ae=>{if(Ae.stderr.length>0&&Ae.exitCode!=0){throw new Error(Ae.stderr)}}));yield it.getExecOutput("gpg",["--batch","--yes","--delete-keys",Ae],{ignoreReturnCode:true,silent:true}).then((Ae=>{if(Ae.stderr.length>0&&Ae.exitCode!=0){throw new Error(Ae.stderr)}}))}));Se.deleteKey=deleteKey;const killAgent=()=>rt(void 0,void 0,void 0,(function*(){yield gpgConnectAgent("KILLAGENT")}));Se.killAgent=killAgent},399:function(Ae,Se,Ce){"use strict";var qe=this&&this.__createBinding||(Object.create?function(Ae,Se,Ce,qe){if(qe===undefined)qe=Ce;var Fe=Object.getOwnPropertyDescriptor(Se,Ce);if(!Fe||("get"in Fe?!Se.__esModule:Fe.writable||Fe.configurable)){Fe={enumerable:true,get:function(){return Se[Ce]}}}Object.defineProperty(Ae,qe,Fe)}:function(Ae,Se,Ce,qe){if(qe===undefined)qe=Ce;Ae[qe]=Se[Ce]});var Fe=this&&this.__setModuleDefault||(Object.create?function(Ae,Se){Object.defineProperty(Ae,"default",{enumerable:true,value:Se})}:function(Ae,Se){Ae["default"]=Se});var $e=this&&this.__importStar||function(Ae){if(Ae&&Ae.__esModule)return Ae;var Se={};if(Ae!=null)for(var Ce in Ae)if(Ce!=="default"&&Object.prototype.hasOwnProperty.call(Ae,Ce))qe(Se,Ae,Ce);Fe(Se,Ae);return Se};var rt=this&&this.__awaiter||function(Ae,Se,Ce,qe){function adopt(Ae){return Ae instanceof Ce?Ae:new Ce((function(Se){Se(Ae)}))}return new(Ce||(Ce=Promise))((function(Ce,Fe){function fulfilled(Ae){try{step(qe.next(Ae))}catch(Ae){Fe(Ae)}}function rejected(Ae){try{step(qe["throw"](Ae))}catch(Ae){Fe(Ae)}}function step(Ae){Ae.done?Ce(Ae.value):adopt(Ae.value).then(fulfilled,rejected)}step((qe=qe.apply(Ae,Se||[])).next())}))};Object.defineProperty(Se,"__esModule",{value:true});const it=$e(Ce(2186));const nt=$e(Ce(8954));const st=$e(Ce(6350));const ut=$e(Ce(3759));const ht=$e(Ce(5728));const ft=$e(Ce(963));function run(){return rt(this,void 0,void 0,(function*(){try{const Ae=yield nt.getInputs();if(Ae.workdir&&Ae.workdir!=="."){it.info(`Using ${Ae.workdir} as working directory...`);process.chdir(Ae.workdir)}const Se=yield ut.getVersion();const Ce=yield ut.getDirs();yield it.group(`GnuPG info`,(()=>rt(this,void 0,void 0,(function*(){it.info(`Version : ${Se.gnupg} (libgcrypt ${Se.libgcrypt})`);it.info(`Libdir : ${Ce.libdir}`);it.info(`Libexecdir : ${Ce.libexecdir}`);it.info(`Datadir : ${Ce.datadir}`);it.info(`Homedir : ${Ce.homedir}`)}))));const qe=yield ht.readPrivateKey(Ae.gpgPrivateKey);yield it.group(`GPG private key info`,(()=>rt(this,void 0,void 0,(function*(){it.info(`Fingerprint : ${qe.fingerprint}`);it.info(`KeyID : ${qe.keyID}`);it.info(`Name : ${qe.name}`);it.info(`Email : ${qe.email}`);it.info(`CreationTime : ${qe.creationTime}`)}))));ft.setFingerprint(qe.fingerprint);let Fe=qe.fingerprint;if(Ae.fingerprint){Fe=Ae.fingerprint}yield it.group(`Fingerprint to use`,(()=>rt(this,void 0,void 0,(function*(){it.info(Fe)}))));yield it.group(`Importing GPG private key`,(()=>rt(this,void 0,void 0,(function*(){yield ut.importKey(Ae.gpgPrivateKey).then((Ae=>{it.info(Ae)}))}))));if(Ae.passphrase){yield it.group(`Configuring GnuPG agent`,(()=>rt(this,void 0,void 0,(function*(){const Ae=yield ut.getHome();it.info(`GnuPG home: ${Ae}`);yield ut.configureAgent(Ae,ut.agentConfig)}))));if(!Ae.fingerprint){yield it.group(`Getting keygrips`,(()=>rt(this,void 0,void 0,(function*(){for(const Se of yield ut.getKeygrips(Fe)){it.info(`Presetting passphrase for ${Se}`);yield ut.presetPassphrase(Se,Ae.passphrase).then((Ae=>{it.debug(Ae)}))}}))))}else{yield it.group(`Getting keygrip for fingerprint`,(()=>rt(this,void 0,void 0,(function*(){const Se=yield ut.getKeygrip(Fe);it.info(`Presetting passphrase for key ${Fe} with keygrip ${Se}`);yield ut.presetPassphrase(Se,Ae.passphrase).then((Ae=>{it.debug(Ae)}))}))))}}if(Ae.trustLevel){yield it.group(`Setting key's trust level`,(()=>rt(this,void 0,void 0,(function*(){yield ut.setTrustLevel(qe.keyID,Ae.trustLevel).then((()=>{it.info(`Trust level set to ${Ae.trustLevel} for ${qe.keyID}`)}))}))))}yield it.group(`Setting outputs`,(()=>rt(this,void 0,void 0,(function*(){it.info(`fingerprint=${Fe}`);it.setOutput("fingerprint",Fe);it.info(`keyid=${qe.keyID}`);it.setOutput("keyid",qe.keyID);it.info(`name=${qe.name}`);it.setOutput("name",qe.name);it.info(`email=${qe.email}`);it.setOutput("email",qe.email)}))));if(Ae.gitUserSigningkey){it.info("Setting GPG signing keyID for this Git repository");yield st.setConfig("user.signingkey",qe.keyID,Ae.gitConfigGlobal);const Se=Ae.gitCommitterEmail||qe.email;const Ce=Ae.gitCommitterName||qe.name;if(Se!=qe.email){it.setFailed(`Committer email "${Ae.gitCommitterEmail}" (name: "${Ae.gitCommitterName}") does not match GPG private key email "${qe.email}" (name: "${qe.name}")`);return}it.info(`Configuring Git committer (${Ce} <${Se}>)`);yield st.setConfig("user.name",Ce,Ae.gitConfigGlobal);yield st.setConfig("user.email",Se,Ae.gitConfigGlobal);if(Ae.gitCommitGpgsign){it.info("Sign all commits automatically");yield st.setConfig("commit.gpgsign","true",Ae.gitConfigGlobal)}if(Ae.gitTagGpgsign){it.info("Sign all tags automatically");yield st.setConfig("tag.gpgsign","true",Ae.gitConfigGlobal)}if(Ae.gitPushGpgsign){it.info("Sign all pushes automatically");yield st.setConfig("push.gpgsign",Ae.gitPushGpgsign,Ae.gitConfigGlobal)}}}catch(Ae){it.setFailed(Ae.message)}}))}function cleanup(){return rt(this,void 0,void 0,(function*(){if(ft.fingerprint.length<=0){it.debug("Primary key fingerprint is not defined. Skipping cleanup.");return}try{it.info(`Removing key ${ft.fingerprint}`);yield ut.deleteKey(ft.fingerprint);it.info("Killing GnuPG agent");yield ut.killAgent()}catch(Ae){it.warning(Ae.message)}}))}if(!ft.IsPost){run()}else{cleanup()}},5728:function(Ae,Se,Ce){"use strict";var qe=this&&this.__createBinding||(Object.create?function(Ae,Se,Ce,qe){if(qe===undefined)qe=Ce;var Fe=Object.getOwnPropertyDescriptor(Se,Ce);if(!Fe||("get"in Fe?!Se.__esModule:Fe.writable||Fe.configurable)){Fe={enumerable:true,get:function(){return Se[Ce]}}}Object.defineProperty(Ae,qe,Fe)}:function(Ae,Se,Ce,qe){if(qe===undefined)qe=Ce;Ae[qe]=Se[Ce]});var Fe=this&&this.__setModuleDefault||(Object.create?function(Ae,Se){Object.defineProperty(Ae,"default",{enumerable:true,value:Se})}:function(Ae,Se){Ae["default"]=Se});var $e=this&&this.__importStar||function(Ae){if(Ae&&Ae.__esModule)return Ae;var Se={};if(Ae!=null)for(var Ce in Ae)if(Ce!=="default"&&Object.prototype.hasOwnProperty.call(Ae,Ce))qe(Se,Ae,Ce);Fe(Se,Ae);return Se};var rt=this&&this.__awaiter||function(Ae,Se,Ce,qe){function adopt(Ae){return Ae instanceof Ce?Ae:new Ce((function(Se){Se(Ae)}))}return new(Ce||(Ce=Promise))((function(Ce,Fe){function fulfilled(Ae){try{step(qe.next(Ae))}catch(Ae){Fe(Ae)}}function rejected(Ae){try{step(qe["throw"](Ae))}catch(Ae){Fe(Ae)}}function step(Ae){Ae.done?Ce(Ae.value):adopt(Ae.value).then(fulfilled,rejected)}step((qe=qe.apply(Ae,Se||[])).next())}))};var it=this&&this.__importDefault||function(Ae){return Ae&&Ae.__esModule?Ae:{default:Ae}};Object.defineProperty(Se,"__esModule",{value:true});Se.isArmored=Se.generateKeyPair=Se.readPrivateKey=void 0;const nt=$e(Ce(7946));const st=it(Ce(2764));const readPrivateKey=Ae=>rt(void 0,void 0,void 0,(function*(){const Ce=yield nt.readKey({armoredKey:(yield(0,Se.isArmored)(Ae))?Ae:Buffer.from(Ae,"base64").toString()});const qe=yield Ce.getPrimaryUser().then((Ae=>{var Se;return(0,st.default)((Se=Ae.user.userID)===null||Se===void 0?void 0:Se.userID)[0]}));return{fingerprint:Ce.getFingerprint().toUpperCase(),keyID:Ce.getKeyID().toHex().toUpperCase(),name:qe.name,email:qe.address,creationTime:Ce.getCreationTime()}}));Se.readPrivateKey=readPrivateKey;const generateKeyPair=(Ae,Se,Ce,qe)=>rt(void 0,void 0,void 0,(function*(){const Fe=yield nt.generateKey({userIDs:[{name:Ae,email:Se}],passphrase:Ce,type:qe});return{publicKey:Fe.publicKey.replace(/\r\n/g,"\n").trim(),privateKey:Fe.privateKey.replace(/\r\n/g,"\n").trim()}}));Se.generateKeyPair=generateKeyPair;const isArmored=Ae=>rt(void 0,void 0,void 0,(function*(){return Ae.trimLeft().startsWith("---")}));Se.isArmored=isArmored},963:function(Ae,Se,Ce){"use strict";var qe=this&&this.__createBinding||(Object.create?function(Ae,Se,Ce,qe){if(qe===undefined)qe=Ce;var Fe=Object.getOwnPropertyDescriptor(Se,Ce);if(!Fe||("get"in Fe?!Se.__esModule:Fe.writable||Fe.configurable)){Fe={enumerable:true,get:function(){return Se[Ce]}}}Object.defineProperty(Ae,qe,Fe)}:function(Ae,Se,Ce,qe){if(qe===undefined)qe=Ce;Ae[qe]=Se[Ce]});var Fe=this&&this.__setModuleDefault||(Object.create?function(Ae,Se){Object.defineProperty(Ae,"default",{enumerable:true,value:Se})}:function(Ae,Se){Ae["default"]=Se});var $e=this&&this.__importStar||function(Ae){if(Ae&&Ae.__esModule)return Ae;var Se={};if(Ae!=null)for(var Ce in Ae)if(Ce!=="default"&&Object.prototype.hasOwnProperty.call(Ae,Ce))qe(Se,Ae,Ce);Fe(Se,Ae);return Se};Object.defineProperty(Se,"__esModule",{value:true});Se.setFingerprint=Se.fingerprint=Se.IsPost=void 0;const rt=$e(Ce(2186));Se.IsPost=!!process.env["STATE_isPost"];Se.fingerprint=process.env["STATE_fingerprint"]||"";function setFingerprint(Ae){rt.saveState("fingerprint",Ae)}Se.setFingerprint=setFingerprint;if(!Se.IsPost){rt.saveState("isPost","true")}},9491:Ae=>{"use strict";Ae.exports=require("assert")},4300:Ae=>{"use strict";Ae.exports=require("buffer")},2081:Ae=>{"use strict";Ae.exports=require("child_process")},6113:Ae=>{"use strict";Ae.exports=require("crypto")},2361:Ae=>{"use strict";Ae.exports=require("events")},7147:Ae=>{"use strict";Ae.exports=require("fs")},3685:Ae=>{"use strict";Ae.exports=require("http")},5687:Ae=>{"use strict";Ae.exports=require("https")},1808:Ae=>{"use strict";Ae.exports=require("net")},2037:Ae=>{"use strict";Ae.exports=require("os")},1017:Ae=>{"use strict";Ae.exports=require("path")},2781:Ae=>{"use strict";Ae.exports=require("stream")},1576:Ae=>{"use strict";Ae.exports=require("string_decoder")},9512:Ae=>{"use strict";Ae.exports=require("timers")},4404:Ae=>{"use strict";Ae.exports=require("tls")},3837:Ae=>{"use strict";Ae.exports=require("util")},9796:Ae=>{"use strict";Ae.exports=require("zlib")}};var Se={};function __nccwpck_require__(Ce){var qe=Se[Ce];if(qe!==undefined){return qe.exports}var Fe=Se[Ce]={id:Ce,loaded:false,exports:{}};var $e=true;try{Ae[Ce].call(Fe.exports,Fe,Fe.exports,__nccwpck_require__);$e=false}finally{if($e)delete Se[Ce]}Fe.loaded=true;return Fe.exports}(()=>{__nccwpck_require__.nmd=Ae=>{Ae.paths=[];if(!Ae.children)Ae.children=[];return Ae}})();if(typeof __nccwpck_require__!=="undefined")__nccwpck_require__.ab=__dirname+"/";var Ce=__nccwpck_require__(399);module.exports=Ce})(); //# sourceMappingURL=index.js.map