require('./sourcemap-register.js');(()=>{var ke={7351:function(ke,Ae,Ce){"use strict";var ze=this&&this.__createBinding||(Object.create?function(ke,Ae,Ce,ze){if(ze===undefined)ze=Ce;Object.defineProperty(ke,ze,{enumerable:true,get:function(){return Ae[Ce]}})}:function(ke,Ae,Ce,ze){if(ze===undefined)ze=Ce;ke[ze]=Ae[Ce]});var qe=this&&this.__setModuleDefault||(Object.create?function(ke,Ae){Object.defineProperty(ke,"default",{enumerable:true,value:Ae})}:function(ke,Ae){ke["default"]=Ae});var Ve=this&&this.__importStar||function(ke){if(ke&&ke.__esModule)return ke;var Ae={};if(ke!=null)for(var Ce in ke)if(Ce!=="default"&&Object.hasOwnProperty.call(ke,Ce))ze(Ae,ke,Ce);qe(Ae,ke);return Ae};Object.defineProperty(Ae,"__esModule",{value:true});Ae.issue=Ae.issueCommand=void 0;const tt=Ve(Ce(2037));const rt=Ce(5278);function issueCommand(ke,Ae,Ce){const ze=new Command(ke,Ae,Ce);process.stdout.write(ze.toString()+tt.EOL)}Ae.issueCommand=issueCommand;function issue(ke,Ae=""){issueCommand(ke,{},Ae)}Ae.issue=issue;const it="::";class Command{constructor(ke,Ae,Ce){if(!ke){ke="missing.command"}this.command=ke;this.properties=Ae;this.message=Ce}toString(){let ke=it+this.command;if(this.properties&&Object.keys(this.properties).length>0){ke+=" ";let Ae=true;for(const Ce in this.properties){if(this.properties.hasOwnProperty(Ce)){const ze=this.properties[Ce];if(ze){if(Ae){Ae=false}else{ke+=","}ke+=`${Ce}=${escapeProperty(ze)}`}}}}ke+=`${it}${escapeData(this.message)}`;return ke}}function escapeData(ke){return rt.toCommandValue(ke).replace(/%/g,"%25").replace(/\r/g,"%0D").replace(/\n/g,"%0A")}function escapeProperty(ke){return rt.toCommandValue(ke).replace(/%/g,"%25").replace(/\r/g,"%0D").replace(/\n/g,"%0A").replace(/:/g,"%3A").replace(/,/g,"%2C")}},2186:function(ke,Ae,Ce){"use strict";var ze=this&&this.__createBinding||(Object.create?function(ke,Ae,Ce,ze){if(ze===undefined)ze=Ce;Object.defineProperty(ke,ze,{enumerable:true,get:function(){return Ae[Ce]}})}:function(ke,Ae,Ce,ze){if(ze===undefined)ze=Ce;ke[ze]=Ae[Ce]});var qe=this&&this.__setModuleDefault||(Object.create?function(ke,Ae){Object.defineProperty(ke,"default",{enumerable:true,value:Ae})}:function(ke,Ae){ke["default"]=Ae});var Ve=this&&this.__importStar||function(ke){if(ke&&ke.__esModule)return ke;var Ae={};if(ke!=null)for(var Ce in ke)if(Ce!=="default"&&Object.hasOwnProperty.call(ke,Ce))ze(Ae,ke,Ce);qe(Ae,ke);return Ae};var tt=this&&this.__awaiter||function(ke,Ae,Ce,ze){function adopt(ke){return ke instanceof Ce?ke:new Ce((function(Ae){Ae(ke)}))}return new(Ce||(Ce=Promise))((function(Ce,qe){function fulfilled(ke){try{step(ze.next(ke))}catch(ke){qe(ke)}}function rejected(ke){try{step(ze["throw"](ke))}catch(ke){qe(ke)}}function step(ke){ke.done?Ce(ke.value):adopt(ke.value).then(fulfilled,rejected)}step((ze=ze.apply(ke,Ae||[])).next())}))};Object.defineProperty(Ae,"__esModule",{value:true});Ae.getIDToken=Ae.getState=Ae.saveState=Ae.group=Ae.endGroup=Ae.startGroup=Ae.info=Ae.notice=Ae.warning=Ae.error=Ae.debug=Ae.isDebug=Ae.setFailed=Ae.setCommandEcho=Ae.setOutput=Ae.getBooleanInput=Ae.getMultilineInput=Ae.getInput=Ae.addPath=Ae.setSecret=Ae.exportVariable=Ae.ExitCode=void 0;const rt=Ce(7351);const it=Ce(717);const nt=Ce(5278);const ot=Ve(Ce(2037));const ct=Ve(Ce(1017));const ht=Ce(8041);var ft;(function(ke){ke[ke["Success"]=0]="Success";ke[ke["Failure"]=1]="Failure"})(ft=Ae.ExitCode||(Ae.ExitCode={}));function exportVariable(ke,Ae){const Ce=nt.toCommandValue(Ae);process.env[ke]=Ce;const ze=process.env["GITHUB_ENV"]||"";if(ze){const Ae="_GitHubActionsFileCommandDelimeter_";const ze=`${ke}<<${Ae}${ot.EOL}${Ce}${ot.EOL}${Ae}`;it.issueCommand("ENV",ze)}else{rt.issueCommand("set-env",{name:ke},Ce)}}Ae.exportVariable=exportVariable;function setSecret(ke){rt.issueCommand("add-mask",{},ke)}Ae.setSecret=setSecret;function addPath(ke){const Ae=process.env["GITHUB_PATH"]||"";if(Ae){it.issueCommand("PATH",ke)}else{rt.issueCommand("add-path",{},ke)}process.env["PATH"]=`${ke}${ct.delimiter}${process.env["PATH"]}`}Ae.addPath=addPath;function getInput(ke,Ae){const Ce=process.env[`INPUT_${ke.replace(/ /g,"_").toUpperCase()}`]||"";if(Ae&&Ae.required&&!Ce){throw new Error(`Input required and not supplied: ${ke}`)}if(Ae&&Ae.trimWhitespace===false){return Ce}return Ce.trim()}Ae.getInput=getInput;function getMultilineInput(ke,Ae){const Ce=getInput(ke,Ae).split("\n").filter((ke=>ke!==""));return Ce}Ae.getMultilineInput=getMultilineInput;function getBooleanInput(ke,Ae){const Ce=["true","True","TRUE"];const ze=["false","False","FALSE"];const qe=getInput(ke,Ae);if(Ce.includes(qe))return true;if(ze.includes(qe))return false;throw new TypeError(`Input does not meet YAML 1.2 "Core Schema" specification: ${ke}\n`+`Support boolean input list: \`true | True | TRUE | false | False | FALSE\``)}Ae.getBooleanInput=getBooleanInput;function setOutput(ke,Ae){process.stdout.write(ot.EOL);rt.issueCommand("set-output",{name:ke},Ae)}Ae.setOutput=setOutput;function setCommandEcho(ke){rt.issue("echo",ke?"on":"off")}Ae.setCommandEcho=setCommandEcho;function setFailed(ke){process.exitCode=ft.Failure;error(ke)}Ae.setFailed=setFailed;function isDebug(){return process.env["RUNNER_DEBUG"]==="1"}Ae.isDebug=isDebug;function debug(ke){rt.issueCommand("debug",{},ke)}Ae.debug=debug;function error(ke,Ae={}){rt.issueCommand("error",nt.toCommandProperties(Ae),ke instanceof Error?ke.toString():ke)}Ae.error=error;function warning(ke,Ae={}){rt.issueCommand("warning",nt.toCommandProperties(Ae),ke instanceof Error?ke.toString():ke)}Ae.warning=warning;function notice(ke,Ae={}){rt.issueCommand("notice",nt.toCommandProperties(Ae),ke instanceof Error?ke.toString():ke)}Ae.notice=notice;function info(ke){process.stdout.write(ke+ot.EOL)}Ae.info=info;function startGroup(ke){rt.issue("group",ke)}Ae.startGroup=startGroup;function endGroup(){rt.issue("endgroup")}Ae.endGroup=endGroup;function group(ke,Ae){return tt(this,void 0,void 0,(function*(){startGroup(ke);let Ce;try{Ce=yield Ae()}finally{endGroup()}return Ce}))}Ae.group=group;function saveState(ke,Ae){rt.issueCommand("save-state",{name:ke},Ae)}Ae.saveState=saveState;function getState(ke){return process.env[`STATE_${ke}`]||""}Ae.getState=getState;function getIDToken(ke){return tt(this,void 0,void 0,(function*(){return yield ht.OidcClient.getIDToken(ke)}))}Ae.getIDToken=getIDToken},717:function(ke,Ae,Ce){"use strict";var ze=this&&this.__createBinding||(Object.create?function(ke,Ae,Ce,ze){if(ze===undefined)ze=Ce;Object.defineProperty(ke,ze,{enumerable:true,get:function(){return Ae[Ce]}})}:function(ke,Ae,Ce,ze){if(ze===undefined)ze=Ce;ke[ze]=Ae[Ce]});var qe=this&&this.__setModuleDefault||(Object.create?function(ke,Ae){Object.defineProperty(ke,"default",{enumerable:true,value:Ae})}:function(ke,Ae){ke["default"]=Ae});var Ve=this&&this.__importStar||function(ke){if(ke&&ke.__esModule)return ke;var Ae={};if(ke!=null)for(var Ce in ke)if(Ce!=="default"&&Object.hasOwnProperty.call(ke,Ce))ze(Ae,ke,Ce);qe(Ae,ke);return Ae};Object.defineProperty(Ae,"__esModule",{value:true});Ae.issueCommand=void 0;const tt=Ve(Ce(7147));const rt=Ve(Ce(2037));const it=Ce(5278);function issueCommand(ke,Ae){const Ce=process.env[`GITHUB_${ke}`];if(!Ce){throw new Error(`Unable to find environment variable for file command ${ke}`)}if(!tt.existsSync(Ce)){throw new Error(`Missing file at path: ${Ce}`)}tt.appendFileSync(Ce,`${it.toCommandValue(Ae)}${rt.EOL}`,{encoding:"utf8"})}Ae.issueCommand=issueCommand},8041:function(ke,Ae,Ce){"use strict";var ze=this&&this.__awaiter||function(ke,Ae,Ce,ze){function adopt(ke){return ke instanceof Ce?ke:new Ce((function(Ae){Ae(ke)}))}return new(Ce||(Ce=Promise))((function(Ce,qe){function fulfilled(ke){try{step(ze.next(ke))}catch(ke){qe(ke)}}function rejected(ke){try{step(ze["throw"](ke))}catch(ke){qe(ke)}}function step(ke){ke.done?Ce(ke.value):adopt(ke.value).then(fulfilled,rejected)}step((ze=ze.apply(ke,Ae||[])).next())}))};Object.defineProperty(Ae,"__esModule",{value:true});Ae.OidcClient=void 0;const qe=Ce(9925);const Ve=Ce(3702);const tt=Ce(2186);class OidcClient{static createHttpClient(ke=true,Ae=10){const Ce={allowRetries:ke,maxRetries:Ae};return new qe.HttpClient("actions/oidc-client",[new Ve.BearerCredentialHandler(OidcClient.getRequestToken())],Ce)}static getRequestToken(){const ke=process.env["ACTIONS_ID_TOKEN_REQUEST_TOKEN"];if(!ke){throw new Error("Unable to get ACTIONS_ID_TOKEN_REQUEST_TOKEN env variable")}return ke}static getIDTokenUrl(){const ke=process.env["ACTIONS_ID_TOKEN_REQUEST_URL"];if(!ke){throw new Error("Unable to get ACTIONS_ID_TOKEN_REQUEST_URL env variable")}return ke}static getCall(ke){var Ae;return ze(this,void 0,void 0,(function*(){const Ce=OidcClient.createHttpClient();const ze=yield Ce.getJson(ke).catch((ke=>{throw new Error(`Failed to get ID Token. \n \n Error Code : ${ke.statusCode}\n \n Error Message: ${ke.result.message}`)}));const qe=(Ae=ze.result)===null||Ae===void 0?void 0:Ae.value;if(!qe){throw new Error("Response json body do not have ID Token field")}return qe}))}static getIDToken(ke){return ze(this,void 0,void 0,(function*(){try{let Ae=OidcClient.getIDTokenUrl();if(ke){const Ce=encodeURIComponent(ke);Ae=`${Ae}&audience=${Ce}`}tt.debug(`ID token url is ${Ae}`);const Ce=yield OidcClient.getCall(Ae);tt.setSecret(Ce);return Ce}catch(ke){throw new Error(`Error message: ${ke.message}`)}}))}}Ae.OidcClient=OidcClient},5278:(ke,Ae)=>{"use strict";Object.defineProperty(Ae,"__esModule",{value:true});Ae.toCommandProperties=Ae.toCommandValue=void 0;function toCommandValue(ke){if(ke===null||ke===undefined){return""}else if(typeof ke==="string"||ke instanceof String){return ke}return JSON.stringify(ke)}Ae.toCommandValue=toCommandValue;function toCommandProperties(ke){if(!Object.keys(ke).length){return{}}return{title:ke.title,file:ke.file,line:ke.startLine,endLine:ke.endLine,col:ke.startColumn,endColumn:ke.endColumn}}Ae.toCommandProperties=toCommandProperties},1514:function(ke,Ae,Ce){"use strict";var ze=this&&this.__createBinding||(Object.create?function(ke,Ae,Ce,ze){if(ze===undefined)ze=Ce;Object.defineProperty(ke,ze,{enumerable:true,get:function(){return Ae[Ce]}})}:function(ke,Ae,Ce,ze){if(ze===undefined)ze=Ce;ke[ze]=Ae[Ce]});var qe=this&&this.__setModuleDefault||(Object.create?function(ke,Ae){Object.defineProperty(ke,"default",{enumerable:true,value:Ae})}:function(ke,Ae){ke["default"]=Ae});var Ve=this&&this.__importStar||function(ke){if(ke&&ke.__esModule)return ke;var Ae={};if(ke!=null)for(var Ce in ke)if(Ce!=="default"&&Object.hasOwnProperty.call(ke,Ce))ze(Ae,ke,Ce);qe(Ae,ke);return Ae};var tt=this&&this.__awaiter||function(ke,Ae,Ce,ze){function adopt(ke){return ke instanceof Ce?ke:new Ce((function(Ae){Ae(ke)}))}return new(Ce||(Ce=Promise))((function(Ce,qe){function fulfilled(ke){try{step(ze.next(ke))}catch(ke){qe(ke)}}function rejected(ke){try{step(ze["throw"](ke))}catch(ke){qe(ke)}}function step(ke){ke.done?Ce(ke.value):adopt(ke.value).then(fulfilled,rejected)}step((ze=ze.apply(ke,Ae||[])).next())}))};Object.defineProperty(Ae,"__esModule",{value:true});Ae.getExecOutput=Ae.exec=void 0;const rt=Ce(1576);const it=Ve(Ce(8159));function exec(ke,Ae,Ce){return tt(this,void 0,void 0,(function*(){const ze=it.argStringToArray(ke);if(ze.length===0){throw new Error(`Parameter 'commandLine' cannot be null or empty.`)}const qe=ze[0];Ae=ze.slice(1).concat(Ae||[]);const Ve=new it.ToolRunner(qe,Ae,Ce);return Ve.exec()}))}Ae.exec=exec;function getExecOutput(ke,Ae,Ce){var ze,qe;return tt(this,void 0,void 0,(function*(){let Ve="";let tt="";const it=new rt.StringDecoder("utf8");const nt=new rt.StringDecoder("utf8");const ot=(ze=Ce===null||Ce===void 0?void 0:Ce.listeners)===null||ze===void 0?void 0:ze.stdout;const ct=(qe=Ce===null||Ce===void 0?void 0:Ce.listeners)===null||qe===void 0?void 0:qe.stderr;const stdErrListener=ke=>{tt+=nt.write(ke);if(ct){ct(ke)}};const stdOutListener=ke=>{Ve+=it.write(ke);if(ot){ot(ke)}};const ht=Object.assign(Object.assign({},Ce===null||Ce===void 0?void 0:Ce.listeners),{stdout:stdOutListener,stderr:stdErrListener});const ft=yield exec(ke,Ae,Object.assign(Object.assign({},Ce),{listeners:ht}));Ve+=it.end();tt+=nt.end();return{exitCode:ft,stdout:Ve,stderr:tt}}))}Ae.getExecOutput=getExecOutput},8159:function(ke,Ae,Ce){"use strict";var ze=this&&this.__createBinding||(Object.create?function(ke,Ae,Ce,ze){if(ze===undefined)ze=Ce;Object.defineProperty(ke,ze,{enumerable:true,get:function(){return Ae[Ce]}})}:function(ke,Ae,Ce,ze){if(ze===undefined)ze=Ce;ke[ze]=Ae[Ce]});var qe=this&&this.__setModuleDefault||(Object.create?function(ke,Ae){Object.defineProperty(ke,"default",{enumerable:true,value:Ae})}:function(ke,Ae){ke["default"]=Ae});var Ve=this&&this.__importStar||function(ke){if(ke&&ke.__esModule)return ke;var Ae={};if(ke!=null)for(var Ce in ke)if(Ce!=="default"&&Object.hasOwnProperty.call(ke,Ce))ze(Ae,ke,Ce);qe(Ae,ke);return Ae};var tt=this&&this.__awaiter||function(ke,Ae,Ce,ze){function adopt(ke){return ke instanceof Ce?ke:new Ce((function(Ae){Ae(ke)}))}return new(Ce||(Ce=Promise))((function(Ce,qe){function fulfilled(ke){try{step(ze.next(ke))}catch(ke){qe(ke)}}function rejected(ke){try{step(ze["throw"](ke))}catch(ke){qe(ke)}}function step(ke){ke.done?Ce(ke.value):adopt(ke.value).then(fulfilled,rejected)}step((ze=ze.apply(ke,Ae||[])).next())}))};Object.defineProperty(Ae,"__esModule",{value:true});Ae.argStringToArray=Ae.ToolRunner=void 0;const rt=Ve(Ce(2037));const it=Ve(Ce(2361));const nt=Ve(Ce(2081));const ot=Ve(Ce(1017));const ct=Ve(Ce(7436));const ht=Ve(Ce(1962));const ft=Ce(9512);const yt=process.platform==="win32";class ToolRunner extends it.EventEmitter{constructor(ke,Ae,Ce){super();if(!ke){throw new Error("Parameter 'toolPath' cannot be null or empty.")}this.toolPath=ke;this.args=Ae||[];this.options=Ce||{}}_debug(ke){if(this.options.listeners&&this.options.listeners.debug){this.options.listeners.debug(ke)}}_getCommandString(ke,Ae){const Ce=this._getSpawnFileName();const ze=this._getSpawnArgs(ke);let qe=Ae?"":"[command]";if(yt){if(this._isCmdFile()){qe+=Ce;for(const ke of ze){qe+=` ${ke}`}}else if(ke.windowsVerbatimArguments){qe+=`"${Ce}"`;for(const ke of ze){qe+=` ${ke}`}}else{qe+=this._windowsQuoteCmdArg(Ce);for(const ke of ze){qe+=` ${this._windowsQuoteCmdArg(ke)}`}}}else{qe+=Ce;for(const ke of ze){qe+=` ${ke}`}}return qe}_processLineBuffer(ke,Ae,Ce){try{let ze=Ae+ke.toString();let qe=ze.indexOf(rt.EOL);while(qe>-1){const ke=ze.substring(0,qe);Ce(ke);ze=ze.substring(qe+rt.EOL.length);qe=ze.indexOf(rt.EOL)}return ze}catch(ke){this._debug(`error processing line. Failed with error ${ke}`);return""}}_getSpawnFileName(){if(yt){if(this._isCmdFile()){return process.env["COMSPEC"]||"cmd.exe"}}return this.toolPath}_getSpawnArgs(ke){if(yt){if(this._isCmdFile()){let Ae=`/D /S /C "${this._windowsQuoteCmdArg(this.toolPath)}`;for(const Ce of this.args){Ae+=" ";Ae+=ke.windowsVerbatimArguments?Ce:this._windowsQuoteCmdArg(Ce)}Ae+='"';return[Ae]}}return this.args}_endsWith(ke,Ae){return ke.endsWith(Ae)}_isCmdFile(){const ke=this.toolPath.toUpperCase();return this._endsWith(ke,".CMD")||this._endsWith(ke,".BAT")}_windowsQuoteCmdArg(ke){if(!this._isCmdFile()){return this._uvQuoteCmdArg(ke)}if(!ke){return'""'}const Ae=[" ","\t","&","(",")","[","]","{","}","^","=",";","!","'","+",",","`","~","|","<",">",'"'];let Ce=false;for(const ze of ke){if(Ae.some((ke=>ke===ze))){Ce=true;break}}if(!Ce){return ke}let ze='"';let qe=true;for(let Ae=ke.length;Ae>0;Ae--){ze+=ke[Ae-1];if(qe&&ke[Ae-1]==="\\"){ze+="\\"}else if(ke[Ae-1]==='"'){qe=true;ze+='"'}else{qe=false}}ze+='"';return ze.split("").reverse().join("")}_uvQuoteCmdArg(ke){if(!ke){return'""'}if(!ke.includes(" ")&&!ke.includes("\t")&&!ke.includes('"')){return ke}if(!ke.includes('"')&&!ke.includes("\\")){return`"${ke}"`}let Ae='"';let Ce=true;for(let ze=ke.length;ze>0;ze--){Ae+=ke[ze-1];if(Ce&&ke[ze-1]==="\\"){Ae+="\\"}else if(ke[ze-1]==='"'){Ce=true;Ae+="\\"}else{Ce=false}}Ae+='"';return Ae.split("").reverse().join("")}_cloneExecOptions(ke){ke=ke||{};const Ae={cwd:ke.cwd||process.cwd(),env:ke.env||process.env,silent:ke.silent||false,windowsVerbatimArguments:ke.windowsVerbatimArguments||false,failOnStdErr:ke.failOnStdErr||false,ignoreReturnCode:ke.ignoreReturnCode||false,delay:ke.delay||1e4};Ae.outStream=ke.outStream||process.stdout;Ae.errStream=ke.errStream||process.stderr;return Ae}_getSpawnOptions(ke,Ae){ke=ke||{};const Ce={};Ce.cwd=ke.cwd;Ce.env=ke.env;Ce["windowsVerbatimArguments"]=ke.windowsVerbatimArguments||this._isCmdFile();if(ke.windowsVerbatimArguments){Ce.argv0=`"${Ae}"`}return Ce}exec(){return tt(this,void 0,void 0,(function*(){if(!ht.isRooted(this.toolPath)&&(this.toolPath.includes("/")||yt&&this.toolPath.includes("\\"))){this.toolPath=ot.resolve(process.cwd(),this.options.cwd||process.cwd(),this.toolPath)}this.toolPath=yield ct.which(this.toolPath,true);return new Promise(((ke,Ae)=>tt(this,void 0,void 0,(function*(){this._debug(`exec tool: ${this.toolPath}`);this._debug("arguments:");for(const ke of this.args){this._debug(` ${ke}`)}const Ce=this._cloneExecOptions(this.options);if(!Ce.silent&&Ce.outStream){Ce.outStream.write(this._getCommandString(Ce)+rt.EOL)}const ze=new ExecState(Ce,this.toolPath);ze.on("debug",(ke=>{this._debug(ke)}));if(this.options.cwd&&!(yield ht.exists(this.options.cwd))){return Ae(new Error(`The cwd: ${this.options.cwd} does not exist!`))}const qe=this._getSpawnFileName();const Ve=nt.spawn(qe,this._getSpawnArgs(Ce),this._getSpawnOptions(this.options,qe));let tt="";if(Ve.stdout){Ve.stdout.on("data",(ke=>{if(this.options.listeners&&this.options.listeners.stdout){this.options.listeners.stdout(ke)}if(!Ce.silent&&Ce.outStream){Ce.outStream.write(ke)}tt=this._processLineBuffer(ke,tt,(ke=>{if(this.options.listeners&&this.options.listeners.stdline){this.options.listeners.stdline(ke)}}))}))}let it="";if(Ve.stderr){Ve.stderr.on("data",(ke=>{ze.processStderr=true;if(this.options.listeners&&this.options.listeners.stderr){this.options.listeners.stderr(ke)}if(!Ce.silent&&Ce.errStream&&Ce.outStream){const Ae=Ce.failOnStdErr?Ce.errStream:Ce.outStream;Ae.write(ke)}it=this._processLineBuffer(ke,it,(ke=>{if(this.options.listeners&&this.options.listeners.errline){this.options.listeners.errline(ke)}}))}))}Ve.on("error",(ke=>{ze.processError=ke.message;ze.processExited=true;ze.processClosed=true;ze.CheckComplete()}));Ve.on("exit",(ke=>{ze.processExitCode=ke;ze.processExited=true;this._debug(`Exit code ${ke} received from tool '${this.toolPath}'`);ze.CheckComplete()}));Ve.on("close",(ke=>{ze.processExitCode=ke;ze.processExited=true;ze.processClosed=true;this._debug(`STDIO streams have closed for tool '${this.toolPath}'`);ze.CheckComplete()}));ze.on("done",((Ce,ze)=>{if(tt.length>0){this.emit("stdline",tt)}if(it.length>0){this.emit("errline",it)}Ve.removeAllListeners();if(Ce){Ae(Ce)}else{ke(ze)}}));if(this.options.input){if(!Ve.stdin){throw new Error("child process missing stdin")}Ve.stdin.end(this.options.input)}}))))}))}}Ae.ToolRunner=ToolRunner;function argStringToArray(ke){const Ae=[];let Ce=false;let ze=false;let qe="";function append(ke){if(ze&&ke!=='"'){qe+="\\"}qe+=ke;ze=false}for(let Ve=0;Ve0){Ae.push(qe);qe=""}continue}append(tt)}if(qe.length>0){Ae.push(qe.trim())}return Ae}Ae.argStringToArray=argStringToArray;class ExecState extends it.EventEmitter{constructor(ke,Ae){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(!Ae){throw new Error("toolPath must not be empty")}this.options=ke;this.toolPath=Ae;if(ke.delay){this.delay=ke.delay}}CheckComplete(){if(this.done){return}if(this.processClosed){this._setResult()}else if(this.processExited){this.timeout=ft.setTimeout(ExecState.HandleTimeout,this.delay,this)}}_debug(ke){this.emit("debug",ke)}_setResult(){let ke;if(this.processExited){if(this.processError){ke=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){ke=new Error(`The process '${this.toolPath}' failed with exit code ${this.processExitCode}`)}else if(this.processStderr&&this.options.failOnStdErr){ke=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",ke,this.processExitCode)}static HandleTimeout(ke){if(ke.done){return}if(!ke.processClosed&&ke.processExited){const Ae=`The STDIO streams did not close within ${ke.delay/1e3} seconds of the exit event from process '${ke.toolPath}'. This may indicate a child process inherited the STDIO streams and has not yet exited.`;ke._debug(Ae)}ke._setResult()}}},3702:(ke,Ae)=>{"use strict";Object.defineProperty(Ae,"__esModule",{value:true});class BasicCredentialHandler{constructor(ke,Ae){this.username=ke;this.password=Ae}prepareRequest(ke){ke.headers["Authorization"]="Basic "+Buffer.from(this.username+":"+this.password).toString("base64")}canHandleAuthentication(ke){return false}handleAuthentication(ke,Ae,Ce){return null}}Ae.BasicCredentialHandler=BasicCredentialHandler;class BearerCredentialHandler{constructor(ke){this.token=ke}prepareRequest(ke){ke.headers["Authorization"]="Bearer "+this.token}canHandleAuthentication(ke){return false}handleAuthentication(ke,Ae,Ce){return null}}Ae.BearerCredentialHandler=BearerCredentialHandler;class PersonalAccessTokenCredentialHandler{constructor(ke){this.token=ke}prepareRequest(ke){ke.headers["Authorization"]="Basic "+Buffer.from("PAT:"+this.token).toString("base64")}canHandleAuthentication(ke){return false}handleAuthentication(ke,Ae,Ce){return null}}Ae.PersonalAccessTokenCredentialHandler=PersonalAccessTokenCredentialHandler},9925:(ke,Ae,Ce)=>{"use strict";Object.defineProperty(Ae,"__esModule",{value:true});const ze=Ce(3685);const qe=Ce(5687);const Ve=Ce(6443);let tt;var rt;(function(ke){ke[ke["OK"]=200]="OK";ke[ke["MultipleChoices"]=300]="MultipleChoices";ke[ke["MovedPermanently"]=301]="MovedPermanently";ke[ke["ResourceMoved"]=302]="ResourceMoved";ke[ke["SeeOther"]=303]="SeeOther";ke[ke["NotModified"]=304]="NotModified";ke[ke["UseProxy"]=305]="UseProxy";ke[ke["SwitchProxy"]=306]="SwitchProxy";ke[ke["TemporaryRedirect"]=307]="TemporaryRedirect";ke[ke["PermanentRedirect"]=308]="PermanentRedirect";ke[ke["BadRequest"]=400]="BadRequest";ke[ke["Unauthorized"]=401]="Unauthorized";ke[ke["PaymentRequired"]=402]="PaymentRequired";ke[ke["Forbidden"]=403]="Forbidden";ke[ke["NotFound"]=404]="NotFound";ke[ke["MethodNotAllowed"]=405]="MethodNotAllowed";ke[ke["NotAcceptable"]=406]="NotAcceptable";ke[ke["ProxyAuthenticationRequired"]=407]="ProxyAuthenticationRequired";ke[ke["RequestTimeout"]=408]="RequestTimeout";ke[ke["Conflict"]=409]="Conflict";ke[ke["Gone"]=410]="Gone";ke[ke["TooManyRequests"]=429]="TooManyRequests";ke[ke["InternalServerError"]=500]="InternalServerError";ke[ke["NotImplemented"]=501]="NotImplemented";ke[ke["BadGateway"]=502]="BadGateway";ke[ke["ServiceUnavailable"]=503]="ServiceUnavailable";ke[ke["GatewayTimeout"]=504]="GatewayTimeout"})(rt=Ae.HttpCodes||(Ae.HttpCodes={}));var it;(function(ke){ke["Accept"]="accept";ke["ContentType"]="content-type"})(it=Ae.Headers||(Ae.Headers={}));var nt;(function(ke){ke["ApplicationJson"]="application/json"})(nt=Ae.MediaTypes||(Ae.MediaTypes={}));function getProxyUrl(ke){let Ae=Ve.getProxyUrl(new URL(ke));return Ae?Ae.href:""}Ae.getProxyUrl=getProxyUrl;const ot=[rt.MovedPermanently,rt.ResourceMoved,rt.SeeOther,rt.TemporaryRedirect,rt.PermanentRedirect];const ct=[rt.BadGateway,rt.ServiceUnavailable,rt.GatewayTimeout];const ht=["OPTIONS","GET","DELETE","HEAD"];const ft=10;const yt=5;class HttpClientError extends Error{constructor(ke,Ae){super(ke);this.name="HttpClientError";this.statusCode=Ae;Object.setPrototypeOf(this,HttpClientError.prototype)}}Ae.HttpClientError=HttpClientError;class HttpClientResponse{constructor(ke){this.message=ke}readBody(){return new Promise((async(ke,Ae)=>{let Ce=Buffer.alloc(0);this.message.on("data",(ke=>{Ce=Buffer.concat([Ce,ke])}));this.message.on("end",(()=>{ke(Ce.toString())}))}))}}Ae.HttpClientResponse=HttpClientResponse;function isHttps(ke){let Ae=new URL(ke);return Ae.protocol==="https:"}Ae.isHttps=isHttps;class HttpClient{constructor(ke,Ae,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=ke;this.handlers=Ae||[];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(ke,Ae){return this.request("OPTIONS",ke,null,Ae||{})}get(ke,Ae){return this.request("GET",ke,null,Ae||{})}del(ke,Ae){return this.request("DELETE",ke,null,Ae||{})}post(ke,Ae,Ce){return this.request("POST",ke,Ae,Ce||{})}patch(ke,Ae,Ce){return this.request("PATCH",ke,Ae,Ce||{})}put(ke,Ae,Ce){return this.request("PUT",ke,Ae,Ce||{})}head(ke,Ae){return this.request("HEAD",ke,null,Ae||{})}sendStream(ke,Ae,Ce,ze){return this.request(ke,Ae,Ce,ze)}async getJson(ke,Ae={}){Ae[it.Accept]=this._getExistingOrDefaultHeader(Ae,it.Accept,nt.ApplicationJson);let Ce=await this.get(ke,Ae);return this._processResponse(Ce,this.requestOptions)}async postJson(ke,Ae,Ce={}){let ze=JSON.stringify(Ae,null,2);Ce[it.Accept]=this._getExistingOrDefaultHeader(Ce,it.Accept,nt.ApplicationJson);Ce[it.ContentType]=this._getExistingOrDefaultHeader(Ce,it.ContentType,nt.ApplicationJson);let qe=await this.post(ke,ze,Ce);return this._processResponse(qe,this.requestOptions)}async putJson(ke,Ae,Ce={}){let ze=JSON.stringify(Ae,null,2);Ce[it.Accept]=this._getExistingOrDefaultHeader(Ce,it.Accept,nt.ApplicationJson);Ce[it.ContentType]=this._getExistingOrDefaultHeader(Ce,it.ContentType,nt.ApplicationJson);let qe=await this.put(ke,ze,Ce);return this._processResponse(qe,this.requestOptions)}async patchJson(ke,Ae,Ce={}){let ze=JSON.stringify(Ae,null,2);Ce[it.Accept]=this._getExistingOrDefaultHeader(Ce,it.Accept,nt.ApplicationJson);Ce[it.ContentType]=this._getExistingOrDefaultHeader(Ce,it.ContentType,nt.ApplicationJson);let qe=await this.patch(ke,ze,Ce);return this._processResponse(qe,this.requestOptions)}async request(ke,Ae,Ce,ze){if(this._disposed){throw new Error("Client has already been disposed.")}let qe=new URL(Ae);let Ve=this._prepareRequest(ke,qe,ze);let tt=this._allowRetries&&ht.indexOf(ke)!=-1?this._maxRetries+1:1;let it=0;let nt;while(it0){const tt=nt.message.headers["location"];if(!tt){break}let rt=new URL(tt);if(qe.protocol=="https:"&&qe.protocol!=rt.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.")}await nt.readBody();if(rt.hostname!==qe.hostname){for(let ke in ze){if(ke.toLowerCase()==="authorization"){delete ze[ke]}}}Ve=this._prepareRequest(ke,rt,ze);nt=await this.requestRaw(Ve,Ce);Ae--}if(ct.indexOf(nt.message.statusCode)==-1){return nt}it+=1;if(it{let callbackForResult=function(ke,Ae){if(ke){ze(ke)}Ce(Ae)};this.requestRawWithCallback(ke,Ae,callbackForResult)}))}requestRawWithCallback(ke,Ae,Ce){let ze;if(typeof Ae==="string"){ke.options.headers["Content-Length"]=Buffer.byteLength(Ae,"utf8")}let qe=false;let handleResult=(ke,Ae)=>{if(!qe){qe=true;Ce(ke,Ae)}};let Ve=ke.httpModule.request(ke.options,(ke=>{let Ae=new HttpClientResponse(ke);handleResult(null,Ae)}));Ve.on("socket",(ke=>{ze=ke}));Ve.setTimeout(this._socketTimeout||3*6e4,(()=>{if(ze){ze.end()}handleResult(new Error("Request timeout: "+ke.options.path),null)}));Ve.on("error",(function(ke){handleResult(ke,null)}));if(Ae&&typeof Ae==="string"){Ve.write(Ae,"utf8")}if(Ae&&typeof Ae!=="string"){Ae.on("close",(function(){Ve.end()}));Ae.pipe(Ve)}else{Ve.end()}}getAgent(ke){let Ae=new URL(ke);return this._getAgent(Ae)}_prepareRequest(ke,Ae,Ce){const Ve={};Ve.parsedUrl=Ae;const tt=Ve.parsedUrl.protocol==="https:";Ve.httpModule=tt?qe:ze;const rt=tt?443:80;Ve.options={};Ve.options.host=Ve.parsedUrl.hostname;Ve.options.port=Ve.parsedUrl.port?parseInt(Ve.parsedUrl.port):rt;Ve.options.path=(Ve.parsedUrl.pathname||"")+(Ve.parsedUrl.search||"");Ve.options.method=ke;Ve.options.headers=this._mergeHeaders(Ce);if(this.userAgent!=null){Ve.options.headers["user-agent"]=this.userAgent}Ve.options.agent=this._getAgent(Ve.parsedUrl);if(this.handlers){this.handlers.forEach((ke=>{ke.prepareRequest(Ve.options)}))}return Ve}_mergeHeaders(ke){const lowercaseKeys=ke=>Object.keys(ke).reduce(((Ae,Ce)=>(Ae[Ce.toLowerCase()]=ke[Ce],Ae)),{});if(this.requestOptions&&this.requestOptions.headers){return Object.assign({},lowercaseKeys(this.requestOptions.headers),lowercaseKeys(ke))}return lowercaseKeys(ke||{})}_getExistingOrDefaultHeader(ke,Ae,Ce){const lowercaseKeys=ke=>Object.keys(ke).reduce(((Ae,Ce)=>(Ae[Ce.toLowerCase()]=ke[Ce],Ae)),{});let ze;if(this.requestOptions&&this.requestOptions.headers){ze=lowercaseKeys(this.requestOptions.headers)[Ae]}return ke[Ae]||ze||Ce}_getAgent(ke){let Ae;let rt=Ve.getProxyUrl(ke);let it=rt&&rt.hostname;if(this._keepAlive&&it){Ae=this._proxyAgent}if(this._keepAlive&&!it){Ae=this._agent}if(!!Ae){return Ae}const nt=ke.protocol==="https:";let ot=100;if(!!this.requestOptions){ot=this.requestOptions.maxSockets||ze.globalAgent.maxSockets}if(it){if(!tt){tt=Ce(4294)}const ke={maxSockets:ot,keepAlive:this._keepAlive,proxy:{...(rt.username||rt.password)&&{proxyAuth:`${rt.username}:${rt.password}`},host:rt.hostname,port:rt.port}};let ze;const qe=rt.protocol==="https:";if(nt){ze=qe?tt.httpsOverHttps:tt.httpsOverHttp}else{ze=qe?tt.httpOverHttps:tt.httpOverHttp}Ae=ze(ke);this._proxyAgent=Ae}if(this._keepAlive&&!Ae){const ke={keepAlive:this._keepAlive,maxSockets:ot};Ae=nt?new qe.Agent(ke):new ze.Agent(ke);this._agent=Ae}if(!Ae){Ae=nt?qe.globalAgent:ze.globalAgent}if(nt&&this._ignoreSslError){Ae.options=Object.assign(Ae.options||{},{rejectUnauthorized:false})}return Ae}_performExponentialBackoff(ke){ke=Math.min(ft,ke);const Ae=yt*Math.pow(2,ke);return new Promise((ke=>setTimeout((()=>ke()),Ae)))}static dateTimeDeserializer(ke,Ae){if(typeof Ae==="string"){let ke=new Date(Ae);if(!isNaN(ke.valueOf())){return ke}}return Ae}async _processResponse(ke,Ae){return new Promise((async(Ce,ze)=>{const qe=ke.message.statusCode;const Ve={statusCode:qe,result:null,headers:{}};if(qe==rt.NotFound){Ce(Ve)}let tt;let it;try{it=await ke.readBody();if(it&&it.length>0){if(Ae&&Ae.deserializeDates){tt=JSON.parse(it,HttpClient.dateTimeDeserializer)}else{tt=JSON.parse(it)}Ve.result=tt}Ve.headers=ke.message.headers}catch(ke){}if(qe>299){let ke;if(tt&&tt.message){ke=tt.message}else if(it&&it.length>0){ke=it}else{ke="Failed request: ("+qe+")"}let Ae=new HttpClientError(ke,qe);Ae.result=Ve.result;ze(Ae)}else{Ce(Ve)}}))}}Ae.HttpClient=HttpClient},6443:(ke,Ae)=>{"use strict";Object.defineProperty(Ae,"__esModule",{value:true});function getProxyUrl(ke){let Ae=ke.protocol==="https:";let Ce;if(checkBypass(ke)){return Ce}let ze;if(Ae){ze=process.env["https_proxy"]||process.env["HTTPS_PROXY"]}else{ze=process.env["http_proxy"]||process.env["HTTP_PROXY"]}if(ze){Ce=new URL(ze)}return Ce}Ae.getProxyUrl=getProxyUrl;function checkBypass(ke){if(!ke.hostname){return false}let Ae=process.env["no_proxy"]||process.env["NO_PROXY"]||"";if(!Ae){return false}let Ce;if(ke.port){Ce=Number(ke.port)}else if(ke.protocol==="http:"){Ce=80}else if(ke.protocol==="https:"){Ce=443}let ze=[ke.hostname.toUpperCase()];if(typeof Ce==="number"){ze.push(`${ze[0]}:${Ce}`)}for(let ke of Ae.split(",").map((ke=>ke.trim().toUpperCase())).filter((ke=>ke))){if(ze.some((Ae=>Ae===ke))){return true}}return false}Ae.checkBypass=checkBypass},1962:function(ke,Ae,Ce){"use strict";var ze=this&&this.__awaiter||function(ke,Ae,Ce,ze){function adopt(ke){return ke instanceof Ce?ke:new Ce((function(Ae){Ae(ke)}))}return new(Ce||(Ce=Promise))((function(Ce,qe){function fulfilled(ke){try{step(ze.next(ke))}catch(ke){qe(ke)}}function rejected(ke){try{step(ze["throw"](ke))}catch(ke){qe(ke)}}function step(ke){ke.done?Ce(ke.value):adopt(ke.value).then(fulfilled,rejected)}step((ze=ze.apply(ke,Ae||[])).next())}))};var qe;Object.defineProperty(Ae,"__esModule",{value:true});const Ve=Ce(9491);const tt=Ce(7147);const rt=Ce(1017);qe=tt.promises,Ae.chmod=qe.chmod,Ae.copyFile=qe.copyFile,Ae.lstat=qe.lstat,Ae.mkdir=qe.mkdir,Ae.readdir=qe.readdir,Ae.readlink=qe.readlink,Ae.rename=qe.rename,Ae.rmdir=qe.rmdir,Ae.stat=qe.stat,Ae.symlink=qe.symlink,Ae.unlink=qe.unlink;Ae.IS_WINDOWS=process.platform==="win32";function exists(ke){return ze(this,void 0,void 0,(function*(){try{yield Ae.stat(ke)}catch(ke){if(ke.code==="ENOENT"){return false}throw ke}return true}))}Ae.exists=exists;function isDirectory(ke,Ce=false){return ze(this,void 0,void 0,(function*(){const ze=Ce?yield Ae.stat(ke):yield Ae.lstat(ke);return ze.isDirectory()}))}Ae.isDirectory=isDirectory;function isRooted(ke){ke=normalizeSeparators(ke);if(!ke){throw new Error('isRooted() parameter "p" cannot be empty')}if(Ae.IS_WINDOWS){return ke.startsWith("\\")||/^[A-Z]:/i.test(ke)}return ke.startsWith("/")}Ae.isRooted=isRooted;function mkdirP(ke,Ce=1e3,qe=1){return ze(this,void 0,void 0,(function*(){Ve.ok(ke,"a path argument must be provided");ke=rt.resolve(ke);if(qe>=Ce)return Ae.mkdir(ke);try{yield Ae.mkdir(ke);return}catch(ze){switch(ze.code){case"ENOENT":{yield mkdirP(rt.dirname(ke),Ce,qe+1);yield Ae.mkdir(ke);return}default:{let Ce;try{Ce=yield Ae.stat(ke)}catch(ke){throw ze}if(!Ce.isDirectory())throw ze}}}}))}Ae.mkdirP=mkdirP;function tryGetExecutablePath(ke,Ce){return ze(this,void 0,void 0,(function*(){let ze=undefined;try{ze=yield Ae.stat(ke)}catch(Ae){if(Ae.code!=="ENOENT"){console.log(`Unexpected error attempting to determine if executable file exists '${ke}': ${Ae}`)}}if(ze&&ze.isFile()){if(Ae.IS_WINDOWS){const Ae=rt.extname(ke).toUpperCase();if(Ce.some((ke=>ke.toUpperCase()===Ae))){return ke}}else{if(isUnixExecutable(ze)){return ke}}}const qe=ke;for(const Ve of Ce){ke=qe+Ve;ze=undefined;try{ze=yield Ae.stat(ke)}catch(Ae){if(Ae.code!=="ENOENT"){console.log(`Unexpected error attempting to determine if executable file exists '${ke}': ${Ae}`)}}if(ze&&ze.isFile()){if(Ae.IS_WINDOWS){try{const Ce=rt.dirname(ke);const ze=rt.basename(ke).toUpperCase();for(const qe of yield Ae.readdir(Ce)){if(ze===qe.toUpperCase()){ke=rt.join(Ce,qe);break}}}catch(Ae){console.log(`Unexpected error attempting to determine the actual case of the file '${ke}': ${Ae}`)}return ke}else{if(isUnixExecutable(ze)){return ke}}}}return""}))}Ae.tryGetExecutablePath=tryGetExecutablePath;function normalizeSeparators(ke){ke=ke||"";if(Ae.IS_WINDOWS){ke=ke.replace(/\//g,"\\");return ke.replace(/\\\\+/g,"\\")}return ke.replace(/\/\/+/g,"/")}function isUnixExecutable(ke){return(ke.mode&1)>0||(ke.mode&8)>0&&ke.gid===process.getgid()||(ke.mode&64)>0&&ke.uid===process.getuid()}},7436:function(ke,Ae,Ce){"use strict";var ze=this&&this.__awaiter||function(ke,Ae,Ce,ze){function adopt(ke){return ke instanceof Ce?ke:new Ce((function(Ae){Ae(ke)}))}return new(Ce||(Ce=Promise))((function(Ce,qe){function fulfilled(ke){try{step(ze.next(ke))}catch(ke){qe(ke)}}function rejected(ke){try{step(ze["throw"](ke))}catch(ke){qe(ke)}}function step(ke){ke.done?Ce(ke.value):adopt(ke.value).then(fulfilled,rejected)}step((ze=ze.apply(ke,Ae||[])).next())}))};Object.defineProperty(Ae,"__esModule",{value:true});const qe=Ce(2081);const Ve=Ce(1017);const tt=Ce(3837);const rt=Ce(1962);const it=tt.promisify(qe.exec);function cp(ke,Ae,Ce={}){return ze(this,void 0,void 0,(function*(){const{force:ze,recursive:qe}=readCopyOptions(Ce);const tt=(yield rt.exists(Ae))?yield rt.stat(Ae):null;if(tt&&tt.isFile()&&!ze){return}const it=tt&&tt.isDirectory()?Ve.join(Ae,Ve.basename(ke)):Ae;if(!(yield rt.exists(ke))){throw new Error(`no such file or directory: ${ke}`)}const nt=yield rt.stat(ke);if(nt.isDirectory()){if(!qe){throw new Error(`Failed to copy. ${ke} is a directory, but tried to copy without recursive flag.`)}else{yield cpDirRecursive(ke,it,0,ze)}}else{if(Ve.relative(ke,it)===""){throw new Error(`'${it}' and '${ke}' are the same file`)}yield copyFile(ke,it,ze)}}))}Ae.cp=cp;function mv(ke,Ae,Ce={}){return ze(this,void 0,void 0,(function*(){if(yield rt.exists(Ae)){let ze=true;if(yield rt.isDirectory(Ae)){Ae=Ve.join(Ae,Ve.basename(ke));ze=yield rt.exists(Ae)}if(ze){if(Ce.force==null||Ce.force){yield rmRF(Ae)}else{throw new Error("Destination already exists")}}}yield mkdirP(Ve.dirname(Ae));yield rt.rename(ke,Ae)}))}Ae.mv=mv;function rmRF(ke){return ze(this,void 0,void 0,(function*(){if(rt.IS_WINDOWS){try{if(yield rt.isDirectory(ke,true)){yield it(`rd /s /q "${ke}"`)}else{yield it(`del /f /a "${ke}"`)}}catch(ke){if(ke.code!=="ENOENT")throw ke}try{yield rt.unlink(ke)}catch(ke){if(ke.code!=="ENOENT")throw ke}}else{let Ae=false;try{Ae=yield rt.isDirectory(ke)}catch(ke){if(ke.code!=="ENOENT")throw ke;return}if(Ae){yield it(`rm -rf "${ke}"`)}else{yield rt.unlink(ke)}}}))}Ae.rmRF=rmRF;function mkdirP(ke){return ze(this,void 0,void 0,(function*(){yield rt.mkdirP(ke)}))}Ae.mkdirP=mkdirP;function which(ke,Ae){return ze(this,void 0,void 0,(function*(){if(!ke){throw new Error("parameter 'tool' is required")}if(Ae){const Ae=yield which(ke,false);if(!Ae){if(rt.IS_WINDOWS){throw new Error(`Unable to locate executable file: ${ke}. 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: ${ke}. 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 Ae=[];if(rt.IS_WINDOWS&&process.env.PATHEXT){for(const ke of process.env.PATHEXT.split(Ve.delimiter)){if(ke){Ae.push(ke)}}}if(rt.isRooted(ke)){const Ce=yield rt.tryGetExecutablePath(ke,Ae);if(Ce){return Ce}return""}if(ke.includes("/")||rt.IS_WINDOWS&&ke.includes("\\")){return""}const Ce=[];if(process.env.PATH){for(const ke of process.env.PATH.split(Ve.delimiter)){if(ke){Ce.push(ke)}}}for(const ze of Ce){const Ce=yield rt.tryGetExecutablePath(ze+Ve.sep+ke,Ae);if(Ce){return Ce}}return""}catch(ke){throw new Error(`which failed with message ${ke.message}`)}}))}Ae.which=which;function readCopyOptions(ke){const Ae=ke.force==null?true:ke.force;const Ce=Boolean(ke.recursive);return{force:Ae,recursive:Ce}}function cpDirRecursive(ke,Ae,Ce,qe){return ze(this,void 0,void 0,(function*(){if(Ce>=255)return;Ce++;yield mkdirP(Ae);const ze=yield rt.readdir(ke);for(const Ve of ze){const ze=`${ke}/${Ve}`;const tt=`${Ae}/${Ve}`;const it=yield rt.lstat(ze);if(it.isDirectory()){yield cpDirRecursive(ze,tt,Ce,qe)}else{yield copyFile(ze,tt,qe)}}yield rt.chmod(Ae,(yield rt.stat(ke)).mode)}))}function copyFile(ke,Ae,Ce){return ze(this,void 0,void 0,(function*(){if((yield rt.lstat(ke)).isSymbolicLink()){try{yield rt.lstat(Ae);yield rt.unlink(Ae)}catch(ke){if(ke.code==="EPERM"){yield rt.chmod(Ae,"0666");yield rt.unlink(Ae)}}const Ce=yield rt.readlink(ke);yield rt.symlink(Ce,Ae,rt.IS_WINDOWS?"junction":null)}else if(!(yield rt.exists(Ae))||Ce){yield rt.copyFile(ke,Ae)}}))}},2764:ke=>{"use strict";ke.exports=addressparser;function addressparser(ke){var Ae=new Tokenizer(ke);var Ce=Ae.tokenize();var ze=[];var qe=[];var Ve=[];Ce.forEach((function(ke){if(ke.type==="operator"&&(ke.value===","||ke.value===";")){if(qe.length){ze.push(qe)}qe=[]}else{qe.push(ke)}}));if(qe.length){ze.push(qe)}ze.forEach((function(ke){ke=_handleAddress(ke);if(ke.length){Ve=Ve.concat(ke)}}));return Ve}function _handleAddress(ke){var Ae;var Ce=false;var ze="text";var qe;var Ve=[];var tt={address:[],comment:[],group:[],text:[]};var rt;var it;for(rt=0,it=ke.length;rt=0;rt--){if(tt.text[rt].match(/^[^@\s]+@[^@\s]+$/)){tt.address=tt.text.splice(rt,1);break}}var _regexHandler=function(ke){if(!tt.address.length){tt.address=[ke.trim()];return" "}else{return ke}};if(!tt.address.length){for(rt=tt.text.length-1;rt>=0;rt--){tt.text[rt]=tt.text[rt].replace(/\s*\b[^@\s]+@[^\s]+\b\s*/,_regexHandler).trim();if(tt.address.length){break}}}}if(!tt.text.length&&tt.comment.length){tt.text=tt.comment;tt.comment=[]}if(tt.address.length>1){tt.text=tt.text.concat(tt.address.splice(1))}tt.text=tt.text.join(" ");tt.address=tt.address.join(" ");if(!tt.address&&Ce){return[]}else{qe={address:tt.address||tt.text||"",name:tt.text||tt.address||""};if(qe.address===qe.name){if((qe.address||"").match(/@/)){qe.name=""}else{qe.address=""}}Ve.push(qe)}}return Ve}function Tokenizer(ke){this.str=(ke||"").toString();this.operatorCurrent="";this.operatorExpecting="";this.node=null;this.escaped=false;this.list=[]}Tokenizer.prototype.operators={'"':'"',"(":")","<":">",",":"",":":";",";":""};Tokenizer.prototype.tokenize=function(){var ke,Ae=[];for(var Ce=0,ze=this.str.length;Ce{"use strict";const ze=Ae;ze.bignum=Ce(6641);ze.define=Ce(5245).define;ze.base=Ce(8096);ze.constants=Ce(3371);ze.decoders=Ce(4952);ze.encoders=Ce(9083)},5245:(ke,Ae,Ce)=>{"use strict";const ze=Ce(9083);const qe=Ce(4952);const Ve=Ce(4124);const tt=Ae;tt.define=function define(ke,Ae){return new Entity(ke,Ae)};function Entity(ke,Ae){this.name=ke;this.body=Ae;this.decoders={};this.encoders={}}Entity.prototype._createNamed=function createNamed(ke){const Ae=this.name;function Generated(ke){this._initNamed(ke,Ae)}Ve(Generated,ke);Generated.prototype._initNamed=function _initNamed(Ae,Ce){ke.call(this,Ae,Ce)};return new Generated(this)};Entity.prototype._getDecoder=function _getDecoder(ke){ke=ke||"der";if(!this.decoders.hasOwnProperty(ke))this.decoders[ke]=this._createNamed(qe[ke]);return this.decoders[ke]};Entity.prototype.decode=function decode(ke,Ae,Ce){return this._getDecoder(Ae).decode(ke,Ce)};Entity.prototype._getEncoder=function _getEncoder(ke){ke=ke||"der";if(!this.encoders.hasOwnProperty(ke))this.encoders[ke]=this._createNamed(ze[ke]);return this.encoders[ke]};Entity.prototype.encode=function encode(ke,Ae,Ce){return this._getEncoder(Ae).encode(ke,Ce)}},5298:(ke,Ae,Ce)=>{"use strict";const ze=Ce(4124);const qe=Ce(3744).b;const Ve=Ce(5118).Buffer;function DecoderBuffer(ke,Ae){qe.call(this,Ae);if(!Ve.isBuffer(ke)){this.error("Input not Buffer");return}this.base=ke;this.offset=0;this.length=ke.length}ze(DecoderBuffer,qe);Ae.C=DecoderBuffer;DecoderBuffer.isDecoderBuffer=function isDecoderBuffer(ke){if(ke instanceof DecoderBuffer){return true}const Ae=typeof ke==="object"&&Ve.isBuffer(ke.base)&&ke.constructor.name==="DecoderBuffer"&&typeof ke.offset==="number"&&typeof ke.length==="number"&&typeof ke.save==="function"&&typeof ke.restore==="function"&&typeof ke.isEmpty==="function"&&typeof ke.readUInt8==="function"&&typeof ke.skip==="function"&&typeof ke.raw==="function";return Ae};DecoderBuffer.prototype.save=function save(){return{offset:this.offset,reporter:qe.prototype.save.call(this)}};DecoderBuffer.prototype.restore=function restore(ke){const Ae=new DecoderBuffer(this.base);Ae.offset=ke.offset;Ae.length=this.offset;this.offset=ke.offset;qe.prototype.restore.call(this,ke.reporter);return Ae};DecoderBuffer.prototype.isEmpty=function isEmpty(){return this.offset===this.length};DecoderBuffer.prototype.readUInt8=function readUInt8(ke){if(this.offset+1<=this.length)return this.base.readUInt8(this.offset++,true);else return this.error(ke||"DecoderBuffer overrun")};DecoderBuffer.prototype.skip=function skip(ke,Ae){if(!(this.offset+ke<=this.length))return this.error(Ae||"DecoderBuffer overrun");const Ce=new DecoderBuffer(this.base);Ce._reporterState=this._reporterState;Ce.offset=this.offset;Ce.length=this.offset+ke;this.offset+=ke;return Ce};DecoderBuffer.prototype.raw=function raw(ke){return this.base.slice(ke?ke.offset:this.offset,this.length)};function EncoderBuffer(ke,Ae){if(Array.isArray(ke)){this.length=0;this.value=ke.map((function(ke){if(!EncoderBuffer.isEncoderBuffer(ke))ke=new EncoderBuffer(ke,Ae);this.length+=ke.length;return ke}),this)}else if(typeof ke==="number"){if(!(0<=ke&&ke<=255))return Ae.error("non-byte EncoderBuffer value");this.value=ke;this.length=1}else if(typeof ke==="string"){this.value=ke;this.length=Ve.byteLength(ke)}else if(Ve.isBuffer(ke)){this.value=ke;this.length=ke.length}else{return Ae.error("Unsupported type: "+typeof ke)}}Ae.R=EncoderBuffer;EncoderBuffer.isEncoderBuffer=function isEncoderBuffer(ke){if(ke instanceof EncoderBuffer){return true}const Ae=typeof ke==="object"&&ke.constructor.name==="EncoderBuffer"&&typeof ke.length==="number"&&typeof ke.join==="function";return Ae};EncoderBuffer.prototype.join=function join(ke,Ae){if(!ke)ke=Ve.alloc(this.length);if(!Ae)Ae=0;if(this.length===0)return ke;if(Array.isArray(this.value)){this.value.forEach((function(Ce){Ce.join(ke,Ae);Ae+=Ce.length}))}else{if(typeof this.value==="number")ke[Ae]=this.value;else if(typeof this.value==="string")ke.write(this.value,Ae);else if(Ve.isBuffer(this.value))this.value.copy(ke,Ae);Ae+=this.length}return ke}},8096:(ke,Ae,Ce)=>{"use strict";const ze=Ae;ze.Reporter=Ce(3744).b;ze.DecoderBuffer=Ce(5298).C;ze.EncoderBuffer=Ce(5298).R;ze.Node=Ce(842)},842:(ke,Ae,Ce)=>{"use strict";const ze=Ce(3744).b;const qe=Ce(5298).R;const Ve=Ce(5298).C;const tt=Ce(910);const rt=["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 it=["key","obj","use","optional","explicit","implicit","def","choice","any","contains"].concat(rt);const nt=["_peekTag","_decodeTag","_use","_decodeStr","_decodeObjid","_decodeTime","_decodeNull","_decodeInt","_decodeBool","_decodeList","_encodeComposite","_encodeStr","_encodeObjid","_encodeTime","_encodeNull","_encodeInt","_encodeBool"];function Node(ke,Ae,Ce){const ze={};this._baseState=ze;ze.name=Ce;ze.enc=ke;ze.parent=Ae||null;ze.children=null;ze.tag=null;ze.args=null;ze.reverseArgs=null;ze.choice=null;ze.optional=false;ze.any=false;ze.obj=false;ze.use=null;ze.useDecoder=null;ze.key=null;ze["default"]=null;ze.explicit=null;ze.implicit=null;ze.contains=null;if(!ze.parent){ze.children=[];this._wrap()}}ke.exports=Node;const ot=["enc","parent","children","tag","args","reverseArgs","choice","optional","any","obj","use","alteredUse","key","default","explicit","implicit","contains"];Node.prototype.clone=function clone(){const ke=this._baseState;const Ae={};ot.forEach((function(Ce){Ae[Ce]=ke[Ce]}));const Ce=new this.constructor(Ae.parent);Ce._baseState=Ae;return Ce};Node.prototype._wrap=function wrap(){const ke=this._baseState;it.forEach((function(Ae){this[Ae]=function _wrappedMethod(){const Ce=new this.constructor(this);ke.children.push(Ce);return Ce[Ae].apply(Ce,arguments)}}),this)};Node.prototype._init=function init(ke){const Ae=this._baseState;tt(Ae.parent===null);ke.call(this);Ae.children=Ae.children.filter((function(ke){return ke._baseState.parent===this}),this);tt.equal(Ae.children.length,1,"Root node can have only one child")};Node.prototype._useArgs=function useArgs(ke){const Ae=this._baseState;const Ce=ke.filter((function(ke){return ke instanceof this.constructor}),this);ke=ke.filter((function(ke){return!(ke instanceof this.constructor)}),this);if(Ce.length!==0){tt(Ae.children===null);Ae.children=Ce;Ce.forEach((function(ke){ke._baseState.parent=this}),this)}if(ke.length!==0){tt(Ae.args===null);Ae.args=ke;Ae.reverseArgs=ke.map((function(ke){if(typeof ke!=="object"||ke.constructor!==Object)return ke;const Ae={};Object.keys(ke).forEach((function(Ce){if(Ce==(Ce|0))Ce|=0;const ze=ke[Ce];Ae[ze]=Ce}));return Ae}))}};nt.forEach((function(ke){Node.prototype[ke]=function _overrided(){const Ae=this._baseState;throw new Error(ke+" not implemented for encoding: "+Ae.enc)}}));rt.forEach((function(ke){Node.prototype[ke]=function _tagMethod(){const Ae=this._baseState;const Ce=Array.prototype.slice.call(arguments);tt(Ae.tag===null);Ae.tag=ke;this._useArgs(Ce);return this}}));Node.prototype.use=function use(ke){tt(ke);const Ae=this._baseState;tt(Ae.use===null);Ae.use=ke;return this};Node.prototype.optional=function optional(){const ke=this._baseState;ke.optional=true;return this};Node.prototype.def=function def(ke){const Ae=this._baseState;tt(Ae["default"]===null);Ae["default"]=ke;Ae.optional=true;return this};Node.prototype.explicit=function explicit(ke){const Ae=this._baseState;tt(Ae.explicit===null&&Ae.implicit===null);Ae.explicit=ke;return this};Node.prototype.implicit=function implicit(ke){const Ae=this._baseState;tt(Ae.explicit===null&&Ae.implicit===null);Ae.implicit=ke;return this};Node.prototype.obj=function obj(){const ke=this._baseState;const Ae=Array.prototype.slice.call(arguments);ke.obj=true;if(Ae.length!==0)this._useArgs(Ae);return this};Node.prototype.key=function key(ke){const Ae=this._baseState;tt(Ae.key===null);Ae.key=ke;return this};Node.prototype.any=function any(){const ke=this._baseState;ke.any=true;return this};Node.prototype.choice=function choice(ke){const Ae=this._baseState;tt(Ae.choice===null);Ae.choice=ke;this._useArgs(Object.keys(ke).map((function(Ae){return ke[Ae]})));return this};Node.prototype.contains=function contains(ke){const Ae=this._baseState;tt(Ae.use===null);Ae.contains=ke;return this};Node.prototype._decode=function decode(ke,Ae){const Ce=this._baseState;if(Ce.parent===null)return ke.wrapResult(Ce.children[0]._decode(ke,Ae));let ze=Ce["default"];let qe=true;let tt=null;if(Ce.key!==null)tt=ke.enterKey(Ce.key);if(Ce.optional){let ze=null;if(Ce.explicit!==null)ze=Ce.explicit;else if(Ce.implicit!==null)ze=Ce.implicit;else if(Ce.tag!==null)ze=Ce.tag;if(ze===null&&!Ce.any){const ze=ke.save();try{if(Ce.choice===null)this._decodeGeneric(Ce.tag,ke,Ae);else this._decodeChoice(ke,Ae);qe=true}catch(ke){qe=false}ke.restore(ze)}else{qe=this._peekTag(ke,ze,Ce.any);if(ke.isError(qe))return qe}}let rt;if(Ce.obj&&qe)rt=ke.enterObject();if(qe){if(Ce.explicit!==null){const Ae=this._decodeTag(ke,Ce.explicit);if(ke.isError(Ae))return Ae;ke=Ae}const qe=ke.offset;if(Ce.use===null&&Ce.choice===null){let Ae;if(Ce.any)Ae=ke.save();const qe=this._decodeTag(ke,Ce.implicit!==null?Ce.implicit:Ce.tag,Ce.any);if(ke.isError(qe))return qe;if(Ce.any)ze=ke.raw(Ae);else ke=qe}if(Ae&&Ae.track&&Ce.tag!==null)Ae.track(ke.path(),qe,ke.length,"tagged");if(Ae&&Ae.track&&Ce.tag!==null)Ae.track(ke.path(),ke.offset,ke.length,"content");if(Ce.any){}else if(Ce.choice===null){ze=this._decodeGeneric(Ce.tag,ke,Ae)}else{ze=this._decodeChoice(ke,Ae)}if(ke.isError(ze))return ze;if(!Ce.any&&Ce.choice===null&&Ce.children!==null){Ce.children.forEach((function decodeChildren(Ce){Ce._decode(ke,Ae)}))}if(Ce.contains&&(Ce.tag==="octstr"||Ce.tag==="bitstr")){const qe=new Ve(ze);ze=this._getUse(Ce.contains,ke._reporterState.obj)._decode(qe,Ae)}}if(Ce.obj&&qe)ze=ke.leaveObject(rt);if(Ce.key!==null&&(ze!==null||qe===true))ke.leaveKey(tt,Ce.key,ze);else if(tt!==null)ke.exitKey(tt);return ze};Node.prototype._decodeGeneric=function decodeGeneric(ke,Ae,Ce){const ze=this._baseState;if(ke==="seq"||ke==="set")return null;if(ke==="seqof"||ke==="setof")return this._decodeList(Ae,ke,ze.args[0],Ce);else if(/str$/.test(ke))return this._decodeStr(Ae,ke,Ce);else if(ke==="objid"&&ze.args)return this._decodeObjid(Ae,ze.args[0],ze.args[1],Ce);else if(ke==="objid")return this._decodeObjid(Ae,null,null,Ce);else if(ke==="gentime"||ke==="utctime")return this._decodeTime(Ae,ke,Ce);else if(ke==="null_")return this._decodeNull(Ae,Ce);else if(ke==="bool")return this._decodeBool(Ae,Ce);else if(ke==="objDesc")return this._decodeStr(Ae,ke,Ce);else if(ke==="int"||ke==="enum")return this._decodeInt(Ae,ze.args&&ze.args[0],Ce);if(ze.use!==null){return this._getUse(ze.use,Ae._reporterState.obj)._decode(Ae,Ce)}else{return Ae.error("unknown tag: "+ke)}};Node.prototype._getUse=function _getUse(ke,Ae){const Ce=this._baseState;Ce.useDecoder=this._use(ke,Ae);tt(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(ke,Ae){const Ce=this._baseState;let ze=null;let qe=false;Object.keys(Ce.choice).some((function(Ve){const tt=ke.save();const rt=Ce.choice[Ve];try{const Ce=rt._decode(ke,Ae);if(ke.isError(Ce))return false;ze={type:Ve,value:Ce};qe=true}catch(Ae){ke.restore(tt);return false}return true}),this);if(!qe)return ke.error("Choice not matched");return ze};Node.prototype._createEncoderBuffer=function createEncoderBuffer(ke){return new qe(ke,this.reporter)};Node.prototype._encode=function encode(ke,Ae,Ce){const ze=this._baseState;if(ze["default"]!==null&&ze["default"]===ke)return;const qe=this._encodeValue(ke,Ae,Ce);if(qe===undefined)return;if(this._skipDefault(qe,Ae,Ce))return;return qe};Node.prototype._encodeValue=function encode(ke,Ae,Ce){const qe=this._baseState;if(qe.parent===null)return qe.children[0]._encode(ke,Ae||new ze);let Ve=null;this.reporter=Ae;if(qe.optional&&ke===undefined){if(qe["default"]!==null)ke=qe["default"];else return}let tt=null;let rt=false;if(qe.any){Ve=this._createEncoderBuffer(ke)}else if(qe.choice){Ve=this._encodeChoice(ke,Ae)}else if(qe.contains){tt=this._getUse(qe.contains,Ce)._encode(ke,Ae);rt=true}else if(qe.children){tt=qe.children.map((function(Ce){if(Ce._baseState.tag==="null_")return Ce._encode(null,Ae,ke);if(Ce._baseState.key===null)return Ae.error("Child should have a key");const ze=Ae.enterKey(Ce._baseState.key);if(typeof ke!=="object")return Ae.error("Child expected, but input is not object");const qe=Ce._encode(ke[Ce._baseState.key],Ae,ke);Ae.leaveKey(ze);return qe}),this).filter((function(ke){return ke}));tt=this._createEncoderBuffer(tt)}else{if(qe.tag==="seqof"||qe.tag==="setof"){if(!(qe.args&&qe.args.length===1))return Ae.error("Too many args for : "+qe.tag);if(!Array.isArray(ke))return Ae.error("seqof/setof, but data is not Array");const Ce=this.clone();Ce._baseState.implicit=null;tt=this._createEncoderBuffer(ke.map((function(Ce){const ze=this._baseState;return this._getUse(ze.args[0],ke)._encode(Ce,Ae)}),Ce))}else if(qe.use!==null){Ve=this._getUse(qe.use,Ce)._encode(ke,Ae)}else{tt=this._encodePrimitive(qe.tag,ke);rt=true}}if(!qe.any&&qe.choice===null){const ke=qe.implicit!==null?qe.implicit:qe.tag;const Ce=qe.implicit===null?"universal":"context";if(ke===null){if(qe.use===null)Ae.error("Tag could be omitted only for .use()")}else{if(qe.use===null)Ve=this._encodeComposite(ke,rt,Ce,tt)}}if(qe.explicit!==null)Ve=this._encodeComposite(qe.explicit,false,"context",Ve);return Ve};Node.prototype._encodeChoice=function encodeChoice(ke,Ae){const Ce=this._baseState;const ze=Ce.choice[ke.type];if(!ze){tt(false,ke.type+" not found in "+JSON.stringify(Object.keys(Ce.choice)))}return ze._encode(ke.value,Ae)};Node.prototype._encodePrimitive=function encodePrimitive(ke,Ae){const Ce=this._baseState;if(/str$/.test(ke))return this._encodeStr(Ae,ke);else if(ke==="objid"&&Ce.args)return this._encodeObjid(Ae,Ce.reverseArgs[0],Ce.args[1]);else if(ke==="objid")return this._encodeObjid(Ae,null,null);else if(ke==="gentime"||ke==="utctime")return this._encodeTime(Ae,ke);else if(ke==="null_")return this._encodeNull();else if(ke==="int"||ke==="enum")return this._encodeInt(Ae,Ce.args&&Ce.reverseArgs[0]);else if(ke==="bool")return this._encodeBool(Ae);else if(ke==="objDesc")return this._encodeStr(Ae,ke);else throw new Error("Unsupported tag: "+ke)};Node.prototype._isNumstr=function isNumstr(ke){return/^[0-9 ]*$/.test(ke)};Node.prototype._isPrintstr=function isPrintstr(ke){return/^[A-Za-z0-9 '()+,-./:=?]*$/.test(ke)}},3744:(ke,Ae,Ce)=>{"use strict";const ze=Ce(4124);function Reporter(ke){this._reporterState={obj:null,path:[],options:ke||{},errors:[]}}Ae.b=Reporter;Reporter.prototype.isError=function isError(ke){return ke instanceof ReporterError};Reporter.prototype.save=function save(){const ke=this._reporterState;return{obj:ke.obj,pathLen:ke.path.length}};Reporter.prototype.restore=function restore(ke){const Ae=this._reporterState;Ae.obj=ke.obj;Ae.path=Ae.path.slice(0,ke.pathLen)};Reporter.prototype.enterKey=function enterKey(ke){return this._reporterState.path.push(ke)};Reporter.prototype.exitKey=function exitKey(ke){const Ae=this._reporterState;Ae.path=Ae.path.slice(0,ke-1)};Reporter.prototype.leaveKey=function leaveKey(ke,Ae,Ce){const ze=this._reporterState;this.exitKey(ke);if(ze.obj!==null)ze.obj[Ae]=Ce};Reporter.prototype.path=function path(){return this._reporterState.path.join("/")};Reporter.prototype.enterObject=function enterObject(){const ke=this._reporterState;const Ae=ke.obj;ke.obj={};return Ae};Reporter.prototype.leaveObject=function leaveObject(ke){const Ae=this._reporterState;const Ce=Ae.obj;Ae.obj=ke;return Ce};Reporter.prototype.error=function error(ke){let Ae;const Ce=this._reporterState;const ze=ke instanceof ReporterError;if(ze){Ae=ke}else{Ae=new ReporterError(Ce.path.map((function(ke){return"["+JSON.stringify(ke)+"]"})).join(""),ke.message||ke,ke.stack)}if(!Ce.options.partial)throw Ae;if(!ze)Ce.errors.push(Ae);return Ae};Reporter.prototype.wrapResult=function wrapResult(ke){const Ae=this._reporterState;if(!Ae.options.partial)return ke;return{result:this.isError(ke)?null:ke,errors:Ae.errors}};function ReporterError(ke,Ae){this.path=ke;this.rethrow(Ae)}ze(ReporterError,Error);ReporterError.prototype.rethrow=function rethrow(ke){this.message=ke+" at: "+(this.path||"(shallow)");if(Error.captureStackTrace)Error.captureStackTrace(this,ReporterError);if(!this.stack){try{throw new Error(this.message)}catch(ke){this.stack=ke.stack}}return this}},1188:(ke,Ae)=>{"use strict";function reverse(ke){const Ae={};Object.keys(ke).forEach((function(Ce){if((Ce|0)==Ce)Ce=Ce|0;const ze=ke[Ce];Ae[ze]=Ce}));return Ae}Ae.tagClass={0:"universal",1:"application",2:"context",3:"private"};Ae.tagClassByName=reverse(Ae.tagClass);Ae.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"};Ae.tagByName=reverse(Ae.tag)},3371:(ke,Ae,Ce)=>{"use strict";const ze=Ae;ze._reverse=function reverse(ke){const Ae={};Object.keys(ke).forEach((function(Ce){if((Ce|0)==Ce)Ce=Ce|0;const ze=ke[Ce];Ae[ze]=Ce}));return Ae};ze.der=Ce(1188)},3332:(ke,Ae,Ce)=>{"use strict";const ze=Ce(4124);const qe=Ce(6641);const Ve=Ce(5298).C;const tt=Ce(842);const rt=Ce(1188);function DERDecoder(ke){this.enc="der";this.name=ke.name;this.entity=ke;this.tree=new DERNode;this.tree._init(ke.body)}ke.exports=DERDecoder;DERDecoder.prototype.decode=function decode(ke,Ae){if(!Ve.isDecoderBuffer(ke)){ke=new Ve(ke,Ae)}return this.tree._decode(ke,Ae)};function DERNode(ke){tt.call(this,"der",ke)}ze(DERNode,tt);DERNode.prototype._peekTag=function peekTag(ke,Ae,Ce){if(ke.isEmpty())return false;const ze=ke.save();const qe=derDecodeTag(ke,'Failed to peek tag: "'+Ae+'"');if(ke.isError(qe))return qe;ke.restore(ze);return qe.tag===Ae||qe.tagStr===Ae||qe.tagStr+"of"===Ae||Ce};DERNode.prototype._decodeTag=function decodeTag(ke,Ae,Ce){const ze=derDecodeTag(ke,'Failed to decode tag of "'+Ae+'"');if(ke.isError(ze))return ze;let qe=derDecodeLen(ke,ze.primitive,'Failed to get length of "'+Ae+'"');if(ke.isError(qe))return qe;if(!Ce&&ze.tag!==Ae&&ze.tagStr!==Ae&&ze.tagStr+"of"!==Ae){return ke.error('Failed to match tag: "'+Ae+'"')}if(ze.primitive||qe!==null)return ke.skip(qe,'Failed to match body of: "'+Ae+'"');const Ve=ke.save();const tt=this._skipUntilEnd(ke,'Failed to skip indefinite length body: "'+this.tag+'"');if(ke.isError(tt))return tt;qe=ke.offset-Ve.offset;ke.restore(Ve);return ke.skip(qe,'Failed to match body of: "'+Ae+'"')};DERNode.prototype._skipUntilEnd=function skipUntilEnd(ke,Ae){for(;;){const Ce=derDecodeTag(ke,Ae);if(ke.isError(Ce))return Ce;const ze=derDecodeLen(ke,Ce.primitive,Ae);if(ke.isError(ze))return ze;let qe;if(Ce.primitive||ze!==null)qe=ke.skip(ze);else qe=this._skipUntilEnd(ke,Ae);if(ke.isError(qe))return qe;if(Ce.tagStr==="end")break}};DERNode.prototype._decodeList=function decodeList(ke,Ae,Ce,ze){const qe=[];while(!ke.isEmpty()){const Ae=this._peekTag(ke,"end");if(ke.isError(Ae))return Ae;const Ve=Ce.decode(ke,"der",ze);if(ke.isError(Ve)&&Ae)break;qe.push(Ve)}return qe};DERNode.prototype._decodeStr=function decodeStr(ke,Ae){if(Ae==="bitstr"){const Ae=ke.readUInt8();if(ke.isError(Ae))return Ae;return{unused:Ae,data:ke.raw()}}else if(Ae==="bmpstr"){const Ae=ke.raw();if(Ae.length%2===1)return ke.error("Decoding of string type: bmpstr length mismatch");let Ce="";for(let ke=0;ke>6];const qe=(Ce&32)===0;if((Ce&31)===31){let ze=Ce;Ce=0;while((ze&128)===128){ze=ke.readUInt8(Ae);if(ke.isError(ze))return ze;Ce<<=7;Ce|=ze&127}}else{Ce&=31}const Ve=rt.tag[Ce];return{cls:ze,primitive:qe,tag:Ce,tagStr:Ve}}function derDecodeLen(ke,Ae,Ce){let ze=ke.readUInt8(Ce);if(ke.isError(ze))return ze;if(!Ae&&ze===128)return null;if((ze&128)===0){return ze}const qe=ze&127;if(qe>4)return ke.error("length octect is too long");ze=0;for(let Ae=0;Ae{"use strict";const ze=Ae;ze.der=Ce(3332);ze.pem=Ce(8361)},8361:(ke,Ae,Ce)=>{"use strict";const ze=Ce(4124);const qe=Ce(5118).Buffer;const Ve=Ce(3332);function PEMDecoder(ke){Ve.call(this,ke);this.enc="pem"}ze(PEMDecoder,Ve);ke.exports=PEMDecoder;PEMDecoder.prototype.decode=function decode(ke,Ae){const Ce=ke.toString().split(/[\r\n]+/g);const ze=Ae.label.toUpperCase();const tt=/^-----(BEGIN|END) ([^-]+)-----$/;let rt=-1;let it=-1;for(let ke=0;ke{"use strict";const ze=Ce(4124);const qe=Ce(5118).Buffer;const Ve=Ce(842);const tt=Ce(1188);function DEREncoder(ke){this.enc="der";this.name=ke.name;this.entity=ke;this.tree=new DERNode;this.tree._init(ke.body)}ke.exports=DEREncoder;DEREncoder.prototype.encode=function encode(ke,Ae){return this.tree._encode(ke,Ae).join()};function DERNode(ke){Ve.call(this,"der",ke)}ze(DERNode,Ve);DERNode.prototype._encodeComposite=function encodeComposite(ke,Ae,Ce,ze){const Ve=encodeTag(ke,Ae,Ce,this.reporter);if(ze.length<128){const ke=qe.alloc(2);ke[0]=Ve;ke[1]=ze.length;return this._createEncoderBuffer([ke,ze])}let tt=1;for(let ke=ze.length;ke>=256;ke>>=8)tt++;const rt=qe.alloc(1+1+tt);rt[0]=Ve;rt[1]=128|tt;for(let ke=1+tt,Ae=ze.length;Ae>0;ke--,Ae>>=8)rt[ke]=Ae&255;return this._createEncoderBuffer([rt,ze])};DERNode.prototype._encodeStr=function encodeStr(ke,Ae){if(Ae==="bitstr"){return this._createEncoderBuffer([ke.unused|0,ke.data])}else if(Ae==="bmpstr"){const Ae=qe.alloc(ke.length*2);for(let Ce=0;Ce=40)return this.reporter.error("Second objid identifier OOB");ke.splice(0,2,ke[0]*40+ke[1])}let ze=0;for(let Ae=0;Ae=128;Ce>>=7)ze++}const Ve=qe.alloc(ze);let tt=Ve.length-1;for(let Ae=ke.length-1;Ae>=0;Ae--){let Ce=ke[Ae];Ve[tt--]=Ce&127;while((Ce>>=7)>0)Ve[tt--]=128|Ce&127}return this._createEncoderBuffer(Ve)};function two(ke){if(ke<10)return"0"+ke;else return ke}DERNode.prototype._encodeTime=function encodeTime(ke,Ae){let Ce;const ze=new Date(ke);if(Ae==="gentime"){Ce=[two(ze.getUTCFullYear()),two(ze.getUTCMonth()+1),two(ze.getUTCDate()),two(ze.getUTCHours()),two(ze.getUTCMinutes()),two(ze.getUTCSeconds()),"Z"].join("")}else if(Ae==="utctime"){Ce=[two(ze.getUTCFullYear()%100),two(ze.getUTCMonth()+1),two(ze.getUTCDate()),two(ze.getUTCHours()),two(ze.getUTCMinutes()),two(ze.getUTCSeconds()),"Z"].join("")}else{this.reporter.error("Encoding "+Ae+" time is not supported yet")}return this._encodeStr(Ce,"octstr")};DERNode.prototype._encodeNull=function encodeNull(){return this._createEncoderBuffer("")};DERNode.prototype._encodeInt=function encodeInt(ke,Ae){if(typeof ke==="string"){if(!Ae)return this.reporter.error("String int or enum given, but no values map");if(!Ae.hasOwnProperty(ke)){return this.reporter.error("Values map doesn't contain: "+JSON.stringify(ke))}ke=Ae[ke]}if(typeof ke!=="number"&&!qe.isBuffer(ke)){const Ae=ke.toArray();if(!ke.sign&&Ae[0]&128){Ae.unshift(0)}ke=qe.from(Ae)}if(qe.isBuffer(ke)){let Ae=ke.length;if(ke.length===0)Ae++;const Ce=qe.alloc(Ae);ke.copy(Ce);if(ke.length===0)Ce[0]=0;return this._createEncoderBuffer(Ce)}if(ke<128)return this._createEncoderBuffer(ke);if(ke<256)return this._createEncoderBuffer([0,ke]);let Ce=1;for(let Ae=ke;Ae>=256;Ae>>=8)Ce++;const ze=new Array(Ce);for(let Ae=ze.length-1;Ae>=0;Ae--){ze[Ae]=ke&255;ke>>=8}if(ze[0]&128){ze.unshift(0)}return this._createEncoderBuffer(qe.from(ze))};DERNode.prototype._encodeBool=function encodeBool(ke){return this._createEncoderBuffer(ke?255:0)};DERNode.prototype._use=function use(ke,Ae){if(typeof ke==="function")ke=ke(Ae);return ke._getEncoder("der").tree};DERNode.prototype._skipDefault=function skipDefault(ke,Ae,Ce){const ze=this._baseState;let qe;if(ze["default"]===null)return false;const Ve=ke.join();if(ze.defaultBuffer===undefined)ze.defaultBuffer=this._encodeValue(ze["default"],Ae,Ce).join();if(Ve.length!==ze.defaultBuffer.length)return false;for(qe=0;qe=31)return ze.error("Multi-octet tag encoding unsupported");if(!Ae)qe|=32;qe|=tt.tagClassByName[Ce||"universal"]<<6;return qe}},9083:(ke,Ae,Ce)=>{"use strict";const ze=Ae;ze.der=Ce(5769);ze.pem=Ce(279)},279:(ke,Ae,Ce)=>{"use strict";const ze=Ce(4124);const qe=Ce(5769);function PEMEncoder(ke){qe.call(this,ke);this.enc="pem"}ze(PEMEncoder,qe);ke.exports=PEMEncoder;PEMEncoder.prototype.encode=function encode(ke,Ae){const Ce=qe.prototype.encode.call(this,ke);const ze=Ce.toString("base64");const Ve=["-----BEGIN "+Ae.label+"-----"];for(let ke=0;ke0)return ke;return Ae};BN.min=function min(ke,Ae){if(ke.cmp(Ae)<0)return ke;return Ae};BN.prototype._init=function init(ke,Ae,Ce){if(typeof ke==="number"){return this._initNumber(ke,Ae,Ce)}if(typeof ke==="object"){return this._initArray(ke,Ae,Ce)}if(Ae==="hex"){Ae=16}assert(Ae===(Ae|0)&&Ae>=2&&Ae<=36);ke=ke.toString().replace(/\s+/g,"");var ze=0;if(ke[0]==="-"){ze++}if(Ae===16){this._parseHex(ke,ze)}else{this._parseBase(ke,Ae,ze)}if(ke[0]==="-"){this.negative=1}this.strip();if(Ce!=="le")return;this._initArray(this.toArray(),Ae,Ce)};BN.prototype._initNumber=function _initNumber(ke,Ae,Ce){if(ke<0){this.negative=1;ke=-ke}if(ke<67108864){this.words=[ke&67108863];this.length=1}else if(ke<4503599627370496){this.words=[ke&67108863,ke/67108864&67108863];this.length=2}else{assert(ke<9007199254740992);this.words=[ke&67108863,ke/67108864&67108863,1];this.length=3}if(Ce!=="le")return;this._initArray(this.toArray(),Ae,Ce)};BN.prototype._initArray=function _initArray(ke,Ae,Ce){assert(typeof ke.length==="number");if(ke.length<=0){this.words=[0];this.length=1;return this}this.length=Math.ceil(ke.length/3);this.words=new Array(this.length);for(var ze=0;ze=0;ze-=3){Ve=ke[ze]|ke[ze-1]<<8|ke[ze-2]<<16;this.words[qe]|=Ve<>>26-tt&67108863;tt+=24;if(tt>=26){tt-=26;qe++}}}else if(Ce==="le"){for(ze=0,qe=0;ze>>26-tt&67108863;tt+=24;if(tt>=26){tt-=26;qe++}}}return this.strip()};function parseHex(ke,Ae,Ce){var ze=0;var qe=Math.min(ke.length,Ce);for(var Ve=Ae;Ve=49&&tt<=54){ze|=tt-49+10}else if(tt>=17&&tt<=22){ze|=tt-17+10}else{ze|=tt&15}}return ze}BN.prototype._parseHex=function _parseHex(ke,Ae){this.length=Math.ceil((ke.length-Ae)/6);this.words=new Array(this.length);for(var Ce=0;Ce=Ae;Ce-=6){qe=parseHex(ke,Ce,Ce+6);this.words[ze]|=qe<>>26-Ve&4194303;Ve+=24;if(Ve>=26){Ve-=26;ze++}}if(Ce+6!==Ae){qe=parseHex(ke,Ae,Ce+6);this.words[ze]|=qe<>>26-Ve&4194303}this.strip()};function parseBase(ke,Ae,Ce,ze){var qe=0;var Ve=Math.min(ke.length,Ce);for(var tt=Ae;tt=49){qe+=rt-49+10}else if(rt>=17){qe+=rt-17+10}else{qe+=rt}}return qe}BN.prototype._parseBase=function _parseBase(ke,Ae,Ce){this.words=[0];this.length=1;for(var ze=0,qe=1;qe<=67108863;qe*=Ae){ze++}ze--;qe=qe/Ae|0;var Ve=ke.length-Ce;var tt=Ve%ze;var rt=Math.min(Ve,Ve-tt)+Ce;var it=0;for(var nt=Ce;nt1&&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 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"];var Ve=[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 tt=[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(ke,Ae){ke=ke||10;Ae=Ae|0||1;var Ce;if(ke===16||ke==="hex"){Ce="";var ze=0;var rt=0;for(var it=0;it>>24-ze&16777215;if(rt!==0||it!==this.length-1){Ce=qe[6-ot.length]+ot+Ce}else{Ce=ot+Ce}ze+=2;if(ze>=26){ze-=26;it--}}if(rt!==0){Ce=rt.toString(16)+Ce}while(Ce.length%Ae!==0){Ce="0"+Ce}if(this.negative!==0){Ce="-"+Ce}return Ce}if(ke===(ke|0)&&ke>=2&&ke<=36){var ct=Ve[ke];var ht=tt[ke];Ce="";var ft=this.clone();ft.negative=0;while(!ft.isZero()){var yt=ft.modn(ht).toString(ke);ft=ft.idivn(ht);if(!ft.isZero()){Ce=qe[ct-yt.length]+yt+Ce}else{Ce=yt+Ce}}if(this.isZero()){Ce="0"+Ce}while(Ce.length%Ae!==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 ke=this.words[0];if(this.length===2){ke+=this.words[1]*67108864}else if(this.length===3&&this.words[2]===1){ke+=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?-ke:ke};BN.prototype.toJSON=function toJSON(){return this.toString(16)};BN.prototype.toBuffer=function toBuffer(ke,Ae){assert(typeof ze!=="undefined");return this.toArrayLike(ze,ke,Ae)};BN.prototype.toArray=function toArray(ke,Ae){return this.toArrayLike(Array,ke,Ae)};BN.prototype.toArrayLike=function toArrayLike(ke,Ae,Ce){var ze=this.byteLength();var qe=Ce||Math.max(1,ze);assert(ze<=qe,"byte array longer than desired length");assert(qe>0,"Requested array length <= 0");this.strip();var Ve=Ae==="le";var tt=new ke(qe);var rt,it;var nt=this.clone();if(!Ve){for(it=0;it=4096){Ce+=13;Ae>>>=13}if(Ae>=64){Ce+=7;Ae>>>=7}if(Ae>=8){Ce+=4;Ae>>>=4}if(Ae>=2){Ce+=2;Ae>>>=2}return Ce+Ae}}BN.prototype._zeroBits=function _zeroBits(ke){if(ke===0)return 26;var Ae=ke;var Ce=0;if((Ae&8191)===0){Ce+=13;Ae>>>=13}if((Ae&127)===0){Ce+=7;Ae>>>=7}if((Ae&15)===0){Ce+=4;Ae>>>=4}if((Ae&3)===0){Ce+=2;Ae>>>=2}if((Ae&1)===0){Ce++}return Ce};BN.prototype.bitLength=function bitLength(){var ke=this.words[this.length-1];var Ae=this._countBits(ke);return(this.length-1)*26+Ae};function toBitArray(ke){var Ae=new Array(ke.bitLength());for(var Ce=0;Ce>>qe}return Ae}BN.prototype.zeroBits=function zeroBits(){if(this.isZero())return 0;var ke=0;for(var Ae=0;Aeke.length)return this.clone().ior(ke);return ke.clone().ior(this)};BN.prototype.uor=function uor(ke){if(this.length>ke.length)return this.clone().iuor(ke);return ke.clone().iuor(this)};BN.prototype.iuand=function iuand(ke){var Ae;if(this.length>ke.length){Ae=ke}else{Ae=this}for(var Ce=0;Ceke.length)return this.clone().iand(ke);return ke.clone().iand(this)};BN.prototype.uand=function uand(ke){if(this.length>ke.length)return this.clone().iuand(ke);return ke.clone().iuand(this)};BN.prototype.iuxor=function iuxor(ke){var Ae;var Ce;if(this.length>ke.length){Ae=this;Ce=ke}else{Ae=ke;Ce=this}for(var ze=0;zeke.length)return this.clone().ixor(ke);return ke.clone().ixor(this)};BN.prototype.uxor=function uxor(ke){if(this.length>ke.length)return this.clone().iuxor(ke);return ke.clone().iuxor(this)};BN.prototype.inotn=function inotn(ke){assert(typeof ke==="number"&&ke>=0);var Ae=Math.ceil(ke/26)|0;var Ce=ke%26;this._expand(Ae);if(Ce>0){Ae--}for(var ze=0;ze0){this.words[ze]=~this.words[ze]&67108863>>26-Ce}return this.strip()};BN.prototype.notn=function notn(ke){return this.clone().inotn(ke)};BN.prototype.setn=function setn(ke,Ae){assert(typeof ke==="number"&&ke>=0);var Ce=ke/26|0;var ze=ke%26;this._expand(Ce+1);if(Ae){this.words[Ce]=this.words[Ce]|1<ke.length){Ce=this;ze=ke}else{Ce=ke;ze=this}var qe=0;for(var Ve=0;Ve>>26}for(;qe!==0&&Ve>>26}this.length=Ce.length;if(qe!==0){this.words[this.length]=qe;this.length++}else if(Ce!==this){for(;Veke.length)return this.clone().iadd(ke);return ke.clone().iadd(this)};BN.prototype.isub=function isub(ke){if(ke.negative!==0){ke.negative=0;var Ae=this.iadd(ke);ke.negative=1;return Ae._normSign()}else if(this.negative!==0){this.negative=0;this.iadd(ke);this.negative=1;return this._normSign()}var Ce=this.cmp(ke);if(Ce===0){this.negative=0;this.length=1;this.words[0]=0;return this}var ze,qe;if(Ce>0){ze=this;qe=ke}else{ze=ke;qe=this}var Ve=0;for(var tt=0;tt>26;this.words[tt]=Ae&67108863}for(;Ve!==0&&tt>26;this.words[tt]=Ae&67108863}if(Ve===0&&tt>>26;var ct=it&67108863;var ht=Math.min(nt,Ae.length-1);for(var ft=Math.max(0,nt-ke.length+1);ft<=ht;ft++){var yt=nt-ft|0;qe=ke.words[yt]|0;Ve=Ae.words[ft]|0;tt=qe*Ve+ct;ot+=tt/67108864|0;ct=tt&67108863}Ce.words[nt]=ct|0;it=ot|0}if(it!==0){Ce.words[nt]=it|0}else{Ce.length--}return Ce.strip()}var rt=function comb10MulTo(ke,Ae,Ce){var ze=ke.words;var qe=Ae.words;var Ve=Ce.words;var tt=0;var rt;var it;var nt;var ot=ze[0]|0;var ct=ot&8191;var ht=ot>>>13;var ft=ze[1]|0;var yt=ft&8191;var mt=ft>>>13;var kt=ze[2]|0;var St=kt&8191;var Et=kt>>>13;var Pt=ze[3]|0;var Bt=Pt&8191;var Dt=Pt>>>13;var Rt=ze[4]|0;var Tt=Rt&8191;var Kt=Rt>>>13;var It=ze[5]|0;var Ut=It&8191;var Ot=It>>>13;var Nt=ze[6]|0;var zt=Nt&8191;var qt=Nt>>>13;var Ft=ze[7]|0;var Lt=Ft&8191;var Ht=Ft>>>13;var Gt=ze[8]|0;var $t=Gt&8191;var Vt=Gt>>>13;var Zt=ze[9]|0;var Xt=Zt&8191;var Jt=Zt>>>13;var Yt=qe[0]|0;var Qt=Yt&8191;var er=Yt>>>13;var tr=qe[1]|0;var rr=tr&8191;var ir=tr>>>13;var nr=qe[2]|0;var sr=nr&8191;var vr=nr>>>13;var _r=qe[3]|0;var kr=_r&8191;var Ar=_r>>>13;var Sr=qe[4]|0;var Er=Sr&8191;var xr=Sr>>>13;var Br=qe[5]|0;var Dr=Br&8191;var Rr=Br>>>13;var Ir=qe[6]|0;var Ur=Ir&8191;var Lr=Ir>>>13;var Gr=qe[7]|0;var Vr=Gr&8191;var Xr=Gr>>>13;var Qr=qe[8]|0;var ei=Qr&8191;var ti=Qr>>>13;var ni=qe[9]|0;var ai=ni&8191;var ci=ni>>>13;Ce.negative=ke.negative^Ae.negative;Ce.length=19;rt=Math.imul(ct,Qt);it=Math.imul(ct,er);it=it+Math.imul(ht,Qt)|0;nt=Math.imul(ht,er);var ui=(tt+rt|0)+((it&8191)<<13)|0;tt=(nt+(it>>>13)|0)+(ui>>>26)|0;ui&=67108863;rt=Math.imul(yt,Qt);it=Math.imul(yt,er);it=it+Math.imul(mt,Qt)|0;nt=Math.imul(mt,er);rt=rt+Math.imul(ct,rr)|0;it=it+Math.imul(ct,ir)|0;it=it+Math.imul(ht,rr)|0;nt=nt+Math.imul(ht,ir)|0;var li=(tt+rt|0)+((it&8191)<<13)|0;tt=(nt+(it>>>13)|0)+(li>>>26)|0;li&=67108863;rt=Math.imul(St,Qt);it=Math.imul(St,er);it=it+Math.imul(Et,Qt)|0;nt=Math.imul(Et,er);rt=rt+Math.imul(yt,rr)|0;it=it+Math.imul(yt,ir)|0;it=it+Math.imul(mt,rr)|0;nt=nt+Math.imul(mt,ir)|0;rt=rt+Math.imul(ct,sr)|0;it=it+Math.imul(ct,vr)|0;it=it+Math.imul(ht,sr)|0;nt=nt+Math.imul(ht,vr)|0;var pi=(tt+rt|0)+((it&8191)<<13)|0;tt=(nt+(it>>>13)|0)+(pi>>>26)|0;pi&=67108863;rt=Math.imul(Bt,Qt);it=Math.imul(Bt,er);it=it+Math.imul(Dt,Qt)|0;nt=Math.imul(Dt,er);rt=rt+Math.imul(St,rr)|0;it=it+Math.imul(St,ir)|0;it=it+Math.imul(Et,rr)|0;nt=nt+Math.imul(Et,ir)|0;rt=rt+Math.imul(yt,sr)|0;it=it+Math.imul(yt,vr)|0;it=it+Math.imul(mt,sr)|0;nt=nt+Math.imul(mt,vr)|0;rt=rt+Math.imul(ct,kr)|0;it=it+Math.imul(ct,Ar)|0;it=it+Math.imul(ht,kr)|0;nt=nt+Math.imul(ht,Ar)|0;var yi=(tt+rt|0)+((it&8191)<<13)|0;tt=(nt+(it>>>13)|0)+(yi>>>26)|0;yi&=67108863;rt=Math.imul(Tt,Qt);it=Math.imul(Tt,er);it=it+Math.imul(Kt,Qt)|0;nt=Math.imul(Kt,er);rt=rt+Math.imul(Bt,rr)|0;it=it+Math.imul(Bt,ir)|0;it=it+Math.imul(Dt,rr)|0;nt=nt+Math.imul(Dt,ir)|0;rt=rt+Math.imul(St,sr)|0;it=it+Math.imul(St,vr)|0;it=it+Math.imul(Et,sr)|0;nt=nt+Math.imul(Et,vr)|0;rt=rt+Math.imul(yt,kr)|0;it=it+Math.imul(yt,Ar)|0;it=it+Math.imul(mt,kr)|0;nt=nt+Math.imul(mt,Ar)|0;rt=rt+Math.imul(ct,Er)|0;it=it+Math.imul(ct,xr)|0;it=it+Math.imul(ht,Er)|0;nt=nt+Math.imul(ht,xr)|0;var mi=(tt+rt|0)+((it&8191)<<13)|0;tt=(nt+(it>>>13)|0)+(mi>>>26)|0;mi&=67108863;rt=Math.imul(Ut,Qt);it=Math.imul(Ut,er);it=it+Math.imul(Ot,Qt)|0;nt=Math.imul(Ot,er);rt=rt+Math.imul(Tt,rr)|0;it=it+Math.imul(Tt,ir)|0;it=it+Math.imul(Kt,rr)|0;nt=nt+Math.imul(Kt,ir)|0;rt=rt+Math.imul(Bt,sr)|0;it=it+Math.imul(Bt,vr)|0;it=it+Math.imul(Dt,sr)|0;nt=nt+Math.imul(Dt,vr)|0;rt=rt+Math.imul(St,kr)|0;it=it+Math.imul(St,Ar)|0;it=it+Math.imul(Et,kr)|0;nt=nt+Math.imul(Et,Ar)|0;rt=rt+Math.imul(yt,Er)|0;it=it+Math.imul(yt,xr)|0;it=it+Math.imul(mt,Er)|0;nt=nt+Math.imul(mt,xr)|0;rt=rt+Math.imul(ct,Dr)|0;it=it+Math.imul(ct,Rr)|0;it=it+Math.imul(ht,Dr)|0;nt=nt+Math.imul(ht,Rr)|0;var gi=(tt+rt|0)+((it&8191)<<13)|0;tt=(nt+(it>>>13)|0)+(gi>>>26)|0;gi&=67108863;rt=Math.imul(zt,Qt);it=Math.imul(zt,er);it=it+Math.imul(qt,Qt)|0;nt=Math.imul(qt,er);rt=rt+Math.imul(Ut,rr)|0;it=it+Math.imul(Ut,ir)|0;it=it+Math.imul(Ot,rr)|0;nt=nt+Math.imul(Ot,ir)|0;rt=rt+Math.imul(Tt,sr)|0;it=it+Math.imul(Tt,vr)|0;it=it+Math.imul(Kt,sr)|0;nt=nt+Math.imul(Kt,vr)|0;rt=rt+Math.imul(Bt,kr)|0;it=it+Math.imul(Bt,Ar)|0;it=it+Math.imul(Dt,kr)|0;nt=nt+Math.imul(Dt,Ar)|0;rt=rt+Math.imul(St,Er)|0;it=it+Math.imul(St,xr)|0;it=it+Math.imul(Et,Er)|0;nt=nt+Math.imul(Et,xr)|0;rt=rt+Math.imul(yt,Dr)|0;it=it+Math.imul(yt,Rr)|0;it=it+Math.imul(mt,Dr)|0;nt=nt+Math.imul(mt,Rr)|0;rt=rt+Math.imul(ct,Ur)|0;it=it+Math.imul(ct,Lr)|0;it=it+Math.imul(ht,Ur)|0;nt=nt+Math.imul(ht,Lr)|0;var bi=(tt+rt|0)+((it&8191)<<13)|0;tt=(nt+(it>>>13)|0)+(bi>>>26)|0;bi&=67108863;rt=Math.imul(Lt,Qt);it=Math.imul(Lt,er);it=it+Math.imul(Ht,Qt)|0;nt=Math.imul(Ht,er);rt=rt+Math.imul(zt,rr)|0;it=it+Math.imul(zt,ir)|0;it=it+Math.imul(qt,rr)|0;nt=nt+Math.imul(qt,ir)|0;rt=rt+Math.imul(Ut,sr)|0;it=it+Math.imul(Ut,vr)|0;it=it+Math.imul(Ot,sr)|0;nt=nt+Math.imul(Ot,vr)|0;rt=rt+Math.imul(Tt,kr)|0;it=it+Math.imul(Tt,Ar)|0;it=it+Math.imul(Kt,kr)|0;nt=nt+Math.imul(Kt,Ar)|0;rt=rt+Math.imul(Bt,Er)|0;it=it+Math.imul(Bt,xr)|0;it=it+Math.imul(Dt,Er)|0;nt=nt+Math.imul(Dt,xr)|0;rt=rt+Math.imul(St,Dr)|0;it=it+Math.imul(St,Rr)|0;it=it+Math.imul(Et,Dr)|0;nt=nt+Math.imul(Et,Rr)|0;rt=rt+Math.imul(yt,Ur)|0;it=it+Math.imul(yt,Lr)|0;it=it+Math.imul(mt,Ur)|0;nt=nt+Math.imul(mt,Lr)|0;rt=rt+Math.imul(ct,Vr)|0;it=it+Math.imul(ct,Xr)|0;it=it+Math.imul(ht,Vr)|0;nt=nt+Math.imul(ht,Xr)|0;var vi=(tt+rt|0)+((it&8191)<<13)|0;tt=(nt+(it>>>13)|0)+(vi>>>26)|0;vi&=67108863;rt=Math.imul($t,Qt);it=Math.imul($t,er);it=it+Math.imul(Vt,Qt)|0;nt=Math.imul(Vt,er);rt=rt+Math.imul(Lt,rr)|0;it=it+Math.imul(Lt,ir)|0;it=it+Math.imul(Ht,rr)|0;nt=nt+Math.imul(Ht,ir)|0;rt=rt+Math.imul(zt,sr)|0;it=it+Math.imul(zt,vr)|0;it=it+Math.imul(qt,sr)|0;nt=nt+Math.imul(qt,vr)|0;rt=rt+Math.imul(Ut,kr)|0;it=it+Math.imul(Ut,Ar)|0;it=it+Math.imul(Ot,kr)|0;nt=nt+Math.imul(Ot,Ar)|0;rt=rt+Math.imul(Tt,Er)|0;it=it+Math.imul(Tt,xr)|0;it=it+Math.imul(Kt,Er)|0;nt=nt+Math.imul(Kt,xr)|0;rt=rt+Math.imul(Bt,Dr)|0;it=it+Math.imul(Bt,Rr)|0;it=it+Math.imul(Dt,Dr)|0;nt=nt+Math.imul(Dt,Rr)|0;rt=rt+Math.imul(St,Ur)|0;it=it+Math.imul(St,Lr)|0;it=it+Math.imul(Et,Ur)|0;nt=nt+Math.imul(Et,Lr)|0;rt=rt+Math.imul(yt,Vr)|0;it=it+Math.imul(yt,Xr)|0;it=it+Math.imul(mt,Vr)|0;nt=nt+Math.imul(mt,Xr)|0;rt=rt+Math.imul(ct,ei)|0;it=it+Math.imul(ct,ti)|0;it=it+Math.imul(ht,ei)|0;nt=nt+Math.imul(ht,ti)|0;var wi=(tt+rt|0)+((it&8191)<<13)|0;tt=(nt+(it>>>13)|0)+(wi>>>26)|0;wi&=67108863;rt=Math.imul(Xt,Qt);it=Math.imul(Xt,er);it=it+Math.imul(Jt,Qt)|0;nt=Math.imul(Jt,er);rt=rt+Math.imul($t,rr)|0;it=it+Math.imul($t,ir)|0;it=it+Math.imul(Vt,rr)|0;nt=nt+Math.imul(Vt,ir)|0;rt=rt+Math.imul(Lt,sr)|0;it=it+Math.imul(Lt,vr)|0;it=it+Math.imul(Ht,sr)|0;nt=nt+Math.imul(Ht,vr)|0;rt=rt+Math.imul(zt,kr)|0;it=it+Math.imul(zt,Ar)|0;it=it+Math.imul(qt,kr)|0;nt=nt+Math.imul(qt,Ar)|0;rt=rt+Math.imul(Ut,Er)|0;it=it+Math.imul(Ut,xr)|0;it=it+Math.imul(Ot,Er)|0;nt=nt+Math.imul(Ot,xr)|0;rt=rt+Math.imul(Tt,Dr)|0;it=it+Math.imul(Tt,Rr)|0;it=it+Math.imul(Kt,Dr)|0;nt=nt+Math.imul(Kt,Rr)|0;rt=rt+Math.imul(Bt,Ur)|0;it=it+Math.imul(Bt,Lr)|0;it=it+Math.imul(Dt,Ur)|0;nt=nt+Math.imul(Dt,Lr)|0;rt=rt+Math.imul(St,Vr)|0;it=it+Math.imul(St,Xr)|0;it=it+Math.imul(Et,Vr)|0;nt=nt+Math.imul(Et,Xr)|0;rt=rt+Math.imul(yt,ei)|0;it=it+Math.imul(yt,ti)|0;it=it+Math.imul(mt,ei)|0;nt=nt+Math.imul(mt,ti)|0;rt=rt+Math.imul(ct,ai)|0;it=it+Math.imul(ct,ci)|0;it=it+Math.imul(ht,ai)|0;nt=nt+Math.imul(ht,ci)|0;var Ei=(tt+rt|0)+((it&8191)<<13)|0;tt=(nt+(it>>>13)|0)+(Ei>>>26)|0;Ei&=67108863;rt=Math.imul(Xt,rr);it=Math.imul(Xt,ir);it=it+Math.imul(Jt,rr)|0;nt=Math.imul(Jt,ir);rt=rt+Math.imul($t,sr)|0;it=it+Math.imul($t,vr)|0;it=it+Math.imul(Vt,sr)|0;nt=nt+Math.imul(Vt,vr)|0;rt=rt+Math.imul(Lt,kr)|0;it=it+Math.imul(Lt,Ar)|0;it=it+Math.imul(Ht,kr)|0;nt=nt+Math.imul(Ht,Ar)|0;rt=rt+Math.imul(zt,Er)|0;it=it+Math.imul(zt,xr)|0;it=it+Math.imul(qt,Er)|0;nt=nt+Math.imul(qt,xr)|0;rt=rt+Math.imul(Ut,Dr)|0;it=it+Math.imul(Ut,Rr)|0;it=it+Math.imul(Ot,Dr)|0;nt=nt+Math.imul(Ot,Rr)|0;rt=rt+Math.imul(Tt,Ur)|0;it=it+Math.imul(Tt,Lr)|0;it=it+Math.imul(Kt,Ur)|0;nt=nt+Math.imul(Kt,Lr)|0;rt=rt+Math.imul(Bt,Vr)|0;it=it+Math.imul(Bt,Xr)|0;it=it+Math.imul(Dt,Vr)|0;nt=nt+Math.imul(Dt,Xr)|0;rt=rt+Math.imul(St,ei)|0;it=it+Math.imul(St,ti)|0;it=it+Math.imul(Et,ei)|0;nt=nt+Math.imul(Et,ti)|0;rt=rt+Math.imul(yt,ai)|0;it=it+Math.imul(yt,ci)|0;it=it+Math.imul(mt,ai)|0;nt=nt+Math.imul(mt,ci)|0;var Mi=(tt+rt|0)+((it&8191)<<13)|0;tt=(nt+(it>>>13)|0)+(Mi>>>26)|0;Mi&=67108863;rt=Math.imul(Xt,sr);it=Math.imul(Xt,vr);it=it+Math.imul(Jt,sr)|0;nt=Math.imul(Jt,vr);rt=rt+Math.imul($t,kr)|0;it=it+Math.imul($t,Ar)|0;it=it+Math.imul(Vt,kr)|0;nt=nt+Math.imul(Vt,Ar)|0;rt=rt+Math.imul(Lt,Er)|0;it=it+Math.imul(Lt,xr)|0;it=it+Math.imul(Ht,Er)|0;nt=nt+Math.imul(Ht,xr)|0;rt=rt+Math.imul(zt,Dr)|0;it=it+Math.imul(zt,Rr)|0;it=it+Math.imul(qt,Dr)|0;nt=nt+Math.imul(qt,Rr)|0;rt=rt+Math.imul(Ut,Ur)|0;it=it+Math.imul(Ut,Lr)|0;it=it+Math.imul(Ot,Ur)|0;nt=nt+Math.imul(Ot,Lr)|0;rt=rt+Math.imul(Tt,Vr)|0;it=it+Math.imul(Tt,Xr)|0;it=it+Math.imul(Kt,Vr)|0;nt=nt+Math.imul(Kt,Xr)|0;rt=rt+Math.imul(Bt,ei)|0;it=it+Math.imul(Bt,ti)|0;it=it+Math.imul(Dt,ei)|0;nt=nt+Math.imul(Dt,ti)|0;rt=rt+Math.imul(St,ai)|0;it=it+Math.imul(St,ci)|0;it=it+Math.imul(Et,ai)|0;nt=nt+Math.imul(Et,ci)|0;var xi=(tt+rt|0)+((it&8191)<<13)|0;tt=(nt+(it>>>13)|0)+(xi>>>26)|0;xi&=67108863;rt=Math.imul(Xt,kr);it=Math.imul(Xt,Ar);it=it+Math.imul(Jt,kr)|0;nt=Math.imul(Jt,Ar);rt=rt+Math.imul($t,Er)|0;it=it+Math.imul($t,xr)|0;it=it+Math.imul(Vt,Er)|0;nt=nt+Math.imul(Vt,xr)|0;rt=rt+Math.imul(Lt,Dr)|0;it=it+Math.imul(Lt,Rr)|0;it=it+Math.imul(Ht,Dr)|0;nt=nt+Math.imul(Ht,Rr)|0;rt=rt+Math.imul(zt,Ur)|0;it=it+Math.imul(zt,Lr)|0;it=it+Math.imul(qt,Ur)|0;nt=nt+Math.imul(qt,Lr)|0;rt=rt+Math.imul(Ut,Vr)|0;it=it+Math.imul(Ut,Xr)|0;it=it+Math.imul(Ot,Vr)|0;nt=nt+Math.imul(Ot,Xr)|0;rt=rt+Math.imul(Tt,ei)|0;it=it+Math.imul(Tt,ti)|0;it=it+Math.imul(Kt,ei)|0;nt=nt+Math.imul(Kt,ti)|0;rt=rt+Math.imul(Bt,ai)|0;it=it+Math.imul(Bt,ci)|0;it=it+Math.imul(Dt,ai)|0;nt=nt+Math.imul(Dt,ci)|0;var Pi=(tt+rt|0)+((it&8191)<<13)|0;tt=(nt+(it>>>13)|0)+(Pi>>>26)|0;Pi&=67108863;rt=Math.imul(Xt,Er);it=Math.imul(Xt,xr);it=it+Math.imul(Jt,Er)|0;nt=Math.imul(Jt,xr);rt=rt+Math.imul($t,Dr)|0;it=it+Math.imul($t,Rr)|0;it=it+Math.imul(Vt,Dr)|0;nt=nt+Math.imul(Vt,Rr)|0;rt=rt+Math.imul(Lt,Ur)|0;it=it+Math.imul(Lt,Lr)|0;it=it+Math.imul(Ht,Ur)|0;nt=nt+Math.imul(Ht,Lr)|0;rt=rt+Math.imul(zt,Vr)|0;it=it+Math.imul(zt,Xr)|0;it=it+Math.imul(qt,Vr)|0;nt=nt+Math.imul(qt,Xr)|0;rt=rt+Math.imul(Ut,ei)|0;it=it+Math.imul(Ut,ti)|0;it=it+Math.imul(Ot,ei)|0;nt=nt+Math.imul(Ot,ti)|0;rt=rt+Math.imul(Tt,ai)|0;it=it+Math.imul(Tt,ci)|0;it=it+Math.imul(Kt,ai)|0;nt=nt+Math.imul(Kt,ci)|0;var Ci=(tt+rt|0)+((it&8191)<<13)|0;tt=(nt+(it>>>13)|0)+(Ci>>>26)|0;Ci&=67108863;rt=Math.imul(Xt,Dr);it=Math.imul(Xt,Rr);it=it+Math.imul(Jt,Dr)|0;nt=Math.imul(Jt,Rr);rt=rt+Math.imul($t,Ur)|0;it=it+Math.imul($t,Lr)|0;it=it+Math.imul(Vt,Ur)|0;nt=nt+Math.imul(Vt,Lr)|0;rt=rt+Math.imul(Lt,Vr)|0;it=it+Math.imul(Lt,Xr)|0;it=it+Math.imul(Ht,Vr)|0;nt=nt+Math.imul(Ht,Xr)|0;rt=rt+Math.imul(zt,ei)|0;it=it+Math.imul(zt,ti)|0;it=it+Math.imul(qt,ei)|0;nt=nt+Math.imul(qt,ti)|0;rt=rt+Math.imul(Ut,ai)|0;it=it+Math.imul(Ut,ci)|0;it=it+Math.imul(Ot,ai)|0;nt=nt+Math.imul(Ot,ci)|0;var Ti=(tt+rt|0)+((it&8191)<<13)|0;tt=(nt+(it>>>13)|0)+(Ti>>>26)|0;Ti&=67108863;rt=Math.imul(Xt,Ur);it=Math.imul(Xt,Lr);it=it+Math.imul(Jt,Ur)|0;nt=Math.imul(Jt,Lr);rt=rt+Math.imul($t,Vr)|0;it=it+Math.imul($t,Xr)|0;it=it+Math.imul(Vt,Vr)|0;nt=nt+Math.imul(Vt,Xr)|0;rt=rt+Math.imul(Lt,ei)|0;it=it+Math.imul(Lt,ti)|0;it=it+Math.imul(Ht,ei)|0;nt=nt+Math.imul(Ht,ti)|0;rt=rt+Math.imul(zt,ai)|0;it=it+Math.imul(zt,ci)|0;it=it+Math.imul(qt,ai)|0;nt=nt+Math.imul(qt,ci)|0;var Ki=(tt+rt|0)+((it&8191)<<13)|0;tt=(nt+(it>>>13)|0)+(Ki>>>26)|0;Ki&=67108863;rt=Math.imul(Xt,Vr);it=Math.imul(Xt,Xr);it=it+Math.imul(Jt,Vr)|0;nt=Math.imul(Jt,Xr);rt=rt+Math.imul($t,ei)|0;it=it+Math.imul($t,ti)|0;it=it+Math.imul(Vt,ei)|0;nt=nt+Math.imul(Vt,ti)|0;rt=rt+Math.imul(Lt,ai)|0;it=it+Math.imul(Lt,ci)|0;it=it+Math.imul(Ht,ai)|0;nt=nt+Math.imul(Ht,ci)|0;var Ni=(tt+rt|0)+((it&8191)<<13)|0;tt=(nt+(it>>>13)|0)+(Ni>>>26)|0;Ni&=67108863;rt=Math.imul(Xt,ei);it=Math.imul(Xt,ti);it=it+Math.imul(Jt,ei)|0;nt=Math.imul(Jt,ti);rt=rt+Math.imul($t,ai)|0;it=it+Math.imul($t,ci)|0;it=it+Math.imul(Vt,ai)|0;nt=nt+Math.imul(Vt,ci)|0;var zi=(tt+rt|0)+((it&8191)<<13)|0;tt=(nt+(it>>>13)|0)+(zi>>>26)|0;zi&=67108863;rt=Math.imul(Xt,ai);it=Math.imul(Xt,ci);it=it+Math.imul(Jt,ai)|0;nt=Math.imul(Jt,ci);var ji=(tt+rt|0)+((it&8191)<<13)|0;tt=(nt+(it>>>13)|0)+(ji>>>26)|0;ji&=67108863;Ve[0]=ui;Ve[1]=li;Ve[2]=pi;Ve[3]=yi;Ve[4]=mi;Ve[5]=gi;Ve[6]=bi;Ve[7]=vi;Ve[8]=wi;Ve[9]=Ei;Ve[10]=Mi;Ve[11]=xi;Ve[12]=Pi;Ve[13]=Ci;Ve[14]=Ti;Ve[15]=Ki;Ve[16]=Ni;Ve[17]=zi;Ve[18]=ji;if(tt!==0){Ve[19]=tt;Ce.length++}return Ce};if(!Math.imul){rt=smallMulTo}function bigMulTo(ke,Ae,Ce){Ce.negative=Ae.negative^ke.negative;Ce.length=ke.length+Ae.length;var ze=0;var qe=0;for(var Ve=0;Ve>>26)|0;qe+=tt>>>26;tt&=67108863}Ce.words[Ve]=rt;ze=tt;tt=qe}if(ze!==0){Ce.words[Ve]=ze}else{Ce.length--}return Ce.strip()}function jumboMulTo(ke,Ae,Ce){var ze=new FFTM;return ze.mulp(ke,Ae,Ce)}BN.prototype.mulTo=function mulTo(ke,Ae){var Ce;var ze=this.length+ke.length;if(this.length===10&&ke.length===10){Ce=rt(this,ke,Ae)}else if(ze<63){Ce=smallMulTo(this,ke,Ae)}else if(ze<1024){Ce=bigMulTo(this,ke,Ae)}else{Ce=jumboMulTo(this,ke,Ae)}return Ce};function FFTM(ke,Ae){this.x=ke;this.y=Ae}FFTM.prototype.makeRBT=function makeRBT(ke){var Ae=new Array(ke);var Ce=BN.prototype._countBits(ke)-1;for(var ze=0;ze>=1}return ze};FFTM.prototype.permute=function permute(ke,Ae,Ce,ze,qe,Ve){for(var tt=0;tt>>1){qe++}return 1<>>13;Ce[2*Ve+1]=qe&8191;qe=qe>>>13}for(Ve=2*Ae;Ve>=26;Ae+=ze/67108864|0;Ae+=qe>>>26;this.words[Ce]=qe&67108863}if(Ae!==0){this.words[Ce]=Ae;this.length++}return this};BN.prototype.muln=function muln(ke){return this.clone().imuln(ke)};BN.prototype.sqr=function sqr(){return this.mul(this)};BN.prototype.isqr=function isqr(){return this.imul(this.clone())};BN.prototype.pow=function pow(ke){var Ae=toBitArray(ke);if(Ae.length===0)return new BN(1);var Ce=this;for(var ze=0;ze=0);var Ae=ke%26;var Ce=(ke-Ae)/26;var ze=67108863>>>26-Ae<<26-Ae;var qe;if(Ae!==0){var Ve=0;for(qe=0;qe>>26-Ae}if(Ve){this.words[qe]=Ve;this.length++}}if(Ce!==0){for(qe=this.length-1;qe>=0;qe--){this.words[qe+Ce]=this.words[qe]}for(qe=0;qe=0);var ze;if(Ae){ze=(Ae-Ae%26)/26}else{ze=0}var qe=ke%26;var Ve=Math.min((ke-qe)/26,this.length);var tt=67108863^67108863>>>qe<Ve){this.length-=Ve;for(it=0;it=0&&(nt!==0||it>=ze);it--){var ot=this.words[it]|0;this.words[it]=nt<<26-qe|ot>>>qe;nt=ot&tt}if(rt&&nt!==0){rt.words[rt.length++]=nt}if(this.length===0){this.words[0]=0;this.length=1}return this.strip()};BN.prototype.ishrn=function ishrn(ke,Ae,Ce){assert(this.negative===0);return this.iushrn(ke,Ae,Ce)};BN.prototype.shln=function shln(ke){return this.clone().ishln(ke)};BN.prototype.ushln=function ushln(ke){return this.clone().iushln(ke)};BN.prototype.shrn=function shrn(ke){return this.clone().ishrn(ke)};BN.prototype.ushrn=function ushrn(ke){return this.clone().iushrn(ke)};BN.prototype.testn=function testn(ke){assert(typeof ke==="number"&&ke>=0);var Ae=ke%26;var Ce=(ke-Ae)/26;var ze=1<=0);var Ae=ke%26;var Ce=(ke-Ae)/26;assert(this.negative===0,"imaskn works only with positive numbers");if(this.length<=Ce){return this}if(Ae!==0){Ce++}this.length=Math.min(Ce,this.length);if(Ae!==0){var ze=67108863^67108863>>>Ae<=67108864;Ae++){this.words[Ae]-=67108864;if(Ae===this.length-1){this.words[Ae+1]=1}else{this.words[Ae+1]++}}this.length=Math.max(this.length,Ae+1);return this};BN.prototype.isubn=function isubn(ke){assert(typeof ke==="number");assert(ke<67108864);if(ke<0)return this.iaddn(-ke);if(this.negative!==0){this.negative=0;this.iaddn(ke);this.negative=1;return this}this.words[0]-=ke;if(this.length===1&&this.words[0]<0){this.words[0]=-this.words[0];this.negative=1}else{for(var Ae=0;Ae>26)-(rt/67108864|0);this.words[qe+Ce]=Ve&67108863}for(;qe>26;this.words[qe+Ce]=Ve&67108863}if(tt===0)return this.strip();assert(tt===-1);tt=0;for(qe=0;qe>26;this.words[qe]=Ve&67108863}this.negative=1;return this.strip()};BN.prototype._wordDiv=function _wordDiv(ke,Ae){var Ce=this.length-ke.length;var ze=this.clone();var qe=ke;var Ve=qe.words[qe.length-1]|0;var tt=this._countBits(Ve);Ce=26-tt;if(Ce!==0){qe=qe.ushln(Ce);ze.iushln(Ce);Ve=qe.words[qe.length-1]|0}var rt=ze.length-qe.length;var it;if(Ae!=="mod"){it=new BN(null);it.length=rt+1;it.words=new Array(it.length);for(var nt=0;nt=0;ct--){var ht=(ze.words[qe.length+ct]|0)*67108864+(ze.words[qe.length+ct-1]|0);ht=Math.min(ht/Ve|0,67108863);ze._ishlnsubmul(qe,ht,ct);while(ze.negative!==0){ht--;ze.negative=0;ze._ishlnsubmul(qe,1,ct);if(!ze.isZero()){ze.negative^=1}}if(it){it.words[ct]=ht}}if(it){it.strip()}ze.strip();if(Ae!=="div"&&Ce!==0){ze.iushrn(Ce)}return{div:it||null,mod:ze}};BN.prototype.divmod=function divmod(ke,Ae,Ce){assert(!ke.isZero());if(this.isZero()){return{div:new BN(0),mod:new BN(0)}}var ze,qe,Ve;if(this.negative!==0&&ke.negative===0){Ve=this.neg().divmod(ke,Ae);if(Ae!=="mod"){ze=Ve.div.neg()}if(Ae!=="div"){qe=Ve.mod.neg();if(Ce&&qe.negative!==0){qe.iadd(ke)}}return{div:ze,mod:qe}}if(this.negative===0&&ke.negative!==0){Ve=this.divmod(ke.neg(),Ae);if(Ae!=="mod"){ze=Ve.div.neg()}return{div:ze,mod:Ve.mod}}if((this.negative&ke.negative)!==0){Ve=this.neg().divmod(ke.neg(),Ae);if(Ae!=="div"){qe=Ve.mod.neg();if(Ce&&qe.negative!==0){qe.isub(ke)}}return{div:Ve.div,mod:qe}}if(ke.length>this.length||this.cmp(ke)<0){return{div:new BN(0),mod:this}}if(ke.length===1){if(Ae==="div"){return{div:this.divn(ke.words[0]),mod:null}}if(Ae==="mod"){return{div:null,mod:new BN(this.modn(ke.words[0]))}}return{div:this.divn(ke.words[0]),mod:new BN(this.modn(ke.words[0]))}}return this._wordDiv(ke,Ae)};BN.prototype.div=function div(ke){return this.divmod(ke,"div",false).div};BN.prototype.mod=function mod(ke){return this.divmod(ke,"mod",false).mod};BN.prototype.umod=function umod(ke){return this.divmod(ke,"mod",true).mod};BN.prototype.divRound=function divRound(ke){var Ae=this.divmod(ke);if(Ae.mod.isZero())return Ae.div;var Ce=Ae.div.negative!==0?Ae.mod.isub(ke):Ae.mod;var ze=ke.ushrn(1);var qe=ke.andln(1);var Ve=Ce.cmp(ze);if(Ve<0||qe===1&&Ve===0)return Ae.div;return Ae.div.negative!==0?Ae.div.isubn(1):Ae.div.iaddn(1)};BN.prototype.modn=function modn(ke){assert(ke<=67108863);var Ae=(1<<26)%ke;var Ce=0;for(var ze=this.length-1;ze>=0;ze--){Ce=(Ae*Ce+(this.words[ze]|0))%ke}return Ce};BN.prototype.idivn=function idivn(ke){assert(ke<=67108863);var Ae=0;for(var Ce=this.length-1;Ce>=0;Ce--){var ze=(this.words[Ce]|0)+Ae*67108864;this.words[Ce]=ze/ke|0;Ae=ze%ke}return this.strip()};BN.prototype.divn=function divn(ke){return this.clone().idivn(ke)};BN.prototype.egcd=function egcd(ke){assert(ke.negative===0);assert(!ke.isZero());var Ae=this;var Ce=ke.clone();if(Ae.negative!==0){Ae=Ae.umod(ke)}else{Ae=Ae.clone()}var ze=new BN(1);var qe=new BN(0);var Ve=new BN(0);var tt=new BN(1);var rt=0;while(Ae.isEven()&&Ce.isEven()){Ae.iushrn(1);Ce.iushrn(1);++rt}var it=Ce.clone();var nt=Ae.clone();while(!Ae.isZero()){for(var ot=0,ct=1;(Ae.words[0]&ct)===0&&ot<26;++ot,ct<<=1);if(ot>0){Ae.iushrn(ot);while(ot-- >0){if(ze.isOdd()||qe.isOdd()){ze.iadd(it);qe.isub(nt)}ze.iushrn(1);qe.iushrn(1)}}for(var ht=0,ft=1;(Ce.words[0]&ft)===0&&ht<26;++ht,ft<<=1);if(ht>0){Ce.iushrn(ht);while(ht-- >0){if(Ve.isOdd()||tt.isOdd()){Ve.iadd(it);tt.isub(nt)}Ve.iushrn(1);tt.iushrn(1)}}if(Ae.cmp(Ce)>=0){Ae.isub(Ce);ze.isub(Ve);qe.isub(tt)}else{Ce.isub(Ae);Ve.isub(ze);tt.isub(qe)}}return{a:Ve,b:tt,gcd:Ce.iushln(rt)}};BN.prototype._invmp=function _invmp(ke){assert(ke.negative===0);assert(!ke.isZero());var Ae=this;var Ce=ke.clone();if(Ae.negative!==0){Ae=Ae.umod(ke)}else{Ae=Ae.clone()}var ze=new BN(1);var qe=new BN(0);var Ve=Ce.clone();while(Ae.cmpn(1)>0&&Ce.cmpn(1)>0){for(var tt=0,rt=1;(Ae.words[0]&rt)===0&&tt<26;++tt,rt<<=1);if(tt>0){Ae.iushrn(tt);while(tt-- >0){if(ze.isOdd()){ze.iadd(Ve)}ze.iushrn(1)}}for(var it=0,nt=1;(Ce.words[0]&nt)===0&&it<26;++it,nt<<=1);if(it>0){Ce.iushrn(it);while(it-- >0){if(qe.isOdd()){qe.iadd(Ve)}qe.iushrn(1)}}if(Ae.cmp(Ce)>=0){Ae.isub(Ce);ze.isub(qe)}else{Ce.isub(Ae);qe.isub(ze)}}var ot;if(Ae.cmpn(1)===0){ot=ze}else{ot=qe}if(ot.cmpn(0)<0){ot.iadd(ke)}return ot};BN.prototype.gcd=function gcd(ke){if(this.isZero())return ke.abs();if(ke.isZero())return this.abs();var Ae=this.clone();var Ce=ke.clone();Ae.negative=0;Ce.negative=0;for(var ze=0;Ae.isEven()&&Ce.isEven();ze++){Ae.iushrn(1);Ce.iushrn(1)}do{while(Ae.isEven()){Ae.iushrn(1)}while(Ce.isEven()){Ce.iushrn(1)}var qe=Ae.cmp(Ce);if(qe<0){var Ve=Ae;Ae=Ce;Ce=Ve}else if(qe===0||Ce.cmpn(1)===0){break}Ae.isub(Ce)}while(true);return Ce.iushln(ze)};BN.prototype.invm=function invm(ke){return this.egcd(ke).a.umod(ke)};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(ke){return this.words[0]&ke};BN.prototype.bincn=function bincn(ke){assert(typeof ke==="number");var Ae=ke%26;var Ce=(ke-Ae)/26;var ze=1<>>26;tt&=67108863;this.words[Ve]=tt}if(qe!==0){this.words[Ve]=qe;this.length++}return this};BN.prototype.isZero=function isZero(){return this.length===1&&this.words[0]===0};BN.prototype.cmpn=function cmpn(ke){var Ae=ke<0;if(this.negative!==0&&!Ae)return-1;if(this.negative===0&&Ae)return 1;this.strip();var Ce;if(this.length>1){Ce=1}else{if(Ae){ke=-ke}assert(ke<=67108863,"Number is too big");var ze=this.words[0]|0;Ce=ze===ke?0:zeke.length)return 1;if(this.length=0;Ce--){var ze=this.words[Ce]|0;var qe=ke.words[Ce]|0;if(ze===qe)continue;if(zeqe){Ae=1}break}return Ae};BN.prototype.gtn=function gtn(ke){return this.cmpn(ke)===1};BN.prototype.gt=function gt(ke){return this.cmp(ke)===1};BN.prototype.gten=function gten(ke){return this.cmpn(ke)>=0};BN.prototype.gte=function gte(ke){return this.cmp(ke)>=0};BN.prototype.ltn=function ltn(ke){return this.cmpn(ke)===-1};BN.prototype.lt=function lt(ke){return this.cmp(ke)===-1};BN.prototype.lten=function lten(ke){return this.cmpn(ke)<=0};BN.prototype.lte=function lte(ke){return this.cmp(ke)<=0};BN.prototype.eqn=function eqn(ke){return this.cmpn(ke)===0};BN.prototype.eq=function eq(ke){return this.cmp(ke)===0};BN.red=function red(ke){return new Red(ke)};BN.prototype.toRed=function toRed(ke){assert(!this.red,"Already a number in reduction context");assert(this.negative===0,"red works only with positives");return ke.convertTo(this)._forceRed(ke)};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(ke){this.red=ke;return this};BN.prototype.forceRed=function forceRed(ke){assert(!this.red,"Already a number in reduction context");return this._forceRed(ke)};BN.prototype.redAdd=function redAdd(ke){assert(this.red,"redAdd works only with red numbers");return this.red.add(this,ke)};BN.prototype.redIAdd=function redIAdd(ke){assert(this.red,"redIAdd works only with red numbers");return this.red.iadd(this,ke)};BN.prototype.redSub=function redSub(ke){assert(this.red,"redSub works only with red numbers");return this.red.sub(this,ke)};BN.prototype.redISub=function redISub(ke){assert(this.red,"redISub works only with red numbers");return this.red.isub(this,ke)};BN.prototype.redShl=function redShl(ke){assert(this.red,"redShl works only with red numbers");return this.red.shl(this,ke)};BN.prototype.redMul=function redMul(ke){assert(this.red,"redMul works only with red numbers");this.red._verify2(this,ke);return this.red.mul(this,ke)};BN.prototype.redIMul=function redIMul(ke){assert(this.red,"redMul works only with red numbers");this.red._verify2(this,ke);return this.red.imul(this,ke)};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(ke){assert(this.red&&!ke.red,"redPow(normalNum)");this.red._verify1(this);return this.red.pow(this,ke)};var it={k256:null,p224:null,p192:null,p25519:null};function MPrime(ke,Ae){this.name=ke;this.p=new BN(Ae,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 ke=new BN(null);ke.words=new Array(Math.ceil(this.n/13));return ke};MPrime.prototype.ireduce=function ireduce(ke){var Ae=ke;var Ce;do{this.split(Ae,this.tmp);Ae=this.imulK(Ae);Ae=Ae.iadd(this.tmp);Ce=Ae.bitLength()}while(Ce>this.n);var ze=Ce0){Ae.isub(this.p)}else{if(Ae.strip!==undefined){Ae.strip()}else{Ae._strip()}}return Ae};MPrime.prototype.split=function split(ke,Ae){ke.iushrn(this.n,0,Ae)};MPrime.prototype.imulK=function imulK(ke){return ke.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(ke,Ae){var Ce=4194303;var ze=Math.min(ke.length,9);for(var qe=0;qe>>22;Ve=tt}Ve>>>=22;ke.words[qe-10]=Ve;if(Ve===0&&ke.length>10){ke.length-=10}else{ke.length-=9}};K256.prototype.imulK=function imulK(ke){ke.words[ke.length]=0;ke.words[ke.length+1]=0;ke.length+=2;var Ae=0;for(var Ce=0;Ce>>=26;ke.words[Ce]=qe;Ae=ze}if(Ae!==0){ke.words[ke.length++]=Ae}return ke};BN._prime=function prime(ke){if(it[ke])return it[ke];var prime;if(ke==="k256"){prime=new K256}else if(ke==="p224"){prime=new P224}else if(ke==="p192"){prime=new P192}else if(ke==="p25519"){prime=new P25519}else{throw new Error("Unknown prime "+ke)}it[ke]=prime;return prime};function Red(ke){if(typeof ke==="string"){var Ae=BN._prime(ke);this.m=Ae.p;this.prime=Ae}else{assert(ke.gtn(1),"modulus must be greater than 1");this.m=ke;this.prime=null}}Red.prototype._verify1=function _verify1(ke){assert(ke.negative===0,"red works only with positives");assert(ke.red,"red works only with red numbers")};Red.prototype._verify2=function _verify2(ke,Ae){assert((ke.negative|Ae.negative)===0,"red works only with positives");assert(ke.red&&ke.red===Ae.red,"red works only with red numbers")};Red.prototype.imod=function imod(ke){if(this.prime)return this.prime.ireduce(ke)._forceRed(this);return ke.umod(this.m)._forceRed(this)};Red.prototype.neg=function neg(ke){if(ke.isZero()){return ke.clone()}return this.m.sub(ke)._forceRed(this)};Red.prototype.add=function add(ke,Ae){this._verify2(ke,Ae);var Ce=ke.add(Ae);if(Ce.cmp(this.m)>=0){Ce.isub(this.m)}return Ce._forceRed(this)};Red.prototype.iadd=function iadd(ke,Ae){this._verify2(ke,Ae);var Ce=ke.iadd(Ae);if(Ce.cmp(this.m)>=0){Ce.isub(this.m)}return Ce};Red.prototype.sub=function sub(ke,Ae){this._verify2(ke,Ae);var Ce=ke.sub(Ae);if(Ce.cmpn(0)<0){Ce.iadd(this.m)}return Ce._forceRed(this)};Red.prototype.isub=function isub(ke,Ae){this._verify2(ke,Ae);var Ce=ke.isub(Ae);if(Ce.cmpn(0)<0){Ce.iadd(this.m)}return Ce};Red.prototype.shl=function shl(ke,Ae){this._verify1(ke);return this.imod(ke.ushln(Ae))};Red.prototype.imul=function imul(ke,Ae){this._verify2(ke,Ae);return this.imod(ke.imul(Ae))};Red.prototype.mul=function mul(ke,Ae){this._verify2(ke,Ae);return this.imod(ke.mul(Ae))};Red.prototype.isqr=function isqr(ke){return this.imul(ke,ke.clone())};Red.prototype.sqr=function sqr(ke){return this.mul(ke,ke)};Red.prototype.sqrt=function sqrt(ke){if(ke.isZero())return ke.clone();var Ae=this.m.andln(3);assert(Ae%2===1);if(Ae===3){var Ce=this.m.add(new BN(1)).iushrn(2);return this.pow(ke,Ce)}var ze=this.m.subn(1);var qe=0;while(!ze.isZero()&&ze.andln(1)===0){qe++;ze.iushrn(1)}assert(!ze.isZero());var Ve=new BN(1).toRed(this);var tt=Ve.redNeg();var rt=this.m.subn(1).iushrn(1);var it=this.m.bitLength();it=new BN(2*it*it).toRed(this);while(this.pow(it,rt).cmp(tt)!==0){it.redIAdd(tt)}var nt=this.pow(it,ze);var ot=this.pow(ke,ze.addn(1).iushrn(1));var ct=this.pow(ke,ze);var ht=qe;while(ct.cmp(Ve)!==0){var ft=ct;for(var yt=0;ft.cmp(Ve)!==0;yt++){ft=ft.redSqr()}assert(yt=0;qe--){var nt=Ae.words[qe];for(var ot=it-1;ot>=0;ot--){var ct=nt>>ot&1;if(Ve!==ze[0]){Ve=this.sqr(Ve)}if(ct===0&&tt===0){rt=0;continue}tt<<=1;tt|=ct;rt++;if(rt!==Ce&&(qe!==0||ot!==0))continue;Ve=this.mul(Ve,ze[tt]);rt=0;tt=0}it=26}return Ve};Red.prototype.convertTo=function convertTo(ke){var Ae=ke.umod(this.m);return Ae===ke?Ae.clone():Ae};Red.prototype.convertFrom=function convertFrom(ke){var Ae=ke.clone();Ae.red=null;return Ae};BN.mont=function mont(ke){return new Mont(ke)};function Mont(ke){Red.call(this,ke);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(ke){return this.imod(ke.ushln(this.shift))};Mont.prototype.convertFrom=function convertFrom(ke){var Ae=this.imod(ke.mul(this.rinv));Ae.red=null;return Ae};Mont.prototype.imul=function imul(ke,Ae){if(ke.isZero()||Ae.isZero()){ke.words[0]=0;ke.length=1;return ke}var Ce=ke.imul(Ae);var ze=Ce.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m);var qe=Ce.isub(ze).iushrn(this.shift);var Ve=qe;if(qe.cmp(this.m)>=0){Ve=qe.isub(this.m)}else if(qe.cmpn(0)<0){Ve=qe.iadd(this.m)}return Ve._forceRed(this)};Mont.prototype.mul=function mul(ke,Ae){if(ke.isZero()||Ae.isZero())return new BN(0)._forceRed(this);var Ce=ke.mul(Ae);var ze=Ce.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m);var qe=Ce.isub(ze).iushrn(this.shift);var Ve=qe;if(qe.cmp(this.m)>=0){Ve=qe.isub(this.m)}else if(qe.cmpn(0)<0){Ve=qe.iadd(this.m)}return Ve._forceRed(this)};Mont.prototype.invm=function invm(ke){var Ae=this.imod(ke._invmp(this.m).mul(this.r2));return Ae._forceRed(this)}})(false||ke,this)},4124:(ke,Ae,Ce)=>{try{var ze=Ce(3837);if(typeof ze.inherits!=="function")throw"";ke.exports=ze.inherits}catch(Ae){ke.exports=Ce(8544)}},8544:ke=>{if(typeof Object.create==="function"){ke.exports=function inherits(ke,Ae){if(Ae){ke.super_=Ae;ke.prototype=Object.create(Ae.prototype,{constructor:{value:ke,enumerable:false,writable:true,configurable:true}})}}}else{ke.exports=function inherits(ke,Ae){if(Ae){ke.super_=Ae;var TempCtor=function(){};TempCtor.prototype=Ae.prototype;ke.prototype=new TempCtor;ke.prototype.constructor=ke}}}},910:ke=>{ke.exports=assert;function assert(ke,Ae){if(!ke)throw new Error(Ae||"Assertion failed")}assert.equal=function assertEqual(ke,Ae,Ce){if(ke!=Ae)throw new Error(Ce||"Assertion failed: "+ke+" != "+Ae)}},7946:(ke,Ae,Ce)=>{"use strict"; /*! OpenPGP.js v5.2.1 - 2022-03-15 - this is LGPL licensed code, see LICENSE/our website https://openpgpjs.org/ for more information. */const ze="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};Object.defineProperty(Ae,"__esModule",{value:!0});var qe=Ce(4300),Ve=Ce(2781),tt=Ce(6113),rt=Ce(9796),it=Ce(2037),nt=Ce(3837),ot=Ce(4293);function c(ke){return ke&&"object"==typeof ke&&"default"in ke?ke:{default:ke}}var ct=c(qe),ht=c(Ve),ft=c(tt),yt=c(rt),mt=c(it),kt=c(nt),St=c(ot);const Et=Symbol("doneWritingPromise"),Pt=Symbol("doneWritingResolve"),Bt=Symbol("doneWritingReject"),Dt=Symbol("readingIndex");class v extends Array{constructor(){super(),this[Et]=new Promise(((ke,Ae)=>{this[Pt]=ke,this[Bt]=Ae})),this[Et].catch((()=>{}))}}function _(ke){return ke&&ke.getReader&&Array.isArray(ke)}function k(ke){if(!_(ke)){const Ae=ke.getWriter(),Ce=Ae.releaseLock;return Ae.releaseLock=()=>{Ae.closed.catch((function(){})),Ce.call(Ae)},Ae}this.stream=ke}v.prototype.getReader=function(){return void 0===this[Dt]&&(this[Dt]=0),{read:async()=>(await this[Et],this[Dt]===this.length?{value:void 0,done:!0}:{value:this[this[Dt]++],done:!1})}},v.prototype.readToEnd=async function(ke){await this[Et];const Ae=ke(this.slice(this[Dt]));return this.length=0,Ae},v.prototype.clone=function(){const ke=new v;return ke[Et]=this[Et].then((()=>{ke.push(...this)})),ke},k.prototype.write=async function(ke){this.stream.push(ke)},k.prototype.close=async function(){this.stream[Pt]()},k.prototype.abort=async function(ke){return this.stream[Bt](ke),ke},k.prototype.releaseLock=function(){};const Rt="object"==typeof ze.process&&"object"==typeof ze.process.versions,Tt=Rt&&ht.default.Readable;function E(ke){return _(ke)?"array":ze.ReadableStream&&ze.ReadableStream.prototype.isPrototypeOf(ke)?"web":Lt&&Lt.prototype.isPrototypeOf(ke)?"ponyfill":Tt&&Tt.prototype.isPrototypeOf(ke)?"node":!(!ke||!ke.getReader)&&"web-like"}function P(ke){return Uint8Array.prototype.isPrototypeOf(ke)}function x(ke){if(1===ke.length)return ke[0];let Ae=0;for(let Ce=0;Ce{Ae||(Kt.isBuffer(ze)&&(ze=new Uint8Array(ze.buffer,ze.byteOffset,ze.byteLength)),Ce.enqueue(ze),ke.pause())})),ke.on("end",(()=>{Ae||Ce.close()})),ke.on("error",(ke=>Ce.error(ke)))},pull(){ke.resume()},cancel(Ce){Ae=!0,ke.destroy(Ce)}})};class e extends It{constructor(ke,Ae){super(Ae),this._reader=H(ke)}async _read(ke){try{for(;;){const{done:ke,value:Ae}=await this._reader.read();if(ke){this.push(null);break}if(!this.push(Ae)||this._cancelling){this._reading=!1;break}}}catch(ke){this.emit("error",ke)}}_destroy(ke){this._reader.cancel(ke)}}Ot=function(ke,Ae){return new e(ke,Ae)}}const Nt=new WeakSet,zt=Symbol("externalBuffer");function U(ke){if(this.stream=ke,ke[zt]&&(this[zt]=ke[zt].slice()),_(ke)){const Ae=ke.getReader();return this._read=Ae.read.bind(Ae),this._releaseLock=()=>{},void(this._cancel=()=>{})}let Ae=E(ke);if("node"===Ae&&(ke=Ut(ke)),Ae){const Ae=ke.getReader();return this._read=Ae.read.bind(Ae),this._releaseLock=()=>{Ae.closed.catch((function(){})),Ae.releaseLock()},void(this._cancel=Ae.cancel.bind(Ae))}let Ce=!1;this._read=async()=>Ce||Nt.has(ke)?{value:void 0,done:!0}:(Ce=!0,{value:ke,done:!1}),this._releaseLock=()=>{if(Ce)try{Nt.add(ke)}catch(ke){}}}U.prototype.read=async function(){if(this[zt]&&this[zt].length){return{done:!1,value:this[zt].shift()}}return this._read()},U.prototype.releaseLock=function(){this[zt]&&(this.stream[zt]=this[zt]),this._releaseLock()},U.prototype.cancel=function(ke){return this._cancel(ke)},U.prototype.readLine=async function(){let ke,Ae=[];for(;!ke;){let{done:Ce,value:ze}=await this.read();if(ze+="",Ce)return Ae.length?W(Ae):void 0;const qe=ze.indexOf("\n")+1;qe&&(ke=W(Ae.concat(ze.substr(0,qe))),Ae=[]),qe!==ze.length&&Ae.push(ze.substr(qe))}return this.unshift(...Ae),ke},U.prototype.readByte=async function(){const{done:ke,value:Ae}=await this.read();if(ke)return;const Ce=Ae[0];return this.unshift(re(Ae,1)),Ce},U.prototype.readBytes=async function(ke){const Ae=[];let Ce=0;for(;;){const{done:ze,value:qe}=await this.read();if(ze)return Ae.length?W(Ae):void 0;if(Ae.push(qe),Ce+=qe.length,Ce>=ke){const Ce=W(Ae);return this.unshift(re(Ce,ke)),re(Ce,0,ke)}}},U.prototype.peekBytes=async function(ke){const Ae=await this.readBytes(ke);return this.unshift(Ae),Ae},U.prototype.unshift=function(...ke){this[zt]||(this[zt]=[]),1===ke.length&&P(ke[0])&&this[zt].length&&ke[0].length&&this[zt][0].byteOffset>=ke[0].length?this[zt][0]=new Uint8Array(this[zt][0].buffer,this[zt][0].byteOffset-ke[0].length,this[zt][0].byteLength+ke[0].length):this[zt].unshift(...ke.filter((ke=>ke&&ke.length)))},U.prototype.readToEnd=async function(ke=W){const Ae=[];for(;;){const{done:ke,value:Ce}=await this.read();if(ke)break;Ae.push(Ce)}return ke(Ae)};let qt,Ft,{ReadableStream:Lt,WritableStream:Ht,TransformStream:Gt}=ze;async function F(){if(Gt)return;const[ke,Ae]=await Promise.all([Promise.resolve().then((function(){return Md})),Promise.resolve().then((function(){return Kd}))]);({ReadableStream:Lt,WritableStream:Ht,TransformStream:Gt}=ke);const{createReadableStreamWrapper:Ce}=Ae;ze.ReadableStream&&Lt!==ze.ReadableStream&&(qt=Ce(Lt),Ft=Ce(ze.ReadableStream))}const $t=Rt&&ct.default.Buffer;function j(ke){let Ae=E(ke);return"node"===Ae?Ut(ke):"web"===Ae&&qt?qt(ke):Ae?ke:new Lt({start(Ae){Ae.enqueue(ke),Ae.close()}})}function L(ke){if(E(ke))return ke;const Ae=new v;return(async()=>{const Ce=G(Ae);await Ce.write(ke),await Ce.close()})(),Ae}function W(ke){return ke.some((ke=>E(ke)&&!_(ke)))?function(ke){ke=ke.map(j);const Ae=Z((async function(ke){await Promise.all(ze.map((Ae=>ne(Ae,ke))))}));let Ce=Promise.resolve();const ze=ke.map(((ze,qe)=>X(ze,((ze,Ve)=>(Ce=Ce.then((()=>V(ze,Ae.writable,{preventClose:qe!==ke.length-1}))),Ce)))));return Ae.readable}(ke):ke.some((ke=>_(ke)))?function(ke){const Ae=new v;let Ce=Promise.resolve();return ke.forEach(((ze,qe)=>(Ce=Ce.then((()=>V(ze,Ae,{preventClose:qe!==ke.length-1}))),Ce))),Ae}(ke):"string"==typeof ke[0]?ke.join(""):$t&&$t.isBuffer(ke[0])?$t.concat(ke):x(ke)}function H(ke){return new U(ke)}function G(ke){return new k(ke)}async function V(ke,Ae,{preventClose:Ce=!1,preventAbort:ze=!1,preventCancel:qe=!1}={}){if(E(ke)&&!_(ke)){ke=j(ke);try{if(ke[zt]){const Ce=G(Ae);for(let Ae=0;Ae{Ae=ke})),Ae=null)},close:Ce.close.bind(Ce),abort:Ce.error.bind(Ce)})}}function Y(ke,Ae=(()=>{}),Ce=(()=>{})){if(_(ke)){const ze=new v;return(async()=>{const qe=await ie(ke),Ve=Ae(qe),tt=Ce();let rt;rt=void 0!==Ve&&void 0!==tt?W([Ve,tt]):void 0!==Ve?Ve:tt;const it=G(ze);await it.write(rt),await it.close()})(),ze}if(E(ke))return $(ke,{async transform(ke,Ce){try{const ze=await Ae(ke);void 0!==ze&&Ce.enqueue(ze)}catch(ke){Ce.error(ke)}},async flush(ke){try{const Ae=await Ce();void 0!==Ae&&ke.enqueue(Ae)}catch(Ae){ke.error(Ae)}}});const ze=Ae(ke),qe=Ce();return void 0!==ze&&void 0!==qe?W([ze,qe]):void 0!==ze?ze:qe}function X(ke,Ae){if(E(ke)&&!_(ke)){let Ce;const ze=new Gt({start(ke){Ce=ke}}),qe=V(ke,ze.writable),Ve=Z((async function(ke){Ce.error(ke),await qe,await new Promise(setTimeout)}));return Ae(ze.readable,Ve.writable),Ve.readable}ke=L(ke);const Ce=new v;return Ae(ke,Ce),Ce}function Q(ke,Ae){let Ce;const ze=X(ke,((ke,qe)=>{const Ve=H(ke);Ve.remainder=()=>(Ve.releaseLock(),V(ke,qe),ze),Ce=Ae(Ve)}));return Ce}function J(ke){if(_(ke))return ke.clone();if(E(ke)){const Ae=function(ke){if(_(ke))throw Error("ArrayStream cannot be tee()d, use clone() instead");if(E(ke)){const Ae=j(ke).tee();return Ae[0][zt]=Ae[1][zt]=ke[zt],Ae}return[re(ke),re(ke)]}(ke);return te(ke,Ae[0]),Ae[1]}return re(ke)}function ee(ke){return _(ke)?J(ke):E(ke)?new Lt({start(Ae){const Ce=X(ke,(async(ke,Ce)=>{const ze=H(ke),qe=G(Ce);try{for(;;){await qe.ready;const{done:Ce,value:Ve}=await ze.read();if(Ce){try{Ae.close()}catch(ke){}return void await qe.close()}try{Ae.enqueue(Ve)}catch(ke){}await qe.write(Ve)}}catch(ke){Ae.error(ke),await qe.abort(ke)}}));te(ke,Ce)}}):re(ke)}function te(ke,Ae){Object.entries(Object.getOwnPropertyDescriptors(ke.constructor.prototype)).forEach((([Ce,ze])=>{"constructor"!==Ce&&(ze.value?ze.value=ze.value.bind(Ae):ze.get=ze.get.bind(Ae),Object.defineProperty(ke,Ce,ze))}))}function re(ke,Ae=0,Ce=1/0){if(_(ke))throw Error("Not implemented");if(E(ke)){if(Ae>=0&&Ce>=0){let ze=0;return $(ke,{transform(ke,qe){ze=Ae&&qe.enqueue(re(ke,Math.max(Ae-ze,0),Ce-ze)),ze+=ke.length):qe.terminate()}})}if(Ae<0&&(Ce<0||Ce===1/0)){let ze=[];return Y(ke,(ke=>{ke.length>=-Ae?ze=[ke]:ze.push(ke)}),(()=>re(W(ze),Ae,Ce)))}if(0===Ae&&Ce<0){let ze;return Y(ke,(ke=>{const qe=ze?W([ze,ke]):ke;if(qe.length>=-Ce)return ze=re(qe,Ce),re(qe,Ae,Ce);ze=qe}))}return console.warn(`stream.slice(input, ${Ae}, ${Ce}) not implemented efficiently.`),ae((async()=>re(await ie(ke),Ae,Ce)))}return ke[zt]&&(ke=W(ke[zt].concat([ke]))),!P(ke)||$t&&$t.isBuffer(ke)?ke.slice(Ae,Ce):(Ce===1/0&&(Ce=ke.length),ke.subarray(Ae,Ce))}async function ie(ke,Ae=W){return _(ke)?ke.readToEnd(Ae):E(ke)?H(ke).readToEnd(Ae):ke}async function ne(ke,Ae){if(E(ke)){if(ke.cancel)return ke.cancel(Ae);if(ke.destroy)return ke.destroy(Ae),await new Promise(setTimeout),Ae}}function ae(ke){const Ae=new v;return(async()=>{const Ce=G(Ae);try{await Ce.write(await ke()),await Ce.close()}catch(ke){await Ce.abort(ke)}})(),Ae}class se{constructor(ke){if(void 0===ke)throw Error("Invalid BigInteger input");if(ke instanceof Uint8Array){const Ae=ke,Ce=Array(Ae.length);for(let ke=0;keBigInt(0);){const ke=Ce&BigInt(1);Ce>>=BigInt(1);const Ve=qe*ze%Ae.value;qe=ke?Ve:qe,ze=ze*ze%Ae.value}return new se(qe)}modInv(ke){const{gcd:Ae,x:Ce}=this._egcd(ke);if(!Ae.isOne())throw Error("Inverse does not exist");return Ce.add(ke).mod(ke)}_egcd(ke){let Ae=BigInt(0),Ce=BigInt(1),ze=BigInt(1),qe=BigInt(0),Ve=this.value;for(ke=ke.value;ke!==BigInt(0);){const tt=Ve/ke;let rt=Ae;Ae=ze-tt*Ae,ze=rt,rt=Ce,Ce=qe-tt*Ce,qe=rt,rt=ke,ke=Ve%ke,Ve=rt}return{x:new se(ze),y:new se(qe),gcd:new se(Ve)}}gcd(ke){let Ae=this.value;for(ke=ke.value;ke!==BigInt(0);){const Ce=ke;ke=Ae%ke,Ae=Ce}return new se(Ae)}ileftShift(ke){return this.value<<=ke.value,this}leftShift(ke){return this.clone().ileftShift(ke)}irightShift(ke){return this.value>>=ke.value,this}rightShift(ke){return this.clone().irightShift(ke)}equal(ke){return this.value===ke.value}lt(ke){return this.valueke.value}gte(ke){return this.value>=ke.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 ke}getBit(ke){return(this.value>>BigInt(ke)&BigInt(1))===BigInt(0)?0:1}bitLength(){const ke=new se(0),Ae=new se(1),Ce=new se(-1),ze=this.isNegative()?Ce:ke;let qe=1;const Ve=this.clone();for(;!Ve.irightShift(Ae).equal(ze);)qe++;return qe}byteLength(){const ke=new se(0),Ae=new se(-1),Ce=this.isNegative()?Ae:ke,ze=new se(8);let qe=1;const Ve=this.clone();for(;!Ve.irightShift(ze).equal(Ce);)qe++;return qe}toUint8Array(ke="be",Ae){let Ce=this.value.toString(16);Ce.length%2==1&&(Ce="0"+Ce);const ze=Ce.length/2,qe=new Uint8Array(Ae||ze),Ve=Ae?Ae-ze:0;let tt=0;for(;tt{try{return"development"===process.env.NODE_ENV}catch(ke){}return!1})(),Zt={isString:function(ke){return"string"==typeof ke||String.prototype.isPrototypeOf(ke)},isArray:function(ke){return Array.prototype.isPrototypeOf(ke)},isUint8Array:P,isStream:E,readNumber:function(ke){let Ae=0;for(let Ce=0;Ce>8*(Ae-ze-1)&255;return Ce},readDate:function(ke){const Ae=Zt.readNumber(ke);return new Date(1e3*Ae)},writeDate:function(ke){const Ae=Math.floor(ke.getTime()/1e3);return Zt.writeNumber(Ae,4)},normalizeDate:function(ke=Date.now()){return null===ke||ke===1/0?ke:new Date(1e3*Math.floor(+ke/1e3))},readMPI:function(ke){const Ae=(ke[0]<<8|ke[1])+7>>>3;return ke.subarray(2,2+Ae)},leftPad(ke,Ae){const Ce=new Uint8Array(Ae),ze=Ae-ke.length;return Ce.set(ke,ze),Ce},uint8ArrayToMPI:function(ke){const Ae=Zt.uint8ArrayBitLength(ke);if(0===Ae)throw Error("Zero MPI");const Ce=ke.subarray(ke.length-Math.ceil(Ae/8)),ze=new Uint8Array([(65280&Ae)>>8,255&Ae]);return Zt.concatUint8Array([ze,Ce])},uint8ArrayBitLength:function(ke){let Ae;for(Ae=0;Ae>1);for(let Ce=0;Ce>1;Ce++)Ae[Ce]=parseInt(ke.substr(Ce<<1,2),16);return Ae},uint8ArrayToHex:function(ke){const Ae=[],Ce=ke.length;let ze,qe=0;for(;qe{if(!Zt.isString(ke))throw Error("stringToUint8Array: Data must be in the form of a string");const Ae=new Uint8Array(ke.length);for(let Ce=0;Cer("",!0)))},decodeUTF8:function(ke){const Ae=new TextDecoder("utf-8");function r(ke,Ce=!1){return Ae.decode(ke,{stream:!Ce})}return Y(ke,r,(()=>r(new Uint8Array,!0)))},concat:W,concatUint8Array:x,equalsUint8Array:function(ke,Ae){if(!Zt.isUint8Array(ke)||!Zt.isUint8Array(Ae))throw Error("Data must be in the form of a Uint8Array");if(ke.length!==Ae.length)return!1;for(let Ce=0;Ce>>16;return 0!==Ce&&(ke=Ce,Ae+=16),Ce=ke>>8,0!==Ce&&(ke=Ce,Ae+=8),Ce=ke>>4,0!==Ce&&(ke=Ce,Ae+=4),Ce=ke>>2,0!==Ce&&(ke=Ce,Ae+=2),Ce=ke>>1,0!==Ce&&(ke=Ce,Ae+=1),Ae},double:function(ke){const Ae=new Uint8Array(ke.length),Ce=ke.length-1;for(let ze=0;ze>7;return Ae[Ce]=ke[Ce]<<1^135*(ke[0]>>7),Ae},shiftRight:function(ke,Ae){if(Ae)for(let Ce=ke.length-1;Ce>=0;Ce--)ke[Ce]>>=Ae,Ce>0&&(ke[Ce]|=ke[Ce-1]<<8-Ae);return ke},getWebCrypto:function(){return void 0!==ze&&ze.crypto&&ze.crypto.subtle},detectNode:function(){return"object"==typeof ze.process&&"object"==typeof ze.process.versions},detectBigInt:()=>"undefined"!=typeof BigInt,getBigInteger:async function(){if(Zt.detectBigInt())return se;{const{default:ke}=await Promise.resolve().then((function(){return qd}));return ke}},getNodeCrypto:function(){return ft.default},getNodeZlib:function(){return yt.default},getNodeBuffer:function(){return(ct.default||{}).Buffer},getHardwareConcurrency:function(){if(Zt.detectNode()){return mt.default.cpus().length}return"undefined"!=typeof navigator&&navigator.hardwareConcurrency||1},isEmailAddress:function(ke){if(!Zt.isString(ke))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,}|xn--[a-zA-Z\-0-9]+)))$/.test(ke)},canonicalizeEOL:function(ke){let Ae=!1;return Y(ke,(ke=>{let Ce;Ae&&(ke=Zt.concatUint8Array([new Uint8Array([13]),ke])),13===ke[ke.length-1]?(Ae=!0,ke=ke.subarray(0,-1)):Ae=!1;const ze=[];for(let Ae=0;Ce=ke.indexOf(10,Ae)+1,Ce;Ae=Ce)13!==ke[Ce-2]&&ze.push(Ce);if(!ze.length)return ke;const qe=new Uint8Array(ke.length+ze.length);let Ve=0;for(let Ae=0;AeAe?new Uint8Array([13]):void 0))},nativeEOL:function(ke){let Ae=!1;return Y(ke,(ke=>{let Ce;13===(ke=Ae&&10!==ke[0]?Zt.concatUint8Array([new Uint8Array([13]),ke]):new Uint8Array(ke))[ke.length-1]?(Ae=!0,ke=ke.subarray(0,-1)):Ae=!1;let ze=0;for(let Ae=0;Ae!==ke.length;Ae=Ce){Ce=ke.indexOf(13,Ae)+1,Ce||(Ce=ke.length);const qe=Ce-(10===ke[Ce]?1:0);Ae&&ke.copyWithin(ze,Ae,qe),ze+=qe-Ae}return ke.subarray(0,ze)}),(()=>Ae?new Uint8Array([13]):void 0))},removeTrailingSpaces:function(ke){return ke.split("\n").map((ke=>{let Ae=ke.length-1;for(;Ae>=0&&(" "===ke[Ae]||"\t"===ke[Ae]);Ae--);return ke.substr(0,Ae+1)})).join("\n")},wrapError:function(ke,Ae){if(!Ae)return Error(ke);try{Ae.message=ke+": "+Ae.message}catch(ke){}return Ae},constructAllowedPackets:function(ke){const Ae={};return ke.forEach((ke=>{if(!ke.tag)throw Error("Invalid input: expected a packet class");Ae[ke.tag]=ke})),Ae},anyPromise:function(ke){return new Promise((async(Ae,Ce)=>{let ze;await Promise.all(ke.map((async ke=>{try{Ae(await ke)}catch(ke){ze=ke}}))),Ce(ze)}))},selectUint8Array:function(ke,Ae,Ce){const ze=Math.max(Ae.length,Ce.length),qe=new Uint8Array(ze);let Ve=0;for(let ze=0;ze{Ae=Zt.concatUint8Array([Ae,ke]);const Ce=[],ze=Math.floor(Ae.length/45),qe=45*ze,Ve=Jt(Ae.subarray(0,qe));for(let ke=0;keAe.length?Jt(Ae)+"\n":""))}function le(ke){let Ae="";return Y(ke,(ke=>{Ae+=ke;let Ce=0;const ze=[" ","\t","\r","\n"];for(let ke=0;ke0&&(qe-Ce)%4!=0;qe--)ze.includes(Ae[qe])&&Ce--;const Ve=Yt(Ae.substr(0,qe));return Ae=Ae.substr(qe),Ve}),(()=>Yt(Ae)))}function pe(ke){return le(ke.replace(/-/g,"+").replace(/_/g,"/"))}function ye(ke,Ae){let Ce=de(ke).replace(/[\r\n]/g,"");return Ae&&(Ce=Ce.replace(/[+]/g,"-").replace(/[/]/g,"_").replace(/[=]/g,"")),Ce}Xt?(Jt=ke=>Xt.from(ke).toString("base64"),Yt=ke=>{const Ae=Xt.from(ke,"base64");return new Uint8Array(Ae.buffer,Ae.byteOffset,Ae.byteLength)}):(Jt=ke=>btoa(Zt.uint8ArrayToString(ke)),Yt=ke=>Zt.stringToUint8Array(atob(ke)));const Qt=Symbol("byValue");var er={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",ED25519:"ed25519",ed25519:"ed25519",Ed25519:"ed25519","1.3.6.1.4.1.11591.15.1":"ed25519","2b06010401da470f01":"ed25519","2B06010401DA470F01":"ed25519",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,eddsa:22,aedh:23,aedsa:24},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(ke,Ae){if("number"==typeof Ae&&(Ae=this.read(ke,Ae)),void 0!==ke[Ae])return ke[Ae];throw Error("Invalid enum value.")},read:function(ke,Ae){if(ke[Qt]||(ke[Qt]=[],Object.entries(ke).forEach((([Ae,Ce])=>{ke[Qt][Ce]=Ae}))),void 0!==ke[Qt][Ae])return ke[Qt][Ae];throw Error("Invalid enum value.")}},tr={preferredHashAlgorithm:er.hash.sha256,preferredSymmetricAlgorithm:er.symmetric.aes256,preferredCompressionAlgorithm:er.compression.uncompressed,deflateLevel:6,aeadProtect:!1,preferredAEADAlgorithm:er.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([er.symmetric.aes128,er.symmetric.aes192,er.symmetric.aes256]),minBytesForWebCrypto:1e3,ignoreUnsupportedPackets:!0,ignoreMalformedPackets:!1,showVersion:!1,showComment:!1,versionString:"OpenPGP.js 5.2.1",commentString:"https://openpgpjs.org",maxUserIDLength:5120,knownNotations:["preferred-email-encoding@pgp.com","pka-address@gnupg.org"],useIndutnyElliptic:!0,rejectHashAlgorithms:new Set([er.hash.md5,er.hash.ripemd]),rejectMessageHashAlgorithms:new Set([er.hash.md5,er.hash.ripemd,er.hash.sha1]),rejectPublicKeyAlgorithms:new Set([er.publicKey.elgamal,er.publicKey.dsa]),rejectCurves:new Set([er.curve.brainpoolP256r1,er.curve.brainpoolP384r1,er.curve.brainpoolP512r1,er.curve.secp256k1])};function we(ke){const Ae=ke.match(/^-----BEGIN PGP (MESSAGE, PART \d+\/\d+|MESSAGE, PART \d+|SIGNED MESSAGE|MESSAGE|PUBLIC KEY BLOCK|PRIVATE KEY BLOCK|SIGNATURE)-----$/m);if(!Ae)throw Error("Unknown ASCII armor type");return/MESSAGE, PART \d+\/\d+/.test(Ae[1])?er.armor.multipartSection:/MESSAGE, PART \d+/.test(Ae[1])?er.armor.multipartLast:/SIGNED MESSAGE/.test(Ae[1])?er.armor.signed:/MESSAGE/.test(Ae[1])?er.armor.message:/PUBLIC KEY BLOCK/.test(Ae[1])?er.armor.publicKey:/PRIVATE KEY BLOCK/.test(Ae[1])?er.armor.privateKey:/SIGNATURE/.test(Ae[1])?er.armor.signature:void 0}function ve(ke,Ae){let Ce="";return Ae.showVersion&&(Ce+="Version: "+Ae.versionString+"\n"),Ae.showComment&&(Ce+="Comment: "+Ae.commentString+"\n"),ke&&(Ce+="Comment: "+ke+"\n"),Ce+="\n",Ce}function _e(ke){return de(function(ke){let Ae=13501623;return Y(ke,(ke=>{const Ce=ir?Math.floor(ke.length/4):0,ze=new Uint32Array(ke.buffer,ke.byteOffset,Ce);for(let ke=0;ke>24&255]^rr[1][Ae>>16&255]^rr[2][Ae>>8&255]^rr[3][Ae>>0&255];for(let ze=4*Ce;ze>8^rr[0][255&Ae^ke[ze]]}),(()=>new Uint8Array([Ae,Ae>>8,Ae>>16])))}(ke))}const rr=[Array(255),Array(255),Array(255),Array(255)];for(let ke=0;ke<=255;ke++){let Ae=ke<<16;for(let ke=0;ke<8;ke++)Ae=Ae<<1^(0!=(8388608&Ae)?8801531:0);rr[0][ke]=(16711680&Ae)>>16|65280&Ae|(255&Ae)<<16}for(let ke=0;ke<=255;ke++)rr[1][ke]=rr[0][ke]>>8^rr[0][255&rr[0][ke]];for(let ke=0;ke<=255;ke++)rr[2][ke]=rr[1][ke]>>8^rr[0][255&rr[1][ke]];for(let ke=0;ke<=255;ke++)rr[3][ke]=rr[2][ke]>>8^rr[0][255&rr[2][ke]];const ir=function(){const ke=new ArrayBuffer(2);return new DataView(ke).setInt16(0,255,!0),255===new Int16Array(ke)[0]}();function Se(ke){for(let Ae=0;Ae=0&&ze!==ke.length-1&&(Ae=ke.slice(0,ze),Ce=ke.slice(ze+1).substr(0,4)),{body:Ae,checksum:Ce}}function Pe(ke,Ae=tr){return new Promise((async(Ce,ze)=>{try{const qe=/^-----[^-]+-----$/m,Ve=/^[ \f\r\t\u00a0\u2000-\u200a\u202f\u205f\u3000]*$/;let tt;const rt=[];let it,nt,ot,ct=rt,ht=[],ft=le(X(ke,(async(ke,Ae)=>{const yt=H(ke);try{for(;;){let ke=await yt.readLine();if(void 0===ke)throw Error("Misformed armored text");if(ke=Zt.removeTrailingSpaces(ke.replace(/[\r\n]/g,"")),tt)if(it)nt||2!==tt||(qe.test(ke)?(ht=ht.join("\r\n"),nt=!0,Se(ct),ct=[],it=!1):ht.push(ke.replace(/^- /,"")));else if(qe.test(ke)&&ze(Error("Mandatory blank line missing between armor headers and armor data")),Ve.test(ke)){if(Se(ct),it=!0,nt||2!==tt){Ce({text:ht,data:ft,headers:rt,type:tt});break}}else ct.push(ke);else qe.test(ke)&&(tt=we(ke))}}catch(ke){return void ze(ke)}const mt=G(Ae);try{for(;;){await mt.ready;const{done:ke,value:Ae}=await yt.read();if(ke)throw Error("Misformed armored text");const Ce=Ae+"";if(-1!==Ce.indexOf("=")||-1!==Ce.indexOf("-")){let ke=await yt.readToEnd();ke.length||(ke=""),ke=Ce+ke,ke=Zt.removeTrailingSpaces(ke.replace(/\r/g,""));const Ae=ke.split(qe);if(1===Ae.length)throw Error("Misformed armored text");const ze=Ee(Ae[0].slice(0,-1));ot=ze.checksum,await mt.write(ze.body);break}await mt.write(Ce)}await mt.ready,await mt.close()}catch(ke){await mt.abort(ke)}})));ft=X(ft,(async(ke,Ce)=>{const ze=ie(_e(ee(ke)));ze.catch((()=>{})),await V(ke,Ce,{preventClose:!0});const qe=G(Ce);try{const ke=(await ze).replace("\n","");if(ot!==ke&&(ot||Ae.checksumRequired))throw Error("Ascii armor integrity check failed");await qe.ready,await qe.close()}catch(ke){await qe.abort(ke)}}))}catch(ke){ze(ke)}})).then((async ke=>(_(ke.data)&&(ke.data=await ie(ke.data)),ke)))}function xe(ke,Ae,Ce,ze,qe,Ve=tr){let tt,rt;ke===er.armor.signed&&(tt=Ae.text,rt=Ae.hash,Ae=Ae.data);const it=ee(Ae),nt=[];switch(ke){case er.armor.multipartSection:nt.push("-----BEGIN PGP MESSAGE, PART "+Ce+"/"+ze+"-----\n"),nt.push(ve(qe,Ve)),nt.push(de(Ae)),nt.push("=",_e(it)),nt.push("-----END PGP MESSAGE, PART "+Ce+"/"+ze+"-----\n");break;case er.armor.multipartLast:nt.push("-----BEGIN PGP MESSAGE, PART "+Ce+"-----\n"),nt.push(ve(qe,Ve)),nt.push(de(Ae)),nt.push("=",_e(it)),nt.push("-----END PGP MESSAGE, PART "+Ce+"-----\n");break;case er.armor.signed:nt.push("\n-----BEGIN PGP SIGNED MESSAGE-----\n"),nt.push("Hash: "+rt+"\n\n"),nt.push(tt.replace(/^-/gm,"- -")),nt.push("\n-----BEGIN PGP SIGNATURE-----\n"),nt.push(ve(qe,Ve)),nt.push(de(Ae)),nt.push("=",_e(it)),nt.push("-----END PGP SIGNATURE-----\n");break;case er.armor.message:nt.push("-----BEGIN PGP MESSAGE-----\n"),nt.push(ve(qe,Ve)),nt.push(de(Ae)),nt.push("=",_e(it)),nt.push("-----END PGP MESSAGE-----\n");break;case er.armor.publicKey:nt.push("-----BEGIN PGP PUBLIC KEY BLOCK-----\n"),nt.push(ve(qe,Ve)),nt.push(de(Ae)),nt.push("=",_e(it)),nt.push("-----END PGP PUBLIC KEY BLOCK-----\n");break;case er.armor.privateKey:nt.push("-----BEGIN PGP PRIVATE KEY BLOCK-----\n"),nt.push(ve(qe,Ve)),nt.push(de(Ae)),nt.push("=",_e(it)),nt.push("-----END PGP PRIVATE KEY BLOCK-----\n");break;case er.armor.signature:nt.push("-----BEGIN PGP SIGNATURE-----\n"),nt.push(ve(qe,Ve)),nt.push(de(Ae)),nt.push("=",_e(it)),nt.push("-----END PGP SIGNATURE-----\n")}return Zt.concat(nt)}class Me{constructor(){this.bytes=""}read(ke){this.bytes=Zt.uint8ArrayToString(ke.subarray(0,8))}write(){return Zt.stringToUint8Array(this.bytes)}toHex(){return Zt.uint8ArrayToHex(Zt.stringToUint8Array(this.bytes))}equals(ke,Ae=!1){return Ae&&(ke.isWildcard()||this.isWildcard())||this.bytes===ke.bytes}isNull(){return""===this.bytes}isWildcard(){return/^0+$/.test(this.toHex())}static mapToHex(ke){return ke.toHex()}static fromID(ke){const Ae=new Me;return Ae.read(Zt.hexToUint8Array(ke)),Ae}static wildcard(){const ke=new Me;return ke.read(new Uint8Array(8)),ke}}var nr=function(){var ke,Ae,Ce=!1;function i(Ce,ze){var qe=ke[(Ae[Ce]+Ae[ze])%255];return 0!==Ce&&0!==ze||(qe=0),qe}var ze,qe,Ve,tt,rt=!1;function u(){function u(Ce){var ze,qe,Ve;for(qe=Ve=function(Ce){var ze=ke[255-Ae[Ce]];return 0===Ce&&(ze=0),ze}(Ce),ze=0;ze<4;ze++)Ve^=qe=255&(qe<<1|qe>>>7);return Ve^=99}Ce||function(){ke=[],Ae=[];var ze,qe,Ve=1;for(ze=0;ze<255;ze++)ke[ze]=Ve,qe=128&Ve,Ve<<=1,Ve&=255,128===qe&&(Ve^=27),Ve^=ke[ze],Ae[ke[ze]]=ze;ke[255]=ke[0],Ae[0]=0,Ce=!0}(),ze=[],qe=[],Ve=[[],[],[],[]],tt=[[],[],[],[]];for(var it=0;it<256;it++){var nt=u(it);ze[it]=nt,qe[nt]=it,Ve[0][it]=i(2,nt)<<24|nt<<16|nt<<8|i(3,nt),tt[0][nt]=i(14,it)<<24|i(9,it)<<16|i(13,it)<<8|i(11,it);for(var ot=1;ot<4;ot++)Ve[ot][it]=Ve[ot-1][it]>>>8|Ve[ot-1][it]<<24,tt[ot][nt]=tt[ot-1][nt]>>>8|tt[ot-1][nt]<<24}rt=!0}var h=function(ke,Ae){rt||u();var Ce=new Uint32Array(Ae);Ce.set(ze,512),Ce.set(qe,768);for(var it=0;it<4;it++)Ce.set(Ve[it],4096+1024*it>>2),Ce.set(tt[it],8192+1024*it>>2);var nt=function(ke,Ae,Ce){"use asm";var ze=0,qe=0,Ve=0,tt=0,rt=0,it=0,nt=0,ot=0,ct=0,ht=0,ft=0,yt=0,mt=0,kt=0,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ke=ke|0;Ae=Ae|0;Ce=Ce|0;ze=ze|0;ct=ke,ht=Ae,ft=Ce,yt=ze}function F(ke,Ae,Ce,ze){ke=ke|0;Ae=Ae|0;Ce=Ce|0;ze=ze|0;mt=ke,kt=Ae,St=Ce,Et=ze}function N(ke,Ae,Ce,ze){ke=ke|0;Ae=Ae|0;Ce=Ce|0;ze=ze|0;yt=~Et&yt|Et&ze,ft=~St&ft|St&Ce,ht=~kt&ht|kt&Ae,ct=~mt&ct|mt&ke}function j(ke){ke=ke|0;if(ke&15)return-1;It[ke|0]=ze>>>24,It[ke|1]=ze>>>16&255,It[ke|2]=ze>>>8&255,It[ke|3]=ze&255,It[ke|4]=qe>>>24,It[ke|5]=qe>>>16&255,It[ke|6]=qe>>>8&255,It[ke|7]=qe&255,It[ke|8]=Ve>>>24,It[ke|9]=Ve>>>16&255,It[ke|10]=Ve>>>8&255,It[ke|11]=Ve&255,It[ke|12]=tt>>>24,It[ke|13]=tt>>>16&255,It[ke|14]=tt>>>8&255,It[ke|15]=tt&255;return 16}function L(ke){ke=ke|0;if(ke&15)return-1;It[ke|0]=rt>>>24,It[ke|1]=rt>>>16&255,It[ke|2]=rt>>>8&255,It[ke|3]=rt&255,It[ke|4]=it>>>24,It[ke|5]=it>>>16&255,It[ke|6]=it>>>8&255,It[ke|7]=it&255,It[ke|8]=nt>>>24,It[ke|9]=nt>>>16&255,It[ke|10]=nt>>>8&255,It[ke|11]=nt&255,It[ke|12]=ot>>>24,It[ke|13]=ot>>>16&255,It[ke|14]=ot>>>8&255,It[ke|15]=ot&255;return 16}function W(){x(0,0,0,0);Pt=ze,Bt=qe,Dt=Ve,Rt=tt}function H(ke,Ae,Ce){ke=ke|0;Ae=Ae|0;Ce=Ce|0;var rt=0;if(Ae&15)return-1;while((Ce|0)>=16){Ut[ke&7](It[Ae|0]<<24|It[Ae|1]<<16|It[Ae|2]<<8|It[Ae|3],It[Ae|4]<<24|It[Ae|5]<<16|It[Ae|6]<<8|It[Ae|7],It[Ae|8]<<24|It[Ae|9]<<16|It[Ae|10]<<8|It[Ae|11],It[Ae|12]<<24|It[Ae|13]<<16|It[Ae|14]<<8|It[Ae|15]);It[Ae|0]=ze>>>24,It[Ae|1]=ze>>>16&255,It[Ae|2]=ze>>>8&255,It[Ae|3]=ze&255,It[Ae|4]=qe>>>24,It[Ae|5]=qe>>>16&255,It[Ae|6]=qe>>>8&255,It[Ae|7]=qe&255,It[Ae|8]=Ve>>>24,It[Ae|9]=Ve>>>16&255,It[Ae|10]=Ve>>>8&255,It[Ae|11]=Ve&255,It[Ae|12]=tt>>>24,It[Ae|13]=tt>>>16&255,It[Ae|14]=tt>>>8&255,It[Ae|15]=tt&255;rt=rt+16|0,Ae=Ae+16|0,Ce=Ce-16|0}return rt|0}function G(ke,Ae,Ce){ke=ke|0;Ae=Ae|0;Ce=Ce|0;var ze=0;if(Ae&15)return-1;while((Ce|0)>=16){Ot[ke&1](It[Ae|0]<<24|It[Ae|1]<<16|It[Ae|2]<<8|It[Ae|3],It[Ae|4]<<24|It[Ae|5]<<16|It[Ae|6]<<8|It[Ae|7],It[Ae|8]<<24|It[Ae|9]<<16|It[Ae|10]<<8|It[Ae|11],It[Ae|12]<<24|It[Ae|13]<<16|It[Ae|14]<<8|It[Ae|15]);ze=ze+16|0,Ae=Ae+16|0,Ce=Ce-16|0}return ze|0}var Ut=[x,M,C,K,D,R,I,U];var Ot=[C,B];return{set_rounds:T,set_state:z,set_iv:q,set_nonce:O,set_mask:F,set_counter:N,get_state:j,get_iv:L,gcm_init:W,cipher:H,mac:G}}({Uint8Array:Uint8Array,Uint32Array:Uint32Array},ke,Ae);return nt.set_key=function(ke,Ae,qe,Ve,rt,it,ot,ct,ht){var ft=Ce.subarray(0,60),yt=Ce.subarray(256,316);ft.set([Ae,qe,Ve,rt,it,ot,ct,ht]);for(var mt=ke,kt=1;mt<4*ke+28;mt++){var St=ft[mt-1];(mt%ke==0||8===ke&&mt%ke==4)&&(St=ze[St>>>24]<<24^ze[St>>>16&255]<<16^ze[St>>>8&255]<<8^ze[255&St]),mt%ke==0&&(St=St<<8^St>>>24^kt<<24,kt=kt<<1^(128&kt?27:0)),ft[mt]=ft[mt-ke]^St}for(var Et=0;Et=mt-4?St:tt[0][ze[St>>>24]]^tt[1][ze[St>>>16&255]]^tt[2][ze[St>>>8&255]]^tt[3][ze[255&St]]}nt.set_rounds(ke+5)},nt};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 Ke(ke){return ke instanceof Uint8Array}function De(ke,Ae){const Ce=ke?ke.byteLength:Ae||65536;if(4095&Ce||Ce<=0)throw Error("heap size must be a positive integer and a multiple of 4096");return ke=ke||new Uint8Array(new ArrayBuffer(Ce))}function Re(ke,Ae,Ce,ze,qe){const Ve=ke.length-Ae,tt=Veke+Ae.length),0),Ce=new Uint8Array(Ae);let ze=0;for(let Ae=0;Ae>2,qe.getUint32(0),qe.getUint32(4),qe.getUint32(8),qe.getUint32(12),ze>16?qe.getUint32(16):0,ze>16?qe.getUint32(20):0,ze>24?qe.getUint32(24):0,ze>24?qe.getUint32(28):0),void 0!==Ae){if(16!==Ae.length)throw new Be("illegal iv size");let ke=new DataView(Ae.buffer,Ae.byteOffset,Ae.byteLength);Ce.set_iv(ke.getUint32(0),ke.getUint32(4),ke.getUint32(8),ke.getUint32(12))}else Ce.set_iv(0,0,0,0)}AES_Encrypt_process(ke){if(!Ke(ke))throw new TypeError("data isn't of expected type");let{heap:Ae,asm:Ce}=this.acquire_asm(),ze=nr.ENC[this.mode],qe=nr.HEAP_DATA,Ve=this.pos,tt=this.len,rt=0,it=ke.length||0,nt=0,ot=0,ct=new Uint8Array(tt+it&-16);for(;it>0;)ot=Re(Ae,Ve+tt,ke,rt,it),tt+=ot,rt+=ot,it-=ot,ot=Ce.cipher(ze,qe+Ve,tt),ot&&ct.set(Ae.subarray(Ve,Ve+ot),nt),nt+=ot,ot0;)ht=Re(Ae,Ve+tt,ke,rt,it),tt+=ht,rt+=ht,it-=ht,ht=Ce.cipher(ze,qe+Ve,tt-(it?0:ct)),ht&&ft.set(Ae.subarray(Ve,Ve+ht),nt),nt+=ht,ht0){if(Ve%16){if(this.hasOwnProperty("padding"))throw new Be("data length must be a multiple of the block size");Ve+=16-Ve%16}if(Ae.cipher(Ce,ze+qe,Ve),this.hasOwnProperty("padding")&&this.padding){let Ae=ke[qe+tt-1];if(Ae<1||Ae>16||Ae>tt)throw new Te("bad padding");let Ce=0;for(let ze=Ae;ze>1;ze--)Ce|=Ae^ke[qe+tt-ze];if(Ce)throw new Te("bad padding");tt-=Ae}}const rt=new Uint8Array(tt);return tt>0&&rt.set(ke.subarray(qe,qe+tt)),this.pos=0,this.len=0,this.release_asm(),rt}}class Fe{static encrypt(ke,Ae,Ce=!1){return new Fe(Ae,Ce).encrypt(ke)}static decrypt(ke,Ae,Ce=!1){return new Fe(Ae,Ce).decrypt(ke)}constructor(ke,Ae=!1,Ce){this.aes=Ce||new Oe(ke,void 0,Ae,"ECB")}encrypt(ke){return Ie(this.aes.AES_Encrypt_process(ke),this.aes.AES_Encrypt_finish())}decrypt(ke){return Ie(this.aes.AES_Decrypt_process(ke),this.aes.AES_Decrypt_finish())}}function Ne(ke){const t=function(ke){const Ae=new Fe(ke);this.encrypt=function(ke){return Ae.encrypt(ke)},this.decrypt=function(ke){return Ae.decrypt(ke)}};return t.blockSize=t.prototype.blockSize=16,t.keySize=t.prototype.keySize=ke/8,t}function je(ke,Ae,Ce,ze,qe,Ve){const tt=[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],rt=[-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],it=[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],nt=[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],ot=[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],ct=[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],ht=[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],ft=[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 yt,mt,kt,St,Et,Pt,Bt,Dt,Rt,Tt,Kt,It,Ut,Ot,Nt=0,zt=Ae.length;const qt=32===ke.length?3:9;Dt=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&&(zt=(Ae=function(ke,Ae){const Ce=8-ke.length%8;let ze;if(2===Ae&&Ce<8)ze=32;else if(1===Ae)ze=Ce;else{if(Ae||!(Ce<8)){if(8===Ce)return ke;throw Error("des: invalid padding")}ze=0}const qe=new Uint8Array(ke.length+Ce);for(let Ae=0;Ae>>4^Bt),Bt^=kt,Pt^=kt<<4,kt=65535&(Pt>>>16^Bt),Bt^=kt,Pt^=kt<<16,kt=858993459&(Bt>>>2^Pt),Pt^=kt,Bt^=kt<<2,kt=16711935&(Bt>>>8^Pt),Pt^=kt,Bt^=kt<<8,kt=1431655765&(Pt>>>1^Bt),Bt^=kt,Pt^=kt<<1,Pt=Pt<<1|Pt>>>31,Bt=Bt<<1|Bt>>>31,mt=0;mt>>4|Bt<<28)^ke[yt+1],kt=Pt,Pt=Bt,Bt=kt^(rt[St>>>24&63]|nt[St>>>16&63]|ct[St>>>8&63]|ft[63&St]|tt[Et>>>24&63]|it[Et>>>16&63]|ot[Et>>>8&63]|ht[63&Et]);kt=Pt,Pt=Bt,Bt=kt}Pt=Pt>>>1|Pt<<31,Bt=Bt>>>1|Bt<<31,kt=1431655765&(Pt>>>1^Bt),Bt^=kt,Pt^=kt<<1,kt=16711935&(Bt>>>8^Pt),Pt^=kt,Bt^=kt<<8,kt=858993459&(Bt>>>2^Pt),Pt^=kt,Bt^=kt<<2,kt=65535&(Pt>>>16^Bt),Bt^=kt,Pt^=kt<<16,kt=252645135&(Pt>>>4^Bt),Bt^=kt,Pt^=kt<<4,1===ze&&(Ce?(Rt=Pt,Kt=Bt):(Pt^=Tt,Bt^=It)),Ft[Lt++]=Pt>>>24,Ft[Lt++]=Pt>>>16&255,Ft[Lt++]=Pt>>>8&255,Ft[Lt++]=255&Pt,Ft[Lt++]=Bt>>>24,Ft[Lt++]=Bt>>>16&255,Ft[Lt++]=Bt>>>8&255,Ft[Lt++]=255&Bt}return Ce||(Ft=function(ke,Ae){let Ce,ze=null;if(2===Ae)Ce=32;else if(1===Ae)ze=ke[ke.length-1];else{if(Ae)throw Error("des: invalid padding");Ce=0}if(!ze){for(ze=1;ke[ke.length-ze]===Ce;)ze++;ze--}return ke.subarray(0,ke.length-ze)}(Ft,Ve)),Ft}function Le(ke){const Ae=[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],ze=[0,8,2048,2056,16777216,16777224,16779264,16779272,0,8,2048,2056,16777216,16777224,16779264,16779272],qe=[0,2097152,134217728,136314880,8192,2105344,134225920,136323072,131072,2228224,134348800,136445952,139264,2236416,134356992,136454144],Ve=[0,262144,16,262160,0,262144,16,262160,4096,266240,4112,266256,4096,266240,4112,266256],tt=[0,1024,32,1056,0,1024,32,1056,33554432,33555456,33554464,33555488,33554432,33555456,33554464,33555488],rt=[0,268435456,524288,268959744,2,268435458,524290,268959746,0,268435456,524288,268959744,2,268435458,524290,268959746],it=[0,65536,2048,67584,536870912,536936448,536872960,536938496,131072,196608,133120,198656,537001984,537067520,537004032,537069568],nt=[0,262144,0,262144,2,262146,2,262146,33554432,33816576,33554432,33816576,33554434,33816578,33554434,33816578],ot=[0,268435456,8,268435464,0,268435456,8,268435464,1024,268436480,1032,268436488,1024,268436480,1032,268436488],ct=[0,32,0,32,1048576,1048608,1048576,1048608,8192,8224,8192,8224,1056768,1056800,1056768,1056800],ht=[0,16777216,512,16777728,2097152,18874368,2097664,18874880,67108864,83886080,67109376,83886592,69206016,85983232,69206528,85983744],ft=[0,4096,134217728,134221824,524288,528384,134742016,134746112,16,4112,134217744,134221840,524304,528400,134742032,134746128],yt=[0,4,256,260,0,4,256,260,1,5,257,261,1,5,257,261],mt=ke.length>8?3:1,kt=Array(32*mt),St=[0,0,1,1,1,1,1,1,0,1,1,1,1,1,1,0];let Et,Pt,Bt,Dt=0,Rt=0;for(let Tt=0;Tt>>4^Tt),Tt^=Bt,mt^=Bt<<4,Bt=65535&(Tt>>>-16^mt),mt^=Bt,Tt^=Bt<<-16,Bt=858993459&(mt>>>2^Tt),Tt^=Bt,mt^=Bt<<2,Bt=65535&(Tt>>>-16^mt),mt^=Bt,Tt^=Bt<<-16,Bt=1431655765&(mt>>>1^Tt),Tt^=Bt,mt^=Bt<<1,Bt=16711935&(Tt>>>8^mt),mt^=Bt,Tt^=Bt<<8,Bt=1431655765&(mt>>>1^Tt),Tt^=Bt,mt^=Bt<<1,Bt=mt<<8|Tt>>>20&240,mt=Tt<<24|Tt<<8&16711680|Tt>>>8&65280|Tt>>>24&240,Tt=Bt;for(let ke=0;ke<16;ke++)St[ke]?(mt=mt<<2|mt>>>26,Tt=Tt<<2|Tt>>>26):(mt=mt<<1|mt>>>27,Tt=Tt<<1|Tt>>>27),mt&=-15,Tt&=-15,Et=Ae[mt>>>28]|Ce[mt>>>24&15]|ze[mt>>>20&15]|qe[mt>>>16&15]|Ve[mt>>>12&15]|tt[mt>>>8&15]|rt[mt>>>4&15],Pt=it[Tt>>>28]|nt[Tt>>>24&15]|ot[Tt>>>20&15]|ct[Tt>>>16&15]|ht[Tt>>>12&15]|ft[Tt>>>8&15]|yt[Tt>>>4&15],Bt=65535&(Pt>>>16^Et),kt[Rt++]=Et^Bt,kt[Rt++]=Pt^Bt<<16}return kt}function We(ke){this.key=[];for(let Ae=0;Ae<3;Ae++)this.key.push(new Uint8Array(ke.subarray(8*Ae,8*Ae+8)));this.encrypt=function(ke){return je(Le(this.key[2]),je(Le(this.key[1]),je(Le(this.key[0]),ke,!0,0,null,null),!1,0,null,null),!0,0,null,null)}}function He(){this.BlockSize=8,this.KeySize=16,this.setKey=function(ke){if(this.masking=Array(16),this.rotate=Array(16),this.reset(),ke.length!==this.KeySize)throw Error("CAST-128: keys must be 16 bytes");return this.keySchedule(ke),!0},this.reset=function(){for(let ke=0;ke<16;ke++)this.masking[ke]=0,this.rotate[ke]=0},this.getBlockSize=function(){return this.BlockSize},this.encrypt=function(ke){const Ae=Array(ke.length);for(let Ce=0;Ce>>24&255,Ae[Ce+1]=Ve>>>16&255,Ae[Ce+2]=Ve>>>8&255,Ae[Ce+3]=255&Ve,Ae[Ce+4]=qe>>>24&255,Ae[Ce+5]=qe>>>16&255,Ae[Ce+6]=qe>>>8&255,Ae[Ce+7]=255&qe}return Ae},this.decrypt=function(ke){const Ae=Array(ke.length);for(let Ce=0;Ce>>24&255,Ae[Ce+1]=Ve>>>16&255,Ae[Ce+2]=Ve>>>8&255,Ae[Ce+3]=255&Ve,Ae[Ce+4]=qe>>>24&255,Ae[Ce+5]=qe>>16&255,Ae[Ce+6]=qe>>8&255,Ae[Ce+7]=255&qe}return Ae};const ke=[,,,,];ke[0]=[,,,,],ke[0][0]=[4,0,13,15,12,14,8],ke[0][1]=[5,2,16,18,17,19,10],ke[0][2]=[6,3,23,22,21,20,9],ke[0][3]=[7,1,26,25,27,24,11],ke[1]=[,,,,],ke[1][0]=[0,6,21,23,20,22,16],ke[1][1]=[1,4,0,2,1,3,18],ke[1][2]=[2,5,7,6,5,4,17],ke[1][3]=[3,7,10,9,11,8,19],ke[2]=[,,,,],ke[2][0]=[4,0,13,15,12,14,8],ke[2][1]=[5,2,16,18,17,19,10],ke[2][2]=[6,3,23,22,21,20,9],ke[2][3]=[7,1,26,25,27,24,11],ke[3]=[,,,,],ke[3][0]=[0,6,21,23,20,22,16],ke[3][1]=[1,4,0,2,1,3,18],ke[3][2]=[2,5,7,6,5,4,17],ke[3][3]=[3,7,10,9,11,8,19];const Ae=[,,,,];function r(ke,Ae,ze){const qe=Ae+ke,Ve=qe<>>32-ze;return(Ce[0][Ve>>>24]^Ce[1][Ve>>>16&255])-Ce[2][Ve>>>8&255]+Ce[3][255&Ve]}function i(ke,Ae,ze){const qe=Ae^ke,Ve=qe<>>32-ze;return Ce[0][Ve>>>24]-Ce[1][Ve>>>16&255]+Ce[2][Ve>>>8&255]^Ce[3][255&Ve]}function n(ke,Ae,ze){const qe=Ae-ke,Ve=qe<>>32-ze;return(Ce[0][Ve>>>24]+Ce[1][Ve>>>16&255]^Ce[2][Ve>>>8&255])-Ce[3][255&Ve]}Ae[0]=[,,,,],Ae[0][0]=[24,25,23,22,18],Ae[0][1]=[26,27,21,20,22],Ae[0][2]=[28,29,19,18,25],Ae[0][3]=[30,31,17,16,28],Ae[1]=[,,,,],Ae[1][0]=[3,2,12,13,8],Ae[1][1]=[1,0,14,15,13],Ae[1][2]=[7,6,8,9,3],Ae[1][3]=[5,4,10,11,7],Ae[2]=[,,,,],Ae[2][0]=[19,18,28,29,25],Ae[2][1]=[17,16,30,31,28],Ae[2][2]=[23,22,24,25,18],Ae[2][3]=[21,20,26,27,22],Ae[3]=[,,,,],Ae[3][0]=[8,9,7,6,3],Ae[3][1]=[10,11,5,4,7],Ae[3][2]=[12,13,3,2,8],Ae[3][3]=[14,15,1,0,13],this.keySchedule=function(ze){const qe=[,,,,,,,,],Ve=Array(32);let tt;for(let ke=0;ke<4;ke++)tt=4*ke,qe[ke]=ze[tt]<<24|ze[tt+1]<<16|ze[tt+2]<<8|ze[tt+3];const rt=[6,7,4,5];let it,nt=0;for(let ze=0;ze<2;ze++)for(let ze=0;ze<4;ze++){for(tt=0;tt<4;tt++){const Ae=ke[ze][tt];it=qe[Ae[1]],it^=Ce[4][qe[Ae[2]>>>2]>>>24-8*(3&Ae[2])&255],it^=Ce[5][qe[Ae[3]>>>2]>>>24-8*(3&Ae[3])&255],it^=Ce[6][qe[Ae[4]>>>2]>>>24-8*(3&Ae[4])&255],it^=Ce[7][qe[Ae[5]>>>2]>>>24-8*(3&Ae[5])&255],it^=Ce[rt[tt]][qe[Ae[6]>>>2]>>>24-8*(3&Ae[6])&255],qe[Ae[0]]=it}for(tt=0;tt<4;tt++){const ke=Ae[ze][tt];it=Ce[4][qe[ke[0]>>>2]>>>24-8*(3&ke[0])&255],it^=Ce[5][qe[ke[1]>>>2]>>>24-8*(3&ke[1])&255],it^=Ce[6][qe[ke[2]>>>2]>>>24-8*(3&ke[2])&255],it^=Ce[7][qe[ke[3]>>>2]>>>24-8*(3&ke[3])&255],it^=Ce[4+tt][qe[ke[4]>>>2]>>>24-8*(3&ke[4])&255],Ve[nt]=it,nt++}}for(let ke=0;ke<16;ke++)this.masking[ke]=Ve[ke],this.rotate[ke]=31&Ve[16+ke]};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 Ge(ke){this.cast5=new He,this.cast5.setKey(ke),this.encrypt=function(ke){return this.cast5.encrypt(ke)}}We.keySize=We.prototype.keySize=24,We.blockSize=We.prototype.blockSize=8,Ge.blockSize=Ge.prototype.blockSize=8,Ge.keySize=Ge.prototype.keySize=16;const _r=4294967295;function $e(ke,Ae){return(ke<>>32-Ae)&_r}function Ze(ke,Ae){return ke[Ae]|ke[Ae+1]<<8|ke[Ae+2]<<16|ke[Ae+3]<<24}function Ye(ke,Ae,Ce){ke.splice(Ae,4,255&Ce,Ce>>>8&255,Ce>>>16&255,Ce>>>24&255)}function Xe(ke,Ae){return ke>>>8*Ae&255}function Qe(ke){this.tf=function(){let ke=null,Ae=null,Ce=-1,ze=[],qe=[[],[],[],[]];function a(ke){return qe[0][Xe(ke,0)]^qe[1][Xe(ke,1)]^qe[2][Xe(ke,2)]^qe[3][Xe(ke,3)]}function s(ke){return qe[0][Xe(ke,3)]^qe[1][Xe(ke,0)]^qe[2][Xe(ke,1)]^qe[3][Xe(ke,2)]}function o(ke,Ae){let Ce=a(Ae[0]),qe=s(Ae[1]);Ae[2]=$e(Ae[2]^Ce+qe+ze[4*ke+8]&_r,31),Ae[3]=$e(Ae[3],1)^Ce+2*qe+ze[4*ke+9]&_r,Ce=a(Ae[2]),qe=s(Ae[3]),Ae[0]=$e(Ae[0]^Ce+qe+ze[4*ke+10]&_r,31),Ae[1]=$e(Ae[1],1)^Ce+2*qe+ze[4*ke+11]&_r}function c(ke,Ae){let Ce=a(Ae[0]),qe=s(Ae[1]);Ae[2]=$e(Ae[2],1)^Ce+qe+ze[4*ke+10]&_r,Ae[3]=$e(Ae[3]^Ce+2*qe+ze[4*ke+11]&_r,31),Ce=a(Ae[2]),qe=s(Ae[3]),Ae[0]=$e(Ae[0],1)^Ce+qe+ze[4*ke+8]&_r,Ae[1]=$e(Ae[1]^Ce+2*qe+ze[4*ke+9]&_r,31)}return{name:"twofish",blocksize:16,open:function(Ae){let Ce,Ve,tt,rt,it;ke=Ae;const nt=[],ot=[],ct=[];let ht;const ft=[];let yt,mt,kt;const St=[[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]],Et=[[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]],Pt=[[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]],Bt=[[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]],Dt=[0,8,1,9,2,10,3,11,4,12,5,13,6,14,7,15],Rt=[0,9,2,11,4,13,6,15,8,1,10,3,12,5,14,7],Tt=[[],[]],Kt=[[],[],[],[]];function E(ke){return ke^ke>>2^[0,90,180,238][3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=P(yt),Kt[0][Ce]=yt+(mt<<8)+(kt<<16)+(kt<<24),Kt[2][Ce]=mt+(kt<<8)+(yt<<16)+(kt<<24),yt=Tt[0][Ce],mt=E(yt),kt=P(yt),Kt[1][Ce]=kt+(kt<<8)+(mt<<16)+(yt<<24),Kt[3][Ce]=mt+(yt<<8)+(kt<<16)+(mt<<24);for(ht=ct.length/2,Ce=0;Ce=0;ke--)c(ke,Ve);Ye(Ae,Ce,Ve[2]^ze[0]),Ye(Ae,Ce+4,Ve[3]^ze[1]),Ye(Ae,Ce+8,Ve[0]^ze[2]),Ye(Ae,Ce+12,Ve[1]^ze[3]),Ce+=16},finalize:function(){return Ae}}}(),this.tf.open(Array.from(ke),0),this.encrypt=function(ke){return this.tf.encrypt(Array.from(ke),0)}}function Je(){}function et(ke){this.bf=new Je,this.bf.init(ke),this.encrypt=function(ke){return this.bf.encryptBlock(ke)}}Qe.keySize=Qe.prototype.keySize=32,Qe.blockSize=Qe.prototype.blockSize=16,Je.prototype.BLOCKSIZE=8,Je.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]],Je.prototype.PARRAY=[608135816,2242054355,320440878,57701188,2752067618,698298832,137296536,3964562569,1160258022,953160567,3193202383,887688300,3232508343,3380367581,1065670069,3041331479,2450970073,2306472731],Je.prototype.NN=16,Je.prototype._clean=function(ke){if(ke<0){ke=(2147483647&ke)+2147483648}return ke},Je.prototype._F=function(ke){let Ae;const Ce=255&ke,ze=255&(ke>>>=8),qe=255&(ke>>>=8),Ve=255&(ke>>>=8);return Ae=this.sboxes[0][Ve]+this.sboxes[1][qe],Ae^=this.sboxes[2][ze],Ae+=this.sboxes[3][Ce],Ae},Je.prototype._encryptBlock=function(ke){let Ae,Ce=ke[0],ze=ke[1];for(Ae=0;Ae>>24-8*Ae&255,qe[Ae+ze]=Ce[1]>>>24-8*Ae&255;return qe},Je.prototype._decryptBlock=function(ke){let Ae,Ce=ke[0],ze=ke[1];for(Ae=this.NN+1;Ae>1;--Ae){Ce^=this.parray[Ae],ze=this._F(Ce)^ze;const ke=Ce;Ce=ze,ze=ke}Ce^=this.parray[1],ze^=this.parray[0],ke[0]=this._clean(ze),ke[1]=this._clean(Ce)},Je.prototype.init=function(ke){let Ae,Ce=0;for(this.parray=[],Ae=0;Ae=ke.length&&(Ce=0);this.parray[Ae]=this.PARRAY[Ae]^ze}for(this.sboxes=[],Ae=0;Ae<4;++Ae)for(this.sboxes[Ae]=[],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],Bt[ke|44]<<24|Bt[ke|45]<<16|Bt[ke|46]<<8|Bt[ke|47],Bt[ke|48]<<24|Bt[ke|49]<<16|Bt[ke|50]<<8|Bt[ke|51],Bt[ke|52]<<24|Bt[ke|53]<<16|Bt[ke|54]<<8|Bt[ke|55],Bt[ke|56]<<24|Bt[ke|57]<<16|Bt[ke|58]<<8|Bt[ke|59],Bt[ke|60]<<24|Bt[ke|61]<<16|Bt[ke|62]<<8|Bt[ke|63])}function A(ke){ke=ke|0;Bt[ke|0]=ze>>>24;Bt[ke|1]=ze>>>16&255;Bt[ke|2]=ze>>>8&255;Bt[ke|3]=ze&255;Bt[ke|4]=qe>>>24;Bt[ke|5]=qe>>>16&255;Bt[ke|6]=qe>>>8&255;Bt[ke|7]=qe&255;Bt[ke|8]=Ve>>>24;Bt[ke|9]=Ve>>>16&255;Bt[ke|10]=Ve>>>8&255;Bt[ke|11]=Ve&255;Bt[ke|12]=tt>>>24;Bt[ke|13]=tt>>>16&255;Bt[ke|14]=tt>>>8&255;Bt[ke|15]=tt&255;Bt[ke|16]=rt>>>24;Bt[ke|17]=rt>>>16&255;Bt[ke|18]=rt>>>8&255;Bt[ke|19]=rt&255}function S(){ze=0x67452301;qe=0xefcdab89;Ve=0x98badcfe;tt=0x10325476;rt=0xc3d2e1f0;it=nt=0}function E(ke,Ae,Ce,ot,ct,ht,ft){ke=ke|0;Ae=Ae|0;Ce=Ce|0;ot=ot|0;ct=ct|0;ht=ht|0;ft=ft|0;ze=ke;qe=Ae;Ve=Ce;tt=ot;rt=ct;it=ht;nt=ft}function P(ke,Ae){ke=ke|0;Ae=Ae|0;var Ce=0;if(ke&63)return-1;while((Ae|0)>=64){k(ke);ke=ke+64|0;Ae=Ae-64|0;Ce=Ce+64|0}it=it+Ce|0;if(it>>>0>>0)nt=nt+1|0;return Ce|0}function x(ke,Ae,Ce){ke=ke|0;Ae=Ae|0;Ce=Ce|0;var ze=0,qe=0;if(ke&63)return-1;if(~Ce)if(Ce&31)return-1;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^0x36363636,Bt^0x36363636,Dt^0x36363636,Rt^0x36363636,Tt^0x36363636,Kt^0x36363636,It^0x36363636,Ut^0x36363636,Ot^0x36363636,Nt^0x36363636,zt^0x36363636,qt^0x36363636,Ft^0x36363636,Lt^0x36363636);ot=ze;ct=qe;ht=Ve;ft=tt;yt=rt;it=64;nt=0}function D(ke,Ae,Ce){ke=ke|0;Ae=Ae|0;Ce=Ce|0;var it=0,nt=0,ot=0,ct=0,ht=0,ft=0;if(ke&63)return-1;if(~Ce)if(Ce&31)return-1;ft=x(ke,Ae,-1)|0;it=ze,nt=qe,ot=Ve,ct=tt,ht=rt;C();_(it,nt,ot,ct,ht,0x80000000,0,0,0,0,0,0,0,0,0,672);if(~Ce)A(Ce);return ft|0}function R(ke,Ae,Ce,it,nt){ke=ke|0;Ae=Ae|0;Ce=Ce|0;it=it|0;nt=nt|0;var ot=0,ct=0,ht=0,ft=0,yt=0,mt=0,kt=0,St=0,Et=0,Pt=0;if(ke&63)return-1;if(~nt)if(nt&31)return-1;Bt[ke+Ae|0]=Ce>>>24;Bt[ke+Ae+1|0]=Ce>>>16&255;Bt[ke+Ae+2|0]=Ce>>>8&255;Bt[ke+Ae+3|0]=Ce&255;D(ke,Ae+4|0,-1)|0;ot=mt=ze,ct=kt=qe,ht=St=Ve,ft=Et=tt,yt=Pt=rt;it=it-1|0;while((it|0)>0){M();_(mt,kt,St,Et,Pt,0x80000000,0,0,0,0,0,0,0,0,0,672);mt=ze,kt=qe,St=Ve,Et=tt,Pt=rt;C();_(mt,kt,St,Et,Pt,0x80000000,0,0,0,0,0,0,0,0,0,672);mt=ze,kt=qe,St=Ve,Et=tt,Pt=rt;ot=ot^ze;ct=ct^qe;ht=ht^Ve;ft=ft^tt;yt=yt^rt;it=it-1|0}ze=ot;qe=ct;Ve=ht;tt=ft;rt=yt;if(~nt)A(nt);return 0}return{reset:S,init:E,process:P,finish:x,hmac_reset:M,hmac_init:K,hmac_finish:D,pbkdf2_generate_block:R}};class st{constructor(){this.pos=0,this.len=0}reset(){const{asm:ke}=this.acquire_asm();return this.result=null,this.pos=0,this.len=0,ke.reset(),this}process(ke){if(null!==this.result)throw new Ue("state must be reset before processing new data");const{asm:Ae,heap:Ce}=this.acquire_asm();let ze=this.pos,qe=this.len,Ve=0,tt=ke.length,rt=0;for(;tt>0;)rt=Re(Ce,ze+qe,ke,Ve,tt),qe+=rt,Ve+=rt,tt-=rt,rt=Ae.process(ze,qe),ze+=rt,qe-=rt,qe||(ze=0);return this.pos=ze,this.len=qe,this}finish(){if(null!==this.result)throw new Ue("state must be reset before processing new data");const{asm:ke,heap:Ae}=this.acquire_asm();return ke.finish(this.pos,this.len,0),this.result=new Uint8Array(this.HASH_SIZE),this.result.set(Ae.subarray(0,this.HASH_SIZE)),this.pos=0,this.len=0,this.release_asm(),this}}const xr=[],Br=[];class ut extends st{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=xr.pop()||De(),this.asm=Br.pop()||at({Uint8Array:Uint8Array},null,this.heap.buffer),this.reset()),{heap:this.heap,asm:this.asm}}release_asm(){void 0!==this.heap&&void 0!==this.asm&&(xr.push(this.heap),Br.push(this.asm)),this.heap=void 0,this.asm=void 0}static bytes(ke){return(new ut).process(ke).finish().result}}ut.NAME="sha1",ut.heap_pool=[],ut.asm_pool=[],ut.asm_function=at;const Dr=[],Rr=[];class dt extends st{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=Dr.pop()||De(),this.asm=Rr.pop()||function(ke,Ae,Ce){"use asm";var ze=0,qe=0,Ve=0,tt=0,rt=0,it=0,nt=0,ot=0,ct=0,ht=0,ft=0,yt=0,mt=0,kt=0,St=0,Et=0,Pt=0,Bt=0,Dt=0,Rt=0,Tt=0,Kt=0,It=0,Ut=0,Ot=0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ke|6]<<8|zt[ke|7],zt[ke|8]<<24|zt[ke|9]<<16|zt[ke|10]<<8|zt[ke|11],zt[ke|12]<<24|zt[ke|13]<<16|zt[ke|14]<<8|zt[ke|15],zt[ke|16]<<24|zt[ke|17]<<16|zt[ke|18]<<8|zt[ke|19],zt[ke|20]<<24|zt[ke|21]<<16|zt[ke|22]<<8|zt[ke|23],zt[ke|24]<<24|zt[ke|25]<<16|zt[ke|26]<<8|zt[ke|27],zt[ke|28]<<24|zt[ke|29]<<16|zt[ke|30]<<8|zt[ke|31],zt[ke|32]<<24|zt[ke|33]<<16|zt[ke|34]<<8|zt[ke|35],zt[ke|36]<<24|zt[ke|37]<<16|zt[ke|38]<<8|zt[ke|39],zt[ke|40]<<24|zt[ke|41]<<16|zt[ke|42]<<8|zt[ke|43],zt[ke|44]<<24|zt[ke|45]<<16|zt[ke|46]<<8|zt[ke|47],zt[ke|48]<<24|zt[ke|49]<<16|zt[ke|50]<<8|zt[ke|51],zt[ke|52]<<24|zt[ke|53]<<16|zt[ke|54]<<8|zt[ke|55],zt[ke|56]<<24|zt[ke|57]<<16|zt[ke|58]<<8|zt[ke|59],zt[ke|60]<<24|zt[ke|61]<<16|zt[ke|62]<<8|zt[ke|63])}function R(ke){ke=ke|0;zt[ke|0]=ze>>>24;zt[ke|1]=ze>>>16&255;zt[ke|2]=ze>>>8&255;zt[ke|3]=ze&255;zt[ke|4]=qe>>>24;zt[ke|5]=qe>>>16&255;zt[ke|6]=qe>>>8&255;zt[ke|7]=qe&255;zt[ke|8]=Ve>>>24;zt[ke|9]=Ve>>>16&255;zt[ke|10]=Ve>>>8&255;zt[ke|11]=Ve&255;zt[ke|12]=tt>>>24;zt[ke|13]=tt>>>16&255;zt[ke|14]=tt>>>8&255;zt[ke|15]=tt&255;zt[ke|16]=rt>>>24;zt[ke|17]=rt>>>16&255;zt[ke|18]=rt>>>8&255;zt[ke|19]=rt&255;zt[ke|20]=it>>>24;zt[ke|21]=it>>>16&255;zt[ke|22]=it>>>8&255;zt[ke|23]=it&255;zt[ke|24]=nt>>>24;zt[ke|25]=nt>>>16&255;zt[ke|26]=nt>>>8&255;zt[ke|27]=nt&255;zt[ke|28]=ot>>>24;zt[ke|29]=ot>>>16&255;zt[ke|30]=ot>>>8&255;zt[ke|31]=ot&255}function I(){ze=0x6a09e667;qe=0xbb67ae85;Ve=0x3c6ef372;tt=0xa54ff53a;rt=0x510e527f;it=0x9b05688c;nt=0x1f83d9ab;ot=0x5be0cd19;ct=ht=0}function U(ke,Ae,Ce,ft,yt,mt,kt,St,Et,Pt){ke=ke|0;Ae=Ae|0;Ce=Ce|0;ft=ft|0;yt=yt|0;mt=mt|0;kt=kt|0;St=St|0;Et=Et|0;Pt=Pt|0;ze=ke;qe=Ae;Ve=Ce;tt=ft;rt=yt;it=mt;nt=kt;ot=St;ct=Et;ht=Pt}function B(ke,Ae){ke=ke|0;Ae=Ae|0;var Ce=0;if(ke&63)return-1;while((Ae|0)>=64){D(ke);ke=ke+64|0;Ae=Ae-64|0;Ce=Ce+64|0}ct=ct+Ce|0;if(ct>>>0>>0)ht=ht+1|0;return Ce|0}function T(ke,Ae,Ce){ke=ke|0;Ae=Ae|0;Ce=Ce|0;var ze=0,qe=0;if(ke&63)return-1;if(~Ce)if(Ce&31)return-1;if((Ae|0)>=64){ze=B(ke,Ae)|0;if((ze|0)==-1)return-1;ke=ke+ze|0;Ae=Ae-ze|0}ze=ze+Ae|0;ct=ct+Ae|0;if(ct>>>0>>0)ht=ht+1|0;zt[ke|Ae]=0x80;if((Ae|0)>=56){for(qe=Ae+1|0;(qe|0)<64;qe=qe+1|0)zt[ke|qe]=0x00;D(ke);Ae=0;zt[ke|0]=0}for(qe=Ae+1|0;(qe|0)<59;qe=qe+1|0)zt[ke|qe]=0;zt[ke|56]=ht>>>21&255;zt[ke|57]=ht>>>13&255;zt[ke|58]=ht>>>5&255;zt[ke|59]=ht<<3&255|ct>>>29;zt[ke|60]=ct>>>21&255;zt[ke|61]=ct>>>13&255;z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(Ce&31)return-1;Pt=T(ke,Ae,-1)|0;ct=ze,ht=qe,ft=Ve,yt=tt,mt=rt,kt=it,St=nt,Et=ot;q();K(ct,ht,ft,yt,mt,kt,St,Et,0x80000000,0,0,0,0,0,0,768);if(~Ce)R(Ce);return Pt|0}function N(ke,Ae,Ce,ct,ht){ke=ke|0;Ae=Ae|0;Ce=Ce|0;ct=ct|0;ht=ht|0;var ft=0,yt=0,mt=0,kt=0,St=0,Et=0,Pt=0,Bt=0,Dt=0,Rt=0,Tt=0,Kt=0,It=0,Ut=0,Ot=0,Nt=0;if(ke&63)return-1;if(~ht)if(ht&31)return-1;zt[ke+Ae|0]=Ce>>>24;zt[ke+Ae+1|0]=Ce>>>16&255;zt[ke+Ae+2|0]=Ce>>>8&255;zt[ke+Ae+3|0]=Ce&255;F(ke,Ae+4|0,-1)|0;ft=Dt=ze,yt=Rt=qe,mt=Tt=Ve,kt=Kt=tt,St=It=rt,Et=Ut=it,Pt=Ot=nt,Bt=Nt=ot;ct=ct-1|0;while((ct|0)>0){z();K(Dt,Rt,Tt,Kt,It,Ut,Ot,Nt,0x80000000,0,0,0,0,0,0,768);Dt=ze,Rt=qe,Tt=Ve,Kt=tt,It=rt,Ut=it,Ot=nt,Nt=ot;q();K(Dt,Rt,Tt,Kt,It,Ut,Ot,Nt,0x80000000,0,0,0,0,0,0,768);Dt=ze,Rt=qe,Tt=Ve,Kt=tt,It=rt,Ut=it,Ot=nt,Nt=ot;ft=ft^ze;yt=yt^qe;mt=mt^Ve;kt=kt^tt;St=St^rt;Et=Et^it;Pt=Pt^nt;Bt=Bt^ot;ct=ct-1|0}ze=ft;qe=yt;Ve=mt;tt=kt;rt=St;it=Et;nt=Pt;ot=Bt;if(~ht)R(ht);return 0}return{reset:I,init:U,process:B,finish:T,hmac_reset:z,hmac_init:O,hmac_finish:F,pbkdf2_generate_block:N}}({Uint8Array:Uint8Array},null,this.heap.buffer),this.reset()),{heap:this.heap,asm:this.asm}}release_asm(){void 0!==this.heap&&void 0!==this.asm&&(Dr.push(this.heap),Rr.push(this.asm)),this.heap=void 0,this.asm=void 0}static bytes(ke){return(new dt).process(ke).finish().result}}dt.NAME="sha256";var Ir=pt;function pt(ke,Ae){if(!ke)throw Error(Ae||"Assertion failed")}pt.equal=function(ke,Ae,Ce){if(ke!=Ae)throw Error(Ce||"Assertion failed: "+ke+" != "+Ae)};var Ur=void 0!==ze?ze:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function bt(ke,Ae){return ke(Ae={exports:{}},Ae.exports),Ae.exports}var Lr=bt((function(ke){ke.exports="function"==typeof Object.create?function(ke,Ae){ke.super_=Ae,ke.prototype=Object.create(Ae.prototype,{constructor:{value:ke,enumerable:!1,writable:!0,configurable:!0}})}:function(ke,Ae){ke.super_=Ae;var r=function(){};r.prototype=Ae.prototype,ke.prototype=new r,ke.prototype.constructor=ke}})),Gr=bt((function(ke){try{var Ae=kt.default;if("function"!=typeof Ae.inherits)throw"";ke.exports=Ae.inherits}catch(Ae){ke.exports=Lr}}));function wt(ke){return(ke>>>24|ke>>>8&65280|ke<<8&16711680|(255&ke)<<24)>>>0}function vt(ke){return 1===ke.length?"0"+ke:ke}function _t(ke){return 7===ke.length?"0"+ke:6===ke.length?"00"+ke:5===ke.length?"000"+ke:4===ke.length?"0000"+ke:3===ke.length?"00000"+ke:2===ke.length?"000000"+ke:1===ke.length?"0000000"+ke:ke}var Vr={inherits:Gr,toArray:function(ke,Ae){if(Array.isArray(ke))return ke.slice();if(!ke)return[];var Ce=[];if("string"==typeof ke)if(Ae){if("hex"===Ae)for((ke=ke.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(ke="0"+ke),ze=0;ze>8,tt=255&qe;Ve?Ce.push(Ve,tt):Ce.push(tt)}else for(ze=0;ze>>0}return Ve},split32:function(ke,Ae){for(var Ce=Array(4*ke.length),ze=0,qe=0;ze>>24,Ce[qe+1]=Ve>>>16&255,Ce[qe+2]=Ve>>>8&255,Ce[qe+3]=255&Ve):(Ce[qe+3]=Ve>>>24,Ce[qe+2]=Ve>>>16&255,Ce[qe+1]=Ve>>>8&255,Ce[qe]=255&Ve)}return Ce},rotr32:function(ke,Ae){return ke>>>Ae|ke<<32-Ae},rotl32:function(ke,Ae){return ke<>>32-Ae},sum32:function(ke,Ae){return ke+Ae>>>0},sum32_3:function(ke,Ae,Ce){return ke+Ae+Ce>>>0},sum32_4:function(ke,Ae,Ce,ze){return ke+Ae+Ce+ze>>>0},sum32_5:function(ke,Ae,Ce,ze,qe){return ke+Ae+Ce+ze+qe>>>0},sum64:function(ke,Ae,Ce,ze){var qe=ke[Ae],Ve=ze+ke[Ae+1]>>>0,tt=(Ve>>0,ke[Ae+1]=Ve},sum64_hi:function(ke,Ae,Ce,ze){return(Ae+ze>>>0>>0},sum64_lo:function(ke,Ae,Ce,ze){return Ae+ze>>>0},sum64_4_hi:function(ke,Ae,Ce,ze,qe,Ve,tt,rt){var it=0,nt=Ae;return it+=(nt=nt+ze>>>0)>>0)>>0)>>0},sum64_4_lo:function(ke,Ae,Ce,ze,qe,Ve,tt,rt){return Ae+ze+Ve+rt>>>0},sum64_5_hi:function(ke,Ae,Ce,ze,qe,Ve,tt,rt,it,nt){var ot=0,ct=Ae;return ot+=(ct=ct+ze>>>0)>>0)>>0)>>0)>>0},sum64_5_lo:function(ke,Ae,Ce,ze,qe,Ve,tt,rt,it,nt){return Ae+ze+Ve+rt+nt>>>0},rotr64_hi:function(ke,Ae,Ce){return(Ae<<32-Ce|ke>>>Ce)>>>0},rotr64_lo:function(ke,Ae,Ce){return(ke<<32-Ce|Ae>>>Ce)>>>0},shr64_hi:function(ke,Ae,Ce){return ke>>>Ce},shr64_lo:function(ke,Ae,Ce){return(ke<<32-Ce|Ae>>>Ce)>>>0}};function At(){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 Xr=At;At.prototype.update=function(ke,Ae){if(ke=Vr.toArray(ke,Ae),this.pending?this.pending=this.pending.concat(ke):this.pending=ke,this.pendingTotal+=ke.length,this.pending.length>=this._delta8){var Ce=(ke=this.pending).length%this._delta8;this.pending=ke.slice(ke.length-Ce,ke.length),0===this.pending.length&&(this.pending=null),ke=Vr.join32(ke,0,ke.length-Ce,this.endian);for(var ze=0;ze>>24&255,ze[qe++]=ke>>>16&255,ze[qe++]=ke>>>8&255,ze[qe++]=255&ke}else for(ze[qe++]=255&ke,ze[qe++]=ke>>>8&255,ze[qe++]=ke>>>16&255,ze[qe++]=ke>>>24&255,ze[qe++]=0,ze[qe++]=0,ze[qe++]=0,ze[qe++]=0,Ve=8;Ve>>3},g1_256:function(ke){return ei(ke,17)^ei(ke,19)^ke>>>10}},ni=Vr.sum32,ai=Vr.sum32_4,ci=Vr.sum32_5,ui=ti.ch32,li=ti.maj32,pi=ti.s0_256,yi=ti.s1_256,mi=ti.g0_256,gi=ti.g1_256,bi=Qr.BlockHash,vi=[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 jt(){if(!(this instanceof jt))return new jt;bi.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=vi,this.W=Array(64)}Vr.inherits(jt,bi);var wi=jt;function Wt(){if(!(this instanceof Wt))return new Wt;wi.call(this),this.h=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]}jt.blockSize=512,jt.outSize=256,jt.hmacStrength=192,jt.padLength=64,jt.prototype._update=function(ke,Ae){for(var Ce=this.W,ze=0;ze<16;ze++)Ce[ze]=ke[Ae+ze];for(;ze>>32-qe,Ce)}function qr(ke,Ae,Ce,ze,qe,Ve,tt){return zr(Ae&Ce|~Ae&ze,ke,Ae,qe,Ve,tt)}function Or(ke,Ae,Ce,ze,qe,Ve,tt){return zr(Ae&ze|Ce&~ze,ke,Ae,qe,Ve,tt)}function Fr(ke,Ae,Ce,ze,qe,Ve,tt){return zr(Ae^Ce^ze,ke,Ae,qe,Ve,tt)}function Nr(ke,Ae,Ce,ze,qe,Ve,tt){return zr(Ce^(Ae|~ze),ke,Ae,qe,Ve,tt)}function jr(ke){const Ae=[];let Ce;for(Ce=0;Ce<64;Ce+=4)Ae[Ce>>2]=ke.charCodeAt(Ce)+(ke.charCodeAt(Ce+1)<<8)+(ke.charCodeAt(Ce+2)<<16)+(ke.charCodeAt(Ce+3)<<24);return Ae}const _n="0123456789abcdef".split("");function Wr(ke){let Ae="",Ce=0;for(;Ce<4;Ce++)Ae+=_n[ke>>8*Ce+4&15]+_n[ke>>8*Ce&15];return Ae}function Hr(ke,Ae){return ke+Ae&4294967295}const kn=Zt.getWebCrypto(),Sn=Zt.getNodeCrypto();function $r(ke){return async function(Ae){const Ce=Sn.createHash(ke);return Y(Ae,(ke=>{Ce.update(ke)}),(()=>new Uint8Array(Ce.digest())))}}function Zr(ke,Ae){return async function(Ce,ze=tr){if(_(Ce)&&(Ce=await ie(Ce)),!Zt.isStream(Ce)&&kn&&Ae&&Ce.length>=ze.minBytesForWebCrypto)return new Uint8Array(await kn.digest(Ae,Ce));const qe=ke();return Y(Ce,(ke=>{qe.update(ke)}),(()=>new Uint8Array(qe.digest())))}}function Yr(ke,Ae){return async function(Ce,ze=tr){if(_(Ce)&&(Ce=await ie(Ce)),Zt.isStream(Ce)){const Ae=new ke;return Y(Ce,(ke=>{Ae.process(ke)}),(()=>Ae.finish().result))}return kn&&Ae&&Ce.length>=ze.minBytesForWebCrypto?new Uint8Array(await kn.digest(Ae,Ce)):ke.bytes(Ce)}}let Mn;Mn=Sn?{md5:$r("md5"),sha1:$r("sha1"),sha224:$r("sha224"),sha256:$r("sha256"),sha384:$r("sha384"),sha512:$r("sha512"),ripemd:$r("ripemd160")}:{md5:async function(ke){const Ae=function(ke){const Ae=ke.length,Ce=[1732584193,-271733879,-1732584194,271733878];let ze;for(ze=64;ze<=ke.length;ze+=64)Tr(Ce,jr(ke.substring(ze-64,ze)));ke=ke.substring(ze-64);const qe=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];for(ze=0;ze>2]|=ke.charCodeAt(ze)<<(ze%4<<3);if(qe[ze>>2]|=128<<(ze%4<<3),ze>55)for(Tr(Ce,qe),ze=0;ze<16;ze++)qe[ze]=0;return qe[14]=8*Ae,Tr(Ce,qe),Ce}(Zt.uint8ArrayToString(ke));return Zt.hexToUint8Array(function(ke){for(let Ae=0;Ae>>8)-1}(ke,Ae,Ce,ze,32)}function p(ke,Ae){var Ce;for(Ce=0;Ce<16;Ce++)ke[Ce]=0|Ae[Ce]}function y(ke){var Ae,Ce,ze=1;for(Ae=0;Ae<16;Ae++)Ce=ke[Ae]+ze+65535,ze=Math.floor(Ce/65536),ke[Ae]=Ce-65536*ze;ke[0]+=ze-1+37*(ze-1)}function b(ke,Ae,Ce){for(var ze,qe=~(Ce-1),Ve=0;Ve<16;Ve++)ze=qe&(ke[Ve]^Ae[Ve]),ke[Ve]^=ze,Ae[Ve]^=ze}function m(ke,Ae){var Ce,ze,qe,Ve=t(),tt=t();for(Ce=0;Ce<16;Ce++)tt[Ce]=Ae[Ce];for(y(tt),y(tt),y(tt),ze=0;ze<2;ze++){for(Ve[0]=tt[0]-65517,Ce=1;Ce<15;Ce++)Ve[Ce]=tt[Ce]-65535-(Ve[Ce-1]>>16&1),Ve[Ce-1]&=65535;Ve[15]=tt[15]-32767-(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ar,Et+=(ze=Ae[13])*Vt,Pt+=ze*Zt,Bt+=ze*Xt,Dt+=ze*Jt,Rt+=ze*Yt,Tt+=ze*Qt,Kt+=ze*er,It+=ze*tr,Ut+=ze*rr,Ot+=ze*ir,Nt+=ze*nr,zt+=ze*sr,qt+=ze*vr,Ft+=ze*_r,Lt+=ze*kr,Ht+=ze*Ar,Pt+=(ze=Ae[14])*Vt,Bt+=ze*Zt,Dt+=ze*Xt,Rt+=ze*Jt,Tt+=ze*Yt,Kt+=ze*Qt,It+=ze*er,Ut+=ze*tr,Ot+=ze*rr,Nt+=ze*ir,zt+=ze*nr,qt+=ze*sr,Ft+=ze*vr,Lt+=ze*_r,Ht+=ze*kr,Gt+=ze*Ar,Bt+=(ze=Ae[15])*Vt,tt+=38*(Rt+=ze*Xt),rt+=38*(Tt+=ze*Jt),it+=38*(Kt+=ze*Yt),nt+=38*(It+=ze*Qt),ot+=38*(Ut+=ze*er),ct+=38*(Ot+=ze*tr),ht+=38*(Nt+=ze*rr),ft+=38*(zt+=ze*ir),yt+=38*(qt+=ze*nr),mt+=38*(Ft+=ze*sr),kt+=38*(Lt+=ze*vr),St+=38*(Ht+=ze*_r),Et+=38*(Gt+=ze*kr),Pt+=38*($t+=ze*Ar),Ve=(ze=(Ve+=38*(Dt+=ze*Zt))+(qe=1)+65535)-65536*(qe=Math.floor(ze/65536)),tt=(ze=tt+qe+65535)-65536*(qe=Math.floor(ze/65536)),rt=(ze=rt+qe+65535)-65536*(qe=Math.floor(ze/65536)),it=(ze=it+qe+65535)-65536*(qe=Math.floor(ze/65536)),nt=(ze=nt+qe+65535)-65536*(qe=Math.floor(ze/65536)),ot=(ze=ot+qe+65535)-65536*(qe=Math.floor(ze/65536)),ct=(ze=ct+qe+65535)-65536*(qe=Math.floor(ze/65536)),ht=(ze=ht+qe+65535)-65536*(qe=Math.floor(ze/65536)),ft=(ze=ft+qe+65535)-65536*(qe=Math.floor(ze/65536)),yt=(ze=yt+qe+65535)-65536*(qe=Math.floor(ze/65536)),mt=(ze=mt+qe+65535)-65536*(qe=Math.floor(ze/65536)),kt=(ze=kt+qe+65535)-65536*(qe=Math.floor(ze/65536)),St=(ze=St+qe+65535)-65536*(qe=Math.floor(ze/65536)),Et=(ze=Et+qe+65535)-65536*(qe=Math.floor(ze/65536)),Pt=(ze=Pt+qe+65535)-65536*(qe=Math.floor(ze/65536)),Bt=(ze=Bt+qe+65535)-65536*(qe=Math.floor(ze/65536)),Ve=(ze=(Ve+=qe-1+37*(qe-1))+(qe=1)+65535)-65536*(qe=Math.floor(ze/65536)),tt=(ze=tt+qe+65535)-65536*(qe=Math.floor(ze/65536)),rt=(ze=rt+qe+65535)-65536*(qe=Math.floor(ze/65536)),it=(ze=it+qe+65535)-65536*(qe=Math.floor(ze/65536)),nt=(ze=nt+qe+65535)-65536*(qe=Math.floor(ze/65536)),ot=(ze=ot+qe+65535)-65536*(qe=Math.floor(ze/65536)),ct=(ze=ct+qe+65535)-65536*(qe=Math.floor(ze/65536)),ht=(ze=ht+qe+65535)-65536*(qe=Math.floor(ze/65536)),ft=(ze=ft+qe+65535)-65536*(qe=Math.floor(ze/65536)),yt=(ze=yt+qe+65535)-65536*(qe=Math.floor(ze/65536)),mt=(ze=mt+qe+65535)-65536*(qe=Math.floor(ze/65536)),kt=(ze=kt+qe+65535)-65536*(qe=Math.floor(ze/65536)),St=(ze=St+qe+65535)-65536*(qe=Math.floor(ze/65536)),Et=(ze=Et+qe+65535)-65536*(qe=Math.floor(ze/65536)),Pt=(ze=Pt+qe+65535)-65536*(qe=Math.floor(ze/65536)),Bt=(ze=Bt+qe+65535)-65536*(qe=Math.floor(ze/65536)),Ve+=qe-1+37*(qe-1),ke[0]=Ve,ke[1]=tt,ke[2]=rt,ke[3]=it,ke[4]=nt,ke[5]=ot,ke[6]=ct,ke[7]=ht,ke[8]=ft,ke[9]=yt,ke[10]=mt,ke[11]=kt,ke[12]=St,ke[13]=Et,ke[14]=Pt,ke[15]=Bt}function S(ke,Ae){A(ke,Ae,Ae)}function E(ke,Ae){var Ce,ze=t();for(Ce=0;Ce<16;Ce++)ze[Ce]=Ae[Ce];for(Ce=253;Ce>=0;Ce--)S(ze,ze),2!==Ce&&4!==Ce&&A(ze,ze,Ae);for(Ce=0;Ce<16;Ce++)ke[Ce]=ze[Ce]}function P(ke,Ae,Ce){var ze,Ve,tt=new Uint8Array(32),rt=new Float64Array(80),it=t(),nt=t(),ot=t(),ct=t(),ht=t(),ft=t();for(Ve=0;Ve<31;Ve++)tt[Ve]=Ae[Ve];for(tt[31]=127&Ae[31]|64,tt[0]&=248,v(rt,Ce),Ve=0;Ve<16;Ve++)nt[Ve]=rt[Ve],ct[Ve]=it[Ve]=ot[Ve]=0;for(it[0]=ct[0]=1,Ve=254;Ve>=0;--Ve)b(it,nt,ze=tt[Ve>>>3]>>>(7&Ve)&1),b(ot,ct,ze),_(ht,it,ot),k(it,it,ot),_(ot,nt,ct),k(nt,nt,ct),S(ct,ht),S(ft,it),A(it,ot,it),A(ot,nt,ht),_(ht,it,ot),k(it,it,ot),S(nt,it),k(ot,ct,ft),A(it,ot,qe),_(it,it,ct),A(ot,ot,it),A(it,ct,ft),A(ct,nt,rt),S(nt,ht),b(it,nt,ze),b(ot,ct,ze);for(Ve=0;Ve<16;Ve++)rt[Ve+16]=it[Ve],rt[Ve+32]=ot[Ve],rt[Ve+48]=nt[Ve],rt[Ve+64]=ct[Ve];var yt=rt.subarray(32),mt=rt.subarray(16);return E(yt,yt),A(mt,mt,yt),m(ke,mt),0}function x(ke,Ce){return P(ke,Ce,Ae)}function M(ke,Ae){var Ce=t(),ze=t(),qe=t(),Ve=t(),rt=t(),it=t(),nt=t(),ot=t(),ct=t();k(Ce,ke[1],ke[0]),k(ct,Ae[1],Ae[0]),A(Ce,Ce,ct),_(ze,ke[0],ke[1]),_(ct,Ae[0],Ae[1]),A(ze,ze,ct),A(qe,ke[3],Ae[3]),A(qe,qe,tt),A(Ve,ke[2],Ae[2]),_(Ve,Ve,Ve),k(rt,ze,Ce),k(it,Ve,qe),_(nt,Ve,qe),_(ot,ze,Ce),A(ke[0],rt,it),A(ke[1],ot,nt),A(ke[2],nt,it),A(ke[3],rt,ot)}function C(ke,Ae,Ce){var ze;for(ze=0;ze<4;ze++)b(ke[ze],Ae[ze],Ce)}function K(ke,Ae){var Ce=t(),ze=t(),qe=t();E(qe,Ae[2]),A(Ce,Ae[0],qe),A(ze,Ae[1],qe),m(ke,ze),ke[31]^=w(Ce)<<7}function D(ke,Ae,qe){var Ve,tt;for(p(ke[0],Ce),p(ke[1],ze),p(ke[2],ze),p(ke[3],Ce),tt=255;tt>=0;--tt)C(ke,Ae,Ve=qe[tt/8|0]>>(7&tt)&1),M(Ae,ke),M(ke,ke),C(ke,Ae,Ve)}function R(ke,Ae){var Ce=[t(),t(),t(),t()];p(Ce[0],rt),p(Ce[1],it),p(Ce[2],ze),A(Ce[3],rt,it),D(ke,Ce,Ae)}function I(Ae,Ce,ze){var qe,Ve,tt=[t(),t(),t(),t()];for(ze||r(Ce,32),(qe=ke.hash(Ce.subarray(0,32)))[0]&=248,qe[31]&=127,qe[31]|=64,R(tt,qe),K(Ae,tt),Ve=0;Ve<32;Ve++)Ce[Ve+32]=Ae[Ve];return 0}var ot=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(ke,Ae){var Ce,ze,qe,Ve;for(ze=63;ze>=32;--ze){for(Ce=0,qe=ze-32,Ve=ze-12;qe>4)*ot[qe],Ce=Ae[qe]>>8,Ae[qe]&=255;for(qe=0;qe<32;qe++)Ae[qe]-=Ce*ot[qe];for(ze=0;ze<32;ze++)Ae[ze+1]+=Ae[ze]>>8,ke[ze]=255&Ae[ze]}function T(ke){var Ae,Ce=new Float64Array(64);for(Ae=0;Ae<64;Ae++)Ce[Ae]=ke[Ae];for(Ae=0;Ae<64;Ae++)ke[Ae]=0;B(ke,Ce)}function z(ke,Ae){var qe=t(),tt=t(),rt=t(),it=t(),ot=t(),ct=t(),ht=t();return p(ke[2],ze),v(ke[1],Ae),S(rt,ke[1]),A(it,rt,Ve),k(rt,rt,ke[2]),_(it,ke[2],it),S(ot,it),S(ct,ot),A(ht,ct,ot),A(qe,ht,rt),A(qe,qe,it),function(ke,Ae){var Ce,ze=t();for(Ce=0;Ce<16;Ce++)ze[Ce]=Ae[Ce];for(Ce=250;Ce>=0;Ce--)S(ze,ze),1!==Ce&&A(ze,ze,Ae);for(Ce=0;Ce<16;Ce++)ke[Ce]=ze[Ce]}(qe,qe),A(qe,qe,rt),A(qe,qe,it),A(qe,qe,it),A(ke[0],qe,it),S(tt,ke[0]),A(tt,tt,it),g(tt,rt)&&A(ke[0],ke[0],nt),S(tt,ke[0]),A(tt,tt,it),g(tt,rt)?-1:(w(ke[0])===Ae[31]>>7&&k(ke[0],Ce,ke[0]),A(ke[3],ke[0],ke[1]),0)}var ct=64;function O(){for(var ke=0;ke=0},ke.sign.keyPair=function(){var ke=new Uint8Array(32),Ae=new Uint8Array(64);return I(ke,Ae),{publicKey:ke,secretKey:Ae}},ke.sign.keyPair.fromSecretKey=function(ke){if(O(ke),64!==ke.length)throw Error("bad secret key size");for(var Ae=new Uint8Array(32),Ce=0;CeAe&&(ke=ke.subarray(0,Ae)),this.buffer.set(ke,this.size),this.size+=ke.length}async get(ke){if(!this.buffer)throw Error("RandomBuffer is not initialized");if(!(ke instanceof Uint8Array))throw Error("Invalid type: buf not an Uint8Array");if(this.sizeke&&(it.imod(Ve.leftShift(qe)).iadd(Ve),nt=it.mod(tt).toNumber())}while(!await oi(it,Ae,Ce));return it}async function oi(ke,Ae,Ce){return!(Ae&&!ke.dec().gcd(Ae).isOne())&&(!!await async function(ke){const Ae=await Zt.getBigInteger();return On.every((Ce=>0!==ke.mod(new Ae(Ce))))}(ke)&&(!!await async function(ke,Ae){const Ce=await Zt.getBigInteger();return(Ae=Ae||new Ce(2)).modExp(ke.dec(),ke).isOne()}(ke)&&!!await async function(ke,Ae,Ce){const ze=await Zt.getBigInteger(),qe=ke.bitLength();Ae||(Ae=Math.max(1,qe/48|0));const Ve=ke.dec();let tt=0;for(;!Ve.getBit(tt);)tt++;const rt=ke.rightShift(new ze(tt));for(;Ae>0;Ae--){let Ae,qe=(Ce?Ce():await ii(new ze(2),Ve)).modExp(rt,ke);if(!qe.isOne()&&!qe.equal(Ve)){for(Ae=1;AeAe-11)throw Error("Message too long");const ze=await async function(ke){const Ae=new Uint8Array(ke);let Ce=0;for(;Ce=8&!ze;if(Ae)return Zt.selectUint8Array(tt,Ve,Ae);if(tt)return Ve;throw Error("Decryption error")}async function di(ke,Ae,Ce){let ze;if(Ae.length!==xn.getHashByteLength(ke))throw Error("Invalid hash length");const qe=new Uint8Array(qn[ke].length);for(ze=0;zeWn.generateKeyPair("rsa",Ce,((Ce,ze,qe)=>{Ce?Ae(Ce):ke($n.decode(qe,"der"))}))));return{n:ze.modulus.toArrayLike(Uint8Array),e:ze.publicExponent.toArrayLike(Uint8Array),d:ze.privateExponent.toArrayLike(Uint8Array),p:ze.prime2.toArrayLike(Uint8Array),q:ze.prime1.toArrayLike(Uint8Array),u:ze.coefficient.toArrayLike(Uint8Array)}}let Ce,ze,qe;do{ze=await si(ke-(ke>>1),Ae,40),Ce=await si(ke>>1,Ae,40),qe=Ce.mul(ze)}while(qe.bitLength()!==ke);const Ve=Ce.dec().imul(ze.dec());return ze.lt(Ce)&&([Ce,ze]=[ze,Ce]),{n:qe.toUint8Array(),e:Ae.toUint8Array(),d:Ae.modInv(Ve).toUint8Array(),p:Ce.toUint8Array(),q:ze.toUint8Array(),u:Ce.modInv(ze).toUint8Array()}},validateParams:async function(ke,Ae,Ce,ze,qe,Ve){const tt=await Zt.getBigInteger();if(ke=new tt(ke),ze=new tt(ze),qe=new tt(qe),!ze.mul(qe).equal(ke))return!1;const rt=new tt(2);if(Ve=new tt(Ve),!ze.mul(Ve).mod(qe).isOne())return!1;Ae=new tt(Ae),Ce=new tt(Ce);const it=new tt(Math.floor(ke.bitLength()/3)),nt=await ii(rt,rt.leftShift(it)),ot=nt.mul(Ce).mul(Ae);return!(!ot.mod(ze.dec()).equal(nt)||!ot.mod(qe.dec()).equal(nt))}});var Xn=Object.freeze({__proto__:null,encrypt:async function(ke,Ae,Ce,ze){const qe=await Zt.getBigInteger();Ae=new qe(Ae),Ce=new qe(Ce),ze=new qe(ze);const Ve=new qe(await hi(ke,Ae.byteLength())),tt=await ii(new qe(1),Ae.dec());return{c1:Ce.modExp(tt,Ae).toUint8Array(),c2:ze.modExp(tt,Ae).imul(Ve).imod(Ae).toUint8Array()}},decrypt:async function(ke,Ae,Ce,ze,qe){const Ve=await Zt.getBigInteger();return ke=new Ve(ke),Ae=new Ve(Ae),Ce=new Ve(Ce),ze=new Ve(ze),fi(ke.modExp(ze,Ce).modInv(Ce).imul(Ae).imod(Ce).toUint8Array("be",Ce.byteLength()),qe)},validateParams:async function(ke,Ae,Ce,ze){const qe=await Zt.getBigInteger();ke=new qe(ke),Ae=new qe(Ae),Ce=new qe(Ce);const Ve=new qe(1);if(Ae.lte(Ve)||Ae.gte(ke))return!1;const tt=new qe(ke.bitLength()),rt=new qe(1023);if(tt.lt(rt))return!1;if(!Ae.modExp(ke.dec(),ke).isOne())return!1;let it=Ae;const nt=new qe(1),ot=new qe(2).leftShift(new qe(17));for(;nt.lt(ot);){if(it=it.mul(Ae).imod(ke),it.isOne())return!1;nt.iinc()}ze=new qe(ze);const ct=new qe(2),ht=await ii(ct.leftShift(tt.dec()),ct.leftShift(tt)),ft=ke.dec().imul(ht).iadd(ze);return!!Ce.equal(Ae.modExp(ft,ke))}});class _i{constructor(ke){if(ke instanceof _i)this.oid=ke.oid;else if(Zt.isArray(ke)||Zt.isUint8Array(ke)){if(6===(ke=new Uint8Array(ke))[0]){if(ke[1]!==ke.length-2)throw Error("Length mismatch in DER encoded oid");ke=ke.subarray(2)}this.oid=ke}else this.oid=""}read(ke){if(ke.length>=1){const Ae=ke[0];if(ke.length>=1+Ae)return this.oid=ke.subarray(1,1+Ae),1+this.oid.length}throw Error("Invalid oid")}write(){return Zt.concatUint8Array([new Uint8Array([this.oid.length]),this.oid])}toHex(){return Zt.uint8ArrayToHex(this.oid)}getName(){const ke=this.toHex();if(er.curve[ke])return er.write(er.curve,ke);throw Error("Unknown curve object identifier.")}}function ki(ke,Ae){return ke.keyPair({priv:Ae})}function Ai(ke,Ae){const Ce=ke.keyPair({pub:Ae});if(!0!==Ce.validate().result)throw Error("Invalid elliptic public key");return Ce}async function Si(ke){if(!tr.useIndutnyElliptic)throw Error("This curve is only supported in the full build of OpenPGP.js");const{default:Ae}=await Promise.resolve().then((function(){return qp}));return new Ae.ec(ke)}const Jn=Zt.getWebCrypto(),Qn=Zt.getNodeCrypto(),is={p256:"P-256",p384:"P-384",p521:"P-521"},os=Qn?Qn.getCurves():[],ls=Qn?{secp256k1:os.includes("secp256k1")?"secp256k1":void 0,p256:os.includes("prime256v1")?"prime256v1":void 0,p384:os.includes("secp384r1")?"secp384r1":void 0,p521:os.includes("secp521r1")?"secp521r1":void 0,ed25519:os.includes("ED25519")?"ED25519":void 0,curve25519:os.includes("X25519")?"X25519":void 0,brainpoolP256r1:os.includes("brainpoolP256r1")?"brainpoolP256r1":void 0,brainpoolP384r1:os.includes("brainpoolP384r1")?"brainpoolP384r1":void 0,brainpoolP512r1:os.includes("brainpoolP512r1")?"brainpoolP512r1":void 0}:{},ds={p256:{oid:[6,8,42,134,72,206,61,3,1,7],keyType:er.publicKey.ecdsa,hash:er.hash.sha256,cipher:er.symmetric.aes128,node:ls.p256,web:is.p256,payloadSize:32,sharedSize:256},p384:{oid:[6,5,43,129,4,0,34],keyType:er.publicKey.ecdsa,hash:er.hash.sha384,cipher:er.symmetric.aes192,node:ls.p384,web:is.p384,payloadSize:48,sharedSize:384},p521:{oid:[6,5,43,129,4,0,35],keyType:er.publicKey.ecdsa,hash:er.hash.sha512,cipher:er.symmetric.aes256,node:ls.p521,web:is.p521,payloadSize:66,sharedSize:528},secp256k1:{oid:[6,5,43,129,4,0,10],keyType:er.publicKey.ecdsa,hash:er.hash.sha256,cipher:er.symmetric.aes128,node:ls.secp256k1,payloadSize:32},ed25519:{oid:[6,9,43,6,1,4,1,218,71,15,1],keyType:er.publicKey.eddsa,hash:er.hash.sha512,node:!1,payloadSize:32},curve25519:{oid:[6,10,43,6,1,4,1,151,85,1,5,1],keyType:er.publicKey.ecdh,hash:er.hash.sha256,cipher:er.symmetric.aes128,node:!1,payloadSize:32},brainpoolP256r1:{oid:[6,9,43,36,3,3,2,8,1,1,7],keyType:er.publicKey.ecdsa,hash:er.hash.sha256,cipher:er.symmetric.aes128,node:ls.brainpoolP256r1,payloadSize:32},brainpoolP384r1:{oid:[6,9,43,36,3,3,2,8,1,1,11],keyType:er.publicKey.ecdsa,hash:er.hash.sha384,cipher:er.symmetric.aes192,node:ls.brainpoolP384r1,payloadSize:48},brainpoolP512r1:{oid:[6,9,43,36,3,3,2,8,1,1,13],keyType:er.publicKey.ecdsa,hash:er.hash.sha512,cipher:er.symmetric.aes256,node:ls.brainpoolP512r1,payloadSize:64}};class Di{constructor(ke,Ae){try{(Zt.isArray(ke)||Zt.isUint8Array(ke))&&(ke=new _i(ke)),ke instanceof _i&&(ke=ke.getName()),this.name=er.write(er.curve,ke)}catch(ke){throw Error("Not valid curve")}Ae=Ae||ds[this.name],this.keyType=Ae.keyType,this.oid=Ae.oid,this.hash=Ae.hash,this.cipher=Ae.cipher,this.node=Ae.node&&ds[this.name],this.web=Ae.web&&ds[this.name],this.payloadSize=Ae.payloadSize,this.web&&Zt.getWebCrypto()?this.type="web":this.node&&Zt.getNodeCrypto()?this.type="node":"curve25519"===this.name?this.type="curve25519":"ed25519"===this.name&&(this.type="ed25519")}async genKeyPair(){let ke;switch(this.type){case"web":try{return await async function(ke){const Ae=await Jn.generateKey({name:"ECDSA",namedCurve:is[ke]},!0,["sign","verify"]),Ce=await Jn.exportKey("jwk",Ae.privateKey);return{publicKey:Ii(await Jn.exportKey("jwk",Ae.publicKey)),privateKey:pe(Ce.d)}}(this.name)}catch(ke){Zt.printDebugError("Browser did not support generating ec key "+ke.message);break}case"node":return async function(ke){const Ae=Qn.createECDH(ls[ke]);return await Ae.generateKeys(),{publicKey:new Uint8Array(Ae.getPublicKey()),privateKey:new Uint8Array(Ae.getPrivateKey())}}(this.name);case"curve25519":{const Ae=await ri(32);Ae[0]=127&Ae[0]|64,Ae[31]&=248;const Ce=Ae.slice().reverse();ke=Pn.box.keyPair.fromSecretKey(Ce);return{publicKey:Zt.concatUint8Array([new Uint8Array([64]),ke.publicKey]),privateKey:Ae}}case"ed25519":{const ke=await ri(32),Ae=Pn.sign.keyPair.fromSeed(ke);return{publicKey:Zt.concatUint8Array([new Uint8Array([64]),Ae.publicKey]),privateKey:ke}}}const Ae=await Si(this.name);return ke=await Ae.genKeyPair({entropy:Zt.uint8ArrayToString(await ri(32))}),{publicKey:new Uint8Array(ke.getPublic("array",!1)),privateKey:ke.getPrivate().toArrayLike(Uint8Array)}}}async function Ri(ke,Ae,Ce,ze){const qe={p256:!0,p384:!0,p521:!0,secp256k1:!0,curve25519:ke===er.publicKey.ecdh,brainpoolP256r1:!0,brainpoolP384r1:!0,brainpoolP512r1:!0},Ve=Ae.getName();if(!qe[Ve])return!1;if("curve25519"===Ve){ze=ze.slice().reverse();const{publicKey:ke}=Pn.box.keyPair.fromSecretKey(ze);Ce=new Uint8Array(Ce);const Ae=new Uint8Array([64,...ke]);return!!Zt.equalsUint8Array(Ae,Ce)}const tt=await Si(Ve);try{Ce=Ai(tt,Ce).getPublic()}catch(ke){return!1}return!!ki(tt,ze).getPublic().eq(Ce)}function Ii(ke){const Ae=pe(ke.x),Ce=pe(ke.y),ze=new Uint8Array(Ae.length+Ce.length+1);return ze[0]=4,ze.set(Ae,1),ze.set(Ce,Ae.length+1),ze}function Ui(ke,Ae,Ce){const ze=ke,qe=Ce.slice(1,ze+1),Ve=Ce.slice(ze+1,2*ze+1);return{kty:"EC",crv:Ae,x:ye(qe,!0),y:ye(Ve,!0),ext:!0}}function Bi(ke,Ae,Ce,ze){const qe=Ui(ke,Ae,Ce);return qe.d=ye(ze,!0),qe}const ps=Zt.getWebCrypto(),ys=Zt.getNodeCrypto();async function qi(ke,Ae,Ce,ze,qe,Ve){const tt=new Di(ke);if(Ce&&!Zt.isStream(Ce)){const Ve={publicKey:ze,privateKey:qe};switch(tt.type){case"web":try{return await async function(ke,Ae,Ce,ze){const qe=ke.payloadSize,Ve=Bi(ke.payloadSize,is[ke.name],ze.publicKey,ze.privateKey),tt=await ps.importKey("jwk",Ve,{name:"ECDSA",namedCurve:is[ke.name],hash:{name:er.read(er.webHash,ke.hash)}},!1,["sign"]),rt=new Uint8Array(await ps.sign({name:"ECDSA",namedCurve:is[ke.name],hash:{name:er.read(er.webHash,Ae)}},tt,Ce));return{r:rt.slice(0,qe),s:rt.slice(qe,qe<<1)}}(tt,Ae,Ce,Ve)}catch(ke){if("p521"!==tt.name&&("DataError"===ke.name||"OperationError"===ke.name))throw ke;Zt.printDebugError("Browser did not support signing: "+ke.message)}break;case"node":{const ke=await async function(ke,Ae,Ce,ze){const qe=ys.createSign(er.read(er.hash,Ae));qe.write(Ce),qe.end();const Ve=As.encode({version:1,parameters:ke.oid,privateKey:Array.from(ze.privateKey),publicKey:{unused:0,data:Array.from(ze.publicKey)}},"pem",{label:"EC PRIVATE KEY"});return ks.decode(qe.sign(Ve),"der")}(tt,Ae,Ce,Ve);return{r:ke.r.toArrayLike(Uint8Array),s:ke.s.toArrayLike(Uint8Array)}}}}return async function(ke,Ae,Ce){const ze=await Si(ke.name),qe=ki(ze,Ce).sign(Ae);return{r:qe.r.toArrayLike(Uint8Array),s:qe.s.toArrayLike(Uint8Array)}}(tt,Ve,qe)}async function Oi(ke,Ae,Ce,ze,qe,Ve){const tt=new Di(ke);if(ze&&!Zt.isStream(ze))switch(tt.type){case"web":try{return await async function(ke,Ae,{r:Ce,s:ze},qe,Ve){const tt=Ui(ke.payloadSize,is[ke.name],Ve),rt=await ps.importKey("jwk",tt,{name:"ECDSA",namedCurve:is[ke.name],hash:{name:er.read(er.webHash,ke.hash)}},!1,["verify"]),it=Zt.concatUint8Array([Ce,ze]).buffer;return ps.verify({name:"ECDSA",namedCurve:is[ke.name],hash:{name:er.read(er.webHash,Ae)}},rt,it,qe)}(tt,Ae,Ce,ze,qe)}catch(ke){if("p521"!==tt.name&&("DataError"===ke.name||"OperationError"===ke.name))throw ke;Zt.printDebugError("Browser did not support verifying: "+ke.message)}break;case"node":return async function(ke,Ae,{r:Ce,s:ze},qe,Ve){const{default:tt}=await Promise.resolve().then((function(){return Od})),rt=ys.createVerify(er.read(er.hash,Ae));rt.write(qe),rt.end();const it=Rs.encode({algorithm:{algorithm:[1,2,840,10045,2,1],parameters:ke.oid},subjectPublicKey:{unused:0,data:Array.from(Ve)}},"pem",{label:"PUBLIC KEY"}),nt=ks.encode({r:new tt(Ce),s:new tt(ze)},"der");try{return rt.verify(it,nt)}catch(ke){return!1}}(tt,Ae,Ce,ze,qe)}return async function(ke,Ae,Ce,ze){const qe=await Si(ke.name);return Ai(qe,ze).verify(Ce,Ae)}(tt,Ce,void 0===Ae?ze:Ve,qe)}const _s=ys?St.default:void 0,ks=ys?_s.define("ECDSASignature",(function(){this.seq().obj(this.key("r").int(),this.key("s").int())})):void 0,As=ys?_s.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,Bs=ys?_s.define("AlgorithmIdentifier",(function(){this.seq().obj(this.key("algorithm").objid(),this.key("parameters").optional().any())})):void 0,Rs=ys?_s.define("SubjectPublicKeyInfo",(function(){this.seq().obj(this.key("algorithm").use(Bs),this.key("subjectPublicKey").bitstr())})):void 0;var Ts=Object.freeze({__proto__:null,sign:qi,verify:Oi,validateParams:async function(ke,Ae,Ce){const ze=new Di(ke);if(ze.keyType!==er.publicKey.ecdsa)return!1;switch(ze.type){case"web":case"node":{const ze=await ri(8),qe=er.hash.sha256,Ve=await xn.digest(qe,ze);try{const tt=await qi(ke,qe,ze,Ae,Ce,Ve);return await Oi(ke,qe,tt,ze,Ae,Ve)}catch(ke){return!1}}default:return Ri(er.publicKey.ecdsa,ke,Ae,Ce)}}});Pn.hash=ke=>new Uint8Array(Gi().update(ke).digest());var Ks=Object.freeze({__proto__:null,sign:async function(ke,Ae,Ce,ze,qe,Ve){if(xn.getHashByteLength(Ae)=0;--ke)for(let Ae=rt-1;Ae>=0;--Ae)it[1]=rt*ke+(Ae+1),nt[0]=Ve[0]^it[0],nt[1]=Ve[1]^it[1],nt[2]=tt[2*Ae],nt[3]=tt[2*Ae+1],nt=Zi(Ce.decrypt(Yi(nt))),Ve=nt.subarray(0,2),tt[2*Ae]=nt[2],tt[2*Ae+1]=nt[3];if(Ve[0]===ze[0]&&Ve[1]===ze[1])return Yi(tt);throw Error("Key Data Integrity failed")}function Zi(ke){const{length:Ae}=ke,Ce=function(ke){if(Zt.isString(ke)){const{length:Ae}=ke,Ce=new ArrayBuffer(Ae),ze=new Uint8Array(Ce);for(let Ce=0;Ce0){const Ce=ke[Ae-1];if(Ce>=1){const ze=ke.subarray(Ae-Ce),qe=new Uint8Array(Ce).fill(Ce);if(Zt.equalsUint8Array(ze,qe))return ke.subarray(0,Ae-Ce)}}throw Error("Invalid padding")}var Os=Object.freeze({__proto__:null,encode:Qi,decode:Ji});const qs=Zt.getWebCrypto(),ea=Zt.getNodeCrypto();function nn(ke,Ae,Ce,ze){return Zt.concatUint8Array([Ae.write(),new Uint8Array([ke]),Ce.write(),Zt.stringToUint8Array("Anonymous Sender "),ze.subarray(0,20)])}async function an(ke,Ae,Ce,ze,qe=!1,Ve=!1){let tt;if(qe){for(tt=0;tt=0&&0===Ae[tt];tt--);Ae=Ae.subarray(0,tt+1)}return(await xn.digest(ke,Zt.concatUint8Array([new Uint8Array([0,0,0,1]),Ae,ze]))).subarray(0,Ce)}async function sn(ke,Ae){switch(ke.type){case"curve25519":{const Ce=await ri(32),{secretKey:ze,sharedKey:qe}=await on(ke,Ae,null,Ce);let{publicKey:Ve}=Pn.box.keyPair.fromSecretKey(ze);return Ve=Zt.concatUint8Array([new Uint8Array([64]),Ve]),{publicKey:Ve,sharedKey:qe}}case"web":if(ke.web&&Zt.getWebCrypto())try{return await async function(ke,Ae){const Ce=Ui(ke.payloadSize,ke.web.web,Ae);let ze=qs.generateKey({name:"ECDH",namedCurve:ke.web.web},!0,["deriveKey","deriveBits"]),qe=qs.importKey("jwk",Ce,{name:"ECDH",namedCurve:ke.web.web},!1,[]);[ze,qe]=await Promise.all([ze,qe]);let Ve=qs.deriveBits({name:"ECDH",namedCurve:ke.web.web,public:qe},ze.privateKey,ke.web.sharedSize),tt=qs.exportKey("jwk",ze.publicKey);[Ve,tt]=await Promise.all([Ve,tt]);const rt=new Uint8Array(Ve);return{publicKey:new Uint8Array(Ii(tt)),sharedKey:rt}}(ke,Ae)}catch(ke){Zt.printDebugError(ke)}break;case"node":return async function(ke,Ae){const Ce=ea.createECDH(ke.node.node);Ce.generateKeys();const ze=new Uint8Array(Ce.computeSecret(Ae));return{publicKey:new Uint8Array(Ce.getPublicKey()),sharedKey:ze}}(ke,Ae)}return async function(ke,Ae){const Ce=await Si(ke.name),ze=await ke.genKeyPair();Ae=Ai(Ce,Ae);const qe=ki(Ce,ze.privateKey),Ve=ze.publicKey,tt=qe.derive(Ae.getPublic()),rt=Ce.curve.p.byteLength(),it=tt.toArrayLike(Uint8Array,"be",rt);return{publicKey:Ve,sharedKey:it}}(ke,Ae)}async function on(ke,Ae,Ce,ze){if(ze.length!==ke.payloadSize){const Ae=new Uint8Array(ke.payloadSize);Ae.set(ze,ke.payloadSize-ze.length),ze=Ae}switch(ke.type){case"curve25519":{const ke=ze.slice().reverse();return{secretKey:ke,sharedKey:Pn.scalarMult(ke,Ae.subarray(1))}}case"web":if(ke.web&&Zt.getWebCrypto())try{return await async function(ke,Ae,Ce,ze){const qe=Bi(ke.payloadSize,ke.web.web,Ce,ze);let Ve=qs.importKey("jwk",qe,{name:"ECDH",namedCurve:ke.web.web},!0,["deriveKey","deriveBits"]);const tt=Ui(ke.payloadSize,ke.web.web,Ae);let rt=qs.importKey("jwk",tt,{name:"ECDH",namedCurve:ke.web.web},!0,[]);[Ve,rt]=await Promise.all([Ve,rt]);let it=qs.deriveBits({name:"ECDH",namedCurve:ke.web.web,public:rt},Ve,ke.web.sharedSize),nt=qs.exportKey("jwk",Ve);[it,nt]=await Promise.all([it,nt]);const ot=new Uint8Array(it);return{secretKey:pe(nt.d),sharedKey:ot}}(ke,Ae,Ce,ze)}catch(ke){Zt.printDebugError(ke)}break;case"node":return async function(ke,Ae,Ce){const ze=ea.createECDH(ke.node.node);ze.setPrivateKey(Ce);const qe=new Uint8Array(ze.computeSecret(Ae));return{secretKey:new Uint8Array(ze.getPrivateKey()),sharedKey:qe}}(ke,Ae,ze)}return async function(ke,Ae,Ce){const ze=await Si(ke.name);Ae=Ai(ze,Ae),Ce=ki(ze,Ce);const qe=new Uint8Array(Ce.getPrivate()),Ve=Ce.derive(Ae.getPublic()),tt=ze.curve.p.byteLength(),rt=Ve.toArrayLike(Uint8Array,"be",tt);return{secretKey:qe,sharedKey:rt}}(ke,Ae,ze)}var ta=Object.freeze({__proto__:null,validateParams:async function(ke,Ae,Ce){return Ri(er.publicKey.ecdh,ke,Ae,Ce)},encrypt:async function(ke,Ae,Ce,ze,qe){const Ve=Qi(Ce),tt=new Di(ke),{publicKey:rt,sharedKey:it}=await sn(tt,ze),nt=nn(er.publicKey.ecdh,ke,Ae,qe),{keySize:ot}=dn(Ae.cipher);return{publicKey:rt,wrappedKey:Vi(await an(Ae.hash,it,ot,nt),Ve)}},decrypt:async function(ke,Ae,Ce,ze,qe,Ve,tt){const rt=new Di(ke),{sharedKey:it}=await on(rt,Ce,qe,Ve),nt=nn(er.publicKey.ecdh,ke,Ae,tt),{keySize:ot}=dn(Ae.cipher);let ct;for(let Ce=0;Ce<3;Ce++)try{return Ji($i(await an(Ae.hash,it,ot,nt,1===Ce,2===Ce),ze))}catch(ke){ct=ke}throw ct}});var ra={rsa:Zn,elgamal:Xn,elliptic:Object.freeze({__proto__:null,Curve:Di,ecdh:ta,ecdsa:Ts,eddsa:Ks,generate:async function(ke){const Ae=await Zt.getBigInteger();ke=new Di(ke);const Ce=await ke.genKeyPair(),ze=new Ae(Ce.publicKey).toUint8Array(),qe=new Ae(Ce.privateKey).toUint8Array("be",ke.payloadSize);return{oid:ke.oid,Q:ze,secret:qe,hash:ke.hash,cipher:ke.cipher}},getPreferredHashAlgo:function(ke){return ds[er.write(er.curve,ke.toHex())].hash}}),dsa:Object.freeze({__proto__:null,sign:async function(ke,Ae,Ce,ze,qe,Ve){const tt=await Zt.getBigInteger(),rt=new tt(1);let it,nt,ot,ct;ze=new tt(ze),qe=new tt(qe),Ce=new tt(Ce),Ve=new tt(Ve),Ce=Ce.mod(ze),Ve=Ve.mod(qe);const ht=new tt(Ae.subarray(0,qe.byteLength())).mod(qe);for(;;){if(it=await ii(rt,qe),nt=Ce.modExp(it,ze).imod(qe),nt.isZero())continue;const ke=Ve.mul(nt).imod(qe);if(ct=ht.add(ke).imod(qe),ot=it.modInv(qe).imul(ct).imod(qe),!ot.isZero())break}return{r:nt.toUint8Array("be",qe.byteLength()),s:ot.toUint8Array("be",qe.byteLength())}},verify:async function(ke,Ae,Ce,ze,qe,Ve,tt,rt){const it=await Zt.getBigInteger(),nt=new it(0);if(Ae=new it(Ae),Ce=new it(Ce),Ve=new it(Ve),tt=new it(tt),qe=new it(qe),rt=new it(rt),Ae.lte(nt)||Ae.gte(tt)||Ce.lte(nt)||Ce.gte(tt))return Zt.printDebug("invalid DSA Signature"),!1;const ot=new it(ze.subarray(0,tt.byteLength())).imod(tt),ct=Ce.modInv(tt);if(ct.isZero())return Zt.printDebug("invalid DSA Signature"),!1;qe=qe.mod(Ve),rt=rt.mod(Ve);const ht=ot.mul(ct).imod(tt),ft=Ae.mul(ct).imod(tt),yt=qe.modExp(ht,Ve),mt=rt.modExp(ft,Ve);return yt.mul(mt).imod(Ve).imod(tt).equal(Ae)},validateParams:async function(ke,Ae,Ce,ze,qe){const Ve=await Zt.getBigInteger();ke=new Ve(ke),Ae=new Ve(Ae),Ce=new Ve(Ce),ze=new Ve(ze);const tt=new Ve(1);if(Ce.lte(tt)||Ce.gte(ke))return!1;if(!ke.dec().mod(Ae).isZero())return!1;if(!Ce.modExp(Ae,ke).isOne())return!1;const rt=new Ve(Ae.bitLength()),it=new Ve(150);if(rt.lt(it)||!await oi(Ae,null,32))return!1;qe=new Ve(qe);const nt=new Ve(2),ot=await ii(nt.leftShift(rt.dec()),nt.leftShift(rt)),ct=Ae.mul(ot).add(qe);return!!ze.equal(Ce.modExp(ct,ke))}}),nacl:Pn};class hn{constructor(ke){ke=void 0===ke?new Uint8Array([]):Zt.isString(ke)?Zt.stringToUint8Array(ke):new Uint8Array(ke),this.data=ke}read(ke){if(ke.length>=1){const Ae=ke[0];if(ke.length>=1+Ae)return this.data=ke.subarray(1,1+Ae),1+this.data.length}throw Error("Invalid symmetric key")}write(){return Zt.concatUint8Array([new Uint8Array([this.data.length]),this.data])}}class fn{constructor(ke){if(ke){const{hash:Ae,cipher:Ce}=ke;this.hash=Ae,this.cipher=Ce}else this.hash=null,this.cipher=null}read(ke){if(ke.length<4||3!==ke[0]||1!==ke[1])throw Error("Cannot read KDFParams");return this.hash=ke[2],this.cipher=ke[3],4}write(){return new Uint8Array([3,1,this.hash,this.cipher])}}function dn(ke){const Ae=er.read(er.symmetric,ke);return Er[Ae]}var ia=Object.freeze({__proto__:null,publicKeyEncrypt:async function(ke,Ae,Ce,ze){switch(ke){case er.publicKey.rsaEncrypt:case er.publicKey.rsaEncryptSign:{const{n:ke,e:ze}=Ae;return{c:await ra.rsa.encrypt(Ce,ke,ze)}}case er.publicKey.elgamal:{const{p:ke,g:ze,y:qe}=Ae;return ra.elgamal.encrypt(Ce,ke,ze,qe)}case er.publicKey.ecdh:{const{oid:ke,Q:qe,kdfParams:Ve}=Ae,{publicKey:tt,wrappedKey:rt}=await ra.elliptic.ecdh.encrypt(ke,Ve,Ce,qe,ze);return{V:tt,C:new hn(rt)}}default:return[]}},publicKeyDecrypt:async function(ke,Ae,Ce,ze,qe,Ve){switch(ke){case er.publicKey.rsaEncryptSign:case er.publicKey.rsaEncrypt:{const{c:ke}=ze,{n:qe,e:tt}=Ae,{d:rt,p:it,q:nt,u:ot}=Ce;return ra.rsa.decrypt(ke,qe,tt,rt,it,nt,ot,Ve)}case er.publicKey.elgamal:{const{c1:ke,c2:qe}=ze,tt=Ae.p,rt=Ce.x;return ra.elgamal.decrypt(ke,qe,tt,rt,Ve)}case er.publicKey.ecdh:{const{oid:ke,Q:Ve,kdfParams:tt}=Ae,{d:rt}=Ce,{V:it,C:nt}=ze;return ra.elliptic.ecdh.decrypt(ke,tt,it,nt.data,Ve,rt,qe)}default:throw Error("Invalid public key encryption algorithm.")}},parsePublicKeyParams:function(ke,Ae){let Ce=0;switch(ke){case er.publicKey.rsaEncrypt:case er.publicKey.rsaEncryptSign:case er.publicKey.rsaSign:{const ke=Zt.readMPI(Ae.subarray(Ce));Ce+=ke.length+2;const ze=Zt.readMPI(Ae.subarray(Ce));return Ce+=ze.length+2,{read:Ce,publicParams:{n:ke,e:ze}}}case er.publicKey.dsa:{const ke=Zt.readMPI(Ae.subarray(Ce));Ce+=ke.length+2;const ze=Zt.readMPI(Ae.subarray(Ce));Ce+=ze.length+2;const qe=Zt.readMPI(Ae.subarray(Ce));Ce+=qe.length+2;const Ve=Zt.readMPI(Ae.subarray(Ce));return Ce+=Ve.length+2,{read:Ce,publicParams:{p:ke,q:ze,g:qe,y:Ve}}}case er.publicKey.elgamal:{const ke=Zt.readMPI(Ae.subarray(Ce));Ce+=ke.length+2;const ze=Zt.readMPI(Ae.subarray(Ce));Ce+=ze.length+2;const qe=Zt.readMPI(Ae.subarray(Ce));return Ce+=qe.length+2,{read:Ce,publicParams:{p:ke,g:ze,y:qe}}}case er.publicKey.ecdsa:{const ke=new _i;Ce+=ke.read(Ae);const ze=Zt.readMPI(Ae.subarray(Ce));return Ce+=ze.length+2,{read:Ce,publicParams:{oid:ke,Q:ze}}}case er.publicKey.eddsa:{const ke=new _i;Ce+=ke.read(Ae);let ze=Zt.readMPI(Ae.subarray(Ce));return Ce+=ze.length+2,ze=Zt.leftPad(ze,33),{read:Ce,publicParams:{oid:ke,Q:ze}}}case er.publicKey.ecdh:{const ke=new _i;Ce+=ke.read(Ae);const ze=Zt.readMPI(Ae.subarray(Ce));Ce+=ze.length+2;const qe=new fn;return Ce+=qe.read(Ae.subarray(Ce)),{read:Ce,publicParams:{oid:ke,Q:ze,kdfParams:qe}}}default:throw Error("Invalid public key encryption algorithm.")}},parsePrivateKeyParams:function(ke,Ae,Ce){let ze=0;switch(ke){case er.publicKey.rsaEncrypt:case er.publicKey.rsaEncryptSign:case er.publicKey.rsaSign:{const ke=Zt.readMPI(Ae.subarray(ze));ze+=ke.length+2;const Ce=Zt.readMPI(Ae.subarray(ze));ze+=Ce.length+2;const qe=Zt.readMPI(Ae.subarray(ze));ze+=qe.length+2;const Ve=Zt.readMPI(Ae.subarray(ze));return ze+=Ve.length+2,{read:ze,privateParams:{d:ke,p:Ce,q:qe,u:Ve}}}case er.publicKey.dsa:case er.publicKey.elgamal:{const ke=Zt.readMPI(Ae.subarray(ze));return ze+=ke.length+2,{read:ze,privateParams:{x:ke}}}case er.publicKey.ecdsa:case er.publicKey.ecdh:{const ke=new Di(Ce.oid);let qe=Zt.readMPI(Ae.subarray(ze));return ze+=qe.length+2,qe=Zt.leftPad(qe,ke.payloadSize),{read:ze,privateParams:{d:qe}}}case er.publicKey.eddsa:{let ke=Zt.readMPI(Ae.subarray(ze));return ze+=ke.length+2,ke=Zt.leftPad(ke,32),{read:ze,privateParams:{seed:ke}}}default:throw Error("Invalid public key encryption algorithm.")}},parseEncSessionKeyParams:function(ke,Ae){let Ce=0;switch(ke){case er.publicKey.rsaEncrypt:case er.publicKey.rsaEncryptSign:return{c:Zt.readMPI(Ae.subarray(Ce))};case er.publicKey.elgamal:{const ke=Zt.readMPI(Ae.subarray(Ce));Ce+=ke.length+2;return{c1:ke,c2:Zt.readMPI(Ae.subarray(Ce))}}case er.publicKey.ecdh:{const ke=Zt.readMPI(Ae.subarray(Ce));Ce+=ke.length+2;const ze=new hn;return ze.read(Ae.subarray(Ce)),{V:ke,C:ze}}default:throw Error("Invalid public key encryption algorithm.")}},serializeParams:function(ke,Ae){const Ce=Object.keys(Ae).map((ke=>{const Ce=Ae[ke];return Zt.isUint8Array(Ce)?Zt.uint8ArrayToMPI(Ce):Ce.write()}));return Zt.concatUint8Array(Ce)},generateParams:function(ke,Ae,Ce){switch(ke){case er.publicKey.rsaEncrypt:case er.publicKey.rsaEncryptSign:case er.publicKey.rsaSign:return ra.rsa.generate(Ae,65537).then((({n:ke,e:Ae,d:Ce,p:ze,q:qe,u:Ve})=>({privateParams:{d:Ce,p:ze,q:qe,u:Ve},publicParams:{n:ke,e:Ae}})));case er.publicKey.ecdsa:return ra.elliptic.generate(Ce).then((({oid:ke,Q:Ae,secret:Ce})=>({privateParams:{d:Ce},publicParams:{oid:new _i(ke),Q:Ae}})));case er.publicKey.eddsa:return ra.elliptic.generate(Ce).then((({oid:ke,Q:Ae,secret:Ce})=>({privateParams:{seed:Ce},publicParams:{oid:new _i(ke),Q:Ae}})));case er.publicKey.ecdh:return ra.elliptic.generate(Ce).then((({oid:ke,Q:Ae,secret:Ce,hash:ze,cipher:qe})=>({privateParams:{d:Ce},publicParams:{oid:new _i(ke),Q:Ae,kdfParams:new fn({hash:ze,cipher:qe})}})));case er.publicKey.dsa:case er.publicKey.elgamal:throw Error("Unsupported algorithm for key generation.");default:throw Error("Invalid public key algorithm.")}},validateParams:async function(ke,Ae,Ce){if(!Ae||!Ce)throw Error("Missing key parameters");switch(ke){case er.publicKey.rsaEncrypt:case er.publicKey.rsaEncryptSign:case er.publicKey.rsaSign:{const{n:ke,e:ze}=Ae,{d:qe,p:Ve,q:tt,u:rt}=Ce;return ra.rsa.validateParams(ke,ze,qe,Ve,tt,rt)}case er.publicKey.dsa:{const{p:ke,q:ze,g:qe,y:Ve}=Ae,{x:tt}=Ce;return ra.dsa.validateParams(ke,ze,qe,Ve,tt)}case er.publicKey.elgamal:{const{p:ke,g:ze,y:qe}=Ae,{x:Ve}=Ce;return ra.elgamal.validateParams(ke,ze,qe,Ve)}case er.publicKey.ecdsa:case er.publicKey.ecdh:{const ze=ra.elliptic[er.read(er.publicKey,ke)],{oid:qe,Q:Ve}=Ae,{d:tt}=Ce;return ze.validateParams(qe,Ve,tt)}case er.publicKey.eddsa:{const{oid:ke,Q:ze}=Ae,{seed:qe}=Ce;return ra.elliptic.eddsa.validateParams(ke,ze,qe)}default:throw Error("Invalid public key algorithm.")}},getPrefixRandom:async function(ke){const{blockSize:Ae}=dn(ke),Ce=await ri(Ae),ze=new Uint8Array([Ce[Ce.length-2],Ce[Ce.length-1]]);return Zt.concat([Ce,ze])},generateSessionKey:function(ke){const{keySize:Ae}=dn(ke);return ri(Ae)},getAEADMode:function(ke){const Ae=er.read(er.aead,ke);return uo[Ae]},getCipher:dn});const sa=Zt.getWebCrypto(),aa=Zt.getNodeCrypto(),oa=aa?aa.getCiphers():[],ca={idea:oa.includes("idea-cfb")?"idea-cfb":void 0,tripledes:oa.includes("des-ede3-cfb")?"des-ede3-cfb":void 0,cast5:oa.includes("cast5-cfb")?"cast5-cfb":void 0,blowfish:oa.includes("bf-cfb")?"bf-cfb":void 0,aes128:oa.includes("aes-128-cfb")?"aes-128-cfb":void 0,aes192:oa.includes("aes-192-cfb")?"aes-192-cfb":void 0,aes256:oa.includes("aes-256-cfb")?"aes-256-cfb":void 0};var ua=Object.freeze({__proto__:null,encrypt:async function(ke,Ae,Ce,ze,qe){const Ve=er.read(er.symmetric,ke);if(Zt.getNodeCrypto()&&ca[Ve])return function(ke,Ae,Ce,ze){const qe=er.read(er.symmetric,ke),Ve=new aa.createCipheriv(ca[qe],Ae,ze);return Y(Ce,(ke=>new Uint8Array(Ve.update(ke))))}(ke,Ae,Ce,ze);if("aes"===Ve.substr(0,3))return function(ke,Ae,Ce,ze,qe){if(Zt.getWebCrypto()&&24!==Ae.length&&!Zt.isStream(Ce)&&Ce.length>=3e3*qe.minBytesForWebCrypto)return async function(ke,Ae,Ce,ze){const qe="AES-CBC",Ve=await sa.importKey("raw",Ae,{name:qe},!1,["encrypt"]),{blockSize:tt}=dn(ke),rt=Zt.concatUint8Array([new Uint8Array(tt),Ce]),it=new Uint8Array(await sa.encrypt({name:qe,iv:ze},Ve,rt)).subarray(0,Ce.length);return function(ke,Ae){for(let Ce=0;CeVe.aes.AES_Encrypt_process(ke)),(()=>Ve.aes.AES_Encrypt_finish()))}(ke,Ae,Ce,ze,qe);const tt=new Er[Ve](Ae),rt=tt.blockSize,it=ze.slice();let nt=new Uint8Array;const h=ke=>{ke&&(nt=Zt.concatUint8Array([nt,ke]));const Ae=new Uint8Array(nt.length);let Ce,ze=0;for(;ke?nt.length>=rt:nt.length;){const ke=tt.encrypt(it);for(Ce=0;Cenew Uint8Array(Ve.update(ke))))}(ke,Ae,Ce,ze);if("aes"===qe.substr(0,3))return function(ke,Ae,Ce,ze){if(Zt.isStream(Ce)){const ke=new Jr(Ae,ze);return Y(Ce,(Ae=>ke.aes.AES_Decrypt_process(Ae)),(()=>ke.aes.AES_Decrypt_finish()))}return Jr.decrypt(Ce,Ae,ze)}(0,Ae,Ce,ze);const Ve=new Er[qe](Ae),tt=Ve.blockSize;let rt=ze,it=new Uint8Array;const u=ke=>{ke&&(it=Zt.concatUint8Array([it,ke]));const Ae=new Uint8Array(it.length);let Ce,ze=0;for(;ke?it.length>=tt:it.length;){const ke=Ve.encrypt(rt);for(rt=it,Ce=0;Ce48)throw new Be("illegal counter size");let ke=Math.pow(2,Ce)-1;ze.set_mask(0,0,ke/4294967296|0,0|ke)}else Ce=48,ze.set_mask(0,0,65535,4294967295);if(void 0===ke)throw Error("nonce is required");{let Ae=ke.length;if(!Ae||Ae>16)throw new Be("illegal nonce size");let Ce=new DataView(new ArrayBuffer(16));new Uint8Array(Ce.buffer).set(ke),ze.set_nonce(Ce.getUint32(0),Ce.getUint32(4),Ce.getUint32(8),Ce.getUint32(12))}if(void 0!==Ae){if(Ae<0||Ae>=Math.pow(2,Ce))throw new Be("illegal counter value");ze.set_counter(0,0,Ae/4294967296|0,0|Ae)}}}class vn{static encrypt(ke,Ae,Ce=!0,ze){return new vn(Ae,ze,Ce).encrypt(ke)}static decrypt(ke,Ae,Ce=!0,ze){return new vn(Ae,ze,Ce).decrypt(ke)}constructor(ke,Ae,Ce=!0,ze){this.aes=ze||new Oe(ke,Ae,Ce,"CBC")}encrypt(ke){return Ie(this.aes.AES_Encrypt_process(ke),this.aes.AES_Encrypt_finish())}decrypt(ke){return Ie(this.aes.AES_Decrypt_process(ke),this.aes.AES_Decrypt_finish())}}const ha=Zt.getWebCrypto(),fa=Zt.getNodeCrypto();function An(ke,Ae){const Ce=ke.length-16;for(let ze=0;ze<16;ze++)ke[ze+Ce]^=Ae[ze];return ke}const la=new Uint8Array(16);async function En(ke){const Ae=await async function(ke){if(Zt.getWebCrypto()&&24!==ke.length)return ke=await ha.importKey("raw",ke,{name:"AES-CBC",length:8*ke.length},!1,["encrypt"]),async function(Ae){const Ce=await ha.encrypt({name:"AES-CBC",iv:la,length:128},ke,Ae);return new Uint8Array(Ce).subarray(0,Ce.byteLength-16)};if(Zt.getNodeCrypto())return async function(Ae){const Ce=new fa.createCipheriv("aes-"+8*ke.length+"-cbc",ke,la).update(Ae);return new Uint8Array(Ce)};return async function(Ae){return vn.encrypt(Ae,ke,!1,la)}}(ke),Ce=Zt.double(await Ae(la)),ze=Zt.double(Ce);return async function(ke){return(await Ae(function(ke,Ae,Ce){if(ke.length&&ke.length%16==0)return An(ke,Ae);const ze=new Uint8Array(ke.length+(16-ke.length%16));return ze.set(ke),ze[ke.length]=128,An(ze,Ce)}(ke,Ce,ze))).subarray(-16)}}const da=Zt.getWebCrypto(),pa=Zt.getNodeCrypto(),ma=Zt.getNodeBuffer(),ga=new Uint8Array(16),ba=new Uint8Array(16);ba[15]=1;const Ua=new Uint8Array(16);async function Rn(ke){const Ae=await En(ke);return function(ke,Ce){return Ae(Zt.concatUint8Array([ke,Ce]))}}async function In(ke){return Zt.getWebCrypto()&&24!==ke.length?(ke=await da.importKey("raw",ke,{name:"AES-CTR",length:8*ke.length},!1,["encrypt"]),async function(Ae,Ce){const ze=await da.encrypt({name:"AES-CTR",counter:Ce,length:128},ke,Ae);return new Uint8Array(ze)}):Zt.getNodeCrypto()?async function(Ae,Ce){const ze=new pa.createCipheriv("aes-"+8*ke.length+"-ctr",ke,Ce),qe=ma.concat([ze.update(Ae),ze.final()]);return new Uint8Array(qe)}:async function(Ae,Ce){return wn.encrypt(Ae,ke,Ce)}}async function Un(ke,Ae){if(ke!==er.symmetric.aes128&&ke!==er.symmetric.aes192&&ke!==er.symmetric.aes256)throw Error("EAX mode supports only AES cipher");const[Ce,ze]=await Promise.all([Rn(Ae),In(Ae)]);return{encrypt:async function(ke,Ae,qe){const[Ve,tt]=await Promise.all([Ce(ga,Ae),Ce(ba,qe)]),rt=await ze(ke,Ve),it=await Ce(Ua,rt);for(let ke=0;ke<16;ke++)it[ke]^=tt[ke]^Ve[ke];return Zt.concatUint8Array([rt,it])},decrypt:async function(ke,Ae,qe){if(ke.length<16)throw Error("Invalid EAX ciphertext");const Ve=ke.subarray(0,-16),tt=ke.subarray(-16),[rt,it,nt]=await Promise.all([Ce(ga,Ae),Ce(ba,qe),Ce(Ua,Ve)]),ot=nt;for(let ke=0;ke<16;ke++)ot[ke]^=it[ke]^rt[ke];if(!Zt.equalsUint8Array(tt,ot))throw Error("Authentication tag mismatch");return await ze(Ve,rt)}}}Ua[15]=2,Un.getNonce=function(ke,Ae){const Ce=ke.slice();for(let ke=0;ke>3),17+(nt>>3)),8-(7&nt)).subarray(1),ft=new Uint8Array(16),yt=new Uint8Array(Ae.length+16);let mt,kt=0;for(mt=0;mt16)throw new Be("illegal tagSize value");const rt=Ae.length||0,it=new Uint8Array(16);12!==rt?(this._gcm_mac_process(Ae),tt[0]=0,tt[1]=0,tt[2]=0,tt[3]=0,tt[4]=0,tt[5]=0,tt[6]=0,tt[7]=0,tt[8]=0,tt[9]=0,tt[10]=0,tt[11]=rt>>>29,tt[12]=rt>>>21&255,tt[13]=rt>>>13&255,tt[14]=rt>>>5&255,tt[15]=rt<<3&255,Ve.mac(nr.MAC.GCM,nr.HEAP_DATA,16),Ve.get_iv(nr.HEAP_DATA),Ve.set_iv(0,0,0,0),it.set(tt.subarray(0,16))):(it.set(Ae),it[15]=1);const nt=new DataView(it.buffer);if(this.gamma0=nt.getUint32(12),Ve.set_nonce(nt.getUint32(0),nt.getUint32(4),nt.getUint32(8),0),Ve.set_mask(0,0,0,4294967295),void 0!==Ce){if(Ce.length>68719476704)throw new Be("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");Ve.set_counter(0,0,0,this.gamma0+this.counter|0)}static encrypt(ke,Ae,Ce,ze,qe){return new Nn(Ae,Ce,ze,qe).encrypt(ke)}static decrypt(ke,Ae,Ce,ze,qe){return new Nn(Ae,Ce,ze,qe).decrypt(ke)}encrypt(ke){return this.AES_GCM_encrypt(ke)}decrypt(ke){return this.AES_GCM_decrypt(ke)}AES_GCM_Encrypt_process(ke){let Ae=0,Ce=ke.length||0,{asm:ze,heap:qe}=this.aes.acquire_asm(),Ve=this.counter,tt=this.aes.pos,rt=this.aes.len,it=0,nt=rt+Ce&-16,ot=0;if((Ve-1<<4)+rt+Ce>68719476704)throw new RangeError("counter overflow");const ct=new Uint8Array(nt);for(;Ce>0;)ot=Re(qe,tt+rt,ke,Ae,Ce),rt+=ot,Ae+=ot,Ce-=ot,ot=ze.cipher(nr.ENC.CTR,nr.HEAP_DATA+tt,rt),ot=ze.mac(nr.MAC.GCM,nr.HEAP_DATA+tt,ot),ot&&ct.set(qe.subarray(tt,tt+ot),it),Ve+=ot>>>4,it+=ot,ot>>29,Ae[4]=nt>>>21,Ae[5]=nt>>>13&255,Ae[6]=nt>>>5&255,Ae[7]=nt<<3&255,Ae[8]=Ae[9]=Ae[10]=0,Ae[11]=ot>>>29,Ae[12]=ot>>>21&255,Ae[13]=ot>>>13&255,Ae[14]=ot>>>5&255,Ae[15]=ot<<3&255,ke.mac(nr.MAC.GCM,nr.HEAP_DATA,16),ke.get_iv(nr.HEAP_DATA),ke.set_counter(0,0,0,this.gamma0),ke.cipher(nr.ENC.CTR,nr.HEAP_DATA,16),rt.set(Ae.subarray(0,ze),tt),this.counter=1,this.aes.pos=0,this.aes.len=0,rt}AES_GCM_Decrypt_process(ke){let Ae=0,Ce=ke.length||0,{asm:ze,heap:qe}=this.aes.acquire_asm(),Ve=this.counter,tt=this.tagSize,rt=this.aes.pos,it=this.aes.len,nt=0,ot=it+Ce>tt?it+Ce-tt&-16:0,ct=it+Ce-ot,ht=0;if((Ve-1<<4)+it+Ce>68719476704)throw new RangeError("counter overflow");const ft=new Uint8Array(ot);for(;Ce>ct;)ht=Re(qe,rt+it,ke,Ae,Ce-ct),it+=ht,Ae+=ht,Ce-=ht,ht=ze.mac(nr.MAC.GCM,nr.HEAP_DATA+rt,ht),ht=ze.cipher(nr.DEC.CTR,nr.HEAP_DATA+rt,ht),ht&&ft.set(qe.subarray(rt,rt+ht),nt),Ve+=ht>>>4,nt+=ht,rt=0,it=0;return Ce>0&&(it+=Re(qe,0,ke,Ae,Ce)),this.counter=Ve,this.aes.pos=rt,this.aes.len=it,ft}AES_GCM_Decrypt_finish(){let{asm:ke,heap:Ae}=this.aes.acquire_asm(),Ce=this.tagSize,ze=this.adata,qe=this.counter,Ve=this.aes.pos,tt=this.aes.len,rt=tt-Ce;if(tt>>29,Ae[4]=ct>>>21,Ae[5]=ct>>>13&255,Ae[6]=ct>>>5&255,Ae[7]=ct<<3&255,Ae[8]=Ae[9]=Ae[10]=0,Ae[11]=ht>>>29,Ae[12]=ht>>>21&255,Ae[13]=ht>>>13&255,Ae[14]=ht>>>5&255,Ae[15]=ht<<3&255,ke.mac(nr.MAC.GCM,nr.HEAP_DATA,16),ke.get_iv(nr.HEAP_DATA),ke.set_counter(0,0,0,this.gamma0),ke.cipher(nr.ENC.CTR,nr.HEAP_DATA,16);let ft=0;for(let ke=0;ke0;){for(Ve=Re(Ce,0,ke,ze,qe),ze+=Ve,qe-=Ve;15&Ve;)Ce[Ve++]=0;Ae.mac(nr.MAC.GCM,nr.HEAP_DATA,Ve)}}}const eo=Zt.getWebCrypto(),to=Zt.getNodeCrypto(),oo=Zt.getNodeBuffer();async function Hn(ke,Ae){if(ke!==er.symmetric.aes128&&ke!==er.symmetric.aes192&&ke!==er.symmetric.aes256)throw Error("GCM mode supports only AES cipher");if(Zt.getWebCrypto()&&24!==Ae.length){const ke=await eo.importKey("raw",Ae,{name:"AES-GCM"},!1,["encrypt","decrypt"]);return{encrypt:async function(Ce,ze,qe=new Uint8Array){if(!Ce.length)return Nn.encrypt(Ce,Ae,ze,qe);const Ve=await eo.encrypt({name:"AES-GCM",iv:ze,additionalData:qe,tagLength:128},ke,Ce);return new Uint8Array(Ve)},decrypt:async function(Ce,ze,qe=new Uint8Array){if(16===Ce.length)return Nn.decrypt(Ce,Ae,ze,qe);const Ve=await eo.decrypt({name:"AES-GCM",iv:ze,additionalData:qe,tagLength:128},ke,Ce);return new Uint8Array(Ve)}}}return Zt.getNodeCrypto()?{encrypt:async function(ke,Ce,ze=new Uint8Array){const qe=new to.createCipheriv("aes-"+8*Ae.length+"-gcm",Ae,Ce);qe.setAAD(ze);const Ve=oo.concat([qe.update(ke),qe.final(),qe.getAuthTag()]);return new Uint8Array(Ve)},decrypt:async function(ke,Ce,ze=new Uint8Array){const qe=new to.createDecipheriv("aes-"+8*Ae.length+"-gcm",Ae,Ce);qe.setAAD(ze),qe.setAuthTag(ke.slice(ke.length-16,ke.length));const Ve=oo.concat([qe.update(ke.slice(0,ke.length-16)),qe.final()]);return new Uint8Array(Ve)}}:{encrypt:async function(ke,Ce,ze){return Nn.encrypt(ke,Ae,Ce,ze)},decrypt:async function(ke,Ce,ze){return Nn.decrypt(ke,Ae,Ce,ze)}}}Hn.getNonce=function(ke,Ae){const Ce=ke.slice();for(let ke=0;ke=0;)ke[Ae]=0}const cc=[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],uc=[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],lc=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],gc=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],Sc=Array(576);na(Sc);const Mc=Array(60);na(Mc);const Pc=Array(512);na(Pc);const Cc=Array(256);na(Cc);const Dc=Array(29);na(Dc);const Rc=Array(30);function ya(ke,Ae,Ce,ze,qe){this.static_tree=ke,this.extra_bits=Ae,this.extra_base=Ce,this.elems=ze,this.max_length=qe,this.has_stree=ke&&ke.length}let Kc,jc,eu;function wa(ke,Ae){this.dyn_tree=ke,this.max_code=0,this.stat_desc=Ae}function va(ke){return ke<256?Pc[ke]:Pc[256+(ke>>>7)]}function _a(ke,Ae){ke.pending_buf[ke.pending++]=255&Ae,ke.pending_buf[ke.pending++]=Ae>>>8&255}function ka(ke,Ae,Ce){ke.bi_valid>16-Ce?(ke.bi_buf|=Ae<>16-ke.bi_valid,ke.bi_valid+=Ce-16):(ke.bi_buf|=Ae<>>=1,Ce<<=1}while(--Ae>0);return Ce>>>1}function Ea(ke,Ae,Ce){const ze=Array(16);let qe,Ve,tt=0;for(qe=1;qe<=15;qe++)ze[qe]=tt=tt+Ce[qe-1]<<1;for(Ve=0;Ve<=Ae;Ve++){const Ae=ke[2*Ve+1];0!==Ae&&(ke[2*Ve]=Sa(ze[Ae]++,Ae))}}function Pa(ke){let Ae;for(Ae=0;Ae<286;Ae++)ke.dyn_ltree[2*Ae]=0;for(Ae=0;Ae<30;Ae++)ke.dyn_dtree[2*Ae]=0;for(Ae=0;Ae<19;Ae++)ke.bl_tree[2*Ae]=0;ke.dyn_ltree[512]=1,ke.opt_len=ke.static_len=0,ke.last_lit=ke.matches=0}function xa(ke){ke.bi_valid>8?_a(ke,ke.bi_buf):ke.bi_valid>0&&(ke.pending_buf[ke.pending++]=ke.bi_buf),ke.bi_buf=0,ke.bi_valid=0}function Ma(ke,Ae,Ce,ze){const qe=2*Ae,Ve=2*Ce;return ke[qe]>1;tt>=1;tt--)Ca(ke,Ce,tt);it=Ve;do{tt=ke.heap[1],ke.heap[1]=ke.heap[ke.heap_len--],Ca(ke,Ce,1),rt=ke.heap[1],ke.heap[--ke.heap_max]=tt,ke.heap[--ke.heap_max]=rt,Ce[2*it]=Ce[2*tt]+Ce[2*rt],ke.depth[it]=(ke.depth[tt]>=ke.depth[rt]?ke.depth[tt]:ke.depth[rt])+1,Ce[2*tt+1]=Ce[2*rt+1]=it,ke.heap[1]=it++,Ca(ke,Ce,1)}while(ke.heap_len>=2);ke.heap[--ke.heap_max]=ke.heap[1],function(ke,Ae){const Ce=Ae.dyn_tree,ze=Ae.max_code,qe=Ae.stat_desc.static_tree,Ve=Ae.stat_desc.has_stree,tt=Ae.stat_desc.extra_bits,rt=Ae.stat_desc.extra_base,it=Ae.stat_desc.max_length;let nt,ot,ct,ht,ft,yt,mt=0;for(ht=0;ht<=15;ht++)ke.bl_count[ht]=0;for(Ce[2*ke.heap[ke.heap_max]+1]=0,nt=ke.heap_max+1;nt<573;nt++)ot=ke.heap[nt],ht=Ce[2*Ce[2*ot+1]+1]+1,ht>it&&(ht=it,mt++),Ce[2*ot+1]=ht,ot>ze||(ke.bl_count[ht]++,ft=0,ot>=rt&&(ft=tt[ot-rt]),yt=Ce[2*ot],ke.opt_len+=yt*(ht+ft),Ve&&(ke.static_len+=yt*(qe[2*ot+1]+ft)));if(0!==mt){do{for(ht=it-1;0===ke.bl_count[ht];)ht--;ke.bl_count[ht]--,ke.bl_count[ht+1]+=2,ke.bl_count[it]--,mt-=2}while(mt>0);for(ht=it;0!==ht;ht--)for(ot=ke.bl_count[ht];0!==ot;)ct=ke.heap[--nt],ct>ze||(Ce[2*ct+1]!==ht&&(ke.opt_len+=(ht-Ce[2*ct+1])*Ce[2*ct],Ce[2*ct+1]=ht),ot--)}}(ke,Ae),Ea(Ce,nt,ke.bl_count)}function Ra(ke,Ae,Ce){let ze,qe,Ve=-1,tt=Ae[1],rt=0,it=7,nt=4;for(0===tt&&(it=138,nt=3),Ae[2*(Ce+1)+1]=65535,ze=0;ze<=Ce;ze++)qe=tt,tt=Ae[2*(ze+1)+1],++rt>=7;ze<30;ze++)for(Rc[ze]=qe<<7,ke=0;ke<1<=8&&(ke.pending_buf[ke.pending++]=255&ke.bi_buf,ke.bi_buf>>=8,ke.bi_valid-=8)}(ke)}function qa(ke,Ae,Ce,ze){let qe,Ve,tt=0;ke.level>0?(2===ke.strm.data_type&&(ke.strm.data_type=function(ke){let Ae,Ce=4093624447;for(Ae=0;Ae<=31;Ae++,Ce>>>=1)if(1&Ce&&0!==ke.dyn_ltree[2*Ae])return 0;if(0!==ke.dyn_ltree[18]||0!==ke.dyn_ltree[20]||0!==ke.dyn_ltree[26])return 1;for(Ae=32;Ae<256;Ae++)if(0!==ke.dyn_ltree[2*Ae])return 1;return 0}(ke)),Da(ke,ke.l_desc),Da(ke,ke.d_desc),tt=function(ke){let Ae;for(Ra(ke,ke.dyn_ltree,ke.l_desc.max_code),Ra(ke,ke.dyn_dtree,ke.d_desc.max_code),Da(ke,ke.bl_desc),Ae=18;Ae>=3&&0===ke.bl_tree[2*gc[Ae]+1];Ae--);return ke.opt_len+=3*(Ae+1)+5+5+4,Ae}(ke),qe=ke.opt_len+3+7>>>3,Ve=ke.static_len+3+7>>>3,Ve<=qe&&(qe=Ve)):qe=Ve=Ce+5,Ce+4<=qe&&-1!==Ae?Ta(ke,Ae,Ce,ze):4===ke.strategy||Ve===qe?(ka(ke,2+(ze?1:0),3),Ka(ke,Sc,Mc)):(ka(ke,4+(ze?1:0),3),function(ke,Ae,Ce,ze){let qe;for(ka(ke,Ae-257,5),ka(ke,Ce-1,5),ka(ke,ze-4,4),qe=0;qe>>8&255,ke.pending_buf[ke.d_buf+2*ke.last_lit+1]=255&Ae,ke.pending_buf[ke.l_buf+ke.last_lit]=255&Ce,ke.last_lit++,0===Ae?ke.dyn_ltree[2*Ce]++:(ke.matches++,Ae--,ke.dyn_ltree[2*(Cc[Ce]+256+1)]++,ke.dyn_dtree[2*va(Ae)]++),ke.last_lit===ke.lit_bufsize-1}function Fa(ke,Ae,Ce,ze){let qe=65535&ke|0,Ve=ke>>>16&65535|0,tt=0;for(;0!==Ce;){tt=Ce>2e3?2e3:Ce,Ce-=tt;do{qe=qe+Ae[ze++]|0,Ve=Ve+qe|0}while(--tt);qe%=65521,Ve%=65521}return qe|Ve<<16|0}const ru=function(){let ke;const Ae=[];for(let Ce=0;Ce<256;Ce++){ke=Ce;for(let Ae=0;Ae<8;Ae++)ke=1&ke?3988292384^ke>>>1:ke>>>1;Ae[Ce]=ke}return Ae}();function ja(ke,Ae,Ce,ze){const qe=ru,Ve=ze+Ce;ke^=-1;for(let Ce=ze;Ce>>8^qe[255&(ke^Ae[Ce])];return-1^ke}var iu={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"};function Wa(ke,Ae){return ke.msg=iu[Ae],Ae}function Ha(ke){return(ke<<1)-(ke>4?9:0)}function Ga(ke){let Ae=ke.length;for(;--Ae>=0;)ke[Ae]=0}function Va(ke){const Ae=ke.state;let Ce=Ae.pending;Ce>ke.avail_out&&(Ce=ke.avail_out),0!==Ce&&(oc(ke.output,Ae.pending_buf,Ae.pending_out,Ce,ke.next_out),ke.next_out+=Ce,Ae.pending_out+=Ce,ke.total_out+=Ce,ke.avail_out-=Ce,Ae.pending-=Ce,0===Ae.pending&&(Ae.pending_out=0))}function $a(ke,Ae){qa(ke,ke.block_start>=0?ke.block_start:-1,ke.strstart-ke.block_start,Ae),ke.block_start=ke.strstart,Va(ke.strm)}function Za(ke,Ae){ke.pending_buf[ke.pending++]=Ae}function Ya(ke,Ae){ke.pending_buf[ke.pending++]=Ae>>>8&255,ke.pending_buf[ke.pending++]=255&Ae}function Xa(ke,Ae,Ce,ze){let qe=ke.avail_in;return qe>ze&&(qe=ze),0===qe?0:(ke.avail_in-=qe,oc(Ae,ke.input,ke.next_in,qe,Ce),1===ke.state.wrap?ke.adler=Fa(ke.adler,Ae,qe,Ce):2===ke.state.wrap&&(ke.adler=ja(ke.adler,Ae,qe,Ce)),ke.next_in+=qe,ke.total_in+=qe,qe)}function Qa(ke,Ae){let Ce,ze,qe=ke.max_chain_length,Ve=ke.strstart,tt=ke.prev_length,rt=ke.nice_match;const it=ke.strstart>ke.w_size-262?ke.strstart-(ke.w_size-262):0,nt=ke.window,ot=ke.w_mask,ct=ke.prev,ht=ke.strstart+258;let ft=nt[Ve+tt-1],yt=nt[Ve+tt];ke.prev_length>=ke.good_match&&(qe>>=2),rt>ke.lookahead&&(rt=ke.lookahead);do{if(Ce=Ae,nt[Ce+tt]===yt&&nt[Ce+tt-1]===ft&&nt[Ce]===nt[Ve]&&nt[++Ce]===nt[Ve+1]){Ve+=2,Ce++;do{}while(nt[++Ve]===nt[++Ce]&&nt[++Ve]===nt[++Ce]&&nt[++Ve]===nt[++Ce]&&nt[++Ve]===nt[++Ce]&&nt[++Ve]===nt[++Ce]&&nt[++Ve]===nt[++Ce]&&nt[++Ve]===nt[++Ce]&&nt[++Ve]===nt[++Ce]&&Vett){if(ke.match_start=Ae,tt=ze,ze>=rt)break;ft=nt[Ve+tt-1],yt=nt[Ve+tt]}}}while((Ae=ct[Ae&ot])>it&&0!=--qe);return tt<=ke.lookahead?tt:ke.lookahead}function Ja(ke){const Ae=ke.w_size;let Ce,ze,qe,Ve,tt;do{if(Ve=ke.window_size-ke.lookahead-ke.strstart,ke.strstart>=Ae+(Ae-262)){oc(ke.window,ke.window,Ae,Ae,0),ke.match_start-=Ae,ke.strstart-=Ae,ke.block_start-=Ae,ze=ke.hash_size,Ce=ze;do{qe=ke.head[--Ce],ke.head[Ce]=qe>=Ae?qe-Ae:0}while(--ze);ze=Ae,Ce=ze;do{qe=ke.prev[--Ce],ke.prev[Ce]=qe>=Ae?qe-Ae:0}while(--ze);Ve+=Ae}if(0===ke.strm.avail_in)break;if(ze=Xa(ke.strm,ke.window,ke.strstart+ke.lookahead,Ve),ke.lookahead+=ze,ke.lookahead+ke.insert>=3)for(tt=ke.strstart-ke.insert,ke.ins_h=ke.window[tt],ke.ins_h=(ke.ins_h<=3&&(ke.ins_h=(ke.ins_h<=3)if(ze=Oa(ke,ke.strstart-ke.match_start,ke.match_length-3),ke.lookahead-=ke.match_length,ke.match_length<=ke.max_lazy_match&&ke.lookahead>=3){ke.match_length--;do{ke.strstart++,ke.ins_h=(ke.ins_h<=3&&(ke.ins_h=(ke.ins_h<4096)&&(ke.match_length=2)),ke.prev_length>=3&&ke.match_length<=ke.prev_length){qe=ke.strstart+ke.lookahead-3,ze=Oa(ke,ke.strstart-1-ke.prev_match,ke.prev_length-3),ke.lookahead-=ke.prev_length-1,ke.prev_length-=2;do{++ke.strstart<=qe&&(ke.ins_h=(ke.ins_h<ke.pending_buf_size-5&&(Ce=ke.pending_buf_size-5);;){if(ke.lookahead<=1){if(Ja(ke),0===ke.lookahead&&0===Ae)return 1;if(0===ke.lookahead)break}ke.strstart+=ke.lookahead,ke.lookahead=0;const ze=ke.block_start+Ce;if((0===ke.strstart||ke.strstart>=ze)&&(ke.lookahead=ke.strstart-ze,ke.strstart=ze,$a(ke,!1),0===ke.strm.avail_out))return 1;if(ke.strstart-ke.block_start>=ke.w_size-262&&($a(ke,!1),0===ke.strm.avail_out))return 1}return ke.insert=0,4===Ae?($a(ke,!0),0===ke.strm.avail_out?3:4):(ke.strstart>ke.block_start&&($a(ke,!1),ke.strm.avail_out),1)})),new rs(4,4,8,4,es),new rs(4,5,16,8,es),new rs(4,6,32,32,es),new rs(4,4,16,16,ts),new rs(8,16,32,32,ts),new rs(8,16,128,128,ts),new rs(8,32,128,256,ts),new rs(32,128,258,1024,ts),new rs(32,258,258,4096,ts)];class ns{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=8,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new Uo(1146),this.dyn_dtree=new Uo(122),this.bl_tree=new Uo(78),Ga(this.dyn_ltree),Ga(this.dyn_dtree),Ga(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uo(16),this.heap=new Uo(573),Ga(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uo(573),Ga(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 as(ke){const Ae=function(ke){let Ae;return ke&&ke.state?(ke.total_in=ke.total_out=0,ke.data_type=2,Ae=ke.state,Ae.pending=0,Ae.pending_out=0,Ae.wrap<0&&(Ae.wrap=-Ae.wrap),Ae.status=Ae.wrap?42:113,ke.adler=2===Ae.wrap?0:1,Ae.last_flush=0,Ba(Ae),0):Wa(ke,-2)}(ke);return 0===Ae&&function(ke){ke.window_size=2*ke.w_size,Ga(ke.head),ke.max_lazy_match=nu[ke.level].max_lazy,ke.good_match=nu[ke.level].good_length,ke.nice_match=nu[ke.level].nice_length,ke.max_chain_length=nu[ke.level].max_chain,ke.strstart=0,ke.block_start=0,ke.lookahead=0,ke.insert=0,ke.match_length=ke.prev_length=2,ke.match_available=0,ke.ins_h=0}(ke.state),Ae}function ss(ke,Ae){let Ce,ze,qe,Ve;if(!ke||!ke.state||Ae>5||Ae<0)return ke?Wa(ke,-2):-2;if(ze=ke.state,!ke.output||!ke.input&&0!==ke.avail_in||666===ze.status&&4!==Ae)return Wa(ke,0===ke.avail_out?-5:-2);if(ze.strm=ke,Ce=ze.last_flush,ze.last_flush=Ae,42===ze.status)if(2===ze.wrap)ke.adler=0,Za(ze,31),Za(ze,139),Za(ze,8),ze.gzhead?(Za(ze,(ze.gzhead.text?1:0)+(ze.gzhead.hcrc?2:0)+(ze.gzhead.extra?4:0)+(ze.gzhead.name?8:0)+(ze.gzhead.comment?16:0)),Za(ze,255&ze.gzhead.time),Za(ze,ze.gzhead.time>>8&255),Za(ze,ze.gzhead.time>>16&255),Za(ze,ze.gzhead.time>>24&255),Za(ze,9===ze.level?2:ze.strategy>=2||ze.level<2?4:0),Za(ze,255&ze.gzhead.os),ze.gzhead.extra&&ze.gzhead.extra.length&&(Za(ze,255&ze.gzhead.extra.length),Za(ze,ze.gzhead.extra.length>>8&255)),ze.gzhead.hcrc&&(ke.adler=ja(ke.adler,ze.pending_buf,ze.pending,0)),ze.gzindex=0,ze.status=69):(Za(ze,0),Za(ze,0),Za(ze,0),Za(ze,0),Za(ze,0),Za(ze,9===ze.level?2:ze.strategy>=2||ze.level<2?4:0),Za(ze,3),ze.status=113);else{let Ae=8+(ze.w_bits-8<<4)<<8,Ce=-1;Ce=ze.strategy>=2||ze.level<2?0:ze.level<6?1:6===ze.level?2:3,Ae|=Ce<<6,0!==ze.strstart&&(Ae|=32),Ae+=31-Ae%31,ze.status=113,Ya(ze,Ae),0!==ze.strstart&&(Ya(ze,ke.adler>>>16),Ya(ze,65535&ke.adler)),ke.adler=1}if(69===ze.status)if(ze.gzhead.extra){for(qe=ze.pending;ze.gzindex<(65535&ze.gzhead.extra.length)&&(ze.pending!==ze.pending_buf_size||(ze.gzhead.hcrc&&ze.pending>qe&&(ke.adler=ja(ke.adler,ze.pending_buf,ze.pending-qe,qe)),Va(ke),qe=ze.pending,ze.pending!==ze.pending_buf_size));)Za(ze,255&ze.gzhead.extra[ze.gzindex]),ze.gzindex++;ze.gzhead.hcrc&&ze.pending>qe&&(ke.adler=ja(ke.adler,ze.pending_buf,ze.pending-qe,qe)),ze.gzindex===ze.gzhead.extra.length&&(ze.gzindex=0,ze.status=73)}else ze.status=73;if(73===ze.status)if(ze.gzhead.name){qe=ze.pending;do{if(ze.pending===ze.pending_buf_size&&(ze.gzhead.hcrc&&ze.pending>qe&&(ke.adler=ja(ke.adler,ze.pending_buf,ze.pending-qe,qe)),Va(ke),qe=ze.pending,ze.pending===ze.pending_buf_size)){Ve=1;break}Ve=ze.gzindexqe&&(ke.adler=ja(ke.adler,ze.pending_buf,ze.pending-qe,qe)),0===Ve&&(ze.gzindex=0,ze.status=91)}else ze.status=91;if(91===ze.status)if(ze.gzhead.comment){qe=ze.pending;do{if(ze.pending===ze.pending_buf_size&&(ze.gzhead.hcrc&&ze.pending>qe&&(ke.adler=ja(ke.adler,ze.pending_buf,ze.pending-qe,qe)),Va(ke),qe=ze.pending,ze.pending===ze.pending_buf_size)){Ve=1;break}Ve=ze.gzindexqe&&(ke.adler=ja(ke.adler,ze.pending_buf,ze.pending-qe,qe)),0===Ve&&(ze.status=103)}else ze.status=103;if(103===ze.status&&(ze.gzhead.hcrc?(ze.pending+2>ze.pending_buf_size&&Va(ke),ze.pending+2<=ze.pending_buf_size&&(Za(ze,255&ke.adler),Za(ze,ke.adler>>8&255),ke.adler=0,ze.status=113)):ze.status=113),0!==ze.pending){if(Va(ke),0===ke.avail_out)return ze.last_flush=-1,0}else if(0===ke.avail_in&&Ha(Ae)<=Ha(Ce)&&4!==Ae)return Wa(ke,-5);if(666===ze.status&&0!==ke.avail_in)return Wa(ke,-5);if(0!==ke.avail_in||0!==ze.lookahead||0!==Ae&&666!==ze.status){var tt=2===ze.strategy?function(ke,Ae){let Ce;for(;;){if(0===ke.lookahead&&(Ja(ke),0===ke.lookahead)){if(0===Ae)return 1;break}if(ke.match_length=0,Ce=Oa(ke,0,ke.window[ke.strstart]),ke.lookahead--,ke.strstart++,Ce&&($a(ke,!1),0===ke.strm.avail_out))return 1}return ke.insert=0,4===Ae?($a(ke,!0),0===ke.strm.avail_out?3:4):ke.last_lit&&($a(ke,!1),0===ke.strm.avail_out)?1:2}(ze,Ae):3===ze.strategy?function(ke,Ae){let Ce,ze,qe,Ve;const tt=ke.window;for(;;){if(ke.lookahead<=258){if(Ja(ke),ke.lookahead<=258&&0===Ae)return 1;if(0===ke.lookahead)break}if(ke.match_length=0,ke.lookahead>=3&&ke.strstart>0&&(qe=ke.strstart-1,ze=tt[qe],ze===tt[++qe]&&ze===tt[++qe]&&ze===tt[++qe])){Ve=ke.strstart+258;do{}while(ze===tt[++qe]&&ze===tt[++qe]&&ze===tt[++qe]&&ze===tt[++qe]&&ze===tt[++qe]&&ze===tt[++qe]&&ze===tt[++qe]&&ze===tt[++qe]&&qeke.lookahead&&(ke.match_length=ke.lookahead)}if(ke.match_length>=3?(Ce=Oa(ke,1,ke.match_length-3),ke.lookahead-=ke.match_length,ke.strstart+=ke.match_length,ke.match_length=0):(Ce=Oa(ke,0,ke.window[ke.strstart]),ke.lookahead--,ke.strstart++),Ce&&($a(ke,!1),0===ke.strm.avail_out))return 1}return ke.insert=0,4===Ae?($a(ke,!0),0===ke.strm.avail_out?3:4):ke.last_lit&&($a(ke,!1),0===ke.strm.avail_out)?1:2}(ze,Ae):nu[ze.level].func(ze,Ae);if(3!==tt&&4!==tt||(ze.status=666),1===tt||3===tt)return 0===ke.avail_out&&(ze.last_flush=-1),0;if(2===tt&&(1===Ae?za(ze):5!==Ae&&(Ta(ze,0,0,!1),3===Ae&&(Ga(ze.head),0===ze.lookahead&&(ze.strstart=0,ze.block_start=0,ze.insert=0))),Va(ke),0===ke.avail_out))return ze.last_flush=-1,0}return 4!==Ae?0:ze.wrap<=0?1:(2===ze.wrap?(Za(ze,255&ke.adler),Za(ze,ke.adler>>8&255),Za(ze,ke.adler>>16&255),Za(ze,ke.adler>>24&255),Za(ze,255&ke.total_in),Za(ze,ke.total_in>>8&255),Za(ze,ke.total_in>>16&255),Za(ze,ke.total_in>>24&255)):(Ya(ze,ke.adler>>>16),Ya(ze,65535&ke.adler)),Va(ke),ze.wrap>0&&(ze.wrap=-ze.wrap),0!==ze.pending?0:1)}try{String.fromCharCode.call(null,0)}catch(ze){}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(ze){}const au=new Do(256);for(let ke=0;ke<256;ke++)au[ke]=ke>=252?6:ke>=248?5:ke>=240?4:ke>=224?3:ke>=192?2:1;function cs(ke){let Ae,Ce,ze,qe,Ve=0;const tt=ke.length;for(ze=0;ze>>6,rt[qe++]=128|63&Ae):Ae<65536?(rt[qe++]=224|Ae>>>12,rt[qe++]=128|Ae>>>6&63,rt[qe++]=128|63&Ae):(rt[qe++]=240|Ae>>>18,rt[qe++]=128|Ae>>>12&63,rt[qe++]=128|Ae>>>6&63,rt[qe++]=128|63&Ae);return rt}au[254]=au[254]=1;class us{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 hs{constructor(ke){this.options={level:-1,method:8,chunkSize:16384,windowBits:15,memLevel:8,strategy:0,...ke||{}};const Ae=this.options;Ae.raw&&Ae.windowBits>0?Ae.windowBits=-Ae.windowBits:Ae.gzip&&Ae.windowBits>0&&Ae.windowBits<16&&(Ae.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new us,this.strm.avail_out=0;var Ce,ze,qe=function(ke,Ae,Ce,ze,qe,Ve){if(!ke)return-2;let tt=1;if(-1===Ae&&(Ae=6),ze<0?(tt=0,ze=-ze):ze>15&&(tt=2,ze-=16),qe<1||qe>9||8!==Ce||ze<8||ze>15||Ae<0||Ae>9||Ve<0||Ve>4)return Wa(ke,-2);8===ze&&(ze=9);const rt=new ns;return ke.state=rt,rt.strm=ke,rt.wrap=tt,rt.gzhead=null,rt.w_bits=ze,rt.w_size=1<=Ce.w_size&&(0===Ve&&(Ga(Ce.head),Ce.strstart=0,Ce.block_start=0,Ce.insert=0),nt=new Do(Ce.w_size),oc(nt,Ae,ot-Ce.w_size,Ce.w_size,0),Ae=nt,ot=Ce.w_size),tt=ke.avail_in,rt=ke.next_in,it=ke.input,ke.avail_in=ot,ke.next_in=0,ke.input=Ae,Ja(Ce);Ce.lookahead>=3;){ze=Ce.strstart,qe=Ce.lookahead-2;do{Ce.ins_h=(Ce.ins_h<0||0===Ce.avail_out)&&1!==qe);return 4===Ve?(qe=function(ke){let Ae;return ke&&ke.state?(Ae=ke.state.status,42!==Ae&&69!==Ae&&73!==Ae&&91!==Ae&&103!==Ae&&113!==Ae&&666!==Ae?Wa(ke,-2):(ke.state=null,113===Ae?Wa(ke,-3):0)):-2}(this.strm),this.onEnd(qe),this.ended=!0,0===qe):2!==Ve||(this.onEnd(0),Ce.avail_out=0,!0)}onData(ke){this.chunks.push(ke)}onEnd(ke){0===ke&&(this.result=ac(this.chunks)),this.chunks=[],this.err=ke,this.msg=this.strm.msg}}function fs(ke,Ae){let Ce,ze,qe,Ve,tt,rt,it,nt,ot,ct;const ht=ke.state;Ce=ke.next_in;const ft=ke.input,yt=Ce+(ke.avail_in-5);ze=ke.next_out;const mt=ke.output,kt=ze-(Ae-ke.avail_out),St=ze+(ke.avail_out-257),Et=ht.dmax,Pt=ht.wsize,Bt=ht.whave,Dt=ht.wnext,Rt=ht.window;qe=ht.hold,Ve=ht.bits;const Tt=ht.lencode,Kt=ht.distcode,It=(1<>>24,qe>>>=rt,Ve-=rt,rt=tt>>>16&255,0===rt)mt[ze++]=65535&tt;else{if(!(16&rt)){if(0==(64&rt)){tt=Tt[(65535&tt)+(qe&(1<>>=rt,Ve-=rt),Ve<15&&(qe+=ft[Ce++]<>>24,qe>>>=rt,Ve-=rt,rt=tt>>>16&255,!(16&rt)){if(0==(64&rt)){tt=Kt[(65535&tt)+(qe&(1<Et){ke.msg="invalid distance too far back",ht.mode=30;break e}if(qe>>>=rt,Ve-=rt,rt=ze-kt,nt>rt){if(rt=nt-rt,rt>Bt&&ht.sane){ke.msg="invalid distance too far back",ht.mode=30;break e}if(ot=0,ct=Rt,0===Dt){if(ot+=Pt-rt,rt2;)mt[ze++]=ct[ot++],mt[ze++]=ct[ot++],mt[ze++]=ct[ot++],it-=3;it&&(mt[ze++]=ct[ot++],it>1&&(mt[ze++]=ct[ot++]))}else{ot=ze-nt;do{mt[ze++]=mt[ot++],mt[ze++]=mt[ot++],mt[ze++]=mt[ot++],it-=3}while(it>2);it&&(mt[ze++]=mt[ot++],it>1&&(mt[ze++]=mt[ot++]))}break}}break}}while(Ce>3,Ce-=it,Ve-=it<<3,qe&=(1<=1&&0===Ut[St];St--);if(Et>St&&(Et=St),0===St)return qe[Ve++]=20971520,qe[Ve++]=20971520,rt.bits=1,0;for(kt=1;kt0&&(0===ke||1!==St))return-1;for(Ot[1]=0,yt=1;yt<15;yt++)Ot[yt+1]=Ot[yt]+Ut[yt];for(mt=0;mt852||2===ke&&Rt>592)return 1;for(;;){Nt=yt-Bt,tt[mt]ft?(zt=Ft[Lt+tt[mt]],qt=Kt[It+tt[mt]]):(zt=96,qt=0),nt=1<>Bt)+ot]=Nt<<24|zt<<16|qt|0}while(0!==ot);for(nt=1<>=1;if(0!==nt?(Tt&=nt-1,Tt+=nt):Tt=0,mt++,0==--Ut[yt]){if(yt===St)break;yt=Ae[Ce+tt[mt]]}if(yt>Et&&(Tt&Ht)!==ct){for(0===Bt&&(Bt=Et),ht+=kt,Pt=yt-Bt,Dt=1<852||2===ke&&Rt>592)return 1;ct=Tt&Ht,qe[ct]=Et<<24|Pt<<16|ht-Ve|0}}return 0!==Tt&&(qe[ht+Tt]=yt-Bt<<24|64<<16|0),rt.bits=Et,0}function ms(ke){return(ke>>>24&255)+(ke>>>8&65280)+((65280&ke)<<8)+((255&ke)<<24)}class gs{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 Uo(320),this.work=new Uo(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}}function ws(ke){let Ae;return ke&&ke.state?(Ae=ke.state,Ae.wsize=0,Ae.whave=0,Ae.wnext=0,function(ke){let Ae;return ke&&ke.state?(Ae=ke.state,ke.total_in=ke.total_out=Ae.total=0,ke.msg="",Ae.wrap&&(ke.adler=1&Ae.wrap),Ae.mode=1,Ae.last=0,Ae.havedict=0,Ae.dmax=32768,Ae.head=null,Ae.hold=0,Ae.bits=0,Ae.lencode=Ae.lendyn=new ec(852),Ae.distcode=Ae.distdyn=new ec(592),Ae.sane=1,Ae.back=-1,0):-2}(ke)):-2}function vs(ke,Ae){let Ce,ze;return ke?(ze=new gs,ke.state=ze,ze.window=null,Ce=function(ke,Ae){let Ce,ze;return ke&&ke.state?(ze=ke.state,Ae<0?(Ce=0,Ae=-Ae):(Ce=1+(Ae>>4),Ae<48&&(Ae&=15)),Ae&&(Ae<8||Ae>15)?-2:(null!==ze.window&&ze.wbits!==Ae&&(ze.window=null),ze.wrap=Ce,ze.wbits=Ae,ws(ke))):-2}(ke,Ae),0!==Ce&&(ke.state=null),Ce):-2}let sf,af,el=!0;function Ss(ke){if(el){let Ae;for(sf=new ec(512),af=new ec(32),Ae=0;Ae<144;)ke.lens[Ae++]=8;for(;Ae<256;)ke.lens[Ae++]=9;for(;Ae<280;)ke.lens[Ae++]=7;for(;Ae<288;)ke.lens[Ae++]=8;for(bs(1,ke.lens,0,288,sf,0,ke.work,{bits:9}),Ae=0;Ae<32;)ke.lens[Ae++]=5;bs(2,ke.lens,0,32,af,0,ke.work,{bits:5}),el=!1}ke.lencode=sf,ke.lenbits=9,ke.distcode=af,ke.distbits=5}function Es(ke,Ae,Ce,ze){let qe;const Ve=ke.state;return null===Ve.window&&(Ve.wsize=1<=Ve.wsize?(oc(Ve.window,Ae,Ce-Ve.wsize,Ve.wsize,0),Ve.wnext=0,Ve.whave=Ve.wsize):(qe=Ve.wsize-Ve.wnext,qe>ze&&(qe=ze),oc(Ve.window,Ae,Ce-ze,qe,Ve.wnext),(ze-=qe)?(oc(Ve.window,Ae,Ce-ze,ze,0),Ve.wnext=ze,Ve.whave=Ve.wsize):(Ve.wnext+=qe,Ve.wnext===Ve.wsize&&(Ve.wnext=0),Ve.whave>>8&255,Ce.check=ja(Ce.check,Ot,2,0),nt=0,ot=0,Ce.mode=2;break}if(Ce.flags=0,Ce.head&&(Ce.head.done=!1),!(1&Ce.wrap)||(((255&nt)<<8)+(nt>>8))%31){ke.msg="incorrect header check",Ce.mode=30;break}if(8!=(15&nt)){ke.msg="unknown compression method",Ce.mode=30;break}if(nt>>>=4,ot-=4,Rt=8+(15&nt),0===Ce.wbits)Ce.wbits=Rt;else if(Rt>Ce.wbits){ke.msg="invalid window size",Ce.mode=30;break}Ce.dmax=1<>8&1),512&Ce.flags&&(Ot[0]=255&nt,Ot[1]=nt>>>8&255,Ce.check=ja(Ce.check,Ot,2,0)),nt=0,ot=0,Ce.mode=3;case 3:for(;ot<32;){if(0===rt)break e;rt--,nt+=ze[Ve++]<>>8&255,Ot[2]=nt>>>16&255,Ot[3]=nt>>>24&255,Ce.check=ja(Ce.check,Ot,4,0)),nt=0,ot=0,Ce.mode=4;case 4:for(;ot<16;){if(0===rt)break e;rt--,nt+=ze[Ve++]<>8),512&Ce.flags&&(Ot[0]=255&nt,Ot[1]=nt>>>8&255,Ce.check=ja(Ce.check,Ot,2,0)),nt=0,ot=0,Ce.mode=5;case 5:if(1024&Ce.flags){for(;ot<16;){if(0===rt)break e;rt--,nt+=ze[Ve++]<>>8&255,Ce.check=ja(Ce.check,Ot,2,0)),nt=0,ot=0}else Ce.head&&(Ce.head.extra=null);Ce.mode=6;case 6:if(1024&Ce.flags&&(ft=Ce.length,ft>rt&&(ft=rt),ft&&(Ce.head&&(Rt=Ce.head.extra_len-Ce.length,Ce.head.extra||(Ce.head.extra=Array(Ce.head.extra_len)),oc(Ce.head.extra,ze,Ve,ft,Rt)),512&Ce.flags&&(Ce.check=ja(Ce.check,ze,ft,Ve)),rt-=ft,Ve+=ft,Ce.length-=ft),Ce.length))break e;Ce.length=0,Ce.mode=7;case 7:if(2048&Ce.flags){if(0===rt)break e;ft=0;do{Rt=ze[Ve+ft++],Ce.head&&Rt&&Ce.length<65536&&(Ce.head.name+=String.fromCharCode(Rt))}while(Rt&&ft>9&1,Ce.head.done=!0),ke.adler=Ce.check=0,Ce.mode=12;break;case 10:for(;ot<32;){if(0===rt)break e;rt--,nt+=ze[Ve++]<>>=7&ot,ot-=7&ot,Ce.mode=27;break}for(;ot<3;){if(0===rt)break e;rt--,nt+=ze[Ve++]<>>=1,ot-=1,3&nt){case 0:Ce.mode=14;break;case 1:if(Ss(Ce),Ce.mode=20,6===Ae){nt>>>=2,ot-=2;break e}break;case 2:Ce.mode=17;break;case 3:ke.msg="invalid block type",Ce.mode=30}nt>>>=2,ot-=2;break;case 14:for(nt>>>=7&ot,ot-=7&ot;ot<32;){if(0===rt)break e;rt--,nt+=ze[Ve++]<>>16^65535)){ke.msg="invalid stored block lengths",Ce.mode=30;break}if(Ce.length=65535&nt,nt=0,ot=0,Ce.mode=15,6===Ae)break e;case 15:Ce.mode=16;case 16:if(ft=Ce.length,ft){if(ft>rt&&(ft=rt),ft>it&&(ft=it),0===ft)break e;oc(qe,ze,Ve,ft,tt),rt-=ft,Ve+=ft,it-=ft,tt+=ft,Ce.length-=ft;break}Ce.mode=12;break;case 17:for(;ot<14;){if(0===rt)break e;rt--,nt+=ze[Ve++]<>>=5,ot-=5,Ce.ndist=1+(31&nt),nt>>>=5,ot-=5,Ce.ncode=4+(15&nt),nt>>>=4,ot-=4,Ce.nlen>286||Ce.ndist>30){ke.msg="too many length or distance symbols",Ce.mode=30;break}Ce.have=0,Ce.mode=18;case 18:for(;Ce.have>>=3,ot-=3}for(;Ce.have<19;)Ce.lens[Nt[Ce.have++]]=0;if(Ce.lencode=Ce.lendyn,Ce.lenbits=7,Kt={bits:Ce.lenbits},Tt=bs(0,Ce.lens,0,19,Ce.lencode,0,Ce.work,Kt),Ce.lenbits=Kt.bits,Tt){ke.msg="invalid code lengths set",Ce.mode=30;break}Ce.have=0,Ce.mode=19;case 19:for(;Ce.have>>24,St=Ut>>>16&255,Et=65535&Ut,!(kt<=ot);){if(0===rt)break e;rt--,nt+=ze[Ve++]<>>=kt,ot-=kt,Ce.lens[Ce.have++]=Et;else{if(16===Et){for(It=kt+2;ot>>=kt,ot-=kt,0===Ce.have){ke.msg="invalid bit length repeat",Ce.mode=30;break}Rt=Ce.lens[Ce.have-1],ft=3+(3&nt),nt>>>=2,ot-=2}else if(17===Et){for(It=kt+3;ot>>=kt,ot-=kt,Rt=0,ft=3+(7&nt),nt>>>=3,ot-=3}else{for(It=kt+7;ot>>=kt,ot-=kt,Rt=0,ft=11+(127&nt),nt>>>=7,ot-=7}if(Ce.have+ft>Ce.nlen+Ce.ndist){ke.msg="invalid bit length repeat",Ce.mode=30;break}for(;ft--;)Ce.lens[Ce.have++]=Rt}}if(30===Ce.mode)break;if(0===Ce.lens[256]){ke.msg="invalid code -- missing end-of-block",Ce.mode=30;break}if(Ce.lenbits=9,Kt={bits:Ce.lenbits},Tt=bs(1,Ce.lens,0,Ce.nlen,Ce.lencode,0,Ce.work,Kt),Ce.lenbits=Kt.bits,Tt){ke.msg="invalid literal/lengths set",Ce.mode=30;break}if(Ce.distbits=6,Ce.distcode=Ce.distdyn,Kt={bits:Ce.distbits},Tt=bs(2,Ce.lens,Ce.nlen,Ce.ndist,Ce.distcode,0,Ce.work,Kt),Ce.distbits=Kt.bits,Tt){ke.msg="invalid distances set",Ce.mode=30;break}if(Ce.mode=20,6===Ae)break e;case 20:Ce.mode=21;case 21:if(rt>=6&&it>=258){ke.next_out=tt,ke.avail_out=it,ke.next_in=Ve,ke.avail_in=rt,Ce.hold=nt,Ce.bits=ot,fs(ke,ht),tt=ke.next_out,qe=ke.output,it=ke.avail_out,Ve=ke.next_in,ze=ke.input,rt=ke.avail_in,nt=Ce.hold,ot=Ce.bits,12===Ce.mode&&(Ce.back=-1);break}for(Ce.back=0;Ut=Ce.lencode[nt&(1<>>24,St=Ut>>>16&255,Et=65535&Ut,!(kt<=ot);){if(0===rt)break e;rt--,nt+=ze[Ve++]<>Pt)],kt=Ut>>>24,St=Ut>>>16&255,Et=65535&Ut,!(Pt+kt<=ot);){if(0===rt)break e;rt--,nt+=ze[Ve++]<>>=Pt,ot-=Pt,Ce.back+=Pt}if(nt>>>=kt,ot-=kt,Ce.back+=kt,Ce.length=Et,0===St){Ce.mode=26;break}if(32&St){Ce.back=-1,Ce.mode=12;break}if(64&St){ke.msg="invalid literal/length code",Ce.mode=30;break}Ce.extra=15&St,Ce.mode=22;case 22:if(Ce.extra){for(It=Ce.extra;ot>>=Ce.extra,ot-=Ce.extra,Ce.back+=Ce.extra}Ce.was=Ce.length,Ce.mode=23;case 23:for(;Ut=Ce.distcode[nt&(1<>>24,St=Ut>>>16&255,Et=65535&Ut,!(kt<=ot);){if(0===rt)break e;rt--,nt+=ze[Ve++]<>Pt)],kt=Ut>>>24,St=Ut>>>16&255,Et=65535&Ut,!(Pt+kt<=ot);){if(0===rt)break e;rt--,nt+=ze[Ve++]<>>=Pt,ot-=Pt,Ce.back+=Pt}if(nt>>>=kt,ot-=kt,Ce.back+=kt,64&St){ke.msg="invalid distance code",Ce.mode=30;break}Ce.offset=Et,Ce.extra=15&St,Ce.mode=24;case 24:if(Ce.extra){for(It=Ce.extra;ot>>=Ce.extra,ot-=Ce.extra,Ce.back+=Ce.extra}if(Ce.offset>Ce.dmax){ke.msg="invalid distance too far back",Ce.mode=30;break}Ce.mode=25;case 25:if(0===it)break e;if(ft=ht-it,Ce.offset>ft){if(ft=Ce.offset-ft,ft>Ce.whave&&Ce.sane){ke.msg="invalid distance too far back",Ce.mode=30;break}ft>Ce.wnext?(ft-=Ce.wnext,yt=Ce.wsize-ft):yt=Ce.wnext-ft,ft>Ce.length&&(ft=Ce.length),mt=Ce.window}else mt=qe,yt=tt-Ce.offset,ft=Ce.length;ft>it&&(ft=it),it-=ft,Ce.length-=ft;do{qe[tt++]=mt[yt++]}while(--ft);0===Ce.length&&(Ce.mode=21);break;case 26:if(0===it)break e;qe[tt++]=Ce.length,it--,Ce.mode=21;break;case 27:if(Ce.wrap){for(;ot<32;){if(0===rt)break e;rt--,nt|=ze[Ve++]<=0&&Ae.windowBits<16&&(Ae.windowBits=-Ae.windowBits,0===Ae.windowBits&&(Ae.windowBits=-15)),!(Ae.windowBits>=0&&Ae.windowBits<16)||ke&&ke.windowBits||(Ae.windowBits+=32),Ae.windowBits>15&&Ae.windowBits<48&&0==(15&Ae.windowBits)&&(Ae.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new us,this.strm.avail_out=0;let Ce=vs(this.strm,Ae.windowBits);if(0!==Ce)throw Error(iu[Ce]);if(this.header=new Ms,function(ke,Ae){let Ce;ke&&ke.state&&(Ce=ke.state,0==(2&Ce.wrap)||(Ce.head=Ae,Ae.done=!1))}(this.strm,this.header),Ae.dictionary&&("string"==typeof Ae.dictionary?Ae.dictionary=cs(Ae.dictionary):Ae.dictionary instanceof ArrayBuffer&&(Ae.dictionary=new Uint8Array(Ae.dictionary)),Ae.raw&&(Ce=xs(this.strm,Ae.dictionary),0!==Ce)))throw Error(iu[Ce])}push(ke,Ae){const{strm:Ce,options:{chunkSize:ze,dictionary:qe}}=this;let Ve,tt,rt=!1;if(this.ended)return!1;tt=Ae===~~Ae?Ae:!0===Ae?4:0,"string"==typeof ke?Ce.input=function(ke){const Ae=new Do(ke.length);for(let Ce=0,ze=Ae.length;Ce0||0===Ce.avail_out)&&1!==Ve);return 1===Ve&&(tt=4),4===tt?(Ve=function(ke){if(!ke||!ke.state)return-2;const Ae=ke.state;return Ae.window&&(Ae.window=null),ke.state=null,0}(this.strm),this.onEnd(Ve),this.ended=!0,0===Ve):2!==tt||(this.onEnd(0),Ce.avail_out=0,!0)}onData(ke){this.chunks.push(ke)}onEnd(ke){0===ke&&(this.result=ac(this.chunks)),this.chunks=[],this.err=ke,this.msg=this.strm.msg}}var rl=[0,1,3,7,15,31,63,127,255],Ds=function(ke){this.stream=ke,this.bitOffset=0,this.curByte=0,this.hasByte=!1};Ds.prototype._ensureByte=function(){this.hasByte||(this.curByte=this.stream.readByte(),this.hasByte=!0)},Ds.prototype.read=function(ke){for(var Ae=0;ke>0;){this._ensureByte();var Ce=8-this.bitOffset;if(ke>=Ce)Ae<<=Ce,Ae|=rl[Ce]&this.curByte,this.hasByte=!1,this.bitOffset=0,ke-=Ce;else{Ae<<=ke;var ze=Ce-ke;Ae|=(this.curByte&rl[ke]<>ze,this.bitOffset+=ke,ke=0}}return Ae},Ds.prototype.seek=function(ke){var Ae=ke%8,Ce=(ke-Ae)/8;this.bitOffset=Ae,this.stream.seek(Ce),this.hasByte=!1},Ds.prototype.pi=function(){var ke,Ae=new Uint8Array(6);for(ke=0;ke("00"+ke.toString(16)).slice(-2))).join("")}(Ae)};var il=Ds,Is=function(){};Is.prototype.readByte=function(){throw Error("abstract method readByte() not implemented")},Is.prototype.read=function(ke,Ae,Ce){for(var ze=0;ze>>0},this.updateCRC=function(Ae){ke=ke<<8^nl[255&(ke>>>24^Ae)]},this.updateCRCRun=function(Ae,Ce){for(;Ce-- >0;)ke=ke<<8^nl[255&(ke>>>24^Ae)]}}),zs=function(ke,Ae){var Ce,ze=ke[Ae];for(Ce=Ae;Ce>0;Ce--)ke[Ce]=ke[Ce-1];return ke[0]=ze,ze},ol={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},cl={};cl[ol.LAST_BLOCK]="Bad file checksum",cl[ol.NOT_BZIP_DATA]="Not bzip data",cl[ol.UNEXPECTED_INPUT_EOF]="Unexpected input EOF",cl[ol.UNEXPECTED_OUTPUT_EOF]="Unexpected output EOF",cl[ol.DATA_ERROR]="Data error",cl[ol.OUT_OF_MEMORY]="Out of memory",cl[ol.OBSOLETE_INPUT]="Obsolete (pre 0.9.5) bzip format not supported.";var Fs=function(ke,Ae){var Ce=cl[ke]||"unknown error";Ae&&(Ce+=": "+Ae);var ze=new TypeError(Ce);throw ze.errorCode=ke,ze},Ns=function(ke,Ae){this.writePos=this.writeCurrent=this.writeCount=0,this._start_bunzip(ke,Ae)};Ns.prototype._init_block=function(){return this._get_next_block()?(this.blockCRC=new al,!0):(this.writeCount=-1,!1)},Ns.prototype._start_bunzip=function(ke,Ae){var Ce=new Uint8Array(4);4===ke.read(Ce,0,4)&&"BZh"===String.fromCharCode(Ce[0],Ce[1],Ce[2])||Fs(ol.NOT_BZIP_DATA,"bad magic");var ze=Ce[3]-48;(ze<1||ze>9)&&Fs(ol.NOT_BZIP_DATA,"level out of range"),this.reader=new il(ke),this.dbufSize=1e5*ze,this.nextoutput=0,this.outputStream=Ae,this.streamCRC=0},Ns.prototype._get_next_block=function(){var ke,Ae,Ce,ze=this.reader,qe=ze.pi();if("177245385090"===qe)return!1;"314159265359"!==qe&&Fs(ol.NOT_BZIP_DATA),this.targetBlockCRC=ze.read(32)>>>0,this.streamCRC=(this.targetBlockCRC^(this.streamCRC<<1|this.streamCRC>>>31))>>>0,ze.read(1)&&Fs(ol.OBSOLETE_INPUT);var Ve=ze.read(24);Ve>this.dbufSize&&Fs(ol.DATA_ERROR,"initial position out of bounds");var tt=ze.read(16),rt=new Uint8Array(256),it=0;for(ke=0;ke<16;ke++)if(tt&1<<15-ke){var nt=16*ke;for(Ce=ze.read(16),Ae=0;Ae<16;Ae++)Ce&1<<15-Ae&&(rt[it++]=nt+Ae)}var ot=ze.read(3);(ot<2||ot>6)&&Fs(ol.DATA_ERROR);var ct=ze.read(15);0===ct&&Fs(ol.DATA_ERROR);var ht=new Uint8Array(256);for(ke=0;ke=ot&&Fs(ol.DATA_ERROR);ft[ke]=zs(ht,Ae)}var yt,mt=it+2,kt=[];for(Ae=0;Ae20)&&Fs(ol.DATA_ERROR),ze.read(1);)ze.read(1)?tt--:tt++;Pt[ke]=tt}for(St=Et=Pt[0],ke=1;keEt?Et=Pt[ke]:Pt[ke]=ct&&Fs(ol.DATA_ERROR),yt=kt[ft[Ut++]]),ke=yt.minLen,Ae=ze.read(ke);ke>yt.maxLen&&Fs(ol.DATA_ERROR),!(Ae<=yt.limit[ke]);ke++)Ae=Ae<<1|ze.read(1);((Ae-=yt.base[ke])<0||Ae>=258)&&Fs(ol.DATA_ERROR);var Nt=yt.permute[Ae];if(0!==Nt&&1!==Nt){if(Kt)for(Kt=0,It+tt>this.dbufSize&&Fs(ol.DATA_ERROR),Rt[Tt=rt[ht[0]]]+=tt;tt--;)Ot[It++]=Tt;if(Nt>it)break;It>=this.dbufSize&&Fs(ol.DATA_ERROR),Rt[Tt=rt[Tt=zs(ht,ke=Nt-1)]]++,Ot[It++]=Tt}else Kt||(Kt=1,tt=0),tt+=0===Nt?Kt:2*Kt,Kt<<=1}for((Ve<0||Ve>=It)&&Fs(ol.DATA_ERROR),Ae=0,ke=0;ke<256;ke++)Ce=Ae+Rt[ke],Rt[ke]=Ae,Ae=Ce;for(ke=0;ke>=8,Ft=-1),this.writePos=zt,this.writeCurrent=qt,this.writeCount=It,this.writeRun=Ft,!0},Ns.prototype._read_bunzip=function(ke,Ae){var Ce,ze,qe;if(this.writeCount<0)return 0;var Ve=this.dbuf,tt=this.writePos,rt=this.writeCurrent,it=this.writeCount;this.outputsize;for(var nt=this.writeRun;it;){for(it--,ze=rt,rt=255&(tt=Ve[tt]),tt>>=8,3==nt++?(Ce=rt,qe=ze,rt=-1):(Ce=1,qe=rt),this.blockCRC.updateCRCRun(qe,Ce);Ce--;)this.outputStream.writeByte(qe),this.nextoutput++;rt!=ze&&(nt=0)}return this.writeCount=it,this.blockCRC.getCRC()!==this.targetBlockCRC&&Fs(ol.DATA_ERROR,"Bad block CRC (got "+this.blockCRC.getCRC().toString(16)+" expected "+this.targetBlockCRC.toString(16)+")"),this.nextoutput};var js=function(ke){if("readByte"in ke)return ke;var Ae=new sl;return Ae.pos=0,Ae.readByte=function(){return ke[this.pos++]},Ae.seek=function(ke){this.pos=ke},Ae.eof=function(){return this.pos>=ke.length},Ae},Ls=function(ke){var Ae=new sl,Ce=!0;if(ke)if("number"==typeof ke)Ae.buffer=new Uint8Array(ke),Ce=!1;else{if("writeByte"in ke)return ke;Ae.buffer=ke,Ce=!1}else Ae.buffer=new Uint8Array(16384);return Ae.pos=0,Ae.writeByte=function(ke){if(Ce&&this.pos>=this.buffer.length){var Ae=new Uint8Array(2*this.buffer.length);Ae.set(this.buffer),this.buffer=Ae}this.buffer[this.pos++]=ke},Ae.getBuffer=function(){if(this.pos!==this.buffer.length){if(!Ce)throw new TypeError("outputsize does not match decoded input");var ke=new Uint8Array(this.pos);ke.set(this.buffer.subarray(0,this.pos)),this.buffer=ke}return this.buffer},Ae._coerced=!0,Ae};var Ws=function(ke,Ae,Ce){for(var ze=js(ke),qe=Ls(Ae),Ve=new Ns(ze,qe);!("eof"in ze)||!ze.eof();)if(Ve._init_block())Ve._read_bunzip();else{var tt=Ve.reader.read(32)>>>0;if(tt!==Ve.streamCRC&&Fs(ol.DATA_ERROR,"Bad stream CRC (got "+Ve.streamCRC.toString(16)+" expected "+tt.toString(16)+")"),!Ce||!("eof"in ze)||ze.eof())break;Ve._start_bunzip(ze,qe)}if("getBuffer"in qe)return qe.getBuffer()};class Hs{static get tag(){return er.packet.literalData}constructor(ke=new Date){this.format=er.literal.utf8,this.date=Zt.normalizeDate(ke),this.text=null,this.data=null,this.filename=""}setText(ke,Ae=er.literal.utf8){this.format=Ae,this.text=ke,this.data=null}getText(ke=!1){return(null===this.text||Zt.isStream(this.text))&&(this.text=Zt.decodeUTF8(Zt.nativeEOL(this.getBytes(ke)))),this.text}setBytes(ke,Ae){this.format=Ae,this.data=ke,this.text=null}getBytes(ke=!1){return null===this.data&&(this.data=Zt.canonicalizeEOL(Zt.encodeUTF8(this.text))),ke?ee(this.data):this.data}setFilename(ke){this.filename=ke}getFilename(){return this.filename}async read(ke){await Q(ke,(async ke=>{const Ae=await ke.readByte(),Ce=await ke.readByte();this.filename=Zt.decodeUTF8(await ke.readBytes(Ce)),this.date=Zt.readDate(await ke.readBytes(4));let ze=ke.remainder();_(ze)&&(ze=await ie(ze)),this.setBytes(ze,Ae)}))}writeHeader(){const ke=Zt.encodeUTF8(this.filename),Ae=new Uint8Array([ke.length]),Ce=new Uint8Array([this.format]),ze=Zt.writeDate(this.date);return Zt.concatUint8Array([Ce,Ae,ke,ze])}write(){const ke=this.writeHeader(),Ae=this.getBytes();return Zt.concat([ke,Ae])}}function Gs(ke){let Ae,Ce=0;const ze=ke[0];return ze<192?([Ce]=ke,Ae=1):ze<255?(Ce=(ke[0]-192<<8)+ke[1]+192,Ae=2):255===ze&&(Ce=Zt.readNumber(ke.subarray(1,5)),Ae=5),{len:Ce,offset:Ae}}function Vs(ke){return ke<192?new Uint8Array([ke]):ke>191&&ke<8384?new Uint8Array([192+(ke-192>>8),ke-192&255]):Zt.concatUint8Array([new Uint8Array([255]),Zt.writeNumber(ke,4)])}function $s(ke){if(ke<0||ke>30)throw Error("Partial Length power must be between 1 and 30");return new Uint8Array([224+ke])}function Zs(ke){return new Uint8Array([192|ke])}function Ys(ke,Ae){return Zt.concatUint8Array([Zs(ke),Vs(Ae)])}function Xs(ke){return[er.packet.literalData,er.packet.compressedData,er.packet.symmetricallyEncryptedData,er.packet.symEncryptedIntegrityProtectedData,er.packet.aeadEncryptedData].includes(ke)}async function Qs(ke,Ae){const Ce=H(ke);let ze,qe;try{const Ve=await Ce.peekBytes(2);if(!Ve||Ve.length<2||0==(128&Ve[0]))throw Error("Error during parsing. This message / key probably does not conform to a valid OpenPGP format.");const tt=await Ce.readByte();let rt,it,nt=-1,ot=-1;ot=0,0!=(64&tt)&&(ot=1),ot?nt=63&tt:(nt=(63&tt)>>2,it=3&tt);const ct=Xs(nt);let ht,ft=null;if(ct){if("array"===Zt.isStream(ke)){const ke=new v;ze=G(ke),ft=ke}else{const ke=new Gt;ze=G(ke.writable),ft=ke.readable}qe=Ae({tag:nt,packet:ft})}else ft=[];do{if(ot){const ke=await Ce.readByte();if(ht=!1,ke<192)rt=ke;else if(ke>=192&&ke<224)rt=(ke-192<<8)+await Ce.readByte()+192;else if(ke>223&&ke<255){if(rt=1<<(31&ke),ht=!0,!ct)throw new TypeError("This packet type does not support partial lengths.")}else rt=await Ce.readByte()<<24|await Ce.readByte()<<16|await Ce.readByte()<<8|await Ce.readByte()}else switch(it){case 0:rt=await Ce.readByte();break;case 1:rt=await Ce.readByte()<<8|await Ce.readByte();break;case 2:rt=await Ce.readByte()<<24|await Ce.readByte()<<16|await Ce.readByte()<<8|await Ce.readByte();break;default:rt=1/0}if(rt>0){let ke=0;for(;;){ze&&await ze.ready;const{done:Ae,value:qe}=await Ce.read();if(Ae){if(rt===1/0)break;throw Error("Unexpected end of packet")}const Ve=rt===1/0?qe:qe.subarray(0,rt-ke);if(ze?await ze.write(Ve):ft.push(Ve),ke+=qe.length,ke>=rt){Ce.unshift(qe.subarray(rt-ke+qe.length));break}}}}while(ht);const yt=await Ce.peekBytes(ct?1/0:2);return ze?(await ze.ready,await ze.close()):(ft=Zt.concatUint8Array(ft),await Ae({tag:nt,packet:ft})),!yt||!yt.length}catch(ke){if(ze)return await ze.abort(ke),!0;throw ke}finally{ze&&await qe,Ce.releaseLock()}}class Js extends Error{constructor(...ke){super(...ke),Error.captureStackTrace&&Error.captureStackTrace(this,Js),this.name="UnsupportedError"}}const hl=Symbol("verified"),fl=new Set([er.signatureSubpacket.issuer,er.signatureSubpacket.issuerFingerprint,er.signatureSubpacket.embeddedSignature]);class ro{static get tag(){return er.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 Me,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[hl]=null}read(ke){let Ae=0;if(this.version=ke[Ae++],4!==this.version&&5!==this.version)throw new Js(`Version ${this.version} of the signature packet is unsupported.`);if(this.signatureType=ke[Ae++],this.publicKeyAlgorithm=ke[Ae++],this.hashAlgorithm=ke[Ae++],Ae+=this.readSubPackets(ke.subarray(Ae,ke.length),!0),!this.created)throw Error("Missing signature creation time subpacket.");this.signatureData=ke.subarray(0,Ae),Ae+=this.readSubPackets(ke.subarray(Ae,ke.length),!1),this.signedHashValue=ke.subarray(Ae,Ae+2),Ae+=2,this.params=mo.signature.parseSignatureParams(this.publicKeyAlgorithm,ke.subarray(Ae,ke.length))}writeParams(){return this.params instanceof Promise?ae((async()=>mo.serializeParams(this.publicKeyAlgorithm,await this.params))):mo.serializeParams(this.publicKeyAlgorithm,this.params)}write(){const ke=[];return ke.push(this.signatureData),ke.push(this.writeUnhashedSubPackets()),ke.push(this.signedHashValue),ke.push(this.writeParams()),Zt.concat(ke)}async sign(ke,Ae,Ce=new Date,ze=!1){5===ke.version?this.version=5:this.version=4;const qe=[new Uint8Array([this.version,this.signatureType,this.publicKeyAlgorithm,this.hashAlgorithm])];this.created=Zt.normalizeDate(Ce),this.issuerKeyVersion=ke.version,this.issuerFingerprint=ke.getFingerprintBytes(),this.issuerKeyID=ke.getKeyID(),qe.push(this.writeHashedSubPackets()),this.signatureData=Zt.concat(qe);const Ve=this.toHash(this.signatureType,Ae,ze),tt=await this.hash(this.signatureType,Ae,Ve,ze);this.signedHashValue=re(J(tt),0,2);const o=async()=>mo.signature.sign(this.publicKeyAlgorithm,this.hashAlgorithm,ke.publicParams,ke.privateParams,Ve,await ie(tt));Zt.isStream(tt)?this.params=o():(this.params=await o(),this[hl]=!0)}writeHashedSubPackets(){const ke=er.signatureSubpacket,Ae=[];let Ce;if(null===this.created)throw Error("Missing signature creation time");Ae.push(io(ke.signatureCreationTime,Zt.writeDate(this.created))),null!==this.signatureExpirationTime&&Ae.push(io(ke.signatureExpirationTime,Zt.writeNumber(this.signatureExpirationTime,4))),null!==this.exportable&&Ae.push(io(ke.exportableCertification,new Uint8Array([this.exportable?1:0]))),null!==this.trustLevel&&(Ce=new Uint8Array([this.trustLevel,this.trustAmount]),Ae.push(io(ke.trustSignature,Ce))),null!==this.regularExpression&&Ae.push(io(ke.regularExpression,this.regularExpression)),null!==this.revocable&&Ae.push(io(ke.revocable,new Uint8Array([this.revocable?1:0]))),null!==this.keyExpirationTime&&Ae.push(io(ke.keyExpirationTime,Zt.writeNumber(this.keyExpirationTime,4))),null!==this.preferredSymmetricAlgorithms&&(Ce=Zt.stringToUint8Array(Zt.uint8ArrayToString(this.preferredSymmetricAlgorithms)),Ae.push(io(ke.preferredSymmetricAlgorithms,Ce))),null!==this.revocationKeyClass&&(Ce=new Uint8Array([this.revocationKeyClass,this.revocationKeyAlgorithm]),Ce=Zt.concat([Ce,this.revocationKeyFingerprint]),Ae.push(io(ke.revocationKey,Ce))),this.rawNotations.forEach((([{name:ze,value:qe,humanReadable:Ve}])=>{Ce=[new Uint8Array([Ve?128:0,0,0,0])],Ce.push(Zt.writeNumber(ze.length,2)),Ce.push(Zt.writeNumber(qe.length,2)),Ce.push(Zt.stringToUint8Array(ze)),Ce.push(qe),Ce=Zt.concat(Ce),Ae.push(io(ke.notationData,Ce))})),null!==this.preferredHashAlgorithms&&(Ce=Zt.stringToUint8Array(Zt.uint8ArrayToString(this.preferredHashAlgorithms)),Ae.push(io(ke.preferredHashAlgorithms,Ce))),null!==this.preferredCompressionAlgorithms&&(Ce=Zt.stringToUint8Array(Zt.uint8ArrayToString(this.preferredCompressionAlgorithms)),Ae.push(io(ke.preferredCompressionAlgorithms,Ce))),null!==this.keyServerPreferences&&(Ce=Zt.stringToUint8Array(Zt.uint8ArrayToString(this.keyServerPreferences)),Ae.push(io(ke.keyServerPreferences,Ce))),null!==this.preferredKeyServer&&Ae.push(io(ke.preferredKeyServer,Zt.stringToUint8Array(this.preferredKeyServer))),null!==this.isPrimaryUserID&&Ae.push(io(ke.primaryUserID,new Uint8Array([this.isPrimaryUserID?1:0]))),null!==this.policyURI&&Ae.push(io(ke.policyURI,Zt.stringToUint8Array(this.policyURI))),null!==this.keyFlags&&(Ce=Zt.stringToUint8Array(Zt.uint8ArrayToString(this.keyFlags)),Ae.push(io(ke.keyFlags,Ce))),null!==this.signersUserID&&Ae.push(io(ke.signersUserID,Zt.stringToUint8Array(this.signersUserID))),null!==this.reasonForRevocationFlag&&(Ce=Zt.stringToUint8Array(String.fromCharCode(this.reasonForRevocationFlag)+this.reasonForRevocationString),Ae.push(io(ke.reasonForRevocation,Ce))),null!==this.features&&(Ce=Zt.stringToUint8Array(Zt.uint8ArrayToString(this.features)),Ae.push(io(ke.features,Ce))),null!==this.signatureTargetPublicKeyAlgorithm&&(Ce=[new Uint8Array([this.signatureTargetPublicKeyAlgorithm,this.signatureTargetHashAlgorithm])],Ce.push(Zt.stringToUint8Array(this.signatureTargetHash)),Ce=Zt.concat(Ce),Ae.push(io(ke.signatureTarget,Ce))),null!==this.preferredAEADAlgorithms&&(Ce=Zt.stringToUint8Array(Zt.uint8ArrayToString(this.preferredAEADAlgorithms)),Ae.push(io(ke.preferredAEADAlgorithms,Ce)));const ze=Zt.concat(Ae),qe=Zt.writeNumber(ze.length,2);return Zt.concat([qe,ze])}writeUnhashedSubPackets(){const ke=er.signatureSubpacket,Ae=[];let Ce;this.issuerKeyID.isNull()||5===this.issuerKeyVersion||Ae.push(io(ke.issuer,this.issuerKeyID.write())),null!==this.embeddedSignature&&Ae.push(io(ke.embeddedSignature,this.embeddedSignature.write())),null!==this.issuerFingerprint&&(Ce=[new Uint8Array([this.issuerKeyVersion]),this.issuerFingerprint],Ce=Zt.concat(Ce),Ae.push(io(ke.issuerFingerprint,Ce))),this.unhashedSubpackets.forEach((ke=>{Ae.push(Vs(ke.length)),Ae.push(ke)}));const ze=Zt.concat(Ae),qe=Zt.writeNumber(ze.length,2);return Zt.concat([qe,ze])}readSubPacket(ke,Ae=!0){let Ce=0;const ze=128&ke[Ce],qe=127&ke[Ce];if(Ae||fl.has(qe))switch(Ce++,qe){case er.signatureSubpacket.signatureCreationTime:this.created=Zt.readDate(ke.subarray(Ce,ke.length));break;case er.signatureSubpacket.signatureExpirationTime:{const Ae=Zt.readNumber(ke.subarray(Ce,ke.length));this.signatureNeverExpires=0===Ae,this.signatureExpirationTime=Ae;break}case er.signatureSubpacket.exportableCertification:this.exportable=1===ke[Ce++];break;case er.signatureSubpacket.trustSignature:this.trustLevel=ke[Ce++],this.trustAmount=ke[Ce++];break;case er.signatureSubpacket.regularExpression:this.regularExpression=ke[Ce];break;case er.signatureSubpacket.revocable:this.revocable=1===ke[Ce++];break;case er.signatureSubpacket.keyExpirationTime:{const Ae=Zt.readNumber(ke.subarray(Ce,ke.length));this.keyExpirationTime=Ae,this.keyNeverExpires=0===Ae;break}case er.signatureSubpacket.preferredSymmetricAlgorithms:this.preferredSymmetricAlgorithms=[...ke.subarray(Ce,ke.length)];break;case er.signatureSubpacket.revocationKey:this.revocationKeyClass=ke[Ce++],this.revocationKeyAlgorithm=ke[Ce++],this.revocationKeyFingerprint=ke.subarray(Ce,Ce+20);break;case er.signatureSubpacket.issuer:this.issuerKeyID.read(ke.subarray(Ce,ke.length));break;case er.signatureSubpacket.notationData:{const Ae=!!(128&ke[Ce]);Ce+=4;const qe=Zt.readNumber(ke.subarray(Ce,Ce+2));Ce+=2;const Ve=Zt.readNumber(ke.subarray(Ce,Ce+2));Ce+=2;const tt=Zt.uint8ArrayToString(ke.subarray(Ce,Ce+qe)),rt=ke.subarray(Ce+qe,Ce+qe+Ve);this.rawNotations.push({name:tt,humanReadable:Ae,value:rt,critical:ze}),Ae&&(this.notations[tt]=Zt.uint8ArrayToString(rt));break}case er.signatureSubpacket.preferredHashAlgorithms:this.preferredHashAlgorithms=[...ke.subarray(Ce,ke.length)];break;case er.signatureSubpacket.preferredCompressionAlgorithms:this.preferredCompressionAlgorithms=[...ke.subarray(Ce,ke.length)];break;case er.signatureSubpacket.keyServerPreferences:this.keyServerPreferences=[...ke.subarray(Ce,ke.length)];break;case er.signatureSubpacket.preferredKeyServer:this.preferredKeyServer=Zt.uint8ArrayToString(ke.subarray(Ce,ke.length));break;case er.signatureSubpacket.primaryUserID:this.isPrimaryUserID=0!==ke[Ce++];break;case er.signatureSubpacket.policyURI:this.policyURI=Zt.uint8ArrayToString(ke.subarray(Ce,ke.length));break;case er.signatureSubpacket.keyFlags:this.keyFlags=[...ke.subarray(Ce,ke.length)];break;case er.signatureSubpacket.signersUserID:this.signersUserID=Zt.uint8ArrayToString(ke.subarray(Ce,ke.length));break;case er.signatureSubpacket.reasonForRevocation:this.reasonForRevocationFlag=ke[Ce++],this.reasonForRevocationString=Zt.uint8ArrayToString(ke.subarray(Ce,ke.length));break;case er.signatureSubpacket.features:this.features=[...ke.subarray(Ce,ke.length)];break;case er.signatureSubpacket.signatureTarget:{this.signatureTargetPublicKeyAlgorithm=ke[Ce++],this.signatureTargetHashAlgorithm=ke[Ce++];const Ae=mo.getHashByteLength(this.signatureTargetHashAlgorithm);this.signatureTargetHash=Zt.uint8ArrayToString(ke.subarray(Ce,Ce+Ae));break}case er.signatureSubpacket.embeddedSignature:this.embeddedSignature=new ro,this.embeddedSignature.read(ke.subarray(Ce,ke.length));break;case er.signatureSubpacket.issuerFingerprint:this.issuerKeyVersion=ke[Ce++],this.issuerFingerprint=ke.subarray(Ce,ke.length),5===this.issuerKeyVersion?this.issuerKeyID.read(this.issuerFingerprint):this.issuerKeyID.read(this.issuerFingerprint.subarray(-8));break;case er.signatureSubpacket.preferredAEADAlgorithms:this.preferredAEADAlgorithms=[...ke.subarray(Ce,ke.length)];break;default:{const ke=Error("Unknown signature subpacket type "+qe);if(ze)throw ke;Zt.printDebug(ke)}}else this.unhashedSubpackets.push(ke.subarray(Ce,ke.length))}readSubPackets(ke,Ae=!0,Ce){const ze=Zt.readNumber(ke.subarray(0,2));let qe=2;for(;qe<2+ze;){const ze=Gs(ke.subarray(qe,ke.length));qe+=ze.offset,this.readSubPacket(ke.subarray(qe,qe+ze.len),Ae,Ce),qe+=ze.len}return qe}toSign(ke,Ae){const Ce=er.signature;switch(ke){case Ce.binary:return null!==Ae.text?Zt.encodeUTF8(Ae.getText(!0)):Ae.getBytes(!0);case Ce.text:{const ke=Ae.getBytes(!0);return Zt.canonicalizeEOL(ke)}case Ce.standalone:return new Uint8Array(0);case Ce.certGeneric:case Ce.certPersona:case Ce.certCasual:case Ce.certPositive:case Ce.certRevocation:{let ke,ze;if(Ae.userID)ze=180,ke=Ae.userID;else{if(!Ae.userAttribute)throw Error("Either a userID or userAttribute packet needs to be supplied for certification.");ze=209,ke=Ae.userAttribute}const qe=ke.write();return Zt.concat([this.toSign(Ce.key,Ae),new Uint8Array([ze]),Zt.writeNumber(qe.length,4),qe])}case Ce.subkeyBinding:case Ce.subkeyRevocation:case Ce.keyBinding:return Zt.concat([this.toSign(Ce.key,Ae),this.toSign(Ce.key,{key:Ae.bind})]);case Ce.key:if(void 0===Ae.key)throw Error("Key packet is required for this signature.");return Ae.key.writeForHash(this.version);case Ce.keyRevocation:return this.toSign(Ce.key,Ae);case Ce.timestamp:return new Uint8Array(0);case Ce.thirdParty:throw Error("Not implemented");default:throw Error("Unknown signature type.")}}calculateTrailer(ke,Ae){let Ce=0;return Y(J(this.signatureData),(ke=>{Ce+=ke.length}),(()=>{const ze=[];return 5!==this.version||this.signatureType!==er.signature.binary&&this.signatureType!==er.signature.text||(Ae?ze.push(new Uint8Array(6)):ze.push(ke.writeHeader())),ze.push(new Uint8Array([this.version,255])),5===this.version&&ze.push(new Uint8Array(4)),ze.push(Zt.writeNumber(Ce,4)),Zt.concat(ze)}))}toHash(ke,Ae,Ce=!1){const ze=this.toSign(ke,Ae);return Zt.concat([ze,this.signatureData,this.calculateTrailer(Ae,Ce)])}async hash(ke,Ae,Ce,ze=!1){return Ce||(Ce=this.toHash(ke,Ae,ze)),mo.hash.digest(this.hashAlgorithm,Ce)}async verify(ke,Ae,Ce,ze=new Date,qe=!1,Ve=tr){if(!this.issuerKeyID.equals(ke.getKeyID()))throw Error("Signature was not issued by the given public key");if(this.publicKeyAlgorithm!==ke.algorithm)throw Error("Public key algorithm used to sign signature does not match issuer key algorithm.");const tt=Ae===er.signature.binary||Ae===er.signature.text;if(!(this[hl]&&!tt)){let ze,Ve;if(this.hashed?Ve=await this.hashed:(ze=this.toHash(Ae,Ce,qe),Ve=await this.hash(Ae,Ce,ze)),Ve=await ie(Ve),this.signedHashValue[0]!==Ve[0]||this.signedHashValue[1]!==Ve[1])throw Error("Signed digest did not match");if(this.params=await this.params,this[hl]=await mo.signature.verify(this.publicKeyAlgorithm,this.hashAlgorithm,this.params,ke.publicParams,ze,Ve),!this[hl])throw Error("Signature verification failed")}const rt=Zt.normalizeDate(ze);if(rt&&this.created>rt)throw Error("Signature creation time is in the future");if(rt&&rt>=this.getExpirationTime())throw Error("Signature is expired");if(Ve.rejectHashAlgorithms.has(this.hashAlgorithm))throw Error("Insecure hash algorithm: "+er.read(er.hash,this.hashAlgorithm).toUpperCase());if(Ve.rejectMessageHashAlgorithms.has(this.hashAlgorithm)&&[er.signature.binary,er.signature.text].includes(this.signatureType))throw Error("Insecure message hash algorithm: "+er.read(er.hash,this.hashAlgorithm).toUpperCase());if(this.rawNotations.forEach((({name:ke,critical:Ae})=>{if(Ae&&Ve.knownNotations.indexOf(ke)<0)throw Error("Unknown critical notation: "+ke)})),null!==this.revocationKeyClass)throw Error("This key is intended to be revoked with an authorized key, which OpenPGP.js does not support.")}isExpired(ke=new Date){const Ae=Zt.normalizeDate(ke);return null!==Ae&&!(this.created<=Ae&&Aero.prototype.calculateTrailer.apply(await this.correspondingSig,ke)))}async verify(){const ke=await this.correspondingSig;if(!ke||ke.constructor.tag!==er.packet.signature)throw Error("Corresponding signature packet missing");if(ke.signatureType!==this.signatureType||ke.hashAlgorithm!==this.hashAlgorithm||ke.publicKeyAlgorithm!==this.publicKeyAlgorithm||!ke.issuerKeyID.equals(this.issuerKeyID))throw Error("Corresponding signature packet does not match one-pass signature packet");return ke.hashed=this.hashed,ke.verify.apply(ke,arguments)}}function ao(ke,Ae){if(!Ae[ke]){let Ce;try{Ce=er.read(er.packet,ke)}catch(Ae){throw new Js("Unknown packet type with tag: "+ke)}throw Error("Packet not allowed in this context: "+Ce)}return new Ae[ke]}no.prototype.hash=ro.prototype.hash,no.prototype.toHash=ro.prototype.toHash,no.prototype.toSign=ro.prototype.toSign;class so extends Array{static async fromBinary(ke,Ae,Ce=tr){const ze=new so;return await ze.read(ke,Ae,Ce),ze}async read(ke,Ae,Ce=tr){this.stream=X(ke,(async(ke,ze)=>{const qe=G(ze);try{for(;;){await qe.ready;if(await Qs(ke,(async ke=>{try{if(ke.tag===er.packet.marker||ke.tag===er.packet.trust)return;const ze=ao(ke.tag,Ae);ze.packets=new so,ze.fromStream=Zt.isStream(ke.packet),await ze.read(ke.packet,Ce),await qe.write(ze)}catch(Ae){const ze=!Ce.ignoreUnsupportedPackets&&Ae instanceof Js,Ve=!(Ce.ignoreMalformedPackets||Ae instanceof Js);(ze||Ve||Xs(ke.tag))&&await qe.abort(Ae),Zt.printDebugError(Ae)}})))return await qe.ready,void await qe.close()}}catch(ke){await qe.abort(ke)}}));const ze=H(this.stream);for(;;){const{done:ke,value:Ae}=await ze.read();if(ke?this.stream=null:this.push(Ae),ke||Xs(Ae.constructor.tag))break}ze.releaseLock()}write(){const ke=[];for(let Ae=0;Ae{if(ze.push(ke),qe+=ke.length,qe>=Ve){const ke=Math.min(Math.log(qe)/Math.LN2|0,30),Ae=2**ke,Ce=Zt.concat([$s(ke)].concat(ze));return ze=[Ce.subarray(1+Ae)],qe=ze[0].length,Ce.subarray(0,1+Ae)}}),(()=>Zt.concat([Vs(qe)].concat(ze)))))}else{if(Zt.isStream(Ce)){let ze=0;ke.push(Y(J(Ce),(ke=>{ze+=ke.length}),(()=>Ys(this[Ae].constructor.tag,ze))))}else ke.push(Ys(this[Ae].constructor.tag,Ce.length));ke.push(Ce)}}return Zt.concat(ke)}filterByTag(...ke){const Ae=new so,r=ke=>Ae=>ke===Ae;for(let Ce=0;CeAe.constructor.tag===ke))}indexOfTag(...ke){const Ae=[],Ce=this,i=ke=>Ae=>ke===Ae;for(let ze=0;ze{this.algorithm=await ke.readByte(),this.compressed=ke.remainder(),await this.decompress(Ae)}))}write(){return null===this.compressed&&this.compress(),Zt.concat([new Uint8Array([this.algorithm]),this.compressed])}async decompress(ke=tr){const Ae=er.read(er.compression,this.algorithm),Ce=gl[Ae];if(!Ce)throw Error(Ae+" decompression not supported");this.packets=await so.fromBinary(Ce(this.compressed),ll,ke)}compress(){const ke=er.read(er.compression,this.algorithm),Ae=yl[ke];if(!Ae)throw Error(ke+" compression not supported");this.compressed=Ae(this.packets.write(),this.deflateLevel)}}const pl=Zt.getNodeZlib();function ho(ke){return ke}function fo(ke,Ae,Ce={}){return function(ze){return!Zt.isStream(ze)||_(ze)?ae((()=>ie(ze).then((Ae=>new Promise(((ze,qe)=>{ke(Ae,Ce,((ke,Ae)=>{if(ke)return qe(ke);ze(Ae)}))})))))):Ut(Ot(ze).pipe(Ae(Ce)))}}function lo(ke,Ae={}){return function(Ce){const ze=new ke(Ae);return Y(Ce,(ke=>{if(ke.length)return ze.push(ke,2),ze.result}),(()=>{if(ke===hs)return ze.push([],4),ze.result}))}}function po(ke){return function(Ae){return ae((async()=>ke(await ie(Ae))))}}const yl=pl?{zip:(ke,Ae)=>fo(pl.deflateRaw,pl.createDeflateRaw,{level:Ae})(ke),zlib:(ke,Ae)=>fo(pl.deflate,pl.createDeflate,{level:Ae})(ke)}:{zip:(ke,Ae)=>lo(hs,{raw:!0,level:Ae})(ke),zlib:(ke,Ae)=>lo(hs,{level:Ae})(ke)},gl=pl?{uncompressed:ho,zip:fo(pl.inflateRaw,pl.createInflateRaw),zlib:fo(pl.inflate,pl.createInflate),bzip2:po(Ws)}:{uncompressed:ho,zip:lo(Cs,{raw:!0}),zlib:lo(Cs),bzip2:po(Ws)},bl=Zt.constructAllowedPackets([Hs,co,no,ro]);class go{static get tag(){return er.packet.symEncryptedIntegrityProtectedData}constructor(){this.version=1,this.encrypted=null,this.packets=null}async read(ke){await Q(ke,(async ke=>{const Ae=await ke.readByte();if(1!==Ae)throw new Js(`Version ${Ae} of the SEIP packet is unsupported.`);this.encrypted=ke.remainder()}))}write(){return Zt.concat([new Uint8Array([1]),this.encrypted])}async encrypt(ke,Ae,Ce=tr){const{blockSize:ze}=mo.getCipher(ke);let qe=this.packets.write();_(qe)&&(qe=await ie(qe));const Ve=await mo.getPrefixRandom(ke),tt=new Uint8Array([211,20]),rt=Zt.concat([Ve,qe,tt]),it=await mo.hash.sha1(ee(rt)),nt=Zt.concat([rt,it]);return this.encrypted=await mo.mode.cfb.encrypt(ke,Ae,nt,new Uint8Array(ze),Ce),!0}async decrypt(ke,Ae,Ce=tr){const{blockSize:ze}=mo.getCipher(ke);let qe=J(this.encrypted);_(qe)&&(qe=await ie(qe));const Ve=await mo.mode.cfb.decrypt(ke,Ae,qe,new Uint8Array(ze)),tt=re(ee(Ve),-20),rt=re(Ve,0,-20),it=Promise.all([ie(await mo.hash.sha1(ee(rt))),ie(tt)]).then((([ke,Ae])=>{if(!Zt.equalsUint8Array(ke,Ae))throw Error("Modification detected.");return new Uint8Array})),nt=re(rt,ze+2);let ot=re(nt,0,-2);return ot=W([ot,ae((()=>it))]),Zt.isStream(qe)&&Ce.allowUnauthenticatedStream||(ot=await ie(ot)),this.packets=await so.fromBinary(ot,bl,Ce),!0}}const wl=Zt.constructAllowedPackets([Hs,co,no,ro]);class vo{static get tag(){return er.packet.aeadEncryptedData}constructor(){this.version=1,this.cipherAlgorithm=null,this.aeadAlgorithm=er.aead.eax,this.chunkSizeByte=null,this.iv=null,this.encrypted=null,this.packets=null}async read(ke){await Q(ke,(async ke=>{const Ae=await ke.readByte();if(1!==Ae)throw new Js(`Version ${Ae} of the AEAD-encrypted data packet is not supported.`);this.cipherAlgorithm=await ke.readByte(),this.aeadAlgorithm=await ke.readByte(),this.chunkSizeByte=await ke.readByte();const Ce=mo.getAEADMode(this.aeadAlgorithm);this.iv=await ke.readBytes(Ce.ivLength),this.encrypted=ke.remainder()}))}write(){return Zt.concat([new Uint8Array([this.version,this.cipherAlgorithm,this.aeadAlgorithm,this.chunkSizeByte]),this.iv,this.encrypted])}async decrypt(ke,Ae,Ce=tr){this.packets=await so.fromBinary(await this.crypt("decrypt",Ae,J(this.encrypted)),wl,Ce)}async encrypt(ke,Ae,Ce=tr){this.cipherAlgorithm=ke;const{ivLength:ze}=mo.getAEADMode(this.aeadAlgorithm);this.iv=await mo.random.getRandomBytes(ze),this.chunkSizeByte=Ce.aeadChunkSizeByte;const qe=this.packets.write();this.encrypted=await this.crypt("encrypt",Ae,qe)}async crypt(ke,Ae,Ce){const ze=mo.getAEADMode(this.aeadAlgorithm),qe=await ze(this.cipherAlgorithm,Ae),Ve="decrypt"===ke?ze.tagLength:0,tt="encrypt"===ke?ze.tagLength:0,rt=2**(this.chunkSizeByte+6)+Ve,it=new ArrayBuffer(21),nt=new Uint8Array(it,0,13),ot=new Uint8Array(it),ct=new DataView(it),ht=new Uint8Array(it,5,8);nt.set([192|vo.tag,this.version,this.cipherAlgorithm,this.aeadAlgorithm,this.chunkSizeByte],0);let ft=0,yt=Promise.resolve(),mt=0,kt=0;const St=this.iv;return X(Ce,(async(Ae,Ce)=>{if("array"!==Zt.isStream(Ae)){const ke=new Gt({},{highWaterMark:Zt.getHardwareConcurrency()*2**(this.chunkSizeByte+6),size:ke=>ke.length});V(ke.readable,Ce),Ce=ke.writable}const it=H(Ae),Et=G(Ce);try{for(;;){let Ae=await it.readBytes(rt+Ve)||new Uint8Array;const Ce=Ae.subarray(Ae.length-Ve);let Pt,Bt;if(Ae=Ae.subarray(0,Ae.length-Ve),!ft||Ae.length?(it.unshift(Ce),Pt=qe[ke](Ae,ze.getNonce(St,ht),nt),kt+=Ae.length-Ve+tt):(ct.setInt32(17,mt),Pt=qe[ke](Ce,ze.getNonce(St,ht),ot),kt+=tt,Bt=!0),mt+=Ae.length-Ve,yt=yt.then((()=>Pt)).then((async ke=>{await Et.ready,await Et.write(ke),kt-=ke.length})).catch((ke=>Et.abort(ke))),(Bt||kt>Et.desiredSize)&&await yt,Bt){await Et.close();break}ct.setInt32(9,++ft)}}catch(ke){await Et.abort(ke)}}))}}class _o{static get tag(){return er.packet.publicKeyEncryptedSessionKey}constructor(){this.version=3,this.publicKeyID=new Me,this.publicKeyAlgorithm=null,this.sessionKey=null,this.sessionKeyAlgorithm=null,this.encrypted={}}read(ke){if(this.version=ke[0],3!==this.version)throw new Js(`Version ${this.version} of the PKESK packet is unsupported.`);this.publicKeyID.read(ke.subarray(1,ke.length)),this.publicKeyAlgorithm=ke[9],this.encrypted=mo.parseEncSessionKeyParams(this.publicKeyAlgorithm,ke.subarray(10))}write(){const ke=[new Uint8Array([this.version]),this.publicKeyID.write(),new Uint8Array([this.publicKeyAlgorithm]),mo.serializeParams(this.publicKeyAlgorithm,this.encrypted)];return Zt.concatUint8Array(ke)}async encrypt(ke){const Ae=Zt.concatUint8Array([new Uint8Array([er.write(er.symmetric,this.sessionKeyAlgorithm)]),this.sessionKey,Zt.writeChecksum(this.sessionKey)]),Ce=er.write(er.publicKey,this.publicKeyAlgorithm);this.encrypted=await mo.publicKeyEncrypt(Ce,ke.publicParams,Ae,ke.getFingerprintBytes())}async decrypt(ke,Ae){if(this.publicKeyAlgorithm!==ke.algorithm)throw Error("Decryption error");const Ce=Ae?Zt.concatUint8Array([new Uint8Array([Ae.sessionKeyAlgorithm]),Ae.sessionKey,Zt.writeChecksum(Ae.sessionKey)]):null,ze=await mo.publicKeyDecrypt(this.publicKeyAlgorithm,ke.publicParams,ke.privateParams,this.encrypted,ke.getFingerprintBytes(),Ce),qe=ze[0],Ve=ze.subarray(1,ze.length-2),tt=ze.subarray(ze.length-2),rt=Zt.writeChecksum(Ve),it=rt[0]===tt[0]&rt[1]===tt[1];if(Ae){const ke=it&qe===Ae.sessionKeyAlgorithm&Ve.length===Ae.sessionKey.length;this.sessionKeyAlgorithm=Zt.selectUint8(ke,qe,Ae.sessionKeyAlgorithm),this.sessionKey=Zt.selectUint8Array(ke,Ve,Ae.sessionKey)}else{if(!(it&&er.read(er.symmetric,qe)))throw Error("Decryption error");this.sessionKey=Ve,this.sessionKeyAlgorithm=qe}}}class ko{constructor(ke=tr){this.algorithm=er.hash.sha256,this.type="iterated",this.c=ke.s2kIterationCountByte,this.salt=null}getCount(){return 16+(15&this.c)<<6+(this.c>>4)}read(ke){let Ae=0;switch(this.type=er.read(er.s2k,ke[Ae++]),this.algorithm=ke[Ae++],this.type){case"simple":break;case"salted":this.salt=ke.subarray(Ae,Ae+8),Ae+=8;break;case"iterated":this.salt=ke.subarray(Ae,Ae+8),Ae+=8,this.c=ke[Ae++];break;case"gnu":if("GNU"!==Zt.uint8ArrayToString(ke.subarray(Ae,Ae+3)))throw Error("Unknown s2k type.");Ae+=3;if(1001!==1e3+ke[Ae++])throw Error("Unknown s2k gnu protection mode.");this.type="gnu-dummy";break;default:throw Error("Unknown s2k type.")}return Ae}write(){if("gnu-dummy"===this.type)return new Uint8Array([101,0,...Zt.stringToUint8Array("GNU"),1]);const ke=[new Uint8Array([er.write(er.s2k,this.type),this.algorithm])];switch(this.type){case"simple":break;case"salted":ke.push(this.salt);break;case"iterated":ke.push(this.salt),ke.push(new Uint8Array([this.c]));break;case"gnu":throw Error("GNU s2k type not supported.");default:throw Error("Unknown s2k type.")}return Zt.concatUint8Array(ke)}async produceKey(ke,Ae){ke=Zt.encodeUTF8(ke);const Ce=[];let ze=0,qe=0;for(;ze{this.privateParams[ke].fill(0),delete this.privateParams[ke]})),this.privateParams=null,this.isEncrypted=!0)}}async function Ko(ke,Ae,Ce){const{keySize:ze}=mo.getCipher(Ce);return ke.produceKey(Ae,ze)}var kl=bt((function(ke){!function(Ae){function r(ke){function t(){return Ce0&&(Ae.semantic=" "),Ae}}function b(ke,Ae){return function(){var Ce,ze,qe,Ve,tt;for(Ve=r(),Ce=s("star"),qe=0,tt=void 0===Ae?0:Ae;null!==(ze=ke());)qe+=1,c(Ce,ze);return qe>=tt?Ce:(n(Ve),null)}}function m(ke){return ke.charCodeAt(0)>=128}function g(){return o("cr",h("\r")())}function w(){return o("crlf",f(g,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(Ae){var Ce=Ae.charCodeAt(0),ze=33<=Ce&&Ce<=126;return ke.rfc6532&&(ze=ze||m(Ae)),ze})))}function E(){return o("wsp",d(A,_)())}function P(){var ke=o("quoted-pair",d(f(h("\\"),d(S,E)),ie)());return null===ke?null:(ke.semantic=ke.semantic[1],ke)}function x(){return o("fws",d(ae,f(l(f(b(E),p(w))),b(E,1)))())}function M(){return o("ctext",d((function(){return u((function(Ae){var Ce=Ae.charCodeAt(0),ze=33<=Ce&&Ce<=39||42<=Ce&&Ce<=91||93<=Ce&&Ce<=126;return ke.rfc6532&&(ze=ze||m(Ae)),ze}))}),te)())}function C(){return o("ccontent",d(M,P,K)())}function K(){return o("comment",f(h("("),b(f(l(x),C)),l(x),h(")"))())}function D(){return o("cfws",d(f(b(f(l(x),K),1),l(x)),x)())}function R(){return o("atext",u((function(Ae){var Ce="a"<=Ae&&Ae<="z"||"A"<=Ae&&Ae<="Z"||"0"<=Ae&&Ae<="9"||["!","#","$","%","&","'","*","+","-","/","=","?","^","_","`","{","|","}","~"].indexOf(Ae)>=0;return ke.rfc6532&&(Ce=Ce||m(Ae)),Ce})))}function I(){return o("atom",f(y(l(D)),b(R,1),y(l(D)))())}function U(){var ke,Ae;return null===(ke=o("dot-atom-text",b(R,1)()))||null!==(Ae=b(f(h("."),b(R,1)))())&&c(ke,Ae),ke}function B(){return o("dot-atom",f(p(l(D)),U,p(l(D)))())}function T(){return o("qtext",d((function(){return u((function(Ae){var Ce=Ae.charCodeAt(0),ze=33===Ce||35<=Ce&&Ce<=91||93<=Ce&&Ce<=126;return ke.rfc6532&&(ze=ze||m(Ae)),ze}))}),re)())}function z(){return o("qcontent",d(T,P)())}function q(){return o("quoted-string",f(p(l(D)),p(v),b(f(l(y(x)),z)),l(p(x)),p(v),p(l(D)))())}function O(){return o("word",d(I,q)())}function F(){return o("address",d(N,W)())}function N(){return o("mailbox",d(j,J)())}function j(){return o("name-addr",f(l(H),L)())}function L(){return o("angle-addr",d(f(p(l(D)),h("<"),J,h(">"),p(l(D))),se)())}function W(){return o("group",f(H,h(":"),l($),h(";"),p(l(D)))())}function H(){return o("display-name",(null!==(ke=o("phrase",d(ne,b(O,1))()))&&(ke.semantic=function(ke){return ke.replace(/([ \t]|\r\n)+/g," ").replace(/^\s*/,"").replace(/\s*$/,"")}(ke.semantic)),ke));var ke}function G(){return o("mailbox-list",d(f(N,b(f(h(","),N))),ue)())}function V(){return o("address-list",d(f(F,b(f(h(","),F))),he)())}function $(){return o("group-list",d(G,p(D),fe)())}function Z(){return o("local-part",d(de,B,q)())}function Y(){return o("dtext",d((function(){return u((function(Ae){var Ce=Ae.charCodeAt(0),ze=33<=Ce&&Ce<=90||94<=Ce&&Ce<=126;return ke.rfc6532&&(ze=ze||m(Ae)),ze}))}),pe)())}function X(){return o("domain-literal",f(p(l(D)),h("["),b(f(l(x),Y)),l(x),h("]"),p(l(D)))())}function Q(){return o("domain",(Ae=d(le,B,X)(),ke.rejectTLD&&Ae&&Ae.semantic&&Ae.semantic.indexOf(".")<0?null:(Ae&&(Ae.semantic=Ae.semantic.replace(/\s+/g,"")),Ae)));var Ae}function J(){return o("addr-spec",f(Z,h("@"),Q)())}function ee(){return ke.strict?null:o("obs-NO-WS-CTL",u((function(ke){var Ae=ke.charCodeAt(0);return 1<=Ae&&Ae<=8||11===Ae||12===Ae||14<=Ae&&Ae<=31||127===Ae})))}function te(){return ke.strict?null:o("obs-ctext",ee())}function re(){return ke.strict?null:o("obs-qtext",ee())}function ie(){return ke.strict?null:o("obs-qp",f(h("\\"),d(h("\0"),ee,k,g))())}function ne(){return ke.strict?null:ke.atInDisplayName?o("obs-phrase",f(O,b(d(O,h("."),h("@"),y(D))))()):o("obs-phrase",f(O,b(d(O,h("."),y(D))))())}function ae(){return ke.strict?null:o("obs-FWS",b(f(p(l(w)),E),1)())}function se(){return ke.strict?null:o("obs-angle-addr",f(p(l(D)),h("<"),oe,J,h(">"),p(l(D)))())}function oe(){return ke.strict?null:o("obs-route",f(ce,h(":"))())}function ce(){return ke.strict?null:o("obs-domain-list",f(b(d(p(D),h(","))),h("@"),Q,b(f(h(","),p(l(D)),l(f(h("@"),Q)))))())}function ue(){return ke.strict?null:o("obs-mbox-list",f(b(f(p(l(D)),h(","))),N,b(f(h(","),l(f(N,p(D))))))())}function he(){return ke.strict?null:o("obs-addr-list",f(b(f(p(l(D)),h(","))),F,b(f(h(","),l(f(F,p(D))))))())}function fe(){return ke.strict?null:o("obs-group-list",f(b(f(p(l(D)),h(",")),1),p(l(D)))())}function de(){return ke.strict?null:o("obs-local-part",f(O,b(f(h("."),O)))())}function le(){return ke.strict?null:o("obs-domain",f(I,b(f(h("."),I)))())}function pe(){return ke.strict?null:o("obs-dtext",d(ee,P)())}function ye(ke,Ae){var Ce,ze,qe;if(null==Ae)return null;for(ze=[Ae];ze.length>0;){if((qe=ze.pop()).name===ke)return qe;for(Ce=qe.children.length-1;Ce>=0;Ce-=1)ze.push(qe.children[Ce])}return null}function be(ke,Ae){var Ce,ze,qe,Ve,tt;if(null==Ae)return null;for(ze=[Ae],Ve=[],tt={},Ce=0;Ce0;)if((qe=ze.pop()).name in tt)Ve.push(qe);else for(Ce=qe.children.length-1;Ce>=0;Ce-=1)ze.push(qe.children[Ce]);return Ve}function me(Ae){var Ce,ze,qe,Ve,tt;if(null===Ae)return null;for(Ce=[],ze=be(["group","mailbox"],Ae),qe=0;qe1)return null;return Ae.addresses&&Ae.addresses[0]}(tt):ke.simple?tt&&tt.addresses:tt}function ge(ke){var Ae,Ce=ye("display-name",ke),ze=[],qe=be(["mailbox"],ke);for(Ae=0;Ae0;)for((qe=ze.pop()).name===ke&&Ve.push(qe),Ce=qe.children.length-1;Ce>=0;Ce-=1)ze.push(qe.children[Ce]);return Ve}("cfws",ke),qe=be(["comment"],ke),Ve=ye("local-part",Ce),tt=ye("domain",Ce);return{node:ke,parts:{name:Ae,address:Ce,local:Ve,domain:tt,comments:ze},type:ke.name,name:ve(Ae),address:ve(Ce),local:ve(Ve),domain:ve(tt),comments:_e(qe),groupName:ve(ke.groupName)}}function ve(ke){return null!=ke?ke.semantic:null}function _e(ke){var Ae="";if(ke)for(var Ce=0;Ce`),Ae.userID=Ce.join(" "),Ae}read(ke,Ae=tr){const Ce=Zt.decodeUTF8(ke);if(Ce.length>Ae.maxUserIDLength)throw Error("User ID string is too long");try{const{name:ke,address:Ae,comments:ze}=kl.parseOneAddress({input:Ce,atInDisplayName:!0});this.comment=ze.replace(/^\(|\)$/g,""),this.name=ke,this.email=Ae}catch(ke){}this.userID=Ce}write(){return Zt.encodeUTF8(this.userID)}equals(ke){return ke&&ke.userID===this.userID}}class Io extends Co{static get tag(){return er.packet.secretSubkey}constructor(ke=new Date,Ae=tr){super(ke,Ae)}}const Sl=Zt.constructAllowedPackets([ro]);class Bo{constructor(ke){this.packets=ke||new so}write(){return this.packets.write()}armor(ke=tr){return xe(er.armor.signature,this.write(),void 0,void 0,void 0,ke)}getSigningKeyIDs(){return this.packets.map((ke=>ke.issuerKeyID))}}async function To(ke,Ae){const Ce=new Io(ke.date,Ae);return Ce.packets=null,Ce.algorithm=er.write(er.publicKey,ke.algorithm),await Ce.generate(ke.rsaBits,ke.curve),await Ce.computeFingerprintAndKeyID(),Ce}async function zo(ke,Ae){const Ce=new Co(ke.date,Ae);return Ce.packets=null,Ce.algorithm=er.write(er.publicKey,ke.algorithm),await Ce.generate(ke.rsaBits,ke.curve,ke.config),await Ce.computeFingerprintAndKeyID(),Ce}async function qo(ke,Ae,Ce,ze,qe=new Date,Ve){let tt,rt;for(let it=ke.length-1;it>=0;it--)try{(!tt||ke[it].created>=tt.created)&&(await ke[it].verify(Ae,Ce,ze,qe,void 0,Ve),tt=ke[it])}catch(ke){rt=ke}if(!tt)throw Zt.wrapError(`Could not find valid ${er.read(er.signature,Ce)} signature in key ${Ae.getKeyID().toHex()}`.replace("certGeneric ","self-").replace(/([a-z])([A-Z])/g,((ke,Ae,Ce)=>Ae+" "+Ce.toLowerCase())),rt);return tt}function Oo(ke,Ae,Ce=new Date){const ze=Zt.normalizeDate(Ce);if(null!==ze){const Ce=Go(ke,Ae);return!(ke.created<=ze&&ze0&&(Ve.keyExpirationTime=Ce.keyExpirationTime,Ve.keyNeverExpires=!1),await Ve.sign(Ae,qe,Ce.date),Ve}async function No(ke,Ae,Ce=new Date,ze={},qe){let Ve=qe.preferredHashAlgorithm,tt=Ve;if(ke){const Ae=await ke.getPrimaryUser(Ce,ze,qe);Ae.selfCertification.preferredHashAlgorithms&&([tt]=Ae.selfCertification.preferredHashAlgorithms,Ve=mo.hash.getHashByteLength(Ve)<=mo.hash.getHashByteLength(tt)?tt:Ve)}switch(Object.getPrototypeOf(Ae)){case Co.prototype:case So.prototype:case Io.prototype:case xo.prototype:switch(Ae.algorithm){case er.publicKey.ecdh:case er.publicKey.ecdsa:case er.publicKey.eddsa:tt=mo.publicKey.elliptic.getPreferredHashAlgo(Ae.publicParams.oid)}}return mo.hash.getHashByteLength(Ve)<=mo.hash.getHashByteLength(tt)?tt:Ve}async function jo(ke,Ae=[],Ce=new Date,ze=[],qe=tr){const Ve={symmetric:er.symmetric.aes128,aead:er.aead.eax,compression:er.compression.uncompressed}[ke],tt={symmetric:qe.preferredSymmetricAlgorithm,aead:qe.preferredAEADAlgorithm,compression:qe.preferredCompressionAlgorithm}[ke],rt={symmetric:"preferredSymmetricAlgorithms",aead:"preferredAEADAlgorithms",compression:"preferredCompressionAlgorithms"}[ke];return(await Promise.all(Ae.map((async function(ke,Ae){const Ve=(await ke.getPrimaryUser(Ce,ze[Ae],qe)).selfCertification[rt];return!!Ve&&Ve.indexOf(tt)>=0})))).every(Boolean)?tt:Ve}async function Lo(ke,Ae,Ce,ze,qe,Ve,tt=!1,rt){if(Ce.isDummy())throw Error("Cannot sign with a gnu-dummy key.");if(!Ce.isDecrypted())throw Error("Signing key is not decrypted.");const it=new ro;return Object.assign(it,ze),it.publicKeyAlgorithm=Ce.algorithm,it.hashAlgorithm=await No(Ae,Ce,qe,Ve,rt),await it.sign(Ce,ke,qe,tt),it}async function Wo(ke,Ae,Ce,ze=new Date,qe){(ke=ke[Ce])&&(Ae[Ce].length?await Promise.all(ke.map((async function(ke){ke.isExpired(ze)||qe&&!await qe(ke)||Ae[Ce].some((function(Ae){return Zt.equalsUint8Array(Ae.writeParams(),ke.writeParams())}))||Ae[Ce].push(ke)}))):Ae[Ce]=ke)}async function Ho(ke,Ae,Ce,ze,qe,Ve,tt=new Date,rt){Ve=Ve||ke;const it=[];return await Promise.all(ze.map((async function(ke){try{qe&&!ke.issuerKeyID.equals(qe.issuerKeyID)||(await ke.verify(Ve,Ae,Ce,rt.revocationsExpire?tt:null,!1,rt),it.push(ke.issuerKeyID))}catch(ke){}}))),qe?(qe.revoked=!!it.some((ke=>ke.equals(qe.issuerKeyID)))||(qe.revoked||!1),qe.revoked):it.length>0}function Go(ke,Ae){let Ce;return!1===Ae.keyNeverExpires&&(Ce=ke.created.getTime()+1e3*Ae.keyExpirationTime),Ce?new Date(Ce):1/0}function Vo(ke,Ae={}){switch(ke.type=ke.type||Ae.type,ke.curve=ke.curve||Ae.curve,ke.rsaBits=ke.rsaBits||Ae.rsaBits,ke.keyExpirationTime=void 0!==ke.keyExpirationTime?ke.keyExpirationTime:Ae.keyExpirationTime,ke.passphrase=Zt.isString(ke.passphrase)?ke.passphrase:Ae.passphrase,ke.date=ke.date||Ae.date,ke.sign=ke.sign||!1,ke.type){case"ecc":try{ke.curve=er.write(er.curve,ke.curve)}catch(ke){throw Error("Invalid curve")}ke.curve!==er.curve.ed25519&&ke.curve!==er.curve.curve25519||(ke.curve=ke.sign?er.curve.ed25519:er.curve.curve25519),ke.sign?ke.algorithm=ke.curve===er.curve.ed25519?er.publicKey.eddsa:er.publicKey.ecdsa:ke.algorithm=er.publicKey.ecdh;break;case"rsa":ke.algorithm=er.publicKey.rsaEncryptSign;break;default:throw Error("Unsupported key type "+ke.type)}return ke}function $o(ke,Ae){const Ce=ke.algorithm;return Ce!==er.publicKey.rsaEncrypt&&Ce!==er.publicKey.elgamal&&Ce!==er.publicKey.ecdh&&(!Ae.keyFlags||0!=(Ae.keyFlags[0]&er.keyFlags.signData))}function Zo(ke,Ae){const Ce=ke.algorithm;return Ce!==er.publicKey.dsa&&Ce!==er.publicKey.rsaSign&&Ce!==er.publicKey.ecdsa&&Ce!==er.publicKey.eddsa&&(!Ae.keyFlags||0!=(Ae.keyFlags[0]&er.keyFlags.encryptCommunication)||0!=(Ae.keyFlags[0]&er.keyFlags.encryptStorage))}function Yo(ke,Ae){return!!Ae.allowInsecureDecryptionWithSigningKeys||(!ke.keyFlags||0!=(ke.keyFlags[0]&er.keyFlags.encryptCommunication)||0!=(ke.keyFlags[0]&er.keyFlags.encryptStorage))}function Xo(ke,Ae){const Ce=er.write(er.publicKey,ke.algorithm),ze=ke.getAlgorithmInfo();if(Ae.rejectPublicKeyAlgorithms.has(Ce))throw Error(ze.algorithm+" keys are considered too weak.");switch(Ce){case er.publicKey.rsaEncryptSign:case er.publicKey.rsaSign:case er.publicKey.rsaEncrypt:if(ze.bitske.getKeys(rt).length>0));return 0===it.length?null:(await Promise.all(it.map((async Ae=>{const Ve=await Ae.getSigningKey(rt,ke.created,void 0,ze);if(ke.revoked||await qe.isRevoked(ke,Ve.keyPacket,Ce,ze))throw Error("User certificate is revoked");try{await ke.verify(Ve.keyPacket,er.signature.certGeneric,tt,Ce,void 0,ze)}catch(ke){throw Zt.wrapError("User certificate is invalid",ke)}}))),!0)}async verifyAllCertifications(ke,Ae=new Date,Ce){const ze=this,qe=this.selfCertifications.concat(this.otherCertifications);return Promise.all(qe.map((async qe=>({keyID:qe.issuerKeyID,valid:await ze.verifyCertificate(qe,ke,Ae,Ce).catch((()=>!1))}))))}async verify(ke=new Date,Ae){if(!this.selfCertifications.length)throw Error("No self-certifications found");const Ce=this,ze=this.mainKey.keyPacket,qe={userID:this.userID,userAttribute:this.userAttribute,key:ze};let Ve;for(let tt=this.selfCertifications.length-1;tt>=0;tt--)try{const Ve=this.selfCertifications[tt];if(Ve.revoked||await Ce.isRevoked(Ve,void 0,ke,Ae))throw Error("Self-certification is revoked");try{await Ve.verify(ze,er.signature.certGeneric,qe,ke,void 0,Ae)}catch(ke){throw Zt.wrapError("Self-certification is invalid",ke)}return!0}catch(ke){Ve=ke}throw Ve}async update(ke,Ae,Ce){const ze=this.mainKey.keyPacket,qe={userID:this.userID,userAttribute:this.userAttribute,key:ze};await Wo(ke,this,"selfCertifications",Ae,(async function(ke){try{return await ke.verify(ze,er.signature.certGeneric,qe,Ae,!1,Ce),!0}catch(ke){return!1}})),await Wo(ke,this,"otherCertifications",Ae),await Wo(ke,this,"revocationSignatures",Ae,(function(ke){return Ho(ze,er.signature.certRevocation,qe,[ke],void 0,void 0,Ae,Ce)}))}}class Jo{constructor(ke,Ae){this.keyPacket=ke,this.bindingSignatures=[],this.revocationSignatures=[],this.mainKey=Ae}toPacketList(){const ke=new so;return ke.push(this.keyPacket),ke.push(...this.revocationSignatures),ke.push(...this.bindingSignatures),ke}clone(){const ke=new Jo(this.keyPacket,this.mainKey);return ke.bindingSignatures=[...this.bindingSignatures],ke.revocationSignatures=[...this.revocationSignatures],ke}async isRevoked(ke,Ae,Ce=new Date,ze=tr){const qe=this.mainKey.keyPacket;return Ho(qe,er.signature.subkeyRevocation,{key:qe,bind:this.keyPacket},this.revocationSignatures,ke,Ae,Ce,ze)}async verify(ke=new Date,Ae=tr){const Ce=this.mainKey.keyPacket,ze={key:Ce,bind:this.keyPacket},qe=await qo(this.bindingSignatures,Ce,er.signature.subkeyBinding,ze,ke,Ae);if(qe.revoked||await this.isRevoked(qe,null,ke,Ae))throw Error("Subkey is revoked");if(Oo(this.keyPacket,qe,ke))throw Error("Subkey is expired");return qe}async getExpirationTime(ke=new Date,Ae=tr){const Ce=this.mainKey.keyPacket,ze={key:Ce,bind:this.keyPacket};let qe;try{qe=await qo(this.bindingSignatures,Ce,er.signature.subkeyBinding,ze,ke,Ae)}catch(ke){return null}const Ve=Go(this.keyPacket,qe),tt=qe.getExpirationTime();return Veqe.bindingSignatures[Ae].created&&(qe.bindingSignatures[Ae]=ke),!1;try{return await ke.verify(ze,er.signature.subkeyBinding,Ve,Ae,void 0,Ce),!0}catch(ke){return!1}})),await Wo(ke,this,"revocationSignatures",Ae,(function(ke){return Ho(ze,er.signature.subkeyRevocation,Ve,[ke],void 0,void 0,Ae,Ce)}))}async revoke(ke,{flag:Ae=er.reasonForRevocation.noReason,string:Ce=""}={},ze=new Date,qe=tr){const Ve={key:ke,bind:this.keyPacket},tt=new Jo(this.keyPacket,this.mainKey);return tt.revocationSignatures.push(await Lo(Ve,null,ke,{signatureType:er.signature.subkeyRevocation,reasonForRevocationFlag:er.write(er.reasonForRevocation,Ae),reasonForRevocationString:Ce},ze,void 0,!1,qe)),await tt.update(this),tt}hasSameFingerprintAs(ke){return this.keyPacket.hasSameFingerprintAs(ke.keyPacket||ke)}}["getKeyID","getFingerprint","getAlgorithmInfo","getCreationTime","isDecrypted"].forEach((ke=>{Jo.prototype[ke]=function(){return this.keyPacket[ke]()}}));const Cl=Zt.constructAllowedPackets([ro]);class tc{packetListToStructure(ke,Ae=new Set){let Ce,ze,qe;for(const Ve of ke){const ke=Ve.constructor.tag;if(Ae.has(ke))throw Error("Unexpected packet type: "+ke);switch(ke){case er.packet.publicKey:case er.packet.secretKey:if(this.keyPacket)throw Error("Key block contains multiple keys");if(this.keyPacket=Ve,ze=this.getKeyID(),!ze)throw Error("Missing Key ID");break;case er.packet.userID:case er.packet.userAttribute:Ce=new Qo(Ve,this),this.users.push(Ce);break;case er.packet.publicSubkey:case er.packet.secretSubkey:Ce=null,qe=new Jo(Ve,this),this.subkeys.push(qe);break;case er.packet.signature:switch(Ve.signatureType){case er.signature.certGeneric:case er.signature.certPersona:case er.signature.certCasual:case er.signature.certPositive:if(!Ce){Zt.printDebug("Dropping certification signatures without preceding user packet");continue}Ve.issuerKeyID.equals(ze)?Ce.selfCertifications.push(Ve):Ce.otherCertifications.push(Ve);break;case er.signature.certRevocation:Ce?Ce.revocationSignatures.push(Ve):this.directSignatures.push(Ve);break;case er.signature.key:this.directSignatures.push(Ve);break;case er.signature.subkeyBinding:if(!qe){Zt.printDebug("Dropping subkey binding signature without preceding subkey packet");continue}qe.bindingSignatures.push(Ve);break;case er.signature.keyRevocation:this.revocationSignatures.push(Ve);break;case er.signature.subkeyRevocation:if(!qe){Zt.printDebug("Dropping subkey revocation signature without preceding subkey packet");continue}qe.revocationSignatures.push(Ve)}}}}toPacketList(){const ke=new so;return ke.push(this.keyPacket),ke.push(...this.revocationSignatures),ke.push(...this.directSignatures),this.users.map((Ae=>ke.push(...Ae.toPacketList()))),this.subkeys.map((Ae=>ke.push(...Ae.toPacketList()))),ke}clone(ke=!1){const Ae=new this.constructor(this.toPacketList());return ke&&Ae.getKeys().forEach((ke=>{if(ke.keyPacket=Object.create(Object.getPrototypeOf(ke.keyPacket),Object.getOwnPropertyDescriptors(ke.keyPacket)),!ke.keyPacket.isDecrypted())return;const Ae={};Object.keys(ke.keyPacket.privateParams).forEach((Ce=>{Ae[Ce]=new Uint8Array(ke.keyPacket.privateParams[Ce])})),ke.keyPacket.privateParams=Ae})),Ae}getSubkeys(ke=null){return this.subkeys.filter((Ae=>!ke||Ae.getKeyID().equals(ke,!0)))}getKeys(ke=null){const Ae=[];return ke&&!this.getKeyID().equals(ke,!0)||Ae.push(this),Ae.concat(this.getSubkeys(ke))}getKeyIDs(){return this.getKeys().map((ke=>ke.getKeyID()))}getUserIDs(){return this.users.map((ke=>ke.userID?ke.userID.userID:null)).filter((ke=>null!==ke))}write(){return this.toPacketList().write()}async getSigningKey(ke=null,Ae=new Date,Ce={},ze=tr){await this.verifyPrimaryKey(Ae,Ce,ze);const qe=this.keyPacket,Ve=this.subkeys.slice().sort(((ke,Ae)=>Ae.keyPacket.created-ke.keyPacket.created));let tt;for(const Ce of Ve)if(!ke||Ce.getKeyID().equals(ke))try{await Ce.verify(Ae,ze);const ke={key:qe,bind:Ce.keyPacket},Ve=await qo(Ce.bindingSignatures,qe,er.signature.subkeyBinding,ke,Ae,ze);if(!$o(Ce.keyPacket,Ve))continue;if(!Ve.embeddedSignature)throw Error("Missing embedded signature");return await qo([Ve.embeddedSignature],Ce.keyPacket,er.signature.keyBinding,ke,Ae,ze),Xo(Ce.keyPacket,ze),Ce}catch(ke){tt=ke}try{const Ve=await this.getPrimaryUser(Ae,Ce,ze);if((!ke||qe.getKeyID().equals(ke))&&$o(qe,Ve.selfCertification))return Xo(qe,ze),this}catch(ke){tt=ke}throw Zt.wrapError("Could not find valid signing key packet in key "+this.getKeyID().toHex(),tt)}async getEncryptionKey(ke,Ae=new Date,Ce={},ze=tr){await this.verifyPrimaryKey(Ae,Ce,ze);const qe=this.keyPacket,Ve=this.subkeys.slice().sort(((ke,Ae)=>Ae.keyPacket.created-ke.keyPacket.created));let tt;for(const Ce of Ve)if(!ke||Ce.getKeyID().equals(ke))try{await Ce.verify(Ae,ze);const ke={key:qe,bind:Ce.keyPacket},Ve=await qo(Ce.bindingSignatures,qe,er.signature.subkeyBinding,ke,Ae,ze);if(Zo(Ce.keyPacket,Ve))return Xo(Ce.keyPacket,ze),Ce}catch(ke){tt=ke}try{const Ve=await this.getPrimaryUser(Ae,Ce,ze);if((!ke||qe.getKeyID().equals(ke))&&Zo(qe,Ve.selfCertification))return Xo(qe,ze),this}catch(ke){tt=ke}throw Zt.wrapError("Could not find valid encryption key packet in key "+this.getKeyID().toHex(),tt)}async isRevoked(ke,Ae,Ce=new Date,ze=tr){return Ho(this.keyPacket,er.signature.keyRevocation,{key:this.keyPacket},this.revocationSignatures,ke,Ae,Ce,ze)}async verifyPrimaryKey(ke=new Date,Ae={},Ce=tr){const ze=this.keyPacket;if(await this.isRevoked(null,null,ke,Ce))throw Error("Primary key is revoked");const{selfCertification:qe}=await this.getPrimaryUser(ke,Ae,Ce);if(Oo(ze,qe,ke))throw Error("Primary key is expired");const Ve=await qo(this.directSignatures,ze,er.signature.key,{key:ze},ke,Ce).catch((()=>{}));if(Ve&&Oo(ze,Ve,ke))throw Error("Primary key is expired")}async getExpirationTime(ke,Ae=tr){let Ce;try{const{selfCertification:ze}=await this.getPrimaryUser(null,ke,Ae),qe=Go(this.keyPacket,ze),Ve=ze.getExpirationTime(),tt=await qo(this.directSignatures,this.keyPacket,er.signature.key,{key:this.keyPacket},null,Ae).catch((()=>{}));if(tt){const ke=Go(this.keyPacket,tt);Ce=Math.min(qe,Ve,ke)}else Ce=qeke.subkeys.some((ke=>Ae.hasSameFingerprintAs(ke)))))))throw Error("Cannot update public key with private key if subkeys mismatch");return ke.update(this,Ce)}const ze=this.clone();return await Wo(ke,ze,"revocationSignatures",Ae,(qe=>Ho(ze.keyPacket,er.signature.keyRevocation,ze,[qe],null,ke.keyPacket,Ae,Ce))),await Wo(ke,ze,"directSignatures",Ae),await Promise.all(ke.users.map((async ke=>{const qe=ze.users.filter((Ae=>ke.userID&&ke.userID.equals(Ae.userID)||ke.userAttribute&&ke.userAttribute.equals(Ae.userAttribute)));if(qe.length>0)await Promise.all(qe.map((ze=>ze.update(ke,Ae,Ce))));else{const Ae=ke.clone();Ae.mainKey=ze,ze.users.push(Ae)}}))),await Promise.all(ke.subkeys.map((async ke=>{const qe=ze.subkeys.filter((Ae=>Ae.hasSameFingerprintAs(ke)));if(qe.length>0)await Promise.all(qe.map((ze=>ze.update(ke,Ae,Ce))));else{const Ae=ke.clone();Ae.mainKey=ze,ze.subkeys.push(Ae)}}))),ze}async getRevocationCertificate(ke=new Date,Ae=tr){const Ce={key:this.keyPacket},ze=await qo(this.revocationSignatures,this.keyPacket,er.signature.keyRevocation,Ce,ke,Ae),qe=new so;return qe.push(ze),xe(er.armor.publicKey,qe.write(),null,null,"This is a revocation certificate")}async applyRevocationCertificate(ke,Ae=new Date,Ce=tr){const ze=await Pe(ke,Ce),qe=(await so.fromBinary(ze.data,Cl,Ce)).findPacket(er.packet.signature);if(!qe||qe.signatureType!==er.signature.keyRevocation)throw Error("Could not find revocation signature packet");if(!qe.issuerKeyID.equals(this.getKeyID()))throw Error("Revocation signature does not match key");try{await qe.verify(this.keyPacket,er.signature.keyRevocation,{key:this.keyPacket},Ae,void 0,Ce)}catch(ke){throw Zt.wrapError("Could not verify revocation signature",ke)}const Ve=this.clone();return Ve.revocationSignatures.push(qe),Ve}async signPrimaryUser(ke,Ae,Ce,ze=tr){const{index:qe,user:Ve}=await this.getPrimaryUser(Ae,Ce,ze),tt=await Ve.certify(ke,Ae,ze),rt=this.clone();return rt.users[qe]=tt,rt}async signAllUsers(ke,Ae=new Date,Ce=tr){const ze=this.clone();return ze.users=await Promise.all(this.users.map((function(ze){return ze.certify(ke,Ae,Ce)}))),ze}async verifyPrimaryUser(ke,Ae=new Date,Ce,ze=tr){const qe=this.keyPacket,{user:Ve}=await this.getPrimaryUser(Ae,Ce,ze);return ke?await Ve.verifyAllCertifications(ke,Ae,ze):[{keyID:qe.getKeyID(),valid:await Ve.verify(Ae,ze).catch((()=>!1))}]}async verifyAllUsers(ke,Ae=new Date,Ce=tr){const ze=this.keyPacket,qe=[];return await Promise.all(this.users.map((async Ve=>{const tt=ke?await Ve.verifyAllCertifications(ke,Ae,Ce):[{keyID:ze.getKeyID(),valid:await Ve.verify(Ae,Ce).catch((()=>!1))}];qe.push(...tt.map((ke=>({userID:Ve.userID.userID,keyID:ke.keyID,valid:ke.valid}))))}))),qe}}function rc(ke){for(const Ae of ke)switch(Ae.constructor.tag){case er.packet.secretKey:return new nc(ke);case er.packet.publicKey:return new ic(ke)}throw Error("No key packet found")}["getKeyID","getFingerprint","getAlgorithmInfo","getCreationTime","hasSameFingerprintAs"].forEach((ke=>{tc.prototype[ke]=Jo.prototype[ke]}));class ic extends tc{constructor(ke){if(super(),this.keyPacket=null,this.revocationSignatures=[],this.directSignatures=[],this.users=[],this.subkeys=[],ke&&(this.packetListToStructure(ke,new Set([er.packet.secretKey,er.packet.secretSubkey])),!this.keyPacket))throw Error("Invalid key: missing public-key packet")}isPrivate(){return!1}toPublic(){return this}armor(ke=tr){return xe(er.armor.publicKey,this.toPacketList().write(),void 0,void 0,void 0,ke)}}class nc extends ic{constructor(ke){if(super(),this.packetListToStructure(ke,new Set([er.packet.publicKey,er.packet.publicSubkey])),!this.keyPacket)throw Error("Invalid key: missing private-key packet")}isPrivate(){return!0}toPublic(){const ke=new so,Ae=this.toPacketList();for(const Ce of Ae)switch(Ce.constructor.tag){case er.packet.secretKey:{const Ae=So.fromSecretKeyPacket(Ce);ke.push(Ae);break}case er.packet.secretSubkey:{const Ae=xo.fromSecretSubkeyPacket(Ce);ke.push(Ae);break}default:ke.push(Ce)}return new ic(ke)}armor(ke=tr){return xe(er.armor.privateKey,this.toPacketList().write(),void 0,void 0,void 0,ke)}async getDecryptionKeys(ke,Ae=new Date,Ce={},ze=tr){const qe=this.keyPacket,Ve=[];for(let Ce=0;Ceke.isDecrypted()))}async validate(ke=tr){if(!this.isPrivate())throw Error("Cannot validate a public key");let Ae;if(this.keyPacket.isDummy()){const Ce=await this.getSigningKey(null,null,void 0,{...ke,rejectPublicKeyAlgorithms:new Set,minRSABits:0});Ce&&!Ce.keyPacket.isDummy()&&(Ae=Ce.keyPacket)}else Ae=this.keyPacket;if(Ae)return Ae.validate();{const ke=this.getKeys();if(ke.map((ke=>ke.keyPacket.isDummy())).every(Boolean))throw Error("Cannot validate an all-gnu-dummy key");return Promise.all(ke.map((async ke=>ke.keyPacket.validate())))}}clearPrivateParams(){this.getKeys().forEach((({keyPacket:ke})=>{ke.isDecrypted()&&ke.clearPrivateParams()}))}async revoke({flag:ke=er.reasonForRevocation.noReason,string:Ae=""}={},Ce=new Date,ze=tr){if(!this.isPrivate())throw Error("Need private key for revoking");const qe={key:this.keyPacket},Ve=this.clone();return Ve.revocationSignatures.push(await Lo(qe,null,this.keyPacket,{signatureType:er.signature.keyRevocation,reasonForRevocationFlag:er.write(er.reasonForRevocation,ke),reasonForRevocationString:Ae},Ce,void 0,void 0,ze)),Ve}async addSubkey(ke={}){const Ae={...tr,...ke.config};if(ke.passphrase)throw Error("Subkey could not be encrypted here, please encrypt whole key");if(ke.rsaBitske!==Ae))]}const Ve=Ro.fromObject(Ae),tt={};tt.userID=Ve,tt.key=ke;const rt=new ro;return rt.signatureType=er.signature.certGeneric,rt.publicKeyAlgorithm=ke.algorithm,rt.hashAlgorithm=await No(null,ke,void 0,void 0,ze),rt.keyFlags=[er.keyFlags.certifyKeys|er.keyFlags.signData],rt.preferredSymmetricAlgorithms=a([er.symmetric.aes256,er.symmetric.aes128,er.symmetric.aes192],ze.preferredSymmetricAlgorithm),ze.aeadProtect&&(rt.preferredAEADAlgorithms=a([er.aead.eax,er.aead.ocb],ze.preferredAEADAlgorithm)),rt.preferredHashAlgorithms=a([er.hash.sha256,er.hash.sha512],ze.preferredHashAlgorithm),rt.preferredCompressionAlgorithms=a([er.compression.zlib,er.compression.zip,er.compression.uncompressed],ze.preferredCompressionAlgorithm),0===qe&&(rt.isPrimaryUserID=!0),rt.features=[0],rt.features[0]|=er.features.modificationDetection,ze.aeadProtect&&(rt.features[0]|=er.features.aead),ze.v5Keys&&(rt.features[0]|=er.features.v5Keys),Ce.keyExpirationTime>0&&(rt.keyExpirationTime=Ce.keyExpirationTime,rt.keyNeverExpires=!1),await rt.sign(ke,tt,Ce.date),{userIDPacket:Ve,signaturePacket:rt}}))).then((ke=>{ke.forEach((({userIDPacket:ke,signaturePacket:Ae})=>{qe.push(ke),qe.push(Ae)}))})),await Promise.all(Ae.map((async function(Ae,qe){const Ve=Ce.subkeys[qe];return{secretSubkeyPacket:Ae,subkeySignaturePacket:await Fo(Ae,ke,Ve,ze)}}))).then((ke=>{ke.forEach((({secretSubkeyPacket:ke,subkeySignaturePacket:Ae})=>{qe.push(ke),qe.push(Ae)}))}));const Ve={key:ke};return qe.push(await Lo(Ve,null,ke,{signatureType:er.signature.keyRevocation,reasonForRevocationFlag:er.reasonForRevocation.noReason,reasonForRevocationString:""},Ce.date,void 0,void 0,ze)),Ce.passphrase&&ke.clearPrivateParams(),await Promise.all(Ae.map((async function(ke,Ae){Ce.subkeys[Ae].passphrase&&ke.clearPrivateParams()}))),new nc(qe)}const Rl=Zt.constructAllowedPackets([Hs,co,vo,go,Po,_o,Ao,no,ro]),Tl=Zt.constructAllowedPackets([Ao]),Il=Zt.constructAllowedPackets([ro]);class hc{constructor(ke){this.packets=ke||new so}getEncryptionKeyIDs(){const ke=[];return this.packets.filterByTag(er.packet.publicKeyEncryptedSessionKey).forEach((function(Ae){ke.push(Ae.publicKeyID)})),ke}getSigningKeyIDs(){const ke=this.unwrapCompressed(),Ae=ke.packets.filterByTag(er.packet.onePassSignature);if(Ae.length>0)return Ae.map((ke=>ke.issuerKeyID));return ke.packets.filterByTag(er.packet.signature).map((ke=>ke.issuerKeyID))}async decrypt(ke,Ae,Ce,ze=new Date,qe=tr){const Ve=Ce||await this.decryptSessionKeys(ke,Ae,ze,qe),tt=this.packets.filterByTag(er.packet.symmetricallyEncryptedData,er.packet.symEncryptedIntegrityProtectedData,er.packet.aeadEncryptedData);if(0===tt.length)return this;const rt=tt[0];let it=null;const nt=Promise.all(Ve.map((async({algorithm:ke,data:Ae})=>{if(!Zt.isUint8Array(Ae)||!Zt.isString(ke))throw Error("Invalid session key for decryption.");try{const Ce=er.write(er.symmetric,ke);await rt.decrypt(Ce,Ae,qe)}catch(ke){Zt.printDebugError(ke),it=ke}})));if(ne(rt.encrypted),rt.encrypted=null,await nt,!rt.packets||!rt.packets.length)throw it||Error("Decryption failed.");const ot=new hc(rt.packets);return rt.packets=new so,ot}async decryptSessionKeys(ke,Ae,Ce=new Date,ze=tr){let qe,Ve=[];if(Ae){const ke=this.packets.filterByTag(er.packet.symEncryptedSessionKey);if(0===ke.length)throw Error("No symmetrically encrypted session key packet found.");await Promise.all(Ae.map((async function(Ae,Ce){let qe;qe=Ce?await so.fromBinary(ke.write(),Tl,ze):ke,await Promise.all(qe.map((async function(ke){try{await ke.decrypt(Ae),Ve.push(ke)}catch(ke){Zt.printDebugError(ke)}})))})))}else{if(!ke)throw Error("No key or password specified.");{const Ae=this.packets.filterByTag(er.packet.publicKeyEncryptedSessionKey);if(0===Ae.length)throw Error("No public key encrypted session key packet found.");await Promise.all(Ae.map((async function(Ae){await Promise.all(ke.map((async function(ke){let tt=[er.symmetric.aes256,er.symmetric.aes128,er.symmetric.tripledes,er.symmetric.cast5];try{const Ae=await ke.getPrimaryUser(Ce,void 0,ze);Ae.selfCertification.preferredSymmetricAlgorithms&&(tt=tt.concat(Ae.selfCertification.preferredSymmetricAlgorithms))}catch(ke){}const rt=(await ke.getDecryptionKeys(Ae.publicKeyID,null,void 0,ze)).map((ke=>ke.keyPacket));await Promise.all(rt.map((async function(ke){if(!ke||ke.isDummy())return;if(!ke.isDecrypted())throw Error("Decryption key is not decrypted.");if(ze.constantTimePKCS1Decryption&&(Ae.publicKeyAlgorithm===er.publicKey.rsaEncrypt||Ae.publicKeyAlgorithm===er.publicKey.rsaEncryptSign||Ae.publicKeyAlgorithm===er.publicKey.rsaSign||Ae.publicKeyAlgorithm===er.publicKey.elgamal)){const Ce=Ae.write();await Promise.all(Array.from(ze.constantTimePKCS1DecryptionSupportedSymmetricAlgorithms).map((async Ae=>{const ze=new _o;ze.read(Ce);const tt={sessionKeyAlgorithm:Ae,sessionKey:await mo.generateSessionKey(Ae)};try{await ze.decrypt(ke,tt),Ve.push(ze)}catch(ke){Zt.printDebugError(ke),qe=ke}})))}else try{if(await Ae.decrypt(ke),!tt.includes(er.write(er.symmetric,Ae.sessionKeyAlgorithm)))throw Error("A non-preferred symmetric algorithm was used.");Ve.push(Ae)}catch(ke){Zt.printDebugError(ke),qe=ke}})))}))),ne(Ae.encrypted),Ae.encrypted=null})))}}if(Ve.length>0){if(Ve.length>1){const ke=new Set;Ve=Ve.filter((Ae=>{const Ce=Ae.sessionKeyAlgorithm+Zt.uint8ArrayToString(Ae.sessionKey);return!ke.has(Ce)&&(ke.add(Ce),!0)}))}return Ve.map((ke=>({data:ke.sessionKey,algorithm:er.read(er.symmetric,ke.sessionKeyAlgorithm)})))}throw qe||Error("Session key decryption failed.")}getLiteralData(){const ke=this.unwrapCompressed().packets.findPacket(er.packet.literalData);return ke&&ke.getBytes()||null}getFilename(){const ke=this.unwrapCompressed().packets.findPacket(er.packet.literalData);return ke&&ke.getFilename()||null}getText(){const ke=this.unwrapCompressed().packets.findPacket(er.packet.literalData);return ke?ke.getText():null}static async generateSessionKey(ke=[],Ae=new Date,Ce=[],ze=tr){const qe=await jo("symmetric",ke,Ae,Ce,ze),Ve=er.read(er.symmetric,qe),tt=ze.aeadProtect&&await async function(ke,Ae=new Date,Ce=[],ze=tr){let qe=!0;return await Promise.all(ke.map((async function(ke,Ve){const tt=await ke.getPrimaryUser(Ae,Ce[Ve],ze);tt.selfCertification.features&&tt.selfCertification.features[0]&er.features.aead||(qe=!1)}))),qe}(ke,Ae,Ce,ze)?er.read(er.aead,await jo("aead",ke,Ae,Ce,ze)):void 0;return{data:await mo.generateSessionKey(qe),algorithm:Ve,aeadAlgorithm:tt}}async encrypt(ke,Ae,Ce,ze=!1,qe=[],Ve=new Date,tt=[],rt=tr){if(Ce){if(!Zt.isUint8Array(Ce.data)||!Zt.isString(Ce.algorithm))throw Error("Invalid session key for encryption.")}else if(ke&&ke.length)Ce=await hc.generateSessionKey(ke,Ve,tt,rt);else{if(!Ae||!Ae.length)throw Error("No keys, passwords, or session key provided.");Ce=await hc.generateSessionKey(void 0,void 0,void 0,rt)}const{data:it,algorithm:nt,aeadAlgorithm:ot}=Ce,ct=await hc.encryptSessionKey(it,nt,ot,ke,Ae,ze,qe,Ve,tt,rt);let ht;ot?(ht=new vo,ht.aeadAlgorithm=er.write(er.aead,ot)):ht=new go,ht.packets=this.packets;const ft=er.write(er.symmetric,nt);return await ht.encrypt(ft,it,rt),ct.packets.push(ht),ht.packets=new so,ct}static async encryptSessionKey(ke,Ae,Ce,ze,qe,Ve=!1,tt=[],rt=new Date,it=[],nt=tr){const ot=new so,ct=er.write(er.symmetric,Ae),ht=Ce&&er.write(er.aead,Ce);if(ze){const Ae=await Promise.all(ze.map((async function(Ae,Ce){const ze=await Ae.getEncryptionKey(tt[Ce],rt,it,nt),qe=new _o;return qe.publicKeyID=Ve?Me.wildcard():ze.getKeyID(),qe.publicKeyAlgorithm=ze.keyPacket.algorithm,qe.sessionKey=ke,qe.sessionKeyAlgorithm=ct,await qe.encrypt(ze.keyPacket),delete qe.sessionKey,qe})));ot.push(...Ae)}if(qe){const t=async function(ke,Ae){try{return await ke.decrypt(Ae),1}catch(ke){return 0}},r=(ke,Ae)=>ke+Ae,i=async function(ke,Ae,Ce,ze){const Ve=new Ao(nt);if(Ve.sessionKey=ke,Ve.sessionKeyAlgorithm=Ae,Ce&&(Ve.aeadAlgorithm=Ce),await Ve.encrypt(ze,nt),nt.passwordCollisionCheck){if(1!==(await Promise.all(qe.map((ke=>t(Ve,ke))))).reduce(r))return i(ke,Ae,ze)}return delete Ve.sessionKey,Ve},Ae=await Promise.all(qe.map((Ae=>i(ke,ct,ht,Ae))));ot.push(...Ae)}return new hc(ot)}async sign(ke=[],Ae=null,Ce=[],ze=new Date,qe=[],Ve=tr){const tt=new so,rt=this.packets.findPacket(er.packet.literalData);if(!rt)throw Error("No literal data packet to sign.");let it,nt;const ot=null===rt.text?er.signature.binary:er.signature.text;if(Ae)for(nt=Ae.packets.filterByTag(er.packet.signature),it=nt.length-1;it>=0;it--){const Ae=nt[it],Ce=new no;Ce.signatureType=Ae.signatureType,Ce.hashAlgorithm=Ae.hashAlgorithm,Ce.publicKeyAlgorithm=Ae.publicKeyAlgorithm,Ce.issuerKeyID=Ae.issuerKeyID,ke.length||0!==it||(Ce.flags=1),tt.push(Ce)}return await Promise.all(Array.from(ke).reverse().map((async function(Ae,tt){if(!Ae.isPrivate())throw Error("Need private key for signing");const rt=Ce[ke.length-1-tt],it=await Ae.getSigningKey(rt,ze,qe,Ve),nt=new no;return nt.signatureType=ot,nt.hashAlgorithm=await No(Ae,it.keyPacket,ze,qe,Ve),nt.publicKeyAlgorithm=it.keyPacket.algorithm,nt.issuerKeyID=it.getKeyID(),tt===ke.length-1&&(nt.flags=1),nt}))).then((ke=>{ke.forEach((ke=>tt.push(ke)))})),tt.push(rt),tt.push(...await fc(rt,ke,Ae,Ce,ze,qe,!1,Ve)),new hc(tt)}compress(ke,Ae=tr){if(ke===er.compression.uncompressed)return this;const Ce=new co(Ae);Ce.algorithm=ke,Ce.packets=this.packets;const ze=new so;return ze.push(Ce),new hc(ze)}async signDetached(ke=[],Ae=null,Ce=[],ze=new Date,qe=[],Ve=tr){const tt=this.packets.findPacket(er.packet.literalData);if(!tt)throw Error("No literal data packet to sign.");return new Bo(await fc(tt,ke,Ae,Ce,ze,qe,!0,Ve))}async verify(ke,Ae=new Date,Ce=tr){const ze=this.unwrapCompressed(),qe=ze.packets.filterByTag(er.packet.literalData);if(1!==qe.length)throw Error("Can only verify message with one literal data packet.");_(ze.packets.stream)&&ze.packets.push(...await ie(ze.packets.stream,(ke=>ke||[])));const Ve=ze.packets.filterByTag(er.packet.onePassSignature).reverse(),tt=ze.packets.filterByTag(er.packet.signature);return Ve.length&&!tt.length&&Zt.isStream(ze.packets.stream)&&!_(ze.packets.stream)?(await Promise.all(Ve.map((async ke=>{ke.correspondingSig=new Promise(((Ae,Ce)=>{ke.correspondingSigResolve=Ae,ke.correspondingSigReject=Ce})),ke.signatureData=ae((async()=>(await ke.correspondingSig).signatureData)),ke.hashed=ie(await ke.hash(ke.signatureType,qe[0],void 0,!1)),ke.hashed.catch((()=>{}))}))),ze.packets.stream=X(ze.packets.stream,(async(ke,Ae)=>{const Ce=H(ke),ze=G(Ae);try{for(let ke=0;ke{Ae.correspondingSigReject(ke)})),await ze.abort(ke)}})),dc(Ve,qe,ke,Ae,!1,Ce)):dc(tt,qe,ke,Ae,!1,Ce)}verifyDetached(ke,Ae,Ce=new Date,ze=tr){const qe=this.unwrapCompressed().packets.filterByTag(er.packet.literalData);if(1!==qe.length)throw Error("Can only verify message with one literal data packet.");return dc(ke.packets,qe,Ae,Ce,!0,ze)}unwrapCompressed(){const ke=this.packets.filterByTag(er.packet.compressedData);return ke.length?new hc(ke[0].packets):this}async appendSignature(ke,Ae=tr){await this.packets.read(Zt.isUint8Array(ke)?ke:(await Pe(ke)).data,Il,Ae)}write(){return this.packets.write()}armor(ke=tr){return xe(er.armor.message,this.write(),null,null,null,ke)}}async function fc(ke,Ae,Ce=null,ze=[],qe=new Date,Ve=[],tt=!1,rt=tr){const it=new so,nt=null===ke.text?er.signature.binary:er.signature.text;if(await Promise.all(Ae.map((async(Ae,Ce)=>{const it=Ve[Ce];if(!Ae.isPrivate())throw Error("Need private key for signing");const ot=await Ae.getSigningKey(ze[Ce],qe,it,rt);return Lo(ke,Ae,ot.keyPacket,{signatureType:nt},qe,it,tt,rt)}))).then((ke=>{it.push(...ke)})),Ce){const ke=Ce.packets.filterByTag(er.packet.signature);it.push(...ke)}return it}async function dc(ke,Ae,Ce,ze=new Date,qe=!1,Ve=tr){return Promise.all(ke.filter((function(ke){return["text","binary"].includes(er.read(er.signature,ke.signatureType))})).map((async function(ke){return async function(ke,Ae,Ce,ze=new Date,qe=!1,Ve=tr){let tt,rt;for(const Ae of Ce){const Ce=Ae.getKeys(ke.issuerKeyID);if(Ce.length>0){tt=Ae,rt=Ce[0];break}}const it=ke instanceof no?ke.correspondingSig:ke,nt={keyID:ke.issuerKeyID,verified:(async()=>{if(!rt)throw Error("Could not find signing key with key ID "+ke.issuerKeyID.toHex());await ke.verify(rt.keyPacket,ke.signatureType,Ae[0],ze,qe,Ve);const Ce=await it;if(rt.getCreationTime()>Ce.created)throw Error("Key is newer than the signature");try{await tt.getSigningKey(rt.getKeyID(),Ce.created,void 0,Ve)}catch(ke){if(!Ve.allowInsecureVerificationWithReformattedKeys||!ke.message.match(/Signature creation time is in the future/))throw ke;await tt.getSigningKey(rt.getKeyID(),ze,void 0,Ve)}return!0})(),signature:(async()=>{const ke=await it,Ae=new so;return ke&&Ae.push(ke),new Bo(Ae)})()};return nt.signature.catch((()=>{})),nt.verified.catch((()=>{})),nt}(ke,Ae,Ce,ze,qe,Ve)})))}const Ul=Zt.constructAllowedPackets([ro]);class pc{constructor(ke,Ae){if(this.text=Zt.removeTrailingSpaces(ke).replace(/\r?\n/g,"\r\n"),Ae&&!(Ae instanceof Bo))throw Error("Invalid signature input");this.signature=Ae||new Bo(new so)}getSigningKeyIDs(){const ke=[];return this.signature.packets.forEach((function(Ae){ke.push(Ae.issuerKeyID)})),ke}async sign(ke,Ae=null,Ce=[],ze=new Date,qe=[],Ve=tr){const tt=new Hs;tt.setText(this.text);const rt=new Bo(await fc(tt,ke,Ae,Ce,ze,qe,!0,Ve));return new pc(this.text,rt)}verify(ke,Ae=new Date,Ce=tr){const ze=this.signature.packets,qe=new Hs;return qe.setText(this.text),dc(ze,[qe],ke,Ae,!0,Ce)}getText(){return this.text.replace(/\r\n/g,"\n")}armor(ke=tr){let Ae=this.signature.packets.map((function(ke){return er.read(er.hash,ke.hashAlgorithm).toUpperCase()}));Ae=Ae.filter((function(ke,Ae,Ce){return Ce.indexOf(ke)===Ae}));const Ce={hash:Ae.join(),text:this.text,data:this.signature.packets.write()};return xe(er.armor.signed,Ce,void 0,void 0,void 0,ke)}}function yc(ke){if(!(ke instanceof hc))throw Error("Parameter [message] needs to be of type Message")}function bc(ke){if(!(ke instanceof pc||ke instanceof hc))throw Error("Parameter [message] needs to be of type Message or CleartextMessage")}function mc(ke){if("armored"!==ke&&"binary"!==ke&&"object"!==ke)throw Error("Unsupported format "+ke)}const Ol=Object.keys(tr).length;function wc(ke){const Ae=Object.keys(ke);if(Ae.length!==Ol)for(const ke of Ae)if(void 0===tr[ke])throw Error("Unknown config property: "+ke)}function vc(ke){return ke&&!Zt.isArray(ke)&&(ke=[ke]),ke}async function _c(ke,Ae,Ce="utf8"){const ze=Zt.isStream(ke);return"array"===ze?ie(ke):"node"===Ae?(ke=Ot(ke),"binary"!==Ce&&ke.setEncoding(Ce),ke):"web"===Ae&&"ponyfill"===ze?Ft(ke):ke}function kc(ke,Ae){ke.data=X(Ae.packets.stream,(async(Ae,Ce)=>{await V(ke.data,Ce,{preventClose:!0});const ze=G(Ce);try{await ie(Ae,(ke=>ke)),await ze.close()}catch(ke){await ze.abort(ke)}}))}function Ac(ke,Ae,Ce){switch(Ae){case"object":return ke;case"armored":return ke.armor(Ce);case"binary":return ke.write();default:throw Error("Unsupported format "+Ae)}}const Nl="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?Symbol:ke=>`Symbol(${ke})`;function Ec(){}const zl="undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:void 0;function xc(ke){return"object"==typeof ke&&null!==ke||"function"==typeof ke}const ql=Ec,jl=Promise,Ll=Promise.prototype.then,Hl=Promise.resolve.bind(jl),Gl=Promise.reject.bind(jl);function Ic(ke){return new jl(ke)}function Uc(ke){return Hl(ke)}function Bc(ke){return Gl(ke)}function Tc(ke,Ae,Ce){return Ll.call(ke,Ae,Ce)}function zc(ke,Ae,Ce){Tc(Tc(ke,Ae,Ce),void 0,ql)}function qc(ke,Ae){zc(ke,Ae)}function Oc(ke,Ae){zc(ke,void 0,Ae)}function Fc(ke,Ae,Ce){return Tc(ke,Ae,Ce)}function Nc(ke){Tc(ke,void 0,ql)}const $l=(()=>{const ke=zl&&zl.queueMicrotask;if("function"==typeof ke)return ke;const Ae=Uc(void 0);return ke=>Tc(Ae,ke)})();function Lc(ke,Ae,Ce){if("function"!=typeof ke)throw new TypeError("Argument is not a function");return Function.prototype.apply.call(ke,Ae,Ce)}function Wc(ke,Ae,Ce){try{return Uc(Lc(ke,Ae,Ce))}catch(ke){return Bc(ke)}}class Hc{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(ke){const Ae=this._back;let Ce=Ae;16383===Ae._elements.length&&(Ce={_elements:[],_next:void 0}),Ae._elements.push(ke),Ce!==Ae&&(this._back=Ce,Ae._next=Ce),++this._size}shift(){const ke=this._front;let Ae=ke;const Ce=this._cursor;let ze=Ce+1;const qe=ke._elements,Ve=qe[Ce];return 16384===ze&&(Ae=ke._next,ze=0),--this._size,this._cursor=ze,ke!==Ae&&(this._front=Ae),qe[Ce]=void 0,Ve}forEach(ke){let Ae=this._cursor,Ce=this._front,ze=Ce._elements;for(;!(Ae===ze.length&&void 0===Ce._next||Ae===ze.length&&(Ce=Ce._next,ze=Ce._elements,Ae=0,0===ze.length));)ke(ze[Ae]),++Ae}peek(){const ke=this._front,Ae=this._cursor;return ke._elements[Ae]}}function Gc(ke,Ae){ke._ownerReadableStream=Ae,Ae._reader=ke,"readable"===Ae._state?Yc(ke):"closed"===Ae._state?function(ke){Yc(ke),Jc(ke)}(ke):Xc(ke,Ae._storedError)}function Vc(ke,Ae){return Df(ke._ownerReadableStream,Ae)}function $c(ke){"readable"===ke._ownerReadableStream._state?Qc(ke,new TypeError("Reader was released and can no longer be used to monitor the stream's closedness")):function(ke,Ae){Xc(ke,Ae)}(ke,new TypeError("Reader was released and can no longer be used to monitor the stream's closedness")),ke._ownerReadableStream._reader=void 0,ke._ownerReadableStream=void 0}function Zc(ke){return new TypeError("Cannot "+ke+" a stream using a released reader")}function Yc(ke){ke._closedPromise=Ic(((Ae,Ce)=>{ke._closedPromise_resolve=Ae,ke._closedPromise_reject=Ce}))}function Xc(ke,Ae){Yc(ke),Qc(ke,Ae)}function Qc(ke,Ae){void 0!==ke._closedPromise_reject&&(Nc(ke._closedPromise),ke._closedPromise_reject(Ae),ke._closedPromise_resolve=void 0,ke._closedPromise_reject=void 0)}function Jc(ke){void 0!==ke._closedPromise_resolve&&(ke._closedPromise_resolve(void 0),ke._closedPromise_resolve=void 0,ke._closedPromise_reject=void 0)}const Vl=Nl("[[AbortSteps]]"),Zl=Nl("[[ErrorSteps]]"),Xl=Nl("[[CancelSteps]]"),Jl=Nl("[[PullSteps]]"),Yl=Number.isFinite||function(ke){return"number"==typeof ke&&isFinite(ke)},Ql=Math.trunc||function(ke){return ke<0?Math.ceil(ke):Math.floor(ke)};function su(ke,Ae){if(void 0!==ke&&("object"!=typeof(Ce=ke)&&"function"!=typeof Ce))throw new TypeError(Ae+" is not an object.");var Ce}function ou(ke,Ae){if("function"!=typeof ke)throw new TypeError(Ae+" is not a function.")}function cu(ke,Ae){if(!function(ke){return"object"==typeof ke&&null!==ke||"function"==typeof ke}(ke))throw new TypeError(Ae+" is not an object.")}function uu(ke,Ae,Ce){if(void 0===ke)throw new TypeError(`Parameter ${Ae} is required in '${Ce}'.`)}function hu(ke,Ae,Ce){if(void 0===ke)throw new TypeError(`${Ae} is required in '${Ce}'.`)}function fu(ke){return Number(ke)}function du(ke){return 0===ke?0:ke}function lu(ke,Ae){const Ce=Number.MAX_SAFE_INTEGER;let ze=Number(ke);if(ze=du(ze),!Yl(ze))throw new TypeError(Ae+" is not a finite number");if(ze=function(ke){return du(Ql(ke))}(ze),ze<0||ze>Ce)throw new TypeError(`${Ae} is outside the accepted range of 0 to ${Ce}, inclusive`);return Yl(ze)&&0!==ze?ze:0}function pu(ke,Ae){if(!Cf(ke))throw new TypeError(Ae+" is not a ReadableStream.")}function yu(ke){return new vu(ke)}function bu(ke,Ae){ke._reader._readRequests.push(Ae)}function mu(ke,Ae,Ce){const ze=ke._reader._readRequests.shift();Ce?ze._closeSteps():ze._chunkSteps(Ae)}function gu(ke){return ke._reader._readRequests.length}function wu(ke){const Ae=ke._reader;return void 0!==Ae&&!!_u(Ae)}class vu{constructor(ke){if(uu(ke,1,"ReadableStreamDefaultReader"),pu(ke,"First parameter"),Kf(ke))throw new TypeError("This stream has already been locked for exclusive reading by another reader");Gc(this,ke),this._readRequests=new Hc}get closed(){return _u(this)?this._closedPromise:Bc(Au("closed"))}cancel(ke){return _u(this)?void 0===this._ownerReadableStream?Bc(Zc("cancel")):Vc(this,ke):Bc(Au("cancel"))}read(){if(!_u(this))return Bc(Au("read"));if(void 0===this._ownerReadableStream)return Bc(Zc("read from"));let ke,Ae;const Ce=Ic(((Ce,ze)=>{ke=Ce,Ae=ze}));return ku(this,{_chunkSteps:Ae=>ke({value:Ae,done:!1}),_closeSteps:()=>ke({value:void 0,done:!0}),_errorSteps:ke=>Ae(ke)}),Ce}releaseLock(){if(!_u(this))throw Au("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");$c(this)}}}function _u(ke){return!!xc(ke)&&!!Object.prototype.hasOwnProperty.call(ke,"_readRequests")}function ku(ke,Ae){const Ce=ke._ownerReadableStream;Ce._disturbed=!0,"closed"===Ce._state?Ae._closeSteps():"errored"===Ce._state?Ae._errorSteps(Ce._storedError):Ce._readableStreamController[Jl](Ae)}function Au(ke){return new TypeError(`ReadableStreamDefaultReader.prototype.${ke} can only be used on a ReadableStreamDefaultReader`)}let ad;Object.defineProperties(vu.prototype,{cancel:{enumerable:!0},read:{enumerable:!0},releaseLock:{enumerable:!0},closed:{enumerable:!0}}),"symbol"==typeof Nl.toStringTag&&Object.defineProperty(vu.prototype,Nl.toStringTag,{value:"ReadableStreamDefaultReader",configurable:!0}),"symbol"==typeof Nl.asyncIterator&&(ad={[Nl.asyncIterator](){return this}},Object.defineProperty(ad,Nl.asyncIterator,{enumerable:!1}));class Eu{constructor(ke,Ae){this._ongoingPromise=void 0,this._isFinished=!1,this._reader=ke,this._preventCancel=Ae}next(){const e=()=>this._nextSteps();return this._ongoingPromise=this._ongoingPromise?Fc(this._ongoingPromise,e,e):e(),this._ongoingPromise}return(ke){const t=()=>this._returnSteps(ke);return this._ongoingPromise?Fc(this._ongoingPromise,t,t):t()}_nextSteps(){if(this._isFinished)return Promise.resolve({value:void 0,done:!0});const ke=this._reader;if(void 0===ke._ownerReadableStream)return Bc(Zc("iterate"));let Ae,Ce;const ze=Ic(((ke,ze)=>{Ae=ke,Ce=ze}));return ku(ke,{_chunkSteps:ke=>{this._ongoingPromise=void 0,$l((()=>Ae({value:ke,done:!1})))},_closeSteps:()=>{this._ongoingPromise=void 0,this._isFinished=!0,$c(ke),Ae({value:void 0,done:!0})},_errorSteps:Ae=>{this._ongoingPromise=void 0,this._isFinished=!0,$c(ke),Ce(Ae)}}),ze}_returnSteps(ke){if(this._isFinished)return Promise.resolve({value:ke,done:!0});this._isFinished=!0;const Ae=this._reader;if(void 0===Ae._ownerReadableStream)return Bc(Zc("finish iterating"));if(!this._preventCancel){const Ce=Vc(Ae,ke);return $c(Ae),Fc(Ce,(()=>({value:ke,done:!0})))}return $c(Ae),Uc({value:ke,done:!0})}}const gd={next(){return xu(this)?this._asyncIteratorImpl.next():Bc(Mu("next"))},return(ke){return xu(this)?this._asyncIteratorImpl.return(ke):Bc(Mu("return"))}};function xu(ke){return!!xc(ke)&&!!Object.prototype.hasOwnProperty.call(ke,"_asyncIteratorImpl")}function Mu(ke){return new TypeError(`ReadableStreamAsyncIterator.${ke} can only be used on a ReadableSteamAsyncIterator`)}void 0!==ad&&Object.setPrototypeOf(gd,ad);const wd=Number.isNaN||function(ke){return ke!=ke};function Ku(ke){return!!function(ke){if("number"!=typeof ke)return!1;if(wd(ke))return!1;if(ke<0)return!1;return!0}(ke)&&ke!==1/0}function Du(ke){const Ae=ke._queue.shift();return ke._queueTotalSize-=Ae.size,ke._queueTotalSize<0&&(ke._queueTotalSize=0),Ae.value}function Ru(ke,Ae,Ce){if(!Ku(Ce=Number(Ce)))throw new RangeError("Size must be a finite, non-NaN, non-negative number.");ke._queue.push({value:Ae,size:Ce}),ke._queueTotalSize+=Ce}function Iu(ke){ke._queue=new Hc,ke._queueTotalSize=0}function Uu(ke){return ke.slice()}class Bu{constructor(){throw new TypeError("Illegal constructor")}get view(){if(!qu(this))throw eh("view");return this._view}respond(ke){if(!qu(this))throw eh("respond");if(uu(ke,1,"respond"),ke=lu(ke,"First parameter"),void 0===this._associatedReadableByteStreamController)throw new TypeError("This BYOB request has been invalidated");this._view.buffer,function(ke,Ae){if(!Ku(Ae=Number(Ae)))throw new RangeError("bytesWritten must be a finite");$u(ke,Ae)}(this._associatedReadableByteStreamController,ke)}respondWithNewView(ke){if(!qu(this))throw eh("respondWithNewView");if(uu(ke,1,"respondWithNewView"),!ArrayBuffer.isView(ke))throw new TypeError("You can only respond with array buffer views");if(0===ke.byteLength)throw new TypeError("chunk must have non-zero byteLength");if(0===ke.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(ke,Ae){const Ce=ke._pendingPullIntos.peek();if(Ce.byteOffset+Ce.bytesFilled!==Ae.byteOffset)throw new RangeError("The region specified by view does not match byobRequest");if(Ce.byteLength!==Ae.byteLength)throw new RangeError("The buffer of view has different capacity than byobRequest");Ce.buffer=Ae.buffer,$u(ke,Ae.byteLength)}(this._associatedReadableByteStreamController,ke)}}Object.defineProperties(Bu.prototype,{respond:{enumerable:!0},respondWithNewView:{enumerable:!0},view:{enumerable:!0}}),"symbol"==typeof Nl.toStringTag&&Object.defineProperty(Bu.prototype,Nl.toStringTag,{value:"ReadableStreamBYOBRequest",configurable:!0});class Tu{constructor(){throw new TypeError("Illegal constructor")}get byobRequest(){if(!zu(this))throw th("byobRequest");if(null===this._byobRequest&&this._pendingPullIntos.length>0){const ke=this._pendingPullIntos.peek(),Ae=new Uint8Array(ke.buffer,ke.byteOffset+ke.bytesFilled,ke.byteLength-ke.bytesFilled),Ce=Object.create(Bu.prototype);!function(ke,Ae,Ce){ke._associatedReadableByteStreamController=Ae,ke._view=Ce}(Ce,this,Ae),this._byobRequest=Ce}return this._byobRequest}get desiredSize(){if(!zu(this))throw th("desiredSize");return Qu(this)}close(){if(!zu(this))throw th("close");if(this._closeRequested)throw new TypeError("The stream has already been closed; do not close it again!");const ke=this._controlledReadableByteStream._state;if("readable"!==ke)throw new TypeError(`The stream (in ${ke} state) is not in the readable state and cannot be closed`);!function(ke){const Ae=ke._controlledReadableByteStream;if(ke._closeRequested||"readable"!==Ae._state)return;if(ke._queueTotalSize>0)return void(ke._closeRequested=!0);if(ke._pendingPullIntos.length>0){if(ke._pendingPullIntos.peek().bytesFilled>0){const Ae=new TypeError("Insufficient bytes to fill elements in the given buffer");throw Xu(ke,Ae),Ae}}Yu(ke),Rf(Ae)}(this)}enqueue(ke){if(!zu(this))throw th("enqueue");if(uu(ke,1,"enqueue"),!ArrayBuffer.isView(ke))throw new TypeError("chunk must be an array buffer view");if(0===ke.byteLength)throw new TypeError("chunk must have non-zero byteLength");if(0===ke.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 Ae=this._controlledReadableByteStream._state;if("readable"!==Ae)throw new TypeError(`The stream (in ${Ae} state) is not in the readable state and cannot be enqueued to`);!function(ke,Ae){const Ce=ke._controlledReadableByteStream;if(ke._closeRequested||"readable"!==Ce._state)return;const ze=Ae.buffer,qe=Ae.byteOffset,Ve=Ae.byteLength,tt=ze;if(wu(Ce))if(0===gu(Ce))ju(ke,tt,qe,Ve);else{mu(Ce,new Uint8Array(tt,qe,Ve),!1)}else nh(Ce)?(ju(ke,tt,qe,Ve),Vu(ke)):ju(ke,tt,qe,Ve);Ou(ke)}(this,ke)}error(ke){if(!zu(this))throw th("error");Xu(this,ke)}[Xl](ke){if(this._pendingPullIntos.length>0){this._pendingPullIntos.peek().bytesFilled=0}Iu(this);const Ae=this._cancelAlgorithm(ke);return Yu(this),Ae}[Jl](ke){const Ae=this._controlledReadableByteStream;if(this._queueTotalSize>0){const Ae=this._queue.shift();this._queueTotalSize-=Ae.byteLength,Hu(this);const Ce=new Uint8Array(Ae.buffer,Ae.byteOffset,Ae.byteLength);return void ke._chunkSteps(Ce)}const Ce=this._autoAllocateChunkSize;if(void 0!==Ce){let ze;try{ze=new ArrayBuffer(Ce)}catch(Ae){return void ke._errorSteps(Ae)}const qe={buffer:ze,byteOffset:0,byteLength:Ce,bytesFilled:0,elementSize:1,viewConstructor:Uint8Array,readerType:"default"};this._pendingPullIntos.push(qe)}bu(Ae,ke),Ou(this)}}function zu(ke){return!!xc(ke)&&!!Object.prototype.hasOwnProperty.call(ke,"_controlledReadableByteStream")}function qu(ke){return!!xc(ke)&&!!Object.prototype.hasOwnProperty.call(ke,"_associatedReadableByteStreamController")}function Ou(ke){if(!function(ke){const Ae=ke._controlledReadableByteStream;if("readable"!==Ae._state)return!1;if(ke._closeRequested)return!1;if(!ke._started)return!1;if(wu(Ae)&&gu(Ae)>0)return!0;if(nh(Ae)&&ih(Ae)>0)return!0;if(Qu(ke)>0)return!0;return!1}(ke))return;if(ke._pulling)return void(ke._pullAgain=!0);ke._pulling=!0;zc(ke._pullAlgorithm(),(()=>{ke._pulling=!1,ke._pullAgain&&(ke._pullAgain=!1,Ou(ke))}),(Ae=>{Xu(ke,Ae)}))}function Fu(ke,Ae){let Ce=!1;"closed"===ke._state&&(Ce=!0);const ze=Nu(Ae);"default"===Ae.readerType?mu(ke,ze,Ce):function(ke,Ae,Ce){const ze=ke._reader._readIntoRequests.shift();Ce?ze._closeSteps(Ae):ze._chunkSteps(Ae)}(ke,ze,Ce)}function Nu(ke){const Ae=ke.bytesFilled,Ce=ke.elementSize;return new ke.viewConstructor(ke.buffer,ke.byteOffset,Ae/Ce)}function ju(ke,Ae,Ce,ze){ke._queue.push({buffer:Ae,byteOffset:Ce,byteLength:ze}),ke._queueTotalSize+=ze}function Lu(ke,Ae){const Ce=Ae.elementSize,ze=Ae.bytesFilled-Ae.bytesFilled%Ce,qe=Math.min(ke._queueTotalSize,Ae.byteLength-Ae.bytesFilled),Ve=Ae.bytesFilled+qe,tt=Ve-Ve%Ce;let rt=qe,it=!1;tt>ze&&(rt=tt-Ae.bytesFilled,it=!0);const nt=ke._queue;for(;rt>0;){const Ce=nt.peek(),ze=Math.min(rt,Ce.byteLength),qe=Ae.byteOffset+Ae.bytesFilled;ot=Ae.buffer,ct=qe,ht=Ce.buffer,ft=Ce.byteOffset,yt=ze,new Uint8Array(ot).set(new Uint8Array(ht,ft,yt),ct),Ce.byteLength===ze?nt.shift():(Ce.byteOffset+=ze,Ce.byteLength-=ze),ke._queueTotalSize-=ze,Wu(ke,ze,Ae),rt-=ze}var ot,ct,ht,ft,yt;return it}function Wu(ke,Ae,Ce){Gu(ke),Ce.bytesFilled+=Ae}function Hu(ke){0===ke._queueTotalSize&&ke._closeRequested?(Yu(ke),Rf(ke._controlledReadableByteStream)):Ou(ke)}function Gu(ke){null!==ke._byobRequest&&(ke._byobRequest._associatedReadableByteStreamController=void 0,ke._byobRequest._view=null,ke._byobRequest=null)}function Vu(ke){for(;ke._pendingPullIntos.length>0;){if(0===ke._queueTotalSize)return;const Ae=ke._pendingPullIntos.peek();Lu(ke,Ae)&&(Zu(ke),Fu(ke._controlledReadableByteStream,Ae))}}function $u(ke,Ae){const Ce=ke._pendingPullIntos.peek();if("closed"===ke._controlledReadableByteStream._state){if(0!==Ae)throw new TypeError("bytesWritten must be 0 when calling respond() on a closed stream");!function(ke,Ae){Ae.buffer=Ae.buffer;const Ce=ke._controlledReadableByteStream;if(nh(Ce))for(;ih(Ce)>0;)Fu(Ce,Zu(ke))}(ke,Ce)}else!function(ke,Ae,Ce){if(Ce.bytesFilled+Ae>Ce.byteLength)throw new RangeError("bytesWritten out of range");if(Wu(ke,Ae,Ce),Ce.bytesFilled0){const Ae=Ce.byteOffset+Ce.bytesFilled,qe=Ce.buffer.slice(Ae-ze,Ae);ju(ke,qe,0,qe.byteLength)}Ce.buffer=Ce.buffer,Ce.bytesFilled-=ze,Fu(ke._controlledReadableByteStream,Ce),Vu(ke)}(ke,Ae,Ce);Ou(ke)}function Zu(ke){const Ae=ke._pendingPullIntos.shift();return Gu(ke),Ae}function Yu(ke){ke._pullAlgorithm=void 0,ke._cancelAlgorithm=void 0}function Xu(ke,Ae){const Ce=ke._controlledReadableByteStream;"readable"===Ce._state&&(!function(ke){Gu(ke),ke._pendingPullIntos=new Hc}(ke),Iu(ke),Yu(ke),If(Ce,Ae))}function Qu(ke){const Ae=ke._controlledReadableByteStream._state;return"errored"===Ae?null:"closed"===Ae?0:ke._strategyHWM-ke._queueTotalSize}function Ju(ke,Ae,Ce){const ze=Object.create(Tu.prototype);let n=()=>{},a=()=>Uc(void 0),s=()=>Uc(void 0);void 0!==Ae.start&&(n=()=>Ae.start(ze)),void 0!==Ae.pull&&(a=()=>Ae.pull(ze)),void 0!==Ae.cancel&&(s=ke=>Ae.cancel(ke));const qe=Ae.autoAllocateChunkSize;if(0===qe)throw new TypeError("autoAllocateChunkSize must be greater than 0");!function(ke,Ae,Ce,ze,qe,Ve,tt){Ae._controlledReadableByteStream=ke,Ae._pullAgain=!1,Ae._pulling=!1,Ae._byobRequest=null,Ae._queue=Ae._queueTotalSize=void 0,Iu(Ae),Ae._closeRequested=!1,Ae._started=!1,Ae._strategyHWM=Ve,Ae._pullAlgorithm=ze,Ae._cancelAlgorithm=qe,Ae._autoAllocateChunkSize=tt,Ae._pendingPullIntos=new Hc,ke._readableStreamController=Ae,zc(Uc(Ce()),(()=>{Ae._started=!0,Ou(Ae)}),(ke=>{Xu(Ae,ke)}))}(ke,ze,n,a,s,Ce,qe)}function eh(ke){return new TypeError(`ReadableStreamBYOBRequest.prototype.${ke} can only be used on a ReadableStreamBYOBRequest`)}function th(ke){return new TypeError(`ReadableByteStreamController.prototype.${ke} can only be used on a ReadableByteStreamController`)}function rh(ke,Ae){ke._reader._readIntoRequests.push(Ae)}function ih(ke){return ke._reader._readIntoRequests.length}function nh(ke){const Ae=ke._reader;return void 0!==Ae&&!!sh(Ae)}Object.defineProperties(Tu.prototype,{close:{enumerable:!0},enqueue:{enumerable:!0},error:{enumerable:!0},byobRequest:{enumerable:!0},desiredSize:{enumerable:!0}}),"symbol"==typeof Nl.toStringTag&&Object.defineProperty(Tu.prototype,Nl.toStringTag,{value:"ReadableByteStreamController",configurable:!0});class ah{constructor(ke){if(uu(ke,1,"ReadableStreamBYOBReader"),pu(ke,"First parameter"),Kf(ke))throw new TypeError("This stream has already been locked for exclusive reading by another reader");if(!zu(ke._readableStreamController))throw new TypeError("Cannot construct a ReadableStreamBYOBReader for a stream not constructed with a byte source");Gc(this,ke),this._readIntoRequests=new Hc}get closed(){return sh(this)?this._closedPromise:Bc(oh("closed"))}cancel(ke){return sh(this)?void 0===this._ownerReadableStream?Bc(Zc("cancel")):Vc(this,ke):Bc(oh("cancel"))}read(ke){if(!sh(this))return Bc(oh("read"));if(!ArrayBuffer.isView(ke))return Bc(new TypeError("view must be an array buffer view"));if(0===ke.byteLength)return Bc(new TypeError("view must have non-zero byteLength"));if(0===ke.buffer.byteLength)return Bc(new TypeError("view's buffer must have non-zero byteLength"));if(void 0===this._ownerReadableStream)return Bc(Zc("read from"));let Ae,Ce;const ze=Ic(((ke,ze)=>{Ae=ke,Ce=ze}));return function(ke,Ae,Ce){const ze=ke._ownerReadableStream;ze._disturbed=!0,"errored"===ze._state?Ce._errorSteps(ze._storedError):function(ke,Ae,Ce){const ze=ke._controlledReadableByteStream;let qe=1;Ae.constructor!==DataView&&(qe=Ae.constructor.BYTES_PER_ELEMENT);const Ve=Ae.constructor,tt={buffer:Ae.buffer,byteOffset:Ae.byteOffset,byteLength:Ae.byteLength,bytesFilled:0,elementSize:qe,viewConstructor:Ve,readerType:"byob"};if(ke._pendingPullIntos.length>0)return ke._pendingPullIntos.push(tt),void rh(ze,Ce);if("closed"!==ze._state){if(ke._queueTotalSize>0){if(Lu(ke,tt)){const Ae=Nu(tt);return Hu(ke),void Ce._chunkSteps(Ae)}if(ke._closeRequested){const Ae=new TypeError("Insufficient bytes to fill elements in the given buffer");return Xu(ke,Ae),void Ce._errorSteps(Ae)}}ke._pendingPullIntos.push(tt),rh(ze,Ce),Ou(ke)}else{const ke=new Ve(tt.buffer,tt.byteOffset,0);Ce._closeSteps(ke)}}(ze._readableStreamController,Ae,Ce)}(this,ke,{_chunkSteps:ke=>Ae({value:ke,done:!1}),_closeSteps:ke=>Ae({value:ke,done:!0}),_errorSteps:ke=>Ce(ke)}),ze}releaseLock(){if(!sh(this))throw oh("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");$c(this)}}}function sh(ke){return!!xc(ke)&&!!Object.prototype.hasOwnProperty.call(ke,"_readIntoRequests")}function oh(ke){return new TypeError(`ReadableStreamBYOBReader.prototype.${ke} can only be used on a ReadableStreamBYOBReader`)}function ch(ke,Ae){const{highWaterMark:Ce}=ke;if(void 0===Ce)return Ae;if(wd(Ce)||Ce<0)throw new RangeError("Invalid highWaterMark");return Ce}function uh(ke){const{size:Ae}=ke;return Ae||(()=>1)}function hh(ke,Ae){su(ke,Ae);const Ce=null==ke?void 0:ke.highWaterMark,ze=null==ke?void 0:ke.size;return{highWaterMark:void 0===Ce?void 0:fu(Ce),size:void 0===ze?void 0:fh(ze,Ae+" has member 'size' that")}}function fh(ke,Ae){return ou(ke,Ae),Ae=>fu(ke(Ae))}function dh(ke,Ae,Ce){return ou(ke,Ce),Ce=>Wc(ke,Ae,[Ce])}function lh(ke,Ae,Ce){return ou(ke,Ce),()=>Wc(ke,Ae,[])}function ph(ke,Ae,Ce){return ou(ke,Ce),Ce=>Lc(ke,Ae,[Ce])}function yh(ke,Ae,Ce){return ou(ke,Ce),(Ce,ze)=>Wc(ke,Ae,[Ce,ze])}function bh(ke,Ae){if(!vh(ke))throw new TypeError(Ae+" is not a WritableStream.")}Object.defineProperties(ah.prototype,{cancel:{enumerable:!0},read:{enumerable:!0},releaseLock:{enumerable:!0},closed:{enumerable:!0}}),"symbol"==typeof Nl.toStringTag&&Object.defineProperty(ah.prototype,Nl.toStringTag,{value:"ReadableStreamBYOBReader",configurable:!0});class mh{constructor(ke={},Ae={}){void 0===ke?ke=null:cu(ke,"First parameter");const Ce=hh(Ae,"Second parameter"),ze=function(ke,Ae){su(ke,Ae);const Ce=null==ke?void 0:ke.abort,ze=null==ke?void 0:ke.close,qe=null==ke?void 0:ke.start,Ve=null==ke?void 0:ke.type,tt=null==ke?void 0:ke.write;return{abort:void 0===Ce?void 0:dh(Ce,ke,Ae+" has member 'abort' that"),close:void 0===ze?void 0:lh(ze,ke,Ae+" has member 'close' that"),start:void 0===qe?void 0:ph(qe,ke,Ae+" has member 'start' that"),write:void 0===tt?void 0:yh(tt,ke,Ae+" has member 'write' that"),type:Ve}}(ke,"First parameter");wh(this);if(void 0!==ze.type)throw new RangeError("Invalid type is specified");const qe=uh(Ce);!function(ke,Ae,Ce,ze){const qe=Object.create(qh.prototype);let a=()=>{},s=()=>Uc(void 0),o=()=>Uc(void 0),c=()=>Uc(void 0);void 0!==Ae.start&&(a=()=>Ae.start(qe));void 0!==Ae.write&&(s=ke=>Ae.write(ke,qe));void 0!==Ae.close&&(o=()=>Ae.close());void 0!==Ae.abort&&(c=ke=>Ae.abort(ke));Oh(ke,qe,a,s,o,c,Ce,ze)}(this,ze,ch(Ce,1),qe)}get locked(){if(!vh(this))throw Gh("locked");return _h(this)}abort(ke){return vh(this)?_h(this)?Bc(new TypeError("Cannot abort a stream that already has a writer")):kh(this,ke):Bc(Gh("abort"))}close(){return vh(this)?_h(this)?Bc(new TypeError("Cannot close a stream that already has a writer")):xh(this)?Bc(new TypeError("Cannot close an already-closing stream")):Ah(this):Bc(Gh("close"))}getWriter(){if(!vh(this))throw Gh("getWriter");return gh(this)}}function gh(ke){return new Kh(ke)}function wh(ke){ke._state="writable",ke._storedError=void 0,ke._writer=void 0,ke._writableStreamController=void 0,ke._writeRequests=new Hc,ke._inFlightWriteRequest=void 0,ke._closeRequest=void 0,ke._inFlightCloseRequest=void 0,ke._pendingAbortRequest=void 0,ke._backpressure=!1}function vh(ke){return!!xc(ke)&&!!Object.prototype.hasOwnProperty.call(ke,"_writableStreamController")}function _h(ke){return void 0!==ke._writer}function kh(ke,Ae){const Ce=ke._state;if("closed"===Ce||"errored"===Ce)return Uc(void 0);if(void 0!==ke._pendingAbortRequest)return ke._pendingAbortRequest._promise;let ze=!1;"erroring"===Ce&&(ze=!0,Ae=void 0);const qe=Ic(((Ce,qe)=>{ke._pendingAbortRequest={_promise:void 0,_resolve:Ce,_reject:qe,_reason:Ae,_wasAlreadyErroring:ze}}));return ke._pendingAbortRequest._promise=qe,ze||Eh(ke,Ae),qe}function Ah(ke){const Ae=ke._state;if("closed"===Ae||"errored"===Ae)return Bc(new TypeError(`The stream (in ${Ae} state) is not in the writable state and cannot be closed`));const Ce=Ic(((Ae,Ce)=>{const ze={_resolve:Ae,_reject:Ce};ke._closeRequest=ze})),ze=ke._writer;var qe;return void 0!==ze&&ke._backpressure&&"writable"===Ae&&nf(ze),Ru(qe=ke._writableStreamController,_d,0),jh(qe),Ce}function Sh(ke,Ae){"writable"!==ke._state?Ph(ke):Eh(ke,Ae)}function Eh(ke,Ae){const Ce=ke._writableStreamController;ke._state="erroring",ke._storedError=Ae;const ze=ke._writer;void 0!==ze&&Uh(ze,Ae),!function(ke){if(void 0===ke._inFlightWriteRequest&&void 0===ke._inFlightCloseRequest)return!1;return!0}(ke)&&Ce._started&&Ph(ke)}function Ph(ke){ke._state="errored",ke._writableStreamController[Zl]();const Ae=ke._storedError;if(ke._writeRequests.forEach((ke=>{ke._reject(Ae)})),ke._writeRequests=new Hc,void 0===ke._pendingAbortRequest)return void Mh(ke);const Ce=ke._pendingAbortRequest;if(ke._pendingAbortRequest=void 0,Ce._wasAlreadyErroring)return Ce._reject(Ae),void Mh(ke);zc(ke._writableStreamController[Vl](Ce._reason),(()=>{Ce._resolve(),Mh(ke)}),(Ae=>{Ce._reject(Ae),Mh(ke)}))}function xh(ke){return void 0!==ke._closeRequest||void 0!==ke._inFlightCloseRequest}function Mh(ke){void 0!==ke._closeRequest&&(ke._closeRequest._reject(ke._storedError),ke._closeRequest=void 0);const Ae=ke._writer;void 0!==Ae&&Xh(Ae,ke._storedError)}function Ch(ke,Ae){const Ce=ke._writer;void 0!==Ce&&Ae!==ke._backpressure&&(Ae?function(ke){Jh(ke)}(Ce):nf(Ce)),ke._backpressure=Ae}Object.defineProperties(mh.prototype,{abort:{enumerable:!0},close:{enumerable:!0},getWriter:{enumerable:!0},locked:{enumerable:!0}}),"symbol"==typeof Nl.toStringTag&&Object.defineProperty(mh.prototype,Nl.toStringTag,{value:"WritableStream",configurable:!0});class Kh{constructor(ke){if(uu(ke,1,"WritableStreamDefaultWriter"),bh(ke,"First parameter"),_h(ke))throw new TypeError("This stream has already been locked for exclusive writing by another writer");this._ownerWritableStream=ke,ke._writer=this;const Ae=ke._state;if("writable"===Ae)!xh(ke)&&ke._backpressure?Jh(this):tf(this),Zh(this);else if("erroring"===Ae)ef(this,ke._storedError),Zh(this);else if("closed"===Ae)tf(this),Zh(Ce=this),Qh(Ce);else{const Ae=ke._storedError;ef(this,Ae),Yh(this,Ae)}var Ce}get closed(){return Dh(this)?this._closedPromise:Bc(Vh("closed"))}get desiredSize(){if(!Dh(this))throw Vh("desiredSize");if(void 0===this._ownerWritableStream)throw $h("desiredSize");return function(ke){const Ae=ke._ownerWritableStream,Ce=Ae._state;if("errored"===Ce||"erroring"===Ce)return null;if("closed"===Ce)return 0;return Nh(Ae._writableStreamController)}(this)}get ready(){return Dh(this)?this._readyPromise:Bc(Vh("ready"))}abort(ke){return Dh(this)?void 0===this._ownerWritableStream?Bc($h("abort")):function(ke,Ae){return kh(ke._ownerWritableStream,Ae)}(this,ke):Bc(Vh("abort"))}close(){if(!Dh(this))return Bc(Vh("close"));const ke=this._ownerWritableStream;return void 0===ke?Bc($h("close")):xh(ke)?Bc(new TypeError("Cannot close an already-closing stream")):Rh(this)}releaseLock(){if(!Dh(this))throw Vh("releaseLock");void 0!==this._ownerWritableStream&&Bh(this)}write(ke){return Dh(this)?void 0===this._ownerWritableStream?Bc($h("write to")):Th(this,ke):Bc(Vh("write"))}}function Dh(ke){return!!xc(ke)&&!!Object.prototype.hasOwnProperty.call(ke,"_ownerWritableStream")}function Rh(ke){return Ah(ke._ownerWritableStream)}function Ih(ke,Ae){"pending"===ke._closedPromiseState?Xh(ke,Ae):function(ke,Ae){Yh(ke,Ae)}(ke,Ae)}function Uh(ke,Ae){"pending"===ke._readyPromiseState?rf(ke,Ae):function(ke,Ae){ef(ke,Ae)}(ke,Ae)}function Bh(ke){const Ae=ke._ownerWritableStream,Ce=new TypeError("Writer was released and can no longer be used to monitor the stream's closedness");Uh(ke,Ce),Ih(ke,Ce),Ae._writer=void 0,ke._ownerWritableStream=void 0}function Th(ke,Ae){const Ce=ke._ownerWritableStream,ze=Ce._writableStreamController,qe=function(ke,Ae){try{return ke._strategySizeAlgorithm(Ae)}catch(Ae){return Lh(ke,Ae),1}}(ze,Ae);if(Ce!==ke._ownerWritableStream)return Bc($h("write to"));const Ve=Ce._state;if("errored"===Ve)return Bc(Ce._storedError);if(xh(Ce)||"closed"===Ve)return Bc(new TypeError("The stream is closing or closed and cannot be written to"));if("erroring"===Ve)return Bc(Ce._storedError);const tt=function(ke){return Ic(((Ae,Ce)=>{const ze={_resolve:Ae,_reject:Ce};ke._writeRequests.push(ze)}))}(Ce);return function(ke,Ae,Ce){try{Ru(ke,Ae,Ce)}catch(Ae){return void Lh(ke,Ae)}const ze=ke._controlledWritableStream;if(!xh(ze)&&"writable"===ze._state){Ch(ze,Wh(ke))}jh(ke)}(ze,Ae,qe),tt}Object.defineProperties(Kh.prototype,{abort:{enumerable:!0},close:{enumerable:!0},releaseLock:{enumerable:!0},write:{enumerable:!0},closed:{enumerable:!0},desiredSize:{enumerable:!0},ready:{enumerable:!0}}),"symbol"==typeof Nl.toStringTag&&Object.defineProperty(Kh.prototype,Nl.toStringTag,{value:"WritableStreamDefaultWriter",configurable:!0});const _d={};class qh{constructor(){throw new TypeError("Illegal constructor")}error(ke){if(!function(ke){if(!xc(ke))return!1;if(!Object.prototype.hasOwnProperty.call(ke,"_controlledWritableStream"))return!1;return!0}(this))throw new TypeError("WritableStreamDefaultController.prototype.error can only be used on a WritableStreamDefaultController");"writable"===this._controlledWritableStream._state&&Hh(this,ke)}[Vl](ke){const Ae=this._abortAlgorithm(ke);return Fh(this),Ae}[Zl](){Iu(this)}}function Oh(ke,Ae,Ce,ze,qe,Ve,tt,rt){Ae._controlledWritableStream=ke,ke._writableStreamController=Ae,Ae._queue=void 0,Ae._queueTotalSize=void 0,Iu(Ae),Ae._started=!1,Ae._strategySizeAlgorithm=rt,Ae._strategyHWM=tt,Ae._writeAlgorithm=ze,Ae._closeAlgorithm=qe,Ae._abortAlgorithm=Ve;const it=Wh(Ae);Ch(ke,it);zc(Uc(Ce()),(()=>{Ae._started=!0,jh(Ae)}),(Ce=>{Ae._started=!0,Sh(ke,Ce)}))}function Fh(ke){ke._writeAlgorithm=void 0,ke._closeAlgorithm=void 0,ke._abortAlgorithm=void 0,ke._strategySizeAlgorithm=void 0}function Nh(ke){return ke._strategyHWM-ke._queueTotalSize}function jh(ke){const Ae=ke._controlledWritableStream;if(!ke._started)return;if(void 0!==Ae._inFlightWriteRequest)return;if("erroring"===Ae._state)return void Ph(Ae);if(0===ke._queue.length)return;const Ce=ke._queue.peek().value;Ce===_d?function(ke){const Ae=ke._controlledWritableStream;(function(ke){ke._inFlightCloseRequest=ke._closeRequest,ke._closeRequest=void 0})(Ae),Du(ke);const Ce=ke._closeAlgorithm();Fh(ke),zc(Ce,(()=>{!function(ke){ke._inFlightCloseRequest._resolve(void 0),ke._inFlightCloseRequest=void 0,"erroring"===ke._state&&(ke._storedError=void 0,void 0!==ke._pendingAbortRequest&&(ke._pendingAbortRequest._resolve(),ke._pendingAbortRequest=void 0)),ke._state="closed";const Ae=ke._writer;void 0!==Ae&&Qh(Ae)}(Ae)}),(ke=>{!function(ke,Ae){ke._inFlightCloseRequest._reject(Ae),ke._inFlightCloseRequest=void 0,void 0!==ke._pendingAbortRequest&&(ke._pendingAbortRequest._reject(Ae),ke._pendingAbortRequest=void 0),Sh(ke,Ae)}(Ae,ke)}))}(ke):function(ke,Ae){const Ce=ke._controlledWritableStream;!function(ke){ke._inFlightWriteRequest=ke._writeRequests.shift()}(Ce);zc(ke._writeAlgorithm(Ae),(()=>{!function(ke){ke._inFlightWriteRequest._resolve(void 0),ke._inFlightWriteRequest=void 0}(Ce);const Ae=Ce._state;if(Du(ke),!xh(Ce)&&"writable"===Ae){const Ae=Wh(ke);Ch(Ce,Ae)}jh(ke)}),(Ae=>{"writable"===Ce._state&&Fh(ke),function(ke,Ae){ke._inFlightWriteRequest._reject(Ae),ke._inFlightWriteRequest=void 0,Sh(ke,Ae)}(Ce,Ae)}))}(ke,Ce)}function Lh(ke,Ae){"writable"===ke._controlledWritableStream._state&&Hh(ke,Ae)}function Wh(ke){return Nh(ke)<=0}function Hh(ke,Ae){const Ce=ke._controlledWritableStream;Fh(ke),Eh(Ce,Ae)}function Gh(ke){return new TypeError(`WritableStream.prototype.${ke} can only be used on a WritableStream`)}function Vh(ke){return new TypeError(`WritableStreamDefaultWriter.prototype.${ke} can only be used on a WritableStreamDefaultWriter`)}function $h(ke){return new TypeError("Cannot "+ke+" a stream using a released writer")}function Zh(ke){ke._closedPromise=Ic(((Ae,Ce)=>{ke._closedPromise_resolve=Ae,ke._closedPromise_reject=Ce,ke._closedPromiseState="pending"}))}function Yh(ke,Ae){Zh(ke),Xh(ke,Ae)}function Xh(ke,Ae){void 0!==ke._closedPromise_reject&&(Nc(ke._closedPromise),ke._closedPromise_reject(Ae),ke._closedPromise_resolve=void 0,ke._closedPromise_reject=void 0,ke._closedPromiseState="rejected")}function Qh(ke){void 0!==ke._closedPromise_resolve&&(ke._closedPromise_resolve(void 0),ke._closedPromise_resolve=void 0,ke._closedPromise_reject=void 0,ke._closedPromiseState="resolved")}function Jh(ke){ke._readyPromise=Ic(((Ae,Ce)=>{ke._readyPromise_resolve=Ae,ke._readyPromise_reject=Ce})),ke._readyPromiseState="pending"}function ef(ke,Ae){Jh(ke),rf(ke,Ae)}function tf(ke){Jh(ke),nf(ke)}function rf(ke,Ae){void 0!==ke._readyPromise_reject&&(Nc(ke._readyPromise),ke._readyPromise_reject(Ae),ke._readyPromise_resolve=void 0,ke._readyPromise_reject=void 0,ke._readyPromiseState="rejected")}function nf(ke){void 0!==ke._readyPromise_resolve&&(ke._readyPromise_resolve(void 0),ke._readyPromise_resolve=void 0,ke._readyPromise_reject=void 0,ke._readyPromiseState="fulfilled")}Object.defineProperties(qh.prototype,{error:{enumerable:!0}}),"symbol"==typeof Nl.toStringTag&&Object.defineProperty(qh.prototype,Nl.toStringTag,{value:"WritableStreamDefaultController",configurable:!0});const Ad="undefined"!=typeof DOMException?DOMException:void 0;const Ed=function(ke){if("function"!=typeof ke&&"object"!=typeof ke)return!1;try{return new ke,!0}catch(ke){return!1}}(Ad)?Ad:function(){const e=function(ke,Ae){this.message=ke||"",this.name=Ae||"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 of(ke,Ae,Ce,ze,qe,Ve){const tt=yu(ke),rt=gh(Ae);ke._disturbed=!0;let it=!1,nt=Uc(void 0);return Ic(((ot,ct)=>{let ht;if(void 0!==Ve){if(ht=()=>{const Ce=new Ed("Aborted","AbortError"),Ve=[];ze||Ve.push((()=>"writable"===Ae._state?kh(Ae,Ce):Uc(void 0))),qe||Ve.push((()=>"readable"===ke._state?Df(ke,Ce):Uc(void 0))),y((()=>Promise.all(Ve.map((ke=>ke())))),!0,Ce)},Ve.aborted)return void ht();Ve.addEventListener("abort",ht)}if(p(ke,tt._closedPromise,(ke=>{ze?b(!0,ke):y((()=>kh(Ae,ke)),!0,ke)})),p(Ae,rt._closedPromise,(Ae=>{qe?b(!0,Ae):y((()=>Df(ke,Ae)),!0,Ae)})),function(ke,Ae,Ce){"closed"===ke._state?Ce():qc(Ae,Ce)}(ke,tt._closedPromise,(()=>{Ce?b():y((()=>function(ke){const Ae=ke._ownerWritableStream,Ce=Ae._state;return xh(Ae)||"closed"===Ce?Uc(void 0):"errored"===Ce?Bc(Ae._storedError):Rh(ke)}(rt)))})),xh(Ae)||"closed"===Ae._state){const Ae=new TypeError("the destination writable stream closed before all data could be piped to it");qe?b(!0,Ae):y((()=>Df(ke,Ae)),!0,Ae)}function l(){const ke=nt;return Tc(nt,(()=>ke!==nt?l():void 0))}function p(ke,Ae,Ce){"errored"===ke._state?Ce(ke._storedError):Oc(Ae,Ce)}function y(ke,Ce,ze){function n(){zc(ke(),(()=>m(Ce,ze)),(ke=>m(!0,ke)))}it||(it=!0,"writable"!==Ae._state||xh(Ae)?n():qc(l(),n))}function b(ke,Ce){it||(it=!0,"writable"!==Ae._state||xh(Ae)?m(ke,Ce):qc(l(),(()=>m(ke,Ce))))}function m(ke,Ae){Bh(rt),$c(tt),void 0!==Ve&&Ve.removeEventListener("abort",ht),ke?ct(Ae):ot(void 0)}Nc(Ic(((ke,Ae)=>{!function r(Ce){Ce?ke():Tc(it?Uc(!0):Tc(rt._readyPromise,(()=>Ic(((ke,Ae)=>{ku(tt,{_chunkSteps:Ae=>{nt=Tc(Th(rt,Ae),void 0,Ec),ke(!1)},_closeSteps:()=>ke(!0),_errorSteps:Ae})})))),r,Ae)}(!1)})))}))}class cf{constructor(){throw new TypeError("Illegal constructor")}get desiredSize(){if(!uf(this))throw wf("desiredSize");return bf(this)}close(){if(!uf(this))throw wf("close");if(!mf(this))throw new TypeError("The stream is not in a state that permits close");lf(this)}enqueue(ke){if(!uf(this))throw wf("enqueue");if(!mf(this))throw new TypeError("The stream is not in a state that permits enqueue");return pf(this,ke)}error(ke){if(!uf(this))throw wf("error");yf(this,ke)}[Xl](ke){Iu(this);const Ae=this._cancelAlgorithm(ke);return df(this),Ae}[Jl](ke){const Ae=this._controlledReadableStream;if(this._queue.length>0){const Ce=Du(this);this._closeRequested&&0===this._queue.length?(df(this),Rf(Ae)):hf(this),ke._chunkSteps(Ce)}else bu(Ae,ke),hf(this)}}function uf(ke){return!!xc(ke)&&!!Object.prototype.hasOwnProperty.call(ke,"_controlledReadableStream")}function hf(ke){if(!ff(ke))return;if(ke._pulling)return void(ke._pullAgain=!0);ke._pulling=!0;zc(ke._pullAlgorithm(),(()=>{ke._pulling=!1,ke._pullAgain&&(ke._pullAgain=!1,hf(ke))}),(Ae=>{yf(ke,Ae)}))}function ff(ke){const Ae=ke._controlledReadableStream;if(!mf(ke))return!1;if(!ke._started)return!1;if(Kf(Ae)&&gu(Ae)>0)return!0;return bf(ke)>0}function df(ke){ke._pullAlgorithm=void 0,ke._cancelAlgorithm=void 0,ke._strategySizeAlgorithm=void 0}function lf(ke){if(!mf(ke))return;const Ae=ke._controlledReadableStream;ke._closeRequested=!0,0===ke._queue.length&&(df(ke),Rf(Ae))}function pf(ke,Ae){if(!mf(ke))return;const Ce=ke._controlledReadableStream;if(Kf(Ce)&&gu(Ce)>0)mu(Ce,Ae,!1);else{let Ce;try{Ce=ke._strategySizeAlgorithm(Ae)}catch(Ae){throw yf(ke,Ae),Ae}try{Ru(ke,Ae,Ce)}catch(Ae){throw yf(ke,Ae),Ae}}hf(ke)}function yf(ke,Ae){const Ce=ke._controlledReadableStream;"readable"===Ce._state&&(Iu(ke),df(ke),If(Ce,Ae))}function bf(ke){const Ae=ke._controlledReadableStream._state;return"errored"===Ae?null:"closed"===Ae?0:ke._strategyHWM-ke._queueTotalSize}function mf(ke){const Ae=ke._controlledReadableStream._state;return!ke._closeRequested&&"readable"===Ae}function gf(ke,Ae,Ce,ze,qe,Ve,tt){Ae._controlledReadableStream=ke,Ae._queue=void 0,Ae._queueTotalSize=void 0,Iu(Ae),Ae._started=!1,Ae._closeRequested=!1,Ae._pullAgain=!1,Ae._pulling=!1,Ae._strategySizeAlgorithm=tt,Ae._strategyHWM=Ve,Ae._pullAlgorithm=ze,Ae._cancelAlgorithm=qe,ke._readableStreamController=Ae;zc(Uc(Ce()),(()=>{Ae._started=!0,hf(Ae)}),(ke=>{yf(Ae,ke)}))}function wf(ke){return new TypeError(`ReadableStreamDefaultController.prototype.${ke} can only be used on a ReadableStreamDefaultController`)}function vf(ke,Ae,Ce){return ou(ke,Ce),Ce=>Wc(ke,Ae,[Ce])}function _f(ke,Ae,Ce){return ou(ke,Ce),Ce=>Wc(ke,Ae,[Ce])}function kf(ke,Ae,Ce){return ou(ke,Ce),Ce=>Lc(ke,Ae,[Ce])}function Af(ke,Ae){if("bytes"!==(ke=""+ke))throw new TypeError(`${Ae} '${ke}' is not a valid enumeration value for ReadableStreamType`);return ke}function Sf(ke,Ae){if("byob"!==(ke=""+ke))throw new TypeError(`${Ae} '${ke}' is not a valid enumeration value for ReadableStreamReaderMode`);return ke}function Ef(ke,Ae){su(ke,Ae);const Ce=null==ke?void 0:ke.preventAbort,ze=null==ke?void 0:ke.preventCancel,qe=null==ke?void 0:ke.preventClose,Ve=null==ke?void 0:ke.signal;return void 0!==Ve&&function(ke,Ae){if(!function(ke){if("object"!=typeof ke||null===ke)return!1;try{return"boolean"==typeof ke.aborted}catch(ke){return!1}}(ke))throw new TypeError(Ae+" is not an AbortSignal.")}(Ve,Ae+" has member 'signal' that"),{preventAbort:!!Ce,preventCancel:!!ze,preventClose:!!qe,signal:Ve}}Object.defineProperties(cf.prototype,{close:{enumerable:!0},enqueue:{enumerable:!0},error:{enumerable:!0},desiredSize:{enumerable:!0}}),"symbol"==typeof Nl.toStringTag&&Object.defineProperty(cf.prototype,Nl.toStringTag,{value:"ReadableStreamDefaultController",configurable:!0});class Pf{constructor(ke={},Ae={}){void 0===ke?ke=null:cu(ke,"First parameter");const Ce=hh(Ae,"Second parameter"),ze=function(ke,Ae){su(ke,Ae);const Ce=ke,ze=null==Ce?void 0:Ce.autoAllocateChunkSize,qe=null==Ce?void 0:Ce.cancel,Ve=null==Ce?void 0:Ce.pull,tt=null==Ce?void 0:Ce.start,rt=null==Ce?void 0:Ce.type;return{autoAllocateChunkSize:void 0===ze?void 0:lu(ze,Ae+" has member 'autoAllocateChunkSize' that"),cancel:void 0===qe?void 0:vf(qe,Ce,Ae+" has member 'cancel' that"),pull:void 0===Ve?void 0:_f(Ve,Ce,Ae+" has member 'pull' that"),start:void 0===tt?void 0:kf(tt,Ce,Ae+" has member 'start' that"),type:void 0===rt?void 0:Af(rt,Ae+" has member 'type' that")}}(ke,"First parameter");if(Mf(this),"bytes"===ze.type){if(void 0!==Ce.size)throw new RangeError("The strategy for a byte stream cannot have a size function");Ju(this,ze,ch(Ce,0))}else{const ke=uh(Ce);!function(ke,Ae,Ce,ze){const qe=Object.create(cf.prototype);let a=()=>{},s=()=>Uc(void 0),o=()=>Uc(void 0);void 0!==Ae.start&&(a=()=>Ae.start(qe)),void 0!==Ae.pull&&(s=()=>Ae.pull(qe)),void 0!==Ae.cancel&&(o=ke=>Ae.cancel(ke)),gf(ke,qe,a,s,o,Ce,ze)}(this,ze,ch(Ce,1),ke)}}get locked(){if(!Cf(this))throw Uf("locked");return Kf(this)}cancel(ke){return Cf(this)?Kf(this)?Bc(new TypeError("Cannot cancel a stream that already has a reader")):Df(this,ke):Bc(Uf("cancel"))}getReader(ke){if(!Cf(this))throw Uf("getReader");return void 0===function(ke,Ae){su(ke,Ae);const Ce=null==ke?void 0:ke.mode;return{mode:void 0===Ce?void 0:Sf(Ce,Ae+" has member 'mode' that")}}(ke,"First parameter").mode?yu(this):function(ke){return new ah(ke)}(this)}pipeThrough(ke,Ae={}){if(!Cf(this))throw Uf("pipeThrough");uu(ke,1,"pipeThrough");const Ce=function(ke,Ae){su(ke,Ae);const Ce=null==ke?void 0:ke.readable;hu(Ce,"readable","ReadableWritablePair"),pu(Ce,Ae+" has member 'readable' that");const ze=null==ke?void 0:ke.writable;return hu(ze,"writable","ReadableWritablePair"),bh(ze,Ae+" has member 'writable' that"),{readable:Ce,writable:ze}}(ke,"First parameter"),ze=Ef(Ae,"Second parameter");if(Kf(this))throw new TypeError("ReadableStream.prototype.pipeThrough cannot be used on a locked ReadableStream");if(_h(Ce.writable))throw new TypeError("ReadableStream.prototype.pipeThrough cannot be used on a locked WritableStream");return Nc(of(this,Ce.writable,ze.preventClose,ze.preventAbort,ze.preventCancel,ze.signal)),Ce.readable}pipeTo(ke,Ae={}){if(!Cf(this))return Bc(Uf("pipeTo"));if(void 0===ke)return Bc("Parameter 1 is required in 'pipeTo'.");if(!vh(ke))return Bc(new TypeError("ReadableStream.prototype.pipeTo's first argument must be a WritableStream"));let Ce;try{Ce=Ef(Ae,"Second parameter")}catch(ke){return Bc(ke)}return Kf(this)?Bc(new TypeError("ReadableStream.prototype.pipeTo cannot be used on a locked ReadableStream")):_h(ke)?Bc(new TypeError("ReadableStream.prototype.pipeTo cannot be used on a locked WritableStream")):of(this,ke,Ce.preventClose,Ce.preventAbort,Ce.preventCancel,Ce.signal)}tee(){if(!Cf(this))throw Uf("tee");const ke=function(ke,Ae){const Ce=yu(ke);let ze,qe,Ve,tt,rt,it=!1,nt=!1,ot=!1;const ct=Ic((ke=>{rt=ke}));function d(){return it||(it=!0,ku(Ce,{_chunkSteps:ke=>{$l((()=>{it=!1;const Ae=ke,Ce=ke;nt||pf(Ve._readableStreamController,Ae),ot||pf(tt._readableStreamController,Ce)}))},_closeSteps:()=>{it=!1,nt||lf(Ve._readableStreamController),ot||lf(tt._readableStreamController),nt&&ot||rt(void 0)},_errorSteps:()=>{it=!1}})),Uc(void 0)}function l(){}return Ve=xf(l,d,(function(Ae){if(nt=!0,ze=Ae,ot){const Ae=Uu([ze,qe]),Ce=Df(ke,Ae);rt(Ce)}return ct})),tt=xf(l,d,(function(Ae){if(ot=!0,qe=Ae,nt){const Ae=Uu([ze,qe]),Ce=Df(ke,Ae);rt(Ce)}return ct})),Oc(Ce._closedPromise,(ke=>{yf(Ve._readableStreamController,ke),yf(tt._readableStreamController,ke),nt&&ot||rt(void 0)})),[Ve,tt]}(this);return Uu(ke)}values(ke){if(!Cf(this))throw Uf("values");return function(ke,Ae){const Ce=yu(ke),ze=new Eu(Ce,Ae),qe=Object.create(gd);return qe._asyncIteratorImpl=ze,qe}(this,function(ke,Ae){return su(ke,Ae),{preventCancel:!!(null==ke?void 0:ke.preventCancel)}}(ke,"First parameter").preventCancel)}}function xf(ke,Ae,Ce,ze=1,qe=(()=>1)){const Ve=Object.create(Pf.prototype);Mf(Ve);return gf(Ve,Object.create(cf.prototype),ke,Ae,Ce,ze,qe),Ve}function Mf(ke){ke._state="readable",ke._reader=void 0,ke._storedError=void 0,ke._disturbed=!1}function Cf(ke){return!!xc(ke)&&!!Object.prototype.hasOwnProperty.call(ke,"_readableStreamController")}function Kf(ke){return void 0!==ke._reader}function Df(ke,Ae){if(ke._disturbed=!0,"closed"===ke._state)return Uc(void 0);if("errored"===ke._state)return Bc(ke._storedError);Rf(ke);return Fc(ke._readableStreamController[Xl](Ae),Ec)}function Rf(ke){ke._state="closed";const Ae=ke._reader;void 0!==Ae&&(Jc(Ae),_u(Ae)&&(Ae._readRequests.forEach((ke=>{ke._closeSteps()})),Ae._readRequests=new Hc))}function If(ke,Ae){ke._state="errored",ke._storedError=Ae;const Ce=ke._reader;void 0!==Ce&&(Qc(Ce,Ae),_u(Ce)?(Ce._readRequests.forEach((ke=>{ke._errorSteps(Ae)})),Ce._readRequests=new Hc):(Ce._readIntoRequests.forEach((ke=>{ke._errorSteps(Ae)})),Ce._readIntoRequests=new Hc))}function Uf(ke){return new TypeError(`ReadableStream.prototype.${ke} can only be used on a ReadableStream`)}function Bf(ke,Ae){su(ke,Ae);const Ce=null==ke?void 0:ke.highWaterMark;return hu(Ce,"highWaterMark","QueuingStrategyInit"),{highWaterMark:fu(Ce)}}Object.defineProperties(Pf.prototype,{cancel:{enumerable:!0},getReader:{enumerable:!0},pipeThrough:{enumerable:!0},pipeTo:{enumerable:!0},tee:{enumerable:!0},values:{enumerable:!0},locked:{enumerable:!0}}),"symbol"==typeof Nl.toStringTag&&Object.defineProperty(Pf.prototype,Nl.toStringTag,{value:"ReadableStream",configurable:!0}),"symbol"==typeof Nl.asyncIterator&&Object.defineProperty(Pf.prototype,Nl.asyncIterator,{value:Pf.prototype.values,writable:!0,configurable:!0});const Tf=function(ke){return ke.byteLength};class zf{constructor(ke){uu(ke,1,"ByteLengthQueuingStrategy"),ke=Bf(ke,"First parameter"),this._byteLengthQueuingStrategyHighWaterMark=ke.highWaterMark}get highWaterMark(){if(!Of(this))throw qf("highWaterMark");return this._byteLengthQueuingStrategyHighWaterMark}get size(){if(!Of(this))throw qf("size");return Tf}}function qf(ke){return new TypeError(`ByteLengthQueuingStrategy.prototype.${ke} can only be used on a ByteLengthQueuingStrategy`)}function Of(ke){return!!xc(ke)&&!!Object.prototype.hasOwnProperty.call(ke,"_byteLengthQueuingStrategyHighWaterMark")}Object.defineProperties(zf.prototype,{highWaterMark:{enumerable:!0},size:{enumerable:!0}}),"symbol"==typeof Nl.toStringTag&&Object.defineProperty(zf.prototype,Nl.toStringTag,{value:"ByteLengthQueuingStrategy",configurable:!0});const Ff=function(){return 1};class Nf{constructor(ke){uu(ke,1,"CountQueuingStrategy"),ke=Bf(ke,"First parameter"),this._countQueuingStrategyHighWaterMark=ke.highWaterMark}get highWaterMark(){if(!Lf(this))throw jf("highWaterMark");return this._countQueuingStrategyHighWaterMark}get size(){if(!Lf(this))throw jf("size");return Ff}}function jf(ke){return new TypeError(`CountQueuingStrategy.prototype.${ke} can only be used on a CountQueuingStrategy`)}function Lf(ke){return!!xc(ke)&&!!Object.prototype.hasOwnProperty.call(ke,"_countQueuingStrategyHighWaterMark")}function Wf(ke,Ae,Ce){return ou(ke,Ce),Ce=>Wc(ke,Ae,[Ce])}function Hf(ke,Ae,Ce){return ou(ke,Ce),Ce=>Lc(ke,Ae,[Ce])}function Gf(ke,Ae,Ce){return ou(ke,Ce),(Ce,ze)=>Wc(ke,Ae,[Ce,ze])}Object.defineProperties(Nf.prototype,{highWaterMark:{enumerable:!0},size:{enumerable:!0}}),"symbol"==typeof Nl.toStringTag&&Object.defineProperty(Nf.prototype,Nl.toStringTag,{value:"CountQueuingStrategy",configurable:!0});class Vf{constructor(ke={},Ae={},Ce={}){void 0===ke&&(ke=null);const ze=hh(Ae,"Second parameter"),qe=hh(Ce,"Third parameter"),Ve=function(ke,Ae){su(ke,Ae);const Ce=null==ke?void 0:ke.flush,ze=null==ke?void 0:ke.readableType,qe=null==ke?void 0:ke.start,Ve=null==ke?void 0:ke.transform,tt=null==ke?void 0:ke.writableType;return{flush:void 0===Ce?void 0:Wf(Ce,ke,Ae+" has member 'flush' that"),readableType:ze,start:void 0===qe?void 0:Hf(qe,ke,Ae+" has member 'start' that"),transform:void 0===Ve?void 0:Gf(Ve,ke,Ae+" has member 'transform' that"),writableType:tt}}(ke,"First parameter");if(void 0!==Ve.readableType)throw new RangeError("Invalid readableType specified");if(void 0!==Ve.writableType)throw new RangeError("Invalid writableType specified");const tt=ch(qe,0),rt=uh(qe),it=ch(ze,1),nt=uh(ze);let ot;!function(ke,Ae,Ce,ze,qe,Ve){function s(){return Ae}function o(Ae){return function(ke,Ae){const Ce=ke._transformStreamController;if(ke._backpressure){return Fc(ke._backpressureChangePromise,(()=>{const ze=ke._writable;if("erroring"===ze._state)throw ze._storedError;return rd(Ce,Ae)}))}return rd(Ce,Ae)}(ke,Ae)}function c(Ae){return function(ke,Ae){return Zf(ke,Ae),Uc(void 0)}(ke,Ae)}function u(){return function(ke){const Ae=ke._readable,Ce=ke._transformStreamController,ze=Ce._flushAlgorithm();return ed(Ce),Fc(ze,(()=>{if("errored"===Ae._state)throw Ae._storedError;lf(Ae._readableStreamController)}),(Ce=>{throw Zf(ke,Ce),Ae._storedError}))}(ke)}function h(){return function(ke){return Xf(ke,!1),ke._backpressureChangePromise}(ke)}function f(Ae){return Yf(ke,Ae),Uc(void 0)}ke._writable=function(ke,Ae,Ce,ze,qe=1,Ve=(()=>1)){const tt=Object.create(mh.prototype);return wh(tt),Oh(tt,Object.create(qh.prototype),ke,Ae,Ce,ze,qe,Ve),tt}(s,o,u,c,Ce,ze),ke._readable=xf(s,h,f,qe,Ve),ke._backpressure=void 0,ke._backpressureChangePromise=void 0,ke._backpressureChangePromise_resolve=void 0,Xf(ke,!0),ke._transformStreamController=void 0}(this,Ic((ke=>{ot=ke})),it,nt,tt,rt),function(ke,Ae){const Ce=Object.create(Qf.prototype);let i=ke=>{try{return td(Ce,ke),Uc(void 0)}catch(ke){return Bc(ke)}},n=()=>Uc(void 0);void 0!==Ae.transform&&(i=ke=>Ae.transform(ke,Ce));void 0!==Ae.flush&&(n=()=>Ae.flush(Ce));!function(ke,Ae,Ce,ze){Ae._controlledTransformStream=ke,ke._transformStreamController=Ae,Ae._transformAlgorithm=Ce,Ae._flushAlgorithm=ze}(ke,Ce,i,n)}(this,Ve),void 0!==Ve.start?ot(Ve.start(this._transformStreamController)):ot(void 0)}get readable(){if(!$f(this))throw nd("readable");return this._readable}get writable(){if(!$f(this))throw nd("writable");return this._writable}}function $f(ke){return!!xc(ke)&&!!Object.prototype.hasOwnProperty.call(ke,"_transformStreamController")}function Zf(ke,Ae){yf(ke._readable._readableStreamController,Ae),Yf(ke,Ae)}function Yf(ke,Ae){ed(ke._transformStreamController),Lh(ke._writable._writableStreamController,Ae),ke._backpressure&&Xf(ke,!1)}function Xf(ke,Ae){void 0!==ke._backpressureChangePromise&&ke._backpressureChangePromise_resolve(),ke._backpressureChangePromise=Ic((Ae=>{ke._backpressureChangePromise_resolve=Ae})),ke._backpressure=Ae}Object.defineProperties(Vf.prototype,{readable:{enumerable:!0},writable:{enumerable:!0}}),"symbol"==typeof Nl.toStringTag&&Object.defineProperty(Vf.prototype,Nl.toStringTag,{value:"TransformStream",configurable:!0});class Qf{constructor(){throw new TypeError("Illegal constructor")}get desiredSize(){if(!Jf(this))throw id("desiredSize");return bf(this._controlledTransformStream._readable._readableStreamController)}enqueue(ke){if(!Jf(this))throw id("enqueue");td(this,ke)}error(ke){if(!Jf(this))throw id("error");var Ae;Ae=ke,Zf(this._controlledTransformStream,Ae)}terminate(){if(!Jf(this))throw id("terminate");!function(ke){const Ae=ke._controlledTransformStream;lf(Ae._readable._readableStreamController);Yf(Ae,new TypeError("TransformStream terminated"))}(this)}}function Jf(ke){return!!xc(ke)&&!!Object.prototype.hasOwnProperty.call(ke,"_controlledTransformStream")}function ed(ke){ke._transformAlgorithm=void 0,ke._flushAlgorithm=void 0}function td(ke,Ae){const Ce=ke._controlledTransformStream,ze=Ce._readable._readableStreamController;if(!mf(ze))throw new TypeError("Readable side is not in a state that permits enqueue");try{pf(ze,Ae)}catch(ke){throw Yf(Ce,ke),Ce._readable._storedError}(function(ke){return!ff(ke)})(ze)!==Ce._backpressure&&Xf(Ce,!0)}function rd(ke,Ae){return Fc(ke._transformAlgorithm(Ae),void 0,(Ae=>{throw Zf(ke._controlledTransformStream,Ae),Ae}))}function id(ke){return new TypeError(`TransformStreamDefaultController.prototype.${ke} can only be used on a TransformStreamDefaultController`)}function nd(ke){return new TypeError(`TransformStream.prototype.${ke} can only be used on a TransformStream`)}Object.defineProperties(Qf.prototype,{enqueue:{enumerable:!0},error:{enumerable:!0},terminate:{enumerable:!0},desiredSize:{enumerable:!0}}),"symbol"==typeof Nl.toStringTag&&Object.defineProperty(Qf.prototype,Nl.toStringTag,{value:"TransformStreamDefaultController",configurable:!0});var Md=Object.freeze({__proto__:null,ByteLengthQueuingStrategy:zf,CountQueuingStrategy:Nf,ReadableByteStreamController:Tu,ReadableStream:Pf,ReadableStreamBYOBReader:ah,ReadableStreamBYOBRequest:Bu,ReadableStreamDefaultController:cf,ReadableStreamDefaultReader:vu,TransformStream:Vf,TransformStreamDefaultController:Qf,WritableStream:mh,WritableStreamDefaultController:qh,WritableStreamDefaultWriter:Kh}),sd=function(ke,Ae){return(sd=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(ke,Ae){ke.__proto__=Ae}||function(ke,Ae){for(var Ce in Ae)Object.prototype.hasOwnProperty.call(Ae,Ce)&&(ke[Ce]=Ae[Ce])})(ke,Ae)}; /*! ***************************************************************************** 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 od(ke,Ae){if("function"!=typeof Ae&&null!==Ae)throw new TypeError("Class extends value "+Ae+" is not a constructor or null");function r(){this.constructor=ke}sd(ke,Ae),ke.prototype=null===Ae?Object.create(Ae):(r.prototype=Ae.prototype,new r)}function cd(ke){if(!ke)throw new TypeError("Assertion failed")}function ud(){}function hd(ke){return"object"==typeof ke&&null!==ke||"function"==typeof ke}function fd(ke){if("function"!=typeof ke)return!1;var Ae=!1;try{new ke({start:function(){Ae=!0}})}catch(ke){}return Ae}function dd(ke){return!!hd(ke)&&"function"==typeof ke.getReader}function ld(ke){return!!hd(ke)&&"function"==typeof ke.getWriter}function pd(ke){return!!hd(ke)&&(!!dd(ke.readable)&&!!ld(ke.writable))}function yd(ke){try{return ke.getReader({mode:"byob"}).releaseLock(),!0}catch(ke){return!1}}function bd(ke,Ae){var Ce=(void 0===Ae?{}:Ae).type;return cd(dd(ke)),cd(!1===ke.locked),"bytes"===(Ce=md(Ce))?new Dd(ke):new Pd(ke)}function md(ke){var Ae=ke+"";if("bytes"===Ae)return Ae;if(void 0===ke)return ke;throw new RangeError("Invalid type is specified")}var xd=function(){function e(ke){this._underlyingReader=void 0,this._readerMode=void 0,this._readableStreamController=void 0,this._pendingRead=void 0,this._underlyingStream=ke,this._attachDefaultReader()}return e.prototype.start=function(ke){this._readableStreamController=ke},e.prototype.cancel=function(ke){return cd(void 0!==this._underlyingReader),this._underlyingReader.cancel(ke)},e.prototype._attachDefaultReader=function(){if("default"!==this._readerMode){this._detachReader();var ke=this._underlyingStream.getReader();this._readerMode="default",this._attachReader(ke)}},e.prototype._attachReader=function(ke){var Ae=this;cd(void 0===this._underlyingReader),this._underlyingReader=ke;var Ce=this._underlyingReader.closed;Ce&&Ce.then((function(){return Ae._finishPendingRead()})).then((function(){ke===Ae._underlyingReader&&Ae._readableStreamController.close()}),(function(Ce){ke===Ae._underlyingReader&&Ae._readableStreamController.error(Ce)})).catch(ud)},e.prototype._detachReader=function(){void 0!==this._underlyingReader&&(this._underlyingReader.releaseLock(),this._underlyingReader=void 0,this._readerMode=void 0)},e.prototype._pullWithDefaultReader=function(){var ke=this;this._attachDefaultReader();var Ae=this._underlyingReader.read().then((function(Ae){var Ce=ke._readableStreamController;Ae.done?ke._tryClose():Ce.enqueue(Ae.value)}));return this._setPendingRead(Ae),Ae},e.prototype._tryClose=function(){try{this._readableStreamController.close()}catch(ke){}},e.prototype._setPendingRead=function(ke){var Ae,Ce=this,i=function(){Ce._pendingRead===Ae&&(Ce._pendingRead=void 0)};this._pendingRead=Ae=ke.then(i,i)},e.prototype._finishPendingRead=function(){var ke=this;if(this._pendingRead){var t=function(){return ke._finishPendingRead()};return this._pendingRead.then(t,t)}},e}(),Pd=function(ke){function t(){return null!==ke&&ke.apply(this,arguments)||this}return od(t,ke),t.prototype.pull=function(){return this._pullWithDefaultReader()},t}(xd);function vd(ke){return new Uint8Array(ke.buffer,ke.byteOffset,ke.byteLength)}var Dd=function(ke){function t(Ae){var Ce=this,ze=yd(Ae);return(Ce=ke.call(this,Ae)||this)._supportsByob=ze,Ce}return od(t,ke),Object.defineProperty(t.prototype,"type",{get:function(){return"bytes"},enumerable:!1,configurable:!0}),t.prototype._attachByobReader=function(){if("byob"!==this._readerMode){cd(this._supportsByob),this._detachReader();var ke=this._underlyingStream.getReader({mode:"byob"});this._readerMode="byob",this._attachReader(ke)}},t.prototype.pull=function(){if(this._supportsByob){var ke=this._readableStreamController.byobRequest;if(ke)return this._pullWithByobRequest(ke)}return this._pullWithDefaultReader()},t.prototype._pullWithByobRequest=function(ke){var Ae=this;this._attachByobReader();var Ce=new Uint8Array(ke.view.byteLength),ze=this._underlyingReader.read(Ce).then((function(Ce){var ze,qe,Ve;Ae._readableStreamController,Ce.done?(Ae._tryClose(),ke.respond(0)):(ze=Ce.value,qe=ke.view,Ve=vd(ze),vd(qe).set(Ve,0),ke.respond(Ce.value.byteLength))}));return this._setPendingRead(ze),ze},t}(xd);function kd(ke){cd(ld(ke)),cd(!1===ke.locked);var Ae=ke.getWriter();return new Rd(Ae)}var Rd=function(){function e(ke){var Ae=this;this._writableStreamController=void 0,this._pendingWrite=void 0,this._state="writable",this._storedError=void 0,this._underlyingWriter=ke,this._errorPromise=new Promise((function(ke,Ce){Ae._errorPromiseReject=Ce})),this._errorPromise.catch(ud)}return e.prototype.start=function(ke){var Ae=this;this._writableStreamController=ke,this._underlyingWriter.closed.then((function(){Ae._state="closed"})).catch((function(ke){return Ae._finishErroring(ke)}))},e.prototype.write=function(ke){var Ae=this,Ce=this._underlyingWriter;if(null===Ce.desiredSize)return Ce.ready;var ze=Ce.write(ke);ze.catch((function(ke){return Ae._finishErroring(ke)})),Ce.ready.catch((function(ke){return Ae._startErroring(ke)}));var qe=Promise.race([ze,this._errorPromise]);return this._setPendingWrite(qe),qe},e.prototype.close=function(){var ke=this;return void 0===this._pendingWrite?this._underlyingWriter.close():this._finishPendingWrite().then((function(){return ke.close()}))},e.prototype.abort=function(ke){if("errored"!==this._state)return this._underlyingWriter.abort(ke)},e.prototype._setPendingWrite=function(ke){var Ae,Ce=this,i=function(){Ce._pendingWrite===Ae&&(Ce._pendingWrite=void 0)};this._pendingWrite=Ae=ke.then(i,i)},e.prototype._finishPendingWrite=function(){var ke=this;if(void 0===this._pendingWrite)return Promise.resolve();var t=function(){return ke._finishPendingWrite()};return this._pendingWrite.then(t,t)},e.prototype._startErroring=function(ke){var Ae=this;if("writable"===this._state){this._state="erroring",this._storedError=ke;var r=function(){return Ae._finishErroring(ke)};void 0===this._pendingWrite?r():this._finishPendingWrite().then(r,r),this._writableStreamController.error(ke)}},e.prototype._finishErroring=function(ke){"writable"===this._state&&this._startErroring(ke),"erroring"===this._state&&(this._state="errored",this._errorPromiseReject(this._storedError))},e}();function Sd(ke){cd(pd(ke));var Ae=ke.readable,Ce=ke.writable;cd(!1===Ae.locked),cd(!1===Ce.locked);var ze,qe=Ae.getReader();try{ze=Ce.getWriter()}catch(ke){throw qe.releaseLock(),ke}return new Td(qe,ze)}var Td=function(){function e(ke,Ae){var Ce=this;this._transformStreamController=void 0,this._onRead=function(ke){if(!ke.done)return Ce._transformStreamController.enqueue(ke.value),Ce._reader.read().then(Ce._onRead)},this._onError=function(ke){Ce._flushReject(ke),Ce._transformStreamController.error(ke),Ce._reader.cancel(ke).catch(ud),Ce._writer.abort(ke).catch(ud)},this._onTerminate=function(){Ce._flushResolve(),Ce._transformStreamController.terminate();var ke=new TypeError("TransformStream terminated");Ce._writer.abort(ke).catch(ud)},this._reader=ke,this._writer=Ae,this._flushPromise=new Promise((function(ke,Ae){Ce._flushResolve=ke,Ce._flushReject=Ae}))}return e.prototype.start=function(ke){this._transformStreamController=ke,this._reader.read().then(this._onRead).then(this._onTerminate,this._onError);var Ae=this._reader.closed;Ae&&Ae.then(this._onTerminate,this._onError)},e.prototype.transform=function(ke){return this._writer.write(ke)},e.prototype.flush=function(){var ke=this;return this._writer.close().then((function(){return ke._flushPromise}))},e}(),Kd=Object.freeze({__proto__:null,createReadableStreamWrapper:function(ke){cd(function(ke){return!!fd(ke)&&!!dd(new ke)}(ke));var Ae=function(ke){try{return new ke({type:"bytes"}),!0}catch(ke){return!1}}(ke);return function(Ce,ze){var qe=(void 0===ze?{}:ze).type;if("bytes"!==(qe=md(qe))||Ae||(qe=void 0),Ce.constructor===ke&&("bytes"!==qe||yd(Ce)))return Ce;if("bytes"===qe){var Ve=bd(Ce,{type:qe});return new ke(Ve)}Ve=bd(Ce);return new ke(Ve)}},createTransformStreamWrapper:function(ke){return cd(function(ke){return!!fd(ke)&&!!pd(new ke)}(ke)),function(Ae){if(Ae.constructor===ke)return Ae;var Ce=Sd(Ae);return new ke(Ce)}},createWrappingReadableSource:bd,createWrappingTransformer:Sd,createWrappingWritableSink:kd,createWritableStreamWrapper:function(ke){return cd(function(ke){return!!fd(ke)&&!!ld(new ke)}(ke)),function(Ae){if(Ae.constructor===ke)return Ae;var Ce=kd(Ae);return new ke(Ce)}}}),Id=bt((function(ke){!function(ke,Ae){function r(ke,Ae){if(!ke)throw Error(Ae||"Assertion failed")}function i(ke,Ae){ke.super_=Ae;var r=function(){};r.prototype=Ae.prototype,ke.prototype=new r,ke.prototype.constructor=ke}function n(ke,Ae,Ce){if(n.isBN(ke))return ke;this.negative=0,this.words=null,this.length=0,this.red=null,null!==ke&&("le"!==Ae&&"be"!==Ae||(Ce=Ae,Ae=10),this._init(ke||0,Ae||10,Ce||"be"))}var Ce;"object"==typeof ke?ke.exports=n:Ae.BN=n,n.BN=n,n.wordSize=26;try{Ce=ct.default.Buffer}catch(ke){}function s(ke,Ae,Ce){for(var ze=0,qe=Math.min(ke.length,Ce),Ve=Ae;Ve=49&&tt<=54?tt-49+10:tt>=17&&tt<=22?tt-17+10:15&tt}return ze}function o(ke,Ae,Ce,ze){for(var qe=0,Ve=Math.min(ke.length,Ce),tt=Ae;tt=49?rt-49+10:rt>=17?rt-17+10:rt}return qe}n.isBN=function(ke){return ke instanceof n||null!==ke&&"object"==typeof ke&&ke.constructor.wordSize===n.wordSize&&Array.isArray(ke.words)},n.max=function(ke,Ae){return ke.cmp(Ae)>0?ke:Ae},n.min=function(ke,Ae){return ke.cmp(Ae)<0?ke:Ae},n.prototype._init=function(ke,Ae,Ce){if("number"==typeof ke)return this._initNumber(ke,Ae,Ce);if("object"==typeof ke)return this._initArray(ke,Ae,Ce);"hex"===Ae&&(Ae=16),r(Ae===(0|Ae)&&Ae>=2&&Ae<=36);var ze=0;"-"===(ke=ke.toString().replace(/\s+/g,""))[0]&&ze++,16===Ae?this._parseHex(ke,ze):this._parseBase(ke,Ae,ze),"-"===ke[0]&&(this.negative=1),this.strip(),"le"===Ce&&this._initArray(this.toArray(),Ae,Ce)},n.prototype._initNumber=function(ke,Ae,Ce){ke<0&&(this.negative=1,ke=-ke),ke<67108864?(this.words=[67108863&ke],this.length=1):ke<4503599627370496?(this.words=[67108863&ke,ke/67108864&67108863],this.length=2):(r(ke<9007199254740992),this.words=[67108863&ke,ke/67108864&67108863,1],this.length=3),"le"===Ce&&this._initArray(this.toArray(),Ae,Ce)},n.prototype._initArray=function(ke,Ae,Ce){if(r("number"==typeof ke.length),ke.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(ke.length/3),this.words=Array(this.length);for(var ze=0;ze=0;ze-=3)Ve=ke[ze]|ke[ze-1]<<8|ke[ze-2]<<16,this.words[qe]|=Ve<>>26-tt&67108863,(tt+=24)>=26&&(tt-=26,qe++);else if("le"===Ce)for(ze=0,qe=0;ze>>26-tt&67108863,(tt+=24)>=26&&(tt-=26,qe++);return this.strip()},n.prototype._parseHex=function(ke,Ae){this.length=Math.ceil((ke.length-Ae)/6),this.words=Array(this.length);for(var Ce=0;Ce=Ae;Ce-=6)qe=s(ke,Ce,Ce+6),this.words[ze]|=qe<>>26-Ve&4194303,(Ve+=24)>=26&&(Ve-=26,ze++);Ce+6!==Ae&&(qe=s(ke,Ae,Ce+6),this.words[ze]|=qe<>>26-Ve&4194303),this.strip()},n.prototype._parseBase=function(ke,Ae,Ce){this.words=[0],this.length=1;for(var ze=0,qe=1;qe<=67108863;qe*=Ae)ze++;ze--,qe=qe/Ae|0;for(var Ve=ke.length-Ce,tt=Ve%ze,rt=Math.min(Ve,Ve-tt)+Ce,it=0,nt=Ce;nt1&&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 ze=["","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"],qe=[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],Ve=[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 d(ke,Ae,Ce){Ce.negative=Ae.negative^ke.negative;var ze=ke.length+Ae.length|0;Ce.length=ze,ze=ze-1|0;var qe=0|ke.words[0],Ve=0|Ae.words[0],tt=qe*Ve,rt=67108863&tt,it=tt/67108864|0;Ce.words[0]=rt;for(var nt=1;nt>>26,ct=67108863&it,ht=Math.min(nt,Ae.length-1),ft=Math.max(0,nt-ke.length+1);ft<=ht;ft++){var yt=nt-ft|0;ot+=(tt=(qe=0|ke.words[yt])*(Ve=0|Ae.words[ft])+ct)/67108864|0,ct=67108863&tt}Ce.words[nt]=0|ct,it=0|ot}return 0!==it?Ce.words[nt]=0|it:Ce.length--,Ce.strip()}n.prototype.toString=function(ke,Ae){var Ce;if(Ae=0|Ae||1,16===(ke=ke||10)||"hex"===ke){Ce="";for(var tt=0,rt=0,it=0;it>>24-tt&16777215)||it!==this.length-1?ze[6-ot.length]+ot+Ce:ot+Ce,(tt+=2)>=26&&(tt-=26,it--)}for(0!==rt&&(Ce=rt.toString(16)+Ce);Ce.length%Ae!=0;)Ce="0"+Ce;return 0!==this.negative&&(Ce="-"+Ce),Ce}if(ke===(0|ke)&&ke>=2&&ke<=36){var ct=qe[ke],ht=Ve[ke];Ce="";var ft=this.clone();for(ft.negative=0;!ft.isZero();){var yt=ft.modn(ht).toString(ke);Ce=(ft=ft.idivn(ht)).isZero()?yt+Ce:ze[ct-yt.length]+yt+Ce}for(this.isZero()&&(Ce="0"+Ce);Ce.length%Ae!=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 ke=this.words[0];return 2===this.length?ke+=67108864*this.words[1]:3===this.length&&1===this.words[2]?ke+=4503599627370496+67108864*this.words[1]:this.length>2&&r(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-ke:ke},n.prototype.toJSON=function(){return this.toString(16)},n.prototype.toBuffer=function(ke,Ae){return r(void 0!==Ce),this.toArrayLike(Ce,ke,Ae)},n.prototype.toArray=function(ke,Ae){return this.toArrayLike(Array,ke,Ae)},n.prototype.toArrayLike=function(ke,Ae,Ce){var ze=this.byteLength(),qe=Ce||Math.max(1,ze);r(ze<=qe,"byte array longer than desired length"),r(qe>0,"Requested array length <= 0"),this.strip();var Ve,tt,rt="le"===Ae,it=new ke(qe),nt=this.clone();if(rt){for(tt=0;!nt.isZero();tt++)Ve=nt.andln(255),nt.iushrn(8),it[tt]=Ve;for(;tt=4096&&(Ce+=13,Ae>>>=13),Ae>=64&&(Ce+=7,Ae>>>=7),Ae>=8&&(Ce+=4,Ae>>>=4),Ae>=2&&(Ce+=2,Ae>>>=2),Ce+Ae},n.prototype._zeroBits=function(ke){if(0===ke)return 26;var Ae=ke,Ce=0;return 0==(8191&Ae)&&(Ce+=13,Ae>>>=13),0==(127&Ae)&&(Ce+=7,Ae>>>=7),0==(15&Ae)&&(Ce+=4,Ae>>>=4),0==(3&Ae)&&(Ce+=2,Ae>>>=2),0==(1&Ae)&&Ce++,Ce},n.prototype.bitLength=function(){var ke=this.words[this.length-1],Ae=this._countBits(ke);return 26*(this.length-1)+Ae},n.prototype.zeroBits=function(){if(this.isZero())return 0;for(var ke=0,Ae=0;Aeke.length?this.clone().ior(ke):ke.clone().ior(this)},n.prototype.uor=function(ke){return this.length>ke.length?this.clone().iuor(ke):ke.clone().iuor(this)},n.prototype.iuand=function(ke){var Ae;Ae=this.length>ke.length?ke:this;for(var Ce=0;Ceke.length?this.clone().iand(ke):ke.clone().iand(this)},n.prototype.uand=function(ke){return this.length>ke.length?this.clone().iuand(ke):ke.clone().iuand(this)},n.prototype.iuxor=function(ke){var Ae,Ce;this.length>ke.length?(Ae=this,Ce=ke):(Ae=ke,Ce=this);for(var ze=0;zeke.length?this.clone().ixor(ke):ke.clone().ixor(this)},n.prototype.uxor=function(ke){return this.length>ke.length?this.clone().iuxor(ke):ke.clone().iuxor(this)},n.prototype.inotn=function(ke){r("number"==typeof ke&&ke>=0);var Ae=0|Math.ceil(ke/26),Ce=ke%26;this._expand(Ae),Ce>0&&Ae--;for(var ze=0;ze0&&(this.words[ze]=~this.words[ze]&67108863>>26-Ce),this.strip()},n.prototype.notn=function(ke){return this.clone().inotn(ke)},n.prototype.setn=function(ke,Ae){r("number"==typeof ke&&ke>=0);var Ce=ke/26|0,ze=ke%26;return this._expand(Ce+1),this.words[Ce]=Ae?this.words[Ce]|1<ke.length?(Ce=this,ze=ke):(Ce=ke,ze=this);for(var qe=0,Ve=0;Ve>>26;for(;0!==qe&&Ve>>26;if(this.length=Ce.length,0!==qe)this.words[this.length]=qe,this.length++;else if(Ce!==this)for(;Veke.length?this.clone().iadd(ke):ke.clone().iadd(this)},n.prototype.isub=function(ke){if(0!==ke.negative){ke.negative=0;var Ae=this.iadd(ke);return ke.negative=1,Ae._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(ke),this.negative=1,this._normSign();var Ce,ze,qe=this.cmp(ke);if(0===qe)return this.negative=0,this.length=1,this.words[0]=0,this;qe>0?(Ce=this,ze=ke):(Ce=ke,ze=this);for(var Ve=0,tt=0;tt>26,this.words[tt]=67108863&Ae;for(;0!==Ve&&tt>26,this.words[tt]=67108863&Ae;if(0===Ve&&tt>>13,ft=0|tt[1],yt=8191&ft,mt=ft>>>13,kt=0|tt[2],St=8191&kt,Et=kt>>>13,Pt=0|tt[3],Bt=8191&Pt,Dt=Pt>>>13,Rt=0|tt[4],Tt=8191&Rt,Kt=Rt>>>13,It=0|tt[5],Ut=8191&It,Ot=It>>>13,Nt=0|tt[6],zt=8191&Nt,qt=Nt>>>13,Ft=0|tt[7],Lt=8191&Ft,Ht=Ft>>>13,Gt=0|tt[8],$t=8191&Gt,Vt=Gt>>>13,Zt=0|tt[9],Xt=8191&Zt,Jt=Zt>>>13,Yt=0|rt[0],Qt=8191&Yt,er=Yt>>>13,tr=0|rt[1],rr=8191&tr,ir=tr>>>13,nr=0|rt[2],sr=8191&nr,vr=nr>>>13,_r=0|rt[3],kr=8191&_r,Ar=_r>>>13,Sr=0|rt[4],Er=8191&Sr,xr=Sr>>>13,Br=0|rt[5],Dr=8191&Br,Rr=Br>>>13,Ir=0|rt[6],Ur=8191&Ir,Lr=Ir>>>13,Gr=0|rt[7],Vr=8191&Gr,Xr=Gr>>>13,Qr=0|rt[8],ei=8191&Qr,ti=Qr>>>13,ni=0|rt[9],ai=8191&ni,ci=ni>>>13;Ce.negative=ke.negative^Ae.negative,Ce.length=19;var ui=(nt+(ze=Math.imul(ct,Qt))|0)+((8191&(qe=(qe=Math.imul(ct,er))+Math.imul(ht,Qt)|0))<<13)|0;nt=((Ve=Math.imul(ht,er))+(qe>>>13)|0)+(ui>>>26)|0,ui&=67108863,ze=Math.imul(yt,Qt),qe=(qe=Math.imul(yt,er))+Math.imul(mt,Qt)|0,Ve=Math.imul(mt,er);var li=(nt+(ze=ze+Math.imul(ct,rr)|0)|0)+((8191&(qe=(qe=qe+Math.imul(ct,ir)|0)+Math.imul(ht,rr)|0))<<13)|0;nt=((Ve=Ve+Math.imul(ht,ir)|0)+(qe>>>13)|0)+(li>>>26)|0,li&=67108863,ze=Math.imul(St,Qt),qe=(qe=Math.imul(St,er))+Math.imul(Et,Qt)|0,Ve=Math.imul(Et,er),ze=ze+Math.imul(yt,rr)|0,qe=(qe=qe+Math.imul(yt,ir)|0)+Math.imul(mt,rr)|0,Ve=Ve+Math.imul(mt,ir)|0;var pi=(nt+(ze=ze+Math.imul(ct,sr)|0)|0)+((8191&(qe=(qe=qe+Math.imul(ct,vr)|0)+Math.imul(ht,sr)|0))<<13)|0;nt=((Ve=Ve+Math.imul(ht,vr)|0)+(qe>>>13)|0)+(pi>>>26)|0,pi&=67108863,ze=Math.imul(Bt,Qt),qe=(qe=Math.imul(Bt,er))+Math.imul(Dt,Qt)|0,Ve=Math.imul(Dt,er),ze=ze+Math.imul(St,rr)|0,qe=(qe=qe+Math.imul(St,ir)|0)+Math.imul(Et,rr)|0,Ve=Ve+Math.imul(Et,ir)|0,ze=ze+Math.imul(yt,sr)|0,qe=(qe=qe+Math.imul(yt,vr)|0)+Math.imul(mt,sr)|0,Ve=Ve+Math.imul(mt,vr)|0;var yi=(nt+(ze=ze+Math.imul(ct,kr)|0)|0)+((8191&(qe=(qe=qe+Math.imul(ct,Ar)|0)+Math.imul(ht,kr)|0))<<13)|0;nt=((Ve=Ve+Math.imul(ht,Ar)|0)+(qe>>>13)|0)+(yi>>>26)|0,yi&=67108863,ze=Math.imul(Tt,Qt),qe=(qe=Math.imul(Tt,er))+Math.imul(Kt,Qt)|0,Ve=Math.imul(Kt,er),ze=ze+Math.imul(Bt,rr)|0,qe=(qe=qe+Math.imul(Bt,ir)|0)+Math.imul(Dt,rr)|0,Ve=Ve+Math.imul(Dt,ir)|0,ze=ze+Math.imul(St,sr)|0,qe=(qe=qe+Math.imul(St,vr)|0)+Math.imul(Et,sr)|0,Ve=Ve+Math.imul(Et,vr)|0,ze=ze+Math.imul(yt,kr)|0,qe=(qe=qe+Math.imul(yt,Ar)|0)+Math.imul(mt,kr)|0,Ve=Ve+Math.imul(mt,Ar)|0;var mi=(nt+(ze=ze+Math.imul(ct,Er)|0)|0)+((8191&(qe=(qe=qe+Math.imul(ct,xr)|0)+Math.imul(ht,Er)|0))<<13)|0;nt=((Ve=Ve+Math.imul(ht,xr)|0)+(qe>>>13)|0)+(mi>>>26)|0,mi&=67108863,ze=Math.imul(Ut,Qt),qe=(qe=Math.imul(Ut,er))+Math.imul(Ot,Qt)|0,Ve=Math.imul(Ot,er),ze=ze+Math.imul(Tt,rr)|0,qe=(qe=qe+Math.imul(Tt,ir)|0)+Math.imul(Kt,rr)|0,Ve=Ve+Math.imul(Kt,ir)|0,ze=ze+Math.imul(Bt,sr)|0,qe=(qe=qe+Math.imul(Bt,vr)|0)+Math.imul(Dt,sr)|0,Ve=Ve+Math.imul(Dt,vr)|0,ze=ze+Math.imul(St,kr)|0,qe=(qe=qe+Math.imul(St,Ar)|0)+Math.imul(Et,kr)|0,Ve=Ve+Math.imul(Et,Ar)|0,ze=ze+Math.imul(yt,Er)|0,qe=(qe=qe+Math.imul(yt,xr)|0)+Math.imul(mt,Er)|0,Ve=Ve+Math.imul(mt,xr)|0;var gi=(nt+(ze=ze+Math.imul(ct,Dr)|0)|0)+((8191&(qe=(qe=qe+Math.imul(ct,Rr)|0)+Math.imul(ht,Dr)|0))<<13)|0;nt=((Ve=Ve+Math.imul(ht,Rr)|0)+(qe>>>13)|0)+(gi>>>26)|0,gi&=67108863,ze=Math.imul(zt,Qt),qe=(qe=Math.imul(zt,er))+Math.imul(qt,Qt)|0,Ve=Math.imul(qt,er),ze=ze+Math.imul(Ut,rr)|0,qe=(qe=qe+Math.imul(Ut,ir)|0)+Math.imul(Ot,rr)|0,Ve=Ve+Math.imul(Ot,ir)|0,ze=ze+Math.imul(Tt,sr)|0,qe=(qe=qe+Math.imul(Tt,vr)|0)+Math.imul(Kt,sr)|0,Ve=Ve+Math.imul(Kt,vr)|0,ze=ze+Math.imul(Bt,kr)|0,qe=(qe=qe+Math.imul(Bt,Ar)|0)+Math.imul(Dt,kr)|0,Ve=Ve+Math.imul(Dt,Ar)|0,ze=ze+Math.imul(St,Er)|0,qe=(qe=qe+Math.imul(St,xr)|0)+Math.imul(Et,Er)|0,Ve=Ve+Math.imul(Et,xr)|0,ze=ze+Math.imul(yt,Dr)|0,qe=(qe=qe+Math.imul(yt,Rr)|0)+Math.imul(mt,Dr)|0,Ve=Ve+Math.imul(mt,Rr)|0;var bi=(nt+(ze=ze+Math.imul(ct,Ur)|0)|0)+((8191&(qe=(qe=qe+Math.imul(ct,Lr)|0)+Math.imul(ht,Ur)|0))<<13)|0;nt=((Ve=Ve+Math.imul(ht,Lr)|0)+(qe>>>13)|0)+(bi>>>26)|0,bi&=67108863,ze=Math.imul(Lt,Qt),qe=(qe=Math.imul(Lt,er))+Math.imul(Ht,Qt)|0,Ve=Math.imul(Ht,er),ze=ze+Math.imul(zt,rr)|0,qe=(qe=qe+Math.imul(zt,ir)|0)+Math.imul(qt,rr)|0,Ve=Ve+Math.imul(qt,ir)|0,ze=ze+Math.imul(Ut,sr)|0,qe=(qe=qe+Math.imul(Ut,vr)|0)+Math.imul(Ot,sr)|0,Ve=Ve+Math.imul(Ot,vr)|0,ze=ze+Math.imul(Tt,kr)|0,qe=(qe=qe+Math.imul(Tt,Ar)|0)+Math.imul(Kt,kr)|0,Ve=Ve+Math.imul(Kt,Ar)|0,ze=ze+Math.imul(Bt,Er)|0,qe=(qe=qe+Math.imul(Bt,xr)|0)+Math.imul(Dt,Er)|0,Ve=Ve+Math.imul(Dt,xr)|0,ze=ze+Math.imul(St,Dr)|0,qe=(qe=qe+Math.imul(St,Rr)|0)+Math.imul(Et,Dr)|0,Ve=Ve+Math.imul(Et,Rr)|0,ze=ze+Math.imul(yt,Ur)|0,qe=(qe=qe+Math.imul(yt,Lr)|0)+Math.imul(mt,Ur)|0,Ve=Ve+Math.imul(mt,Lr)|0;var vi=(nt+(ze=ze+Math.imul(ct,Vr)|0)|0)+((8191&(qe=(qe=qe+Math.imul(ct,Xr)|0)+Math.imul(ht,Vr)|0))<<13)|0;nt=((Ve=Ve+Math.imul(ht,Xr)|0)+(qe>>>13)|0)+(vi>>>26)|0,vi&=67108863,ze=Math.imul($t,Qt),qe=(qe=Math.imul($t,er))+Math.imul(Vt,Qt)|0,Ve=Math.imul(Vt,er),ze=ze+Math.imul(Lt,rr)|0,qe=(qe=qe+Math.imul(Lt,ir)|0)+Math.imul(Ht,rr)|0,Ve=Ve+Math.imul(Ht,ir)|0,ze=ze+Math.imul(zt,sr)|0,qe=(qe=qe+Math.imul(zt,vr)|0)+Math.imul(qt,sr)|0,Ve=Ve+Math.imul(qt,vr)|0,ze=ze+Math.imul(Ut,kr)|0,qe=(qe=qe+Math.imul(Ut,Ar)|0)+Math.imul(Ot,kr)|0,Ve=Ve+Math.imul(Ot,Ar)|0,ze=ze+Math.imul(Tt,Er)|0,qe=(qe=qe+Math.imul(Tt,xr)|0)+Math.imul(Kt,Er)|0,Ve=Ve+Math.imul(Kt,xr)|0,ze=ze+Math.imul(Bt,Dr)|0,qe=(qe=qe+Math.imul(Bt,Rr)|0)+Math.imul(Dt,Dr)|0,Ve=Ve+Math.imul(Dt,Rr)|0,ze=ze+Math.imul(St,Ur)|0,qe=(qe=qe+Math.imul(St,Lr)|0)+Math.imul(Et,Ur)|0,Ve=Ve+Math.imul(Et,Lr)|0,ze=ze+Math.imul(yt,Vr)|0,qe=(qe=qe+Math.imul(yt,Xr)|0)+Math.imul(mt,Vr)|0,Ve=Ve+Math.imul(mt,Xr)|0;var wi=(nt+(ze=ze+Math.imul(ct,ei)|0)|0)+((8191&(qe=(qe=qe+Math.imul(ct,ti)|0)+Math.imul(ht,ei)|0))<<13)|0;nt=((Ve=Ve+Math.imul(ht,ti)|0)+(qe>>>13)|0)+(wi>>>26)|0,wi&=67108863,ze=Math.imul(Xt,Qt),qe=(qe=Math.imul(Xt,er))+Math.imul(Jt,Qt)|0,Ve=Math.imul(Jt,er),ze=ze+Math.imul($t,rr)|0,qe=(qe=qe+Math.imul($t,ir)|0)+Math.imul(Vt,rr)|0,Ve=Ve+Math.imul(Vt,ir)|0,ze=ze+Math.imul(Lt,sr)|0,qe=(qe=qe+Math.imul(Lt,vr)|0)+Math.imul(Ht,sr)|0,Ve=Ve+Math.imul(Ht,vr)|0,ze=ze+Math.imul(zt,kr)|0,qe=(qe=qe+Math.imul(zt,Ar)|0)+Math.imul(qt,kr)|0,Ve=Ve+Math.imul(qt,Ar)|0,ze=ze+Math.imul(Ut,Er)|0,qe=(qe=qe+Math.imul(Ut,xr)|0)+Math.imul(Ot,Er)|0,Ve=Ve+Math.imul(Ot,xr)|0,ze=ze+Math.imul(Tt,Dr)|0,qe=(qe=qe+Math.imul(Tt,Rr)|0)+Math.imul(Kt,Dr)|0,Ve=Ve+Math.imul(Kt,Rr)|0,ze=ze+Math.imul(Bt,Ur)|0,qe=(qe=qe+Math.imul(Bt,Lr)|0)+Math.imul(Dt,Ur)|0,Ve=Ve+Math.imul(Dt,Lr)|0,ze=ze+Math.imul(St,Vr)|0,qe=(qe=qe+Math.imul(St,Xr)|0)+Math.imul(Et,Vr)|0,Ve=Ve+Math.imul(Et,Xr)|0,ze=ze+Math.imul(yt,ei)|0,qe=(qe=qe+Math.imul(yt,ti)|0)+Math.imul(mt,ei)|0,Ve=Ve+Math.imul(mt,ti)|0;var Ei=(nt+(ze=ze+Math.imul(ct,ai)|0)|0)+((8191&(qe=(qe=qe+Math.imul(ct,ci)|0)+Math.imul(ht,ai)|0))<<13)|0;nt=((Ve=Ve+Math.imul(ht,ci)|0)+(qe>>>13)|0)+(Ei>>>26)|0,Ei&=67108863,ze=Math.imul(Xt,rr),qe=(qe=Math.imul(Xt,ir))+Math.imul(Jt,rr)|0,Ve=Math.imul(Jt,ir),ze=ze+Math.imul($t,sr)|0,qe=(qe=qe+Math.imul($t,vr)|0)+Math.imul(Vt,sr)|0,Ve=Ve+Math.imul(Vt,vr)|0,ze=ze+Math.imul(Lt,kr)|0,qe=(qe=qe+Math.imul(Lt,Ar)|0)+Math.imul(Ht,kr)|0,Ve=Ve+Math.imul(Ht,Ar)|0,ze=ze+Math.imul(zt,Er)|0,qe=(qe=qe+Math.imul(zt,xr)|0)+Math.imul(qt,Er)|0,Ve=Ve+Math.imul(qt,xr)|0,ze=ze+Math.imul(Ut,Dr)|0,qe=(qe=qe+Math.imul(Ut,Rr)|0)+Math.imul(Ot,Dr)|0,Ve=Ve+Math.imul(Ot,Rr)|0,ze=ze+Math.imul(Tt,Ur)|0,qe=(qe=qe+Math.imul(Tt,Lr)|0)+Math.imul(Kt,Ur)|0,Ve=Ve+Math.imul(Kt,Lr)|0,ze=ze+Math.imul(Bt,Vr)|0,qe=(qe=qe+Math.imul(Bt,Xr)|0)+Math.imul(Dt,Vr)|0,Ve=Ve+Math.imul(Dt,Xr)|0,ze=ze+Math.imul(St,ei)|0,qe=(qe=qe+Math.imul(St,ti)|0)+Math.imul(Et,ei)|0,Ve=Ve+Math.imul(Et,ti)|0;var Mi=(nt+(ze=ze+Math.imul(yt,ai)|0)|0)+((8191&(qe=(qe=qe+Math.imul(yt,ci)|0)+Math.imul(mt,ai)|0))<<13)|0;nt=((Ve=Ve+Math.imul(mt,ci)|0)+(qe>>>13)|0)+(Mi>>>26)|0,Mi&=67108863,ze=Math.imul(Xt,sr),qe=(qe=Math.imul(Xt,vr))+Math.imul(Jt,sr)|0,Ve=Math.imul(Jt,vr),ze=ze+Math.imul($t,kr)|0,qe=(qe=qe+Math.imul($t,Ar)|0)+Math.imul(Vt,kr)|0,Ve=Ve+Math.imul(Vt,Ar)|0,ze=ze+Math.imul(Lt,Er)|0,qe=(qe=qe+Math.imul(Lt,xr)|0)+Math.imul(Ht,Er)|0,Ve=Ve+Math.imul(Ht,xr)|0,ze=ze+Math.imul(zt,Dr)|0,qe=(qe=qe+Math.imul(zt,Rr)|0)+Math.imul(qt,Dr)|0,Ve=Ve+Math.imul(qt,Rr)|0,ze=ze+Math.imul(Ut,Ur)|0,qe=(qe=qe+Math.imul(Ut,Lr)|0)+Math.imul(Ot,Ur)|0,Ve=Ve+Math.imul(Ot,Lr)|0,ze=ze+Math.imul(Tt,Vr)|0,qe=(qe=qe+Math.imul(Tt,Xr)|0)+Math.imul(Kt,Vr)|0,Ve=Ve+Math.imul(Kt,Xr)|0,ze=ze+Math.imul(Bt,ei)|0,qe=(qe=qe+Math.imul(Bt,ti)|0)+Math.imul(Dt,ei)|0,Ve=Ve+Math.imul(Dt,ti)|0;var xi=(nt+(ze=ze+Math.imul(St,ai)|0)|0)+((8191&(qe=(qe=qe+Math.imul(St,ci)|0)+Math.imul(Et,ai)|0))<<13)|0;nt=((Ve=Ve+Math.imul(Et,ci)|0)+(qe>>>13)|0)+(xi>>>26)|0,xi&=67108863,ze=Math.imul(Xt,kr),qe=(qe=Math.imul(Xt,Ar))+Math.imul(Jt,kr)|0,Ve=Math.imul(Jt,Ar),ze=ze+Math.imul($t,Er)|0,qe=(qe=qe+Math.imul($t,xr)|0)+Math.imul(Vt,Er)|0,Ve=Ve+Math.imul(Vt,xr)|0,ze=ze+Math.imul(Lt,Dr)|0,qe=(qe=qe+Math.imul(Lt,Rr)|0)+Math.imul(Ht,Dr)|0,Ve=Ve+Math.imul(Ht,Rr)|0,ze=ze+Math.imul(zt,Ur)|0,qe=(qe=qe+Math.imul(zt,Lr)|0)+Math.imul(qt,Ur)|0,Ve=Ve+Math.imul(qt,Lr)|0,ze=ze+Math.imul(Ut,Vr)|0,qe=(qe=qe+Math.imul(Ut,Xr)|0)+Math.imul(Ot,Vr)|0,Ve=Ve+Math.imul(Ot,Xr)|0,ze=ze+Math.imul(Tt,ei)|0,qe=(qe=qe+Math.imul(Tt,ti)|0)+Math.imul(Kt,ei)|0,Ve=Ve+Math.imul(Kt,ti)|0;var Pi=(nt+(ze=ze+Math.imul(Bt,ai)|0)|0)+((8191&(qe=(qe=qe+Math.imul(Bt,ci)|0)+Math.imul(Dt,ai)|0))<<13)|0;nt=((Ve=Ve+Math.imul(Dt,ci)|0)+(qe>>>13)|0)+(Pi>>>26)|0,Pi&=67108863,ze=Math.imul(Xt,Er),qe=(qe=Math.imul(Xt,xr))+Math.imul(Jt,Er)|0,Ve=Math.imul(Jt,xr),ze=ze+Math.imul($t,Dr)|0,qe=(qe=qe+Math.imul($t,Rr)|0)+Math.imul(Vt,Dr)|0,Ve=Ve+Math.imul(Vt,Rr)|0,ze=ze+Math.imul(Lt,Ur)|0,qe=(qe=qe+Math.imul(Lt,Lr)|0)+Math.imul(Ht,Ur)|0,Ve=Ve+Math.imul(Ht,Lr)|0,ze=ze+Math.imul(zt,Vr)|0,qe=(qe=qe+Math.imul(zt,Xr)|0)+Math.imul(qt,Vr)|0,Ve=Ve+Math.imul(qt,Xr)|0,ze=ze+Math.imul(Ut,ei)|0,qe=(qe=qe+Math.imul(Ut,ti)|0)+Math.imul(Ot,ei)|0,Ve=Ve+Math.imul(Ot,ti)|0;var Ci=(nt+(ze=ze+Math.imul(Tt,ai)|0)|0)+((8191&(qe=(qe=qe+Math.imul(Tt,ci)|0)+Math.imul(Kt,ai)|0))<<13)|0;nt=((Ve=Ve+Math.imul(Kt,ci)|0)+(qe>>>13)|0)+(Ci>>>26)|0,Ci&=67108863,ze=Math.imul(Xt,Dr),qe=(qe=Math.imul(Xt,Rr))+Math.imul(Jt,Dr)|0,Ve=Math.imul(Jt,Rr),ze=ze+Math.imul($t,Ur)|0,qe=(qe=qe+Math.imul($t,Lr)|0)+Math.imul(Vt,Ur)|0,Ve=Ve+Math.imul(Vt,Lr)|0,ze=ze+Math.imul(Lt,Vr)|0,qe=(qe=qe+Math.imul(Lt,Xr)|0)+Math.imul(Ht,Vr)|0,Ve=Ve+Math.imul(Ht,Xr)|0,ze=ze+Math.imul(zt,ei)|0,qe=(qe=qe+Math.imul(zt,ti)|0)+Math.imul(qt,ei)|0,Ve=Ve+Math.imul(qt,ti)|0;var Ti=(nt+(ze=ze+Math.imul(Ut,ai)|0)|0)+((8191&(qe=(qe=qe+Math.imul(Ut,ci)|0)+Math.imul(Ot,ai)|0))<<13)|0;nt=((Ve=Ve+Math.imul(Ot,ci)|0)+(qe>>>13)|0)+(Ti>>>26)|0,Ti&=67108863,ze=Math.imul(Xt,Ur),qe=(qe=Math.imul(Xt,Lr))+Math.imul(Jt,Ur)|0,Ve=Math.imul(Jt,Lr),ze=ze+Math.imul($t,Vr)|0,qe=(qe=qe+Math.imul($t,Xr)|0)+Math.imul(Vt,Vr)|0,Ve=Ve+Math.imul(Vt,Xr)|0,ze=ze+Math.imul(Lt,ei)|0,qe=(qe=qe+Math.imul(Lt,ti)|0)+Math.imul(Ht,ei)|0,Ve=Ve+Math.imul(Ht,ti)|0;var Ki=(nt+(ze=ze+Math.imul(zt,ai)|0)|0)+((8191&(qe=(qe=qe+Math.imul(zt,ci)|0)+Math.imul(qt,ai)|0))<<13)|0;nt=((Ve=Ve+Math.imul(qt,ci)|0)+(qe>>>13)|0)+(Ki>>>26)|0,Ki&=67108863,ze=Math.imul(Xt,Vr),qe=(qe=Math.imul(Xt,Xr))+Math.imul(Jt,Vr)|0,Ve=Math.imul(Jt,Xr),ze=ze+Math.imul($t,ei)|0,qe=(qe=qe+Math.imul($t,ti)|0)+Math.imul(Vt,ei)|0,Ve=Ve+Math.imul(Vt,ti)|0;var Ni=(nt+(ze=ze+Math.imul(Lt,ai)|0)|0)+((8191&(qe=(qe=qe+Math.imul(Lt,ci)|0)+Math.imul(Ht,ai)|0))<<13)|0;nt=((Ve=Ve+Math.imul(Ht,ci)|0)+(qe>>>13)|0)+(Ni>>>26)|0,Ni&=67108863,ze=Math.imul(Xt,ei),qe=(qe=Math.imul(Xt,ti))+Math.imul(Jt,ei)|0,Ve=Math.imul(Jt,ti);var zi=(nt+(ze=ze+Math.imul($t,ai)|0)|0)+((8191&(qe=(qe=qe+Math.imul($t,ci)|0)+Math.imul(Vt,ai)|0))<<13)|0;nt=((Ve=Ve+Math.imul(Vt,ci)|0)+(qe>>>13)|0)+(zi>>>26)|0,zi&=67108863;var ji=(nt+(ze=Math.imul(Xt,ai))|0)+((8191&(qe=(qe=Math.imul(Xt,ci))+Math.imul(Jt,ai)|0))<<13)|0;return nt=((Ve=Math.imul(Jt,ci))+(qe>>>13)|0)+(ji>>>26)|0,ji&=67108863,it[0]=ui,it[1]=li,it[2]=pi,it[3]=yi,it[4]=mi,it[5]=gi,it[6]=bi,it[7]=vi,it[8]=wi,it[9]=Ei,it[10]=Mi,it[11]=xi,it[12]=Pi,it[13]=Ci,it[14]=Ti,it[15]=Ki,it[16]=Ni,it[17]=zi,it[18]=ji,0!==nt&&(it[19]=nt,Ce.length++),Ce};function p(ke,Ae,Ce){return(new y).mulp(ke,Ae,Ce)}function y(ke,Ae){this.x=ke,this.y=Ae}Math.imul||(l=d),n.prototype.mulTo=function(ke,Ae){var Ce=this.length+ke.length;return 10===this.length&&10===ke.length?l(this,ke,Ae):Ce<63?d(this,ke,Ae):Ce<1024?function(ke,Ae,Ce){Ce.negative=Ae.negative^ke.negative,Ce.length=ke.length+Ae.length;for(var ze=0,qe=0,Ve=0;Ve>>26)|0)>>>26,tt&=67108863}Ce.words[Ve]=rt,ze=tt,tt=qe}return 0!==ze?Ce.words[Ve]=ze:Ce.length--,Ce.strip()}(this,ke,Ae):p(this,ke,Ae)},y.prototype.makeRBT=function(ke){for(var Ae=Array(ke),Ce=n.prototype._countBits(ke)-1,ze=0;ze>=1;return ze},y.prototype.permute=function(ke,Ae,Ce,ze,qe,Ve){for(var tt=0;tt>>=1)qe++;return 1<>>=13,Ce[2*Ve+1]=8191&qe,qe>>>=13;for(Ve=2*Ae;Ve>=26,Ae+=ze/67108864|0,Ae+=qe>>>26,this.words[Ce]=67108863&qe}return 0!==Ae&&(this.words[Ce]=Ae,this.length++),this},n.prototype.muln=function(ke){return this.clone().imuln(ke)},n.prototype.sqr=function(){return this.mul(this)},n.prototype.isqr=function(){return this.imul(this.clone())},n.prototype.pow=function(ke){var Ae=function(ke){for(var Ae=Array(ke.bitLength()),Ce=0;Ce>>qe}return Ae}(ke);if(0===Ae.length)return new n(1);for(var Ce=this,ze=0;ze=0);var Ae,Ce=ke%26,ze=(ke-Ce)/26,qe=67108863>>>26-Ce<<26-Ce;if(0!==Ce){var Ve=0;for(Ae=0;Ae>>26-Ce}Ve&&(this.words[Ae]=Ve,this.length++)}if(0!==ze){for(Ae=this.length-1;Ae>=0;Ae--)this.words[Ae+ze]=this.words[Ae];for(Ae=0;Ae=0),ze=Ae?(Ae-Ae%26)/26:0;var qe=ke%26,Ve=Math.min((ke-qe)/26,this.length),tt=67108863^67108863>>>qe<Ve)for(this.length-=Ve,it=0;it=0&&(0!==nt||it>=ze);it--){var ot=0|this.words[it];this.words[it]=nt<<26-qe|ot>>>qe,nt=ot&tt}return rt&&0!==nt&&(rt.words[rt.length++]=nt),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},n.prototype.ishrn=function(ke,Ae,Ce){return r(0===this.negative),this.iushrn(ke,Ae,Ce)},n.prototype.shln=function(ke){return this.clone().ishln(ke)},n.prototype.ushln=function(ke){return this.clone().iushln(ke)},n.prototype.shrn=function(ke){return this.clone().ishrn(ke)},n.prototype.ushrn=function(ke){return this.clone().iushrn(ke)},n.prototype.testn=function(ke){r("number"==typeof ke&&ke>=0);var Ae=ke%26,Ce=(ke-Ae)/26,ze=1<=0);var Ae=ke%26,Ce=(ke-Ae)/26;if(r(0===this.negative,"imaskn works only with positive numbers"),this.length<=Ce)return this;if(0!==Ae&&Ce++,this.length=Math.min(Ce,this.length),0!==Ae){var ze=67108863^67108863>>>Ae<=67108864;Ae++)this.words[Ae]-=67108864,Ae===this.length-1?this.words[Ae+1]=1:this.words[Ae+1]++;return this.length=Math.max(this.length,Ae+1),this},n.prototype.isubn=function(ke){if(r("number"==typeof ke),r(ke<67108864),ke<0)return this.iaddn(-ke);if(0!==this.negative)return this.negative=0,this.iaddn(ke),this.negative=1,this;if(this.words[0]-=ke,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var Ae=0;Ae>26)-(rt/67108864|0),this.words[ze+Ce]=67108863&qe}for(;ze>26,this.words[ze+Ce]=67108863&qe;if(0===tt)return this.strip();for(r(-1===tt),tt=0,ze=0;ze>26,this.words[ze]=67108863&qe;return this.negative=1,this.strip()},n.prototype._wordDiv=function(ke,Ae){var Ce=(this.length,ke.length),ze=this.clone(),qe=ke,Ve=0|qe.words[qe.length-1];0!==(Ce=26-this._countBits(Ve))&&(qe=qe.ushln(Ce),ze.iushln(Ce),Ve=0|qe.words[qe.length-1]);var tt,rt=ze.length-qe.length;if("mod"!==Ae){(tt=new n(null)).length=rt+1,tt.words=Array(tt.length);for(var it=0;it=0;ot--){var ct=67108864*(0|ze.words[qe.length+ot])+(0|ze.words[qe.length+ot-1]);for(ct=Math.min(ct/Ve|0,67108863),ze._ishlnsubmul(qe,ct,ot);0!==ze.negative;)ct--,ze.negative=0,ze._ishlnsubmul(qe,1,ot),ze.isZero()||(ze.negative^=1);tt&&(tt.words[ot]=ct)}return tt&&tt.strip(),ze.strip(),"div"!==Ae&&0!==Ce&&ze.iushrn(Ce),{div:tt||null,mod:ze}},n.prototype.divmod=function(ke,Ae,Ce){return r(!ke.isZero()),this.isZero()?{div:new n(0),mod:new n(0)}:0!==this.negative&&0===ke.negative?(Ve=this.neg().divmod(ke,Ae),"mod"!==Ae&&(ze=Ve.div.neg()),"div"!==Ae&&(qe=Ve.mod.neg(),Ce&&0!==qe.negative&&qe.iadd(ke)),{div:ze,mod:qe}):0===this.negative&&0!==ke.negative?(Ve=this.divmod(ke.neg(),Ae),"mod"!==Ae&&(ze=Ve.div.neg()),{div:ze,mod:Ve.mod}):0!=(this.negative&ke.negative)?(Ve=this.neg().divmod(ke.neg(),Ae),"div"!==Ae&&(qe=Ve.mod.neg(),Ce&&0!==qe.negative&&qe.isub(ke)),{div:Ve.div,mod:qe}):ke.length>this.length||this.cmp(ke)<0?{div:new n(0),mod:this}:1===ke.length?"div"===Ae?{div:this.divn(ke.words[0]),mod:null}:"mod"===Ae?{div:null,mod:new n(this.modn(ke.words[0]))}:{div:this.divn(ke.words[0]),mod:new n(this.modn(ke.words[0]))}:this._wordDiv(ke,Ae);var ze,qe,Ve},n.prototype.div=function(ke){return this.divmod(ke,"div",!1).div},n.prototype.mod=function(ke){return this.divmod(ke,"mod",!1).mod},n.prototype.umod=function(ke){return this.divmod(ke,"mod",!0).mod},n.prototype.divRound=function(ke){var Ae=this.divmod(ke);if(Ae.mod.isZero())return Ae.div;var Ce=0!==Ae.div.negative?Ae.mod.isub(ke):Ae.mod,ze=ke.ushrn(1),qe=ke.andln(1),Ve=Ce.cmp(ze);return Ve<0||1===qe&&0===Ve?Ae.div:0!==Ae.div.negative?Ae.div.isubn(1):Ae.div.iaddn(1)},n.prototype.modn=function(ke){r(ke<=67108863);for(var Ae=(1<<26)%ke,Ce=0,ze=this.length-1;ze>=0;ze--)Ce=(Ae*Ce+(0|this.words[ze]))%ke;return Ce},n.prototype.idivn=function(ke){r(ke<=67108863);for(var Ae=0,Ce=this.length-1;Ce>=0;Ce--){var ze=(0|this.words[Ce])+67108864*Ae;this.words[Ce]=ze/ke|0,Ae=ze%ke}return this.strip()},n.prototype.divn=function(ke){return this.clone().idivn(ke)},n.prototype.egcd=function(ke){r(0===ke.negative),r(!ke.isZero());var Ae=this,Ce=ke.clone();Ae=0!==Ae.negative?Ae.umod(ke):Ae.clone();for(var ze=new n(1),qe=new n(0),Ve=new n(0),tt=new n(1),rt=0;Ae.isEven()&&Ce.isEven();)Ae.iushrn(1),Ce.iushrn(1),++rt;for(var it=Ce.clone(),nt=Ae.clone();!Ae.isZero();){for(var ot=0,ct=1;0==(Ae.words[0]&ct)&&ot<26;++ot,ct<<=1);if(ot>0)for(Ae.iushrn(ot);ot-- >0;)(ze.isOdd()||qe.isOdd())&&(ze.iadd(it),qe.isub(nt)),ze.iushrn(1),qe.iushrn(1);for(var ht=0,ft=1;0==(Ce.words[0]&ft)&&ht<26;++ht,ft<<=1);if(ht>0)for(Ce.iushrn(ht);ht-- >0;)(Ve.isOdd()||tt.isOdd())&&(Ve.iadd(it),tt.isub(nt)),Ve.iushrn(1),tt.iushrn(1);Ae.cmp(Ce)>=0?(Ae.isub(Ce),ze.isub(Ve),qe.isub(tt)):(Ce.isub(Ae),Ve.isub(ze),tt.isub(qe))}return{a:Ve,b:tt,gcd:Ce.iushln(rt)}},n.prototype._invmp=function(ke){r(0===ke.negative),r(!ke.isZero());var Ae=this,Ce=ke.clone();Ae=0!==Ae.negative?Ae.umod(ke):Ae.clone();for(var ze,qe=new n(1),Ve=new n(0),tt=Ce.clone();Ae.cmpn(1)>0&&Ce.cmpn(1)>0;){for(var rt=0,it=1;0==(Ae.words[0]&it)&&rt<26;++rt,it<<=1);if(rt>0)for(Ae.iushrn(rt);rt-- >0;)qe.isOdd()&&qe.iadd(tt),qe.iushrn(1);for(var nt=0,ot=1;0==(Ce.words[0]&ot)&&nt<26;++nt,ot<<=1);if(nt>0)for(Ce.iushrn(nt);nt-- >0;)Ve.isOdd()&&Ve.iadd(tt),Ve.iushrn(1);Ae.cmp(Ce)>=0?(Ae.isub(Ce),qe.isub(Ve)):(Ce.isub(Ae),Ve.isub(qe))}return(ze=0===Ae.cmpn(1)?qe:Ve).cmpn(0)<0&&ze.iadd(ke),ze},n.prototype.gcd=function(ke){if(this.isZero())return ke.abs();if(ke.isZero())return this.abs();var Ae=this.clone(),Ce=ke.clone();Ae.negative=0,Ce.negative=0;for(var ze=0;Ae.isEven()&&Ce.isEven();ze++)Ae.iushrn(1),Ce.iushrn(1);for(;;){for(;Ae.isEven();)Ae.iushrn(1);for(;Ce.isEven();)Ce.iushrn(1);var qe=Ae.cmp(Ce);if(qe<0){var Ve=Ae;Ae=Ce,Ce=Ve}else if(0===qe||0===Ce.cmpn(1))break;Ae.isub(Ce)}return Ce.iushln(ze)},n.prototype.invm=function(ke){return this.egcd(ke).a.umod(ke)},n.prototype.isEven=function(){return 0==(1&this.words[0])},n.prototype.isOdd=function(){return 1==(1&this.words[0])},n.prototype.andln=function(ke){return this.words[0]&ke},n.prototype.bincn=function(ke){r("number"==typeof ke);var Ae=ke%26,Ce=(ke-Ae)/26,ze=1<>>26,tt&=67108863,this.words[Ve]=tt}return 0!==qe&&(this.words[Ve]=qe,this.length++),this},n.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},n.prototype.cmpn=function(ke){var Ae,Ce=ke<0;if(0!==this.negative&&!Ce)return-1;if(0===this.negative&&Ce)return 1;if(this.strip(),this.length>1)Ae=1;else{Ce&&(ke=-ke),r(ke<=67108863,"Number is too big");var ze=0|this.words[0];Ae=ze===ke?0:zeke.length)return 1;if(this.length=0;Ce--){var ze=0|this.words[Ce],qe=0|ke.words[Ce];if(ze!==qe){zeqe&&(Ae=1);break}}return Ae},n.prototype.gtn=function(ke){return 1===this.cmpn(ke)},n.prototype.gt=function(ke){return 1===this.cmp(ke)},n.prototype.gten=function(ke){return this.cmpn(ke)>=0},n.prototype.gte=function(ke){return this.cmp(ke)>=0},n.prototype.ltn=function(ke){return-1===this.cmpn(ke)},n.prototype.lt=function(ke){return-1===this.cmp(ke)},n.prototype.lten=function(ke){return this.cmpn(ke)<=0},n.prototype.lte=function(ke){return this.cmp(ke)<=0},n.prototype.eqn=function(ke){return 0===this.cmpn(ke)},n.prototype.eq=function(ke){return 0===this.cmp(ke)},n.red=function(ke){return new k(ke)},n.prototype.toRed=function(ke){return r(!this.red,"Already a number in reduction context"),r(0===this.negative,"red works only with positives"),ke.convertTo(this)._forceRed(ke)},n.prototype.fromRed=function(){return r(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},n.prototype._forceRed=function(ke){return this.red=ke,this},n.prototype.forceRed=function(ke){return r(!this.red,"Already a number in reduction context"),this._forceRed(ke)},n.prototype.redAdd=function(ke){return r(this.red,"redAdd works only with red numbers"),this.red.add(this,ke)},n.prototype.redIAdd=function(ke){return r(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,ke)},n.prototype.redSub=function(ke){return r(this.red,"redSub works only with red numbers"),this.red.sub(this,ke)},n.prototype.redISub=function(ke){return r(this.red,"redISub works only with red numbers"),this.red.isub(this,ke)},n.prototype.redShl=function(ke){return r(this.red,"redShl works only with red numbers"),this.red.shl(this,ke)},n.prototype.redMul=function(ke){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,ke),this.red.mul(this,ke)},n.prototype.redIMul=function(ke){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,ke),this.red.imul(this,ke)},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(ke){return r(this.red&&!ke.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,ke)};var tt={k256:null,p224:null,p192:null,p25519:null};function m(ke,Ae){this.name=ke,this.p=new n(Ae,16),this.n=this.p.bitLength(),this.k=new n(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function g(){m.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function w(){m.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function v(){m.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function _(){m.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function k(ke){if("string"==typeof ke){var Ae=n._prime(ke);this.m=Ae.p,this.prime=Ae}else r(ke.gtn(1),"modulus must be greater than 1"),this.m=ke,this.prime=null}function A(ke){k.call(this,ke),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)}m.prototype._tmp=function(){var ke=new n(null);return ke.words=Array(Math.ceil(this.n/13)),ke},m.prototype.ireduce=function(ke){var Ae,Ce=ke;do{this.split(Ce,this.tmp),Ae=(Ce=(Ce=this.imulK(Ce)).iadd(this.tmp)).bitLength()}while(Ae>this.n);var ze=Ae0?Ce.isub(this.p):Ce.strip(),Ce},m.prototype.split=function(ke,Ae){ke.iushrn(this.n,0,Ae)},m.prototype.imulK=function(ke){return ke.imul(this.k)},i(g,m),g.prototype.split=function(ke,Ae){for(var Ce=4194303,ze=Math.min(ke.length,9),qe=0;qe>>22,Ve=tt}Ve>>>=22,ke.words[qe-10]=Ve,0===Ve&&ke.length>10?ke.length-=10:ke.length-=9},g.prototype.imulK=function(ke){ke.words[ke.length]=0,ke.words[ke.length+1]=0,ke.length+=2;for(var Ae=0,Ce=0;Ce>>=26,ke.words[Ce]=qe,Ae=ze}return 0!==Ae&&(ke.words[ke.length++]=Ae),ke},n._prime=function(ke){if(tt[ke])return tt[ke];var Ae;if("k256"===ke)Ae=new g;else if("p224"===ke)Ae=new w;else if("p192"===ke)Ae=new v;else{if("p25519"!==ke)throw Error("Unknown prime "+ke);Ae=new _}return tt[ke]=Ae,Ae},k.prototype._verify1=function(ke){r(0===ke.negative,"red works only with positives"),r(ke.red,"red works only with red numbers")},k.prototype._verify2=function(ke,Ae){r(0==(ke.negative|Ae.negative),"red works only with positives"),r(ke.red&&ke.red===Ae.red,"red works only with red numbers")},k.prototype.imod=function(ke){return this.prime?this.prime.ireduce(ke)._forceRed(this):ke.umod(this.m)._forceRed(this)},k.prototype.neg=function(ke){return ke.isZero()?ke.clone():this.m.sub(ke)._forceRed(this)},k.prototype.add=function(ke,Ae){this._verify2(ke,Ae);var Ce=ke.add(Ae);return Ce.cmp(this.m)>=0&&Ce.isub(this.m),Ce._forceRed(this)},k.prototype.iadd=function(ke,Ae){this._verify2(ke,Ae);var Ce=ke.iadd(Ae);return Ce.cmp(this.m)>=0&&Ce.isub(this.m),Ce},k.prototype.sub=function(ke,Ae){this._verify2(ke,Ae);var Ce=ke.sub(Ae);return Ce.cmpn(0)<0&&Ce.iadd(this.m),Ce._forceRed(this)},k.prototype.isub=function(ke,Ae){this._verify2(ke,Ae);var Ce=ke.isub(Ae);return Ce.cmpn(0)<0&&Ce.iadd(this.m),Ce},k.prototype.shl=function(ke,Ae){return this._verify1(ke),this.imod(ke.ushln(Ae))},k.prototype.imul=function(ke,Ae){return this._verify2(ke,Ae),this.imod(ke.imul(Ae))},k.prototype.mul=function(ke,Ae){return this._verify2(ke,Ae),this.imod(ke.mul(Ae))},k.prototype.isqr=function(ke){return this.imul(ke,ke.clone())},k.prototype.sqr=function(ke){return this.mul(ke,ke)},k.prototype.sqrt=function(ke){if(ke.isZero())return ke.clone();var Ae=this.m.andln(3);if(r(Ae%2==1),3===Ae){var Ce=this.m.add(new n(1)).iushrn(2);return this.pow(ke,Ce)}for(var ze=this.m.subn(1),qe=0;!ze.isZero()&&0===ze.andln(1);)qe++,ze.iushrn(1);r(!ze.isZero());var Ve=new n(1).toRed(this),tt=Ve.redNeg(),rt=this.m.subn(1).iushrn(1),it=this.m.bitLength();for(it=new n(2*it*it).toRed(this);0!==this.pow(it,rt).cmp(tt);)it.redIAdd(tt);for(var nt=this.pow(it,ze),ot=this.pow(ke,ze.addn(1).iushrn(1)),ct=this.pow(ke,ze),ht=qe;0!==ct.cmp(Ve);){for(var ft=ct,yt=0;0!==ft.cmp(Ve);yt++)ft=ft.redSqr();r(yt=0;ze--){for(var it=Ae.words[ze],nt=rt-1;nt>=0;nt--){var ot=it>>nt&1;qe!==Ce[0]&&(qe=this.sqr(qe)),0!==ot||0!==Ve?(Ve<<=1,Ve|=ot,(4===++tt||0===ze&&0===nt)&&(qe=this.mul(qe,Ce[Ve]),tt=0,Ve=0)):tt=0}rt=26}return qe},k.prototype.convertTo=function(ke){var Ae=ke.umod(this.m);return Ae===ke?Ae.clone():Ae},k.prototype.convertFrom=function(ke){var Ae=ke.clone();return Ae.red=null,Ae},n.mont=function(ke){return new A(ke)},i(A,k),A.prototype.convertTo=function(ke){return this.imod(ke.ushln(this.shift))},A.prototype.convertFrom=function(ke){var Ae=this.imod(ke.mul(this.rinv));return Ae.red=null,Ae},A.prototype.imul=function(ke,Ae){if(ke.isZero()||Ae.isZero())return ke.words[0]=0,ke.length=1,ke;var Ce=ke.imul(Ae),ze=Ce.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),qe=Ce.isub(ze).iushrn(this.shift),Ve=qe;return qe.cmp(this.m)>=0?Ve=qe.isub(this.m):qe.cmpn(0)<0&&(Ve=qe.iadd(this.m)),Ve._forceRed(this)},A.prototype.mul=function(ke,Ae){if(ke.isZero()||Ae.isZero())return new n(0)._forceRed(this);var Ce=ke.mul(Ae),ze=Ce.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),qe=Ce.isub(ze).iushrn(this.shift),Ve=qe;return qe.cmp(this.m)>=0?Ve=qe.isub(this.m):qe.cmpn(0)<0&&(Ve=qe.iadd(this.m)),Ve._forceRed(this)},A.prototype.invm=function(ke){return this.imod(ke._invmp(this.m).mul(this.r2))._forceRed(this)}}(ke,Ur)})),Od=Object.freeze({__proto__:null,default:Id,__moduleExports:Id});class Cd{constructor(ke){if(void 0===ke)throw Error("Invalid BigInteger input");this.value=new Id(ke)}clone(){const ke=new Cd(null);return this.value.copy(ke.value),ke}iinc(){return this.value.iadd(new Id(1)),this}inc(){return this.clone().iinc()}idec(){return this.value.isub(new Id(1)),this}dec(){return this.clone().idec()}iadd(ke){return this.value.iadd(ke.value),this}add(ke){return this.clone().iadd(ke)}isub(ke){return this.value.isub(ke.value),this}sub(ke){return this.clone().isub(ke)}imul(ke){return this.value.imul(ke.value),this}mul(ke){return this.clone().imul(ke)}imod(ke){return this.value=this.value.umod(ke.value),this}mod(ke){return this.clone().imod(ke)}modExp(ke,Ae){const Ce=Ae.isEven()?Id.red(Ae.value):Id.mont(Ae.value),ze=this.clone();return ze.value=ze.value.toRed(Ce).redPow(ke.value).fromRed(),ze}modInv(ke){if(!this.gcd(ke).isOne())throw Error("Inverse does not exist");return new Cd(this.value.invm(ke.value))}gcd(ke){return new Cd(this.value.gcd(ke.value))}ileftShift(ke){return this.value.ishln(ke.value.toNumber()),this}leftShift(ke){return this.clone().ileftShift(ke)}irightShift(ke){return this.value.ishrn(ke.value.toNumber()),this}rightShift(ke){return this.clone().irightShift(ke)}equal(ke){return this.value.eq(ke.value)}lt(ke){return this.value.lt(ke.value)}lte(ke){return this.value.lte(ke.value)}gt(ke){return this.value.gt(ke.value)}gte(ke){return this.value.gte(ke.value)}isZero(){return this.value.isZero()}isOne(){return this.value.eq(new Id(1))}isNegative(){return this.value.isNeg()}isEven(){return this.value.isEven()}abs(){const ke=this.clone();return ke.value=ke.value.abs(),ke}toString(){return this.value.toString()}toNumber(){return this.value.toNumber()}getBit(ke){return this.value.testn(ke)?1:0}bitLength(){return this.value.bitLength()}byteLength(){return this.value.byteLength()}toUint8Array(ke="be",Ae){return this.value.toArrayLike(Uint8Array,ke,Ae)}}var zd,qd=Object.freeze({__proto__:null,default:Cd}),jd=bt((function(ke,Ae){var Ce=Ae;function i(ke){return 1===ke.length?"0"+ke:ke}function n(ke){for(var Ae="",Ce=0;Ce>8,tt=255&qe;Ve?Ce.push(Ve,tt):Ce.push(tt)}return Ce},Ce.zero2=i,Ce.toHex=n,Ce.encode=function(ke,Ae){return"hex"===Ae?n(ke):ke}})),Fd=bt((function(ke,Ae){var Ce=Ae;Ce.assert=Ir,Ce.toArray=jd.toArray,Ce.zero2=jd.zero2,Ce.toHex=jd.toHex,Ce.encode=jd.encode,Ce.getNAF=function(ke,Ae){for(var Ce=[],ze=1<=0;){var Ve;if(qe.isOdd()){var tt=qe.andln(ze-1);Ve=tt>(ze>>1)-1?(ze>>1)-tt:tt,qe.isubn(Ve)}else Ve=0;Ce.push(Ve);for(var rt=0!==qe.cmpn(0)&&0===qe.andln(ze-1)?Ae+1:1,it=1;it0||Ae.cmpn(-qe)>0;){var Ve,tt,rt,it=ke.andln(3)+ze&3,nt=Ae.andln(3)+qe&3;if(3===it&&(it=-1),3===nt&&(nt=-1),0==(1&it))Ve=0;else Ve=3!==(rt=ke.andln(7)+ze&7)&&5!==rt||2!==nt?it:-it;if(Ce[0].push(Ve),0==(1&nt))tt=0;else tt=3!==(rt=Ae.andln(7)+qe&7)&&5!==rt||2!==it?nt:-nt;Ce[1].push(tt),2*ze===Ve+1&&(ze=1-ze),2*qe===tt+1&&(qe=1-qe),ke.iushrn(1),Ae.iushrn(1)}return Ce},Ce.cachedProperty=function(ke,Ae,Ce){var ze="_"+Ae;ke.prototype[Ae]=function(){return void 0!==this[ze]?this[ze]:this[ze]=Ce.call(this)}},Ce.parseBytes=function(ke){return"string"==typeof ke?Ce.toArray(ke,"hex"):ke},Ce.intFromLE=function(ke){return new Id(ke,"hex","le")}})),Ud=function(ke){return zd||(zd=new Bd(null)),zd.generate(ke)};function Bd(ke){this.rand=ke}var Wd=Bd;if(Bd.prototype.generate=function(ke){return this._rand(ke)},Bd.prototype._rand=function(ke){if(this.rand.getBytes)return this.rand.getBytes(ke);for(var Ae=new Uint8Array(ke),Ce=0;Ce0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}var tp=Nd;function Ld(ke,Ae){this.curve=ke,this.type=Ae,this.precomputed=null}Nd.prototype.point=function(){throw Error("Not implemented")},Nd.prototype.validate=function(){throw Error("Not implemented")},Nd.prototype._fixedNafMul=function(ke,Ae){ep(ke.precomputed);var Ce=ke._getDoubles(),ze=Yd(Ae,1),qe=(1<=tt;Ae--)rt=(rt<<1)+ze[Ae];Ve.push(rt)}for(var it=this.jpoint(null,null,null),nt=this.jpoint(null,null,null),ot=qe;ot>0;ot--){for(tt=0;tt=0;rt--){for(Ae=0;rt>=0&&0===Ve[rt];rt--)Ae++;if(rt>=0&&Ae++,tt=tt.dblp(Ae),rt<0)break;var it=Ve[rt];ep(0!==it),tt="affine"===ke.type?it>0?tt.mixedAdd(qe[it-1>>1]):tt.mixedAdd(qe[-it-1>>1].neg()):it>0?tt.add(qe[it-1>>1]):tt.add(qe[-it-1>>1].neg())}return"affine"===ke.type?tt.toP():tt},Nd.prototype._wnafMulAdd=function(ke,Ae,Ce,ze,qe){for(var Ve=this._wnafT1,tt=this._wnafT2,rt=this._wnafT3,it=0,nt=0;nt=1;nt-=2){var ct=nt-1,ht=nt;if(1===Ve[ct]&&1===Ve[ht]){var ft=[Ae[ct],null,null,Ae[ht]];0===Ae[ct].y.cmp(Ae[ht].y)?(ft[1]=Ae[ct].add(Ae[ht]),ft[2]=Ae[ct].toJ().mixedAdd(Ae[ht].neg())):0===Ae[ct].y.cmp(Ae[ht].y.redNeg())?(ft[1]=Ae[ct].toJ().mixedAdd(Ae[ht]),ft[2]=Ae[ct].add(Ae[ht].neg())):(ft[1]=Ae[ct].toJ().mixedAdd(Ae[ht]),ft[2]=Ae[ct].toJ().mixedAdd(Ae[ht].neg()));var yt=[-3,-1,-5,-7,0,7,5,1,3],mt=Qd(Ce[ct],Ce[ht]);it=Math.max(mt[0].length,it),rt[ct]=Array(it),rt[ht]=Array(it);for(var kt=0;kt=0;nt--){for(var Dt=0;nt>=0;){var Rt=!0;for(kt=0;kt=0&&Dt++,Pt=Pt.dblp(Dt),nt<0)break;for(kt=0;kt0?Tt=tt[kt][Kt-1>>1]:Kt<0&&(Tt=tt[kt][-Kt-1>>1].neg()),Pt="affine"===Tt.type?Pt.mixedAdd(Tt):Pt.add(Tt))}}for(nt=0;nt=Math.ceil((ke.bitLength()+1)/Ae.step)},Ld.prototype._getDoubles=function(ke,Ae){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var Ce=[this],ze=this,qe=0;qe=0&&(Ve=Ae,tt=Ce),ze.negative&&(ze=ze.neg(),qe=qe.neg()),Ve.negative&&(Ve=Ve.neg(),tt=tt.neg()),[{a:ze,b:qe},{a:Ve,b:tt}]},Hd.prototype._endoSplit=function(ke){var Ae=this.endo.basis,Ce=Ae[0],ze=Ae[1],qe=ze.b.mul(ke).divRound(this.n),Ve=Ce.b.neg().mul(ke).divRound(this.n),tt=qe.mul(Ce.a),rt=Ve.mul(ze.a),it=qe.mul(Ce.b),nt=Ve.mul(ze.b);return{k1:ke.sub(tt).sub(rt),k2:it.add(nt).neg()}},Hd.prototype.pointFromX=function(ke,Ae){(ke=new Id(ke,16)).red||(ke=ke.toRed(this.red));var Ce=ke.redSqr().redMul(ke).redIAdd(ke.redMul(this.a)).redIAdd(this.b),ze=Ce.redSqrt();if(0!==ze.redSqr().redSub(Ce).cmp(this.zero))throw Error("invalid point");var qe=ze.fromRed().isOdd();return(Ae&&!qe||!Ae&&qe)&&(ze=ze.redNeg()),this.point(ke,ze)},Hd.prototype.validate=function(ke){if(ke.inf)return!0;var Ae=ke.x,Ce=ke.y,ze=this.a.redMul(Ae),qe=Ae.redSqr().redMul(Ae).redIAdd(ze).redIAdd(this.b);return 0===Ce.redSqr().redISub(qe).cmpn(0)},Hd.prototype._endoWnafMulAdd=function(ke,Ae,Ce){for(var ze=this._endoWnafT1,qe=this._endoWnafT2,Ve=0;Ve":""},Vd.prototype.isInfinity=function(){return this.inf},Vd.prototype.add=function(ke){if(this.inf)return ke;if(ke.inf)return this;if(this.eq(ke))return this.dbl();if(this.neg().eq(ke))return this.curve.point(null,null);if(0===this.x.cmp(ke.x))return this.curve.point(null,null);var Ae=this.y.redSub(ke.y);0!==Ae.cmpn(0)&&(Ae=Ae.redMul(this.x.redSub(ke.x).redInvm()));var Ce=Ae.redSqr().redISub(this.x).redISub(ke.x),ze=Ae.redMul(this.x.redSub(Ce)).redISub(this.y);return this.curve.point(Ce,ze)},Vd.prototype.dbl=function(){if(this.inf)return this;var ke=this.y.redAdd(this.y);if(0===ke.cmpn(0))return this.curve.point(null,null);var Ae=this.curve.a,Ce=this.x.redSqr(),ze=ke.redInvm(),qe=Ce.redAdd(Ce).redIAdd(Ce).redIAdd(Ae).redMul(ze),Ve=qe.redSqr().redISub(this.x.redAdd(this.x)),tt=qe.redMul(this.x.redSub(Ve)).redISub(this.y);return this.curve.point(Ve,tt)},Vd.prototype.getX=function(){return this.x.fromRed()},Vd.prototype.getY=function(){return this.y.fromRed()},Vd.prototype.mul=function(ke){return ke=new Id(ke,16),this.isInfinity()?this:this._hasDoubles(ke)?this.curve._fixedNafMul(this,ke):this.curve.endo?this.curve._endoWnafMulAdd([this],[ke]):this.curve._wnafMul(this,ke)},Vd.prototype.mulAdd=function(ke,Ae,Ce){var ze=[this,Ae],qe=[ke,Ce];return this.curve.endo?this.curve._endoWnafMulAdd(ze,qe):this.curve._wnafMulAdd(1,ze,qe,2)},Vd.prototype.jmulAdd=function(ke,Ae,Ce){var ze=[this,Ae],qe=[ke,Ce];return this.curve.endo?this.curve._endoWnafMulAdd(ze,qe,!0):this.curve._wnafMulAdd(1,ze,qe,2,!0)},Vd.prototype.eq=function(ke){return this===ke||this.inf===ke.inf&&(this.inf||0===this.x.cmp(ke.x)&&0===this.y.cmp(ke.y))},Vd.prototype.neg=function(ke){if(this.inf)return this;var Ae=this.curve.point(this.x,this.y.redNeg());if(ke&&this.precomputed){var Ce=this.precomputed,i=function(ke){return ke.neg()};Ae.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 Ae},Vd.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},Gr($d,tp.BasePoint),Hd.prototype.jpoint=function(ke,Ae,Ce){return new $d(this,ke,Ae,Ce)},$d.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var ke=this.z.redInvm(),Ae=ke.redSqr(),Ce=this.x.redMul(Ae),ze=this.y.redMul(Ae).redMul(ke);return this.curve.point(Ce,ze)},$d.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},$d.prototype.add=function(ke){if(this.isInfinity())return ke;if(ke.isInfinity())return this;var Ae=ke.z.redSqr(),Ce=this.z.redSqr(),ze=this.x.redMul(Ae),qe=ke.x.redMul(Ce),Ve=this.y.redMul(Ae.redMul(ke.z)),tt=ke.y.redMul(Ce.redMul(this.z)),rt=ze.redSub(qe),it=Ve.redSub(tt);if(0===rt.cmpn(0))return 0!==it.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var nt=rt.redSqr(),ot=nt.redMul(rt),ct=ze.redMul(nt),ht=it.redSqr().redIAdd(ot).redISub(ct).redISub(ct),ft=it.redMul(ct.redISub(ht)).redISub(Ve.redMul(ot)),yt=this.z.redMul(ke.z).redMul(rt);return this.curve.jpoint(ht,ft,yt)},$d.prototype.mixedAdd=function(ke){if(this.isInfinity())return ke.toJ();if(ke.isInfinity())return this;var Ae=this.z.redSqr(),Ce=this.x,ze=ke.x.redMul(Ae),qe=this.y,Ve=ke.y.redMul(Ae).redMul(this.z),tt=Ce.redSub(ze),rt=qe.redSub(Ve);if(0===tt.cmpn(0))return 0!==rt.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var it=tt.redSqr(),nt=it.redMul(tt),ot=Ce.redMul(it),ct=rt.redSqr().redIAdd(nt).redISub(ot).redISub(ot),ht=rt.redMul(ot.redISub(ct)).redISub(qe.redMul(nt)),ft=this.z.redMul(tt);return this.curve.jpoint(ct,ht,ft)},$d.prototype.dblp=function(ke){if(0===ke)return this;if(this.isInfinity())return this;if(!ke)return this.dbl();if(this.curve.zeroA||this.curve.threeA){for(var Ae=this,Ce=0;Ce=0)return!1;if(Ce.redIAdd(qe),0===this.x.cmp(Ce))return!0}},$d.prototype.inspect=function(){return this.isInfinity()?"":""},$d.prototype.isInfinity=function(){return 0===this.z.cmpn(0)},Gr(Zd,tp);var np=Zd;function Xd(ke,Ae,Ce){tp.BasePoint.call(this,ke,"projective"),null===Ae&&null===Ce?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new Id(Ae,16),this.z=new Id(Ce,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}Zd.prototype.validate=function(ke){var Ae=ke.normalize().x,Ce=Ae.redSqr(),ze=Ce.redMul(Ae).redAdd(Ce.redMul(this.a)).redAdd(Ae);return 0===ze.redSqrt().redSqr().cmp(ze)},Gr(Xd,tp.BasePoint),Zd.prototype.decodePoint=function(ke,Ae){if(33===(ke=Fd.toArray(ke,Ae)).length&&64===ke[0]&&(ke=ke.slice(1,33).reverse()),32!==ke.length)throw Error("Unknown point compression format");return this.point(ke,1)},Zd.prototype.point=function(ke,Ae){return new Xd(this,ke,Ae)},Zd.prototype.pointFromJSON=function(ke){return Xd.fromJSON(this,ke)},Xd.prototype.precompute=function(){},Xd.prototype._encode=function(ke){var Ae=this.curve.p.byteLength();return ke?[64].concat(this.getX().toArray("le",Ae)):this.getX().toArray("be",Ae)},Xd.fromJSON=function(ke,Ae){return new Xd(ke,Ae[0],Ae[1]||ke.one)},Xd.prototype.inspect=function(){return this.isInfinity()?"":""},Xd.prototype.isInfinity=function(){return 0===this.z.cmpn(0)},Xd.prototype.dbl=function(){var ke=this.x.redAdd(this.z).redSqr(),Ae=this.x.redSub(this.z).redSqr(),Ce=ke.redSub(Ae),ze=ke.redMul(Ae),qe=Ce.redMul(Ae.redAdd(this.curve.a24.redMul(Ce)));return this.curve.point(ze,qe)},Xd.prototype.add=function(){throw Error("Not supported on Montgomery curve")},Xd.prototype.diffAdd=function(ke,Ae){var Ce=this.x.redAdd(this.z),ze=this.x.redSub(this.z),qe=ke.x.redAdd(ke.z),Ve=ke.x.redSub(ke.z).redMul(Ce),tt=qe.redMul(ze),rt=Ae.z.redMul(Ve.redAdd(tt).redSqr()),it=Ae.x.redMul(Ve.redISub(tt).redSqr());return this.curve.point(rt,it)},Xd.prototype.mul=function(ke){for(var Ae=(ke=new Id(ke,16)).clone(),Ce=this,ze=this.curve.point(null,null),qe=[];0!==Ae.cmpn(0);Ae.iushrn(1))qe.push(Ae.andln(1));for(var Ve=qe.length-1;Ve>=0;Ve--)0===qe[Ve]?(Ce=Ce.diffAdd(ze,this),ze=ze.dbl()):(ze=Ce.diffAdd(ze,this),Ce=Ce.dbl());return ze},Xd.prototype.mulAdd=function(){throw Error("Not supported on Montgomery curve")},Xd.prototype.jumlAdd=function(){throw Error("Not supported on Montgomery curve")},Xd.prototype.eq=function(ke){return 0===this.getX().cmp(ke.getX())},Xd.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},Xd.prototype.getX=function(){return this.normalize(),this.x.fromRed()};var sp=Fd.assert;function Jd(ke){this.twisted=1!=(0|ke.a),this.mOneA=this.twisted&&-1==(0|ke.a),this.extended=this.mOneA,tp.call(this,"edwards",ke),this.a=new Id(ke.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new Id(ke.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new Id(ke.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),sp(!this.twisted||0===this.c.fromRed().cmpn(1)),this.oneC=1==(0|ke.c)}Gr(Jd,tp);var ap=Jd;function tl(ke,Ae,Ce,ze,qe){tp.BasePoint.call(this,ke,"projective"),null===Ae&&null===Ce&&null===ze?(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 Id(Ae,16),this.y=new Id(Ce,16),this.z=ze?new Id(ze,16):this.curve.one,this.t=qe&&new Id(qe,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()))))}Jd.prototype._mulA=function(ke){return this.mOneA?ke.redNeg():this.a.redMul(ke)},Jd.prototype._mulC=function(ke){return this.oneC?ke:this.c.redMul(ke)},Jd.prototype.jpoint=function(ke,Ae,Ce,ze){return this.point(ke,Ae,Ce,ze)},Jd.prototype.pointFromX=function(ke,Ae){(ke=new Id(ke,16)).red||(ke=ke.toRed(this.red));var Ce=ke.redSqr(),ze=this.c2.redSub(this.a.redMul(Ce)),qe=this.one.redSub(this.c2.redMul(this.d).redMul(Ce)),Ve=ze.redMul(qe.redInvm()),tt=Ve.redSqrt();if(0!==tt.redSqr().redSub(Ve).cmp(this.zero))throw Error("invalid point");var rt=tt.fromRed().isOdd();return(Ae&&!rt||!Ae&&rt)&&(tt=tt.redNeg()),this.point(ke,tt)},Jd.prototype.pointFromY=function(ke,Ae){(ke=new Id(ke,16)).red||(ke=ke.toRed(this.red));var Ce=ke.redSqr(),ze=Ce.redSub(this.c2),qe=Ce.redMul(this.d).redMul(this.c2).redSub(this.a),Ve=ze.redMul(qe.redInvm());if(0===Ve.cmp(this.zero)){if(Ae)throw Error("invalid point");return this.point(this.zero,ke)}var tt=Ve.redSqrt();if(0!==tt.redSqr().redSub(Ve).cmp(this.zero))throw Error("invalid point");return tt.fromRed().isOdd()!==Ae&&(tt=tt.redNeg()),this.point(tt,ke)},Jd.prototype.validate=function(ke){if(ke.isInfinity())return!0;ke.normalize();var Ae=ke.x.redSqr(),Ce=ke.y.redSqr(),ze=Ae.redMul(this.a).redAdd(Ce),qe=this.c2.redMul(this.one.redAdd(this.d.redMul(Ae).redMul(Ce)));return 0===ze.cmp(qe)},Gr(tl,tp.BasePoint),Jd.prototype.pointFromJSON=function(ke){return tl.fromJSON(this,ke)},Jd.prototype.point=function(ke,Ae,Ce,ze){return new tl(this,ke,Ae,Ce,ze)},tl.fromJSON=function(ke,Ae){return new tl(ke,Ae[0],Ae[1],Ae[2])},tl.prototype.inspect=function(){return this.isInfinity()?"":""},tl.prototype.isInfinity=function(){return 0===this.x.cmpn(0)&&(0===this.y.cmp(this.z)||this.zOne&&0===this.y.cmp(this.curve.c))},tl.prototype._extDbl=function(){var ke=this.x.redSqr(),Ae=this.y.redSqr(),Ce=this.z.redSqr();Ce=Ce.redIAdd(Ce);var ze=this.curve._mulA(ke),qe=this.x.redAdd(this.y).redSqr().redISub(ke).redISub(Ae),Ve=ze.redAdd(Ae),tt=Ve.redSub(Ce),rt=ze.redSub(Ae),it=qe.redMul(tt),nt=Ve.redMul(rt),ot=qe.redMul(rt),ct=tt.redMul(Ve);return this.curve.point(it,nt,ct,ot)},tl.prototype._projDbl=function(){var ke,Ae,Ce,ze=this.x.redAdd(this.y).redSqr(),qe=this.x.redSqr(),Ve=this.y.redSqr();if(this.curve.twisted){var tt=(nt=this.curve._mulA(qe)).redAdd(Ve);if(this.zOne)ke=ze.redSub(qe).redSub(Ve).redMul(tt.redSub(this.curve.two)),Ae=tt.redMul(nt.redSub(Ve)),Ce=tt.redSqr().redSub(tt).redSub(tt);else{var rt=this.z.redSqr(),it=tt.redSub(rt).redISub(rt);ke=ze.redSub(qe).redISub(Ve).redMul(it),Ae=tt.redMul(nt.redSub(Ve)),Ce=tt.redMul(it)}}else{var nt=qe.redAdd(Ve);rt=this.curve._mulC(this.z).redSqr(),it=nt.redSub(rt).redSub(rt);ke=this.curve._mulC(ze.redISub(nt)).redMul(it),Ae=this.curve._mulC(nt).redMul(qe.redISub(Ve)),Ce=nt.redMul(it)}return this.curve.point(ke,Ae,Ce)},tl.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},tl.prototype._extAdd=function(ke){var Ae=this.y.redSub(this.x).redMul(ke.y.redSub(ke.x)),Ce=this.y.redAdd(this.x).redMul(ke.y.redAdd(ke.x)),ze=this.t.redMul(this.curve.dd).redMul(ke.t),qe=this.z.redMul(ke.z.redAdd(ke.z)),Ve=Ce.redSub(Ae),tt=qe.redSub(ze),rt=qe.redAdd(ze),it=Ce.redAdd(Ae),nt=Ve.redMul(tt),ot=rt.redMul(it),ct=Ve.redMul(it),ht=tt.redMul(rt);return this.curve.point(nt,ot,ht,ct)},tl.prototype._projAdd=function(ke){var Ae,Ce,ze=this.z.redMul(ke.z),qe=ze.redSqr(),Ve=this.x.redMul(ke.x),tt=this.y.redMul(ke.y),rt=this.curve.d.redMul(Ve).redMul(tt),it=qe.redSub(rt),nt=qe.redAdd(rt),ot=this.x.redAdd(this.y).redMul(ke.x.redAdd(ke.y)).redISub(Ve).redISub(tt),ct=ze.redMul(it).redMul(ot);return this.curve.twisted?(Ae=ze.redMul(nt).redMul(tt.redSub(this.curve._mulA(Ve))),Ce=it.redMul(nt)):(Ae=ze.redMul(nt).redMul(tt.redSub(Ve)),Ce=this.curve._mulC(it).redMul(nt)),this.curve.point(ct,Ae,Ce)},tl.prototype.add=function(ke){return this.isInfinity()?ke:ke.isInfinity()?this:this.curve.extended?this._extAdd(ke):this._projAdd(ke)},tl.prototype.mul=function(ke){return this._hasDoubles(ke)?this.curve._fixedNafMul(this,ke):this.curve._wnafMul(this,ke)},tl.prototype.mulAdd=function(ke,Ae,Ce){return this.curve._wnafMulAdd(1,[this,Ae],[ke,Ce],2,!1)},tl.prototype.jmulAdd=function(ke,Ae,Ce){return this.curve._wnafMulAdd(1,[this,Ae],[ke,Ce],2,!0)},tl.prototype.normalize=function(){if(this.zOne)return this;var ke=this.z.redInvm();return this.x=this.x.redMul(ke),this.y=this.y.redMul(ke),this.t&&(this.t=this.t.redMul(ke)),this.z=this.curve.one,this.zOne=!0,this},tl.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},tl.prototype.getX=function(){return this.normalize(),this.x.fromRed()},tl.prototype.getY=function(){return this.normalize(),this.y.fromRed()},tl.prototype.eq=function(ke){return this===ke||0===this.getX().cmp(ke.getX())&&0===this.getY().cmp(ke.getY())},tl.prototype.eqXToP=function(ke){var Ae=ke.toRed(this.curve.red).redMul(this.z);if(0===this.x.cmp(Ae))return!0;for(var Ce=ke.clone(),ze=this.curve.redN.redMul(this.z);;){if(Ce.iadd(this.curve.n),Ce.cmp(this.curve.p)>=0)return!1;if(Ae.redIAdd(ze),0===this.x.cmp(Ae))return!0}},tl.prototype.toP=tl.prototype.normalize,tl.prototype.mixedAdd=tl.prototype.add;var op=bt((function(ke,Ae){var Ce=Ae;Ce.base=tp,Ce.short=ip,Ce.mont=np,Ce.edwards=ap})),up=Vr.rotl32,hp=Vr.sum32,fp=Vr.sum32_5,lp=ti.ft_1,dp=Qr.BlockHash,pp=[1518500249,1859775393,2400959708,3395469782];function ul(){if(!(this instanceof ul))return new ul;dp.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=Array(80)}Vr.inherits(ul,dp);var yp=ul;ul.blockSize=512,ul.outSize=160,ul.hmacStrength=80,ul.padLength=64,ul.prototype._update=function(ke,Ae){for(var Ce=this.W,ze=0;ze<16;ze++)Ce[ze]=ke[Ae+ze];for(;zethis.blockSize&&(ke=(new this.Hash).update(ke).digest()),Ir(ke.length<=this.blockSize);for(var Ae=ke.length;Ae=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(Ae,Ce,ze)}var _p=ml;ml.prototype._init=function(ke,Ae,Ce){var ze=ke.concat(Ae).concat(Ce);this.K=Array(this.outLen/8),this.V=Array(this.outLen/8);for(var qe=0;qe=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(ke.concat(Ce||[])),this._reseed=1},ml.prototype.generate=function(ke,Ae,Ce,ze){if(this._reseed>this.reseedInterval)throw Error("Reseed is required");"string"!=typeof Ae&&(ze=Ce,Ce=Ae,Ae=null),Ce&&(Ce=jd.toArray(Ce,ze||"hex"),this._update(Ce));for(var qe=[];qe.length"};var Sp=Fd.assert;function Al(ke,Ae){if(ke instanceof Al)return ke;this._importDER(ke,Ae)||(Sp(ke.r&&ke.s,"Signature without r or s"),this.r=new Id(ke.r,16),this.s=new Id(ke.s,16),void 0===ke.recoveryParam?this.recoveryParam=null:this.recoveryParam=ke.recoveryParam)}var Ep=Al;function El(){this.place=0}function Pl(ke,Ae){var Ce=ke[Ae.place++];if(!(128&Ce))return Ce;for(var ze=15&Ce,qe=0,Ve=0,tt=Ae.place;Ve>>3);for(ke.push(128|Ce);--Ce;)ke.push(Ae>>>(Ce<<3)&255);ke.push(Ae)}}Al.prototype._importDER=function(ke,Ae){ke=Fd.toArray(ke,Ae);var Ce=new El;if(48!==ke[Ce.place++])return!1;if(Pl(ke,Ce)+Ce.place!==ke.length)return!1;if(2!==ke[Ce.place++])return!1;var ze=Pl(ke,Ce),qe=ke.slice(Ce.place,ze+Ce.place);if(Ce.place+=ze,2!==ke[Ce.place++])return!1;var Ve=Pl(ke,Ce);if(ke.length!==Ve+Ce.place)return!1;var tt=ke.slice(Ce.place,Ve+Ce.place);return 0===qe[0]&&128&qe[1]&&(qe=qe.slice(1)),0===tt[0]&&128&tt[1]&&(tt=tt.slice(1)),this.r=new Id(qe),this.s=new Id(tt),this.recoveryParam=null,!0},Al.prototype.toDER=function(ke){var Ae=this.r.toArray(),Ce=this.s.toArray();for(128&Ae[0]&&(Ae=[0].concat(Ae)),128&Ce[0]&&(Ce=[0].concat(Ce)),Ae=xl(Ae),Ce=xl(Ce);!(Ce[0]||128&Ce[1]);)Ce=Ce.slice(1);var ze=[2];Ml(ze,Ae.length),(ze=ze.concat(Ae)).push(2),Ml(ze,Ce.length);var qe=ze.concat(Ce),Ve=[48];return Ml(Ve,qe.length),Ve=Ve.concat(qe),Fd.encode(Ve,ke)};var Mp=Fd.assert;function Kl(ke){if(!(this instanceof Kl))return new Kl(ke);"string"==typeof ke&&(Mp(wp.hasOwnProperty(ke),"Unknown curve "+ke),ke=wp[ke]),ke instanceof wp.PresetCurve&&(ke={curve:ke}),this.curve=ke.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=ke.curve.g,this.g.precompute(ke.curve.n.bitLength()+1),this.hash=ke.hash||ke.curve.hash}var xp=Kl;Kl.prototype.keyPair=function(ke){return new Ap(this,ke)},Kl.prototype.keyFromPrivate=function(ke,Ae){return Ap.fromPrivate(this,ke,Ae)},Kl.prototype.keyFromPublic=function(ke,Ae){return Ap.fromPublic(this,ke,Ae)},Kl.prototype.genKeyPair=function(ke){ke||(ke={});var Ae=new _p({hash:this.hash,pers:ke.pers,persEnc:ke.persEnc||"utf8",entropy:ke.entropy||Ud(this.hash.hmacStrength),entropyEnc:ke.entropy&&ke.entropyEnc||"utf8",nonce:this.n.toArray()});if("mont"===this.curve.type){var Ce=new Id(Ae.generate(32));return this.keyFromPrivate(Ce)}for(var ze=this.n.byteLength(),qe=this.n.sub(new Id(2));;){if(!((Ce=new Id(Ae.generate(ze))).cmp(qe)>0))return Ce.iaddn(1),this.keyFromPrivate(Ce)}},Kl.prototype._truncateToN=function(ke,Ae,Ce){var ze=(Ce=Ce||8*ke.byteLength())-this.n.bitLength();return ze>0&&(ke=ke.ushrn(ze)),!Ae&&ke.cmp(this.n)>=0?ke.sub(this.n):ke},Kl.prototype.truncateMsg=function(ke){var Ae;return ke instanceof Uint8Array?(Ae=8*ke.byteLength,ke=this._truncateToN(new Id(ke,16),!1,Ae)):"string"==typeof ke?(Ae=4*ke.length,ke=this._truncateToN(new Id(ke,16),!1,Ae)):ke=this._truncateToN(new Id(ke,16)),ke},Kl.prototype.sign=function(ke,Ae,Ce,ze){"object"==typeof Ce&&(ze=Ce,Ce=null),ze||(ze={}),Ae=this.keyFromPrivate(Ae,Ce),ke=this.truncateMsg(ke);for(var qe=this.n.byteLength(),Ve=Ae.getPrivate().toArray("be",qe),tt=ke.toArray("be",qe),rt=new _p({hash:this.hash,entropy:Ve,nonce:tt,pers:ze.pers,persEnc:ze.persEnc||"utf8"}),it=this.n.sub(new Id(1)),nt=0;;nt++){var ot=ze.k?ze.k(nt):new Id(rt.generate(this.n.byteLength()));if(!((ot=this._truncateToN(ot,!0)).cmpn(1)<=0||ot.cmp(it)>=0)){var ct=this.g.mul(ot);if(!ct.isInfinity()){var ht=ct.getX(),ft=ht.umod(this.n);if(0!==ft.cmpn(0)){var yt=ot.invm(this.n).mul(ft.mul(Ae.getPrivate()).iadd(ke));if(0!==(yt=yt.umod(this.n)).cmpn(0)){var mt=(ct.getY().isOdd()?1:0)|(0!==ht.cmp(ft)?2:0);return ze.canonical&&yt.cmp(this.nh)>0&&(yt=this.n.sub(yt),mt^=1),new Ep({r:ft,s:yt,recoveryParam:mt})}}}}}},Kl.prototype.verify=function(ke,Ae,Ce,ze){return Ce=this.keyFromPublic(Ce,ze),Ae=new Ep(Ae,"hex"),this._verify(this.truncateMsg(ke),Ae,Ce)||this._verify(this._truncateToN(new Id(ke,16)),Ae,Ce)},Kl.prototype._verify=function(ke,Ae,Ce){var ze=Ae.r,qe=Ae.s;if(ze.cmpn(1)<0||ze.cmp(this.n)>=0)return!1;if(qe.cmpn(1)<0||qe.cmp(this.n)>=0)return!1;var Ve,tt=qe.invm(this.n),rt=tt.mul(ke).umod(this.n),it=tt.mul(ze).umod(this.n);return this.curve._maxwellTrick?!(Ve=this.g.jmulAdd(rt,Ce.getPublic(),it)).isInfinity()&&Ve.eqXToP(ze):!(Ve=this.g.mulAdd(rt,Ce.getPublic(),it)).isInfinity()&&0===Ve.getX().umod(this.n).cmp(ze)},Kl.prototype.recoverPubKey=function(ke,Ae,Ce,ze){Mp((3&Ce)===Ce,"The recovery param is more than two bits"),Ae=new Ep(Ae,ze);var qe=this.n,Ve=new Id(ke),tt=Ae.r,rt=Ae.s,it=1&Ce,nt=Ce>>1;if(tt.cmp(this.curve.p.umod(this.curve.n))>=0&&nt)throw Error("Unable to find sencond key candinate");tt=nt?this.curve.pointFromX(tt.add(this.curve.n),it):this.curve.pointFromX(tt,it);var ot=Ae.r.invm(qe),ct=qe.sub(Ve).mul(ot).umod(qe),ht=rt.mul(ot).umod(qe);return this.g.mulAdd(ct,tt,ht)},Kl.prototype.getKeyRecoveryParam=function(ke,Ae,Ce,ze){if(null!==(Ae=new Ep(Ae,ze)).recoveryParam)return Ae.recoveryParam;for(var qe=0;qe<4;qe++){var Ve;try{Ve=this.recoverPubKey(ke,Ae,qe)}catch(ke){continue}if(Ve.eq(Ce))return qe}throw Error("Unable to find valid recovery factor")};var Pp=Fd.assert,Cp=Fd.parseBytes,Bp=Fd.cachedProperty;function Bl(ke,Ae){if(this.eddsa=ke,Ae.hasOwnProperty("secret")&&(this._secret=Cp(Ae.secret)),ke.isPoint(Ae.pub))this._pub=Ae.pub;else if(this._pubBytes=Cp(Ae.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")}Bl.fromPublic=function(ke,Ae){return Ae instanceof Bl?Ae:new Bl(ke,{pub:Ae})},Bl.fromSecret=function(ke,Ae){return Ae instanceof Bl?Ae:new Bl(ke,{secret:Ae})},Bl.prototype.secret=function(){return this._secret},Bp(Bl,"pubBytes",(function(){return this.eddsa.encodePoint(this.pub())})),Bp(Bl,"pub",(function(){return this._pubBytes?this.eddsa.decodePoint(this._pubBytes):this.eddsa.g.mul(this.priv())})),Bp(Bl,"privBytes",(function(){var ke=this.eddsa,Ae=this.hash(),Ce=ke.encodingLength-1,ze=Ae.slice(0,ke.encodingLength);return ze[0]&=248,ze[Ce]&=127,ze[Ce]|=64,ze})),Bp(Bl,"priv",(function(){return this.eddsa.decodeInt(this.privBytes())})),Bp(Bl,"hash",(function(){return this.eddsa.hash().update(this.secret()).digest()})),Bp(Bl,"messagePrefix",(function(){return this.hash().slice(this.eddsa.encodingLength)})),Bl.prototype.sign=function(ke){return Pp(this._secret,"KeyPair can only verify"),this.eddsa.sign(ke,this)},Bl.prototype.verify=function(ke,Ae){return this.eddsa.verify(ke,Ae,this)},Bl.prototype.getSecret=function(ke){return Pp(this._secret,"KeyPair is public only"),Fd.encode(this.secret(),ke)},Bl.prototype.getPublic=function(ke,Ae){return Fd.encode((Ae?[64]:[]).concat(this.pubBytes()),ke)};var Dp=Bl,Rp=Fd.assert,Tp=Fd.cachedProperty,Kp=Fd.parseBytes;function Fl(ke,Ae){this.eddsa=ke,"object"!=typeof Ae&&(Ae=Kp(Ae)),Array.isArray(Ae)&&(Ae={R:Ae.slice(0,ke.encodingLength),S:Ae.slice(ke.encodingLength)}),Rp(Ae.R&&Ae.S,"Signature without R or S"),ke.isPoint(Ae.R)&&(this._R=Ae.R),Ae.S instanceof Id&&(this._S=Ae.S),this._Rencoded=Array.isArray(Ae.R)?Ae.R:Ae.Rencoded,this._Sencoded=Array.isArray(Ae.S)?Ae.S:Ae.Sencoded}Tp(Fl,"S",(function(){return this.eddsa.decodeInt(this.Sencoded())})),Tp(Fl,"R",(function(){return this.eddsa.decodePoint(this.Rencoded())})),Tp(Fl,"Rencoded",(function(){return this.eddsa.encodePoint(this.R())})),Tp(Fl,"Sencoded",(function(){return this.eddsa.encodeInt(this.S())})),Fl.prototype.toBytes=function(){return this.Rencoded().concat(this.Sencoded())},Fl.prototype.toHex=function(){return Fd.encode(this.toBytes(),"hex").toUpperCase()};var Ip=Fl,Up=Fd.assert,Op=Fd.parseBytes;function Wl(ke){if(Up("ed25519"===ke,"only tested with ed25519 so far"),!(this instanceof Wl))return new Wl(ke);ke=wp[ke].curve;this.curve=ke,this.g=ke.g,this.g.precompute(ke.n.bitLength()+1),this.pointClass=ke.point().constructor,this.encodingLength=Math.ceil(ke.n.bitLength()/8),this.hash=bp.sha512}var Np=Wl;Wl.prototype.sign=function(ke,Ae){ke=Op(ke);var Ce=this.keyFromSecret(Ae),ze=this.hashInt(Ce.messagePrefix(),ke),qe=this.g.mul(ze),Ve=this.encodePoint(qe),tt=this.hashInt(Ve,Ce.pubBytes(),ke).mul(Ce.priv()),rt=ze.add(tt).umod(this.curve.n);return this.makeSignature({R:qe,S:rt,Rencoded:Ve})},Wl.prototype.verify=function(ke,Ae,Ce){ke=Op(ke),Ae=this.makeSignature(Ae);var ze=this.keyFromPublic(Ce),qe=this.hashInt(Ae.Rencoded(),ze.pubBytes(),ke),Ve=this.g.mul(Ae.S());return Ae.R().add(ze.pub().mul(qe)).eq(Ve)},Wl.prototype.hashInt=function(){for(var ke=this.hash(),Ae=0;Ae0)throw Error("Unknown option: "+Ce.join(", "));return new pc(ke)},Ae.createMessage=async function({text:ke,binary:Ae,filename:Ce,date:ze=new Date,format:qe=(void 0!==ke?"utf8":"binary"),...Ve}){let tt=void 0!==ke?ke:Ae;if(void 0===tt)throw Error("createMessage: must pass options object containing `text` or `binary`");if(ke&&!Zt.isString(ke)&&!Zt.isStream(ke))throw Error("createMessage: options.text must be a string or stream");if(Ae&&!Zt.isUint8Array(Ae)&&!Zt.isStream(Ae))throw Error("createMessage: options.binary must be a Uint8Array or stream");const rt=Object.keys(Ve);if(rt.length>0)throw Error("Unknown option: "+rt.join(", "));const it=Zt.isStream(tt);it&&(await F(),tt=j(tt));const nt=new Hs(ze);void 0!==ke?nt.setText(tt,er.write(er.literal,qe)):nt.setBytes(tt,er.write(er.literal,qe)),void 0!==Ce&&nt.setFilename(Ce);const ot=new so;ot.push(nt);const ct=new hc(ot);return ct.fromStream=it,ct},Ae.decrypt=async function({message:ke,decryptionKeys:Ae,passwords:Ce,sessionKeys:ze,verificationKeys:qe,expectSigned:Ve=!1,format:tt="utf8",signature:rt=null,date:it=new Date,config:nt,...ot}){if(wc(nt={...tr,...nt}),yc(ke),qe=vc(qe),Ae=vc(Ae),Ce=vc(Ce),ze=vc(ze),ot.privateKeys)throw Error("The `privateKeys` option has been removed from openpgp.decrypt, pass `decryptionKeys` instead");if(ot.publicKeys)throw Error("The `publicKeys` option has been removed from openpgp.decrypt, pass `verificationKeys` instead");const ct=Object.keys(ot);if(ct.length>0)throw Error("Unknown option: "+ct.join(", "));try{const ot=await ke.decrypt(Ae,Ce,ze,it,nt);qe||(qe=[]);const ct={};if(ct.signatures=rt?await ot.verifyDetached(rt,qe,it,nt):await ot.verify(qe,it,nt),ct.data="binary"===tt?ot.getLiteralData():ot.getText(),ct.filename=ot.getFilename(),kc(ct,ke),Ve){if(0===qe.length)throw Error("Verification keys are required to verify message signatures");if(0===ct.signatures.length)throw Error("Message is not signed");ct.data=W([ct.data,ae((async()=>{await Zt.anyPromise(ct.signatures.map((ke=>ke.verified)))}))])}return ct.data=await _c(ct.data,ke.fromStream,tt),ct}catch(ke){throw Zt.wrapError("Error decrypting message",ke)}},Ae.decryptKey=async function({privateKey:ke,passphrase:Ae,config:Ce,...ze}){wc(Ce={...tr,...Ce});const qe=Object.keys(ze);if(qe.length>0)throw Error("Unknown option: "+qe.join(", "));if(!ke.isPrivate())throw Error("Cannot decrypt a public key");const Ve=ke.clone(!0),tt=Zt.isArray(Ae)?Ae:[Ae];try{return await Promise.all(Ve.getKeys().map((ke=>Zt.anyPromise(tt.map((Ae=>ke.keyPacket.decrypt(Ae))))))),await Ve.validate(Ce),Ve}catch(ke){throw Ve.clearPrivateParams(),Zt.wrapError("Error decrypting private key",ke)}},Ae.decryptSessionKeys=async function({message:ke,decryptionKeys:Ae,passwords:Ce,date:ze=new Date,config:qe,...Ve}){if(wc(qe={...tr,...qe}),yc(ke),Ae=vc(Ae),Ce=vc(Ce),Ve.privateKeys)throw Error("The `privateKeys` option has been removed from openpgp.decryptSessionKeys, pass `decryptionKeys` instead");const tt=Object.keys(Ve);if(tt.length>0)throw Error("Unknown option: "+tt.join(", "));try{return await ke.decryptSessionKeys(Ae,Ce,ze,qe)}catch(ke){throw Zt.wrapError("Error decrypting session keys",ke)}},Ae.encrypt=async function({message:ke,encryptionKeys:Ae,signingKeys:Ce,passwords:ze,sessionKey:qe,format:Ve="armored",signature:tt=null,wildcard:rt=!1,signingKeyIDs:it=[],encryptionKeyIDs:nt=[],date:ot=new Date,signingUserIDs:ct=[],encryptionUserIDs:ht=[],config:ft,...yt}){if(wc(ft={...tr,...ft}),yc(ke),mc(Ve),Ae=vc(Ae),Ce=vc(Ce),ze=vc(ze),it=vc(it),nt=vc(nt),ct=vc(ct),ht=vc(ht),yt.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(yt.publicKeys)throw Error("The `publicKeys` option has been removed from openpgp.encrypt, pass `encryptionKeys` instead");if(yt.privateKeys)throw Error("The `privateKeys` option has been removed from openpgp.encrypt, pass `signingKeys` instead");if(void 0!==yt.armor)throw Error("The `armor` option has been removed from openpgp.encrypt, pass `format` instead.");const mt=Object.keys(yt);if(mt.length>0)throw Error("Unknown option: "+mt.join(", "));Ce||(Ce=[]);const kt=ke.fromStream;try{if((Ce.length||tt)&&(ke=await ke.sign(Ce,tt,it,ot,ct,ft)),ke=ke.compress(await jo("compression",Ae,ot,ht,ft),ft),ke=await ke.encrypt(Ae,ze,qe,rt,nt,ot,ht,ft),"object"===Ve)return ke;const yt="armored"===Ve;return _c(yt?ke.armor(ft):ke.write(),kt,yt?"utf8":"binary")}catch(ke){throw Zt.wrapError("Error encrypting message",ke)}},Ae.encryptKey=async function({privateKey:ke,passphrase:Ae,config:Ce,...ze}){wc(Ce={...tr,...Ce});const qe=Object.keys(ze);if(qe.length>0)throw Error("Unknown option: "+qe.join(", "));if(!ke.isPrivate())throw Error("Cannot encrypt a public key");const Ve=ke.clone(!0),tt=Ve.getKeys(),rt=Zt.isArray(Ae)?Ae:Array(tt.length).fill(Ae);if(rt.length!==tt.length)throw Error("Invalid number of passphrases given for key encryption");try{return await Promise.all(tt.map((async(ke,Ae)=>{const{keyPacket:ze}=ke;await ze.encrypt(rt[Ae],Ce),ze.clearPrivateParams()}))),Ve}catch(ke){throw Ve.clearPrivateParams(),Zt.wrapError("Error encrypting private key",ke)}},Ae.encryptSessionKey=async function({data:ke,algorithm:Ae,aeadAlgorithm:Ce,encryptionKeys:ze,passwords:qe,format:Ve="armored",wildcard:tt=!1,encryptionKeyIDs:rt=[],date:it=new Date,encryptionUserIDs:nt=[],config:ot,...ct}){if(wc(ot={...tr,...ot}),function(ke,Ae){if(!Zt.isUint8Array(ke))throw Error("Parameter ["+(Ae||"data")+"] must be of type Uint8Array")}(ke),function(ke,Ae){if(!Zt.isString(ke))throw Error("Parameter ["+(Ae||"data")+"] must be of type String")}(Ae,"algorithm"),mc(Ve),ze=vc(ze),qe=vc(qe),rt=vc(rt),nt=vc(nt),ct.publicKeys)throw Error("The `publicKeys` option has been removed from openpgp.encryptSessionKey, pass `encryptionKeys` instead");const ht=Object.keys(ct);if(ht.length>0)throw Error("Unknown option: "+ht.join(", "));try{return Ac(await hc.encryptSessionKey(ke,Ae,Ce,ze,qe,tt,rt,it,nt,ot),Ve,ot)}catch(ke){throw Zt.wrapError("Error encrypting session key",ke)}},Ae.enums=er,Ae.generateKey=async function({userIDs:ke=[],passphrase:Ae="",type:Ce="ecc",rsaBits:ze=4096,curve:qe="curve25519",keyExpirationTime:Ve=0,date:tt=new Date,subkeys:rt=[{}],format:it="armored",config:nt,...ot}){wc(nt={...tr,...nt}),ke=vc(ke);const ct=Object.keys(ot);if(ct.length>0)throw Error("Unknown option: "+ct.join(", "));if(0===ke.length)throw Error("UserIDs are required for key generation");if("rsa"===Ce&&zeVo(ke.subkeys[Ce],ke)));let Ce=[zo(ke,Ae)];Ce=Ce.concat(ke.subkeys.map((ke=>To(ke,Ae))));const ze=await Promise.all(Ce),qe=await sc(ze[0],ze.slice(1),ke,Ae),Ve=await qe.getRevocationCertificate(ke.date,Ae);return qe.revocationSignatures=[],{key:qe,revocationCertificate:Ve}}(ht,nt);return ke.getKeys().forEach((({keyPacket:ke})=>Xo(ke,nt))),{privateKey:Ac(ke,it,nt),publicKey:Ac(ke.toPublic(),it,nt),revocationCertificate:Ae}}catch(ke){throw Zt.wrapError("Error generating keypair",ke)}},Ae.generateSessionKey=async function({encryptionKeys:ke,date:Ae=new Date,encryptionUserIDs:Ce=[],config:ze,...qe}){if(wc(ze={...tr,...ze}),ke=vc(ke),Ce=vc(Ce),qe.publicKeys)throw Error("The `publicKeys` option has been removed from openpgp.generateSessionKey, pass `encryptionKeys` instead");const Ve=Object.keys(qe);if(Ve.length>0)throw Error("Unknown option: "+Ve.join(", "));try{return await hc.generateSessionKey(ke,Ae,Ce,ze)}catch(ke){throw Zt.wrapError("Error generating session key",ke)}},Ae.readCleartextMessage=async function({cleartextMessage:ke,config:Ae,...Ce}){if(Ae={...tr,...Ae},!ke)throw Error("readCleartextMessage: must pass options object containing `cleartextMessage`");if(!Zt.isString(ke))throw Error("readCleartextMessage: options.cleartextMessage must be a string");const ze=Object.keys(Ce);if(ze.length>0)throw Error("Unknown option: "+ze.join(", "));const qe=await Pe(ke);if(qe.type!==er.armor.signed)throw Error("No cleartext signed message.");const Ve=await so.fromBinary(qe.data,Ul,Ae);!function(ke,Ae){const r=function(ke){const r=ke=>Ae=>ke.hashAlgorithm===Ae;for(let Ce=0;Ce0)throw Error("Unknown option: "+qe.join(", "));let Ve;if(ke){const{type:Ae,data:ze}=await Pe(ke,Ce);if(Ae!==er.armor.publicKey&&Ae!==er.armor.privateKey)throw Error("Armored text not of type key");Ve=ze}else Ve=Ae;return rc(await so.fromBinary(Ve,Dl,Ce))},Ae.readKeys=async function({armoredKeys:ke,binaryKeys:Ae,config:Ce,...ze}){Ce={...tr,...Ce};let qe=ke||Ae;if(!qe)throw Error("readKeys: must pass options object containing `armoredKeys` or `binaryKeys`");if(ke&&!Zt.isString(ke))throw Error("readKeys: options.armoredKeys must be a string");if(Ae&&!Zt.isUint8Array(Ae))throw Error("readKeys: options.binaryKeys must be a Uint8Array");const Ve=Object.keys(ze);if(Ve.length>0)throw Error("Unknown option: "+Ve.join(", "));if(ke){const{type:Ae,data:ze}=await Pe(ke,Ce);if(Ae!==er.armor.publicKey&&Ae!==er.armor.privateKey)throw Error("Armored text not of type key");qe=ze}const tt=[],rt=await so.fromBinary(qe,Dl,Ce),it=rt.indexOfTag(er.packet.publicKey,er.packet.secretKey);if(0===it.length)throw Error("No key packet found");for(let ke=0;ke0)throw Error("Unknown option: "+Ve.join(", "));const tt=Zt.isStream(qe);if(tt&&(await F(),qe=j(qe)),ke){const{type:ke,data:Ae}=await Pe(qe,Ce);if(ke!==er.armor.message)throw Error("Armored text not of type message");qe=Ae}const rt=await so.fromBinary(qe,Rl,Ce),it=new hc(rt);return it.fromStream=tt,it},Ae.readPrivateKey=async function({armoredKey:ke,binaryKey:Ae,config:Ce,...ze}){if(Ce={...tr,...Ce},!ke&&!Ae)throw Error("readPrivateKey: must pass options object containing `armoredKey` or `binaryKey`");if(ke&&!Zt.isString(ke))throw Error("readPrivateKey: options.armoredKey must be a string");if(Ae&&!Zt.isUint8Array(Ae))throw Error("readPrivateKey: options.binaryKey must be a Uint8Array");const qe=Object.keys(ze);if(qe.length>0)throw Error("Unknown option: "+qe.join(", "));let Ve;if(ke){const{type:Ae,data:ze}=await Pe(ke,Ce);if(Ae!==er.armor.privateKey)throw Error("Armored text not of type private key");Ve=ze}else Ve=Ae;const tt=await so.fromBinary(Ve,Dl,Ce);return new nc(tt)},Ae.readPrivateKeys=async function({armoredKeys:ke,binaryKeys:Ae,config:Ce}){Ce={...tr,...Ce};let ze=ke||Ae;if(!ze)throw Error("readPrivateKeys: must pass options object containing `armoredKeys` or `binaryKeys`");if(ke&&!Zt.isString(ke))throw Error("readPrivateKeys: options.armoredKeys must be a string");if(Ae&&!Zt.isUint8Array(Ae))throw Error("readPrivateKeys: options.binaryKeys must be a Uint8Array");if(ke){const{type:Ae,data:qe}=await Pe(ke,Ce);if(Ae!==er.armor.privateKey)throw Error("Armored text not of type private key");ze=qe}const qe=[],Ve=await so.fromBinary(ze,Dl,Ce),tt=Ve.indexOfTag(er.packet.secretKey);if(0===tt.length)throw Error("No secret key packet found");for(let ke=0;ke0)throw Error("Unknown option: "+Ve.join(", "));if(ke){const{type:ke,data:Ae}=await Pe(qe,Ce);if(ke!==er.armor.signature)throw Error("Armored text not of type signature");qe=Ae}const tt=await so.fromBinary(qe,Sl,Ce);return new Bo(tt)},Ae.reformatKey=async function({privateKey:ke,userIDs:Ae=[],passphrase:Ce="",keyExpirationTime:ze=0,date:qe,format:Ve="armored",config:tt,...rt}){wc(tt={...tr,...tt}),Ae=vc(Ae);const it=Object.keys(rt);if(it.length>0)throw Error("Unknown option: "+it.join(", "));if(0===Ae.length)throw Error("UserIDs are required for key reformat");const nt={privateKey:ke,userIDs:Ae,passphrase:Ce,keyExpirationTime:ze,date:qe};try{const{key:ke,revocationCertificate:Ae}=await async function(ke,Ae){ke=o(ke);const{privateKey:Ce}=ke;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:ke})=>ke.isDecrypted())))throw Error("Key is not decrypted");const ze=Ce.keyPacket;ke.subkeys||(ke.subkeys=await Promise.all(Ce.subkeys.map((async ke=>{const Ce=ke.keyPacket,qe={key:ze,bind:Ce},Ve=await qo(ke.bindingSignatures,ze,er.signature.subkeyBinding,qe,null,Ae).catch((()=>({})));return{sign:Ve.keyFlags&&Ve.keyFlags[0]&er.keyFlags.signData}}))));const qe=Ce.subkeys.map((ke=>ke.keyPacket));if(ke.subkeys.length!==qe.length)throw Error("Number of subkey options does not match number of subkeys");ke.subkeys=ke.subkeys.map((Ae=>o(Ae,ke)));const Ve=await sc(ze,qe,ke,Ae),tt=await Ve.getRevocationCertificate(ke.date,Ae);return Ve.revocationSignatures=[],{key:Ve,revocationCertificate:tt};function o(ke,Ae={}){return ke.keyExpirationTime=ke.keyExpirationTime||Ae.keyExpirationTime,ke.passphrase=Zt.isString(ke.passphrase)?ke.passphrase:Ae.passphrase,ke.date=ke.date||Ae.date,ke}}(nt,tt);return{privateKey:Ac(ke,Ve,tt),publicKey:Ac(ke.toPublic(),Ve,tt),revocationCertificate:Ae}}catch(ke){throw Zt.wrapError("Error reformatting keypair",ke)}},Ae.revokeKey=async function({key:ke,revocationCertificate:Ae,reasonForRevocation:Ce,date:ze=new Date,format:qe="armored",config:Ve,...tt}){wc(Ve={...tr,...Ve});const rt=Object.keys(tt);if(rt.length>0)throw Error("Unknown option: "+rt.join(", "));try{const tt=Ae?await ke.applyRevocationCertificate(Ae,ze,Ve):await ke.revoke(Ce,ze,Ve);return tt.isPrivate()?{privateKey:Ac(tt,qe,Ve),publicKey:Ac(tt.toPublic(),qe,Ve)}:{privateKey:null,publicKey:Ac(tt,qe,Ve)}}catch(ke){throw Zt.wrapError("Error revoking key",ke)}},Ae.sign=async function({message:ke,signingKeys:Ae,format:Ce="armored",detached:ze=!1,signingKeyIDs:qe=[],date:Ve=new Date,signingUserIDs:tt=[],config:rt,...it}){if(wc(rt={...tr,...rt}),bc(ke),mc(Ce),Ae=vc(Ae),qe=vc(qe),tt=vc(tt),it.privateKeys)throw Error("The `privateKeys` option has been removed from openpgp.sign, pass `signingKeys` instead");if(void 0!==it.armor)throw Error("The `armor` option has been removed from openpgp.sign, pass `format` instead.");const nt=Object.keys(it);if(nt.length>0)throw Error("Unknown option: "+nt.join(", "));if(ke instanceof pc&&"binary"===Ce)throw Error("Cannot return signed cleartext message in binary format");if(ke instanceof pc&&ze)throw Error("Cannot detach-sign a cleartext message");if(!Ae||0===Ae.length)throw Error("No signing keys provided");try{let it;if(it=ze?await ke.signDetached(Ae,void 0,qe,Ve,tt,rt):await ke.sign(Ae,void 0,qe,Ve,tt,rt),"object"===Ce)return it;const nt="armored"===Ce;return it=nt?it.armor(rt):it.write(),ze&&(it=X(ke.packets.write(),(async(ke,Ae)=>{await Promise.all([V(it,Ae),ie(ke).catch((()=>{}))])}))),_c(it,ke.fromStream,nt?"utf8":"binary")}catch(ke){throw Zt.wrapError("Error signing message",ke)}},Ae.unarmor=Pe,Ae.verify=async function({message:ke,verificationKeys:Ae,expectSigned:Ce=!1,format:ze="utf8",signature:qe=null,date:Ve=new Date,config:tt,...rt}){if(wc(tt={...tr,...tt}),bc(ke),Ae=vc(Ae),rt.publicKeys)throw Error("The `publicKeys` option has been removed from openpgp.verify, pass `verificationKeys` instead");const it=Object.keys(rt);if(it.length>0)throw Error("Unknown option: "+it.join(", "));if(ke instanceof pc&&"binary"===ze)throw Error("Can't return cleartext message data as binary");if(ke instanceof pc&&qe)throw Error("Can't verify detached cleartext signature");try{const rt={};if(rt.signatures=qe?await ke.verifyDetached(qe,Ae,Ve,tt):await ke.verify(Ae,Ve,tt),rt.data="binary"===ze?ke.getLiteralData():ke.getText(),ke.fromStream&&kc(rt,ke),Ce){if(0===rt.signatures.length)throw Error("Message is not signed");rt.data=W([rt.data,ae((async()=>{await Zt.anyPromise(rt.signatures.map((ke=>ke.verified)))}))])}return rt.data=await _c(rt.data,ke.fromStream,ze),rt}catch(ke){throw Zt.wrapError("Error verifying signed message",ke)}}},5118:(ke,Ae,Ce)=>{"use strict";var ze=Ce(4300);var qe=ze.Buffer;var Ve={};var tt;for(tt in ze){if(!ze.hasOwnProperty(tt))continue;if(tt==="SlowBuffer"||tt==="Buffer")continue;Ve[tt]=ze[tt]}var rt=Ve.Buffer={};for(tt in qe){if(!qe.hasOwnProperty(tt))continue;if(tt==="allocUnsafe"||tt==="allocUnsafeSlow")continue;rt[tt]=qe[tt]}Ve.Buffer.prototype=qe.prototype;if(!rt.from||rt.from===Uint8Array.from){rt.from=function(ke,Ae,Ce){if(typeof ke==="number"){throw new TypeError('The "value" argument must not be of type number. Received type '+typeof ke)}if(ke&&typeof ke.length==="undefined"){throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof ke)}return qe(ke,Ae,Ce)}}if(!rt.alloc){rt.alloc=function(ke,Ae,Ce){if(typeof ke!=="number"){throw new TypeError('The "size" argument must be of type number. Received type '+typeof ke)}if(ke<0||ke>=2*(1<<30)){throw new RangeError('The value "'+ke+'" is invalid for option "size"')}var ze=qe(ke);if(!Ae||Ae.length===0){ze.fill(0)}else if(typeof Ce==="string"){ze.fill(Ae,Ce)}else{ze.fill(Ae)}return ze}}if(!Ve.kStringMaxLength){try{Ve.kStringMaxLength=process.binding("buffer").kStringMaxLength}catch(ke){}}if(!Ve.constants){Ve.constants={MAX_LENGTH:Ve.kMaxLength};if(Ve.kStringMaxLength){Ve.constants.MAX_STRING_LENGTH=Ve.kStringMaxLength}}ke.exports=Ve},4294:(ke,Ae,Ce)=>{ke.exports=Ce(4219)},4219:(ke,Ae,Ce)=>{"use strict";var ze=Ce(1808);var qe=Ce(4404);var Ve=Ce(3685);var tt=Ce(5687);var rt=Ce(2361);var it=Ce(9491);var nt=Ce(3837);Ae.httpOverHttp=httpOverHttp;Ae.httpsOverHttp=httpsOverHttp;Ae.httpOverHttps=httpOverHttps;Ae.httpsOverHttps=httpsOverHttps;function httpOverHttp(ke){var Ae=new TunnelingAgent(ke);Ae.request=Ve.request;return Ae}function httpsOverHttp(ke){var Ae=new TunnelingAgent(ke);Ae.request=Ve.request;Ae.createSocket=createSecureSocket;Ae.defaultPort=443;return Ae}function httpOverHttps(ke){var Ae=new TunnelingAgent(ke);Ae.request=tt.request;return Ae}function httpsOverHttps(ke){var Ae=new TunnelingAgent(ke);Ae.request=tt.request;Ae.createSocket=createSecureSocket;Ae.defaultPort=443;return Ae}function TunnelingAgent(ke){var Ae=this;Ae.options=ke||{};Ae.proxyOptions=Ae.options.proxy||{};Ae.maxSockets=Ae.options.maxSockets||Ve.Agent.defaultMaxSockets;Ae.requests=[];Ae.sockets=[];Ae.on("free",(function onFree(ke,Ce,ze,qe){var Ve=toOptions(Ce,ze,qe);for(var tt=0,rt=Ae.requests.length;tt=this.maxSockets){qe.requests.push(Ve);return}qe.createSocket(Ve,(function(Ae){Ae.on("free",onFree);Ae.on("close",onCloseOrRemove);Ae.on("agentRemove",onCloseOrRemove);ke.onSocket(Ae);function onFree(){qe.emit("free",Ae,Ve)}function onCloseOrRemove(ke){qe.removeSocket(Ae);Ae.removeListener("free",onFree);Ae.removeListener("close",onCloseOrRemove);Ae.removeListener("agentRemove",onCloseOrRemove)}}))};TunnelingAgent.prototype.createSocket=function createSocket(ke,Ae){var Ce=this;var ze={};Ce.sockets.push(ze);var qe=mergeOptions({},Ce.proxyOptions,{method:"CONNECT",path:ke.host+":"+ke.port,agent:false,headers:{host:ke.host+":"+ke.port}});if(ke.localAddress){qe.localAddress=ke.localAddress}if(qe.proxyAuth){qe.headers=qe.headers||{};qe.headers["Proxy-Authorization"]="Basic "+new Buffer(qe.proxyAuth).toString("base64")}ot("making CONNECT request");var Ve=Ce.request(qe);Ve.useChunkedEncodingByDefault=false;Ve.once("response",onResponse);Ve.once("upgrade",onUpgrade);Ve.once("connect",onConnect);Ve.once("error",onError);Ve.end();function onResponse(ke){ke.upgrade=true}function onUpgrade(ke,Ae,Ce){process.nextTick((function(){onConnect(ke,Ae,Ce)}))}function onConnect(qe,tt,rt){Ve.removeAllListeners();tt.removeAllListeners();if(qe.statusCode!==200){ot("tunneling socket could not be established, statusCode=%d",qe.statusCode);tt.destroy();var it=new Error("tunneling socket could not be established, "+"statusCode="+qe.statusCode);it.code="ECONNRESET";ke.request.emit("error",it);Ce.removeSocket(ze);return}if(rt.length>0){ot("got illegal response body from proxy");tt.destroy();var it=new Error("got illegal response body from proxy");it.code="ECONNRESET";ke.request.emit("error",it);Ce.removeSocket(ze);return}ot("tunneling connection has established");Ce.sockets[Ce.sockets.indexOf(ze)]=tt;return Ae(tt)}function onError(Ae){Ve.removeAllListeners();ot("tunneling socket could not be established, cause=%s\n",Ae.message,Ae.stack);var qe=new Error("tunneling socket could not be established, "+"cause="+Ae.message);qe.code="ECONNRESET";ke.request.emit("error",qe);Ce.removeSocket(ze)}};TunnelingAgent.prototype.removeSocket=function removeSocket(ke){var Ae=this.sockets.indexOf(ke);if(Ae===-1){return}this.sockets.splice(Ae,1);var Ce=this.requests.shift();if(Ce){this.createSocket(Ce,(function(ke){Ce.request.onSocket(ke)}))}};function createSecureSocket(ke,Ae){var Ce=this;TunnelingAgent.prototype.createSocket.call(Ce,ke,(function(ze){var Ve=ke.request.getHeader("host");var tt=mergeOptions({},Ce.options,{socket:ze,servername:Ve?Ve.replace(/:.*$/,""):ke.host});var rt=qe.connect(0,tt);Ce.sockets[Ce.sockets.indexOf(ze)]=rt;Ae(rt)}))}function toOptions(ke,Ae,Ce){if(typeof ke==="string"){return{host:ke,port:Ae,localAddress:Ce}}return ke}function mergeOptions(ke){for(var Ae=1,Ce=arguments.length;Aett(void 0,void 0,void 0,(function*(){return yield rt.getExecOutput(`git`,ke,{ignoreReturnCode:true,silent:true}).then((ke=>{if(ke.stderr.length>0&&ke.exitCode!=0){throw new Error(ke.stderr)}return ke.stdout.trim()}))}));function setConfig(ke,Ae,Ce){return tt(this,void 0,void 0,(function*(){const ze=["config"];if(Ce){ze.push("--global")}ze.push(ke,Ae);yield git(ze)}))}Ae.setConfig=setConfig},3759:function(ke,Ae,Ce){"use strict";var ze=this&&this.__createBinding||(Object.create?function(ke,Ae,Ce,ze){if(ze===undefined)ze=Ce;var qe=Object.getOwnPropertyDescriptor(Ae,Ce);if(!qe||("get"in qe?!Ae.__esModule:qe.writable||qe.configurable)){qe={enumerable:true,get:function(){return Ae[Ce]}}}Object.defineProperty(ke,ze,qe)}:function(ke,Ae,Ce,ze){if(ze===undefined)ze=Ce;ke[ze]=Ae[Ce]});var qe=this&&this.__setModuleDefault||(Object.create?function(ke,Ae){Object.defineProperty(ke,"default",{enumerable:true,value:Ae})}:function(ke,Ae){ke["default"]=Ae});var Ve=this&&this.__importStar||function(ke){if(ke&&ke.__esModule)return ke;var Ae={};if(ke!=null)for(var Ce in ke)if(Ce!=="default"&&Object.prototype.hasOwnProperty.call(ke,Ce))ze(Ae,ke,Ce);qe(Ae,ke);return Ae};var tt=this&&this.__awaiter||function(ke,Ae,Ce,ze){function adopt(ke){return ke instanceof Ce?ke:new Ce((function(Ae){Ae(ke)}))}return new(Ce||(Ce=Promise))((function(Ce,qe){function fulfilled(ke){try{step(ze.next(ke))}catch(ke){qe(ke)}}function rejected(ke){try{step(ze["throw"](ke))}catch(ke){qe(ke)}}function step(ke){ke.done?Ce(ke.value):adopt(ke.value).then(fulfilled,rejected)}step((ze=ze.apply(ke,Ae||[])).next())}))};Object.defineProperty(Ae,"__esModule",{value:true});Ae.killAgent=Ae.deleteKey=Ae.presetPassphrase=Ae.configureAgent=Ae.getKeygrip=Ae.parseKeygripFromGpgColonsOutput=Ae.getKeygrips=Ae.importKey=Ae.getDirs=Ae.getVersion=Ae.agentConfig=void 0;const rt=Ve(Ce(1514));const it=Ve(Ce(7147));const nt=Ve(Ce(1017));const ot=Ve(Ce(2037));const ct=Ve(Ce(5728));Ae.agentConfig=`default-cache-ttl 21600\nmax-cache-ttl 31536000\nallow-preset-passphrase`;const getGnupgHome=()=>tt(void 0,void 0,void 0,(function*(){if(process.env.GNUPGHOME){return process.env.GNUPGHOME}let ke=nt.join(process.env.HOME||"",".gnupg");if(ot.platform()=="win32"&&!process.env.HOME){ke=nt.join(process.env.USERPROFILE||"",".gnupg")}return ke}));const gpgConnectAgent=ke=>tt(void 0,void 0,void 0,(function*(){return yield rt.getExecOutput(`gpg-connect-agent "${ke}" /bye`,[],{ignoreReturnCode:true,silent:true}).then((ke=>{if(ke.stderr.length>0&&ke.exitCode!=0){throw new Error(ke.stderr)}for(const Ae of ke.stdout.replace(/\r/g,"").trim().split(/\n/g)){if(Ae.startsWith("ERR")){throw new Error(Ae)}}return ke.stdout.trim()}))}));const getVersion=()=>tt(void 0,void 0,void 0,(function*(){return yield rt.getExecOutput("gpg",["--version"],{ignoreReturnCode:true,silent:true}).then((ke=>{if(ke.stderr.length>0&&ke.exitCode!=0){throw new Error(ke.stderr)}let Ae="";let Ce="";for(const ze of ke.stdout.replace(/\r/g,"").trim().split(/\n/g)){if(ze.startsWith("gpg (GnuPG) ")){Ae=ze.substr("gpg (GnuPG) ".length).trim()}else if(ze.startsWith("gpg (GnuPG/MacGPG2) ")){Ae=ze.substr("gpg (GnuPG/MacGPG2) ".length).trim()}else if(ze.startsWith("libgcrypt ")){Ce=ze.substr("libgcrypt ".length).trim()}}return{gnupg:Ae,libgcrypt:Ce}}))}));Ae.getVersion=getVersion;const getDirs=()=>tt(void 0,void 0,void 0,(function*(){return yield rt.getExecOutput("gpgconf",["--list-dirs"],{ignoreReturnCode:true,silent:true}).then((ke=>{if(ke.stderr.length>0&&ke.exitCode!=0){throw new Error(ke.stderr)}let Ae="";let Ce="";let ze="";let qe="";for(const Ve of ke.stdout.replace(/\r/g,"").trim().split(/\n/g)){if(Ve.startsWith("libdir:")){Ae=Ve.substr("libdir:".length).replace("%3a",":").trim()}else if(Ve.startsWith("libexecdir:")){Ce=Ve.substr("libexecdir:".length).replace("%3a",":").trim()}else if(Ve.startsWith("datadir:")){ze=Ve.substr("datadir:".length).replace("%3a",":").trim()}else if(Ve.startsWith("homedir:")){qe=Ve.substr("homedir:".length).replace("%3a",":").trim()}}return{libdir:Ae,libexecdir:Ce,datadir:ze,homedir:qe}}))}));Ae.getDirs=getDirs;const importKey=ke=>tt(void 0,void 0,void 0,(function*(){const Ae=it.mkdtempSync(nt.join(ot.tmpdir(),"ghaction-import-gpg-"));const Ce=`${Ae}/key.pgp`;it.writeFileSync(Ce,(yield ct.isArmored(ke))?ke:Buffer.from(ke,"base64").toString(),{mode:384});return yield rt.getExecOutput("gpg",["--import","--batch","--yes",Ce],{ignoreReturnCode:true,silent:true}).then((ke=>{if(ke.stderr.length>0&&ke.exitCode!=0){throw new Error(ke.stderr)}if(ke.stderr!=""){return ke.stderr.trim()}return ke.stdout.trim()})).finally((()=>{it.unlinkSync(Ce)}))}));Ae.importKey=importKey;const getKeygrips=ke=>tt(void 0,void 0,void 0,(function*(){return yield rt.getExecOutput("gpg",["--batch","--with-colons","--with-keygrip","--list-secret-keys",ke],{ignoreReturnCode:true,silent:true}).then((ke=>{const Ae=[];for(const Ce of ke.stdout.replace(/\r/g,"").trim().split(/\n/g)){if(Ce.startsWith("grp")){Ae.push(Ce.replace(/(grp|:)/g,"").trim())}}return Ae}))}));Ae.getKeygrips=getKeygrips;const parseKeygripFromGpgColonsOutput=(ke,Ae)=>{let Ce="";let ze=false;const qe=ke.replace(/\r/g,"").trim().split(/\n/g);for(const ke of qe){if(ke.startsWith(`fpr:`)&&ke.includes(`:${Ae}:`)){ze=true;continue}if(ke.startsWith("grp:")&&ze){Ce=ke.replace(/(grp|:)/g,"").trim();break}}return Ce};Ae.parseKeygripFromGpgColonsOutput=parseKeygripFromGpgColonsOutput;const getKeygrip=ke=>tt(void 0,void 0,void 0,(function*(){return yield rt.getExecOutput("gpg",["--batch","--with-colons","--with-keygrip","--list-secret-keys",ke],{ignoreReturnCode:true,silent:true}).then((Ce=>(0,Ae.parseKeygripFromGpgColonsOutput)(Ce.stdout,ke)))}));Ae.getKeygrip=getKeygrip;const configureAgent=ke=>tt(void 0,void 0,void 0,(function*(){const Ae=nt.join(yield getGnupgHome(),"gpg-agent.conf");yield it.writeFile(Ae,ke,(function(ke){if(ke)throw ke}));yield gpgConnectAgent("RELOADAGENT")}));Ae.configureAgent=configureAgent;const presetPassphrase=(ke,Ae)=>tt(void 0,void 0,void 0,(function*(){const Ce=Buffer.from(Ae,"utf8").toString("hex").toUpperCase();yield gpgConnectAgent(`PRESET_PASSPHRASE ${ke} -1 ${Ce}`);return yield gpgConnectAgent(`KEYINFO ${ke}`)}));Ae.presetPassphrase=presetPassphrase;const deleteKey=ke=>tt(void 0,void 0,void 0,(function*(){yield rt.getExecOutput("gpg",["--batch","--yes","--delete-secret-keys",ke],{ignoreReturnCode:true,silent:true}).then((ke=>{if(ke.stderr.length>0&&ke.exitCode!=0){throw new Error(ke.stderr)}}));yield rt.getExecOutput("gpg",["--batch","--yes","--delete-keys",ke],{ignoreReturnCode:true,silent:true}).then((ke=>{if(ke.stderr.length>0&&ke.exitCode!=0){throw new Error(ke.stderr)}}))}));Ae.deleteKey=deleteKey;const killAgent=()=>tt(void 0,void 0,void 0,(function*(){yield gpgConnectAgent("KILLAGENT")}));Ae.killAgent=killAgent},399:function(ke,Ae,Ce){"use strict";var ze=this&&this.__createBinding||(Object.create?function(ke,Ae,Ce,ze){if(ze===undefined)ze=Ce;var qe=Object.getOwnPropertyDescriptor(Ae,Ce);if(!qe||("get"in qe?!Ae.__esModule:qe.writable||qe.configurable)){qe={enumerable:true,get:function(){return Ae[Ce]}}}Object.defineProperty(ke,ze,qe)}:function(ke,Ae,Ce,ze){if(ze===undefined)ze=Ce;ke[ze]=Ae[Ce]});var qe=this&&this.__setModuleDefault||(Object.create?function(ke,Ae){Object.defineProperty(ke,"default",{enumerable:true,value:Ae})}:function(ke,Ae){ke["default"]=Ae});var Ve=this&&this.__importStar||function(ke){if(ke&&ke.__esModule)return ke;var Ae={};if(ke!=null)for(var Ce in ke)if(Ce!=="default"&&Object.prototype.hasOwnProperty.call(ke,Ce))ze(Ae,ke,Ce);qe(Ae,ke);return Ae};var tt=this&&this.__awaiter||function(ke,Ae,Ce,ze){function adopt(ke){return ke instanceof Ce?ke:new Ce((function(Ae){Ae(ke)}))}return new(Ce||(Ce=Promise))((function(Ce,qe){function fulfilled(ke){try{step(ze.next(ke))}catch(ke){qe(ke)}}function rejected(ke){try{step(ze["throw"](ke))}catch(ke){qe(ke)}}function step(ke){ke.done?Ce(ke.value):adopt(ke.value).then(fulfilled,rejected)}step((ze=ze.apply(ke,Ae||[])).next())}))};Object.defineProperty(Ae,"__esModule",{value:true});const rt=Ve(Ce(2186));const it=Ve(Ce(8954));const nt=Ve(Ce(6350));const ot=Ve(Ce(3759));const ct=Ve(Ce(5728));const ht=Ve(Ce(963));function run(){return tt(this,void 0,void 0,(function*(){try{const ke=yield it.getInputs();if(ke.workdir&&ke.workdir!=="."){rt.info(`Using ${ke.workdir} as working directory...`);process.chdir(ke.workdir)}const Ae=yield ot.getVersion();const Ce=yield ot.getDirs();yield rt.group(`GnuPG info`,(()=>tt(this,void 0,void 0,(function*(){rt.info(`Version : ${Ae.gnupg} (libgcrypt ${Ae.libgcrypt})`);rt.info(`Libdir : ${Ce.libdir}`);rt.info(`Libexecdir : ${Ce.libexecdir}`);rt.info(`Datadir : ${Ce.datadir}`);rt.info(`Homedir : ${Ce.homedir}`)}))));const ze=yield ct.readPrivateKey(ke.gpgPrivateKey);yield rt.group(`GPG private key info`,(()=>tt(this,void 0,void 0,(function*(){rt.info(`Fingerprint : ${ze.fingerprint}`);rt.info(`KeyID : ${ze.keyID}`);rt.info(`Name : ${ze.name}`);rt.info(`Email : ${ze.email}`);rt.info(`CreationTime : ${ze.creationTime}`)}))));ht.setFingerprint(ze.fingerprint);let qe=ze.fingerprint;if(ke.fingerprint){qe=ke.fingerprint}yield rt.group(`Fingerprint to use`,(()=>tt(this,void 0,void 0,(function*(){rt.info(qe)}))));yield rt.group(`Importing GPG private key`,(()=>tt(this,void 0,void 0,(function*(){yield ot.importKey(ke.gpgPrivateKey).then((ke=>{rt.info(ke)}))}))));if(ke.passphrase&&!ke.fingerprint){rt.info("Configuring GnuPG agent");yield ot.configureAgent(ot.agentConfig);yield rt.group(`Getting keygrips`,(()=>tt(this,void 0,void 0,(function*(){for(const Ae of yield ot.getKeygrips(qe)){rt.info(`Presetting passphrase for ${Ae}`);yield ot.presetPassphrase(Ae,ke.passphrase).then((ke=>{rt.debug(ke)}))}}))))}if(ke.passphrase&&ke.fingerprint){rt.info("Configuring GnuPG agent");yield ot.configureAgent(ot.agentConfig);yield rt.group(`Getting keygrip for fingerprint`,(()=>tt(this,void 0,void 0,(function*(){const Ae=yield ot.getKeygrip(qe);rt.info(`Presetting passphrase for key ${qe} with keygrip ${Ae}`);yield ot.presetPassphrase(Ae,ke.passphrase).then((ke=>{rt.debug(ke)}))}))))}yield rt.group(`Setting outputs`,(()=>tt(this,void 0,void 0,(function*(){rt.info(`fingerprint=${qe}`);it.setOutput("fingerprint",qe);rt.info(`keyid=${ze.keyID}`);it.setOutput("keyid",ze.keyID);rt.info(`name=${ze.name}`);it.setOutput("name",ze.name);rt.info(`email=${ze.email}`);it.setOutput("email",ze.email)}))));if(ke.gitUserSigningkey){rt.info("Setting GPG signing keyID for this Git repository");yield nt.setConfig("user.signingkey",ze.keyID,ke.gitConfigGlobal);const Ae=ke.gitCommitterEmail||ze.email;const Ce=ke.gitCommitterName||ze.name;if(Ae!=ze.email){rt.setFailed(`Committer email "${ke.gitCommitterEmail}" (name: "${ke.gitCommitterName}") does not match GPG private key email "${ze.email}" (name: "${ze.name}")`);return}rt.info(`Configuring Git committer (${Ce} <${Ae}>)`);yield nt.setConfig("user.name",Ce,ke.gitConfigGlobal);yield nt.setConfig("user.email",Ae,ke.gitConfigGlobal);if(ke.gitCommitGpgsign){rt.info("Sign all commits automatically");yield nt.setConfig("commit.gpgsign","true",ke.gitConfigGlobal)}if(ke.gitTagGpgsign){rt.info("Sign all tags automatically");yield nt.setConfig("tag.gpgsign","true",ke.gitConfigGlobal)}if(ke.gitPushGpgsign){rt.info("Sign all pushes automatically");yield nt.setConfig("push.gpgsign",ke.gitPushGpgsign,ke.gitConfigGlobal)}}}catch(ke){rt.setFailed(ke.message)}}))}function cleanup(){return tt(this,void 0,void 0,(function*(){if(ht.fingerprint.length<=0){rt.debug("Primary key fingerprint is not defined. Skipping cleanup.");return}try{rt.info(`Removing key ${ht.fingerprint}`);yield ot.deleteKey(ht.fingerprint);rt.info("Killing GnuPG agent");yield ot.killAgent()}catch(ke){rt.warning(ke.message)}}))}if(!ht.IsPost){run()}else{cleanup()}},5728:function(ke,Ae,Ce){"use strict";var ze=this&&this.__createBinding||(Object.create?function(ke,Ae,Ce,ze){if(ze===undefined)ze=Ce;var qe=Object.getOwnPropertyDescriptor(Ae,Ce);if(!qe||("get"in qe?!Ae.__esModule:qe.writable||qe.configurable)){qe={enumerable:true,get:function(){return Ae[Ce]}}}Object.defineProperty(ke,ze,qe)}:function(ke,Ae,Ce,ze){if(ze===undefined)ze=Ce;ke[ze]=Ae[Ce]});var qe=this&&this.__setModuleDefault||(Object.create?function(ke,Ae){Object.defineProperty(ke,"default",{enumerable:true,value:Ae})}:function(ke,Ae){ke["default"]=Ae});var Ve=this&&this.__importStar||function(ke){if(ke&&ke.__esModule)return ke;var Ae={};if(ke!=null)for(var Ce in ke)if(Ce!=="default"&&Object.prototype.hasOwnProperty.call(ke,Ce))ze(Ae,ke,Ce);qe(Ae,ke);return Ae};var tt=this&&this.__awaiter||function(ke,Ae,Ce,ze){function adopt(ke){return ke instanceof Ce?ke:new Ce((function(Ae){Ae(ke)}))}return new(Ce||(Ce=Promise))((function(Ce,qe){function fulfilled(ke){try{step(ze.next(ke))}catch(ke){qe(ke)}}function rejected(ke){try{step(ze["throw"](ke))}catch(ke){qe(ke)}}function step(ke){ke.done?Ce(ke.value):adopt(ke.value).then(fulfilled,rejected)}step((ze=ze.apply(ke,Ae||[])).next())}))};var rt=this&&this.__importDefault||function(ke){return ke&&ke.__esModule?ke:{default:ke}};Object.defineProperty(Ae,"__esModule",{value:true});Ae.isArmored=Ae.generateKeyPair=Ae.readPrivateKey=void 0;const it=Ve(Ce(7946));const nt=rt(Ce(2764));const readPrivateKey=ke=>tt(void 0,void 0,void 0,(function*(){const Ce=yield it.readKey({armoredKey:(yield(0,Ae.isArmored)(ke))?ke:Buffer.from(ke,"base64").toString()});const ze=yield Ce.getPrimaryUser().then((ke=>{var Ae;return(0,nt.default)((Ae=ke.user.userID)===null||Ae===void 0?void 0:Ae.userID)[0]}));return{fingerprint:Ce.getFingerprint().toUpperCase(),keyID:Ce.getKeyID().toHex().toUpperCase(),name:ze.name,email:ze.address,creationTime:Ce.getCreationTime()}}));Ae.readPrivateKey=readPrivateKey;const generateKeyPair=(ke,Ae,Ce,ze)=>tt(void 0,void 0,void 0,(function*(){const qe=yield it.generateKey({userIDs:[{name:ke,email:Ae}],passphrase:Ce,type:ze});return{publicKey:qe.publicKey.replace(/\r\n/g,"\n").trim(),privateKey:qe.privateKey.replace(/\r\n/g,"\n").trim()}}));Ae.generateKeyPair=generateKeyPair;const isArmored=ke=>tt(void 0,void 0,void 0,(function*(){return ke.trimLeft().startsWith("---")}));Ae.isArmored=isArmored},963:function(ke,Ae,Ce){"use strict";var ze=this&&this.__createBinding||(Object.create?function(ke,Ae,Ce,ze){if(ze===undefined)ze=Ce;var qe=Object.getOwnPropertyDescriptor(Ae,Ce);if(!qe||("get"in qe?!Ae.__esModule:qe.writable||qe.configurable)){qe={enumerable:true,get:function(){return Ae[Ce]}}}Object.defineProperty(ke,ze,qe)}:function(ke,Ae,Ce,ze){if(ze===undefined)ze=Ce;ke[ze]=Ae[Ce]});var qe=this&&this.__setModuleDefault||(Object.create?function(ke,Ae){Object.defineProperty(ke,"default",{enumerable:true,value:Ae})}:function(ke,Ae){ke["default"]=Ae});var Ve=this&&this.__importStar||function(ke){if(ke&&ke.__esModule)return ke;var Ae={};if(ke!=null)for(var Ce in ke)if(Ce!=="default"&&Object.prototype.hasOwnProperty.call(ke,Ce))ze(Ae,ke,Ce);qe(Ae,ke);return Ae};Object.defineProperty(Ae,"__esModule",{value:true});Ae.setFingerprint=Ae.fingerprint=Ae.IsPost=void 0;const tt=Ve(Ce(2186));Ae.IsPost=!!process.env["STATE_isPost"];Ae.fingerprint=process.env["STATE_fingerprint"]||"";function setFingerprint(ke){tt.saveState("fingerprint",ke)}Ae.setFingerprint=setFingerprint;if(!Ae.IsPost){tt.saveState("isPost","true")}},9491:ke=>{"use strict";ke.exports=require("assert")},4300:ke=>{"use strict";ke.exports=require("buffer")},2081:ke=>{"use strict";ke.exports=require("child_process")},6113:ke=>{"use strict";ke.exports=require("crypto")},2361:ke=>{"use strict";ke.exports=require("events")},7147:ke=>{"use strict";ke.exports=require("fs")},3685:ke=>{"use strict";ke.exports=require("http")},5687:ke=>{"use strict";ke.exports=require("https")},1808:ke=>{"use strict";ke.exports=require("net")},2037:ke=>{"use strict";ke.exports=require("os")},1017:ke=>{"use strict";ke.exports=require("path")},2781:ke=>{"use strict";ke.exports=require("stream")},1576:ke=>{"use strict";ke.exports=require("string_decoder")},9512:ke=>{"use strict";ke.exports=require("timers")},4404:ke=>{"use strict";ke.exports=require("tls")},3837:ke=>{"use strict";ke.exports=require("util")},9796:ke=>{"use strict";ke.exports=require("zlib")}};var Ae={};function __nccwpck_require__(Ce){var ze=Ae[Ce];if(ze!==undefined){return ze.exports}var qe=Ae[Ce]={id:Ce,loaded:false,exports:{}};var Ve=true;try{ke[Ce].call(qe.exports,qe,qe.exports,__nccwpck_require__);Ve=false}finally{if(Ve)delete Ae[Ce]}qe.loaded=true;return qe.exports}(()=>{__nccwpck_require__.nmd=ke=>{ke.paths=[];if(!ke.children)ke.children=[];return ke}})();if(typeof __nccwpck_require__!=="undefined")__nccwpck_require__.ab=__dirname+"/";var Ce=__nccwpck_require__(399);module.exports=Ce})(); //# sourceMappingURL=index.js.map