diff --git a/package.json b/package.json index 76c7cbffbb6e..20602cc71f07 100644 --- a/package.json +++ b/package.json @@ -98,6 +98,7 @@ "critters": "0.0.6", "cross-env": "6.0.3", "cross-spawn": "6.0.5", + "dd-trace": "2.3.0", "es5-ext": "0.10.53", "escape-string-regexp": "2.0.0", "eslint": "7.24.0", @@ -110,6 +111,7 @@ "faker": "5.5.3", "faunadb": "2.6.1", "firebase": "7.14.5", + "flat": "5.0.2", "fs-extra": "9.0.0", "get-port": "5.1.1", "glob": "7.1.6", diff --git a/packages/next/compiled/@vercel/nft/index.js b/packages/next/compiled/@vercel/nft/index.js index 20d651e27a67..63d61ba7bdbb 100644 --- a/packages/next/compiled/@vercel/nft/index.js +++ b/packages/next/compiled/@vercel/nft/index.js @@ -1,4 +1,4 @@ -(()=>{var __webpack_modules__={111:(e,t,r)=>{"use strict";e.exports=t;t.mockS3Http=r(7048).get_mockS3Http();t.mockS3Http("on");const a=t.mockS3Http("get");const o=r(7147);const s=r(1017);const u=r(1400);const c=r(9658);c.disableProgress();const d=r(5677);const f=r(2361).EventEmitter;const p=r(3837).inherits;const h=["clean","install","reinstall","build","rebuild","package","testpackage","publish","unpublish","info","testbinary","reveal","configure"];const v={};c.heading="node-pre-gyp";if(a){c.warn(`mocking s3 to ${process.env.node_pre_gyp_mock_s3}`)}Object.defineProperty(t,"find",{get:function(){return r(3093).find},enumerable:true});function Run({package_json_path:e="./package.json",argv:t}){this.package_json_path=e;this.commands={};const r=this;h.forEach((e=>{r.commands[e]=function(t,a){c.verbose("command",e,t);return require("./"+e)(r,t,a)}}));this.parseArgv(t);this.binaryHostSet=false}p(Run,f);t.Run=Run;const _=Run.prototype;_.package=r(9286);_.configDefs={help:Boolean,arch:String,debug:Boolean,directory:String,proxy:String,loglevel:String};_.shorthands={release:"--no-debug",C:"--directory",debug:"--debug",j:"--jobs",silent:"--loglevel=silent",silly:"--loglevel=silly",verbose:"--loglevel=verbose"};_.aliases=v;_.parseArgv=function parseOpts(e){this.opts=u(this.configDefs,this.shorthands,e);this.argv=this.opts.argv.remain.slice();const t=this.todo=[];e=this.argv.map((e=>{if(e in this.aliases){e=this.aliases[e]}return e}));e.slice().forEach((r=>{if(r in this.commands){const a=e.splice(0,e.indexOf(r));e.shift();if(t.length>0){t[t.length-1].args=a}t.push({name:r,args:[]})}}));if(t.length>0){t[t.length-1].args=e.splice(0)}let r=this.package_json_path;if(this.opts.directory){r=s.join(this.opts.directory,r)}this.package_json=JSON.parse(o.readFileSync(r));this.todo=d.expand_commands(this.package_json,this.opts,t);const a="npm_config_";Object.keys(process.env).forEach((e=>{if(e.indexOf(a)!==0)return;const t=process.env[e];if(e===a+"loglevel"){c.level=t}else{e=e.substring(a.length);if(e==="argv"){if(this.opts.argv&&this.opts.argv.remain&&this.opts.argv.remain.length){}else{this.opts[e]=t}}else{this.opts[e]=t}}}));if(this.opts.loglevel){c.level=this.opts.loglevel}c.resume()};_.setBinaryHostProperty=function(e){if(this.binaryHostSet){return this.package_json.binary.host}const t=this.package_json;if(!t||!t.binary||t.binary.host){return""}if(!t.binary.staging_host||!t.binary.production_host){return""}let r="production_host";if(e==="publish"){r="staging_host"}const a=process.env.node_pre_gyp_s3_host;if(a==="staging"||a==="production"){r=`${a}_host`}else if(this.opts["s3_host"]==="staging"||this.opts["s3_host"]==="production"){r=`${this.opts["s3_host"]}_host`}else if(this.opts["s3_host"]||a){throw new Error(`invalid s3_host ${this.opts["s3_host"]||a}`)}t.binary.host=t.binary[r];this.binaryHostSet=true;return t.binary.host};_.usage=function usage(){const e=[""," Usage: node-pre-gyp [options]",""," where is one of:",h.map((e=>" - "+e+" - "+require("./"+e).usage)).join("\n"),"","node-pre-gyp@"+this.version+" "+s.resolve(__dirname,".."),"node@"+process.versions.node].join("\n");return e};Object.defineProperty(_,"version",{get:function(){return this.package.version},enumerable:true})},3093:(e,t,r)=>{"use strict";const a=r(111);const o=r(302);const s=r(5677);const u=r(7147).existsSync||r(1017).existsSync;const c=r(1017);e.exports=t;t.usage="Finds the require path for the node-pre-gyp installed module";t.validate=function(e,t){o.validate_config(e,t)};t.find=function(e,t){if(!u(e)){throw new Error(e+"does not exist")}const r=new a.Run({package_json_path:e,argv:process.argv});r.setBinaryHostProperty();const d=r.package_json;o.validate_config(d,t);let f;if(s.get_napi_build_versions(d,t)){f=s.get_best_napi_build_version(d,t)}t=t||{};if(!t.module_root)t.module_root=c.dirname(e);const p=o.evaluate(d,t,f);return p.module}},5677:(e,t,r)=>{"use strict";const a=r(7147);e.exports=t;const o=process.version.substr(1).replace(/-.*$/,"").split(".").map((e=>+e));const s=["build","clean","configure","package","publish","reveal","testbinary","testpackage","unpublish"];const u="napi_build_version=";e.exports.get_napi_version=function(){let e=process.versions.napi;if(!e){if(o[0]===9&&o[1]>=3)e=2;else if(o[0]===8)e=1}return e};e.exports.get_napi_version_as_string=function(t){const r=e.exports.get_napi_version(t);return r?""+r:""};e.exports.validate_package_json=function(t,r){const a=t.binary;const o=pathOK(a.module_path);const s=pathOK(a.remote_path);const u=pathOK(a.package_name);const c=e.exports.get_napi_build_versions(t,r,true);const d=e.exports.get_napi_build_versions_raw(t);if(c){c.forEach((e=>{if(!(parseInt(e,10)===e&&e>0)){throw new Error("All values specified in napi_versions must be positive integers.")}}))}if(c&&(!o||!s&&!u)){throw new Error("When napi_versions is specified; module_path and either remote_path or "+"package_name must contain the substitution string '{napi_build_version}`.")}if((o||s||u)&&!d){throw new Error("When the substitution string '{napi_build_version}` is specified in "+"module_path, remote_path, or package_name; napi_versions must also be specified.")}if(c&&!e.exports.get_best_napi_build_version(t,r)&&e.exports.build_napi_only(t)){throw new Error("The Node-API version of this Node instance is "+e.exports.get_napi_version(r?r.target:undefined)+". "+"This module supports Node-API version(s) "+e.exports.get_napi_build_versions_raw(t)+". "+"This Node instance cannot run this module.")}if(d&&!c&&e.exports.build_napi_only(t)){throw new Error("The Node-API version of this Node instance is "+e.exports.get_napi_version(r?r.target:undefined)+". "+"This module supports Node-API version(s) "+e.exports.get_napi_build_versions_raw(t)+". "+"This Node instance cannot run this module.")}};function pathOK(e){return e&&(e.indexOf("{napi_build_version}")!==-1||e.indexOf("{node_napi_label}")!==-1)}e.exports.expand_commands=function(t,r,a){const o=[];const c=e.exports.get_napi_build_versions(t,r);a.forEach((a=>{if(c&&a.name==="install"){const s=e.exports.get_best_napi_build_version(t,r);const c=s?[u+s]:[];o.push({name:a.name,args:c})}else if(c&&s.indexOf(a.name)!==-1){c.forEach((e=>{const t=a.args.slice();t.push(u+e);o.push({name:a.name,args:t})}))}else{o.push(a)}}));return o};e.exports.get_napi_build_versions=function(t,a,o){const s=r(9658);let u=[];const c=e.exports.get_napi_version(a?a.target:undefined);if(t.binary&&t.binary.napi_versions){t.binary.napi_versions.forEach((e=>{const t=u.indexOf(e)!==-1;if(!t&&c&&e<=c){u.push(e)}else if(o&&!t&&c){s.info("This Node instance does not support builds for Node-API version",e)}}))}if(a&&a["build-latest-napi-version-only"]){let e=0;u.forEach((t=>{if(t>e)e=t}));u=e?[e]:[]}return u.length?u:undefined};e.exports.get_napi_build_versions_raw=function(e){const t=[];if(e.binary&&e.binary.napi_versions){e.binary.napi_versions.forEach((e=>{if(t.indexOf(e)===-1){t.push(e)}}))}return t.length?t:undefined};e.exports.get_command_arg=function(e){return u+e};e.exports.get_napi_build_version_from_command_args=function(e){for(let t=0;t{if(e>a&&e<=t){a=e}}))}return a===0?undefined:a};e.exports.build_napi_only=function(e){return e.binary&&e.binary.package_name&&e.binary.package_name.indexOf("{node_napi_label}")===-1}},7048:(e,t,r)=>{"use strict";e.exports=t;const a=r(7310);const o=r(7147);const s=r(1017);e.exports.detect=function(e,t){const r=e.hosted_path;const o=a.parse(r);t.prefix=!o.pathname||o.pathname==="/"?"":o.pathname.replace("/","");if(e.bucket&&e.region){t.bucket=e.bucket;t.region=e.region;t.endpoint=e.host;t.s3ForcePathStyle=e.s3ForcePathStyle}else{const e=o.hostname.split(".s3");const r=e[0];if(!r){return}if(!t.bucket){t.bucket=r}if(!t.region){const r=e[1].slice(1).split(".")[0];if(r==="amazonaws"){t.region="us-east-1"}else{t.region=r}}}};e.exports.get_s3=function(e){if(process.env.node_pre_gyp_mock_s3){const e=r(2722);const t=r(2037);e.config.basePath=`${t.tmpdir()}/mock`;const a=e.S3();const wcb=e=>(t,...r)=>{if(t&&t.code==="ENOENT"){t.code="NotFound"}return e(t,...r)};return{listObjects(e,t){return a.listObjects(e,wcb(t))},headObject(e,t){return a.headObject(e,wcb(t))},deleteObject(e,t){return a.deleteObject(e,wcb(t))},putObject(e,t){return a.putObject(e,wcb(t))}}}const t=r(918);t.config.update(e);const a=new t.S3;return{listObjects(e,t){return a.listObjects(e,t)},headObject(e,t){return a.headObject(e,t)},deleteObject(e,t){return a.deleteObject(e,t)},putObject(e,t){return a.putObject(e,t)}}};e.exports.get_mockS3Http=function(){let e=false;if(!process.env.node_pre_gyp_mock_s3){return()=>e}const t=r(3902);const a="https://mapbox-node-pre-gyp-public-testing-bucket.s3.us-east-1.amazonaws.com";const u=process.env.node_pre_gyp_mock_s3+"/mapbox-node-pre-gyp-public-testing-bucket";const mock_http=()=>{function get(e,t){const r=s.join(u,e.replace("%2B","+"));try{o.accessSync(r,o.constants.R_OK)}catch(e){return[404,"not found\n"]}return[200,o.createReadStream(r)]}return t(a).persist().get((()=>e)).reply(get)};mock_http(t,a,u);const mockS3Http=t=>{const r=e;if(t==="off"){e=false}else if(t==="on"){e=true}else if(t!=="get"){throw new Error(`illegal action for setMockHttp ${t}`)}return r};return mockS3Http}},302:(e,t,r)=>{"use strict";e.exports=t;const a=r(1017);const o=r(7849);const s=r(7310);const u=r(2157);const c=r(5677);let d;if(process.env.NODE_PRE_GYP_ABI_CROSSWALK){d=require(process.env.NODE_PRE_GYP_ABI_CROSSWALK)}else{d=r(2339)}const f={};Object.keys(d).forEach((e=>{const t=e.split(".")[0];if(!f[t]){f[t]=e}}));function get_electron_abi(e,t){if(!e){throw new Error("get_electron_abi requires valid runtime arg")}if(typeof t==="undefined"){throw new Error("Empty target version is not supported if electron is the target.")}const r=o.parse(t);return e+"-v"+r.major+"."+r.minor}e.exports.get_electron_abi=get_electron_abi;function get_node_webkit_abi(e,t){if(!e){throw new Error("get_node_webkit_abi requires valid runtime arg")}if(typeof t==="undefined"){throw new Error("Empty target version is not supported if node-webkit is the target.")}return e+"-v"+t}e.exports.get_node_webkit_abi=get_node_webkit_abi;function get_node_abi(e,t){if(!e){throw new Error("get_node_abi requires valid runtime arg")}if(!t){throw new Error("get_node_abi requires valid process.versions object")}const r=o.parse(t.node);if(r.major===0&&r.minor%2){return e+"-v"+t.node}else{return t.modules?e+"-v"+ +t.modules:"v8-"+t.v8.split(".").slice(0,2).join(".")}}e.exports.get_node_abi=get_node_abi;function get_runtime_abi(e,t){if(!e){throw new Error("get_runtime_abi requires valid runtime arg")}if(e==="node-webkit"){return get_node_webkit_abi(e,t||process.versions["node-webkit"])}else if(e==="electron"){return get_electron_abi(e,t||process.versions.electron)}else{if(e!=="node"){throw new Error("Unknown Runtime: '"+e+"'")}if(!t){return get_node_abi(e,process.versions)}else{let r;if(d[t]){r=d[t]}else{const e=t.split(".").map((e=>+e));if(e.length!==3){throw new Error("Unknown target version: "+t)}const a=e[0];let o=e[1];let s=e[2];if(a===1){while(true){if(o>0)--o;if(s>0)--s;const e=""+a+"."+o+"."+s;if(d[e]){r=d[e];console.log("Warning: node-pre-gyp could not find exact match for "+t);console.log("Warning: but node-pre-gyp successfully choose "+e+" as ABI compatible target");break}if(o===0&&s===0){break}}}else if(a>=2){if(f[a]){r=d[f[a]];console.log("Warning: node-pre-gyp could not find exact match for "+t);console.log("Warning: but node-pre-gyp successfully choose "+f[a]+" as ABI compatible target")}}else if(a===0){if(e[1]%2===0){while(--s>0){const e=""+a+"."+o+"."+s;if(d[e]){r=d[e];console.log("Warning: node-pre-gyp could not find exact match for "+t);console.log("Warning: but node-pre-gyp successfully choose "+e+" as ABI compatible target");break}}}}}if(!r){throw new Error("Unsupported target version: "+t)}const a={node:t,v8:r.v8+".0",modules:r.node_abi>1?r.node_abi:undefined};return get_node_abi(e,a)}}}e.exports.get_runtime_abi=get_runtime_abi;const p=["module_name","module_path","host"];function validate_config(e,t){const r=e.name+" package.json is not node-pre-gyp ready:\n";const a=[];if(!e.main){a.push("main")}if(!e.version){a.push("version")}if(!e.name){a.push("name")}if(!e.binary){a.push("binary")}const o=e.binary;if(o){p.forEach((e=>{if(!o[e]||typeof o[e]!=="string"){a.push("binary."+e)}}))}if(a.length>=1){throw new Error(r+"package.json must declare these properties: \n"+a.join("\n"))}if(o){const e=s.parse(o.host).protocol;if(e==="http:"){throw new Error("'host' protocol ("+e+") is invalid - only 'https:' is accepted")}}c.validate_package_json(e,t)}e.exports.validate_config=validate_config;function eval_template(e,t){Object.keys(t).forEach((r=>{const a="{"+r+"}";while(e.indexOf(a)>-1){e=e.replace(a,t[r])}}));return e}function fix_slashes(e){if(e.slice(-1)!=="/"){return e+"/"}return e}function drop_double_slashes(e){return e.replace(/\/\//g,"/")}function get_process_runtime(e){let t="node";if(e["node-webkit"]){t="node-webkit"}else if(e.electron){t="electron"}return t}e.exports.get_process_runtime=get_process_runtime;const h="{module_name}-v{version}-{node_abi}-{platform}-{arch}.tar.gz";const v="";e.exports.evaluate=function(e,t,r){t=t||{};validate_config(e,t);const d=e.version;const f=o.parse(d);const p=t.runtime||get_process_runtime(process.versions);const _={name:e.name,configuration:t.debug?"Debug":"Release",debug:t.debug,module_name:e.binary.module_name,version:f.version,prerelease:f.prerelease.length?f.prerelease.join("."):"",build:f.build.length?f.build.join("."):"",major:f.major,minor:f.minor,patch:f.patch,runtime:p,node_abi:get_runtime_abi(p,t.target),node_abi_napi:c.get_napi_version(t.target)?"napi":get_runtime_abi(p,t.target),napi_version:c.get_napi_version(t.target),napi_build_version:r||"",node_napi_label:r?"napi-v"+r:get_runtime_abi(p,t.target),target:t.target||"",platform:t.target_platform||process.platform,target_platform:t.target_platform||process.platform,arch:t.target_arch||process.arch,target_arch:t.target_arch||process.arch,libc:t.target_libc||u.family||"unknown",module_main:e.main,toolset:t.toolset||"",bucket:e.binary.bucket,region:e.binary.region,s3ForcePathStyle:e.binary.s3ForcePathStyle||false};const g=_.module_name.replace("-","_");const y=process.env["npm_config_"+g+"_binary_host_mirror"]||e.binary.host;_.host=fix_slashes(eval_template(y,_));_.module_path=eval_template(e.binary.module_path,_);if(t.module_root){_.module_path=a.join(t.module_root,_.module_path)}else{_.module_path=a.resolve(_.module_path)}_.module=a.join(_.module_path,_.module_name+".node");_.remote_path=e.binary.remote_path?drop_double_slashes(fix_slashes(eval_template(e.binary.remote_path,_))):v;const m=e.binary.package_name?e.binary.package_name:h;_.package_name=eval_template(m,_);_.staged_tarball=a.join("build/stage",_.remote_path,_.package_name);_.hosted_path=s.resolve(_.host,_.remote_path);_.hosted_tarball=s.resolve(_.hosted_path,_.package_name);return _}},1400:(e,t,r)=>{var a=process.env.DEBUG_NOPT||process.env.NOPT_DEBUG?function(){console.error.apply(console,arguments)}:function(){};var o=r(7310),s=r(1017),u=r(2781).Stream,c=r(5920),d=r(2037);e.exports=t=nopt;t.clean=clean;t.typeDefs={String:{type:String,validate:validateString},Boolean:{type:Boolean,validate:validateBoolean},url:{type:o,validate:validateUrl},Number:{type:Number,validate:validateNumber},path:{type:s,validate:validatePath},Stream:{type:u,validate:validateStream},Date:{type:Date,validate:validateDate}};function nopt(e,r,o,s){o=o||process.argv;e=e||{};r=r||{};if(typeof s!=="number")s=2;a(e,r,o,s);o=o.slice(s);var u={},c,d={remain:[],cooked:o,original:o.slice(0)};parse(o,u,d.remain,e,r);clean(u,e,t.typeDefs);u.argv=d;Object.defineProperty(u.argv,"toString",{value:function(){return this.original.map(JSON.stringify).join(" ")},enumerable:false});return u}function clean(e,r,o){o=o||t.typeDefs;var s={},u=[false,true,null,String,Array];Object.keys(e).forEach((function(c){if(c==="argv")return;var d=e[c],f=Array.isArray(d),p=r[c];if(!f)d=[d];if(!p)p=u;if(p===Array)p=u.concat(Array);if(!Array.isArray(p))p=[p];a("val=%j",d);a("types=",p);d=d.map((function(u){if(typeof u==="string"){a("string %j",u);u=u.trim();if(u==="null"&&~p.indexOf(null)||u==="true"&&(~p.indexOf(true)||~p.indexOf(Boolean))||u==="false"&&(~p.indexOf(false)||~p.indexOf(Boolean))){u=JSON.parse(u);a("jsonable %j",u)}else if(~p.indexOf(Number)&&!isNaN(u)){a("convert to number",u);u=+u}else if(~p.indexOf(Date)&&!isNaN(Date.parse(u))){a("convert to date",u);u=new Date(u)}}if(!r.hasOwnProperty(c)){return u}if(u===false&&~p.indexOf(null)&&!(~p.indexOf(false)||~p.indexOf(Boolean))){u=null}var d={};d[c]=u;a("prevalidated val",d,u,r[c]);if(!validate(d,c,u,r[c],o)){if(t.invalidHandler){t.invalidHandler(c,u,r[c],e)}else if(t.invalidHandler!==false){a("invalid: "+c+"="+u,r[c])}return s}a("validated val",d,u,r[c]);return d[c]})).filter((function(e){return e!==s}));if(!d.length&&p.indexOf(Array)===-1){a("VAL HAS NO LENGTH, DELETE IT",d,c,p.indexOf(Array));delete e[c]}else if(f){a(f,e[c],d);e[c]=d}else e[c]=d[0];a("k=%s val=%j",c,d,e[c])}))}function validateString(e,t,r){e[t]=String(r)}function validatePath(e,t,r){if(r===true)return false;if(r===null)return true;r=String(r);var a=process.platform==="win32",o=a?/^~(\/|\\)/:/^~\//,u=d.homedir();if(u&&r.match(o)){e[t]=s.resolve(u,r.substr(2))}else{e[t]=s.resolve(r)}return true}function validateNumber(e,t,r){a("validate Number %j %j %j",t,r,isNaN(r));if(isNaN(r))return false;e[t]=+r}function validateDate(e,t,r){var o=Date.parse(r);a("validate Date %j %j %j",t,r,o);if(isNaN(o))return false;e[t]=new Date(r)}function validateBoolean(e,t,r){if(r instanceof Boolean)r=r.valueOf();else if(typeof r==="string"){if(!isNaN(r))r=!!+r;else if(r==="null"||r==="false")r=false;else r=true}else r=!!r;e[t]=r}function validateUrl(e,t,r){r=o.parse(String(r));if(!r.host)return false;e[t]=r.href}function validateStream(e,t,r){if(!(r instanceof u))return false;e[t]=r}function validate(e,t,r,o,s){if(Array.isArray(o)){for(var u=0,c=o.length;u1){var _=h.indexOf("=");if(_>-1){v=true;var g=h.substr(_+1);h=h.substr(0,_);e.splice(p,1,h,g)}var y=resolveShort(h,s,f,d);a("arg=%j shRes=%j",h,y);if(y){a(h,y);e.splice.apply(e,[p,1].concat(y));if(h!==y[0]){p--;continue}}h=h.replace(/^-+/,"");var m=null;while(h.toLowerCase().indexOf("no-")===0){m=!m;h=h.substr(3)}if(d[h])h=d[h];var w=o[h];var x=Array.isArray(w);if(x&&w.length===1){x=false;w=w[0]}var E=w===Array||x&&w.indexOf(Array)!==-1;if(!o.hasOwnProperty(h)&&t.hasOwnProperty(h)){if(!Array.isArray(t[h]))t[h]=[t[h]];E=true}var S,k=e[p+1];var R=typeof m==="boolean"||w===Boolean||x&&w.indexOf(Boolean)!==-1||typeof w==="undefined"&&!v||k==="false"&&(w===null||x&&~w.indexOf(null));if(R){S=!m;if(k==="true"||k==="false"){S=JSON.parse(k);k=null;if(m)S=!S;p++}if(x&&k){if(~w.indexOf(k)){S=k;p++}else if(k==="null"&&~w.indexOf(null)){S=null;p++}else if(!k.match(/^-{2,}[^-]/)&&!isNaN(k)&&~w.indexOf(Number)){S=+k;p++}else if(!k.match(/^-[^-]/)&&~w.indexOf(String)){S=k;p++}}if(E)(t[h]=t[h]||[]).push(S);else t[h]=S;continue}if(w===String){if(k===undefined){k=""}else if(k.match(/^-{1,2}[^-]+/)){k="";p--}}if(k&&k.match(/^-{2,}$/)){k=undefined;p--}S=k===undefined?true:k;if(E)(t[h]=t[h]||[]).push(S);else t[h]=S;p++;continue}r.push(h)}}function resolveShort(e,t,r,o){e=e.replace(/^-+/,"");if(o[e]===e)return null;if(t[e]){if(t[e]&&!Array.isArray(t[e]))t[e]=t[e].split(/\s+/);return t[e]}var s=t.___singles;if(!s){s=Object.keys(t).filter((function(e){return e.length===1})).reduce((function(e,t){e[t]=true;return e}),{});t.___singles=s;a("shorthand singles",s)}var u=e.split("").filter((function(e){return s[e]}));if(u.join("")===e)return u.map((function(e){return t[e]})).reduce((function(e,t){return e.concat(t)}),[]);if(o[e]&&!t[e])return null;if(r[e])e=r[e];if(t[e]&&!Array.isArray(t[e]))t[e]=t[e].split(/\s+/);return t[e]}},6286:(e,t,r)=>{const a=r(9491);const o=r(1017);const s=r(7147);let u=undefined;try{u=r(3535)}catch(e){}const c={nosort:true,silent:true};let d=0;const f=process.platform==="win32";const defaults=e=>{const t=["unlink","chmod","stat","lstat","rmdir","readdir"];t.forEach((t=>{e[t]=e[t]||s[t];t=t+"Sync";e[t]=e[t]||s[t]}));e.maxBusyTries=e.maxBusyTries||3;e.emfileWait=e.emfileWait||1e3;if(e.glob===false){e.disableGlob=true}if(e.disableGlob!==true&&u===undefined){throw Error("glob dependency not found, set `options.disableGlob = true` if intentional")}e.disableGlob=e.disableGlob||false;e.glob=e.glob||c};const rimraf=(e,t,r)=>{if(typeof t==="function"){r=t;t={}}a(e,"rimraf: missing path");a.equal(typeof e,"string","rimraf: path should be a string");a.equal(typeof r,"function","rimraf: callback function required");a(t,"rimraf: invalid options argument provided");a.equal(typeof t,"object","rimraf: options should be object");defaults(t);let o=0;let s=null;let c=0;const next=e=>{s=s||e;if(--c===0)r(s)};const afterGlob=(e,a)=>{if(e)return r(e);c=a.length;if(c===0)return r();a.forEach((e=>{const CB=r=>{if(r){if((r.code==="EBUSY"||r.code==="ENOTEMPTY"||r.code==="EPERM")&&orimraf_(e,t,CB)),o*100)}if(r.code==="EMFILE"&&drimraf_(e,t,CB)),d++)}if(r.code==="ENOENT")r=null}d=0;next(r)};rimraf_(e,t,CB)}))};if(t.disableGlob||!u.hasMagic(e))return afterGlob(null,[e]);t.lstat(e,((r,a)=>{if(!r)return afterGlob(null,[e]);u(e,t.glob,afterGlob)}))};const rimraf_=(e,t,r)=>{a(e);a(t);a(typeof r==="function");t.lstat(e,((a,o)=>{if(a&&a.code==="ENOENT")return r(null);if(a&&a.code==="EPERM"&&f)fixWinEPERM(e,t,a,r);if(o&&o.isDirectory())return rmdir(e,t,a,r);t.unlink(e,(a=>{if(a){if(a.code==="ENOENT")return r(null);if(a.code==="EPERM")return f?fixWinEPERM(e,t,a,r):rmdir(e,t,a,r);if(a.code==="EISDIR")return rmdir(e,t,a,r)}return r(a)}))}))};const fixWinEPERM=(e,t,r,o)=>{a(e);a(t);a(typeof o==="function");t.chmod(e,438,(a=>{if(a)o(a.code==="ENOENT"?null:r);else t.stat(e,((a,s)=>{if(a)o(a.code==="ENOENT"?null:r);else if(s.isDirectory())rmdir(e,t,r,o);else t.unlink(e,o)}))}))};const fixWinEPERMSync=(e,t,r)=>{a(e);a(t);try{t.chmodSync(e,438)}catch(e){if(e.code==="ENOENT")return;else throw r}let o;try{o=t.statSync(e)}catch(e){if(e.code==="ENOENT")return;else throw r}if(o.isDirectory())rmdirSync(e,t,r);else t.unlinkSync(e)};const rmdir=(e,t,r,o)=>{a(e);a(t);a(typeof o==="function");t.rmdir(e,(a=>{if(a&&(a.code==="ENOTEMPTY"||a.code==="EEXIST"||a.code==="EPERM"))rmkids(e,t,o);else if(a&&a.code==="ENOTDIR")o(r);else o(a)}))};const rmkids=(e,t,r)=>{a(e);a(t);a(typeof r==="function");t.readdir(e,((a,s)=>{if(a)return r(a);let u=s.length;if(u===0)return t.rmdir(e,r);let c;s.forEach((a=>{rimraf(o.join(e,a),t,(a=>{if(c)return;if(a)return r(c=a);if(--u===0)t.rmdir(e,r)}))}))}))};const rimrafSync=(e,t)=>{t=t||{};defaults(t);a(e,"rimraf: missing path");a.equal(typeof e,"string","rimraf: path should be a string");a(t,"rimraf: missing options");a.equal(typeof t,"object","rimraf: options should be object");let r;if(t.disableGlob||!u.hasMagic(e)){r=[e]}else{try{t.lstatSync(e);r=[e]}catch(a){r=u.sync(e,t.glob)}}if(!r.length)return;for(let e=0;e{a(e);a(t);try{t.rmdirSync(e)}catch(a){if(a.code==="ENOENT")return;if(a.code==="ENOTDIR")throw r;if(a.code==="ENOTEMPTY"||a.code==="EEXIST"||a.code==="EPERM")rmkidsSync(e,t)}};const rmkidsSync=(e,t)=>{a(e);a(t);t.readdirSync(e).forEach((r=>rimrafSync(o.join(e,r),t)));const r=f?100:1;let s=0;do{let a=true;try{const o=t.rmdirSync(e,t);a=false;return o}finally{if(++sG,env:{NODE_ENV:u.UNKNOWN,[u.UNKNOWN]:true},[u.UNKNOWN]:true};const T=Symbol();const C=Symbol();const j=Symbol();const N=Symbol();const L=Symbol();const I=Symbol();const P=Symbol();const D=Symbol();const M=Symbol();const W={access:I,accessSync:I,createReadStream:I,exists:I,existsSync:I,fstat:I,fstatSync:I,lstat:I,lstatSync:I,open:I,readdir:P,readdirSync:P,readFile:I,readFileSync:I,stat:I,statSync:I};const F=Object.assign(Object.create(null),{bindings:{default:D},express:{default:function(){return{[u.UNKNOWN]:true,set:T,engine:C}}},fs:Object.assign({default:W},W),process:Object.assign({default:O},O),path:{default:{}},os:Object.assign({default:k.default},k.default),"@mapbox/node-pre-gyp":Object.assign({default:w.default},w.default),"node-pre-gyp":v.pregyp,"node-pre-gyp/lib/pre-binding":v.pregyp,"node-pre-gyp/lib/pre-binding.js":v.pregyp,"node-gyp-build":{default:M},nbind:{init:j,default:{init:j}},"resolve-from":{default:A.default},"strong-globalize":{default:{SetRootDir:N},SetRootDir:N},pkginfo:{default:L}});const B={_interopRequireDefault:_.normalizeDefaultRequire,_interopRequireWildcard:_.normalizeWildcardRequire,__importDefault:_.normalizeDefaultRequire,__importStar:_.normalizeWildcardRequire,MONGOOSE_DRIVER_PATH:undefined,URL:x.URL,Object:{assign:Object.assign}};B.global=B.GLOBAL=B.globalThis=B;const $=Symbol();v.pregyp.find[$]=true;const U=F.path;Object.keys(o.default).forEach((e=>{const t=o.default[e];if(typeof t==="function"){const r=function mockPath(){return t.apply(mockPath,arguments)};r[$]=true;U[e]=U.default[e]=r}else{U[e]=U.default[e]=t}}));U.resolve=U.default.resolve=function(...e){return o.default.resolve.apply(this,[G,...e])};U.resolve[$]=true;const H=new Set([".h",".cmake",".c",".cpp"]);const q=new Set(["CHANGELOG.md","README.md","readme.md","changelog.md"]);let G;const K=/^\/[^\/]+|^[a-z]:[\\/][^\\/]+/i;function isAbsolutePathOrUrl(e){if(e instanceof x.URL)return e.protocol==="file:";if(typeof e==="string"){if(e.startsWith("file:")){try{new x.URL(e);return true}catch(e){return false}}return K.test(e)}return false}const z=Symbol();const V=/([\/\\]\*\*[\/\\]\*)+/g;async function analyze(e,t,r){const a=new Set;const c=new Set;const _=new Set;const w=o.default.dirname(e);G=r.cwd;const k=h.getPackageBase(e);const emitAssetDirectory=e=>{if(!r.analysis.emitGlobs)return;const t=e.indexOf(u.WILDCARD);const s=t===-1?e.length:e.lastIndexOf(o.default.sep,t);const c=e.substr(0,s);const d=e.substr(s);const f=d.replace(u.wildcardRegEx,((e,t)=>d[t-1]===o.default.sep?"**/*":"*")).replace(V,"/**/*")||"/**/*";if(r.ignoreFn(o.default.relative(r.base,c+f)))return;A=A.then((async()=>{if(r.log)console.log("Globbing "+c+f);const e=await new Promise(((e,t)=>p.default(c+f,{mark:true,ignore:c+"/**/node_modules/**/*"},((r,a)=>r?t(r):e(a)))));e.filter((e=>!H.has(o.default.extname(e))&&!q.has(o.default.basename(e))&&!e.endsWith("/"))).forEach((e=>a.add(e)))}))};let A=Promise.resolve();t=t.replace(/^#![^\n\r]*[\r\n]/,"");let W;let U=false;try{W=S.parse(t,{ecmaVersion:"latest",allowReturnOutsideFunction:true});U=false}catch(t){const a=t&&t.message&&t.message.includes("sourceType: module");if(!a){r.warnings.add(new Error(`Failed to parse ${e} as script:\n${t&&t.message}`))}}if(!W){try{W=S.parse(t,{ecmaVersion:"latest",sourceType:"module",allowAwaitOutsideFunction:true});U=true}catch(t){r.warnings.add(new Error(`Failed to parse ${e} as module:\n${t&&t.message}`));return{assets:a,deps:c,imports:_,isESM:false}}}const Y=x.pathToFileURL(e).href;const Q=Object.assign(Object.create(null),{__dirname:{shadowDepth:0,value:{value:o.default.resolve(e,"..")}},__filename:{shadowDepth:0,value:{value:e}},process:{shadowDepth:0,value:{value:O}}});if(!U||r.mixedModules){Q.require={shadowDepth:0,value:{value:{[u.FUNCTION](e){c.add(e);const t=F[e];return t.default},resolve(t){return y.default(t,e,r)}}}};Q.require.value.value.resolve[$]=true}function setKnownBinding(e,t){if(e==="require")return;Q[e]={shadowDepth:0,value:t}}function getKnownBinding(e){const t=Q[e];if(t){if(t.shadowDepth===0){return t.value}}return undefined}function hasKnownBindingValue(e){const t=Q[e];return t&&t.shadowDepth===0}if((U||r.mixedModules)&&isAst(W)){for(const e of W.body){if(e.type==="ImportDeclaration"){const t=String(e.source.value);c.add(t);const r=F[t];if(r){for(const t of e.specifiers){if(t.type==="ImportNamespaceSpecifier")setKnownBinding(t.local.name,{value:r});else if(t.type==="ImportDefaultSpecifier"&&"default"in r)setKnownBinding(t.local.name,{value:r.default});else if(t.type==="ImportSpecifier"&&t.imported.name in r)setKnownBinding(t.local.name,{value:r[t.imported.name]})}}}else if(e.type==="ExportNamedDeclaration"||e.type==="ExportAllDeclaration"){if(e.source)c.add(String(e.source.value))}}}async function computePureStaticValue(e,t=true){const r=Object.create(null);Object.keys(B).forEach((e=>{r[e]={value:B[e]}}));Object.keys(Q).forEach((e=>{r[e]=getKnownBinding(e)}));r["import.meta"]={url:Y};const a=await u.evaluate(e,r,t);return a}let X;let Z;let J=false;function emitWildcardRequire(e){if(!r.analysis.emitGlobs||!e.startsWith("./")&&!e.startsWith("../"))return;e=o.default.resolve(w,e);const t=e.indexOf(u.WILDCARD);const s=t===-1?e.length:e.lastIndexOf(o.default.sep,t);const c=e.substr(0,s);const d=e.substr(s);let f=d.replace(u.wildcardRegEx,((e,t)=>d[t-1]===o.default.sep?"**/*":"*"))||"/**/*";if(!f.endsWith("*"))f+="?("+(r.ts?".ts|.tsx|":"")+".js|.json|.node)";if(r.ignoreFn(o.default.relative(r.base,c+f)))return;A=A.then((async()=>{if(r.log)console.log("Globbing "+c+f);const e=await new Promise(((e,t)=>p.default(c+f,{mark:true,ignore:c+"/**/node_modules/**/*"},((r,a)=>r?t(r):e(a)))));e.filter((e=>!H.has(o.default.extname(e))&&!q.has(o.default.basename(e))&&!e.endsWith("/"))).forEach((e=>a.add(e)))}))}async function processRequireArg(e,t=false){if(e.type==="ConditionalExpression"){await processRequireArg(e.consequent,t);await processRequireArg(e.alternate,t);return}if(e.type==="LogicalExpression"){await processRequireArg(e.left,t);await processRequireArg(e.right,t);return}let r=await computePureStaticValue(e,true);if(!r)return;if("value"in r&&typeof r.value==="string"){if(!r.wildcards)(t?_:c).add(r.value);else if(r.wildcards.length>=1)emitWildcardRequire(r.value)}else{if("then"in r&&typeof r.then==="string")(t?_:c).add(r.then);if("else"in r&&typeof r.else==="string")(t?_:c).add(r.else)}}let ee=s.attachScopes(W,"scope");if(isAst(W)){R.handleWrappers(W);await g.default({id:e,ast:W,emitAsset:e=>a.add(e),emitAssetDirectory:emitAssetDirectory,job:r})}async function backtrack(e,t){if(!X)throw new Error("Internal error: No staticChildNode for backtrack.");const r=await computePureStaticValue(e,true);if(r){if("value"in r&&typeof r.value!=="symbol"||"then"in r&&typeof r.then!=="symbol"&&typeof r.else!=="symbol"){Z=r;X=e;if(t)t.skip();return}}await emitStaticChildAsset()}await E(W,{async enter(t,s){var u;const p=t;const h=s;if(p.scope){ee=p.scope;for(const e in p.scope.declarations){if(e in Q)Q[e].shadowDepth++}}if(X)return;if(!h)return;if(p.type==="Identifier"){if(f.isIdentifierRead(p,h)&&r.analysis.computeFileReferences){let e;if(typeof(e=(u=getKnownBinding(p.name))===null||u===void 0?void 0:u.value)==="string"&&e.match(K)||e&&(typeof e==="function"||typeof e==="object")&&e[$]){Z={value:typeof e==="string"?e:undefined};X=p;await backtrack(h,this)}}}else if(r.analysis.computeFileReferences&&p.type==="MemberExpression"&&p.object.type==="MetaProperty"&&p.object.meta.name==="import"&&p.object.property.name==="meta"&&(p.property.computed?p.property.value:p.property.name)==="url"){Z={value:Y};X=p;await backtrack(h,this)}else if(p.type==="ImportExpression"){await processRequireArg(p.source,true);return}else if(p.type==="CallExpression"){if((!U||r.mixedModules)&&p.callee.type==="Identifier"&&p.arguments.length){if(p.callee.name==="require"&&Q.require.shadowDepth===0){await processRequireArg(p.arguments[0]);return}}else if((!U||r.mixedModules)&&p.callee.type==="MemberExpression"&&p.callee.object.type==="Identifier"&&p.callee.object.name==="module"&&"module"in Q===false&&p.callee.property.type==="Identifier"&&!p.callee.computed&&p.callee.property.name==="require"&&p.arguments.length){await processRequireArg(p.arguments[0]);return}const t=r.analysis.evaluatePureExpressions&&await computePureStaticValue(p.callee,false);if(t&&"value"in t&&typeof t.value==="function"&&t.value[$]&&r.analysis.computeFileReferences){Z=await computePureStaticValue(p,true);if(Z&&h){X=p;await backtrack(h,this)}}else if(t&&"value"in t&&typeof t.value==="symbol"){switch(t.value){case z:if(p.arguments.length===1&&p.arguments[0].type==="Literal"&&p.callee.type==="Identifier"&&Q.require.shadowDepth===0){await processRequireArg(p.arguments[0])}break;case D:if(p.arguments.length){const e=await computePureStaticValue(p.arguments[0],false);if(e&&"value"in e&&e.value){let t;if(typeof e.value==="object")t=e.value;else if(typeof e.value==="string")t={bindings:e.value};if(!t.path){t.path=true}t.module_root=k;let r;try{r=d.default(t)}catch(e){}if(r){Z={value:r};X=p;await emitStaticChildAsset()}}}break;case M:if(p.arguments.length===1&&p.arguments[0].type==="Identifier"&&p.arguments[0].name==="__dirname"&&Q.__dirname.shadowDepth===0){let e;try{e=m.default.path(w)}catch(e){}if(e){Z={value:e};X=p;await emitStaticChildAsset()}}break;case j:if(p.arguments.length){const e=await computePureStaticValue(p.arguments[0],false);if(e&&"value"in e&&(typeof e.value==="string"||typeof e.value==="undefined")){const t=v.nbind(e.value);if(t&&t.path){c.add(o.default.relative(w,t.path).replace(/\\/g,"/"));return this.skip()}}}break;case T:if(p.arguments.length===2&&p.arguments[0].type==="Literal"&&p.arguments[0].value==="view engine"&&!J){await processRequireArg(p.arguments[1]);return this.skip()}break;case C:J=true;break;case I:case P:if(p.arguments[0]&&r.analysis.computeFileReferences){Z=await computePureStaticValue(p.arguments[0],true);if(Z){X=p.arguments[0];if(t.value===P&&p.arguments[0].type==="Identifier"&&p.arguments[0].name==="__dirname"){emitAssetDirectory(w)}else{await backtrack(h,this)}return this.skip()}}break;case N:if(p.arguments[0]){const e=await computePureStaticValue(p.arguments[0],false);if(e&&"value"in e&&e.value)emitAssetDirectory(e.value+"/intl");return this.skip()}break;case L:let s=o.default.resolve(e,"../package.json");const u=o.default.resolve("/package.json");while(s!==u&&await r.stat(s)===null)s=o.default.resolve(s,"../../package.json");if(s!==u)a.add(s);break}}}else if(p.type==="VariableDeclaration"&&h&&!f.isVarLoop(h)&&r.analysis.evaluatePureExpressions){for(const e of p.declarations){if(!e.init)continue;const t=await computePureStaticValue(e.init,true);if(t){if(e.id.type==="Identifier"){setKnownBinding(e.id.name,t)}else if(e.id.type==="ObjectPattern"&&"value"in t){for(const r of e.id.properties){if(r.type!=="Property"||r.key.type!=="Identifier"||r.value.type!=="Identifier"||typeof t.value!=="object"||t.value===null||!(r.key.name in t.value))continue;setKnownBinding(r.value.name,{value:t.value[r.key.name]})}}if(!("value"in t)&&isAbsolutePathOrUrl(t.then)&&isAbsolutePathOrUrl(t.else)){Z=t;X=e.init;await emitStaticChildAsset()}}}}else if(p.type==="AssignmentExpression"&&h&&!f.isLoop(h)&&r.analysis.evaluatePureExpressions){if(!hasKnownBindingValue(p.left.name)){const e=await computePureStaticValue(p.right,false);if(e&&"value"in e){if(p.left.type==="Identifier"){setKnownBinding(p.left.name,e)}else if(p.left.type==="ObjectPattern"){for(const t of p.left.properties){if(t.type!=="Property"||t.key.type!=="Identifier"||t.value.type!=="Identifier"||typeof e.value!=="object"||e.value===null||!(t.key.name in e.value))continue;setKnownBinding(t.value.name,{value:e.value[t.key.name]})}}if(isAbsolutePathOrUrl(e.value)){Z=e;X=p.right;await emitStaticChildAsset()}}}}else if((!U||r.mixedModules)&&(p.type==="FunctionDeclaration"||p.type==="FunctionExpression"||p.type==="ArrowFunctionExpression")&&(p.arguments||p.params)[0]&&(p.arguments||p.params)[0].type==="Identifier"){let e;let t;if((p.type==="ArrowFunctionExpression"||p.type==="FunctionExpression")&&h&&h.type==="VariableDeclarator"&&h.id.type==="Identifier"){e=h.id;t=p.arguments||p.params}else if(p.id){e=p.id;t=p.arguments||p.params}if(e&&p.body.body){let r,a=false;for(let e=0;ee&&e.id&&e.id.type==="Identifier"&&e.init&&e.init.type==="CallExpression"&&e.init.callee.type==="Identifier"&&e.init.callee.name==="require"&&Q.require.shadowDepth===0&&e.init.arguments[0]&&e.init.arguments[0].type==="Identifier"&&e.init.arguments[0].name===t[0].name))}if(r&&p.body.body[e].type==="ReturnStatement"&&p.body.body[e].argument&&p.body.body[e].argument.type==="Identifier"&&p.body.body[e].argument.name===r.id.name){a=true;break}}if(a)setKnownBinding(e.name,{value:z})}}},async leave(e,t){const r=e;const a=t;if(r.scope){if(ee.parent){ee=ee.parent}for(const e in r.scope.declarations){if(e in Q){if(Q[e].shadowDepth>0)Q[e].shadowDepth--;else delete Q[e]}}}if(X&&a)await backtrack(a,this)}});await A;return{assets:a,deps:c,imports:_,isESM:U};async function emitAssetPath(e){const t=e.indexOf(u.WILDCARD);const s=t===-1?e.length:e.lastIndexOf(o.default.sep,t);const c=e.substr(0,s);try{var d=await r.stat(c);if(d===null){throw new Error("file not found")}}catch(e){return}if(t!==-1&&d.isFile())return;if(d.isFile()){a.add(e)}else if(d.isDirectory()){if(validWildcard(e))emitAssetDirectory(e)}}function validWildcard(t){let a="";if(t.endsWith(o.default.sep))a=o.default.sep;else if(t.endsWith(o.default.sep+u.WILDCARD))a=o.default.sep+u.WILDCARD;else if(t.endsWith(u.WILDCARD))a=u.WILDCARD;if(t===w+a)return false;if(t===G+a)return false;if(t.endsWith(o.default.sep+"node_modules"+a))return false;if(w.startsWith(t.substr(0,t.length-a.length)+o.default.sep))return false;if(k){const a=e.substr(0,e.indexOf(o.default.sep+"node_modules"))+o.default.sep+"node_modules"+o.default.sep;if(!t.startsWith(a)){if(r.log)console.log("Skipping asset emission of "+t.replace(u.wildcardRegEx,"*")+" for "+e+" as it is outside the package base "+k);return false}}return true}function resolveAbsolutePathOrUrl(e){return e instanceof x.URL?x.fileURLToPath(e):e.startsWith("file:")?x.fileURLToPath(new x.URL(e)):o.default.resolve(e)}async function emitStaticChildAsset(){if(!Z){return}if("value"in Z&&isAbsolutePathOrUrl(Z.value)){try{const e=resolveAbsolutePathOrUrl(Z.value);await emitAssetPath(e)}catch(e){}}else if("then"in Z&&"else"in Z&&isAbsolutePathOrUrl(Z.then)&&isAbsolutePathOrUrl(Z.else)){let e;try{e=resolveAbsolutePathOrUrl(Z.then)}catch(e){}let t;try{t=resolveAbsolutePathOrUrl(Z.else)}catch(e){}if(e)await emitAssetPath(e);if(t)await emitAssetPath(t)}else if(X&&X.type==="ArrayExpression"&&"value"in Z&&Z.value instanceof Array){for(const e of Z.value){try{const t=resolveAbsolutePathOrUrl(e);await emitAssetPath(t)}catch(e){}}}X=Z=undefined}}t["default"]=analyze;function isAst(e){return"body"in e}},9582:function(e,t,r){"use strict";var a=this&&this.__createBinding||(Object.create?function(e,t,r,a){if(a===undefined)a=r;Object.defineProperty(e,a,{enumerable:true,get:function(){return t[r]}})}:function(e,t,r,a){if(a===undefined)a=r;e[a]=t[r]});var o=this&&this.__exportStar||function(e,t){for(var r in e)if(r!=="default"&&!t.hasOwnProperty(r))a(t,e,r)};Object.defineProperty(t,"__esModule",{value:true});o(r(3864),t);var s=r(3471);Object.defineProperty(t,"nodeFileTrace",{enumerable:true,get:function(){return s.nodeFileTrace}})},3471:function(e,t,r){"use strict";var a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});t.Job=t.nodeFileTrace=void 0;const o=r(1017);const s=a(r(552));const u=a(r(8827));const c=a(r(2278));const d=r(2540);const f=r(2985);const p=r(1017);const h=s.default.promises.readFile;const v=s.default.promises.readlink;const _=s.default.promises.stat;function inPath(e,t){const r=p.join(t,o.sep);return e.startsWith(r)&&e!==r}async function nodeFileTrace(e,t={}){const r=new Job(t);if(t.readFile)r.readFile=t.readFile;if(t.stat)r.stat=t.stat;if(t.readlink)r.readlink=t.readlink;if(t.resolve)r.resolve=t.resolve;r.ts=true;await Promise.all(e.map((async e=>{const t=o.resolve(e);await r.emitFile(t,"initial");if(t.endsWith(".js")||t.endsWith(".cjs")||t.endsWith(".mjs")||t.endsWith(".node")||r.ts&&(t.endsWith(".ts")||t.endsWith(".tsx"))){return r.emitDependency(t)}return undefined})));const a={fileList:r.fileList,esmFileList:r.esmFileList,reasons:r.reasons,warnings:r.warnings};return a}t.nodeFileTrace=nodeFileTrace;class Job{constructor({base:e=process.cwd(),processCwd:t,exports:r,conditions:a=r||["node"],exportsOnly:s=false,paths:u={},ignore:c,log:f=false,mixedModules:p=false,ts:h=true,analysis:v={},cache:_}){this.reasons=new Map;this.ts=h;e=o.resolve(e);this.ignoreFn=e=>{if(e.startsWith(".."+o.sep))return true;return false};if(typeof c==="string")c=[c];if(typeof c==="function"){const e=c;this.ignoreFn=t=>{if(t.startsWith(".."+o.sep))return true;if(e(t))return true;return false}}else if(Array.isArray(c)){const t=c.map((t=>o.relative(e,o.resolve(e||process.cwd(),t))));this.ignoreFn=e=>{if(e.startsWith(".."+o.sep))return true;if(d.isMatch(e,t))return true;return false}}this.base=e;this.cwd=o.resolve(t||e);this.conditions=a;this.exportsOnly=s;const g={};for(const t of Object.keys(u)){const r=u[t].endsWith("/");const a=o.resolve(e,u[t]);g[t]=a+(r?"/":"")}this.paths=g;this.log=f;this.mixedModules=p;this.analysis={};if(v!==false){Object.assign(this.analysis,{emitGlobs:true,computeFileReferences:true,evaluatePureExpressions:true},v===true?{}:v)}this.fileCache=_&&_.fileCache||new Map;this.statCache=_&&_.statCache||new Map;this.symlinkCache=_&&_.symlinkCache||new Map;this.analysisCache=_&&_.analysisCache||new Map;if(_){_.fileCache=this.fileCache;_.statCache=this.statCache;_.symlinkCache=this.symlinkCache;_.analysisCache=this.analysisCache}this.fileList=new Set;this.esmFileList=new Set;this.processed=new Set;this.warnings=new Set}async readlink(e){const t=this.symlinkCache.get(e);if(t!==undefined)return t;try{const t=await v(e);const r=this.statCache.get(e);if(r)this.statCache.set(o.resolve(e,t),r);this.symlinkCache.set(e,t);return t}catch(t){if(t.code!=="EINVAL"&&t.code!=="ENOENT"&&t.code!=="UNKNOWN")throw t;this.symlinkCache.set(e,null);return null}}async isFile(e){const t=await this.stat(e);if(t)return t.isFile();return false}async isDir(e){const t=await this.stat(e);if(t)return t.isDirectory();return false}async stat(e){const t=this.statCache.get(e);if(t)return t;try{const t=await _(e);this.statCache.set(e,t);return t}catch(t){if(t.code==="ENOENT"){this.statCache.set(e,null);return null}throw t}}async resolve(e,t,r,a){return c.default(e,t,r,a)}async readFile(e){const t=this.fileCache.get(e);if(t!==undefined)return t;try{const t=(await h(e)).toString();this.fileCache.set(e,t);return t}catch(t){if(t.code==="ENOENT"||t.code==="EISDIR"){this.fileCache.set(e,null);return null}throw t}}async realpath(e,t,r=new Set){if(r.has(e))throw new Error("Recursive symlink detected resolving "+e);r.add(e);const a=await this.readlink(e);if(a){const s=o.dirname(e);const u=o.resolve(s,a);const c=await this.realpath(s,t);if(inPath(e,c))await this.emitFile(e,"resolve",t,true);return this.realpath(u,t,r)}if(!inPath(e,this.base))return e;return p.join(await this.realpath(o.dirname(e),t,r),o.basename(e))}async emitFile(e,t,r,a=false){if(!a){e=await this.realpath(e,r)}e=o.relative(this.base,e);if(r){r=o.relative(this.base,r)}let s=this.reasons.get(e);if(!s){s={type:t,ignored:false,parents:new Set};this.reasons.set(e,s)}if(r&&this.ignoreFn(e,r)){if(!this.fileList.has(e)&&s){s.ignored=true}return false}if(r){s.parents.add(r)}this.fileList.add(e);return true}async getPjsonBoundary(e){const t=e.indexOf(o.sep);let r;while((r=e.lastIndexOf(o.sep))>t){e=e.substr(0,r);if(await this.isFile(e+o.sep+"package.json"))return e}return undefined}async emitDependency(e,t){if(this.processed.has(e)){if(t){await this.emitFile(e,"dependency",t)}return}this.processed.add(e);const r=await this.emitFile(e,"dependency",t);if(!r)return;if(e.endsWith(".json"))return;if(e.endsWith(".node"))return await f.sharedLibEmit(e,this);if(e.endsWith(".js")){const t=await this.getPjsonBoundary(e);if(t)await this.emitFile(t+o.sep+"package.json","resolve",e)}let a;const s=this.analysisCache.get(e);if(s){a=s}else{const t=await this.readFile(e);if(t===null)throw new Error("File "+e+" does not exist.");a=await u.default(e,t.toString(),this);this.analysisCache.set(e,a)}const{deps:c,imports:d,assets:p,isESM:h}=a;if(h)this.esmFileList.add(o.relative(this.base,e));await Promise.all([...[...p].map((async t=>{const r=o.extname(t);if(r===".js"||r===".mjs"||r===".node"||r===""||this.ts&&(r===".ts"||r===".tsx")&&t.startsWith(this.base)&&t.substr(this.base.length).indexOf(o.sep+"node_modules"+o.sep)===-1)await this.emitDependency(t,e);else await this.emitFile(t,"asset",e)})),...[...c].map((async t=>{try{var r=await this.resolve(t,e,this,!h)}catch(e){this.warnings.add(new Error(`Failed to resolve dependency ${t}:\n${e&&e.message}`));return}if(Array.isArray(r)){for(const t of r){if(t.startsWith("node:"))return;await this.emitDependency(t,e)}}else{if(r.startsWith("node:"))return;await this.emitDependency(r,e)}})),...[...d].map((async t=>{try{var r=await this.resolve(t,e,this,false)}catch(e){this.warnings.add(new Error(`Failed to resolve dependency ${t}:\n${e&&e.message}`));return}if(Array.isArray(r)){for(const t of r){if(t.startsWith("node:"))return;await this.emitDependency(t,e)}}else{if(r.startsWith("node:"))return;await this.emitDependency(r,e)}}))])}}t.Job=Job},2278:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});const a=r(1017);async function resolveDependency(e,t,r,o=true){let s;if(a.isAbsolute(e)||e==="."||e===".."||e.startsWith("./")||e.startsWith("../")){const o=e.endsWith("/");s=await resolvePath(a.resolve(t,"..",e)+(o?"/":""),t,r)}else if(e[0]==="#"){s=await packageImportsResolve(e,t,r,o)}else{s=await resolvePackage(e,t,r,o)}if(Array.isArray(s)){return Promise.all(s.map((e=>r.realpath(e,t))))}else if(s.startsWith("node:")){return s}else{return r.realpath(s,t)}}t["default"]=resolveDependency;async function resolvePath(e,t,r){const a=await resolveFile(e,t,r)||await resolveDir(e,t,r);if(!a){throw new NotFoundError(e,t)}return a}async function resolveFile(e,t,r){if(e.endsWith("/"))return undefined;e=await r.realpath(e,t);if(await r.isFile(e))return e;if(r.ts&&e.startsWith(r.base)&&e.substr(r.base.length).indexOf(a.sep+"node_modules"+a.sep)===-1&&await r.isFile(e+".ts"))return e+".ts";if(r.ts&&e.startsWith(r.base)&&e.substr(r.base.length).indexOf(a.sep+"node_modules"+a.sep)===-1&&await r.isFile(e+".tsx"))return e+".tsx";if(await r.isFile(e+".js"))return e+".js";if(await r.isFile(e+".json"))return e+".json";if(await r.isFile(e+".node"))return e+".node";return undefined}async function resolveDir(e,t,r){if(e.endsWith("/"))e=e.slice(0,-1);if(!await r.isDir(e))return;const o=await getPkgCfg(e,r);if(o&&typeof o.main==="string"){const s=await resolveFile(a.resolve(e,o.main),t,r)||await resolveFile(a.resolve(e,o.main,"index"),t,r);if(s){await r.emitFile(e+a.sep+"package.json","resolve",t);return s}}return resolveFile(a.resolve(e,"index"),t,r)}class NotFoundError extends Error{constructor(e,t){super("Cannot find module '"+e+"' loaded from "+t);this.code="MODULE_NOT_FOUND"}}const o=new Set([...r(8102)._builtinLibs,"constants","module","timers","console","_stream_writable","_stream_readable","_stream_duplex","process","sys"]);function getPkgName(e){const t=e.split("/");if(e[0]==="@"&&t.length>1)return t.length>1?t.slice(0,2).join("/"):null;return t.length?t[0]:null}async function getPkgCfg(e,t){const r=await t.readFile(e+a.sep+"package.json");if(r){try{return JSON.parse(r.toString())}catch(e){}}return undefined}function getExportsTarget(e,t,r){if(typeof e==="string"){return e}else if(e===null){return e}else if(Array.isArray(e)){for(const a of e){const e=getExportsTarget(a,t,r);if(e===null||typeof e==="string"&&e.startsWith("./"))return e}}else if(typeof e==="object"){for(const a of Object.keys(e)){if(a==="default"||a==="require"&&r||a==="import"&&!r||t.includes(a)){const o=getExportsTarget(e[a],t,r);if(o!==undefined)return o}}}return undefined}function resolveExportsImports(e,t,r,a,o,s){let u;if(o){if(!(typeof t==="object"&&!Array.isArray(t)&&t!==null))return undefined;u=t}else if(typeof t==="string"||Array.isArray(t)||t===null||typeof t==="object"&&Object.keys(t).length&&Object.keys(t)[0][0]!=="."){u={".":t}}else{u=t}if(r in u){const t=getExportsTarget(u[r],a.conditions,s);if(typeof t==="string"&&t.startsWith("./"))return e+t.slice(1)}for(const t of Object.keys(u).sort(((e,t)=>t.length-e.length))){if(t.endsWith("*")&&r.startsWith(t.slice(0,-1))){const o=getExportsTarget(u[t],a.conditions,s);if(typeof o==="string"&&o.startsWith("./"))return e+o.slice(1).replace(/\*/g,r.slice(t.length-1))}if(!t.endsWith("/"))continue;if(r.startsWith(t)){const o=getExportsTarget(u[t],a.conditions,s);if(typeof o==="string"&&o.endsWith("/")&&o.startsWith("./"))return e+o.slice(1)+r.slice(t.length)}}return undefined}async function packageImportsResolve(e,t,r,o){if(e!=="#"&&!e.startsWith("#/")&&r.conditions){const s=await r.getPjsonBoundary(t);if(s){const u=await getPkgCfg(s,r);const{imports:c}=u||{};if(u&&c!==null&&c!==undefined){let u=resolveExportsImports(s,c,e,r,true,o);if(u){if(o)u=await resolveFile(u,t,r)||await resolveDir(u,t,r);else if(!await r.isFile(u))throw new NotFoundError(u,t);if(u){await r.emitFile(s+a.sep+"package.json","resolve",t);return u}}}}}throw new NotFoundError(e,t)}async function resolvePackage(e,t,r,s){let u=t;if(o.has(e))return"node:"+e;const c=getPkgName(e)||"";let d;if(r.conditions){const o=await r.getPjsonBoundary(t);if(o){const u=await getPkgCfg(o,r);const{exports:f}=u||{};if(u&&u.name&&u.name===c&&f!==null&&f!==undefined){d=resolveExportsImports(o,f,"."+e.slice(c.length),r,false,s);if(d){if(s)d=await resolveFile(d,t,r)||await resolveDir(d,t,r);else if(!await r.isFile(d))throw new NotFoundError(d,t)}if(d)await r.emitFile(o+a.sep+"package.json","resolve",t)}}}let f;const p=u.indexOf(a.sep);while((f=u.lastIndexOf(a.sep))>p){u=u.substr(0,f);const o=u+a.sep+"node_modules";const p=await r.stat(o);if(!p||!p.isDirectory())continue;const h=await getPkgCfg(o+a.sep+c,r);const{exports:v}=h||{};if(r.conditions&&v!==undefined&&v!==null&&!d){let u;if(!r.exportsOnly)u=await resolveFile(o+a.sep+e,t,r)||await resolveDir(o+a.sep+e,t,r);let d=resolveExportsImports(o+a.sep+c,v,"."+e.slice(c.length),r,false,s);if(d){if(s)d=await resolveFile(d,t,r)||await resolveDir(d,t,r);else if(!await r.isFile(d))throw new NotFoundError(d,t)}if(d){await r.emitFile(o+a.sep+c+a.sep+"package.json","resolve",t);if(u&&u!==d)return[d,u];return d}if(u)return u}else{const s=await resolveFile(o+a.sep+e,t,r)||await resolveDir(o+a.sep+e,t,r);if(s){if(d&&d!==s)return[s,d];return s}}}if(d)return d;if(Object.hasOwnProperty.call(r.paths,e)){return r.paths[e]}for(const a of Object.keys(r.paths)){if(a.endsWith("/")&&e.startsWith(a)){const o=r.paths[a]+e.slice(a.length);const s=await resolveFile(o,t,r)||await resolveDir(o,t,r);if(!s){throw new NotFoundError(e,t)}return s}}throw new NotFoundError(e,t)}},3864:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true})},5078:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.isLoop=t.isVarLoop=t.isIdentifierRead=void 0;function isIdentifierRead(e,t){switch(t.type){case"ObjectPattern":case"ArrayPattern":return false;case"AssignmentExpression":return t.right===e;case"MemberExpression":return t.computed||e===t.object;case"Property":return e===t.value;case"MethodDefinition":return false;case"VariableDeclarator":return t.id!==e;case"ExportSpecifier":return false;case"FunctionExpression":case"FunctionDeclaration":case"ArrowFunctionExpression":return false;default:return true}}t.isIdentifierRead=isIdentifierRead;function isVarLoop(e){return e.type==="ForStatement"||e.type==="ForInStatement"||e.type==="ForOfStatement"}t.isVarLoop=isVarLoop;function isLoop(e){return e.type==="ForStatement"||e.type==="ForInStatement"||e.type==="ForOfStatement"||e.type==="WhileStatement"||e.type==="DoWhileStatement"}t.isLoop=isLoop},2774:function(__unused_webpack_module,exports,__nccwpck_require__){"use strict";var __importDefault=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(exports,"__esModule",{value:true});exports.nbind=exports.pregyp=void 0;const path_1=__importDefault(__nccwpck_require__(1017));const graceful_fs_1=__importDefault(__nccwpck_require__(552));const versioning=__nccwpck_require__(5574);const napi=__nccwpck_require__(9248);const pregypFind=(e,t)=>{const r=JSON.parse(graceful_fs_1.default.readFileSync(e).toString());versioning.validate_config(r,t);var a;if(napi.get_napi_build_versions(r,t)){a=napi.get_best_napi_build_version(r,t)}t=t||{};if(!t.module_root)t.module_root=path_1.default.dirname(e);var o=versioning.evaluate(r,t,a);return o.module};exports.pregyp={default:{find:pregypFind},find:pregypFind};function makeModulePathList(e,t){return[[e,t],[e,"build",t],[e,"build","Debug",t],[e,"build","Release",t],[e,"out","Debug",t],[e,"Debug",t],[e,"out","Release",t],[e,"Release",t],[e,"build","default",t],[e,process.env["NODE_BINDINGS_COMPILED_DIR"]||"compiled",process.versions.node,process.platform,process.arch,t]]}function findCompiledModule(basePath,specList){var resolvedList=[];var ext=path_1.default.extname(basePath);for(var _i=0,specList_1=specList;_i{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.getPackageName=t.getPackageBase=void 0;const r=/^(@[^\\\/]+[\\\/])?[^\\\/]+/;function getPackageBase(e){const t=e.lastIndexOf("node_modules");if(t!==-1&&(e[t-1]==="/"||e[t-1]==="\\")&&(e[t+12]==="/"||e[t+12]==="\\")){const a=e.substr(t+13).match(r);if(a)return e.substr(0,t+13+a[0].length)}return undefined}t.getPackageBase=getPackageBase;function getPackageName(e){const t=e.lastIndexOf("node_modules");if(t!==-1&&(e[t-1]==="/"||e[t-1]==="\\")&&(e[t+12]==="/"||e[t+12]==="\\")){const a=e.substr(t+13).match(r);if(a&&a.length>0){return a[0].replace(/\\/g,"/")}}return undefined}t.getPackageName=getPackageName},216:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.normalizeWildcardRequire=t.normalizeDefaultRequire=void 0;function normalizeDefaultRequire(e){if(e&&e.__esModule)return e;return{default:e}}t.normalizeDefaultRequire=normalizeDefaultRequire;const r=Object.prototype.hasOwnProperty;function normalizeWildcardRequire(e){if(e&&e.__esModule)return e;const t={};for(const a in e){if(!r.call(e,a))continue;t[a]=e[a]}t["default"]=e;return t}t.normalizeWildcardRequire=normalizeWildcardRequire},2985:function(e,t,r){"use strict";var a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});t.sharedLibEmit=void 0;const o=a(r(2037));const s=a(r(3535));const u=r(7468);let c="";switch(o.default.platform()){case"darwin":c="/**/*.@(dylib|so?(.*))";break;case"win32":c="/**/*.dll";break;default:c="/**/*.so?(.*)"}async function sharedLibEmit(e,t){const r=u.getPackageBase(e);if(!r)return;const a=await new Promise(((e,t)=>s.default(r+c,{ignore:r+"/**/node_modules/**/*"},((r,a)=>r?t(r):e(a)))));await Promise.all(a.map((r=>t.emitFile(r,"sharedlib",e))))}t.sharedLibEmit=sharedLibEmit},5735:function(e,t,r){"use strict";var a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});const o=r(1017);const s=a(r(2278));const u=r(7468);const c=r(552);const d={"@generated/photon"({id:e,emitAssetDirectory:t}){if(e.endsWith("@generated/photon/index.js")){t(o.resolve(o.dirname(e),"runtime/"))}},argon2({id:e,emitAssetDirectory:t}){if(e.endsWith("argon2/argon2.js")){t(o.resolve(o.dirname(e),"build","Release"));t(o.resolve(o.dirname(e),"prebuilds"));t(o.resolve(o.dirname(e),"lib","binding"))}},bull({id:e,emitAssetDirectory:t}){if(e.endsWith("bull/lib/commands/index.js")){t(o.resolve(o.dirname(e)))}},camaro({id:e,emitAsset:t}){if(e.endsWith("camaro/dist/camaro.js")){t(o.resolve(o.dirname(e),"camaro.wasm"))}},esbuild({id:e,emitAssetDirectory:t}){if(e.endsWith("esbuild/lib/main.js")){const r=o.resolve(e,"..","..","package.json");const a=JSON.parse(c.readFileSync(r,"utf8"));for(const r of Object.keys(a.optionalDependencies||{})){const a=o.resolve(e,"..","..","..",r);t(a)}}},"google-gax"({id:e,ast:t,emitAssetDirectory:r}){if(e.endsWith("google-gax/build/src/grpc.js")){for(const a of t.body){if(a.type==="VariableDeclaration"&&a.declarations[0].id.type==="Identifier"&&a.declarations[0].id.name==="googleProtoFilesDir"){r(o.resolve(o.dirname(e),"../../../google-proto-files"))}}}},oracledb({id:e,ast:t,emitAsset:r}){if(e.endsWith("oracledb/lib/oracledb.js")){for(const a of t.body){if(a.type==="ForStatement"&&"body"in a.body&&a.body.body&&Array.isArray(a.body.body)&&a.body.body[0]&&a.body.body[0].type==="TryStatement"&&a.body.body[0].block.body[0]&&a.body.body[0].block.body[0].type==="ExpressionStatement"&&a.body.body[0].block.body[0].expression.type==="AssignmentExpression"&&a.body.body[0].block.body[0].expression.operator==="="&&a.body.body[0].block.body[0].expression.left.type==="Identifier"&&a.body.body[0].block.body[0].expression.left.name==="oracledbCLib"&&a.body.body[0].block.body[0].expression.right.type==="CallExpression"&&a.body.body[0].block.body[0].expression.right.callee.type==="Identifier"&&a.body.body[0].block.body[0].expression.right.callee.name==="require"&&a.body.body[0].block.body[0].expression.right.arguments.length===1&&a.body.body[0].block.body[0].expression.right.arguments[0].type==="MemberExpression"&&a.body.body[0].block.body[0].expression.right.arguments[0].computed===true&&a.body.body[0].block.body[0].expression.right.arguments[0].object.type==="Identifier"&&a.body.body[0].block.body[0].expression.right.arguments[0].object.name==="binaryLocations"&&a.body.body[0].block.body[0].expression.right.arguments[0].property.type==="Identifier"&&a.body.body[0].block.body[0].expression.right.arguments[0].property.name==="i"){a.body.body[0].block.body[0].expression.right.arguments=[{type:"Literal",value:"_"}];const t=global._unit?"3.0.0":JSON.parse(c.readFileSync(e.slice(0,-15)+"package.json","utf8")).version;const s=Number(t.slice(0,t.indexOf(".")))>=4;const u="oracledb-"+(s?t:"abi"+process.versions.modules)+"-"+process.platform+"-"+process.arch+".node";r(o.resolve(e,"../../build/Release/"+u))}}}},"phantomjs-prebuilt"({id:e,emitAssetDirectory:t}){if(e.endsWith("phantomjs-prebuilt/lib/phantomjs.js")){t(o.resolve(o.dirname(e),"..","bin"))}},"remark-prism"({id:e,emitAssetDirectory:t}){const r="remark-prism/src/highlight.js";if(e.endsWith(r)){try{const a=e.slice(0,-r.length);t(o.resolve(a,"prismjs","components"))}catch(e){}}},semver({id:e,emitAsset:t}){if(e.endsWith("semver/index.js")){t(o.resolve(e.replace("index.js","preload.js")))}},"socket.io":async function({id:e,ast:t,job:r}){if(e.endsWith("socket.io/lib/index.js")){async function replaceResolvePathStatement(t){if(t.type==="ExpressionStatement"&&t.expression.type==="AssignmentExpression"&&t.expression.operator==="="&&t.expression.right.type==="CallExpression"&&t.expression.right.callee.type==="Identifier"&&t.expression.right.callee.name==="read"&&t.expression.right.arguments.length>=1&&t.expression.right.arguments[0].type==="CallExpression"&&t.expression.right.arguments[0].callee.type==="Identifier"&&t.expression.right.arguments[0].callee.name==="resolvePath"&&t.expression.right.arguments[0].arguments.length===1&&t.expression.right.arguments[0].arguments[0].type==="Literal"){const a=t.expression.right.arguments[0].arguments[0].value;let u;try{const t=await s.default(String(a),e,r);if(typeof t==="string"){u=t}else{return undefined}}catch(e){return undefined}const c="/"+o.relative(o.dirname(e),u);t.expression.right.arguments[0]={type:"BinaryExpression",start:t.expression.right.arguments[0].start,end:t.expression.right.arguments[0].end,operator:"+",left:{type:"Identifier",name:"__dirname"},right:{type:"Literal",value:c,raw:JSON.stringify(c)}}}return undefined}for(const e of t.body){if(e.type==="ExpressionStatement"&&e.expression.type==="AssignmentExpression"&&e.expression.operator==="="&&e.expression.left.type==="MemberExpression"&&e.expression.left.object.type==="MemberExpression"&&e.expression.left.object.object.type==="Identifier"&&e.expression.left.object.object.name==="Server"&&e.expression.left.object.property.type==="Identifier"&&e.expression.left.object.property.name==="prototype"&&e.expression.left.property.type==="Identifier"&&e.expression.left.property.name==="serveClient"&&e.expression.right.type==="FunctionExpression"){for(const t of e.expression.right.body.body){if(t.type==="IfStatement"&&t.consequent&&"body"in t.consequent&&t.consequent.body){const e=t.consequent.body;let r=false;if(Array.isArray(e)&&e[0]&&e[0].type==="ExpressionStatement"){r=await replaceResolvePathStatement(e[0])}if(Array.isArray(e)&&e[1]&&e[1].type==="TryStatement"&&e[1].block.body&&e[1].block.body[0]){r=await replaceResolvePathStatement(e[1].block.body[0])||r}return}}}}}},typescript({id:e,emitAssetDirectory:t}){if(e.endsWith("typescript/lib/tsc.js")){t(o.resolve(e,"../"))}},"uglify-es"({id:e,emitAsset:t}){if(e.endsWith("uglify-es/tools/node.js")){t(o.resolve(e,"../../lib/utils.js"));t(o.resolve(e,"../../lib/ast.js"));t(o.resolve(e,"../../lib/parse.js"));t(o.resolve(e,"../../lib/transform.js"));t(o.resolve(e,"../../lib/scope.js"));t(o.resolve(e,"../../lib/output.js"));t(o.resolve(e,"../../lib/compress.js"));t(o.resolve(e,"../../lib/sourcemap.js"));t(o.resolve(e,"../../lib/mozilla-ast.js"));t(o.resolve(e,"../../lib/propmangle.js"));t(o.resolve(e,"../../lib/minify.js"));t(o.resolve(e,"../exports.js"))}},"uglify-js"({id:e,emitAsset:t,emitAssetDirectory:r}){if(e.endsWith("uglify-js/tools/node.js")){r(o.resolve(e,"../../lib"));t(o.resolve(e,"../exports.js"))}},"playwright-core"({id:e,emitAsset:t}){if(e.endsWith("playwright-core/index.js")){t(o.resolve(o.dirname(e),"browsers.json"))}},"geo-tz"({id:e,emitAsset:t}){if(e.endsWith("geo-tz/dist/geo-tz.js")){t(o.resolve(o.dirname(e),"../data/geo.dat"))}}};async function handleSpecialCases({id:e,ast:t,emitAsset:r,emitAssetDirectory:a,job:o}){const s=u.getPackageName(e);const c=d[s||""];e=e.replace(/\\/g,"/");if(c)await c({id:e,ast:t,emitAsset:r,emitAssetDirectory:a,job:o})}t["default"]=handleSpecialCases},5401:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.wildcardRegEx=t.WILDCARD=t.FUNCTION=t.UNKNOWN=t.evaluate=void 0;const a=r(7310);async function evaluate(e,t={},r=true){const a={computeBranches:r,vars:t};return walk(e);function walk(e){const t=o[e.type];if(t){return t.call(a,e,walk)}return undefined}}t.evaluate=evaluate;t.UNKNOWN=Symbol();t.FUNCTION=Symbol();t.WILDCARD="";t.wildcardRegEx=/\x1a/g;function countWildcards(e){t.wildcardRegEx.lastIndex=0;let r=0;while(t.wildcardRegEx.exec(e))r++;return r}const o={ArrayExpression:async function ArrayExpression(e,t){const r=[];for(let a=0,o=e.elements.length;aa.value}}}return undefined},BinaryExpression:async function BinaryExpression(e,r){const a=e.operator;let o=await r(e.left);if(!o&&a!=="+")return;let s=await r(e.right);if(!o&&!s)return;if(!o){if(this.computeBranches&&s&&"value"in s&&typeof s.value==="string")return{value:t.WILDCARD+s.value,wildcards:[e.left,...s.wildcards||[]]};return}if(!s){if(this.computeBranches&&a==="+"){if(o&&"value"in o&&typeof o.value==="string")return{value:o.value+t.WILDCARD,wildcards:[...o.wildcards||[],e.right]}}if(!("test"in o)&&a==="||"&&o.value)return o;return}if("test"in o&&"value"in s){const e=s.value;if(a==="==")return{test:o.test,then:o.then==e,else:o.else==e};if(a==="===")return{test:o.test,then:o.then===e,else:o.else===e};if(a==="!=")return{test:o.test,then:o.then!=e,else:o.else!=e};if(a==="!==")return{test:o.test,then:o.then!==e,else:o.else!==e};if(a==="+")return{test:o.test,then:o.then+e,else:o.else+e};if(a==="-")return{test:o.test,then:o.then-e,else:o.else-e};if(a==="*")return{test:o.test,then:o.then*e,else:o.else*e};if(a==="/")return{test:o.test,then:o.then/e,else:o.else/e};if(a==="%")return{test:o.test,then:o.then%e,else:o.else%e};if(a==="<")return{test:o.test,then:o.then")return{test:o.test,then:o.then>e,else:o.else>e};if(a===">=")return{test:o.test,then:o.then>=e,else:o.else>=e};if(a==="|")return{test:o.test,then:o.then|e,else:o.else|e};if(a==="&")return{test:o.test,then:o.then&e,else:o.else&e};if(a==="^")return{test:o.test,then:o.then^e,else:o.else^e};if(a==="&&")return{test:o.test,then:o.then&&e,else:o.else&&e};if(a==="||")return{test:o.test,then:o.then||e,else:o.else||e}}else if("test"in s&&"value"in o){const e=o.value;if(a==="==")return{test:s.test,then:e==s.then,else:e==s.else};if(a==="===")return{test:s.test,then:e===s.then,else:e===s.else};if(a==="!=")return{test:s.test,then:e!=s.then,else:e!=s.else};if(a==="!==")return{test:s.test,then:e!==s.then,else:e!==s.else};if(a==="+")return{test:s.test,then:e+s.then,else:e+s.else};if(a==="-")return{test:s.test,then:e-s.then,else:e-s.else};if(a==="*")return{test:s.test,then:e*s.then,else:e*s.else};if(a==="/")return{test:s.test,then:e/s.then,else:e/s.else};if(a==="%")return{test:s.test,then:e%s.then,else:e%s.else};if(a==="<")return{test:s.test,then:e")return{test:s.test,then:e>s.then,else:e>s.else};if(a===">=")return{test:s.test,then:e>=s.then,else:e>=s.else};if(a==="|")return{test:s.test,then:e|s.then,else:e|s.else};if(a==="&")return{test:s.test,then:e&s.then,else:e&s.else};if(a==="^")return{test:s.test,then:e^s.then,else:e^s.else};if(a==="&&")return{test:s.test,then:e&&s.then,else:o&&s.else};if(a==="||")return{test:s.test,then:e||s.then,else:o||s.else}}else if("value"in o&&"value"in s){if(a==="==")return{value:o.value==s.value};if(a==="===")return{value:o.value===s.value};if(a==="!=")return{value:o.value!=s.value};if(a==="!==")return{value:o.value!==s.value};if(a==="+"){const e={value:o.value+s.value};let t=[];if("wildcards"in o&&o.wildcards){t=t.concat(o.wildcards)}if("wildcards"in s&&s.wildcards){t=t.concat(s.wildcards)}if(t.length>0){e.wildcards=t}return e}if(a==="-")return{value:o.value-s.value};if(a==="*")return{value:o.value*s.value};if(a==="/")return{value:o.value/s.value};if(a==="%")return{value:o.value%s.value};if(a==="<")return{value:o.value")return{value:o.value>s.value};if(a===">=")return{value:o.value>=s.value};if(a==="|")return{value:o.value|s.value};if(a==="&")return{value:o.value&s.value};if(a==="^")return{value:o.value^s.value};if(a==="&&")return{value:o.value&&s.value};if(a==="||")return{value:o.value||s.value}}return},CallExpression:async function CallExpression(e,r){var a;const o=await r(e.callee);if(!o||"test"in o)return;let s=o.value;if(typeof s==="object"&&s!==null)s=s[t.FUNCTION];if(typeof s!=="function")return;let u=null;if(e.callee.object){u=await r(e.callee.object);u=u&&"value"in u&&u.value?u.value:null}let c;let d=[];let f;let p=e.arguments.length>0&&((a=e.callee.property)===null||a===void 0?void 0:a.name)!=="concat";const h=[];for(let a=0,o=e.arguments.length;ah.push(e)))}else{if(!this.computeBranches)return;o={value:t.WILDCARD};h.push(e.arguments[a])}if("test"in o){if(h.length)return;if(c)return;c=o.test;f=d.concat([]);d.push(o.then);f.push(o.else)}else{d.push(o.value);if(f)f.push(o.value)}}if(p)return;try{const e=await s.apply(u,d);if(e===t.UNKNOWN)return;if(!c){if(h.length){if(typeof e!=="string"||countWildcards(e)!==h.length)return;return{value:e,wildcards:h}}return{value:e}}const r=await s.apply(u,f);if(e===t.UNKNOWN)return;return{test:c,then:e,else:r}}catch(e){return}},ConditionalExpression:async function ConditionalExpression(e,t){const r=await t(e.test);if(r&&"value"in r)return r.value?t(e.consequent):t(e.alternate);if(!this.computeBranches)return;const a=await t(e.consequent);if(!a||"wildcards"in a||"test"in a)return;const o=await t(e.alternate);if(!o||"wildcards"in o||"test"in o)return;return{test:e.test,then:a.value,else:o.value}},ExpressionStatement:async function ExpressionStatement(e,t){return t(e.expression)},Identifier:async function Identifier(e,t){if(Object.hasOwnProperty.call(this.vars,e.name))return this.vars[e.name];return undefined},Literal:async function Literal(e,t){return{value:e.value}},MemberExpression:async function MemberExpression(e,r){const a=await r(e.object);if(!a||"test"in a||typeof a.value==="function"){return undefined}if(e.property.type==="Identifier"){if(typeof a.value==="string"&&e.property.name==="concat"){return{value:{[t.FUNCTION]:(...e)=>a.value.concat(e)}}}if(typeof a.value==="object"&&a.value!==null){const o=a.value;if(e.computed){const s=await r(e.property);if(s&&"value"in s&&s.value){const e=o[s.value];if(e===t.UNKNOWN)return undefined;return{value:e}}if(!o[t.UNKNOWN]&&Object.keys(a).length===0){return{value:undefined}}}else if(e.property.name in o){const r=o[e.property.name];if(r===t.UNKNOWN)return undefined;return{value:r}}else if(o[t.UNKNOWN])return undefined}else{return{value:undefined}}}const o=await r(e.property);if(!o||"test"in o)return undefined;if(typeof a.value==="object"&&a.value!==null){if(o.value in a.value){const e=a.value[o.value];if(e===t.UNKNOWN)return undefined;return{value:e}}else if(a.value[t.UNKNOWN]){return undefined}}else{return{value:undefined}}return undefined},MetaProperty:async function MetaProperty(e){if(e.meta.name==="import"&&e.property.name==="meta")return{value:this.vars["import.meta"]};return undefined},NewExpression:async function NewExpression(e,t){const r=await t(e.callee);if(r&&"value"in r&&r.value===a.URL&&e.arguments.length){const r=await t(e.arguments[0]);if(!r)return undefined;let o=null;if(e.arguments[1]){o=await t(e.arguments[1]);if(!o||!("value"in o))return undefined}if("value"in r){if(o){try{return{value:new a.URL(r.value,o.value)}}catch(e){return undefined}}try{return{value:new a.URL(r.value)}}catch(e){return undefined}}else{const e=r.test;if(o){try{return{test:e,then:new a.URL(r.then,o.value),else:new a.URL(r.else,o.value)}}catch(e){return undefined}}try{return{test:e,then:new a.URL(r.then),else:new a.URL(r.else)}}catch(e){return undefined}}}return undefined},ObjectExpression:async function ObjectExpression(e,r){const a={};for(let o=0;o{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.handleWrappers=void 0;const a=r(7470);function isUndefinedOrVoid(e){return e.type==="Identifier"&&e.name==="undefined"||e.type==="UnaryExpression"&&e.operator==="void"&&e.argument.type==="Literal"&&e.argument.value===0}function handleWrappers(e){var t;let r;if(e.body.length===1&&e.body[0].type==="ExpressionStatement"&&e.body[0].expression.type==="UnaryExpression"&&e.body[0].expression.operator==="!"&&e.body[0].expression.argument.type==="CallExpression"&&e.body[0].expression.argument.callee.type==="FunctionExpression"&&e.body[0].expression.argument.arguments.length===1)r=e.body[0].expression.argument;else if(e.body.length===1&&e.body[0].type==="ExpressionStatement"&&e.body[0].expression.type==="CallExpression"&&e.body[0].expression.callee.type==="FunctionExpression"&&(e.body[0].expression.arguments.length===1||e.body[0].expression.arguments.length===0))r=e.body[0].expression;else if(e.body.length===1&&e.body[0].type==="ExpressionStatement"&&e.body[0].expression.type==="AssignmentExpression"&&e.body[0].expression.left.type==="MemberExpression"&&e.body[0].expression.left.object.type==="Identifier"&&e.body[0].expression.left.object.name==="module"&&e.body[0].expression.left.property.type==="Identifier"&&e.body[0].expression.left.property.name==="exports"&&e.body[0].expression.right.type==="CallExpression"&&e.body[0].expression.right.callee.type==="FunctionExpression"&&e.body[0].expression.right.arguments.length===1)r=e.body[0].expression.right;if(r){let e;let o;if(r.arguments[0]&&r.arguments[0].type==="ConditionalExpression"&&r.arguments[0].test.type==="LogicalExpression"&&r.arguments[0].test.operator==="&&"&&r.arguments[0].test.left.type==="BinaryExpression"&&r.arguments[0].test.left.operator==="==="&&r.arguments[0].test.left.left.type==="UnaryExpression"&&r.arguments[0].test.left.left.operator==="typeof"&&"name"in r.arguments[0].test.left.left.argument&&r.arguments[0].test.left.left.argument.name==="define"&&r.arguments[0].test.left.right.type==="Literal"&&r.arguments[0].test.left.right.value==="function"&&r.arguments[0].test.right.type==="MemberExpression"&&r.arguments[0].test.right.object.type==="Identifier"&&r.arguments[0].test.right.property.type==="Identifier"&&r.arguments[0].test.right.property.name==="amd"&&r.arguments[0].test.right.computed===false&&r.arguments[0].alternate.type==="FunctionExpression"&&r.arguments[0].alternate.params.length===1&&r.arguments[0].alternate.params[0].type==="Identifier"&&r.arguments[0].alternate.body.body.length===1&&r.arguments[0].alternate.body.body[0].type==="ExpressionStatement"&&r.arguments[0].alternate.body.body[0].expression.type==="AssignmentExpression"&&r.arguments[0].alternate.body.body[0].expression.left.type==="MemberExpression"&&r.arguments[0].alternate.body.body[0].expression.left.object.type==="Identifier"&&r.arguments[0].alternate.body.body[0].expression.left.object.name==="module"&&r.arguments[0].alternate.body.body[0].expression.left.property.type==="Identifier"&&r.arguments[0].alternate.body.body[0].expression.left.property.name==="exports"&&r.arguments[0].alternate.body.body[0].expression.left.computed===false&&r.arguments[0].alternate.body.body[0].expression.right.type==="CallExpression"&&r.arguments[0].alternate.body.body[0].expression.right.callee.type==="Identifier"&&r.arguments[0].alternate.body.body[0].expression.right.callee.name===r.arguments[0].alternate.params[0].name&&"body"in r.callee&&"body"in r.callee.body&&Array.isArray(r.callee.body.body)&&r.arguments[0].alternate.body.body[0].expression.right.arguments.length===1&&r.arguments[0].alternate.body.body[0].expression.right.arguments[0].type==="Identifier"&&r.arguments[0].alternate.body.body[0].expression.right.arguments[0].name==="require"){let e=r.callee.body.body;if(e[0].type==="ExpressionStatement"&&e[0].expression.type==="Literal"&&e[0].expression.value==="use strict"){e=e.slice(1)}if(e.length===1&&e[0].type==="ExpressionStatement"&&e[0].expression.type==="CallExpression"&&e[0].expression.callee.type==="Identifier"&&e[0].expression.callee.name===r.arguments[0].test.right.object.name&&e[0].expression.arguments.length===1&&e[0].expression.arguments[0].type==="FunctionExpression"&&e[0].expression.arguments[0].params.length===1&&e[0].expression.arguments[0].params[0].type==="Identifier"&&e[0].expression.arguments[0].params[0].name==="require"){const t=e[0].expression.arguments[0];t.params=[];try{delete t.scope.declarations.require}catch(e){}}}else if(r.arguments[0]&&r.arguments[0].type==="FunctionExpression"&&r.arguments[0].params.length===0&&(r.arguments[0].body.body.length===1||r.arguments[0].body.body.length===2&&r.arguments[0].body.body[0].type==="VariableDeclaration"&&r.arguments[0].body.body[0].declarations.length===3&&r.arguments[0].body.body[0].declarations.every((e=>e.init===null&&e.id.type==="Identifier")))&&r.arguments[0].body.body[r.arguments[0].body.body.length-1].type==="ReturnStatement"&&(e=r.arguments[0].body.body[r.arguments[0].body.body.length-1])&&((t=e.argument)===null||t===void 0?void 0:t.type)==="CallExpression"&&e.argument.arguments.length&&e.argument.arguments.every((e=>e&&e.type==="Literal"&&typeof e.value==="number"))&&e.argument.callee.type==="CallExpression"&&(e.argument.callee.callee.type==="FunctionExpression"||e.argument.callee.callee.type==="CallExpression"&&e.argument.callee.callee.callee.type==="FunctionExpression"&&e.argument.callee.callee.arguments.length===0)&&e.argument.callee.arguments.length===3&&e.argument.callee.arguments[0].type==="ObjectExpression"&&e.argument.callee.arguments[1].type==="ObjectExpression"&&e.argument.callee.arguments[2].type==="ArrayExpression"){const t=e.argument.callee.arguments[0].properties;const r={};if(t.every((e=>{if(e.type!=="Property"||e.computed!==false||e.key.type!=="Literal"||typeof e.key.value!=="number"||e.value.type!=="ArrayExpression"||e.value.elements.length!==2||!e.value.elements[0]||!e.value.elements[1]||e.value.elements[0].type!=="FunctionExpression"||e.value.elements[1].type!=="ObjectExpression"){return false}const t=e.value.elements[1].properties;for(const e of t){if(e.type!=="Property"||e.value.type!=="Identifier"&&e.value.type!=="Literal"&&!isUndefinedOrVoid(e.value)||!(e.key.type==="Literal"&&typeof e.key.value==="string"||e.key.type==="Identifier")||e.computed){return false}if(isUndefinedOrVoid(e.value)){if(e.key.type==="Identifier"){r[e.key.name]={type:"Literal",start:e.key.start,end:e.key.end,value:e.key.name,raw:JSON.stringify(e.key.name)}}else if(e.key.type==="Literal"){r[String(e.key.value)]=e.key}}}return true}))){const t=Object.keys(r);const a=e.argument.callee.arguments[1];a.properties=t.map((e=>({type:"Property",method:false,shorthand:false,computed:false,kind:"init",key:r[e],value:{type:"ObjectExpression",properties:[{type:"Property",kind:"init",method:false,shorthand:false,computed:false,key:{type:"Identifier",name:"exports"},value:{type:"CallExpression",optional:false,callee:{type:"Identifier",name:"require"},arguments:[r[e]]}}]}})))}}else if(r.arguments[0]&&r.arguments[0].type==="FunctionExpression"&&r.arguments[0].params.length===2&&r.arguments[0].params[0].type==="Identifier"&&r.arguments[0].params[1].type==="Identifier"&&"body"in r.callee&&"body"in r.callee.body&&Array.isArray(r.callee.body.body)&&r.callee.body.body.length===1){const e=r.callee.body.body[0];if(e.type==="IfStatement"&&e.test.type==="LogicalExpression"&&e.test.operator==="&&"&&e.test.left.type==="BinaryExpression"&&e.test.left.left.type==="UnaryExpression"&&e.test.left.left.operator==="typeof"&&e.test.left.left.argument.type==="Identifier"&&e.test.left.left.argument.name==="module"&&e.test.left.right.type==="Literal"&&e.test.left.right.value==="object"&&e.test.right.type==="BinaryExpression"&&e.test.right.left.type==="UnaryExpression"&&e.test.right.left.operator==="typeof"&&e.test.right.left.argument.type==="MemberExpression"&&e.test.right.left.argument.object.type==="Identifier"&&e.test.right.left.argument.object.name==="module"&&e.test.right.left.argument.property.type==="Identifier"&&e.test.right.left.argument.property.name==="exports"&&e.test.right.right.type==="Literal"&&e.test.right.right.value==="object"&&e.consequent.type==="BlockStatement"&&e.consequent.body.length>0){let t;if(e.consequent.body[0].type==="VariableDeclaration"&&e.consequent.body[0].declarations[0].init&&e.consequent.body[0].declarations[0].init.type==="CallExpression")t=e.consequent.body[0].declarations[0].init;else if(e.consequent.body[0].type==="ExpressionStatement"&&e.consequent.body[0].expression.type==="CallExpression")t=e.consequent.body[0].expression;else if(e.consequent.body[0].type==="ExpressionStatement"&&e.consequent.body[0].expression.type==="AssignmentExpression"&&e.consequent.body[0].expression.operator==="="&&e.consequent.body[0].expression.right.type==="CallExpression")t=e.consequent.body[0].expression.right;if(t&&t.callee.type==="Identifier"&&"params"in r.callee&&r.callee.params.length>0&&"name"in r.callee.params[0]&&t.callee.name===r.callee.params[0].name&&t.arguments.length===2&&t.arguments[0].type==="Identifier"&&t.arguments[0].name==="require"&&t.arguments[1].type==="Identifier"&&t.arguments[1].name==="exports"){const e=r.arguments[0];e.params=[];try{const t=e.scope;delete t.declarations.require;delete t.declarations.exports}catch(e){}}}}else if(r.callee.type==="FunctionExpression"&&r.callee.body.body.length>2&&r.callee.body.body[0].type==="VariableDeclaration"&&r.callee.body.body[0].declarations.length===1&&r.callee.body.body[0].declarations[0].type==="VariableDeclarator"&&r.callee.body.body[0].declarations[0].id.type==="Identifier"&&r.callee.body.body[0].declarations[0].init&&(r.callee.body.body[0].declarations[0].init.type==="ObjectExpression"&&r.callee.body.body[0].declarations[0].init.properties.length===0||r.callee.body.body[0].declarations[0].init.type==="CallExpression"&&r.callee.body.body[0].declarations[0].init.arguments.length===1)&&(r.callee.body.body[1]&&r.callee.body.body[1].type==="FunctionDeclaration"&&r.callee.body.body[1].params.length===1&&r.callee.body.body[1].body.body.length>=3||r.callee.body.body[2]&&r.callee.body.body[2].type==="FunctionDeclaration"&&r.callee.body.body[2].params.length===1&&r.callee.body.body[2].body.body.length>=3)&&(r.arguments[0]&&(r.arguments[0].type==="ArrayExpression"&&(o=r.arguments[0])&&r.arguments[0].elements.length>0&&r.arguments[0].elements.every((e=>e&&e.type==="FunctionExpression"))||r.arguments[0].type==="ObjectExpression"&&(o=r.arguments[0])&&r.arguments[0].properties&&r.arguments[0].properties.length>0&&r.arguments[0].properties.every((e=>e&&e.type==="Property"&&!e.computed&&e.key&&e.key.type==="Literal"&&(typeof e.key.value==="string"||typeof e.key.value==="number")&&e.value&&e.value.type==="FunctionExpression"))))||r.arguments.length===0&&r.callee.type==="FunctionExpression"&&r.callee.params.length===0&&r.callee.body.type==="BlockStatement"&&r.callee.body.body.length>5&&r.callee.body.body[0].type==="VariableDeclaration"&&r.callee.body.body[0].declarations.length===1&&r.callee.body.body[0].declarations[0].id.type==="Identifier"&&r.callee.body.body[1].type==="ExpressionStatement"&&r.callee.body.body[1].expression.type==="AssignmentExpression"&&r.callee.body.body[2].type==="ExpressionStatement"&&r.callee.body.body[2].expression.type==="AssignmentExpression"&&r.callee.body.body[3].type==="ExpressionStatement"&&r.callee.body.body[3].expression.type==="AssignmentExpression"&&r.callee.body.body[3].expression.left.type==="MemberExpression"&&r.callee.body.body[3].expression.left.object.type==="Identifier"&&r.callee.body.body[3].expression.left.object.name===r.callee.body.body[0].declarations[0].id.name&&r.callee.body.body[3].expression.left.property.type==="Identifier"&&r.callee.body.body[3].expression.left.property.name==="modules"&&r.callee.body.body[3].expression.right.type==="ObjectExpression"&&r.callee.body.body[3].expression.right.properties.every((e=>e&&e.type==="Property"&&!e.computed&&e.key&&e.key.type==="Literal"&&(typeof e.key.value==="string"||typeof e.key.value==="number")&&e.value&&e.value.type==="FunctionExpression"))&&(o=r.callee.body.body[3].expression.right)&&(r.callee.body.body[4].type==="VariableDeclaration"&&r.callee.body.body[4].declarations.length===1&&r.callee.body.body[4].declarations[0].init&&r.callee.body.body[4].declarations[0].init.type==="CallExpression"&&r.callee.body.body[4].declarations[0].init.callee.type==="Identifier"&&r.callee.body.body[4].declarations[0].init.callee.name==="require"||r.callee.body.body[5].type==="VariableDeclaration"&&r.callee.body.body[5].declarations.length===1&&r.callee.body.body[5].declarations[0].init&&r.callee.body.body[5].declarations[0].init.type==="CallExpression"&&r.callee.body.body[5].declarations[0].init.callee.type==="Identifier"&&r.callee.body.body[5].declarations[0].init.callee.name==="require")){const e=new Map;let t;if(o.type==="ArrayExpression")t=o.elements.filter((e=>(e===null||e===void 0?void 0:e.type)==="FunctionExpression")).map(((e,t)=>[String(t),e]));else t=o.properties.map((e=>[String(e.key.value),e.value]));for(const[r,a]of t){const t=a.body.body.length===1?a.body.body[0]:(a.body.body.length===2||a.body.body.length===3&&a.body.body[2].type==="EmptyStatement")&&a.body.body[0].type==="ExpressionStatement"&&a.body.body[0].expression.type==="Literal"&&a.body.body[0].expression.value==="use strict"?a.body.body[1]:null;if(t&&t.type==="ExpressionStatement"&&t.expression.type==="AssignmentExpression"&&t.expression.operator==="="&&t.expression.left.type==="MemberExpression"&&t.expression.left.object.type==="Identifier"&&"params"in a&&a.params.length>0&&"name"in a.params[0]&&t.expression.left.object.name===a.params[0].name&&t.expression.left.property.type==="Identifier"&&t.expression.left.property.name==="exports"&&t.expression.right.type==="CallExpression"&&t.expression.right.callee.type==="Identifier"&&t.expression.right.callee.name==="require"&&t.expression.right.arguments.length===1&&t.expression.right.arguments[0].type==="Literal"){e.set(r,t.expression.right.arguments[0].value)}}for(const[,r]of t){if("params"in r&&r.params.length===3&&r.params[2].type==="Identifier"){const t=new Map;a.walk(r.body,{enter(a,o){const s=a;const u=o;if(s.type==="CallExpression"&&s.callee.type==="Identifier"&&"name"in r.params[2]&&s.callee.name===r.params[2].name&&s.arguments.length===1&&s.arguments[0].type==="Literal"){const r=e.get(String(s.arguments[0].value));if(r){const e={type:"CallExpression",optional:false,callee:{type:"Identifier",name:"require"},arguments:[{type:"Literal",value:r}]};const a=u;if("right"in a&&a.right===s){a.right=e}else if("left"in a&&a.left===s){a.left=e}else if("object"in a&&a.object===s){a.object=e}else if("callee"in a&&a.callee===s){a.callee=e}else if("arguments"in a&&a.arguments.some((e=>e===s))){a.arguments=a.arguments.map((t=>t===s?e:t))}else if("init"in a&&a.init===s){if(a.type==="VariableDeclarator"&&a.id.type==="Identifier")t.set(a.id.name,r);a.init=e}}}else if(s.type==="CallExpression"&&s.callee.type==="MemberExpression"&&s.callee.object.type==="Identifier"&&"name"in r.params[2]&&s.callee.object.name===r.params[2].name&&s.callee.property.type==="Identifier"&&s.callee.property.name==="n"&&s.arguments.length===1&&s.arguments[0].type==="Identifier"){if(u&&"init"in u&&u.init===s){const e=s.arguments[0];const t={type:"CallExpression",optional:false,callee:{type:"MemberExpression",computed:false,optional:false,object:{type:"Identifier",name:"Object"},property:{type:"Identifier",name:"assign"}},arguments:[{type:"ArrowFunctionExpression",expression:true,params:[],body:e},{type:"ObjectExpression",properties:[{type:"Property",kind:"init",method:false,computed:false,shorthand:false,key:{type:"Identifier",name:"a"},value:e}]}]};u.init=t}}}})}}}}}t.handleWrappers=handleWrappers},5920:(e,t)=>{e.exports=t=abbrev.abbrev=abbrev;abbrev.monkeyPatch=monkeyPatch;function monkeyPatch(){Object.defineProperty(Array.prototype,"abbrev",{value:function(){return abbrev(this)},enumerable:false,configurable:true,writable:true});Object.defineProperty(Object.prototype,"abbrev",{value:function(){return abbrev(Object.keys(this))},enumerable:false,configurable:true,writable:true})}function abbrev(e){if(arguments.length!==1||!Array.isArray(e)){e=Array.prototype.slice.call(arguments,0)}for(var t=0,r=e.length,a=[];tt?1:-1}},5534:e=>{"use strict";function isArguments(e){return e!=null&&typeof e==="object"&&e.hasOwnProperty("callee")}var t={"*":{label:"any",check:function(){return true}},A:{label:"array",check:function(e){return Array.isArray(e)||isArguments(e)}},S:{label:"string",check:function(e){return typeof e==="string"}},N:{label:"number",check:function(e){return typeof e==="number"}},F:{label:"function",check:function(e){return typeof e==="function"}},O:{label:"object",check:function(e){return typeof e==="object"&&e!=null&&!t.A.check(e)&&!t.E.check(e)}},B:{label:"boolean",check:function(e){return typeof e==="boolean"}},E:{label:"error",check:function(e){return e instanceof Error}},Z:{label:"null",check:function(e){return e==null}}};function addSchema(e,t){var r=t[e.length]=t[e.length]||[];if(r.indexOf(e)===-1)r.push(e)}var r=e.exports=function(e,r){if(arguments.length!==2)throw wrongNumberOfArgs(["SA"],arguments.length);if(!e)throw missingRequiredArg(0,"rawSchemas");if(!r)throw missingRequiredArg(1,"args");if(!t.S.check(e))throw invalidType(0,["string"],e);if(!t.A.check(r))throw invalidType(1,["array"],r);var a=e.split("|");var o={};a.forEach((function(e){for(var r=0;r{"use strict";t.TrackerGroup=r(2952);t.Tracker=r(6189);t.TrackerStream=r(5849)},8313:(e,t,r)=>{"use strict";var a=r(2361).EventEmitter;var o=r(3837);var s=0;var u=e.exports=function(e){a.call(this);this.id=++s;this.name=e};o.inherits(u,a)},2952:(e,t,r)=>{"use strict";var a=r(3837);var o=r(8313);var s=r(6189);var u=r(5849);var c=e.exports=function(e){o.call(this,e);this.parentGroup=null;this.trackers=[];this.completion={};this.weight={};this.totalWeight=0;this.finished=false;this.bubbleChange=bubbleChange(this)};a.inherits(c,o);function bubbleChange(e){return function(t,r,a){e.completion[a.id]=r;if(e.finished)return;e.emit("change",t||e.name,e.completed(),e)}}c.prototype.nameInTree=function(){var e=[];var t=this;while(t){e.unshift(t.name);t=t.parentGroup}return e.join("/")};c.prototype.addUnit=function(e,t){if(e.addUnit){var r=this;while(r){if(e===r){throw new Error("Attempted to add tracker group "+e.name+" to tree that already includes it "+this.nameInTree(this))}r=r.parentGroup}e.parentGroup=this}this.weight[e.id]=t||1;this.totalWeight+=this.weight[e.id];this.trackers.push(e);this.completion[e.id]=e.completed();e.on("change",this.bubbleChange);if(!this.finished)this.emit("change",e.name,this.completion[e.id],e);return e};c.prototype.completed=function(){if(this.trackers.length===0)return 0;var e=1/this.totalWeight;var t=0;for(var r=0;r{"use strict";var a=r(3837);var o=r(675);var s=r(1722);var u=r(6189);var c=e.exports=function(e,t,r){o.Transform.call(this,r);this.tracker=new u(e,t);this.name=e;this.id=this.tracker.id;this.tracker.on("change",delegateChange(this))};a.inherits(c,o.Transform);function delegateChange(e){return function(t,r,a){e.emit("change",t,r,e)}}c.prototype._transform=function(e,t,r){this.tracker.completeWork(e.length?e.length:1);this.push(e);r()};c.prototype._flush=function(e){this.tracker.finish();e()};s(c.prototype,"tracker").method("completed").method("addWork").method("finish")},6189:(e,t,r)=>{"use strict";var a=r(3837);var o=r(8313);var s=e.exports=function(e,t){o.call(this,e);this.workDone=0;this.workTodo=t||0};a.inherits(s,o);s.prototype.completed=function(){return this.workTodo===0?0:this.workDone/this.workTodo};s.prototype.addWork=function(e){this.workTodo+=e;this.emit("change",this.name,this.completed(),this)};s.prototype.completeWork=function(e){this.workDone+=e;if(this.workDone>this.workTodo)this.workDone=this.workTodo;this.emit("change",this.name,this.completed(),this)};s.prototype.finish=function(){this.workTodo=this.workDone=1;this.emit("change",this.name,1,this)}},5706:(module,exports,__nccwpck_require__)=>{var fs=__nccwpck_require__(7147),path=__nccwpck_require__(1017),fileURLToPath=__nccwpck_require__(9001),join=path.join,dirname=path.dirname,exists=fs.accessSync&&function(e){try{fs.accessSync(e)}catch(e){return false}return true}||fs.existsSync||path.existsSync,defaults={arrow:process.env.NODE_BINDINGS_ARROW||" → ",compiled:process.env.NODE_BINDINGS_COMPILED_DIR||"compiled",platform:process.platform,arch:process.arch,nodePreGyp:"node-v"+process.versions.modules+"-"+process.platform+"-"+process.arch,version:process.versions.node,bindings:"bindings.node",try:[["module_root","build","bindings"],["module_root","build","Debug","bindings"],["module_root","build","Release","bindings"],["module_root","out","Debug","bindings"],["module_root","Debug","bindings"],["module_root","out","Release","bindings"],["module_root","Release","bindings"],["module_root","build","default","bindings"],["module_root","compiled","version","platform","arch","bindings"],["module_root","addon-build","release","install-root","bindings"],["module_root","addon-build","debug","install-root","bindings"],["module_root","addon-build","default","install-root","bindings"],["module_root","lib","binding","nodePreGyp","bindings"]]};function bindings(opts){if(typeof opts=="string"){opts={bindings:opts}}else if(!opts){opts={}}Object.keys(defaults).map((function(e){if(!(e in opts))opts[e]=defaults[e]}));if(!opts.module_root){opts.module_root=exports.getRoot(exports.getFileName())}if(path.extname(opts.bindings)!=".node"){opts.bindings+=".node"}var requireFunc=true?eval("require"):0;var tries=[],i=0,l=opts.try.length,n,b,err;for(;i{"use strict";e.exports=function(e,t){if(e===null||e===undefined){throw TypeError()}e=String(e);var r=e.length;var a=t?Number(t):0;if(Number.isNaN(a)){a=0}if(a<0||a>=r){return undefined}var o=e.charCodeAt(a);if(o>=55296&&o<=56319&&r>a+1){var s=e.charCodeAt(a+1);if(s>=56320&&s<=57343){return(o-55296)*1024+s-56320+65536}}return o}},6322:(e,t)=>{"use strict";var r="[";t.up=function up(e){return r+(e||"")+"A"};t.down=function down(e){return r+(e||"")+"B"};t.forward=function forward(e){return r+(e||"")+"C"};t.back=function back(e){return r+(e||"")+"D"};t.nextLine=function nextLine(e){return r+(e||"")+"E"};t.previousLine=function previousLine(e){return r+(e||"")+"F"};t.horizontalAbsolute=function horizontalAbsolute(e){if(e==null)throw new Error("horizontalAboslute requires a column to position to");return r+e+"G"};t.eraseData=function eraseData(){return r+"J"};t.eraseLine=function eraseLine(){return r+"K"};t.goto=function(e,t){return r+t+";"+e+"H"};t.gotoSOL=function(){return"\r"};t.beep=function(){return""};t.hideCursor=function hideCursor(){return r+"?25l"};t.showCursor=function showCursor(){return r+"?25h"};var a={reset:0,bold:1,italic:3,underline:4,inverse:7,stopBold:22,stopItalic:23,stopUnderline:24,stopInverse:27,white:37,black:30,blue:34,cyan:36,green:32,magenta:35,red:31,yellow:33,bgWhite:47,bgBlack:40,bgBlue:44,bgCyan:46,bgGreen:42,bgMagenta:45,bgRed:41,bgYellow:43,grey:90,brightBlack:90,brightRed:91,brightGreen:92,brightYellow:93,brightBlue:94,brightMagenta:95,brightCyan:96,brightWhite:97,bgGrey:100,bgBrightBlack:100,bgBrightRed:101,bgBrightGreen:102,bgBrightYellow:103,bgBrightBlue:104,bgBrightMagenta:105,bgBrightCyan:106,bgBrightWhite:107};t.color=function color(e){if(arguments.length!==1||!Array.isArray(e)){e=Array.prototype.slice.call(arguments)}return r+e.map(colorNameToCode).join(";")+"m"};function colorNameToCode(e){if(a[e]!=null)return a[e];throw new Error("Unknown color or style name: "+e)}},3487:(e,t)=>{function isArray(e){if(Array.isArray){return Array.isArray(e)}return objectToString(e)==="[object Array]"}t.isArray=isArray;function isBoolean(e){return typeof e==="boolean"}t.isBoolean=isBoolean;function isNull(e){return e===null}t.isNull=isNull;function isNullOrUndefined(e){return e==null}t.isNullOrUndefined=isNullOrUndefined;function isNumber(e){return typeof e==="number"}t.isNumber=isNumber;function isString(e){return typeof e==="string"}t.isString=isString;function isSymbol(e){return typeof e==="symbol"}t.isSymbol=isSymbol;function isUndefined(e){return e===void 0}t.isUndefined=isUndefined;function isRegExp(e){return objectToString(e)==="[object RegExp]"}t.isRegExp=isRegExp;function isObject(e){return typeof e==="object"&&e!==null}t.isObject=isObject;function isDate(e){return objectToString(e)==="[object Date]"}t.isDate=isDate;function isError(e){return objectToString(e)==="[object Error]"||e instanceof Error}t.isError=isError;function isFunction(e){return typeof e==="function"}t.isFunction=isFunction;function isPrimitive(e){return e===null||typeof e==="boolean"||typeof e==="number"||typeof e==="string"||typeof e==="symbol"||typeof e==="undefined"}t.isPrimitive=isPrimitive;t.isBuffer=Buffer.isBuffer;function objectToString(e){return Object.prototype.toString.call(e)}},1722:e=>{e.exports=Delegator;function Delegator(e,t){if(!(this instanceof Delegator))return new Delegator(e,t);this.proto=e;this.target=t;this.methods=[];this.getters=[];this.setters=[];this.fluents=[]}Delegator.prototype.method=function(e){var t=this.proto;var r=this.target;this.methods.push(e);t[e]=function(){return this[r][e].apply(this[r],arguments)};return this};Delegator.prototype.access=function(e){return this.getter(e).setter(e)};Delegator.prototype.getter=function(e){var t=this.proto;var r=this.target;this.getters.push(e);t.__defineGetter__(e,(function(){return this[r][e]}));return this};Delegator.prototype.setter=function(e){var t=this.proto;var r=this.target;this.setters.push(e);t.__defineSetter__(e,(function(t){return this[r][e]=t}));return this};Delegator.prototype.fluent=function(e){var t=this.proto;var r=this.target;this.fluents.push(e);t[e]=function(t){if("undefined"!=typeof t){this[r][e]=t;return this}else{return this[r][e]}};return this}},2157:(e,t,r)=>{"use strict";var a=r(2037).platform();var o=r(2081).spawnSync;var s=r(7147).readdirSync;var u="glibc";var c="musl";var d={encoding:"utf8",env:process.env};if(!o){o=function(){return{status:126,stdout:"",stderr:""}}}function contains(e){return function(t){return t.indexOf(e)!==-1}}function versionFromMuslLdd(e){return e.split(/[\r\n]+/)[1].trim().split(/\s/)[1]}function safeReaddirSync(e){try{return s(e)}catch(e){}return[]}var f="";var p="";var h="";if(a==="linux"){var v=o("getconf",["GNU_LIBC_VERSION"],d);if(v.status===0){f=u;p=v.stdout.trim().split(" ")[1];h="getconf"}else{var _=o("ldd",["--version"],d);if(_.status===0&&_.stdout.indexOf(c)!==-1){f=c;p=versionFromMuslLdd(_.stdout);h="ldd"}else if(_.status===1&&_.stderr.indexOf(c)!==-1){f=c;p=versionFromMuslLdd(_.stderr);h="ldd"}else{var g=safeReaddirSync("/lib");if(g.some(contains("-linux-gnu"))){f=u;h="filesystem"}else if(g.some(contains("libc.musl-"))){f=c;h="filesystem"}else if(g.some(contains("ld-musl-"))){f=c;h="filesystem"}else{var y=safeReaddirSync("/usr/sbin");if(y.some(contains("glibc"))){f=u;h="filesystem"}}}}}var m=f!==""&&f!==u;e.exports={GLIBC:u,MUSL:c,family:f,version:p,method:h,isNonGlibcLinux:m}},9001:(e,t,r)=>{var a=r(1017).sep||"/";e.exports=fileUriToPath;function fileUriToPath(e){if("string"!=typeof e||e.length<=7||"file://"!=e.substring(0,7)){throw new TypeError("must pass in a file:// URI to convert to a file path")}var t=decodeURI(e.substring(7));var r=t.indexOf("/");var o=t.substring(0,r);var s=t.substring(r+1);if("localhost"==o)o="";if(o){o=a+a+o}s=s.replace(/^(.+)\|/,"$1:");if(a=="\\"){s=s.replace(/\//g,"\\")}if(/^.+\:/.test(s)){}else{s=a+s}return o+s}},1271:(e,t,r)=>{"use strict";var a=r(1021);var o=r(5791);e.exports={activityIndicator:function(e,t,r){if(e.spun==null)return;return a(t,e.spun)},progressbar:function(e,t,r){if(e.completed==null)return;return o(t,r,e.completed)}}},2479:(e,t,r)=>{"use strict";var a=r(3837);var o=t.User=function User(e){var t=new Error(e);Error.captureStackTrace(t,User);t.code="EGAUGE";return t};t.MissingTemplateValue=function MissingTemplateValue(e,t){var r=new o(a.format('Missing template value "%s"',e.type));Error.captureStackTrace(r,MissingTemplateValue);r.template=e;r.values=t;return r};t.Internal=function Internal(e){var t=new Error(e);Error.captureStackTrace(t,Internal);t.code="EGAUGEINTERNAL";return t}},3278:e=>{"use strict";e.exports=isWin32()||isColorTerm();function isWin32(){return process.platform==="win32"}function isColorTerm(){var e=/^screen|^xterm|^vt100|color|ansi|cygwin|linux/i;return!!process.env.COLORTERM||e.test(process.env.TERM)}},6054:(e,t,r)=>{"use strict";var a=r(4708);var o=r(7963);var s=r(3278);var u=r(2028);var c=r(7987);var d=r(75);var f=r(9186);var p=r(6401);e.exports=Gauge;function callWith(e,t){return function(){return t.call(e)}}function Gauge(e,t){var r,o;if(e&&e.write){o=e;r=t||{}}else if(t&&t.write){o=t;r=e||{}}else{o=f.stderr;r=e||t||{}}this._status={spun:0,section:"",subsection:""};this._paused=false;this._disabled=true;this._showing=false;this._onScreen=false;this._needsRedraw=false;this._hideCursor=r.hideCursor==null?true:r.hideCursor;this._fixedFramerate=r.fixedFramerate==null?!/^v0\.8\./.test(f.version):r.fixedFramerate;this._lastUpdateAt=null;this._updateInterval=r.updateInterval==null?50:r.updateInterval;this._themes=r.themes||c;this._theme=r.theme;var s=this._computeTheme(r.theme);var u=r.template||[{type:"progressbar",length:20},{type:"activityIndicator",kerning:1,length:1},{type:"section",kerning:1,default:""},{type:"subsection",kerning:1,default:""}];this.setWriteTo(o,r.tty);var d=r.Plumbing||a;this._gauge=new d(s,u,this.getWidth());this._$$doRedraw=callWith(this,this._doRedraw);this._$$handleSizeChange=callWith(this,this._handleSizeChange);this._cleanupOnExit=r.cleanupOnExit==null||r.cleanupOnExit;this._removeOnExit=null;if(r.enabled||r.enabled==null&&this._tty&&this._tty.isTTY){this.enable()}else{this.disable()}}Gauge.prototype={};Gauge.prototype.isEnabled=function(){return!this._disabled};Gauge.prototype.setTemplate=function(e){this._gauge.setTemplate(e);if(this._showing)this._requestRedraw()};Gauge.prototype._computeTheme=function(e){if(!e)e={};if(typeof e==="string"){e=this._themes.getTheme(e)}else if(e&&(Object.keys(e).length===0||e.hasUnicode!=null||e.hasColor!=null)){var t=e.hasUnicode==null?o():e.hasUnicode;var r=e.hasColor==null?s:e.hasColor;e=this._themes.getDefault({hasUnicode:t,hasColor:r,platform:e.platform})}return e};Gauge.prototype.setThemeset=function(e){this._themes=e;this.setTheme(this._theme)};Gauge.prototype.setTheme=function(e){this._gauge.setTheme(this._computeTheme(e));if(this._showing)this._requestRedraw();this._theme=e};Gauge.prototype._requestRedraw=function(){this._needsRedraw=true;if(!this._fixedFramerate)this._doRedraw()};Gauge.prototype.getWidth=function(){return(this._tty&&this._tty.columns||80)-1};Gauge.prototype.setWriteTo=function(e,t){var r=!this._disabled;if(r)this.disable();this._writeTo=e;this._tty=t||e===f.stderr&&f.stdout.isTTY&&f.stdout||e.isTTY&&e||this._tty;if(this._gauge)this._gauge.setWidth(this.getWidth());if(r)this.enable()};Gauge.prototype.enable=function(){if(!this._disabled)return;this._disabled=false;if(this._tty)this._enableEvents();if(this._showing)this.show()};Gauge.prototype.disable=function(){if(this._disabled)return;if(this._showing){this._lastUpdateAt=null;this._showing=false;this._doRedraw();this._showing=true}this._disabled=true;if(this._tty)this._disableEvents()};Gauge.prototype._enableEvents=function(){if(this._cleanupOnExit){this._removeOnExit=u(callWith(this,this.disable))}this._tty.on("resize",this._$$handleSizeChange);if(this._fixedFramerate){this.redrawTracker=d(this._$$doRedraw,this._updateInterval);if(this.redrawTracker.unref)this.redrawTracker.unref()}};Gauge.prototype._disableEvents=function(){this._tty.removeListener("resize",this._$$handleSizeChange);if(this._fixedFramerate)clearInterval(this.redrawTracker);if(this._removeOnExit)this._removeOnExit()};Gauge.prototype.hide=function(e){if(this._disabled)return e&&f.nextTick(e);if(!this._showing)return e&&f.nextTick(e);this._showing=false;this._doRedraw();e&&p(e)};Gauge.prototype.show=function(e,t){this._showing=true;if(typeof e==="string"){this._status.section=e}else if(typeof e==="object"){var r=Object.keys(e);for(var a=0;a{"use strict";var a=r(8753);e.exports=function(e){if(a(e)){return false}if(e>=4352&&(e<=4447||9001===e||9002===e||11904<=e&&e<=12871&&e!==12351||12880<=e&&e<=19903||19968<=e&&e<=42182||43360<=e&&e<=43388||44032<=e&&e<=55203||63744<=e&&e<=64255||65040<=e&&e<=65049||65072<=e&&e<=65131||65281<=e&&e<=65376||65504<=e&&e<=65510||110592<=e&&e<=110593||127488<=e&&e<=127569||131072<=e&&e<=262141)){return true}return false}},5511:(e,t,r)=>{"use strict";var a=r(7518);var o=r(6708);var s=r(6062);e.exports=function(e){if(typeof e!=="string"||e.length===0){return 0}var t=0;e=a(e);for(var r=0;r=127&&u<=159){continue}if(u>=65536){r++}if(s(u)){t+=2}else{t++}}return t}},4708:(e,t,r)=>{"use strict";var a=r(6322);var o=r(4293);var s=r(5534);var u=e.exports=function(e,t,r){if(!r)r=80;s("OAN",[e,t,r]);this.showing=false;this.theme=e;this.width=r;this.template=t};u.prototype={};u.prototype.setTheme=function(e){s("O",[e]);this.theme=e};u.prototype.setTemplate=function(e){s("A",[e]);this.template=e};u.prototype.setWidth=function(e){s("N",[e]);this.width=e};u.prototype.hide=function(){return a.gotoSOL()+a.eraseLine()};u.prototype.hideCursor=a.hideCursor;u.prototype.showCursor=a.showCursor;u.prototype.show=function(e){var t=Object.create(this.theme);for(var r in e){t[r]=e[r]}return o(this.width,this.template,t).trim()+a.color("reset")+a.eraseLine()+a.gotoSOL()}},9186:e=>{"use strict";e.exports=process},5791:(e,t,r)=>{"use strict";var a=r(5534);var o=r(4293);var s=r(2343);var u=r(5511);e.exports=function(e,t,r){a("ONN",[e,t,r]);if(r<0)r=0;if(r>1)r=1;if(t<=0)return"";var s=Math.round(t*r);var u=t-s;var c=[{type:"complete",value:repeat(e.complete,s),length:s},{type:"remaining",value:repeat(e.remaining,u),length:u}];return o(t,c,e)};function repeat(e,t){var r="";var a=t;do{if(a%2){r+=e}a=Math.floor(a/2);e+=e}while(a&&u(r){"use strict";var a=r(7568);var o=r(5534);var s=r(1800);var u=r(2343);var c=r(2479);var d=r(5205);function renderValueWithValues(e){return function(t){return renderValue(t,e)}}var f=e.exports=function(e,t,r){var o=prepareItems(e,t,r);var s=o.map(renderValueWithValues(r)).join("");return a.left(u(s,e),e)};function preType(e){var t=e.type[0].toUpperCase()+e.type.slice(1);return"pre"+t}function postType(e){var t=e.type[0].toUpperCase()+e.type.slice(1);return"post"+t}function hasPreOrPost(e,t){if(!e.type)return;return t[preType(e)]||t[postType(e)]}function generatePreAndPost(e,t){var r=s({},e);var a=Object.create(t);var o=[];var u=preType(r);var c=postType(r);if(a[u]){o.push({value:a[u]});a[u]=null}r.minLength=null;r.length=null;r.maxLength=null;o.push(r);a[r.type]=a[r.type];if(a[c]){o.push({value:a[c]});a[c]=null}return function(e,t,r){return f(r,o,a)}}function prepareItems(e,t,r){function cloneAndObjectify(t,a,o){var s=new d(t,e);var u=s.type;if(s.value==null){if(!(u in r)){if(s.default==null){throw new c.MissingTemplateValue(s,r)}else{s.value=s.default}}else{s.value=r[u]}}if(s.value==null||s.value==="")return null;s.index=a;s.first=a===0;s.last=a===o.length-1;if(hasPreOrPost(s,r))s.value=generatePreAndPost(s,r);return s}var a=t.map(cloneAndObjectify).filter((function(e){return e!=null}));var o=0;var s=e;var u=a.length;function consumeSpace(e){if(e>s)e=s;o+=e;s-=e}function finishSizing(e,t){if(e.finished)throw new c.Internal("Tried to finish template item that was already finished");if(t===Infinity)throw new c.Internal("Length of template item cannot be infinity");if(t!=null)e.length=t;e.minLength=null;e.maxLength=null;--u;e.finished=true;if(e.length==null)e.length=e.getBaseLength();if(e.length==null)throw new c.Internal("Finished template items must have a length");consumeSpace(e.getLength())}a.forEach((function(e){if(!e.kerning)return;var t=e.first?0:a[e.index-1].padRight;if(!e.first&&t=h){finishSizing(e,e.minLength);p=true}}))}while(p&&f++{"use strict";var a=r(9186);try{e.exports=setImmediate}catch(t){e.exports=a.nextTick}},75:e=>{"use strict";e.exports=setInterval},1021:e=>{"use strict";e.exports=function spin(e,t){return e[t%e.length]}},5205:(e,t,r)=>{"use strict";var a=r(5511);e.exports=TemplateItem;function isPercent(e){if(typeof e!=="string")return false;return e.slice(-1)==="%"}function percent(e){return Number(e.slice(0,-1))/100}function TemplateItem(e,t){this.overallOutputLength=t;this.finished=false;this.type=null;this.value=null;this.length=null;this.maxLength=null;this.minLength=null;this.kerning=null;this.align="left";this.padLeft=0;this.padRight=0;this.index=null;this.first=null;this.last=null;if(typeof e==="string"){this.value=e}else{for(var r in e)this[r]=e[r]}if(isPercent(this.length)){this.length=Math.round(this.overallOutputLength*percent(this.length))}if(isPercent(this.minLength)){this.minLength=Math.round(this.overallOutputLength*percent(this.minLength))}if(isPercent(this.maxLength)){this.maxLength=Math.round(this.overallOutputLength*percent(this.maxLength))}return this}TemplateItem.prototype={};TemplateItem.prototype.getBaseLength=function(){var e=this.length;if(e==null&&typeof this.value==="string"&&this.maxLength==null&&this.minLength==null){e=a(this.value)}return e};TemplateItem.prototype.getLength=function(){var e=this.getBaseLength();if(e==null)return null;return e+this.padLeft+this.padRight};TemplateItem.prototype.getMaxLength=function(){if(this.maxLength==null)return null;return this.maxLength+this.padLeft+this.padRight};TemplateItem.prototype.getMinLength=function(){if(this.minLength==null)return null;return this.minLength+this.padLeft+this.padRight}},3117:(e,t,r)=>{"use strict";var a=r(1800);e.exports=function(){return o.newThemeSet()};var o={};o.baseTheme=r(1271);o.newTheme=function(e,t){if(!t){t=e;e=this.baseTheme}return a({},e,t)};o.getThemeNames=function(){return Object.keys(this.themes)};o.addTheme=function(e,t,r){this.themes[e]=this.newTheme(t,r)};o.addToAllThemes=function(e){var t=this.themes;Object.keys(t).forEach((function(r){a(t[r],e)}));a(this.baseTheme,e)};o.getTheme=function(e){if(!this.themes[e])throw this.newMissingThemeError(e);return this.themes[e]};o.setDefault=function(e,t){if(t==null){t=e;e={}}var r=e.platform==null?"fallback":e.platform;var a=!!e.hasUnicode;var o=!!e.hasColor;if(!this.defaults[r])this.defaults[r]={true:{},false:{}};this.defaults[r][a][o]=t};o.getDefault=function(e){if(!e)e={};var t=e.platform||process.platform;var r=this.defaults[t]||this.defaults.fallback;var o=!!e.hasUnicode;var s=!!e.hasColor;if(!r)throw this.newMissingDefaultThemeError(t,o,s);if(!r[o][s]){if(o&&s&&r[!o][s]){o=false}else if(o&&s&&r[o][!s]){s=false}else if(o&&s&&r[!o][!s]){o=false;s=false}else if(o&&!s&&r[!o][s]){o=false}else if(!o&&s&&r[o][!s]){s=false}else if(r===this.defaults.fallback){throw this.newMissingDefaultThemeError(t,o,s)}}if(r[o][s]){return this.getTheme(r[o][s])}else{return this.getDefault(a({},e,{platform:"fallback"}))}};o.newMissingThemeError=function newMissingThemeError(e){var t=new Error('Could not find a gauge theme named "'+e+'"');Error.captureStackTrace.call(t,newMissingThemeError);t.theme=e;t.code="EMISSINGTHEME";return t};o.newMissingDefaultThemeError=function newMissingDefaultThemeError(e,t,r){var a=new Error("Could not find a gauge theme for your platform/unicode/color use combo:\n"+" platform = "+e+"\n"+" hasUnicode = "+t+"\n"+" hasColor = "+r);Error.captureStackTrace.call(a,newMissingDefaultThemeError);a.platform=e;a.hasUnicode=t;a.hasColor=r;a.code="EMISSINGTHEME";return a};o.newThemeSet=function(){var themeset=function(e){return themeset.getDefault(e)};return a(themeset,o,{themes:a({},this.themes),baseTheme:a({},this.baseTheme),defaults:JSON.parse(JSON.stringify(this.defaults||{}))})}},7987:(e,t,r)=>{"use strict";var a=r(6322);var o=r(3117);var s=e.exports=new o;s.addTheme("ASCII",{preProgressbar:"[",postProgressbar:"]",progressbarTheme:{complete:"#",remaining:"."},activityIndicatorTheme:"-\\|/",preSubsection:">"});s.addTheme("colorASCII",s.getTheme("ASCII"),{progressbarTheme:{preComplete:a.color("inverse"),complete:" ",postComplete:a.color("stopInverse"),preRemaining:a.color("brightBlack"),remaining:".",postRemaining:a.color("reset")}});s.addTheme("brailleSpinner",{preProgressbar:"⸨",postProgressbar:"⸩",progressbarTheme:{complete:"░",remaining:"⠂"},activityIndicatorTheme:"⠋⠙⠹⠸⠼⠴⠦⠧⠇⠏",preSubsection:">"});s.addTheme("colorBrailleSpinner",s.getTheme("brailleSpinner"),{progressbarTheme:{preComplete:a.color("inverse"),complete:" ",postComplete:a.color("stopInverse"),preRemaining:a.color("brightBlack"),remaining:"░",postRemaining:a.color("reset")}});s.setDefault({},"ASCII");s.setDefault({hasColor:true},"colorASCII");s.setDefault({platform:"darwin",hasUnicode:true},"brailleSpinner");s.setDefault({platform:"darwin",hasUnicode:true,hasColor:true},"colorBrailleSpinner")},2343:(e,t,r)=>{"use strict";var a=r(5511);var o=r(7518);e.exports=wideTruncate;function wideTruncate(e,t){if(a(e)===0)return e;if(t<=0)return"";if(a(e)<=t)return e;var r=o(e);var s=e.length+r.length;var u=e.slice(0,t+s);while(a(u)>t){u=u.slice(0,-1)}return u}},9132:e=>{"use strict";e.exports=clone;var t=Object.getPrototypeOf||function(e){return e.__proto__};function clone(e){if(e===null||typeof e!=="object")return e;if(e instanceof Object)var r={__proto__:t(e)};else var r=Object.create(null);Object.getOwnPropertyNames(e).forEach((function(t){Object.defineProperty(r,t,Object.getOwnPropertyDescriptor(e,t))}));return r}},552:(e,t,r)=>{var a=r(7147);var o=r(1290);var s=r(4410);var u=r(9132);var c=r(3837);var d;var f;if(typeof Symbol==="function"&&typeof Symbol.for==="function"){d=Symbol.for("graceful-fs.queue");f=Symbol.for("graceful-fs.previous")}else{d="___graceful-fs.queue";f="___graceful-fs.previous"}function noop(){}function publishQueue(e,t){Object.defineProperty(e,d,{get:function(){return t}})}var p=noop;if(c.debuglog)p=c.debuglog("gfs4");else if(/\bgfs4\b/i.test(process.env.NODE_DEBUG||""))p=function(){var e=c.format.apply(c,arguments);e="GFS4: "+e.split(/\n/).join("\nGFS4: ");console.error(e)};if(!a[d]){var h=global[d]||[];publishQueue(a,h);a.close=function(e){function close(t,r){return e.call(a,t,(function(e){if(!e){resetQueue()}if(typeof r==="function")r.apply(this,arguments)}))}Object.defineProperty(close,f,{value:e});return close}(a.close);a.closeSync=function(e){function closeSync(t){e.apply(a,arguments);resetQueue()}Object.defineProperty(closeSync,f,{value:e});return closeSync}(a.closeSync);if(/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")){process.on("exit",(function(){p(a[d]);r(9491).equal(a[d].length,0)}))}}if(!global[d]){publishQueue(global,a[d])}e.exports=patch(u(a));if(process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!a.__patched){e.exports=patch(a);a.__patched=true}function patch(e){o(e);e.gracefulify=patch;e.createReadStream=createReadStream;e.createWriteStream=createWriteStream;var t=e.readFile;e.readFile=readFile;function readFile(e,r,a){if(typeof r==="function")a=r,r=null;return go$readFile(e,r,a);function go$readFile(e,r,a,o){return t(e,r,(function(t){if(t&&(t.code==="EMFILE"||t.code==="ENFILE"))enqueue([go$readFile,[e,r,a],t,o||Date.now(),Date.now()]);else{if(typeof a==="function")a.apply(this,arguments)}}))}}var r=e.writeFile;e.writeFile=writeFile;function writeFile(e,t,a,o){if(typeof a==="function")o=a,a=null;return go$writeFile(e,t,a,o);function go$writeFile(e,t,a,o,s){return r(e,t,a,(function(r){if(r&&(r.code==="EMFILE"||r.code==="ENFILE"))enqueue([go$writeFile,[e,t,a,o],r,s||Date.now(),Date.now()]);else{if(typeof o==="function")o.apply(this,arguments)}}))}}var a=e.appendFile;if(a)e.appendFile=appendFile;function appendFile(e,t,r,o){if(typeof r==="function")o=r,r=null;return go$appendFile(e,t,r,o);function go$appendFile(e,t,r,o,s){return a(e,t,r,(function(a){if(a&&(a.code==="EMFILE"||a.code==="ENFILE"))enqueue([go$appendFile,[e,t,r,o],a,s||Date.now(),Date.now()]);else{if(typeof o==="function")o.apply(this,arguments)}}))}}var u=e.copyFile;if(u)e.copyFile=copyFile;function copyFile(e,t,r,a){if(typeof r==="function"){a=r;r=0}return go$copyFile(e,t,r,a);function go$copyFile(e,t,r,a,o){return u(e,t,r,(function(s){if(s&&(s.code==="EMFILE"||s.code==="ENFILE"))enqueue([go$copyFile,[e,t,r,a],s,o||Date.now(),Date.now()]);else{if(typeof a==="function")a.apply(this,arguments)}}))}}var c=e.readdir;e.readdir=readdir;function readdir(e,t,r){if(typeof t==="function")r=t,t=null;return go$readdir(e,t,r);function go$readdir(e,t,r,a){return c(e,t,(function(o,s){if(o&&(o.code==="EMFILE"||o.code==="ENFILE"))enqueue([go$readdir,[e,t,r],o,a||Date.now(),Date.now()]);else{if(s&&s.sort)s.sort();if(typeof r==="function")r.call(this,o,s)}}))}}if(process.version.substr(0,4)==="v0.8"){var d=s(e);ReadStream=d.ReadStream;WriteStream=d.WriteStream}var f=e.ReadStream;if(f){ReadStream.prototype=Object.create(f.prototype);ReadStream.prototype.open=ReadStream$open}var p=e.WriteStream;if(p){WriteStream.prototype=Object.create(p.prototype);WriteStream.prototype.open=WriteStream$open}Object.defineProperty(e,"ReadStream",{get:function(){return ReadStream},set:function(e){ReadStream=e},enumerable:true,configurable:true});Object.defineProperty(e,"WriteStream",{get:function(){return WriteStream},set:function(e){WriteStream=e},enumerable:true,configurable:true});var h=ReadStream;Object.defineProperty(e,"FileReadStream",{get:function(){return h},set:function(e){h=e},enumerable:true,configurable:true});var v=WriteStream;Object.defineProperty(e,"FileWriteStream",{get:function(){return v},set:function(e){v=e},enumerable:true,configurable:true});function ReadStream(e,t){if(this instanceof ReadStream)return f.apply(this,arguments),this;else return ReadStream.apply(Object.create(ReadStream.prototype),arguments)}function ReadStream$open(){var e=this;open(e.path,e.flags,e.mode,(function(t,r){if(t){if(e.autoClose)e.destroy();e.emit("error",t)}else{e.fd=r;e.emit("open",r);e.read()}}))}function WriteStream(e,t){if(this instanceof WriteStream)return p.apply(this,arguments),this;else return WriteStream.apply(Object.create(WriteStream.prototype),arguments)}function WriteStream$open(){var e=this;open(e.path,e.flags,e.mode,(function(t,r){if(t){e.destroy();e.emit("error",t)}else{e.fd=r;e.emit("open",r)}}))}function createReadStream(t,r){return new e.ReadStream(t,r)}function createWriteStream(t,r){return new e.WriteStream(t,r)}var _=e.open;e.open=open;function open(e,t,r,a){if(typeof r==="function")a=r,r=null;return go$open(e,t,r,a);function go$open(e,t,r,a,o){return _(e,t,r,(function(s,u){if(s&&(s.code==="EMFILE"||s.code==="ENFILE"))enqueue([go$open,[e,t,r,a],s,o||Date.now(),Date.now()]);else{if(typeof a==="function")a.apply(this,arguments)}}))}}return e}function enqueue(e){p("ENQUEUE",e[0].name,e[1]);a[d].push(e);retry()}var v;function resetQueue(){var e=Date.now();for(var t=0;t2){a[d][t][3]=e;a[d][t][4]=e}}retry()}function retry(){clearTimeout(v);v=undefined;if(a[d].length===0)return;var e=a[d].shift();var t=e[0];var r=e[1];var o=e[2];var s=e[3];var u=e[4];if(s===undefined){p("RETRY",t.name,r);t.apply(null,r)}else if(Date.now()-s>=6e4){p("TIMEOUT",t.name,r);var c=r.pop();if(typeof c==="function")c.call(null,o)}else{var f=Date.now()-u;var h=Math.max(u-s,1);var _=Math.min(h*1.2,100);if(f>=_){p("RETRY",t.name,r);t.apply(null,r.concat([s]))}else{a[d].push(e)}}if(v===undefined){v=setTimeout(retry,0)}}},4410:(e,t,r)=>{var a=r(2781).Stream;e.exports=legacy;function legacy(e){return{ReadStream:ReadStream,WriteStream:WriteStream};function ReadStream(t,r){if(!(this instanceof ReadStream))return new ReadStream(t,r);a.call(this);var o=this;this.path=t;this.fd=null;this.readable=true;this.paused=false;this.flags="r";this.mode=438;this.bufferSize=64*1024;r=r||{};var s=Object.keys(r);for(var u=0,c=s.length;uthis.end){throw new Error("start must be <= end")}this.pos=this.start}if(this.fd!==null){process.nextTick((function(){o._read()}));return}e.open(this.path,this.flags,this.mode,(function(e,t){if(e){o.emit("error",e);o.readable=false;return}o.fd=t;o.emit("open",t);o._read()}))}function WriteStream(t,r){if(!(this instanceof WriteStream))return new WriteStream(t,r);a.call(this);this.path=t;this.fd=null;this.writable=true;this.flags="w";this.encoding="binary";this.mode=438;this.bytesWritten=0;r=r||{};var o=Object.keys(r);for(var s=0,u=o.length;s= zero")}this.pos=this.start}this.busy=false;this._queue=[];if(this.fd===null){this._open=e.open;this._queue.push([this._open,this.path,this.flags,this.mode,undefined]);this.flush()}}}},1290:(e,t,r)=>{var a=r(2057);var o=process.cwd;var s=null;var u=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){if(!s)s=o.call(process);return s};try{process.cwd()}catch(e){}if(typeof process.chdir==="function"){var c=process.chdir;process.chdir=function(e){s=null;c.call(process,e)};if(Object.setPrototypeOf)Object.setPrototypeOf(process.chdir,c)}e.exports=patch;function patch(e){if(a.hasOwnProperty("O_SYMLINK")&&process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)){patchLchmod(e)}if(!e.lutimes){patchLutimes(e)}e.chown=chownFix(e.chown);e.fchown=chownFix(e.fchown);e.lchown=chownFix(e.lchown);e.chmod=chmodFix(e.chmod);e.fchmod=chmodFix(e.fchmod);e.lchmod=chmodFix(e.lchmod);e.chownSync=chownFixSync(e.chownSync);e.fchownSync=chownFixSync(e.fchownSync);e.lchownSync=chownFixSync(e.lchownSync);e.chmodSync=chmodFixSync(e.chmodSync);e.fchmodSync=chmodFixSync(e.fchmodSync);e.lchmodSync=chmodFixSync(e.lchmodSync);e.stat=statFix(e.stat);e.fstat=statFix(e.fstat);e.lstat=statFix(e.lstat);e.statSync=statFixSync(e.statSync);e.fstatSync=statFixSync(e.fstatSync);e.lstatSync=statFixSync(e.lstatSync);if(!e.lchmod){e.lchmod=function(e,t,r){if(r)process.nextTick(r)};e.lchmodSync=function(){}}if(!e.lchown){e.lchown=function(e,t,r,a){if(a)process.nextTick(a)};e.lchownSync=function(){}}if(u==="win32"){e.rename=function(t){return function(r,a,o){var s=Date.now();var u=0;t(r,a,(function CB(c){if(c&&(c.code==="EACCES"||c.code==="EPERM")&&Date.now()-s<6e4){setTimeout((function(){e.stat(a,(function(e,s){if(e&&e.code==="ENOENT")t(r,a,CB);else o(c)}))}),u);if(u<100)u+=10;return}if(o)o(c)}))}}(e.rename)}e.read=function(t){function read(r,a,o,s,u,c){var d;if(c&&typeof c==="function"){var f=0;d=function(p,h,v){if(p&&p.code==="EAGAIN"&&f<10){f++;return t.call(e,r,a,o,s,u,d)}c.apply(this,arguments)}}return t.call(e,r,a,o,s,u,d)}if(Object.setPrototypeOf)Object.setPrototypeOf(read,t);return read}(e.read);e.readSync=function(t){return function(r,a,o,s,u){var c=0;while(true){try{return t.call(e,r,a,o,s,u)}catch(e){if(e.code==="EAGAIN"&&c<10){c++;continue}throw e}}}}(e.readSync);function patchLchmod(e){e.lchmod=function(t,r,o){e.open(t,a.O_WRONLY|a.O_SYMLINK,r,(function(t,a){if(t){if(o)o(t);return}e.fchmod(a,r,(function(t){e.close(a,(function(e){if(o)o(t||e)}))}))}))};e.lchmodSync=function(t,r){var o=e.openSync(t,a.O_WRONLY|a.O_SYMLINK,r);var s=true;var u;try{u=e.fchmodSync(o,r);s=false}finally{if(s){try{e.closeSync(o)}catch(e){}}else{e.closeSync(o)}}return u}}function patchLutimes(e){if(a.hasOwnProperty("O_SYMLINK")){e.lutimes=function(t,r,o,s){e.open(t,a.O_SYMLINK,(function(t,a){if(t){if(s)s(t);return}e.futimes(a,r,o,(function(t){e.close(a,(function(e){if(s)s(t||e)}))}))}))};e.lutimesSync=function(t,r,o){var s=e.openSync(t,a.O_SYMLINK);var u;var c=true;try{u=e.futimesSync(s,r,o);c=false}finally{if(c){try{e.closeSync(s)}catch(e){}}else{e.closeSync(s)}}return u}}else{e.lutimes=function(e,t,r,a){if(a)process.nextTick(a)};e.lutimesSync=function(){}}}function chmodFix(t){if(!t)return t;return function(r,a,o){return t.call(e,r,a,(function(e){if(chownErOk(e))e=null;if(o)o.apply(this,arguments)}))}}function chmodFixSync(t){if(!t)return t;return function(r,a){try{return t.call(e,r,a)}catch(e){if(!chownErOk(e))throw e}}}function chownFix(t){if(!t)return t;return function(r,a,o,s){return t.call(e,r,a,o,(function(e){if(chownErOk(e))e=null;if(s)s.apply(this,arguments)}))}}function chownFixSync(t){if(!t)return t;return function(r,a,o){try{return t.call(e,r,a,o)}catch(e){if(!chownErOk(e))throw e}}}function statFix(t){if(!t)return t;return function(r,a,o){if(typeof a==="function"){o=a;a=null}function callback(e,t){if(t){if(t.uid<0)t.uid+=4294967296;if(t.gid<0)t.gid+=4294967296}if(o)o.apply(this,arguments)}return a?t.call(e,r,a,callback):t.call(e,r,callback)}}function statFixSync(t){if(!t)return t;return function(r,a){var o=a?t.call(e,r,a):t.call(e,r);if(o){if(o.uid<0)o.uid+=4294967296;if(o.gid<0)o.gid+=4294967296}return o}}function chownErOk(e){if(!e)return true;if(e.code==="ENOSYS")return true;var t=!process.getuid||process.getuid()!==0;if(t){if(e.code==="EINVAL"||e.code==="EPERM")return true}return false}}},7963:(e,t,r)=>{"use strict";var a=r(2037);var o=e.exports=function(){if(a.type()=="Windows_NT"){return false}var e=/UTF-?8$/i;var t=process.env.LC_ALL||process.env.LC_CTYPE||process.env.LANG;return e.test(t)}},6919:(e,t,r)=>{try{var a=r(3837);if(typeof a.inherits!=="function")throw"";e.exports=a.inherits}catch(t){e.exports=r(7526)}},7526:e=>{if(typeof Object.create==="function"){e.exports=function inherits(e,t){if(t){e.super_=t;e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}})}}}else{e.exports=function inherits(e,t){if(t){e.super_=t;var TempCtor=function(){};TempCtor.prototype=t.prototype;e.prototype=new TempCtor;e.prototype.constructor=e}}}},9842:e=>{var t={}.toString;e.exports=Array.isArray||function(e){return t.call(e)=="[object Array]"}},3277:(module,__unused_webpack_exports,__nccwpck_require__)=>{var fs=__nccwpck_require__(7147);var path=__nccwpck_require__(1017);var os=__nccwpck_require__(2037);var runtimeRequire=true?eval("require"):0;var vars=process.config&&process.config.variables||{};var prebuildsOnly=!!process.env.PREBUILDS_ONLY;var abi=process.versions.modules;var runtime=isElectron()?"electron":"node";var arch=os.arch();var platform=os.platform();var libc=process.env.LIBC||(isAlpine(platform)?"musl":"glibc");var armv=process.env.ARM_VERSION||(arch==="arm64"?"8":vars.arm_version)||"";var uv=(process.versions.uv||"").split(".")[0];module.exports=load;function load(e){return runtimeRequire(load.path(e))}load.path=function(e){e=path.resolve(e||".");try{var t=runtimeRequire(path.join(e,"package.json")).name.toUpperCase().replace(/-/g,"_");if(process.env[t+"_PREBUILD"])e=process.env[t+"_PREBUILD"]}catch(e){}if(!prebuildsOnly){var r=getFirst(path.join(e,"build/Release"),matchBuild);if(r)return r;var a=getFirst(path.join(e,"build/Debug"),matchBuild);if(a)return a}var o=resolve(e);if(o)return o;var s=resolve(path.dirname(process.execPath));if(s)return s;var u=["platform="+platform,"arch="+arch,"runtime="+runtime,"abi="+abi,"uv="+uv,armv?"armv="+armv:"","libc="+libc,"node="+process.versions.node,process.versions&&process.versions.electron?"electron="+process.versions.electron:"",true?"webpack=true":0].filter(Boolean).join(" ");throw new Error("No native build was found for "+u+"\n loaded from: "+e+"\n");function resolve(e){var t=path.join(e,"prebuilds",platform+"-"+arch);var r=readdirSync(t).map(parseTags);var a=r.filter(matchTags(runtime,abi));var o=a.sort(compareTags(runtime))[0];if(o)return path.join(t,o.file)}};function readdirSync(e){try{return fs.readdirSync(e)}catch(e){return[]}}function getFirst(e,t){var r=readdirSync(e).filter(t);return r[0]&&path.join(e,r[0])}function matchBuild(e){return/\.node$/.test(e)}function parseTags(e){var t=e.split(".");var r=t.pop();var a={file:e,specificity:0};if(r!=="node")return;for(var o=0;or.specificity?-1:1}else{return 0}}}function isElectron(){if(process.versions&&process.versions.electron)return true;if(process.env.ELECTRON_RUN_AS_NODE)return true;return typeof window!=="undefined"&&window.process&&window.process.type==="renderer"}function isAlpine(e){return e==="linux"&&fs.existsSync("/etc/alpine-release")}load.parseTags=parseTags;load.matchTags=matchTags;load.compareTags=compareTags},9248:(e,t,r)=>{"use strict";var a=r(7147);var o=r(3632);var s=r(9658);e.exports=t;var u=process.version.substr(1).replace(/-.*$/,"").split(".").map((function(e){return+e}));var c=["build","clean","configure","package","publish","reveal","testbinary","testpackage","unpublish"];var d="napi_build_version=";e.exports.get_napi_version=function(e){var t=process.versions.napi;if(!t){if(u[0]===9&&u[1]>=3)t=2;else if(u[0]===8)t=1}return t};e.exports.get_napi_version_as_string=function(t){var r=e.exports.get_napi_version(t);return r?""+r:""};e.exports.validate_package_json=function(t,r){var a=t.binary;var o=pathOK(a.module_path);var s=pathOK(a.remote_path);var u=pathOK(a.package_name);var c=e.exports.get_napi_build_versions(t,r,true);var d=e.exports.get_napi_build_versions_raw(t);if(c){c.forEach((function(e){if(!(parseInt(e,10)===e&&e>0)){throw new Error("All values specified in napi_versions must be positive integers.")}}))}if(c&&(!o||!s&&!u)){throw new Error("When napi_versions is specified; module_path and either remote_path or "+"package_name must contain the substitution string '{napi_build_version}`.")}if((o||s||u)&&!d){throw new Error("When the substitution string '{napi_build_version}` is specified in "+"module_path, remote_path, or package_name; napi_versions must also be specified.")}if(c&&!e.exports.get_best_napi_build_version(t,r)&&e.exports.build_napi_only(t)){throw new Error("The N-API version of this Node instance is "+e.exports.get_napi_version(r?r.target:undefined)+". "+"This module supports N-API version(s) "+e.exports.get_napi_build_versions_raw(t)+". "+"This Node instance cannot run this module.")}if(d&&!c&&e.exports.build_napi_only(t)){throw new Error("The N-API version of this Node instance is "+e.exports.get_napi_version(r?r.target:undefined)+". "+"This module supports N-API version(s) "+e.exports.get_napi_build_versions_raw(t)+". "+"This Node instance cannot run this module.")}};function pathOK(e){return e&&(e.indexOf("{napi_build_version}")!==-1||e.indexOf("{node_napi_label}")!==-1)}e.exports.expand_commands=function(t,r,a){var o=[];var s=e.exports.get_napi_build_versions(t,r);a.forEach((function(a){if(s&&a.name==="install"){var u=e.exports.get_best_napi_build_version(t,r);var f=u?[d+u]:[];o.push({name:a.name,args:f})}else if(s&&c.indexOf(a.name)!==-1){s.forEach((function(e){var t=a.args.slice();t.push(d+e);o.push({name:a.name,args:t})}))}else{o.push(a)}}));return o};e.exports.get_napi_build_versions=function(t,r,a){var o=[];var u=e.exports.get_napi_version(r?r.target:undefined);if(t.binary&&t.binary.napi_versions){t.binary.napi_versions.forEach((function(e){var t=o.indexOf(e)!==-1;if(!t&&u&&e<=u){o.push(e)}else if(a&&!t&&u){s.info("This Node instance does not support builds for N-API version",e)}}))}if(r&&r["build-latest-napi-version-only"]){var c=0;o.forEach((function(e){if(e>c)c=e}));o=c?[c]:[]}return o.length?o:undefined};e.exports.get_napi_build_versions_raw=function(e){var t=[];if(e.binary&&e.binary.napi_versions){e.binary.napi_versions.forEach((function(e){if(t.indexOf(e)===-1){t.push(e)}}))}return t.length?t:undefined};e.exports.get_command_arg=function(e){return d+e};e.exports.get_napi_build_version_from_command_args=function(e){for(var t=0;ta&&e<=s){a=e}}))}return a===0?undefined:a};e.exports.build_napi_only=function(e){return e.binary&&e.binary.package_name&&e.binary.package_name.indexOf("{node_napi_label}")===-1}},5574:(e,t,r)=>{"use strict";e.exports=t;var a=r(1017);var o=r(7849);var s=r(7310);var u=r(2157);var c=r(9248);var d;if(process.env.NODE_PRE_GYP_ABI_CROSSWALK){d=require(process.env.NODE_PRE_GYP_ABI_CROSSWALK)}else{d=r(7316)}var f={};Object.keys(d).forEach((function(e){var t=e.split(".")[0];if(!f[t]){f[t]=e}}));function get_electron_abi(e,t){if(!e){throw new Error("get_electron_abi requires valid runtime arg")}if(typeof t==="undefined"){throw new Error("Empty target version is not supported if electron is the target.")}var r=o.parse(t);return e+"-v"+r.major+"."+r.minor}e.exports.get_electron_abi=get_electron_abi;function get_node_webkit_abi(e,t){if(!e){throw new Error("get_node_webkit_abi requires valid runtime arg")}if(typeof t==="undefined"){throw new Error("Empty target version is not supported if node-webkit is the target.")}return e+"-v"+t}e.exports.get_node_webkit_abi=get_node_webkit_abi;function get_node_abi(e,t){if(!e){throw new Error("get_node_abi requires valid runtime arg")}if(!t){throw new Error("get_node_abi requires valid process.versions object")}var r=o.parse(t.node);if(r.major===0&&r.minor%2){return e+"-v"+t.node}else{return t.modules?e+"-v"+ +t.modules:"v8-"+t.v8.split(".").slice(0,2).join(".")}}e.exports.get_node_abi=get_node_abi;function get_runtime_abi(e,t){if(!e){throw new Error("get_runtime_abi requires valid runtime arg")}if(e==="node-webkit"){return get_node_webkit_abi(e,t||process.versions["node-webkit"])}else if(e==="electron"){return get_electron_abi(e,t||process.versions.electron)}else{if(e!="node"){throw new Error("Unknown Runtime: '"+e+"'")}if(!t){return get_node_abi(e,process.versions)}else{var r;if(d[t]){r=d[t]}else{var a=t.split(".").map((function(e){return+e}));if(a.length!=3){throw new Error("Unknown target version: "+t)}var o=a[0];var s=a[1];var u=a[2];if(o===1){while(true){if(s>0)--s;if(u>0)--u;var c=""+o+"."+s+"."+u;if(d[c]){r=d[c];console.log("Warning: node-pre-gyp could not find exact match for "+t);console.log("Warning: but node-pre-gyp successfully choose "+c+" as ABI compatible target");break}if(s===0&&u===0){break}}}else if(o>=2){if(f[o]){r=d[f[o]];console.log("Warning: node-pre-gyp could not find exact match for "+t);console.log("Warning: but node-pre-gyp successfully choose "+f[o]+" as ABI compatible target")}}else if(o===0){if(a[1]%2===0){while(--u>0){var p=""+o+"."+s+"."+u;if(d[p]){r=d[p];console.log("Warning: node-pre-gyp could not find exact match for "+t);console.log("Warning: but node-pre-gyp successfully choose "+p+" as ABI compatible target");break}}}}}if(!r){throw new Error("Unsupported target version: "+t)}var h={node:t,v8:r.v8+".0",modules:r.node_abi>1?r.node_abi:undefined};return get_node_abi(e,h)}}}e.exports.get_runtime_abi=get_runtime_abi;var p=["module_name","module_path","host"];function validate_config(e,t){var r=e.name+" package.json is not node-pre-gyp ready:\n";var a=[];if(!e.main){a.push("main")}if(!e.version){a.push("version")}if(!e.name){a.push("name")}if(!e.binary){a.push("binary")}var o=e.binary;p.forEach((function(e){if(a.indexOf("binary")>-1){a.pop("binary")}if(!o||o[e]===undefined||o[e]===""){a.push("binary."+e)}}));if(a.length>=1){throw new Error(r+"package.json must declare these properties: \n"+a.join("\n"))}if(o){var u=s.parse(o.host).protocol;if(u==="http:"){throw new Error("'host' protocol ("+u+") is invalid - only 'https:' is accepted")}}c.validate_package_json(e,t)}e.exports.validate_config=validate_config;function eval_template(e,t){Object.keys(t).forEach((function(r){var a="{"+r+"}";while(e.indexOf(a)>-1){e=e.replace(a,t[r])}}));return e}function fix_slashes(e){if(e.slice(-1)!="/"){return e+"/"}return e}function drop_double_slashes(e){return e.replace(/\/\//g,"/")}function get_process_runtime(e){var t="node";if(e["node-webkit"]){t="node-webkit"}else if(e.electron){t="electron"}return t}e.exports.get_process_runtime=get_process_runtime;var h="{module_name}-v{version}-{node_abi}-{platform}-{arch}.tar.gz";var v="";e.exports.evaluate=function(e,t,r){t=t||{};validate_config(e,t);var d=e.version;var f=o.parse(d);var p=t.runtime||get_process_runtime(process.versions);var _={name:e.name,configuration:Boolean(t.debug)?"Debug":"Release",debug:t.debug,module_name:e.binary.module_name,version:f.version,prerelease:f.prerelease.length?f.prerelease.join("."):"",build:f.build.length?f.build.join("."):"",major:f.major,minor:f.minor,patch:f.patch,runtime:p,node_abi:get_runtime_abi(p,t.target),node_abi_napi:c.get_napi_version(t.target)?"napi":get_runtime_abi(p,t.target),napi_version:c.get_napi_version(t.target),napi_build_version:r||"",node_napi_label:r?"napi-v"+r:get_runtime_abi(p,t.target),target:t.target||"",platform:t.target_platform||process.platform,target_platform:t.target_platform||process.platform,arch:t.target_arch||process.arch,target_arch:t.target_arch||process.arch,libc:t.target_libc||u.family||"unknown",module_main:e.main,toolset:t.toolset||""};var g=process.env["npm_config_"+_.module_name+"_binary_host_mirror"]||e.binary.host;_.host=fix_slashes(eval_template(g,_));_.module_path=eval_template(e.binary.module_path,_);if(t.module_root){_.module_path=a.join(t.module_root,_.module_path)}else{_.module_path=a.resolve(_.module_path)}_.module=a.join(_.module_path,_.module_name+".node");_.remote_path=e.binary.remote_path?drop_double_slashes(fix_slashes(eval_template(e.binary.remote_path,_))):v;var y=e.binary.package_name?e.binary.package_name:h;_.package_name=eval_template(y,_);_.staged_tarball=a.join("build/stage",_.remote_path,_.package_name);_.hosted_path=s.resolve(_.host,_.remote_path);_.hosted_tarball=s.resolve(_.hosted_path,_.package_name);return _}},3632:(e,t,r)=>{e.exports=rimraf;rimraf.sync=rimrafSync;var a=r(9491);var o=r(1017);var s=r(7147);var u=undefined;try{u=r(3535)}catch(e){}var c=parseInt("666",8);var d={nosort:true,silent:true};var f=0;var p=process.platform==="win32";function defaults(e){var t=["unlink","chmod","stat","lstat","rmdir","readdir"];t.forEach((function(t){e[t]=e[t]||s[t];t=t+"Sync";e[t]=e[t]||s[t]}));e.maxBusyTries=e.maxBusyTries||3;e.emfileWait=e.emfileWait||1e3;if(e.glob===false){e.disableGlob=true}if(e.disableGlob!==true&&u===undefined){throw Error("glob dependency not found, set `options.disableGlob = true` if intentional")}e.disableGlob=e.disableGlob||false;e.glob=e.glob||d}function rimraf(e,t,r){if(typeof t==="function"){r=t;t={}}a(e,"rimraf: missing path");a.equal(typeof e,"string","rimraf: path should be a string");a.equal(typeof r,"function","rimraf: callback function required");a(t,"rimraf: invalid options argument provided");a.equal(typeof t,"object","rimraf: options should be object");defaults(t);var o=0;var s=null;var c=0;if(t.disableGlob||!u.hasMagic(e))return afterGlob(null,[e]);t.lstat(e,(function(r,a){if(!r)return afterGlob(null,[e]);u(e,t.glob,afterGlob)}));function next(e){s=s||e;if(--c===0)r(s)}function afterGlob(e,a){if(e)return r(e);c=a.length;if(c===0)return r();a.forEach((function(e){rimraf_(e,t,(function CB(r){if(r){if((r.code==="EBUSY"||r.code==="ENOTEMPTY"||r.code==="EPERM")&&o{"use strict";var a=r(2717);var o=r(6054);var s=r(2361).EventEmitter;var u=t=e.exports=new s;var c=r(3837);var d=r(8834);var f=r(6322);d(true);var p=process.stderr;Object.defineProperty(u,"stream",{set:function(e){p=e;if(this.gauge)this.gauge.setWriteTo(p,p)},get:function(){return p}});var h;u.useColor=function(){return h!=null?h:p.isTTY};u.enableColor=function(){h=true;this.gauge.setTheme({hasColor:h,hasUnicode:v})};u.disableColor=function(){h=false;this.gauge.setTheme({hasColor:h,hasUnicode:v})};u.level="info";u.gauge=new o(p,{enabled:false,theme:{hasColor:u.useColor()},template:[{type:"progressbar",length:20},{type:"activityIndicator",kerning:1,length:1},{type:"section",default:""},":",{type:"logline",kerning:1,default:""}]});u.tracker=new a.TrackerGroup;u.progressEnabled=u.gauge.isEnabled();var v;u.enableUnicode=function(){v=true;this.gauge.setTheme({hasColor:this.useColor(),hasUnicode:v})};u.disableUnicode=function(){v=false;this.gauge.setTheme({hasColor:this.useColor(),hasUnicode:v})};u.setGaugeThemeset=function(e){this.gauge.setThemeset(e)};u.setGaugeTemplate=function(e){this.gauge.setTemplate(e)};u.enableProgress=function(){if(this.progressEnabled)return;this.progressEnabled=true;this.tracker.on("change",this.showProgress);if(this._pause)return;this.gauge.enable()};u.disableProgress=function(){if(!this.progressEnabled)return;this.progressEnabled=false;this.tracker.removeListener("change",this.showProgress);this.gauge.disable()};var _=["newGroup","newItem","newStream"];var mixinLog=function(e){Object.keys(u).forEach((function(t){if(t[0]==="_")return;if(_.filter((function(e){return e===t})).length)return;if(e[t])return;if(typeof u[t]!=="function")return;var r=u[t];e[t]=function(){return r.apply(u,arguments)}}));if(e instanceof a.TrackerGroup){_.forEach((function(t){var r=e[t];e[t]=function(){return mixinLog(r.apply(e,arguments))}}))}return e};_.forEach((function(e){u[e]=function(){return mixinLog(this.tracker[e].apply(this.tracker,arguments))}}));u.clearProgress=function(e){if(!this.progressEnabled)return e&&process.nextTick(e);this.gauge.hide(e)};u.showProgress=function(e,t){if(!this.progressEnabled)return;var r={};if(e)r.section=e;var a=u.record[u.record.length-1];if(a){r.subsection=a.prefix;var o=u.disp[a.level]||a.level;var s=this._format(o,u.style[a.level]);if(a.prefix)s+=" "+this._format(a.prefix,this.prefixStyle);s+=" "+a.message.split(/\r?\n/)[0];r.logline=s}r.completed=t||this.tracker.completed();this.gauge.show(r)}.bind(u);u.pause=function(){this._paused=true;if(this.progressEnabled)this.gauge.disable()};u.resume=function(){if(!this._paused)return;this._paused=false;var e=this._buffer;this._buffer=[];e.forEach((function(e){this.emitLog(e)}),this);if(this.progressEnabled)this.gauge.enable()};u._buffer=[];var g=0;u.record=[];u.maxRecordSize=1e4;u.log=function(e,t,r){var a=this.levels[e];if(a===undefined){return this.emit("error",new Error(c.format("Undefined log level: %j",e)))}var o=new Array(arguments.length-2);var s=null;for(var u=2;up/10){var v=Math.floor(p*.9);this.record=this.record.slice(-1*v)}this.emitLog(f)}.bind(u);u.emitLog=function(e){if(this._paused){this._buffer.push(e);return}if(this.progressEnabled)this.gauge.pulse(e.prefix);var t=this.levels[e.level];if(t===undefined)return;if(t0&&!isFinite(t))return;var r=u.disp[e.level]!=null?u.disp[e.level]:e.level;this.clearProgress();e.message.split(/\r?\n/).forEach((function(t){if(this.heading){this.write(this.heading,this.headingStyle);this.write(" ")}this.write(r,u.style[e.level]);var a=e.prefix||"";if(a)this.write(" ");this.write(a,this.prefixStyle);this.write(" "+t+"\n")}),this);this.showProgress()};u._format=function(e,t){if(!p)return;var r="";if(this.useColor()){t=t||{};var a=[];if(t.fg)a.push(t.fg);if(t.bg)a.push("bg"+t.bg[0].toUpperCase()+t.bg.slice(1));if(t.bold)a.push("bold");if(t.underline)a.push("underline");if(t.inverse)a.push("inverse");if(a.length)r+=f.color(a);if(t.beep)r+=f.beep()}r+=e;if(this.useColor()){r+=f.color("reset")}return r};u.write=function(e,t){if(!p)return;p.write(this._format(e,t))};u.addLevel=function(e,t,r,a){if(a==null)a=e;this.levels[e]=t;this.style[e]=r;if(!this[e]){this[e]=function(){var t=new Array(arguments.length+1);t[0]=e;for(var r=0;r{"use strict";e.exports=Number.isNaN||function(e){return e!==e}},1800:e=>{"use strict"; +(()=>{var __webpack_modules__={111:(e,t,r)=>{"use strict";e.exports=t;t.mockS3Http=r(7048).get_mockS3Http();t.mockS3Http("on");const a=t.mockS3Http("get");const o=r(7147);const s=r(1017);const u=r(1400);const c=r(9658);c.disableProgress();const d=r(5677);const f=r(2361).EventEmitter;const p=r(3837).inherits;const h=["clean","install","reinstall","build","rebuild","package","testpackage","publish","unpublish","info","testbinary","reveal","configure"];const v={};c.heading="node-pre-gyp";if(a){c.warn(`mocking s3 to ${process.env.node_pre_gyp_mock_s3}`)}Object.defineProperty(t,"find",{get:function(){return r(3093).find},enumerable:true});function Run({package_json_path:e="./package.json",argv:t}){this.package_json_path=e;this.commands={};const r=this;h.forEach((e=>{r.commands[e]=function(t,a){c.verbose("command",e,t);return require("./"+e)(r,t,a)}}));this.parseArgv(t);this.binaryHostSet=false}p(Run,f);t.Run=Run;const _=Run.prototype;_.package=r(9286);_.configDefs={help:Boolean,arch:String,debug:Boolean,directory:String,proxy:String,loglevel:String};_.shorthands={release:"--no-debug",C:"--directory",debug:"--debug",j:"--jobs",silent:"--loglevel=silent",silly:"--loglevel=silly",verbose:"--loglevel=verbose"};_.aliases=v;_.parseArgv=function parseOpts(e){this.opts=u(this.configDefs,this.shorthands,e);this.argv=this.opts.argv.remain.slice();const t=this.todo=[];e=this.argv.map((e=>{if(e in this.aliases){e=this.aliases[e]}return e}));e.slice().forEach((r=>{if(r in this.commands){const a=e.splice(0,e.indexOf(r));e.shift();if(t.length>0){t[t.length-1].args=a}t.push({name:r,args:[]})}}));if(t.length>0){t[t.length-1].args=e.splice(0)}let r=this.package_json_path;if(this.opts.directory){r=s.join(this.opts.directory,r)}this.package_json=JSON.parse(o.readFileSync(r));this.todo=d.expand_commands(this.package_json,this.opts,t);const a="npm_config_";Object.keys(process.env).forEach((e=>{if(e.indexOf(a)!==0)return;const t=process.env[e];if(e===a+"loglevel"){c.level=t}else{e=e.substring(a.length);if(e==="argv"){if(this.opts.argv&&this.opts.argv.remain&&this.opts.argv.remain.length){}else{this.opts[e]=t}}else{this.opts[e]=t}}}));if(this.opts.loglevel){c.level=this.opts.loglevel}c.resume()};_.setBinaryHostProperty=function(e){if(this.binaryHostSet){return this.package_json.binary.host}const t=this.package_json;if(!t||!t.binary||t.binary.host){return""}if(!t.binary.staging_host||!t.binary.production_host){return""}let r="production_host";if(e==="publish"){r="staging_host"}const a=process.env.node_pre_gyp_s3_host;if(a==="staging"||a==="production"){r=`${a}_host`}else if(this.opts["s3_host"]==="staging"||this.opts["s3_host"]==="production"){r=`${this.opts["s3_host"]}_host`}else if(this.opts["s3_host"]||a){throw new Error(`invalid s3_host ${this.opts["s3_host"]||a}`)}t.binary.host=t.binary[r];this.binaryHostSet=true;return t.binary.host};_.usage=function usage(){const e=[""," Usage: node-pre-gyp [options]",""," where is one of:",h.map((e=>" - "+e+" - "+require("./"+e).usage)).join("\n"),"","node-pre-gyp@"+this.version+" "+s.resolve(__dirname,".."),"node@"+process.versions.node].join("\n");return e};Object.defineProperty(_,"version",{get:function(){return this.package.version},enumerable:true})},3093:(e,t,r)=>{"use strict";const a=r(111);const o=r(302);const s=r(5677);const u=r(7147).existsSync||r(1017).existsSync;const c=r(1017);e.exports=t;t.usage="Finds the require path for the node-pre-gyp installed module";t.validate=function(e,t){o.validate_config(e,t)};t.find=function(e,t){if(!u(e)){throw new Error(e+"does not exist")}const r=new a.Run({package_json_path:e,argv:process.argv});r.setBinaryHostProperty();const d=r.package_json;o.validate_config(d,t);let f;if(s.get_napi_build_versions(d,t)){f=s.get_best_napi_build_version(d,t)}t=t||{};if(!t.module_root)t.module_root=c.dirname(e);const p=o.evaluate(d,t,f);return p.module}},5677:(e,t,r)=>{"use strict";const a=r(7147);e.exports=t;const o=process.version.substr(1).replace(/-.*$/,"").split(".").map((e=>+e));const s=["build","clean","configure","package","publish","reveal","testbinary","testpackage","unpublish"];const u="napi_build_version=";e.exports.get_napi_version=function(){let e=process.versions.napi;if(!e){if(o[0]===9&&o[1]>=3)e=2;else if(o[0]===8)e=1}return e};e.exports.get_napi_version_as_string=function(t){const r=e.exports.get_napi_version(t);return r?""+r:""};e.exports.validate_package_json=function(t,r){const a=t.binary;const o=pathOK(a.module_path);const s=pathOK(a.remote_path);const u=pathOK(a.package_name);const c=e.exports.get_napi_build_versions(t,r,true);const d=e.exports.get_napi_build_versions_raw(t);if(c){c.forEach((e=>{if(!(parseInt(e,10)===e&&e>0)){throw new Error("All values specified in napi_versions must be positive integers.")}}))}if(c&&(!o||!s&&!u)){throw new Error("When napi_versions is specified; module_path and either remote_path or "+"package_name must contain the substitution string '{napi_build_version}`.")}if((o||s||u)&&!d){throw new Error("When the substitution string '{napi_build_version}` is specified in "+"module_path, remote_path, or package_name; napi_versions must also be specified.")}if(c&&!e.exports.get_best_napi_build_version(t,r)&&e.exports.build_napi_only(t)){throw new Error("The Node-API version of this Node instance is "+e.exports.get_napi_version(r?r.target:undefined)+". "+"This module supports Node-API version(s) "+e.exports.get_napi_build_versions_raw(t)+". "+"This Node instance cannot run this module.")}if(d&&!c&&e.exports.build_napi_only(t)){throw new Error("The Node-API version of this Node instance is "+e.exports.get_napi_version(r?r.target:undefined)+". "+"This module supports Node-API version(s) "+e.exports.get_napi_build_versions_raw(t)+". "+"This Node instance cannot run this module.")}};function pathOK(e){return e&&(e.indexOf("{napi_build_version}")!==-1||e.indexOf("{node_napi_label}")!==-1)}e.exports.expand_commands=function(t,r,a){const o=[];const c=e.exports.get_napi_build_versions(t,r);a.forEach((a=>{if(c&&a.name==="install"){const s=e.exports.get_best_napi_build_version(t,r);const c=s?[u+s]:[];o.push({name:a.name,args:c})}else if(c&&s.indexOf(a.name)!==-1){c.forEach((e=>{const t=a.args.slice();t.push(u+e);o.push({name:a.name,args:t})}))}else{o.push(a)}}));return o};e.exports.get_napi_build_versions=function(t,a,o){const s=r(9658);let u=[];const c=e.exports.get_napi_version(a?a.target:undefined);if(t.binary&&t.binary.napi_versions){t.binary.napi_versions.forEach((e=>{const t=u.indexOf(e)!==-1;if(!t&&c&&e<=c){u.push(e)}else if(o&&!t&&c){s.info("This Node instance does not support builds for Node-API version",e)}}))}if(a&&a["build-latest-napi-version-only"]){let e=0;u.forEach((t=>{if(t>e)e=t}));u=e?[e]:[]}return u.length?u:undefined};e.exports.get_napi_build_versions_raw=function(e){const t=[];if(e.binary&&e.binary.napi_versions){e.binary.napi_versions.forEach((e=>{if(t.indexOf(e)===-1){t.push(e)}}))}return t.length?t:undefined};e.exports.get_command_arg=function(e){return u+e};e.exports.get_napi_build_version_from_command_args=function(e){for(let t=0;t{if(e>a&&e<=t){a=e}}))}return a===0?undefined:a};e.exports.build_napi_only=function(e){return e.binary&&e.binary.package_name&&e.binary.package_name.indexOf("{node_napi_label}")===-1}},7048:(e,t,r)=>{"use strict";e.exports=t;const a=r(7310);const o=r(7147);const s=r(1017);e.exports.detect=function(e,t){const r=e.hosted_path;const o=a.parse(r);t.prefix=!o.pathname||o.pathname==="/"?"":o.pathname.replace("/","");if(e.bucket&&e.region){t.bucket=e.bucket;t.region=e.region;t.endpoint=e.host;t.s3ForcePathStyle=e.s3ForcePathStyle}else{const e=o.hostname.split(".s3");const r=e[0];if(!r){return}if(!t.bucket){t.bucket=r}if(!t.region){const r=e[1].slice(1).split(".")[0];if(r==="amazonaws"){t.region="us-east-1"}else{t.region=r}}}};e.exports.get_s3=function(e){if(process.env.node_pre_gyp_mock_s3){const e=r(2722);const t=r(2037);e.config.basePath=`${t.tmpdir()}/mock`;const a=e.S3();const wcb=e=>(t,...r)=>{if(t&&t.code==="ENOENT"){t.code="NotFound"}return e(t,...r)};return{listObjects(e,t){return a.listObjects(e,wcb(t))},headObject(e,t){return a.headObject(e,wcb(t))},deleteObject(e,t){return a.deleteObject(e,wcb(t))},putObject(e,t){return a.putObject(e,wcb(t))}}}const t=r(918);t.config.update(e);const a=new t.S3;return{listObjects(e,t){return a.listObjects(e,t)},headObject(e,t){return a.headObject(e,t)},deleteObject(e,t){return a.deleteObject(e,t)},putObject(e,t){return a.putObject(e,t)}}};e.exports.get_mockS3Http=function(){let e=false;if(!process.env.node_pre_gyp_mock_s3){return()=>e}const t=r(3902);const a="https://mapbox-node-pre-gyp-public-testing-bucket.s3.us-east-1.amazonaws.com";const u=process.env.node_pre_gyp_mock_s3+"/mapbox-node-pre-gyp-public-testing-bucket";const mock_http=()=>{function get(e,t){const r=s.join(u,e.replace("%2B","+"));try{o.accessSync(r,o.constants.R_OK)}catch(e){return[404,"not found\n"]}return[200,o.createReadStream(r)]}return t(a).persist().get((()=>e)).reply(get)};mock_http(t,a,u);const mockS3Http=t=>{const r=e;if(t==="off"){e=false}else if(t==="on"){e=true}else if(t!=="get"){throw new Error(`illegal action for setMockHttp ${t}`)}return r};return mockS3Http}},302:(e,t,r)=>{"use strict";e.exports=t;const a=r(1017);const o=r(7849);const s=r(7310);const u=r(2157);const c=r(5677);let d;if(process.env.NODE_PRE_GYP_ABI_CROSSWALK){d=require(process.env.NODE_PRE_GYP_ABI_CROSSWALK)}else{d=r(2339)}const f={};Object.keys(d).forEach((e=>{const t=e.split(".")[0];if(!f[t]){f[t]=e}}));function get_electron_abi(e,t){if(!e){throw new Error("get_electron_abi requires valid runtime arg")}if(typeof t==="undefined"){throw new Error("Empty target version is not supported if electron is the target.")}const r=o.parse(t);return e+"-v"+r.major+"."+r.minor}e.exports.get_electron_abi=get_electron_abi;function get_node_webkit_abi(e,t){if(!e){throw new Error("get_node_webkit_abi requires valid runtime arg")}if(typeof t==="undefined"){throw new Error("Empty target version is not supported if node-webkit is the target.")}return e+"-v"+t}e.exports.get_node_webkit_abi=get_node_webkit_abi;function get_node_abi(e,t){if(!e){throw new Error("get_node_abi requires valid runtime arg")}if(!t){throw new Error("get_node_abi requires valid process.versions object")}const r=o.parse(t.node);if(r.major===0&&r.minor%2){return e+"-v"+t.node}else{return t.modules?e+"-v"+ +t.modules:"v8-"+t.v8.split(".").slice(0,2).join(".")}}e.exports.get_node_abi=get_node_abi;function get_runtime_abi(e,t){if(!e){throw new Error("get_runtime_abi requires valid runtime arg")}if(e==="node-webkit"){return get_node_webkit_abi(e,t||process.versions["node-webkit"])}else if(e==="electron"){return get_electron_abi(e,t||process.versions.electron)}else{if(e!=="node"){throw new Error("Unknown Runtime: '"+e+"'")}if(!t){return get_node_abi(e,process.versions)}else{let r;if(d[t]){r=d[t]}else{const e=t.split(".").map((e=>+e));if(e.length!==3){throw new Error("Unknown target version: "+t)}const a=e[0];let o=e[1];let s=e[2];if(a===1){while(true){if(o>0)--o;if(s>0)--s;const e=""+a+"."+o+"."+s;if(d[e]){r=d[e];console.log("Warning: node-pre-gyp could not find exact match for "+t);console.log("Warning: but node-pre-gyp successfully choose "+e+" as ABI compatible target");break}if(o===0&&s===0){break}}}else if(a>=2){if(f[a]){r=d[f[a]];console.log("Warning: node-pre-gyp could not find exact match for "+t);console.log("Warning: but node-pre-gyp successfully choose "+f[a]+" as ABI compatible target")}}else if(a===0){if(e[1]%2===0){while(--s>0){const e=""+a+"."+o+"."+s;if(d[e]){r=d[e];console.log("Warning: node-pre-gyp could not find exact match for "+t);console.log("Warning: but node-pre-gyp successfully choose "+e+" as ABI compatible target");break}}}}}if(!r){throw new Error("Unsupported target version: "+t)}const a={node:t,v8:r.v8+".0",modules:r.node_abi>1?r.node_abi:undefined};return get_node_abi(e,a)}}}e.exports.get_runtime_abi=get_runtime_abi;const p=["module_name","module_path","host"];function validate_config(e,t){const r=e.name+" package.json is not node-pre-gyp ready:\n";const a=[];if(!e.main){a.push("main")}if(!e.version){a.push("version")}if(!e.name){a.push("name")}if(!e.binary){a.push("binary")}const o=e.binary;if(o){p.forEach((e=>{if(!o[e]||typeof o[e]!=="string"){a.push("binary."+e)}}))}if(a.length>=1){throw new Error(r+"package.json must declare these properties: \n"+a.join("\n"))}if(o){const e=s.parse(o.host).protocol;if(e==="http:"){throw new Error("'host' protocol ("+e+") is invalid - only 'https:' is accepted")}}c.validate_package_json(e,t)}e.exports.validate_config=validate_config;function eval_template(e,t){Object.keys(t).forEach((r=>{const a="{"+r+"}";while(e.indexOf(a)>-1){e=e.replace(a,t[r])}}));return e}function fix_slashes(e){if(e.slice(-1)!=="/"){return e+"/"}return e}function drop_double_slashes(e){return e.replace(/\/\//g,"/")}function get_process_runtime(e){let t="node";if(e["node-webkit"]){t="node-webkit"}else if(e.electron){t="electron"}return t}e.exports.get_process_runtime=get_process_runtime;const h="{module_name}-v{version}-{node_abi}-{platform}-{arch}.tar.gz";const v="";e.exports.evaluate=function(e,t,r){t=t||{};validate_config(e,t);const d=e.version;const f=o.parse(d);const p=t.runtime||get_process_runtime(process.versions);const _={name:e.name,configuration:t.debug?"Debug":"Release",debug:t.debug,module_name:e.binary.module_name,version:f.version,prerelease:f.prerelease.length?f.prerelease.join("."):"",build:f.build.length?f.build.join("."):"",major:f.major,minor:f.minor,patch:f.patch,runtime:p,node_abi:get_runtime_abi(p,t.target),node_abi_napi:c.get_napi_version(t.target)?"napi":get_runtime_abi(p,t.target),napi_version:c.get_napi_version(t.target),napi_build_version:r||"",node_napi_label:r?"napi-v"+r:get_runtime_abi(p,t.target),target:t.target||"",platform:t.target_platform||process.platform,target_platform:t.target_platform||process.platform,arch:t.target_arch||process.arch,target_arch:t.target_arch||process.arch,libc:t.target_libc||u.family||"unknown",module_main:e.main,toolset:t.toolset||"",bucket:e.binary.bucket,region:e.binary.region,s3ForcePathStyle:e.binary.s3ForcePathStyle||false};const g=_.module_name.replace("-","_");const y=process.env["npm_config_"+g+"_binary_host_mirror"]||e.binary.host;_.host=fix_slashes(eval_template(y,_));_.module_path=eval_template(e.binary.module_path,_);if(t.module_root){_.module_path=a.join(t.module_root,_.module_path)}else{_.module_path=a.resolve(_.module_path)}_.module=a.join(_.module_path,_.module_name+".node");_.remote_path=e.binary.remote_path?drop_double_slashes(fix_slashes(eval_template(e.binary.remote_path,_))):v;const m=e.binary.package_name?e.binary.package_name:h;_.package_name=eval_template(m,_);_.staged_tarball=a.join("build/stage",_.remote_path,_.package_name);_.hosted_path=s.resolve(_.host,_.remote_path);_.hosted_tarball=s.resolve(_.hosted_path,_.package_name);return _}},1400:(e,t,r)=>{var a=process.env.DEBUG_NOPT||process.env.NOPT_DEBUG?function(){console.error.apply(console,arguments)}:function(){};var o=r(7310),s=r(1017),u=r(2781).Stream,c=r(5920),d=r(2037);e.exports=t=nopt;t.clean=clean;t.typeDefs={String:{type:String,validate:validateString},Boolean:{type:Boolean,validate:validateBoolean},url:{type:o,validate:validateUrl},Number:{type:Number,validate:validateNumber},path:{type:s,validate:validatePath},Stream:{type:u,validate:validateStream},Date:{type:Date,validate:validateDate}};function nopt(e,r,o,s){o=o||process.argv;e=e||{};r=r||{};if(typeof s!=="number")s=2;a(e,r,o,s);o=o.slice(s);var u={},c,d={remain:[],cooked:o,original:o.slice(0)};parse(o,u,d.remain,e,r);clean(u,e,t.typeDefs);u.argv=d;Object.defineProperty(u.argv,"toString",{value:function(){return this.original.map(JSON.stringify).join(" ")},enumerable:false});return u}function clean(e,r,o){o=o||t.typeDefs;var s={},u=[false,true,null,String,Array];Object.keys(e).forEach((function(c){if(c==="argv")return;var d=e[c],f=Array.isArray(d),p=r[c];if(!f)d=[d];if(!p)p=u;if(p===Array)p=u.concat(Array);if(!Array.isArray(p))p=[p];a("val=%j",d);a("types=",p);d=d.map((function(u){if(typeof u==="string"){a("string %j",u);u=u.trim();if(u==="null"&&~p.indexOf(null)||u==="true"&&(~p.indexOf(true)||~p.indexOf(Boolean))||u==="false"&&(~p.indexOf(false)||~p.indexOf(Boolean))){u=JSON.parse(u);a("jsonable %j",u)}else if(~p.indexOf(Number)&&!isNaN(u)){a("convert to number",u);u=+u}else if(~p.indexOf(Date)&&!isNaN(Date.parse(u))){a("convert to date",u);u=new Date(u)}}if(!r.hasOwnProperty(c)){return u}if(u===false&&~p.indexOf(null)&&!(~p.indexOf(false)||~p.indexOf(Boolean))){u=null}var d={};d[c]=u;a("prevalidated val",d,u,r[c]);if(!validate(d,c,u,r[c],o)){if(t.invalidHandler){t.invalidHandler(c,u,r[c],e)}else if(t.invalidHandler!==false){a("invalid: "+c+"="+u,r[c])}return s}a("validated val",d,u,r[c]);return d[c]})).filter((function(e){return e!==s}));if(!d.length&&p.indexOf(Array)===-1){a("VAL HAS NO LENGTH, DELETE IT",d,c,p.indexOf(Array));delete e[c]}else if(f){a(f,e[c],d);e[c]=d}else e[c]=d[0];a("k=%s val=%j",c,d,e[c])}))}function validateString(e,t,r){e[t]=String(r)}function validatePath(e,t,r){if(r===true)return false;if(r===null)return true;r=String(r);var a=process.platform==="win32",o=a?/^~(\/|\\)/:/^~\//,u=d.homedir();if(u&&r.match(o)){e[t]=s.resolve(u,r.substr(2))}else{e[t]=s.resolve(r)}return true}function validateNumber(e,t,r){a("validate Number %j %j %j",t,r,isNaN(r));if(isNaN(r))return false;e[t]=+r}function validateDate(e,t,r){var o=Date.parse(r);a("validate Date %j %j %j",t,r,o);if(isNaN(o))return false;e[t]=new Date(r)}function validateBoolean(e,t,r){if(r instanceof Boolean)r=r.valueOf();else if(typeof r==="string"){if(!isNaN(r))r=!!+r;else if(r==="null"||r==="false")r=false;else r=true}else r=!!r;e[t]=r}function validateUrl(e,t,r){r=o.parse(String(r));if(!r.host)return false;e[t]=r.href}function validateStream(e,t,r){if(!(r instanceof u))return false;e[t]=r}function validate(e,t,r,o,s){if(Array.isArray(o)){for(var u=0,c=o.length;u1){var _=h.indexOf("=");if(_>-1){v=true;var g=h.substr(_+1);h=h.substr(0,_);e.splice(p,1,h,g)}var y=resolveShort(h,s,f,d);a("arg=%j shRes=%j",h,y);if(y){a(h,y);e.splice.apply(e,[p,1].concat(y));if(h!==y[0]){p--;continue}}h=h.replace(/^-+/,"");var m=null;while(h.toLowerCase().indexOf("no-")===0){m=!m;h=h.substr(3)}if(d[h])h=d[h];var w=o[h];var x=Array.isArray(w);if(x&&w.length===1){x=false;w=w[0]}var E=w===Array||x&&w.indexOf(Array)!==-1;if(!o.hasOwnProperty(h)&&t.hasOwnProperty(h)){if(!Array.isArray(t[h]))t[h]=[t[h]];E=true}var S,k=e[p+1];var R=typeof m==="boolean"||w===Boolean||x&&w.indexOf(Boolean)!==-1||typeof w==="undefined"&&!v||k==="false"&&(w===null||x&&~w.indexOf(null));if(R){S=!m;if(k==="true"||k==="false"){S=JSON.parse(k);k=null;if(m)S=!S;p++}if(x&&k){if(~w.indexOf(k)){S=k;p++}else if(k==="null"&&~w.indexOf(null)){S=null;p++}else if(!k.match(/^-{2,}[^-]/)&&!isNaN(k)&&~w.indexOf(Number)){S=+k;p++}else if(!k.match(/^-[^-]/)&&~w.indexOf(String)){S=k;p++}}if(E)(t[h]=t[h]||[]).push(S);else t[h]=S;continue}if(w===String){if(k===undefined){k=""}else if(k.match(/^-{1,2}[^-]+/)){k="";p--}}if(k&&k.match(/^-{2,}$/)){k=undefined;p--}S=k===undefined?true:k;if(E)(t[h]=t[h]||[]).push(S);else t[h]=S;p++;continue}r.push(h)}}function resolveShort(e,t,r,o){e=e.replace(/^-+/,"");if(o[e]===e)return null;if(t[e]){if(t[e]&&!Array.isArray(t[e]))t[e]=t[e].split(/\s+/);return t[e]}var s=t.___singles;if(!s){s=Object.keys(t).filter((function(e){return e.length===1})).reduce((function(e,t){e[t]=true;return e}),{});t.___singles=s;a("shorthand singles",s)}var u=e.split("").filter((function(e){return s[e]}));if(u.join("")===e)return u.map((function(e){return t[e]})).reduce((function(e,t){return e.concat(t)}),[]);if(o[e]&&!t[e])return null;if(r[e])e=r[e];if(t[e]&&!Array.isArray(t[e]))t[e]=t[e].split(/\s+/);return t[e]}},6286:(e,t,r)=>{const a=r(9491);const o=r(1017);const s=r(7147);let u=undefined;try{u=r(3535)}catch(e){}const c={nosort:true,silent:true};let d=0;const f=process.platform==="win32";const defaults=e=>{const t=["unlink","chmod","stat","lstat","rmdir","readdir"];t.forEach((t=>{e[t]=e[t]||s[t];t=t+"Sync";e[t]=e[t]||s[t]}));e.maxBusyTries=e.maxBusyTries||3;e.emfileWait=e.emfileWait||1e3;if(e.glob===false){e.disableGlob=true}if(e.disableGlob!==true&&u===undefined){throw Error("glob dependency not found, set `options.disableGlob = true` if intentional")}e.disableGlob=e.disableGlob||false;e.glob=e.glob||c};const rimraf=(e,t,r)=>{if(typeof t==="function"){r=t;t={}}a(e,"rimraf: missing path");a.equal(typeof e,"string","rimraf: path should be a string");a.equal(typeof r,"function","rimraf: callback function required");a(t,"rimraf: invalid options argument provided");a.equal(typeof t,"object","rimraf: options should be object");defaults(t);let o=0;let s=null;let c=0;const next=e=>{s=s||e;if(--c===0)r(s)};const afterGlob=(e,a)=>{if(e)return r(e);c=a.length;if(c===0)return r();a.forEach((e=>{const CB=r=>{if(r){if((r.code==="EBUSY"||r.code==="ENOTEMPTY"||r.code==="EPERM")&&orimraf_(e,t,CB)),o*100)}if(r.code==="EMFILE"&&drimraf_(e,t,CB)),d++)}if(r.code==="ENOENT")r=null}d=0;next(r)};rimraf_(e,t,CB)}))};if(t.disableGlob||!u.hasMagic(e))return afterGlob(null,[e]);t.lstat(e,((r,a)=>{if(!r)return afterGlob(null,[e]);u(e,t.glob,afterGlob)}))};const rimraf_=(e,t,r)=>{a(e);a(t);a(typeof r==="function");t.lstat(e,((a,o)=>{if(a&&a.code==="ENOENT")return r(null);if(a&&a.code==="EPERM"&&f)fixWinEPERM(e,t,a,r);if(o&&o.isDirectory())return rmdir(e,t,a,r);t.unlink(e,(a=>{if(a){if(a.code==="ENOENT")return r(null);if(a.code==="EPERM")return f?fixWinEPERM(e,t,a,r):rmdir(e,t,a,r);if(a.code==="EISDIR")return rmdir(e,t,a,r)}return r(a)}))}))};const fixWinEPERM=(e,t,r,o)=>{a(e);a(t);a(typeof o==="function");t.chmod(e,438,(a=>{if(a)o(a.code==="ENOENT"?null:r);else t.stat(e,((a,s)=>{if(a)o(a.code==="ENOENT"?null:r);else if(s.isDirectory())rmdir(e,t,r,o);else t.unlink(e,o)}))}))};const fixWinEPERMSync=(e,t,r)=>{a(e);a(t);try{t.chmodSync(e,438)}catch(e){if(e.code==="ENOENT")return;else throw r}let o;try{o=t.statSync(e)}catch(e){if(e.code==="ENOENT")return;else throw r}if(o.isDirectory())rmdirSync(e,t,r);else t.unlinkSync(e)};const rmdir=(e,t,r,o)=>{a(e);a(t);a(typeof o==="function");t.rmdir(e,(a=>{if(a&&(a.code==="ENOTEMPTY"||a.code==="EEXIST"||a.code==="EPERM"))rmkids(e,t,o);else if(a&&a.code==="ENOTDIR")o(r);else o(a)}))};const rmkids=(e,t,r)=>{a(e);a(t);a(typeof r==="function");t.readdir(e,((a,s)=>{if(a)return r(a);let u=s.length;if(u===0)return t.rmdir(e,r);let c;s.forEach((a=>{rimraf(o.join(e,a),t,(a=>{if(c)return;if(a)return r(c=a);if(--u===0)t.rmdir(e,r)}))}))}))};const rimrafSync=(e,t)=>{t=t||{};defaults(t);a(e,"rimraf: missing path");a.equal(typeof e,"string","rimraf: path should be a string");a(t,"rimraf: missing options");a.equal(typeof t,"object","rimraf: options should be object");let r;if(t.disableGlob||!u.hasMagic(e)){r=[e]}else{try{t.lstatSync(e);r=[e]}catch(a){r=u.sync(e,t.glob)}}if(!r.length)return;for(let e=0;e{a(e);a(t);try{t.rmdirSync(e)}catch(a){if(a.code==="ENOENT")return;if(a.code==="ENOTDIR")throw r;if(a.code==="ENOTEMPTY"||a.code==="EEXIST"||a.code==="EPERM")rmkidsSync(e,t)}};const rmkidsSync=(e,t)=>{a(e);a(t);t.readdirSync(e).forEach((r=>rimrafSync(o.join(e,r),t)));const r=f?100:1;let s=0;do{let a=true;try{const o=t.rmdirSync(e,t);a=false;return o}finally{if(++s{var fs=__nccwpck_require__(7147);var path=__nccwpck_require__(1017);var os=__nccwpck_require__(2037);var runtimeRequire=true?eval("require"):0;var vars=process.config&&process.config.variables||{};var prebuildsOnly=!!process.env.PREBUILDS_ONLY;var abi=process.versions.modules;var runtime=isElectron()?"electron":"node";var arch=os.arch();var platform=os.platform();var libc=process.env.LIBC||(isAlpine(platform)?"musl":"glibc");var armv=process.env.ARM_VERSION||(arch==="arm64"?"8":vars.arm_version)||"";var uv=(process.versions.uv||"").split(".")[0];module.exports=load;function load(e){return runtimeRequire(load.path(e))}load.path=function(e){e=path.resolve(e||".");try{var t=runtimeRequire(path.join(e,"package.json")).name.toUpperCase().replace(/-/g,"_");if(process.env[t+"_PREBUILD"])e=process.env[t+"_PREBUILD"]}catch(e){}if(!prebuildsOnly){var r=getFirst(path.join(e,"build/Release"),matchBuild);if(r)return r;var a=getFirst(path.join(e,"build/Debug"),matchBuild);if(a)return a}var o=resolve(e);if(o)return o;var s=resolve(path.dirname(process.execPath));if(s)return s;var u=["platform="+platform,"arch="+arch,"runtime="+runtime,"abi="+abi,"uv="+uv,armv?"armv="+armv:"","libc="+libc,"node="+process.versions.node,process.versions&&process.versions.electron?"electron="+process.versions.electron:"",true?"webpack=true":0].filter(Boolean).join(" ");throw new Error("No native build was found for "+u+"\n loaded from: "+e+"\n");function resolve(e){var t=path.join(e,"prebuilds",platform+"-"+arch);var r=readdirSync(t).map(parseTags);var a=r.filter(matchTags(runtime,abi));var o=a.sort(compareTags(runtime))[0];if(o)return path.join(t,o.file)}};function readdirSync(e){try{return fs.readdirSync(e)}catch(e){return[]}}function getFirst(e,t){var r=readdirSync(e).filter(t);return r[0]&&path.join(e,r[0])}function matchBuild(e){return/\.node$/.test(e)}function parseTags(e){var t=e.split(".");var r=t.pop();var a={file:e,specificity:0};if(r!=="node")return;for(var o=0;or.specificity?-1:1}else{return 0}}}function isElectron(){if(process.versions&&process.versions.electron)return true;if(process.env.ELECTRON_RUN_AS_NODE)return true;return typeof window!=="undefined"&&window.process&&window.process.type==="renderer"}function isAlpine(e){return e==="linux"&&fs.existsSync("/etc/alpine-release")}load.parseTags=parseTags;load.matchTags=matchTags;load.compareTags=compareTags},8827:function(e,t,r){"use strict";var a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});const o=a(r(1017));const s=r(7586);const u=r(5401);const c=r(1988);const d=a(r(5706));const f=r(5078);const p=a(r(3535));const h=r(7468);const v=r(2774);const _=r(216);const g=a(r(5735));const y=a(r(2278));const m=a(r(411));const w=a(r(111));const x=r(7310);const E=r(7470).asyncWalk;const S=c.Parser.extend();const k=a(r(2037));const R=r(7780);const A=a(r(2753));const O={cwd:()=>G,env:{NODE_ENV:u.UNKNOWN,[u.UNKNOWN]:true},[u.UNKNOWN]:true};const T=Symbol();const C=Symbol();const j=Symbol();const N=Symbol();const L=Symbol();const I=Symbol();const P=Symbol();const D=Symbol();const M=Symbol();const W={access:I,accessSync:I,createReadStream:I,exists:I,existsSync:I,fstat:I,fstatSync:I,lstat:I,lstatSync:I,open:I,readdir:P,readdirSync:P,readFile:I,readFileSync:I,stat:I,statSync:I};const F=Object.assign(Object.create(null),{bindings:{default:D},express:{default:function(){return{[u.UNKNOWN]:true,set:T,engine:C}}},fs:Object.assign({default:W},W),process:Object.assign({default:O},O),path:{default:{}},os:Object.assign({default:k.default},k.default),"@mapbox/node-pre-gyp":Object.assign({default:w.default},w.default),"node-pre-gyp":v.pregyp,"node-pre-gyp/lib/pre-binding":v.pregyp,"node-pre-gyp/lib/pre-binding.js":v.pregyp,"node-gyp-build":{default:M},nbind:{init:j,default:{init:j}},"resolve-from":{default:A.default},"strong-globalize":{default:{SetRootDir:N},SetRootDir:N},pkginfo:{default:L}});const B={_interopRequireDefault:_.normalizeDefaultRequire,_interopRequireWildcard:_.normalizeWildcardRequire,__importDefault:_.normalizeDefaultRequire,__importStar:_.normalizeWildcardRequire,MONGOOSE_DRIVER_PATH:undefined,URL:x.URL,Object:{assign:Object.assign}};B.global=B.GLOBAL=B.globalThis=B;const $=Symbol();v.pregyp.find[$]=true;const U=F.path;Object.keys(o.default).forEach((e=>{const t=o.default[e];if(typeof t==="function"){const r=function mockPath(){return t.apply(mockPath,arguments)};r[$]=true;U[e]=U.default[e]=r}else{U[e]=U.default[e]=t}}));U.resolve=U.default.resolve=function(...e){return o.default.resolve.apply(this,[G,...e])};U.resolve[$]=true;const H=new Set([".h",".cmake",".c",".cpp"]);const q=new Set(["CHANGELOG.md","README.md","readme.md","changelog.md"]);let G;const K=/^\/[^\/]+|^[a-z]:[\\/][^\\/]+/i;function isAbsolutePathOrUrl(e){if(e instanceof x.URL)return e.protocol==="file:";if(typeof e==="string"){if(e.startsWith("file:")){try{new x.URL(e);return true}catch(e){return false}}return K.test(e)}return false}const z=Symbol();const V=/([\/\\]\*\*[\/\\]\*)+/g;async function analyze(e,t,r){const a=new Set;const c=new Set;const _=new Set;const w=o.default.dirname(e);G=r.cwd;const k=h.getPackageBase(e);const emitAssetDirectory=e=>{if(!r.analysis.emitGlobs)return;const t=e.indexOf(u.WILDCARD);const s=t===-1?e.length:e.lastIndexOf(o.default.sep,t);const c=e.substr(0,s);const d=e.substr(s);const f=d.replace(u.wildcardRegEx,((e,t)=>d[t-1]===o.default.sep?"**/*":"*")).replace(V,"/**/*")||"/**/*";if(r.ignoreFn(o.default.relative(r.base,c+f)))return;A=A.then((async()=>{if(r.log)console.log("Globbing "+c+f);const e=await new Promise(((e,t)=>p.default(c+f,{mark:true,ignore:c+"/**/node_modules/**/*"},((r,a)=>r?t(r):e(a)))));e.filter((e=>!H.has(o.default.extname(e))&&!q.has(o.default.basename(e))&&!e.endsWith("/"))).forEach((e=>a.add(e)))}))};let A=Promise.resolve();t=t.replace(/^#![^\n\r]*[\r\n]/,"");let W;let U=false;try{W=S.parse(t,{ecmaVersion:"latest",allowReturnOutsideFunction:true});U=false}catch(t){const a=t&&t.message&&t.message.includes("sourceType: module");if(!a){r.warnings.add(new Error(`Failed to parse ${e} as script:\n${t&&t.message}`))}}if(!W){try{W=S.parse(t,{ecmaVersion:"latest",sourceType:"module",allowAwaitOutsideFunction:true});U=true}catch(t){r.warnings.add(new Error(`Failed to parse ${e} as module:\n${t&&t.message}`));return{assets:a,deps:c,imports:_,isESM:false}}}const Y=x.pathToFileURL(e).href;const Q=Object.assign(Object.create(null),{__dirname:{shadowDepth:0,value:{value:o.default.resolve(e,"..")}},__filename:{shadowDepth:0,value:{value:e}},process:{shadowDepth:0,value:{value:O}}});if(!U||r.mixedModules){Q.require={shadowDepth:0,value:{value:{[u.FUNCTION](e){c.add(e);const t=F[e];return t.default},resolve(t){return y.default(t,e,r)}}}};Q.require.value.value.resolve[$]=true}function setKnownBinding(e,t){if(e==="require")return;Q[e]={shadowDepth:0,value:t}}function getKnownBinding(e){const t=Q[e];if(t){if(t.shadowDepth===0){return t.value}}return undefined}function hasKnownBindingValue(e){const t=Q[e];return t&&t.shadowDepth===0}if((U||r.mixedModules)&&isAst(W)){for(const e of W.body){if(e.type==="ImportDeclaration"){const t=String(e.source.value);c.add(t);const r=F[t];if(r){for(const t of e.specifiers){if(t.type==="ImportNamespaceSpecifier")setKnownBinding(t.local.name,{value:r});else if(t.type==="ImportDefaultSpecifier"&&"default"in r)setKnownBinding(t.local.name,{value:r.default});else if(t.type==="ImportSpecifier"&&t.imported.name in r)setKnownBinding(t.local.name,{value:r[t.imported.name]})}}}else if(e.type==="ExportNamedDeclaration"||e.type==="ExportAllDeclaration"){if(e.source)c.add(String(e.source.value))}}}async function computePureStaticValue(e,t=true){const r=Object.create(null);Object.keys(B).forEach((e=>{r[e]={value:B[e]}}));Object.keys(Q).forEach((e=>{r[e]=getKnownBinding(e)}));r["import.meta"]={url:Y};const a=await u.evaluate(e,r,t);return a}let X;let Z;let J=false;function emitWildcardRequire(e){if(!r.analysis.emitGlobs||!e.startsWith("./")&&!e.startsWith("../"))return;e=o.default.resolve(w,e);const t=e.indexOf(u.WILDCARD);const s=t===-1?e.length:e.lastIndexOf(o.default.sep,t);const c=e.substr(0,s);const d=e.substr(s);let f=d.replace(u.wildcardRegEx,((e,t)=>d[t-1]===o.default.sep?"**/*":"*"))||"/**/*";if(!f.endsWith("*"))f+="?("+(r.ts?".ts|.tsx|":"")+".js|.json|.node)";if(r.ignoreFn(o.default.relative(r.base,c+f)))return;A=A.then((async()=>{if(r.log)console.log("Globbing "+c+f);const e=await new Promise(((e,t)=>p.default(c+f,{mark:true,ignore:c+"/**/node_modules/**/*"},((r,a)=>r?t(r):e(a)))));e.filter((e=>!H.has(o.default.extname(e))&&!q.has(o.default.basename(e))&&!e.endsWith("/"))).forEach((e=>a.add(e)))}))}async function processRequireArg(e,t=false){if(e.type==="ConditionalExpression"){await processRequireArg(e.consequent,t);await processRequireArg(e.alternate,t);return}if(e.type==="LogicalExpression"){await processRequireArg(e.left,t);await processRequireArg(e.right,t);return}let r=await computePureStaticValue(e,true);if(!r)return;if("value"in r&&typeof r.value==="string"){if(!r.wildcards)(t?_:c).add(r.value);else if(r.wildcards.length>=1)emitWildcardRequire(r.value)}else{if("then"in r&&typeof r.then==="string")(t?_:c).add(r.then);if("else"in r&&typeof r.else==="string")(t?_:c).add(r.else)}}let ee=s.attachScopes(W,"scope");if(isAst(W)){R.handleWrappers(W);await g.default({id:e,ast:W,emitAsset:e=>a.add(e),emitAssetDirectory:emitAssetDirectory,job:r})}async function backtrack(e,t){if(!X)throw new Error("Internal error: No staticChildNode for backtrack.");const r=await computePureStaticValue(e,true);if(r){if("value"in r&&typeof r.value!=="symbol"||"then"in r&&typeof r.then!=="symbol"&&typeof r.else!=="symbol"){Z=r;X=e;if(t)t.skip();return}}await emitStaticChildAsset()}await E(W,{async enter(t,s){var u;const p=t;const h=s;if(p.scope){ee=p.scope;for(const e in p.scope.declarations){if(e in Q)Q[e].shadowDepth++}}if(X)return;if(!h)return;if(p.type==="Identifier"){if(f.isIdentifierRead(p,h)&&r.analysis.computeFileReferences){let e;if(typeof(e=(u=getKnownBinding(p.name))===null||u===void 0?void 0:u.value)==="string"&&e.match(K)||e&&(typeof e==="function"||typeof e==="object")&&e[$]){Z={value:typeof e==="string"?e:undefined};X=p;await backtrack(h,this)}}}else if(r.analysis.computeFileReferences&&p.type==="MemberExpression"&&p.object.type==="MetaProperty"&&p.object.meta.name==="import"&&p.object.property.name==="meta"&&(p.property.computed?p.property.value:p.property.name)==="url"){Z={value:Y};X=p;await backtrack(h,this)}else if(p.type==="ImportExpression"){await processRequireArg(p.source,true);return}else if(p.type==="CallExpression"){if((!U||r.mixedModules)&&p.callee.type==="Identifier"&&p.arguments.length){if(p.callee.name==="require"&&Q.require.shadowDepth===0){await processRequireArg(p.arguments[0]);return}}else if((!U||r.mixedModules)&&p.callee.type==="MemberExpression"&&p.callee.object.type==="Identifier"&&p.callee.object.name==="module"&&"module"in Q===false&&p.callee.property.type==="Identifier"&&!p.callee.computed&&p.callee.property.name==="require"&&p.arguments.length){await processRequireArg(p.arguments[0]);return}const t=r.analysis.evaluatePureExpressions&&await computePureStaticValue(p.callee,false);if(t&&"value"in t&&typeof t.value==="function"&&t.value[$]&&r.analysis.computeFileReferences){Z=await computePureStaticValue(p,true);if(Z&&h){X=p;await backtrack(h,this)}}else if(t&&"value"in t&&typeof t.value==="symbol"){switch(t.value){case z:if(p.arguments.length===1&&p.arguments[0].type==="Literal"&&p.callee.type==="Identifier"&&Q.require.shadowDepth===0){await processRequireArg(p.arguments[0])}break;case D:if(p.arguments.length){const e=await computePureStaticValue(p.arguments[0],false);if(e&&"value"in e&&e.value){let t;if(typeof e.value==="object")t=e.value;else if(typeof e.value==="string")t={bindings:e.value};if(!t.path){t.path=true}t.module_root=k;let r;try{r=d.default(t)}catch(e){}if(r){Z={value:r};X=p;await emitStaticChildAsset()}}}break;case M:if(p.arguments.length===1&&p.arguments[0].type==="Identifier"&&p.arguments[0].name==="__dirname"&&Q.__dirname.shadowDepth===0){let e;try{e=m.default.path(w)}catch(e){}if(e){Z={value:e};X=p;await emitStaticChildAsset()}}break;case j:if(p.arguments.length){const e=await computePureStaticValue(p.arguments[0],false);if(e&&"value"in e&&(typeof e.value==="string"||typeof e.value==="undefined")){const t=v.nbind(e.value);if(t&&t.path){c.add(o.default.relative(w,t.path).replace(/\\/g,"/"));return this.skip()}}}break;case T:if(p.arguments.length===2&&p.arguments[0].type==="Literal"&&p.arguments[0].value==="view engine"&&!J){await processRequireArg(p.arguments[1]);return this.skip()}break;case C:J=true;break;case I:case P:if(p.arguments[0]&&r.analysis.computeFileReferences){Z=await computePureStaticValue(p.arguments[0],true);if(Z){X=p.arguments[0];if(t.value===P&&p.arguments[0].type==="Identifier"&&p.arguments[0].name==="__dirname"){emitAssetDirectory(w)}else{await backtrack(h,this)}return this.skip()}}break;case N:if(p.arguments[0]){const e=await computePureStaticValue(p.arguments[0],false);if(e&&"value"in e&&e.value)emitAssetDirectory(e.value+"/intl");return this.skip()}break;case L:let s=o.default.resolve(e,"../package.json");const u=o.default.resolve("/package.json");while(s!==u&&await r.stat(s)===null)s=o.default.resolve(s,"../../package.json");if(s!==u)a.add(s);break}}}else if(p.type==="VariableDeclaration"&&h&&!f.isVarLoop(h)&&r.analysis.evaluatePureExpressions){for(const e of p.declarations){if(!e.init)continue;const t=await computePureStaticValue(e.init,true);if(t){if(e.id.type==="Identifier"){setKnownBinding(e.id.name,t)}else if(e.id.type==="ObjectPattern"&&"value"in t){for(const r of e.id.properties){if(r.type!=="Property"||r.key.type!=="Identifier"||r.value.type!=="Identifier"||typeof t.value!=="object"||t.value===null||!(r.key.name in t.value))continue;setKnownBinding(r.value.name,{value:t.value[r.key.name]})}}if(!("value"in t)&&isAbsolutePathOrUrl(t.then)&&isAbsolutePathOrUrl(t.else)){Z=t;X=e.init;await emitStaticChildAsset()}}}}else if(p.type==="AssignmentExpression"&&h&&!f.isLoop(h)&&r.analysis.evaluatePureExpressions){if(!hasKnownBindingValue(p.left.name)){const e=await computePureStaticValue(p.right,false);if(e&&"value"in e){if(p.left.type==="Identifier"){setKnownBinding(p.left.name,e)}else if(p.left.type==="ObjectPattern"){for(const t of p.left.properties){if(t.type!=="Property"||t.key.type!=="Identifier"||t.value.type!=="Identifier"||typeof e.value!=="object"||e.value===null||!(t.key.name in e.value))continue;setKnownBinding(t.value.name,{value:e.value[t.key.name]})}}if(isAbsolutePathOrUrl(e.value)){Z=e;X=p.right;await emitStaticChildAsset()}}}}else if((!U||r.mixedModules)&&(p.type==="FunctionDeclaration"||p.type==="FunctionExpression"||p.type==="ArrowFunctionExpression")&&(p.arguments||p.params)[0]&&(p.arguments||p.params)[0].type==="Identifier"){let e;let t;if((p.type==="ArrowFunctionExpression"||p.type==="FunctionExpression")&&h&&h.type==="VariableDeclarator"&&h.id.type==="Identifier"){e=h.id;t=p.arguments||p.params}else if(p.id){e=p.id;t=p.arguments||p.params}if(e&&p.body.body){let r,a=false;for(let e=0;ee&&e.id&&e.id.type==="Identifier"&&e.init&&e.init.type==="CallExpression"&&e.init.callee.type==="Identifier"&&e.init.callee.name==="require"&&Q.require.shadowDepth===0&&e.init.arguments[0]&&e.init.arguments[0].type==="Identifier"&&e.init.arguments[0].name===t[0].name))}if(r&&p.body.body[e].type==="ReturnStatement"&&p.body.body[e].argument&&p.body.body[e].argument.type==="Identifier"&&p.body.body[e].argument.name===r.id.name){a=true;break}}if(a)setKnownBinding(e.name,{value:z})}}},async leave(e,t){const r=e;const a=t;if(r.scope){if(ee.parent){ee=ee.parent}for(const e in r.scope.declarations){if(e in Q){if(Q[e].shadowDepth>0)Q[e].shadowDepth--;else delete Q[e]}}}if(X&&a)await backtrack(a,this)}});await A;return{assets:a,deps:c,imports:_,isESM:U};async function emitAssetPath(e){const t=e.indexOf(u.WILDCARD);const s=t===-1?e.length:e.lastIndexOf(o.default.sep,t);const c=e.substr(0,s);try{var d=await r.stat(c);if(d===null){throw new Error("file not found")}}catch(e){return}if(t!==-1&&d.isFile())return;if(d.isFile()){a.add(e)}else if(d.isDirectory()){if(validWildcard(e))emitAssetDirectory(e)}}function validWildcard(t){let a="";if(t.endsWith(o.default.sep))a=o.default.sep;else if(t.endsWith(o.default.sep+u.WILDCARD))a=o.default.sep+u.WILDCARD;else if(t.endsWith(u.WILDCARD))a=u.WILDCARD;if(t===w+a)return false;if(t===G+a)return false;if(t.endsWith(o.default.sep+"node_modules"+a))return false;if(w.startsWith(t.substr(0,t.length-a.length)+o.default.sep))return false;if(k){const a=e.substr(0,e.indexOf(o.default.sep+"node_modules"))+o.default.sep+"node_modules"+o.default.sep;if(!t.startsWith(a)){if(r.log)console.log("Skipping asset emission of "+t.replace(u.wildcardRegEx,"*")+" for "+e+" as it is outside the package base "+k);return false}}return true}function resolveAbsolutePathOrUrl(e){return e instanceof x.URL?x.fileURLToPath(e):e.startsWith("file:")?x.fileURLToPath(new x.URL(e)):o.default.resolve(e)}async function emitStaticChildAsset(){if(!Z){return}if("value"in Z&&isAbsolutePathOrUrl(Z.value)){try{const e=resolveAbsolutePathOrUrl(Z.value);await emitAssetPath(e)}catch(e){}}else if("then"in Z&&"else"in Z&&isAbsolutePathOrUrl(Z.then)&&isAbsolutePathOrUrl(Z.else)){let e;try{e=resolveAbsolutePathOrUrl(Z.then)}catch(e){}let t;try{t=resolveAbsolutePathOrUrl(Z.else)}catch(e){}if(e)await emitAssetPath(e);if(t)await emitAssetPath(t)}else if(X&&X.type==="ArrayExpression"&&"value"in Z&&Z.value instanceof Array){for(const e of Z.value){try{const t=resolveAbsolutePathOrUrl(e);await emitAssetPath(t)}catch(e){}}}X=Z=undefined}}t["default"]=analyze;function isAst(e){return"body"in e}},9582:function(e,t,r){"use strict";var a=this&&this.__createBinding||(Object.create?function(e,t,r,a){if(a===undefined)a=r;Object.defineProperty(e,a,{enumerable:true,get:function(){return t[r]}})}:function(e,t,r,a){if(a===undefined)a=r;e[a]=t[r]});var o=this&&this.__exportStar||function(e,t){for(var r in e)if(r!=="default"&&!t.hasOwnProperty(r))a(t,e,r)};Object.defineProperty(t,"__esModule",{value:true});o(r(3864),t);var s=r(3471);Object.defineProperty(t,"nodeFileTrace",{enumerable:true,get:function(){return s.nodeFileTrace}})},3471:function(e,t,r){"use strict";var a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});t.Job=t.nodeFileTrace=void 0;const o=r(1017);const s=a(r(552));const u=a(r(8827));const c=a(r(2278));const d=r(2540);const f=r(2985);const p=r(1017);const h=s.default.promises.readFile;const v=s.default.promises.readlink;const _=s.default.promises.stat;function inPath(e,t){const r=p.join(t,o.sep);return e.startsWith(r)&&e!==r}async function nodeFileTrace(e,t={}){const r=new Job(t);if(t.readFile)r.readFile=t.readFile;if(t.stat)r.stat=t.stat;if(t.readlink)r.readlink=t.readlink;if(t.resolve)r.resolve=t.resolve;r.ts=true;await Promise.all(e.map((async e=>{const t=o.resolve(e);await r.emitFile(t,"initial");if(t.endsWith(".js")||t.endsWith(".cjs")||t.endsWith(".mjs")||t.endsWith(".node")||r.ts&&(t.endsWith(".ts")||t.endsWith(".tsx"))){return r.emitDependency(t)}return undefined})));const a={fileList:r.fileList,esmFileList:r.esmFileList,reasons:r.reasons,warnings:r.warnings};return a}t.nodeFileTrace=nodeFileTrace;class Job{constructor({base:e=process.cwd(),processCwd:t,exports:r,conditions:a=r||["node"],exportsOnly:s=false,paths:u={},ignore:c,log:f=false,mixedModules:p=false,ts:h=true,analysis:v={},cache:_}){this.reasons=new Map;this.ts=h;e=o.resolve(e);this.ignoreFn=e=>{if(e.startsWith(".."+o.sep))return true;return false};if(typeof c==="string")c=[c];if(typeof c==="function"){const e=c;this.ignoreFn=t=>{if(t.startsWith(".."+o.sep))return true;if(e(t))return true;return false}}else if(Array.isArray(c)){const t=c.map((t=>o.relative(e,o.resolve(e||process.cwd(),t))));this.ignoreFn=e=>{if(e.startsWith(".."+o.sep))return true;if(d.isMatch(e,t))return true;return false}}this.base=e;this.cwd=o.resolve(t||e);this.conditions=a;this.exportsOnly=s;const g={};for(const t of Object.keys(u)){const r=u[t].endsWith("/");const a=o.resolve(e,u[t]);g[t]=a+(r?"/":"")}this.paths=g;this.log=f;this.mixedModules=p;this.analysis={};if(v!==false){Object.assign(this.analysis,{emitGlobs:true,computeFileReferences:true,evaluatePureExpressions:true},v===true?{}:v)}this.fileCache=_&&_.fileCache||new Map;this.statCache=_&&_.statCache||new Map;this.symlinkCache=_&&_.symlinkCache||new Map;this.analysisCache=_&&_.analysisCache||new Map;if(_){_.fileCache=this.fileCache;_.statCache=this.statCache;_.symlinkCache=this.symlinkCache;_.analysisCache=this.analysisCache}this.fileList=new Set;this.esmFileList=new Set;this.processed=new Set;this.warnings=new Set}async readlink(e){const t=this.symlinkCache.get(e);if(t!==undefined)return t;try{const t=await v(e);const r=this.statCache.get(e);if(r)this.statCache.set(o.resolve(e,t),r);this.symlinkCache.set(e,t);return t}catch(t){if(t.code!=="EINVAL"&&t.code!=="ENOENT"&&t.code!=="UNKNOWN")throw t;this.symlinkCache.set(e,null);return null}}async isFile(e){const t=await this.stat(e);if(t)return t.isFile();return false}async isDir(e){const t=await this.stat(e);if(t)return t.isDirectory();return false}async stat(e){const t=this.statCache.get(e);if(t)return t;try{const t=await _(e);this.statCache.set(e,t);return t}catch(t){if(t.code==="ENOENT"){this.statCache.set(e,null);return null}throw t}}async resolve(e,t,r,a){return c.default(e,t,r,a)}async readFile(e){const t=this.fileCache.get(e);if(t!==undefined)return t;try{const t=(await h(e)).toString();this.fileCache.set(e,t);return t}catch(t){if(t.code==="ENOENT"||t.code==="EISDIR"){this.fileCache.set(e,null);return null}throw t}}async realpath(e,t,r=new Set){if(r.has(e))throw new Error("Recursive symlink detected resolving "+e);r.add(e);const a=await this.readlink(e);if(a){const s=o.dirname(e);const u=o.resolve(s,a);const c=await this.realpath(s,t);if(inPath(e,c))await this.emitFile(e,"resolve",t,true);return this.realpath(u,t,r)}if(!inPath(e,this.base))return e;return p.join(await this.realpath(o.dirname(e),t,r),o.basename(e))}async emitFile(e,t,r,a=false){if(!a){e=await this.realpath(e,r)}e=o.relative(this.base,e);if(r){r=o.relative(this.base,r)}let s=this.reasons.get(e);if(!s){s={type:t,ignored:false,parents:new Set};this.reasons.set(e,s)}if(r&&this.ignoreFn(e,r)){if(!this.fileList.has(e)&&s){s.ignored=true}return false}if(r){s.parents.add(r)}this.fileList.add(e);return true}async getPjsonBoundary(e){const t=e.indexOf(o.sep);let r;while((r=e.lastIndexOf(o.sep))>t){e=e.substr(0,r);if(await this.isFile(e+o.sep+"package.json"))return e}return undefined}async emitDependency(e,t){if(this.processed.has(e)){if(t){await this.emitFile(e,"dependency",t)}return}this.processed.add(e);const r=await this.emitFile(e,"dependency",t);if(!r)return;if(e.endsWith(".json"))return;if(e.endsWith(".node"))return await f.sharedLibEmit(e,this);if(e.endsWith(".js")){const t=await this.getPjsonBoundary(e);if(t)await this.emitFile(t+o.sep+"package.json","resolve",e)}let a;const s=this.analysisCache.get(e);if(s){a=s}else{const t=await this.readFile(e);if(t===null)throw new Error("File "+e+" does not exist.");a=await u.default(e,t.toString(),this);this.analysisCache.set(e,a)}const{deps:c,imports:d,assets:p,isESM:h}=a;if(h)this.esmFileList.add(o.relative(this.base,e));await Promise.all([...[...p].map((async t=>{const r=o.extname(t);if(r===".js"||r===".mjs"||r===".node"||r===""||this.ts&&(r===".ts"||r===".tsx")&&t.startsWith(this.base)&&t.substr(this.base.length).indexOf(o.sep+"node_modules"+o.sep)===-1)await this.emitDependency(t,e);else await this.emitFile(t,"asset",e)})),...[...c].map((async t=>{try{var r=await this.resolve(t,e,this,!h)}catch(e){this.warnings.add(new Error(`Failed to resolve dependency ${t}:\n${e&&e.message}`));return}if(Array.isArray(r)){for(const t of r){if(t.startsWith("node:"))return;await this.emitDependency(t,e)}}else{if(r.startsWith("node:"))return;await this.emitDependency(r,e)}})),...[...d].map((async t=>{try{var r=await this.resolve(t,e,this,false)}catch(e){this.warnings.add(new Error(`Failed to resolve dependency ${t}:\n${e&&e.message}`));return}if(Array.isArray(r)){for(const t of r){if(t.startsWith("node:"))return;await this.emitDependency(t,e)}}else{if(r.startsWith("node:"))return;await this.emitDependency(r,e)}}))])}}t.Job=Job},2278:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});const a=r(1017);async function resolveDependency(e,t,r,o=true){let s;if(a.isAbsolute(e)||e==="."||e===".."||e.startsWith("./")||e.startsWith("../")){const o=e.endsWith("/");s=await resolvePath(a.resolve(t,"..",e)+(o?"/":""),t,r)}else if(e[0]==="#"){s=await packageImportsResolve(e,t,r,o)}else{s=await resolvePackage(e,t,r,o)}if(Array.isArray(s)){return Promise.all(s.map((e=>r.realpath(e,t))))}else if(s.startsWith("node:")){return s}else{return r.realpath(s,t)}}t["default"]=resolveDependency;async function resolvePath(e,t,r){const a=await resolveFile(e,t,r)||await resolveDir(e,t,r);if(!a){throw new NotFoundError(e,t)}return a}async function resolveFile(e,t,r){if(e.endsWith("/"))return undefined;e=await r.realpath(e,t);if(await r.isFile(e))return e;if(r.ts&&e.startsWith(r.base)&&e.substr(r.base.length).indexOf(a.sep+"node_modules"+a.sep)===-1&&await r.isFile(e+".ts"))return e+".ts";if(r.ts&&e.startsWith(r.base)&&e.substr(r.base.length).indexOf(a.sep+"node_modules"+a.sep)===-1&&await r.isFile(e+".tsx"))return e+".tsx";if(await r.isFile(e+".js"))return e+".js";if(await r.isFile(e+".json"))return e+".json";if(await r.isFile(e+".node"))return e+".node";return undefined}async function resolveDir(e,t,r){if(e.endsWith("/"))e=e.slice(0,-1);if(!await r.isDir(e))return;const o=await getPkgCfg(e,r);if(o&&typeof o.main==="string"){const s=await resolveFile(a.resolve(e,o.main),t,r)||await resolveFile(a.resolve(e,o.main,"index"),t,r);if(s){await r.emitFile(e+a.sep+"package.json","resolve",t);return s}}return resolveFile(a.resolve(e,"index"),t,r)}class NotFoundError extends Error{constructor(e,t){super("Cannot find module '"+e+"' loaded from "+t);this.code="MODULE_NOT_FOUND"}}const o=new Set([...r(8102)._builtinLibs,"constants","module","timers","console","_stream_writable","_stream_readable","_stream_duplex","process","sys"]);function getPkgName(e){const t=e.split("/");if(e[0]==="@"&&t.length>1)return t.length>1?t.slice(0,2).join("/"):null;return t.length?t[0]:null}async function getPkgCfg(e,t){const r=await t.readFile(e+a.sep+"package.json");if(r){try{return JSON.parse(r.toString())}catch(e){}}return undefined}function getExportsTarget(e,t,r){if(typeof e==="string"){return e}else if(e===null){return e}else if(Array.isArray(e)){for(const a of e){const e=getExportsTarget(a,t,r);if(e===null||typeof e==="string"&&e.startsWith("./"))return e}}else if(typeof e==="object"){for(const a of Object.keys(e)){if(a==="default"||a==="require"&&r||a==="import"&&!r||t.includes(a)){const o=getExportsTarget(e[a],t,r);if(o!==undefined)return o}}}return undefined}function resolveExportsImports(e,t,r,a,o,s){let u;if(o){if(!(typeof t==="object"&&!Array.isArray(t)&&t!==null))return undefined;u=t}else if(typeof t==="string"||Array.isArray(t)||t===null||typeof t==="object"&&Object.keys(t).length&&Object.keys(t)[0][0]!=="."){u={".":t}}else{u=t}if(r in u){const t=getExportsTarget(u[r],a.conditions,s);if(typeof t==="string"&&t.startsWith("./"))return e+t.slice(1)}for(const t of Object.keys(u).sort(((e,t)=>t.length-e.length))){if(t.endsWith("*")&&r.startsWith(t.slice(0,-1))){const o=getExportsTarget(u[t],a.conditions,s);if(typeof o==="string"&&o.startsWith("./"))return e+o.slice(1).replace(/\*/g,r.slice(t.length-1))}if(!t.endsWith("/"))continue;if(r.startsWith(t)){const o=getExportsTarget(u[t],a.conditions,s);if(typeof o==="string"&&o.endsWith("/")&&o.startsWith("./"))return e+o.slice(1)+r.slice(t.length)}}return undefined}async function packageImportsResolve(e,t,r,o){if(e!=="#"&&!e.startsWith("#/")&&r.conditions){const s=await r.getPjsonBoundary(t);if(s){const u=await getPkgCfg(s,r);const{imports:c}=u||{};if(u&&c!==null&&c!==undefined){let u=resolveExportsImports(s,c,e,r,true,o);if(u){if(o)u=await resolveFile(u,t,r)||await resolveDir(u,t,r);else if(!await r.isFile(u))throw new NotFoundError(u,t);if(u){await r.emitFile(s+a.sep+"package.json","resolve",t);return u}}}}}throw new NotFoundError(e,t)}async function resolvePackage(e,t,r,s){let u=t;if(o.has(e))return"node:"+e;const c=getPkgName(e)||"";let d;if(r.conditions){const o=await r.getPjsonBoundary(t);if(o){const u=await getPkgCfg(o,r);const{exports:f}=u||{};if(u&&u.name&&u.name===c&&f!==null&&f!==undefined){d=resolveExportsImports(o,f,"."+e.slice(c.length),r,false,s);if(d){if(s)d=await resolveFile(d,t,r)||await resolveDir(d,t,r);else if(!await r.isFile(d))throw new NotFoundError(d,t)}if(d)await r.emitFile(o+a.sep+"package.json","resolve",t)}}}let f;const p=u.indexOf(a.sep);while((f=u.lastIndexOf(a.sep))>p){u=u.substr(0,f);const o=u+a.sep+"node_modules";const p=await r.stat(o);if(!p||!p.isDirectory())continue;const h=await getPkgCfg(o+a.sep+c,r);const{exports:v}=h||{};if(r.conditions&&v!==undefined&&v!==null&&!d){let u;if(!r.exportsOnly)u=await resolveFile(o+a.sep+e,t,r)||await resolveDir(o+a.sep+e,t,r);let d=resolveExportsImports(o+a.sep+c,v,"."+e.slice(c.length),r,false,s);if(d){if(s)d=await resolveFile(d,t,r)||await resolveDir(d,t,r);else if(!await r.isFile(d))throw new NotFoundError(d,t)}if(d){await r.emitFile(o+a.sep+c+a.sep+"package.json","resolve",t);if(u&&u!==d)return[d,u];return d}if(u)return u}else{const s=await resolveFile(o+a.sep+e,t,r)||await resolveDir(o+a.sep+e,t,r);if(s){if(d&&d!==s)return[s,d];return s}}}if(d)return d;if(Object.hasOwnProperty.call(r.paths,e)){return r.paths[e]}for(const a of Object.keys(r.paths)){if(a.endsWith("/")&&e.startsWith(a)){const o=r.paths[a]+e.slice(a.length);const s=await resolveFile(o,t,r)||await resolveDir(o,t,r);if(!s){throw new NotFoundError(e,t)}return s}}throw new NotFoundError(e,t)}},3864:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true})},5078:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.isLoop=t.isVarLoop=t.isIdentifierRead=void 0;function isIdentifierRead(e,t){switch(t.type){case"ObjectPattern":case"ArrayPattern":return false;case"AssignmentExpression":return t.right===e;case"MemberExpression":return t.computed||e===t.object;case"Property":return e===t.value;case"MethodDefinition":return false;case"VariableDeclarator":return t.id!==e;case"ExportSpecifier":return false;case"FunctionExpression":case"FunctionDeclaration":case"ArrowFunctionExpression":return false;default:return true}}t.isIdentifierRead=isIdentifierRead;function isVarLoop(e){return e.type==="ForStatement"||e.type==="ForInStatement"||e.type==="ForOfStatement"}t.isVarLoop=isVarLoop;function isLoop(e){return e.type==="ForStatement"||e.type==="ForInStatement"||e.type==="ForOfStatement"||e.type==="WhileStatement"||e.type==="DoWhileStatement"}t.isLoop=isLoop},2774:function(__unused_webpack_module,exports,__nccwpck_require__){"use strict";var __importDefault=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(exports,"__esModule",{value:true});exports.nbind=exports.pregyp=void 0;const path_1=__importDefault(__nccwpck_require__(1017));const graceful_fs_1=__importDefault(__nccwpck_require__(552));const versioning=__nccwpck_require__(5574);const napi=__nccwpck_require__(9248);const pregypFind=(e,t)=>{const r=JSON.parse(graceful_fs_1.default.readFileSync(e).toString());versioning.validate_config(r,t);var a;if(napi.get_napi_build_versions(r,t)){a=napi.get_best_napi_build_version(r,t)}t=t||{};if(!t.module_root)t.module_root=path_1.default.dirname(e);var o=versioning.evaluate(r,t,a);return o.module};exports.pregyp={default:{find:pregypFind},find:pregypFind};function makeModulePathList(e,t){return[[e,t],[e,"build",t],[e,"build","Debug",t],[e,"build","Release",t],[e,"out","Debug",t],[e,"Debug",t],[e,"out","Release",t],[e,"Release",t],[e,"build","default",t],[e,process.env["NODE_BINDINGS_COMPILED_DIR"]||"compiled",process.versions.node,process.platform,process.arch,t]]}function findCompiledModule(basePath,specList){var resolvedList=[];var ext=path_1.default.extname(basePath);for(var _i=0,specList_1=specList;_i{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.getPackageName=t.getPackageBase=void 0;const r=/^(@[^\\\/]+[\\\/])?[^\\\/]+/;function getPackageBase(e){const t=e.lastIndexOf("node_modules");if(t!==-1&&(e[t-1]==="/"||e[t-1]==="\\")&&(e[t+12]==="/"||e[t+12]==="\\")){const a=e.substr(t+13).match(r);if(a)return e.substr(0,t+13+a[0].length)}return undefined}t.getPackageBase=getPackageBase;function getPackageName(e){const t=e.lastIndexOf("node_modules");if(t!==-1&&(e[t-1]==="/"||e[t-1]==="\\")&&(e[t+12]==="/"||e[t+12]==="\\")){const a=e.substr(t+13).match(r);if(a&&a.length>0){return a[0].replace(/\\/g,"/")}}return undefined}t.getPackageName=getPackageName},216:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.normalizeWildcardRequire=t.normalizeDefaultRequire=void 0;function normalizeDefaultRequire(e){if(e&&e.__esModule)return e;return{default:e}}t.normalizeDefaultRequire=normalizeDefaultRequire;const r=Object.prototype.hasOwnProperty;function normalizeWildcardRequire(e){if(e&&e.__esModule)return e;const t={};for(const a in e){if(!r.call(e,a))continue;t[a]=e[a]}t["default"]=e;return t}t.normalizeWildcardRequire=normalizeWildcardRequire},2985:function(e,t,r){"use strict";var a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});t.sharedLibEmit=void 0;const o=a(r(2037));const s=a(r(3535));const u=r(7468);let c="";switch(o.default.platform()){case"darwin":c="/**/*.@(dylib|so?(.*))";break;case"win32":c="/**/*.dll";break;default:c="/**/*.so?(.*)"}async function sharedLibEmit(e,t){const r=u.getPackageBase(e);if(!r)return;const a=await new Promise(((e,t)=>s.default(r+c,{ignore:r+"/**/node_modules/**/*"},((r,a)=>r?t(r):e(a)))));await Promise.all(a.map((r=>t.emitFile(r,"sharedlib",e))))}t.sharedLibEmit=sharedLibEmit},5735:function(e,t,r){"use strict";var a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});const o=r(1017);const s=a(r(2278));const u=r(7468);const c=r(552);const d={"@generated/photon"({id:e,emitAssetDirectory:t}){if(e.endsWith("@generated/photon/index.js")){t(o.resolve(o.dirname(e),"runtime/"))}},argon2({id:e,emitAssetDirectory:t}){if(e.endsWith("argon2/argon2.js")){t(o.resolve(o.dirname(e),"build","Release"));t(o.resolve(o.dirname(e),"prebuilds"));t(o.resolve(o.dirname(e),"lib","binding"))}},bull({id:e,emitAssetDirectory:t}){if(e.endsWith("bull/lib/commands/index.js")){t(o.resolve(o.dirname(e)))}},camaro({id:e,emitAsset:t}){if(e.endsWith("camaro/dist/camaro.js")){t(o.resolve(o.dirname(e),"camaro.wasm"))}},esbuild({id:e,emitAssetDirectory:t}){if(e.endsWith("esbuild/lib/main.js")){const r=o.resolve(e,"..","..","package.json");const a=JSON.parse(c.readFileSync(r,"utf8"));for(const r of Object.keys(a.optionalDependencies||{})){const a=o.resolve(e,"..","..","..",r);t(a)}}},"google-gax"({id:e,ast:t,emitAssetDirectory:r}){if(e.endsWith("google-gax/build/src/grpc.js")){for(const a of t.body){if(a.type==="VariableDeclaration"&&a.declarations[0].id.type==="Identifier"&&a.declarations[0].id.name==="googleProtoFilesDir"){r(o.resolve(o.dirname(e),"../../../google-proto-files"))}}}},oracledb({id:e,ast:t,emitAsset:r}){if(e.endsWith("oracledb/lib/oracledb.js")){for(const a of t.body){if(a.type==="ForStatement"&&"body"in a.body&&a.body.body&&Array.isArray(a.body.body)&&a.body.body[0]&&a.body.body[0].type==="TryStatement"&&a.body.body[0].block.body[0]&&a.body.body[0].block.body[0].type==="ExpressionStatement"&&a.body.body[0].block.body[0].expression.type==="AssignmentExpression"&&a.body.body[0].block.body[0].expression.operator==="="&&a.body.body[0].block.body[0].expression.left.type==="Identifier"&&a.body.body[0].block.body[0].expression.left.name==="oracledbCLib"&&a.body.body[0].block.body[0].expression.right.type==="CallExpression"&&a.body.body[0].block.body[0].expression.right.callee.type==="Identifier"&&a.body.body[0].block.body[0].expression.right.callee.name==="require"&&a.body.body[0].block.body[0].expression.right.arguments.length===1&&a.body.body[0].block.body[0].expression.right.arguments[0].type==="MemberExpression"&&a.body.body[0].block.body[0].expression.right.arguments[0].computed===true&&a.body.body[0].block.body[0].expression.right.arguments[0].object.type==="Identifier"&&a.body.body[0].block.body[0].expression.right.arguments[0].object.name==="binaryLocations"&&a.body.body[0].block.body[0].expression.right.arguments[0].property.type==="Identifier"&&a.body.body[0].block.body[0].expression.right.arguments[0].property.name==="i"){a.body.body[0].block.body[0].expression.right.arguments=[{type:"Literal",value:"_"}];const t=global._unit?"3.0.0":JSON.parse(c.readFileSync(e.slice(0,-15)+"package.json","utf8")).version;const s=Number(t.slice(0,t.indexOf(".")))>=4;const u="oracledb-"+(s?t:"abi"+process.versions.modules)+"-"+process.platform+"-"+process.arch+".node";r(o.resolve(e,"../../build/Release/"+u))}}}},"phantomjs-prebuilt"({id:e,emitAssetDirectory:t}){if(e.endsWith("phantomjs-prebuilt/lib/phantomjs.js")){t(o.resolve(o.dirname(e),"..","bin"))}},"remark-prism"({id:e,emitAssetDirectory:t}){const r="remark-prism/src/highlight.js";if(e.endsWith(r)){try{const a=e.slice(0,-r.length);t(o.resolve(a,"prismjs","components"))}catch(e){}}},semver({id:e,emitAsset:t}){if(e.endsWith("semver/index.js")){t(o.resolve(e.replace("index.js","preload.js")))}},"socket.io":async function({id:e,ast:t,job:r}){if(e.endsWith("socket.io/lib/index.js")){async function replaceResolvePathStatement(t){if(t.type==="ExpressionStatement"&&t.expression.type==="AssignmentExpression"&&t.expression.operator==="="&&t.expression.right.type==="CallExpression"&&t.expression.right.callee.type==="Identifier"&&t.expression.right.callee.name==="read"&&t.expression.right.arguments.length>=1&&t.expression.right.arguments[0].type==="CallExpression"&&t.expression.right.arguments[0].callee.type==="Identifier"&&t.expression.right.arguments[0].callee.name==="resolvePath"&&t.expression.right.arguments[0].arguments.length===1&&t.expression.right.arguments[0].arguments[0].type==="Literal"){const a=t.expression.right.arguments[0].arguments[0].value;let u;try{const t=await s.default(String(a),e,r);if(typeof t==="string"){u=t}else{return undefined}}catch(e){return undefined}const c="/"+o.relative(o.dirname(e),u);t.expression.right.arguments[0]={type:"BinaryExpression",start:t.expression.right.arguments[0].start,end:t.expression.right.arguments[0].end,operator:"+",left:{type:"Identifier",name:"__dirname"},right:{type:"Literal",value:c,raw:JSON.stringify(c)}}}return undefined}for(const e of t.body){if(e.type==="ExpressionStatement"&&e.expression.type==="AssignmentExpression"&&e.expression.operator==="="&&e.expression.left.type==="MemberExpression"&&e.expression.left.object.type==="MemberExpression"&&e.expression.left.object.object.type==="Identifier"&&e.expression.left.object.object.name==="Server"&&e.expression.left.object.property.type==="Identifier"&&e.expression.left.object.property.name==="prototype"&&e.expression.left.property.type==="Identifier"&&e.expression.left.property.name==="serveClient"&&e.expression.right.type==="FunctionExpression"){for(const t of e.expression.right.body.body){if(t.type==="IfStatement"&&t.consequent&&"body"in t.consequent&&t.consequent.body){const e=t.consequent.body;let r=false;if(Array.isArray(e)&&e[0]&&e[0].type==="ExpressionStatement"){r=await replaceResolvePathStatement(e[0])}if(Array.isArray(e)&&e[1]&&e[1].type==="TryStatement"&&e[1].block.body&&e[1].block.body[0]){r=await replaceResolvePathStatement(e[1].block.body[0])||r}return}}}}}},typescript({id:e,emitAssetDirectory:t}){if(e.endsWith("typescript/lib/tsc.js")){t(o.resolve(e,"../"))}},"uglify-es"({id:e,emitAsset:t}){if(e.endsWith("uglify-es/tools/node.js")){t(o.resolve(e,"../../lib/utils.js"));t(o.resolve(e,"../../lib/ast.js"));t(o.resolve(e,"../../lib/parse.js"));t(o.resolve(e,"../../lib/transform.js"));t(o.resolve(e,"../../lib/scope.js"));t(o.resolve(e,"../../lib/output.js"));t(o.resolve(e,"../../lib/compress.js"));t(o.resolve(e,"../../lib/sourcemap.js"));t(o.resolve(e,"../../lib/mozilla-ast.js"));t(o.resolve(e,"../../lib/propmangle.js"));t(o.resolve(e,"../../lib/minify.js"));t(o.resolve(e,"../exports.js"))}},"uglify-js"({id:e,emitAsset:t,emitAssetDirectory:r}){if(e.endsWith("uglify-js/tools/node.js")){r(o.resolve(e,"../../lib"));t(o.resolve(e,"../exports.js"))}},"playwright-core"({id:e,emitAsset:t}){if(e.endsWith("playwright-core/index.js")){t(o.resolve(o.dirname(e),"browsers.json"))}},"geo-tz"({id:e,emitAsset:t}){if(e.endsWith("geo-tz/dist/geo-tz.js")){t(o.resolve(o.dirname(e),"../data/geo.dat"))}}};async function handleSpecialCases({id:e,ast:t,emitAsset:r,emitAssetDirectory:a,job:o}){const s=u.getPackageName(e);const c=d[s||""];e=e.replace(/\\/g,"/");if(c)await c({id:e,ast:t,emitAsset:r,emitAssetDirectory:a,job:o})}t["default"]=handleSpecialCases},5401:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.wildcardRegEx=t.WILDCARD=t.FUNCTION=t.UNKNOWN=t.evaluate=void 0;const a=r(7310);async function evaluate(e,t={},r=true){const a={computeBranches:r,vars:t};return walk(e);function walk(e){const t=o[e.type];if(t){return t.call(a,e,walk)}return undefined}}t.evaluate=evaluate;t.UNKNOWN=Symbol();t.FUNCTION=Symbol();t.WILDCARD="";t.wildcardRegEx=/\x1a/g;function countWildcards(e){t.wildcardRegEx.lastIndex=0;let r=0;while(t.wildcardRegEx.exec(e))r++;return r}const o={ArrayExpression:async function ArrayExpression(e,t){const r=[];for(let a=0,o=e.elements.length;aa.value}}}return undefined},BinaryExpression:async function BinaryExpression(e,r){const a=e.operator;let o=await r(e.left);if(!o&&a!=="+")return;let s=await r(e.right);if(!o&&!s)return;if(!o){if(this.computeBranches&&s&&"value"in s&&typeof s.value==="string")return{value:t.WILDCARD+s.value,wildcards:[e.left,...s.wildcards||[]]};return}if(!s){if(this.computeBranches&&a==="+"){if(o&&"value"in o&&typeof o.value==="string")return{value:o.value+t.WILDCARD,wildcards:[...o.wildcards||[],e.right]}}if(!("test"in o)&&a==="||"&&o.value)return o;return}if("test"in o&&"value"in s){const e=s.value;if(a==="==")return{test:o.test,then:o.then==e,else:o.else==e};if(a==="===")return{test:o.test,then:o.then===e,else:o.else===e};if(a==="!=")return{test:o.test,then:o.then!=e,else:o.else!=e};if(a==="!==")return{test:o.test,then:o.then!==e,else:o.else!==e};if(a==="+")return{test:o.test,then:o.then+e,else:o.else+e};if(a==="-")return{test:o.test,then:o.then-e,else:o.else-e};if(a==="*")return{test:o.test,then:o.then*e,else:o.else*e};if(a==="/")return{test:o.test,then:o.then/e,else:o.else/e};if(a==="%")return{test:o.test,then:o.then%e,else:o.else%e};if(a==="<")return{test:o.test,then:o.then")return{test:o.test,then:o.then>e,else:o.else>e};if(a===">=")return{test:o.test,then:o.then>=e,else:o.else>=e};if(a==="|")return{test:o.test,then:o.then|e,else:o.else|e};if(a==="&")return{test:o.test,then:o.then&e,else:o.else&e};if(a==="^")return{test:o.test,then:o.then^e,else:o.else^e};if(a==="&&")return{test:o.test,then:o.then&&e,else:o.else&&e};if(a==="||")return{test:o.test,then:o.then||e,else:o.else||e}}else if("test"in s&&"value"in o){const e=o.value;if(a==="==")return{test:s.test,then:e==s.then,else:e==s.else};if(a==="===")return{test:s.test,then:e===s.then,else:e===s.else};if(a==="!=")return{test:s.test,then:e!=s.then,else:e!=s.else};if(a==="!==")return{test:s.test,then:e!==s.then,else:e!==s.else};if(a==="+")return{test:s.test,then:e+s.then,else:e+s.else};if(a==="-")return{test:s.test,then:e-s.then,else:e-s.else};if(a==="*")return{test:s.test,then:e*s.then,else:e*s.else};if(a==="/")return{test:s.test,then:e/s.then,else:e/s.else};if(a==="%")return{test:s.test,then:e%s.then,else:e%s.else};if(a==="<")return{test:s.test,then:e")return{test:s.test,then:e>s.then,else:e>s.else};if(a===">=")return{test:s.test,then:e>=s.then,else:e>=s.else};if(a==="|")return{test:s.test,then:e|s.then,else:e|s.else};if(a==="&")return{test:s.test,then:e&s.then,else:e&s.else};if(a==="^")return{test:s.test,then:e^s.then,else:e^s.else};if(a==="&&")return{test:s.test,then:e&&s.then,else:o&&s.else};if(a==="||")return{test:s.test,then:e||s.then,else:o||s.else}}else if("value"in o&&"value"in s){if(a==="==")return{value:o.value==s.value};if(a==="===")return{value:o.value===s.value};if(a==="!=")return{value:o.value!=s.value};if(a==="!==")return{value:o.value!==s.value};if(a==="+"){const e={value:o.value+s.value};let t=[];if("wildcards"in o&&o.wildcards){t=t.concat(o.wildcards)}if("wildcards"in s&&s.wildcards){t=t.concat(s.wildcards)}if(t.length>0){e.wildcards=t}return e}if(a==="-")return{value:o.value-s.value};if(a==="*")return{value:o.value*s.value};if(a==="/")return{value:o.value/s.value};if(a==="%")return{value:o.value%s.value};if(a==="<")return{value:o.value")return{value:o.value>s.value};if(a===">=")return{value:o.value>=s.value};if(a==="|")return{value:o.value|s.value};if(a==="&")return{value:o.value&s.value};if(a==="^")return{value:o.value^s.value};if(a==="&&")return{value:o.value&&s.value};if(a==="||")return{value:o.value||s.value}}return},CallExpression:async function CallExpression(e,r){var a;const o=await r(e.callee);if(!o||"test"in o)return;let s=o.value;if(typeof s==="object"&&s!==null)s=s[t.FUNCTION];if(typeof s!=="function")return;let u=null;if(e.callee.object){u=await r(e.callee.object);u=u&&"value"in u&&u.value?u.value:null}let c;let d=[];let f;let p=e.arguments.length>0&&((a=e.callee.property)===null||a===void 0?void 0:a.name)!=="concat";const h=[];for(let a=0,o=e.arguments.length;ah.push(e)))}else{if(!this.computeBranches)return;o={value:t.WILDCARD};h.push(e.arguments[a])}if("test"in o){if(h.length)return;if(c)return;c=o.test;f=d.concat([]);d.push(o.then);f.push(o.else)}else{d.push(o.value);if(f)f.push(o.value)}}if(p)return;try{const e=await s.apply(u,d);if(e===t.UNKNOWN)return;if(!c){if(h.length){if(typeof e!=="string"||countWildcards(e)!==h.length)return;return{value:e,wildcards:h}}return{value:e}}const r=await s.apply(u,f);if(e===t.UNKNOWN)return;return{test:c,then:e,else:r}}catch(e){return}},ConditionalExpression:async function ConditionalExpression(e,t){const r=await t(e.test);if(r&&"value"in r)return r.value?t(e.consequent):t(e.alternate);if(!this.computeBranches)return;const a=await t(e.consequent);if(!a||"wildcards"in a||"test"in a)return;const o=await t(e.alternate);if(!o||"wildcards"in o||"test"in o)return;return{test:e.test,then:a.value,else:o.value}},ExpressionStatement:async function ExpressionStatement(e,t){return t(e.expression)},Identifier:async function Identifier(e,t){if(Object.hasOwnProperty.call(this.vars,e.name))return this.vars[e.name];return undefined},Literal:async function Literal(e,t){return{value:e.value}},MemberExpression:async function MemberExpression(e,r){const a=await r(e.object);if(!a||"test"in a||typeof a.value==="function"){return undefined}if(e.property.type==="Identifier"){if(typeof a.value==="string"&&e.property.name==="concat"){return{value:{[t.FUNCTION]:(...e)=>a.value.concat(e)}}}if(typeof a.value==="object"&&a.value!==null){const o=a.value;if(e.computed){const s=await r(e.property);if(s&&"value"in s&&s.value){const e=o[s.value];if(e===t.UNKNOWN)return undefined;return{value:e}}if(!o[t.UNKNOWN]&&Object.keys(a).length===0){return{value:undefined}}}else if(e.property.name in o){const r=o[e.property.name];if(r===t.UNKNOWN)return undefined;return{value:r}}else if(o[t.UNKNOWN])return undefined}else{return{value:undefined}}}const o=await r(e.property);if(!o||"test"in o)return undefined;if(typeof a.value==="object"&&a.value!==null){if(o.value in a.value){const e=a.value[o.value];if(e===t.UNKNOWN)return undefined;return{value:e}}else if(a.value[t.UNKNOWN]){return undefined}}else{return{value:undefined}}return undefined},MetaProperty:async function MetaProperty(e){if(e.meta.name==="import"&&e.property.name==="meta")return{value:this.vars["import.meta"]};return undefined},NewExpression:async function NewExpression(e,t){const r=await t(e.callee);if(r&&"value"in r&&r.value===a.URL&&e.arguments.length){const r=await t(e.arguments[0]);if(!r)return undefined;let o=null;if(e.arguments[1]){o=await t(e.arguments[1]);if(!o||!("value"in o))return undefined}if("value"in r){if(o){try{return{value:new a.URL(r.value,o.value)}}catch(e){return undefined}}try{return{value:new a.URL(r.value)}}catch(e){return undefined}}else{const e=r.test;if(o){try{return{test:e,then:new a.URL(r.then,o.value),else:new a.URL(r.else,o.value)}}catch(e){return undefined}}try{return{test:e,then:new a.URL(r.then),else:new a.URL(r.else)}}catch(e){return undefined}}}return undefined},ObjectExpression:async function ObjectExpression(e,r){const a={};for(let o=0;o{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.handleWrappers=void 0;const a=r(7470);function isUndefinedOrVoid(e){return e.type==="Identifier"&&e.name==="undefined"||e.type==="UnaryExpression"&&e.operator==="void"&&e.argument.type==="Literal"&&e.argument.value===0}function handleWrappers(e){var t;let r;if(e.body.length===1&&e.body[0].type==="ExpressionStatement"&&e.body[0].expression.type==="UnaryExpression"&&e.body[0].expression.operator==="!"&&e.body[0].expression.argument.type==="CallExpression"&&e.body[0].expression.argument.callee.type==="FunctionExpression"&&e.body[0].expression.argument.arguments.length===1)r=e.body[0].expression.argument;else if(e.body.length===1&&e.body[0].type==="ExpressionStatement"&&e.body[0].expression.type==="CallExpression"&&e.body[0].expression.callee.type==="FunctionExpression"&&(e.body[0].expression.arguments.length===1||e.body[0].expression.arguments.length===0))r=e.body[0].expression;else if(e.body.length===1&&e.body[0].type==="ExpressionStatement"&&e.body[0].expression.type==="AssignmentExpression"&&e.body[0].expression.left.type==="MemberExpression"&&e.body[0].expression.left.object.type==="Identifier"&&e.body[0].expression.left.object.name==="module"&&e.body[0].expression.left.property.type==="Identifier"&&e.body[0].expression.left.property.name==="exports"&&e.body[0].expression.right.type==="CallExpression"&&e.body[0].expression.right.callee.type==="FunctionExpression"&&e.body[0].expression.right.arguments.length===1)r=e.body[0].expression.right;if(r){let e;let o;if(r.arguments[0]&&r.arguments[0].type==="ConditionalExpression"&&r.arguments[0].test.type==="LogicalExpression"&&r.arguments[0].test.operator==="&&"&&r.arguments[0].test.left.type==="BinaryExpression"&&r.arguments[0].test.left.operator==="==="&&r.arguments[0].test.left.left.type==="UnaryExpression"&&r.arguments[0].test.left.left.operator==="typeof"&&"name"in r.arguments[0].test.left.left.argument&&r.arguments[0].test.left.left.argument.name==="define"&&r.arguments[0].test.left.right.type==="Literal"&&r.arguments[0].test.left.right.value==="function"&&r.arguments[0].test.right.type==="MemberExpression"&&r.arguments[0].test.right.object.type==="Identifier"&&r.arguments[0].test.right.property.type==="Identifier"&&r.arguments[0].test.right.property.name==="amd"&&r.arguments[0].test.right.computed===false&&r.arguments[0].alternate.type==="FunctionExpression"&&r.arguments[0].alternate.params.length===1&&r.arguments[0].alternate.params[0].type==="Identifier"&&r.arguments[0].alternate.body.body.length===1&&r.arguments[0].alternate.body.body[0].type==="ExpressionStatement"&&r.arguments[0].alternate.body.body[0].expression.type==="AssignmentExpression"&&r.arguments[0].alternate.body.body[0].expression.left.type==="MemberExpression"&&r.arguments[0].alternate.body.body[0].expression.left.object.type==="Identifier"&&r.arguments[0].alternate.body.body[0].expression.left.object.name==="module"&&r.arguments[0].alternate.body.body[0].expression.left.property.type==="Identifier"&&r.arguments[0].alternate.body.body[0].expression.left.property.name==="exports"&&r.arguments[0].alternate.body.body[0].expression.left.computed===false&&r.arguments[0].alternate.body.body[0].expression.right.type==="CallExpression"&&r.arguments[0].alternate.body.body[0].expression.right.callee.type==="Identifier"&&r.arguments[0].alternate.body.body[0].expression.right.callee.name===r.arguments[0].alternate.params[0].name&&"body"in r.callee&&"body"in r.callee.body&&Array.isArray(r.callee.body.body)&&r.arguments[0].alternate.body.body[0].expression.right.arguments.length===1&&r.arguments[0].alternate.body.body[0].expression.right.arguments[0].type==="Identifier"&&r.arguments[0].alternate.body.body[0].expression.right.arguments[0].name==="require"){let e=r.callee.body.body;if(e[0].type==="ExpressionStatement"&&e[0].expression.type==="Literal"&&e[0].expression.value==="use strict"){e=e.slice(1)}if(e.length===1&&e[0].type==="ExpressionStatement"&&e[0].expression.type==="CallExpression"&&e[0].expression.callee.type==="Identifier"&&e[0].expression.callee.name===r.arguments[0].test.right.object.name&&e[0].expression.arguments.length===1&&e[0].expression.arguments[0].type==="FunctionExpression"&&e[0].expression.arguments[0].params.length===1&&e[0].expression.arguments[0].params[0].type==="Identifier"&&e[0].expression.arguments[0].params[0].name==="require"){const t=e[0].expression.arguments[0];t.params=[];try{delete t.scope.declarations.require}catch(e){}}}else if(r.arguments[0]&&r.arguments[0].type==="FunctionExpression"&&r.arguments[0].params.length===0&&(r.arguments[0].body.body.length===1||r.arguments[0].body.body.length===2&&r.arguments[0].body.body[0].type==="VariableDeclaration"&&r.arguments[0].body.body[0].declarations.length===3&&r.arguments[0].body.body[0].declarations.every((e=>e.init===null&&e.id.type==="Identifier")))&&r.arguments[0].body.body[r.arguments[0].body.body.length-1].type==="ReturnStatement"&&(e=r.arguments[0].body.body[r.arguments[0].body.body.length-1])&&((t=e.argument)===null||t===void 0?void 0:t.type)==="CallExpression"&&e.argument.arguments.length&&e.argument.arguments.every((e=>e&&e.type==="Literal"&&typeof e.value==="number"))&&e.argument.callee.type==="CallExpression"&&(e.argument.callee.callee.type==="FunctionExpression"||e.argument.callee.callee.type==="CallExpression"&&e.argument.callee.callee.callee.type==="FunctionExpression"&&e.argument.callee.callee.arguments.length===0)&&e.argument.callee.arguments.length===3&&e.argument.callee.arguments[0].type==="ObjectExpression"&&e.argument.callee.arguments[1].type==="ObjectExpression"&&e.argument.callee.arguments[2].type==="ArrayExpression"){const t=e.argument.callee.arguments[0].properties;const r={};if(t.every((e=>{if(e.type!=="Property"||e.computed!==false||e.key.type!=="Literal"||typeof e.key.value!=="number"||e.value.type!=="ArrayExpression"||e.value.elements.length!==2||!e.value.elements[0]||!e.value.elements[1]||e.value.elements[0].type!=="FunctionExpression"||e.value.elements[1].type!=="ObjectExpression"){return false}const t=e.value.elements[1].properties;for(const e of t){if(e.type!=="Property"||e.value.type!=="Identifier"&&e.value.type!=="Literal"&&!isUndefinedOrVoid(e.value)||!(e.key.type==="Literal"&&typeof e.key.value==="string"||e.key.type==="Identifier")||e.computed){return false}if(isUndefinedOrVoid(e.value)){if(e.key.type==="Identifier"){r[e.key.name]={type:"Literal",start:e.key.start,end:e.key.end,value:e.key.name,raw:JSON.stringify(e.key.name)}}else if(e.key.type==="Literal"){r[String(e.key.value)]=e.key}}}return true}))){const t=Object.keys(r);const a=e.argument.callee.arguments[1];a.properties=t.map((e=>({type:"Property",method:false,shorthand:false,computed:false,kind:"init",key:r[e],value:{type:"ObjectExpression",properties:[{type:"Property",kind:"init",method:false,shorthand:false,computed:false,key:{type:"Identifier",name:"exports"},value:{type:"CallExpression",optional:false,callee:{type:"Identifier",name:"require"},arguments:[r[e]]}}]}})))}}else if(r.arguments[0]&&r.arguments[0].type==="FunctionExpression"&&r.arguments[0].params.length===2&&r.arguments[0].params[0].type==="Identifier"&&r.arguments[0].params[1].type==="Identifier"&&"body"in r.callee&&"body"in r.callee.body&&Array.isArray(r.callee.body.body)&&r.callee.body.body.length===1){const e=r.callee.body.body[0];if(e.type==="IfStatement"&&e.test.type==="LogicalExpression"&&e.test.operator==="&&"&&e.test.left.type==="BinaryExpression"&&e.test.left.left.type==="UnaryExpression"&&e.test.left.left.operator==="typeof"&&e.test.left.left.argument.type==="Identifier"&&e.test.left.left.argument.name==="module"&&e.test.left.right.type==="Literal"&&e.test.left.right.value==="object"&&e.test.right.type==="BinaryExpression"&&e.test.right.left.type==="UnaryExpression"&&e.test.right.left.operator==="typeof"&&e.test.right.left.argument.type==="MemberExpression"&&e.test.right.left.argument.object.type==="Identifier"&&e.test.right.left.argument.object.name==="module"&&e.test.right.left.argument.property.type==="Identifier"&&e.test.right.left.argument.property.name==="exports"&&e.test.right.right.type==="Literal"&&e.test.right.right.value==="object"&&e.consequent.type==="BlockStatement"&&e.consequent.body.length>0){let t;if(e.consequent.body[0].type==="VariableDeclaration"&&e.consequent.body[0].declarations[0].init&&e.consequent.body[0].declarations[0].init.type==="CallExpression")t=e.consequent.body[0].declarations[0].init;else if(e.consequent.body[0].type==="ExpressionStatement"&&e.consequent.body[0].expression.type==="CallExpression")t=e.consequent.body[0].expression;else if(e.consequent.body[0].type==="ExpressionStatement"&&e.consequent.body[0].expression.type==="AssignmentExpression"&&e.consequent.body[0].expression.operator==="="&&e.consequent.body[0].expression.right.type==="CallExpression")t=e.consequent.body[0].expression.right;if(t&&t.callee.type==="Identifier"&&"params"in r.callee&&r.callee.params.length>0&&"name"in r.callee.params[0]&&t.callee.name===r.callee.params[0].name&&t.arguments.length===2&&t.arguments[0].type==="Identifier"&&t.arguments[0].name==="require"&&t.arguments[1].type==="Identifier"&&t.arguments[1].name==="exports"){const e=r.arguments[0];e.params=[];try{const t=e.scope;delete t.declarations.require;delete t.declarations.exports}catch(e){}}}}else if(r.callee.type==="FunctionExpression"&&r.callee.body.body.length>2&&r.callee.body.body[0].type==="VariableDeclaration"&&r.callee.body.body[0].declarations.length===1&&r.callee.body.body[0].declarations[0].type==="VariableDeclarator"&&r.callee.body.body[0].declarations[0].id.type==="Identifier"&&r.callee.body.body[0].declarations[0].init&&(r.callee.body.body[0].declarations[0].init.type==="ObjectExpression"&&r.callee.body.body[0].declarations[0].init.properties.length===0||r.callee.body.body[0].declarations[0].init.type==="CallExpression"&&r.callee.body.body[0].declarations[0].init.arguments.length===1)&&(r.callee.body.body[1]&&r.callee.body.body[1].type==="FunctionDeclaration"&&r.callee.body.body[1].params.length===1&&r.callee.body.body[1].body.body.length>=3||r.callee.body.body[2]&&r.callee.body.body[2].type==="FunctionDeclaration"&&r.callee.body.body[2].params.length===1&&r.callee.body.body[2].body.body.length>=3)&&(r.arguments[0]&&(r.arguments[0].type==="ArrayExpression"&&(o=r.arguments[0])&&r.arguments[0].elements.length>0&&r.arguments[0].elements.every((e=>e&&e.type==="FunctionExpression"))||r.arguments[0].type==="ObjectExpression"&&(o=r.arguments[0])&&r.arguments[0].properties&&r.arguments[0].properties.length>0&&r.arguments[0].properties.every((e=>e&&e.type==="Property"&&!e.computed&&e.key&&e.key.type==="Literal"&&(typeof e.key.value==="string"||typeof e.key.value==="number")&&e.value&&e.value.type==="FunctionExpression"))))||r.arguments.length===0&&r.callee.type==="FunctionExpression"&&r.callee.params.length===0&&r.callee.body.type==="BlockStatement"&&r.callee.body.body.length>5&&r.callee.body.body[0].type==="VariableDeclaration"&&r.callee.body.body[0].declarations.length===1&&r.callee.body.body[0].declarations[0].id.type==="Identifier"&&r.callee.body.body[1].type==="ExpressionStatement"&&r.callee.body.body[1].expression.type==="AssignmentExpression"&&r.callee.body.body[2].type==="ExpressionStatement"&&r.callee.body.body[2].expression.type==="AssignmentExpression"&&r.callee.body.body[3].type==="ExpressionStatement"&&r.callee.body.body[3].expression.type==="AssignmentExpression"&&r.callee.body.body[3].expression.left.type==="MemberExpression"&&r.callee.body.body[3].expression.left.object.type==="Identifier"&&r.callee.body.body[3].expression.left.object.name===r.callee.body.body[0].declarations[0].id.name&&r.callee.body.body[3].expression.left.property.type==="Identifier"&&r.callee.body.body[3].expression.left.property.name==="modules"&&r.callee.body.body[3].expression.right.type==="ObjectExpression"&&r.callee.body.body[3].expression.right.properties.every((e=>e&&e.type==="Property"&&!e.computed&&e.key&&e.key.type==="Literal"&&(typeof e.key.value==="string"||typeof e.key.value==="number")&&e.value&&e.value.type==="FunctionExpression"))&&(o=r.callee.body.body[3].expression.right)&&(r.callee.body.body[4].type==="VariableDeclaration"&&r.callee.body.body[4].declarations.length===1&&r.callee.body.body[4].declarations[0].init&&r.callee.body.body[4].declarations[0].init.type==="CallExpression"&&r.callee.body.body[4].declarations[0].init.callee.type==="Identifier"&&r.callee.body.body[4].declarations[0].init.callee.name==="require"||r.callee.body.body[5].type==="VariableDeclaration"&&r.callee.body.body[5].declarations.length===1&&r.callee.body.body[5].declarations[0].init&&r.callee.body.body[5].declarations[0].init.type==="CallExpression"&&r.callee.body.body[5].declarations[0].init.callee.type==="Identifier"&&r.callee.body.body[5].declarations[0].init.callee.name==="require")){const e=new Map;let t;if(o.type==="ArrayExpression")t=o.elements.filter((e=>(e===null||e===void 0?void 0:e.type)==="FunctionExpression")).map(((e,t)=>[String(t),e]));else t=o.properties.map((e=>[String(e.key.value),e.value]));for(const[r,a]of t){const t=a.body.body.length===1?a.body.body[0]:(a.body.body.length===2||a.body.body.length===3&&a.body.body[2].type==="EmptyStatement")&&a.body.body[0].type==="ExpressionStatement"&&a.body.body[0].expression.type==="Literal"&&a.body.body[0].expression.value==="use strict"?a.body.body[1]:null;if(t&&t.type==="ExpressionStatement"&&t.expression.type==="AssignmentExpression"&&t.expression.operator==="="&&t.expression.left.type==="MemberExpression"&&t.expression.left.object.type==="Identifier"&&"params"in a&&a.params.length>0&&"name"in a.params[0]&&t.expression.left.object.name===a.params[0].name&&t.expression.left.property.type==="Identifier"&&t.expression.left.property.name==="exports"&&t.expression.right.type==="CallExpression"&&t.expression.right.callee.type==="Identifier"&&t.expression.right.callee.name==="require"&&t.expression.right.arguments.length===1&&t.expression.right.arguments[0].type==="Literal"){e.set(r,t.expression.right.arguments[0].value)}}for(const[,r]of t){if("params"in r&&r.params.length===3&&r.params[2].type==="Identifier"){const t=new Map;a.walk(r.body,{enter(a,o){const s=a;const u=o;if(s.type==="CallExpression"&&s.callee.type==="Identifier"&&"name"in r.params[2]&&s.callee.name===r.params[2].name&&s.arguments.length===1&&s.arguments[0].type==="Literal"){const r=e.get(String(s.arguments[0].value));if(r){const e={type:"CallExpression",optional:false,callee:{type:"Identifier",name:"require"},arguments:[{type:"Literal",value:r}]};const a=u;if("right"in a&&a.right===s){a.right=e}else if("left"in a&&a.left===s){a.left=e}else if("object"in a&&a.object===s){a.object=e}else if("callee"in a&&a.callee===s){a.callee=e}else if("arguments"in a&&a.arguments.some((e=>e===s))){a.arguments=a.arguments.map((t=>t===s?e:t))}else if("init"in a&&a.init===s){if(a.type==="VariableDeclarator"&&a.id.type==="Identifier")t.set(a.id.name,r);a.init=e}}}else if(s.type==="CallExpression"&&s.callee.type==="MemberExpression"&&s.callee.object.type==="Identifier"&&"name"in r.params[2]&&s.callee.object.name===r.params[2].name&&s.callee.property.type==="Identifier"&&s.callee.property.name==="n"&&s.arguments.length===1&&s.arguments[0].type==="Identifier"){if(u&&"init"in u&&u.init===s){const e=s.arguments[0];const t={type:"CallExpression",optional:false,callee:{type:"MemberExpression",computed:false,optional:false,object:{type:"Identifier",name:"Object"},property:{type:"Identifier",name:"assign"}},arguments:[{type:"ArrowFunctionExpression",expression:true,params:[],body:e},{type:"ObjectExpression",properties:[{type:"Property",kind:"init",method:false,computed:false,shorthand:false,key:{type:"Identifier",name:"a"},value:e}]}]};u.init=t}}}})}}}}}t.handleWrappers=handleWrappers},5920:(e,t)=>{e.exports=t=abbrev.abbrev=abbrev;abbrev.monkeyPatch=monkeyPatch;function monkeyPatch(){Object.defineProperty(Array.prototype,"abbrev",{value:function(){return abbrev(this)},enumerable:false,configurable:true,writable:true});Object.defineProperty(Object.prototype,"abbrev",{value:function(){return abbrev(Object.keys(this))},enumerable:false,configurable:true,writable:true})}function abbrev(e){if(arguments.length!==1||!Array.isArray(e)){e=Array.prototype.slice.call(arguments,0)}for(var t=0,r=e.length,a=[];tt?1:-1}},5534:e=>{"use strict";function isArguments(e){return e!=null&&typeof e==="object"&&e.hasOwnProperty("callee")}var t={"*":{label:"any",check:function(){return true}},A:{label:"array",check:function(e){return Array.isArray(e)||isArguments(e)}},S:{label:"string",check:function(e){return typeof e==="string"}},N:{label:"number",check:function(e){return typeof e==="number"}},F:{label:"function",check:function(e){return typeof e==="function"}},O:{label:"object",check:function(e){return typeof e==="object"&&e!=null&&!t.A.check(e)&&!t.E.check(e)}},B:{label:"boolean",check:function(e){return typeof e==="boolean"}},E:{label:"error",check:function(e){return e instanceof Error}},Z:{label:"null",check:function(e){return e==null}}};function addSchema(e,t){var r=t[e.length]=t[e.length]||[];if(r.indexOf(e)===-1)r.push(e)}var r=e.exports=function(e,r){if(arguments.length!==2)throw wrongNumberOfArgs(["SA"],arguments.length);if(!e)throw missingRequiredArg(0,"rawSchemas");if(!r)throw missingRequiredArg(1,"args");if(!t.S.check(e))throw invalidType(0,["string"],e);if(!t.A.check(r))throw invalidType(1,["array"],r);var a=e.split("|");var o={};a.forEach((function(e){for(var r=0;r{"use strict";t.TrackerGroup=r(2952);t.Tracker=r(6189);t.TrackerStream=r(5849)},8313:(e,t,r)=>{"use strict";var a=r(2361).EventEmitter;var o=r(3837);var s=0;var u=e.exports=function(e){a.call(this);this.id=++s;this.name=e};o.inherits(u,a)},2952:(e,t,r)=>{"use strict";var a=r(3837);var o=r(8313);var s=r(6189);var u=r(5849);var c=e.exports=function(e){o.call(this,e);this.parentGroup=null;this.trackers=[];this.completion={};this.weight={};this.totalWeight=0;this.finished=false;this.bubbleChange=bubbleChange(this)};a.inherits(c,o);function bubbleChange(e){return function(t,r,a){e.completion[a.id]=r;if(e.finished)return;e.emit("change",t||e.name,e.completed(),e)}}c.prototype.nameInTree=function(){var e=[];var t=this;while(t){e.unshift(t.name);t=t.parentGroup}return e.join("/")};c.prototype.addUnit=function(e,t){if(e.addUnit){var r=this;while(r){if(e===r){throw new Error("Attempted to add tracker group "+e.name+" to tree that already includes it "+this.nameInTree(this))}r=r.parentGroup}e.parentGroup=this}this.weight[e.id]=t||1;this.totalWeight+=this.weight[e.id];this.trackers.push(e);this.completion[e.id]=e.completed();e.on("change",this.bubbleChange);if(!this.finished)this.emit("change",e.name,this.completion[e.id],e);return e};c.prototype.completed=function(){if(this.trackers.length===0)return 0;var e=1/this.totalWeight;var t=0;for(var r=0;r{"use strict";var a=r(3837);var o=r(675);var s=r(1722);var u=r(6189);var c=e.exports=function(e,t,r){o.Transform.call(this,r);this.tracker=new u(e,t);this.name=e;this.id=this.tracker.id;this.tracker.on("change",delegateChange(this))};a.inherits(c,o.Transform);function delegateChange(e){return function(t,r,a){e.emit("change",t,r,e)}}c.prototype._transform=function(e,t,r){this.tracker.completeWork(e.length?e.length:1);this.push(e);r()};c.prototype._flush=function(e){this.tracker.finish();e()};s(c.prototype,"tracker").method("completed").method("addWork").method("finish")},6189:(e,t,r)=>{"use strict";var a=r(3837);var o=r(8313);var s=e.exports=function(e,t){o.call(this,e);this.workDone=0;this.workTodo=t||0};a.inherits(s,o);s.prototype.completed=function(){return this.workTodo===0?0:this.workDone/this.workTodo};s.prototype.addWork=function(e){this.workTodo+=e;this.emit("change",this.name,this.completed(),this)};s.prototype.completeWork=function(e){this.workDone+=e;if(this.workDone>this.workTodo)this.workDone=this.workTodo;this.emit("change",this.name,this.completed(),this)};s.prototype.finish=function(){this.workTodo=this.workDone=1;this.emit("change",this.name,1,this)}},5706:(module,exports,__nccwpck_require__)=>{var fs=__nccwpck_require__(7147),path=__nccwpck_require__(1017),fileURLToPath=__nccwpck_require__(9001),join=path.join,dirname=path.dirname,exists=fs.accessSync&&function(e){try{fs.accessSync(e)}catch(e){return false}return true}||fs.existsSync||path.existsSync,defaults={arrow:process.env.NODE_BINDINGS_ARROW||" → ",compiled:process.env.NODE_BINDINGS_COMPILED_DIR||"compiled",platform:process.platform,arch:process.arch,nodePreGyp:"node-v"+process.versions.modules+"-"+process.platform+"-"+process.arch,version:process.versions.node,bindings:"bindings.node",try:[["module_root","build","bindings"],["module_root","build","Debug","bindings"],["module_root","build","Release","bindings"],["module_root","out","Debug","bindings"],["module_root","Debug","bindings"],["module_root","out","Release","bindings"],["module_root","Release","bindings"],["module_root","build","default","bindings"],["module_root","compiled","version","platform","arch","bindings"],["module_root","addon-build","release","install-root","bindings"],["module_root","addon-build","debug","install-root","bindings"],["module_root","addon-build","default","install-root","bindings"],["module_root","lib","binding","nodePreGyp","bindings"]]};function bindings(opts){if(typeof opts=="string"){opts={bindings:opts}}else if(!opts){opts={}}Object.keys(defaults).map((function(e){if(!(e in opts))opts[e]=defaults[e]}));if(!opts.module_root){opts.module_root=exports.getRoot(exports.getFileName())}if(path.extname(opts.bindings)!=".node"){opts.bindings+=".node"}var requireFunc=true?eval("require"):0;var tries=[],i=0,l=opts.try.length,n,b,err;for(;i{"use strict";e.exports=function(e,t){if(e===null||e===undefined){throw TypeError()}e=String(e);var r=e.length;var a=t?Number(t):0;if(Number.isNaN(a)){a=0}if(a<0||a>=r){return undefined}var o=e.charCodeAt(a);if(o>=55296&&o<=56319&&r>a+1){var s=e.charCodeAt(a+1);if(s>=56320&&s<=57343){return(o-55296)*1024+s-56320+65536}}return o}},6322:(e,t)=>{"use strict";var r="[";t.up=function up(e){return r+(e||"")+"A"};t.down=function down(e){return r+(e||"")+"B"};t.forward=function forward(e){return r+(e||"")+"C"};t.back=function back(e){return r+(e||"")+"D"};t.nextLine=function nextLine(e){return r+(e||"")+"E"};t.previousLine=function previousLine(e){return r+(e||"")+"F"};t.horizontalAbsolute=function horizontalAbsolute(e){if(e==null)throw new Error("horizontalAboslute requires a column to position to");return r+e+"G"};t.eraseData=function eraseData(){return r+"J"};t.eraseLine=function eraseLine(){return r+"K"};t.goto=function(e,t){return r+t+";"+e+"H"};t.gotoSOL=function(){return"\r"};t.beep=function(){return""};t.hideCursor=function hideCursor(){return r+"?25l"};t.showCursor=function showCursor(){return r+"?25h"};var a={reset:0,bold:1,italic:3,underline:4,inverse:7,stopBold:22,stopItalic:23,stopUnderline:24,stopInverse:27,white:37,black:30,blue:34,cyan:36,green:32,magenta:35,red:31,yellow:33,bgWhite:47,bgBlack:40,bgBlue:44,bgCyan:46,bgGreen:42,bgMagenta:45,bgRed:41,bgYellow:43,grey:90,brightBlack:90,brightRed:91,brightGreen:92,brightYellow:93,brightBlue:94,brightMagenta:95,brightCyan:96,brightWhite:97,bgGrey:100,bgBrightBlack:100,bgBrightRed:101,bgBrightGreen:102,bgBrightYellow:103,bgBrightBlue:104,bgBrightMagenta:105,bgBrightCyan:106,bgBrightWhite:107};t.color=function color(e){if(arguments.length!==1||!Array.isArray(e)){e=Array.prototype.slice.call(arguments)}return r+e.map(colorNameToCode).join(";")+"m"};function colorNameToCode(e){if(a[e]!=null)return a[e];throw new Error("Unknown color or style name: "+e)}},3487:(e,t)=>{function isArray(e){if(Array.isArray){return Array.isArray(e)}return objectToString(e)==="[object Array]"}t.isArray=isArray;function isBoolean(e){return typeof e==="boolean"}t.isBoolean=isBoolean;function isNull(e){return e===null}t.isNull=isNull;function isNullOrUndefined(e){return e==null}t.isNullOrUndefined=isNullOrUndefined;function isNumber(e){return typeof e==="number"}t.isNumber=isNumber;function isString(e){return typeof e==="string"}t.isString=isString;function isSymbol(e){return typeof e==="symbol"}t.isSymbol=isSymbol;function isUndefined(e){return e===void 0}t.isUndefined=isUndefined;function isRegExp(e){return objectToString(e)==="[object RegExp]"}t.isRegExp=isRegExp;function isObject(e){return typeof e==="object"&&e!==null}t.isObject=isObject;function isDate(e){return objectToString(e)==="[object Date]"}t.isDate=isDate;function isError(e){return objectToString(e)==="[object Error]"||e instanceof Error}t.isError=isError;function isFunction(e){return typeof e==="function"}t.isFunction=isFunction;function isPrimitive(e){return e===null||typeof e==="boolean"||typeof e==="number"||typeof e==="string"||typeof e==="symbol"||typeof e==="undefined"}t.isPrimitive=isPrimitive;t.isBuffer=Buffer.isBuffer;function objectToString(e){return Object.prototype.toString.call(e)}},1722:e=>{e.exports=Delegator;function Delegator(e,t){if(!(this instanceof Delegator))return new Delegator(e,t);this.proto=e;this.target=t;this.methods=[];this.getters=[];this.setters=[];this.fluents=[]}Delegator.prototype.method=function(e){var t=this.proto;var r=this.target;this.methods.push(e);t[e]=function(){return this[r][e].apply(this[r],arguments)};return this};Delegator.prototype.access=function(e){return this.getter(e).setter(e)};Delegator.prototype.getter=function(e){var t=this.proto;var r=this.target;this.getters.push(e);t.__defineGetter__(e,(function(){return this[r][e]}));return this};Delegator.prototype.setter=function(e){var t=this.proto;var r=this.target;this.setters.push(e);t.__defineSetter__(e,(function(t){return this[r][e]=t}));return this};Delegator.prototype.fluent=function(e){var t=this.proto;var r=this.target;this.fluents.push(e);t[e]=function(t){if("undefined"!=typeof t){this[r][e]=t;return this}else{return this[r][e]}};return this}},2157:(e,t,r)=>{"use strict";var a=r(2037).platform();var o=r(2081).spawnSync;var s=r(7147).readdirSync;var u="glibc";var c="musl";var d={encoding:"utf8",env:process.env};if(!o){o=function(){return{status:126,stdout:"",stderr:""}}}function contains(e){return function(t){return t.indexOf(e)!==-1}}function versionFromMuslLdd(e){return e.split(/[\r\n]+/)[1].trim().split(/\s/)[1]}function safeReaddirSync(e){try{return s(e)}catch(e){}return[]}var f="";var p="";var h="";if(a==="linux"){var v=o("getconf",["GNU_LIBC_VERSION"],d);if(v.status===0){f=u;p=v.stdout.trim().split(" ")[1];h="getconf"}else{var _=o("ldd",["--version"],d);if(_.status===0&&_.stdout.indexOf(c)!==-1){f=c;p=versionFromMuslLdd(_.stdout);h="ldd"}else if(_.status===1&&_.stderr.indexOf(c)!==-1){f=c;p=versionFromMuslLdd(_.stderr);h="ldd"}else{var g=safeReaddirSync("/lib");if(g.some(contains("-linux-gnu"))){f=u;h="filesystem"}else if(g.some(contains("libc.musl-"))){f=c;h="filesystem"}else if(g.some(contains("ld-musl-"))){f=c;h="filesystem"}else{var y=safeReaddirSync("/usr/sbin");if(y.some(contains("glibc"))){f=u;h="filesystem"}}}}}var m=f!==""&&f!==u;e.exports={GLIBC:u,MUSL:c,family:f,version:p,method:h,isNonGlibcLinux:m}},9001:(e,t,r)=>{var a=r(1017).sep||"/";e.exports=fileUriToPath;function fileUriToPath(e){if("string"!=typeof e||e.length<=7||"file://"!=e.substring(0,7)){throw new TypeError("must pass in a file:// URI to convert to a file path")}var t=decodeURI(e.substring(7));var r=t.indexOf("/");var o=t.substring(0,r);var s=t.substring(r+1);if("localhost"==o)o="";if(o){o=a+a+o}s=s.replace(/^(.+)\|/,"$1:");if(a=="\\"){s=s.replace(/\//g,"\\")}if(/^.+\:/.test(s)){}else{s=a+s}return o+s}},1271:(e,t,r)=>{"use strict";var a=r(1021);var o=r(5791);e.exports={activityIndicator:function(e,t,r){if(e.spun==null)return;return a(t,e.spun)},progressbar:function(e,t,r){if(e.completed==null)return;return o(t,r,e.completed)}}},2479:(e,t,r)=>{"use strict";var a=r(3837);var o=t.User=function User(e){var t=new Error(e);Error.captureStackTrace(t,User);t.code="EGAUGE";return t};t.MissingTemplateValue=function MissingTemplateValue(e,t){var r=new o(a.format('Missing template value "%s"',e.type));Error.captureStackTrace(r,MissingTemplateValue);r.template=e;r.values=t;return r};t.Internal=function Internal(e){var t=new Error(e);Error.captureStackTrace(t,Internal);t.code="EGAUGEINTERNAL";return t}},3278:e=>{"use strict";e.exports=isWin32()||isColorTerm();function isWin32(){return process.platform==="win32"}function isColorTerm(){var e=/^screen|^xterm|^vt100|color|ansi|cygwin|linux/i;return!!process.env.COLORTERM||e.test(process.env.TERM)}},6054:(e,t,r)=>{"use strict";var a=r(4708);var o=r(7963);var s=r(3278);var u=r(2028);var c=r(7987);var d=r(75);var f=r(9186);var p=r(6401);e.exports=Gauge;function callWith(e,t){return function(){return t.call(e)}}function Gauge(e,t){var r,o;if(e&&e.write){o=e;r=t||{}}else if(t&&t.write){o=t;r=e||{}}else{o=f.stderr;r=e||t||{}}this._status={spun:0,section:"",subsection:""};this._paused=false;this._disabled=true;this._showing=false;this._onScreen=false;this._needsRedraw=false;this._hideCursor=r.hideCursor==null?true:r.hideCursor;this._fixedFramerate=r.fixedFramerate==null?!/^v0\.8\./.test(f.version):r.fixedFramerate;this._lastUpdateAt=null;this._updateInterval=r.updateInterval==null?50:r.updateInterval;this._themes=r.themes||c;this._theme=r.theme;var s=this._computeTheme(r.theme);var u=r.template||[{type:"progressbar",length:20},{type:"activityIndicator",kerning:1,length:1},{type:"section",kerning:1,default:""},{type:"subsection",kerning:1,default:""}];this.setWriteTo(o,r.tty);var d=r.Plumbing||a;this._gauge=new d(s,u,this.getWidth());this._$$doRedraw=callWith(this,this._doRedraw);this._$$handleSizeChange=callWith(this,this._handleSizeChange);this._cleanupOnExit=r.cleanupOnExit==null||r.cleanupOnExit;this._removeOnExit=null;if(r.enabled||r.enabled==null&&this._tty&&this._tty.isTTY){this.enable()}else{this.disable()}}Gauge.prototype={};Gauge.prototype.isEnabled=function(){return!this._disabled};Gauge.prototype.setTemplate=function(e){this._gauge.setTemplate(e);if(this._showing)this._requestRedraw()};Gauge.prototype._computeTheme=function(e){if(!e)e={};if(typeof e==="string"){e=this._themes.getTheme(e)}else if(e&&(Object.keys(e).length===0||e.hasUnicode!=null||e.hasColor!=null)){var t=e.hasUnicode==null?o():e.hasUnicode;var r=e.hasColor==null?s:e.hasColor;e=this._themes.getDefault({hasUnicode:t,hasColor:r,platform:e.platform})}return e};Gauge.prototype.setThemeset=function(e){this._themes=e;this.setTheme(this._theme)};Gauge.prototype.setTheme=function(e){this._gauge.setTheme(this._computeTheme(e));if(this._showing)this._requestRedraw();this._theme=e};Gauge.prototype._requestRedraw=function(){this._needsRedraw=true;if(!this._fixedFramerate)this._doRedraw()};Gauge.prototype.getWidth=function(){return(this._tty&&this._tty.columns||80)-1};Gauge.prototype.setWriteTo=function(e,t){var r=!this._disabled;if(r)this.disable();this._writeTo=e;this._tty=t||e===f.stderr&&f.stdout.isTTY&&f.stdout||e.isTTY&&e||this._tty;if(this._gauge)this._gauge.setWidth(this.getWidth());if(r)this.enable()};Gauge.prototype.enable=function(){if(!this._disabled)return;this._disabled=false;if(this._tty)this._enableEvents();if(this._showing)this.show()};Gauge.prototype.disable=function(){if(this._disabled)return;if(this._showing){this._lastUpdateAt=null;this._showing=false;this._doRedraw();this._showing=true}this._disabled=true;if(this._tty)this._disableEvents()};Gauge.prototype._enableEvents=function(){if(this._cleanupOnExit){this._removeOnExit=u(callWith(this,this.disable))}this._tty.on("resize",this._$$handleSizeChange);if(this._fixedFramerate){this.redrawTracker=d(this._$$doRedraw,this._updateInterval);if(this.redrawTracker.unref)this.redrawTracker.unref()}};Gauge.prototype._disableEvents=function(){this._tty.removeListener("resize",this._$$handleSizeChange);if(this._fixedFramerate)clearInterval(this.redrawTracker);if(this._removeOnExit)this._removeOnExit()};Gauge.prototype.hide=function(e){if(this._disabled)return e&&f.nextTick(e);if(!this._showing)return e&&f.nextTick(e);this._showing=false;this._doRedraw();e&&p(e)};Gauge.prototype.show=function(e,t){this._showing=true;if(typeof e==="string"){this._status.section=e}else if(typeof e==="object"){var r=Object.keys(e);for(var a=0;a{"use strict";var a=r(8753);e.exports=function(e){if(a(e)){return false}if(e>=4352&&(e<=4447||9001===e||9002===e||11904<=e&&e<=12871&&e!==12351||12880<=e&&e<=19903||19968<=e&&e<=42182||43360<=e&&e<=43388||44032<=e&&e<=55203||63744<=e&&e<=64255||65040<=e&&e<=65049||65072<=e&&e<=65131||65281<=e&&e<=65376||65504<=e&&e<=65510||110592<=e&&e<=110593||127488<=e&&e<=127569||131072<=e&&e<=262141)){return true}return false}},5511:(e,t,r)=>{"use strict";var a=r(7518);var o=r(6708);var s=r(6062);e.exports=function(e){if(typeof e!=="string"||e.length===0){return 0}var t=0;e=a(e);for(var r=0;r=127&&u<=159){continue}if(u>=65536){r++}if(s(u)){t+=2}else{t++}}return t}},4708:(e,t,r)=>{"use strict";var a=r(6322);var o=r(4293);var s=r(5534);var u=e.exports=function(e,t,r){if(!r)r=80;s("OAN",[e,t,r]);this.showing=false;this.theme=e;this.width=r;this.template=t};u.prototype={};u.prototype.setTheme=function(e){s("O",[e]);this.theme=e};u.prototype.setTemplate=function(e){s("A",[e]);this.template=e};u.prototype.setWidth=function(e){s("N",[e]);this.width=e};u.prototype.hide=function(){return a.gotoSOL()+a.eraseLine()};u.prototype.hideCursor=a.hideCursor;u.prototype.showCursor=a.showCursor;u.prototype.show=function(e){var t=Object.create(this.theme);for(var r in e){t[r]=e[r]}return o(this.width,this.template,t).trim()+a.color("reset")+a.eraseLine()+a.gotoSOL()}},9186:e=>{"use strict";e.exports=process},5791:(e,t,r)=>{"use strict";var a=r(5534);var o=r(4293);var s=r(2343);var u=r(5511);e.exports=function(e,t,r){a("ONN",[e,t,r]);if(r<0)r=0;if(r>1)r=1;if(t<=0)return"";var s=Math.round(t*r);var u=t-s;var c=[{type:"complete",value:repeat(e.complete,s),length:s},{type:"remaining",value:repeat(e.remaining,u),length:u}];return o(t,c,e)};function repeat(e,t){var r="";var a=t;do{if(a%2){r+=e}a=Math.floor(a/2);e+=e}while(a&&u(r){"use strict";var a=r(7568);var o=r(5534);var s=r(1800);var u=r(2343);var c=r(2479);var d=r(5205);function renderValueWithValues(e){return function(t){return renderValue(t,e)}}var f=e.exports=function(e,t,r){var o=prepareItems(e,t,r);var s=o.map(renderValueWithValues(r)).join("");return a.left(u(s,e),e)};function preType(e){var t=e.type[0].toUpperCase()+e.type.slice(1);return"pre"+t}function postType(e){var t=e.type[0].toUpperCase()+e.type.slice(1);return"post"+t}function hasPreOrPost(e,t){if(!e.type)return;return t[preType(e)]||t[postType(e)]}function generatePreAndPost(e,t){var r=s({},e);var a=Object.create(t);var o=[];var u=preType(r);var c=postType(r);if(a[u]){o.push({value:a[u]});a[u]=null}r.minLength=null;r.length=null;r.maxLength=null;o.push(r);a[r.type]=a[r.type];if(a[c]){o.push({value:a[c]});a[c]=null}return function(e,t,r){return f(r,o,a)}}function prepareItems(e,t,r){function cloneAndObjectify(t,a,o){var s=new d(t,e);var u=s.type;if(s.value==null){if(!(u in r)){if(s.default==null){throw new c.MissingTemplateValue(s,r)}else{s.value=s.default}}else{s.value=r[u]}}if(s.value==null||s.value==="")return null;s.index=a;s.first=a===0;s.last=a===o.length-1;if(hasPreOrPost(s,r))s.value=generatePreAndPost(s,r);return s}var a=t.map(cloneAndObjectify).filter((function(e){return e!=null}));var o=0;var s=e;var u=a.length;function consumeSpace(e){if(e>s)e=s;o+=e;s-=e}function finishSizing(e,t){if(e.finished)throw new c.Internal("Tried to finish template item that was already finished");if(t===Infinity)throw new c.Internal("Length of template item cannot be infinity");if(t!=null)e.length=t;e.minLength=null;e.maxLength=null;--u;e.finished=true;if(e.length==null)e.length=e.getBaseLength();if(e.length==null)throw new c.Internal("Finished template items must have a length");consumeSpace(e.getLength())}a.forEach((function(e){if(!e.kerning)return;var t=e.first?0:a[e.index-1].padRight;if(!e.first&&t=h){finishSizing(e,e.minLength);p=true}}))}while(p&&f++{"use strict";var a=r(9186);try{e.exports=setImmediate}catch(t){e.exports=a.nextTick}},75:e=>{"use strict";e.exports=setInterval},1021:e=>{"use strict";e.exports=function spin(e,t){return e[t%e.length]}},5205:(e,t,r)=>{"use strict";var a=r(5511);e.exports=TemplateItem;function isPercent(e){if(typeof e!=="string")return false;return e.slice(-1)==="%"}function percent(e){return Number(e.slice(0,-1))/100}function TemplateItem(e,t){this.overallOutputLength=t;this.finished=false;this.type=null;this.value=null;this.length=null;this.maxLength=null;this.minLength=null;this.kerning=null;this.align="left";this.padLeft=0;this.padRight=0;this.index=null;this.first=null;this.last=null;if(typeof e==="string"){this.value=e}else{for(var r in e)this[r]=e[r]}if(isPercent(this.length)){this.length=Math.round(this.overallOutputLength*percent(this.length))}if(isPercent(this.minLength)){this.minLength=Math.round(this.overallOutputLength*percent(this.minLength))}if(isPercent(this.maxLength)){this.maxLength=Math.round(this.overallOutputLength*percent(this.maxLength))}return this}TemplateItem.prototype={};TemplateItem.prototype.getBaseLength=function(){var e=this.length;if(e==null&&typeof this.value==="string"&&this.maxLength==null&&this.minLength==null){e=a(this.value)}return e};TemplateItem.prototype.getLength=function(){var e=this.getBaseLength();if(e==null)return null;return e+this.padLeft+this.padRight};TemplateItem.prototype.getMaxLength=function(){if(this.maxLength==null)return null;return this.maxLength+this.padLeft+this.padRight};TemplateItem.prototype.getMinLength=function(){if(this.minLength==null)return null;return this.minLength+this.padLeft+this.padRight}},3117:(e,t,r)=>{"use strict";var a=r(1800);e.exports=function(){return o.newThemeSet()};var o={};o.baseTheme=r(1271);o.newTheme=function(e,t){if(!t){t=e;e=this.baseTheme}return a({},e,t)};o.getThemeNames=function(){return Object.keys(this.themes)};o.addTheme=function(e,t,r){this.themes[e]=this.newTheme(t,r)};o.addToAllThemes=function(e){var t=this.themes;Object.keys(t).forEach((function(r){a(t[r],e)}));a(this.baseTheme,e)};o.getTheme=function(e){if(!this.themes[e])throw this.newMissingThemeError(e);return this.themes[e]};o.setDefault=function(e,t){if(t==null){t=e;e={}}var r=e.platform==null?"fallback":e.platform;var a=!!e.hasUnicode;var o=!!e.hasColor;if(!this.defaults[r])this.defaults[r]={true:{},false:{}};this.defaults[r][a][o]=t};o.getDefault=function(e){if(!e)e={};var t=e.platform||process.platform;var r=this.defaults[t]||this.defaults.fallback;var o=!!e.hasUnicode;var s=!!e.hasColor;if(!r)throw this.newMissingDefaultThemeError(t,o,s);if(!r[o][s]){if(o&&s&&r[!o][s]){o=false}else if(o&&s&&r[o][!s]){s=false}else if(o&&s&&r[!o][!s]){o=false;s=false}else if(o&&!s&&r[!o][s]){o=false}else if(!o&&s&&r[o][!s]){s=false}else if(r===this.defaults.fallback){throw this.newMissingDefaultThemeError(t,o,s)}}if(r[o][s]){return this.getTheme(r[o][s])}else{return this.getDefault(a({},e,{platform:"fallback"}))}};o.newMissingThemeError=function newMissingThemeError(e){var t=new Error('Could not find a gauge theme named "'+e+'"');Error.captureStackTrace.call(t,newMissingThemeError);t.theme=e;t.code="EMISSINGTHEME";return t};o.newMissingDefaultThemeError=function newMissingDefaultThemeError(e,t,r){var a=new Error("Could not find a gauge theme for your platform/unicode/color use combo:\n"+" platform = "+e+"\n"+" hasUnicode = "+t+"\n"+" hasColor = "+r);Error.captureStackTrace.call(a,newMissingDefaultThemeError);a.platform=e;a.hasUnicode=t;a.hasColor=r;a.code="EMISSINGTHEME";return a};o.newThemeSet=function(){var themeset=function(e){return themeset.getDefault(e)};return a(themeset,o,{themes:a({},this.themes),baseTheme:a({},this.baseTheme),defaults:JSON.parse(JSON.stringify(this.defaults||{}))})}},7987:(e,t,r)=>{"use strict";var a=r(6322);var o=r(3117);var s=e.exports=new o;s.addTheme("ASCII",{preProgressbar:"[",postProgressbar:"]",progressbarTheme:{complete:"#",remaining:"."},activityIndicatorTheme:"-\\|/",preSubsection:">"});s.addTheme("colorASCII",s.getTheme("ASCII"),{progressbarTheme:{preComplete:a.color("inverse"),complete:" ",postComplete:a.color("stopInverse"),preRemaining:a.color("brightBlack"),remaining:".",postRemaining:a.color("reset")}});s.addTheme("brailleSpinner",{preProgressbar:"⸨",postProgressbar:"⸩",progressbarTheme:{complete:"░",remaining:"⠂"},activityIndicatorTheme:"⠋⠙⠹⠸⠼⠴⠦⠧⠇⠏",preSubsection:">"});s.addTheme("colorBrailleSpinner",s.getTheme("brailleSpinner"),{progressbarTheme:{preComplete:a.color("inverse"),complete:" ",postComplete:a.color("stopInverse"),preRemaining:a.color("brightBlack"),remaining:"░",postRemaining:a.color("reset")}});s.setDefault({},"ASCII");s.setDefault({hasColor:true},"colorASCII");s.setDefault({platform:"darwin",hasUnicode:true},"brailleSpinner");s.setDefault({platform:"darwin",hasUnicode:true,hasColor:true},"colorBrailleSpinner")},2343:(e,t,r)=>{"use strict";var a=r(5511);var o=r(7518);e.exports=wideTruncate;function wideTruncate(e,t){if(a(e)===0)return e;if(t<=0)return"";if(a(e)<=t)return e;var r=o(e);var s=e.length+r.length;var u=e.slice(0,t+s);while(a(u)>t){u=u.slice(0,-1)}return u}},9132:e=>{"use strict";e.exports=clone;var t=Object.getPrototypeOf||function(e){return e.__proto__};function clone(e){if(e===null||typeof e!=="object")return e;if(e instanceof Object)var r={__proto__:t(e)};else var r=Object.create(null);Object.getOwnPropertyNames(e).forEach((function(t){Object.defineProperty(r,t,Object.getOwnPropertyDescriptor(e,t))}));return r}},552:(e,t,r)=>{var a=r(7147);var o=r(1290);var s=r(4410);var u=r(9132);var c=r(3837);var d;var f;if(typeof Symbol==="function"&&typeof Symbol.for==="function"){d=Symbol.for("graceful-fs.queue");f=Symbol.for("graceful-fs.previous")}else{d="___graceful-fs.queue";f="___graceful-fs.previous"}function noop(){}function publishQueue(e,t){Object.defineProperty(e,d,{get:function(){return t}})}var p=noop;if(c.debuglog)p=c.debuglog("gfs4");else if(/\bgfs4\b/i.test(process.env.NODE_DEBUG||""))p=function(){var e=c.format.apply(c,arguments);e="GFS4: "+e.split(/\n/).join("\nGFS4: ");console.error(e)};if(!a[d]){var h=global[d]||[];publishQueue(a,h);a.close=function(e){function close(t,r){return e.call(a,t,(function(e){if(!e){resetQueue()}if(typeof r==="function")r.apply(this,arguments)}))}Object.defineProperty(close,f,{value:e});return close}(a.close);a.closeSync=function(e){function closeSync(t){e.apply(a,arguments);resetQueue()}Object.defineProperty(closeSync,f,{value:e});return closeSync}(a.closeSync);if(/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")){process.on("exit",(function(){p(a[d]);r(9491).equal(a[d].length,0)}))}}if(!global[d]){publishQueue(global,a[d])}e.exports=patch(u(a));if(process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!a.__patched){e.exports=patch(a);a.__patched=true}function patch(e){o(e);e.gracefulify=patch;e.createReadStream=createReadStream;e.createWriteStream=createWriteStream;var t=e.readFile;e.readFile=readFile;function readFile(e,r,a){if(typeof r==="function")a=r,r=null;return go$readFile(e,r,a);function go$readFile(e,r,a,o){return t(e,r,(function(t){if(t&&(t.code==="EMFILE"||t.code==="ENFILE"))enqueue([go$readFile,[e,r,a],t,o||Date.now(),Date.now()]);else{if(typeof a==="function")a.apply(this,arguments)}}))}}var r=e.writeFile;e.writeFile=writeFile;function writeFile(e,t,a,o){if(typeof a==="function")o=a,a=null;return go$writeFile(e,t,a,o);function go$writeFile(e,t,a,o,s){return r(e,t,a,(function(r){if(r&&(r.code==="EMFILE"||r.code==="ENFILE"))enqueue([go$writeFile,[e,t,a,o],r,s||Date.now(),Date.now()]);else{if(typeof o==="function")o.apply(this,arguments)}}))}}var a=e.appendFile;if(a)e.appendFile=appendFile;function appendFile(e,t,r,o){if(typeof r==="function")o=r,r=null;return go$appendFile(e,t,r,o);function go$appendFile(e,t,r,o,s){return a(e,t,r,(function(a){if(a&&(a.code==="EMFILE"||a.code==="ENFILE"))enqueue([go$appendFile,[e,t,r,o],a,s||Date.now(),Date.now()]);else{if(typeof o==="function")o.apply(this,arguments)}}))}}var u=e.copyFile;if(u)e.copyFile=copyFile;function copyFile(e,t,r,a){if(typeof r==="function"){a=r;r=0}return go$copyFile(e,t,r,a);function go$copyFile(e,t,r,a,o){return u(e,t,r,(function(s){if(s&&(s.code==="EMFILE"||s.code==="ENFILE"))enqueue([go$copyFile,[e,t,r,a],s,o||Date.now(),Date.now()]);else{if(typeof a==="function")a.apply(this,arguments)}}))}}var c=e.readdir;e.readdir=readdir;function readdir(e,t,r){if(typeof t==="function")r=t,t=null;return go$readdir(e,t,r);function go$readdir(e,t,r,a){return c(e,t,(function(o,s){if(o&&(o.code==="EMFILE"||o.code==="ENFILE"))enqueue([go$readdir,[e,t,r],o,a||Date.now(),Date.now()]);else{if(s&&s.sort)s.sort();if(typeof r==="function")r.call(this,o,s)}}))}}if(process.version.substr(0,4)==="v0.8"){var d=s(e);ReadStream=d.ReadStream;WriteStream=d.WriteStream}var f=e.ReadStream;if(f){ReadStream.prototype=Object.create(f.prototype);ReadStream.prototype.open=ReadStream$open}var p=e.WriteStream;if(p){WriteStream.prototype=Object.create(p.prototype);WriteStream.prototype.open=WriteStream$open}Object.defineProperty(e,"ReadStream",{get:function(){return ReadStream},set:function(e){ReadStream=e},enumerable:true,configurable:true});Object.defineProperty(e,"WriteStream",{get:function(){return WriteStream},set:function(e){WriteStream=e},enumerable:true,configurable:true});var h=ReadStream;Object.defineProperty(e,"FileReadStream",{get:function(){return h},set:function(e){h=e},enumerable:true,configurable:true});var v=WriteStream;Object.defineProperty(e,"FileWriteStream",{get:function(){return v},set:function(e){v=e},enumerable:true,configurable:true});function ReadStream(e,t){if(this instanceof ReadStream)return f.apply(this,arguments),this;else return ReadStream.apply(Object.create(ReadStream.prototype),arguments)}function ReadStream$open(){var e=this;open(e.path,e.flags,e.mode,(function(t,r){if(t){if(e.autoClose)e.destroy();e.emit("error",t)}else{e.fd=r;e.emit("open",r);e.read()}}))}function WriteStream(e,t){if(this instanceof WriteStream)return p.apply(this,arguments),this;else return WriteStream.apply(Object.create(WriteStream.prototype),arguments)}function WriteStream$open(){var e=this;open(e.path,e.flags,e.mode,(function(t,r){if(t){e.destroy();e.emit("error",t)}else{e.fd=r;e.emit("open",r)}}))}function createReadStream(t,r){return new e.ReadStream(t,r)}function createWriteStream(t,r){return new e.WriteStream(t,r)}var _=e.open;e.open=open;function open(e,t,r,a){if(typeof r==="function")a=r,r=null;return go$open(e,t,r,a);function go$open(e,t,r,a,o){return _(e,t,r,(function(s,u){if(s&&(s.code==="EMFILE"||s.code==="ENFILE"))enqueue([go$open,[e,t,r,a],s,o||Date.now(),Date.now()]);else{if(typeof a==="function")a.apply(this,arguments)}}))}}return e}function enqueue(e){p("ENQUEUE",e[0].name,e[1]);a[d].push(e);retry()}var v;function resetQueue(){var e=Date.now();for(var t=0;t2){a[d][t][3]=e;a[d][t][4]=e}}retry()}function retry(){clearTimeout(v);v=undefined;if(a[d].length===0)return;var e=a[d].shift();var t=e[0];var r=e[1];var o=e[2];var s=e[3];var u=e[4];if(s===undefined){p("RETRY",t.name,r);t.apply(null,r)}else if(Date.now()-s>=6e4){p("TIMEOUT",t.name,r);var c=r.pop();if(typeof c==="function")c.call(null,o)}else{var f=Date.now()-u;var h=Math.max(u-s,1);var _=Math.min(h*1.2,100);if(f>=_){p("RETRY",t.name,r);t.apply(null,r.concat([s]))}else{a[d].push(e)}}if(v===undefined){v=setTimeout(retry,0)}}},4410:(e,t,r)=>{var a=r(2781).Stream;e.exports=legacy;function legacy(e){return{ReadStream:ReadStream,WriteStream:WriteStream};function ReadStream(t,r){if(!(this instanceof ReadStream))return new ReadStream(t,r);a.call(this);var o=this;this.path=t;this.fd=null;this.readable=true;this.paused=false;this.flags="r";this.mode=438;this.bufferSize=64*1024;r=r||{};var s=Object.keys(r);for(var u=0,c=s.length;uthis.end){throw new Error("start must be <= end")}this.pos=this.start}if(this.fd!==null){process.nextTick((function(){o._read()}));return}e.open(this.path,this.flags,this.mode,(function(e,t){if(e){o.emit("error",e);o.readable=false;return}o.fd=t;o.emit("open",t);o._read()}))}function WriteStream(t,r){if(!(this instanceof WriteStream))return new WriteStream(t,r);a.call(this);this.path=t;this.fd=null;this.writable=true;this.flags="w";this.encoding="binary";this.mode=438;this.bytesWritten=0;r=r||{};var o=Object.keys(r);for(var s=0,u=o.length;s= zero")}this.pos=this.start}this.busy=false;this._queue=[];if(this.fd===null){this._open=e.open;this._queue.push([this._open,this.path,this.flags,this.mode,undefined]);this.flush()}}}},1290:(e,t,r)=>{var a=r(2057);var o=process.cwd;var s=null;var u=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){if(!s)s=o.call(process);return s};try{process.cwd()}catch(e){}if(typeof process.chdir==="function"){var c=process.chdir;process.chdir=function(e){s=null;c.call(process,e)};if(Object.setPrototypeOf)Object.setPrototypeOf(process.chdir,c)}e.exports=patch;function patch(e){if(a.hasOwnProperty("O_SYMLINK")&&process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)){patchLchmod(e)}if(!e.lutimes){patchLutimes(e)}e.chown=chownFix(e.chown);e.fchown=chownFix(e.fchown);e.lchown=chownFix(e.lchown);e.chmod=chmodFix(e.chmod);e.fchmod=chmodFix(e.fchmod);e.lchmod=chmodFix(e.lchmod);e.chownSync=chownFixSync(e.chownSync);e.fchownSync=chownFixSync(e.fchownSync);e.lchownSync=chownFixSync(e.lchownSync);e.chmodSync=chmodFixSync(e.chmodSync);e.fchmodSync=chmodFixSync(e.fchmodSync);e.lchmodSync=chmodFixSync(e.lchmodSync);e.stat=statFix(e.stat);e.fstat=statFix(e.fstat);e.lstat=statFix(e.lstat);e.statSync=statFixSync(e.statSync);e.fstatSync=statFixSync(e.fstatSync);e.lstatSync=statFixSync(e.lstatSync);if(!e.lchmod){e.lchmod=function(e,t,r){if(r)process.nextTick(r)};e.lchmodSync=function(){}}if(!e.lchown){e.lchown=function(e,t,r,a){if(a)process.nextTick(a)};e.lchownSync=function(){}}if(u==="win32"){e.rename=function(t){return function(r,a,o){var s=Date.now();var u=0;t(r,a,(function CB(c){if(c&&(c.code==="EACCES"||c.code==="EPERM")&&Date.now()-s<6e4){setTimeout((function(){e.stat(a,(function(e,s){if(e&&e.code==="ENOENT")t(r,a,CB);else o(c)}))}),u);if(u<100)u+=10;return}if(o)o(c)}))}}(e.rename)}e.read=function(t){function read(r,a,o,s,u,c){var d;if(c&&typeof c==="function"){var f=0;d=function(p,h,v){if(p&&p.code==="EAGAIN"&&f<10){f++;return t.call(e,r,a,o,s,u,d)}c.apply(this,arguments)}}return t.call(e,r,a,o,s,u,d)}if(Object.setPrototypeOf)Object.setPrototypeOf(read,t);return read}(e.read);e.readSync=function(t){return function(r,a,o,s,u){var c=0;while(true){try{return t.call(e,r,a,o,s,u)}catch(e){if(e.code==="EAGAIN"&&c<10){c++;continue}throw e}}}}(e.readSync);function patchLchmod(e){e.lchmod=function(t,r,o){e.open(t,a.O_WRONLY|a.O_SYMLINK,r,(function(t,a){if(t){if(o)o(t);return}e.fchmod(a,r,(function(t){e.close(a,(function(e){if(o)o(t||e)}))}))}))};e.lchmodSync=function(t,r){var o=e.openSync(t,a.O_WRONLY|a.O_SYMLINK,r);var s=true;var u;try{u=e.fchmodSync(o,r);s=false}finally{if(s){try{e.closeSync(o)}catch(e){}}else{e.closeSync(o)}}return u}}function patchLutimes(e){if(a.hasOwnProperty("O_SYMLINK")){e.lutimes=function(t,r,o,s){e.open(t,a.O_SYMLINK,(function(t,a){if(t){if(s)s(t);return}e.futimes(a,r,o,(function(t){e.close(a,(function(e){if(s)s(t||e)}))}))}))};e.lutimesSync=function(t,r,o){var s=e.openSync(t,a.O_SYMLINK);var u;var c=true;try{u=e.futimesSync(s,r,o);c=false}finally{if(c){try{e.closeSync(s)}catch(e){}}else{e.closeSync(s)}}return u}}else{e.lutimes=function(e,t,r,a){if(a)process.nextTick(a)};e.lutimesSync=function(){}}}function chmodFix(t){if(!t)return t;return function(r,a,o){return t.call(e,r,a,(function(e){if(chownErOk(e))e=null;if(o)o.apply(this,arguments)}))}}function chmodFixSync(t){if(!t)return t;return function(r,a){try{return t.call(e,r,a)}catch(e){if(!chownErOk(e))throw e}}}function chownFix(t){if(!t)return t;return function(r,a,o,s){return t.call(e,r,a,o,(function(e){if(chownErOk(e))e=null;if(s)s.apply(this,arguments)}))}}function chownFixSync(t){if(!t)return t;return function(r,a,o){try{return t.call(e,r,a,o)}catch(e){if(!chownErOk(e))throw e}}}function statFix(t){if(!t)return t;return function(r,a,o){if(typeof a==="function"){o=a;a=null}function callback(e,t){if(t){if(t.uid<0)t.uid+=4294967296;if(t.gid<0)t.gid+=4294967296}if(o)o.apply(this,arguments)}return a?t.call(e,r,a,callback):t.call(e,r,callback)}}function statFixSync(t){if(!t)return t;return function(r,a){var o=a?t.call(e,r,a):t.call(e,r);if(o){if(o.uid<0)o.uid+=4294967296;if(o.gid<0)o.gid+=4294967296}return o}}function chownErOk(e){if(!e)return true;if(e.code==="ENOSYS")return true;var t=!process.getuid||process.getuid()!==0;if(t){if(e.code==="EINVAL"||e.code==="EPERM")return true}return false}}},7963:(e,t,r)=>{"use strict";var a=r(2037);var o=e.exports=function(){if(a.type()=="Windows_NT"){return false}var e=/UTF-?8$/i;var t=process.env.LC_ALL||process.env.LC_CTYPE||process.env.LANG;return e.test(t)}},6919:(e,t,r)=>{try{var a=r(3837);if(typeof a.inherits!=="function")throw"";e.exports=a.inherits}catch(t){e.exports=r(7526)}},7526:e=>{if(typeof Object.create==="function"){e.exports=function inherits(e,t){if(t){e.super_=t;e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}})}}}else{e.exports=function inherits(e,t){if(t){e.super_=t;var TempCtor=function(){};TempCtor.prototype=t.prototype;e.prototype=new TempCtor;e.prototype.constructor=e}}}},9842:e=>{var t={}.toString;e.exports=Array.isArray||function(e){return t.call(e)=="[object Array]"}},9248:(e,t,r)=>{"use strict";var a=r(7147);var o=r(3632);var s=r(9658);e.exports=t;var u=process.version.substr(1).replace(/-.*$/,"").split(".").map((function(e){return+e}));var c=["build","clean","configure","package","publish","reveal","testbinary","testpackage","unpublish"];var d="napi_build_version=";e.exports.get_napi_version=function(e){var t=process.versions.napi;if(!t){if(u[0]===9&&u[1]>=3)t=2;else if(u[0]===8)t=1}return t};e.exports.get_napi_version_as_string=function(t){var r=e.exports.get_napi_version(t);return r?""+r:""};e.exports.validate_package_json=function(t,r){var a=t.binary;var o=pathOK(a.module_path);var s=pathOK(a.remote_path);var u=pathOK(a.package_name);var c=e.exports.get_napi_build_versions(t,r,true);var d=e.exports.get_napi_build_versions_raw(t);if(c){c.forEach((function(e){if(!(parseInt(e,10)===e&&e>0)){throw new Error("All values specified in napi_versions must be positive integers.")}}))}if(c&&(!o||!s&&!u)){throw new Error("When napi_versions is specified; module_path and either remote_path or "+"package_name must contain the substitution string '{napi_build_version}`.")}if((o||s||u)&&!d){throw new Error("When the substitution string '{napi_build_version}` is specified in "+"module_path, remote_path, or package_name; napi_versions must also be specified.")}if(c&&!e.exports.get_best_napi_build_version(t,r)&&e.exports.build_napi_only(t)){throw new Error("The N-API version of this Node instance is "+e.exports.get_napi_version(r?r.target:undefined)+". "+"This module supports N-API version(s) "+e.exports.get_napi_build_versions_raw(t)+". "+"This Node instance cannot run this module.")}if(d&&!c&&e.exports.build_napi_only(t)){throw new Error("The N-API version of this Node instance is "+e.exports.get_napi_version(r?r.target:undefined)+". "+"This module supports N-API version(s) "+e.exports.get_napi_build_versions_raw(t)+". "+"This Node instance cannot run this module.")}};function pathOK(e){return e&&(e.indexOf("{napi_build_version}")!==-1||e.indexOf("{node_napi_label}")!==-1)}e.exports.expand_commands=function(t,r,a){var o=[];var s=e.exports.get_napi_build_versions(t,r);a.forEach((function(a){if(s&&a.name==="install"){var u=e.exports.get_best_napi_build_version(t,r);var f=u?[d+u]:[];o.push({name:a.name,args:f})}else if(s&&c.indexOf(a.name)!==-1){s.forEach((function(e){var t=a.args.slice();t.push(d+e);o.push({name:a.name,args:t})}))}else{o.push(a)}}));return o};e.exports.get_napi_build_versions=function(t,r,a){var o=[];var u=e.exports.get_napi_version(r?r.target:undefined);if(t.binary&&t.binary.napi_versions){t.binary.napi_versions.forEach((function(e){var t=o.indexOf(e)!==-1;if(!t&&u&&e<=u){o.push(e)}else if(a&&!t&&u){s.info("This Node instance does not support builds for N-API version",e)}}))}if(r&&r["build-latest-napi-version-only"]){var c=0;o.forEach((function(e){if(e>c)c=e}));o=c?[c]:[]}return o.length?o:undefined};e.exports.get_napi_build_versions_raw=function(e){var t=[];if(e.binary&&e.binary.napi_versions){e.binary.napi_versions.forEach((function(e){if(t.indexOf(e)===-1){t.push(e)}}))}return t.length?t:undefined};e.exports.get_command_arg=function(e){return d+e};e.exports.get_napi_build_version_from_command_args=function(e){for(var t=0;ta&&e<=s){a=e}}))}return a===0?undefined:a};e.exports.build_napi_only=function(e){return e.binary&&e.binary.package_name&&e.binary.package_name.indexOf("{node_napi_label}")===-1}},5574:(e,t,r)=>{"use strict";e.exports=t;var a=r(1017);var o=r(7849);var s=r(7310);var u=r(2157);var c=r(9248);var d;if(process.env.NODE_PRE_GYP_ABI_CROSSWALK){d=require(process.env.NODE_PRE_GYP_ABI_CROSSWALK)}else{d=r(7316)}var f={};Object.keys(d).forEach((function(e){var t=e.split(".")[0];if(!f[t]){f[t]=e}}));function get_electron_abi(e,t){if(!e){throw new Error("get_electron_abi requires valid runtime arg")}if(typeof t==="undefined"){throw new Error("Empty target version is not supported if electron is the target.")}var r=o.parse(t);return e+"-v"+r.major+"."+r.minor}e.exports.get_electron_abi=get_electron_abi;function get_node_webkit_abi(e,t){if(!e){throw new Error("get_node_webkit_abi requires valid runtime arg")}if(typeof t==="undefined"){throw new Error("Empty target version is not supported if node-webkit is the target.")}return e+"-v"+t}e.exports.get_node_webkit_abi=get_node_webkit_abi;function get_node_abi(e,t){if(!e){throw new Error("get_node_abi requires valid runtime arg")}if(!t){throw new Error("get_node_abi requires valid process.versions object")}var r=o.parse(t.node);if(r.major===0&&r.minor%2){return e+"-v"+t.node}else{return t.modules?e+"-v"+ +t.modules:"v8-"+t.v8.split(".").slice(0,2).join(".")}}e.exports.get_node_abi=get_node_abi;function get_runtime_abi(e,t){if(!e){throw new Error("get_runtime_abi requires valid runtime arg")}if(e==="node-webkit"){return get_node_webkit_abi(e,t||process.versions["node-webkit"])}else if(e==="electron"){return get_electron_abi(e,t||process.versions.electron)}else{if(e!="node"){throw new Error("Unknown Runtime: '"+e+"'")}if(!t){return get_node_abi(e,process.versions)}else{var r;if(d[t]){r=d[t]}else{var a=t.split(".").map((function(e){return+e}));if(a.length!=3){throw new Error("Unknown target version: "+t)}var o=a[0];var s=a[1];var u=a[2];if(o===1){while(true){if(s>0)--s;if(u>0)--u;var c=""+o+"."+s+"."+u;if(d[c]){r=d[c];console.log("Warning: node-pre-gyp could not find exact match for "+t);console.log("Warning: but node-pre-gyp successfully choose "+c+" as ABI compatible target");break}if(s===0&&u===0){break}}}else if(o>=2){if(f[o]){r=d[f[o]];console.log("Warning: node-pre-gyp could not find exact match for "+t);console.log("Warning: but node-pre-gyp successfully choose "+f[o]+" as ABI compatible target")}}else if(o===0){if(a[1]%2===0){while(--u>0){var p=""+o+"."+s+"."+u;if(d[p]){r=d[p];console.log("Warning: node-pre-gyp could not find exact match for "+t);console.log("Warning: but node-pre-gyp successfully choose "+p+" as ABI compatible target");break}}}}}if(!r){throw new Error("Unsupported target version: "+t)}var h={node:t,v8:r.v8+".0",modules:r.node_abi>1?r.node_abi:undefined};return get_node_abi(e,h)}}}e.exports.get_runtime_abi=get_runtime_abi;var p=["module_name","module_path","host"];function validate_config(e,t){var r=e.name+" package.json is not node-pre-gyp ready:\n";var a=[];if(!e.main){a.push("main")}if(!e.version){a.push("version")}if(!e.name){a.push("name")}if(!e.binary){a.push("binary")}var o=e.binary;p.forEach((function(e){if(a.indexOf("binary")>-1){a.pop("binary")}if(!o||o[e]===undefined||o[e]===""){a.push("binary."+e)}}));if(a.length>=1){throw new Error(r+"package.json must declare these properties: \n"+a.join("\n"))}if(o){var u=s.parse(o.host).protocol;if(u==="http:"){throw new Error("'host' protocol ("+u+") is invalid - only 'https:' is accepted")}}c.validate_package_json(e,t)}e.exports.validate_config=validate_config;function eval_template(e,t){Object.keys(t).forEach((function(r){var a="{"+r+"}";while(e.indexOf(a)>-1){e=e.replace(a,t[r])}}));return e}function fix_slashes(e){if(e.slice(-1)!="/"){return e+"/"}return e}function drop_double_slashes(e){return e.replace(/\/\//g,"/")}function get_process_runtime(e){var t="node";if(e["node-webkit"]){t="node-webkit"}else if(e.electron){t="electron"}return t}e.exports.get_process_runtime=get_process_runtime;var h="{module_name}-v{version}-{node_abi}-{platform}-{arch}.tar.gz";var v="";e.exports.evaluate=function(e,t,r){t=t||{};validate_config(e,t);var d=e.version;var f=o.parse(d);var p=t.runtime||get_process_runtime(process.versions);var _={name:e.name,configuration:Boolean(t.debug)?"Debug":"Release",debug:t.debug,module_name:e.binary.module_name,version:f.version,prerelease:f.prerelease.length?f.prerelease.join("."):"",build:f.build.length?f.build.join("."):"",major:f.major,minor:f.minor,patch:f.patch,runtime:p,node_abi:get_runtime_abi(p,t.target),node_abi_napi:c.get_napi_version(t.target)?"napi":get_runtime_abi(p,t.target),napi_version:c.get_napi_version(t.target),napi_build_version:r||"",node_napi_label:r?"napi-v"+r:get_runtime_abi(p,t.target),target:t.target||"",platform:t.target_platform||process.platform,target_platform:t.target_platform||process.platform,arch:t.target_arch||process.arch,target_arch:t.target_arch||process.arch,libc:t.target_libc||u.family||"unknown",module_main:e.main,toolset:t.toolset||""};var g=process.env["npm_config_"+_.module_name+"_binary_host_mirror"]||e.binary.host;_.host=fix_slashes(eval_template(g,_));_.module_path=eval_template(e.binary.module_path,_);if(t.module_root){_.module_path=a.join(t.module_root,_.module_path)}else{_.module_path=a.resolve(_.module_path)}_.module=a.join(_.module_path,_.module_name+".node");_.remote_path=e.binary.remote_path?drop_double_slashes(fix_slashes(eval_template(e.binary.remote_path,_))):v;var y=e.binary.package_name?e.binary.package_name:h;_.package_name=eval_template(y,_);_.staged_tarball=a.join("build/stage",_.remote_path,_.package_name);_.hosted_path=s.resolve(_.host,_.remote_path);_.hosted_tarball=s.resolve(_.hosted_path,_.package_name);return _}},3632:(e,t,r)=>{e.exports=rimraf;rimraf.sync=rimrafSync;var a=r(9491);var o=r(1017);var s=r(7147);var u=undefined;try{u=r(3535)}catch(e){}var c=parseInt("666",8);var d={nosort:true,silent:true};var f=0;var p=process.platform==="win32";function defaults(e){var t=["unlink","chmod","stat","lstat","rmdir","readdir"];t.forEach((function(t){e[t]=e[t]||s[t];t=t+"Sync";e[t]=e[t]||s[t]}));e.maxBusyTries=e.maxBusyTries||3;e.emfileWait=e.emfileWait||1e3;if(e.glob===false){e.disableGlob=true}if(e.disableGlob!==true&&u===undefined){throw Error("glob dependency not found, set `options.disableGlob = true` if intentional")}e.disableGlob=e.disableGlob||false;e.glob=e.glob||d}function rimraf(e,t,r){if(typeof t==="function"){r=t;t={}}a(e,"rimraf: missing path");a.equal(typeof e,"string","rimraf: path should be a string");a.equal(typeof r,"function","rimraf: callback function required");a(t,"rimraf: invalid options argument provided");a.equal(typeof t,"object","rimraf: options should be object");defaults(t);var o=0;var s=null;var c=0;if(t.disableGlob||!u.hasMagic(e))return afterGlob(null,[e]);t.lstat(e,(function(r,a){if(!r)return afterGlob(null,[e]);u(e,t.glob,afterGlob)}));function next(e){s=s||e;if(--c===0)r(s)}function afterGlob(e,a){if(e)return r(e);c=a.length;if(c===0)return r();a.forEach((function(e){rimraf_(e,t,(function CB(r){if(r){if((r.code==="EBUSY"||r.code==="ENOTEMPTY"||r.code==="EPERM")&&o{"use strict";var a=r(2717);var o=r(6054);var s=r(2361).EventEmitter;var u=t=e.exports=new s;var c=r(3837);var d=r(8834);var f=r(6322);d(true);var p=process.stderr;Object.defineProperty(u,"stream",{set:function(e){p=e;if(this.gauge)this.gauge.setWriteTo(p,p)},get:function(){return p}});var h;u.useColor=function(){return h!=null?h:p.isTTY};u.enableColor=function(){h=true;this.gauge.setTheme({hasColor:h,hasUnicode:v})};u.disableColor=function(){h=false;this.gauge.setTheme({hasColor:h,hasUnicode:v})};u.level="info";u.gauge=new o(p,{enabled:false,theme:{hasColor:u.useColor()},template:[{type:"progressbar",length:20},{type:"activityIndicator",kerning:1,length:1},{type:"section",default:""},":",{type:"logline",kerning:1,default:""}]});u.tracker=new a.TrackerGroup;u.progressEnabled=u.gauge.isEnabled();var v;u.enableUnicode=function(){v=true;this.gauge.setTheme({hasColor:this.useColor(),hasUnicode:v})};u.disableUnicode=function(){v=false;this.gauge.setTheme({hasColor:this.useColor(),hasUnicode:v})};u.setGaugeThemeset=function(e){this.gauge.setThemeset(e)};u.setGaugeTemplate=function(e){this.gauge.setTemplate(e)};u.enableProgress=function(){if(this.progressEnabled)return;this.progressEnabled=true;this.tracker.on("change",this.showProgress);if(this._pause)return;this.gauge.enable()};u.disableProgress=function(){if(!this.progressEnabled)return;this.progressEnabled=false;this.tracker.removeListener("change",this.showProgress);this.gauge.disable()};var _=["newGroup","newItem","newStream"];var mixinLog=function(e){Object.keys(u).forEach((function(t){if(t[0]==="_")return;if(_.filter((function(e){return e===t})).length)return;if(e[t])return;if(typeof u[t]!=="function")return;var r=u[t];e[t]=function(){return r.apply(u,arguments)}}));if(e instanceof a.TrackerGroup){_.forEach((function(t){var r=e[t];e[t]=function(){return mixinLog(r.apply(e,arguments))}}))}return e};_.forEach((function(e){u[e]=function(){return mixinLog(this.tracker[e].apply(this.tracker,arguments))}}));u.clearProgress=function(e){if(!this.progressEnabled)return e&&process.nextTick(e);this.gauge.hide(e)};u.showProgress=function(e,t){if(!this.progressEnabled)return;var r={};if(e)r.section=e;var a=u.record[u.record.length-1];if(a){r.subsection=a.prefix;var o=u.disp[a.level]||a.level;var s=this._format(o,u.style[a.level]);if(a.prefix)s+=" "+this._format(a.prefix,this.prefixStyle);s+=" "+a.message.split(/\r?\n/)[0];r.logline=s}r.completed=t||this.tracker.completed();this.gauge.show(r)}.bind(u);u.pause=function(){this._paused=true;if(this.progressEnabled)this.gauge.disable()};u.resume=function(){if(!this._paused)return;this._paused=false;var e=this._buffer;this._buffer=[];e.forEach((function(e){this.emitLog(e)}),this);if(this.progressEnabled)this.gauge.enable()};u._buffer=[];var g=0;u.record=[];u.maxRecordSize=1e4;u.log=function(e,t,r){var a=this.levels[e];if(a===undefined){return this.emit("error",new Error(c.format("Undefined log level: %j",e)))}var o=new Array(arguments.length-2);var s=null;for(var u=2;up/10){var v=Math.floor(p*.9);this.record=this.record.slice(-1*v)}this.emitLog(f)}.bind(u);u.emitLog=function(e){if(this._paused){this._buffer.push(e);return}if(this.progressEnabled)this.gauge.pulse(e.prefix);var t=this.levels[e.level];if(t===undefined)return;if(t0&&!isFinite(t))return;var r=u.disp[e.level]!=null?u.disp[e.level]:e.level;this.clearProgress();e.message.split(/\r?\n/).forEach((function(t){if(this.heading){this.write(this.heading,this.headingStyle);this.write(" ")}this.write(r,u.style[e.level]);var a=e.prefix||"";if(a)this.write(" ");this.write(a,this.prefixStyle);this.write(" "+t+"\n")}),this);this.showProgress()};u._format=function(e,t){if(!p)return;var r="";if(this.useColor()){t=t||{};var a=[];if(t.fg)a.push(t.fg);if(t.bg)a.push("bg"+t.bg[0].toUpperCase()+t.bg.slice(1));if(t.bold)a.push("bold");if(t.underline)a.push("underline");if(t.inverse)a.push("inverse");if(a.length)r+=f.color(a);if(t.beep)r+=f.beep()}r+=e;if(this.useColor()){r+=f.color("reset")}return r};u.write=function(e,t){if(!p)return;p.write(this._format(e,t))};u.addLevel=function(e,t,r,a){if(a==null)a=e;this.levels[e]=t;this.style[e]=r;if(!this[e]){this[e]=function(){var t=new Array(arguments.length+1);t[0]=e;for(var r=0;r{"use strict";e.exports=Number.isNaN||function(e){return e!==e}},1800:e=>{"use strict"; /* object-assign (c) Sindre Sorhus diff --git a/packages/next/compiled/crypto-browserify/index.js b/packages/next/compiled/crypto-browserify/index.js index a8d83afcae01..caa80e48b428 100644 --- a/packages/next/compiled/crypto-browserify/index.js +++ b/packages/next/compiled/crypto-browserify/index.js @@ -1 +1 @@ -(function(){var e={8557:function(e,t,r){var i=t;i.bignum=r(6884);i.define=r(9636).define;i.base=r(2207);i.constants=r(3503);i.decoders=r(5133);i.encoders=r(9245)},9636:function(e,t,r){var i=r(8557);var n=r(7526);var a=t;a.define=function define(e,t){return new Entity(e,t)};function Entity(e,t){this.name=e;this.body=t;this.decoders={};this.encoders={}}Entity.prototype._createNamed=function createNamed(e){var t;try{t=r(6144).runInThisContext("(function "+this.name+"(entity) {\n"+" this._initNamed(entity);\n"+"})")}catch(e){t=function(e){this._initNamed(e)}}n(t,e);t.prototype._initNamed=function initnamed(t){e.call(this,t)};return new t(this)};Entity.prototype._getDecoder=function _getDecoder(e){e=e||"der";if(!this.decoders.hasOwnProperty(e))this.decoders[e]=this._createNamed(i.decoders[e]);return this.decoders[e]};Entity.prototype.decode=function decode(e,t,r){return this._getDecoder(t).decode(e,r)};Entity.prototype._getEncoder=function _getEncoder(e){e=e||"der";if(!this.encoders.hasOwnProperty(e))this.encoders[e]=this._createNamed(i.encoders[e]);return this.encoders[e]};Entity.prototype.encode=function encode(e,t,r){return this._getEncoder(t).encode(e,r)}},8483:function(e,t,r){var i=r(7526);var n=r(2207).Reporter;var a=r(4300).Buffer;function DecoderBuffer(e,t){n.call(this,t);if(!a.isBuffer(e)){this.error("Input not Buffer");return}this.base=e;this.offset=0;this.length=e.length}i(DecoderBuffer,n);t.C=DecoderBuffer;DecoderBuffer.prototype.save=function save(){return{offset:this.offset,reporter:n.prototype.save.call(this)}};DecoderBuffer.prototype.restore=function restore(e){var t=new DecoderBuffer(this.base);t.offset=e.offset;t.length=this.offset;this.offset=e.offset;n.prototype.restore.call(this,e.reporter);return t};DecoderBuffer.prototype.isEmpty=function isEmpty(){return this.offset===this.length};DecoderBuffer.prototype.readUInt8=function readUInt8(e){if(this.offset+1<=this.length)return this.base.readUInt8(this.offset++,true);else return this.error(e||"DecoderBuffer overrun")};DecoderBuffer.prototype.skip=function skip(e,t){if(!(this.offset+e<=this.length))return this.error(t||"DecoderBuffer overrun");var r=new DecoderBuffer(this.base);r._reporterState=this._reporterState;r.offset=this.offset;r.length=this.offset+e;this.offset+=e;return r};DecoderBuffer.prototype.raw=function raw(e){return this.base.slice(e?e.offset:this.offset,this.length)};function EncoderBuffer(e,t){if(Array.isArray(e)){this.length=0;this.value=e.map((function(e){if(!(e instanceof EncoderBuffer))e=new EncoderBuffer(e,t);this.length+=e.length;return e}),this)}else if(typeof e==="number"){if(!(0<=e&&e<=255))return t.error("non-byte EncoderBuffer value");this.value=e;this.length=1}else if(typeof e==="string"){this.value=e;this.length=a.byteLength(e)}else if(a.isBuffer(e)){this.value=e;this.length=e.length}else{return t.error("Unsupported type: "+typeof e)}}t.R=EncoderBuffer;EncoderBuffer.prototype.join=function join(e,t){if(!e)e=new a(this.length);if(!t)t=0;if(this.length===0)return e;if(Array.isArray(this.value)){this.value.forEach((function(r){r.join(e,t);t+=r.length}))}else{if(typeof this.value==="number")e[t]=this.value;else if(typeof this.value==="string")e.write(this.value,t);else if(a.isBuffer(this.value))this.value.copy(e,t);t+=this.length}return e}},2207:function(e,t,r){var i=t;i.Reporter=r(2148).b;i.DecoderBuffer=r(8483).C;i.EncoderBuffer=r(8483).R;i.Node=r(211)},211:function(e,t,r){var i=r(2207).Reporter;var n=r(2207).EncoderBuffer;var a=r(2207).DecoderBuffer;var s=r(9036);var o=["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"];var u=["key","obj","use","optional","explicit","implicit","def","choice","any","contains"].concat(o);var h=["_peekTag","_decodeTag","_use","_decodeStr","_decodeObjid","_decodeTime","_decodeNull","_decodeInt","_decodeBool","_decodeList","_encodeComposite","_encodeStr","_encodeObjid","_encodeTime","_encodeNull","_encodeInt","_encodeBool"];function Node(e,t){var r={};this._baseState=r;r.enc=e;r.parent=t||null;r.children=null;r.tag=null;r.args=null;r.reverseArgs=null;r.choice=null;r.optional=false;r.any=false;r.obj=false;r.use=null;r.useDecoder=null;r.key=null;r["default"]=null;r.explicit=null;r.implicit=null;r.contains=null;if(!r.parent){r.children=[];this._wrap()}}e.exports=Node;var d=["enc","parent","children","tag","args","reverseArgs","choice","optional","any","obj","use","alteredUse","key","default","explicit","implicit","contains"];Node.prototype.clone=function clone(){var e=this._baseState;var t={};d.forEach((function(r){t[r]=e[r]}));var r=new this.constructor(t.parent);r._baseState=t;return r};Node.prototype._wrap=function wrap(){var e=this._baseState;u.forEach((function(t){this[t]=function _wrappedMethod(){var r=new this.constructor(this);e.children.push(r);return r[t].apply(r,arguments)}}),this)};Node.prototype._init=function init(e){var t=this._baseState;s(t.parent===null);e.call(this);t.children=t.children.filter((function(e){return e._baseState.parent===this}),this);s.equal(t.children.length,1,"Root node can have only one child")};Node.prototype._useArgs=function useArgs(e){var t=this._baseState;var r=e.filter((function(e){return e instanceof this.constructor}),this);e=e.filter((function(e){return!(e instanceof this.constructor)}),this);if(r.length!==0){s(t.children===null);t.children=r;r.forEach((function(e){e._baseState.parent=this}),this)}if(e.length!==0){s(t.args===null);t.args=e;t.reverseArgs=e.map((function(e){if(typeof e!=="object"||e.constructor!==Object)return e;var t={};Object.keys(e).forEach((function(r){if(r==(r|0))r|=0;var i=e[r];t[i]=r}));return t}))}};h.forEach((function(e){Node.prototype[e]=function _overrided(){var t=this._baseState;throw new Error(e+" not implemented for encoding: "+t.enc)}}));o.forEach((function(e){Node.prototype[e]=function _tagMethod(){var t=this._baseState;var r=Array.prototype.slice.call(arguments);s(t.tag===null);t.tag=e;this._useArgs(r);return this}}));Node.prototype.use=function use(e){s(e);var t=this._baseState;s(t.use===null);t.use=e;return this};Node.prototype.optional=function optional(){var e=this._baseState;e.optional=true;return this};Node.prototype.def=function def(e){var t=this._baseState;s(t["default"]===null);t["default"]=e;t.optional=true;return this};Node.prototype.explicit=function explicit(e){var t=this._baseState;s(t.explicit===null&&t.implicit===null);t.explicit=e;return this};Node.prototype.implicit=function implicit(e){var t=this._baseState;s(t.explicit===null&&t.implicit===null);t.implicit=e;return this};Node.prototype.obj=function obj(){var e=this._baseState;var t=Array.prototype.slice.call(arguments);e.obj=true;if(t.length!==0)this._useArgs(t);return this};Node.prototype.key=function key(e){var t=this._baseState;s(t.key===null);t.key=e;return this};Node.prototype.any=function any(){var e=this._baseState;e.any=true;return this};Node.prototype.choice=function choice(e){var t=this._baseState;s(t.choice===null);t.choice=e;this._useArgs(Object.keys(e).map((function(t){return e[t]})));return this};Node.prototype.contains=function contains(e){var t=this._baseState;s(t.use===null);t.contains=e;return this};Node.prototype._decode=function decode(e,t){var r=this._baseState;if(r.parent===null)return e.wrapResult(r.children[0]._decode(e,t));var i=r["default"];var n=true;var s=null;if(r.key!==null)s=e.enterKey(r.key);if(r.optional){var o=null;if(r.explicit!==null)o=r.explicit;else if(r.implicit!==null)o=r.implicit;else if(r.tag!==null)o=r.tag;if(o===null&&!r.any){var u=e.save();try{if(r.choice===null)this._decodeGeneric(r.tag,e,t);else this._decodeChoice(e,t);n=true}catch(e){n=false}e.restore(u)}else{n=this._peekTag(e,o,r.any);if(e.isError(n))return n}}var h;if(r.obj&&n)h=e.enterObject();if(n){if(r.explicit!==null){var d=this._decodeTag(e,r.explicit);if(e.isError(d))return d;e=d}var c=e.offset;if(r.use===null&&r.choice===null){if(r.any)var u=e.save();var l=this._decodeTag(e,r.implicit!==null?r.implicit:r.tag,r.any);if(e.isError(l))return l;if(r.any)i=e.raw(u);else e=l}if(t&&t.track&&r.tag!==null)t.track(e.path(),c,e.length,"tagged");if(t&&t.track&&r.tag!==null)t.track(e.path(),e.offset,e.length,"content");if(r.any)i=i;else if(r.choice===null)i=this._decodeGeneric(r.tag,e,t);else i=this._decodeChoice(e,t);if(e.isError(i))return i;if(!r.any&&r.choice===null&&r.children!==null){r.children.forEach((function decodeChildren(r){r._decode(e,t)}))}if(r.contains&&(r.tag==="octstr"||r.tag==="bitstr")){var p=new a(i);i=this._getUse(r.contains,e._reporterState.obj)._decode(p,t)}}if(r.obj&&n)i=e.leaveObject(h);if(r.key!==null&&(i!==null||n===true))e.leaveKey(s,r.key,i);else if(s!==null)e.exitKey(s);return i};Node.prototype._decodeGeneric=function decodeGeneric(e,t,r){var i=this._baseState;if(e==="seq"||e==="set")return null;if(e==="seqof"||e==="setof")return this._decodeList(t,e,i.args[0],r);else if(/str$/.test(e))return this._decodeStr(t,e,r);else if(e==="objid"&&i.args)return this._decodeObjid(t,i.args[0],i.args[1],r);else if(e==="objid")return this._decodeObjid(t,null,null,r);else if(e==="gentime"||e==="utctime")return this._decodeTime(t,e,r);else if(e==="null_")return this._decodeNull(t,r);else if(e==="bool")return this._decodeBool(t,r);else if(e==="objDesc")return this._decodeStr(t,e,r);else if(e==="int"||e==="enum")return this._decodeInt(t,i.args&&i.args[0],r);if(i.use!==null){return this._getUse(i.use,t._reporterState.obj)._decode(t,r)}else{return t.error("unknown tag: "+e)}};Node.prototype._getUse=function _getUse(e,t){var r=this._baseState;r.useDecoder=this._use(e,t);s(r.useDecoder._baseState.parent===null);r.useDecoder=r.useDecoder._baseState.children[0];if(r.implicit!==r.useDecoder._baseState.implicit){r.useDecoder=r.useDecoder.clone();r.useDecoder._baseState.implicit=r.implicit}return r.useDecoder};Node.prototype._decodeChoice=function decodeChoice(e,t){var r=this._baseState;var i=null;var n=false;Object.keys(r.choice).some((function(a){var s=e.save();var o=r.choice[a];try{var u=o._decode(e,t);if(e.isError(u))return false;i={type:a,value:u};n=true}catch(t){e.restore(s);return false}return true}),this);if(!n)return e.error("Choice not matched");return i};Node.prototype._createEncoderBuffer=function createEncoderBuffer(e){return new n(e,this.reporter)};Node.prototype._encode=function encode(e,t,r){var i=this._baseState;if(i["default"]!==null&&i["default"]===e)return;var n=this._encodeValue(e,t,r);if(n===undefined)return;if(this._skipDefault(n,t,r))return;return n};Node.prototype._encodeValue=function encode(e,t,r){var n=this._baseState;if(n.parent===null)return n.children[0]._encode(e,t||new i);var a=null;this.reporter=t;if(n.optional&&e===undefined){if(n["default"]!==null)e=n["default"];else return}var s=null;var o=false;if(n.any){a=this._createEncoderBuffer(e)}else if(n.choice){a=this._encodeChoice(e,t)}else if(n.contains){s=this._getUse(n.contains,r)._encode(e,t);o=true}else if(n.children){s=n.children.map((function(r){if(r._baseState.tag==="null_")return r._encode(null,t,e);if(r._baseState.key===null)return t.error("Child should have a key");var i=t.enterKey(r._baseState.key);if(typeof e!=="object")return t.error("Child expected, but input is not object");var n=r._encode(e[r._baseState.key],t,e);t.leaveKey(i);return n}),this).filter((function(e){return e}));s=this._createEncoderBuffer(s)}else{if(n.tag==="seqof"||n.tag==="setof"){if(!(n.args&&n.args.length===1))return t.error("Too many args for : "+n.tag);if(!Array.isArray(e))return t.error("seqof/setof, but data is not Array");var u=this.clone();u._baseState.implicit=null;s=this._createEncoderBuffer(e.map((function(r){var i=this._baseState;return this._getUse(i.args[0],e)._encode(r,t)}),u))}else if(n.use!==null){a=this._getUse(n.use,r)._encode(e,t)}else{s=this._encodePrimitive(n.tag,e);o=true}}var a;if(!n.any&&n.choice===null){var h=n.implicit!==null?n.implicit:n.tag;var d=n.implicit===null?"universal":"context";if(h===null){if(n.use===null)t.error("Tag could be omitted only for .use()")}else{if(n.use===null)a=this._encodeComposite(h,o,d,s)}}if(n.explicit!==null)a=this._encodeComposite(n.explicit,false,"context",a);return a};Node.prototype._encodeChoice=function encodeChoice(e,t){var r=this._baseState;var i=r.choice[e.type];if(!i){s(false,e.type+" not found in "+JSON.stringify(Object.keys(r.choice)))}return i._encode(e.value,t)};Node.prototype._encodePrimitive=function encodePrimitive(e,t){var r=this._baseState;if(/str$/.test(e))return this._encodeStr(t,e);else if(e==="objid"&&r.args)return this._encodeObjid(t,r.reverseArgs[0],r.args[1]);else if(e==="objid")return this._encodeObjid(t,null,null);else if(e==="gentime"||e==="utctime")return this._encodeTime(t,e);else if(e==="null_")return this._encodeNull();else if(e==="int"||e==="enum")return this._encodeInt(t,r.args&&r.reverseArgs[0]);else if(e==="bool")return this._encodeBool(t);else if(e==="objDesc")return this._encodeStr(t,e);else throw new Error("Unsupported tag: "+e)};Node.prototype._isNumstr=function isNumstr(e){return/^[0-9 ]*$/.test(e)};Node.prototype._isPrintstr=function isPrintstr(e){return/^[A-Za-z0-9 '\(\)\+,\-\.\/:=\?]*$/.test(e)}},2148:function(e,t,r){var i=r(7526);function Reporter(e){this._reporterState={obj:null,path:[],options:e||{},errors:[]}}t.b=Reporter;Reporter.prototype.isError=function isError(e){return e instanceof ReporterError};Reporter.prototype.save=function save(){var e=this._reporterState;return{obj:e.obj,pathLen:e.path.length}};Reporter.prototype.restore=function restore(e){var t=this._reporterState;t.obj=e.obj;t.path=t.path.slice(0,e.pathLen)};Reporter.prototype.enterKey=function enterKey(e){return this._reporterState.path.push(e)};Reporter.prototype.exitKey=function exitKey(e){var t=this._reporterState;t.path=t.path.slice(0,e-1)};Reporter.prototype.leaveKey=function leaveKey(e,t,r){var i=this._reporterState;this.exitKey(e);if(i.obj!==null)i.obj[t]=r};Reporter.prototype.path=function path(){return this._reporterState.path.join("/")};Reporter.prototype.enterObject=function enterObject(){var e=this._reporterState;var t=e.obj;e.obj={};return t};Reporter.prototype.leaveObject=function leaveObject(e){var t=this._reporterState;var r=t.obj;t.obj=e;return r};Reporter.prototype.error=function error(e){var t;var r=this._reporterState;var i=e instanceof ReporterError;if(i){t=e}else{t=new ReporterError(r.path.map((function(e){return"["+JSON.stringify(e)+"]"})).join(""),e.message||e,e.stack)}if(!r.options.partial)throw t;if(!i)r.errors.push(t);return t};Reporter.prototype.wrapResult=function wrapResult(e){var t=this._reporterState;if(!t.options.partial)return e;return{result:this.isError(e)?null:e,errors:t.errors}};function ReporterError(e,t){this.path=e;this.rethrow(t)}i(ReporterError,Error);ReporterError.prototype.rethrow=function rethrow(e){this.message=e+" at: "+(this.path||"(shallow)");if(Error.captureStackTrace)Error.captureStackTrace(this,ReporterError);if(!this.stack){try{throw new Error(this.message)}catch(e){this.stack=e.stack}}return this}},8880:function(e,t,r){var i=r(3503);t.tagClass={0:"universal",1:"application",2:"context",3:"private"};t.tagClassByName=i._reverse(t.tagClass);t.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"};t.tagByName=i._reverse(t.tag)},3503:function(e,t,r){var i=t;i._reverse=function reverse(e){var t={};Object.keys(e).forEach((function(r){if((r|0)==r)r=r|0;var i=e[r];t[i]=r}));return t};i.der=r(8880)},359:function(e,t,r){var i=r(7526);var n=r(8557);var a=n.base;var s=n.bignum;var o=n.constants.der;function DERDecoder(e){this.enc="der";this.name=e.name;this.entity=e;this.tree=new DERNode;this.tree._init(e.body)}e.exports=DERDecoder;DERDecoder.prototype.decode=function decode(e,t){if(!(e instanceof a.DecoderBuffer))e=new a.DecoderBuffer(e,t);return this.tree._decode(e,t)};function DERNode(e){a.Node.call(this,"der",e)}i(DERNode,a.Node);DERNode.prototype._peekTag=function peekTag(e,t,r){if(e.isEmpty())return false;var i=e.save();var n=derDecodeTag(e,'Failed to peek tag: "'+t+'"');if(e.isError(n))return n;e.restore(i);return n.tag===t||n.tagStr===t||n.tagStr+"of"===t||r};DERNode.prototype._decodeTag=function decodeTag(e,t,r){var i=derDecodeTag(e,'Failed to decode tag of "'+t+'"');if(e.isError(i))return i;var n=derDecodeLen(e,i.primitive,'Failed to get length of "'+t+'"');if(e.isError(n))return n;if(!r&&i.tag!==t&&i.tagStr!==t&&i.tagStr+"of"!==t){return e.error('Failed to match tag: "'+t+'"')}if(i.primitive||n!==null)return e.skip(n,'Failed to match body of: "'+t+'"');var a=e.save();var s=this._skipUntilEnd(e,'Failed to skip indefinite length body: "'+this.tag+'"');if(e.isError(s))return s;n=e.offset-a.offset;e.restore(a);return e.skip(n,'Failed to match body of: "'+t+'"')};DERNode.prototype._skipUntilEnd=function skipUntilEnd(e,t){while(true){var r=derDecodeTag(e,t);if(e.isError(r))return r;var i=derDecodeLen(e,r.primitive,t);if(e.isError(i))return i;var n;if(r.primitive||i!==null)n=e.skip(i);else n=this._skipUntilEnd(e,t);if(e.isError(n))return n;if(r.tagStr==="end")break}};DERNode.prototype._decodeList=function decodeList(e,t,r,i){var n=[];while(!e.isEmpty()){var a=this._peekTag(e,"end");if(e.isError(a))return a;var s=r.decode(e,"der",i);if(e.isError(s)&&a)break;n.push(s)}return n};DERNode.prototype._decodeStr=function decodeStr(e,t){if(t==="bitstr"){var r=e.readUInt8();if(e.isError(r))return r;return{unused:r,data:e.raw()}}else if(t==="bmpstr"){var i=e.raw();if(i.length%2===1)return e.error("Decoding of string type: bmpstr length mismatch");var n="";for(var a=0;a>6];var n=(r&32)===0;if((r&31)===31){var a=r;r=0;while((a&128)===128){a=e.readUInt8(t);if(e.isError(a))return a;r<<=7;r|=a&127}}else{r&=31}var s=o.tag[r];return{cls:i,primitive:n,tag:r,tagStr:s}}function derDecodeLen(e,t,r){var i=e.readUInt8(r);if(e.isError(i))return i;if(!t&&i===128)return null;if((i&128)===0){return i}var n=i&127;if(n>4)return e.error("length octect is too long");i=0;for(var a=0;a=256;u>>=8)o++;var s=new n(1+1+o);s[0]=a;s[1]=128|o;for(var u=1+o,h=i.length;h>0;u--,h>>=8)s[u]=h&255;return this._createEncoderBuffer([s,i])};DERNode.prototype._encodeStr=function encodeStr(e,t){if(t==="bitstr"){return this._createEncoderBuffer([e.unused|0,e.data])}else if(t==="bmpstr"){var r=new n(e.length*2);for(var i=0;i=40)return this.reporter.error("Second objid identifier OOB");e.splice(0,2,e[0]*40+e[1])}var a=0;for(var i=0;i=128;s>>=7)a++}var o=new n(a);var u=o.length-1;for(var i=e.length-1;i>=0;i--){var s=e[i];o[u--]=s&127;while((s>>=7)>0)o[u--]=128|s&127}return this._createEncoderBuffer(o)};function two(e){if(e<10)return"0"+e;else return e}DERNode.prototype._encodeTime=function encodeTime(e,t){var r;var i=new Date(e);if(t==="gentime"){r=[two(i.getFullYear()),two(i.getUTCMonth()+1),two(i.getUTCDate()),two(i.getUTCHours()),two(i.getUTCMinutes()),two(i.getUTCSeconds()),"Z"].join("")}else if(t==="utctime"){r=[two(i.getFullYear()%100),two(i.getUTCMonth()+1),two(i.getUTCDate()),two(i.getUTCHours()),two(i.getUTCMinutes()),two(i.getUTCSeconds()),"Z"].join("")}else{this.reporter.error("Encoding "+t+" time is not supported yet")}return this._encodeStr(r,"octstr")};DERNode.prototype._encodeNull=function encodeNull(){return this._createEncoderBuffer("")};DERNode.prototype._encodeInt=function encodeInt(e,t){if(typeof e==="string"){if(!t)return this.reporter.error("String int or enum given, but no values map");if(!t.hasOwnProperty(e)){return this.reporter.error("Values map doesn't contain: "+JSON.stringify(e))}e=t[e]}if(typeof e!=="number"&&!n.isBuffer(e)){var r=e.toArray();if(!e.sign&&r[0]&128){r.unshift(0)}e=new n(r)}if(n.isBuffer(e)){var i=e.length;if(e.length===0)i++;var a=new n(i);e.copy(a);if(e.length===0)a[0]=0;return this._createEncoderBuffer(a)}if(e<128)return this._createEncoderBuffer(e);if(e<256)return this._createEncoderBuffer([0,e]);var i=1;for(var s=e;s>=256;s>>=8)i++;var a=new Array(i);for(var s=a.length-1;s>=0;s--){a[s]=e&255;e>>=8}if(a[0]&128){a.unshift(0)}return this._createEncoderBuffer(new n(a))};DERNode.prototype._encodeBool=function encodeBool(e){return this._createEncoderBuffer(e?255:0)};DERNode.prototype._use=function use(e,t){if(typeof e==="function")e=e(t);return e._getEncoder("der").tree};DERNode.prototype._skipDefault=function skipDefault(e,t,r){var i=this._baseState;var n;if(i["default"]===null)return false;var a=e.join();if(i.defaultBuffer===undefined)i.defaultBuffer=this._encodeValue(i["default"],t,r).join();if(a.length!==i.defaultBuffer.length)return false;for(n=0;n=31)return i.error("Multi-octet tag encoding unsupported");if(!t)n|=32;n|=o.tagClassByName[r||"universal"]<<6;return n}},9245:function(e,t,r){var i=t;i.der=r(6125);i.pem=r(4599)},4599:function(e,t,r){var i=r(7526);var n=r(6125);function PEMEncoder(e){n.call(this,e);this.enc="pem"}i(PEMEncoder,n);e.exports=PEMEncoder;PEMEncoder.prototype.encode=function encode(e,t){var r=n.prototype.encode.call(this,e);var i=r.toString("base64");var a=["-----BEGIN "+t.label+"-----"];for(var s=0;s0)return e;return t};BN.min=function min(e,t){if(e.cmp(t)<0)return e;return t};BN.prototype._init=function init(e,t,r){if(typeof e==="number"){return this._initNumber(e,t,r)}if(typeof e==="object"){return this._initArray(e,t,r)}if(t==="hex"){t=16}assert(t===(t|0)&&t>=2&&t<=36);e=e.toString().replace(/\s+/g,"");var i=0;if(e[0]==="-"){i++}if(t===16){this._parseHex(e,i)}else{this._parseBase(e,t,i)}if(e[0]==="-"){this.negative=1}this.strip();if(r!=="le")return;this._initArray(this.toArray(),t,r)};BN.prototype._initNumber=function _initNumber(e,t,r){if(e<0){this.negative=1;e=-e}if(e<67108864){this.words=[e&67108863];this.length=1}else if(e<4503599627370496){this.words=[e&67108863,e/67108864&67108863];this.length=2}else{assert(e<9007199254740992);this.words=[e&67108863,e/67108864&67108863,1];this.length=3}if(r!=="le")return;this._initArray(this.toArray(),t,r)};BN.prototype._initArray=function _initArray(e,t,r){assert(typeof e.length==="number");if(e.length<=0){this.words=[0];this.length=1;return this}this.length=Math.ceil(e.length/3);this.words=new Array(this.length);for(var i=0;i=0;i-=3){a=e[i]|e[i-1]<<8|e[i-2]<<16;this.words[n]|=a<>>26-s&67108863;s+=24;if(s>=26){s-=26;n++}}}else if(r==="le"){for(i=0,n=0;i>>26-s&67108863;s+=24;if(s>=26){s-=26;n++}}}return this.strip()};function parseHex(e,t,r){var i=0;var n=Math.min(e.length,r);for(var a=t;a=49&&s<=54){i|=s-49+10}else if(s>=17&&s<=22){i|=s-17+10}else{i|=s&15}}return i}BN.prototype._parseHex=function _parseHex(e,t){this.length=Math.ceil((e.length-t)/6);this.words=new Array(this.length);for(var r=0;r=t;r-=6){n=parseHex(e,r,r+6);this.words[i]|=n<>>26-a&4194303;a+=24;if(a>=26){a-=26;i++}}if(r+6!==t){n=parseHex(e,t,r+6);this.words[i]|=n<>>26-a&4194303}this.strip()};function parseBase(e,t,r,i){var n=0;var a=Math.min(e.length,r);for(var s=t;s=49){n+=o-49+10}else if(o>=17){n+=o-17+10}else{n+=o}}return n}BN.prototype._parseBase=function _parseBase(e,t,r){this.words=[0];this.length=1;for(var i=0,n=1;n<=67108863;n*=t){i++}i--;n=n/t|0;var a=e.length-r;var s=a%i;var o=Math.min(a,a-s)+r;var u=0;for(var h=r;h1&&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 n=["","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 a=[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 s=[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(e,t){e=e||10;t=t|0||1;var r;if(e===16||e==="hex"){r="";var i=0;var o=0;for(var u=0;u>>24-i&16777215;if(o!==0||u!==this.length-1){r=n[6-d.length]+d+r}else{r=d+r}i+=2;if(i>=26){i-=26;u--}}if(o!==0){r=o.toString(16)+r}while(r.length%t!==0){r="0"+r}if(this.negative!==0){r="-"+r}return r}if(e===(e|0)&&e>=2&&e<=36){var c=a[e];var l=s[e];r="";var p=this.clone();p.negative=0;while(!p.isZero()){var b=p.modn(l).toString(e);p=p.idivn(l);if(!p.isZero()){r=n[c-b.length]+b+r}else{r=b+r}}if(this.isZero()){r="0"+r}while(r.length%t!==0){r="0"+r}if(this.negative!==0){r="-"+r}return r}assert(false,"Base should be between 2 and 36")};BN.prototype.toNumber=function toNumber(){var e=this.words[0];if(this.length===2){e+=this.words[1]*67108864}else if(this.length===3&&this.words[2]===1){e+=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?-e:e};BN.prototype.toJSON=function toJSON(){return this.toString(16)};BN.prototype.toBuffer=function toBuffer(e,t){assert(typeof i!=="undefined");return this.toArrayLike(i,e,t)};BN.prototype.toArray=function toArray(e,t){return this.toArrayLike(Array,e,t)};BN.prototype.toArrayLike=function toArrayLike(e,t,r){var i=this.byteLength();var n=r||Math.max(1,i);assert(i<=n,"byte array longer than desired length");assert(n>0,"Requested array length <= 0");this.strip();var a=t==="le";var s=new e(n);var o,u;var h=this.clone();if(!a){for(u=0;u=4096){r+=13;t>>>=13}if(t>=64){r+=7;t>>>=7}if(t>=8){r+=4;t>>>=4}if(t>=2){r+=2;t>>>=2}return r+t}}BN.prototype._zeroBits=function _zeroBits(e){if(e===0)return 26;var t=e;var r=0;if((t&8191)===0){r+=13;t>>>=13}if((t&127)===0){r+=7;t>>>=7}if((t&15)===0){r+=4;t>>>=4}if((t&3)===0){r+=2;t>>>=2}if((t&1)===0){r++}return r};BN.prototype.bitLength=function bitLength(){var e=this.words[this.length-1];var t=this._countBits(e);return(this.length-1)*26+t};function toBitArray(e){var t=new Array(e.bitLength());for(var r=0;r>>n}return t}BN.prototype.zeroBits=function zeroBits(){if(this.isZero())return 0;var e=0;for(var t=0;te.length)return this.clone().ior(e);return e.clone().ior(this)};BN.prototype.uor=function uor(e){if(this.length>e.length)return this.clone().iuor(e);return e.clone().iuor(this)};BN.prototype.iuand=function iuand(e){var t;if(this.length>e.length){t=e}else{t=this}for(var r=0;re.length)return this.clone().iand(e);return e.clone().iand(this)};BN.prototype.uand=function uand(e){if(this.length>e.length)return this.clone().iuand(e);return e.clone().iuand(this)};BN.prototype.iuxor=function iuxor(e){var t;var r;if(this.length>e.length){t=this;r=e}else{t=e;r=this}for(var i=0;ie.length)return this.clone().ixor(e);return e.clone().ixor(this)};BN.prototype.uxor=function uxor(e){if(this.length>e.length)return this.clone().iuxor(e);return e.clone().iuxor(this)};BN.prototype.inotn=function inotn(e){assert(typeof e==="number"&&e>=0);var t=Math.ceil(e/26)|0;var r=e%26;this._expand(t);if(r>0){t--}for(var i=0;i0){this.words[i]=~this.words[i]&67108863>>26-r}return this.strip()};BN.prototype.notn=function notn(e){return this.clone().inotn(e)};BN.prototype.setn=function setn(e,t){assert(typeof e==="number"&&e>=0);var r=e/26|0;var i=e%26;this._expand(r+1);if(t){this.words[r]=this.words[r]|1<e.length){r=this;i=e}else{r=e;i=this}var n=0;for(var a=0;a>>26}for(;n!==0&&a>>26}this.length=r.length;if(n!==0){this.words[this.length]=n;this.length++}else if(r!==this){for(;ae.length)return this.clone().iadd(e);return e.clone().iadd(this)};BN.prototype.isub=function isub(e){if(e.negative!==0){e.negative=0;var t=this.iadd(e);e.negative=1;return t._normSign()}else if(this.negative!==0){this.negative=0;this.iadd(e);this.negative=1;return this._normSign()}var r=this.cmp(e);if(r===0){this.negative=0;this.length=1;this.words[0]=0;return this}var i,n;if(r>0){i=this;n=e}else{i=e;n=this}var a=0;for(var s=0;s>26;this.words[s]=t&67108863}for(;a!==0&&s>26;this.words[s]=t&67108863}if(a===0&&s>>26;var c=u&67108863;var l=Math.min(h,t.length-1);for(var p=Math.max(0,h-e.length+1);p<=l;p++){var b=h-p|0;n=e.words[b]|0;a=t.words[p]|0;s=n*a+c;d+=s/67108864|0;c=s&67108863}r.words[h]=c|0;u=d|0}if(u!==0){r.words[h]=u|0}else{r.length--}return r.strip()}var o=function comb10MulTo(e,t,r){var i=e.words;var n=t.words;var a=r.words;var s=0;var o;var u;var h;var d=i[0]|0;var c=d&8191;var l=d>>>13;var p=i[1]|0;var b=p&8191;var v=p>>>13;var m=i[2]|0;var y=m&8191;var g=m>>>13;var _=i[3]|0;var w=_&8191;var M=_>>>13;var E=i[4]|0;var B=E&8191;var k=E>>>13;var A=i[5]|0;var N=A&8191;var P=A>>>13;var x=i[6]|0;var T=x&8191;var I=x>>>13;var C=i[7]|0;var D=C&8191;var O=C>>>13;var j=i[8]|0;var L=j&8191;var q=j>>>13;var H=i[9]|0;var F=H&8191;var U=H>>>13;var z=n[0]|0;var W=z&8191;var V=z>>>13;var G=n[1]|0;var J=G&8191;var Z=G>>>13;var X=n[2]|0;var Y=X&8191;var $=X>>>13;var Q=n[3]|0;var ee=Q&8191;var te=Q>>>13;var re=n[4]|0;var ie=re&8191;var ne=re>>>13;var ae=n[5]|0;var fe=ae&8191;var se=ae>>>13;var oe=n[6]|0;var ue=oe&8191;var he=oe>>>13;var de=n[7]|0;var ce=de&8191;var le=de>>>13;var pe=n[8]|0;var be=pe&8191;var ve=pe>>>13;var me=n[9]|0;var ye=me&8191;var ge=me>>>13;r.negative=e.negative^t.negative;r.length=19;o=Math.imul(c,W);u=Math.imul(c,V);u=u+Math.imul(l,W)|0;h=Math.imul(l,V);var _e=(s+o|0)+((u&8191)<<13)|0;s=(h+(u>>>13)|0)+(_e>>>26)|0;_e&=67108863;o=Math.imul(b,W);u=Math.imul(b,V);u=u+Math.imul(v,W)|0;h=Math.imul(v,V);o=o+Math.imul(c,J)|0;u=u+Math.imul(c,Z)|0;u=u+Math.imul(l,J)|0;h=h+Math.imul(l,Z)|0;var we=(s+o|0)+((u&8191)<<13)|0;s=(h+(u>>>13)|0)+(we>>>26)|0;we&=67108863;o=Math.imul(y,W);u=Math.imul(y,V);u=u+Math.imul(g,W)|0;h=Math.imul(g,V);o=o+Math.imul(b,J)|0;u=u+Math.imul(b,Z)|0;u=u+Math.imul(v,J)|0;h=h+Math.imul(v,Z)|0;o=o+Math.imul(c,Y)|0;u=u+Math.imul(c,$)|0;u=u+Math.imul(l,Y)|0;h=h+Math.imul(l,$)|0;var Me=(s+o|0)+((u&8191)<<13)|0;s=(h+(u>>>13)|0)+(Me>>>26)|0;Me&=67108863;o=Math.imul(w,W);u=Math.imul(w,V);u=u+Math.imul(M,W)|0;h=Math.imul(M,V);o=o+Math.imul(y,J)|0;u=u+Math.imul(y,Z)|0;u=u+Math.imul(g,J)|0;h=h+Math.imul(g,Z)|0;o=o+Math.imul(b,Y)|0;u=u+Math.imul(b,$)|0;u=u+Math.imul(v,Y)|0;h=h+Math.imul(v,$)|0;o=o+Math.imul(c,ee)|0;u=u+Math.imul(c,te)|0;u=u+Math.imul(l,ee)|0;h=h+Math.imul(l,te)|0;var Se=(s+o|0)+((u&8191)<<13)|0;s=(h+(u>>>13)|0)+(Se>>>26)|0;Se&=67108863;o=Math.imul(B,W);u=Math.imul(B,V);u=u+Math.imul(k,W)|0;h=Math.imul(k,V);o=o+Math.imul(w,J)|0;u=u+Math.imul(w,Z)|0;u=u+Math.imul(M,J)|0;h=h+Math.imul(M,Z)|0;o=o+Math.imul(y,Y)|0;u=u+Math.imul(y,$)|0;u=u+Math.imul(g,Y)|0;h=h+Math.imul(g,$)|0;o=o+Math.imul(b,ee)|0;u=u+Math.imul(b,te)|0;u=u+Math.imul(v,ee)|0;h=h+Math.imul(v,te)|0;o=o+Math.imul(c,ie)|0;u=u+Math.imul(c,ne)|0;u=u+Math.imul(l,ie)|0;h=h+Math.imul(l,ne)|0;var Ee=(s+o|0)+((u&8191)<<13)|0;s=(h+(u>>>13)|0)+(Ee>>>26)|0;Ee&=67108863;o=Math.imul(N,W);u=Math.imul(N,V);u=u+Math.imul(P,W)|0;h=Math.imul(P,V);o=o+Math.imul(B,J)|0;u=u+Math.imul(B,Z)|0;u=u+Math.imul(k,J)|0;h=h+Math.imul(k,Z)|0;o=o+Math.imul(w,Y)|0;u=u+Math.imul(w,$)|0;u=u+Math.imul(M,Y)|0;h=h+Math.imul(M,$)|0;o=o+Math.imul(y,ee)|0;u=u+Math.imul(y,te)|0;u=u+Math.imul(g,ee)|0;h=h+Math.imul(g,te)|0;o=o+Math.imul(b,ie)|0;u=u+Math.imul(b,ne)|0;u=u+Math.imul(v,ie)|0;h=h+Math.imul(v,ne)|0;o=o+Math.imul(c,fe)|0;u=u+Math.imul(c,se)|0;u=u+Math.imul(l,fe)|0;h=h+Math.imul(l,se)|0;var Be=(s+o|0)+((u&8191)<<13)|0;s=(h+(u>>>13)|0)+(Be>>>26)|0;Be&=67108863;o=Math.imul(T,W);u=Math.imul(T,V);u=u+Math.imul(I,W)|0;h=Math.imul(I,V);o=o+Math.imul(N,J)|0;u=u+Math.imul(N,Z)|0;u=u+Math.imul(P,J)|0;h=h+Math.imul(P,Z)|0;o=o+Math.imul(B,Y)|0;u=u+Math.imul(B,$)|0;u=u+Math.imul(k,Y)|0;h=h+Math.imul(k,$)|0;o=o+Math.imul(w,ee)|0;u=u+Math.imul(w,te)|0;u=u+Math.imul(M,ee)|0;h=h+Math.imul(M,te)|0;o=o+Math.imul(y,ie)|0;u=u+Math.imul(y,ne)|0;u=u+Math.imul(g,ie)|0;h=h+Math.imul(g,ne)|0;o=o+Math.imul(b,fe)|0;u=u+Math.imul(b,se)|0;u=u+Math.imul(v,fe)|0;h=h+Math.imul(v,se)|0;o=o+Math.imul(c,ue)|0;u=u+Math.imul(c,he)|0;u=u+Math.imul(l,ue)|0;h=h+Math.imul(l,he)|0;var Re=(s+o|0)+((u&8191)<<13)|0;s=(h+(u>>>13)|0)+(Re>>>26)|0;Re&=67108863;o=Math.imul(D,W);u=Math.imul(D,V);u=u+Math.imul(O,W)|0;h=Math.imul(O,V);o=o+Math.imul(T,J)|0;u=u+Math.imul(T,Z)|0;u=u+Math.imul(I,J)|0;h=h+Math.imul(I,Z)|0;o=o+Math.imul(N,Y)|0;u=u+Math.imul(N,$)|0;u=u+Math.imul(P,Y)|0;h=h+Math.imul(P,$)|0;o=o+Math.imul(B,ee)|0;u=u+Math.imul(B,te)|0;u=u+Math.imul(k,ee)|0;h=h+Math.imul(k,te)|0;o=o+Math.imul(w,ie)|0;u=u+Math.imul(w,ne)|0;u=u+Math.imul(M,ie)|0;h=h+Math.imul(M,ne)|0;o=o+Math.imul(y,fe)|0;u=u+Math.imul(y,se)|0;u=u+Math.imul(g,fe)|0;h=h+Math.imul(g,se)|0;o=o+Math.imul(b,ue)|0;u=u+Math.imul(b,he)|0;u=u+Math.imul(v,ue)|0;h=h+Math.imul(v,he)|0;o=o+Math.imul(c,ce)|0;u=u+Math.imul(c,le)|0;u=u+Math.imul(l,ce)|0;h=h+Math.imul(l,le)|0;var ke=(s+o|0)+((u&8191)<<13)|0;s=(h+(u>>>13)|0)+(ke>>>26)|0;ke&=67108863;o=Math.imul(L,W);u=Math.imul(L,V);u=u+Math.imul(q,W)|0;h=Math.imul(q,V);o=o+Math.imul(D,J)|0;u=u+Math.imul(D,Z)|0;u=u+Math.imul(O,J)|0;h=h+Math.imul(O,Z)|0;o=o+Math.imul(T,Y)|0;u=u+Math.imul(T,$)|0;u=u+Math.imul(I,Y)|0;h=h+Math.imul(I,$)|0;o=o+Math.imul(N,ee)|0;u=u+Math.imul(N,te)|0;u=u+Math.imul(P,ee)|0;h=h+Math.imul(P,te)|0;o=o+Math.imul(B,ie)|0;u=u+Math.imul(B,ne)|0;u=u+Math.imul(k,ie)|0;h=h+Math.imul(k,ne)|0;o=o+Math.imul(w,fe)|0;u=u+Math.imul(w,se)|0;u=u+Math.imul(M,fe)|0;h=h+Math.imul(M,se)|0;o=o+Math.imul(y,ue)|0;u=u+Math.imul(y,he)|0;u=u+Math.imul(g,ue)|0;h=h+Math.imul(g,he)|0;o=o+Math.imul(b,ce)|0;u=u+Math.imul(b,le)|0;u=u+Math.imul(v,ce)|0;h=h+Math.imul(v,le)|0;o=o+Math.imul(c,be)|0;u=u+Math.imul(c,ve)|0;u=u+Math.imul(l,be)|0;h=h+Math.imul(l,ve)|0;var Ae=(s+o|0)+((u&8191)<<13)|0;s=(h+(u>>>13)|0)+(Ae>>>26)|0;Ae&=67108863;o=Math.imul(F,W);u=Math.imul(F,V);u=u+Math.imul(U,W)|0;h=Math.imul(U,V);o=o+Math.imul(L,J)|0;u=u+Math.imul(L,Z)|0;u=u+Math.imul(q,J)|0;h=h+Math.imul(q,Z)|0;o=o+Math.imul(D,Y)|0;u=u+Math.imul(D,$)|0;u=u+Math.imul(O,Y)|0;h=h+Math.imul(O,$)|0;o=o+Math.imul(T,ee)|0;u=u+Math.imul(T,te)|0;u=u+Math.imul(I,ee)|0;h=h+Math.imul(I,te)|0;o=o+Math.imul(N,ie)|0;u=u+Math.imul(N,ne)|0;u=u+Math.imul(P,ie)|0;h=h+Math.imul(P,ne)|0;o=o+Math.imul(B,fe)|0;u=u+Math.imul(B,se)|0;u=u+Math.imul(k,fe)|0;h=h+Math.imul(k,se)|0;o=o+Math.imul(w,ue)|0;u=u+Math.imul(w,he)|0;u=u+Math.imul(M,ue)|0;h=h+Math.imul(M,he)|0;o=o+Math.imul(y,ce)|0;u=u+Math.imul(y,le)|0;u=u+Math.imul(g,ce)|0;h=h+Math.imul(g,le)|0;o=o+Math.imul(b,be)|0;u=u+Math.imul(b,ve)|0;u=u+Math.imul(v,be)|0;h=h+Math.imul(v,ve)|0;o=o+Math.imul(c,ye)|0;u=u+Math.imul(c,ge)|0;u=u+Math.imul(l,ye)|0;h=h+Math.imul(l,ge)|0;var Ne=(s+o|0)+((u&8191)<<13)|0;s=(h+(u>>>13)|0)+(Ne>>>26)|0;Ne&=67108863;o=Math.imul(F,J);u=Math.imul(F,Z);u=u+Math.imul(U,J)|0;h=Math.imul(U,Z);o=o+Math.imul(L,Y)|0;u=u+Math.imul(L,$)|0;u=u+Math.imul(q,Y)|0;h=h+Math.imul(q,$)|0;o=o+Math.imul(D,ee)|0;u=u+Math.imul(D,te)|0;u=u+Math.imul(O,ee)|0;h=h+Math.imul(O,te)|0;o=o+Math.imul(T,ie)|0;u=u+Math.imul(T,ne)|0;u=u+Math.imul(I,ie)|0;h=h+Math.imul(I,ne)|0;o=o+Math.imul(N,fe)|0;u=u+Math.imul(N,se)|0;u=u+Math.imul(P,fe)|0;h=h+Math.imul(P,se)|0;o=o+Math.imul(B,ue)|0;u=u+Math.imul(B,he)|0;u=u+Math.imul(k,ue)|0;h=h+Math.imul(k,he)|0;o=o+Math.imul(w,ce)|0;u=u+Math.imul(w,le)|0;u=u+Math.imul(M,ce)|0;h=h+Math.imul(M,le)|0;o=o+Math.imul(y,be)|0;u=u+Math.imul(y,ve)|0;u=u+Math.imul(g,be)|0;h=h+Math.imul(g,ve)|0;o=o+Math.imul(b,ye)|0;u=u+Math.imul(b,ge)|0;u=u+Math.imul(v,ye)|0;h=h+Math.imul(v,ge)|0;var Pe=(s+o|0)+((u&8191)<<13)|0;s=(h+(u>>>13)|0)+(Pe>>>26)|0;Pe&=67108863;o=Math.imul(F,Y);u=Math.imul(F,$);u=u+Math.imul(U,Y)|0;h=Math.imul(U,$);o=o+Math.imul(L,ee)|0;u=u+Math.imul(L,te)|0;u=u+Math.imul(q,ee)|0;h=h+Math.imul(q,te)|0;o=o+Math.imul(D,ie)|0;u=u+Math.imul(D,ne)|0;u=u+Math.imul(O,ie)|0;h=h+Math.imul(O,ne)|0;o=o+Math.imul(T,fe)|0;u=u+Math.imul(T,se)|0;u=u+Math.imul(I,fe)|0;h=h+Math.imul(I,se)|0;o=o+Math.imul(N,ue)|0;u=u+Math.imul(N,he)|0;u=u+Math.imul(P,ue)|0;h=h+Math.imul(P,he)|0;o=o+Math.imul(B,ce)|0;u=u+Math.imul(B,le)|0;u=u+Math.imul(k,ce)|0;h=h+Math.imul(k,le)|0;o=o+Math.imul(w,be)|0;u=u+Math.imul(w,ve)|0;u=u+Math.imul(M,be)|0;h=h+Math.imul(M,ve)|0;o=o+Math.imul(y,ye)|0;u=u+Math.imul(y,ge)|0;u=u+Math.imul(g,ye)|0;h=h+Math.imul(g,ge)|0;var xe=(s+o|0)+((u&8191)<<13)|0;s=(h+(u>>>13)|0)+(xe>>>26)|0;xe&=67108863;o=Math.imul(F,ee);u=Math.imul(F,te);u=u+Math.imul(U,ee)|0;h=Math.imul(U,te);o=o+Math.imul(L,ie)|0;u=u+Math.imul(L,ne)|0;u=u+Math.imul(q,ie)|0;h=h+Math.imul(q,ne)|0;o=o+Math.imul(D,fe)|0;u=u+Math.imul(D,se)|0;u=u+Math.imul(O,fe)|0;h=h+Math.imul(O,se)|0;o=o+Math.imul(T,ue)|0;u=u+Math.imul(T,he)|0;u=u+Math.imul(I,ue)|0;h=h+Math.imul(I,he)|0;o=o+Math.imul(N,ce)|0;u=u+Math.imul(N,le)|0;u=u+Math.imul(P,ce)|0;h=h+Math.imul(P,le)|0;o=o+Math.imul(B,be)|0;u=u+Math.imul(B,ve)|0;u=u+Math.imul(k,be)|0;h=h+Math.imul(k,ve)|0;o=o+Math.imul(w,ye)|0;u=u+Math.imul(w,ge)|0;u=u+Math.imul(M,ye)|0;h=h+Math.imul(M,ge)|0;var Te=(s+o|0)+((u&8191)<<13)|0;s=(h+(u>>>13)|0)+(Te>>>26)|0;Te&=67108863;o=Math.imul(F,ie);u=Math.imul(F,ne);u=u+Math.imul(U,ie)|0;h=Math.imul(U,ne);o=o+Math.imul(L,fe)|0;u=u+Math.imul(L,se)|0;u=u+Math.imul(q,fe)|0;h=h+Math.imul(q,se)|0;o=o+Math.imul(D,ue)|0;u=u+Math.imul(D,he)|0;u=u+Math.imul(O,ue)|0;h=h+Math.imul(O,he)|0;o=o+Math.imul(T,ce)|0;u=u+Math.imul(T,le)|0;u=u+Math.imul(I,ce)|0;h=h+Math.imul(I,le)|0;o=o+Math.imul(N,be)|0;u=u+Math.imul(N,ve)|0;u=u+Math.imul(P,be)|0;h=h+Math.imul(P,ve)|0;o=o+Math.imul(B,ye)|0;u=u+Math.imul(B,ge)|0;u=u+Math.imul(k,ye)|0;h=h+Math.imul(k,ge)|0;var Ie=(s+o|0)+((u&8191)<<13)|0;s=(h+(u>>>13)|0)+(Ie>>>26)|0;Ie&=67108863;o=Math.imul(F,fe);u=Math.imul(F,se);u=u+Math.imul(U,fe)|0;h=Math.imul(U,se);o=o+Math.imul(L,ue)|0;u=u+Math.imul(L,he)|0;u=u+Math.imul(q,ue)|0;h=h+Math.imul(q,he)|0;o=o+Math.imul(D,ce)|0;u=u+Math.imul(D,le)|0;u=u+Math.imul(O,ce)|0;h=h+Math.imul(O,le)|0;o=o+Math.imul(T,be)|0;u=u+Math.imul(T,ve)|0;u=u+Math.imul(I,be)|0;h=h+Math.imul(I,ve)|0;o=o+Math.imul(N,ye)|0;u=u+Math.imul(N,ge)|0;u=u+Math.imul(P,ye)|0;h=h+Math.imul(P,ge)|0;var Ce=(s+o|0)+((u&8191)<<13)|0;s=(h+(u>>>13)|0)+(Ce>>>26)|0;Ce&=67108863;o=Math.imul(F,ue);u=Math.imul(F,he);u=u+Math.imul(U,ue)|0;h=Math.imul(U,he);o=o+Math.imul(L,ce)|0;u=u+Math.imul(L,le)|0;u=u+Math.imul(q,ce)|0;h=h+Math.imul(q,le)|0;o=o+Math.imul(D,be)|0;u=u+Math.imul(D,ve)|0;u=u+Math.imul(O,be)|0;h=h+Math.imul(O,ve)|0;o=o+Math.imul(T,ye)|0;u=u+Math.imul(T,ge)|0;u=u+Math.imul(I,ye)|0;h=h+Math.imul(I,ge)|0;var De=(s+o|0)+((u&8191)<<13)|0;s=(h+(u>>>13)|0)+(De>>>26)|0;De&=67108863;o=Math.imul(F,ce);u=Math.imul(F,le);u=u+Math.imul(U,ce)|0;h=Math.imul(U,le);o=o+Math.imul(L,be)|0;u=u+Math.imul(L,ve)|0;u=u+Math.imul(q,be)|0;h=h+Math.imul(q,ve)|0;o=o+Math.imul(D,ye)|0;u=u+Math.imul(D,ge)|0;u=u+Math.imul(O,ye)|0;h=h+Math.imul(O,ge)|0;var Oe=(s+o|0)+((u&8191)<<13)|0;s=(h+(u>>>13)|0)+(Oe>>>26)|0;Oe&=67108863;o=Math.imul(F,be);u=Math.imul(F,ve);u=u+Math.imul(U,be)|0;h=Math.imul(U,ve);o=o+Math.imul(L,ye)|0;u=u+Math.imul(L,ge)|0;u=u+Math.imul(q,ye)|0;h=h+Math.imul(q,ge)|0;var je=(s+o|0)+((u&8191)<<13)|0;s=(h+(u>>>13)|0)+(je>>>26)|0;je&=67108863;o=Math.imul(F,ye);u=Math.imul(F,ge);u=u+Math.imul(U,ye)|0;h=Math.imul(U,ge);var Le=(s+o|0)+((u&8191)<<13)|0;s=(h+(u>>>13)|0)+(Le>>>26)|0;Le&=67108863;a[0]=_e;a[1]=we;a[2]=Me;a[3]=Se;a[4]=Ee;a[5]=Be;a[6]=Re;a[7]=ke;a[8]=Ae;a[9]=Ne;a[10]=Pe;a[11]=xe;a[12]=Te;a[13]=Ie;a[14]=Ce;a[15]=De;a[16]=Oe;a[17]=je;a[18]=Le;if(s!==0){a[19]=s;r.length++}return r};if(!Math.imul){o=smallMulTo}function bigMulTo(e,t,r){r.negative=t.negative^e.negative;r.length=e.length+t.length;var i=0;var n=0;for(var a=0;a>>26)|0;n+=s>>>26;s&=67108863}r.words[a]=o;i=s;s=n}if(i!==0){r.words[a]=i}else{r.length--}return r.strip()}function jumboMulTo(e,t,r){var i=new FFTM;return i.mulp(e,t,r)}BN.prototype.mulTo=function mulTo(e,t){var r;var i=this.length+e.length;if(this.length===10&&e.length===10){r=o(this,e,t)}else if(i<63){r=smallMulTo(this,e,t)}else if(i<1024){r=bigMulTo(this,e,t)}else{r=jumboMulTo(this,e,t)}return r};function FFTM(e,t){this.x=e;this.y=t}FFTM.prototype.makeRBT=function makeRBT(e){var t=new Array(e);var r=BN.prototype._countBits(e)-1;for(var i=0;i>=1}return i};FFTM.prototype.permute=function permute(e,t,r,i,n,a){for(var s=0;s>>1){n++}return 1<>>13;r[2*a+1]=n&8191;n=n>>>13}for(a=2*t;a>=26;t+=i/67108864|0;t+=n>>>26;this.words[r]=n&67108863}if(t!==0){this.words[r]=t;this.length++}return this};BN.prototype.muln=function muln(e){return this.clone().imuln(e)};BN.prototype.sqr=function sqr(){return this.mul(this)};BN.prototype.isqr=function isqr(){return this.imul(this.clone())};BN.prototype.pow=function pow(e){var t=toBitArray(e);if(t.length===0)return new BN(1);var r=this;for(var i=0;i=0);var t=e%26;var r=(e-t)/26;var i=67108863>>>26-t<<26-t;var n;if(t!==0){var a=0;for(n=0;n>>26-t}if(a){this.words[n]=a;this.length++}}if(r!==0){for(n=this.length-1;n>=0;n--){this.words[n+r]=this.words[n]}for(n=0;n=0);var i;if(t){i=(t-t%26)/26}else{i=0}var n=e%26;var a=Math.min((e-n)/26,this.length);var s=67108863^67108863>>>n<a){this.length-=a;for(u=0;u=0&&(h!==0||u>=i);u--){var d=this.words[u]|0;this.words[u]=h<<26-n|d>>>n;h=d&s}if(o&&h!==0){o.words[o.length++]=h}if(this.length===0){this.words[0]=0;this.length=1}return this.strip()};BN.prototype.ishrn=function ishrn(e,t,r){assert(this.negative===0);return this.iushrn(e,t,r)};BN.prototype.shln=function shln(e){return this.clone().ishln(e)};BN.prototype.ushln=function ushln(e){return this.clone().iushln(e)};BN.prototype.shrn=function shrn(e){return this.clone().ishrn(e)};BN.prototype.ushrn=function ushrn(e){return this.clone().iushrn(e)};BN.prototype.testn=function testn(e){assert(typeof e==="number"&&e>=0);var t=e%26;var r=(e-t)/26;var i=1<=0);var t=e%26;var r=(e-t)/26;assert(this.negative===0,"imaskn works only with positive numbers");if(this.length<=r){return this}if(t!==0){r++}this.length=Math.min(r,this.length);if(t!==0){var i=67108863^67108863>>>t<=67108864;t++){this.words[t]-=67108864;if(t===this.length-1){this.words[t+1]=1}else{this.words[t+1]++}}this.length=Math.max(this.length,t+1);return this};BN.prototype.isubn=function isubn(e){assert(typeof e==="number");assert(e<67108864);if(e<0)return this.iaddn(-e);if(this.negative!==0){this.negative=0;this.iaddn(e);this.negative=1;return this}this.words[0]-=e;if(this.length===1&&this.words[0]<0){this.words[0]=-this.words[0];this.negative=1}else{for(var t=0;t>26)-(o/67108864|0);this.words[n+r]=a&67108863}for(;n>26;this.words[n+r]=a&67108863}if(s===0)return this.strip();assert(s===-1);s=0;for(n=0;n>26;this.words[n]=a&67108863}this.negative=1;return this.strip()};BN.prototype._wordDiv=function _wordDiv(e,t){var r=this.length-e.length;var i=this.clone();var n=e;var a=n.words[n.length-1]|0;var s=this._countBits(a);r=26-s;if(r!==0){n=n.ushln(r);i.iushln(r);a=n.words[n.length-1]|0}var o=i.length-n.length;var u;if(t!=="mod"){u=new BN(null);u.length=o+1;u.words=new Array(u.length);for(var h=0;h=0;c--){var l=(i.words[n.length+c]|0)*67108864+(i.words[n.length+c-1]|0);l=Math.min(l/a|0,67108863);i._ishlnsubmul(n,l,c);while(i.negative!==0){l--;i.negative=0;i._ishlnsubmul(n,1,c);if(!i.isZero()){i.negative^=1}}if(u){u.words[c]=l}}if(u){u.strip()}i.strip();if(t!=="div"&&r!==0){i.iushrn(r)}return{div:u||null,mod:i}};BN.prototype.divmod=function divmod(e,t,r){assert(!e.isZero());if(this.isZero()){return{div:new BN(0),mod:new BN(0)}}var i,n,a;if(this.negative!==0&&e.negative===0){a=this.neg().divmod(e,t);if(t!=="mod"){i=a.div.neg()}if(t!=="div"){n=a.mod.neg();if(r&&n.negative!==0){n.iadd(e)}}return{div:i,mod:n}}if(this.negative===0&&e.negative!==0){a=this.divmod(e.neg(),t);if(t!=="mod"){i=a.div.neg()}return{div:i,mod:a.mod}}if((this.negative&e.negative)!==0){a=this.neg().divmod(e.neg(),t);if(t!=="div"){n=a.mod.neg();if(r&&n.negative!==0){n.isub(e)}}return{div:a.div,mod:n}}if(e.length>this.length||this.cmp(e)<0){return{div:new BN(0),mod:this}}if(e.length===1){if(t==="div"){return{div:this.divn(e.words[0]),mod:null}}if(t==="mod"){return{div:null,mod:new BN(this.modn(e.words[0]))}}return{div:this.divn(e.words[0]),mod:new BN(this.modn(e.words[0]))}}return this._wordDiv(e,t)};BN.prototype.div=function div(e){return this.divmod(e,"div",false).div};BN.prototype.mod=function mod(e){return this.divmod(e,"mod",false).mod};BN.prototype.umod=function umod(e){return this.divmod(e,"mod",true).mod};BN.prototype.divRound=function divRound(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var r=t.div.negative!==0?t.mod.isub(e):t.mod;var i=e.ushrn(1);var n=e.andln(1);var a=r.cmp(i);if(a<0||n===1&&a===0)return t.div;return t.div.negative!==0?t.div.isubn(1):t.div.iaddn(1)};BN.prototype.modn=function modn(e){assert(e<=67108863);var t=(1<<26)%e;var r=0;for(var i=this.length-1;i>=0;i--){r=(t*r+(this.words[i]|0))%e}return r};BN.prototype.idivn=function idivn(e){assert(e<=67108863);var t=0;for(var r=this.length-1;r>=0;r--){var i=(this.words[r]|0)+t*67108864;this.words[r]=i/e|0;t=i%e}return this.strip()};BN.prototype.divn=function divn(e){return this.clone().idivn(e)};BN.prototype.egcd=function egcd(e){assert(e.negative===0);assert(!e.isZero());var t=this;var r=e.clone();if(t.negative!==0){t=t.umod(e)}else{t=t.clone()}var i=new BN(1);var n=new BN(0);var a=new BN(0);var s=new BN(1);var o=0;while(t.isEven()&&r.isEven()){t.iushrn(1);r.iushrn(1);++o}var u=r.clone();var h=t.clone();while(!t.isZero()){for(var d=0,c=1;(t.words[0]&c)===0&&d<26;++d,c<<=1);if(d>0){t.iushrn(d);while(d-- >0){if(i.isOdd()||n.isOdd()){i.iadd(u);n.isub(h)}i.iushrn(1);n.iushrn(1)}}for(var l=0,p=1;(r.words[0]&p)===0&&l<26;++l,p<<=1);if(l>0){r.iushrn(l);while(l-- >0){if(a.isOdd()||s.isOdd()){a.iadd(u);s.isub(h)}a.iushrn(1);s.iushrn(1)}}if(t.cmp(r)>=0){t.isub(r);i.isub(a);n.isub(s)}else{r.isub(t);a.isub(i);s.isub(n)}}return{a:a,b:s,gcd:r.iushln(o)}};BN.prototype._invmp=function _invmp(e){assert(e.negative===0);assert(!e.isZero());var t=this;var r=e.clone();if(t.negative!==0){t=t.umod(e)}else{t=t.clone()}var i=new BN(1);var n=new BN(0);var a=r.clone();while(t.cmpn(1)>0&&r.cmpn(1)>0){for(var s=0,o=1;(t.words[0]&o)===0&&s<26;++s,o<<=1);if(s>0){t.iushrn(s);while(s-- >0){if(i.isOdd()){i.iadd(a)}i.iushrn(1)}}for(var u=0,h=1;(r.words[0]&h)===0&&u<26;++u,h<<=1);if(u>0){r.iushrn(u);while(u-- >0){if(n.isOdd()){n.iadd(a)}n.iushrn(1)}}if(t.cmp(r)>=0){t.isub(r);i.isub(n)}else{r.isub(t);n.isub(i)}}var d;if(t.cmpn(1)===0){d=i}else{d=n}if(d.cmpn(0)<0){d.iadd(e)}return d};BN.prototype.gcd=function gcd(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone();var r=e.clone();t.negative=0;r.negative=0;for(var i=0;t.isEven()&&r.isEven();i++){t.iushrn(1);r.iushrn(1)}do{while(t.isEven()){t.iushrn(1)}while(r.isEven()){r.iushrn(1)}var n=t.cmp(r);if(n<0){var a=t;t=r;r=a}else if(n===0||r.cmpn(1)===0){break}t.isub(r)}while(true);return r.iushln(i)};BN.prototype.invm=function invm(e){return this.egcd(e).a.umod(e)};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(e){return this.words[0]&e};BN.prototype.bincn=function bincn(e){assert(typeof e==="number");var t=e%26;var r=(e-t)/26;var i=1<>>26;s&=67108863;this.words[a]=s}if(n!==0){this.words[a]=n;this.length++}return this};BN.prototype.isZero=function isZero(){return this.length===1&&this.words[0]===0};BN.prototype.cmpn=function cmpn(e){var t=e<0;if(this.negative!==0&&!t)return-1;if(this.negative===0&&t)return 1;this.strip();var r;if(this.length>1){r=1}else{if(t){e=-e}assert(e<=67108863,"Number is too big");var i=this.words[0]|0;r=i===e?0:ie.length)return 1;if(this.length=0;r--){var i=this.words[r]|0;var n=e.words[r]|0;if(i===n)continue;if(in){t=1}break}return t};BN.prototype.gtn=function gtn(e){return this.cmpn(e)===1};BN.prototype.gt=function gt(e){return this.cmp(e)===1};BN.prototype.gten=function gten(e){return this.cmpn(e)>=0};BN.prototype.gte=function gte(e){return this.cmp(e)>=0};BN.prototype.ltn=function ltn(e){return this.cmpn(e)===-1};BN.prototype.lt=function lt(e){return this.cmp(e)===-1};BN.prototype.lten=function lten(e){return this.cmpn(e)<=0};BN.prototype.lte=function lte(e){return this.cmp(e)<=0};BN.prototype.eqn=function eqn(e){return this.cmpn(e)===0};BN.prototype.eq=function eq(e){return this.cmp(e)===0};BN.red=function red(e){return new Red(e)};BN.prototype.toRed=function toRed(e){assert(!this.red,"Already a number in reduction context");assert(this.negative===0,"red works only with positives");return e.convertTo(this)._forceRed(e)};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(e){this.red=e;return this};BN.prototype.forceRed=function forceRed(e){assert(!this.red,"Already a number in reduction context");return this._forceRed(e)};BN.prototype.redAdd=function redAdd(e){assert(this.red,"redAdd works only with red numbers");return this.red.add(this,e)};BN.prototype.redIAdd=function redIAdd(e){assert(this.red,"redIAdd works only with red numbers");return this.red.iadd(this,e)};BN.prototype.redSub=function redSub(e){assert(this.red,"redSub works only with red numbers");return this.red.sub(this,e)};BN.prototype.redISub=function redISub(e){assert(this.red,"redISub works only with red numbers");return this.red.isub(this,e)};BN.prototype.redShl=function redShl(e){assert(this.red,"redShl works only with red numbers");return this.red.shl(this,e)};BN.prototype.redMul=function redMul(e){assert(this.red,"redMul works only with red numbers");this.red._verify2(this,e);return this.red.mul(this,e)};BN.prototype.redIMul=function redIMul(e){assert(this.red,"redMul works only with red numbers");this.red._verify2(this,e);return this.red.imul(this,e)};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(e){assert(this.red&&!e.red,"redPow(normalNum)");this.red._verify1(this);return this.red.pow(this,e)};var u={k256:null,p224:null,p192:null,p25519:null};function MPrime(e,t){this.name=e;this.p=new BN(t,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 e=new BN(null);e.words=new Array(Math.ceil(this.n/13));return e};MPrime.prototype.ireduce=function ireduce(e){var t=e;var r;do{this.split(t,this.tmp);t=this.imulK(t);t=t.iadd(this.tmp);r=t.bitLength()}while(r>this.n);var i=r0){t.isub(this.p)}else{if(t.strip!==undefined){t.strip()}else{t._strip()}}return t};MPrime.prototype.split=function split(e,t){e.iushrn(this.n,0,t)};MPrime.prototype.imulK=function imulK(e){return e.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(e,t){var r=4194303;var i=Math.min(e.length,9);for(var n=0;n>>22;a=s}a>>>=22;e.words[n-10]=a;if(a===0&&e.length>10){e.length-=10}else{e.length-=9}};K256.prototype.imulK=function imulK(e){e.words[e.length]=0;e.words[e.length+1]=0;e.length+=2;var t=0;for(var r=0;r>>=26;e.words[r]=n;t=i}if(t!==0){e.words[e.length++]=t}return e};BN._prime=function prime(e){if(u[e])return u[e];var prime;if(e==="k256"){prime=new K256}else if(e==="p224"){prime=new P224}else if(e==="p192"){prime=new P192}else if(e==="p25519"){prime=new P25519}else{throw new Error("Unknown prime "+e)}u[e]=prime;return prime};function Red(e){if(typeof e==="string"){var t=BN._prime(e);this.m=t.p;this.prime=t}else{assert(e.gtn(1),"modulus must be greater than 1");this.m=e;this.prime=null}}Red.prototype._verify1=function _verify1(e){assert(e.negative===0,"red works only with positives");assert(e.red,"red works only with red numbers")};Red.prototype._verify2=function _verify2(e,t){assert((e.negative|t.negative)===0,"red works only with positives");assert(e.red&&e.red===t.red,"red works only with red numbers")};Red.prototype.imod=function imod(e){if(this.prime)return this.prime.ireduce(e)._forceRed(this);return e.umod(this.m)._forceRed(this)};Red.prototype.neg=function neg(e){if(e.isZero()){return e.clone()}return this.m.sub(e)._forceRed(this)};Red.prototype.add=function add(e,t){this._verify2(e,t);var r=e.add(t);if(r.cmp(this.m)>=0){r.isub(this.m)}return r._forceRed(this)};Red.prototype.iadd=function iadd(e,t){this._verify2(e,t);var r=e.iadd(t);if(r.cmp(this.m)>=0){r.isub(this.m)}return r};Red.prototype.sub=function sub(e,t){this._verify2(e,t);var r=e.sub(t);if(r.cmpn(0)<0){r.iadd(this.m)}return r._forceRed(this)};Red.prototype.isub=function isub(e,t){this._verify2(e,t);var r=e.isub(t);if(r.cmpn(0)<0){r.iadd(this.m)}return r};Red.prototype.shl=function shl(e,t){this._verify1(e);return this.imod(e.ushln(t))};Red.prototype.imul=function imul(e,t){this._verify2(e,t);return this.imod(e.imul(t))};Red.prototype.mul=function mul(e,t){this._verify2(e,t);return this.imod(e.mul(t))};Red.prototype.isqr=function isqr(e){return this.imul(e,e.clone())};Red.prototype.sqr=function sqr(e){return this.mul(e,e)};Red.prototype.sqrt=function sqrt(e){if(e.isZero())return e.clone();var t=this.m.andln(3);assert(t%2===1);if(t===3){var r=this.m.add(new BN(1)).iushrn(2);return this.pow(e,r)}var i=this.m.subn(1);var n=0;while(!i.isZero()&&i.andln(1)===0){n++;i.iushrn(1)}assert(!i.isZero());var a=new BN(1).toRed(this);var s=a.redNeg();var o=this.m.subn(1).iushrn(1);var u=this.m.bitLength();u=new BN(2*u*u).toRed(this);while(this.pow(u,o).cmp(s)!==0){u.redIAdd(s)}var h=this.pow(u,i);var d=this.pow(e,i.addn(1).iushrn(1));var c=this.pow(e,i);var l=n;while(c.cmp(a)!==0){var p=c;for(var b=0;p.cmp(a)!==0;b++){p=p.redSqr()}assert(b=0;n--){var h=t.words[n];for(var d=u-1;d>=0;d--){var c=h>>d&1;if(a!==i[0]){a=this.sqr(a)}if(c===0&&s===0){o=0;continue}s<<=1;s|=c;o++;if(o!==r&&(n!==0||d!==0))continue;a=this.mul(a,i[s]);o=0;s=0}u=26}return a};Red.prototype.convertTo=function convertTo(e){var t=e.umod(this.m);return t===e?t.clone():t};Red.prototype.convertFrom=function convertFrom(e){var t=e.clone();t.red=null;return t};BN.mont=function mont(e){return new Mont(e)};function Mont(e){Red.call(this,e);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(e){return this.imod(e.ushln(this.shift))};Mont.prototype.convertFrom=function convertFrom(e){var t=this.imod(e.mul(this.rinv));t.red=null;return t};Mont.prototype.imul=function imul(e,t){if(e.isZero()||t.isZero()){e.words[0]=0;e.length=1;return e}var r=e.imul(t);var i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m);var n=r.isub(i).iushrn(this.shift);var a=n;if(n.cmp(this.m)>=0){a=n.isub(this.m)}else if(n.cmpn(0)<0){a=n.iadd(this.m)}return a._forceRed(this)};Mont.prototype.mul=function mul(e,t){if(e.isZero()||t.isZero())return new BN(0)._forceRed(this);var r=e.mul(t);var i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m);var n=r.isub(i).iushrn(this.shift);var a=n;if(n.cmp(this.m)>=0){a=n.isub(this.m)}else if(n.cmpn(0)<0){a=n.iadd(this.m)}return a._forceRed(this)};Mont.prototype.invm=function invm(e){var t=this.imod(e._invmp(this.m).mul(this.r2));return t._forceRed(this)}})(false||e,this)},6069:function(e,t,r){var i;e.exports=function rand(e){if(!i)i=new Rand(null);return i.generate(e)};function Rand(e){this.rand=e}e.exports.Rand=Rand;Rand.prototype.generate=function generate(e){return this._rand(e)};Rand.prototype._rand=function _rand(e){if(this.rand.getBytes)return this.rand.getBytes(e);var t=new Uint8Array(e);for(var r=0;r>>24]^s[d>>>16&255]^o[c>>>8&255]^u[l&255]^t[y++];b=a[d>>>24]^s[c>>>16&255]^o[l>>>8&255]^u[h&255]^t[y++];v=a[c>>>24]^s[l>>>16&255]^o[h>>>8&255]^u[d&255]^t[y++];m=a[l>>>24]^s[h>>>16&255]^o[d>>>8&255]^u[c&255]^t[y++];h=p;d=b;c=v;l=m}p=(i[h>>>24]<<24|i[d>>>16&255]<<16|i[c>>>8&255]<<8|i[l&255])^t[y++];b=(i[d>>>24]<<24|i[c>>>16&255]<<16|i[l>>>8&255]<<8|i[h&255])^t[y++];v=(i[c>>>24]<<24|i[l>>>16&255]<<16|i[h>>>8&255]<<8|i[d&255])^t[y++];m=(i[l>>>24]<<24|i[h>>>16&255]<<16|i[d>>>8&255]<<8|i[c&255])^t[y++];p=p>>>0;b=b>>>0;v=v>>>0;m=m>>>0;return[p,b,v,m]}var n=[0,1,2,4,8,16,32,64,128,27,54];var a=function(){var e=new Array(256);for(var t=0;t<256;t++){if(t<128){e[t]=t<<1}else{e[t]=t<<1^283}}var r=[];var i=[];var n=[[],[],[],[]];var a=[[],[],[],[]];var s=0;var o=0;for(var u=0;u<256;++u){var h=o^o<<1^o<<2^o<<3^o<<4;h=h>>>8^h&255^99;r[s]=h;i[h]=s;var d=e[s];var c=e[d];var l=e[c];var p=e[h]*257^h*16843008;n[0][s]=p<<24|p>>>8;n[1][s]=p<<16|p>>>16;n[2][s]=p<<8|p>>>24;n[3][s]=p;p=l*16843009^c*65537^d*257^s*16843008;a[0][h]=p<<24|p>>>8;a[1][h]=p<<16|p>>>16;a[2][h]=p<<8|p>>>24;a[3][h]=p;if(s===0){s=o=1}else{s=d^e[e[e[l^d]]];o^=e[e[o]]}}return{SBOX:r,INV_SBOX:i,SUB_MIX:n,INV_SUB_MIX:a}}();function AES(e){this._key=asUInt32Array(e);this._reset()}AES.blockSize=4*4;AES.keySize=256/8;AES.prototype.blockSize=AES.blockSize;AES.prototype.keySize=AES.keySize;AES.prototype._reset=function(){var e=this._key;var t=e.length;var r=t+6;var i=(r+1)*4;var s=[];for(var o=0;o>>24;u=a.SBOX[u>>>24]<<24|a.SBOX[u>>>16&255]<<16|a.SBOX[u>>>8&255]<<8|a.SBOX[u&255];u^=n[o/t|0]<<24}else if(t>6&&o%t===4){u=a.SBOX[u>>>24]<<24|a.SBOX[u>>>16&255]<<16|a.SBOX[u>>>8&255]<<8|a.SBOX[u&255]}s[o]=s[o-t]^u}var h=[];for(var d=0;d>>24]]^a.INV_SUB_MIX[1][a.SBOX[l>>>16&255]]^a.INV_SUB_MIX[2][a.SBOX[l>>>8&255]]^a.INV_SUB_MIX[3][a.SBOX[l&255]]}}this._nRounds=r;this._keySchedule=s;this._invKeySchedule=h};AES.prototype.encryptBlockRaw=function(e){e=asUInt32Array(e);return cryptBlock(e,this._keySchedule,a.SUB_MIX,a.SBOX,this._nRounds)};AES.prototype.encryptBlock=function(e){var t=this.encryptBlockRaw(e);var r=i.allocUnsafe(16);r.writeUInt32BE(t[0],0);r.writeUInt32BE(t[1],4);r.writeUInt32BE(t[2],8);r.writeUInt32BE(t[3],12);return r};AES.prototype.decryptBlock=function(e){e=asUInt32Array(e);var t=e[1];e[1]=e[3];e[3]=t;var r=cryptBlock(e,this._invKeySchedule,a.INV_SUB_MIX,a.INV_SBOX,this._nRounds);var n=i.allocUnsafe(16);n.writeUInt32BE(r[0],0);n.writeUInt32BE(r[3],4);n.writeUInt32BE(r[2],8);n.writeUInt32BE(r[1],12);return n};AES.prototype.scrub=function(){scrubVec(this._keySchedule);scrubVec(this._invKeySchedule);scrubVec(this._key)};e.exports.AES=AES},5112:function(e,t,r){var i=r(9725);var n=r(3118).Buffer;var a=r(8826);var s=r(7526);var o=r(7731);var u=r(5653);var h=r(4630);function xorTest(e,t){var r=0;if(e.length!==t.length)r++;var i=Math.min(e.length,t.length);for(var n=0;n16){t=this.cache.slice(0,16);this.cache=this.cache.slice(16);return t}}else{if(this.cache.length>=16){t=this.cache.slice(0,16);this.cache=this.cache.slice(16);return t}}return null};Splitter.prototype.flush=function(){if(this.cache.length)return this.cache};function unpad(e){var t=e[15];if(t<1||t>16){throw new Error("unable to decrypt data")}var r=-1;while(++r15){var e=this.cache.slice(0,16);this.cache=this.cache.slice(16);return e}return null};Splitter.prototype.flush=function(){var e=16-this.cache.length;var t=a.allocUnsafe(e);var r=-1;while(++r>>0,0);t.writeUInt32BE(e[1]>>>0,4);t.writeUInt32BE(e[2]>>>0,8);t.writeUInt32BE(e[3]>>>0,12);return t}function GHASH(e){this.h=e;this.state=i.alloc(16,0);this.cache=i.allocUnsafe(0)}GHASH.prototype.ghash=function(e){var t=-1;while(++t0;r--){e[r]=e[r]>>>1|(e[r-1]&1)<<31}e[0]=e[0]>>>1;if(n){e[0]=e[0]^225<<24}}this.state=fromArray(t)};GHASH.prototype.update=function(e){this.cache=i.concat([this.cache,e]);var t;while(this.cache.length>=16){t=this.cache.slice(0,16);this.cache=this.cache.slice(16);this.ghash(t)}};GHASH.prototype.final=function(e,t){if(this.cache.length){this.ghash(i.concat([this.cache,n],16))}this.ghash(fromArray([0,e,0,t]));return this.state};e.exports=GHASH},4630:function(e){function incr32(e){var t=e.length;var r;while(t--){r=e.readUInt8(t);if(r===255){e.writeUInt8(0,t)}else{r++;e.writeUInt8(r,t);break}}}e.exports=incr32},4156:function(e,t,r){var i=r(5653);t.encrypt=function(e,t){var r=i(t,e._prev);e._prev=e._cipher.encryptBlock(r);return e._prev};t.decrypt=function(e,t){var r=e._prev;e._prev=t;var n=e._cipher.decryptBlock(t);return i(n,r)}},2509:function(e,t,r){var i=r(3118).Buffer;var n=r(5653);function encryptStart(e,t,r){var a=t.length;var s=n(t,e._cache);e._cache=e._cache.slice(a);e._prev=i.concat([e._prev,r?t:s]);return s}t.encrypt=function(e,t,r){var n=i.allocUnsafe(0);var a;while(t.length){if(e._cache.length===0){e._cache=e._cipher.encryptBlock(e._prev);e._prev=i.allocUnsafe(0)}if(e._cache.length<=t.length){a=e._cache.length;n=i.concat([n,encryptStart(e,t.slice(0,a),r)]);t=t.slice(a)}else{n=i.concat([n,encryptStart(e,t,r)]);break}}return n}},9010:function(e,t,r){var i=r(3118).Buffer;function encryptByte(e,t,r){var i;var n=-1;var a=8;var s=0;var o,u;while(++n>n%8;e._prev=shiftIn(e._prev,r?o:u)}return s}function shiftIn(e,t){var r=e.length;var n=-1;var a=i.allocUnsafe(e.length);e=i.concat([e,i.from([t])]);while(++n>7}return a}t.encrypt=function(e,t,r){var n=t.length;var a=i.allocUnsafe(n);var s=-1;while(++s=0||!r.umod(e.prime1)||!r.umod(e.prime2)){r=new i(n(t))}return r}},5703:function(e,t,r){e.exports=r(26)},1265:function(e,t,r){var i=r(3118).Buffer;var n=r(2539);var a=r(6572);var s=r(7526);var o=r(3596);var u=r(9204);var h=r(26);Object.keys(h).forEach((function(e){h[e].id=i.from(h[e].id,"hex");h[e.toLowerCase()]=h[e]}));function Sign(e){a.Writable.call(this);var t=h[e];if(!t)throw new Error("Unknown message digest");this._hashType=t.hash;this._hash=n(t.hash);this._tag=t.id;this._signType=t.sign}s(Sign,a.Writable);Sign.prototype._write=function _write(e,t,r){this._hash.update(e);r()};Sign.prototype.update=function update(e,t){if(typeof e==="string")e=i.from(e,t);this._hash.update(e);return this};Sign.prototype.sign=function signMethod(e,t){this.end();var r=this._hash.digest();var i=o(r,e,this._hashType,this._signType,this._tag);return t?i.toString(t):i};function Verify(e){a.Writable.call(this);var t=h[e];if(!t)throw new Error("Unknown message digest");this._hash=n(t.hash);this._tag=t.id;this._signType=t.sign}s(Verify,a.Writable);Verify.prototype._write=function _write(e,t,r){this._hash.update(e);r()};Verify.prototype.update=function update(e,t){if(typeof e==="string")e=i.from(e,t);this._hash.update(e);return this};Verify.prototype.verify=function verifyMethod(e,t,r){if(typeof t==="string")t=i.from(t,r);this.end();var n=this._hash.digest();return u(t,n,e,this._signType,this._tag)};function createSign(e){return new Sign(e)}function createVerify(e){return new Verify(e)}e.exports={Sign:createSign,Verify:createVerify,createSign:createSign,createVerify:createVerify}},3596:function(e,t,r){var i=r(3118).Buffer;var n=r(2730);var a=r(6236);var s=r(8818).ec;var o=r(5410);var u=r(569);var h=r(9167);function sign(e,t,r,n,s){var o=u(t);if(o.curve){if(n!=="ecdsa"&&n!=="ecdsa/rsa")throw new Error("wrong private key type");return ecSign(e,o)}else if(o.type==="dsa"){if(n!=="dsa")throw new Error("wrong private key type");return dsaSign(e,o,r)}else{if(n!=="rsa"&&n!=="ecdsa/rsa")throw new Error("wrong private key type")}e=i.concat([s,e]);var h=o.modulus.byteLength();var d=[0,1];while(e.length+d.length+10)r.ishrn(i);return r}function bits2octets(e,t){e=bits2int(e,t);e=e.mod(t);var r=i.from(e.toArray());if(r.length=t)throw new Error("invalid sig")}e.exports=verify},5410:function(e,t,r){e=r.nmd(e);(function(e,t){"use strict";function assert(e,t){if(!e)throw new Error(t||"Assertion failed")}function inherits(e,t){e.super_=t;var TempCtor=function(){};TempCtor.prototype=t.prototype;e.prototype=new TempCtor;e.prototype.constructor=e}function BN(e,t,r){if(BN.isBN(e)){return e}this.negative=0;this.words=null;this.length=0;this.red=null;if(e!==null){if(t==="le"||t==="be"){r=t;t=10}this._init(e||0,t||10,r||"be")}}if(typeof e==="object"){e.exports=BN}else{t.BN=BN}BN.BN=BN;BN.wordSize=26;var i;try{i=r(4300).Buffer}catch(e){}BN.isBN=function isBN(e){if(e instanceof BN){return true}return e!==null&&typeof e==="object"&&e.constructor.wordSize===BN.wordSize&&Array.isArray(e.words)};BN.max=function max(e,t){if(e.cmp(t)>0)return e;return t};BN.min=function min(e,t){if(e.cmp(t)<0)return e;return t};BN.prototype._init=function init(e,t,r){if(typeof e==="number"){return this._initNumber(e,t,r)}if(typeof e==="object"){return this._initArray(e,t,r)}if(t==="hex"){t=16}assert(t===(t|0)&&t>=2&&t<=36);e=e.toString().replace(/\s+/g,"");var i=0;if(e[0]==="-"){i++}if(t===16){this._parseHex(e,i)}else{this._parseBase(e,t,i)}if(e[0]==="-"){this.negative=1}this._strip();if(r!=="le")return;this._initArray(this.toArray(),t,r)};BN.prototype._initNumber=function _initNumber(e,t,r){if(e<0){this.negative=1;e=-e}if(e<67108864){this.words=[e&67108863];this.length=1}else if(e<4503599627370496){this.words=[e&67108863,e/67108864&67108863];this.length=2}else{assert(e<9007199254740992);this.words=[e&67108863,e/67108864&67108863,1];this.length=3}if(r!=="le")return;this._initArray(this.toArray(),t,r)};BN.prototype._initArray=function _initArray(e,t,r){assert(typeof e.length==="number");if(e.length<=0){this.words=[0];this.length=1;return this}this.length=Math.ceil(e.length/3);this.words=new Array(this.length);for(var i=0;i=0;i-=3){a=e[i]|e[i-1]<<8|e[i-2]<<16;this.words[n]|=a<>>26-s&67108863;s+=24;if(s>=26){s-=26;n++}}}else if(r==="le"){for(i=0,n=0;i>>26-s&67108863;s+=24;if(s>=26){s-=26;n++}}}return this._strip()};function parseHex(e,t,r){var i=0;var n=Math.min(e.length,r);var a=0;for(var s=t;s=49&&o<=54){u=o-49+10}else if(o>=17&&o<=22){u=o-17+10}else{u=o}i|=u;a|=u}assert(!(a&240),"Invalid character in "+e);return i}BN.prototype._parseHex=function _parseHex(e,t){this.length=Math.ceil((e.length-t)/6);this.words=new Array(this.length);for(var r=0;r=t;r-=6){n=parseHex(e,r,r+6);this.words[i]|=n<>>26-a&4194303;a+=24;if(a>=26){a-=26;i++}}if(r+6!==t){n=parseHex(e,t,r+6);this.words[i]|=n<>>26-a&4194303}this._strip()};function parseBase(e,t,r,i){var n=0;var a=0;var s=Math.min(e.length,r);for(var o=t;o=49){a=u-49+10}else if(u>=17){a=u-17+10}else{a=u}assert(u>=0&&a1&&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};if(typeof Symbol!=="undefined"&&typeof Symbol.for==="function"){BN.prototype[Symbol.for("nodejs.util.inspect.custom")]=inspect}else{BN.prototype.inspect=inspect}function inspect(){return(this.red?""}var n=["","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 a=[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 s=[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(e,t){e=e||10;t=t|0||1;var r;if(e===16||e==="hex"){r="";var i=0;var o=0;for(var u=0;u>>24-i&16777215;if(o!==0||u!==this.length-1){r=n[6-d.length]+d+r}else{r=d+r}i+=2;if(i>=26){i-=26;u--}}if(o!==0){r=o.toString(16)+r}while(r.length%t!==0){r="0"+r}if(this.negative!==0){r="-"+r}return r}if(e===(e|0)&&e>=2&&e<=36){var c=a[e];var l=s[e];r="";var p=this.clone();p.negative=0;while(!p.isZero()){var b=p.modrn(l).toString(e);p=p.idivn(l);if(!p.isZero()){r=n[c-b.length]+b+r}else{r=b+r}}if(this.isZero()){r="0"+r}while(r.length%t!==0){r="0"+r}if(this.negative!==0){r="-"+r}return r}assert(false,"Base should be between 2 and 36")};BN.prototype.toNumber=function toNumber(){var e=this.words[0];if(this.length===2){e+=this.words[1]*67108864}else if(this.length===3&&this.words[2]===1){e+=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?-e:e};BN.prototype.toJSON=function toJSON(){return this.toString(16,2)};if(i){BN.prototype.toBuffer=function toBuffer(e,t){return this.toArrayLike(i,e,t)}}BN.prototype.toArray=function toArray(e,t){return this.toArrayLike(Array,e,t)};var o=function allocate(e,t){if(e.allocUnsafe){return e.allocUnsafe(t)}return new e(t)};BN.prototype.toArrayLike=function toArrayLike(e,t,r){this._strip();var i=this.byteLength();var n=r||Math.max(1,i);assert(i<=n,"byte array longer than desired length");assert(n>0,"Requested array length <= 0");var a=o(e,n);var s=t==="le"?"LE":"BE";this["_toArrayLike"+s](a,i);return a};BN.prototype._toArrayLikeLE=function _toArrayLikeLE(e,t){var r=0;var i=0;for(var n=0,a=0;n>8&255}if(r>16&255}if(a===6){if(r>24&255}i=0;a=0}else{i=s>>>24;a+=2}}if(r=0){e[r--]=s>>8&255}if(r>=0){e[r--]=s>>16&255}if(a===6){if(r>=0){e[r--]=s>>24&255}i=0;a=0}else{i=s>>>24;a+=2}}if(r>=0){e[r--]=i;while(r>=0){e[r--]=0}}};if(Math.clz32){BN.prototype._countBits=function _countBits(e){return 32-Math.clz32(e)}}else{BN.prototype._countBits=function _countBits(e){var t=e;var r=0;if(t>=4096){r+=13;t>>>=13}if(t>=64){r+=7;t>>>=7}if(t>=8){r+=4;t>>>=4}if(t>=2){r+=2;t>>>=2}return r+t}}BN.prototype._zeroBits=function _zeroBits(e){if(e===0)return 26;var t=e;var r=0;if((t&8191)===0){r+=13;t>>>=13}if((t&127)===0){r+=7;t>>>=7}if((t&15)===0){r+=4;t>>>=4}if((t&3)===0){r+=2;t>>>=2}if((t&1)===0){r++}return r};BN.prototype.bitLength=function bitLength(){var e=this.words[this.length-1];var t=this._countBits(e);return(this.length-1)*26+t};function toBitArray(e){var t=new Array(e.bitLength());for(var r=0;r>>n&1}return t}BN.prototype.zeroBits=function zeroBits(){if(this.isZero())return 0;var e=0;for(var t=0;te.length)return this.clone().ior(e);return e.clone().ior(this)};BN.prototype.uor=function uor(e){if(this.length>e.length)return this.clone().iuor(e);return e.clone().iuor(this)};BN.prototype.iuand=function iuand(e){var t;if(this.length>e.length){t=e}else{t=this}for(var r=0;re.length)return this.clone().iand(e);return e.clone().iand(this)};BN.prototype.uand=function uand(e){if(this.length>e.length)return this.clone().iuand(e);return e.clone().iuand(this)};BN.prototype.iuxor=function iuxor(e){var t;var r;if(this.length>e.length){t=this;r=e}else{t=e;r=this}for(var i=0;ie.length)return this.clone().ixor(e);return e.clone().ixor(this)};BN.prototype.uxor=function uxor(e){if(this.length>e.length)return this.clone().iuxor(e);return e.clone().iuxor(this)};BN.prototype.inotn=function inotn(e){assert(typeof e==="number"&&e>=0);var t=Math.ceil(e/26)|0;var r=e%26;this._expand(t);if(r>0){t--}for(var i=0;i0){this.words[i]=~this.words[i]&67108863>>26-r}return this._strip()};BN.prototype.notn=function notn(e){return this.clone().inotn(e)};BN.prototype.setn=function setn(e,t){assert(typeof e==="number"&&e>=0);var r=e/26|0;var i=e%26;this._expand(r+1);if(t){this.words[r]=this.words[r]|1<e.length){r=this;i=e}else{r=e;i=this}var n=0;for(var a=0;a>>26}for(;n!==0&&a>>26}this.length=r.length;if(n!==0){this.words[this.length]=n;this.length++}else if(r!==this){for(;ae.length)return this.clone().iadd(e);return e.clone().iadd(this)};BN.prototype.isub=function isub(e){if(e.negative!==0){e.negative=0;var t=this.iadd(e);e.negative=1;return t._normSign()}else if(this.negative!==0){this.negative=0;this.iadd(e);this.negative=1;return this._normSign()}var r=this.cmp(e);if(r===0){this.negative=0;this.length=1;this.words[0]=0;return this}var i,n;if(r>0){i=this;n=e}else{i=e;n=this}var a=0;for(var s=0;s>26;this.words[s]=t&67108863}for(;a!==0&&s>26;this.words[s]=t&67108863}if(a===0&&s>>26;var c=u&67108863;var l=Math.min(h,t.length-1);for(var p=Math.max(0,h-e.length+1);p<=l;p++){var b=h-p|0;n=e.words[b]|0;a=t.words[p]|0;s=n*a+c;d+=s/67108864|0;c=s&67108863}r.words[h]=c|0;u=d|0}if(u!==0){r.words[h]=u|0}else{r.length--}return r._strip()}var u=function comb10MulTo(e,t,r){var i=e.words;var n=t.words;var a=r.words;var s=0;var o;var u;var h;var d=i[0]|0;var c=d&8191;var l=d>>>13;var p=i[1]|0;var b=p&8191;var v=p>>>13;var m=i[2]|0;var y=m&8191;var g=m>>>13;var _=i[3]|0;var w=_&8191;var M=_>>>13;var E=i[4]|0;var B=E&8191;var k=E>>>13;var A=i[5]|0;var N=A&8191;var P=A>>>13;var x=i[6]|0;var T=x&8191;var I=x>>>13;var C=i[7]|0;var D=C&8191;var O=C>>>13;var j=i[8]|0;var L=j&8191;var q=j>>>13;var H=i[9]|0;var F=H&8191;var U=H>>>13;var z=n[0]|0;var W=z&8191;var V=z>>>13;var G=n[1]|0;var J=G&8191;var Z=G>>>13;var X=n[2]|0;var Y=X&8191;var $=X>>>13;var Q=n[3]|0;var ee=Q&8191;var te=Q>>>13;var re=n[4]|0;var ie=re&8191;var ne=re>>>13;var ae=n[5]|0;var fe=ae&8191;var se=ae>>>13;var oe=n[6]|0;var ue=oe&8191;var he=oe>>>13;var de=n[7]|0;var ce=de&8191;var le=de>>>13;var pe=n[8]|0;var be=pe&8191;var ve=pe>>>13;var me=n[9]|0;var ye=me&8191;var ge=me>>>13;r.negative=e.negative^t.negative;r.length=19;o=Math.imul(c,W);u=Math.imul(c,V);u=u+Math.imul(l,W)|0;h=Math.imul(l,V);var _e=(s+o|0)+((u&8191)<<13)|0;s=(h+(u>>>13)|0)+(_e>>>26)|0;_e&=67108863;o=Math.imul(b,W);u=Math.imul(b,V);u=u+Math.imul(v,W)|0;h=Math.imul(v,V);o=o+Math.imul(c,J)|0;u=u+Math.imul(c,Z)|0;u=u+Math.imul(l,J)|0;h=h+Math.imul(l,Z)|0;var we=(s+o|0)+((u&8191)<<13)|0;s=(h+(u>>>13)|0)+(we>>>26)|0;we&=67108863;o=Math.imul(y,W);u=Math.imul(y,V);u=u+Math.imul(g,W)|0;h=Math.imul(g,V);o=o+Math.imul(b,J)|0;u=u+Math.imul(b,Z)|0;u=u+Math.imul(v,J)|0;h=h+Math.imul(v,Z)|0;o=o+Math.imul(c,Y)|0;u=u+Math.imul(c,$)|0;u=u+Math.imul(l,Y)|0;h=h+Math.imul(l,$)|0;var Me=(s+o|0)+((u&8191)<<13)|0;s=(h+(u>>>13)|0)+(Me>>>26)|0;Me&=67108863;o=Math.imul(w,W);u=Math.imul(w,V);u=u+Math.imul(M,W)|0;h=Math.imul(M,V);o=o+Math.imul(y,J)|0;u=u+Math.imul(y,Z)|0;u=u+Math.imul(g,J)|0;h=h+Math.imul(g,Z)|0;o=o+Math.imul(b,Y)|0;u=u+Math.imul(b,$)|0;u=u+Math.imul(v,Y)|0;h=h+Math.imul(v,$)|0;o=o+Math.imul(c,ee)|0;u=u+Math.imul(c,te)|0;u=u+Math.imul(l,ee)|0;h=h+Math.imul(l,te)|0;var Se=(s+o|0)+((u&8191)<<13)|0;s=(h+(u>>>13)|0)+(Se>>>26)|0;Se&=67108863;o=Math.imul(B,W);u=Math.imul(B,V);u=u+Math.imul(k,W)|0;h=Math.imul(k,V);o=o+Math.imul(w,J)|0;u=u+Math.imul(w,Z)|0;u=u+Math.imul(M,J)|0;h=h+Math.imul(M,Z)|0;o=o+Math.imul(y,Y)|0;u=u+Math.imul(y,$)|0;u=u+Math.imul(g,Y)|0;h=h+Math.imul(g,$)|0;o=o+Math.imul(b,ee)|0;u=u+Math.imul(b,te)|0;u=u+Math.imul(v,ee)|0;h=h+Math.imul(v,te)|0;o=o+Math.imul(c,ie)|0;u=u+Math.imul(c,ne)|0;u=u+Math.imul(l,ie)|0;h=h+Math.imul(l,ne)|0;var Ee=(s+o|0)+((u&8191)<<13)|0;s=(h+(u>>>13)|0)+(Ee>>>26)|0;Ee&=67108863;o=Math.imul(N,W);u=Math.imul(N,V);u=u+Math.imul(P,W)|0;h=Math.imul(P,V);o=o+Math.imul(B,J)|0;u=u+Math.imul(B,Z)|0;u=u+Math.imul(k,J)|0;h=h+Math.imul(k,Z)|0;o=o+Math.imul(w,Y)|0;u=u+Math.imul(w,$)|0;u=u+Math.imul(M,Y)|0;h=h+Math.imul(M,$)|0;o=o+Math.imul(y,ee)|0;u=u+Math.imul(y,te)|0;u=u+Math.imul(g,ee)|0;h=h+Math.imul(g,te)|0;o=o+Math.imul(b,ie)|0;u=u+Math.imul(b,ne)|0;u=u+Math.imul(v,ie)|0;h=h+Math.imul(v,ne)|0;o=o+Math.imul(c,fe)|0;u=u+Math.imul(c,se)|0;u=u+Math.imul(l,fe)|0;h=h+Math.imul(l,se)|0;var Be=(s+o|0)+((u&8191)<<13)|0;s=(h+(u>>>13)|0)+(Be>>>26)|0;Be&=67108863;o=Math.imul(T,W);u=Math.imul(T,V);u=u+Math.imul(I,W)|0;h=Math.imul(I,V);o=o+Math.imul(N,J)|0;u=u+Math.imul(N,Z)|0;u=u+Math.imul(P,J)|0;h=h+Math.imul(P,Z)|0;o=o+Math.imul(B,Y)|0;u=u+Math.imul(B,$)|0;u=u+Math.imul(k,Y)|0;h=h+Math.imul(k,$)|0;o=o+Math.imul(w,ee)|0;u=u+Math.imul(w,te)|0;u=u+Math.imul(M,ee)|0;h=h+Math.imul(M,te)|0;o=o+Math.imul(y,ie)|0;u=u+Math.imul(y,ne)|0;u=u+Math.imul(g,ie)|0;h=h+Math.imul(g,ne)|0;o=o+Math.imul(b,fe)|0;u=u+Math.imul(b,se)|0;u=u+Math.imul(v,fe)|0;h=h+Math.imul(v,se)|0;o=o+Math.imul(c,ue)|0;u=u+Math.imul(c,he)|0;u=u+Math.imul(l,ue)|0;h=h+Math.imul(l,he)|0;var Re=(s+o|0)+((u&8191)<<13)|0;s=(h+(u>>>13)|0)+(Re>>>26)|0;Re&=67108863;o=Math.imul(D,W);u=Math.imul(D,V);u=u+Math.imul(O,W)|0;h=Math.imul(O,V);o=o+Math.imul(T,J)|0;u=u+Math.imul(T,Z)|0;u=u+Math.imul(I,J)|0;h=h+Math.imul(I,Z)|0;o=o+Math.imul(N,Y)|0;u=u+Math.imul(N,$)|0;u=u+Math.imul(P,Y)|0;h=h+Math.imul(P,$)|0;o=o+Math.imul(B,ee)|0;u=u+Math.imul(B,te)|0;u=u+Math.imul(k,ee)|0;h=h+Math.imul(k,te)|0;o=o+Math.imul(w,ie)|0;u=u+Math.imul(w,ne)|0;u=u+Math.imul(M,ie)|0;h=h+Math.imul(M,ne)|0;o=o+Math.imul(y,fe)|0;u=u+Math.imul(y,se)|0;u=u+Math.imul(g,fe)|0;h=h+Math.imul(g,se)|0;o=o+Math.imul(b,ue)|0;u=u+Math.imul(b,he)|0;u=u+Math.imul(v,ue)|0;h=h+Math.imul(v,he)|0;o=o+Math.imul(c,ce)|0;u=u+Math.imul(c,le)|0;u=u+Math.imul(l,ce)|0;h=h+Math.imul(l,le)|0;var ke=(s+o|0)+((u&8191)<<13)|0;s=(h+(u>>>13)|0)+(ke>>>26)|0;ke&=67108863;o=Math.imul(L,W);u=Math.imul(L,V);u=u+Math.imul(q,W)|0;h=Math.imul(q,V);o=o+Math.imul(D,J)|0;u=u+Math.imul(D,Z)|0;u=u+Math.imul(O,J)|0;h=h+Math.imul(O,Z)|0;o=o+Math.imul(T,Y)|0;u=u+Math.imul(T,$)|0;u=u+Math.imul(I,Y)|0;h=h+Math.imul(I,$)|0;o=o+Math.imul(N,ee)|0;u=u+Math.imul(N,te)|0;u=u+Math.imul(P,ee)|0;h=h+Math.imul(P,te)|0;o=o+Math.imul(B,ie)|0;u=u+Math.imul(B,ne)|0;u=u+Math.imul(k,ie)|0;h=h+Math.imul(k,ne)|0;o=o+Math.imul(w,fe)|0;u=u+Math.imul(w,se)|0;u=u+Math.imul(M,fe)|0;h=h+Math.imul(M,se)|0;o=o+Math.imul(y,ue)|0;u=u+Math.imul(y,he)|0;u=u+Math.imul(g,ue)|0;h=h+Math.imul(g,he)|0;o=o+Math.imul(b,ce)|0;u=u+Math.imul(b,le)|0;u=u+Math.imul(v,ce)|0;h=h+Math.imul(v,le)|0;o=o+Math.imul(c,be)|0;u=u+Math.imul(c,ve)|0;u=u+Math.imul(l,be)|0;h=h+Math.imul(l,ve)|0;var Ae=(s+o|0)+((u&8191)<<13)|0;s=(h+(u>>>13)|0)+(Ae>>>26)|0;Ae&=67108863;o=Math.imul(F,W);u=Math.imul(F,V);u=u+Math.imul(U,W)|0;h=Math.imul(U,V);o=o+Math.imul(L,J)|0;u=u+Math.imul(L,Z)|0;u=u+Math.imul(q,J)|0;h=h+Math.imul(q,Z)|0;o=o+Math.imul(D,Y)|0;u=u+Math.imul(D,$)|0;u=u+Math.imul(O,Y)|0;h=h+Math.imul(O,$)|0;o=o+Math.imul(T,ee)|0;u=u+Math.imul(T,te)|0;u=u+Math.imul(I,ee)|0;h=h+Math.imul(I,te)|0;o=o+Math.imul(N,ie)|0;u=u+Math.imul(N,ne)|0;u=u+Math.imul(P,ie)|0;h=h+Math.imul(P,ne)|0;o=o+Math.imul(B,fe)|0;u=u+Math.imul(B,se)|0;u=u+Math.imul(k,fe)|0;h=h+Math.imul(k,se)|0;o=o+Math.imul(w,ue)|0;u=u+Math.imul(w,he)|0;u=u+Math.imul(M,ue)|0;h=h+Math.imul(M,he)|0;o=o+Math.imul(y,ce)|0;u=u+Math.imul(y,le)|0;u=u+Math.imul(g,ce)|0;h=h+Math.imul(g,le)|0;o=o+Math.imul(b,be)|0;u=u+Math.imul(b,ve)|0;u=u+Math.imul(v,be)|0;h=h+Math.imul(v,ve)|0;o=o+Math.imul(c,ye)|0;u=u+Math.imul(c,ge)|0;u=u+Math.imul(l,ye)|0;h=h+Math.imul(l,ge)|0;var Ne=(s+o|0)+((u&8191)<<13)|0;s=(h+(u>>>13)|0)+(Ne>>>26)|0;Ne&=67108863;o=Math.imul(F,J);u=Math.imul(F,Z);u=u+Math.imul(U,J)|0;h=Math.imul(U,Z);o=o+Math.imul(L,Y)|0;u=u+Math.imul(L,$)|0;u=u+Math.imul(q,Y)|0;h=h+Math.imul(q,$)|0;o=o+Math.imul(D,ee)|0;u=u+Math.imul(D,te)|0;u=u+Math.imul(O,ee)|0;h=h+Math.imul(O,te)|0;o=o+Math.imul(T,ie)|0;u=u+Math.imul(T,ne)|0;u=u+Math.imul(I,ie)|0;h=h+Math.imul(I,ne)|0;o=o+Math.imul(N,fe)|0;u=u+Math.imul(N,se)|0;u=u+Math.imul(P,fe)|0;h=h+Math.imul(P,se)|0;o=o+Math.imul(B,ue)|0;u=u+Math.imul(B,he)|0;u=u+Math.imul(k,ue)|0;h=h+Math.imul(k,he)|0;o=o+Math.imul(w,ce)|0;u=u+Math.imul(w,le)|0;u=u+Math.imul(M,ce)|0;h=h+Math.imul(M,le)|0;o=o+Math.imul(y,be)|0;u=u+Math.imul(y,ve)|0;u=u+Math.imul(g,be)|0;h=h+Math.imul(g,ve)|0;o=o+Math.imul(b,ye)|0;u=u+Math.imul(b,ge)|0;u=u+Math.imul(v,ye)|0;h=h+Math.imul(v,ge)|0;var Pe=(s+o|0)+((u&8191)<<13)|0;s=(h+(u>>>13)|0)+(Pe>>>26)|0;Pe&=67108863;o=Math.imul(F,Y);u=Math.imul(F,$);u=u+Math.imul(U,Y)|0;h=Math.imul(U,$);o=o+Math.imul(L,ee)|0;u=u+Math.imul(L,te)|0;u=u+Math.imul(q,ee)|0;h=h+Math.imul(q,te)|0;o=o+Math.imul(D,ie)|0;u=u+Math.imul(D,ne)|0;u=u+Math.imul(O,ie)|0;h=h+Math.imul(O,ne)|0;o=o+Math.imul(T,fe)|0;u=u+Math.imul(T,se)|0;u=u+Math.imul(I,fe)|0;h=h+Math.imul(I,se)|0;o=o+Math.imul(N,ue)|0;u=u+Math.imul(N,he)|0;u=u+Math.imul(P,ue)|0;h=h+Math.imul(P,he)|0;o=o+Math.imul(B,ce)|0;u=u+Math.imul(B,le)|0;u=u+Math.imul(k,ce)|0;h=h+Math.imul(k,le)|0;o=o+Math.imul(w,be)|0;u=u+Math.imul(w,ve)|0;u=u+Math.imul(M,be)|0;h=h+Math.imul(M,ve)|0;o=o+Math.imul(y,ye)|0;u=u+Math.imul(y,ge)|0;u=u+Math.imul(g,ye)|0;h=h+Math.imul(g,ge)|0;var xe=(s+o|0)+((u&8191)<<13)|0;s=(h+(u>>>13)|0)+(xe>>>26)|0;xe&=67108863;o=Math.imul(F,ee);u=Math.imul(F,te);u=u+Math.imul(U,ee)|0;h=Math.imul(U,te);o=o+Math.imul(L,ie)|0;u=u+Math.imul(L,ne)|0;u=u+Math.imul(q,ie)|0;h=h+Math.imul(q,ne)|0;o=o+Math.imul(D,fe)|0;u=u+Math.imul(D,se)|0;u=u+Math.imul(O,fe)|0;h=h+Math.imul(O,se)|0;o=o+Math.imul(T,ue)|0;u=u+Math.imul(T,he)|0;u=u+Math.imul(I,ue)|0;h=h+Math.imul(I,he)|0;o=o+Math.imul(N,ce)|0;u=u+Math.imul(N,le)|0;u=u+Math.imul(P,ce)|0;h=h+Math.imul(P,le)|0;o=o+Math.imul(B,be)|0;u=u+Math.imul(B,ve)|0;u=u+Math.imul(k,be)|0;h=h+Math.imul(k,ve)|0;o=o+Math.imul(w,ye)|0;u=u+Math.imul(w,ge)|0;u=u+Math.imul(M,ye)|0;h=h+Math.imul(M,ge)|0;var Te=(s+o|0)+((u&8191)<<13)|0;s=(h+(u>>>13)|0)+(Te>>>26)|0;Te&=67108863;o=Math.imul(F,ie);u=Math.imul(F,ne);u=u+Math.imul(U,ie)|0;h=Math.imul(U,ne);o=o+Math.imul(L,fe)|0;u=u+Math.imul(L,se)|0;u=u+Math.imul(q,fe)|0;h=h+Math.imul(q,se)|0;o=o+Math.imul(D,ue)|0;u=u+Math.imul(D,he)|0;u=u+Math.imul(O,ue)|0;h=h+Math.imul(O,he)|0;o=o+Math.imul(T,ce)|0;u=u+Math.imul(T,le)|0;u=u+Math.imul(I,ce)|0;h=h+Math.imul(I,le)|0;o=o+Math.imul(N,be)|0;u=u+Math.imul(N,ve)|0;u=u+Math.imul(P,be)|0;h=h+Math.imul(P,ve)|0;o=o+Math.imul(B,ye)|0;u=u+Math.imul(B,ge)|0;u=u+Math.imul(k,ye)|0;h=h+Math.imul(k,ge)|0;var Ie=(s+o|0)+((u&8191)<<13)|0;s=(h+(u>>>13)|0)+(Ie>>>26)|0;Ie&=67108863;o=Math.imul(F,fe);u=Math.imul(F,se);u=u+Math.imul(U,fe)|0;h=Math.imul(U,se);o=o+Math.imul(L,ue)|0;u=u+Math.imul(L,he)|0;u=u+Math.imul(q,ue)|0;h=h+Math.imul(q,he)|0;o=o+Math.imul(D,ce)|0;u=u+Math.imul(D,le)|0;u=u+Math.imul(O,ce)|0;h=h+Math.imul(O,le)|0;o=o+Math.imul(T,be)|0;u=u+Math.imul(T,ve)|0;u=u+Math.imul(I,be)|0;h=h+Math.imul(I,ve)|0;o=o+Math.imul(N,ye)|0;u=u+Math.imul(N,ge)|0;u=u+Math.imul(P,ye)|0;h=h+Math.imul(P,ge)|0;var Ce=(s+o|0)+((u&8191)<<13)|0;s=(h+(u>>>13)|0)+(Ce>>>26)|0;Ce&=67108863;o=Math.imul(F,ue);u=Math.imul(F,he);u=u+Math.imul(U,ue)|0;h=Math.imul(U,he);o=o+Math.imul(L,ce)|0;u=u+Math.imul(L,le)|0;u=u+Math.imul(q,ce)|0;h=h+Math.imul(q,le)|0;o=o+Math.imul(D,be)|0;u=u+Math.imul(D,ve)|0;u=u+Math.imul(O,be)|0;h=h+Math.imul(O,ve)|0;o=o+Math.imul(T,ye)|0;u=u+Math.imul(T,ge)|0;u=u+Math.imul(I,ye)|0;h=h+Math.imul(I,ge)|0;var De=(s+o|0)+((u&8191)<<13)|0;s=(h+(u>>>13)|0)+(De>>>26)|0;De&=67108863;o=Math.imul(F,ce);u=Math.imul(F,le);u=u+Math.imul(U,ce)|0;h=Math.imul(U,le);o=o+Math.imul(L,be)|0;u=u+Math.imul(L,ve)|0;u=u+Math.imul(q,be)|0;h=h+Math.imul(q,ve)|0;o=o+Math.imul(D,ye)|0;u=u+Math.imul(D,ge)|0;u=u+Math.imul(O,ye)|0;h=h+Math.imul(O,ge)|0;var Oe=(s+o|0)+((u&8191)<<13)|0;s=(h+(u>>>13)|0)+(Oe>>>26)|0;Oe&=67108863;o=Math.imul(F,be);u=Math.imul(F,ve);u=u+Math.imul(U,be)|0;h=Math.imul(U,ve);o=o+Math.imul(L,ye)|0;u=u+Math.imul(L,ge)|0;u=u+Math.imul(q,ye)|0;h=h+Math.imul(q,ge)|0;var je=(s+o|0)+((u&8191)<<13)|0;s=(h+(u>>>13)|0)+(je>>>26)|0;je&=67108863;o=Math.imul(F,ye);u=Math.imul(F,ge);u=u+Math.imul(U,ye)|0;h=Math.imul(U,ge);var Le=(s+o|0)+((u&8191)<<13)|0;s=(h+(u>>>13)|0)+(Le>>>26)|0;Le&=67108863;a[0]=_e;a[1]=we;a[2]=Me;a[3]=Se;a[4]=Ee;a[5]=Be;a[6]=Re;a[7]=ke;a[8]=Ae;a[9]=Ne;a[10]=Pe;a[11]=xe;a[12]=Te;a[13]=Ie;a[14]=Ce;a[15]=De;a[16]=Oe;a[17]=je;a[18]=Le;if(s!==0){a[19]=s;r.length++}return r};if(!Math.imul){u=smallMulTo}function bigMulTo(e,t,r){r.negative=t.negative^e.negative;r.length=e.length+t.length;var i=0;var n=0;for(var a=0;a>>26)|0;n+=s>>>26;s&=67108863}r.words[a]=o;i=s;s=n}if(i!==0){r.words[a]=i}else{r.length--}return r._strip()}function jumboMulTo(e,t,r){return bigMulTo(e,t,r)}BN.prototype.mulTo=function mulTo(e,t){var r;var i=this.length+e.length;if(this.length===10&&e.length===10){r=u(this,e,t)}else if(i<63){r=smallMulTo(this,e,t)}else if(i<1024){r=bigMulTo(this,e,t)}else{r=jumboMulTo(this,e,t)}return r};function FFTM(e,t){this.x=e;this.y=t}FFTM.prototype.makeRBT=function makeRBT(e){var t=new Array(e);var r=BN.prototype._countBits(e)-1;for(var i=0;i>=1}return i};FFTM.prototype.permute=function permute(e,t,r,i,n,a){for(var s=0;s>>1){n++}return 1<>>13;r[2*a+1]=n&8191;n=n>>>13}for(a=2*t;a>=26;r+=n/67108864|0;r+=a>>>26;this.words[i]=a&67108863}if(r!==0){this.words[i]=r;this.length++}return t?this.ineg():this};BN.prototype.muln=function muln(e){return this.clone().imuln(e)};BN.prototype.sqr=function sqr(){return this.mul(this)};BN.prototype.isqr=function isqr(){return this.imul(this.clone())};BN.prototype.pow=function pow(e){var t=toBitArray(e);if(t.length===0)return new BN(1);var r=this;for(var i=0;i=0);var t=e%26;var r=(e-t)/26;var i=67108863>>>26-t<<26-t;var n;if(t!==0){var a=0;for(n=0;n>>26-t}if(a){this.words[n]=a;this.length++}}if(r!==0){for(n=this.length-1;n>=0;n--){this.words[n+r]=this.words[n]}for(n=0;n=0);var i;if(t){i=(t-t%26)/26}else{i=0}var n=e%26;var a=Math.min((e-n)/26,this.length);var s=67108863^67108863>>>n<a){this.length-=a;for(u=0;u=0&&(h!==0||u>=i);u--){var d=this.words[u]|0;this.words[u]=h<<26-n|d>>>n;h=d&s}if(o&&h!==0){o.words[o.length++]=h}if(this.length===0){this.words[0]=0;this.length=1}return this._strip()};BN.prototype.ishrn=function ishrn(e,t,r){assert(this.negative===0);return this.iushrn(e,t,r)};BN.prototype.shln=function shln(e){return this.clone().ishln(e)};BN.prototype.ushln=function ushln(e){return this.clone().iushln(e)};BN.prototype.shrn=function shrn(e){return this.clone().ishrn(e)};BN.prototype.ushrn=function ushrn(e){return this.clone().iushrn(e)};BN.prototype.testn=function testn(e){assert(typeof e==="number"&&e>=0);var t=e%26;var r=(e-t)/26;var i=1<=0);var t=e%26;var r=(e-t)/26;assert(this.negative===0,"imaskn works only with positive numbers");if(this.length<=r){return this}if(t!==0){r++}this.length=Math.min(r,this.length);if(t!==0){var i=67108863^67108863>>>t<=67108864;t++){this.words[t]-=67108864;if(t===this.length-1){this.words[t+1]=1}else{this.words[t+1]++}}this.length=Math.max(this.length,t+1);return this};BN.prototype.isubn=function isubn(e){assert(typeof e==="number");assert(e<67108864);if(e<0)return this.iaddn(-e);if(this.negative!==0){this.negative=0;this.iaddn(e);this.negative=1;return this}this.words[0]-=e;if(this.length===1&&this.words[0]<0){this.words[0]=-this.words[0];this.negative=1}else{for(var t=0;t>26)-(o/67108864|0);this.words[n+r]=a&67108863}for(;n>26;this.words[n+r]=a&67108863}if(s===0)return this._strip();assert(s===-1);s=0;for(n=0;n>26;this.words[n]=a&67108863}this.negative=1;return this._strip()};BN.prototype._wordDiv=function _wordDiv(e,t){var r=this.length-e.length;var i=this.clone();var n=e;var a=n.words[n.length-1]|0;var s=this._countBits(a);r=26-s;if(r!==0){n=n.ushln(r);i.iushln(r);a=n.words[n.length-1]|0}var o=i.length-n.length;var u;if(t!=="mod"){u=new BN(null);u.length=o+1;u.words=new Array(u.length);for(var h=0;h=0;c--){var l=(i.words[n.length+c]|0)*67108864+(i.words[n.length+c-1]|0);l=Math.min(l/a|0,67108863);i._ishlnsubmul(n,l,c);while(i.negative!==0){l--;i.negative=0;i._ishlnsubmul(n,1,c);if(!i.isZero()){i.negative^=1}}if(u){u.words[c]=l}}if(u){u._strip()}i._strip();if(t!=="div"&&r!==0){i.iushrn(r)}return{div:u||null,mod:i}};BN.prototype.divmod=function divmod(e,t,r){assert(!e.isZero());if(this.isZero()){return{div:new BN(0),mod:new BN(0)}}var i,n,a;if(this.negative!==0&&e.negative===0){a=this.neg().divmod(e,t);if(t!=="mod"){i=a.div.neg()}if(t!=="div"){n=a.mod.neg();if(r&&n.negative!==0){n.iadd(e)}}return{div:i,mod:n}}if(this.negative===0&&e.negative!==0){a=this.divmod(e.neg(),t);if(t!=="mod"){i=a.div.neg()}return{div:i,mod:a.mod}}if((this.negative&e.negative)!==0){a=this.neg().divmod(e.neg(),t);if(t!=="div"){n=a.mod.neg();if(r&&n.negative!==0){n.isub(e)}}return{div:a.div,mod:n}}if(e.length>this.length||this.cmp(e)<0){return{div:new BN(0),mod:this}}if(e.length===1){if(t==="div"){return{div:this.divn(e.words[0]),mod:null}}if(t==="mod"){return{div:null,mod:new BN(this.modrn(e.words[0]))}}return{div:this.divn(e.words[0]),mod:new BN(this.modrn(e.words[0]))}}return this._wordDiv(e,t)};BN.prototype.div=function div(e){return this.divmod(e,"div",false).div};BN.prototype.mod=function mod(e){return this.divmod(e,"mod",false).mod};BN.prototype.umod=function umod(e){return this.divmod(e,"mod",true).mod};BN.prototype.divRound=function divRound(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var r=t.div.negative!==0?t.mod.isub(e):t.mod;var i=e.ushrn(1);var n=e.andln(1);var a=r.cmp(i);if(a<0||n===1&&a===0)return t.div;return t.div.negative!==0?t.div.isubn(1):t.div.iaddn(1)};BN.prototype.modrn=function modrn(e){var t=e<0;if(t)e=-e;assert(e<=67108863);var r=(1<<26)%e;var i=0;for(var n=this.length-1;n>=0;n--){i=(r*i+(this.words[n]|0))%e}return t?-i:i};BN.prototype.modn=function modn(e){return this.modrn(e)};BN.prototype.idivn=function idivn(e){var t=e<0;if(t)e=-e;assert(e<=67108863);var r=0;for(var i=this.length-1;i>=0;i--){var n=(this.words[i]|0)+r*67108864;this.words[i]=n/e|0;r=n%e}this._strip();return t?this.ineg():this};BN.prototype.divn=function divn(e){return this.clone().idivn(e)};BN.prototype.egcd=function egcd(e){assert(e.negative===0);assert(!e.isZero());var t=this;var r=e.clone();if(t.negative!==0){t=t.umod(e)}else{t=t.clone()}var i=new BN(1);var n=new BN(0);var a=new BN(0);var s=new BN(1);var o=0;while(t.isEven()&&r.isEven()){t.iushrn(1);r.iushrn(1);++o}var u=r.clone();var h=t.clone();while(!t.isZero()){for(var d=0,c=1;(t.words[0]&c)===0&&d<26;++d,c<<=1);if(d>0){t.iushrn(d);while(d-- >0){if(i.isOdd()||n.isOdd()){i.iadd(u);n.isub(h)}i.iushrn(1);n.iushrn(1)}}for(var l=0,p=1;(r.words[0]&p)===0&&l<26;++l,p<<=1);if(l>0){r.iushrn(l);while(l-- >0){if(a.isOdd()||s.isOdd()){a.iadd(u);s.isub(h)}a.iushrn(1);s.iushrn(1)}}if(t.cmp(r)>=0){t.isub(r);i.isub(a);n.isub(s)}else{r.isub(t);a.isub(i);s.isub(n)}}return{a:a,b:s,gcd:r.iushln(o)}};BN.prototype._invmp=function _invmp(e){assert(e.negative===0);assert(!e.isZero());var t=this;var r=e.clone();if(t.negative!==0){t=t.umod(e)}else{t=t.clone()}var i=new BN(1);var n=new BN(0);var a=r.clone();while(t.cmpn(1)>0&&r.cmpn(1)>0){for(var s=0,o=1;(t.words[0]&o)===0&&s<26;++s,o<<=1);if(s>0){t.iushrn(s);while(s-- >0){if(i.isOdd()){i.iadd(a)}i.iushrn(1)}}for(var u=0,h=1;(r.words[0]&h)===0&&u<26;++u,h<<=1);if(u>0){r.iushrn(u);while(u-- >0){if(n.isOdd()){n.iadd(a)}n.iushrn(1)}}if(t.cmp(r)>=0){t.isub(r);i.isub(n)}else{r.isub(t);n.isub(i)}}var d;if(t.cmpn(1)===0){d=i}else{d=n}if(d.cmpn(0)<0){d.iadd(e)}return d};BN.prototype.gcd=function gcd(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone();var r=e.clone();t.negative=0;r.negative=0;for(var i=0;t.isEven()&&r.isEven();i++){t.iushrn(1);r.iushrn(1)}do{while(t.isEven()){t.iushrn(1)}while(r.isEven()){r.iushrn(1)}var n=t.cmp(r);if(n<0){var a=t;t=r;r=a}else if(n===0||r.cmpn(1)===0){break}t.isub(r)}while(true);return r.iushln(i)};BN.prototype.invm=function invm(e){return this.egcd(e).a.umod(e)};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(e){return this.words[0]&e};BN.prototype.bincn=function bincn(e){assert(typeof e==="number");var t=e%26;var r=(e-t)/26;var i=1<>>26;s&=67108863;this.words[a]=s}if(n!==0){this.words[a]=n;this.length++}return this};BN.prototype.isZero=function isZero(){return this.length===1&&this.words[0]===0};BN.prototype.cmpn=function cmpn(e){var t=e<0;if(this.negative!==0&&!t)return-1;if(this.negative===0&&t)return 1;this._strip();var r;if(this.length>1){r=1}else{if(t){e=-e}assert(e<=67108863,"Number is too big");var i=this.words[0]|0;r=i===e?0:ie.length)return 1;if(this.length=0;r--){var i=this.words[r]|0;var n=e.words[r]|0;if(i===n)continue;if(in){t=1}break}return t};BN.prototype.gtn=function gtn(e){return this.cmpn(e)===1};BN.prototype.gt=function gt(e){return this.cmp(e)===1};BN.prototype.gten=function gten(e){return this.cmpn(e)>=0};BN.prototype.gte=function gte(e){return this.cmp(e)>=0};BN.prototype.ltn=function ltn(e){return this.cmpn(e)===-1};BN.prototype.lt=function lt(e){return this.cmp(e)===-1};BN.prototype.lten=function lten(e){return this.cmpn(e)<=0};BN.prototype.lte=function lte(e){return this.cmp(e)<=0};BN.prototype.eqn=function eqn(e){return this.cmpn(e)===0};BN.prototype.eq=function eq(e){return this.cmp(e)===0};BN.red=function red(e){return new Red(e)};BN.prototype.toRed=function toRed(e){assert(!this.red,"Already a number in reduction context");assert(this.negative===0,"red works only with positives");return e.convertTo(this)._forceRed(e)};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(e){this.red=e;return this};BN.prototype.forceRed=function forceRed(e){assert(!this.red,"Already a number in reduction context");return this._forceRed(e)};BN.prototype.redAdd=function redAdd(e){assert(this.red,"redAdd works only with red numbers");return this.red.add(this,e)};BN.prototype.redIAdd=function redIAdd(e){assert(this.red,"redIAdd works only with red numbers");return this.red.iadd(this,e)};BN.prototype.redSub=function redSub(e){assert(this.red,"redSub works only with red numbers");return this.red.sub(this,e)};BN.prototype.redISub=function redISub(e){assert(this.red,"redISub works only with red numbers");return this.red.isub(this,e)};BN.prototype.redShl=function redShl(e){assert(this.red,"redShl works only with red numbers");return this.red.shl(this,e)};BN.prototype.redMul=function redMul(e){assert(this.red,"redMul works only with red numbers");this.red._verify2(this,e);return this.red.mul(this,e)};BN.prototype.redIMul=function redIMul(e){assert(this.red,"redMul works only with red numbers");this.red._verify2(this,e);return this.red.imul(this,e)};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(e){assert(this.red&&!e.red,"redPow(normalNum)");this.red._verify1(this);return this.red.pow(this,e)};var h={k256:null,p224:null,p192:null,p25519:null};function MPrime(e,t){this.name=e;this.p=new BN(t,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 e=new BN(null);e.words=new Array(Math.ceil(this.n/13));return e};MPrime.prototype.ireduce=function ireduce(e){var t=e;var r;do{this.split(t,this.tmp);t=this.imulK(t);t=t.iadd(this.tmp);r=t.bitLength()}while(r>this.n);var i=r0){t.isub(this.p)}else{if(t.strip!==undefined){t.strip()}else{t._strip()}}return t};MPrime.prototype.split=function split(e,t){e.iushrn(this.n,0,t)};MPrime.prototype.imulK=function imulK(e){return e.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(e,t){var r=4194303;var i=Math.min(e.length,9);for(var n=0;n>>22;a=s}a>>>=22;e.words[n-10]=a;if(a===0&&e.length>10){e.length-=10}else{e.length-=9}};K256.prototype.imulK=function imulK(e){e.words[e.length]=0;e.words[e.length+1]=0;e.length+=2;var t=0;for(var r=0;r>>=26;e.words[r]=n;t=i}if(t!==0){e.words[e.length++]=t}return e};BN._prime=function prime(e){if(h[e])return h[e];var prime;if(e==="k256"){prime=new K256}else if(e==="p224"){prime=new P224}else if(e==="p192"){prime=new P192}else if(e==="p25519"){prime=new P25519}else{throw new Error("Unknown prime "+e)}h[e]=prime;return prime};function Red(e){if(typeof e==="string"){var t=BN._prime(e);this.m=t.p;this.prime=t}else{assert(e.gtn(1),"modulus must be greater than 1");this.m=e;this.prime=null}}Red.prototype._verify1=function _verify1(e){assert(e.negative===0,"red works only with positives");assert(e.red,"red works only with red numbers")};Red.prototype._verify2=function _verify2(e,t){assert((e.negative|t.negative)===0,"red works only with positives");assert(e.red&&e.red===t.red,"red works only with red numbers")};Red.prototype.imod=function imod(e){if(this.prime)return this.prime.ireduce(e)._forceRed(this);move(e,e.umod(this.m)._forceRed(this));return e};Red.prototype.neg=function neg(e){if(e.isZero()){return e.clone()}return this.m.sub(e)._forceRed(this)};Red.prototype.add=function add(e,t){this._verify2(e,t);var r=e.add(t);if(r.cmp(this.m)>=0){r.isub(this.m)}return r._forceRed(this)};Red.prototype.iadd=function iadd(e,t){this._verify2(e,t);var r=e.iadd(t);if(r.cmp(this.m)>=0){r.isub(this.m)}return r};Red.prototype.sub=function sub(e,t){this._verify2(e,t);var r=e.sub(t);if(r.cmpn(0)<0){r.iadd(this.m)}return r._forceRed(this)};Red.prototype.isub=function isub(e,t){this._verify2(e,t);var r=e.isub(t);if(r.cmpn(0)<0){r.iadd(this.m)}return r};Red.prototype.shl=function shl(e,t){this._verify1(e);return this.imod(e.ushln(t))};Red.prototype.imul=function imul(e,t){this._verify2(e,t);return this.imod(e.imul(t))};Red.prototype.mul=function mul(e,t){this._verify2(e,t);return this.imod(e.mul(t))};Red.prototype.isqr=function isqr(e){return this.imul(e,e.clone())};Red.prototype.sqr=function sqr(e){return this.mul(e,e)};Red.prototype.sqrt=function sqrt(e){if(e.isZero())return e.clone();var t=this.m.andln(3);assert(t%2===1);if(t===3){var r=this.m.add(new BN(1)).iushrn(2);return this.pow(e,r)}var i=this.m.subn(1);var n=0;while(!i.isZero()&&i.andln(1)===0){n++;i.iushrn(1)}assert(!i.isZero());var a=new BN(1).toRed(this);var s=a.redNeg();var o=this.m.subn(1).iushrn(1);var u=this.m.bitLength();u=new BN(2*u*u).toRed(this);while(this.pow(u,o).cmp(s)!==0){u.redIAdd(s)}var h=this.pow(u,i);var d=this.pow(e,i.addn(1).iushrn(1));var c=this.pow(e,i);var l=n;while(c.cmp(a)!==0){var p=c;for(var b=0;p.cmp(a)!==0;b++){p=p.redSqr()}assert(b=0;n--){var h=t.words[n];for(var d=u-1;d>=0;d--){var c=h>>d&1;if(a!==i[0]){a=this.sqr(a)}if(c===0&&s===0){o=0;continue}s<<=1;s|=c;o++;if(o!==r&&(n!==0||d!==0))continue;a=this.mul(a,i[s]);o=0;s=0}u=26}return a};Red.prototype.convertTo=function convertTo(e){var t=e.umod(this.m);return t===e?t.clone():t};Red.prototype.convertFrom=function convertFrom(e){var t=e.clone();t.red=null;return t};BN.mont=function mont(e){return new Mont(e)};function Mont(e){Red.call(this,e);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(e){return this.imod(e.ushln(this.shift))};Mont.prototype.convertFrom=function convertFrom(e){var t=this.imod(e.mul(this.rinv));t.red=null;return t};Mont.prototype.imul=function imul(e,t){if(e.isZero()||t.isZero()){e.words[0]=0;e.length=1;return e}var r=e.imul(t);var i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m);var n=r.isub(i).iushrn(this.shift);var a=n;if(n.cmp(this.m)>=0){a=n.isub(this.m)}else if(n.cmpn(0)<0){a=n.iadd(this.m)}return a._forceRed(this)};Mont.prototype.mul=function mul(e,t){if(e.isZero()||t.isZero())return new BN(0)._forceRed(this);var r=e.mul(t);var i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m);var n=r.isub(i).iushrn(this.shift);var a=n;if(n.cmp(this.m)>=0){a=n.isub(this.m)}else if(n.cmpn(0)<0){a=n.iadd(this.m)}return a._forceRed(this)};Mont.prototype.invm=function invm(e){var t=this.imod(e._invmp(this.m).mul(this.r2));return t._forceRed(this)}})(false||e,this)},42:function(e){"use strict";const t={};function createErrorType(e,r,i){if(!i){i=Error}function getMessage(e,t,i){if(typeof r==="string"){return r}else{return r(e,t,i)}}class NodeError extends i{constructor(e,t,r){super(getMessage(e,t,r))}}NodeError.prototype.name=i.name;NodeError.prototype.code=e;t[e]=NodeError}function oneOf(e,t){if(Array.isArray(e)){const r=e.length;e=e.map((e=>String(e)));if(r>2){return`one of ${t} ${e.slice(0,r-1).join(", ")}, or `+e[r-1]}else if(r===2){return`one of ${t} ${e[0]} or ${e[1]}`}else{return`of ${t} ${e[0]}`}}else{return`of ${t} ${String(e)}`}}function startsWith(e,t,r){return e.substr(!r||r<0?0:+r,t.length)===t}function endsWith(e,t,r){if(r===undefined||r>e.length){r=e.length}return e.substring(r-t.length,r)===t}function includes(e,t,r){if(typeof r!=="number"){r=0}if(r+t.length>e.length){return false}else{return e.indexOf(t,r)!==-1}}createErrorType("ERR_INVALID_OPT_VALUE",(function(e,t){return'The value "'+t+'" is invalid for option "'+e+'"'}),TypeError);createErrorType("ERR_INVALID_ARG_TYPE",(function(e,t,r){let i;if(typeof t==="string"&&startsWith(t,"not ")){i="must not be";t=t.replace(/^not /,"")}else{i="must be"}let n;if(endsWith(e," argument")){n=`The ${e} ${i} ${oneOf(t,"type")}`}else{const r=includes(e,".")?"property":"argument";n=`The "${e}" ${r} ${i} ${oneOf(t,"type")}`}n+=`. Received type ${typeof r}`;return n}),TypeError);createErrorType("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF");createErrorType("ERR_METHOD_NOT_IMPLEMENTED",(function(e){return"The "+e+" method is not implemented"}));createErrorType("ERR_STREAM_PREMATURE_CLOSE","Premature close");createErrorType("ERR_STREAM_DESTROYED",(function(e){return"Cannot call "+e+" after a stream was destroyed"}));createErrorType("ERR_MULTIPLE_CALLBACK","Callback called multiple times");createErrorType("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable");createErrorType("ERR_STREAM_WRITE_AFTER_END","write after end");createErrorType("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError);createErrorType("ERR_UNKNOWN_ENCODING",(function(e){return"Unknown encoding: "+e}),TypeError);createErrorType("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event");e.exports.q=t},6744:function(e,t,r){"use strict";var i=Object.keys||function(e){var t=[];for(var r in e){t.push(r)}return t};e.exports=Duplex;var n=r(8318);var a=r(3877);r(7526)(Duplex,n);{var s=i(a.prototype);for(var o=0;o0){if(typeof t!=="string"&&!a.objectMode&&Object.getPrototypeOf(t)!==o.prototype){t=_uint8ArrayToBuffer(t)}if(i){if(a.endEmitted)B(e,new _);else addChunk(e,a,t,true)}else if(a.ended){B(e,new y)}else if(a.destroyed){return false}else{a.reading=false;if(a.decoder&&!r){t=a.decoder.write(t);if(a.objectMode||t.length!==0)addChunk(e,a,t,false);else maybeReadMore(e,a)}else{addChunk(e,a,t,false)}}}else if(!i){a.reading=false;maybeReadMore(e,a)}}return!a.ended&&(a.length=A){e=A}else{e--;e|=e>>>1;e|=e>>>2;e|=e>>>4;e|=e>>>8;e|=e>>>16;e++}return e}function howMuchToRead(e,t){if(e<=0||t.length===0&&t.ended)return 0;if(t.objectMode)return 1;if(e!==e){if(t.flowing&&t.length)return t.buffer.head.data.length;else return t.length}if(e>t.highWaterMark)t.highWaterMark=computeNewHighWaterMark(e);if(e<=t.length)return e;if(!t.ended){t.needReadable=true;return 0}return t.length}Readable.prototype.read=function(e){d("read",e);e=parseInt(e,10);var t=this._readableState;var r=e;if(e!==0)t.emittedReadable=false;if(e===0&&t.needReadable&&((t.highWaterMark!==0?t.length>=t.highWaterMark:t.length>0)||t.ended)){d("read: emitReadable",t.length,t.ended);if(t.length===0&&t.ended)endReadable(this);else emitReadable(this);return null}e=howMuchToRead(e,t);if(e===0&&t.ended){if(t.length===0)endReadable(this);return null}var i=t.needReadable;d("need readable",i);if(t.length===0||t.length-e0)n=fromList(e,t);else n=null;if(n===null){t.needReadable=t.length<=t.highWaterMark;e=0}else{t.length-=e;t.awaitDrain=0}if(t.length===0){if(!t.ended)t.needReadable=true;if(r!==e&&t.ended)endReadable(this)}if(n!==null)this.emit("data",n);return n};function onEofChunk(e,t){d("onEofChunk");if(t.ended)return;if(t.decoder){var r=t.decoder.end();if(r&&r.length){t.buffer.push(r);t.length+=t.objectMode?1:r.length}}t.ended=true;if(t.sync){emitReadable(e)}else{t.needReadable=false;if(!t.emittedReadable){t.emittedReadable=true;emitReadable_(e)}}}function emitReadable(e){var t=e._readableState;d("emitReadable",t.needReadable,t.emittedReadable);t.needReadable=false;if(!t.emittedReadable){d("emitReadable",t.flowing);t.emittedReadable=true;process.nextTick(emitReadable_,e)}}function emitReadable_(e){var t=e._readableState;d("emitReadable_",t.destroyed,t.length,t.ended);if(!t.destroyed&&(t.length||t.ended)){e.emit("readable");t.emittedReadable=false}t.needReadable=!t.flowing&&!t.ended&&t.length<=t.highWaterMark;flow(e)}function maybeReadMore(e,t){if(!t.readingMore){t.readingMore=true;process.nextTick(maybeReadMore_,e,t)}}function maybeReadMore_(e,t){while(!t.reading&&!t.ended&&(t.length1&&indexOf(i.pipes,e)!==-1)&&!u){d("false write response, pause",i.awaitDrain);i.awaitDrain++}r.pause()}}function onerror(t){d("onerror",t);unpipe();e.removeListener("error",onerror);if(a(e,"error")===0)B(e,t)}prependListener(e,"error",onerror);function onclose(){e.removeListener("finish",onfinish);unpipe()}e.once("close",onclose);function onfinish(){d("onfinish");e.removeListener("close",onclose);unpipe()}e.once("finish",onfinish);function unpipe(){d("unpipe");r.unpipe(e)}e.emit("pipe",r);if(!i.flowing){d("pipe resume");r.resume()}return e};function pipeOnDrain(e){return function pipeOnDrainFunctionResult(){var t=e._readableState;d("pipeOnDrain",t.awaitDrain);if(t.awaitDrain)t.awaitDrain--;if(t.awaitDrain===0&&a(e,"data")){t.flowing=true;flow(e)}}}Readable.prototype.unpipe=function(e){var t=this._readableState;var r={hasUnpiped:false};if(t.pipesCount===0)return this;if(t.pipesCount===1){if(e&&e!==t.pipes)return this;if(!e)e=t.pipes;t.pipes=null;t.pipesCount=0;t.flowing=false;if(e)e.emit("unpipe",this,r);return this}if(!e){var i=t.pipes;var n=t.pipesCount;t.pipes=null;t.pipesCount=0;t.flowing=false;for(var a=0;a0;if(i.flowing!==false)this.resume()}else if(e==="readable"){if(!i.endEmitted&&!i.readableListening){i.readableListening=i.needReadable=true;i.flowing=false;i.emittedReadable=false;d("on readable",i.length,i.reading);if(i.length){emitReadable(this)}else if(!i.reading){process.nextTick(nReadingNextTick,this)}}}return r};Readable.prototype.addListener=Readable.prototype.on;Readable.prototype.removeListener=function(e,t){var r=s.prototype.removeListener.call(this,e,t);if(e==="readable"){process.nextTick(updateReadableListening,this)}return r};Readable.prototype.removeAllListeners=function(e){var t=s.prototype.removeAllListeners.apply(this,arguments);if(e==="readable"||e===undefined){process.nextTick(updateReadableListening,this)}return t};function updateReadableListening(e){var t=e._readableState;t.readableListening=e.listenerCount("readable")>0;if(t.resumeScheduled&&!t.paused){t.flowing=true}else if(e.listenerCount("data")>0){e.resume()}}function nReadingNextTick(e){d("readable nexttick read 0");e.read(0)}Readable.prototype.resume=function(){var e=this._readableState;if(!e.flowing){d("resume");e.flowing=!e.readableListening;resume(this,e)}e.paused=false;return this};function resume(e,t){if(!t.resumeScheduled){t.resumeScheduled=true;process.nextTick(resume_,e,t)}}function resume_(e,t){d("resume",t.reading);if(!t.reading){e.read(0)}t.resumeScheduled=false;e.emit("resume");flow(e);if(t.flowing&&!t.reading)e.read(0)}Readable.prototype.pause=function(){d("call pause flowing=%j",this._readableState.flowing);if(this._readableState.flowing!==false){d("pause");this._readableState.flowing=false;this.emit("pause")}this._readableState.paused=true;return this};function flow(e){var t=e._readableState;d("flow",t.flowing);while(t.flowing&&e.read()!==null){}}Readable.prototype.wrap=function(e){var t=this;var r=this._readableState;var i=false;e.on("end",(function(){d("wrapped end");if(r.decoder&&!r.ended){var e=r.decoder.end();if(e&&e.length)t.push(e)}t.push(null)}));e.on("data",(function(n){d("wrapped data");if(r.decoder)n=r.decoder.write(n);if(r.objectMode&&(n===null||n===undefined))return;else if(!r.objectMode&&(!n||!n.length))return;var a=t.push(n);if(!a){i=true;e.pause()}}));for(var n in e){if(this[n]===undefined&&typeof e[n]==="function"){this[n]=function methodWrap(t){return function methodWrapReturnFunction(){return e[t].apply(e,arguments)}}(n)}}for(var a=0;a=t.length){if(t.decoder)r=t.buffer.join("");else if(t.buffer.length===1)r=t.buffer.first();else r=t.buffer.concat(t.length);t.buffer.clear()}else{r=t.buffer.consume(e,t.decoder)}return r}function endReadable(e){var t=e._readableState;d("endReadable",t.endEmitted);if(!t.endEmitted){t.ended=true;process.nextTick(endReadableNT,t,e)}}function endReadableNT(e,t){d("endReadableNT",e.endEmitted,e.length);if(!e.endEmitted&&e.length===0){e.endEmitted=true;t.readable=false;t.emit("end");if(e.autoDestroy){var r=t._writableState;if(!r||r.autoDestroy&&r.finished){t.destroy()}}}}if(typeof Symbol==="function"){Readable.from=function(e,t){if(E===undefined){E=r(6171)}return E(Readable,e,t)}}function indexOf(e,t){for(var r=0,i=e.length;r-1))throw new _(e);this._writableState.defaultEncoding=e;return this};Object.defineProperty(Writable.prototype,"writableBuffer",{enumerable:false,get:function get(){return this._writableState&&this._writableState.getBuffer()}});function decodeChunk(e,t,r){if(!e.objectMode&&e.decodeStrings!==false&&typeof t==="string"){t=s.from(t,r)}return t}Object.defineProperty(Writable.prototype,"writableHighWaterMark",{enumerable:false,get:function get(){return this._writableState.highWaterMark}});function writeOrBuffer(e,t,r,i,n,a){if(!r){var s=decodeChunk(t,i,n);if(i!==s){r=true;n="buffer";i=s}}var o=t.objectMode?1:i.length;t.length+=o;var u=t.length0)this.tail.next=t;else this.head=t;this.tail=t;++this.length}},{key:"unshift",value:function unshift(e){var t={data:e,next:this.head};if(this.length===0)this.tail=t;this.head=t;++this.length}},{key:"shift",value:function shift(){if(this.length===0)return;var e=this.head.data;if(this.length===1)this.head=this.tail=null;else this.head=this.head.next;--this.length;return e}},{key:"clear",value:function clear(){this.head=this.tail=null;this.length=0}},{key:"join",value:function join(e){if(this.length===0)return"";var t=this.head;var r=""+t.data;while(t=t.next){r+=e+t.data}return r}},{key:"concat",value:function concat(e){if(this.length===0)return n.alloc(0);var t=n.allocUnsafe(e>>>0);var r=this.head;var i=0;while(r){copyBuffer(r.data,t,i);i+=r.data.length;r=r.next}return t}},{key:"consume",value:function consume(e,t){var r;if(en.length?n.length:e;if(a===n.length)i+=n;else i+=n.slice(0,e);e-=a;if(e===0){if(a===n.length){++r;if(t.next)this.head=t.next;else this.head=this.tail=null}else{this.head=t;t.data=n.slice(a)}break}++r}this.length-=r;return i}},{key:"_getBuffer",value:function _getBuffer(e){var t=n.allocUnsafe(e);var r=this.head;var i=1;r.data.copy(t);e-=r.data.length;while(r=r.next){var a=r.data;var s=e>a.length?a.length:e;a.copy(t,t.length-e,0,s);e-=s;if(e===0){if(s===a.length){++i;if(r.next)this.head=r.next;else this.head=this.tail=null}else{this.head=r;r.data=a.slice(s)}break}++i}this.length-=i;return t}},{key:o,value:function value(e,t){return s(this,_objectSpread({},t,{depth:0,customInspect:false}))}}]);return BufferList}()},9666:function(e){"use strict";function destroy(e,t){var r=this;var i=this._readableState&&this._readableState.destroyed;var n=this._writableState&&this._writableState.destroyed;if(i||n){if(t){t(e)}else if(e){if(!this._writableState){process.nextTick(emitErrorNT,this,e)}else if(!this._writableState.errorEmitted){this._writableState.errorEmitted=true;process.nextTick(emitErrorNT,this,e)}}return this}if(this._readableState){this._readableState.destroyed=true}if(this._writableState){this._writableState.destroyed=true}this._destroy(e||null,(function(e){if(!t&&e){if(!r._writableState){process.nextTick(emitErrorAndCloseNT,r,e)}else if(!r._writableState.errorEmitted){r._writableState.errorEmitted=true;process.nextTick(emitErrorAndCloseNT,r,e)}else{process.nextTick(emitCloseNT,r)}}else if(t){process.nextTick(emitCloseNT,r);t(e)}else{process.nextTick(emitCloseNT,r)}}));return this}function emitErrorAndCloseNT(e,t){emitErrorNT(e,t);emitCloseNT(e)}function emitCloseNT(e){if(e._writableState&&!e._writableState.emitClose)return;if(e._readableState&&!e._readableState.emitClose)return;e.emit("close")}function undestroy(){if(this._readableState){this._readableState.destroyed=false;this._readableState.reading=false;this._readableState.ended=false;this._readableState.endEmitted=false}if(this._writableState){this._writableState.destroyed=false;this._writableState.ended=false;this._writableState.ending=false;this._writableState.finalCalled=false;this._writableState.prefinished=false;this._writableState.finished=false;this._writableState.errorEmitted=false}}function emitErrorNT(e,t){e.emit("error",t)}function errorOrDestroy(e,t){var r=e._readableState;var i=e._writableState;if(r&&r.autoDestroy||i&&i.autoDestroy)e.destroy(t);else e.emit("error",t)}e.exports={destroy:destroy,undestroy:undestroy,errorOrDestroy:errorOrDestroy}},1785:function(e,t,r){"use strict";var i=r(42).q.ERR_STREAM_PREMATURE_CLOSE;function once(e){var t=false;return function(){if(t)return;t=true;for(var r=arguments.length,i=new Array(r),n=0;n0;return destroyer(e,a,o,(function(e){if(!n)n=e;if(e)s.forEach(call);if(a)return;s.forEach(call);i(n)}))}));return t.reduce(pipe)}e.exports=pipeline},894:function(e,t,r){"use strict";var i=r(42).q.ERR_INVALID_OPT_VALUE;function highWaterMarkFrom(e,t,r){return e.highWaterMark!=null?e.highWaterMark:t?e[r]:null}function getHighWaterMark(e,t,r,n){var a=highWaterMarkFrom(t,n,r);if(a!=null){if(!(isFinite(a)&&Math.floor(a)===a)||a<0){var s=n?r:"highWaterMark";throw new i(s,a)}return Math.floor(a)}return e.objectMode?16:16*1024}e.exports={getHighWaterMark:getHighWaterMark}},1727:function(e,t,r){e.exports=r(2781)},6572:function(e,t,r){var i=r(2781);if(process.env.READABLE_STREAM==="disable"&&i){e.exports=i.Readable;Object.assign(e.exports,i);e.exports.Stream=i}else{t=e.exports=r(8318);t.Stream=i||t;t.Readable=t;t.Writable=r(3877);t.Duplex=r(6744);t.Transform=r(9482);t.PassThrough=r(6609);t.finished=r(1785);t.pipeline=r(7612)}},5653:function(e){e.exports=function xor(e,t){var r=Math.min(e.length,t.length);var i=new Buffer(r);for(var n=0;nr){var i=e==="rmd160"?new u:h(e);t=i.update(t).digest()}else if(t.lengtho){t=e(t)}else if(t.length0;i--){t+=this._buffer(e,t);r+=this._flushBuffer(n,r)}t+=this._buffer(e,t);return n};Cipher.prototype.final=function final(e){var t;if(e)t=this.update(e);var r;if(this.type==="encrypt")r=this._finalEncrypt();else r=this._finalDecrypt();if(t)return t.concat(r);else return r};Cipher.prototype._pad=function _pad(e,t){if(t===0)return false;while(t>>1];r=a.r28shl(r,u);n=a.r28shl(n,u);a.pc2(r,n,e.keys,s)}};DES.prototype._update=function _update(e,t,r,i){var n=this._desState;var s=a.readUInt32BE(e,t);var o=a.readUInt32BE(e,t+4);a.ip(s,o,n.tmp,0);s=n.tmp[0];o=n.tmp[1];if(this.type==="encrypt")this._encrypt(n,s,o,n.tmp,0);else this._decrypt(n,s,o,n.tmp,0);s=n.tmp[0];o=n.tmp[1];a.writeUInt32BE(r,s,i);a.writeUInt32BE(r,o,i+4)};DES.prototype._pad=function _pad(e,t){var r=e.length-t;for(var i=t;i>>0;s=p}a.rip(o,s,i,n)};DES.prototype._decrypt=function _decrypt(e,t,r,i,n){var s=r;var o=t;for(var u=e.keys.length-2;u>=0;u-=2){var h=e.keys[u];var d=e.keys[u+1];a.expand(s,e.tmp,0);h^=e.tmp[0];d^=e.tmp[1];var c=a.substitute(h,d);var l=a.permute(c);var p=s;s=(o^l)>>>0;o=p}a.rip(s,o,i,n)}},2635:function(e,t,r){"use strict";var i=r(9036);var n=r(7526);var a=r(1020);var s=r(9670);function EDEState(e,t){i.equal(t.length,24,"Invalid key length");var r=t.slice(0,8);var n=t.slice(8,16);var a=t.slice(16,24);if(e==="encrypt"){this.ciphers=[s.create({type:"encrypt",key:r}),s.create({type:"decrypt",key:n}),s.create({type:"encrypt",key:a})]}else{this.ciphers=[s.create({type:"decrypt",key:a}),s.create({type:"encrypt",key:n}),s.create({type:"decrypt",key:r})]}}function EDE(e){a.call(this,e);var t=new EDEState(this.type,this.options.key);this._edeState=t}n(EDE,a);e.exports=EDE;EDE.create=function create(e){return new EDE(e)};EDE.prototype._update=function _update(e,t,r,i){var n=this._edeState;n.ciphers[0]._update(e,t,r,i);n.ciphers[1]._update(r,i,r,i);n.ciphers[2]._update(r,i,r,i)};EDE.prototype._pad=s.prototype._pad;EDE.prototype._unpad=s.prototype._unpad},6843:function(e,t){"use strict";t.readUInt32BE=function readUInt32BE(e,t){var r=e[0+t]<<24|e[1+t]<<16|e[2+t]<<8|e[3+t];return r>>>0};t.writeUInt32BE=function writeUInt32BE(e,t,r){e[0+r]=t>>>24;e[1+r]=t>>>16&255;e[2+r]=t>>>8&255;e[3+r]=t&255};t.ip=function ip(e,t,r,i){var n=0;var a=0;for(var s=6;s>=0;s-=2){for(var o=0;o<=24;o+=8){n<<=1;n|=t>>>o+s&1}for(var o=0;o<=24;o+=8){n<<=1;n|=e>>>o+s&1}}for(var s=6;s>=0;s-=2){for(var o=1;o<=25;o+=8){a<<=1;a|=t>>>o+s&1}for(var o=1;o<=25;o+=8){a<<=1;a|=e>>>o+s&1}}r[i+0]=n>>>0;r[i+1]=a>>>0};t.rip=function rip(e,t,r,i){var n=0;var a=0;for(var s=0;s<4;s++){for(var o=24;o>=0;o-=8){n<<=1;n|=t>>>o+s&1;n<<=1;n|=e>>>o+s&1}}for(var s=4;s<8;s++){for(var o=24;o>=0;o-=8){a<<=1;a|=t>>>o+s&1;a<<=1;a|=e>>>o+s&1}}r[i+0]=n>>>0;r[i+1]=a>>>0};t.pc1=function pc1(e,t,r,i){var n=0;var a=0;for(var s=7;s>=5;s--){for(var o=0;o<=24;o+=8){n<<=1;n|=t>>o+s&1}for(var o=0;o<=24;o+=8){n<<=1;n|=e>>o+s&1}}for(var o=0;o<=24;o+=8){n<<=1;n|=t>>o+s&1}for(var s=1;s<=3;s++){for(var o=0;o<=24;o+=8){a<<=1;a|=t>>o+s&1}for(var o=0;o<=24;o+=8){a<<=1;a|=e>>o+s&1}}for(var o=0;o<=24;o+=8){a<<=1;a|=e>>o+s&1}r[i+0]=n>>>0;r[i+1]=a>>>0};t.r28shl=function r28shl(e,t){return e<>>28-t};var r=[14,11,17,4,27,23,25,0,13,22,7,18,5,9,16,24,2,20,12,21,1,8,15,26,15,4,25,19,9,1,26,16,5,11,23,8,12,7,17,0,22,3,10,14,6,20,27,24];t.pc2=function pc2(e,t,i,n){var a=0;var s=0;var o=r.length>>>1;for(var u=0;u>>r[u]&1}for(var u=o;u>>r[u]&1}i[n+0]=a>>>0;i[n+1]=s>>>0};t.expand=function expand(e,t,r){var i=0;var n=0;i=(e&1)<<5|e>>>27;for(var a=23;a>=15;a-=4){i<<=6;i|=e>>>a&63}for(var a=11;a>=3;a-=4){n|=e>>>a&63;n<<=6}n|=(e&31)<<1|e>>>31;t[r+0]=i>>>0;t[r+1]=n>>>0};var i=[14,0,4,15,13,7,1,4,2,14,15,2,11,13,8,1,3,10,10,6,6,12,12,11,5,9,9,5,0,3,7,8,4,15,1,12,14,8,8,2,13,4,6,9,2,1,11,7,15,5,12,11,9,3,7,14,3,10,10,0,5,6,0,13,15,3,1,13,8,4,14,7,6,15,11,2,3,8,4,14,9,12,7,0,2,1,13,10,12,6,0,9,5,11,10,5,0,13,14,8,7,10,11,1,10,3,4,15,13,4,1,2,5,11,8,6,12,7,6,12,9,0,3,5,2,14,15,9,10,13,0,7,9,0,14,9,6,3,3,4,15,6,5,10,1,2,13,8,12,5,7,14,11,12,4,11,2,15,8,1,13,1,6,10,4,13,9,0,8,6,15,9,3,8,0,7,11,4,1,15,2,14,12,3,5,11,10,5,14,2,7,12,7,13,13,8,14,11,3,5,0,6,6,15,9,0,10,3,1,4,2,7,8,2,5,12,11,1,12,10,4,14,15,9,10,3,6,15,9,0,0,6,12,10,11,1,7,13,13,8,15,9,1,4,3,5,14,11,5,12,2,7,8,2,4,14,2,14,12,11,4,2,1,12,7,4,10,7,11,13,6,1,8,5,5,0,3,15,15,10,13,3,0,9,14,8,9,6,4,11,2,8,1,12,11,7,10,1,13,14,7,2,8,13,15,6,9,15,12,0,5,9,6,10,3,4,0,5,14,3,12,10,1,15,10,4,15,2,9,7,2,12,6,9,8,5,0,6,13,1,3,13,4,14,14,0,7,11,5,3,11,8,9,4,14,3,15,2,5,12,2,9,8,5,12,15,3,10,7,11,0,14,4,1,10,7,1,6,13,0,11,8,6,13,4,13,11,0,2,11,14,7,15,4,0,9,8,1,13,10,3,14,12,3,9,5,7,12,5,2,10,15,6,8,1,6,1,6,4,11,11,13,13,8,12,1,3,4,7,10,14,7,10,9,15,5,6,0,8,15,0,14,5,2,9,3,2,12,13,1,2,15,8,13,4,8,6,10,15,3,11,7,1,4,10,12,9,5,3,6,14,11,5,0,0,14,12,9,7,2,7,2,11,1,4,14,1,7,9,4,12,10,14,8,2,13,0,15,6,12,10,9,13,0,15,3,3,5,5,6,8,11];t.substitute=function substitute(e,t){var r=0;for(var n=0;n<4;n++){var a=e>>>18-n*6&63;var s=i[n*64+a];r<<=4;r|=s}for(var n=0;n<4;n++){var a=t>>>18-n*6&63;var s=i[4*64+n*64+a];r<<=4;r|=s}return r>>>0};var n=[16,25,12,11,3,20,4,15,31,17,9,6,27,14,1,22,30,24,8,18,0,5,29,23,13,19,2,26,10,21,28,7];t.permute=function permute(e){var t=0;for(var r=0;r>>n[r]&1}return t>>>0};t.padSplit=function padSplit(e,t,r){var i=e.toString(2);while(i.lengthe){r.ishrn(1)}if(r.isEven()){r.iadd(u)}if(!r.testn(1)){r.iadd(h)}if(!t.cmp(h)){while(r.mod(a).cmp(m)){r.iadd(y)}}else if(!t.cmp(d)){while(r.mod(p).cmp(b)){r.iadd(y)}}s=r.shrn(1);if(simpleSieve(s)&&simpleSieve(r)&&fermatTest(s)&&fermatTest(r)&&o.test(s)&&o.test(r)){return r}}}},8818:function(e,t,r){"use strict";var i=t;i.version=r(763).i8;i.utils=r(8454);i.rand=r(6069);i.curve=r(954);i.curves=r(2998);i.ec=r(2081);i.eddsa=r(2298)},3005:function(e,t,r){"use strict";var i=r(6884);var n=r(8454);var a=n.getNAF;var s=n.getJSF;var o=n.assert;function BaseCurve(e,t){this.type=e;this.p=new i(t.p,16);this.red=t.prime?i.red(t.prime):i.mont(this.p);this.zero=new i(0).toRed(this.red);this.one=new i(1).toRed(this.red);this.two=new i(2).toRed(this.red);this.n=t.n&&new i(t.n,16);this.g=t.g&&this.pointFromJSON(t.g,t.gRed);this._wnafT1=new Array(4);this._wnafT2=new Array(4);this._wnafT3=new Array(4);this._wnafT4=new Array(4);this._bitLength=this.n?this.n.bitLength():0;var r=this.n&&this.p.div(this.n);if(!r||r.cmpn(100)>0){this.redN=null}else{this._maxwellTrick=true;this.redN=this.n.toRed(this.red)}}e.exports=BaseCurve;BaseCurve.prototype.point=function point(){throw new Error("Not implemented")};BaseCurve.prototype.validate=function validate(){throw new Error("Not implemented")};BaseCurve.prototype._fixedNafMul=function _fixedNafMul(e,t){o(e.precomputed);var r=e._getDoubles();var i=a(t,1,this._bitLength);var n=(1<=u;t--)h=(h<<1)+i[t];s.push(h)}var d=this.jpoint(null,null,null);var c=this.jpoint(null,null,null);for(var l=n;l>0;l--){for(var u=0;u=0;h--){for(var t=0;h>=0&&s[h]===0;h--)t++;if(h>=0)t++;u=u.dblp(t);if(h<0)break;var d=s[h];o(d!==0);if(e.type==="affine"){if(d>0)u=u.mixedAdd(n[d-1>>1]);else u=u.mixedAdd(n[-d-1>>1].neg())}else{if(d>0)u=u.add(n[d-1>>1]);else u=u.add(n[-d-1>>1].neg())}}return e.type==="affine"?u.toP():u};BaseCurve.prototype._wnafMulAdd=function _wnafMulAdd(e,t,r,i,n){var o=this._wnafT1;var u=this._wnafT2;var h=this._wnafT3;var d=0;for(var c=0;c=1;c-=2){var b=c-1;var v=c;if(o[b]!==1||o[v]!==1){h[b]=a(r[b],o[b],this._bitLength);h[v]=a(r[v],o[v],this._bitLength);d=Math.max(h[b].length,d);d=Math.max(h[v].length,d);continue}var m=[t[b],null,null,t[v]];if(t[b].y.cmp(t[v].y)===0){m[1]=t[b].add(t[v]);m[2]=t[b].toJ().mixedAdd(t[v].neg())}else if(t[b].y.cmp(t[v].y.redNeg())===0){m[1]=t[b].toJ().mixedAdd(t[v]);m[2]=t[b].add(t[v].neg())}else{m[1]=t[b].toJ().mixedAdd(t[v]);m[2]=t[b].toJ().mixedAdd(t[v].neg())}var y=[-3,-1,-5,-7,0,7,5,1,3];var g=s(r[b],r[v]);d=Math.max(g[0].length,d);h[b]=new Array(d);h[v]=new Array(d);for(var _=0;_=0;c--){var k=0;while(c>=0){var A=true;for(var _=0;_=0)k++;E=E.dblp(k);if(c<0)break;for(var _=0;_0)l=u[_][N-1>>1];else if(N<0)l=u[_][-N-1>>1].neg();if(l.type==="affine")E=E.mixedAdd(l);else E=E.add(l)}}for(var c=0;c=Math.ceil((e.bitLength()+1)/t.step)};BasePoint.prototype._getDoubles=function _getDoubles(e,t){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;var r=[this];var i=this;for(var n=0;n";return""};Point.prototype.isInfinity=function isInfinity(){return this.x.cmpn(0)===0&&(this.y.cmp(this.z)===0||this.zOne&&this.y.cmp(this.curve.c)===0)};Point.prototype._extDbl=function _extDbl(){var e=this.x.redSqr();var t=this.y.redSqr();var r=this.z.redSqr();r=r.redIAdd(r);var i=this.curve._mulA(e);var n=this.x.redAdd(this.y).redSqr().redISub(e).redISub(t);var a=i.redAdd(t);var s=a.redSub(r);var o=i.redSub(t);var u=n.redMul(s);var h=a.redMul(o);var d=n.redMul(o);var c=s.redMul(a);return this.curve.point(u,h,c,d)};Point.prototype._projDbl=function _projDbl(){var e=this.x.redAdd(this.y).redSqr();var t=this.x.redSqr();var r=this.y.redSqr();var i;var n;var a;if(this.curve.twisted){var s=this.curve._mulA(t);var o=s.redAdd(r);if(this.zOne){i=e.redSub(t).redSub(r).redMul(o.redSub(this.curve.two));n=o.redMul(s.redSub(r));a=o.redSqr().redSub(o).redSub(o)}else{var u=this.z.redSqr();var h=o.redSub(u).redISub(u);i=e.redSub(t).redISub(r).redMul(h);n=o.redMul(s.redSub(r));a=o.redMul(h)}}else{var s=t.redAdd(r);var u=this.curve._mulC(this.z).redSqr();var h=s.redSub(u).redSub(u);i=this.curve._mulC(e.redISub(s)).redMul(h);n=this.curve._mulC(s).redMul(t.redISub(r));a=s.redMul(h)}return this.curve.point(i,n,a)};Point.prototype.dbl=function dbl(){if(this.isInfinity())return this;if(this.curve.extended)return this._extDbl();else return this._projDbl()};Point.prototype._extAdd=function _extAdd(e){var t=this.y.redSub(this.x).redMul(e.y.redSub(e.x));var r=this.y.redAdd(this.x).redMul(e.y.redAdd(e.x));var i=this.t.redMul(this.curve.dd).redMul(e.t);var n=this.z.redMul(e.z.redAdd(e.z));var a=r.redSub(t);var s=n.redSub(i);var o=n.redAdd(i);var u=r.redAdd(t);var h=a.redMul(s);var d=o.redMul(u);var c=a.redMul(u);var l=s.redMul(o);return this.curve.point(h,d,l,c)};Point.prototype._projAdd=function _projAdd(e){var t=this.z.redMul(e.z);var r=t.redSqr();var i=this.x.redMul(e.x);var n=this.y.redMul(e.y);var a=this.curve.d.redMul(i).redMul(n);var s=r.redSub(a);var o=r.redAdd(a);var u=this.x.redAdd(this.y).redMul(e.x.redAdd(e.y)).redISub(i).redISub(n);var h=t.redMul(s).redMul(u);var d;var c;if(this.curve.twisted){d=t.redMul(o).redMul(n.redSub(this.curve._mulA(i)));c=s.redMul(o)}else{d=t.redMul(o).redMul(n.redSub(i));c=this.curve._mulC(s).redMul(o)}return this.curve.point(h,d,c)};Point.prototype.add=function add(e){if(this.isInfinity())return e;if(e.isInfinity())return this;if(this.curve.extended)return this._extAdd(e);else return this._projAdd(e)};Point.prototype.mul=function mul(e){if(this._hasDoubles(e))return this.curve._fixedNafMul(this,e);else return this.curve._wnafMul(this,e)};Point.prototype.mulAdd=function mulAdd(e,t,r){return this.curve._wnafMulAdd(1,[this,t],[e,r],2,false)};Point.prototype.jmulAdd=function jmulAdd(e,t,r){return this.curve._wnafMulAdd(1,[this,t],[e,r],2,true)};Point.prototype.normalize=function normalize(){if(this.zOne)return this;var e=this.z.redInvm();this.x=this.x.redMul(e);this.y=this.y.redMul(e);if(this.t)this.t=this.t.redMul(e);this.z=this.curve.one;this.zOne=true;return this};Point.prototype.neg=function neg(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())};Point.prototype.getX=function getX(){this.normalize();return this.x.fromRed()};Point.prototype.getY=function getY(){this.normalize();return this.y.fromRed()};Point.prototype.eq=function eq(e){return this===e||this.getX().cmp(e.getX())===0&&this.getY().cmp(e.getY())===0};Point.prototype.eqXToP=function eqXToP(e){var t=e.toRed(this.curve.red).redMul(this.z);if(this.x.cmp(t)===0)return true;var r=e.clone();var i=this.curve.redN.redMul(this.z);for(;;){r.iadd(this.curve.n);if(r.cmp(this.curve.p)>=0)return false;t.redIAdd(i);if(this.x.cmp(t)===0)return true}};Point.prototype.toP=Point.prototype.normalize;Point.prototype.mixedAdd=Point.prototype.add},954:function(e,t,r){"use strict";var i=t;i.base=r(3005);i.short=r(401);i.mont=r(6103);i.edwards=r(9224)},6103:function(e,t,r){"use strict";var i=r(6884);var n=r(7526);var a=r(3005);var s=r(8454);function MontCurve(e){a.call(this,"mont",e);this.a=new i(e.a,16).toRed(this.red);this.b=new i(e.b,16).toRed(this.red);this.i4=new i(4).toRed(this.red).redInvm();this.two=new i(2).toRed(this.red);this.a24=this.i4.redMul(this.a.redAdd(this.two))}n(MontCurve,a);e.exports=MontCurve;MontCurve.prototype.validate=function validate(e){var t=e.normalize().x;var r=t.redSqr();var i=r.redMul(t).redAdd(r.redMul(this.a)).redAdd(t);var n=i.redSqrt();return n.redSqr().cmp(i)===0};function Point(e,t,r){a.BasePoint.call(this,e,"projective");if(t===null&&r===null){this.x=this.curve.one;this.z=this.curve.zero}else{this.x=new i(t,16);this.z=new i(r,16);if(!this.x.red)this.x=this.x.toRed(this.curve.red);if(!this.z.red)this.z=this.z.toRed(this.curve.red)}}n(Point,a.BasePoint);MontCurve.prototype.decodePoint=function decodePoint(e,t){return this.point(s.toArray(e,t),1)};MontCurve.prototype.point=function point(e,t){return new Point(this,e,t)};MontCurve.prototype.pointFromJSON=function pointFromJSON(e){return Point.fromJSON(this,e)};Point.prototype.precompute=function precompute(){};Point.prototype._encode=function _encode(){return this.getX().toArray("be",this.curve.p.byteLength())};Point.fromJSON=function fromJSON(e,t){return new Point(e,t[0],t[1]||e.one)};Point.prototype.inspect=function inspect(){if(this.isInfinity())return"";return""};Point.prototype.isInfinity=function isInfinity(){return this.z.cmpn(0)===0};Point.prototype.dbl=function dbl(){var e=this.x.redAdd(this.z);var t=e.redSqr();var r=this.x.redSub(this.z);var i=r.redSqr();var n=t.redSub(i);var a=t.redMul(i);var s=n.redMul(i.redAdd(this.curve.a24.redMul(n)));return this.curve.point(a,s)};Point.prototype.add=function add(){throw new Error("Not supported on Montgomery curve")};Point.prototype.diffAdd=function diffAdd(e,t){var r=this.x.redAdd(this.z);var i=this.x.redSub(this.z);var n=e.x.redAdd(e.z);var a=e.x.redSub(e.z);var s=a.redMul(r);var o=n.redMul(i);var u=t.z.redMul(s.redAdd(o).redSqr());var h=t.x.redMul(s.redISub(o).redSqr());return this.curve.point(u,h)};Point.prototype.mul=function mul(e){var t=e.clone();var r=this;var i=this.curve.point(null,null);var n=this;for(var a=[];t.cmpn(0)!==0;t.iushrn(1))a.push(t.andln(1));for(var s=a.length-1;s>=0;s--){if(a[s]===0){r=r.diffAdd(i,n);i=i.dbl()}else{i=r.diffAdd(i,n);r=r.dbl()}}return i};Point.prototype.mulAdd=function mulAdd(){throw new Error("Not supported on Montgomery curve")};Point.prototype.jumlAdd=function jumlAdd(){throw new Error("Not supported on Montgomery curve")};Point.prototype.eq=function eq(e){return this.getX().cmp(e.getX())===0};Point.prototype.normalize=function normalize(){this.x=this.x.redMul(this.z.redInvm());this.z=this.curve.one;return this};Point.prototype.getX=function getX(){this.normalize();return this.x.fromRed()}},401:function(e,t,r){"use strict";var i=r(8454);var n=r(6884);var a=r(7526);var s=r(3005);var o=i.assert;function ShortCurve(e){s.call(this,"short",e);this.a=new n(e.a,16).toRed(this.red);this.b=new n(e.b,16).toRed(this.red);this.tinv=this.two.redInvm();this.zeroA=this.a.fromRed().cmpn(0)===0;this.threeA=this.a.fromRed().sub(this.p).cmpn(-3)===0;this.endo=this._getEndomorphism(e);this._endoWnafT1=new Array(4);this._endoWnafT2=new Array(4)}a(ShortCurve,s);e.exports=ShortCurve;ShortCurve.prototype._getEndomorphism=function _getEndomorphism(e){if(!this.zeroA||!this.g||!this.n||this.p.modn(3)!==1)return;var t;var r;if(e.beta){t=new n(e.beta,16).toRed(this.red)}else{var i=this._getEndoRoots(this.p);t=i[0].cmp(i[1])<0?i[0]:i[1];t=t.toRed(this.red)}if(e.lambda){r=new n(e.lambda,16)}else{var a=this._getEndoRoots(this.n);if(this.g.mul(a[0]).x.cmp(this.g.x.redMul(t))===0){r=a[0]}else{r=a[1];o(this.g.mul(r).x.cmp(this.g.x.redMul(t))===0)}}var s;if(e.basis){s=e.basis.map((function(e){return{a:new n(e.a,16),b:new n(e.b,16)}}))}else{s=this._getEndoBasis(r)}return{beta:t,lambda:r,basis:s}};ShortCurve.prototype._getEndoRoots=function _getEndoRoots(e){var t=e===this.p?this.red:n.mont(e);var r=new n(2).toRed(t).redInvm();var i=r.redNeg();var a=new n(3).toRed(t).redNeg().redSqrt().redMul(r);var s=i.redAdd(a).fromRed();var o=i.redSub(a).fromRed();return[s,o]};ShortCurve.prototype._getEndoBasis=function _getEndoBasis(e){var t=this.n.ushrn(Math.floor(this.n.bitLength()/2));var r=e;var i=this.n.clone();var a=new n(1);var s=new n(0);var o=new n(0);var u=new n(1);var h;var d;var c;var l;var p;var b;var v;var m=0;var y;var g;while(r.cmpn(0)!==0){var _=i.div(r);y=i.sub(_.mul(r));g=o.sub(_.mul(a));var w=u.sub(_.mul(s));if(!c&&y.cmp(t)<0){h=v.neg();d=a;c=y.neg();l=g}else if(c&&++m===2){break}v=y;i=r;r=y;o=a;a=g;u=s;s=w}p=y.neg();b=g;var M=c.sqr().add(l.sqr());var E=p.sqr().add(b.sqr());if(E.cmp(M)>=0){p=h;b=d}if(c.negative){c=c.neg();l=l.neg()}if(p.negative){p=p.neg();b=b.neg()}return[{a:c,b:l},{a:p,b:b}]};ShortCurve.prototype._endoSplit=function _endoSplit(e){var t=this.endo.basis;var r=t[0];var i=t[1];var n=i.b.mul(e).divRound(this.n);var a=r.b.neg().mul(e).divRound(this.n);var s=n.mul(r.a);var o=a.mul(i.a);var u=n.mul(r.b);var h=a.mul(i.b);var d=e.sub(s).sub(o);var c=u.add(h).neg();return{k1:d,k2:c}};ShortCurve.prototype.pointFromX=function pointFromX(e,t){e=new n(e,16);if(!e.red)e=e.toRed(this.red);var r=e.redSqr().redMul(e).redIAdd(e.redMul(this.a)).redIAdd(this.b);var i=r.redSqrt();if(i.redSqr().redSub(r).cmp(this.zero)!==0)throw new Error("invalid point");var a=i.fromRed().isOdd();if(t&&!a||!t&&a)i=i.redNeg();return this.point(e,i)};ShortCurve.prototype.validate=function validate(e){if(e.inf)return true;var t=e.x;var r=e.y;var i=this.a.redMul(t);var n=t.redSqr().redMul(t).redIAdd(i).redIAdd(this.b);return r.redSqr().redISub(n).cmpn(0)===0};ShortCurve.prototype._endoWnafMulAdd=function _endoWnafMulAdd(e,t,r){var i=this._endoWnafT1;var n=this._endoWnafT2;for(var a=0;a";return""};Point.prototype.isInfinity=function isInfinity(){return this.inf};Point.prototype.add=function add(e){if(this.inf)return e;if(e.inf)return this;if(this.eq(e))return this.dbl();if(this.neg().eq(e))return this.curve.point(null,null);if(this.x.cmp(e.x)===0)return this.curve.point(null,null);var t=this.y.redSub(e.y);if(t.cmpn(0)!==0)t=t.redMul(this.x.redSub(e.x).redInvm());var r=t.redSqr().redISub(this.x).redISub(e.x);var i=t.redMul(this.x.redSub(r)).redISub(this.y);return this.curve.point(r,i)};Point.prototype.dbl=function dbl(){if(this.inf)return this;var e=this.y.redAdd(this.y);if(e.cmpn(0)===0)return this.curve.point(null,null);var t=this.curve.a;var r=this.x.redSqr();var i=e.redInvm();var n=r.redAdd(r).redIAdd(r).redIAdd(t).redMul(i);var a=n.redSqr().redISub(this.x.redAdd(this.x));var s=n.redMul(this.x.redSub(a)).redISub(this.y);return this.curve.point(a,s)};Point.prototype.getX=function getX(){return this.x.fromRed()};Point.prototype.getY=function getY(){return this.y.fromRed()};Point.prototype.mul=function mul(e){e=new n(e,16);if(this.isInfinity())return this;else if(this._hasDoubles(e))return this.curve._fixedNafMul(this,e);else if(this.curve.endo)return this.curve._endoWnafMulAdd([this],[e]);else return this.curve._wnafMul(this,e)};Point.prototype.mulAdd=function mulAdd(e,t,r){var i=[this,t];var n=[e,r];if(this.curve.endo)return this.curve._endoWnafMulAdd(i,n);else return this.curve._wnafMulAdd(1,i,n,2)};Point.prototype.jmulAdd=function jmulAdd(e,t,r){var i=[this,t];var n=[e,r];if(this.curve.endo)return this.curve._endoWnafMulAdd(i,n,true);else return this.curve._wnafMulAdd(1,i,n,2,true)};Point.prototype.eq=function eq(e){return this===e||this.inf===e.inf&&(this.inf||this.x.cmp(e.x)===0&&this.y.cmp(e.y)===0)};Point.prototype.neg=function neg(e){if(this.inf)return this;var t=this.curve.point(this.x,this.y.redNeg());if(e&&this.precomputed){var r=this.precomputed;var negate=function(e){return e.neg()};t.precomputed={naf:r.naf&&{wnd:r.naf.wnd,points:r.naf.points.map(negate)},doubles:r.doubles&&{step:r.doubles.step,points:r.doubles.points.map(negate)}}}return t};Point.prototype.toJ=function toJ(){if(this.inf)return this.curve.jpoint(null,null,null);var e=this.curve.jpoint(this.x,this.y,this.curve.one);return e};function JPoint(e,t,r,i){s.BasePoint.call(this,e,"jacobian");if(t===null&&r===null&&i===null){this.x=this.curve.one;this.y=this.curve.one;this.z=new n(0)}else{this.x=new n(t,16);this.y=new n(r,16);this.z=new n(i,16)}if(!this.x.red)this.x=this.x.toRed(this.curve.red);if(!this.y.red)this.y=this.y.toRed(this.curve.red);if(!this.z.red)this.z=this.z.toRed(this.curve.red);this.zOne=this.z===this.curve.one}a(JPoint,s.BasePoint);ShortCurve.prototype.jpoint=function jpoint(e,t,r){return new JPoint(this,e,t,r)};JPoint.prototype.toP=function toP(){if(this.isInfinity())return this.curve.point(null,null);var e=this.z.redInvm();var t=e.redSqr();var r=this.x.redMul(t);var i=this.y.redMul(t).redMul(e);return this.curve.point(r,i)};JPoint.prototype.neg=function neg(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)};JPoint.prototype.add=function add(e){if(this.isInfinity())return e;if(e.isInfinity())return this;var t=e.z.redSqr();var r=this.z.redSqr();var i=this.x.redMul(t);var n=e.x.redMul(r);var a=this.y.redMul(t.redMul(e.z));var s=e.y.redMul(r.redMul(this.z));var o=i.redSub(n);var u=a.redSub(s);if(o.cmpn(0)===0){if(u.cmpn(0)!==0)return this.curve.jpoint(null,null,null);else return this.dbl()}var h=o.redSqr();var d=h.redMul(o);var c=i.redMul(h);var l=u.redSqr().redIAdd(d).redISub(c).redISub(c);var p=u.redMul(c.redISub(l)).redISub(a.redMul(d));var b=this.z.redMul(e.z).redMul(o);return this.curve.jpoint(l,p,b)};JPoint.prototype.mixedAdd=function mixedAdd(e){if(this.isInfinity())return e.toJ();if(e.isInfinity())return this;var t=this.z.redSqr();var r=this.x;var i=e.x.redMul(t);var n=this.y;var a=e.y.redMul(t).redMul(this.z);var s=r.redSub(i);var o=n.redSub(a);if(s.cmpn(0)===0){if(o.cmpn(0)!==0)return this.curve.jpoint(null,null,null);else return this.dbl()}var u=s.redSqr();var h=u.redMul(s);var d=r.redMul(u);var c=o.redSqr().redIAdd(h).redISub(d).redISub(d);var l=o.redMul(d.redISub(c)).redISub(n.redMul(h));var p=this.z.redMul(s);return this.curve.jpoint(c,l,p)};JPoint.prototype.dblp=function dblp(e){if(e===0)return this;if(this.isInfinity())return this;if(!e)return this.dbl();if(this.curve.zeroA||this.curve.threeA){var t=this;for(var r=0;r=0)return false;r.redIAdd(n);if(this.x.cmp(r)===0)return true}};JPoint.prototype.inspect=function inspect(){if(this.isInfinity())return"";return""};JPoint.prototype.isInfinity=function isInfinity(){return this.z.cmpn(0)===0}},2998:function(e,t,r){"use strict";var i=t;var n=r(9767);var a=r(954);var s=r(8454);var o=s.assert;function PresetCurve(e){if(e.type==="short")this.curve=new a.short(e);else if(e.type==="edwards")this.curve=new a.edwards(e);else this.curve=new a.mont(e);this.g=this.curve.g;this.n=this.curve.n;this.hash=e.hash;o(this.g.validate(),"Invalid curve");o(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}i.PresetCurve=PresetCurve;function defineCurve(e,t){Object.defineProperty(i,e,{configurable:true,enumerable:true,get:function(){var r=new PresetCurve(t);Object.defineProperty(i,e,{configurable:true,enumerable:true,value:r});return r}})}defineCurve("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:n.sha256,gRed:false,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]});defineCurve("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:n.sha256,gRed:false,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]});defineCurve("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:n.sha256,gRed:false,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]});defineCurve("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff "+"fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff "+"fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f "+"5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 "+"f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:n.sha384,gRed:false,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 "+"5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 "+"0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]});defineCurve("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff "+"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff "+"ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff "+"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff "+"ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b "+"99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd "+"3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff "+"ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 "+"f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:n.sha512,gRed:false,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 "+"053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 "+"a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 "+"579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 "+"3fad0761 353c7086 a272c240 88be9476 9fd16650"]});defineCurve("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:n.sha256,gRed:false,g:["9"]});defineCurve("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:n.sha256,gRed:false,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});var u;try{u=r(7759)}catch(e){u=undefined}defineCurve("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:n.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:false,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",u]})},2081:function(e,t,r){"use strict";var i=r(6884);var n=r(8242);var a=r(8454);var s=r(2998);var o=r(6069);var u=a.assert;var h=r(7044);var d=r(8020);function EC(e){if(!(this instanceof EC))return new EC(e);if(typeof e==="string"){u(s.hasOwnProperty(e),"Unknown curve "+e);e=s[e]}if(e instanceof s.PresetCurve)e={curve:e};this.curve=e.curve.curve;this.n=this.curve.n;this.nh=this.n.ushrn(1);this.g=this.curve.g;this.g=e.curve.g;this.g.precompute(e.curve.n.bitLength()+1);this.hash=e.hash||e.curve.hash}e.exports=EC;EC.prototype.keyPair=function keyPair(e){return new h(this,e)};EC.prototype.keyFromPrivate=function keyFromPrivate(e,t){return h.fromPrivate(this,e,t)};EC.prototype.keyFromPublic=function keyFromPublic(e,t){return h.fromPublic(this,e,t)};EC.prototype.genKeyPair=function genKeyPair(e){if(!e)e={};var t=new n({hash:this.hash,pers:e.pers,persEnc:e.persEnc||"utf8",entropy:e.entropy||o(this.hash.hmacStrength),entropyEnc:e.entropy&&e.entropyEnc||"utf8",nonce:this.n.toArray()});var r=this.n.byteLength();var a=this.n.sub(new i(2));do{var s=new i(t.generate(r));if(s.cmp(a)>0)continue;s.iaddn(1);return this.keyFromPrivate(s)}while(true)};EC.prototype._truncateToN=function truncateToN(e,t){var r=e.byteLength()*8-this.n.bitLength();if(r>0)e=e.ushrn(r);if(!t&&e.cmp(this.n)>=0)return e.sub(this.n);else return e};EC.prototype.sign=function sign(e,t,r,a){if(typeof r==="object"){a=r;r=null}if(!a)a={};t=this.keyFromPrivate(t,r);e=this._truncateToN(new i(e,16));var s=this.n.byteLength();var o=t.getPrivate().toArray("be",s);var u=e.toArray("be",s);var h=new n({hash:this.hash,entropy:o,nonce:u,pers:a.pers,persEnc:a.persEnc||"utf8"});var c=this.n.sub(new i(1));for(var l=0;true;l++){var p=a.k?a.k(l):new i(h.generate(this.n.byteLength()));p=this._truncateToN(p,true);if(p.cmpn(1)<=0||p.cmp(c)>=0)continue;var b=this.g.mul(p);if(b.isInfinity())continue;var v=b.getX();var m=v.umod(this.n);if(m.cmpn(0)===0)continue;var y=p.invm(this.n).mul(m.mul(t.getPrivate()).iadd(e));y=y.umod(this.n);if(y.cmpn(0)===0)continue;var g=(b.getY().isOdd()?1:0)|(v.cmp(m)!==0?2:0);if(a.canonical&&y.cmp(this.nh)>0){y=this.n.sub(y);g^=1}return new d({r:m,s:y,recoveryParam:g})}};EC.prototype.verify=function verify(e,t,r,n){e=this._truncateToN(new i(e,16));r=this.keyFromPublic(r,n);t=new d(t,"hex");var a=t.r;var s=t.s;if(a.cmpn(1)<0||a.cmp(this.n)>=0)return false;if(s.cmpn(1)<0||s.cmp(this.n)>=0)return false;var o=s.invm(this.n);var u=o.mul(e).umod(this.n);var h=o.mul(a).umod(this.n);if(!this.curve._maxwellTrick){var c=this.g.mulAdd(u,r.getPublic(),h);if(c.isInfinity())return false;return c.getX().umod(this.n).cmp(a)===0}var c=this.g.jmulAdd(u,r.getPublic(),h);if(c.isInfinity())return false;return c.eqXToP(a)};EC.prototype.recoverPubKey=function(e,t,r,n){u((3&r)===r,"The recovery param is more than two bits");t=new d(t,n);var a=this.n;var s=new i(e);var o=t.r;var h=t.s;var c=r&1;var l=r>>1;if(o.cmp(this.curve.p.umod(this.curve.n))>=0&&l)throw new Error("Unable to find sencond key candinate");if(l)o=this.curve.pointFromX(o.add(this.curve.n),c);else o=this.curve.pointFromX(o,c);var p=t.r.invm(a);var b=a.sub(s).mul(p).umod(a);var v=h.mul(p).umod(a);return this.g.mulAdd(b,o,v)};EC.prototype.getKeyRecoveryParam=function(e,t,r,i){t=new d(t,i);if(t.recoveryParam!==null)return t.recoveryParam;for(var n=0;n<4;n++){var a;try{a=this.recoverPubKey(e,t,n)}catch(e){continue}if(a.eq(r))return n}throw new Error("Unable to find valid recovery factor")}},7044:function(e,t,r){"use strict";var i=r(6884);var n=r(8454);var a=n.assert;function KeyPair(e,t){this.ec=e;this.priv=null;this.pub=null;if(t.priv)this._importPrivate(t.priv,t.privEnc);if(t.pub)this._importPublic(t.pub,t.pubEnc)}e.exports=KeyPair;KeyPair.fromPublic=function fromPublic(e,t,r){if(t instanceof KeyPair)return t;return new KeyPair(e,{pub:t,pubEnc:r})};KeyPair.fromPrivate=function fromPrivate(e,t,r){if(t instanceof KeyPair)return t;return new KeyPair(e,{priv:t,privEnc:r})};KeyPair.prototype.validate=function validate(){var e=this.getPublic();if(e.isInfinity())return{result:false,reason:"Invalid public key"};if(!e.validate())return{result:false,reason:"Public key is not a point"};if(!e.mul(this.ec.curve.n).isInfinity())return{result:false,reason:"Public key * N != O"};return{result:true,reason:null}};KeyPair.prototype.getPublic=function getPublic(e,t){if(typeof e==="string"){t=e;e=null}if(!this.pub)this.pub=this.ec.g.mul(this.priv);if(!t)return this.pub;return this.pub.encode(t,e)};KeyPair.prototype.getPrivate=function getPrivate(e){if(e==="hex")return this.priv.toString(16,2);else return this.priv};KeyPair.prototype._importPrivate=function _importPrivate(e,t){this.priv=new i(e,t||16);this.priv=this.priv.umod(this.ec.curve.n)};KeyPair.prototype._importPublic=function _importPublic(e,t){if(e.x||e.y){if(this.ec.curve.type==="mont"){a(e.x,"Need x coordinate")}else if(this.ec.curve.type==="short"||this.ec.curve.type==="edwards"){a(e.x&&e.y,"Need both x and y coordinate")}this.pub=this.ec.curve.point(e.x,e.y);return}this.pub=this.ec.curve.decodePoint(e,t)};KeyPair.prototype.derive=function derive(e){return e.mul(this.priv).getX()};KeyPair.prototype.sign=function sign(e,t,r){return this.ec.sign(e,this,t,r)};KeyPair.prototype.verify=function verify(e,t){return this.ec.verify(e,t,this)};KeyPair.prototype.inspect=function inspect(){return""}},8020:function(e,t,r){"use strict";var i=r(6884);var n=r(8454);var a=n.assert;function Signature(e,t){if(e instanceof Signature)return e;if(this._importDER(e,t))return;a(e.r&&e.s,"Signature without r or s");this.r=new i(e.r,16);this.s=new i(e.s,16);if(e.recoveryParam===undefined)this.recoveryParam=null;else this.recoveryParam=e.recoveryParam}e.exports=Signature;function Position(){this.place=0}function getLength(e,t){var r=e[t.place++];if(!(r&128)){return r}var i=r&15;if(i===0||i>4){return false}var n=0;for(var a=0,s=t.place;a>>=0}if(n<=127){return false}t.place=s;return n}function rmPadding(e){var t=0;var r=e.length-1;while(!e[t]&&!(e[t+1]&128)&&t>>3);e.push(r|128);while(--r){e.push(t>>>(r<<3)&255)}e.push(t)}Signature.prototype.toDER=function toDER(e){var t=this.r.toArray();var r=this.s.toArray();if(t[0]&128)t=[0].concat(t);if(r[0]&128)r=[0].concat(r);t=rmPadding(t);r=rmPadding(r);while(!r[0]&&!(r[1]&128)){r=r.slice(1)}var i=[2];constructLength(i,t.length);i=i.concat(t);i.push(2);constructLength(i,r.length);var a=i.concat(r);var s=[48];constructLength(s,a.length);s=s.concat(a);return n.encode(s,e)}},2298:function(e,t,r){"use strict";var i=r(9767);var n=r(2998);var a=r(8454);var s=a.assert;var o=a.parseBytes;var u=r(9285);var h=r(3883);function EDDSA(e){s(e==="ed25519","only tested with ed25519 so far");if(!(this instanceof EDDSA))return new EDDSA(e);var e=n[e].curve;this.curve=e;this.g=e.g;this.g.precompute(e.n.bitLength()+1);this.pointClass=e.point().constructor;this.encodingLength=Math.ceil(e.n.bitLength()/8);this.hash=i.sha512}e.exports=EDDSA;EDDSA.prototype.sign=function sign(e,t){e=o(e);var r=this.keyFromSecret(t);var i=this.hashInt(r.messagePrefix(),e);var n=this.g.mul(i);var a=this.encodePoint(n);var s=this.hashInt(a,r.pubBytes(),e).mul(r.priv());var u=i.add(s).umod(this.curve.n);return this.makeSignature({R:n,S:u,Rencoded:a})};EDDSA.prototype.verify=function verify(e,t,r){e=o(e);t=this.makeSignature(t);var i=this.keyFromPublic(r);var n=this.hashInt(t.Rencoded(),i.pubBytes(),e);var a=this.g.mul(t.S());var s=t.R().add(i.pub().mul(n));return s.eq(a)};EDDSA.prototype.hashInt=function hashInt(){var e=this.hash();for(var t=0;t(n>>1)-1)o=(n>>1)-u;else o=u;a.isubn(o)}else{o=0}i[s]=o;a.iushrn(1)}return i}i.getNAF=getNAF;function getJSF(e,t){var r=[[],[]];e=e.clone();t=t.clone();var i=0;var n=0;while(e.cmpn(-i)>0||t.cmpn(-n)>0){var a=e.andln(3)+i&3;var s=t.andln(3)+n&3;if(a===3)a=-1;if(s===3)s=-1;var o;if((a&1)===0){o=0}else{var u=e.andln(7)+i&7;if((u===3||u===5)&&s===2)o=-a;else o=a}r[0].push(o);var h;if((s&1)===0){h=0}else{var u=t.andln(7)+n&7;if((u===3||u===5)&&a===2)h=-s;else h=s}r[1].push(h);if(2*i===o+1)i=1-i;if(2*n===h+1)n=1-n;e.iushrn(1);t.iushrn(1)}return r}i.getJSF=getJSF;function cachedProperty(e,t,r){var i="_"+t;e.prototype[t]=function cachedProperty(){return this[i]!==undefined?this[i]:this[i]=r.call(this)}}i.cachedProperty=cachedProperty;function parseBytes(e){return typeof e==="string"?i.toArray(e,"hex"):e}i.parseBytes=parseBytes;function intFromLE(e){return new n(e,"hex","le")}i.intFromLE=intFromLE},7325:function(e,t,r){var i=r(3118).Buffer;var n=r(4125);function EVP_BytesToKey(e,t,r,a){if(!i.isBuffer(e))e=i.from(e,"binary");if(t){if(!i.isBuffer(t))t=i.from(t,"binary");if(t.length!==8)throw new RangeError("salt should be Buffer with 8 byte length")}var s=r/8;var o=i.alloc(s);var u=i.alloc(a||0);var h=i.alloc(0);while(s>0||a>0){var d=new n;d.update(h);d.update(e);if(t)d.update(t);h=d.digest();var c=0;if(s>0){var l=o.length-s;c=Math.min(s,h.length);h.copy(o,l,0,c);s-=c}if(c0){var p=u.length-a;var b=Math.min(a,h.length-c);h.copy(u,p,c,c+b);a-=b}}h.fill(0);return{key:o,iv:u}}e.exports=EVP_BytesToKey},3421:function(e,t,r){"use strict";var i=r(3118).Buffer;var n=r(5098).Transform;var a=r(7526);function throwIfNotStringOrBuffer(e,t){if(!i.isBuffer(e)&&typeof e!=="string"){throw new TypeError(t+" must be a string or a buffer")}}function HashBase(e){n.call(this);this._block=i.allocUnsafe(e);this._blockSize=e;this._blockOffset=0;this._length=[0,0,0,0];this._finalized=false}a(HashBase,n);HashBase.prototype._transform=function(e,t,r){var i=null;try{this.update(e,t)}catch(e){i=e}r(i)};HashBase.prototype._flush=function(e){var t=null;try{this.push(this.digest())}catch(e){t=e}e(t)};HashBase.prototype.update=function(e,t){throwIfNotStringOrBuffer(e,"Data");if(this._finalized)throw new Error("Digest already called");if(!i.isBuffer(e))e=i.from(e,t);var r=this._block;var n=0;while(this._blockOffset+e.length-n>=this._blockSize){for(var a=this._blockOffset;a0;++s){this._length[s]+=o;o=this._length[s]/4294967296|0;if(o>0)this._length[s]-=4294967296*o}return this};HashBase.prototype._update=function(){throw new Error("_update is not implemented")};HashBase.prototype.digest=function(e){if(this._finalized)throw new Error("Digest already called");this._finalized=true;var t=this._digest();if(e!==undefined)t=t.toString(e);this._block.fill(0);this._blockOffset=0;for(var r=0;r<4;++r)this._length[r]=0;return t};HashBase.prototype._digest=function(){throw new Error("_digest is not implemented")};e.exports=HashBase},519:function(e){"use strict";const t={};function createErrorType(e,r,i){if(!i){i=Error}function getMessage(e,t,i){if(typeof r==="string"){return r}else{return r(e,t,i)}}class NodeError extends i{constructor(e,t,r){super(getMessage(e,t,r))}}NodeError.prototype.name=i.name;NodeError.prototype.code=e;t[e]=NodeError}function oneOf(e,t){if(Array.isArray(e)){const r=e.length;e=e.map((e=>String(e)));if(r>2){return`one of ${t} ${e.slice(0,r-1).join(", ")}, or `+e[r-1]}else if(r===2){return`one of ${t} ${e[0]} or ${e[1]}`}else{return`of ${t} ${e[0]}`}}else{return`of ${t} ${String(e)}`}}function startsWith(e,t,r){return e.substr(!r||r<0?0:+r,t.length)===t}function endsWith(e,t,r){if(r===undefined||r>e.length){r=e.length}return e.substring(r-t.length,r)===t}function includes(e,t,r){if(typeof r!=="number"){r=0}if(r+t.length>e.length){return false}else{return e.indexOf(t,r)!==-1}}createErrorType("ERR_INVALID_OPT_VALUE",(function(e,t){return'The value "'+t+'" is invalid for option "'+e+'"'}),TypeError);createErrorType("ERR_INVALID_ARG_TYPE",(function(e,t,r){let i;if(typeof t==="string"&&startsWith(t,"not ")){i="must not be";t=t.replace(/^not /,"")}else{i="must be"}let n;if(endsWith(e," argument")){n=`The ${e} ${i} ${oneOf(t,"type")}`}else{const r=includes(e,".")?"property":"argument";n=`The "${e}" ${r} ${i} ${oneOf(t,"type")}`}n+=`. Received type ${typeof r}`;return n}),TypeError);createErrorType("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF");createErrorType("ERR_METHOD_NOT_IMPLEMENTED",(function(e){return"The "+e+" method is not implemented"}));createErrorType("ERR_STREAM_PREMATURE_CLOSE","Premature close");createErrorType("ERR_STREAM_DESTROYED",(function(e){return"Cannot call "+e+" after a stream was destroyed"}));createErrorType("ERR_MULTIPLE_CALLBACK","Callback called multiple times");createErrorType("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable");createErrorType("ERR_STREAM_WRITE_AFTER_END","write after end");createErrorType("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError);createErrorType("ERR_UNKNOWN_ENCODING",(function(e){return"Unknown encoding: "+e}),TypeError);createErrorType("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event");e.exports.q=t},5077:function(e,t,r){"use strict";var i=Object.keys||function(e){var t=[];for(var r in e){t.push(r)}return t};e.exports=Duplex;var n=r(279);var a=r(3582);r(7526)(Duplex,n);{var s=i(a.prototype);for(var o=0;o0){if(typeof t!=="string"&&!a.objectMode&&Object.getPrototypeOf(t)!==o.prototype){t=_uint8ArrayToBuffer(t)}if(i){if(a.endEmitted)B(e,new _);else addChunk(e,a,t,true)}else if(a.ended){B(e,new y)}else if(a.destroyed){return false}else{a.reading=false;if(a.decoder&&!r){t=a.decoder.write(t);if(a.objectMode||t.length!==0)addChunk(e,a,t,false);else maybeReadMore(e,a)}else{addChunk(e,a,t,false)}}}else if(!i){a.reading=false;maybeReadMore(e,a)}}return!a.ended&&(a.length=A){e=A}else{e--;e|=e>>>1;e|=e>>>2;e|=e>>>4;e|=e>>>8;e|=e>>>16;e++}return e}function howMuchToRead(e,t){if(e<=0||t.length===0&&t.ended)return 0;if(t.objectMode)return 1;if(e!==e){if(t.flowing&&t.length)return t.buffer.head.data.length;else return t.length}if(e>t.highWaterMark)t.highWaterMark=computeNewHighWaterMark(e);if(e<=t.length)return e;if(!t.ended){t.needReadable=true;return 0}return t.length}Readable.prototype.read=function(e){d("read",e);e=parseInt(e,10);var t=this._readableState;var r=e;if(e!==0)t.emittedReadable=false;if(e===0&&t.needReadable&&((t.highWaterMark!==0?t.length>=t.highWaterMark:t.length>0)||t.ended)){d("read: emitReadable",t.length,t.ended);if(t.length===0&&t.ended)endReadable(this);else emitReadable(this);return null}e=howMuchToRead(e,t);if(e===0&&t.ended){if(t.length===0)endReadable(this);return null}var i=t.needReadable;d("need readable",i);if(t.length===0||t.length-e0)n=fromList(e,t);else n=null;if(n===null){t.needReadable=t.length<=t.highWaterMark;e=0}else{t.length-=e;t.awaitDrain=0}if(t.length===0){if(!t.ended)t.needReadable=true;if(r!==e&&t.ended)endReadable(this)}if(n!==null)this.emit("data",n);return n};function onEofChunk(e,t){d("onEofChunk");if(t.ended)return;if(t.decoder){var r=t.decoder.end();if(r&&r.length){t.buffer.push(r);t.length+=t.objectMode?1:r.length}}t.ended=true;if(t.sync){emitReadable(e)}else{t.needReadable=false;if(!t.emittedReadable){t.emittedReadable=true;emitReadable_(e)}}}function emitReadable(e){var t=e._readableState;d("emitReadable",t.needReadable,t.emittedReadable);t.needReadable=false;if(!t.emittedReadable){d("emitReadable",t.flowing);t.emittedReadable=true;process.nextTick(emitReadable_,e)}}function emitReadable_(e){var t=e._readableState;d("emitReadable_",t.destroyed,t.length,t.ended);if(!t.destroyed&&(t.length||t.ended)){e.emit("readable");t.emittedReadable=false}t.needReadable=!t.flowing&&!t.ended&&t.length<=t.highWaterMark;flow(e)}function maybeReadMore(e,t){if(!t.readingMore){t.readingMore=true;process.nextTick(maybeReadMore_,e,t)}}function maybeReadMore_(e,t){while(!t.reading&&!t.ended&&(t.length1&&indexOf(i.pipes,e)!==-1)&&!u){d("false write response, pause",i.awaitDrain);i.awaitDrain++}r.pause()}}function onerror(t){d("onerror",t);unpipe();e.removeListener("error",onerror);if(a(e,"error")===0)B(e,t)}prependListener(e,"error",onerror);function onclose(){e.removeListener("finish",onfinish);unpipe()}e.once("close",onclose);function onfinish(){d("onfinish");e.removeListener("close",onclose);unpipe()}e.once("finish",onfinish);function unpipe(){d("unpipe");r.unpipe(e)}e.emit("pipe",r);if(!i.flowing){d("pipe resume");r.resume()}return e};function pipeOnDrain(e){return function pipeOnDrainFunctionResult(){var t=e._readableState;d("pipeOnDrain",t.awaitDrain);if(t.awaitDrain)t.awaitDrain--;if(t.awaitDrain===0&&a(e,"data")){t.flowing=true;flow(e)}}}Readable.prototype.unpipe=function(e){var t=this._readableState;var r={hasUnpiped:false};if(t.pipesCount===0)return this;if(t.pipesCount===1){if(e&&e!==t.pipes)return this;if(!e)e=t.pipes;t.pipes=null;t.pipesCount=0;t.flowing=false;if(e)e.emit("unpipe",this,r);return this}if(!e){var i=t.pipes;var n=t.pipesCount;t.pipes=null;t.pipesCount=0;t.flowing=false;for(var a=0;a0;if(i.flowing!==false)this.resume()}else if(e==="readable"){if(!i.endEmitted&&!i.readableListening){i.readableListening=i.needReadable=true;i.flowing=false;i.emittedReadable=false;d("on readable",i.length,i.reading);if(i.length){emitReadable(this)}else if(!i.reading){process.nextTick(nReadingNextTick,this)}}}return r};Readable.prototype.addListener=Readable.prototype.on;Readable.prototype.removeListener=function(e,t){var r=s.prototype.removeListener.call(this,e,t);if(e==="readable"){process.nextTick(updateReadableListening,this)}return r};Readable.prototype.removeAllListeners=function(e){var t=s.prototype.removeAllListeners.apply(this,arguments);if(e==="readable"||e===undefined){process.nextTick(updateReadableListening,this)}return t};function updateReadableListening(e){var t=e._readableState;t.readableListening=e.listenerCount("readable")>0;if(t.resumeScheduled&&!t.paused){t.flowing=true}else if(e.listenerCount("data")>0){e.resume()}}function nReadingNextTick(e){d("readable nexttick read 0");e.read(0)}Readable.prototype.resume=function(){var e=this._readableState;if(!e.flowing){d("resume");e.flowing=!e.readableListening;resume(this,e)}e.paused=false;return this};function resume(e,t){if(!t.resumeScheduled){t.resumeScheduled=true;process.nextTick(resume_,e,t)}}function resume_(e,t){d("resume",t.reading);if(!t.reading){e.read(0)}t.resumeScheduled=false;e.emit("resume");flow(e);if(t.flowing&&!t.reading)e.read(0)}Readable.prototype.pause=function(){d("call pause flowing=%j",this._readableState.flowing);if(this._readableState.flowing!==false){d("pause");this._readableState.flowing=false;this.emit("pause")}this._readableState.paused=true;return this};function flow(e){var t=e._readableState;d("flow",t.flowing);while(t.flowing&&e.read()!==null){}}Readable.prototype.wrap=function(e){var t=this;var r=this._readableState;var i=false;e.on("end",(function(){d("wrapped end");if(r.decoder&&!r.ended){var e=r.decoder.end();if(e&&e.length)t.push(e)}t.push(null)}));e.on("data",(function(n){d("wrapped data");if(r.decoder)n=r.decoder.write(n);if(r.objectMode&&(n===null||n===undefined))return;else if(!r.objectMode&&(!n||!n.length))return;var a=t.push(n);if(!a){i=true;e.pause()}}));for(var n in e){if(this[n]===undefined&&typeof e[n]==="function"){this[n]=function methodWrap(t){return function methodWrapReturnFunction(){return e[t].apply(e,arguments)}}(n)}}for(var a=0;a=t.length){if(t.decoder)r=t.buffer.join("");else if(t.buffer.length===1)r=t.buffer.first();else r=t.buffer.concat(t.length);t.buffer.clear()}else{r=t.buffer.consume(e,t.decoder)}return r}function endReadable(e){var t=e._readableState;d("endReadable",t.endEmitted);if(!t.endEmitted){t.ended=true;process.nextTick(endReadableNT,t,e)}}function endReadableNT(e,t){d("endReadableNT",e.endEmitted,e.length);if(!e.endEmitted&&e.length===0){e.endEmitted=true;t.readable=false;t.emit("end");if(e.autoDestroy){var r=t._writableState;if(!r||r.autoDestroy&&r.finished){t.destroy()}}}}if(typeof Symbol==="function"){Readable.from=function(e,t){if(E===undefined){E=r(1514)}return E(Readable,e,t)}}function indexOf(e,t){for(var r=0,i=e.length;r-1))throw new _(e);this._writableState.defaultEncoding=e;return this};Object.defineProperty(Writable.prototype,"writableBuffer",{enumerable:false,get:function get(){return this._writableState&&this._writableState.getBuffer()}});function decodeChunk(e,t,r){if(!e.objectMode&&e.decodeStrings!==false&&typeof t==="string"){t=s.from(t,r)}return t}Object.defineProperty(Writable.prototype,"writableHighWaterMark",{enumerable:false,get:function get(){return this._writableState.highWaterMark}});function writeOrBuffer(e,t,r,i,n,a){if(!r){var s=decodeChunk(t,i,n);if(i!==s){r=true;n="buffer";i=s}}var o=t.objectMode?1:i.length;t.length+=o;var u=t.length0)this.tail.next=t;else this.head=t;this.tail=t;++this.length}},{key:"unshift",value:function unshift(e){var t={data:e,next:this.head};if(this.length===0)this.tail=t;this.head=t;++this.length}},{key:"shift",value:function shift(){if(this.length===0)return;var e=this.head.data;if(this.length===1)this.head=this.tail=null;else this.head=this.head.next;--this.length;return e}},{key:"clear",value:function clear(){this.head=this.tail=null;this.length=0}},{key:"join",value:function join(e){if(this.length===0)return"";var t=this.head;var r=""+t.data;while(t=t.next){r+=e+t.data}return r}},{key:"concat",value:function concat(e){if(this.length===0)return n.alloc(0);var t=n.allocUnsafe(e>>>0);var r=this.head;var i=0;while(r){copyBuffer(r.data,t,i);i+=r.data.length;r=r.next}return t}},{key:"consume",value:function consume(e,t){var r;if(en.length?n.length:e;if(a===n.length)i+=n;else i+=n.slice(0,e);e-=a;if(e===0){if(a===n.length){++r;if(t.next)this.head=t.next;else this.head=this.tail=null}else{this.head=t;t.data=n.slice(a)}break}++r}this.length-=r;return i}},{key:"_getBuffer",value:function _getBuffer(e){var t=n.allocUnsafe(e);var r=this.head;var i=1;r.data.copy(t);e-=r.data.length;while(r=r.next){var a=r.data;var s=e>a.length?a.length:e;a.copy(t,t.length-e,0,s);e-=s;if(e===0){if(s===a.length){++i;if(r.next)this.head=r.next;else this.head=this.tail=null}else{this.head=r;r.data=a.slice(s)}break}++i}this.length-=i;return t}},{key:o,value:function value(e,t){return s(this,_objectSpread({},t,{depth:0,customInspect:false}))}}]);return BufferList}()},8956:function(e){"use strict";function destroy(e,t){var r=this;var i=this._readableState&&this._readableState.destroyed;var n=this._writableState&&this._writableState.destroyed;if(i||n){if(t){t(e)}else if(e){if(!this._writableState){process.nextTick(emitErrorNT,this,e)}else if(!this._writableState.errorEmitted){this._writableState.errorEmitted=true;process.nextTick(emitErrorNT,this,e)}}return this}if(this._readableState){this._readableState.destroyed=true}if(this._writableState){this._writableState.destroyed=true}this._destroy(e||null,(function(e){if(!t&&e){if(!r._writableState){process.nextTick(emitErrorAndCloseNT,r,e)}else if(!r._writableState.errorEmitted){r._writableState.errorEmitted=true;process.nextTick(emitErrorAndCloseNT,r,e)}else{process.nextTick(emitCloseNT,r)}}else if(t){process.nextTick(emitCloseNT,r);t(e)}else{process.nextTick(emitCloseNT,r)}}));return this}function emitErrorAndCloseNT(e,t){emitErrorNT(e,t);emitCloseNT(e)}function emitCloseNT(e){if(e._writableState&&!e._writableState.emitClose)return;if(e._readableState&&!e._readableState.emitClose)return;e.emit("close")}function undestroy(){if(this._readableState){this._readableState.destroyed=false;this._readableState.reading=false;this._readableState.ended=false;this._readableState.endEmitted=false}if(this._writableState){this._writableState.destroyed=false;this._writableState.ended=false;this._writableState.ending=false;this._writableState.finalCalled=false;this._writableState.prefinished=false;this._writableState.finished=false;this._writableState.errorEmitted=false}}function emitErrorNT(e,t){e.emit("error",t)}function errorOrDestroy(e,t){var r=e._readableState;var i=e._writableState;if(r&&r.autoDestroy||i&&i.autoDestroy)e.destroy(t);else e.emit("error",t)}e.exports={destroy:destroy,undestroy:undestroy,errorOrDestroy:errorOrDestroy}},9830:function(e,t,r){"use strict";var i=r(519).q.ERR_STREAM_PREMATURE_CLOSE;function once(e){var t=false;return function(){if(t)return;t=true;for(var r=arguments.length,i=new Array(r),n=0;n0;return destroyer(e,a,o,(function(e){if(!n)n=e;if(e)s.forEach(call);if(a)return;s.forEach(call);i(n)}))}));return t.reduce(pipe)}e.exports=pipeline},4292:function(e,t,r){"use strict";var i=r(519).q.ERR_INVALID_OPT_VALUE;function highWaterMarkFrom(e,t,r){return e.highWaterMark!=null?e.highWaterMark:t?e[r]:null}function getHighWaterMark(e,t,r,n){var a=highWaterMarkFrom(t,n,r);if(a!=null){if(!(isFinite(a)&&Math.floor(a)===a)||a<0){var s=n?r:"highWaterMark";throw new i(s,a)}return Math.floor(a)}return e.objectMode?16:16*1024}e.exports={getHighWaterMark:getHighWaterMark}},3917:function(e,t,r){e.exports=r(2781)},5098:function(e,t,r){var i=r(2781);if(process.env.READABLE_STREAM==="disable"&&i){e.exports=i.Readable;Object.assign(e.exports,i);e.exports.Stream=i}else{t=e.exports=r(279);t.Stream=i||t;t.Readable=t;t.Writable=r(3582);t.Duplex=r(5077);t.Transform=r(6821);t.PassThrough=r(3880);t.finished=r(9830);t.pipeline=r(1586)}},9767:function(e,t,r){var i=t;i.utils=r(8911);i.common=r(5169);i.sha=r(9417);i.ripemd=r(5282);i.hmac=r(7890);i.sha1=i.sha.sha1;i.sha256=i.sha.sha256;i.sha224=i.sha.sha224;i.sha384=i.sha.sha384;i.sha512=i.sha.sha512;i.ripemd160=i.ripemd.ripemd160},5169:function(e,t,r){"use strict";var i=r(8911);var n=r(9036);function BlockHash(){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}t.BlockHash=BlockHash;BlockHash.prototype.update=function update(e,t){e=i.toArray(e,t);if(!this.pending)this.pending=e;else this.pending=this.pending.concat(e);this.pendingTotal+=e.length;if(this.pending.length>=this._delta8){e=this.pending;var r=e.length%this._delta8;this.pending=e.slice(e.length-r,e.length);if(this.pending.length===0)this.pending=null;e=i.join32(e,0,e.length-r,this.endian);for(var n=0;n>>24&255;i[n++]=e>>>16&255;i[n++]=e>>>8&255;i[n++]=e&255}else{i[n++]=e&255;i[n++]=e>>>8&255;i[n++]=e>>>16&255;i[n++]=e>>>24&255;i[n++]=0;i[n++]=0;i[n++]=0;i[n++]=0;for(a=8;athis.blockSize)e=(new this.Hash).update(e).digest();n(e.length<=this.blockSize);for(var t=e.length;t>>3}t.g0_256=g0_256;function g1_256(e){return n(e,17)^n(e,19)^e>>>10}t.g1_256=g1_256},8911:function(e,t,r){"use strict";var i=r(9036);var n=r(7526);t.inherits=n;function isSurrogatePair(e,t){if((e.charCodeAt(t)&64512)!==55296){return false}if(t<0||t+1>=e.length){return false}return(e.charCodeAt(t+1)&64512)===56320}function toArray(e,t){if(Array.isArray(e))return e.slice();if(!e)return[];var r=[];if(typeof e==="string"){if(!t){var i=0;for(var n=0;n>6|192;r[i++]=a&63|128}else if(isSurrogatePair(e,n)){a=65536+((a&1023)<<10)+(e.charCodeAt(++n)&1023);r[i++]=a>>18|240;r[i++]=a>>12&63|128;r[i++]=a>>6&63|128;r[i++]=a&63|128}else{r[i++]=a>>12|224;r[i++]=a>>6&63|128;r[i++]=a&63|128}}}else if(t==="hex"){e=e.replace(/[^a-z0-9]+/gi,"");if(e.length%2!==0)e="0"+e;for(n=0;n>>24|e>>>8&65280|e<<8&16711680|(e&255)<<24;return t>>>0}t.htonl=htonl;function toHex32(e,t){var r="";for(var i=0;i>>0}return s}t.join32=join32;function split32(e,t){var r=new Array(e.length*4);for(var i=0,n=0;i>>24;r[n+1]=a>>>16&255;r[n+2]=a>>>8&255;r[n+3]=a&255}else{r[n+3]=a>>>24;r[n+2]=a>>>16&255;r[n+1]=a>>>8&255;r[n]=a&255}}return r}t.split32=split32;function rotr32(e,t){return e>>>t|e<<32-t}t.rotr32=rotr32;function rotl32(e,t){return e<>>32-t}t.rotl32=rotl32;function sum32(e,t){return e+t>>>0}t.sum32=sum32;function sum32_3(e,t,r){return e+t+r>>>0}t.sum32_3=sum32_3;function sum32_4(e,t,r,i){return e+t+r+i>>>0}t.sum32_4=sum32_4;function sum32_5(e,t,r,i,n){return e+t+r+i+n>>>0}t.sum32_5=sum32_5;function sum64(e,t,r,i){var n=e[t];var a=e[t+1];var s=i+a>>>0;var o=(s>>0;e[t+1]=s}t.sum64=sum64;function sum64_hi(e,t,r,i){var n=t+i>>>0;var a=(n>>0}t.sum64_hi=sum64_hi;function sum64_lo(e,t,r,i){var n=t+i;return n>>>0}t.sum64_lo=sum64_lo;function sum64_4_hi(e,t,r,i,n,a,s,o){var u=0;var h=t;h=h+i>>>0;u+=h>>0;u+=h>>0;u+=h>>0}t.sum64_4_hi=sum64_4_hi;function sum64_4_lo(e,t,r,i,n,a,s,o){var u=t+i+a+o;return u>>>0}t.sum64_4_lo=sum64_4_lo;function sum64_5_hi(e,t,r,i,n,a,s,o,u,h){var d=0;var c=t;c=c+i>>>0;d+=c>>0;d+=c>>0;d+=c>>0;d+=c>>0}t.sum64_5_hi=sum64_5_hi;function sum64_5_lo(e,t,r,i,n,a,s,o,u,h){var d=t+i+a+o+h;return d>>>0}t.sum64_5_lo=sum64_5_lo;function rotr64_hi(e,t,r){var i=t<<32-r|e>>>r;return i>>>0}t.rotr64_hi=rotr64_hi;function rotr64_lo(e,t,r){var i=e<<32-r|t>>>r;return i>>>0}t.rotr64_lo=rotr64_lo;function shr64_hi(e,t,r){return e>>>r}t.shr64_hi=shr64_hi;function shr64_lo(e,t,r){var i=e<<32-r|t>>>r;return i>>>0}t.shr64_lo=shr64_lo},8242:function(e,t,r){"use strict";var i=r(9767);var n=r(6249);var a=r(9036);function HmacDRBG(e){if(!(this instanceof HmacDRBG))return new HmacDRBG(e);this.hash=e.hash;this.predResist=!!e.predResist;this.outLen=this.hash.outSize;this.minEntropy=e.minEntropy||this.hash.hmacStrength;this._reseed=null;this.reseedInterval=null;this.K=null;this.V=null;var t=n.toArray(e.entropy,e.entropyEnc||"hex");var r=n.toArray(e.nonce,e.nonceEnc||"hex");var i=n.toArray(e.pers,e.persEnc||"hex");a(t.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits");this._init(t,r,i)}e.exports=HmacDRBG;HmacDRBG.prototype._init=function init(e,t,r){var i=e.concat(t).concat(r);this.K=new Array(this.outLen/8);this.V=new Array(this.outLen/8);for(var n=0;n=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits");this._update(e.concat(r||[]));this._reseed=1};HmacDRBG.prototype.generate=function generate(e,t,r,i){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");if(typeof t!=="string"){i=r;r=t;t=null}if(r){r=n.toArray(r,i||"hex");this._update(r)}var a=[];while(a.length56){this._block.fill(0,this._blockOffset,64);this._update();this._blockOffset=0}this._block.fill(0,this._blockOffset,56);this._block.writeUInt32LE(this._length[0],56);this._block.writeUInt32LE(this._length[1],60);this._update();var e=a.allocUnsafe(16);e.writeInt32LE(this._a,0);e.writeInt32LE(this._b,4);e.writeInt32LE(this._c,8);e.writeInt32LE(this._d,12);return e};function rotl(e,t){return e<>>32-t}function fnF(e,t,r,i,n,a,s){return rotl(e+(t&r|~t&i)+n+a|0,s)+t|0}function fnG(e,t,r,i,n,a,s){return rotl(e+(t&i|r&~i)+n+a|0,s)+t|0}function fnH(e,t,r,i,n,a,s){return rotl(e+(t^r^i)+n+a|0,s)+t|0}function fnI(e,t,r,i,n,a,s){return rotl(e+(r^(t|~i))+n+a|0,s)+t|0}e.exports=MD5},148:function(e,t,r){var i=r(6884);var n=r(6069);function MillerRabin(e){this.rand=e||new n.Rand}e.exports=MillerRabin;MillerRabin.create=function create(e){return new MillerRabin(e)};MillerRabin.prototype._randbelow=function _randbelow(e){var t=e.bitLength();var r=Math.ceil(t/8);do{var n=new i(this.rand.generate(r))}while(n.cmp(e)>=0);return n};MillerRabin.prototype._randrange=function _randrange(e,t){var r=t.sub(e);return e.add(this._randbelow(r))};MillerRabin.prototype.test=function test(e,t,r){var n=e.bitLength();var a=i.mont(e);var s=new i(1).toRed(a);if(!t)t=Math.max(1,n/48|0);var o=e.subn(1);for(var u=0;!o.testn(u);u++){}var h=e.shrn(u);var d=o.toRed(a);var c=true;for(;t>0;t--){var l=this._randrange(new i(2),o);if(r)r(l);var p=l.toRed(a).redPow(h);if(p.cmp(s)===0||p.cmp(d)===0)continue;for(var b=1;b0;t--){var d=this._randrange(new i(2),s);var c=e.gcd(d);if(c.cmpn(1)!==0)return c;var l=d.toRed(n).redPow(u);if(l.cmp(a)===0||l.cmp(h)===0)continue;for(var p=1;p>8;var s=n&255;if(a)r.push(a,s);else r.push(s)}}return r}r.toArray=toArray;function zero2(e){if(e.length===1)return"0"+e;else return e}r.zero2=zero2;function toHex(e){var t="";for(var r=0;r=6?"utf-8":"binary"}else{t="utf-8"}e.exports=t},721:function(e){var t=Math.pow(2,30)-1;e.exports=function(e,r){if(typeof e!=="number"){throw new TypeError("Iterations not a number")}if(e<0){throw new TypeError("Bad iterations")}if(typeof r!=="number"){throw new TypeError("Key length not a number")}if(r<0||r>t||r!==r){throw new TypeError("Bad key length")}}},2419:function(e,t,r){var i={md5:16,sha1:20,sha224:28,sha256:32,sha384:48,sha512:64,rmd160:20,ripemd160:20};var n=r(2730);var a=r(3118).Buffer;var s=r(721);var o=r(908);var u=r(7409);function pbkdf2(e,t,r,h,d){s(r,h);e=u(e,o,"Password");t=u(t,o,"Salt");d=d||"sha1";var c=a.allocUnsafe(h);var l=a.allocUnsafe(t.length+4);t.copy(l,0,0,t.length);var p=0;var b=i[d];var v=Math.ceil(h/b);for(var m=1;m<=v;m++){l.writeUInt32BE(m,t.length);var y=n(d,e).update(l).digest();var g=y;for(var _=1;_u||new s(t).cmp(a.modulus)>=0){throw new Error("decryption error")}var c;if(r){c=h(new s(t),a)}else{c=o(t,a)}var l=d.alloc(u-c.length);c=d.concat([l,c],u);if(n===4){return oaep(a,c)}else if(n===1){return pkcs1(a,c,r)}else if(n===3){return c}else{throw new Error("unknown padding")}};function oaep(e,t){var r=e.modulus.byteLength();var i=u("sha1").update(d.alloc(0)).digest();var s=i.length;if(t[0]!==0){throw new Error("decryption error")}var o=t.slice(1,s+1);var h=t.slice(s+1);var c=a(o,n(h,s));var l=a(h,n(c,r-s-1));if(compare(i,l.slice(0,s))){throw new Error("decryption error")}var p=s;while(l[p]===0){p++}if(l[p++]!==1){throw new Error("decryption error")}return l.slice(p)}function pkcs1(e,t,r){var i=t.slice(0,2);var n=2;var a=0;while(t[n++]!==0){if(n>=t.length){a++;break}}var s=t.slice(2,n-1);if(i.toString("hex")!=="0002"&&!r||i.toString("hex")!=="0001"&&r){a++}if(s.length<8){a++}if(a){throw new Error("decryption error")}return t.slice(n)}function compare(e,t){e=d.from(e);t=d.from(t);var r=0;var i=e.length;if(e.length!==t.length){r++;i=Math.min(e.length,t.length)}var n=-1;while(++n=0){throw new Error("data too long for modulus")}}else{throw new Error("unknown padding")}if(r){return d(s,a)}else{return h(s,a)}};function oaep(e,t){var r=e.modulus.byteLength();var i=t.length;var h=a("sha1").update(c.alloc(0)).digest();var d=h.length;var l=2*d;if(i>r-l-2){throw new Error("message too long")}var p=c.alloc(r-i-l-2);var b=r-d-1;var v=n(d);var m=o(c.concat([h,p,c.alloc(1,1),t],b),s(v,b));var y=o(v,s(m,d));return new u(c.concat([c.alloc(1),y,m],r))}function pkcs1(e,t,r){var i=t.length;var n=e.modulus.byteLength();if(i>n-11){throw new Error("message too long")}var a;if(r){a=c.alloc(n-i-3,255)}else{a=nonZero(n-i-3)}return new u(c.concat([c.from([0,r?1:2]),a,c.alloc(1),t],n))}function nonZero(e){var t=c.allocUnsafe(e);var r=0;var i=n(e*2);var a=0;var s;while(rn)throw new RangeError("requested too many random bytes");var r=a.allocUnsafe(e);if(e>0){if(e>i){for(var o=0;ou||e<0){throw new TypeError("offset must be a uint32")}if(e>s||e>t){throw new RangeError("offset out of range")}}function assertSize(e,t,r){if(typeof e!=="number"||e!==e){throw new TypeError("size must be a number")}if(e>u||e<0){throw new TypeError("size must be a uint32")}if(e+t>r||e>s){throw new RangeError("buffer too small")}}if(o&&o.getRandomValues||!process.browser){t.randomFill=randomFill;t.randomFillSync=randomFillSync}else{t.randomFill=oldBrowser;t.randomFillSync=oldBrowser}function randomFill(e,t,r,i){if(!a.isBuffer(e)&&!(e instanceof global.Uint8Array)){throw new TypeError('"buf" argument must be a Buffer or Uint8Array')}if(typeof t==="function"){i=t;t=0;r=e.length}else if(typeof r==="function"){i=r;r=e.length-t}else if(typeof i!=="function"){throw new TypeError('"cb" argument must be a function')}assertOffset(t,e.length);assertSize(r,t,e.length);return actualFill(e,t,r,i)}function actualFill(e,t,r,i){if(process.browser){var a=e.buffer;var s=new Uint8Array(a,t,r);o.getRandomValues(s);if(i){process.nextTick((function(){i(null,e)}));return}return e}if(i){n(r,(function(r,n){if(r){return i(r)}n.copy(e,t);i(null,e)}));return}var u=n(r);u.copy(e,t);return e}function randomFillSync(e,t,r){if(typeof t==="undefined"){t=0}if(!a.isBuffer(e)&&!(e instanceof global.Uint8Array)){throw new TypeError('"buf" argument must be a Buffer or Uint8Array')}assertOffset(t,e.length);if(r===undefined)r=e.length-t;assertSize(r,t,e.length);return actualFill(e,t,r)}},7455:function(e,t,r){"use strict";var i=r(4300).Buffer;var n=r(7526);var a=r(3421);var s=new Array(16);var o=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13];var u=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11];var h=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6];var d=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11];var c=[0,1518500249,1859775393,2400959708,2840853838];var l=[1352829926,1548603684,1836072691,2053994217,0];function RIPEMD160(){a.call(this,64);this._a=1732584193;this._b=4023233417;this._c=2562383102;this._d=271733878;this._e=3285377520}n(RIPEMD160,a);RIPEMD160.prototype._update=function(){var e=s;for(var t=0;t<16;++t)e[t]=this._block.readInt32LE(t*4);var r=this._a|0;var i=this._b|0;var n=this._c|0;var a=this._d|0;var p=this._e|0;var b=this._a|0;var v=this._b|0;var m=this._c|0;var y=this._d|0;var g=this._e|0;for(var _=0;_<80;_+=1){var w;var M;if(_<16){w=fn1(r,i,n,a,p,e[o[_]],c[0],h[_]);M=fn5(b,v,m,y,g,e[u[_]],l[0],d[_])}else if(_<32){w=fn2(r,i,n,a,p,e[o[_]],c[1],h[_]);M=fn4(b,v,m,y,g,e[u[_]],l[1],d[_])}else if(_<48){w=fn3(r,i,n,a,p,e[o[_]],c[2],h[_]);M=fn3(b,v,m,y,g,e[u[_]],l[2],d[_])}else if(_<64){w=fn4(r,i,n,a,p,e[o[_]],c[3],h[_]);M=fn2(b,v,m,y,g,e[u[_]],l[3],d[_])}else{w=fn5(r,i,n,a,p,e[o[_]],c[4],h[_]);M=fn1(b,v,m,y,g,e[u[_]],l[4],d[_])}r=p;p=a;a=rotl(n,10);n=i;i=w;b=g;g=y;y=rotl(m,10);m=v;v=M}var E=this._b+n+y|0;this._b=this._c+a+g|0;this._c=this._d+p+b|0;this._d=this._e+r+v|0;this._e=this._a+i+m|0;this._a=E};RIPEMD160.prototype._digest=function(){this._block[this._blockOffset++]=128;if(this._blockOffset>56){this._block.fill(0,this._blockOffset,64);this._update();this._blockOffset=0}this._block.fill(0,this._blockOffset,56);this._block.writeUInt32LE(this._length[0],56);this._block.writeUInt32LE(this._length[1],60);this._update();var e=i.alloc?i.alloc(20):new i(20);e.writeInt32LE(this._a,0);e.writeInt32LE(this._b,4);e.writeInt32LE(this._c,8);e.writeInt32LE(this._d,12);e.writeInt32LE(this._e,16);return e};function rotl(e,t){return e<>>32-t}function fn1(e,t,r,i,n,a,s,o){return rotl(e+(t^r^i)+a+s|0,o)+n|0}function fn2(e,t,r,i,n,a,s,o){return rotl(e+(t&r|~t&i)+a+s|0,o)+n|0}function fn3(e,t,r,i,n,a,s,o){return rotl(e+((t|~r)^i)+a+s|0,o)+n|0}function fn4(e,t,r,i,n,a,s,o){return rotl(e+(t&i|r&~i)+a+s|0,o)+n|0}function fn5(e,t,r,i,n,a,s,o){return rotl(e+(t^(r|~i))+a+s|0,o)+n|0}e.exports=RIPEMD160},3118:function(e,t,r){var i=r(4300);var n=i.Buffer;function copyProps(e,t){for(var r in e){t[r]=e[r]}}if(n.from&&n.alloc&&n.allocUnsafe&&n.allocUnsafeSlow){e.exports=i}else{copyProps(i,t);t.Buffer=SafeBuffer}function SafeBuffer(e,t,r){return n(e,t,r)}SafeBuffer.prototype=Object.create(n.prototype);copyProps(n,SafeBuffer);SafeBuffer.from=function(e,t,r){if(typeof e==="number"){throw new TypeError("Argument must not be a number")}return n(e,t,r)};SafeBuffer.alloc=function(e,t,r){if(typeof e!=="number"){throw new TypeError("Argument must be a number")}var i=n(e);if(t!==undefined){if(typeof r==="string"){i.fill(t,r)}else{i.fill(t)}}else{i.fill(0)}return i};SafeBuffer.allocUnsafe=function(e){if(typeof e!=="number"){throw new TypeError("Argument must be a number")}return n(e)};SafeBuffer.allocUnsafeSlow=function(e){if(typeof e!=="number"){throw new TypeError("Argument must be a number")}return i.SlowBuffer(e)}},7782:function(e,t,r){var i=r(3118).Buffer;function Hash(e,t){this._block=i.alloc(e);this._finalSize=t;this._blockSize=e;this._len=0}Hash.prototype.update=function(e,t){if(typeof e==="string"){t=t||"utf8";e=i.from(e,t)}var r=this._block;var n=this._blockSize;var a=e.length;var s=this._len;for(var o=0;o=this._finalSize){this._update(this._block);this._block.fill(0)}var r=this._len*8;if(r<=4294967295){this._block.writeUInt32BE(r,this._blockSize-4)}else{var i=(r&4294967295)>>>0;var n=(r-i)/4294967296;this._block.writeUInt32BE(n,this._blockSize-8);this._block.writeUInt32BE(i,this._blockSize-4)}this._update(this._block);var a=this._hash();return e?a.toString(e):a};Hash.prototype._update=function(){throw new Error("_update must be implemented by subclass")};e.exports=Hash},1862:function(e,t,r){var i=e.exports=function SHA(e){e=e.toLowerCase();var t=i[e];if(!t)throw new Error(e+" is not supported (we accept pull requests)");return new t};i.sha=r(2003);i.sha1=r(5645);i.sha224=r(7741);i.sha256=r(9642);i.sha384=r(3869);i.sha512=r(3741)},2003:function(e,t,r){var i=r(7526);var n=r(7782);var a=r(3118).Buffer;var s=[1518500249,1859775393,2400959708|0,3395469782|0];var o=new Array(80);function Sha(){this.init();this._w=o;n.call(this,64,56)}i(Sha,n);Sha.prototype.init=function(){this._a=1732584193;this._b=4023233417;this._c=2562383102;this._d=271733878;this._e=3285377520;return this};function rotl5(e){return e<<5|e>>>27}function rotl30(e){return e<<30|e>>>2}function ft(e,t,r,i){if(e===0)return t&r|~t&i;if(e===2)return t&r|t&i|r&i;return t^r^i}Sha.prototype._update=function(e){var t=this._w;var r=this._a|0;var i=this._b|0;var n=this._c|0;var a=this._d|0;var o=this._e|0;for(var u=0;u<16;++u)t[u]=e.readInt32BE(u*4);for(;u<80;++u)t[u]=t[u-3]^t[u-8]^t[u-14]^t[u-16];for(var h=0;h<80;++h){var d=~~(h/20);var c=rotl5(r)+ft(d,i,n,a)+o+t[h]+s[d]|0;o=a;a=n;n=rotl30(i);i=r;r=c}this._a=r+this._a|0;this._b=i+this._b|0;this._c=n+this._c|0;this._d=a+this._d|0;this._e=o+this._e|0};Sha.prototype._hash=function(){var e=a.allocUnsafe(20);e.writeInt32BE(this._a|0,0);e.writeInt32BE(this._b|0,4);e.writeInt32BE(this._c|0,8);e.writeInt32BE(this._d|0,12);e.writeInt32BE(this._e|0,16);return e};e.exports=Sha},5645:function(e,t,r){var i=r(7526);var n=r(7782);var a=r(3118).Buffer;var s=[1518500249,1859775393,2400959708|0,3395469782|0];var o=new Array(80);function Sha1(){this.init();this._w=o;n.call(this,64,56)}i(Sha1,n);Sha1.prototype.init=function(){this._a=1732584193;this._b=4023233417;this._c=2562383102;this._d=271733878;this._e=3285377520;return this};function rotl1(e){return e<<1|e>>>31}function rotl5(e){return e<<5|e>>>27}function rotl30(e){return e<<30|e>>>2}function ft(e,t,r,i){if(e===0)return t&r|~t&i;if(e===2)return t&r|t&i|r&i;return t^r^i}Sha1.prototype._update=function(e){var t=this._w;var r=this._a|0;var i=this._b|0;var n=this._c|0;var a=this._d|0;var o=this._e|0;for(var u=0;u<16;++u)t[u]=e.readInt32BE(u*4);for(;u<80;++u)t[u]=rotl1(t[u-3]^t[u-8]^t[u-14]^t[u-16]);for(var h=0;h<80;++h){var d=~~(h/20);var c=rotl5(r)+ft(d,i,n,a)+o+t[h]+s[d]|0;o=a;a=n;n=rotl30(i);i=r;r=c}this._a=r+this._a|0;this._b=i+this._b|0;this._c=n+this._c|0;this._d=a+this._d|0;this._e=o+this._e|0};Sha1.prototype._hash=function(){var e=a.allocUnsafe(20);e.writeInt32BE(this._a|0,0);e.writeInt32BE(this._b|0,4);e.writeInt32BE(this._c|0,8);e.writeInt32BE(this._d|0,12);e.writeInt32BE(this._e|0,16);return e};e.exports=Sha1},7741:function(e,t,r){var i=r(7526);var n=r(9642);var a=r(7782);var s=r(3118).Buffer;var o=new Array(64);function Sha224(){this.init();this._w=o;a.call(this,64,56)}i(Sha224,n);Sha224.prototype.init=function(){this._a=3238371032;this._b=914150663;this._c=812702999;this._d=4144912697;this._e=4290775857;this._f=1750603025;this._g=1694076839;this._h=3204075428;return this};Sha224.prototype._hash=function(){var e=s.allocUnsafe(28);e.writeInt32BE(this._a,0);e.writeInt32BE(this._b,4);e.writeInt32BE(this._c,8);e.writeInt32BE(this._d,12);e.writeInt32BE(this._e,16);e.writeInt32BE(this._f,20);e.writeInt32BE(this._g,24);return e};e.exports=Sha224},9642:function(e,t,r){var i=r(7526);var n=r(7782);var a=r(3118).Buffer;var s=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298];var o=new Array(64);function Sha256(){this.init();this._w=o;n.call(this,64,56)}i(Sha256,n);Sha256.prototype.init=function(){this._a=1779033703;this._b=3144134277;this._c=1013904242;this._d=2773480762;this._e=1359893119;this._f=2600822924;this._g=528734635;this._h=1541459225;return this};function ch(e,t,r){return r^e&(t^r)}function maj(e,t,r){return e&t|r&(e|t)}function sigma0(e){return(e>>>2|e<<30)^(e>>>13|e<<19)^(e>>>22|e<<10)}function sigma1(e){return(e>>>6|e<<26)^(e>>>11|e<<21)^(e>>>25|e<<7)}function gamma0(e){return(e>>>7|e<<25)^(e>>>18|e<<14)^e>>>3}function gamma1(e){return(e>>>17|e<<15)^(e>>>19|e<<13)^e>>>10}Sha256.prototype._update=function(e){var t=this._w;var r=this._a|0;var i=this._b|0;var n=this._c|0;var a=this._d|0;var o=this._e|0;var u=this._f|0;var h=this._g|0;var d=this._h|0;for(var c=0;c<16;++c)t[c]=e.readInt32BE(c*4);for(;c<64;++c)t[c]=gamma1(t[c-2])+t[c-7]+gamma0(t[c-15])+t[c-16]|0;for(var l=0;l<64;++l){var p=d+sigma1(o)+ch(o,u,h)+s[l]+t[l]|0;var b=sigma0(r)+maj(r,i,n)|0;d=h;h=u;u=o;o=a+p|0;a=n;n=i;i=r;r=p+b|0}this._a=r+this._a|0;this._b=i+this._b|0;this._c=n+this._c|0;this._d=a+this._d|0;this._e=o+this._e|0;this._f=u+this._f|0;this._g=h+this._g|0;this._h=d+this._h|0};Sha256.prototype._hash=function(){var e=a.allocUnsafe(32);e.writeInt32BE(this._a,0);e.writeInt32BE(this._b,4);e.writeInt32BE(this._c,8);e.writeInt32BE(this._d,12);e.writeInt32BE(this._e,16);e.writeInt32BE(this._f,20);e.writeInt32BE(this._g,24);e.writeInt32BE(this._h,28);return e};e.exports=Sha256},3869:function(e,t,r){var i=r(7526);var n=r(3741);var a=r(7782);var s=r(3118).Buffer;var o=new Array(160);function Sha384(){this.init();this._w=o;a.call(this,128,112)}i(Sha384,n);Sha384.prototype.init=function(){this._ah=3418070365;this._bh=1654270250;this._ch=2438529370;this._dh=355462360;this._eh=1731405415;this._fh=2394180231;this._gh=3675008525;this._hh=1203062813;this._al=3238371032;this._bl=914150663;this._cl=812702999;this._dl=4144912697;this._el=4290775857;this._fl=1750603025;this._gl=1694076839;this._hl=3204075428;return this};Sha384.prototype._hash=function(){var e=s.allocUnsafe(48);function writeInt64BE(t,r,i){e.writeInt32BE(t,i);e.writeInt32BE(r,i+4)}writeInt64BE(this._ah,this._al,0);writeInt64BE(this._bh,this._bl,8);writeInt64BE(this._ch,this._cl,16);writeInt64BE(this._dh,this._dl,24);writeInt64BE(this._eh,this._el,32);writeInt64BE(this._fh,this._fl,40);return e};e.exports=Sha384},3741:function(e,t,r){var i=r(7526);var n=r(7782);var a=r(3118).Buffer;var s=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591];var o=new Array(160);function Sha512(){this.init();this._w=o;n.call(this,128,112)}i(Sha512,n);Sha512.prototype.init=function(){this._ah=1779033703;this._bh=3144134277;this._ch=1013904242;this._dh=2773480762;this._eh=1359893119;this._fh=2600822924;this._gh=528734635;this._hh=1541459225;this._al=4089235720;this._bl=2227873595;this._cl=4271175723;this._dl=1595750129;this._el=2917565137;this._fl=725511199;this._gl=4215389547;this._hl=327033209;return this};function Ch(e,t,r){return r^e&(t^r)}function maj(e,t,r){return e&t|r&(e|t)}function sigma0(e,t){return(e>>>28|t<<4)^(t>>>2|e<<30)^(t>>>7|e<<25)}function sigma1(e,t){return(e>>>14|t<<18)^(e>>>18|t<<14)^(t>>>9|e<<23)}function Gamma0(e,t){return(e>>>1|t<<31)^(e>>>8|t<<24)^e>>>7}function Gamma0l(e,t){return(e>>>1|t<<31)^(e>>>8|t<<24)^(e>>>7|t<<25)}function Gamma1(e,t){return(e>>>19|t<<13)^(t>>>29|e<<3)^e>>>6}function Gamma1l(e,t){return(e>>>19|t<<13)^(t>>>29|e<<3)^(e>>>6|t<<26)}function getCarry(e,t){return e>>>0>>0?1:0}Sha512.prototype._update=function(e){var t=this._w;var r=this._ah|0;var i=this._bh|0;var n=this._ch|0;var a=this._dh|0;var o=this._eh|0;var u=this._fh|0;var h=this._gh|0;var d=this._hh|0;var c=this._al|0;var l=this._bl|0;var p=this._cl|0;var b=this._dl|0;var v=this._el|0;var m=this._fl|0;var y=this._gl|0;var g=this._hl|0;for(var _=0;_<32;_+=2){t[_]=e.readInt32BE(_*4);t[_+1]=e.readInt32BE(_*4+4)}for(;_<160;_+=2){var w=t[_-15*2];var M=t[_-15*2+1];var E=Gamma0(w,M);var B=Gamma0l(M,w);w=t[_-2*2];M=t[_-2*2+1];var k=Gamma1(w,M);var A=Gamma1l(M,w);var N=t[_-7*2];var P=t[_-7*2+1];var x=t[_-16*2];var T=t[_-16*2+1];var I=B+P|0;var C=E+N+getCarry(I,B)|0;I=I+A|0;C=C+k+getCarry(I,A)|0;I=I+T|0;C=C+x+getCarry(I,T)|0;t[_]=C;t[_+1]=I}for(var D=0;D<160;D+=2){C=t[D];I=t[D+1];var O=maj(r,i,n);var j=maj(c,l,p);var L=sigma0(r,c);var q=sigma0(c,r);var H=sigma1(o,v);var F=sigma1(v,o);var U=s[D];var z=s[D+1];var W=Ch(o,u,h);var V=Ch(v,m,y);var G=g+F|0;var J=d+H+getCarry(G,g)|0;G=G+V|0;J=J+W+getCarry(G,V)|0;G=G+z|0;J=J+U+getCarry(G,z)|0;G=G+I|0;J=J+C+getCarry(G,I)|0;var Z=q+j|0;var X=L+O+getCarry(Z,q)|0;d=h;g=y;h=u;y=m;u=o;m=v;v=b+G|0;o=a+J+getCarry(v,b)|0;a=n;b=p;n=i;p=l;i=r;l=c;c=G+Z|0;r=J+X+getCarry(c,G)|0}this._al=this._al+c|0;this._bl=this._bl+l|0;this._cl=this._cl+p|0;this._dl=this._dl+b|0;this._el=this._el+v|0;this._fl=this._fl+m|0;this._gl=this._gl+y|0;this._hl=this._hl+g|0;this._ah=this._ah+r+getCarry(this._al,c)|0;this._bh=this._bh+i+getCarry(this._bl,l)|0;this._ch=this._ch+n+getCarry(this._cl,p)|0;this._dh=this._dh+a+getCarry(this._dl,b)|0;this._eh=this._eh+o+getCarry(this._el,v)|0;this._fh=this._fh+u+getCarry(this._fl,m)|0;this._gh=this._gh+h+getCarry(this._gl,y)|0;this._hh=this._hh+d+getCarry(this._hl,g)|0};Sha512.prototype._hash=function(){var e=a.allocUnsafe(64);function writeInt64BE(t,r,i){e.writeInt32BE(t,i);e.writeInt32BE(r,i+4)}writeInt64BE(this._ah,this._al,0);writeInt64BE(this._bh,this._bl,8);writeInt64BE(this._ch,this._cl,16);writeInt64BE(this._dh,this._dl,24);writeInt64BE(this._eh,this._el,32);writeInt64BE(this._fh,this._fl,40);writeInt64BE(this._gh,this._gl,48);writeInt64BE(this._hh,this._hl,56);return e};e.exports=Sha512},642:function(e,t,r){"use strict";var i=r(3118).Buffer;var n=i.isEncoding||function(e){e=""+e;switch(e&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return true;default:return false}};function _normalizeEncoding(e){if(!e)return"utf8";var t;while(true){switch(e){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return e;default:if(t)return;e=(""+e).toLowerCase();t=true}}}function normalizeEncoding(e){var t=_normalizeEncoding(e);if(typeof t!=="string"&&(i.isEncoding===n||!n(e)))throw new Error("Unknown encoding: "+e);return t||e}t.s=StringDecoder;function StringDecoder(e){this.encoding=normalizeEncoding(e);var t;switch(this.encoding){case"utf16le":this.text=utf16Text;this.end=utf16End;t=4;break;case"utf8":this.fillLast=utf8FillLast;t=4;break;case"base64":this.text=base64Text;this.end=base64End;t=3;break;default:this.write=simpleWrite;this.end=simpleEnd;return}this.lastNeed=0;this.lastTotal=0;this.lastChar=i.allocUnsafe(t)}StringDecoder.prototype.write=function(e){if(e.length===0)return"";var t;var r;if(this.lastNeed){t=this.fillLast(e);if(t===undefined)return"";r=this.lastNeed;this.lastNeed=0}else{r=0}if(r>5===6)return 2;else if(e>>4===14)return 3;else if(e>>3===30)return 4;return e>>6===2?-1:-2}function utf8CheckIncomplete(e,t,r){var i=t.length-1;if(i=0){if(n>0)e.lastNeed=n-1;return n}if(--i=0){if(n>0)e.lastNeed=n-2;return n}if(--i=0){if(n>0){if(n===2)n=0;else e.lastNeed=n-3}return n}return 0}function utf8CheckExtraBytes(e,t,r){if((t[0]&192)!==128){e.lastNeed=0;return"�"}if(e.lastNeed>1&&t.length>1){if((t[1]&192)!==128){e.lastNeed=1;return"�"}if(e.lastNeed>2&&t.length>2){if((t[2]&192)!==128){e.lastNeed=2;return"�"}}}}function utf8FillLast(e){var t=this.lastTotal-this.lastNeed;var r=utf8CheckExtraBytes(this,e,t);if(r!==undefined)return r;if(this.lastNeed<=e.length){e.copy(this.lastChar,t,0,this.lastNeed);return this.lastChar.toString(this.encoding,0,this.lastTotal)}e.copy(this.lastChar,t,0,e.length);this.lastNeed-=e.length}function utf8Text(e,t){var r=utf8CheckIncomplete(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=r;var i=e.length-(r-this.lastNeed);e.copy(this.lastChar,0,i);return e.toString("utf8",t,i)}function utf8End(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed)return t+"�";return t}function utf16Text(e,t){if((e.length-t)%2===0){var r=e.toString("utf16le",t);if(r){var i=r.charCodeAt(r.length-1);if(i>=55296&&i<=56319){this.lastNeed=2;this.lastTotal=4;this.lastChar[0]=e[e.length-2];this.lastChar[1]=e[e.length-1];return r.slice(0,-1)}}return r}this.lastNeed=1;this.lastTotal=2;this.lastChar[0]=e[e.length-1];return e.toString("utf16le",t,e.length-1)}function utf16End(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,r)}return t}function base64Text(e,t){var r=(e.length-t)%3;if(r===0)return e.toString("base64",t);this.lastNeed=3-r;this.lastTotal=3;if(r===1){this.lastChar[0]=e[e.length-1]}else{this.lastChar[0]=e[e.length-2];this.lastChar[1]=e[e.length-1]}return e.toString("base64",t,e.length-r)}function base64End(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed)return t+this.lastChar.toString("base64",0,3-this.lastNeed);return t}function simpleWrite(e){return e.toString(this.encoding)}function simpleEnd(e){return e&&e.length?this.write(e):""}},5121:function(e){e.exports=deprecate;function deprecate(e,t){if(config("noDeprecation")){return e}var r=false;function deprecated(){if(!r){if(config("throwDeprecation")){throw new Error(t)}else if(config("traceDeprecation")){console.trace(t)}else{console.warn(t)}r=true}return e.apply(this,arguments)}return deprecated}function config(e){try{if(!global.localStorage)return false}catch(e){return false}var t=global.localStorage[e];if(null==t)return false;return String(t).toLowerCase()==="true"}},4300:function(e){"use strict";e.exports=require("buffer")},6113:function(e){"use strict";e.exports=require("crypto")},2361:function(e){"use strict";e.exports=require("events")},2781:function(e){"use strict";e.exports=require("stream")},1576:function(e){"use strict";e.exports=require("string_decoder")},3837:function(e){"use strict";e.exports=require("util")},6144:function(e){"use strict";e.exports=require("vm")},9234:function(e){"use strict";e.exports=JSON.parse('{"aes-128-ecb":{"cipher":"AES","key":128,"iv":0,"mode":"ECB","type":"block"},"aes-192-ecb":{"cipher":"AES","key":192,"iv":0,"mode":"ECB","type":"block"},"aes-256-ecb":{"cipher":"AES","key":256,"iv":0,"mode":"ECB","type":"block"},"aes-128-cbc":{"cipher":"AES","key":128,"iv":16,"mode":"CBC","type":"block"},"aes-192-cbc":{"cipher":"AES","key":192,"iv":16,"mode":"CBC","type":"block"},"aes-256-cbc":{"cipher":"AES","key":256,"iv":16,"mode":"CBC","type":"block"},"aes128":{"cipher":"AES","key":128,"iv":16,"mode":"CBC","type":"block"},"aes192":{"cipher":"AES","key":192,"iv":16,"mode":"CBC","type":"block"},"aes256":{"cipher":"AES","key":256,"iv":16,"mode":"CBC","type":"block"},"aes-128-cfb":{"cipher":"AES","key":128,"iv":16,"mode":"CFB","type":"stream"},"aes-192-cfb":{"cipher":"AES","key":192,"iv":16,"mode":"CFB","type":"stream"},"aes-256-cfb":{"cipher":"AES","key":256,"iv":16,"mode":"CFB","type":"stream"},"aes-128-cfb8":{"cipher":"AES","key":128,"iv":16,"mode":"CFB8","type":"stream"},"aes-192-cfb8":{"cipher":"AES","key":192,"iv":16,"mode":"CFB8","type":"stream"},"aes-256-cfb8":{"cipher":"AES","key":256,"iv":16,"mode":"CFB8","type":"stream"},"aes-128-cfb1":{"cipher":"AES","key":128,"iv":16,"mode":"CFB1","type":"stream"},"aes-192-cfb1":{"cipher":"AES","key":192,"iv":16,"mode":"CFB1","type":"stream"},"aes-256-cfb1":{"cipher":"AES","key":256,"iv":16,"mode":"CFB1","type":"stream"},"aes-128-ofb":{"cipher":"AES","key":128,"iv":16,"mode":"OFB","type":"stream"},"aes-192-ofb":{"cipher":"AES","key":192,"iv":16,"mode":"OFB","type":"stream"},"aes-256-ofb":{"cipher":"AES","key":256,"iv":16,"mode":"OFB","type":"stream"},"aes-128-ctr":{"cipher":"AES","key":128,"iv":16,"mode":"CTR","type":"stream"},"aes-192-ctr":{"cipher":"AES","key":192,"iv":16,"mode":"CTR","type":"stream"},"aes-256-ctr":{"cipher":"AES","key":256,"iv":16,"mode":"CTR","type":"stream"},"aes-128-gcm":{"cipher":"AES","key":128,"iv":12,"mode":"GCM","type":"auth"},"aes-192-gcm":{"cipher":"AES","key":192,"iv":12,"mode":"GCM","type":"auth"},"aes-256-gcm":{"cipher":"AES","key":256,"iv":12,"mode":"GCM","type":"auth"}}')},26:function(e){"use strict";e.exports=JSON.parse('{"sha224WithRSAEncryption":{"sign":"rsa","hash":"sha224","id":"302d300d06096086480165030402040500041c"},"RSA-SHA224":{"sign":"ecdsa/rsa","hash":"sha224","id":"302d300d06096086480165030402040500041c"},"sha256WithRSAEncryption":{"sign":"rsa","hash":"sha256","id":"3031300d060960864801650304020105000420"},"RSA-SHA256":{"sign":"ecdsa/rsa","hash":"sha256","id":"3031300d060960864801650304020105000420"},"sha384WithRSAEncryption":{"sign":"rsa","hash":"sha384","id":"3041300d060960864801650304020205000430"},"RSA-SHA384":{"sign":"ecdsa/rsa","hash":"sha384","id":"3041300d060960864801650304020205000430"},"sha512WithRSAEncryption":{"sign":"rsa","hash":"sha512","id":"3051300d060960864801650304020305000440"},"RSA-SHA512":{"sign":"ecdsa/rsa","hash":"sha512","id":"3051300d060960864801650304020305000440"},"RSA-SHA1":{"sign":"rsa","hash":"sha1","id":"3021300906052b0e03021a05000414"},"ecdsa-with-SHA1":{"sign":"ecdsa","hash":"sha1","id":""},"sha256":{"sign":"ecdsa","hash":"sha256","id":""},"sha224":{"sign":"ecdsa","hash":"sha224","id":""},"sha384":{"sign":"ecdsa","hash":"sha384","id":""},"sha512":{"sign":"ecdsa","hash":"sha512","id":""},"DSA-SHA":{"sign":"dsa","hash":"sha1","id":""},"DSA-SHA1":{"sign":"dsa","hash":"sha1","id":""},"DSA":{"sign":"dsa","hash":"sha1","id":""},"DSA-WITH-SHA224":{"sign":"dsa","hash":"sha224","id":""},"DSA-SHA224":{"sign":"dsa","hash":"sha224","id":""},"DSA-WITH-SHA256":{"sign":"dsa","hash":"sha256","id":""},"DSA-SHA256":{"sign":"dsa","hash":"sha256","id":""},"DSA-WITH-SHA384":{"sign":"dsa","hash":"sha384","id":""},"DSA-SHA384":{"sign":"dsa","hash":"sha384","id":""},"DSA-WITH-SHA512":{"sign":"dsa","hash":"sha512","id":""},"DSA-SHA512":{"sign":"dsa","hash":"sha512","id":""},"DSA-RIPEMD160":{"sign":"dsa","hash":"rmd160","id":""},"ripemd160WithRSA":{"sign":"rsa","hash":"rmd160","id":"3021300906052b2403020105000414"},"RSA-RIPEMD160":{"sign":"rsa","hash":"rmd160","id":"3021300906052b2403020105000414"},"md5WithRSAEncryption":{"sign":"rsa","hash":"md5","id":"3020300c06082a864886f70d020505000410"},"RSA-MD5":{"sign":"rsa","hash":"md5","id":"3020300c06082a864886f70d020505000410"}}')},9167:function(e){"use strict";e.exports=JSON.parse('{"1.3.132.0.10":"secp256k1","1.3.132.0.33":"p224","1.2.840.10045.3.1.1":"p192","1.2.840.10045.3.1.7":"p256","1.3.132.0.34":"p384","1.3.132.0.35":"p521"}')},3418:function(e){"use strict";e.exports=JSON.parse('{"modp1":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a63a3620ffffffffffffffff"},"modp2":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece65381ffffffffffffffff"},"modp5":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca237327ffffffffffffffff"},"modp14":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aacaa68ffffffffffffffff"},"modp15":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a93ad2caffffffffffffffff"},"modp16":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c934063199ffffffffffffffff"},"modp17":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dcc4024ffffffffffffffff"},"modp18":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dbe115974a3926f12fee5e438777cb6a932df8cd8bec4d073b931ba3bc832b68d9dd300741fa7bf8afc47ed2576f6936ba424663aab639c5ae4f5683423b4742bf1c978238f16cbe39d652de3fdb8befc848ad922222e04a4037c0713eb57a81a23f0c73473fc646cea306b4bcbc8862f8385ddfa9d4b7fa2c087e879683303ed5bdd3a062b3cf5b3a278a66d2a13f83f44f82ddf310ee074ab6a364597e899a0255dc164f31cc50846851df9ab48195ded7ea1b1d510bd7ee74d73faf36bc31ecfa268359046f4eb879f924009438b481c6cd7889a002ed5ee382bc9190da6fc026e479558e4475677e9aa9e3050e2765694dfc81f56e880b96e7160c980dd98edd3dfffffffffffffffff"}}')},763:function(e){"use strict";e.exports={i8:"6.5.3"}},8675:function(e){"use strict";e.exports=JSON.parse('{"2.16.840.1.101.3.4.1.1":"aes-128-ecb","2.16.840.1.101.3.4.1.2":"aes-128-cbc","2.16.840.1.101.3.4.1.3":"aes-128-ofb","2.16.840.1.101.3.4.1.4":"aes-128-cfb","2.16.840.1.101.3.4.1.21":"aes-192-ecb","2.16.840.1.101.3.4.1.22":"aes-192-cbc","2.16.840.1.101.3.4.1.23":"aes-192-ofb","2.16.840.1.101.3.4.1.24":"aes-192-cfb","2.16.840.1.101.3.4.1.41":"aes-256-ecb","2.16.840.1.101.3.4.1.42":"aes-256-cbc","2.16.840.1.101.3.4.1.43":"aes-256-ofb","2.16.840.1.101.3.4.1.44":"aes-256-cfb"}')}};var t={};function __nccwpck_require__(r){var i=t[r];if(i!==undefined){return i.exports}var n=t[r]={id:r,loaded:false,exports:{}};var a=true;try{e[r].call(n.exports,n,n.exports,__nccwpck_require__);a=false}finally{if(a)delete t[r]}n.loaded=true;return n.exports}!function(){__nccwpck_require__.nmd=function(e){e.paths=[];if(!e.children)e.children=[];return e}}();if(typeof __nccwpck_require__!=="undefined")__nccwpck_require__.ab=__dirname+"/";var r={};!function(){"use strict";var e=r;e.randomBytes=e.rng=e.pseudoRandomBytes=e.prng=__nccwpck_require__(2711);e.createHash=e.Hash=__nccwpck_require__(2539);e.createHmac=e.Hmac=__nccwpck_require__(2730);var t=__nccwpck_require__(5703);var i=Object.keys(t);var n=["sha1","sha224","sha256","sha384","sha512","md5","rmd160"].concat(i);e.getHashes=function(){return n};var a=__nccwpck_require__(785);e.pbkdf2=a.pbkdf2;e.pbkdf2Sync=a.pbkdf2Sync;var s=__nccwpck_require__(57);e.Cipher=s.Cipher;e.createCipher=s.createCipher;e.Cipheriv=s.Cipheriv;e.createCipheriv=s.createCipheriv;e.Decipher=s.Decipher;e.createDecipher=s.createDecipher;e.Decipheriv=s.Decipheriv;e.createDecipheriv=s.createDecipheriv;e.getCiphers=s.getCiphers;e.listCiphers=s.listCiphers;var o=__nccwpck_require__(9977);e.DiffieHellmanGroup=o.DiffieHellmanGroup;e.createDiffieHellmanGroup=o.createDiffieHellmanGroup;e.getDiffieHellman=o.getDiffieHellman;e.createDiffieHellman=o.createDiffieHellman;e.DiffieHellman=o.DiffieHellman;var u=__nccwpck_require__(1265);e.createSign=u.createSign;e.Sign=u.Sign;e.createVerify=u.createVerify;e.Verify=u.Verify;e.createECDH=__nccwpck_require__(7354);var h=__nccwpck_require__(3501);e.publicEncrypt=h.publicEncrypt;e.privateEncrypt=h.privateEncrypt;e.publicDecrypt=h.publicDecrypt;e.privateDecrypt=h.privateDecrypt;var d=__nccwpck_require__(9534);e.randomFill=d.randomFill;e.randomFillSync=d.randomFillSync;e.createCredentials=function(){throw new Error(["sorry, createCredentials is not implemented yet","we accept pull requests","https://github.com/crypto-browserify/crypto-browserify"].join("\n"))};e.constants={DH_CHECK_P_NOT_SAFE_PRIME:2,DH_CHECK_P_NOT_PRIME:1,DH_UNABLE_TO_CHECK_GENERATOR:4,DH_NOT_SUITABLE_GENERATOR:8,NPN_ENABLED:1,ALPN_ENABLED:1,RSA_PKCS1_PADDING:1,RSA_SSLV23_PADDING:2,RSA_NO_PADDING:3,RSA_PKCS1_OAEP_PADDING:4,RSA_X931_PADDING:5,RSA_PKCS1_PSS_PADDING:6,POINT_CONVERSION_COMPRESSED:2,POINT_CONVERSION_UNCOMPRESSED:4,POINT_CONVERSION_HYBRID:6}}();module.exports=r})(); \ No newline at end of file +(function(){var e={8557:function(e,t,r){var i=t;i.bignum=r(6884);i.define=r(9636).define;i.base=r(2207);i.constants=r(3503);i.decoders=r(5133);i.encoders=r(9245)},9636:function(e,t,r){var i=r(8557);var n=r(7526);var a=t;a.define=function define(e,t){return new Entity(e,t)};function Entity(e,t){this.name=e;this.body=t;this.decoders={};this.encoders={}}Entity.prototype._createNamed=function createNamed(e){var t;try{t=r(6144).runInThisContext("(function "+this.name+"(entity) {\n"+" this._initNamed(entity);\n"+"})")}catch(e){t=function(e){this._initNamed(e)}}n(t,e);t.prototype._initNamed=function initnamed(t){e.call(this,t)};return new t(this)};Entity.prototype._getDecoder=function _getDecoder(e){e=e||"der";if(!this.decoders.hasOwnProperty(e))this.decoders[e]=this._createNamed(i.decoders[e]);return this.decoders[e]};Entity.prototype.decode=function decode(e,t,r){return this._getDecoder(t).decode(e,r)};Entity.prototype._getEncoder=function _getEncoder(e){e=e||"der";if(!this.encoders.hasOwnProperty(e))this.encoders[e]=this._createNamed(i.encoders[e]);return this.encoders[e]};Entity.prototype.encode=function encode(e,t,r){return this._getEncoder(t).encode(e,r)}},8483:function(e,t,r){var i=r(7526);var n=r(2207).Reporter;var a=r(4300).Buffer;function DecoderBuffer(e,t){n.call(this,t);if(!a.isBuffer(e)){this.error("Input not Buffer");return}this.base=e;this.offset=0;this.length=e.length}i(DecoderBuffer,n);t.C=DecoderBuffer;DecoderBuffer.prototype.save=function save(){return{offset:this.offset,reporter:n.prototype.save.call(this)}};DecoderBuffer.prototype.restore=function restore(e){var t=new DecoderBuffer(this.base);t.offset=e.offset;t.length=this.offset;this.offset=e.offset;n.prototype.restore.call(this,e.reporter);return t};DecoderBuffer.prototype.isEmpty=function isEmpty(){return this.offset===this.length};DecoderBuffer.prototype.readUInt8=function readUInt8(e){if(this.offset+1<=this.length)return this.base.readUInt8(this.offset++,true);else return this.error(e||"DecoderBuffer overrun")};DecoderBuffer.prototype.skip=function skip(e,t){if(!(this.offset+e<=this.length))return this.error(t||"DecoderBuffer overrun");var r=new DecoderBuffer(this.base);r._reporterState=this._reporterState;r.offset=this.offset;r.length=this.offset+e;this.offset+=e;return r};DecoderBuffer.prototype.raw=function raw(e){return this.base.slice(e?e.offset:this.offset,this.length)};function EncoderBuffer(e,t){if(Array.isArray(e)){this.length=0;this.value=e.map((function(e){if(!(e instanceof EncoderBuffer))e=new EncoderBuffer(e,t);this.length+=e.length;return e}),this)}else if(typeof e==="number"){if(!(0<=e&&e<=255))return t.error("non-byte EncoderBuffer value");this.value=e;this.length=1}else if(typeof e==="string"){this.value=e;this.length=a.byteLength(e)}else if(a.isBuffer(e)){this.value=e;this.length=e.length}else{return t.error("Unsupported type: "+typeof e)}}t.R=EncoderBuffer;EncoderBuffer.prototype.join=function join(e,t){if(!e)e=new a(this.length);if(!t)t=0;if(this.length===0)return e;if(Array.isArray(this.value)){this.value.forEach((function(r){r.join(e,t);t+=r.length}))}else{if(typeof this.value==="number")e[t]=this.value;else if(typeof this.value==="string")e.write(this.value,t);else if(a.isBuffer(this.value))this.value.copy(e,t);t+=this.length}return e}},2207:function(e,t,r){var i=t;i.Reporter=r(2148).b;i.DecoderBuffer=r(8483).C;i.EncoderBuffer=r(8483).R;i.Node=r(211)},211:function(e,t,r){var i=r(2207).Reporter;var n=r(2207).EncoderBuffer;var a=r(2207).DecoderBuffer;var s=r(9036);var o=["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"];var u=["key","obj","use","optional","explicit","implicit","def","choice","any","contains"].concat(o);var h=["_peekTag","_decodeTag","_use","_decodeStr","_decodeObjid","_decodeTime","_decodeNull","_decodeInt","_decodeBool","_decodeList","_encodeComposite","_encodeStr","_encodeObjid","_encodeTime","_encodeNull","_encodeInt","_encodeBool"];function Node(e,t){var r={};this._baseState=r;r.enc=e;r.parent=t||null;r.children=null;r.tag=null;r.args=null;r.reverseArgs=null;r.choice=null;r.optional=false;r.any=false;r.obj=false;r.use=null;r.useDecoder=null;r.key=null;r["default"]=null;r.explicit=null;r.implicit=null;r.contains=null;if(!r.parent){r.children=[];this._wrap()}}e.exports=Node;var d=["enc","parent","children","tag","args","reverseArgs","choice","optional","any","obj","use","alteredUse","key","default","explicit","implicit","contains"];Node.prototype.clone=function clone(){var e=this._baseState;var t={};d.forEach((function(r){t[r]=e[r]}));var r=new this.constructor(t.parent);r._baseState=t;return r};Node.prototype._wrap=function wrap(){var e=this._baseState;u.forEach((function(t){this[t]=function _wrappedMethod(){var r=new this.constructor(this);e.children.push(r);return r[t].apply(r,arguments)}}),this)};Node.prototype._init=function init(e){var t=this._baseState;s(t.parent===null);e.call(this);t.children=t.children.filter((function(e){return e._baseState.parent===this}),this);s.equal(t.children.length,1,"Root node can have only one child")};Node.prototype._useArgs=function useArgs(e){var t=this._baseState;var r=e.filter((function(e){return e instanceof this.constructor}),this);e=e.filter((function(e){return!(e instanceof this.constructor)}),this);if(r.length!==0){s(t.children===null);t.children=r;r.forEach((function(e){e._baseState.parent=this}),this)}if(e.length!==0){s(t.args===null);t.args=e;t.reverseArgs=e.map((function(e){if(typeof e!=="object"||e.constructor!==Object)return e;var t={};Object.keys(e).forEach((function(r){if(r==(r|0))r|=0;var i=e[r];t[i]=r}));return t}))}};h.forEach((function(e){Node.prototype[e]=function _overrided(){var t=this._baseState;throw new Error(e+" not implemented for encoding: "+t.enc)}}));o.forEach((function(e){Node.prototype[e]=function _tagMethod(){var t=this._baseState;var r=Array.prototype.slice.call(arguments);s(t.tag===null);t.tag=e;this._useArgs(r);return this}}));Node.prototype.use=function use(e){s(e);var t=this._baseState;s(t.use===null);t.use=e;return this};Node.prototype.optional=function optional(){var e=this._baseState;e.optional=true;return this};Node.prototype.def=function def(e){var t=this._baseState;s(t["default"]===null);t["default"]=e;t.optional=true;return this};Node.prototype.explicit=function explicit(e){var t=this._baseState;s(t.explicit===null&&t.implicit===null);t.explicit=e;return this};Node.prototype.implicit=function implicit(e){var t=this._baseState;s(t.explicit===null&&t.implicit===null);t.implicit=e;return this};Node.prototype.obj=function obj(){var e=this._baseState;var t=Array.prototype.slice.call(arguments);e.obj=true;if(t.length!==0)this._useArgs(t);return this};Node.prototype.key=function key(e){var t=this._baseState;s(t.key===null);t.key=e;return this};Node.prototype.any=function any(){var e=this._baseState;e.any=true;return this};Node.prototype.choice=function choice(e){var t=this._baseState;s(t.choice===null);t.choice=e;this._useArgs(Object.keys(e).map((function(t){return e[t]})));return this};Node.prototype.contains=function contains(e){var t=this._baseState;s(t.use===null);t.contains=e;return this};Node.prototype._decode=function decode(e,t){var r=this._baseState;if(r.parent===null)return e.wrapResult(r.children[0]._decode(e,t));var i=r["default"];var n=true;var s=null;if(r.key!==null)s=e.enterKey(r.key);if(r.optional){var o=null;if(r.explicit!==null)o=r.explicit;else if(r.implicit!==null)o=r.implicit;else if(r.tag!==null)o=r.tag;if(o===null&&!r.any){var u=e.save();try{if(r.choice===null)this._decodeGeneric(r.tag,e,t);else this._decodeChoice(e,t);n=true}catch(e){n=false}e.restore(u)}else{n=this._peekTag(e,o,r.any);if(e.isError(n))return n}}var h;if(r.obj&&n)h=e.enterObject();if(n){if(r.explicit!==null){var d=this._decodeTag(e,r.explicit);if(e.isError(d))return d;e=d}var c=e.offset;if(r.use===null&&r.choice===null){if(r.any)var u=e.save();var l=this._decodeTag(e,r.implicit!==null?r.implicit:r.tag,r.any);if(e.isError(l))return l;if(r.any)i=e.raw(u);else e=l}if(t&&t.track&&r.tag!==null)t.track(e.path(),c,e.length,"tagged");if(t&&t.track&&r.tag!==null)t.track(e.path(),e.offset,e.length,"content");if(r.any)i=i;else if(r.choice===null)i=this._decodeGeneric(r.tag,e,t);else i=this._decodeChoice(e,t);if(e.isError(i))return i;if(!r.any&&r.choice===null&&r.children!==null){r.children.forEach((function decodeChildren(r){r._decode(e,t)}))}if(r.contains&&(r.tag==="octstr"||r.tag==="bitstr")){var p=new a(i);i=this._getUse(r.contains,e._reporterState.obj)._decode(p,t)}}if(r.obj&&n)i=e.leaveObject(h);if(r.key!==null&&(i!==null||n===true))e.leaveKey(s,r.key,i);else if(s!==null)e.exitKey(s);return i};Node.prototype._decodeGeneric=function decodeGeneric(e,t,r){var i=this._baseState;if(e==="seq"||e==="set")return null;if(e==="seqof"||e==="setof")return this._decodeList(t,e,i.args[0],r);else if(/str$/.test(e))return this._decodeStr(t,e,r);else if(e==="objid"&&i.args)return this._decodeObjid(t,i.args[0],i.args[1],r);else if(e==="objid")return this._decodeObjid(t,null,null,r);else if(e==="gentime"||e==="utctime")return this._decodeTime(t,e,r);else if(e==="null_")return this._decodeNull(t,r);else if(e==="bool")return this._decodeBool(t,r);else if(e==="objDesc")return this._decodeStr(t,e,r);else if(e==="int"||e==="enum")return this._decodeInt(t,i.args&&i.args[0],r);if(i.use!==null){return this._getUse(i.use,t._reporterState.obj)._decode(t,r)}else{return t.error("unknown tag: "+e)}};Node.prototype._getUse=function _getUse(e,t){var r=this._baseState;r.useDecoder=this._use(e,t);s(r.useDecoder._baseState.parent===null);r.useDecoder=r.useDecoder._baseState.children[0];if(r.implicit!==r.useDecoder._baseState.implicit){r.useDecoder=r.useDecoder.clone();r.useDecoder._baseState.implicit=r.implicit}return r.useDecoder};Node.prototype._decodeChoice=function decodeChoice(e,t){var r=this._baseState;var i=null;var n=false;Object.keys(r.choice).some((function(a){var s=e.save();var o=r.choice[a];try{var u=o._decode(e,t);if(e.isError(u))return false;i={type:a,value:u};n=true}catch(t){e.restore(s);return false}return true}),this);if(!n)return e.error("Choice not matched");return i};Node.prototype._createEncoderBuffer=function createEncoderBuffer(e){return new n(e,this.reporter)};Node.prototype._encode=function encode(e,t,r){var i=this._baseState;if(i["default"]!==null&&i["default"]===e)return;var n=this._encodeValue(e,t,r);if(n===undefined)return;if(this._skipDefault(n,t,r))return;return n};Node.prototype._encodeValue=function encode(e,t,r){var n=this._baseState;if(n.parent===null)return n.children[0]._encode(e,t||new i);var a=null;this.reporter=t;if(n.optional&&e===undefined){if(n["default"]!==null)e=n["default"];else return}var s=null;var o=false;if(n.any){a=this._createEncoderBuffer(e)}else if(n.choice){a=this._encodeChoice(e,t)}else if(n.contains){s=this._getUse(n.contains,r)._encode(e,t);o=true}else if(n.children){s=n.children.map((function(r){if(r._baseState.tag==="null_")return r._encode(null,t,e);if(r._baseState.key===null)return t.error("Child should have a key");var i=t.enterKey(r._baseState.key);if(typeof e!=="object")return t.error("Child expected, but input is not object");var n=r._encode(e[r._baseState.key],t,e);t.leaveKey(i);return n}),this).filter((function(e){return e}));s=this._createEncoderBuffer(s)}else{if(n.tag==="seqof"||n.tag==="setof"){if(!(n.args&&n.args.length===1))return t.error("Too many args for : "+n.tag);if(!Array.isArray(e))return t.error("seqof/setof, but data is not Array");var u=this.clone();u._baseState.implicit=null;s=this._createEncoderBuffer(e.map((function(r){var i=this._baseState;return this._getUse(i.args[0],e)._encode(r,t)}),u))}else if(n.use!==null){a=this._getUse(n.use,r)._encode(e,t)}else{s=this._encodePrimitive(n.tag,e);o=true}}var a;if(!n.any&&n.choice===null){var h=n.implicit!==null?n.implicit:n.tag;var d=n.implicit===null?"universal":"context";if(h===null){if(n.use===null)t.error("Tag could be omitted only for .use()")}else{if(n.use===null)a=this._encodeComposite(h,o,d,s)}}if(n.explicit!==null)a=this._encodeComposite(n.explicit,false,"context",a);return a};Node.prototype._encodeChoice=function encodeChoice(e,t){var r=this._baseState;var i=r.choice[e.type];if(!i){s(false,e.type+" not found in "+JSON.stringify(Object.keys(r.choice)))}return i._encode(e.value,t)};Node.prototype._encodePrimitive=function encodePrimitive(e,t){var r=this._baseState;if(/str$/.test(e))return this._encodeStr(t,e);else if(e==="objid"&&r.args)return this._encodeObjid(t,r.reverseArgs[0],r.args[1]);else if(e==="objid")return this._encodeObjid(t,null,null);else if(e==="gentime"||e==="utctime")return this._encodeTime(t,e);else if(e==="null_")return this._encodeNull();else if(e==="int"||e==="enum")return this._encodeInt(t,r.args&&r.reverseArgs[0]);else if(e==="bool")return this._encodeBool(t);else if(e==="objDesc")return this._encodeStr(t,e);else throw new Error("Unsupported tag: "+e)};Node.prototype._isNumstr=function isNumstr(e){return/^[0-9 ]*$/.test(e)};Node.prototype._isPrintstr=function isPrintstr(e){return/^[A-Za-z0-9 '\(\)\+,\-\.\/:=\?]*$/.test(e)}},2148:function(e,t,r){var i=r(7526);function Reporter(e){this._reporterState={obj:null,path:[],options:e||{},errors:[]}}t.b=Reporter;Reporter.prototype.isError=function isError(e){return e instanceof ReporterError};Reporter.prototype.save=function save(){var e=this._reporterState;return{obj:e.obj,pathLen:e.path.length}};Reporter.prototype.restore=function restore(e){var t=this._reporterState;t.obj=e.obj;t.path=t.path.slice(0,e.pathLen)};Reporter.prototype.enterKey=function enterKey(e){return this._reporterState.path.push(e)};Reporter.prototype.exitKey=function exitKey(e){var t=this._reporterState;t.path=t.path.slice(0,e-1)};Reporter.prototype.leaveKey=function leaveKey(e,t,r){var i=this._reporterState;this.exitKey(e);if(i.obj!==null)i.obj[t]=r};Reporter.prototype.path=function path(){return this._reporterState.path.join("/")};Reporter.prototype.enterObject=function enterObject(){var e=this._reporterState;var t=e.obj;e.obj={};return t};Reporter.prototype.leaveObject=function leaveObject(e){var t=this._reporterState;var r=t.obj;t.obj=e;return r};Reporter.prototype.error=function error(e){var t;var r=this._reporterState;var i=e instanceof ReporterError;if(i){t=e}else{t=new ReporterError(r.path.map((function(e){return"["+JSON.stringify(e)+"]"})).join(""),e.message||e,e.stack)}if(!r.options.partial)throw t;if(!i)r.errors.push(t);return t};Reporter.prototype.wrapResult=function wrapResult(e){var t=this._reporterState;if(!t.options.partial)return e;return{result:this.isError(e)?null:e,errors:t.errors}};function ReporterError(e,t){this.path=e;this.rethrow(t)}i(ReporterError,Error);ReporterError.prototype.rethrow=function rethrow(e){this.message=e+" at: "+(this.path||"(shallow)");if(Error.captureStackTrace)Error.captureStackTrace(this,ReporterError);if(!this.stack){try{throw new Error(this.message)}catch(e){this.stack=e.stack}}return this}},8880:function(e,t,r){var i=r(3503);t.tagClass={0:"universal",1:"application",2:"context",3:"private"};t.tagClassByName=i._reverse(t.tagClass);t.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"};t.tagByName=i._reverse(t.tag)},3503:function(e,t,r){var i=t;i._reverse=function reverse(e){var t={};Object.keys(e).forEach((function(r){if((r|0)==r)r=r|0;var i=e[r];t[i]=r}));return t};i.der=r(8880)},359:function(e,t,r){var i=r(7526);var n=r(8557);var a=n.base;var s=n.bignum;var o=n.constants.der;function DERDecoder(e){this.enc="der";this.name=e.name;this.entity=e;this.tree=new DERNode;this.tree._init(e.body)}e.exports=DERDecoder;DERDecoder.prototype.decode=function decode(e,t){if(!(e instanceof a.DecoderBuffer))e=new a.DecoderBuffer(e,t);return this.tree._decode(e,t)};function DERNode(e){a.Node.call(this,"der",e)}i(DERNode,a.Node);DERNode.prototype._peekTag=function peekTag(e,t,r){if(e.isEmpty())return false;var i=e.save();var n=derDecodeTag(e,'Failed to peek tag: "'+t+'"');if(e.isError(n))return n;e.restore(i);return n.tag===t||n.tagStr===t||n.tagStr+"of"===t||r};DERNode.prototype._decodeTag=function decodeTag(e,t,r){var i=derDecodeTag(e,'Failed to decode tag of "'+t+'"');if(e.isError(i))return i;var n=derDecodeLen(e,i.primitive,'Failed to get length of "'+t+'"');if(e.isError(n))return n;if(!r&&i.tag!==t&&i.tagStr!==t&&i.tagStr+"of"!==t){return e.error('Failed to match tag: "'+t+'"')}if(i.primitive||n!==null)return e.skip(n,'Failed to match body of: "'+t+'"');var a=e.save();var s=this._skipUntilEnd(e,'Failed to skip indefinite length body: "'+this.tag+'"');if(e.isError(s))return s;n=e.offset-a.offset;e.restore(a);return e.skip(n,'Failed to match body of: "'+t+'"')};DERNode.prototype._skipUntilEnd=function skipUntilEnd(e,t){while(true){var r=derDecodeTag(e,t);if(e.isError(r))return r;var i=derDecodeLen(e,r.primitive,t);if(e.isError(i))return i;var n;if(r.primitive||i!==null)n=e.skip(i);else n=this._skipUntilEnd(e,t);if(e.isError(n))return n;if(r.tagStr==="end")break}};DERNode.prototype._decodeList=function decodeList(e,t,r,i){var n=[];while(!e.isEmpty()){var a=this._peekTag(e,"end");if(e.isError(a))return a;var s=r.decode(e,"der",i);if(e.isError(s)&&a)break;n.push(s)}return n};DERNode.prototype._decodeStr=function decodeStr(e,t){if(t==="bitstr"){var r=e.readUInt8();if(e.isError(r))return r;return{unused:r,data:e.raw()}}else if(t==="bmpstr"){var i=e.raw();if(i.length%2===1)return e.error("Decoding of string type: bmpstr length mismatch");var n="";for(var a=0;a>6];var n=(r&32)===0;if((r&31)===31){var a=r;r=0;while((a&128)===128){a=e.readUInt8(t);if(e.isError(a))return a;r<<=7;r|=a&127}}else{r&=31}var s=o.tag[r];return{cls:i,primitive:n,tag:r,tagStr:s}}function derDecodeLen(e,t,r){var i=e.readUInt8(r);if(e.isError(i))return i;if(!t&&i===128)return null;if((i&128)===0){return i}var n=i&127;if(n>4)return e.error("length octect is too long");i=0;for(var a=0;a=256;u>>=8)o++;var s=new n(1+1+o);s[0]=a;s[1]=128|o;for(var u=1+o,h=i.length;h>0;u--,h>>=8)s[u]=h&255;return this._createEncoderBuffer([s,i])};DERNode.prototype._encodeStr=function encodeStr(e,t){if(t==="bitstr"){return this._createEncoderBuffer([e.unused|0,e.data])}else if(t==="bmpstr"){var r=new n(e.length*2);for(var i=0;i=40)return this.reporter.error("Second objid identifier OOB");e.splice(0,2,e[0]*40+e[1])}var a=0;for(var i=0;i=128;s>>=7)a++}var o=new n(a);var u=o.length-1;for(var i=e.length-1;i>=0;i--){var s=e[i];o[u--]=s&127;while((s>>=7)>0)o[u--]=128|s&127}return this._createEncoderBuffer(o)};function two(e){if(e<10)return"0"+e;else return e}DERNode.prototype._encodeTime=function encodeTime(e,t){var r;var i=new Date(e);if(t==="gentime"){r=[two(i.getFullYear()),two(i.getUTCMonth()+1),two(i.getUTCDate()),two(i.getUTCHours()),two(i.getUTCMinutes()),two(i.getUTCSeconds()),"Z"].join("")}else if(t==="utctime"){r=[two(i.getFullYear()%100),two(i.getUTCMonth()+1),two(i.getUTCDate()),two(i.getUTCHours()),two(i.getUTCMinutes()),two(i.getUTCSeconds()),"Z"].join("")}else{this.reporter.error("Encoding "+t+" time is not supported yet")}return this._encodeStr(r,"octstr")};DERNode.prototype._encodeNull=function encodeNull(){return this._createEncoderBuffer("")};DERNode.prototype._encodeInt=function encodeInt(e,t){if(typeof e==="string"){if(!t)return this.reporter.error("String int or enum given, but no values map");if(!t.hasOwnProperty(e)){return this.reporter.error("Values map doesn't contain: "+JSON.stringify(e))}e=t[e]}if(typeof e!=="number"&&!n.isBuffer(e)){var r=e.toArray();if(!e.sign&&r[0]&128){r.unshift(0)}e=new n(r)}if(n.isBuffer(e)){var i=e.length;if(e.length===0)i++;var a=new n(i);e.copy(a);if(e.length===0)a[0]=0;return this._createEncoderBuffer(a)}if(e<128)return this._createEncoderBuffer(e);if(e<256)return this._createEncoderBuffer([0,e]);var i=1;for(var s=e;s>=256;s>>=8)i++;var a=new Array(i);for(var s=a.length-1;s>=0;s--){a[s]=e&255;e>>=8}if(a[0]&128){a.unshift(0)}return this._createEncoderBuffer(new n(a))};DERNode.prototype._encodeBool=function encodeBool(e){return this._createEncoderBuffer(e?255:0)};DERNode.prototype._use=function use(e,t){if(typeof e==="function")e=e(t);return e._getEncoder("der").tree};DERNode.prototype._skipDefault=function skipDefault(e,t,r){var i=this._baseState;var n;if(i["default"]===null)return false;var a=e.join();if(i.defaultBuffer===undefined)i.defaultBuffer=this._encodeValue(i["default"],t,r).join();if(a.length!==i.defaultBuffer.length)return false;for(n=0;n=31)return i.error("Multi-octet tag encoding unsupported");if(!t)n|=32;n|=o.tagClassByName[r||"universal"]<<6;return n}},9245:function(e,t,r){var i=t;i.der=r(6125);i.pem=r(4599)},4599:function(e,t,r){var i=r(7526);var n=r(6125);function PEMEncoder(e){n.call(this,e);this.enc="pem"}i(PEMEncoder,n);e.exports=PEMEncoder;PEMEncoder.prototype.encode=function encode(e,t){var r=n.prototype.encode.call(this,e);var i=r.toString("base64");var a=["-----BEGIN "+t.label+"-----"];for(var s=0;s0)return e;return t};BN.min=function min(e,t){if(e.cmp(t)<0)return e;return t};BN.prototype._init=function init(e,t,r){if(typeof e==="number"){return this._initNumber(e,t,r)}if(typeof e==="object"){return this._initArray(e,t,r)}if(t==="hex"){t=16}assert(t===(t|0)&&t>=2&&t<=36);e=e.toString().replace(/\s+/g,"");var i=0;if(e[0]==="-"){i++}if(t===16){this._parseHex(e,i)}else{this._parseBase(e,t,i)}if(e[0]==="-"){this.negative=1}this.strip();if(r!=="le")return;this._initArray(this.toArray(),t,r)};BN.prototype._initNumber=function _initNumber(e,t,r){if(e<0){this.negative=1;e=-e}if(e<67108864){this.words=[e&67108863];this.length=1}else if(e<4503599627370496){this.words=[e&67108863,e/67108864&67108863];this.length=2}else{assert(e<9007199254740992);this.words=[e&67108863,e/67108864&67108863,1];this.length=3}if(r!=="le")return;this._initArray(this.toArray(),t,r)};BN.prototype._initArray=function _initArray(e,t,r){assert(typeof e.length==="number");if(e.length<=0){this.words=[0];this.length=1;return this}this.length=Math.ceil(e.length/3);this.words=new Array(this.length);for(var i=0;i=0;i-=3){a=e[i]|e[i-1]<<8|e[i-2]<<16;this.words[n]|=a<>>26-s&67108863;s+=24;if(s>=26){s-=26;n++}}}else if(r==="le"){for(i=0,n=0;i>>26-s&67108863;s+=24;if(s>=26){s-=26;n++}}}return this.strip()};function parseHex(e,t,r){var i=0;var n=Math.min(e.length,r);for(var a=t;a=49&&s<=54){i|=s-49+10}else if(s>=17&&s<=22){i|=s-17+10}else{i|=s&15}}return i}BN.prototype._parseHex=function _parseHex(e,t){this.length=Math.ceil((e.length-t)/6);this.words=new Array(this.length);for(var r=0;r=t;r-=6){n=parseHex(e,r,r+6);this.words[i]|=n<>>26-a&4194303;a+=24;if(a>=26){a-=26;i++}}if(r+6!==t){n=parseHex(e,t,r+6);this.words[i]|=n<>>26-a&4194303}this.strip()};function parseBase(e,t,r,i){var n=0;var a=Math.min(e.length,r);for(var s=t;s=49){n+=o-49+10}else if(o>=17){n+=o-17+10}else{n+=o}}return n}BN.prototype._parseBase=function _parseBase(e,t,r){this.words=[0];this.length=1;for(var i=0,n=1;n<=67108863;n*=t){i++}i--;n=n/t|0;var a=e.length-r;var s=a%i;var o=Math.min(a,a-s)+r;var u=0;for(var h=r;h1&&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 n=["","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 a=[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 s=[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(e,t){e=e||10;t=t|0||1;var r;if(e===16||e==="hex"){r="";var i=0;var o=0;for(var u=0;u>>24-i&16777215;if(o!==0||u!==this.length-1){r=n[6-d.length]+d+r}else{r=d+r}i+=2;if(i>=26){i-=26;u--}}if(o!==0){r=o.toString(16)+r}while(r.length%t!==0){r="0"+r}if(this.negative!==0){r="-"+r}return r}if(e===(e|0)&&e>=2&&e<=36){var c=a[e];var l=s[e];r="";var p=this.clone();p.negative=0;while(!p.isZero()){var b=p.modn(l).toString(e);p=p.idivn(l);if(!p.isZero()){r=n[c-b.length]+b+r}else{r=b+r}}if(this.isZero()){r="0"+r}while(r.length%t!==0){r="0"+r}if(this.negative!==0){r="-"+r}return r}assert(false,"Base should be between 2 and 36")};BN.prototype.toNumber=function toNumber(){var e=this.words[0];if(this.length===2){e+=this.words[1]*67108864}else if(this.length===3&&this.words[2]===1){e+=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?-e:e};BN.prototype.toJSON=function toJSON(){return this.toString(16)};BN.prototype.toBuffer=function toBuffer(e,t){assert(typeof i!=="undefined");return this.toArrayLike(i,e,t)};BN.prototype.toArray=function toArray(e,t){return this.toArrayLike(Array,e,t)};BN.prototype.toArrayLike=function toArrayLike(e,t,r){var i=this.byteLength();var n=r||Math.max(1,i);assert(i<=n,"byte array longer than desired length");assert(n>0,"Requested array length <= 0");this.strip();var a=t==="le";var s=new e(n);var o,u;var h=this.clone();if(!a){for(u=0;u=4096){r+=13;t>>>=13}if(t>=64){r+=7;t>>>=7}if(t>=8){r+=4;t>>>=4}if(t>=2){r+=2;t>>>=2}return r+t}}BN.prototype._zeroBits=function _zeroBits(e){if(e===0)return 26;var t=e;var r=0;if((t&8191)===0){r+=13;t>>>=13}if((t&127)===0){r+=7;t>>>=7}if((t&15)===0){r+=4;t>>>=4}if((t&3)===0){r+=2;t>>>=2}if((t&1)===0){r++}return r};BN.prototype.bitLength=function bitLength(){var e=this.words[this.length-1];var t=this._countBits(e);return(this.length-1)*26+t};function toBitArray(e){var t=new Array(e.bitLength());for(var r=0;r>>n}return t}BN.prototype.zeroBits=function zeroBits(){if(this.isZero())return 0;var e=0;for(var t=0;te.length)return this.clone().ior(e);return e.clone().ior(this)};BN.prototype.uor=function uor(e){if(this.length>e.length)return this.clone().iuor(e);return e.clone().iuor(this)};BN.prototype.iuand=function iuand(e){var t;if(this.length>e.length){t=e}else{t=this}for(var r=0;re.length)return this.clone().iand(e);return e.clone().iand(this)};BN.prototype.uand=function uand(e){if(this.length>e.length)return this.clone().iuand(e);return e.clone().iuand(this)};BN.prototype.iuxor=function iuxor(e){var t;var r;if(this.length>e.length){t=this;r=e}else{t=e;r=this}for(var i=0;ie.length)return this.clone().ixor(e);return e.clone().ixor(this)};BN.prototype.uxor=function uxor(e){if(this.length>e.length)return this.clone().iuxor(e);return e.clone().iuxor(this)};BN.prototype.inotn=function inotn(e){assert(typeof e==="number"&&e>=0);var t=Math.ceil(e/26)|0;var r=e%26;this._expand(t);if(r>0){t--}for(var i=0;i0){this.words[i]=~this.words[i]&67108863>>26-r}return this.strip()};BN.prototype.notn=function notn(e){return this.clone().inotn(e)};BN.prototype.setn=function setn(e,t){assert(typeof e==="number"&&e>=0);var r=e/26|0;var i=e%26;this._expand(r+1);if(t){this.words[r]=this.words[r]|1<e.length){r=this;i=e}else{r=e;i=this}var n=0;for(var a=0;a>>26}for(;n!==0&&a>>26}this.length=r.length;if(n!==0){this.words[this.length]=n;this.length++}else if(r!==this){for(;ae.length)return this.clone().iadd(e);return e.clone().iadd(this)};BN.prototype.isub=function isub(e){if(e.negative!==0){e.negative=0;var t=this.iadd(e);e.negative=1;return t._normSign()}else if(this.negative!==0){this.negative=0;this.iadd(e);this.negative=1;return this._normSign()}var r=this.cmp(e);if(r===0){this.negative=0;this.length=1;this.words[0]=0;return this}var i,n;if(r>0){i=this;n=e}else{i=e;n=this}var a=0;for(var s=0;s>26;this.words[s]=t&67108863}for(;a!==0&&s>26;this.words[s]=t&67108863}if(a===0&&s>>26;var c=u&67108863;var l=Math.min(h,t.length-1);for(var p=Math.max(0,h-e.length+1);p<=l;p++){var b=h-p|0;n=e.words[b]|0;a=t.words[p]|0;s=n*a+c;d+=s/67108864|0;c=s&67108863}r.words[h]=c|0;u=d|0}if(u!==0){r.words[h]=u|0}else{r.length--}return r.strip()}var o=function comb10MulTo(e,t,r){var i=e.words;var n=t.words;var a=r.words;var s=0;var o;var u;var h;var d=i[0]|0;var c=d&8191;var l=d>>>13;var p=i[1]|0;var b=p&8191;var v=p>>>13;var m=i[2]|0;var y=m&8191;var g=m>>>13;var _=i[3]|0;var w=_&8191;var M=_>>>13;var E=i[4]|0;var B=E&8191;var k=E>>>13;var A=i[5]|0;var N=A&8191;var P=A>>>13;var x=i[6]|0;var C=x&8191;var T=x>>>13;var I=i[7]|0;var D=I&8191;var O=I>>>13;var j=i[8]|0;var L=j&8191;var q=j>>>13;var H=i[9]|0;var F=H&8191;var U=H>>>13;var z=n[0]|0;var W=z&8191;var V=z>>>13;var G=n[1]|0;var J=G&8191;var Z=G>>>13;var X=n[2]|0;var Y=X&8191;var $=X>>>13;var Q=n[3]|0;var ee=Q&8191;var te=Q>>>13;var re=n[4]|0;var ie=re&8191;var ne=re>>>13;var ae=n[5]|0;var se=ae&8191;var fe=ae>>>13;var oe=n[6]|0;var ue=oe&8191;var he=oe>>>13;var de=n[7]|0;var ce=de&8191;var le=de>>>13;var pe=n[8]|0;var be=pe&8191;var ve=pe>>>13;var me=n[9]|0;var ye=me&8191;var ge=me>>>13;r.negative=e.negative^t.negative;r.length=19;o=Math.imul(c,W);u=Math.imul(c,V);u=u+Math.imul(l,W)|0;h=Math.imul(l,V);var _e=(s+o|0)+((u&8191)<<13)|0;s=(h+(u>>>13)|0)+(_e>>>26)|0;_e&=67108863;o=Math.imul(b,W);u=Math.imul(b,V);u=u+Math.imul(v,W)|0;h=Math.imul(v,V);o=o+Math.imul(c,J)|0;u=u+Math.imul(c,Z)|0;u=u+Math.imul(l,J)|0;h=h+Math.imul(l,Z)|0;var we=(s+o|0)+((u&8191)<<13)|0;s=(h+(u>>>13)|0)+(we>>>26)|0;we&=67108863;o=Math.imul(y,W);u=Math.imul(y,V);u=u+Math.imul(g,W)|0;h=Math.imul(g,V);o=o+Math.imul(b,J)|0;u=u+Math.imul(b,Z)|0;u=u+Math.imul(v,J)|0;h=h+Math.imul(v,Z)|0;o=o+Math.imul(c,Y)|0;u=u+Math.imul(c,$)|0;u=u+Math.imul(l,Y)|0;h=h+Math.imul(l,$)|0;var Me=(s+o|0)+((u&8191)<<13)|0;s=(h+(u>>>13)|0)+(Me>>>26)|0;Me&=67108863;o=Math.imul(w,W);u=Math.imul(w,V);u=u+Math.imul(M,W)|0;h=Math.imul(M,V);o=o+Math.imul(y,J)|0;u=u+Math.imul(y,Z)|0;u=u+Math.imul(g,J)|0;h=h+Math.imul(g,Z)|0;o=o+Math.imul(b,Y)|0;u=u+Math.imul(b,$)|0;u=u+Math.imul(v,Y)|0;h=h+Math.imul(v,$)|0;o=o+Math.imul(c,ee)|0;u=u+Math.imul(c,te)|0;u=u+Math.imul(l,ee)|0;h=h+Math.imul(l,te)|0;var Se=(s+o|0)+((u&8191)<<13)|0;s=(h+(u>>>13)|0)+(Se>>>26)|0;Se&=67108863;o=Math.imul(B,W);u=Math.imul(B,V);u=u+Math.imul(k,W)|0;h=Math.imul(k,V);o=o+Math.imul(w,J)|0;u=u+Math.imul(w,Z)|0;u=u+Math.imul(M,J)|0;h=h+Math.imul(M,Z)|0;o=o+Math.imul(y,Y)|0;u=u+Math.imul(y,$)|0;u=u+Math.imul(g,Y)|0;h=h+Math.imul(g,$)|0;o=o+Math.imul(b,ee)|0;u=u+Math.imul(b,te)|0;u=u+Math.imul(v,ee)|0;h=h+Math.imul(v,te)|0;o=o+Math.imul(c,ie)|0;u=u+Math.imul(c,ne)|0;u=u+Math.imul(l,ie)|0;h=h+Math.imul(l,ne)|0;var Ee=(s+o|0)+((u&8191)<<13)|0;s=(h+(u>>>13)|0)+(Ee>>>26)|0;Ee&=67108863;o=Math.imul(N,W);u=Math.imul(N,V);u=u+Math.imul(P,W)|0;h=Math.imul(P,V);o=o+Math.imul(B,J)|0;u=u+Math.imul(B,Z)|0;u=u+Math.imul(k,J)|0;h=h+Math.imul(k,Z)|0;o=o+Math.imul(w,Y)|0;u=u+Math.imul(w,$)|0;u=u+Math.imul(M,Y)|0;h=h+Math.imul(M,$)|0;o=o+Math.imul(y,ee)|0;u=u+Math.imul(y,te)|0;u=u+Math.imul(g,ee)|0;h=h+Math.imul(g,te)|0;o=o+Math.imul(b,ie)|0;u=u+Math.imul(b,ne)|0;u=u+Math.imul(v,ie)|0;h=h+Math.imul(v,ne)|0;o=o+Math.imul(c,se)|0;u=u+Math.imul(c,fe)|0;u=u+Math.imul(l,se)|0;h=h+Math.imul(l,fe)|0;var Be=(s+o|0)+((u&8191)<<13)|0;s=(h+(u>>>13)|0)+(Be>>>26)|0;Be&=67108863;o=Math.imul(C,W);u=Math.imul(C,V);u=u+Math.imul(T,W)|0;h=Math.imul(T,V);o=o+Math.imul(N,J)|0;u=u+Math.imul(N,Z)|0;u=u+Math.imul(P,J)|0;h=h+Math.imul(P,Z)|0;o=o+Math.imul(B,Y)|0;u=u+Math.imul(B,$)|0;u=u+Math.imul(k,Y)|0;h=h+Math.imul(k,$)|0;o=o+Math.imul(w,ee)|0;u=u+Math.imul(w,te)|0;u=u+Math.imul(M,ee)|0;h=h+Math.imul(M,te)|0;o=o+Math.imul(y,ie)|0;u=u+Math.imul(y,ne)|0;u=u+Math.imul(g,ie)|0;h=h+Math.imul(g,ne)|0;o=o+Math.imul(b,se)|0;u=u+Math.imul(b,fe)|0;u=u+Math.imul(v,se)|0;h=h+Math.imul(v,fe)|0;o=o+Math.imul(c,ue)|0;u=u+Math.imul(c,he)|0;u=u+Math.imul(l,ue)|0;h=h+Math.imul(l,he)|0;var Re=(s+o|0)+((u&8191)<<13)|0;s=(h+(u>>>13)|0)+(Re>>>26)|0;Re&=67108863;o=Math.imul(D,W);u=Math.imul(D,V);u=u+Math.imul(O,W)|0;h=Math.imul(O,V);o=o+Math.imul(C,J)|0;u=u+Math.imul(C,Z)|0;u=u+Math.imul(T,J)|0;h=h+Math.imul(T,Z)|0;o=o+Math.imul(N,Y)|0;u=u+Math.imul(N,$)|0;u=u+Math.imul(P,Y)|0;h=h+Math.imul(P,$)|0;o=o+Math.imul(B,ee)|0;u=u+Math.imul(B,te)|0;u=u+Math.imul(k,ee)|0;h=h+Math.imul(k,te)|0;o=o+Math.imul(w,ie)|0;u=u+Math.imul(w,ne)|0;u=u+Math.imul(M,ie)|0;h=h+Math.imul(M,ne)|0;o=o+Math.imul(y,se)|0;u=u+Math.imul(y,fe)|0;u=u+Math.imul(g,se)|0;h=h+Math.imul(g,fe)|0;o=o+Math.imul(b,ue)|0;u=u+Math.imul(b,he)|0;u=u+Math.imul(v,ue)|0;h=h+Math.imul(v,he)|0;o=o+Math.imul(c,ce)|0;u=u+Math.imul(c,le)|0;u=u+Math.imul(l,ce)|0;h=h+Math.imul(l,le)|0;var ke=(s+o|0)+((u&8191)<<13)|0;s=(h+(u>>>13)|0)+(ke>>>26)|0;ke&=67108863;o=Math.imul(L,W);u=Math.imul(L,V);u=u+Math.imul(q,W)|0;h=Math.imul(q,V);o=o+Math.imul(D,J)|0;u=u+Math.imul(D,Z)|0;u=u+Math.imul(O,J)|0;h=h+Math.imul(O,Z)|0;o=o+Math.imul(C,Y)|0;u=u+Math.imul(C,$)|0;u=u+Math.imul(T,Y)|0;h=h+Math.imul(T,$)|0;o=o+Math.imul(N,ee)|0;u=u+Math.imul(N,te)|0;u=u+Math.imul(P,ee)|0;h=h+Math.imul(P,te)|0;o=o+Math.imul(B,ie)|0;u=u+Math.imul(B,ne)|0;u=u+Math.imul(k,ie)|0;h=h+Math.imul(k,ne)|0;o=o+Math.imul(w,se)|0;u=u+Math.imul(w,fe)|0;u=u+Math.imul(M,se)|0;h=h+Math.imul(M,fe)|0;o=o+Math.imul(y,ue)|0;u=u+Math.imul(y,he)|0;u=u+Math.imul(g,ue)|0;h=h+Math.imul(g,he)|0;o=o+Math.imul(b,ce)|0;u=u+Math.imul(b,le)|0;u=u+Math.imul(v,ce)|0;h=h+Math.imul(v,le)|0;o=o+Math.imul(c,be)|0;u=u+Math.imul(c,ve)|0;u=u+Math.imul(l,be)|0;h=h+Math.imul(l,ve)|0;var Ae=(s+o|0)+((u&8191)<<13)|0;s=(h+(u>>>13)|0)+(Ae>>>26)|0;Ae&=67108863;o=Math.imul(F,W);u=Math.imul(F,V);u=u+Math.imul(U,W)|0;h=Math.imul(U,V);o=o+Math.imul(L,J)|0;u=u+Math.imul(L,Z)|0;u=u+Math.imul(q,J)|0;h=h+Math.imul(q,Z)|0;o=o+Math.imul(D,Y)|0;u=u+Math.imul(D,$)|0;u=u+Math.imul(O,Y)|0;h=h+Math.imul(O,$)|0;o=o+Math.imul(C,ee)|0;u=u+Math.imul(C,te)|0;u=u+Math.imul(T,ee)|0;h=h+Math.imul(T,te)|0;o=o+Math.imul(N,ie)|0;u=u+Math.imul(N,ne)|0;u=u+Math.imul(P,ie)|0;h=h+Math.imul(P,ne)|0;o=o+Math.imul(B,se)|0;u=u+Math.imul(B,fe)|0;u=u+Math.imul(k,se)|0;h=h+Math.imul(k,fe)|0;o=o+Math.imul(w,ue)|0;u=u+Math.imul(w,he)|0;u=u+Math.imul(M,ue)|0;h=h+Math.imul(M,he)|0;o=o+Math.imul(y,ce)|0;u=u+Math.imul(y,le)|0;u=u+Math.imul(g,ce)|0;h=h+Math.imul(g,le)|0;o=o+Math.imul(b,be)|0;u=u+Math.imul(b,ve)|0;u=u+Math.imul(v,be)|0;h=h+Math.imul(v,ve)|0;o=o+Math.imul(c,ye)|0;u=u+Math.imul(c,ge)|0;u=u+Math.imul(l,ye)|0;h=h+Math.imul(l,ge)|0;var Ne=(s+o|0)+((u&8191)<<13)|0;s=(h+(u>>>13)|0)+(Ne>>>26)|0;Ne&=67108863;o=Math.imul(F,J);u=Math.imul(F,Z);u=u+Math.imul(U,J)|0;h=Math.imul(U,Z);o=o+Math.imul(L,Y)|0;u=u+Math.imul(L,$)|0;u=u+Math.imul(q,Y)|0;h=h+Math.imul(q,$)|0;o=o+Math.imul(D,ee)|0;u=u+Math.imul(D,te)|0;u=u+Math.imul(O,ee)|0;h=h+Math.imul(O,te)|0;o=o+Math.imul(C,ie)|0;u=u+Math.imul(C,ne)|0;u=u+Math.imul(T,ie)|0;h=h+Math.imul(T,ne)|0;o=o+Math.imul(N,se)|0;u=u+Math.imul(N,fe)|0;u=u+Math.imul(P,se)|0;h=h+Math.imul(P,fe)|0;o=o+Math.imul(B,ue)|0;u=u+Math.imul(B,he)|0;u=u+Math.imul(k,ue)|0;h=h+Math.imul(k,he)|0;o=o+Math.imul(w,ce)|0;u=u+Math.imul(w,le)|0;u=u+Math.imul(M,ce)|0;h=h+Math.imul(M,le)|0;o=o+Math.imul(y,be)|0;u=u+Math.imul(y,ve)|0;u=u+Math.imul(g,be)|0;h=h+Math.imul(g,ve)|0;o=o+Math.imul(b,ye)|0;u=u+Math.imul(b,ge)|0;u=u+Math.imul(v,ye)|0;h=h+Math.imul(v,ge)|0;var Pe=(s+o|0)+((u&8191)<<13)|0;s=(h+(u>>>13)|0)+(Pe>>>26)|0;Pe&=67108863;o=Math.imul(F,Y);u=Math.imul(F,$);u=u+Math.imul(U,Y)|0;h=Math.imul(U,$);o=o+Math.imul(L,ee)|0;u=u+Math.imul(L,te)|0;u=u+Math.imul(q,ee)|0;h=h+Math.imul(q,te)|0;o=o+Math.imul(D,ie)|0;u=u+Math.imul(D,ne)|0;u=u+Math.imul(O,ie)|0;h=h+Math.imul(O,ne)|0;o=o+Math.imul(C,se)|0;u=u+Math.imul(C,fe)|0;u=u+Math.imul(T,se)|0;h=h+Math.imul(T,fe)|0;o=o+Math.imul(N,ue)|0;u=u+Math.imul(N,he)|0;u=u+Math.imul(P,ue)|0;h=h+Math.imul(P,he)|0;o=o+Math.imul(B,ce)|0;u=u+Math.imul(B,le)|0;u=u+Math.imul(k,ce)|0;h=h+Math.imul(k,le)|0;o=o+Math.imul(w,be)|0;u=u+Math.imul(w,ve)|0;u=u+Math.imul(M,be)|0;h=h+Math.imul(M,ve)|0;o=o+Math.imul(y,ye)|0;u=u+Math.imul(y,ge)|0;u=u+Math.imul(g,ye)|0;h=h+Math.imul(g,ge)|0;var xe=(s+o|0)+((u&8191)<<13)|0;s=(h+(u>>>13)|0)+(xe>>>26)|0;xe&=67108863;o=Math.imul(F,ee);u=Math.imul(F,te);u=u+Math.imul(U,ee)|0;h=Math.imul(U,te);o=o+Math.imul(L,ie)|0;u=u+Math.imul(L,ne)|0;u=u+Math.imul(q,ie)|0;h=h+Math.imul(q,ne)|0;o=o+Math.imul(D,se)|0;u=u+Math.imul(D,fe)|0;u=u+Math.imul(O,se)|0;h=h+Math.imul(O,fe)|0;o=o+Math.imul(C,ue)|0;u=u+Math.imul(C,he)|0;u=u+Math.imul(T,ue)|0;h=h+Math.imul(T,he)|0;o=o+Math.imul(N,ce)|0;u=u+Math.imul(N,le)|0;u=u+Math.imul(P,ce)|0;h=h+Math.imul(P,le)|0;o=o+Math.imul(B,be)|0;u=u+Math.imul(B,ve)|0;u=u+Math.imul(k,be)|0;h=h+Math.imul(k,ve)|0;o=o+Math.imul(w,ye)|0;u=u+Math.imul(w,ge)|0;u=u+Math.imul(M,ye)|0;h=h+Math.imul(M,ge)|0;var Ce=(s+o|0)+((u&8191)<<13)|0;s=(h+(u>>>13)|0)+(Ce>>>26)|0;Ce&=67108863;o=Math.imul(F,ie);u=Math.imul(F,ne);u=u+Math.imul(U,ie)|0;h=Math.imul(U,ne);o=o+Math.imul(L,se)|0;u=u+Math.imul(L,fe)|0;u=u+Math.imul(q,se)|0;h=h+Math.imul(q,fe)|0;o=o+Math.imul(D,ue)|0;u=u+Math.imul(D,he)|0;u=u+Math.imul(O,ue)|0;h=h+Math.imul(O,he)|0;o=o+Math.imul(C,ce)|0;u=u+Math.imul(C,le)|0;u=u+Math.imul(T,ce)|0;h=h+Math.imul(T,le)|0;o=o+Math.imul(N,be)|0;u=u+Math.imul(N,ve)|0;u=u+Math.imul(P,be)|0;h=h+Math.imul(P,ve)|0;o=o+Math.imul(B,ye)|0;u=u+Math.imul(B,ge)|0;u=u+Math.imul(k,ye)|0;h=h+Math.imul(k,ge)|0;var Te=(s+o|0)+((u&8191)<<13)|0;s=(h+(u>>>13)|0)+(Te>>>26)|0;Te&=67108863;o=Math.imul(F,se);u=Math.imul(F,fe);u=u+Math.imul(U,se)|0;h=Math.imul(U,fe);o=o+Math.imul(L,ue)|0;u=u+Math.imul(L,he)|0;u=u+Math.imul(q,ue)|0;h=h+Math.imul(q,he)|0;o=o+Math.imul(D,ce)|0;u=u+Math.imul(D,le)|0;u=u+Math.imul(O,ce)|0;h=h+Math.imul(O,le)|0;o=o+Math.imul(C,be)|0;u=u+Math.imul(C,ve)|0;u=u+Math.imul(T,be)|0;h=h+Math.imul(T,ve)|0;o=o+Math.imul(N,ye)|0;u=u+Math.imul(N,ge)|0;u=u+Math.imul(P,ye)|0;h=h+Math.imul(P,ge)|0;var Ie=(s+o|0)+((u&8191)<<13)|0;s=(h+(u>>>13)|0)+(Ie>>>26)|0;Ie&=67108863;o=Math.imul(F,ue);u=Math.imul(F,he);u=u+Math.imul(U,ue)|0;h=Math.imul(U,he);o=o+Math.imul(L,ce)|0;u=u+Math.imul(L,le)|0;u=u+Math.imul(q,ce)|0;h=h+Math.imul(q,le)|0;o=o+Math.imul(D,be)|0;u=u+Math.imul(D,ve)|0;u=u+Math.imul(O,be)|0;h=h+Math.imul(O,ve)|0;o=o+Math.imul(C,ye)|0;u=u+Math.imul(C,ge)|0;u=u+Math.imul(T,ye)|0;h=h+Math.imul(T,ge)|0;var De=(s+o|0)+((u&8191)<<13)|0;s=(h+(u>>>13)|0)+(De>>>26)|0;De&=67108863;o=Math.imul(F,ce);u=Math.imul(F,le);u=u+Math.imul(U,ce)|0;h=Math.imul(U,le);o=o+Math.imul(L,be)|0;u=u+Math.imul(L,ve)|0;u=u+Math.imul(q,be)|0;h=h+Math.imul(q,ve)|0;o=o+Math.imul(D,ye)|0;u=u+Math.imul(D,ge)|0;u=u+Math.imul(O,ye)|0;h=h+Math.imul(O,ge)|0;var Oe=(s+o|0)+((u&8191)<<13)|0;s=(h+(u>>>13)|0)+(Oe>>>26)|0;Oe&=67108863;o=Math.imul(F,be);u=Math.imul(F,ve);u=u+Math.imul(U,be)|0;h=Math.imul(U,ve);o=o+Math.imul(L,ye)|0;u=u+Math.imul(L,ge)|0;u=u+Math.imul(q,ye)|0;h=h+Math.imul(q,ge)|0;var je=(s+o|0)+((u&8191)<<13)|0;s=(h+(u>>>13)|0)+(je>>>26)|0;je&=67108863;o=Math.imul(F,ye);u=Math.imul(F,ge);u=u+Math.imul(U,ye)|0;h=Math.imul(U,ge);var Le=(s+o|0)+((u&8191)<<13)|0;s=(h+(u>>>13)|0)+(Le>>>26)|0;Le&=67108863;a[0]=_e;a[1]=we;a[2]=Me;a[3]=Se;a[4]=Ee;a[5]=Be;a[6]=Re;a[7]=ke;a[8]=Ae;a[9]=Ne;a[10]=Pe;a[11]=xe;a[12]=Ce;a[13]=Te;a[14]=Ie;a[15]=De;a[16]=Oe;a[17]=je;a[18]=Le;if(s!==0){a[19]=s;r.length++}return r};if(!Math.imul){o=smallMulTo}function bigMulTo(e,t,r){r.negative=t.negative^e.negative;r.length=e.length+t.length;var i=0;var n=0;for(var a=0;a>>26)|0;n+=s>>>26;s&=67108863}r.words[a]=o;i=s;s=n}if(i!==0){r.words[a]=i}else{r.length--}return r.strip()}function jumboMulTo(e,t,r){var i=new FFTM;return i.mulp(e,t,r)}BN.prototype.mulTo=function mulTo(e,t){var r;var i=this.length+e.length;if(this.length===10&&e.length===10){r=o(this,e,t)}else if(i<63){r=smallMulTo(this,e,t)}else if(i<1024){r=bigMulTo(this,e,t)}else{r=jumboMulTo(this,e,t)}return r};function FFTM(e,t){this.x=e;this.y=t}FFTM.prototype.makeRBT=function makeRBT(e){var t=new Array(e);var r=BN.prototype._countBits(e)-1;for(var i=0;i>=1}return i};FFTM.prototype.permute=function permute(e,t,r,i,n,a){for(var s=0;s>>1){n++}return 1<>>13;r[2*a+1]=n&8191;n=n>>>13}for(a=2*t;a>=26;t+=i/67108864|0;t+=n>>>26;this.words[r]=n&67108863}if(t!==0){this.words[r]=t;this.length++}return this};BN.prototype.muln=function muln(e){return this.clone().imuln(e)};BN.prototype.sqr=function sqr(){return this.mul(this)};BN.prototype.isqr=function isqr(){return this.imul(this.clone())};BN.prototype.pow=function pow(e){var t=toBitArray(e);if(t.length===0)return new BN(1);var r=this;for(var i=0;i=0);var t=e%26;var r=(e-t)/26;var i=67108863>>>26-t<<26-t;var n;if(t!==0){var a=0;for(n=0;n>>26-t}if(a){this.words[n]=a;this.length++}}if(r!==0){for(n=this.length-1;n>=0;n--){this.words[n+r]=this.words[n]}for(n=0;n=0);var i;if(t){i=(t-t%26)/26}else{i=0}var n=e%26;var a=Math.min((e-n)/26,this.length);var s=67108863^67108863>>>n<a){this.length-=a;for(u=0;u=0&&(h!==0||u>=i);u--){var d=this.words[u]|0;this.words[u]=h<<26-n|d>>>n;h=d&s}if(o&&h!==0){o.words[o.length++]=h}if(this.length===0){this.words[0]=0;this.length=1}return this.strip()};BN.prototype.ishrn=function ishrn(e,t,r){assert(this.negative===0);return this.iushrn(e,t,r)};BN.prototype.shln=function shln(e){return this.clone().ishln(e)};BN.prototype.ushln=function ushln(e){return this.clone().iushln(e)};BN.prototype.shrn=function shrn(e){return this.clone().ishrn(e)};BN.prototype.ushrn=function ushrn(e){return this.clone().iushrn(e)};BN.prototype.testn=function testn(e){assert(typeof e==="number"&&e>=0);var t=e%26;var r=(e-t)/26;var i=1<=0);var t=e%26;var r=(e-t)/26;assert(this.negative===0,"imaskn works only with positive numbers");if(this.length<=r){return this}if(t!==0){r++}this.length=Math.min(r,this.length);if(t!==0){var i=67108863^67108863>>>t<=67108864;t++){this.words[t]-=67108864;if(t===this.length-1){this.words[t+1]=1}else{this.words[t+1]++}}this.length=Math.max(this.length,t+1);return this};BN.prototype.isubn=function isubn(e){assert(typeof e==="number");assert(e<67108864);if(e<0)return this.iaddn(-e);if(this.negative!==0){this.negative=0;this.iaddn(e);this.negative=1;return this}this.words[0]-=e;if(this.length===1&&this.words[0]<0){this.words[0]=-this.words[0];this.negative=1}else{for(var t=0;t>26)-(o/67108864|0);this.words[n+r]=a&67108863}for(;n>26;this.words[n+r]=a&67108863}if(s===0)return this.strip();assert(s===-1);s=0;for(n=0;n>26;this.words[n]=a&67108863}this.negative=1;return this.strip()};BN.prototype._wordDiv=function _wordDiv(e,t){var r=this.length-e.length;var i=this.clone();var n=e;var a=n.words[n.length-1]|0;var s=this._countBits(a);r=26-s;if(r!==0){n=n.ushln(r);i.iushln(r);a=n.words[n.length-1]|0}var o=i.length-n.length;var u;if(t!=="mod"){u=new BN(null);u.length=o+1;u.words=new Array(u.length);for(var h=0;h=0;c--){var l=(i.words[n.length+c]|0)*67108864+(i.words[n.length+c-1]|0);l=Math.min(l/a|0,67108863);i._ishlnsubmul(n,l,c);while(i.negative!==0){l--;i.negative=0;i._ishlnsubmul(n,1,c);if(!i.isZero()){i.negative^=1}}if(u){u.words[c]=l}}if(u){u.strip()}i.strip();if(t!=="div"&&r!==0){i.iushrn(r)}return{div:u||null,mod:i}};BN.prototype.divmod=function divmod(e,t,r){assert(!e.isZero());if(this.isZero()){return{div:new BN(0),mod:new BN(0)}}var i,n,a;if(this.negative!==0&&e.negative===0){a=this.neg().divmod(e,t);if(t!=="mod"){i=a.div.neg()}if(t!=="div"){n=a.mod.neg();if(r&&n.negative!==0){n.iadd(e)}}return{div:i,mod:n}}if(this.negative===0&&e.negative!==0){a=this.divmod(e.neg(),t);if(t!=="mod"){i=a.div.neg()}return{div:i,mod:a.mod}}if((this.negative&e.negative)!==0){a=this.neg().divmod(e.neg(),t);if(t!=="div"){n=a.mod.neg();if(r&&n.negative!==0){n.isub(e)}}return{div:a.div,mod:n}}if(e.length>this.length||this.cmp(e)<0){return{div:new BN(0),mod:this}}if(e.length===1){if(t==="div"){return{div:this.divn(e.words[0]),mod:null}}if(t==="mod"){return{div:null,mod:new BN(this.modn(e.words[0]))}}return{div:this.divn(e.words[0]),mod:new BN(this.modn(e.words[0]))}}return this._wordDiv(e,t)};BN.prototype.div=function div(e){return this.divmod(e,"div",false).div};BN.prototype.mod=function mod(e){return this.divmod(e,"mod",false).mod};BN.prototype.umod=function umod(e){return this.divmod(e,"mod",true).mod};BN.prototype.divRound=function divRound(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var r=t.div.negative!==0?t.mod.isub(e):t.mod;var i=e.ushrn(1);var n=e.andln(1);var a=r.cmp(i);if(a<0||n===1&&a===0)return t.div;return t.div.negative!==0?t.div.isubn(1):t.div.iaddn(1)};BN.prototype.modn=function modn(e){assert(e<=67108863);var t=(1<<26)%e;var r=0;for(var i=this.length-1;i>=0;i--){r=(t*r+(this.words[i]|0))%e}return r};BN.prototype.idivn=function idivn(e){assert(e<=67108863);var t=0;for(var r=this.length-1;r>=0;r--){var i=(this.words[r]|0)+t*67108864;this.words[r]=i/e|0;t=i%e}return this.strip()};BN.prototype.divn=function divn(e){return this.clone().idivn(e)};BN.prototype.egcd=function egcd(e){assert(e.negative===0);assert(!e.isZero());var t=this;var r=e.clone();if(t.negative!==0){t=t.umod(e)}else{t=t.clone()}var i=new BN(1);var n=new BN(0);var a=new BN(0);var s=new BN(1);var o=0;while(t.isEven()&&r.isEven()){t.iushrn(1);r.iushrn(1);++o}var u=r.clone();var h=t.clone();while(!t.isZero()){for(var d=0,c=1;(t.words[0]&c)===0&&d<26;++d,c<<=1);if(d>0){t.iushrn(d);while(d-- >0){if(i.isOdd()||n.isOdd()){i.iadd(u);n.isub(h)}i.iushrn(1);n.iushrn(1)}}for(var l=0,p=1;(r.words[0]&p)===0&&l<26;++l,p<<=1);if(l>0){r.iushrn(l);while(l-- >0){if(a.isOdd()||s.isOdd()){a.iadd(u);s.isub(h)}a.iushrn(1);s.iushrn(1)}}if(t.cmp(r)>=0){t.isub(r);i.isub(a);n.isub(s)}else{r.isub(t);a.isub(i);s.isub(n)}}return{a:a,b:s,gcd:r.iushln(o)}};BN.prototype._invmp=function _invmp(e){assert(e.negative===0);assert(!e.isZero());var t=this;var r=e.clone();if(t.negative!==0){t=t.umod(e)}else{t=t.clone()}var i=new BN(1);var n=new BN(0);var a=r.clone();while(t.cmpn(1)>0&&r.cmpn(1)>0){for(var s=0,o=1;(t.words[0]&o)===0&&s<26;++s,o<<=1);if(s>0){t.iushrn(s);while(s-- >0){if(i.isOdd()){i.iadd(a)}i.iushrn(1)}}for(var u=0,h=1;(r.words[0]&h)===0&&u<26;++u,h<<=1);if(u>0){r.iushrn(u);while(u-- >0){if(n.isOdd()){n.iadd(a)}n.iushrn(1)}}if(t.cmp(r)>=0){t.isub(r);i.isub(n)}else{r.isub(t);n.isub(i)}}var d;if(t.cmpn(1)===0){d=i}else{d=n}if(d.cmpn(0)<0){d.iadd(e)}return d};BN.prototype.gcd=function gcd(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone();var r=e.clone();t.negative=0;r.negative=0;for(var i=0;t.isEven()&&r.isEven();i++){t.iushrn(1);r.iushrn(1)}do{while(t.isEven()){t.iushrn(1)}while(r.isEven()){r.iushrn(1)}var n=t.cmp(r);if(n<0){var a=t;t=r;r=a}else if(n===0||r.cmpn(1)===0){break}t.isub(r)}while(true);return r.iushln(i)};BN.prototype.invm=function invm(e){return this.egcd(e).a.umod(e)};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(e){return this.words[0]&e};BN.prototype.bincn=function bincn(e){assert(typeof e==="number");var t=e%26;var r=(e-t)/26;var i=1<>>26;s&=67108863;this.words[a]=s}if(n!==0){this.words[a]=n;this.length++}return this};BN.prototype.isZero=function isZero(){return this.length===1&&this.words[0]===0};BN.prototype.cmpn=function cmpn(e){var t=e<0;if(this.negative!==0&&!t)return-1;if(this.negative===0&&t)return 1;this.strip();var r;if(this.length>1){r=1}else{if(t){e=-e}assert(e<=67108863,"Number is too big");var i=this.words[0]|0;r=i===e?0:ie.length)return 1;if(this.length=0;r--){var i=this.words[r]|0;var n=e.words[r]|0;if(i===n)continue;if(in){t=1}break}return t};BN.prototype.gtn=function gtn(e){return this.cmpn(e)===1};BN.prototype.gt=function gt(e){return this.cmp(e)===1};BN.prototype.gten=function gten(e){return this.cmpn(e)>=0};BN.prototype.gte=function gte(e){return this.cmp(e)>=0};BN.prototype.ltn=function ltn(e){return this.cmpn(e)===-1};BN.prototype.lt=function lt(e){return this.cmp(e)===-1};BN.prototype.lten=function lten(e){return this.cmpn(e)<=0};BN.prototype.lte=function lte(e){return this.cmp(e)<=0};BN.prototype.eqn=function eqn(e){return this.cmpn(e)===0};BN.prototype.eq=function eq(e){return this.cmp(e)===0};BN.red=function red(e){return new Red(e)};BN.prototype.toRed=function toRed(e){assert(!this.red,"Already a number in reduction context");assert(this.negative===0,"red works only with positives");return e.convertTo(this)._forceRed(e)};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(e){this.red=e;return this};BN.prototype.forceRed=function forceRed(e){assert(!this.red,"Already a number in reduction context");return this._forceRed(e)};BN.prototype.redAdd=function redAdd(e){assert(this.red,"redAdd works only with red numbers");return this.red.add(this,e)};BN.prototype.redIAdd=function redIAdd(e){assert(this.red,"redIAdd works only with red numbers");return this.red.iadd(this,e)};BN.prototype.redSub=function redSub(e){assert(this.red,"redSub works only with red numbers");return this.red.sub(this,e)};BN.prototype.redISub=function redISub(e){assert(this.red,"redISub works only with red numbers");return this.red.isub(this,e)};BN.prototype.redShl=function redShl(e){assert(this.red,"redShl works only with red numbers");return this.red.shl(this,e)};BN.prototype.redMul=function redMul(e){assert(this.red,"redMul works only with red numbers");this.red._verify2(this,e);return this.red.mul(this,e)};BN.prototype.redIMul=function redIMul(e){assert(this.red,"redMul works only with red numbers");this.red._verify2(this,e);return this.red.imul(this,e)};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(e){assert(this.red&&!e.red,"redPow(normalNum)");this.red._verify1(this);return this.red.pow(this,e)};var u={k256:null,p224:null,p192:null,p25519:null};function MPrime(e,t){this.name=e;this.p=new BN(t,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 e=new BN(null);e.words=new Array(Math.ceil(this.n/13));return e};MPrime.prototype.ireduce=function ireduce(e){var t=e;var r;do{this.split(t,this.tmp);t=this.imulK(t);t=t.iadd(this.tmp);r=t.bitLength()}while(r>this.n);var i=r0){t.isub(this.p)}else{if(t.strip!==undefined){t.strip()}else{t._strip()}}return t};MPrime.prototype.split=function split(e,t){e.iushrn(this.n,0,t)};MPrime.prototype.imulK=function imulK(e){return e.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(e,t){var r=4194303;var i=Math.min(e.length,9);for(var n=0;n>>22;a=s}a>>>=22;e.words[n-10]=a;if(a===0&&e.length>10){e.length-=10}else{e.length-=9}};K256.prototype.imulK=function imulK(e){e.words[e.length]=0;e.words[e.length+1]=0;e.length+=2;var t=0;for(var r=0;r>>=26;e.words[r]=n;t=i}if(t!==0){e.words[e.length++]=t}return e};BN._prime=function prime(e){if(u[e])return u[e];var prime;if(e==="k256"){prime=new K256}else if(e==="p224"){prime=new P224}else if(e==="p192"){prime=new P192}else if(e==="p25519"){prime=new P25519}else{throw new Error("Unknown prime "+e)}u[e]=prime;return prime};function Red(e){if(typeof e==="string"){var t=BN._prime(e);this.m=t.p;this.prime=t}else{assert(e.gtn(1),"modulus must be greater than 1");this.m=e;this.prime=null}}Red.prototype._verify1=function _verify1(e){assert(e.negative===0,"red works only with positives");assert(e.red,"red works only with red numbers")};Red.prototype._verify2=function _verify2(e,t){assert((e.negative|t.negative)===0,"red works only with positives");assert(e.red&&e.red===t.red,"red works only with red numbers")};Red.prototype.imod=function imod(e){if(this.prime)return this.prime.ireduce(e)._forceRed(this);return e.umod(this.m)._forceRed(this)};Red.prototype.neg=function neg(e){if(e.isZero()){return e.clone()}return this.m.sub(e)._forceRed(this)};Red.prototype.add=function add(e,t){this._verify2(e,t);var r=e.add(t);if(r.cmp(this.m)>=0){r.isub(this.m)}return r._forceRed(this)};Red.prototype.iadd=function iadd(e,t){this._verify2(e,t);var r=e.iadd(t);if(r.cmp(this.m)>=0){r.isub(this.m)}return r};Red.prototype.sub=function sub(e,t){this._verify2(e,t);var r=e.sub(t);if(r.cmpn(0)<0){r.iadd(this.m)}return r._forceRed(this)};Red.prototype.isub=function isub(e,t){this._verify2(e,t);var r=e.isub(t);if(r.cmpn(0)<0){r.iadd(this.m)}return r};Red.prototype.shl=function shl(e,t){this._verify1(e);return this.imod(e.ushln(t))};Red.prototype.imul=function imul(e,t){this._verify2(e,t);return this.imod(e.imul(t))};Red.prototype.mul=function mul(e,t){this._verify2(e,t);return this.imod(e.mul(t))};Red.prototype.isqr=function isqr(e){return this.imul(e,e.clone())};Red.prototype.sqr=function sqr(e){return this.mul(e,e)};Red.prototype.sqrt=function sqrt(e){if(e.isZero())return e.clone();var t=this.m.andln(3);assert(t%2===1);if(t===3){var r=this.m.add(new BN(1)).iushrn(2);return this.pow(e,r)}var i=this.m.subn(1);var n=0;while(!i.isZero()&&i.andln(1)===0){n++;i.iushrn(1)}assert(!i.isZero());var a=new BN(1).toRed(this);var s=a.redNeg();var o=this.m.subn(1).iushrn(1);var u=this.m.bitLength();u=new BN(2*u*u).toRed(this);while(this.pow(u,o).cmp(s)!==0){u.redIAdd(s)}var h=this.pow(u,i);var d=this.pow(e,i.addn(1).iushrn(1));var c=this.pow(e,i);var l=n;while(c.cmp(a)!==0){var p=c;for(var b=0;p.cmp(a)!==0;b++){p=p.redSqr()}assert(b=0;n--){var h=t.words[n];for(var d=u-1;d>=0;d--){var c=h>>d&1;if(a!==i[0]){a=this.sqr(a)}if(c===0&&s===0){o=0;continue}s<<=1;s|=c;o++;if(o!==r&&(n!==0||d!==0))continue;a=this.mul(a,i[s]);o=0;s=0}u=26}return a};Red.prototype.convertTo=function convertTo(e){var t=e.umod(this.m);return t===e?t.clone():t};Red.prototype.convertFrom=function convertFrom(e){var t=e.clone();t.red=null;return t};BN.mont=function mont(e){return new Mont(e)};function Mont(e){Red.call(this,e);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(e){return this.imod(e.ushln(this.shift))};Mont.prototype.convertFrom=function convertFrom(e){var t=this.imod(e.mul(this.rinv));t.red=null;return t};Mont.prototype.imul=function imul(e,t){if(e.isZero()||t.isZero()){e.words[0]=0;e.length=1;return e}var r=e.imul(t);var i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m);var n=r.isub(i).iushrn(this.shift);var a=n;if(n.cmp(this.m)>=0){a=n.isub(this.m)}else if(n.cmpn(0)<0){a=n.iadd(this.m)}return a._forceRed(this)};Mont.prototype.mul=function mul(e,t){if(e.isZero()||t.isZero())return new BN(0)._forceRed(this);var r=e.mul(t);var i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m);var n=r.isub(i).iushrn(this.shift);var a=n;if(n.cmp(this.m)>=0){a=n.isub(this.m)}else if(n.cmpn(0)<0){a=n.iadd(this.m)}return a._forceRed(this)};Mont.prototype.invm=function invm(e){var t=this.imod(e._invmp(this.m).mul(this.r2));return t._forceRed(this)}})(false||e,this)},6069:function(e,t,r){var i;e.exports=function rand(e){if(!i)i=new Rand(null);return i.generate(e)};function Rand(e){this.rand=e}e.exports.Rand=Rand;Rand.prototype.generate=function generate(e){return this._rand(e)};Rand.prototype._rand=function _rand(e){if(this.rand.getBytes)return this.rand.getBytes(e);var t=new Uint8Array(e);for(var r=0;r>>24]^s[d>>>16&255]^o[c>>>8&255]^u[l&255]^t[y++];b=a[d>>>24]^s[c>>>16&255]^o[l>>>8&255]^u[h&255]^t[y++];v=a[c>>>24]^s[l>>>16&255]^o[h>>>8&255]^u[d&255]^t[y++];m=a[l>>>24]^s[h>>>16&255]^o[d>>>8&255]^u[c&255]^t[y++];h=p;d=b;c=v;l=m}p=(i[h>>>24]<<24|i[d>>>16&255]<<16|i[c>>>8&255]<<8|i[l&255])^t[y++];b=(i[d>>>24]<<24|i[c>>>16&255]<<16|i[l>>>8&255]<<8|i[h&255])^t[y++];v=(i[c>>>24]<<24|i[l>>>16&255]<<16|i[h>>>8&255]<<8|i[d&255])^t[y++];m=(i[l>>>24]<<24|i[h>>>16&255]<<16|i[d>>>8&255]<<8|i[c&255])^t[y++];p=p>>>0;b=b>>>0;v=v>>>0;m=m>>>0;return[p,b,v,m]}var n=[0,1,2,4,8,16,32,64,128,27,54];var a=function(){var e=new Array(256);for(var t=0;t<256;t++){if(t<128){e[t]=t<<1}else{e[t]=t<<1^283}}var r=[];var i=[];var n=[[],[],[],[]];var a=[[],[],[],[]];var s=0;var o=0;for(var u=0;u<256;++u){var h=o^o<<1^o<<2^o<<3^o<<4;h=h>>>8^h&255^99;r[s]=h;i[h]=s;var d=e[s];var c=e[d];var l=e[c];var p=e[h]*257^h*16843008;n[0][s]=p<<24|p>>>8;n[1][s]=p<<16|p>>>16;n[2][s]=p<<8|p>>>24;n[3][s]=p;p=l*16843009^c*65537^d*257^s*16843008;a[0][h]=p<<24|p>>>8;a[1][h]=p<<16|p>>>16;a[2][h]=p<<8|p>>>24;a[3][h]=p;if(s===0){s=o=1}else{s=d^e[e[e[l^d]]];o^=e[e[o]]}}return{SBOX:r,INV_SBOX:i,SUB_MIX:n,INV_SUB_MIX:a}}();function AES(e){this._key=asUInt32Array(e);this._reset()}AES.blockSize=4*4;AES.keySize=256/8;AES.prototype.blockSize=AES.blockSize;AES.prototype.keySize=AES.keySize;AES.prototype._reset=function(){var e=this._key;var t=e.length;var r=t+6;var i=(r+1)*4;var s=[];for(var o=0;o>>24;u=a.SBOX[u>>>24]<<24|a.SBOX[u>>>16&255]<<16|a.SBOX[u>>>8&255]<<8|a.SBOX[u&255];u^=n[o/t|0]<<24}else if(t>6&&o%t===4){u=a.SBOX[u>>>24]<<24|a.SBOX[u>>>16&255]<<16|a.SBOX[u>>>8&255]<<8|a.SBOX[u&255]}s[o]=s[o-t]^u}var h=[];for(var d=0;d>>24]]^a.INV_SUB_MIX[1][a.SBOX[l>>>16&255]]^a.INV_SUB_MIX[2][a.SBOX[l>>>8&255]]^a.INV_SUB_MIX[3][a.SBOX[l&255]]}}this._nRounds=r;this._keySchedule=s;this._invKeySchedule=h};AES.prototype.encryptBlockRaw=function(e){e=asUInt32Array(e);return cryptBlock(e,this._keySchedule,a.SUB_MIX,a.SBOX,this._nRounds)};AES.prototype.encryptBlock=function(e){var t=this.encryptBlockRaw(e);var r=i.allocUnsafe(16);r.writeUInt32BE(t[0],0);r.writeUInt32BE(t[1],4);r.writeUInt32BE(t[2],8);r.writeUInt32BE(t[3],12);return r};AES.prototype.decryptBlock=function(e){e=asUInt32Array(e);var t=e[1];e[1]=e[3];e[3]=t;var r=cryptBlock(e,this._invKeySchedule,a.INV_SUB_MIX,a.INV_SBOX,this._nRounds);var n=i.allocUnsafe(16);n.writeUInt32BE(r[0],0);n.writeUInt32BE(r[3],4);n.writeUInt32BE(r[2],8);n.writeUInt32BE(r[1],12);return n};AES.prototype.scrub=function(){scrubVec(this._keySchedule);scrubVec(this._invKeySchedule);scrubVec(this._key)};e.exports.AES=AES},5112:function(e,t,r){var i=r(9725);var n=r(3118).Buffer;var a=r(8826);var s=r(7526);var o=r(7731);var u=r(5653);var h=r(4630);function xorTest(e,t){var r=0;if(e.length!==t.length)r++;var i=Math.min(e.length,t.length);for(var n=0;n16){t=this.cache.slice(0,16);this.cache=this.cache.slice(16);return t}}else{if(this.cache.length>=16){t=this.cache.slice(0,16);this.cache=this.cache.slice(16);return t}}return null};Splitter.prototype.flush=function(){if(this.cache.length)return this.cache};function unpad(e){var t=e[15];if(t<1||t>16){throw new Error("unable to decrypt data")}var r=-1;while(++r15){var e=this.cache.slice(0,16);this.cache=this.cache.slice(16);return e}return null};Splitter.prototype.flush=function(){var e=16-this.cache.length;var t=a.allocUnsafe(e);var r=-1;while(++r>>0,0);t.writeUInt32BE(e[1]>>>0,4);t.writeUInt32BE(e[2]>>>0,8);t.writeUInt32BE(e[3]>>>0,12);return t}function GHASH(e){this.h=e;this.state=i.alloc(16,0);this.cache=i.allocUnsafe(0)}GHASH.prototype.ghash=function(e){var t=-1;while(++t0;r--){e[r]=e[r]>>>1|(e[r-1]&1)<<31}e[0]=e[0]>>>1;if(n){e[0]=e[0]^225<<24}}this.state=fromArray(t)};GHASH.prototype.update=function(e){this.cache=i.concat([this.cache,e]);var t;while(this.cache.length>=16){t=this.cache.slice(0,16);this.cache=this.cache.slice(16);this.ghash(t)}};GHASH.prototype.final=function(e,t){if(this.cache.length){this.ghash(i.concat([this.cache,n],16))}this.ghash(fromArray([0,e,0,t]));return this.state};e.exports=GHASH},4630:function(e){function incr32(e){var t=e.length;var r;while(t--){r=e.readUInt8(t);if(r===255){e.writeUInt8(0,t)}else{r++;e.writeUInt8(r,t);break}}}e.exports=incr32},4156:function(e,t,r){var i=r(5653);t.encrypt=function(e,t){var r=i(t,e._prev);e._prev=e._cipher.encryptBlock(r);return e._prev};t.decrypt=function(e,t){var r=e._prev;e._prev=t;var n=e._cipher.decryptBlock(t);return i(n,r)}},2509:function(e,t,r){var i=r(3118).Buffer;var n=r(5653);function encryptStart(e,t,r){var a=t.length;var s=n(t,e._cache);e._cache=e._cache.slice(a);e._prev=i.concat([e._prev,r?t:s]);return s}t.encrypt=function(e,t,r){var n=i.allocUnsafe(0);var a;while(t.length){if(e._cache.length===0){e._cache=e._cipher.encryptBlock(e._prev);e._prev=i.allocUnsafe(0)}if(e._cache.length<=t.length){a=e._cache.length;n=i.concat([n,encryptStart(e,t.slice(0,a),r)]);t=t.slice(a)}else{n=i.concat([n,encryptStart(e,t,r)]);break}}return n}},9010:function(e,t,r){var i=r(3118).Buffer;function encryptByte(e,t,r){var i;var n=-1;var a=8;var s=0;var o,u;while(++n>n%8;e._prev=shiftIn(e._prev,r?o:u)}return s}function shiftIn(e,t){var r=e.length;var n=-1;var a=i.allocUnsafe(e.length);e=i.concat([e,i.from([t])]);while(++n>7}return a}t.encrypt=function(e,t,r){var n=t.length;var a=i.allocUnsafe(n);var s=-1;while(++s=0||!r.umod(e.prime1)||!r.umod(e.prime2)){r=new i(n(t))}return r}},5703:function(e,t,r){e.exports=r(26)},1265:function(e,t,r){var i=r(3118).Buffer;var n=r(2539);var a=r(6572);var s=r(7526);var o=r(3596);var u=r(9204);var h=r(26);Object.keys(h).forEach((function(e){h[e].id=i.from(h[e].id,"hex");h[e.toLowerCase()]=h[e]}));function Sign(e){a.Writable.call(this);var t=h[e];if(!t)throw new Error("Unknown message digest");this._hashType=t.hash;this._hash=n(t.hash);this._tag=t.id;this._signType=t.sign}s(Sign,a.Writable);Sign.prototype._write=function _write(e,t,r){this._hash.update(e);r()};Sign.prototype.update=function update(e,t){if(typeof e==="string")e=i.from(e,t);this._hash.update(e);return this};Sign.prototype.sign=function signMethod(e,t){this.end();var r=this._hash.digest();var i=o(r,e,this._hashType,this._signType,this._tag);return t?i.toString(t):i};function Verify(e){a.Writable.call(this);var t=h[e];if(!t)throw new Error("Unknown message digest");this._hash=n(t.hash);this._tag=t.id;this._signType=t.sign}s(Verify,a.Writable);Verify.prototype._write=function _write(e,t,r){this._hash.update(e);r()};Verify.prototype.update=function update(e,t){if(typeof e==="string")e=i.from(e,t);this._hash.update(e);return this};Verify.prototype.verify=function verifyMethod(e,t,r){if(typeof t==="string")t=i.from(t,r);this.end();var n=this._hash.digest();return u(t,n,e,this._signType,this._tag)};function createSign(e){return new Sign(e)}function createVerify(e){return new Verify(e)}e.exports={Sign:createSign,Verify:createVerify,createSign:createSign,createVerify:createVerify}},3596:function(e,t,r){var i=r(3118).Buffer;var n=r(2730);var a=r(6236);var s=r(8818).ec;var o=r(5410);var u=r(569);var h=r(9167);function sign(e,t,r,n,s){var o=u(t);if(o.curve){if(n!=="ecdsa"&&n!=="ecdsa/rsa")throw new Error("wrong private key type");return ecSign(e,o)}else if(o.type==="dsa"){if(n!=="dsa")throw new Error("wrong private key type");return dsaSign(e,o,r)}else{if(n!=="rsa"&&n!=="ecdsa/rsa")throw new Error("wrong private key type")}e=i.concat([s,e]);var h=o.modulus.byteLength();var d=[0,1];while(e.length+d.length+10)r.ishrn(i);return r}function bits2octets(e,t){e=bits2int(e,t);e=e.mod(t);var r=i.from(e.toArray());if(r.length=t)throw new Error("invalid sig")}e.exports=verify},5410:function(e,t,r){e=r.nmd(e);(function(e,t){"use strict";function assert(e,t){if(!e)throw new Error(t||"Assertion failed")}function inherits(e,t){e.super_=t;var TempCtor=function(){};TempCtor.prototype=t.prototype;e.prototype=new TempCtor;e.prototype.constructor=e}function BN(e,t,r){if(BN.isBN(e)){return e}this.negative=0;this.words=null;this.length=0;this.red=null;if(e!==null){if(t==="le"||t==="be"){r=t;t=10}this._init(e||0,t||10,r||"be")}}if(typeof e==="object"){e.exports=BN}else{t.BN=BN}BN.BN=BN;BN.wordSize=26;var i;try{i=r(4300).Buffer}catch(e){}BN.isBN=function isBN(e){if(e instanceof BN){return true}return e!==null&&typeof e==="object"&&e.constructor.wordSize===BN.wordSize&&Array.isArray(e.words)};BN.max=function max(e,t){if(e.cmp(t)>0)return e;return t};BN.min=function min(e,t){if(e.cmp(t)<0)return e;return t};BN.prototype._init=function init(e,t,r){if(typeof e==="number"){return this._initNumber(e,t,r)}if(typeof e==="object"){return this._initArray(e,t,r)}if(t==="hex"){t=16}assert(t===(t|0)&&t>=2&&t<=36);e=e.toString().replace(/\s+/g,"");var i=0;if(e[0]==="-"){i++}if(t===16){this._parseHex(e,i)}else{this._parseBase(e,t,i)}if(e[0]==="-"){this.negative=1}this._strip();if(r!=="le")return;this._initArray(this.toArray(),t,r)};BN.prototype._initNumber=function _initNumber(e,t,r){if(e<0){this.negative=1;e=-e}if(e<67108864){this.words=[e&67108863];this.length=1}else if(e<4503599627370496){this.words=[e&67108863,e/67108864&67108863];this.length=2}else{assert(e<9007199254740992);this.words=[e&67108863,e/67108864&67108863,1];this.length=3}if(r!=="le")return;this._initArray(this.toArray(),t,r)};BN.prototype._initArray=function _initArray(e,t,r){assert(typeof e.length==="number");if(e.length<=0){this.words=[0];this.length=1;return this}this.length=Math.ceil(e.length/3);this.words=new Array(this.length);for(var i=0;i=0;i-=3){a=e[i]|e[i-1]<<8|e[i-2]<<16;this.words[n]|=a<>>26-s&67108863;s+=24;if(s>=26){s-=26;n++}}}else if(r==="le"){for(i=0,n=0;i>>26-s&67108863;s+=24;if(s>=26){s-=26;n++}}}return this._strip()};function parseHex(e,t,r){var i=0;var n=Math.min(e.length,r);var a=0;for(var s=t;s=49&&o<=54){u=o-49+10}else if(o>=17&&o<=22){u=o-17+10}else{u=o}i|=u;a|=u}assert(!(a&240),"Invalid character in "+e);return i}BN.prototype._parseHex=function _parseHex(e,t){this.length=Math.ceil((e.length-t)/6);this.words=new Array(this.length);for(var r=0;r=t;r-=6){n=parseHex(e,r,r+6);this.words[i]|=n<>>26-a&4194303;a+=24;if(a>=26){a-=26;i++}}if(r+6!==t){n=parseHex(e,t,r+6);this.words[i]|=n<>>26-a&4194303}this._strip()};function parseBase(e,t,r,i){var n=0;var a=0;var s=Math.min(e.length,r);for(var o=t;o=49){a=u-49+10}else if(u>=17){a=u-17+10}else{a=u}assert(u>=0&&a1&&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};if(typeof Symbol!=="undefined"&&typeof Symbol.for==="function"){BN.prototype[Symbol.for("nodejs.util.inspect.custom")]=inspect}else{BN.prototype.inspect=inspect}function inspect(){return(this.red?""}var n=["","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 a=[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 s=[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(e,t){e=e||10;t=t|0||1;var r;if(e===16||e==="hex"){r="";var i=0;var o=0;for(var u=0;u>>24-i&16777215;if(o!==0||u!==this.length-1){r=n[6-d.length]+d+r}else{r=d+r}i+=2;if(i>=26){i-=26;u--}}if(o!==0){r=o.toString(16)+r}while(r.length%t!==0){r="0"+r}if(this.negative!==0){r="-"+r}return r}if(e===(e|0)&&e>=2&&e<=36){var c=a[e];var l=s[e];r="";var p=this.clone();p.negative=0;while(!p.isZero()){var b=p.modrn(l).toString(e);p=p.idivn(l);if(!p.isZero()){r=n[c-b.length]+b+r}else{r=b+r}}if(this.isZero()){r="0"+r}while(r.length%t!==0){r="0"+r}if(this.negative!==0){r="-"+r}return r}assert(false,"Base should be between 2 and 36")};BN.prototype.toNumber=function toNumber(){var e=this.words[0];if(this.length===2){e+=this.words[1]*67108864}else if(this.length===3&&this.words[2]===1){e+=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?-e:e};BN.prototype.toJSON=function toJSON(){return this.toString(16,2)};if(i){BN.prototype.toBuffer=function toBuffer(e,t){return this.toArrayLike(i,e,t)}}BN.prototype.toArray=function toArray(e,t){return this.toArrayLike(Array,e,t)};var o=function allocate(e,t){if(e.allocUnsafe){return e.allocUnsafe(t)}return new e(t)};BN.prototype.toArrayLike=function toArrayLike(e,t,r){this._strip();var i=this.byteLength();var n=r||Math.max(1,i);assert(i<=n,"byte array longer than desired length");assert(n>0,"Requested array length <= 0");var a=o(e,n);var s=t==="le"?"LE":"BE";this["_toArrayLike"+s](a,i);return a};BN.prototype._toArrayLikeLE=function _toArrayLikeLE(e,t){var r=0;var i=0;for(var n=0,a=0;n>8&255}if(r>16&255}if(a===6){if(r>24&255}i=0;a=0}else{i=s>>>24;a+=2}}if(r=0){e[r--]=s>>8&255}if(r>=0){e[r--]=s>>16&255}if(a===6){if(r>=0){e[r--]=s>>24&255}i=0;a=0}else{i=s>>>24;a+=2}}if(r>=0){e[r--]=i;while(r>=0){e[r--]=0}}};if(Math.clz32){BN.prototype._countBits=function _countBits(e){return 32-Math.clz32(e)}}else{BN.prototype._countBits=function _countBits(e){var t=e;var r=0;if(t>=4096){r+=13;t>>>=13}if(t>=64){r+=7;t>>>=7}if(t>=8){r+=4;t>>>=4}if(t>=2){r+=2;t>>>=2}return r+t}}BN.prototype._zeroBits=function _zeroBits(e){if(e===0)return 26;var t=e;var r=0;if((t&8191)===0){r+=13;t>>>=13}if((t&127)===0){r+=7;t>>>=7}if((t&15)===0){r+=4;t>>>=4}if((t&3)===0){r+=2;t>>>=2}if((t&1)===0){r++}return r};BN.prototype.bitLength=function bitLength(){var e=this.words[this.length-1];var t=this._countBits(e);return(this.length-1)*26+t};function toBitArray(e){var t=new Array(e.bitLength());for(var r=0;r>>n&1}return t}BN.prototype.zeroBits=function zeroBits(){if(this.isZero())return 0;var e=0;for(var t=0;te.length)return this.clone().ior(e);return e.clone().ior(this)};BN.prototype.uor=function uor(e){if(this.length>e.length)return this.clone().iuor(e);return e.clone().iuor(this)};BN.prototype.iuand=function iuand(e){var t;if(this.length>e.length){t=e}else{t=this}for(var r=0;re.length)return this.clone().iand(e);return e.clone().iand(this)};BN.prototype.uand=function uand(e){if(this.length>e.length)return this.clone().iuand(e);return e.clone().iuand(this)};BN.prototype.iuxor=function iuxor(e){var t;var r;if(this.length>e.length){t=this;r=e}else{t=e;r=this}for(var i=0;ie.length)return this.clone().ixor(e);return e.clone().ixor(this)};BN.prototype.uxor=function uxor(e){if(this.length>e.length)return this.clone().iuxor(e);return e.clone().iuxor(this)};BN.prototype.inotn=function inotn(e){assert(typeof e==="number"&&e>=0);var t=Math.ceil(e/26)|0;var r=e%26;this._expand(t);if(r>0){t--}for(var i=0;i0){this.words[i]=~this.words[i]&67108863>>26-r}return this._strip()};BN.prototype.notn=function notn(e){return this.clone().inotn(e)};BN.prototype.setn=function setn(e,t){assert(typeof e==="number"&&e>=0);var r=e/26|0;var i=e%26;this._expand(r+1);if(t){this.words[r]=this.words[r]|1<e.length){r=this;i=e}else{r=e;i=this}var n=0;for(var a=0;a>>26}for(;n!==0&&a>>26}this.length=r.length;if(n!==0){this.words[this.length]=n;this.length++}else if(r!==this){for(;ae.length)return this.clone().iadd(e);return e.clone().iadd(this)};BN.prototype.isub=function isub(e){if(e.negative!==0){e.negative=0;var t=this.iadd(e);e.negative=1;return t._normSign()}else if(this.negative!==0){this.negative=0;this.iadd(e);this.negative=1;return this._normSign()}var r=this.cmp(e);if(r===0){this.negative=0;this.length=1;this.words[0]=0;return this}var i,n;if(r>0){i=this;n=e}else{i=e;n=this}var a=0;for(var s=0;s>26;this.words[s]=t&67108863}for(;a!==0&&s>26;this.words[s]=t&67108863}if(a===0&&s>>26;var c=u&67108863;var l=Math.min(h,t.length-1);for(var p=Math.max(0,h-e.length+1);p<=l;p++){var b=h-p|0;n=e.words[b]|0;a=t.words[p]|0;s=n*a+c;d+=s/67108864|0;c=s&67108863}r.words[h]=c|0;u=d|0}if(u!==0){r.words[h]=u|0}else{r.length--}return r._strip()}var u=function comb10MulTo(e,t,r){var i=e.words;var n=t.words;var a=r.words;var s=0;var o;var u;var h;var d=i[0]|0;var c=d&8191;var l=d>>>13;var p=i[1]|0;var b=p&8191;var v=p>>>13;var m=i[2]|0;var y=m&8191;var g=m>>>13;var _=i[3]|0;var w=_&8191;var M=_>>>13;var E=i[4]|0;var B=E&8191;var k=E>>>13;var A=i[5]|0;var N=A&8191;var P=A>>>13;var x=i[6]|0;var C=x&8191;var T=x>>>13;var I=i[7]|0;var D=I&8191;var O=I>>>13;var j=i[8]|0;var L=j&8191;var q=j>>>13;var H=i[9]|0;var F=H&8191;var U=H>>>13;var z=n[0]|0;var W=z&8191;var V=z>>>13;var G=n[1]|0;var J=G&8191;var Z=G>>>13;var X=n[2]|0;var Y=X&8191;var $=X>>>13;var Q=n[3]|0;var ee=Q&8191;var te=Q>>>13;var re=n[4]|0;var ie=re&8191;var ne=re>>>13;var ae=n[5]|0;var se=ae&8191;var fe=ae>>>13;var oe=n[6]|0;var ue=oe&8191;var he=oe>>>13;var de=n[7]|0;var ce=de&8191;var le=de>>>13;var pe=n[8]|0;var be=pe&8191;var ve=pe>>>13;var me=n[9]|0;var ye=me&8191;var ge=me>>>13;r.negative=e.negative^t.negative;r.length=19;o=Math.imul(c,W);u=Math.imul(c,V);u=u+Math.imul(l,W)|0;h=Math.imul(l,V);var _e=(s+o|0)+((u&8191)<<13)|0;s=(h+(u>>>13)|0)+(_e>>>26)|0;_e&=67108863;o=Math.imul(b,W);u=Math.imul(b,V);u=u+Math.imul(v,W)|0;h=Math.imul(v,V);o=o+Math.imul(c,J)|0;u=u+Math.imul(c,Z)|0;u=u+Math.imul(l,J)|0;h=h+Math.imul(l,Z)|0;var we=(s+o|0)+((u&8191)<<13)|0;s=(h+(u>>>13)|0)+(we>>>26)|0;we&=67108863;o=Math.imul(y,W);u=Math.imul(y,V);u=u+Math.imul(g,W)|0;h=Math.imul(g,V);o=o+Math.imul(b,J)|0;u=u+Math.imul(b,Z)|0;u=u+Math.imul(v,J)|0;h=h+Math.imul(v,Z)|0;o=o+Math.imul(c,Y)|0;u=u+Math.imul(c,$)|0;u=u+Math.imul(l,Y)|0;h=h+Math.imul(l,$)|0;var Me=(s+o|0)+((u&8191)<<13)|0;s=(h+(u>>>13)|0)+(Me>>>26)|0;Me&=67108863;o=Math.imul(w,W);u=Math.imul(w,V);u=u+Math.imul(M,W)|0;h=Math.imul(M,V);o=o+Math.imul(y,J)|0;u=u+Math.imul(y,Z)|0;u=u+Math.imul(g,J)|0;h=h+Math.imul(g,Z)|0;o=o+Math.imul(b,Y)|0;u=u+Math.imul(b,$)|0;u=u+Math.imul(v,Y)|0;h=h+Math.imul(v,$)|0;o=o+Math.imul(c,ee)|0;u=u+Math.imul(c,te)|0;u=u+Math.imul(l,ee)|0;h=h+Math.imul(l,te)|0;var Se=(s+o|0)+((u&8191)<<13)|0;s=(h+(u>>>13)|0)+(Se>>>26)|0;Se&=67108863;o=Math.imul(B,W);u=Math.imul(B,V);u=u+Math.imul(k,W)|0;h=Math.imul(k,V);o=o+Math.imul(w,J)|0;u=u+Math.imul(w,Z)|0;u=u+Math.imul(M,J)|0;h=h+Math.imul(M,Z)|0;o=o+Math.imul(y,Y)|0;u=u+Math.imul(y,$)|0;u=u+Math.imul(g,Y)|0;h=h+Math.imul(g,$)|0;o=o+Math.imul(b,ee)|0;u=u+Math.imul(b,te)|0;u=u+Math.imul(v,ee)|0;h=h+Math.imul(v,te)|0;o=o+Math.imul(c,ie)|0;u=u+Math.imul(c,ne)|0;u=u+Math.imul(l,ie)|0;h=h+Math.imul(l,ne)|0;var Ee=(s+o|0)+((u&8191)<<13)|0;s=(h+(u>>>13)|0)+(Ee>>>26)|0;Ee&=67108863;o=Math.imul(N,W);u=Math.imul(N,V);u=u+Math.imul(P,W)|0;h=Math.imul(P,V);o=o+Math.imul(B,J)|0;u=u+Math.imul(B,Z)|0;u=u+Math.imul(k,J)|0;h=h+Math.imul(k,Z)|0;o=o+Math.imul(w,Y)|0;u=u+Math.imul(w,$)|0;u=u+Math.imul(M,Y)|0;h=h+Math.imul(M,$)|0;o=o+Math.imul(y,ee)|0;u=u+Math.imul(y,te)|0;u=u+Math.imul(g,ee)|0;h=h+Math.imul(g,te)|0;o=o+Math.imul(b,ie)|0;u=u+Math.imul(b,ne)|0;u=u+Math.imul(v,ie)|0;h=h+Math.imul(v,ne)|0;o=o+Math.imul(c,se)|0;u=u+Math.imul(c,fe)|0;u=u+Math.imul(l,se)|0;h=h+Math.imul(l,fe)|0;var Be=(s+o|0)+((u&8191)<<13)|0;s=(h+(u>>>13)|0)+(Be>>>26)|0;Be&=67108863;o=Math.imul(C,W);u=Math.imul(C,V);u=u+Math.imul(T,W)|0;h=Math.imul(T,V);o=o+Math.imul(N,J)|0;u=u+Math.imul(N,Z)|0;u=u+Math.imul(P,J)|0;h=h+Math.imul(P,Z)|0;o=o+Math.imul(B,Y)|0;u=u+Math.imul(B,$)|0;u=u+Math.imul(k,Y)|0;h=h+Math.imul(k,$)|0;o=o+Math.imul(w,ee)|0;u=u+Math.imul(w,te)|0;u=u+Math.imul(M,ee)|0;h=h+Math.imul(M,te)|0;o=o+Math.imul(y,ie)|0;u=u+Math.imul(y,ne)|0;u=u+Math.imul(g,ie)|0;h=h+Math.imul(g,ne)|0;o=o+Math.imul(b,se)|0;u=u+Math.imul(b,fe)|0;u=u+Math.imul(v,se)|0;h=h+Math.imul(v,fe)|0;o=o+Math.imul(c,ue)|0;u=u+Math.imul(c,he)|0;u=u+Math.imul(l,ue)|0;h=h+Math.imul(l,he)|0;var Re=(s+o|0)+((u&8191)<<13)|0;s=(h+(u>>>13)|0)+(Re>>>26)|0;Re&=67108863;o=Math.imul(D,W);u=Math.imul(D,V);u=u+Math.imul(O,W)|0;h=Math.imul(O,V);o=o+Math.imul(C,J)|0;u=u+Math.imul(C,Z)|0;u=u+Math.imul(T,J)|0;h=h+Math.imul(T,Z)|0;o=o+Math.imul(N,Y)|0;u=u+Math.imul(N,$)|0;u=u+Math.imul(P,Y)|0;h=h+Math.imul(P,$)|0;o=o+Math.imul(B,ee)|0;u=u+Math.imul(B,te)|0;u=u+Math.imul(k,ee)|0;h=h+Math.imul(k,te)|0;o=o+Math.imul(w,ie)|0;u=u+Math.imul(w,ne)|0;u=u+Math.imul(M,ie)|0;h=h+Math.imul(M,ne)|0;o=o+Math.imul(y,se)|0;u=u+Math.imul(y,fe)|0;u=u+Math.imul(g,se)|0;h=h+Math.imul(g,fe)|0;o=o+Math.imul(b,ue)|0;u=u+Math.imul(b,he)|0;u=u+Math.imul(v,ue)|0;h=h+Math.imul(v,he)|0;o=o+Math.imul(c,ce)|0;u=u+Math.imul(c,le)|0;u=u+Math.imul(l,ce)|0;h=h+Math.imul(l,le)|0;var ke=(s+o|0)+((u&8191)<<13)|0;s=(h+(u>>>13)|0)+(ke>>>26)|0;ke&=67108863;o=Math.imul(L,W);u=Math.imul(L,V);u=u+Math.imul(q,W)|0;h=Math.imul(q,V);o=o+Math.imul(D,J)|0;u=u+Math.imul(D,Z)|0;u=u+Math.imul(O,J)|0;h=h+Math.imul(O,Z)|0;o=o+Math.imul(C,Y)|0;u=u+Math.imul(C,$)|0;u=u+Math.imul(T,Y)|0;h=h+Math.imul(T,$)|0;o=o+Math.imul(N,ee)|0;u=u+Math.imul(N,te)|0;u=u+Math.imul(P,ee)|0;h=h+Math.imul(P,te)|0;o=o+Math.imul(B,ie)|0;u=u+Math.imul(B,ne)|0;u=u+Math.imul(k,ie)|0;h=h+Math.imul(k,ne)|0;o=o+Math.imul(w,se)|0;u=u+Math.imul(w,fe)|0;u=u+Math.imul(M,se)|0;h=h+Math.imul(M,fe)|0;o=o+Math.imul(y,ue)|0;u=u+Math.imul(y,he)|0;u=u+Math.imul(g,ue)|0;h=h+Math.imul(g,he)|0;o=o+Math.imul(b,ce)|0;u=u+Math.imul(b,le)|0;u=u+Math.imul(v,ce)|0;h=h+Math.imul(v,le)|0;o=o+Math.imul(c,be)|0;u=u+Math.imul(c,ve)|0;u=u+Math.imul(l,be)|0;h=h+Math.imul(l,ve)|0;var Ae=(s+o|0)+((u&8191)<<13)|0;s=(h+(u>>>13)|0)+(Ae>>>26)|0;Ae&=67108863;o=Math.imul(F,W);u=Math.imul(F,V);u=u+Math.imul(U,W)|0;h=Math.imul(U,V);o=o+Math.imul(L,J)|0;u=u+Math.imul(L,Z)|0;u=u+Math.imul(q,J)|0;h=h+Math.imul(q,Z)|0;o=o+Math.imul(D,Y)|0;u=u+Math.imul(D,$)|0;u=u+Math.imul(O,Y)|0;h=h+Math.imul(O,$)|0;o=o+Math.imul(C,ee)|0;u=u+Math.imul(C,te)|0;u=u+Math.imul(T,ee)|0;h=h+Math.imul(T,te)|0;o=o+Math.imul(N,ie)|0;u=u+Math.imul(N,ne)|0;u=u+Math.imul(P,ie)|0;h=h+Math.imul(P,ne)|0;o=o+Math.imul(B,se)|0;u=u+Math.imul(B,fe)|0;u=u+Math.imul(k,se)|0;h=h+Math.imul(k,fe)|0;o=o+Math.imul(w,ue)|0;u=u+Math.imul(w,he)|0;u=u+Math.imul(M,ue)|0;h=h+Math.imul(M,he)|0;o=o+Math.imul(y,ce)|0;u=u+Math.imul(y,le)|0;u=u+Math.imul(g,ce)|0;h=h+Math.imul(g,le)|0;o=o+Math.imul(b,be)|0;u=u+Math.imul(b,ve)|0;u=u+Math.imul(v,be)|0;h=h+Math.imul(v,ve)|0;o=o+Math.imul(c,ye)|0;u=u+Math.imul(c,ge)|0;u=u+Math.imul(l,ye)|0;h=h+Math.imul(l,ge)|0;var Ne=(s+o|0)+((u&8191)<<13)|0;s=(h+(u>>>13)|0)+(Ne>>>26)|0;Ne&=67108863;o=Math.imul(F,J);u=Math.imul(F,Z);u=u+Math.imul(U,J)|0;h=Math.imul(U,Z);o=o+Math.imul(L,Y)|0;u=u+Math.imul(L,$)|0;u=u+Math.imul(q,Y)|0;h=h+Math.imul(q,$)|0;o=o+Math.imul(D,ee)|0;u=u+Math.imul(D,te)|0;u=u+Math.imul(O,ee)|0;h=h+Math.imul(O,te)|0;o=o+Math.imul(C,ie)|0;u=u+Math.imul(C,ne)|0;u=u+Math.imul(T,ie)|0;h=h+Math.imul(T,ne)|0;o=o+Math.imul(N,se)|0;u=u+Math.imul(N,fe)|0;u=u+Math.imul(P,se)|0;h=h+Math.imul(P,fe)|0;o=o+Math.imul(B,ue)|0;u=u+Math.imul(B,he)|0;u=u+Math.imul(k,ue)|0;h=h+Math.imul(k,he)|0;o=o+Math.imul(w,ce)|0;u=u+Math.imul(w,le)|0;u=u+Math.imul(M,ce)|0;h=h+Math.imul(M,le)|0;o=o+Math.imul(y,be)|0;u=u+Math.imul(y,ve)|0;u=u+Math.imul(g,be)|0;h=h+Math.imul(g,ve)|0;o=o+Math.imul(b,ye)|0;u=u+Math.imul(b,ge)|0;u=u+Math.imul(v,ye)|0;h=h+Math.imul(v,ge)|0;var Pe=(s+o|0)+((u&8191)<<13)|0;s=(h+(u>>>13)|0)+(Pe>>>26)|0;Pe&=67108863;o=Math.imul(F,Y);u=Math.imul(F,$);u=u+Math.imul(U,Y)|0;h=Math.imul(U,$);o=o+Math.imul(L,ee)|0;u=u+Math.imul(L,te)|0;u=u+Math.imul(q,ee)|0;h=h+Math.imul(q,te)|0;o=o+Math.imul(D,ie)|0;u=u+Math.imul(D,ne)|0;u=u+Math.imul(O,ie)|0;h=h+Math.imul(O,ne)|0;o=o+Math.imul(C,se)|0;u=u+Math.imul(C,fe)|0;u=u+Math.imul(T,se)|0;h=h+Math.imul(T,fe)|0;o=o+Math.imul(N,ue)|0;u=u+Math.imul(N,he)|0;u=u+Math.imul(P,ue)|0;h=h+Math.imul(P,he)|0;o=o+Math.imul(B,ce)|0;u=u+Math.imul(B,le)|0;u=u+Math.imul(k,ce)|0;h=h+Math.imul(k,le)|0;o=o+Math.imul(w,be)|0;u=u+Math.imul(w,ve)|0;u=u+Math.imul(M,be)|0;h=h+Math.imul(M,ve)|0;o=o+Math.imul(y,ye)|0;u=u+Math.imul(y,ge)|0;u=u+Math.imul(g,ye)|0;h=h+Math.imul(g,ge)|0;var xe=(s+o|0)+((u&8191)<<13)|0;s=(h+(u>>>13)|0)+(xe>>>26)|0;xe&=67108863;o=Math.imul(F,ee);u=Math.imul(F,te);u=u+Math.imul(U,ee)|0;h=Math.imul(U,te);o=o+Math.imul(L,ie)|0;u=u+Math.imul(L,ne)|0;u=u+Math.imul(q,ie)|0;h=h+Math.imul(q,ne)|0;o=o+Math.imul(D,se)|0;u=u+Math.imul(D,fe)|0;u=u+Math.imul(O,se)|0;h=h+Math.imul(O,fe)|0;o=o+Math.imul(C,ue)|0;u=u+Math.imul(C,he)|0;u=u+Math.imul(T,ue)|0;h=h+Math.imul(T,he)|0;o=o+Math.imul(N,ce)|0;u=u+Math.imul(N,le)|0;u=u+Math.imul(P,ce)|0;h=h+Math.imul(P,le)|0;o=o+Math.imul(B,be)|0;u=u+Math.imul(B,ve)|0;u=u+Math.imul(k,be)|0;h=h+Math.imul(k,ve)|0;o=o+Math.imul(w,ye)|0;u=u+Math.imul(w,ge)|0;u=u+Math.imul(M,ye)|0;h=h+Math.imul(M,ge)|0;var Ce=(s+o|0)+((u&8191)<<13)|0;s=(h+(u>>>13)|0)+(Ce>>>26)|0;Ce&=67108863;o=Math.imul(F,ie);u=Math.imul(F,ne);u=u+Math.imul(U,ie)|0;h=Math.imul(U,ne);o=o+Math.imul(L,se)|0;u=u+Math.imul(L,fe)|0;u=u+Math.imul(q,se)|0;h=h+Math.imul(q,fe)|0;o=o+Math.imul(D,ue)|0;u=u+Math.imul(D,he)|0;u=u+Math.imul(O,ue)|0;h=h+Math.imul(O,he)|0;o=o+Math.imul(C,ce)|0;u=u+Math.imul(C,le)|0;u=u+Math.imul(T,ce)|0;h=h+Math.imul(T,le)|0;o=o+Math.imul(N,be)|0;u=u+Math.imul(N,ve)|0;u=u+Math.imul(P,be)|0;h=h+Math.imul(P,ve)|0;o=o+Math.imul(B,ye)|0;u=u+Math.imul(B,ge)|0;u=u+Math.imul(k,ye)|0;h=h+Math.imul(k,ge)|0;var Te=(s+o|0)+((u&8191)<<13)|0;s=(h+(u>>>13)|0)+(Te>>>26)|0;Te&=67108863;o=Math.imul(F,se);u=Math.imul(F,fe);u=u+Math.imul(U,se)|0;h=Math.imul(U,fe);o=o+Math.imul(L,ue)|0;u=u+Math.imul(L,he)|0;u=u+Math.imul(q,ue)|0;h=h+Math.imul(q,he)|0;o=o+Math.imul(D,ce)|0;u=u+Math.imul(D,le)|0;u=u+Math.imul(O,ce)|0;h=h+Math.imul(O,le)|0;o=o+Math.imul(C,be)|0;u=u+Math.imul(C,ve)|0;u=u+Math.imul(T,be)|0;h=h+Math.imul(T,ve)|0;o=o+Math.imul(N,ye)|0;u=u+Math.imul(N,ge)|0;u=u+Math.imul(P,ye)|0;h=h+Math.imul(P,ge)|0;var Ie=(s+o|0)+((u&8191)<<13)|0;s=(h+(u>>>13)|0)+(Ie>>>26)|0;Ie&=67108863;o=Math.imul(F,ue);u=Math.imul(F,he);u=u+Math.imul(U,ue)|0;h=Math.imul(U,he);o=o+Math.imul(L,ce)|0;u=u+Math.imul(L,le)|0;u=u+Math.imul(q,ce)|0;h=h+Math.imul(q,le)|0;o=o+Math.imul(D,be)|0;u=u+Math.imul(D,ve)|0;u=u+Math.imul(O,be)|0;h=h+Math.imul(O,ve)|0;o=o+Math.imul(C,ye)|0;u=u+Math.imul(C,ge)|0;u=u+Math.imul(T,ye)|0;h=h+Math.imul(T,ge)|0;var De=(s+o|0)+((u&8191)<<13)|0;s=(h+(u>>>13)|0)+(De>>>26)|0;De&=67108863;o=Math.imul(F,ce);u=Math.imul(F,le);u=u+Math.imul(U,ce)|0;h=Math.imul(U,le);o=o+Math.imul(L,be)|0;u=u+Math.imul(L,ve)|0;u=u+Math.imul(q,be)|0;h=h+Math.imul(q,ve)|0;o=o+Math.imul(D,ye)|0;u=u+Math.imul(D,ge)|0;u=u+Math.imul(O,ye)|0;h=h+Math.imul(O,ge)|0;var Oe=(s+o|0)+((u&8191)<<13)|0;s=(h+(u>>>13)|0)+(Oe>>>26)|0;Oe&=67108863;o=Math.imul(F,be);u=Math.imul(F,ve);u=u+Math.imul(U,be)|0;h=Math.imul(U,ve);o=o+Math.imul(L,ye)|0;u=u+Math.imul(L,ge)|0;u=u+Math.imul(q,ye)|0;h=h+Math.imul(q,ge)|0;var je=(s+o|0)+((u&8191)<<13)|0;s=(h+(u>>>13)|0)+(je>>>26)|0;je&=67108863;o=Math.imul(F,ye);u=Math.imul(F,ge);u=u+Math.imul(U,ye)|0;h=Math.imul(U,ge);var Le=(s+o|0)+((u&8191)<<13)|0;s=(h+(u>>>13)|0)+(Le>>>26)|0;Le&=67108863;a[0]=_e;a[1]=we;a[2]=Me;a[3]=Se;a[4]=Ee;a[5]=Be;a[6]=Re;a[7]=ke;a[8]=Ae;a[9]=Ne;a[10]=Pe;a[11]=xe;a[12]=Ce;a[13]=Te;a[14]=Ie;a[15]=De;a[16]=Oe;a[17]=je;a[18]=Le;if(s!==0){a[19]=s;r.length++}return r};if(!Math.imul){u=smallMulTo}function bigMulTo(e,t,r){r.negative=t.negative^e.negative;r.length=e.length+t.length;var i=0;var n=0;for(var a=0;a>>26)|0;n+=s>>>26;s&=67108863}r.words[a]=o;i=s;s=n}if(i!==0){r.words[a]=i}else{r.length--}return r._strip()}function jumboMulTo(e,t,r){return bigMulTo(e,t,r)}BN.prototype.mulTo=function mulTo(e,t){var r;var i=this.length+e.length;if(this.length===10&&e.length===10){r=u(this,e,t)}else if(i<63){r=smallMulTo(this,e,t)}else if(i<1024){r=bigMulTo(this,e,t)}else{r=jumboMulTo(this,e,t)}return r};function FFTM(e,t){this.x=e;this.y=t}FFTM.prototype.makeRBT=function makeRBT(e){var t=new Array(e);var r=BN.prototype._countBits(e)-1;for(var i=0;i>=1}return i};FFTM.prototype.permute=function permute(e,t,r,i,n,a){for(var s=0;s>>1){n++}return 1<>>13;r[2*a+1]=n&8191;n=n>>>13}for(a=2*t;a>=26;r+=n/67108864|0;r+=a>>>26;this.words[i]=a&67108863}if(r!==0){this.words[i]=r;this.length++}return t?this.ineg():this};BN.prototype.muln=function muln(e){return this.clone().imuln(e)};BN.prototype.sqr=function sqr(){return this.mul(this)};BN.prototype.isqr=function isqr(){return this.imul(this.clone())};BN.prototype.pow=function pow(e){var t=toBitArray(e);if(t.length===0)return new BN(1);var r=this;for(var i=0;i=0);var t=e%26;var r=(e-t)/26;var i=67108863>>>26-t<<26-t;var n;if(t!==0){var a=0;for(n=0;n>>26-t}if(a){this.words[n]=a;this.length++}}if(r!==0){for(n=this.length-1;n>=0;n--){this.words[n+r]=this.words[n]}for(n=0;n=0);var i;if(t){i=(t-t%26)/26}else{i=0}var n=e%26;var a=Math.min((e-n)/26,this.length);var s=67108863^67108863>>>n<a){this.length-=a;for(u=0;u=0&&(h!==0||u>=i);u--){var d=this.words[u]|0;this.words[u]=h<<26-n|d>>>n;h=d&s}if(o&&h!==0){o.words[o.length++]=h}if(this.length===0){this.words[0]=0;this.length=1}return this._strip()};BN.prototype.ishrn=function ishrn(e,t,r){assert(this.negative===0);return this.iushrn(e,t,r)};BN.prototype.shln=function shln(e){return this.clone().ishln(e)};BN.prototype.ushln=function ushln(e){return this.clone().iushln(e)};BN.prototype.shrn=function shrn(e){return this.clone().ishrn(e)};BN.prototype.ushrn=function ushrn(e){return this.clone().iushrn(e)};BN.prototype.testn=function testn(e){assert(typeof e==="number"&&e>=0);var t=e%26;var r=(e-t)/26;var i=1<=0);var t=e%26;var r=(e-t)/26;assert(this.negative===0,"imaskn works only with positive numbers");if(this.length<=r){return this}if(t!==0){r++}this.length=Math.min(r,this.length);if(t!==0){var i=67108863^67108863>>>t<=67108864;t++){this.words[t]-=67108864;if(t===this.length-1){this.words[t+1]=1}else{this.words[t+1]++}}this.length=Math.max(this.length,t+1);return this};BN.prototype.isubn=function isubn(e){assert(typeof e==="number");assert(e<67108864);if(e<0)return this.iaddn(-e);if(this.negative!==0){this.negative=0;this.iaddn(e);this.negative=1;return this}this.words[0]-=e;if(this.length===1&&this.words[0]<0){this.words[0]=-this.words[0];this.negative=1}else{for(var t=0;t>26)-(o/67108864|0);this.words[n+r]=a&67108863}for(;n>26;this.words[n+r]=a&67108863}if(s===0)return this._strip();assert(s===-1);s=0;for(n=0;n>26;this.words[n]=a&67108863}this.negative=1;return this._strip()};BN.prototype._wordDiv=function _wordDiv(e,t){var r=this.length-e.length;var i=this.clone();var n=e;var a=n.words[n.length-1]|0;var s=this._countBits(a);r=26-s;if(r!==0){n=n.ushln(r);i.iushln(r);a=n.words[n.length-1]|0}var o=i.length-n.length;var u;if(t!=="mod"){u=new BN(null);u.length=o+1;u.words=new Array(u.length);for(var h=0;h=0;c--){var l=(i.words[n.length+c]|0)*67108864+(i.words[n.length+c-1]|0);l=Math.min(l/a|0,67108863);i._ishlnsubmul(n,l,c);while(i.negative!==0){l--;i.negative=0;i._ishlnsubmul(n,1,c);if(!i.isZero()){i.negative^=1}}if(u){u.words[c]=l}}if(u){u._strip()}i._strip();if(t!=="div"&&r!==0){i.iushrn(r)}return{div:u||null,mod:i}};BN.prototype.divmod=function divmod(e,t,r){assert(!e.isZero());if(this.isZero()){return{div:new BN(0),mod:new BN(0)}}var i,n,a;if(this.negative!==0&&e.negative===0){a=this.neg().divmod(e,t);if(t!=="mod"){i=a.div.neg()}if(t!=="div"){n=a.mod.neg();if(r&&n.negative!==0){n.iadd(e)}}return{div:i,mod:n}}if(this.negative===0&&e.negative!==0){a=this.divmod(e.neg(),t);if(t!=="mod"){i=a.div.neg()}return{div:i,mod:a.mod}}if((this.negative&e.negative)!==0){a=this.neg().divmod(e.neg(),t);if(t!=="div"){n=a.mod.neg();if(r&&n.negative!==0){n.isub(e)}}return{div:a.div,mod:n}}if(e.length>this.length||this.cmp(e)<0){return{div:new BN(0),mod:this}}if(e.length===1){if(t==="div"){return{div:this.divn(e.words[0]),mod:null}}if(t==="mod"){return{div:null,mod:new BN(this.modrn(e.words[0]))}}return{div:this.divn(e.words[0]),mod:new BN(this.modrn(e.words[0]))}}return this._wordDiv(e,t)};BN.prototype.div=function div(e){return this.divmod(e,"div",false).div};BN.prototype.mod=function mod(e){return this.divmod(e,"mod",false).mod};BN.prototype.umod=function umod(e){return this.divmod(e,"mod",true).mod};BN.prototype.divRound=function divRound(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var r=t.div.negative!==0?t.mod.isub(e):t.mod;var i=e.ushrn(1);var n=e.andln(1);var a=r.cmp(i);if(a<0||n===1&&a===0)return t.div;return t.div.negative!==0?t.div.isubn(1):t.div.iaddn(1)};BN.prototype.modrn=function modrn(e){var t=e<0;if(t)e=-e;assert(e<=67108863);var r=(1<<26)%e;var i=0;for(var n=this.length-1;n>=0;n--){i=(r*i+(this.words[n]|0))%e}return t?-i:i};BN.prototype.modn=function modn(e){return this.modrn(e)};BN.prototype.idivn=function idivn(e){var t=e<0;if(t)e=-e;assert(e<=67108863);var r=0;for(var i=this.length-1;i>=0;i--){var n=(this.words[i]|0)+r*67108864;this.words[i]=n/e|0;r=n%e}this._strip();return t?this.ineg():this};BN.prototype.divn=function divn(e){return this.clone().idivn(e)};BN.prototype.egcd=function egcd(e){assert(e.negative===0);assert(!e.isZero());var t=this;var r=e.clone();if(t.negative!==0){t=t.umod(e)}else{t=t.clone()}var i=new BN(1);var n=new BN(0);var a=new BN(0);var s=new BN(1);var o=0;while(t.isEven()&&r.isEven()){t.iushrn(1);r.iushrn(1);++o}var u=r.clone();var h=t.clone();while(!t.isZero()){for(var d=0,c=1;(t.words[0]&c)===0&&d<26;++d,c<<=1);if(d>0){t.iushrn(d);while(d-- >0){if(i.isOdd()||n.isOdd()){i.iadd(u);n.isub(h)}i.iushrn(1);n.iushrn(1)}}for(var l=0,p=1;(r.words[0]&p)===0&&l<26;++l,p<<=1);if(l>0){r.iushrn(l);while(l-- >0){if(a.isOdd()||s.isOdd()){a.iadd(u);s.isub(h)}a.iushrn(1);s.iushrn(1)}}if(t.cmp(r)>=0){t.isub(r);i.isub(a);n.isub(s)}else{r.isub(t);a.isub(i);s.isub(n)}}return{a:a,b:s,gcd:r.iushln(o)}};BN.prototype._invmp=function _invmp(e){assert(e.negative===0);assert(!e.isZero());var t=this;var r=e.clone();if(t.negative!==0){t=t.umod(e)}else{t=t.clone()}var i=new BN(1);var n=new BN(0);var a=r.clone();while(t.cmpn(1)>0&&r.cmpn(1)>0){for(var s=0,o=1;(t.words[0]&o)===0&&s<26;++s,o<<=1);if(s>0){t.iushrn(s);while(s-- >0){if(i.isOdd()){i.iadd(a)}i.iushrn(1)}}for(var u=0,h=1;(r.words[0]&h)===0&&u<26;++u,h<<=1);if(u>0){r.iushrn(u);while(u-- >0){if(n.isOdd()){n.iadd(a)}n.iushrn(1)}}if(t.cmp(r)>=0){t.isub(r);i.isub(n)}else{r.isub(t);n.isub(i)}}var d;if(t.cmpn(1)===0){d=i}else{d=n}if(d.cmpn(0)<0){d.iadd(e)}return d};BN.prototype.gcd=function gcd(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone();var r=e.clone();t.negative=0;r.negative=0;for(var i=0;t.isEven()&&r.isEven();i++){t.iushrn(1);r.iushrn(1)}do{while(t.isEven()){t.iushrn(1)}while(r.isEven()){r.iushrn(1)}var n=t.cmp(r);if(n<0){var a=t;t=r;r=a}else if(n===0||r.cmpn(1)===0){break}t.isub(r)}while(true);return r.iushln(i)};BN.prototype.invm=function invm(e){return this.egcd(e).a.umod(e)};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(e){return this.words[0]&e};BN.prototype.bincn=function bincn(e){assert(typeof e==="number");var t=e%26;var r=(e-t)/26;var i=1<>>26;s&=67108863;this.words[a]=s}if(n!==0){this.words[a]=n;this.length++}return this};BN.prototype.isZero=function isZero(){return this.length===1&&this.words[0]===0};BN.prototype.cmpn=function cmpn(e){var t=e<0;if(this.negative!==0&&!t)return-1;if(this.negative===0&&t)return 1;this._strip();var r;if(this.length>1){r=1}else{if(t){e=-e}assert(e<=67108863,"Number is too big");var i=this.words[0]|0;r=i===e?0:ie.length)return 1;if(this.length=0;r--){var i=this.words[r]|0;var n=e.words[r]|0;if(i===n)continue;if(in){t=1}break}return t};BN.prototype.gtn=function gtn(e){return this.cmpn(e)===1};BN.prototype.gt=function gt(e){return this.cmp(e)===1};BN.prototype.gten=function gten(e){return this.cmpn(e)>=0};BN.prototype.gte=function gte(e){return this.cmp(e)>=0};BN.prototype.ltn=function ltn(e){return this.cmpn(e)===-1};BN.prototype.lt=function lt(e){return this.cmp(e)===-1};BN.prototype.lten=function lten(e){return this.cmpn(e)<=0};BN.prototype.lte=function lte(e){return this.cmp(e)<=0};BN.prototype.eqn=function eqn(e){return this.cmpn(e)===0};BN.prototype.eq=function eq(e){return this.cmp(e)===0};BN.red=function red(e){return new Red(e)};BN.prototype.toRed=function toRed(e){assert(!this.red,"Already a number in reduction context");assert(this.negative===0,"red works only with positives");return e.convertTo(this)._forceRed(e)};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(e){this.red=e;return this};BN.prototype.forceRed=function forceRed(e){assert(!this.red,"Already a number in reduction context");return this._forceRed(e)};BN.prototype.redAdd=function redAdd(e){assert(this.red,"redAdd works only with red numbers");return this.red.add(this,e)};BN.prototype.redIAdd=function redIAdd(e){assert(this.red,"redIAdd works only with red numbers");return this.red.iadd(this,e)};BN.prototype.redSub=function redSub(e){assert(this.red,"redSub works only with red numbers");return this.red.sub(this,e)};BN.prototype.redISub=function redISub(e){assert(this.red,"redISub works only with red numbers");return this.red.isub(this,e)};BN.prototype.redShl=function redShl(e){assert(this.red,"redShl works only with red numbers");return this.red.shl(this,e)};BN.prototype.redMul=function redMul(e){assert(this.red,"redMul works only with red numbers");this.red._verify2(this,e);return this.red.mul(this,e)};BN.prototype.redIMul=function redIMul(e){assert(this.red,"redMul works only with red numbers");this.red._verify2(this,e);return this.red.imul(this,e)};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(e){assert(this.red&&!e.red,"redPow(normalNum)");this.red._verify1(this);return this.red.pow(this,e)};var h={k256:null,p224:null,p192:null,p25519:null};function MPrime(e,t){this.name=e;this.p=new BN(t,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 e=new BN(null);e.words=new Array(Math.ceil(this.n/13));return e};MPrime.prototype.ireduce=function ireduce(e){var t=e;var r;do{this.split(t,this.tmp);t=this.imulK(t);t=t.iadd(this.tmp);r=t.bitLength()}while(r>this.n);var i=r0){t.isub(this.p)}else{if(t.strip!==undefined){t.strip()}else{t._strip()}}return t};MPrime.prototype.split=function split(e,t){e.iushrn(this.n,0,t)};MPrime.prototype.imulK=function imulK(e){return e.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(e,t){var r=4194303;var i=Math.min(e.length,9);for(var n=0;n>>22;a=s}a>>>=22;e.words[n-10]=a;if(a===0&&e.length>10){e.length-=10}else{e.length-=9}};K256.prototype.imulK=function imulK(e){e.words[e.length]=0;e.words[e.length+1]=0;e.length+=2;var t=0;for(var r=0;r>>=26;e.words[r]=n;t=i}if(t!==0){e.words[e.length++]=t}return e};BN._prime=function prime(e){if(h[e])return h[e];var prime;if(e==="k256"){prime=new K256}else if(e==="p224"){prime=new P224}else if(e==="p192"){prime=new P192}else if(e==="p25519"){prime=new P25519}else{throw new Error("Unknown prime "+e)}h[e]=prime;return prime};function Red(e){if(typeof e==="string"){var t=BN._prime(e);this.m=t.p;this.prime=t}else{assert(e.gtn(1),"modulus must be greater than 1");this.m=e;this.prime=null}}Red.prototype._verify1=function _verify1(e){assert(e.negative===0,"red works only with positives");assert(e.red,"red works only with red numbers")};Red.prototype._verify2=function _verify2(e,t){assert((e.negative|t.negative)===0,"red works only with positives");assert(e.red&&e.red===t.red,"red works only with red numbers")};Red.prototype.imod=function imod(e){if(this.prime)return this.prime.ireduce(e)._forceRed(this);move(e,e.umod(this.m)._forceRed(this));return e};Red.prototype.neg=function neg(e){if(e.isZero()){return e.clone()}return this.m.sub(e)._forceRed(this)};Red.prototype.add=function add(e,t){this._verify2(e,t);var r=e.add(t);if(r.cmp(this.m)>=0){r.isub(this.m)}return r._forceRed(this)};Red.prototype.iadd=function iadd(e,t){this._verify2(e,t);var r=e.iadd(t);if(r.cmp(this.m)>=0){r.isub(this.m)}return r};Red.prototype.sub=function sub(e,t){this._verify2(e,t);var r=e.sub(t);if(r.cmpn(0)<0){r.iadd(this.m)}return r._forceRed(this)};Red.prototype.isub=function isub(e,t){this._verify2(e,t);var r=e.isub(t);if(r.cmpn(0)<0){r.iadd(this.m)}return r};Red.prototype.shl=function shl(e,t){this._verify1(e);return this.imod(e.ushln(t))};Red.prototype.imul=function imul(e,t){this._verify2(e,t);return this.imod(e.imul(t))};Red.prototype.mul=function mul(e,t){this._verify2(e,t);return this.imod(e.mul(t))};Red.prototype.isqr=function isqr(e){return this.imul(e,e.clone())};Red.prototype.sqr=function sqr(e){return this.mul(e,e)};Red.prototype.sqrt=function sqrt(e){if(e.isZero())return e.clone();var t=this.m.andln(3);assert(t%2===1);if(t===3){var r=this.m.add(new BN(1)).iushrn(2);return this.pow(e,r)}var i=this.m.subn(1);var n=0;while(!i.isZero()&&i.andln(1)===0){n++;i.iushrn(1)}assert(!i.isZero());var a=new BN(1).toRed(this);var s=a.redNeg();var o=this.m.subn(1).iushrn(1);var u=this.m.bitLength();u=new BN(2*u*u).toRed(this);while(this.pow(u,o).cmp(s)!==0){u.redIAdd(s)}var h=this.pow(u,i);var d=this.pow(e,i.addn(1).iushrn(1));var c=this.pow(e,i);var l=n;while(c.cmp(a)!==0){var p=c;for(var b=0;p.cmp(a)!==0;b++){p=p.redSqr()}assert(b=0;n--){var h=t.words[n];for(var d=u-1;d>=0;d--){var c=h>>d&1;if(a!==i[0]){a=this.sqr(a)}if(c===0&&s===0){o=0;continue}s<<=1;s|=c;o++;if(o!==r&&(n!==0||d!==0))continue;a=this.mul(a,i[s]);o=0;s=0}u=26}return a};Red.prototype.convertTo=function convertTo(e){var t=e.umod(this.m);return t===e?t.clone():t};Red.prototype.convertFrom=function convertFrom(e){var t=e.clone();t.red=null;return t};BN.mont=function mont(e){return new Mont(e)};function Mont(e){Red.call(this,e);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(e){return this.imod(e.ushln(this.shift))};Mont.prototype.convertFrom=function convertFrom(e){var t=this.imod(e.mul(this.rinv));t.red=null;return t};Mont.prototype.imul=function imul(e,t){if(e.isZero()||t.isZero()){e.words[0]=0;e.length=1;return e}var r=e.imul(t);var i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m);var n=r.isub(i).iushrn(this.shift);var a=n;if(n.cmp(this.m)>=0){a=n.isub(this.m)}else if(n.cmpn(0)<0){a=n.iadd(this.m)}return a._forceRed(this)};Mont.prototype.mul=function mul(e,t){if(e.isZero()||t.isZero())return new BN(0)._forceRed(this);var r=e.mul(t);var i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m);var n=r.isub(i).iushrn(this.shift);var a=n;if(n.cmp(this.m)>=0){a=n.isub(this.m)}else if(n.cmpn(0)<0){a=n.iadd(this.m)}return a._forceRed(this)};Mont.prototype.invm=function invm(e){var t=this.imod(e._invmp(this.m).mul(this.r2));return t._forceRed(this)}})(false||e,this)},42:function(e){"use strict";const t={};function createErrorType(e,r,i){if(!i){i=Error}function getMessage(e,t,i){if(typeof r==="string"){return r}else{return r(e,t,i)}}class NodeError extends i{constructor(e,t,r){super(getMessage(e,t,r))}}NodeError.prototype.name=i.name;NodeError.prototype.code=e;t[e]=NodeError}function oneOf(e,t){if(Array.isArray(e)){const r=e.length;e=e.map((e=>String(e)));if(r>2){return`one of ${t} ${e.slice(0,r-1).join(", ")}, or `+e[r-1]}else if(r===2){return`one of ${t} ${e[0]} or ${e[1]}`}else{return`of ${t} ${e[0]}`}}else{return`of ${t} ${String(e)}`}}function startsWith(e,t,r){return e.substr(!r||r<0?0:+r,t.length)===t}function endsWith(e,t,r){if(r===undefined||r>e.length){r=e.length}return e.substring(r-t.length,r)===t}function includes(e,t,r){if(typeof r!=="number"){r=0}if(r+t.length>e.length){return false}else{return e.indexOf(t,r)!==-1}}createErrorType("ERR_INVALID_OPT_VALUE",(function(e,t){return'The value "'+t+'" is invalid for option "'+e+'"'}),TypeError);createErrorType("ERR_INVALID_ARG_TYPE",(function(e,t,r){let i;if(typeof t==="string"&&startsWith(t,"not ")){i="must not be";t=t.replace(/^not /,"")}else{i="must be"}let n;if(endsWith(e," argument")){n=`The ${e} ${i} ${oneOf(t,"type")}`}else{const r=includes(e,".")?"property":"argument";n=`The "${e}" ${r} ${i} ${oneOf(t,"type")}`}n+=`. Received type ${typeof r}`;return n}),TypeError);createErrorType("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF");createErrorType("ERR_METHOD_NOT_IMPLEMENTED",(function(e){return"The "+e+" method is not implemented"}));createErrorType("ERR_STREAM_PREMATURE_CLOSE","Premature close");createErrorType("ERR_STREAM_DESTROYED",(function(e){return"Cannot call "+e+" after a stream was destroyed"}));createErrorType("ERR_MULTIPLE_CALLBACK","Callback called multiple times");createErrorType("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable");createErrorType("ERR_STREAM_WRITE_AFTER_END","write after end");createErrorType("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError);createErrorType("ERR_UNKNOWN_ENCODING",(function(e){return"Unknown encoding: "+e}),TypeError);createErrorType("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event");e.exports.q=t},6744:function(e,t,r){"use strict";var i=Object.keys||function(e){var t=[];for(var r in e){t.push(r)}return t};e.exports=Duplex;var n=r(8318);var a=r(3877);r(7526)(Duplex,n);{var s=i(a.prototype);for(var o=0;o0){if(typeof t!=="string"&&!a.objectMode&&Object.getPrototypeOf(t)!==o.prototype){t=_uint8ArrayToBuffer(t)}if(i){if(a.endEmitted)B(e,new _);else addChunk(e,a,t,true)}else if(a.ended){B(e,new y)}else if(a.destroyed){return false}else{a.reading=false;if(a.decoder&&!r){t=a.decoder.write(t);if(a.objectMode||t.length!==0)addChunk(e,a,t,false);else maybeReadMore(e,a)}else{addChunk(e,a,t,false)}}}else if(!i){a.reading=false;maybeReadMore(e,a)}}return!a.ended&&(a.length=A){e=A}else{e--;e|=e>>>1;e|=e>>>2;e|=e>>>4;e|=e>>>8;e|=e>>>16;e++}return e}function howMuchToRead(e,t){if(e<=0||t.length===0&&t.ended)return 0;if(t.objectMode)return 1;if(e!==e){if(t.flowing&&t.length)return t.buffer.head.data.length;else return t.length}if(e>t.highWaterMark)t.highWaterMark=computeNewHighWaterMark(e);if(e<=t.length)return e;if(!t.ended){t.needReadable=true;return 0}return t.length}Readable.prototype.read=function(e){d("read",e);e=parseInt(e,10);var t=this._readableState;var r=e;if(e!==0)t.emittedReadable=false;if(e===0&&t.needReadable&&((t.highWaterMark!==0?t.length>=t.highWaterMark:t.length>0)||t.ended)){d("read: emitReadable",t.length,t.ended);if(t.length===0&&t.ended)endReadable(this);else emitReadable(this);return null}e=howMuchToRead(e,t);if(e===0&&t.ended){if(t.length===0)endReadable(this);return null}var i=t.needReadable;d("need readable",i);if(t.length===0||t.length-e0)n=fromList(e,t);else n=null;if(n===null){t.needReadable=t.length<=t.highWaterMark;e=0}else{t.length-=e;t.awaitDrain=0}if(t.length===0){if(!t.ended)t.needReadable=true;if(r!==e&&t.ended)endReadable(this)}if(n!==null)this.emit("data",n);return n};function onEofChunk(e,t){d("onEofChunk");if(t.ended)return;if(t.decoder){var r=t.decoder.end();if(r&&r.length){t.buffer.push(r);t.length+=t.objectMode?1:r.length}}t.ended=true;if(t.sync){emitReadable(e)}else{t.needReadable=false;if(!t.emittedReadable){t.emittedReadable=true;emitReadable_(e)}}}function emitReadable(e){var t=e._readableState;d("emitReadable",t.needReadable,t.emittedReadable);t.needReadable=false;if(!t.emittedReadable){d("emitReadable",t.flowing);t.emittedReadable=true;process.nextTick(emitReadable_,e)}}function emitReadable_(e){var t=e._readableState;d("emitReadable_",t.destroyed,t.length,t.ended);if(!t.destroyed&&(t.length||t.ended)){e.emit("readable");t.emittedReadable=false}t.needReadable=!t.flowing&&!t.ended&&t.length<=t.highWaterMark;flow(e)}function maybeReadMore(e,t){if(!t.readingMore){t.readingMore=true;process.nextTick(maybeReadMore_,e,t)}}function maybeReadMore_(e,t){while(!t.reading&&!t.ended&&(t.length1&&indexOf(i.pipes,e)!==-1)&&!u){d("false write response, pause",i.awaitDrain);i.awaitDrain++}r.pause()}}function onerror(t){d("onerror",t);unpipe();e.removeListener("error",onerror);if(a(e,"error")===0)B(e,t)}prependListener(e,"error",onerror);function onclose(){e.removeListener("finish",onfinish);unpipe()}e.once("close",onclose);function onfinish(){d("onfinish");e.removeListener("close",onclose);unpipe()}e.once("finish",onfinish);function unpipe(){d("unpipe");r.unpipe(e)}e.emit("pipe",r);if(!i.flowing){d("pipe resume");r.resume()}return e};function pipeOnDrain(e){return function pipeOnDrainFunctionResult(){var t=e._readableState;d("pipeOnDrain",t.awaitDrain);if(t.awaitDrain)t.awaitDrain--;if(t.awaitDrain===0&&a(e,"data")){t.flowing=true;flow(e)}}}Readable.prototype.unpipe=function(e){var t=this._readableState;var r={hasUnpiped:false};if(t.pipesCount===0)return this;if(t.pipesCount===1){if(e&&e!==t.pipes)return this;if(!e)e=t.pipes;t.pipes=null;t.pipesCount=0;t.flowing=false;if(e)e.emit("unpipe",this,r);return this}if(!e){var i=t.pipes;var n=t.pipesCount;t.pipes=null;t.pipesCount=0;t.flowing=false;for(var a=0;a0;if(i.flowing!==false)this.resume()}else if(e==="readable"){if(!i.endEmitted&&!i.readableListening){i.readableListening=i.needReadable=true;i.flowing=false;i.emittedReadable=false;d("on readable",i.length,i.reading);if(i.length){emitReadable(this)}else if(!i.reading){process.nextTick(nReadingNextTick,this)}}}return r};Readable.prototype.addListener=Readable.prototype.on;Readable.prototype.removeListener=function(e,t){var r=s.prototype.removeListener.call(this,e,t);if(e==="readable"){process.nextTick(updateReadableListening,this)}return r};Readable.prototype.removeAllListeners=function(e){var t=s.prototype.removeAllListeners.apply(this,arguments);if(e==="readable"||e===undefined){process.nextTick(updateReadableListening,this)}return t};function updateReadableListening(e){var t=e._readableState;t.readableListening=e.listenerCount("readable")>0;if(t.resumeScheduled&&!t.paused){t.flowing=true}else if(e.listenerCount("data")>0){e.resume()}}function nReadingNextTick(e){d("readable nexttick read 0");e.read(0)}Readable.prototype.resume=function(){var e=this._readableState;if(!e.flowing){d("resume");e.flowing=!e.readableListening;resume(this,e)}e.paused=false;return this};function resume(e,t){if(!t.resumeScheduled){t.resumeScheduled=true;process.nextTick(resume_,e,t)}}function resume_(e,t){d("resume",t.reading);if(!t.reading){e.read(0)}t.resumeScheduled=false;e.emit("resume");flow(e);if(t.flowing&&!t.reading)e.read(0)}Readable.prototype.pause=function(){d("call pause flowing=%j",this._readableState.flowing);if(this._readableState.flowing!==false){d("pause");this._readableState.flowing=false;this.emit("pause")}this._readableState.paused=true;return this};function flow(e){var t=e._readableState;d("flow",t.flowing);while(t.flowing&&e.read()!==null){}}Readable.prototype.wrap=function(e){var t=this;var r=this._readableState;var i=false;e.on("end",(function(){d("wrapped end");if(r.decoder&&!r.ended){var e=r.decoder.end();if(e&&e.length)t.push(e)}t.push(null)}));e.on("data",(function(n){d("wrapped data");if(r.decoder)n=r.decoder.write(n);if(r.objectMode&&(n===null||n===undefined))return;else if(!r.objectMode&&(!n||!n.length))return;var a=t.push(n);if(!a){i=true;e.pause()}}));for(var n in e){if(this[n]===undefined&&typeof e[n]==="function"){this[n]=function methodWrap(t){return function methodWrapReturnFunction(){return e[t].apply(e,arguments)}}(n)}}for(var a=0;a=t.length){if(t.decoder)r=t.buffer.join("");else if(t.buffer.length===1)r=t.buffer.first();else r=t.buffer.concat(t.length);t.buffer.clear()}else{r=t.buffer.consume(e,t.decoder)}return r}function endReadable(e){var t=e._readableState;d("endReadable",t.endEmitted);if(!t.endEmitted){t.ended=true;process.nextTick(endReadableNT,t,e)}}function endReadableNT(e,t){d("endReadableNT",e.endEmitted,e.length);if(!e.endEmitted&&e.length===0){e.endEmitted=true;t.readable=false;t.emit("end");if(e.autoDestroy){var r=t._writableState;if(!r||r.autoDestroy&&r.finished){t.destroy()}}}}if(typeof Symbol==="function"){Readable.from=function(e,t){if(E===undefined){E=r(6171)}return E(Readable,e,t)}}function indexOf(e,t){for(var r=0,i=e.length;r-1))throw new _(e);this._writableState.defaultEncoding=e;return this};Object.defineProperty(Writable.prototype,"writableBuffer",{enumerable:false,get:function get(){return this._writableState&&this._writableState.getBuffer()}});function decodeChunk(e,t,r){if(!e.objectMode&&e.decodeStrings!==false&&typeof t==="string"){t=s.from(t,r)}return t}Object.defineProperty(Writable.prototype,"writableHighWaterMark",{enumerable:false,get:function get(){return this._writableState.highWaterMark}});function writeOrBuffer(e,t,r,i,n,a){if(!r){var s=decodeChunk(t,i,n);if(i!==s){r=true;n="buffer";i=s}}var o=t.objectMode?1:i.length;t.length+=o;var u=t.length0)this.tail.next=t;else this.head=t;this.tail=t;++this.length}},{key:"unshift",value:function unshift(e){var t={data:e,next:this.head};if(this.length===0)this.tail=t;this.head=t;++this.length}},{key:"shift",value:function shift(){if(this.length===0)return;var e=this.head.data;if(this.length===1)this.head=this.tail=null;else this.head=this.head.next;--this.length;return e}},{key:"clear",value:function clear(){this.head=this.tail=null;this.length=0}},{key:"join",value:function join(e){if(this.length===0)return"";var t=this.head;var r=""+t.data;while(t=t.next){r+=e+t.data}return r}},{key:"concat",value:function concat(e){if(this.length===0)return n.alloc(0);var t=n.allocUnsafe(e>>>0);var r=this.head;var i=0;while(r){copyBuffer(r.data,t,i);i+=r.data.length;r=r.next}return t}},{key:"consume",value:function consume(e,t){var r;if(en.length?n.length:e;if(a===n.length)i+=n;else i+=n.slice(0,e);e-=a;if(e===0){if(a===n.length){++r;if(t.next)this.head=t.next;else this.head=this.tail=null}else{this.head=t;t.data=n.slice(a)}break}++r}this.length-=r;return i}},{key:"_getBuffer",value:function _getBuffer(e){var t=n.allocUnsafe(e);var r=this.head;var i=1;r.data.copy(t);e-=r.data.length;while(r=r.next){var a=r.data;var s=e>a.length?a.length:e;a.copy(t,t.length-e,0,s);e-=s;if(e===0){if(s===a.length){++i;if(r.next)this.head=r.next;else this.head=this.tail=null}else{this.head=r;r.data=a.slice(s)}break}++i}this.length-=i;return t}},{key:o,value:function value(e,t){return s(this,_objectSpread({},t,{depth:0,customInspect:false}))}}]);return BufferList}()},9666:function(e){"use strict";function destroy(e,t){var r=this;var i=this._readableState&&this._readableState.destroyed;var n=this._writableState&&this._writableState.destroyed;if(i||n){if(t){t(e)}else if(e){if(!this._writableState){process.nextTick(emitErrorNT,this,e)}else if(!this._writableState.errorEmitted){this._writableState.errorEmitted=true;process.nextTick(emitErrorNT,this,e)}}return this}if(this._readableState){this._readableState.destroyed=true}if(this._writableState){this._writableState.destroyed=true}this._destroy(e||null,(function(e){if(!t&&e){if(!r._writableState){process.nextTick(emitErrorAndCloseNT,r,e)}else if(!r._writableState.errorEmitted){r._writableState.errorEmitted=true;process.nextTick(emitErrorAndCloseNT,r,e)}else{process.nextTick(emitCloseNT,r)}}else if(t){process.nextTick(emitCloseNT,r);t(e)}else{process.nextTick(emitCloseNT,r)}}));return this}function emitErrorAndCloseNT(e,t){emitErrorNT(e,t);emitCloseNT(e)}function emitCloseNT(e){if(e._writableState&&!e._writableState.emitClose)return;if(e._readableState&&!e._readableState.emitClose)return;e.emit("close")}function undestroy(){if(this._readableState){this._readableState.destroyed=false;this._readableState.reading=false;this._readableState.ended=false;this._readableState.endEmitted=false}if(this._writableState){this._writableState.destroyed=false;this._writableState.ended=false;this._writableState.ending=false;this._writableState.finalCalled=false;this._writableState.prefinished=false;this._writableState.finished=false;this._writableState.errorEmitted=false}}function emitErrorNT(e,t){e.emit("error",t)}function errorOrDestroy(e,t){var r=e._readableState;var i=e._writableState;if(r&&r.autoDestroy||i&&i.autoDestroy)e.destroy(t);else e.emit("error",t)}e.exports={destroy:destroy,undestroy:undestroy,errorOrDestroy:errorOrDestroy}},1785:function(e,t,r){"use strict";var i=r(42).q.ERR_STREAM_PREMATURE_CLOSE;function once(e){var t=false;return function(){if(t)return;t=true;for(var r=arguments.length,i=new Array(r),n=0;n0;return destroyer(e,a,o,(function(e){if(!n)n=e;if(e)s.forEach(call);if(a)return;s.forEach(call);i(n)}))}));return t.reduce(pipe)}e.exports=pipeline},894:function(e,t,r){"use strict";var i=r(42).q.ERR_INVALID_OPT_VALUE;function highWaterMarkFrom(e,t,r){return e.highWaterMark!=null?e.highWaterMark:t?e[r]:null}function getHighWaterMark(e,t,r,n){var a=highWaterMarkFrom(t,n,r);if(a!=null){if(!(isFinite(a)&&Math.floor(a)===a)||a<0){var s=n?r:"highWaterMark";throw new i(s,a)}return Math.floor(a)}return e.objectMode?16:16*1024}e.exports={getHighWaterMark:getHighWaterMark}},1727:function(e,t,r){e.exports=r(2781)},6572:function(e,t,r){var i=r(2781);if(process.env.READABLE_STREAM==="disable"&&i){e.exports=i.Readable;Object.assign(e.exports,i);e.exports.Stream=i}else{t=e.exports=r(8318);t.Stream=i||t;t.Readable=t;t.Writable=r(3877);t.Duplex=r(6744);t.Transform=r(9482);t.PassThrough=r(6609);t.finished=r(1785);t.pipeline=r(7612)}},5673:function(e,t,r){"use strict";var i=r(3118).Buffer;var n=i.isEncoding||function(e){e=""+e;switch(e&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return true;default:return false}};function _normalizeEncoding(e){if(!e)return"utf8";var t;while(true){switch(e){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return e;default:if(t)return;e=(""+e).toLowerCase();t=true}}}function normalizeEncoding(e){var t=_normalizeEncoding(e);if(typeof t!=="string"&&(i.isEncoding===n||!n(e)))throw new Error("Unknown encoding: "+e);return t||e}t.s=StringDecoder;function StringDecoder(e){this.encoding=normalizeEncoding(e);var t;switch(this.encoding){case"utf16le":this.text=utf16Text;this.end=utf16End;t=4;break;case"utf8":this.fillLast=utf8FillLast;t=4;break;case"base64":this.text=base64Text;this.end=base64End;t=3;break;default:this.write=simpleWrite;this.end=simpleEnd;return}this.lastNeed=0;this.lastTotal=0;this.lastChar=i.allocUnsafe(t)}StringDecoder.prototype.write=function(e){if(e.length===0)return"";var t;var r;if(this.lastNeed){t=this.fillLast(e);if(t===undefined)return"";r=this.lastNeed;this.lastNeed=0}else{r=0}if(r>5===6)return 2;else if(e>>4===14)return 3;else if(e>>3===30)return 4;return e>>6===2?-1:-2}function utf8CheckIncomplete(e,t,r){var i=t.length-1;if(i=0){if(n>0)e.lastNeed=n-1;return n}if(--i=0){if(n>0)e.lastNeed=n-2;return n}if(--i=0){if(n>0){if(n===2)n=0;else e.lastNeed=n-3}return n}return 0}function utf8CheckExtraBytes(e,t,r){if((t[0]&192)!==128){e.lastNeed=0;return"�"}if(e.lastNeed>1&&t.length>1){if((t[1]&192)!==128){e.lastNeed=1;return"�"}if(e.lastNeed>2&&t.length>2){if((t[2]&192)!==128){e.lastNeed=2;return"�"}}}}function utf8FillLast(e){var t=this.lastTotal-this.lastNeed;var r=utf8CheckExtraBytes(this,e,t);if(r!==undefined)return r;if(this.lastNeed<=e.length){e.copy(this.lastChar,t,0,this.lastNeed);return this.lastChar.toString(this.encoding,0,this.lastTotal)}e.copy(this.lastChar,t,0,e.length);this.lastNeed-=e.length}function utf8Text(e,t){var r=utf8CheckIncomplete(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=r;var i=e.length-(r-this.lastNeed);e.copy(this.lastChar,0,i);return e.toString("utf8",t,i)}function utf8End(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed)return t+"�";return t}function utf16Text(e,t){if((e.length-t)%2===0){var r=e.toString("utf16le",t);if(r){var i=r.charCodeAt(r.length-1);if(i>=55296&&i<=56319){this.lastNeed=2;this.lastTotal=4;this.lastChar[0]=e[e.length-2];this.lastChar[1]=e[e.length-1];return r.slice(0,-1)}}return r}this.lastNeed=1;this.lastTotal=2;this.lastChar[0]=e[e.length-1];return e.toString("utf16le",t,e.length-1)}function utf16End(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,r)}return t}function base64Text(e,t){var r=(e.length-t)%3;if(r===0)return e.toString("base64",t);this.lastNeed=3-r;this.lastTotal=3;if(r===1){this.lastChar[0]=e[e.length-1]}else{this.lastChar[0]=e[e.length-2];this.lastChar[1]=e[e.length-1]}return e.toString("base64",t,e.length-r)}function base64End(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed)return t+this.lastChar.toString("base64",0,3-this.lastNeed);return t}function simpleWrite(e){return e.toString(this.encoding)}function simpleEnd(e){return e&&e.length?this.write(e):""}},5653:function(e){e.exports=function xor(e,t){var r=Math.min(e.length,t.length);var i=new Buffer(r);for(var n=0;nr){var i=e==="rmd160"?new u:h(e);t=i.update(t).digest()}else if(t.lengtho){t=e(t)}else if(t.length0;i--){t+=this._buffer(e,t);r+=this._flushBuffer(n,r)}t+=this._buffer(e,t);return n};Cipher.prototype.final=function final(e){var t;if(e)t=this.update(e);var r;if(this.type==="encrypt")r=this._finalEncrypt();else r=this._finalDecrypt();if(t)return t.concat(r);else return r};Cipher.prototype._pad=function _pad(e,t){if(t===0)return false;while(t>>1];r=a.r28shl(r,u);n=a.r28shl(n,u);a.pc2(r,n,e.keys,s)}};DES.prototype._update=function _update(e,t,r,i){var n=this._desState;var s=a.readUInt32BE(e,t);var o=a.readUInt32BE(e,t+4);a.ip(s,o,n.tmp,0);s=n.tmp[0];o=n.tmp[1];if(this.type==="encrypt")this._encrypt(n,s,o,n.tmp,0);else this._decrypt(n,s,o,n.tmp,0);s=n.tmp[0];o=n.tmp[1];a.writeUInt32BE(r,s,i);a.writeUInt32BE(r,o,i+4)};DES.prototype._pad=function _pad(e,t){var r=e.length-t;for(var i=t;i>>0;s=p}a.rip(o,s,i,n)};DES.prototype._decrypt=function _decrypt(e,t,r,i,n){var s=r;var o=t;for(var u=e.keys.length-2;u>=0;u-=2){var h=e.keys[u];var d=e.keys[u+1];a.expand(s,e.tmp,0);h^=e.tmp[0];d^=e.tmp[1];var c=a.substitute(h,d);var l=a.permute(c);var p=s;s=(o^l)>>>0;o=p}a.rip(s,o,i,n)}},2635:function(e,t,r){"use strict";var i=r(9036);var n=r(7526);var a=r(1020);var s=r(9670);function EDEState(e,t){i.equal(t.length,24,"Invalid key length");var r=t.slice(0,8);var n=t.slice(8,16);var a=t.slice(16,24);if(e==="encrypt"){this.ciphers=[s.create({type:"encrypt",key:r}),s.create({type:"decrypt",key:n}),s.create({type:"encrypt",key:a})]}else{this.ciphers=[s.create({type:"decrypt",key:a}),s.create({type:"encrypt",key:n}),s.create({type:"decrypt",key:r})]}}function EDE(e){a.call(this,e);var t=new EDEState(this.type,this.options.key);this._edeState=t}n(EDE,a);e.exports=EDE;EDE.create=function create(e){return new EDE(e)};EDE.prototype._update=function _update(e,t,r,i){var n=this._edeState;n.ciphers[0]._update(e,t,r,i);n.ciphers[1]._update(r,i,r,i);n.ciphers[2]._update(r,i,r,i)};EDE.prototype._pad=s.prototype._pad;EDE.prototype._unpad=s.prototype._unpad},6843:function(e,t){"use strict";t.readUInt32BE=function readUInt32BE(e,t){var r=e[0+t]<<24|e[1+t]<<16|e[2+t]<<8|e[3+t];return r>>>0};t.writeUInt32BE=function writeUInt32BE(e,t,r){e[0+r]=t>>>24;e[1+r]=t>>>16&255;e[2+r]=t>>>8&255;e[3+r]=t&255};t.ip=function ip(e,t,r,i){var n=0;var a=0;for(var s=6;s>=0;s-=2){for(var o=0;o<=24;o+=8){n<<=1;n|=t>>>o+s&1}for(var o=0;o<=24;o+=8){n<<=1;n|=e>>>o+s&1}}for(var s=6;s>=0;s-=2){for(var o=1;o<=25;o+=8){a<<=1;a|=t>>>o+s&1}for(var o=1;o<=25;o+=8){a<<=1;a|=e>>>o+s&1}}r[i+0]=n>>>0;r[i+1]=a>>>0};t.rip=function rip(e,t,r,i){var n=0;var a=0;for(var s=0;s<4;s++){for(var o=24;o>=0;o-=8){n<<=1;n|=t>>>o+s&1;n<<=1;n|=e>>>o+s&1}}for(var s=4;s<8;s++){for(var o=24;o>=0;o-=8){a<<=1;a|=t>>>o+s&1;a<<=1;a|=e>>>o+s&1}}r[i+0]=n>>>0;r[i+1]=a>>>0};t.pc1=function pc1(e,t,r,i){var n=0;var a=0;for(var s=7;s>=5;s--){for(var o=0;o<=24;o+=8){n<<=1;n|=t>>o+s&1}for(var o=0;o<=24;o+=8){n<<=1;n|=e>>o+s&1}}for(var o=0;o<=24;o+=8){n<<=1;n|=t>>o+s&1}for(var s=1;s<=3;s++){for(var o=0;o<=24;o+=8){a<<=1;a|=t>>o+s&1}for(var o=0;o<=24;o+=8){a<<=1;a|=e>>o+s&1}}for(var o=0;o<=24;o+=8){a<<=1;a|=e>>o+s&1}r[i+0]=n>>>0;r[i+1]=a>>>0};t.r28shl=function r28shl(e,t){return e<>>28-t};var r=[14,11,17,4,27,23,25,0,13,22,7,18,5,9,16,24,2,20,12,21,1,8,15,26,15,4,25,19,9,1,26,16,5,11,23,8,12,7,17,0,22,3,10,14,6,20,27,24];t.pc2=function pc2(e,t,i,n){var a=0;var s=0;var o=r.length>>>1;for(var u=0;u>>r[u]&1}for(var u=o;u>>r[u]&1}i[n+0]=a>>>0;i[n+1]=s>>>0};t.expand=function expand(e,t,r){var i=0;var n=0;i=(e&1)<<5|e>>>27;for(var a=23;a>=15;a-=4){i<<=6;i|=e>>>a&63}for(var a=11;a>=3;a-=4){n|=e>>>a&63;n<<=6}n|=(e&31)<<1|e>>>31;t[r+0]=i>>>0;t[r+1]=n>>>0};var i=[14,0,4,15,13,7,1,4,2,14,15,2,11,13,8,1,3,10,10,6,6,12,12,11,5,9,9,5,0,3,7,8,4,15,1,12,14,8,8,2,13,4,6,9,2,1,11,7,15,5,12,11,9,3,7,14,3,10,10,0,5,6,0,13,15,3,1,13,8,4,14,7,6,15,11,2,3,8,4,14,9,12,7,0,2,1,13,10,12,6,0,9,5,11,10,5,0,13,14,8,7,10,11,1,10,3,4,15,13,4,1,2,5,11,8,6,12,7,6,12,9,0,3,5,2,14,15,9,10,13,0,7,9,0,14,9,6,3,3,4,15,6,5,10,1,2,13,8,12,5,7,14,11,12,4,11,2,15,8,1,13,1,6,10,4,13,9,0,8,6,15,9,3,8,0,7,11,4,1,15,2,14,12,3,5,11,10,5,14,2,7,12,7,13,13,8,14,11,3,5,0,6,6,15,9,0,10,3,1,4,2,7,8,2,5,12,11,1,12,10,4,14,15,9,10,3,6,15,9,0,0,6,12,10,11,1,7,13,13,8,15,9,1,4,3,5,14,11,5,12,2,7,8,2,4,14,2,14,12,11,4,2,1,12,7,4,10,7,11,13,6,1,8,5,5,0,3,15,15,10,13,3,0,9,14,8,9,6,4,11,2,8,1,12,11,7,10,1,13,14,7,2,8,13,15,6,9,15,12,0,5,9,6,10,3,4,0,5,14,3,12,10,1,15,10,4,15,2,9,7,2,12,6,9,8,5,0,6,13,1,3,13,4,14,14,0,7,11,5,3,11,8,9,4,14,3,15,2,5,12,2,9,8,5,12,15,3,10,7,11,0,14,4,1,10,7,1,6,13,0,11,8,6,13,4,13,11,0,2,11,14,7,15,4,0,9,8,1,13,10,3,14,12,3,9,5,7,12,5,2,10,15,6,8,1,6,1,6,4,11,11,13,13,8,12,1,3,4,7,10,14,7,10,9,15,5,6,0,8,15,0,14,5,2,9,3,2,12,13,1,2,15,8,13,4,8,6,10,15,3,11,7,1,4,10,12,9,5,3,6,14,11,5,0,0,14,12,9,7,2,7,2,11,1,4,14,1,7,9,4,12,10,14,8,2,13,0,15,6,12,10,9,13,0,15,3,3,5,5,6,8,11];t.substitute=function substitute(e,t){var r=0;for(var n=0;n<4;n++){var a=e>>>18-n*6&63;var s=i[n*64+a];r<<=4;r|=s}for(var n=0;n<4;n++){var a=t>>>18-n*6&63;var s=i[4*64+n*64+a];r<<=4;r|=s}return r>>>0};var n=[16,25,12,11,3,20,4,15,31,17,9,6,27,14,1,22,30,24,8,18,0,5,29,23,13,19,2,26,10,21,28,7];t.permute=function permute(e){var t=0;for(var r=0;r>>n[r]&1}return t>>>0};t.padSplit=function padSplit(e,t,r){var i=e.toString(2);while(i.lengthe){r.ishrn(1)}if(r.isEven()){r.iadd(u)}if(!r.testn(1)){r.iadd(h)}if(!t.cmp(h)){while(r.mod(a).cmp(m)){r.iadd(y)}}else if(!t.cmp(d)){while(r.mod(p).cmp(b)){r.iadd(y)}}s=r.shrn(1);if(simpleSieve(s)&&simpleSieve(r)&&fermatTest(s)&&fermatTest(r)&&o.test(s)&&o.test(r)){return r}}}},8818:function(e,t,r){"use strict";var i=t;i.version=r(763).i8;i.utils=r(8454);i.rand=r(6069);i.curve=r(954);i.curves=r(2998);i.ec=r(2081);i.eddsa=r(2298)},3005:function(e,t,r){"use strict";var i=r(6884);var n=r(8454);var a=n.getNAF;var s=n.getJSF;var o=n.assert;function BaseCurve(e,t){this.type=e;this.p=new i(t.p,16);this.red=t.prime?i.red(t.prime):i.mont(this.p);this.zero=new i(0).toRed(this.red);this.one=new i(1).toRed(this.red);this.two=new i(2).toRed(this.red);this.n=t.n&&new i(t.n,16);this.g=t.g&&this.pointFromJSON(t.g,t.gRed);this._wnafT1=new Array(4);this._wnafT2=new Array(4);this._wnafT3=new Array(4);this._wnafT4=new Array(4);this._bitLength=this.n?this.n.bitLength():0;var r=this.n&&this.p.div(this.n);if(!r||r.cmpn(100)>0){this.redN=null}else{this._maxwellTrick=true;this.redN=this.n.toRed(this.red)}}e.exports=BaseCurve;BaseCurve.prototype.point=function point(){throw new Error("Not implemented")};BaseCurve.prototype.validate=function validate(){throw new Error("Not implemented")};BaseCurve.prototype._fixedNafMul=function _fixedNafMul(e,t){o(e.precomputed);var r=e._getDoubles();var i=a(t,1,this._bitLength);var n=(1<=u;t--)h=(h<<1)+i[t];s.push(h)}var d=this.jpoint(null,null,null);var c=this.jpoint(null,null,null);for(var l=n;l>0;l--){for(var u=0;u=0;h--){for(var t=0;h>=0&&s[h]===0;h--)t++;if(h>=0)t++;u=u.dblp(t);if(h<0)break;var d=s[h];o(d!==0);if(e.type==="affine"){if(d>0)u=u.mixedAdd(n[d-1>>1]);else u=u.mixedAdd(n[-d-1>>1].neg())}else{if(d>0)u=u.add(n[d-1>>1]);else u=u.add(n[-d-1>>1].neg())}}return e.type==="affine"?u.toP():u};BaseCurve.prototype._wnafMulAdd=function _wnafMulAdd(e,t,r,i,n){var o=this._wnafT1;var u=this._wnafT2;var h=this._wnafT3;var d=0;for(var c=0;c=1;c-=2){var b=c-1;var v=c;if(o[b]!==1||o[v]!==1){h[b]=a(r[b],o[b],this._bitLength);h[v]=a(r[v],o[v],this._bitLength);d=Math.max(h[b].length,d);d=Math.max(h[v].length,d);continue}var m=[t[b],null,null,t[v]];if(t[b].y.cmp(t[v].y)===0){m[1]=t[b].add(t[v]);m[2]=t[b].toJ().mixedAdd(t[v].neg())}else if(t[b].y.cmp(t[v].y.redNeg())===0){m[1]=t[b].toJ().mixedAdd(t[v]);m[2]=t[b].add(t[v].neg())}else{m[1]=t[b].toJ().mixedAdd(t[v]);m[2]=t[b].toJ().mixedAdd(t[v].neg())}var y=[-3,-1,-5,-7,0,7,5,1,3];var g=s(r[b],r[v]);d=Math.max(g[0].length,d);h[b]=new Array(d);h[v]=new Array(d);for(var _=0;_=0;c--){var k=0;while(c>=0){var A=true;for(var _=0;_=0)k++;E=E.dblp(k);if(c<0)break;for(var _=0;_0)l=u[_][N-1>>1];else if(N<0)l=u[_][-N-1>>1].neg();if(l.type==="affine")E=E.mixedAdd(l);else E=E.add(l)}}for(var c=0;c=Math.ceil((e.bitLength()+1)/t.step)};BasePoint.prototype._getDoubles=function _getDoubles(e,t){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;var r=[this];var i=this;for(var n=0;n";return""};Point.prototype.isInfinity=function isInfinity(){return this.x.cmpn(0)===0&&(this.y.cmp(this.z)===0||this.zOne&&this.y.cmp(this.curve.c)===0)};Point.prototype._extDbl=function _extDbl(){var e=this.x.redSqr();var t=this.y.redSqr();var r=this.z.redSqr();r=r.redIAdd(r);var i=this.curve._mulA(e);var n=this.x.redAdd(this.y).redSqr().redISub(e).redISub(t);var a=i.redAdd(t);var s=a.redSub(r);var o=i.redSub(t);var u=n.redMul(s);var h=a.redMul(o);var d=n.redMul(o);var c=s.redMul(a);return this.curve.point(u,h,c,d)};Point.prototype._projDbl=function _projDbl(){var e=this.x.redAdd(this.y).redSqr();var t=this.x.redSqr();var r=this.y.redSqr();var i;var n;var a;if(this.curve.twisted){var s=this.curve._mulA(t);var o=s.redAdd(r);if(this.zOne){i=e.redSub(t).redSub(r).redMul(o.redSub(this.curve.two));n=o.redMul(s.redSub(r));a=o.redSqr().redSub(o).redSub(o)}else{var u=this.z.redSqr();var h=o.redSub(u).redISub(u);i=e.redSub(t).redISub(r).redMul(h);n=o.redMul(s.redSub(r));a=o.redMul(h)}}else{var s=t.redAdd(r);var u=this.curve._mulC(this.z).redSqr();var h=s.redSub(u).redSub(u);i=this.curve._mulC(e.redISub(s)).redMul(h);n=this.curve._mulC(s).redMul(t.redISub(r));a=s.redMul(h)}return this.curve.point(i,n,a)};Point.prototype.dbl=function dbl(){if(this.isInfinity())return this;if(this.curve.extended)return this._extDbl();else return this._projDbl()};Point.prototype._extAdd=function _extAdd(e){var t=this.y.redSub(this.x).redMul(e.y.redSub(e.x));var r=this.y.redAdd(this.x).redMul(e.y.redAdd(e.x));var i=this.t.redMul(this.curve.dd).redMul(e.t);var n=this.z.redMul(e.z.redAdd(e.z));var a=r.redSub(t);var s=n.redSub(i);var o=n.redAdd(i);var u=r.redAdd(t);var h=a.redMul(s);var d=o.redMul(u);var c=a.redMul(u);var l=s.redMul(o);return this.curve.point(h,d,l,c)};Point.prototype._projAdd=function _projAdd(e){var t=this.z.redMul(e.z);var r=t.redSqr();var i=this.x.redMul(e.x);var n=this.y.redMul(e.y);var a=this.curve.d.redMul(i).redMul(n);var s=r.redSub(a);var o=r.redAdd(a);var u=this.x.redAdd(this.y).redMul(e.x.redAdd(e.y)).redISub(i).redISub(n);var h=t.redMul(s).redMul(u);var d;var c;if(this.curve.twisted){d=t.redMul(o).redMul(n.redSub(this.curve._mulA(i)));c=s.redMul(o)}else{d=t.redMul(o).redMul(n.redSub(i));c=this.curve._mulC(s).redMul(o)}return this.curve.point(h,d,c)};Point.prototype.add=function add(e){if(this.isInfinity())return e;if(e.isInfinity())return this;if(this.curve.extended)return this._extAdd(e);else return this._projAdd(e)};Point.prototype.mul=function mul(e){if(this._hasDoubles(e))return this.curve._fixedNafMul(this,e);else return this.curve._wnafMul(this,e)};Point.prototype.mulAdd=function mulAdd(e,t,r){return this.curve._wnafMulAdd(1,[this,t],[e,r],2,false)};Point.prototype.jmulAdd=function jmulAdd(e,t,r){return this.curve._wnafMulAdd(1,[this,t],[e,r],2,true)};Point.prototype.normalize=function normalize(){if(this.zOne)return this;var e=this.z.redInvm();this.x=this.x.redMul(e);this.y=this.y.redMul(e);if(this.t)this.t=this.t.redMul(e);this.z=this.curve.one;this.zOne=true;return this};Point.prototype.neg=function neg(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())};Point.prototype.getX=function getX(){this.normalize();return this.x.fromRed()};Point.prototype.getY=function getY(){this.normalize();return this.y.fromRed()};Point.prototype.eq=function eq(e){return this===e||this.getX().cmp(e.getX())===0&&this.getY().cmp(e.getY())===0};Point.prototype.eqXToP=function eqXToP(e){var t=e.toRed(this.curve.red).redMul(this.z);if(this.x.cmp(t)===0)return true;var r=e.clone();var i=this.curve.redN.redMul(this.z);for(;;){r.iadd(this.curve.n);if(r.cmp(this.curve.p)>=0)return false;t.redIAdd(i);if(this.x.cmp(t)===0)return true}};Point.prototype.toP=Point.prototype.normalize;Point.prototype.mixedAdd=Point.prototype.add},954:function(e,t,r){"use strict";var i=t;i.base=r(3005);i.short=r(401);i.mont=r(6103);i.edwards=r(9224)},6103:function(e,t,r){"use strict";var i=r(6884);var n=r(7526);var a=r(3005);var s=r(8454);function MontCurve(e){a.call(this,"mont",e);this.a=new i(e.a,16).toRed(this.red);this.b=new i(e.b,16).toRed(this.red);this.i4=new i(4).toRed(this.red).redInvm();this.two=new i(2).toRed(this.red);this.a24=this.i4.redMul(this.a.redAdd(this.two))}n(MontCurve,a);e.exports=MontCurve;MontCurve.prototype.validate=function validate(e){var t=e.normalize().x;var r=t.redSqr();var i=r.redMul(t).redAdd(r.redMul(this.a)).redAdd(t);var n=i.redSqrt();return n.redSqr().cmp(i)===0};function Point(e,t,r){a.BasePoint.call(this,e,"projective");if(t===null&&r===null){this.x=this.curve.one;this.z=this.curve.zero}else{this.x=new i(t,16);this.z=new i(r,16);if(!this.x.red)this.x=this.x.toRed(this.curve.red);if(!this.z.red)this.z=this.z.toRed(this.curve.red)}}n(Point,a.BasePoint);MontCurve.prototype.decodePoint=function decodePoint(e,t){return this.point(s.toArray(e,t),1)};MontCurve.prototype.point=function point(e,t){return new Point(this,e,t)};MontCurve.prototype.pointFromJSON=function pointFromJSON(e){return Point.fromJSON(this,e)};Point.prototype.precompute=function precompute(){};Point.prototype._encode=function _encode(){return this.getX().toArray("be",this.curve.p.byteLength())};Point.fromJSON=function fromJSON(e,t){return new Point(e,t[0],t[1]||e.one)};Point.prototype.inspect=function inspect(){if(this.isInfinity())return"";return""};Point.prototype.isInfinity=function isInfinity(){return this.z.cmpn(0)===0};Point.prototype.dbl=function dbl(){var e=this.x.redAdd(this.z);var t=e.redSqr();var r=this.x.redSub(this.z);var i=r.redSqr();var n=t.redSub(i);var a=t.redMul(i);var s=n.redMul(i.redAdd(this.curve.a24.redMul(n)));return this.curve.point(a,s)};Point.prototype.add=function add(){throw new Error("Not supported on Montgomery curve")};Point.prototype.diffAdd=function diffAdd(e,t){var r=this.x.redAdd(this.z);var i=this.x.redSub(this.z);var n=e.x.redAdd(e.z);var a=e.x.redSub(e.z);var s=a.redMul(r);var o=n.redMul(i);var u=t.z.redMul(s.redAdd(o).redSqr());var h=t.x.redMul(s.redISub(o).redSqr());return this.curve.point(u,h)};Point.prototype.mul=function mul(e){var t=e.clone();var r=this;var i=this.curve.point(null,null);var n=this;for(var a=[];t.cmpn(0)!==0;t.iushrn(1))a.push(t.andln(1));for(var s=a.length-1;s>=0;s--){if(a[s]===0){r=r.diffAdd(i,n);i=i.dbl()}else{i=r.diffAdd(i,n);r=r.dbl()}}return i};Point.prototype.mulAdd=function mulAdd(){throw new Error("Not supported on Montgomery curve")};Point.prototype.jumlAdd=function jumlAdd(){throw new Error("Not supported on Montgomery curve")};Point.prototype.eq=function eq(e){return this.getX().cmp(e.getX())===0};Point.prototype.normalize=function normalize(){this.x=this.x.redMul(this.z.redInvm());this.z=this.curve.one;return this};Point.prototype.getX=function getX(){this.normalize();return this.x.fromRed()}},401:function(e,t,r){"use strict";var i=r(8454);var n=r(6884);var a=r(7526);var s=r(3005);var o=i.assert;function ShortCurve(e){s.call(this,"short",e);this.a=new n(e.a,16).toRed(this.red);this.b=new n(e.b,16).toRed(this.red);this.tinv=this.two.redInvm();this.zeroA=this.a.fromRed().cmpn(0)===0;this.threeA=this.a.fromRed().sub(this.p).cmpn(-3)===0;this.endo=this._getEndomorphism(e);this._endoWnafT1=new Array(4);this._endoWnafT2=new Array(4)}a(ShortCurve,s);e.exports=ShortCurve;ShortCurve.prototype._getEndomorphism=function _getEndomorphism(e){if(!this.zeroA||!this.g||!this.n||this.p.modn(3)!==1)return;var t;var r;if(e.beta){t=new n(e.beta,16).toRed(this.red)}else{var i=this._getEndoRoots(this.p);t=i[0].cmp(i[1])<0?i[0]:i[1];t=t.toRed(this.red)}if(e.lambda){r=new n(e.lambda,16)}else{var a=this._getEndoRoots(this.n);if(this.g.mul(a[0]).x.cmp(this.g.x.redMul(t))===0){r=a[0]}else{r=a[1];o(this.g.mul(r).x.cmp(this.g.x.redMul(t))===0)}}var s;if(e.basis){s=e.basis.map((function(e){return{a:new n(e.a,16),b:new n(e.b,16)}}))}else{s=this._getEndoBasis(r)}return{beta:t,lambda:r,basis:s}};ShortCurve.prototype._getEndoRoots=function _getEndoRoots(e){var t=e===this.p?this.red:n.mont(e);var r=new n(2).toRed(t).redInvm();var i=r.redNeg();var a=new n(3).toRed(t).redNeg().redSqrt().redMul(r);var s=i.redAdd(a).fromRed();var o=i.redSub(a).fromRed();return[s,o]};ShortCurve.prototype._getEndoBasis=function _getEndoBasis(e){var t=this.n.ushrn(Math.floor(this.n.bitLength()/2));var r=e;var i=this.n.clone();var a=new n(1);var s=new n(0);var o=new n(0);var u=new n(1);var h;var d;var c;var l;var p;var b;var v;var m=0;var y;var g;while(r.cmpn(0)!==0){var _=i.div(r);y=i.sub(_.mul(r));g=o.sub(_.mul(a));var w=u.sub(_.mul(s));if(!c&&y.cmp(t)<0){h=v.neg();d=a;c=y.neg();l=g}else if(c&&++m===2){break}v=y;i=r;r=y;o=a;a=g;u=s;s=w}p=y.neg();b=g;var M=c.sqr().add(l.sqr());var E=p.sqr().add(b.sqr());if(E.cmp(M)>=0){p=h;b=d}if(c.negative){c=c.neg();l=l.neg()}if(p.negative){p=p.neg();b=b.neg()}return[{a:c,b:l},{a:p,b:b}]};ShortCurve.prototype._endoSplit=function _endoSplit(e){var t=this.endo.basis;var r=t[0];var i=t[1];var n=i.b.mul(e).divRound(this.n);var a=r.b.neg().mul(e).divRound(this.n);var s=n.mul(r.a);var o=a.mul(i.a);var u=n.mul(r.b);var h=a.mul(i.b);var d=e.sub(s).sub(o);var c=u.add(h).neg();return{k1:d,k2:c}};ShortCurve.prototype.pointFromX=function pointFromX(e,t){e=new n(e,16);if(!e.red)e=e.toRed(this.red);var r=e.redSqr().redMul(e).redIAdd(e.redMul(this.a)).redIAdd(this.b);var i=r.redSqrt();if(i.redSqr().redSub(r).cmp(this.zero)!==0)throw new Error("invalid point");var a=i.fromRed().isOdd();if(t&&!a||!t&&a)i=i.redNeg();return this.point(e,i)};ShortCurve.prototype.validate=function validate(e){if(e.inf)return true;var t=e.x;var r=e.y;var i=this.a.redMul(t);var n=t.redSqr().redMul(t).redIAdd(i).redIAdd(this.b);return r.redSqr().redISub(n).cmpn(0)===0};ShortCurve.prototype._endoWnafMulAdd=function _endoWnafMulAdd(e,t,r){var i=this._endoWnafT1;var n=this._endoWnafT2;for(var a=0;a";return""};Point.prototype.isInfinity=function isInfinity(){return this.inf};Point.prototype.add=function add(e){if(this.inf)return e;if(e.inf)return this;if(this.eq(e))return this.dbl();if(this.neg().eq(e))return this.curve.point(null,null);if(this.x.cmp(e.x)===0)return this.curve.point(null,null);var t=this.y.redSub(e.y);if(t.cmpn(0)!==0)t=t.redMul(this.x.redSub(e.x).redInvm());var r=t.redSqr().redISub(this.x).redISub(e.x);var i=t.redMul(this.x.redSub(r)).redISub(this.y);return this.curve.point(r,i)};Point.prototype.dbl=function dbl(){if(this.inf)return this;var e=this.y.redAdd(this.y);if(e.cmpn(0)===0)return this.curve.point(null,null);var t=this.curve.a;var r=this.x.redSqr();var i=e.redInvm();var n=r.redAdd(r).redIAdd(r).redIAdd(t).redMul(i);var a=n.redSqr().redISub(this.x.redAdd(this.x));var s=n.redMul(this.x.redSub(a)).redISub(this.y);return this.curve.point(a,s)};Point.prototype.getX=function getX(){return this.x.fromRed()};Point.prototype.getY=function getY(){return this.y.fromRed()};Point.prototype.mul=function mul(e){e=new n(e,16);if(this.isInfinity())return this;else if(this._hasDoubles(e))return this.curve._fixedNafMul(this,e);else if(this.curve.endo)return this.curve._endoWnafMulAdd([this],[e]);else return this.curve._wnafMul(this,e)};Point.prototype.mulAdd=function mulAdd(e,t,r){var i=[this,t];var n=[e,r];if(this.curve.endo)return this.curve._endoWnafMulAdd(i,n);else return this.curve._wnafMulAdd(1,i,n,2)};Point.prototype.jmulAdd=function jmulAdd(e,t,r){var i=[this,t];var n=[e,r];if(this.curve.endo)return this.curve._endoWnafMulAdd(i,n,true);else return this.curve._wnafMulAdd(1,i,n,2,true)};Point.prototype.eq=function eq(e){return this===e||this.inf===e.inf&&(this.inf||this.x.cmp(e.x)===0&&this.y.cmp(e.y)===0)};Point.prototype.neg=function neg(e){if(this.inf)return this;var t=this.curve.point(this.x,this.y.redNeg());if(e&&this.precomputed){var r=this.precomputed;var negate=function(e){return e.neg()};t.precomputed={naf:r.naf&&{wnd:r.naf.wnd,points:r.naf.points.map(negate)},doubles:r.doubles&&{step:r.doubles.step,points:r.doubles.points.map(negate)}}}return t};Point.prototype.toJ=function toJ(){if(this.inf)return this.curve.jpoint(null,null,null);var e=this.curve.jpoint(this.x,this.y,this.curve.one);return e};function JPoint(e,t,r,i){s.BasePoint.call(this,e,"jacobian");if(t===null&&r===null&&i===null){this.x=this.curve.one;this.y=this.curve.one;this.z=new n(0)}else{this.x=new n(t,16);this.y=new n(r,16);this.z=new n(i,16)}if(!this.x.red)this.x=this.x.toRed(this.curve.red);if(!this.y.red)this.y=this.y.toRed(this.curve.red);if(!this.z.red)this.z=this.z.toRed(this.curve.red);this.zOne=this.z===this.curve.one}a(JPoint,s.BasePoint);ShortCurve.prototype.jpoint=function jpoint(e,t,r){return new JPoint(this,e,t,r)};JPoint.prototype.toP=function toP(){if(this.isInfinity())return this.curve.point(null,null);var e=this.z.redInvm();var t=e.redSqr();var r=this.x.redMul(t);var i=this.y.redMul(t).redMul(e);return this.curve.point(r,i)};JPoint.prototype.neg=function neg(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)};JPoint.prototype.add=function add(e){if(this.isInfinity())return e;if(e.isInfinity())return this;var t=e.z.redSqr();var r=this.z.redSqr();var i=this.x.redMul(t);var n=e.x.redMul(r);var a=this.y.redMul(t.redMul(e.z));var s=e.y.redMul(r.redMul(this.z));var o=i.redSub(n);var u=a.redSub(s);if(o.cmpn(0)===0){if(u.cmpn(0)!==0)return this.curve.jpoint(null,null,null);else return this.dbl()}var h=o.redSqr();var d=h.redMul(o);var c=i.redMul(h);var l=u.redSqr().redIAdd(d).redISub(c).redISub(c);var p=u.redMul(c.redISub(l)).redISub(a.redMul(d));var b=this.z.redMul(e.z).redMul(o);return this.curve.jpoint(l,p,b)};JPoint.prototype.mixedAdd=function mixedAdd(e){if(this.isInfinity())return e.toJ();if(e.isInfinity())return this;var t=this.z.redSqr();var r=this.x;var i=e.x.redMul(t);var n=this.y;var a=e.y.redMul(t).redMul(this.z);var s=r.redSub(i);var o=n.redSub(a);if(s.cmpn(0)===0){if(o.cmpn(0)!==0)return this.curve.jpoint(null,null,null);else return this.dbl()}var u=s.redSqr();var h=u.redMul(s);var d=r.redMul(u);var c=o.redSqr().redIAdd(h).redISub(d).redISub(d);var l=o.redMul(d.redISub(c)).redISub(n.redMul(h));var p=this.z.redMul(s);return this.curve.jpoint(c,l,p)};JPoint.prototype.dblp=function dblp(e){if(e===0)return this;if(this.isInfinity())return this;if(!e)return this.dbl();if(this.curve.zeroA||this.curve.threeA){var t=this;for(var r=0;r=0)return false;r.redIAdd(n);if(this.x.cmp(r)===0)return true}};JPoint.prototype.inspect=function inspect(){if(this.isInfinity())return"";return""};JPoint.prototype.isInfinity=function isInfinity(){return this.z.cmpn(0)===0}},2998:function(e,t,r){"use strict";var i=t;var n=r(9767);var a=r(954);var s=r(8454);var o=s.assert;function PresetCurve(e){if(e.type==="short")this.curve=new a.short(e);else if(e.type==="edwards")this.curve=new a.edwards(e);else this.curve=new a.mont(e);this.g=this.curve.g;this.n=this.curve.n;this.hash=e.hash;o(this.g.validate(),"Invalid curve");o(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}i.PresetCurve=PresetCurve;function defineCurve(e,t){Object.defineProperty(i,e,{configurable:true,enumerable:true,get:function(){var r=new PresetCurve(t);Object.defineProperty(i,e,{configurable:true,enumerable:true,value:r});return r}})}defineCurve("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:n.sha256,gRed:false,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]});defineCurve("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:n.sha256,gRed:false,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]});defineCurve("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:n.sha256,gRed:false,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]});defineCurve("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff "+"fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff "+"fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f "+"5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 "+"f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:n.sha384,gRed:false,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 "+"5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 "+"0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]});defineCurve("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff "+"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff "+"ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff "+"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff "+"ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b "+"99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd "+"3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff "+"ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 "+"f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:n.sha512,gRed:false,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 "+"053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 "+"a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 "+"579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 "+"3fad0761 353c7086 a272c240 88be9476 9fd16650"]});defineCurve("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:n.sha256,gRed:false,g:["9"]});defineCurve("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:n.sha256,gRed:false,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});var u;try{u=r(7759)}catch(e){u=undefined}defineCurve("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:n.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:false,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",u]})},2081:function(e,t,r){"use strict";var i=r(6884);var n=r(8242);var a=r(8454);var s=r(2998);var o=r(6069);var u=a.assert;var h=r(7044);var d=r(8020);function EC(e){if(!(this instanceof EC))return new EC(e);if(typeof e==="string"){u(s.hasOwnProperty(e),"Unknown curve "+e);e=s[e]}if(e instanceof s.PresetCurve)e={curve:e};this.curve=e.curve.curve;this.n=this.curve.n;this.nh=this.n.ushrn(1);this.g=this.curve.g;this.g=e.curve.g;this.g.precompute(e.curve.n.bitLength()+1);this.hash=e.hash||e.curve.hash}e.exports=EC;EC.prototype.keyPair=function keyPair(e){return new h(this,e)};EC.prototype.keyFromPrivate=function keyFromPrivate(e,t){return h.fromPrivate(this,e,t)};EC.prototype.keyFromPublic=function keyFromPublic(e,t){return h.fromPublic(this,e,t)};EC.prototype.genKeyPair=function genKeyPair(e){if(!e)e={};var t=new n({hash:this.hash,pers:e.pers,persEnc:e.persEnc||"utf8",entropy:e.entropy||o(this.hash.hmacStrength),entropyEnc:e.entropy&&e.entropyEnc||"utf8",nonce:this.n.toArray()});var r=this.n.byteLength();var a=this.n.sub(new i(2));do{var s=new i(t.generate(r));if(s.cmp(a)>0)continue;s.iaddn(1);return this.keyFromPrivate(s)}while(true)};EC.prototype._truncateToN=function truncateToN(e,t){var r=e.byteLength()*8-this.n.bitLength();if(r>0)e=e.ushrn(r);if(!t&&e.cmp(this.n)>=0)return e.sub(this.n);else return e};EC.prototype.sign=function sign(e,t,r,a){if(typeof r==="object"){a=r;r=null}if(!a)a={};t=this.keyFromPrivate(t,r);e=this._truncateToN(new i(e,16));var s=this.n.byteLength();var o=t.getPrivate().toArray("be",s);var u=e.toArray("be",s);var h=new n({hash:this.hash,entropy:o,nonce:u,pers:a.pers,persEnc:a.persEnc||"utf8"});var c=this.n.sub(new i(1));for(var l=0;true;l++){var p=a.k?a.k(l):new i(h.generate(this.n.byteLength()));p=this._truncateToN(p,true);if(p.cmpn(1)<=0||p.cmp(c)>=0)continue;var b=this.g.mul(p);if(b.isInfinity())continue;var v=b.getX();var m=v.umod(this.n);if(m.cmpn(0)===0)continue;var y=p.invm(this.n).mul(m.mul(t.getPrivate()).iadd(e));y=y.umod(this.n);if(y.cmpn(0)===0)continue;var g=(b.getY().isOdd()?1:0)|(v.cmp(m)!==0?2:0);if(a.canonical&&y.cmp(this.nh)>0){y=this.n.sub(y);g^=1}return new d({r:m,s:y,recoveryParam:g})}};EC.prototype.verify=function verify(e,t,r,n){e=this._truncateToN(new i(e,16));r=this.keyFromPublic(r,n);t=new d(t,"hex");var a=t.r;var s=t.s;if(a.cmpn(1)<0||a.cmp(this.n)>=0)return false;if(s.cmpn(1)<0||s.cmp(this.n)>=0)return false;var o=s.invm(this.n);var u=o.mul(e).umod(this.n);var h=o.mul(a).umod(this.n);if(!this.curve._maxwellTrick){var c=this.g.mulAdd(u,r.getPublic(),h);if(c.isInfinity())return false;return c.getX().umod(this.n).cmp(a)===0}var c=this.g.jmulAdd(u,r.getPublic(),h);if(c.isInfinity())return false;return c.eqXToP(a)};EC.prototype.recoverPubKey=function(e,t,r,n){u((3&r)===r,"The recovery param is more than two bits");t=new d(t,n);var a=this.n;var s=new i(e);var o=t.r;var h=t.s;var c=r&1;var l=r>>1;if(o.cmp(this.curve.p.umod(this.curve.n))>=0&&l)throw new Error("Unable to find sencond key candinate");if(l)o=this.curve.pointFromX(o.add(this.curve.n),c);else o=this.curve.pointFromX(o,c);var p=t.r.invm(a);var b=a.sub(s).mul(p).umod(a);var v=h.mul(p).umod(a);return this.g.mulAdd(b,o,v)};EC.prototype.getKeyRecoveryParam=function(e,t,r,i){t=new d(t,i);if(t.recoveryParam!==null)return t.recoveryParam;for(var n=0;n<4;n++){var a;try{a=this.recoverPubKey(e,t,n)}catch(e){continue}if(a.eq(r))return n}throw new Error("Unable to find valid recovery factor")}},7044:function(e,t,r){"use strict";var i=r(6884);var n=r(8454);var a=n.assert;function KeyPair(e,t){this.ec=e;this.priv=null;this.pub=null;if(t.priv)this._importPrivate(t.priv,t.privEnc);if(t.pub)this._importPublic(t.pub,t.pubEnc)}e.exports=KeyPair;KeyPair.fromPublic=function fromPublic(e,t,r){if(t instanceof KeyPair)return t;return new KeyPair(e,{pub:t,pubEnc:r})};KeyPair.fromPrivate=function fromPrivate(e,t,r){if(t instanceof KeyPair)return t;return new KeyPair(e,{priv:t,privEnc:r})};KeyPair.prototype.validate=function validate(){var e=this.getPublic();if(e.isInfinity())return{result:false,reason:"Invalid public key"};if(!e.validate())return{result:false,reason:"Public key is not a point"};if(!e.mul(this.ec.curve.n).isInfinity())return{result:false,reason:"Public key * N != O"};return{result:true,reason:null}};KeyPair.prototype.getPublic=function getPublic(e,t){if(typeof e==="string"){t=e;e=null}if(!this.pub)this.pub=this.ec.g.mul(this.priv);if(!t)return this.pub;return this.pub.encode(t,e)};KeyPair.prototype.getPrivate=function getPrivate(e){if(e==="hex")return this.priv.toString(16,2);else return this.priv};KeyPair.prototype._importPrivate=function _importPrivate(e,t){this.priv=new i(e,t||16);this.priv=this.priv.umod(this.ec.curve.n)};KeyPair.prototype._importPublic=function _importPublic(e,t){if(e.x||e.y){if(this.ec.curve.type==="mont"){a(e.x,"Need x coordinate")}else if(this.ec.curve.type==="short"||this.ec.curve.type==="edwards"){a(e.x&&e.y,"Need both x and y coordinate")}this.pub=this.ec.curve.point(e.x,e.y);return}this.pub=this.ec.curve.decodePoint(e,t)};KeyPair.prototype.derive=function derive(e){return e.mul(this.priv).getX()};KeyPair.prototype.sign=function sign(e,t,r){return this.ec.sign(e,this,t,r)};KeyPair.prototype.verify=function verify(e,t){return this.ec.verify(e,t,this)};KeyPair.prototype.inspect=function inspect(){return""}},8020:function(e,t,r){"use strict";var i=r(6884);var n=r(8454);var a=n.assert;function Signature(e,t){if(e instanceof Signature)return e;if(this._importDER(e,t))return;a(e.r&&e.s,"Signature without r or s");this.r=new i(e.r,16);this.s=new i(e.s,16);if(e.recoveryParam===undefined)this.recoveryParam=null;else this.recoveryParam=e.recoveryParam}e.exports=Signature;function Position(){this.place=0}function getLength(e,t){var r=e[t.place++];if(!(r&128)){return r}var i=r&15;if(i===0||i>4){return false}var n=0;for(var a=0,s=t.place;a>>=0}if(n<=127){return false}t.place=s;return n}function rmPadding(e){var t=0;var r=e.length-1;while(!e[t]&&!(e[t+1]&128)&&t>>3);e.push(r|128);while(--r){e.push(t>>>(r<<3)&255)}e.push(t)}Signature.prototype.toDER=function toDER(e){var t=this.r.toArray();var r=this.s.toArray();if(t[0]&128)t=[0].concat(t);if(r[0]&128)r=[0].concat(r);t=rmPadding(t);r=rmPadding(r);while(!r[0]&&!(r[1]&128)){r=r.slice(1)}var i=[2];constructLength(i,t.length);i=i.concat(t);i.push(2);constructLength(i,r.length);var a=i.concat(r);var s=[48];constructLength(s,a.length);s=s.concat(a);return n.encode(s,e)}},2298:function(e,t,r){"use strict";var i=r(9767);var n=r(2998);var a=r(8454);var s=a.assert;var o=a.parseBytes;var u=r(9285);var h=r(3883);function EDDSA(e){s(e==="ed25519","only tested with ed25519 so far");if(!(this instanceof EDDSA))return new EDDSA(e);var e=n[e].curve;this.curve=e;this.g=e.g;this.g.precompute(e.n.bitLength()+1);this.pointClass=e.point().constructor;this.encodingLength=Math.ceil(e.n.bitLength()/8);this.hash=i.sha512}e.exports=EDDSA;EDDSA.prototype.sign=function sign(e,t){e=o(e);var r=this.keyFromSecret(t);var i=this.hashInt(r.messagePrefix(),e);var n=this.g.mul(i);var a=this.encodePoint(n);var s=this.hashInt(a,r.pubBytes(),e).mul(r.priv());var u=i.add(s).umod(this.curve.n);return this.makeSignature({R:n,S:u,Rencoded:a})};EDDSA.prototype.verify=function verify(e,t,r){e=o(e);t=this.makeSignature(t);var i=this.keyFromPublic(r);var n=this.hashInt(t.Rencoded(),i.pubBytes(),e);var a=this.g.mul(t.S());var s=t.R().add(i.pub().mul(n));return s.eq(a)};EDDSA.prototype.hashInt=function hashInt(){var e=this.hash();for(var t=0;t(n>>1)-1)o=(n>>1)-u;else o=u;a.isubn(o)}else{o=0}i[s]=o;a.iushrn(1)}return i}i.getNAF=getNAF;function getJSF(e,t){var r=[[],[]];e=e.clone();t=t.clone();var i=0;var n=0;while(e.cmpn(-i)>0||t.cmpn(-n)>0){var a=e.andln(3)+i&3;var s=t.andln(3)+n&3;if(a===3)a=-1;if(s===3)s=-1;var o;if((a&1)===0){o=0}else{var u=e.andln(7)+i&7;if((u===3||u===5)&&s===2)o=-a;else o=a}r[0].push(o);var h;if((s&1)===0){h=0}else{var u=t.andln(7)+n&7;if((u===3||u===5)&&a===2)h=-s;else h=s}r[1].push(h);if(2*i===o+1)i=1-i;if(2*n===h+1)n=1-n;e.iushrn(1);t.iushrn(1)}return r}i.getJSF=getJSF;function cachedProperty(e,t,r){var i="_"+t;e.prototype[t]=function cachedProperty(){return this[i]!==undefined?this[i]:this[i]=r.call(this)}}i.cachedProperty=cachedProperty;function parseBytes(e){return typeof e==="string"?i.toArray(e,"hex"):e}i.parseBytes=parseBytes;function intFromLE(e){return new n(e,"hex","le")}i.intFromLE=intFromLE},7325:function(e,t,r){var i=r(3118).Buffer;var n=r(4125);function EVP_BytesToKey(e,t,r,a){if(!i.isBuffer(e))e=i.from(e,"binary");if(t){if(!i.isBuffer(t))t=i.from(t,"binary");if(t.length!==8)throw new RangeError("salt should be Buffer with 8 byte length")}var s=r/8;var o=i.alloc(s);var u=i.alloc(a||0);var h=i.alloc(0);while(s>0||a>0){var d=new n;d.update(h);d.update(e);if(t)d.update(t);h=d.digest();var c=0;if(s>0){var l=o.length-s;c=Math.min(s,h.length);h.copy(o,l,0,c);s-=c}if(c0){var p=u.length-a;var b=Math.min(a,h.length-c);h.copy(u,p,c,c+b);a-=b}}h.fill(0);return{key:o,iv:u}}e.exports=EVP_BytesToKey},3421:function(e,t,r){"use strict";var i=r(3118).Buffer;var n=r(5098).Transform;var a=r(7526);function throwIfNotStringOrBuffer(e,t){if(!i.isBuffer(e)&&typeof e!=="string"){throw new TypeError(t+" must be a string or a buffer")}}function HashBase(e){n.call(this);this._block=i.allocUnsafe(e);this._blockSize=e;this._blockOffset=0;this._length=[0,0,0,0];this._finalized=false}a(HashBase,n);HashBase.prototype._transform=function(e,t,r){var i=null;try{this.update(e,t)}catch(e){i=e}r(i)};HashBase.prototype._flush=function(e){var t=null;try{this.push(this.digest())}catch(e){t=e}e(t)};HashBase.prototype.update=function(e,t){throwIfNotStringOrBuffer(e,"Data");if(this._finalized)throw new Error("Digest already called");if(!i.isBuffer(e))e=i.from(e,t);var r=this._block;var n=0;while(this._blockOffset+e.length-n>=this._blockSize){for(var a=this._blockOffset;a0;++s){this._length[s]+=o;o=this._length[s]/4294967296|0;if(o>0)this._length[s]-=4294967296*o}return this};HashBase.prototype._update=function(){throw new Error("_update is not implemented")};HashBase.prototype.digest=function(e){if(this._finalized)throw new Error("Digest already called");this._finalized=true;var t=this._digest();if(e!==undefined)t=t.toString(e);this._block.fill(0);this._blockOffset=0;for(var r=0;r<4;++r)this._length[r]=0;return t};HashBase.prototype._digest=function(){throw new Error("_digest is not implemented")};e.exports=HashBase},519:function(e){"use strict";const t={};function createErrorType(e,r,i){if(!i){i=Error}function getMessage(e,t,i){if(typeof r==="string"){return r}else{return r(e,t,i)}}class NodeError extends i{constructor(e,t,r){super(getMessage(e,t,r))}}NodeError.prototype.name=i.name;NodeError.prototype.code=e;t[e]=NodeError}function oneOf(e,t){if(Array.isArray(e)){const r=e.length;e=e.map((e=>String(e)));if(r>2){return`one of ${t} ${e.slice(0,r-1).join(", ")}, or `+e[r-1]}else if(r===2){return`one of ${t} ${e[0]} or ${e[1]}`}else{return`of ${t} ${e[0]}`}}else{return`of ${t} ${String(e)}`}}function startsWith(e,t,r){return e.substr(!r||r<0?0:+r,t.length)===t}function endsWith(e,t,r){if(r===undefined||r>e.length){r=e.length}return e.substring(r-t.length,r)===t}function includes(e,t,r){if(typeof r!=="number"){r=0}if(r+t.length>e.length){return false}else{return e.indexOf(t,r)!==-1}}createErrorType("ERR_INVALID_OPT_VALUE",(function(e,t){return'The value "'+t+'" is invalid for option "'+e+'"'}),TypeError);createErrorType("ERR_INVALID_ARG_TYPE",(function(e,t,r){let i;if(typeof t==="string"&&startsWith(t,"not ")){i="must not be";t=t.replace(/^not /,"")}else{i="must be"}let n;if(endsWith(e," argument")){n=`The ${e} ${i} ${oneOf(t,"type")}`}else{const r=includes(e,".")?"property":"argument";n=`The "${e}" ${r} ${i} ${oneOf(t,"type")}`}n+=`. Received type ${typeof r}`;return n}),TypeError);createErrorType("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF");createErrorType("ERR_METHOD_NOT_IMPLEMENTED",(function(e){return"The "+e+" method is not implemented"}));createErrorType("ERR_STREAM_PREMATURE_CLOSE","Premature close");createErrorType("ERR_STREAM_DESTROYED",(function(e){return"Cannot call "+e+" after a stream was destroyed"}));createErrorType("ERR_MULTIPLE_CALLBACK","Callback called multiple times");createErrorType("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable");createErrorType("ERR_STREAM_WRITE_AFTER_END","write after end");createErrorType("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError);createErrorType("ERR_UNKNOWN_ENCODING",(function(e){return"Unknown encoding: "+e}),TypeError);createErrorType("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event");e.exports.q=t},5077:function(e,t,r){"use strict";var i=Object.keys||function(e){var t=[];for(var r in e){t.push(r)}return t};e.exports=Duplex;var n=r(279);var a=r(3582);r(7526)(Duplex,n);{var s=i(a.prototype);for(var o=0;o0){if(typeof t!=="string"&&!a.objectMode&&Object.getPrototypeOf(t)!==o.prototype){t=_uint8ArrayToBuffer(t)}if(i){if(a.endEmitted)B(e,new _);else addChunk(e,a,t,true)}else if(a.ended){B(e,new y)}else if(a.destroyed){return false}else{a.reading=false;if(a.decoder&&!r){t=a.decoder.write(t);if(a.objectMode||t.length!==0)addChunk(e,a,t,false);else maybeReadMore(e,a)}else{addChunk(e,a,t,false)}}}else if(!i){a.reading=false;maybeReadMore(e,a)}}return!a.ended&&(a.length=A){e=A}else{e--;e|=e>>>1;e|=e>>>2;e|=e>>>4;e|=e>>>8;e|=e>>>16;e++}return e}function howMuchToRead(e,t){if(e<=0||t.length===0&&t.ended)return 0;if(t.objectMode)return 1;if(e!==e){if(t.flowing&&t.length)return t.buffer.head.data.length;else return t.length}if(e>t.highWaterMark)t.highWaterMark=computeNewHighWaterMark(e);if(e<=t.length)return e;if(!t.ended){t.needReadable=true;return 0}return t.length}Readable.prototype.read=function(e){d("read",e);e=parseInt(e,10);var t=this._readableState;var r=e;if(e!==0)t.emittedReadable=false;if(e===0&&t.needReadable&&((t.highWaterMark!==0?t.length>=t.highWaterMark:t.length>0)||t.ended)){d("read: emitReadable",t.length,t.ended);if(t.length===0&&t.ended)endReadable(this);else emitReadable(this);return null}e=howMuchToRead(e,t);if(e===0&&t.ended){if(t.length===0)endReadable(this);return null}var i=t.needReadable;d("need readable",i);if(t.length===0||t.length-e0)n=fromList(e,t);else n=null;if(n===null){t.needReadable=t.length<=t.highWaterMark;e=0}else{t.length-=e;t.awaitDrain=0}if(t.length===0){if(!t.ended)t.needReadable=true;if(r!==e&&t.ended)endReadable(this)}if(n!==null)this.emit("data",n);return n};function onEofChunk(e,t){d("onEofChunk");if(t.ended)return;if(t.decoder){var r=t.decoder.end();if(r&&r.length){t.buffer.push(r);t.length+=t.objectMode?1:r.length}}t.ended=true;if(t.sync){emitReadable(e)}else{t.needReadable=false;if(!t.emittedReadable){t.emittedReadable=true;emitReadable_(e)}}}function emitReadable(e){var t=e._readableState;d("emitReadable",t.needReadable,t.emittedReadable);t.needReadable=false;if(!t.emittedReadable){d("emitReadable",t.flowing);t.emittedReadable=true;process.nextTick(emitReadable_,e)}}function emitReadable_(e){var t=e._readableState;d("emitReadable_",t.destroyed,t.length,t.ended);if(!t.destroyed&&(t.length||t.ended)){e.emit("readable");t.emittedReadable=false}t.needReadable=!t.flowing&&!t.ended&&t.length<=t.highWaterMark;flow(e)}function maybeReadMore(e,t){if(!t.readingMore){t.readingMore=true;process.nextTick(maybeReadMore_,e,t)}}function maybeReadMore_(e,t){while(!t.reading&&!t.ended&&(t.length1&&indexOf(i.pipes,e)!==-1)&&!u){d("false write response, pause",i.awaitDrain);i.awaitDrain++}r.pause()}}function onerror(t){d("onerror",t);unpipe();e.removeListener("error",onerror);if(a(e,"error")===0)B(e,t)}prependListener(e,"error",onerror);function onclose(){e.removeListener("finish",onfinish);unpipe()}e.once("close",onclose);function onfinish(){d("onfinish");e.removeListener("close",onclose);unpipe()}e.once("finish",onfinish);function unpipe(){d("unpipe");r.unpipe(e)}e.emit("pipe",r);if(!i.flowing){d("pipe resume");r.resume()}return e};function pipeOnDrain(e){return function pipeOnDrainFunctionResult(){var t=e._readableState;d("pipeOnDrain",t.awaitDrain);if(t.awaitDrain)t.awaitDrain--;if(t.awaitDrain===0&&a(e,"data")){t.flowing=true;flow(e)}}}Readable.prototype.unpipe=function(e){var t=this._readableState;var r={hasUnpiped:false};if(t.pipesCount===0)return this;if(t.pipesCount===1){if(e&&e!==t.pipes)return this;if(!e)e=t.pipes;t.pipes=null;t.pipesCount=0;t.flowing=false;if(e)e.emit("unpipe",this,r);return this}if(!e){var i=t.pipes;var n=t.pipesCount;t.pipes=null;t.pipesCount=0;t.flowing=false;for(var a=0;a0;if(i.flowing!==false)this.resume()}else if(e==="readable"){if(!i.endEmitted&&!i.readableListening){i.readableListening=i.needReadable=true;i.flowing=false;i.emittedReadable=false;d("on readable",i.length,i.reading);if(i.length){emitReadable(this)}else if(!i.reading){process.nextTick(nReadingNextTick,this)}}}return r};Readable.prototype.addListener=Readable.prototype.on;Readable.prototype.removeListener=function(e,t){var r=s.prototype.removeListener.call(this,e,t);if(e==="readable"){process.nextTick(updateReadableListening,this)}return r};Readable.prototype.removeAllListeners=function(e){var t=s.prototype.removeAllListeners.apply(this,arguments);if(e==="readable"||e===undefined){process.nextTick(updateReadableListening,this)}return t};function updateReadableListening(e){var t=e._readableState;t.readableListening=e.listenerCount("readable")>0;if(t.resumeScheduled&&!t.paused){t.flowing=true}else if(e.listenerCount("data")>0){e.resume()}}function nReadingNextTick(e){d("readable nexttick read 0");e.read(0)}Readable.prototype.resume=function(){var e=this._readableState;if(!e.flowing){d("resume");e.flowing=!e.readableListening;resume(this,e)}e.paused=false;return this};function resume(e,t){if(!t.resumeScheduled){t.resumeScheduled=true;process.nextTick(resume_,e,t)}}function resume_(e,t){d("resume",t.reading);if(!t.reading){e.read(0)}t.resumeScheduled=false;e.emit("resume");flow(e);if(t.flowing&&!t.reading)e.read(0)}Readable.prototype.pause=function(){d("call pause flowing=%j",this._readableState.flowing);if(this._readableState.flowing!==false){d("pause");this._readableState.flowing=false;this.emit("pause")}this._readableState.paused=true;return this};function flow(e){var t=e._readableState;d("flow",t.flowing);while(t.flowing&&e.read()!==null){}}Readable.prototype.wrap=function(e){var t=this;var r=this._readableState;var i=false;e.on("end",(function(){d("wrapped end");if(r.decoder&&!r.ended){var e=r.decoder.end();if(e&&e.length)t.push(e)}t.push(null)}));e.on("data",(function(n){d("wrapped data");if(r.decoder)n=r.decoder.write(n);if(r.objectMode&&(n===null||n===undefined))return;else if(!r.objectMode&&(!n||!n.length))return;var a=t.push(n);if(!a){i=true;e.pause()}}));for(var n in e){if(this[n]===undefined&&typeof e[n]==="function"){this[n]=function methodWrap(t){return function methodWrapReturnFunction(){return e[t].apply(e,arguments)}}(n)}}for(var a=0;a=t.length){if(t.decoder)r=t.buffer.join("");else if(t.buffer.length===1)r=t.buffer.first();else r=t.buffer.concat(t.length);t.buffer.clear()}else{r=t.buffer.consume(e,t.decoder)}return r}function endReadable(e){var t=e._readableState;d("endReadable",t.endEmitted);if(!t.endEmitted){t.ended=true;process.nextTick(endReadableNT,t,e)}}function endReadableNT(e,t){d("endReadableNT",e.endEmitted,e.length);if(!e.endEmitted&&e.length===0){e.endEmitted=true;t.readable=false;t.emit("end");if(e.autoDestroy){var r=t._writableState;if(!r||r.autoDestroy&&r.finished){t.destroy()}}}}if(typeof Symbol==="function"){Readable.from=function(e,t){if(E===undefined){E=r(1514)}return E(Readable,e,t)}}function indexOf(e,t){for(var r=0,i=e.length;r-1))throw new _(e);this._writableState.defaultEncoding=e;return this};Object.defineProperty(Writable.prototype,"writableBuffer",{enumerable:false,get:function get(){return this._writableState&&this._writableState.getBuffer()}});function decodeChunk(e,t,r){if(!e.objectMode&&e.decodeStrings!==false&&typeof t==="string"){t=s.from(t,r)}return t}Object.defineProperty(Writable.prototype,"writableHighWaterMark",{enumerable:false,get:function get(){return this._writableState.highWaterMark}});function writeOrBuffer(e,t,r,i,n,a){if(!r){var s=decodeChunk(t,i,n);if(i!==s){r=true;n="buffer";i=s}}var o=t.objectMode?1:i.length;t.length+=o;var u=t.length0)this.tail.next=t;else this.head=t;this.tail=t;++this.length}},{key:"unshift",value:function unshift(e){var t={data:e,next:this.head};if(this.length===0)this.tail=t;this.head=t;++this.length}},{key:"shift",value:function shift(){if(this.length===0)return;var e=this.head.data;if(this.length===1)this.head=this.tail=null;else this.head=this.head.next;--this.length;return e}},{key:"clear",value:function clear(){this.head=this.tail=null;this.length=0}},{key:"join",value:function join(e){if(this.length===0)return"";var t=this.head;var r=""+t.data;while(t=t.next){r+=e+t.data}return r}},{key:"concat",value:function concat(e){if(this.length===0)return n.alloc(0);var t=n.allocUnsafe(e>>>0);var r=this.head;var i=0;while(r){copyBuffer(r.data,t,i);i+=r.data.length;r=r.next}return t}},{key:"consume",value:function consume(e,t){var r;if(en.length?n.length:e;if(a===n.length)i+=n;else i+=n.slice(0,e);e-=a;if(e===0){if(a===n.length){++r;if(t.next)this.head=t.next;else this.head=this.tail=null}else{this.head=t;t.data=n.slice(a)}break}++r}this.length-=r;return i}},{key:"_getBuffer",value:function _getBuffer(e){var t=n.allocUnsafe(e);var r=this.head;var i=1;r.data.copy(t);e-=r.data.length;while(r=r.next){var a=r.data;var s=e>a.length?a.length:e;a.copy(t,t.length-e,0,s);e-=s;if(e===0){if(s===a.length){++i;if(r.next)this.head=r.next;else this.head=this.tail=null}else{this.head=r;r.data=a.slice(s)}break}++i}this.length-=i;return t}},{key:o,value:function value(e,t){return s(this,_objectSpread({},t,{depth:0,customInspect:false}))}}]);return BufferList}()},8956:function(e){"use strict";function destroy(e,t){var r=this;var i=this._readableState&&this._readableState.destroyed;var n=this._writableState&&this._writableState.destroyed;if(i||n){if(t){t(e)}else if(e){if(!this._writableState){process.nextTick(emitErrorNT,this,e)}else if(!this._writableState.errorEmitted){this._writableState.errorEmitted=true;process.nextTick(emitErrorNT,this,e)}}return this}if(this._readableState){this._readableState.destroyed=true}if(this._writableState){this._writableState.destroyed=true}this._destroy(e||null,(function(e){if(!t&&e){if(!r._writableState){process.nextTick(emitErrorAndCloseNT,r,e)}else if(!r._writableState.errorEmitted){r._writableState.errorEmitted=true;process.nextTick(emitErrorAndCloseNT,r,e)}else{process.nextTick(emitCloseNT,r)}}else if(t){process.nextTick(emitCloseNT,r);t(e)}else{process.nextTick(emitCloseNT,r)}}));return this}function emitErrorAndCloseNT(e,t){emitErrorNT(e,t);emitCloseNT(e)}function emitCloseNT(e){if(e._writableState&&!e._writableState.emitClose)return;if(e._readableState&&!e._readableState.emitClose)return;e.emit("close")}function undestroy(){if(this._readableState){this._readableState.destroyed=false;this._readableState.reading=false;this._readableState.ended=false;this._readableState.endEmitted=false}if(this._writableState){this._writableState.destroyed=false;this._writableState.ended=false;this._writableState.ending=false;this._writableState.finalCalled=false;this._writableState.prefinished=false;this._writableState.finished=false;this._writableState.errorEmitted=false}}function emitErrorNT(e,t){e.emit("error",t)}function errorOrDestroy(e,t){var r=e._readableState;var i=e._writableState;if(r&&r.autoDestroy||i&&i.autoDestroy)e.destroy(t);else e.emit("error",t)}e.exports={destroy:destroy,undestroy:undestroy,errorOrDestroy:errorOrDestroy}},9830:function(e,t,r){"use strict";var i=r(519).q.ERR_STREAM_PREMATURE_CLOSE;function once(e){var t=false;return function(){if(t)return;t=true;for(var r=arguments.length,i=new Array(r),n=0;n0;return destroyer(e,a,o,(function(e){if(!n)n=e;if(e)s.forEach(call);if(a)return;s.forEach(call);i(n)}))}));return t.reduce(pipe)}e.exports=pipeline},4292:function(e,t,r){"use strict";var i=r(519).q.ERR_INVALID_OPT_VALUE;function highWaterMarkFrom(e,t,r){return e.highWaterMark!=null?e.highWaterMark:t?e[r]:null}function getHighWaterMark(e,t,r,n){var a=highWaterMarkFrom(t,n,r);if(a!=null){if(!(isFinite(a)&&Math.floor(a)===a)||a<0){var s=n?r:"highWaterMark";throw new i(s,a)}return Math.floor(a)}return e.objectMode?16:16*1024}e.exports={getHighWaterMark:getHighWaterMark}},3917:function(e,t,r){e.exports=r(2781)},5098:function(e,t,r){var i=r(2781);if(process.env.READABLE_STREAM==="disable"&&i){e.exports=i.Readable;Object.assign(e.exports,i);e.exports.Stream=i}else{t=e.exports=r(279);t.Stream=i||t;t.Readable=t;t.Writable=r(3582);t.Duplex=r(5077);t.Transform=r(6821);t.PassThrough=r(3880);t.finished=r(9830);t.pipeline=r(1586)}},9573:function(e,t,r){"use strict";var i=r(3118).Buffer;var n=i.isEncoding||function(e){e=""+e;switch(e&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return true;default:return false}};function _normalizeEncoding(e){if(!e)return"utf8";var t;while(true){switch(e){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return e;default:if(t)return;e=(""+e).toLowerCase();t=true}}}function normalizeEncoding(e){var t=_normalizeEncoding(e);if(typeof t!=="string"&&(i.isEncoding===n||!n(e)))throw new Error("Unknown encoding: "+e);return t||e}t.s=StringDecoder;function StringDecoder(e){this.encoding=normalizeEncoding(e);var t;switch(this.encoding){case"utf16le":this.text=utf16Text;this.end=utf16End;t=4;break;case"utf8":this.fillLast=utf8FillLast;t=4;break;case"base64":this.text=base64Text;this.end=base64End;t=3;break;default:this.write=simpleWrite;this.end=simpleEnd;return}this.lastNeed=0;this.lastTotal=0;this.lastChar=i.allocUnsafe(t)}StringDecoder.prototype.write=function(e){if(e.length===0)return"";var t;var r;if(this.lastNeed){t=this.fillLast(e);if(t===undefined)return"";r=this.lastNeed;this.lastNeed=0}else{r=0}if(r>5===6)return 2;else if(e>>4===14)return 3;else if(e>>3===30)return 4;return e>>6===2?-1:-2}function utf8CheckIncomplete(e,t,r){var i=t.length-1;if(i=0){if(n>0)e.lastNeed=n-1;return n}if(--i=0){if(n>0)e.lastNeed=n-2;return n}if(--i=0){if(n>0){if(n===2)n=0;else e.lastNeed=n-3}return n}return 0}function utf8CheckExtraBytes(e,t,r){if((t[0]&192)!==128){e.lastNeed=0;return"�"}if(e.lastNeed>1&&t.length>1){if((t[1]&192)!==128){e.lastNeed=1;return"�"}if(e.lastNeed>2&&t.length>2){if((t[2]&192)!==128){e.lastNeed=2;return"�"}}}}function utf8FillLast(e){var t=this.lastTotal-this.lastNeed;var r=utf8CheckExtraBytes(this,e,t);if(r!==undefined)return r;if(this.lastNeed<=e.length){e.copy(this.lastChar,t,0,this.lastNeed);return this.lastChar.toString(this.encoding,0,this.lastTotal)}e.copy(this.lastChar,t,0,e.length);this.lastNeed-=e.length}function utf8Text(e,t){var r=utf8CheckIncomplete(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=r;var i=e.length-(r-this.lastNeed);e.copy(this.lastChar,0,i);return e.toString("utf8",t,i)}function utf8End(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed)return t+"�";return t}function utf16Text(e,t){if((e.length-t)%2===0){var r=e.toString("utf16le",t);if(r){var i=r.charCodeAt(r.length-1);if(i>=55296&&i<=56319){this.lastNeed=2;this.lastTotal=4;this.lastChar[0]=e[e.length-2];this.lastChar[1]=e[e.length-1];return r.slice(0,-1)}}return r}this.lastNeed=1;this.lastTotal=2;this.lastChar[0]=e[e.length-1];return e.toString("utf16le",t,e.length-1)}function utf16End(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,r)}return t}function base64Text(e,t){var r=(e.length-t)%3;if(r===0)return e.toString("base64",t);this.lastNeed=3-r;this.lastTotal=3;if(r===1){this.lastChar[0]=e[e.length-1]}else{this.lastChar[0]=e[e.length-2];this.lastChar[1]=e[e.length-1]}return e.toString("base64",t,e.length-r)}function base64End(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed)return t+this.lastChar.toString("base64",0,3-this.lastNeed);return t}function simpleWrite(e){return e.toString(this.encoding)}function simpleEnd(e){return e&&e.length?this.write(e):""}},9767:function(e,t,r){var i=t;i.utils=r(8911);i.common=r(5169);i.sha=r(9417);i.ripemd=r(5282);i.hmac=r(7890);i.sha1=i.sha.sha1;i.sha256=i.sha.sha256;i.sha224=i.sha.sha224;i.sha384=i.sha.sha384;i.sha512=i.sha.sha512;i.ripemd160=i.ripemd.ripemd160},5169:function(e,t,r){"use strict";var i=r(8911);var n=r(9036);function BlockHash(){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}t.BlockHash=BlockHash;BlockHash.prototype.update=function update(e,t){e=i.toArray(e,t);if(!this.pending)this.pending=e;else this.pending=this.pending.concat(e);this.pendingTotal+=e.length;if(this.pending.length>=this._delta8){e=this.pending;var r=e.length%this._delta8;this.pending=e.slice(e.length-r,e.length);if(this.pending.length===0)this.pending=null;e=i.join32(e,0,e.length-r,this.endian);for(var n=0;n>>24&255;i[n++]=e>>>16&255;i[n++]=e>>>8&255;i[n++]=e&255}else{i[n++]=e&255;i[n++]=e>>>8&255;i[n++]=e>>>16&255;i[n++]=e>>>24&255;i[n++]=0;i[n++]=0;i[n++]=0;i[n++]=0;for(a=8;athis.blockSize)e=(new this.Hash).update(e).digest();n(e.length<=this.blockSize);for(var t=e.length;t>>3}t.g0_256=g0_256;function g1_256(e){return n(e,17)^n(e,19)^e>>>10}t.g1_256=g1_256},8911:function(e,t,r){"use strict";var i=r(9036);var n=r(7526);t.inherits=n;function isSurrogatePair(e,t){if((e.charCodeAt(t)&64512)!==55296){return false}if(t<0||t+1>=e.length){return false}return(e.charCodeAt(t+1)&64512)===56320}function toArray(e,t){if(Array.isArray(e))return e.slice();if(!e)return[];var r=[];if(typeof e==="string"){if(!t){var i=0;for(var n=0;n>6|192;r[i++]=a&63|128}else if(isSurrogatePair(e,n)){a=65536+((a&1023)<<10)+(e.charCodeAt(++n)&1023);r[i++]=a>>18|240;r[i++]=a>>12&63|128;r[i++]=a>>6&63|128;r[i++]=a&63|128}else{r[i++]=a>>12|224;r[i++]=a>>6&63|128;r[i++]=a&63|128}}}else if(t==="hex"){e=e.replace(/[^a-z0-9]+/gi,"");if(e.length%2!==0)e="0"+e;for(n=0;n>>24|e>>>8&65280|e<<8&16711680|(e&255)<<24;return t>>>0}t.htonl=htonl;function toHex32(e,t){var r="";for(var i=0;i>>0}return s}t.join32=join32;function split32(e,t){var r=new Array(e.length*4);for(var i=0,n=0;i>>24;r[n+1]=a>>>16&255;r[n+2]=a>>>8&255;r[n+3]=a&255}else{r[n+3]=a>>>24;r[n+2]=a>>>16&255;r[n+1]=a>>>8&255;r[n]=a&255}}return r}t.split32=split32;function rotr32(e,t){return e>>>t|e<<32-t}t.rotr32=rotr32;function rotl32(e,t){return e<>>32-t}t.rotl32=rotl32;function sum32(e,t){return e+t>>>0}t.sum32=sum32;function sum32_3(e,t,r){return e+t+r>>>0}t.sum32_3=sum32_3;function sum32_4(e,t,r,i){return e+t+r+i>>>0}t.sum32_4=sum32_4;function sum32_5(e,t,r,i,n){return e+t+r+i+n>>>0}t.sum32_5=sum32_5;function sum64(e,t,r,i){var n=e[t];var a=e[t+1];var s=i+a>>>0;var o=(s>>0;e[t+1]=s}t.sum64=sum64;function sum64_hi(e,t,r,i){var n=t+i>>>0;var a=(n>>0}t.sum64_hi=sum64_hi;function sum64_lo(e,t,r,i){var n=t+i;return n>>>0}t.sum64_lo=sum64_lo;function sum64_4_hi(e,t,r,i,n,a,s,o){var u=0;var h=t;h=h+i>>>0;u+=h>>0;u+=h>>0;u+=h>>0}t.sum64_4_hi=sum64_4_hi;function sum64_4_lo(e,t,r,i,n,a,s,o){var u=t+i+a+o;return u>>>0}t.sum64_4_lo=sum64_4_lo;function sum64_5_hi(e,t,r,i,n,a,s,o,u,h){var d=0;var c=t;c=c+i>>>0;d+=c>>0;d+=c>>0;d+=c>>0;d+=c>>0}t.sum64_5_hi=sum64_5_hi;function sum64_5_lo(e,t,r,i,n,a,s,o,u,h){var d=t+i+a+o+h;return d>>>0}t.sum64_5_lo=sum64_5_lo;function rotr64_hi(e,t,r){var i=t<<32-r|e>>>r;return i>>>0}t.rotr64_hi=rotr64_hi;function rotr64_lo(e,t,r){var i=e<<32-r|t>>>r;return i>>>0}t.rotr64_lo=rotr64_lo;function shr64_hi(e,t,r){return e>>>r}t.shr64_hi=shr64_hi;function shr64_lo(e,t,r){var i=e<<32-r|t>>>r;return i>>>0}t.shr64_lo=shr64_lo},8242:function(e,t,r){"use strict";var i=r(9767);var n=r(6249);var a=r(9036);function HmacDRBG(e){if(!(this instanceof HmacDRBG))return new HmacDRBG(e);this.hash=e.hash;this.predResist=!!e.predResist;this.outLen=this.hash.outSize;this.minEntropy=e.minEntropy||this.hash.hmacStrength;this._reseed=null;this.reseedInterval=null;this.K=null;this.V=null;var t=n.toArray(e.entropy,e.entropyEnc||"hex");var r=n.toArray(e.nonce,e.nonceEnc||"hex");var i=n.toArray(e.pers,e.persEnc||"hex");a(t.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits");this._init(t,r,i)}e.exports=HmacDRBG;HmacDRBG.prototype._init=function init(e,t,r){var i=e.concat(t).concat(r);this.K=new Array(this.outLen/8);this.V=new Array(this.outLen/8);for(var n=0;n=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits");this._update(e.concat(r||[]));this._reseed=1};HmacDRBG.prototype.generate=function generate(e,t,r,i){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");if(typeof t!=="string"){i=r;r=t;t=null}if(r){r=n.toArray(r,i||"hex");this._update(r)}var a=[];while(a.length56){this._block.fill(0,this._blockOffset,64);this._update();this._blockOffset=0}this._block.fill(0,this._blockOffset,56);this._block.writeUInt32LE(this._length[0],56);this._block.writeUInt32LE(this._length[1],60);this._update();var e=a.allocUnsafe(16);e.writeInt32LE(this._a,0);e.writeInt32LE(this._b,4);e.writeInt32LE(this._c,8);e.writeInt32LE(this._d,12);return e};function rotl(e,t){return e<>>32-t}function fnF(e,t,r,i,n,a,s){return rotl(e+(t&r|~t&i)+n+a|0,s)+t|0}function fnG(e,t,r,i,n,a,s){return rotl(e+(t&i|r&~i)+n+a|0,s)+t|0}function fnH(e,t,r,i,n,a,s){return rotl(e+(t^r^i)+n+a|0,s)+t|0}function fnI(e,t,r,i,n,a,s){return rotl(e+(r^(t|~i))+n+a|0,s)+t|0}e.exports=MD5},148:function(e,t,r){var i=r(6884);var n=r(6069);function MillerRabin(e){this.rand=e||new n.Rand}e.exports=MillerRabin;MillerRabin.create=function create(e){return new MillerRabin(e)};MillerRabin.prototype._randbelow=function _randbelow(e){var t=e.bitLength();var r=Math.ceil(t/8);do{var n=new i(this.rand.generate(r))}while(n.cmp(e)>=0);return n};MillerRabin.prototype._randrange=function _randrange(e,t){var r=t.sub(e);return e.add(this._randbelow(r))};MillerRabin.prototype.test=function test(e,t,r){var n=e.bitLength();var a=i.mont(e);var s=new i(1).toRed(a);if(!t)t=Math.max(1,n/48|0);var o=e.subn(1);for(var u=0;!o.testn(u);u++){}var h=e.shrn(u);var d=o.toRed(a);var c=true;for(;t>0;t--){var l=this._randrange(new i(2),o);if(r)r(l);var p=l.toRed(a).redPow(h);if(p.cmp(s)===0||p.cmp(d)===0)continue;for(var b=1;b0;t--){var d=this._randrange(new i(2),s);var c=e.gcd(d);if(c.cmpn(1)!==0)return c;var l=d.toRed(n).redPow(u);if(l.cmp(a)===0||l.cmp(h)===0)continue;for(var p=1;p>8;var s=n&255;if(a)r.push(a,s);else r.push(s)}}return r}r.toArray=toArray;function zero2(e){if(e.length===1)return"0"+e;else return e}r.zero2=zero2;function toHex(e){var t="";for(var r=0;r=6?"utf-8":"binary"}else{t="utf-8"}e.exports=t},721:function(e){var t=Math.pow(2,30)-1;e.exports=function(e,r){if(typeof e!=="number"){throw new TypeError("Iterations not a number")}if(e<0){throw new TypeError("Bad iterations")}if(typeof r!=="number"){throw new TypeError("Key length not a number")}if(r<0||r>t||r!==r){throw new TypeError("Bad key length")}}},2419:function(e,t,r){var i={md5:16,sha1:20,sha224:28,sha256:32,sha384:48,sha512:64,rmd160:20,ripemd160:20};var n=r(2730);var a=r(3118).Buffer;var s=r(721);var o=r(908);var u=r(7409);function pbkdf2(e,t,r,h,d){s(r,h);e=u(e,o,"Password");t=u(t,o,"Salt");d=d||"sha1";var c=a.allocUnsafe(h);var l=a.allocUnsafe(t.length+4);t.copy(l,0,0,t.length);var p=0;var b=i[d];var v=Math.ceil(h/b);for(var m=1;m<=v;m++){l.writeUInt32BE(m,t.length);var y=n(d,e).update(l).digest();var g=y;for(var _=1;_u||new s(t).cmp(a.modulus)>=0){throw new Error("decryption error")}var c;if(r){c=h(new s(t),a)}else{c=o(t,a)}var l=d.alloc(u-c.length);c=d.concat([l,c],u);if(n===4){return oaep(a,c)}else if(n===1){return pkcs1(a,c,r)}else if(n===3){return c}else{throw new Error("unknown padding")}};function oaep(e,t){var r=e.modulus.byteLength();var i=u("sha1").update(d.alloc(0)).digest();var s=i.length;if(t[0]!==0){throw new Error("decryption error")}var o=t.slice(1,s+1);var h=t.slice(s+1);var c=a(o,n(h,s));var l=a(h,n(c,r-s-1));if(compare(i,l.slice(0,s))){throw new Error("decryption error")}var p=s;while(l[p]===0){p++}if(l[p++]!==1){throw new Error("decryption error")}return l.slice(p)}function pkcs1(e,t,r){var i=t.slice(0,2);var n=2;var a=0;while(t[n++]!==0){if(n>=t.length){a++;break}}var s=t.slice(2,n-1);if(i.toString("hex")!=="0002"&&!r||i.toString("hex")!=="0001"&&r){a++}if(s.length<8){a++}if(a){throw new Error("decryption error")}return t.slice(n)}function compare(e,t){e=d.from(e);t=d.from(t);var r=0;var i=e.length;if(e.length!==t.length){r++;i=Math.min(e.length,t.length)}var n=-1;while(++n=0){throw new Error("data too long for modulus")}}else{throw new Error("unknown padding")}if(r){return d(s,a)}else{return h(s,a)}};function oaep(e,t){var r=e.modulus.byteLength();var i=t.length;var h=a("sha1").update(c.alloc(0)).digest();var d=h.length;var l=2*d;if(i>r-l-2){throw new Error("message too long")}var p=c.alloc(r-i-l-2);var b=r-d-1;var v=n(d);var m=o(c.concat([h,p,c.alloc(1,1),t],b),s(v,b));var y=o(v,s(m,d));return new u(c.concat([c.alloc(1),y,m],r))}function pkcs1(e,t,r){var i=t.length;var n=e.modulus.byteLength();if(i>n-11){throw new Error("message too long")}var a;if(r){a=c.alloc(n-i-3,255)}else{a=nonZero(n-i-3)}return new u(c.concat([c.from([0,r?1:2]),a,c.alloc(1),t],n))}function nonZero(e){var t=c.allocUnsafe(e);var r=0;var i=n(e*2);var a=0;var s;while(rn)throw new RangeError("requested too many random bytes");var r=a.allocUnsafe(e);if(e>0){if(e>i){for(var o=0;ou||e<0){throw new TypeError("offset must be a uint32")}if(e>s||e>t){throw new RangeError("offset out of range")}}function assertSize(e,t,r){if(typeof e!=="number"||e!==e){throw new TypeError("size must be a number")}if(e>u||e<0){throw new TypeError("size must be a uint32")}if(e+t>r||e>s){throw new RangeError("buffer too small")}}if(o&&o.getRandomValues||!process.browser){t.randomFill=randomFill;t.randomFillSync=randomFillSync}else{t.randomFill=oldBrowser;t.randomFillSync=oldBrowser}function randomFill(e,t,r,i){if(!a.isBuffer(e)&&!(e instanceof global.Uint8Array)){throw new TypeError('"buf" argument must be a Buffer or Uint8Array')}if(typeof t==="function"){i=t;t=0;r=e.length}else if(typeof r==="function"){i=r;r=e.length-t}else if(typeof i!=="function"){throw new TypeError('"cb" argument must be a function')}assertOffset(t,e.length);assertSize(r,t,e.length);return actualFill(e,t,r,i)}function actualFill(e,t,r,i){if(process.browser){var a=e.buffer;var s=new Uint8Array(a,t,r);o.getRandomValues(s);if(i){process.nextTick((function(){i(null,e)}));return}return e}if(i){n(r,(function(r,n){if(r){return i(r)}n.copy(e,t);i(null,e)}));return}var u=n(r);u.copy(e,t);return e}function randomFillSync(e,t,r){if(typeof t==="undefined"){t=0}if(!a.isBuffer(e)&&!(e instanceof global.Uint8Array)){throw new TypeError('"buf" argument must be a Buffer or Uint8Array')}assertOffset(t,e.length);if(r===undefined)r=e.length-t;assertSize(r,t,e.length);return actualFill(e,t,r)}},7455:function(e,t,r){"use strict";var i=r(4300).Buffer;var n=r(7526);var a=r(3421);var s=new Array(16);var o=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13];var u=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11];var h=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6];var d=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11];var c=[0,1518500249,1859775393,2400959708,2840853838];var l=[1352829926,1548603684,1836072691,2053994217,0];function RIPEMD160(){a.call(this,64);this._a=1732584193;this._b=4023233417;this._c=2562383102;this._d=271733878;this._e=3285377520}n(RIPEMD160,a);RIPEMD160.prototype._update=function(){var e=s;for(var t=0;t<16;++t)e[t]=this._block.readInt32LE(t*4);var r=this._a|0;var i=this._b|0;var n=this._c|0;var a=this._d|0;var p=this._e|0;var b=this._a|0;var v=this._b|0;var m=this._c|0;var y=this._d|0;var g=this._e|0;for(var _=0;_<80;_+=1){var w;var M;if(_<16){w=fn1(r,i,n,a,p,e[o[_]],c[0],h[_]);M=fn5(b,v,m,y,g,e[u[_]],l[0],d[_])}else if(_<32){w=fn2(r,i,n,a,p,e[o[_]],c[1],h[_]);M=fn4(b,v,m,y,g,e[u[_]],l[1],d[_])}else if(_<48){w=fn3(r,i,n,a,p,e[o[_]],c[2],h[_]);M=fn3(b,v,m,y,g,e[u[_]],l[2],d[_])}else if(_<64){w=fn4(r,i,n,a,p,e[o[_]],c[3],h[_]);M=fn2(b,v,m,y,g,e[u[_]],l[3],d[_])}else{w=fn5(r,i,n,a,p,e[o[_]],c[4],h[_]);M=fn1(b,v,m,y,g,e[u[_]],l[4],d[_])}r=p;p=a;a=rotl(n,10);n=i;i=w;b=g;g=y;y=rotl(m,10);m=v;v=M}var E=this._b+n+y|0;this._b=this._c+a+g|0;this._c=this._d+p+b|0;this._d=this._e+r+v|0;this._e=this._a+i+m|0;this._a=E};RIPEMD160.prototype._digest=function(){this._block[this._blockOffset++]=128;if(this._blockOffset>56){this._block.fill(0,this._blockOffset,64);this._update();this._blockOffset=0}this._block.fill(0,this._blockOffset,56);this._block.writeUInt32LE(this._length[0],56);this._block.writeUInt32LE(this._length[1],60);this._update();var e=i.alloc?i.alloc(20):new i(20);e.writeInt32LE(this._a,0);e.writeInt32LE(this._b,4);e.writeInt32LE(this._c,8);e.writeInt32LE(this._d,12);e.writeInt32LE(this._e,16);return e};function rotl(e,t){return e<>>32-t}function fn1(e,t,r,i,n,a,s,o){return rotl(e+(t^r^i)+a+s|0,o)+n|0}function fn2(e,t,r,i,n,a,s,o){return rotl(e+(t&r|~t&i)+a+s|0,o)+n|0}function fn3(e,t,r,i,n,a,s,o){return rotl(e+((t|~r)^i)+a+s|0,o)+n|0}function fn4(e,t,r,i,n,a,s,o){return rotl(e+(t&i|r&~i)+a+s|0,o)+n|0}function fn5(e,t,r,i,n,a,s,o){return rotl(e+(t^(r|~i))+a+s|0,o)+n|0}e.exports=RIPEMD160},3118:function(e,t,r){var i=r(4300);var n=i.Buffer;function copyProps(e,t){for(var r in e){t[r]=e[r]}}if(n.from&&n.alloc&&n.allocUnsafe&&n.allocUnsafeSlow){e.exports=i}else{copyProps(i,t);t.Buffer=SafeBuffer}function SafeBuffer(e,t,r){return n(e,t,r)}SafeBuffer.prototype=Object.create(n.prototype);copyProps(n,SafeBuffer);SafeBuffer.from=function(e,t,r){if(typeof e==="number"){throw new TypeError("Argument must not be a number")}return n(e,t,r)};SafeBuffer.alloc=function(e,t,r){if(typeof e!=="number"){throw new TypeError("Argument must be a number")}var i=n(e);if(t!==undefined){if(typeof r==="string"){i.fill(t,r)}else{i.fill(t)}}else{i.fill(0)}return i};SafeBuffer.allocUnsafe=function(e){if(typeof e!=="number"){throw new TypeError("Argument must be a number")}return n(e)};SafeBuffer.allocUnsafeSlow=function(e){if(typeof e!=="number"){throw new TypeError("Argument must be a number")}return i.SlowBuffer(e)}},7782:function(e,t,r){var i=r(3118).Buffer;function Hash(e,t){this._block=i.alloc(e);this._finalSize=t;this._blockSize=e;this._len=0}Hash.prototype.update=function(e,t){if(typeof e==="string"){t=t||"utf8";e=i.from(e,t)}var r=this._block;var n=this._blockSize;var a=e.length;var s=this._len;for(var o=0;o=this._finalSize){this._update(this._block);this._block.fill(0)}var r=this._len*8;if(r<=4294967295){this._block.writeUInt32BE(r,this._blockSize-4)}else{var i=(r&4294967295)>>>0;var n=(r-i)/4294967296;this._block.writeUInt32BE(n,this._blockSize-8);this._block.writeUInt32BE(i,this._blockSize-4)}this._update(this._block);var a=this._hash();return e?a.toString(e):a};Hash.prototype._update=function(){throw new Error("_update must be implemented by subclass")};e.exports=Hash},1862:function(e,t,r){var i=e.exports=function SHA(e){e=e.toLowerCase();var t=i[e];if(!t)throw new Error(e+" is not supported (we accept pull requests)");return new t};i.sha=r(2003);i.sha1=r(5645);i.sha224=r(7741);i.sha256=r(9642);i.sha384=r(3869);i.sha512=r(3741)},2003:function(e,t,r){var i=r(7526);var n=r(7782);var a=r(3118).Buffer;var s=[1518500249,1859775393,2400959708|0,3395469782|0];var o=new Array(80);function Sha(){this.init();this._w=o;n.call(this,64,56)}i(Sha,n);Sha.prototype.init=function(){this._a=1732584193;this._b=4023233417;this._c=2562383102;this._d=271733878;this._e=3285377520;return this};function rotl5(e){return e<<5|e>>>27}function rotl30(e){return e<<30|e>>>2}function ft(e,t,r,i){if(e===0)return t&r|~t&i;if(e===2)return t&r|t&i|r&i;return t^r^i}Sha.prototype._update=function(e){var t=this._w;var r=this._a|0;var i=this._b|0;var n=this._c|0;var a=this._d|0;var o=this._e|0;for(var u=0;u<16;++u)t[u]=e.readInt32BE(u*4);for(;u<80;++u)t[u]=t[u-3]^t[u-8]^t[u-14]^t[u-16];for(var h=0;h<80;++h){var d=~~(h/20);var c=rotl5(r)+ft(d,i,n,a)+o+t[h]+s[d]|0;o=a;a=n;n=rotl30(i);i=r;r=c}this._a=r+this._a|0;this._b=i+this._b|0;this._c=n+this._c|0;this._d=a+this._d|0;this._e=o+this._e|0};Sha.prototype._hash=function(){var e=a.allocUnsafe(20);e.writeInt32BE(this._a|0,0);e.writeInt32BE(this._b|0,4);e.writeInt32BE(this._c|0,8);e.writeInt32BE(this._d|0,12);e.writeInt32BE(this._e|0,16);return e};e.exports=Sha},5645:function(e,t,r){var i=r(7526);var n=r(7782);var a=r(3118).Buffer;var s=[1518500249,1859775393,2400959708|0,3395469782|0];var o=new Array(80);function Sha1(){this.init();this._w=o;n.call(this,64,56)}i(Sha1,n);Sha1.prototype.init=function(){this._a=1732584193;this._b=4023233417;this._c=2562383102;this._d=271733878;this._e=3285377520;return this};function rotl1(e){return e<<1|e>>>31}function rotl5(e){return e<<5|e>>>27}function rotl30(e){return e<<30|e>>>2}function ft(e,t,r,i){if(e===0)return t&r|~t&i;if(e===2)return t&r|t&i|r&i;return t^r^i}Sha1.prototype._update=function(e){var t=this._w;var r=this._a|0;var i=this._b|0;var n=this._c|0;var a=this._d|0;var o=this._e|0;for(var u=0;u<16;++u)t[u]=e.readInt32BE(u*4);for(;u<80;++u)t[u]=rotl1(t[u-3]^t[u-8]^t[u-14]^t[u-16]);for(var h=0;h<80;++h){var d=~~(h/20);var c=rotl5(r)+ft(d,i,n,a)+o+t[h]+s[d]|0;o=a;a=n;n=rotl30(i);i=r;r=c}this._a=r+this._a|0;this._b=i+this._b|0;this._c=n+this._c|0;this._d=a+this._d|0;this._e=o+this._e|0};Sha1.prototype._hash=function(){var e=a.allocUnsafe(20);e.writeInt32BE(this._a|0,0);e.writeInt32BE(this._b|0,4);e.writeInt32BE(this._c|0,8);e.writeInt32BE(this._d|0,12);e.writeInt32BE(this._e|0,16);return e};e.exports=Sha1},7741:function(e,t,r){var i=r(7526);var n=r(9642);var a=r(7782);var s=r(3118).Buffer;var o=new Array(64);function Sha224(){this.init();this._w=o;a.call(this,64,56)}i(Sha224,n);Sha224.prototype.init=function(){this._a=3238371032;this._b=914150663;this._c=812702999;this._d=4144912697;this._e=4290775857;this._f=1750603025;this._g=1694076839;this._h=3204075428;return this};Sha224.prototype._hash=function(){var e=s.allocUnsafe(28);e.writeInt32BE(this._a,0);e.writeInt32BE(this._b,4);e.writeInt32BE(this._c,8);e.writeInt32BE(this._d,12);e.writeInt32BE(this._e,16);e.writeInt32BE(this._f,20);e.writeInt32BE(this._g,24);return e};e.exports=Sha224},9642:function(e,t,r){var i=r(7526);var n=r(7782);var a=r(3118).Buffer;var s=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298];var o=new Array(64);function Sha256(){this.init();this._w=o;n.call(this,64,56)}i(Sha256,n);Sha256.prototype.init=function(){this._a=1779033703;this._b=3144134277;this._c=1013904242;this._d=2773480762;this._e=1359893119;this._f=2600822924;this._g=528734635;this._h=1541459225;return this};function ch(e,t,r){return r^e&(t^r)}function maj(e,t,r){return e&t|r&(e|t)}function sigma0(e){return(e>>>2|e<<30)^(e>>>13|e<<19)^(e>>>22|e<<10)}function sigma1(e){return(e>>>6|e<<26)^(e>>>11|e<<21)^(e>>>25|e<<7)}function gamma0(e){return(e>>>7|e<<25)^(e>>>18|e<<14)^e>>>3}function gamma1(e){return(e>>>17|e<<15)^(e>>>19|e<<13)^e>>>10}Sha256.prototype._update=function(e){var t=this._w;var r=this._a|0;var i=this._b|0;var n=this._c|0;var a=this._d|0;var o=this._e|0;var u=this._f|0;var h=this._g|0;var d=this._h|0;for(var c=0;c<16;++c)t[c]=e.readInt32BE(c*4);for(;c<64;++c)t[c]=gamma1(t[c-2])+t[c-7]+gamma0(t[c-15])+t[c-16]|0;for(var l=0;l<64;++l){var p=d+sigma1(o)+ch(o,u,h)+s[l]+t[l]|0;var b=sigma0(r)+maj(r,i,n)|0;d=h;h=u;u=o;o=a+p|0;a=n;n=i;i=r;r=p+b|0}this._a=r+this._a|0;this._b=i+this._b|0;this._c=n+this._c|0;this._d=a+this._d|0;this._e=o+this._e|0;this._f=u+this._f|0;this._g=h+this._g|0;this._h=d+this._h|0};Sha256.prototype._hash=function(){var e=a.allocUnsafe(32);e.writeInt32BE(this._a,0);e.writeInt32BE(this._b,4);e.writeInt32BE(this._c,8);e.writeInt32BE(this._d,12);e.writeInt32BE(this._e,16);e.writeInt32BE(this._f,20);e.writeInt32BE(this._g,24);e.writeInt32BE(this._h,28);return e};e.exports=Sha256},3869:function(e,t,r){var i=r(7526);var n=r(3741);var a=r(7782);var s=r(3118).Buffer;var o=new Array(160);function Sha384(){this.init();this._w=o;a.call(this,128,112)}i(Sha384,n);Sha384.prototype.init=function(){this._ah=3418070365;this._bh=1654270250;this._ch=2438529370;this._dh=355462360;this._eh=1731405415;this._fh=2394180231;this._gh=3675008525;this._hh=1203062813;this._al=3238371032;this._bl=914150663;this._cl=812702999;this._dl=4144912697;this._el=4290775857;this._fl=1750603025;this._gl=1694076839;this._hl=3204075428;return this};Sha384.prototype._hash=function(){var e=s.allocUnsafe(48);function writeInt64BE(t,r,i){e.writeInt32BE(t,i);e.writeInt32BE(r,i+4)}writeInt64BE(this._ah,this._al,0);writeInt64BE(this._bh,this._bl,8);writeInt64BE(this._ch,this._cl,16);writeInt64BE(this._dh,this._dl,24);writeInt64BE(this._eh,this._el,32);writeInt64BE(this._fh,this._fl,40);return e};e.exports=Sha384},3741:function(e,t,r){var i=r(7526);var n=r(7782);var a=r(3118).Buffer;var s=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591];var o=new Array(160);function Sha512(){this.init();this._w=o;n.call(this,128,112)}i(Sha512,n);Sha512.prototype.init=function(){this._ah=1779033703;this._bh=3144134277;this._ch=1013904242;this._dh=2773480762;this._eh=1359893119;this._fh=2600822924;this._gh=528734635;this._hh=1541459225;this._al=4089235720;this._bl=2227873595;this._cl=4271175723;this._dl=1595750129;this._el=2917565137;this._fl=725511199;this._gl=4215389547;this._hl=327033209;return this};function Ch(e,t,r){return r^e&(t^r)}function maj(e,t,r){return e&t|r&(e|t)}function sigma0(e,t){return(e>>>28|t<<4)^(t>>>2|e<<30)^(t>>>7|e<<25)}function sigma1(e,t){return(e>>>14|t<<18)^(e>>>18|t<<14)^(t>>>9|e<<23)}function Gamma0(e,t){return(e>>>1|t<<31)^(e>>>8|t<<24)^e>>>7}function Gamma0l(e,t){return(e>>>1|t<<31)^(e>>>8|t<<24)^(e>>>7|t<<25)}function Gamma1(e,t){return(e>>>19|t<<13)^(t>>>29|e<<3)^e>>>6}function Gamma1l(e,t){return(e>>>19|t<<13)^(t>>>29|e<<3)^(e>>>6|t<<26)}function getCarry(e,t){return e>>>0>>0?1:0}Sha512.prototype._update=function(e){var t=this._w;var r=this._ah|0;var i=this._bh|0;var n=this._ch|0;var a=this._dh|0;var o=this._eh|0;var u=this._fh|0;var h=this._gh|0;var d=this._hh|0;var c=this._al|0;var l=this._bl|0;var p=this._cl|0;var b=this._dl|0;var v=this._el|0;var m=this._fl|0;var y=this._gl|0;var g=this._hl|0;for(var _=0;_<32;_+=2){t[_]=e.readInt32BE(_*4);t[_+1]=e.readInt32BE(_*4+4)}for(;_<160;_+=2){var w=t[_-15*2];var M=t[_-15*2+1];var E=Gamma0(w,M);var B=Gamma0l(M,w);w=t[_-2*2];M=t[_-2*2+1];var k=Gamma1(w,M);var A=Gamma1l(M,w);var N=t[_-7*2];var P=t[_-7*2+1];var x=t[_-16*2];var C=t[_-16*2+1];var T=B+P|0;var I=E+N+getCarry(T,B)|0;T=T+A|0;I=I+k+getCarry(T,A)|0;T=T+C|0;I=I+x+getCarry(T,C)|0;t[_]=I;t[_+1]=T}for(var D=0;D<160;D+=2){I=t[D];T=t[D+1];var O=maj(r,i,n);var j=maj(c,l,p);var L=sigma0(r,c);var q=sigma0(c,r);var H=sigma1(o,v);var F=sigma1(v,o);var U=s[D];var z=s[D+1];var W=Ch(o,u,h);var V=Ch(v,m,y);var G=g+F|0;var J=d+H+getCarry(G,g)|0;G=G+V|0;J=J+W+getCarry(G,V)|0;G=G+z|0;J=J+U+getCarry(G,z)|0;G=G+T|0;J=J+I+getCarry(G,T)|0;var Z=q+j|0;var X=L+O+getCarry(Z,q)|0;d=h;g=y;h=u;y=m;u=o;m=v;v=b+G|0;o=a+J+getCarry(v,b)|0;a=n;b=p;n=i;p=l;i=r;l=c;c=G+Z|0;r=J+X+getCarry(c,G)|0}this._al=this._al+c|0;this._bl=this._bl+l|0;this._cl=this._cl+p|0;this._dl=this._dl+b|0;this._el=this._el+v|0;this._fl=this._fl+m|0;this._gl=this._gl+y|0;this._hl=this._hl+g|0;this._ah=this._ah+r+getCarry(this._al,c)|0;this._bh=this._bh+i+getCarry(this._bl,l)|0;this._ch=this._ch+n+getCarry(this._cl,p)|0;this._dh=this._dh+a+getCarry(this._dl,b)|0;this._eh=this._eh+o+getCarry(this._el,v)|0;this._fh=this._fh+u+getCarry(this._fl,m)|0;this._gh=this._gh+h+getCarry(this._gl,y)|0;this._hh=this._hh+d+getCarry(this._hl,g)|0};Sha512.prototype._hash=function(){var e=a.allocUnsafe(64);function writeInt64BE(t,r,i){e.writeInt32BE(t,i);e.writeInt32BE(r,i+4)}writeInt64BE(this._ah,this._al,0);writeInt64BE(this._bh,this._bl,8);writeInt64BE(this._ch,this._cl,16);writeInt64BE(this._dh,this._dl,24);writeInt64BE(this._eh,this._el,32);writeInt64BE(this._fh,this._fl,40);writeInt64BE(this._gh,this._gl,48);writeInt64BE(this._hh,this._hl,56);return e};e.exports=Sha512},5121:function(e){e.exports=deprecate;function deprecate(e,t){if(config("noDeprecation")){return e}var r=false;function deprecated(){if(!r){if(config("throwDeprecation")){throw new Error(t)}else if(config("traceDeprecation")){console.trace(t)}else{console.warn(t)}r=true}return e.apply(this,arguments)}return deprecated}function config(e){try{if(!global.localStorage)return false}catch(e){return false}var t=global.localStorage[e];if(null==t)return false;return String(t).toLowerCase()==="true"}},4300:function(e){"use strict";e.exports=require("buffer")},6113:function(e){"use strict";e.exports=require("crypto")},2361:function(e){"use strict";e.exports=require("events")},2781:function(e){"use strict";e.exports=require("stream")},1576:function(e){"use strict";e.exports=require("string_decoder")},3837:function(e){"use strict";e.exports=require("util")},6144:function(e){"use strict";e.exports=require("vm")},9234:function(e){"use strict";e.exports=JSON.parse('{"aes-128-ecb":{"cipher":"AES","key":128,"iv":0,"mode":"ECB","type":"block"},"aes-192-ecb":{"cipher":"AES","key":192,"iv":0,"mode":"ECB","type":"block"},"aes-256-ecb":{"cipher":"AES","key":256,"iv":0,"mode":"ECB","type":"block"},"aes-128-cbc":{"cipher":"AES","key":128,"iv":16,"mode":"CBC","type":"block"},"aes-192-cbc":{"cipher":"AES","key":192,"iv":16,"mode":"CBC","type":"block"},"aes-256-cbc":{"cipher":"AES","key":256,"iv":16,"mode":"CBC","type":"block"},"aes128":{"cipher":"AES","key":128,"iv":16,"mode":"CBC","type":"block"},"aes192":{"cipher":"AES","key":192,"iv":16,"mode":"CBC","type":"block"},"aes256":{"cipher":"AES","key":256,"iv":16,"mode":"CBC","type":"block"},"aes-128-cfb":{"cipher":"AES","key":128,"iv":16,"mode":"CFB","type":"stream"},"aes-192-cfb":{"cipher":"AES","key":192,"iv":16,"mode":"CFB","type":"stream"},"aes-256-cfb":{"cipher":"AES","key":256,"iv":16,"mode":"CFB","type":"stream"},"aes-128-cfb8":{"cipher":"AES","key":128,"iv":16,"mode":"CFB8","type":"stream"},"aes-192-cfb8":{"cipher":"AES","key":192,"iv":16,"mode":"CFB8","type":"stream"},"aes-256-cfb8":{"cipher":"AES","key":256,"iv":16,"mode":"CFB8","type":"stream"},"aes-128-cfb1":{"cipher":"AES","key":128,"iv":16,"mode":"CFB1","type":"stream"},"aes-192-cfb1":{"cipher":"AES","key":192,"iv":16,"mode":"CFB1","type":"stream"},"aes-256-cfb1":{"cipher":"AES","key":256,"iv":16,"mode":"CFB1","type":"stream"},"aes-128-ofb":{"cipher":"AES","key":128,"iv":16,"mode":"OFB","type":"stream"},"aes-192-ofb":{"cipher":"AES","key":192,"iv":16,"mode":"OFB","type":"stream"},"aes-256-ofb":{"cipher":"AES","key":256,"iv":16,"mode":"OFB","type":"stream"},"aes-128-ctr":{"cipher":"AES","key":128,"iv":16,"mode":"CTR","type":"stream"},"aes-192-ctr":{"cipher":"AES","key":192,"iv":16,"mode":"CTR","type":"stream"},"aes-256-ctr":{"cipher":"AES","key":256,"iv":16,"mode":"CTR","type":"stream"},"aes-128-gcm":{"cipher":"AES","key":128,"iv":12,"mode":"GCM","type":"auth"},"aes-192-gcm":{"cipher":"AES","key":192,"iv":12,"mode":"GCM","type":"auth"},"aes-256-gcm":{"cipher":"AES","key":256,"iv":12,"mode":"GCM","type":"auth"}}')},26:function(e){"use strict";e.exports=JSON.parse('{"sha224WithRSAEncryption":{"sign":"rsa","hash":"sha224","id":"302d300d06096086480165030402040500041c"},"RSA-SHA224":{"sign":"ecdsa/rsa","hash":"sha224","id":"302d300d06096086480165030402040500041c"},"sha256WithRSAEncryption":{"sign":"rsa","hash":"sha256","id":"3031300d060960864801650304020105000420"},"RSA-SHA256":{"sign":"ecdsa/rsa","hash":"sha256","id":"3031300d060960864801650304020105000420"},"sha384WithRSAEncryption":{"sign":"rsa","hash":"sha384","id":"3041300d060960864801650304020205000430"},"RSA-SHA384":{"sign":"ecdsa/rsa","hash":"sha384","id":"3041300d060960864801650304020205000430"},"sha512WithRSAEncryption":{"sign":"rsa","hash":"sha512","id":"3051300d060960864801650304020305000440"},"RSA-SHA512":{"sign":"ecdsa/rsa","hash":"sha512","id":"3051300d060960864801650304020305000440"},"RSA-SHA1":{"sign":"rsa","hash":"sha1","id":"3021300906052b0e03021a05000414"},"ecdsa-with-SHA1":{"sign":"ecdsa","hash":"sha1","id":""},"sha256":{"sign":"ecdsa","hash":"sha256","id":""},"sha224":{"sign":"ecdsa","hash":"sha224","id":""},"sha384":{"sign":"ecdsa","hash":"sha384","id":""},"sha512":{"sign":"ecdsa","hash":"sha512","id":""},"DSA-SHA":{"sign":"dsa","hash":"sha1","id":""},"DSA-SHA1":{"sign":"dsa","hash":"sha1","id":""},"DSA":{"sign":"dsa","hash":"sha1","id":""},"DSA-WITH-SHA224":{"sign":"dsa","hash":"sha224","id":""},"DSA-SHA224":{"sign":"dsa","hash":"sha224","id":""},"DSA-WITH-SHA256":{"sign":"dsa","hash":"sha256","id":""},"DSA-SHA256":{"sign":"dsa","hash":"sha256","id":""},"DSA-WITH-SHA384":{"sign":"dsa","hash":"sha384","id":""},"DSA-SHA384":{"sign":"dsa","hash":"sha384","id":""},"DSA-WITH-SHA512":{"sign":"dsa","hash":"sha512","id":""},"DSA-SHA512":{"sign":"dsa","hash":"sha512","id":""},"DSA-RIPEMD160":{"sign":"dsa","hash":"rmd160","id":""},"ripemd160WithRSA":{"sign":"rsa","hash":"rmd160","id":"3021300906052b2403020105000414"},"RSA-RIPEMD160":{"sign":"rsa","hash":"rmd160","id":"3021300906052b2403020105000414"},"md5WithRSAEncryption":{"sign":"rsa","hash":"md5","id":"3020300c06082a864886f70d020505000410"},"RSA-MD5":{"sign":"rsa","hash":"md5","id":"3020300c06082a864886f70d020505000410"}}')},9167:function(e){"use strict";e.exports=JSON.parse('{"1.3.132.0.10":"secp256k1","1.3.132.0.33":"p224","1.2.840.10045.3.1.1":"p192","1.2.840.10045.3.1.7":"p256","1.3.132.0.34":"p384","1.3.132.0.35":"p521"}')},3418:function(e){"use strict";e.exports=JSON.parse('{"modp1":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a63a3620ffffffffffffffff"},"modp2":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece65381ffffffffffffffff"},"modp5":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca237327ffffffffffffffff"},"modp14":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aacaa68ffffffffffffffff"},"modp15":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a93ad2caffffffffffffffff"},"modp16":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c934063199ffffffffffffffff"},"modp17":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dcc4024ffffffffffffffff"},"modp18":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dbe115974a3926f12fee5e438777cb6a932df8cd8bec4d073b931ba3bc832b68d9dd300741fa7bf8afc47ed2576f6936ba424663aab639c5ae4f5683423b4742bf1c978238f16cbe39d652de3fdb8befc848ad922222e04a4037c0713eb57a81a23f0c73473fc646cea306b4bcbc8862f8385ddfa9d4b7fa2c087e879683303ed5bdd3a062b3cf5b3a278a66d2a13f83f44f82ddf310ee074ab6a364597e899a0255dc164f31cc50846851df9ab48195ded7ea1b1d510bd7ee74d73faf36bc31ecfa268359046f4eb879f924009438b481c6cd7889a002ed5ee382bc9190da6fc026e479558e4475677e9aa9e3050e2765694dfc81f56e880b96e7160c980dd98edd3dfffffffffffffffff"}}')},763:function(e){"use strict";e.exports={i8:"6.5.3"}},8675:function(e){"use strict";e.exports=JSON.parse('{"2.16.840.1.101.3.4.1.1":"aes-128-ecb","2.16.840.1.101.3.4.1.2":"aes-128-cbc","2.16.840.1.101.3.4.1.3":"aes-128-ofb","2.16.840.1.101.3.4.1.4":"aes-128-cfb","2.16.840.1.101.3.4.1.21":"aes-192-ecb","2.16.840.1.101.3.4.1.22":"aes-192-cbc","2.16.840.1.101.3.4.1.23":"aes-192-ofb","2.16.840.1.101.3.4.1.24":"aes-192-cfb","2.16.840.1.101.3.4.1.41":"aes-256-ecb","2.16.840.1.101.3.4.1.42":"aes-256-cbc","2.16.840.1.101.3.4.1.43":"aes-256-ofb","2.16.840.1.101.3.4.1.44":"aes-256-cfb"}')}};var t={};function __nccwpck_require__(r){var i=t[r];if(i!==undefined){return i.exports}var n=t[r]={id:r,loaded:false,exports:{}};var a=true;try{e[r].call(n.exports,n,n.exports,__nccwpck_require__);a=false}finally{if(a)delete t[r]}n.loaded=true;return n.exports}!function(){__nccwpck_require__.nmd=function(e){e.paths=[];if(!e.children)e.children=[];return e}}();if(typeof __nccwpck_require__!=="undefined")__nccwpck_require__.ab=__dirname+"/";var r={};!function(){"use strict";var e=r;e.randomBytes=e.rng=e.pseudoRandomBytes=e.prng=__nccwpck_require__(2711);e.createHash=e.Hash=__nccwpck_require__(2539);e.createHmac=e.Hmac=__nccwpck_require__(2730);var t=__nccwpck_require__(5703);var i=Object.keys(t);var n=["sha1","sha224","sha256","sha384","sha512","md5","rmd160"].concat(i);e.getHashes=function(){return n};var a=__nccwpck_require__(785);e.pbkdf2=a.pbkdf2;e.pbkdf2Sync=a.pbkdf2Sync;var s=__nccwpck_require__(57);e.Cipher=s.Cipher;e.createCipher=s.createCipher;e.Cipheriv=s.Cipheriv;e.createCipheriv=s.createCipheriv;e.Decipher=s.Decipher;e.createDecipher=s.createDecipher;e.Decipheriv=s.Decipheriv;e.createDecipheriv=s.createDecipheriv;e.getCiphers=s.getCiphers;e.listCiphers=s.listCiphers;var o=__nccwpck_require__(9977);e.DiffieHellmanGroup=o.DiffieHellmanGroup;e.createDiffieHellmanGroup=o.createDiffieHellmanGroup;e.getDiffieHellman=o.getDiffieHellman;e.createDiffieHellman=o.createDiffieHellman;e.DiffieHellman=o.DiffieHellman;var u=__nccwpck_require__(1265);e.createSign=u.createSign;e.Sign=u.Sign;e.createVerify=u.createVerify;e.Verify=u.Verify;e.createECDH=__nccwpck_require__(7354);var h=__nccwpck_require__(3501);e.publicEncrypt=h.publicEncrypt;e.privateEncrypt=h.privateEncrypt;e.publicDecrypt=h.publicDecrypt;e.privateDecrypt=h.privateDecrypt;var d=__nccwpck_require__(9534);e.randomFill=d.randomFill;e.randomFillSync=d.randomFillSync;e.createCredentials=function(){throw new Error(["sorry, createCredentials is not implemented yet","we accept pull requests","https://github.com/crypto-browserify/crypto-browserify"].join("\n"))};e.constants={DH_CHECK_P_NOT_SAFE_PRIME:2,DH_CHECK_P_NOT_PRIME:1,DH_UNABLE_TO_CHECK_GENERATOR:4,DH_NOT_SUITABLE_GENERATOR:8,NPN_ENABLED:1,ALPN_ENABLED:1,RSA_PKCS1_PADDING:1,RSA_SSLV23_PADDING:2,RSA_NO_PADDING:3,RSA_PKCS1_OAEP_PADDING:4,RSA_X931_PADDING:5,RSA_PKCS1_PSS_PADDING:6,POINT_CONVERSION_COMPRESSED:2,POINT_CONVERSION_UNCOMPRESSED:4,POINT_CONVERSION_HYBRID:6}}();module.exports=r})(); \ No newline at end of file diff --git a/packages/next/compiled/p-limit/index.js b/packages/next/compiled/p-limit/index.js index 5617bd4ffed1..d6a104316a8a 100644 --- a/packages/next/compiled/p-limit/index.js +++ b/packages/next/compiled/p-limit/index.js @@ -1 +1 @@ -(()=>{var e={631:e=>{class Node{constructor(e){this.value=e;this.next=undefined}}class Queue{constructor(){this.clear()}enqueue(e){const t=new Node(e);if(this._head){this._tail.next=t;this._tail=t}else{this._head=t;this._tail=t}this._size++}dequeue(){const e=this._head;if(!e){return}this._head=this._head.next;this._size--;return e.value}clear(){this._head=undefined;this._tail=undefined;this._size=0}get size(){return this._size}*[Symbol.iterator](){let e=this._head;while(e){yield e.value;e=e.next}}}e.exports=Queue},805:(e,t,i)=>{"use strict";const r=i(631);const pLimit=e=>{if(!((Number.isInteger(e)||e===Infinity)&&e>0)){throw new TypeError("Expected `concurrency` to be a number from 1 and up")}const t=new r;let i=0;const next=()=>{i--;if(t.size>0){t.dequeue()()}};const run=async(e,t,...r)=>{i++;const s=(async()=>e(...r))();t(s);try{await s}catch{}next()};const enqueue=(r,s,...n)=>{t.enqueue(run.bind(null,r,s,...n));(async()=>{await Promise.resolve();if(i0){t.dequeue()()}})()};const generator=(e,...t)=>new Promise((i=>{enqueue(e,i,...t)}));Object.defineProperties(generator,{activeCount:{get:()=>i},pendingCount:{get:()=>t.size},clearQueue:{value:()=>{t.clear()}}});return generator};e.exports=pLimit}};var t={};function __nccwpck_require__(i){var r=t[i];if(r!==undefined){return r.exports}var s=t[i]={exports:{}};var n=true;try{e[i](s,s.exports,__nccwpck_require__);n=false}finally{if(n)delete t[i]}return s.exports}if(typeof __nccwpck_require__!=="undefined")__nccwpck_require__.ab=__dirname+"/";var i=__nccwpck_require__(805);module.exports=i})(); \ No newline at end of file +(()=>{var e={235:(e,t,i)=>{"use strict";const r=i(631);const pLimit=e=>{if(!((Number.isInteger(e)||e===Infinity)&&e>0)){throw new TypeError("Expected `concurrency` to be a number from 1 and up")}const t=new r;let i=0;const next=()=>{i--;if(t.size>0){t.dequeue()()}};const run=async(e,t,...r)=>{i++;const s=(async()=>e(...r))();t(s);try{await s}catch{}next()};const enqueue=(r,s,...n)=>{t.enqueue(run.bind(null,r,s,...n));(async()=>{await Promise.resolve();if(i0){t.dequeue()()}})()};const generator=(e,...t)=>new Promise((i=>{enqueue(e,i,...t)}));Object.defineProperties(generator,{activeCount:{get:()=>i},pendingCount:{get:()=>t.size},clearQueue:{value:()=>{t.clear()}}});return generator};e.exports=pLimit},631:e=>{class Node{constructor(e){this.value=e;this.next=undefined}}class Queue{constructor(){this.clear()}enqueue(e){const t=new Node(e);if(this._head){this._tail.next=t;this._tail=t}else{this._head=t;this._tail=t}this._size++}dequeue(){const e=this._head;if(!e){return}this._head=this._head.next;this._size--;return e.value}clear(){this._head=undefined;this._tail=undefined;this._size=0}get size(){return this._size}*[Symbol.iterator](){let e=this._head;while(e){yield e.value;e=e.next}}}e.exports=Queue}};var t={};function __nccwpck_require__(i){var r=t[i];if(r!==undefined){return r.exports}var s=t[i]={exports:{}};var n=true;try{e[i](s,s.exports,__nccwpck_require__);n=false}finally{if(n)delete t[i]}return s.exports}if(typeof __nccwpck_require__!=="undefined")__nccwpck_require__.ab=__dirname+"/";var i=__nccwpck_require__(235);module.exports=i})(); \ No newline at end of file diff --git a/packages/next/compiled/stream-browserify/index.js b/packages/next/compiled/stream-browserify/index.js index 199142d9b922..a04733b0179f 100644 --- a/packages/next/compiled/stream-browserify/index.js +++ b/packages/next/compiled/stream-browserify/index.js @@ -1 +1 @@ -(function(){var e={526:function(e){if(typeof Object.create==="function"){e.exports=function inherits(e,t){if(t){e.super_=t;e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}})}}}else{e.exports=function inherits(e,t){if(t){e.super_=t;var TempCtor=function(){};TempCtor.prototype=t.prototype;e.prototype=new TempCtor;e.prototype.constructor=e}}}},118:function(e,t,r){var n=r(300);var i=n.Buffer;function copyProps(e,t){for(var r in e){t[r]=e[r]}}if(i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow){e.exports=n}else{copyProps(n,t);t.Buffer=SafeBuffer}function SafeBuffer(e,t,r){return i(e,t,r)}SafeBuffer.prototype=Object.create(i.prototype);copyProps(i,SafeBuffer);SafeBuffer.from=function(e,t,r){if(typeof e==="number"){throw new TypeError("Argument must not be a number")}return i(e,t,r)};SafeBuffer.alloc=function(e,t,r){if(typeof e!=="number"){throw new TypeError("Argument must be a number")}var n=i(e);if(t!==undefined){if(typeof r==="string"){n.fill(t,r)}else{n.fill(t)}}else{n.fill(0)}return n};SafeBuffer.allocUnsafe=function(e){if(typeof e!=="number"){throw new TypeError("Argument must be a number")}return i(e)};SafeBuffer.allocUnsafeSlow=function(e){if(typeof e!=="number"){throw new TypeError("Argument must be a number")}return n.SlowBuffer(e)}},562:function(e,t,r){e.exports=Stream;var n=r(361).EventEmitter;var i=r(526);i(Stream,n);Stream.Readable=r(375);Stream.Writable=r(886);Stream.Duplex=r(239);Stream.Transform=r(786);Stream.PassThrough=r(663);Stream.finished=r(494);Stream.pipeline=r(229);Stream.Stream=Stream;function Stream(){n.call(this)}Stream.prototype.pipe=function(e,t){var r=this;function ondata(t){if(e.writable){if(false===e.write(t)&&r.pause){r.pause()}}}r.on("data",ondata);function ondrain(){if(r.readable&&r.resume){r.resume()}}e.on("drain",ondrain);if(!e._isStdio&&(!t||t.end!==false)){r.on("end",onend);r.on("close",onclose)}var i=false;function onend(){if(i)return;i=true;e.end()}function onclose(){if(i)return;i=true;if(typeof e.destroy==="function")e.destroy()}function onerror(e){cleanup();if(n.listenerCount(this,"error")===0){throw e}}r.on("error",onerror);e.on("error",onerror);function cleanup(){r.removeListener("data",ondata);e.removeListener("drain",ondrain);r.removeListener("end",onend);r.removeListener("close",onclose);r.removeListener("error",onerror);e.removeListener("error",onerror);r.removeListener("end",cleanup);r.removeListener("close",cleanup);e.removeListener("close",cleanup)}r.on("end",cleanup);r.on("close",cleanup);e.on("close",cleanup);e.emit("pipe",r);return e}},833:function(e){"use strict";const t={};function createErrorType(e,r,n){if(!n){n=Error}function getMessage(e,t,n){if(typeof r==="string"){return r}else{return r(e,t,n)}}class NodeError extends n{constructor(e,t,r){super(getMessage(e,t,r))}}NodeError.prototype.name=n.name;NodeError.prototype.code=e;t[e]=NodeError}function oneOf(e,t){if(Array.isArray(e)){const r=e.length;e=e.map((e=>String(e)));if(r>2){return`one of ${t} ${e.slice(0,r-1).join(", ")}, or `+e[r-1]}else if(r===2){return`one of ${t} ${e[0]} or ${e[1]}`}else{return`of ${t} ${e[0]}`}}else{return`of ${t} ${String(e)}`}}function startsWith(e,t,r){return e.substr(!r||r<0?0:+r,t.length)===t}function endsWith(e,t,r){if(r===undefined||r>e.length){r=e.length}return e.substring(r-t.length,r)===t}function includes(e,t,r){if(typeof r!=="number"){r=0}if(r+t.length>e.length){return false}else{return e.indexOf(t,r)!==-1}}createErrorType("ERR_INVALID_OPT_VALUE",(function(e,t){return'The value "'+t+'" is invalid for option "'+e+'"'}),TypeError);createErrorType("ERR_INVALID_ARG_TYPE",(function(e,t,r){let n;if(typeof t==="string"&&startsWith(t,"not ")){n="must not be";t=t.replace(/^not /,"")}else{n="must be"}let i;if(endsWith(e," argument")){i=`The ${e} ${n} ${oneOf(t,"type")}`}else{const r=includes(e,".")?"property":"argument";i=`The "${e}" ${r} ${n} ${oneOf(t,"type")}`}i+=`. Received type ${typeof r}`;return i}),TypeError);createErrorType("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF");createErrorType("ERR_METHOD_NOT_IMPLEMENTED",(function(e){return"The "+e+" method is not implemented"}));createErrorType("ERR_STREAM_PREMATURE_CLOSE","Premature close");createErrorType("ERR_STREAM_DESTROYED",(function(e){return"Cannot call "+e+" after a stream was destroyed"}));createErrorType("ERR_MULTIPLE_CALLBACK","Callback called multiple times");createErrorType("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable");createErrorType("ERR_STREAM_WRITE_AFTER_END","write after end");createErrorType("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError);createErrorType("ERR_UNKNOWN_ENCODING",(function(e){return"Unknown encoding: "+e}),TypeError);createErrorType("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event");e.exports.q=t},239:function(e,t,r){"use strict";var n=Object.keys||function(e){var t=[];for(var r in e){t.push(r)}return t};e.exports=Duplex;var i=r(375);var a=r(886);r(526)(Duplex,i);{var o=n(a.prototype);for(var s=0;s0){if(typeof t!=="string"&&!a.objectMode&&Object.getPrototypeOf(t)!==s.prototype){t=_uint8ArrayToBuffer(t)}if(n){if(a.endEmitted)R(e,new v);else addChunk(e,a,t,true)}else if(a.ended){R(e,new y)}else if(a.destroyed){return false}else{a.reading=false;if(a.decoder&&!r){t=a.decoder.write(t);if(a.objectMode||t.length!==0)addChunk(e,a,t,false);else maybeReadMore(e,a)}else{addChunk(e,a,t,false)}}}else if(!n){a.reading=false;maybeReadMore(e,a)}}return!a.ended&&(a.length=T){e=T}else{e--;e|=e>>>1;e|=e>>>2;e|=e>>>4;e|=e>>>8;e|=e>>>16;e++}return e}function howMuchToRead(e,t){if(e<=0||t.length===0&&t.ended)return 0;if(t.objectMode)return 1;if(e!==e){if(t.flowing&&t.length)return t.buffer.head.data.length;else return t.length}if(e>t.highWaterMark)t.highWaterMark=computeNewHighWaterMark(e);if(e<=t.length)return e;if(!t.ended){t.needReadable=true;return 0}return t.length}Readable.prototype.read=function(e){u("read",e);e=parseInt(e,10);var t=this._readableState;var r=e;if(e!==0)t.emittedReadable=false;if(e===0&&t.needReadable&&((t.highWaterMark!==0?t.length>=t.highWaterMark:t.length>0)||t.ended)){u("read: emitReadable",t.length,t.ended);if(t.length===0&&t.ended)endReadable(this);else emitReadable(this);return null}e=howMuchToRead(e,t);if(e===0&&t.ended){if(t.length===0)endReadable(this);return null}var n=t.needReadable;u("need readable",n);if(t.length===0||t.length-e0)i=fromList(e,t);else i=null;if(i===null){t.needReadable=t.length<=t.highWaterMark;e=0}else{t.length-=e;t.awaitDrain=0}if(t.length===0){if(!t.ended)t.needReadable=true;if(r!==e&&t.ended)endReadable(this)}if(i!==null)this.emit("data",i);return i};function onEofChunk(e,t){u("onEofChunk");if(t.ended)return;if(t.decoder){var r=t.decoder.end();if(r&&r.length){t.buffer.push(r);t.length+=t.objectMode?1:r.length}}t.ended=true;if(t.sync){emitReadable(e)}else{t.needReadable=false;if(!t.emittedReadable){t.emittedReadable=true;emitReadable_(e)}}}function emitReadable(e){var t=e._readableState;u("emitReadable",t.needReadable,t.emittedReadable);t.needReadable=false;if(!t.emittedReadable){u("emitReadable",t.flowing);t.emittedReadable=true;process.nextTick(emitReadable_,e)}}function emitReadable_(e){var t=e._readableState;u("emitReadable_",t.destroyed,t.length,t.ended);if(!t.destroyed&&(t.length||t.ended)){e.emit("readable");t.emittedReadable=false}t.needReadable=!t.flowing&&!t.ended&&t.length<=t.highWaterMark;flow(e)}function maybeReadMore(e,t){if(!t.readingMore){t.readingMore=true;process.nextTick(maybeReadMore_,e,t)}}function maybeReadMore_(e,t){while(!t.reading&&!t.ended&&(t.length1&&indexOf(n.pipes,e)!==-1)&&!f){u("false write response, pause",n.awaitDrain);n.awaitDrain++}r.pause()}}function onerror(t){u("onerror",t);unpipe();e.removeListener("error",onerror);if(a(e,"error")===0)R(e,t)}prependListener(e,"error",onerror);function onclose(){e.removeListener("finish",onfinish);unpipe()}e.once("close",onclose);function onfinish(){u("onfinish");e.removeListener("close",onclose);unpipe()}e.once("finish",onfinish);function unpipe(){u("unpipe");r.unpipe(e)}e.emit("pipe",r);if(!n.flowing){u("pipe resume");r.resume()}return e};function pipeOnDrain(e){return function pipeOnDrainFunctionResult(){var t=e._readableState;u("pipeOnDrain",t.awaitDrain);if(t.awaitDrain)t.awaitDrain--;if(t.awaitDrain===0&&a(e,"data")){t.flowing=true;flow(e)}}}Readable.prototype.unpipe=function(e){var t=this._readableState;var r={hasUnpiped:false};if(t.pipesCount===0)return this;if(t.pipesCount===1){if(e&&e!==t.pipes)return this;if(!e)e=t.pipes;t.pipes=null;t.pipesCount=0;t.flowing=false;if(e)e.emit("unpipe",this,r);return this}if(!e){var n=t.pipes;var i=t.pipesCount;t.pipes=null;t.pipesCount=0;t.flowing=false;for(var a=0;a0;if(n.flowing!==false)this.resume()}else if(e==="readable"){if(!n.endEmitted&&!n.readableListening){n.readableListening=n.needReadable=true;n.flowing=false;n.emittedReadable=false;u("on readable",n.length,n.reading);if(n.length){emitReadable(this)}else if(!n.reading){process.nextTick(nReadingNextTick,this)}}}return r};Readable.prototype.addListener=Readable.prototype.on;Readable.prototype.removeListener=function(e,t){var r=o.prototype.removeListener.call(this,e,t);if(e==="readable"){process.nextTick(updateReadableListening,this)}return r};Readable.prototype.removeAllListeners=function(e){var t=o.prototype.removeAllListeners.apply(this,arguments);if(e==="readable"||e===undefined){process.nextTick(updateReadableListening,this)}return t};function updateReadableListening(e){var t=e._readableState;t.readableListening=e.listenerCount("readable")>0;if(t.resumeScheduled&&!t.paused){t.flowing=true}else if(e.listenerCount("data")>0){e.resume()}}function nReadingNextTick(e){u("readable nexttick read 0");e.read(0)}Readable.prototype.resume=function(){var e=this._readableState;if(!e.flowing){u("resume");e.flowing=!e.readableListening;resume(this,e)}e.paused=false;return this};function resume(e,t){if(!t.resumeScheduled){t.resumeScheduled=true;process.nextTick(resume_,e,t)}}function resume_(e,t){u("resume",t.reading);if(!t.reading){e.read(0)}t.resumeScheduled=false;e.emit("resume");flow(e);if(t.flowing&&!t.reading)e.read(0)}Readable.prototype.pause=function(){u("call pause flowing=%j",this._readableState.flowing);if(this._readableState.flowing!==false){u("pause");this._readableState.flowing=false;this.emit("pause")}this._readableState.paused=true;return this};function flow(e){var t=e._readableState;u("flow",t.flowing);while(t.flowing&&e.read()!==null){}}Readable.prototype.wrap=function(e){var t=this;var r=this._readableState;var n=false;e.on("end",(function(){u("wrapped end");if(r.decoder&&!r.ended){var e=r.decoder.end();if(e&&e.length)t.push(e)}t.push(null)}));e.on("data",(function(i){u("wrapped data");if(r.decoder)i=r.decoder.write(i);if(r.objectMode&&(i===null||i===undefined))return;else if(!r.objectMode&&(!i||!i.length))return;var a=t.push(i);if(!a){n=true;e.pause()}}));for(var i in e){if(this[i]===undefined&&typeof e[i]==="function"){this[i]=function methodWrap(t){return function methodWrapReturnFunction(){return e[t].apply(e,arguments)}}(i)}}for(var a=0;a=t.length){if(t.decoder)r=t.buffer.join("");else if(t.buffer.length===1)r=t.buffer.first();else r=t.buffer.concat(t.length);t.buffer.clear()}else{r=t.buffer.consume(e,t.decoder)}return r}function endReadable(e){var t=e._readableState;u("endReadable",t.endEmitted);if(!t.endEmitted){t.ended=true;process.nextTick(endReadableNT,t,e)}}function endReadableNT(e,t){u("endReadableNT",e.endEmitted,e.length);if(!e.endEmitted&&e.length===0){e.endEmitted=true;t.readable=false;t.emit("end");if(e.autoDestroy){var r=t._writableState;if(!r||r.autoDestroy&&r.finished){t.destroy()}}}}if(typeof Symbol==="function"){Readable.from=function(e,t){if(S===undefined){S=r(16)}return S(Readable,e,t)}}function indexOf(e,t){for(var r=0,n=e.length;r-1))throw new v(e);this._writableState.defaultEncoding=e;return this};Object.defineProperty(Writable.prototype,"writableBuffer",{enumerable:false,get:function get(){return this._writableState&&this._writableState.getBuffer()}});function decodeChunk(e,t,r){if(!e.objectMode&&e.decodeStrings!==false&&typeof t==="string"){t=o.from(t,r)}return t}Object.defineProperty(Writable.prototype,"writableHighWaterMark",{enumerable:false,get:function get(){return this._writableState.highWaterMark}});function writeOrBuffer(e,t,r,n,i,a){if(!r){var o=decodeChunk(t,n,i);if(n!==o){r=true;i="buffer";n=o}}var s=t.objectMode?1:n.length;t.length+=s;var f=t.length0)this.tail.next=t;else this.head=t;this.tail=t;++this.length}},{key:"unshift",value:function unshift(e){var t={data:e,next:this.head};if(this.length===0)this.tail=t;this.head=t;++this.length}},{key:"shift",value:function shift(){if(this.length===0)return;var e=this.head.data;if(this.length===1)this.head=this.tail=null;else this.head=this.head.next;--this.length;return e}},{key:"clear",value:function clear(){this.head=this.tail=null;this.length=0}},{key:"join",value:function join(e){if(this.length===0)return"";var t=this.head;var r=""+t.data;while(t=t.next){r+=e+t.data}return r}},{key:"concat",value:function concat(e){if(this.length===0)return i.alloc(0);var t=i.allocUnsafe(e>>>0);var r=this.head;var n=0;while(r){copyBuffer(r.data,t,n);n+=r.data.length;r=r.next}return t}},{key:"consume",value:function consume(e,t){var r;if(ei.length?i.length:e;if(a===i.length)n+=i;else n+=i.slice(0,e);e-=a;if(e===0){if(a===i.length){++r;if(t.next)this.head=t.next;else this.head=this.tail=null}else{this.head=t;t.data=i.slice(a)}break}++r}this.length-=r;return n}},{key:"_getBuffer",value:function _getBuffer(e){var t=i.allocUnsafe(e);var r=this.head;var n=1;r.data.copy(t);e-=r.data.length;while(r=r.next){var a=r.data;var o=e>a.length?a.length:e;a.copy(t,t.length-e,0,o);e-=o;if(e===0){if(o===a.length){++n;if(r.next)this.head=r.next;else this.head=this.tail=null}else{this.head=r;r.data=a.slice(o)}break}++n}this.length-=n;return t}},{key:s,value:function value(e,t){return o(this,_objectSpread({},t,{depth:0,customInspect:false}))}}]);return BufferList}()},364:function(e){"use strict";function destroy(e,t){var r=this;var n=this._readableState&&this._readableState.destroyed;var i=this._writableState&&this._writableState.destroyed;if(n||i){if(t){t(e)}else if(e){if(!this._writableState){process.nextTick(emitErrorNT,this,e)}else if(!this._writableState.errorEmitted){this._writableState.errorEmitted=true;process.nextTick(emitErrorNT,this,e)}}return this}if(this._readableState){this._readableState.destroyed=true}if(this._writableState){this._writableState.destroyed=true}this._destroy(e||null,(function(e){if(!t&&e){if(!r._writableState){process.nextTick(emitErrorAndCloseNT,r,e)}else if(!r._writableState.errorEmitted){r._writableState.errorEmitted=true;process.nextTick(emitErrorAndCloseNT,r,e)}else{process.nextTick(emitCloseNT,r)}}else if(t){process.nextTick(emitCloseNT,r);t(e)}else{process.nextTick(emitCloseNT,r)}}));return this}function emitErrorAndCloseNT(e,t){emitErrorNT(e,t);emitCloseNT(e)}function emitCloseNT(e){if(e._writableState&&!e._writableState.emitClose)return;if(e._readableState&&!e._readableState.emitClose)return;e.emit("close")}function undestroy(){if(this._readableState){this._readableState.destroyed=false;this._readableState.reading=false;this._readableState.ended=false;this._readableState.endEmitted=false}if(this._writableState){this._writableState.destroyed=false;this._writableState.ended=false;this._writableState.ending=false;this._writableState.finalCalled=false;this._writableState.prefinished=false;this._writableState.finished=false;this._writableState.errorEmitted=false}}function emitErrorNT(e,t){e.emit("error",t)}function errorOrDestroy(e,t){var r=e._readableState;var n=e._writableState;if(r&&r.autoDestroy||n&&n.autoDestroy)e.destroy(t);else e.emit("error",t)}e.exports={destroy:destroy,undestroy:undestroy,errorOrDestroy:errorOrDestroy}},494:function(e,t,r){"use strict";var n=r(833).q.ERR_STREAM_PREMATURE_CLOSE;function once(e){var t=false;return function(){if(t)return;t=true;for(var r=arguments.length,n=new Array(r),i=0;i0;return destroyer(e,a,s,(function(e){if(!i)i=e;if(e)o.forEach(call);if(a)return;o.forEach(call);n(i)}))}));return t.reduce(pipe)}e.exports=pipeline},322:function(e,t,r){"use strict";var n=r(833).q.ERR_INVALID_OPT_VALUE;function highWaterMarkFrom(e,t,r){return e.highWaterMark!=null?e.highWaterMark:t?e[r]:null}function getHighWaterMark(e,t,r,i){var a=highWaterMarkFrom(t,i,r);if(a!=null){if(!(isFinite(a)&&Math.floor(a)===a)||a<0){var o=i?r:"highWaterMark";throw new n(o,a)}return Math.floor(a)}return e.objectMode?16:16*1024}e.exports={getHighWaterMark:getHighWaterMark}},919:function(e,t,r){e.exports=r(781)},642:function(e,t,r){"use strict";var n=r(118).Buffer;var i=n.isEncoding||function(e){e=""+e;switch(e&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return true;default:return false}};function _normalizeEncoding(e){if(!e)return"utf8";var t;while(true){switch(e){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return e;default:if(t)return;e=(""+e).toLowerCase();t=true}}}function normalizeEncoding(e){var t=_normalizeEncoding(e);if(typeof t!=="string"&&(n.isEncoding===i||!i(e)))throw new Error("Unknown encoding: "+e);return t||e}t.s=StringDecoder;function StringDecoder(e){this.encoding=normalizeEncoding(e);var t;switch(this.encoding){case"utf16le":this.text=utf16Text;this.end=utf16End;t=4;break;case"utf8":this.fillLast=utf8FillLast;t=4;break;case"base64":this.text=base64Text;this.end=base64End;t=3;break;default:this.write=simpleWrite;this.end=simpleEnd;return}this.lastNeed=0;this.lastTotal=0;this.lastChar=n.allocUnsafe(t)}StringDecoder.prototype.write=function(e){if(e.length===0)return"";var t;var r;if(this.lastNeed){t=this.fillLast(e);if(t===undefined)return"";r=this.lastNeed;this.lastNeed=0}else{r=0}if(r>5===6)return 2;else if(e>>4===14)return 3;else if(e>>3===30)return 4;return e>>6===2?-1:-2}function utf8CheckIncomplete(e,t,r){var n=t.length-1;if(n=0){if(i>0)e.lastNeed=i-1;return i}if(--n=0){if(i>0)e.lastNeed=i-2;return i}if(--n=0){if(i>0){if(i===2)i=0;else e.lastNeed=i-3}return i}return 0}function utf8CheckExtraBytes(e,t,r){if((t[0]&192)!==128){e.lastNeed=0;return"�"}if(e.lastNeed>1&&t.length>1){if((t[1]&192)!==128){e.lastNeed=1;return"�"}if(e.lastNeed>2&&t.length>2){if((t[2]&192)!==128){e.lastNeed=2;return"�"}}}}function utf8FillLast(e){var t=this.lastTotal-this.lastNeed;var r=utf8CheckExtraBytes(this,e,t);if(r!==undefined)return r;if(this.lastNeed<=e.length){e.copy(this.lastChar,t,0,this.lastNeed);return this.lastChar.toString(this.encoding,0,this.lastTotal)}e.copy(this.lastChar,t,0,e.length);this.lastNeed-=e.length}function utf8Text(e,t){var r=utf8CheckIncomplete(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=r;var n=e.length-(r-this.lastNeed);e.copy(this.lastChar,0,n);return e.toString("utf8",t,n)}function utf8End(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed)return t+"�";return t}function utf16Text(e,t){if((e.length-t)%2===0){var r=e.toString("utf16le",t);if(r){var n=r.charCodeAt(r.length-1);if(n>=55296&&n<=56319){this.lastNeed=2;this.lastTotal=4;this.lastChar[0]=e[e.length-2];this.lastChar[1]=e[e.length-1];return r.slice(0,-1)}}return r}this.lastNeed=1;this.lastTotal=2;this.lastChar[0]=e[e.length-1];return e.toString("utf16le",t,e.length-1)}function utf16End(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,r)}return t}function base64Text(e,t){var r=(e.length-t)%3;if(r===0)return e.toString("base64",t);this.lastNeed=3-r;this.lastTotal=3;if(r===1){this.lastChar[0]=e[e.length-1]}else{this.lastChar[0]=e[e.length-2];this.lastChar[1]=e[e.length-1]}return e.toString("base64",t,e.length-r)}function base64End(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed)return t+this.lastChar.toString("base64",0,3-this.lastNeed);return t}function simpleWrite(e){return e.toString(this.encoding)}function simpleEnd(e){return e&&e.length?this.write(e):""}},121:function(e){e.exports=deprecate;function deprecate(e,t){if(config("noDeprecation")){return e}var r=false;function deprecated(){if(!r){if(config("throwDeprecation")){throw new Error(t)}else if(config("traceDeprecation")){console.trace(t)}else{console.warn(t)}r=true}return e.apply(this,arguments)}return deprecated}function config(e){try{if(!global.localStorage)return false}catch(e){return false}var t=global.localStorage[e];if(null==t)return false;return String(t).toLowerCase()==="true"}},300:function(e){"use strict";e.exports=require("buffer")},361:function(e){"use strict";e.exports=require("events")},781:function(e){"use strict";e.exports=require("events").EventEmitter},837:function(e){"use strict";e.exports=require("util")}};var t={};function __nccwpck_require__(r){var n=t[r];if(n!==undefined){return n.exports}var i=t[r]={exports:{}};var a=true;try{e[r](i,i.exports,__nccwpck_require__);a=false}finally{if(a)delete t[r]}return i.exports}if(typeof __nccwpck_require__!=="undefined")__nccwpck_require__.ab=__dirname+"/";var r=__nccwpck_require__(562);module.exports=r})(); \ No newline at end of file +(function(){var e={526:function(e){if(typeof Object.create==="function"){e.exports=function inherits(e,t){if(t){e.super_=t;e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}})}}}else{e.exports=function inherits(e,t){if(t){e.super_=t;var TempCtor=function(){};TempCtor.prototype=t.prototype;e.prototype=new TempCtor;e.prototype.constructor=e}}}},118:function(e,t,r){var n=r(300);var i=n.Buffer;function copyProps(e,t){for(var r in e){t[r]=e[r]}}if(i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow){e.exports=n}else{copyProps(n,t);t.Buffer=SafeBuffer}function SafeBuffer(e,t,r){return i(e,t,r)}SafeBuffer.prototype=Object.create(i.prototype);copyProps(i,SafeBuffer);SafeBuffer.from=function(e,t,r){if(typeof e==="number"){throw new TypeError("Argument must not be a number")}return i(e,t,r)};SafeBuffer.alloc=function(e,t,r){if(typeof e!=="number"){throw new TypeError("Argument must be a number")}var n=i(e);if(t!==undefined){if(typeof r==="string"){n.fill(t,r)}else{n.fill(t)}}else{n.fill(0)}return n};SafeBuffer.allocUnsafe=function(e){if(typeof e!=="number"){throw new TypeError("Argument must be a number")}return i(e)};SafeBuffer.allocUnsafeSlow=function(e){if(typeof e!=="number"){throw new TypeError("Argument must be a number")}return n.SlowBuffer(e)}},562:function(e,t,r){e.exports=Stream;var n=r(361).EventEmitter;var i=r(526);i(Stream,n);Stream.Readable=r(375);Stream.Writable=r(886);Stream.Duplex=r(239);Stream.Transform=r(786);Stream.PassThrough=r(663);Stream.finished=r(494);Stream.pipeline=r(229);Stream.Stream=Stream;function Stream(){n.call(this)}Stream.prototype.pipe=function(e,t){var r=this;function ondata(t){if(e.writable){if(false===e.write(t)&&r.pause){r.pause()}}}r.on("data",ondata);function ondrain(){if(r.readable&&r.resume){r.resume()}}e.on("drain",ondrain);if(!e._isStdio&&(!t||t.end!==false)){r.on("end",onend);r.on("close",onclose)}var i=false;function onend(){if(i)return;i=true;e.end()}function onclose(){if(i)return;i=true;if(typeof e.destroy==="function")e.destroy()}function onerror(e){cleanup();if(n.listenerCount(this,"error")===0){throw e}}r.on("error",onerror);e.on("error",onerror);function cleanup(){r.removeListener("data",ondata);e.removeListener("drain",ondrain);r.removeListener("end",onend);r.removeListener("close",onclose);r.removeListener("error",onerror);e.removeListener("error",onerror);r.removeListener("end",cleanup);r.removeListener("close",cleanup);e.removeListener("close",cleanup)}r.on("end",cleanup);r.on("close",cleanup);e.on("close",cleanup);e.emit("pipe",r);return e}},833:function(e){"use strict";const t={};function createErrorType(e,r,n){if(!n){n=Error}function getMessage(e,t,n){if(typeof r==="string"){return r}else{return r(e,t,n)}}class NodeError extends n{constructor(e,t,r){super(getMessage(e,t,r))}}NodeError.prototype.name=n.name;NodeError.prototype.code=e;t[e]=NodeError}function oneOf(e,t){if(Array.isArray(e)){const r=e.length;e=e.map((e=>String(e)));if(r>2){return`one of ${t} ${e.slice(0,r-1).join(", ")}, or `+e[r-1]}else if(r===2){return`one of ${t} ${e[0]} or ${e[1]}`}else{return`of ${t} ${e[0]}`}}else{return`of ${t} ${String(e)}`}}function startsWith(e,t,r){return e.substr(!r||r<0?0:+r,t.length)===t}function endsWith(e,t,r){if(r===undefined||r>e.length){r=e.length}return e.substring(r-t.length,r)===t}function includes(e,t,r){if(typeof r!=="number"){r=0}if(r+t.length>e.length){return false}else{return e.indexOf(t,r)!==-1}}createErrorType("ERR_INVALID_OPT_VALUE",(function(e,t){return'The value "'+t+'" is invalid for option "'+e+'"'}),TypeError);createErrorType("ERR_INVALID_ARG_TYPE",(function(e,t,r){let n;if(typeof t==="string"&&startsWith(t,"not ")){n="must not be";t=t.replace(/^not /,"")}else{n="must be"}let i;if(endsWith(e," argument")){i=`The ${e} ${n} ${oneOf(t,"type")}`}else{const r=includes(e,".")?"property":"argument";i=`The "${e}" ${r} ${n} ${oneOf(t,"type")}`}i+=`. Received type ${typeof r}`;return i}),TypeError);createErrorType("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF");createErrorType("ERR_METHOD_NOT_IMPLEMENTED",(function(e){return"The "+e+" method is not implemented"}));createErrorType("ERR_STREAM_PREMATURE_CLOSE","Premature close");createErrorType("ERR_STREAM_DESTROYED",(function(e){return"Cannot call "+e+" after a stream was destroyed"}));createErrorType("ERR_MULTIPLE_CALLBACK","Callback called multiple times");createErrorType("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable");createErrorType("ERR_STREAM_WRITE_AFTER_END","write after end");createErrorType("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError);createErrorType("ERR_UNKNOWN_ENCODING",(function(e){return"Unknown encoding: "+e}),TypeError);createErrorType("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event");e.exports.q=t},239:function(e,t,r){"use strict";var n=Object.keys||function(e){var t=[];for(var r in e){t.push(r)}return t};e.exports=Duplex;var i=r(375);var a=r(886);r(526)(Duplex,i);{var o=n(a.prototype);for(var s=0;s0){if(typeof t!=="string"&&!a.objectMode&&Object.getPrototypeOf(t)!==s.prototype){t=_uint8ArrayToBuffer(t)}if(n){if(a.endEmitted)R(e,new v);else addChunk(e,a,t,true)}else if(a.ended){R(e,new y)}else if(a.destroyed){return false}else{a.reading=false;if(a.decoder&&!r){t=a.decoder.write(t);if(a.objectMode||t.length!==0)addChunk(e,a,t,false);else maybeReadMore(e,a)}else{addChunk(e,a,t,false)}}}else if(!n){a.reading=false;maybeReadMore(e,a)}}return!a.ended&&(a.length=T){e=T}else{e--;e|=e>>>1;e|=e>>>2;e|=e>>>4;e|=e>>>8;e|=e>>>16;e++}return e}function howMuchToRead(e,t){if(e<=0||t.length===0&&t.ended)return 0;if(t.objectMode)return 1;if(e!==e){if(t.flowing&&t.length)return t.buffer.head.data.length;else return t.length}if(e>t.highWaterMark)t.highWaterMark=computeNewHighWaterMark(e);if(e<=t.length)return e;if(!t.ended){t.needReadable=true;return 0}return t.length}Readable.prototype.read=function(e){u("read",e);e=parseInt(e,10);var t=this._readableState;var r=e;if(e!==0)t.emittedReadable=false;if(e===0&&t.needReadable&&((t.highWaterMark!==0?t.length>=t.highWaterMark:t.length>0)||t.ended)){u("read: emitReadable",t.length,t.ended);if(t.length===0&&t.ended)endReadable(this);else emitReadable(this);return null}e=howMuchToRead(e,t);if(e===0&&t.ended){if(t.length===0)endReadable(this);return null}var n=t.needReadable;u("need readable",n);if(t.length===0||t.length-e0)i=fromList(e,t);else i=null;if(i===null){t.needReadable=t.length<=t.highWaterMark;e=0}else{t.length-=e;t.awaitDrain=0}if(t.length===0){if(!t.ended)t.needReadable=true;if(r!==e&&t.ended)endReadable(this)}if(i!==null)this.emit("data",i);return i};function onEofChunk(e,t){u("onEofChunk");if(t.ended)return;if(t.decoder){var r=t.decoder.end();if(r&&r.length){t.buffer.push(r);t.length+=t.objectMode?1:r.length}}t.ended=true;if(t.sync){emitReadable(e)}else{t.needReadable=false;if(!t.emittedReadable){t.emittedReadable=true;emitReadable_(e)}}}function emitReadable(e){var t=e._readableState;u("emitReadable",t.needReadable,t.emittedReadable);t.needReadable=false;if(!t.emittedReadable){u("emitReadable",t.flowing);t.emittedReadable=true;process.nextTick(emitReadable_,e)}}function emitReadable_(e){var t=e._readableState;u("emitReadable_",t.destroyed,t.length,t.ended);if(!t.destroyed&&(t.length||t.ended)){e.emit("readable");t.emittedReadable=false}t.needReadable=!t.flowing&&!t.ended&&t.length<=t.highWaterMark;flow(e)}function maybeReadMore(e,t){if(!t.readingMore){t.readingMore=true;process.nextTick(maybeReadMore_,e,t)}}function maybeReadMore_(e,t){while(!t.reading&&!t.ended&&(t.length1&&indexOf(n.pipes,e)!==-1)&&!f){u("false write response, pause",n.awaitDrain);n.awaitDrain++}r.pause()}}function onerror(t){u("onerror",t);unpipe();e.removeListener("error",onerror);if(a(e,"error")===0)R(e,t)}prependListener(e,"error",onerror);function onclose(){e.removeListener("finish",onfinish);unpipe()}e.once("close",onclose);function onfinish(){u("onfinish");e.removeListener("close",onclose);unpipe()}e.once("finish",onfinish);function unpipe(){u("unpipe");r.unpipe(e)}e.emit("pipe",r);if(!n.flowing){u("pipe resume");r.resume()}return e};function pipeOnDrain(e){return function pipeOnDrainFunctionResult(){var t=e._readableState;u("pipeOnDrain",t.awaitDrain);if(t.awaitDrain)t.awaitDrain--;if(t.awaitDrain===0&&a(e,"data")){t.flowing=true;flow(e)}}}Readable.prototype.unpipe=function(e){var t=this._readableState;var r={hasUnpiped:false};if(t.pipesCount===0)return this;if(t.pipesCount===1){if(e&&e!==t.pipes)return this;if(!e)e=t.pipes;t.pipes=null;t.pipesCount=0;t.flowing=false;if(e)e.emit("unpipe",this,r);return this}if(!e){var n=t.pipes;var i=t.pipesCount;t.pipes=null;t.pipesCount=0;t.flowing=false;for(var a=0;a0;if(n.flowing!==false)this.resume()}else if(e==="readable"){if(!n.endEmitted&&!n.readableListening){n.readableListening=n.needReadable=true;n.flowing=false;n.emittedReadable=false;u("on readable",n.length,n.reading);if(n.length){emitReadable(this)}else if(!n.reading){process.nextTick(nReadingNextTick,this)}}}return r};Readable.prototype.addListener=Readable.prototype.on;Readable.prototype.removeListener=function(e,t){var r=o.prototype.removeListener.call(this,e,t);if(e==="readable"){process.nextTick(updateReadableListening,this)}return r};Readable.prototype.removeAllListeners=function(e){var t=o.prototype.removeAllListeners.apply(this,arguments);if(e==="readable"||e===undefined){process.nextTick(updateReadableListening,this)}return t};function updateReadableListening(e){var t=e._readableState;t.readableListening=e.listenerCount("readable")>0;if(t.resumeScheduled&&!t.paused){t.flowing=true}else if(e.listenerCount("data")>0){e.resume()}}function nReadingNextTick(e){u("readable nexttick read 0");e.read(0)}Readable.prototype.resume=function(){var e=this._readableState;if(!e.flowing){u("resume");e.flowing=!e.readableListening;resume(this,e)}e.paused=false;return this};function resume(e,t){if(!t.resumeScheduled){t.resumeScheduled=true;process.nextTick(resume_,e,t)}}function resume_(e,t){u("resume",t.reading);if(!t.reading){e.read(0)}t.resumeScheduled=false;e.emit("resume");flow(e);if(t.flowing&&!t.reading)e.read(0)}Readable.prototype.pause=function(){u("call pause flowing=%j",this._readableState.flowing);if(this._readableState.flowing!==false){u("pause");this._readableState.flowing=false;this.emit("pause")}this._readableState.paused=true;return this};function flow(e){var t=e._readableState;u("flow",t.flowing);while(t.flowing&&e.read()!==null){}}Readable.prototype.wrap=function(e){var t=this;var r=this._readableState;var n=false;e.on("end",(function(){u("wrapped end");if(r.decoder&&!r.ended){var e=r.decoder.end();if(e&&e.length)t.push(e)}t.push(null)}));e.on("data",(function(i){u("wrapped data");if(r.decoder)i=r.decoder.write(i);if(r.objectMode&&(i===null||i===undefined))return;else if(!r.objectMode&&(!i||!i.length))return;var a=t.push(i);if(!a){n=true;e.pause()}}));for(var i in e){if(this[i]===undefined&&typeof e[i]==="function"){this[i]=function methodWrap(t){return function methodWrapReturnFunction(){return e[t].apply(e,arguments)}}(i)}}for(var a=0;a=t.length){if(t.decoder)r=t.buffer.join("");else if(t.buffer.length===1)r=t.buffer.first();else r=t.buffer.concat(t.length);t.buffer.clear()}else{r=t.buffer.consume(e,t.decoder)}return r}function endReadable(e){var t=e._readableState;u("endReadable",t.endEmitted);if(!t.endEmitted){t.ended=true;process.nextTick(endReadableNT,t,e)}}function endReadableNT(e,t){u("endReadableNT",e.endEmitted,e.length);if(!e.endEmitted&&e.length===0){e.endEmitted=true;t.readable=false;t.emit("end");if(e.autoDestroy){var r=t._writableState;if(!r||r.autoDestroy&&r.finished){t.destroy()}}}}if(typeof Symbol==="function"){Readable.from=function(e,t){if(S===undefined){S=r(16)}return S(Readable,e,t)}}function indexOf(e,t){for(var r=0,n=e.length;r-1))throw new v(e);this._writableState.defaultEncoding=e;return this};Object.defineProperty(Writable.prototype,"writableBuffer",{enumerable:false,get:function get(){return this._writableState&&this._writableState.getBuffer()}});function decodeChunk(e,t,r){if(!e.objectMode&&e.decodeStrings!==false&&typeof t==="string"){t=o.from(t,r)}return t}Object.defineProperty(Writable.prototype,"writableHighWaterMark",{enumerable:false,get:function get(){return this._writableState.highWaterMark}});function writeOrBuffer(e,t,r,n,i,a){if(!r){var o=decodeChunk(t,n,i);if(n!==o){r=true;i="buffer";n=o}}var s=t.objectMode?1:n.length;t.length+=s;var f=t.length0)this.tail.next=t;else this.head=t;this.tail=t;++this.length}},{key:"unshift",value:function unshift(e){var t={data:e,next:this.head};if(this.length===0)this.tail=t;this.head=t;++this.length}},{key:"shift",value:function shift(){if(this.length===0)return;var e=this.head.data;if(this.length===1)this.head=this.tail=null;else this.head=this.head.next;--this.length;return e}},{key:"clear",value:function clear(){this.head=this.tail=null;this.length=0}},{key:"join",value:function join(e){if(this.length===0)return"";var t=this.head;var r=""+t.data;while(t=t.next){r+=e+t.data}return r}},{key:"concat",value:function concat(e){if(this.length===0)return i.alloc(0);var t=i.allocUnsafe(e>>>0);var r=this.head;var n=0;while(r){copyBuffer(r.data,t,n);n+=r.data.length;r=r.next}return t}},{key:"consume",value:function consume(e,t){var r;if(ei.length?i.length:e;if(a===i.length)n+=i;else n+=i.slice(0,e);e-=a;if(e===0){if(a===i.length){++r;if(t.next)this.head=t.next;else this.head=this.tail=null}else{this.head=t;t.data=i.slice(a)}break}++r}this.length-=r;return n}},{key:"_getBuffer",value:function _getBuffer(e){var t=i.allocUnsafe(e);var r=this.head;var n=1;r.data.copy(t);e-=r.data.length;while(r=r.next){var a=r.data;var o=e>a.length?a.length:e;a.copy(t,t.length-e,0,o);e-=o;if(e===0){if(o===a.length){++n;if(r.next)this.head=r.next;else this.head=this.tail=null}else{this.head=r;r.data=a.slice(o)}break}++n}this.length-=n;return t}},{key:s,value:function value(e,t){return o(this,_objectSpread({},t,{depth:0,customInspect:false}))}}]);return BufferList}()},364:function(e){"use strict";function destroy(e,t){var r=this;var n=this._readableState&&this._readableState.destroyed;var i=this._writableState&&this._writableState.destroyed;if(n||i){if(t){t(e)}else if(e){if(!this._writableState){process.nextTick(emitErrorNT,this,e)}else if(!this._writableState.errorEmitted){this._writableState.errorEmitted=true;process.nextTick(emitErrorNT,this,e)}}return this}if(this._readableState){this._readableState.destroyed=true}if(this._writableState){this._writableState.destroyed=true}this._destroy(e||null,(function(e){if(!t&&e){if(!r._writableState){process.nextTick(emitErrorAndCloseNT,r,e)}else if(!r._writableState.errorEmitted){r._writableState.errorEmitted=true;process.nextTick(emitErrorAndCloseNT,r,e)}else{process.nextTick(emitCloseNT,r)}}else if(t){process.nextTick(emitCloseNT,r);t(e)}else{process.nextTick(emitCloseNT,r)}}));return this}function emitErrorAndCloseNT(e,t){emitErrorNT(e,t);emitCloseNT(e)}function emitCloseNT(e){if(e._writableState&&!e._writableState.emitClose)return;if(e._readableState&&!e._readableState.emitClose)return;e.emit("close")}function undestroy(){if(this._readableState){this._readableState.destroyed=false;this._readableState.reading=false;this._readableState.ended=false;this._readableState.endEmitted=false}if(this._writableState){this._writableState.destroyed=false;this._writableState.ended=false;this._writableState.ending=false;this._writableState.finalCalled=false;this._writableState.prefinished=false;this._writableState.finished=false;this._writableState.errorEmitted=false}}function emitErrorNT(e,t){e.emit("error",t)}function errorOrDestroy(e,t){var r=e._readableState;var n=e._writableState;if(r&&r.autoDestroy||n&&n.autoDestroy)e.destroy(t);else e.emit("error",t)}e.exports={destroy:destroy,undestroy:undestroy,errorOrDestroy:errorOrDestroy}},494:function(e,t,r){"use strict";var n=r(833).q.ERR_STREAM_PREMATURE_CLOSE;function once(e){var t=false;return function(){if(t)return;t=true;for(var r=arguments.length,n=new Array(r),i=0;i0;return destroyer(e,a,s,(function(e){if(!i)i=e;if(e)o.forEach(call);if(a)return;o.forEach(call);n(i)}))}));return t.reduce(pipe)}e.exports=pipeline},322:function(e,t,r){"use strict";var n=r(833).q.ERR_INVALID_OPT_VALUE;function highWaterMarkFrom(e,t,r){return e.highWaterMark!=null?e.highWaterMark:t?e[r]:null}function getHighWaterMark(e,t,r,i){var a=highWaterMarkFrom(t,i,r);if(a!=null){if(!(isFinite(a)&&Math.floor(a)===a)||a<0){var o=i?r:"highWaterMark";throw new n(o,a)}return Math.floor(a)}return e.objectMode?16:16*1024}e.exports={getHighWaterMark:getHighWaterMark}},919:function(e,t,r){e.exports=r(781)},313:function(e,t,r){"use strict";var n=r(118).Buffer;var i=n.isEncoding||function(e){e=""+e;switch(e&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return true;default:return false}};function _normalizeEncoding(e){if(!e)return"utf8";var t;while(true){switch(e){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return e;default:if(t)return;e=(""+e).toLowerCase();t=true}}}function normalizeEncoding(e){var t=_normalizeEncoding(e);if(typeof t!=="string"&&(n.isEncoding===i||!i(e)))throw new Error("Unknown encoding: "+e);return t||e}t.s=StringDecoder;function StringDecoder(e){this.encoding=normalizeEncoding(e);var t;switch(this.encoding){case"utf16le":this.text=utf16Text;this.end=utf16End;t=4;break;case"utf8":this.fillLast=utf8FillLast;t=4;break;case"base64":this.text=base64Text;this.end=base64End;t=3;break;default:this.write=simpleWrite;this.end=simpleEnd;return}this.lastNeed=0;this.lastTotal=0;this.lastChar=n.allocUnsafe(t)}StringDecoder.prototype.write=function(e){if(e.length===0)return"";var t;var r;if(this.lastNeed){t=this.fillLast(e);if(t===undefined)return"";r=this.lastNeed;this.lastNeed=0}else{r=0}if(r>5===6)return 2;else if(e>>4===14)return 3;else if(e>>3===30)return 4;return e>>6===2?-1:-2}function utf8CheckIncomplete(e,t,r){var n=t.length-1;if(n=0){if(i>0)e.lastNeed=i-1;return i}if(--n=0){if(i>0)e.lastNeed=i-2;return i}if(--n=0){if(i>0){if(i===2)i=0;else e.lastNeed=i-3}return i}return 0}function utf8CheckExtraBytes(e,t,r){if((t[0]&192)!==128){e.lastNeed=0;return"�"}if(e.lastNeed>1&&t.length>1){if((t[1]&192)!==128){e.lastNeed=1;return"�"}if(e.lastNeed>2&&t.length>2){if((t[2]&192)!==128){e.lastNeed=2;return"�"}}}}function utf8FillLast(e){var t=this.lastTotal-this.lastNeed;var r=utf8CheckExtraBytes(this,e,t);if(r!==undefined)return r;if(this.lastNeed<=e.length){e.copy(this.lastChar,t,0,this.lastNeed);return this.lastChar.toString(this.encoding,0,this.lastTotal)}e.copy(this.lastChar,t,0,e.length);this.lastNeed-=e.length}function utf8Text(e,t){var r=utf8CheckIncomplete(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=r;var n=e.length-(r-this.lastNeed);e.copy(this.lastChar,0,n);return e.toString("utf8",t,n)}function utf8End(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed)return t+"�";return t}function utf16Text(e,t){if((e.length-t)%2===0){var r=e.toString("utf16le",t);if(r){var n=r.charCodeAt(r.length-1);if(n>=55296&&n<=56319){this.lastNeed=2;this.lastTotal=4;this.lastChar[0]=e[e.length-2];this.lastChar[1]=e[e.length-1];return r.slice(0,-1)}}return r}this.lastNeed=1;this.lastTotal=2;this.lastChar[0]=e[e.length-1];return e.toString("utf16le",t,e.length-1)}function utf16End(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,r)}return t}function base64Text(e,t){var r=(e.length-t)%3;if(r===0)return e.toString("base64",t);this.lastNeed=3-r;this.lastTotal=3;if(r===1){this.lastChar[0]=e[e.length-1]}else{this.lastChar[0]=e[e.length-2];this.lastChar[1]=e[e.length-1]}return e.toString("base64",t,e.length-r)}function base64End(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed)return t+this.lastChar.toString("base64",0,3-this.lastNeed);return t}function simpleWrite(e){return e.toString(this.encoding)}function simpleEnd(e){return e&&e.length?this.write(e):""}},121:function(e){e.exports=deprecate;function deprecate(e,t){if(config("noDeprecation")){return e}var r=false;function deprecated(){if(!r){if(config("throwDeprecation")){throw new Error(t)}else if(config("traceDeprecation")){console.trace(t)}else{console.warn(t)}r=true}return e.apply(this,arguments)}return deprecated}function config(e){try{if(!global.localStorage)return false}catch(e){return false}var t=global.localStorage[e];if(null==t)return false;return String(t).toLowerCase()==="true"}},300:function(e){"use strict";e.exports=require("buffer")},361:function(e){"use strict";e.exports=require("events")},781:function(e){"use strict";e.exports=require("events").EventEmitter},837:function(e){"use strict";e.exports=require("util")}};var t={};function __nccwpck_require__(r){var n=t[r];if(n!==undefined){return n.exports}var i=t[r]={exports:{}};var a=true;try{e[r](i,i.exports,__nccwpck_require__);a=false}finally{if(a)delete t[r]}return i.exports}if(typeof __nccwpck_require__!=="undefined")__nccwpck_require__.ab=__dirname+"/";var r=__nccwpck_require__(562);module.exports=r})(); \ No newline at end of file diff --git a/packages/next/compiled/stream-http/index.js b/packages/next/compiled/stream-http/index.js index ad91653e1395..0251f9b153e5 100644 --- a/packages/next/compiled/stream-http/index.js +++ b/packages/next/compiled/stream-http/index.js @@ -1 +1 @@ -(function(){var e={516:function(e){e.exports={100:"Continue",101:"Switching Protocols",102:"Processing",200:"OK",201:"Created",202:"Accepted",203:"Non-Authoritative Information",204:"No Content",205:"Reset Content",206:"Partial Content",207:"Multi-Status",208:"Already Reported",226:"IM Used",300:"Multiple Choices",301:"Moved Permanently",302:"Found",303:"See Other",304:"Not Modified",305:"Use Proxy",307:"Temporary Redirect",308:"Permanent Redirect",400:"Bad Request",401:"Unauthorized",402:"Payment Required",403:"Forbidden",404:"Not Found",405:"Method Not Allowed",406:"Not Acceptable",407:"Proxy Authentication Required",408:"Request Timeout",409:"Conflict",410:"Gone",411:"Length Required",412:"Precondition Failed",413:"Payload Too Large",414:"URI Too Long",415:"Unsupported Media Type",416:"Range Not Satisfiable",417:"Expectation Failed",418:"I'm a teapot",421:"Misdirected Request",422:"Unprocessable Entity",423:"Locked",424:"Failed Dependency",425:"Unordered Collection",426:"Upgrade Required",428:"Precondition Required",429:"Too Many Requests",431:"Request Header Fields Too Large",451:"Unavailable For Legal Reasons",500:"Internal Server Error",501:"Not Implemented",502:"Bad Gateway",503:"Service Unavailable",504:"Gateway Timeout",505:"HTTP Version Not Supported",506:"Variant Also Negotiates",507:"Insufficient Storage",508:"Loop Detected",509:"Bandwidth Limit Exceeded",510:"Not Extended",511:"Network Authentication Required"}},526:function(e){if(typeof Object.create==="function"){e.exports=function inherits(e,t){if(t){e.super_=t;e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}})}}}else{e.exports=function inherits(e,t){if(t){e.super_=t;var TempCtor=function(){};TempCtor.prototype=t.prototype;e.prototype=new TempCtor;e.prototype.constructor=e}}}},118:function(e,t,r){var n=r(300);var i=n.Buffer;function copyProps(e,t){for(var r in e){t[r]=e[r]}}if(i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow){e.exports=n}else{copyProps(n,t);t.Buffer=SafeBuffer}function SafeBuffer(e,t,r){return i(e,t,r)}SafeBuffer.prototype=Object.create(i.prototype);copyProps(i,SafeBuffer);SafeBuffer.from=function(e,t,r){if(typeof e==="number"){throw new TypeError("Argument must not be a number")}return i(e,t,r)};SafeBuffer.alloc=function(e,t,r){if(typeof e!=="number"){throw new TypeError("Argument must be a number")}var n=i(e);if(t!==undefined){if(typeof r==="string"){n.fill(t,r)}else{n.fill(t)}}else{n.fill(0)}return n};SafeBuffer.allocUnsafe=function(e){if(typeof e!=="number"){throw new TypeError("Argument must be a number")}return i(e)};SafeBuffer.allocUnsafeSlow=function(e){if(typeof e!=="number"){throw new TypeError("Argument must be a number")}return n.SlowBuffer(e)}},859:function(e,t,r){var n=r(43);var i=r(808);var a=r(738);var o=r(516);var s=r(310);var f=t;f.request=function(e,t){if(typeof e==="string")e=s.parse(e);else e=a(e);var r=global.location.protocol.search(/^https?:$/)===-1?"http:":"";var i=e.protocol||r;var o=e.hostname||e.host;var f=e.port;var l=e.path||"/";if(o&&o.indexOf(":")!==-1)o="["+o+"]";e.url=(o?i+"//"+o:"")+(f?":"+f:"")+l;e.method=(e.method||"GET").toUpperCase();e.headers=e.headers||{};var u=new n(e);if(t)u.on("response",t);return u};f.get=function get(e,t){var r=f.request(e,t);r.end();return r};f.ClientRequest=n;f.IncomingMessage=i.IncomingMessage;f.Agent=function(){};f.Agent.defaultMaxSockets=4;f.globalAgent=new f.Agent;f.STATUS_CODES=o;f.METHODS=["CHECKOUT","CONNECT","COPY","DELETE","GET","HEAD","LOCK","M-SEARCH","MERGE","MKACTIVITY","MKCOL","MOVE","NOTIFY","OPTIONS","PATCH","POST","PROPFIND","PROPPATCH","PURGE","PUT","REPORT","SEARCH","SUBSCRIBE","TRACE","UNLOCK","UNSUBSCRIBE"]},569:function(e,t){t.fetch=isFunction(global.fetch)&&isFunction(global.ReadableStream);t.writableStream=isFunction(global.WritableStream);t.abortController=isFunction(global.AbortController);var r;function getXHR(){if(r!==undefined)return r;if(global.XMLHttpRequest){r=new global.XMLHttpRequest;try{r.open("GET",global.XDomainRequest?"/":"https://example.com")}catch(e){r=null}}else{r=null}return r}function checkTypeSupport(e){var t=getXHR();if(!t)return false;try{t.responseType=e;return t.responseType===e}catch(e){}return false}t.arraybuffer=t.fetch||checkTypeSupport("arraybuffer");t.msstream=!t.fetch&&checkTypeSupport("ms-stream");t.mozchunkedarraybuffer=!t.fetch&&checkTypeSupport("moz-chunked-arraybuffer");t.overrideMimeType=t.fetch||(getXHR()?isFunction(getXHR().overrideMimeType):false);function isFunction(e){return typeof e==="function"}r=null},43:function(e,t,r){var n=r(569);var i=r(526);var a=r(808);var o=r(121);var s=a.IncomingMessage;var f=a.readyStates;function decideMode(e,t){if(n.fetch&&t){return"fetch"}else if(n.mozchunkedarraybuffer){return"moz-chunked-arraybuffer"}else if(n.msstream){return"ms-stream"}else if(n.arraybuffer&&e){return"arraybuffer"}else{return"text"}}var l=e.exports=function(e){var t=this;o.Writable.call(t);t._opts=e;t._body=[];t._headers={};if(e.auth)t.setHeader("Authorization","Basic "+Buffer.from(e.auth).toString("base64"));Object.keys(e.headers).forEach((function(r){t.setHeader(r,e.headers[r])}));var r;var i=true;if(e.mode==="disable-fetch"||"requestTimeout"in e&&!n.abortController){i=false;r=true}else if(e.mode==="prefer-streaming"){r=false}else if(e.mode==="allow-wrong-content-type"){r=!n.overrideMimeType}else if(!e.mode||e.mode==="default"||e.mode==="prefer-fast"){r=true}else{throw new Error("Invalid value for opts.mode")}t._mode=decideMode(r,i);t._fetchTimer=null;t.on("finish",(function(){t._onFinish()}))};i(l,o.Writable);l.prototype.setHeader=function(e,t){var r=this;var n=e.toLowerCase();if(u.indexOf(n)!==-1)return;r._headers[n]={name:e,value:t}};l.prototype.getHeader=function(e){var t=this._headers[e.toLowerCase()];if(t)return t.value;return null};l.prototype.removeHeader=function(e){var t=this;delete t._headers[e.toLowerCase()]};l.prototype._onFinish=function(){var e=this;if(e._destroyed)return;var t=e._opts;var r=e._headers;var i=null;if(t.method!=="GET"&&t.method!=="HEAD"){i=new Blob(e._body,{type:(r["content-type"]||{}).value||""})}var a=[];Object.keys(r).forEach((function(e){var t=r[e].name;var n=r[e].value;if(Array.isArray(n)){n.forEach((function(e){a.push([t,e])}))}else{a.push([t,n])}}));if(e._mode==="fetch"){var o=null;if(n.abortController){var s=new AbortController;o=s.signal;e._fetchAbortController=s;if("requestTimeout"in t&&t.requestTimeout!==0){e._fetchTimer=global.setTimeout((function(){e.emit("requestTimeout");if(e._fetchAbortController)e._fetchAbortController.abort()}),t.requestTimeout)}}global.fetch(e._opts.url,{method:e._opts.method,headers:a,body:i||undefined,mode:"cors",credentials:t.withCredentials?"include":"same-origin",signal:o}).then((function(t){e._fetchResponse=t;e._connect()}),(function(t){global.clearTimeout(e._fetchTimer);if(!e._destroyed)e.emit("error",t)}))}else{var l=e._xhr=new global.XMLHttpRequest;try{l.open(e._opts.method,e._opts.url,true)}catch(t){process.nextTick((function(){e.emit("error",t)}));return}if("responseType"in l)l.responseType=e._mode;if("withCredentials"in l)l.withCredentials=!!t.withCredentials;if(e._mode==="text"&&"overrideMimeType"in l)l.overrideMimeType("text/plain; charset=x-user-defined");if("requestTimeout"in t){l.timeout=t.requestTimeout;l.ontimeout=function(){e.emit("requestTimeout")}}a.forEach((function(e){l.setRequestHeader(e[0],e[1])}));e._response=null;l.onreadystatechange=function(){switch(l.readyState){case f.LOADING:case f.DONE:e._onXHRProgress();break}};if(e._mode==="moz-chunked-arraybuffer"){l.onprogress=function(){e._onXHRProgress()}}l.onerror=function(){if(e._destroyed)return;e.emit("error",new Error("XHR error"))};try{l.send(i)}catch(t){process.nextTick((function(){e.emit("error",t)}));return}}};function statusValid(e){try{var t=e.status;return t!==null&&t!==0}catch(e){return false}}l.prototype._onXHRProgress=function(){var e=this;if(!statusValid(e._xhr)||e._destroyed)return;if(!e._response)e._connect();e._response._onXHRProgress()};l.prototype._connect=function(){var e=this;if(e._destroyed)return;e._response=new s(e._xhr,e._fetchResponse,e._mode,e._fetchTimer);e._response.on("error",(function(t){e.emit("error",t)}));e.emit("response",e._response)};l.prototype._write=function(e,t,r){var n=this;n._body.push(e);r()};l.prototype.abort=l.prototype.destroy=function(){var e=this;e._destroyed=true;global.clearTimeout(e._fetchTimer);if(e._response)e._response._destroyed=true;if(e._xhr)e._xhr.abort();else if(e._fetchAbortController)e._fetchAbortController.abort()};l.prototype.end=function(e,t,r){var n=this;if(typeof e==="function"){r=e;e=undefined}o.Writable.prototype.end.call(n,e,t,r)};l.prototype.flushHeaders=function(){};l.prototype.setTimeout=function(){};l.prototype.setNoDelay=function(){};l.prototype.setSocketKeepAlive=function(){};var u=["accept-charset","accept-encoding","access-control-request-headers","access-control-request-method","connection","content-length","cookie","cookie2","date","dnt","expect","host","keep-alive","origin","referer","te","trailer","transfer-encoding","upgrade","via"]},808:function(e,t,r){var n=r(569);var i=r(526);var a=r(121);var o=t.readyStates={UNSENT:0,OPENED:1,HEADERS_RECEIVED:2,LOADING:3,DONE:4};var s=t.IncomingMessage=function(e,t,r,i){var o=this;a.Readable.call(o);o._mode=r;o.headers={};o.rawHeaders=[];o.trailers={};o.rawTrailers=[];o.on("end",(function(){process.nextTick((function(){o.emit("close")}))}));if(r==="fetch"){o._fetchResponse=t;o.url=t.url;o.statusCode=t.status;o.statusMessage=t.statusText;t.headers.forEach((function(e,t){o.headers[t.toLowerCase()]=e;o.rawHeaders.push(t,e)}));if(n.writableStream){var s=new WritableStream({write:function(e){return new Promise((function(t,r){if(o._destroyed){r()}else if(o.push(Buffer.from(e))){t()}else{o._resumeFetch=t}}))},close:function(){global.clearTimeout(i);if(!o._destroyed)o.push(null)},abort:function(e){if(!o._destroyed)o.emit("error",e)}});try{t.body.pipeTo(s).catch((function(e){global.clearTimeout(i);if(!o._destroyed)o.emit("error",e)}));return}catch(e){}}var f=t.body.getReader();function read(){f.read().then((function(e){if(o._destroyed)return;if(e.done){global.clearTimeout(i);o.push(null);return}o.push(Buffer.from(e.value));read()})).catch((function(e){global.clearTimeout(i);if(!o._destroyed)o.emit("error",e)}))}read()}else{o._xhr=e;o._pos=0;o.url=e.responseURL;o.statusCode=e.status;o.statusMessage=e.statusText;var l=e.getAllResponseHeaders().split(/\r?\n/);l.forEach((function(e){var t=e.match(/^([^:]+):\s*(.*)/);if(t){var r=t[1].toLowerCase();if(r==="set-cookie"){if(o.headers[r]===undefined){o.headers[r]=[]}o.headers[r].push(t[2])}else if(o.headers[r]!==undefined){o.headers[r]+=", "+t[2]}else{o.headers[r]=t[2]}o.rawHeaders.push(t[1],t[2])}}));o._charset="x-user-defined";if(!n.overrideMimeType){var u=o.rawHeaders["mime-type"];if(u){var d=u.match(/;\s*charset=([^;])(;|$)/);if(d){o._charset=d[1].toLowerCase()}}if(!o._charset)o._charset="utf-8"}}};i(s,a.Readable);s.prototype._read=function(){var e=this;var t=e._resumeFetch;if(t){e._resumeFetch=null;t()}};s.prototype._onXHRProgress=function(){var e=this;var t=e._xhr;var r=null;switch(e._mode){case"text":r=t.responseText;if(r.length>e._pos){var n=r.substr(e._pos);if(e._charset==="x-user-defined"){var i=Buffer.alloc(n.length);for(var a=0;ae._pos){e.push(Buffer.from(new Uint8Array(s.result.slice(e._pos))));e._pos=s.result.byteLength}};s.onload=function(){e.push(null)};s.readAsArrayBuffer(r);break}if(e._xhr.readyState===o.DONE&&e._mode!=="ms-stream"){e.push(null)}}},558:function(e){"use strict";const t={};function createErrorType(e,r,n){if(!n){n=Error}function getMessage(e,t,n){if(typeof r==="string"){return r}else{return r(e,t,n)}}class NodeError extends n{constructor(e,t,r){super(getMessage(e,t,r))}}NodeError.prototype.name=n.name;NodeError.prototype.code=e;t[e]=NodeError}function oneOf(e,t){if(Array.isArray(e)){const r=e.length;e=e.map((e=>String(e)));if(r>2){return`one of ${t} ${e.slice(0,r-1).join(", ")}, or `+e[r-1]}else if(r===2){return`one of ${t} ${e[0]} or ${e[1]}`}else{return`of ${t} ${e[0]}`}}else{return`of ${t} ${String(e)}`}}function startsWith(e,t,r){return e.substr(!r||r<0?0:+r,t.length)===t}function endsWith(e,t,r){if(r===undefined||r>e.length){r=e.length}return e.substring(r-t.length,r)===t}function includes(e,t,r){if(typeof r!=="number"){r=0}if(r+t.length>e.length){return false}else{return e.indexOf(t,r)!==-1}}createErrorType("ERR_INVALID_OPT_VALUE",(function(e,t){return'The value "'+t+'" is invalid for option "'+e+'"'}),TypeError);createErrorType("ERR_INVALID_ARG_TYPE",(function(e,t,r){let n;if(typeof t==="string"&&startsWith(t,"not ")){n="must not be";t=t.replace(/^not /,"")}else{n="must be"}let i;if(endsWith(e," argument")){i=`The ${e} ${n} ${oneOf(t,"type")}`}else{const r=includes(e,".")?"property":"argument";i=`The "${e}" ${r} ${n} ${oneOf(t,"type")}`}i+=`. Received type ${typeof r}`;return i}),TypeError);createErrorType("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF");createErrorType("ERR_METHOD_NOT_IMPLEMENTED",(function(e){return"The "+e+" method is not implemented"}));createErrorType("ERR_STREAM_PREMATURE_CLOSE","Premature close");createErrorType("ERR_STREAM_DESTROYED",(function(e){return"Cannot call "+e+" after a stream was destroyed"}));createErrorType("ERR_MULTIPLE_CALLBACK","Callback called multiple times");createErrorType("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable");createErrorType("ERR_STREAM_WRITE_AFTER_END","write after end");createErrorType("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError);createErrorType("ERR_UNKNOWN_ENCODING",(function(e){return"Unknown encoding: "+e}),TypeError);createErrorType("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event");e.exports.q=t},309:function(e,t,r){"use strict";var n=Object.keys||function(e){var t=[];for(var r in e){t.push(r)}return t};e.exports=Duplex;var i=r(903);var a=r(551);r(526)(Duplex,i);{var o=n(a.prototype);for(var s=0;s0){if(typeof t!=="string"&&!a.objectMode&&Object.getPrototypeOf(t)!==s.prototype){t=_uint8ArrayToBuffer(t)}if(n){if(a.endEmitted)S(e,new v);else addChunk(e,a,t,true)}else if(a.ended){S(e,new g)}else if(a.destroyed){return false}else{a.reading=false;if(a.decoder&&!r){t=a.decoder.write(t);if(a.objectMode||t.length!==0)addChunk(e,a,t,false);else maybeReadMore(e,a)}else{addChunk(e,a,t,false)}}}else if(!n){a.reading=false;maybeReadMore(e,a)}}return!a.ended&&(a.length=T){e=T}else{e--;e|=e>>>1;e|=e>>>2;e|=e>>>4;e|=e>>>8;e|=e>>>16;e++}return e}function howMuchToRead(e,t){if(e<=0||t.length===0&&t.ended)return 0;if(t.objectMode)return 1;if(e!==e){if(t.flowing&&t.length)return t.buffer.head.data.length;else return t.length}if(e>t.highWaterMark)t.highWaterMark=computeNewHighWaterMark(e);if(e<=t.length)return e;if(!t.ended){t.needReadable=true;return 0}return t.length}Readable.prototype.read=function(e){u("read",e);e=parseInt(e,10);var t=this._readableState;var r=e;if(e!==0)t.emittedReadable=false;if(e===0&&t.needReadable&&((t.highWaterMark!==0?t.length>=t.highWaterMark:t.length>0)||t.ended)){u("read: emitReadable",t.length,t.ended);if(t.length===0&&t.ended)endReadable(this);else emitReadable(this);return null}e=howMuchToRead(e,t);if(e===0&&t.ended){if(t.length===0)endReadable(this);return null}var n=t.needReadable;u("need readable",n);if(t.length===0||t.length-e0)i=fromList(e,t);else i=null;if(i===null){t.needReadable=t.length<=t.highWaterMark;e=0}else{t.length-=e;t.awaitDrain=0}if(t.length===0){if(!t.ended)t.needReadable=true;if(r!==e&&t.ended)endReadable(this)}if(i!==null)this.emit("data",i);return i};function onEofChunk(e,t){u("onEofChunk");if(t.ended)return;if(t.decoder){var r=t.decoder.end();if(r&&r.length){t.buffer.push(r);t.length+=t.objectMode?1:r.length}}t.ended=true;if(t.sync){emitReadable(e)}else{t.needReadable=false;if(!t.emittedReadable){t.emittedReadable=true;emitReadable_(e)}}}function emitReadable(e){var t=e._readableState;u("emitReadable",t.needReadable,t.emittedReadable);t.needReadable=false;if(!t.emittedReadable){u("emitReadable",t.flowing);t.emittedReadable=true;process.nextTick(emitReadable_,e)}}function emitReadable_(e){var t=e._readableState;u("emitReadable_",t.destroyed,t.length,t.ended);if(!t.destroyed&&(t.length||t.ended)){e.emit("readable");t.emittedReadable=false}t.needReadable=!t.flowing&&!t.ended&&t.length<=t.highWaterMark;flow(e)}function maybeReadMore(e,t){if(!t.readingMore){t.readingMore=true;process.nextTick(maybeReadMore_,e,t)}}function maybeReadMore_(e,t){while(!t.reading&&!t.ended&&(t.length1&&indexOf(n.pipes,e)!==-1)&&!f){u("false write response, pause",n.awaitDrain);n.awaitDrain++}r.pause()}}function onerror(t){u("onerror",t);unpipe();e.removeListener("error",onerror);if(a(e,"error")===0)S(e,t)}prependListener(e,"error",onerror);function onclose(){e.removeListener("finish",onfinish);unpipe()}e.once("close",onclose);function onfinish(){u("onfinish");e.removeListener("close",onclose);unpipe()}e.once("finish",onfinish);function unpipe(){u("unpipe");r.unpipe(e)}e.emit("pipe",r);if(!n.flowing){u("pipe resume");r.resume()}return e};function pipeOnDrain(e){return function pipeOnDrainFunctionResult(){var t=e._readableState;u("pipeOnDrain",t.awaitDrain);if(t.awaitDrain)t.awaitDrain--;if(t.awaitDrain===0&&a(e,"data")){t.flowing=true;flow(e)}}}Readable.prototype.unpipe=function(e){var t=this._readableState;var r={hasUnpiped:false};if(t.pipesCount===0)return this;if(t.pipesCount===1){if(e&&e!==t.pipes)return this;if(!e)e=t.pipes;t.pipes=null;t.pipesCount=0;t.flowing=false;if(e)e.emit("unpipe",this,r);return this}if(!e){var n=t.pipes;var i=t.pipesCount;t.pipes=null;t.pipesCount=0;t.flowing=false;for(var a=0;a0;if(n.flowing!==false)this.resume()}else if(e==="readable"){if(!n.endEmitted&&!n.readableListening){n.readableListening=n.needReadable=true;n.flowing=false;n.emittedReadable=false;u("on readable",n.length,n.reading);if(n.length){emitReadable(this)}else if(!n.reading){process.nextTick(nReadingNextTick,this)}}}return r};Readable.prototype.addListener=Readable.prototype.on;Readable.prototype.removeListener=function(e,t){var r=o.prototype.removeListener.call(this,e,t);if(e==="readable"){process.nextTick(updateReadableListening,this)}return r};Readable.prototype.removeAllListeners=function(e){var t=o.prototype.removeAllListeners.apply(this,arguments);if(e==="readable"||e===undefined){process.nextTick(updateReadableListening,this)}return t};function updateReadableListening(e){var t=e._readableState;t.readableListening=e.listenerCount("readable")>0;if(t.resumeScheduled&&!t.paused){t.flowing=true}else if(e.listenerCount("data")>0){e.resume()}}function nReadingNextTick(e){u("readable nexttick read 0");e.read(0)}Readable.prototype.resume=function(){var e=this._readableState;if(!e.flowing){u("resume");e.flowing=!e.readableListening;resume(this,e)}e.paused=false;return this};function resume(e,t){if(!t.resumeScheduled){t.resumeScheduled=true;process.nextTick(resume_,e,t)}}function resume_(e,t){u("resume",t.reading);if(!t.reading){e.read(0)}t.resumeScheduled=false;e.emit("resume");flow(e);if(t.flowing&&!t.reading)e.read(0)}Readable.prototype.pause=function(){u("call pause flowing=%j",this._readableState.flowing);if(this._readableState.flowing!==false){u("pause");this._readableState.flowing=false;this.emit("pause")}this._readableState.paused=true;return this};function flow(e){var t=e._readableState;u("flow",t.flowing);while(t.flowing&&e.read()!==null){}}Readable.prototype.wrap=function(e){var t=this;var r=this._readableState;var n=false;e.on("end",(function(){u("wrapped end");if(r.decoder&&!r.ended){var e=r.decoder.end();if(e&&e.length)t.push(e)}t.push(null)}));e.on("data",(function(i){u("wrapped data");if(r.decoder)i=r.decoder.write(i);if(r.objectMode&&(i===null||i===undefined))return;else if(!r.objectMode&&(!i||!i.length))return;var a=t.push(i);if(!a){n=true;e.pause()}}));for(var i in e){if(this[i]===undefined&&typeof e[i]==="function"){this[i]=function methodWrap(t){return function methodWrapReturnFunction(){return e[t].apply(e,arguments)}}(i)}}for(var a=0;a=t.length){if(t.decoder)r=t.buffer.join("");else if(t.buffer.length===1)r=t.buffer.first();else r=t.buffer.concat(t.length);t.buffer.clear()}else{r=t.buffer.consume(e,t.decoder)}return r}function endReadable(e){var t=e._readableState;u("endReadable",t.endEmitted);if(!t.endEmitted){t.ended=true;process.nextTick(endReadableNT,t,e)}}function endReadableNT(e,t){u("endReadableNT",e.endEmitted,e.length);if(!e.endEmitted&&e.length===0){e.endEmitted=true;t.readable=false;t.emit("end");if(e.autoDestroy){var r=t._writableState;if(!r||r.autoDestroy&&r.finished){t.destroy()}}}}if(typeof Symbol==="function"){Readable.from=function(e,t){if(R===undefined){R=r(722)}return R(Readable,e,t)}}function indexOf(e,t){for(var r=0,n=e.length;r-1))throw new v(e);this._writableState.defaultEncoding=e;return this};Object.defineProperty(Writable.prototype,"writableBuffer",{enumerable:false,get:function get(){return this._writableState&&this._writableState.getBuffer()}});function decodeChunk(e,t,r){if(!e.objectMode&&e.decodeStrings!==false&&typeof t==="string"){t=o.from(t,r)}return t}Object.defineProperty(Writable.prototype,"writableHighWaterMark",{enumerable:false,get:function get(){return this._writableState.highWaterMark}});function writeOrBuffer(e,t,r,n,i,a){if(!r){var o=decodeChunk(t,n,i);if(n!==o){r=true;i="buffer";n=o}}var s=t.objectMode?1:n.length;t.length+=s;var f=t.length0)this.tail.next=t;else this.head=t;this.tail=t;++this.length}},{key:"unshift",value:function unshift(e){var t={data:e,next:this.head};if(this.length===0)this.tail=t;this.head=t;++this.length}},{key:"shift",value:function shift(){if(this.length===0)return;var e=this.head.data;if(this.length===1)this.head=this.tail=null;else this.head=this.head.next;--this.length;return e}},{key:"clear",value:function clear(){this.head=this.tail=null;this.length=0}},{key:"join",value:function join(e){if(this.length===0)return"";var t=this.head;var r=""+t.data;while(t=t.next){r+=e+t.data}return r}},{key:"concat",value:function concat(e){if(this.length===0)return i.alloc(0);var t=i.allocUnsafe(e>>>0);var r=this.head;var n=0;while(r){copyBuffer(r.data,t,n);n+=r.data.length;r=r.next}return t}},{key:"consume",value:function consume(e,t){var r;if(ei.length?i.length:e;if(a===i.length)n+=i;else n+=i.slice(0,e);e-=a;if(e===0){if(a===i.length){++r;if(t.next)this.head=t.next;else this.head=this.tail=null}else{this.head=t;t.data=i.slice(a)}break}++r}this.length-=r;return n}},{key:"_getBuffer",value:function _getBuffer(e){var t=i.allocUnsafe(e);var r=this.head;var n=1;r.data.copy(t);e-=r.data.length;while(r=r.next){var a=r.data;var o=e>a.length?a.length:e;a.copy(t,t.length-e,0,o);e-=o;if(e===0){if(o===a.length){++n;if(r.next)this.head=r.next;else this.head=this.tail=null}else{this.head=r;r.data=a.slice(o)}break}++n}this.length-=n;return t}},{key:s,value:function value(e,t){return o(this,_objectSpread({},t,{depth:0,customInspect:false}))}}]);return BufferList}()},556:function(e){"use strict";function destroy(e,t){var r=this;var n=this._readableState&&this._readableState.destroyed;var i=this._writableState&&this._writableState.destroyed;if(n||i){if(t){t(e)}else if(e){if(!this._writableState){process.nextTick(emitErrorNT,this,e)}else if(!this._writableState.errorEmitted){this._writableState.errorEmitted=true;process.nextTick(emitErrorNT,this,e)}}return this}if(this._readableState){this._readableState.destroyed=true}if(this._writableState){this._writableState.destroyed=true}this._destroy(e||null,(function(e){if(!t&&e){if(!r._writableState){process.nextTick(emitErrorAndCloseNT,r,e)}else if(!r._writableState.errorEmitted){r._writableState.errorEmitted=true;process.nextTick(emitErrorAndCloseNT,r,e)}else{process.nextTick(emitCloseNT,r)}}else if(t){process.nextTick(emitCloseNT,r);t(e)}else{process.nextTick(emitCloseNT,r)}}));return this}function emitErrorAndCloseNT(e,t){emitErrorNT(e,t);emitCloseNT(e)}function emitCloseNT(e){if(e._writableState&&!e._writableState.emitClose)return;if(e._readableState&&!e._readableState.emitClose)return;e.emit("close")}function undestroy(){if(this._readableState){this._readableState.destroyed=false;this._readableState.reading=false;this._readableState.ended=false;this._readableState.endEmitted=false}if(this._writableState){this._writableState.destroyed=false;this._writableState.ended=false;this._writableState.ending=false;this._writableState.finalCalled=false;this._writableState.prefinished=false;this._writableState.finished=false;this._writableState.errorEmitted=false}}function emitErrorNT(e,t){e.emit("error",t)}function errorOrDestroy(e,t){var r=e._readableState;var n=e._writableState;if(r&&r.autoDestroy||n&&n.autoDestroy)e.destroy(t);else e.emit("error",t)}e.exports={destroy:destroy,undestroy:undestroy,errorOrDestroy:errorOrDestroy}},745:function(e,t,r){"use strict";var n=r(558).q.ERR_STREAM_PREMATURE_CLOSE;function once(e){var t=false;return function(){if(t)return;t=true;for(var r=arguments.length,n=new Array(r),i=0;i0;return destroyer(e,a,s,(function(e){if(!i)i=e;if(e)o.forEach(call);if(a)return;o.forEach(call);n(i)}))}));return t.reduce(pipe)}e.exports=pipeline},416:function(e,t,r){"use strict";var n=r(558).q.ERR_INVALID_OPT_VALUE;function highWaterMarkFrom(e,t,r){return e.highWaterMark!=null?e.highWaterMark:t?e[r]:null}function getHighWaterMark(e,t,r,i){var a=highWaterMarkFrom(t,i,r);if(a!=null){if(!(isFinite(a)&&Math.floor(a)===a)||a<0){var o=i?r:"highWaterMark";throw new n(o,a)}return Math.floor(a)}return e.objectMode?16:16*1024}e.exports={getHighWaterMark:getHighWaterMark}},982:function(e,t,r){e.exports=r(781)},121:function(e,t,r){var n=r(781);if(process.env.READABLE_STREAM==="disable"&&n){e.exports=n.Readable;Object.assign(e.exports,n);e.exports.Stream=n}else{t=e.exports=r(903);t.Stream=n||t;t.Readable=t;t.Writable=r(551);t.Duplex=r(309);t.Transform=r(767);t.PassThrough=r(268);t.finished=r(745);t.pipeline=r(921)}},642:function(e,t,r){"use strict";var n=r(118).Buffer;var i=n.isEncoding||function(e){e=""+e;switch(e&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return true;default:return false}};function _normalizeEncoding(e){if(!e)return"utf8";var t;while(true){switch(e){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return e;default:if(t)return;e=(""+e).toLowerCase();t=true}}}function normalizeEncoding(e){var t=_normalizeEncoding(e);if(typeof t!=="string"&&(n.isEncoding===i||!i(e)))throw new Error("Unknown encoding: "+e);return t||e}t.s=StringDecoder;function StringDecoder(e){this.encoding=normalizeEncoding(e);var t;switch(this.encoding){case"utf16le":this.text=utf16Text;this.end=utf16End;t=4;break;case"utf8":this.fillLast=utf8FillLast;t=4;break;case"base64":this.text=base64Text;this.end=base64End;t=3;break;default:this.write=simpleWrite;this.end=simpleEnd;return}this.lastNeed=0;this.lastTotal=0;this.lastChar=n.allocUnsafe(t)}StringDecoder.prototype.write=function(e){if(e.length===0)return"";var t;var r;if(this.lastNeed){t=this.fillLast(e);if(t===undefined)return"";r=this.lastNeed;this.lastNeed=0}else{r=0}if(r>5===6)return 2;else if(e>>4===14)return 3;else if(e>>3===30)return 4;return e>>6===2?-1:-2}function utf8CheckIncomplete(e,t,r){var n=t.length-1;if(n=0){if(i>0)e.lastNeed=i-1;return i}if(--n=0){if(i>0)e.lastNeed=i-2;return i}if(--n=0){if(i>0){if(i===2)i=0;else e.lastNeed=i-3}return i}return 0}function utf8CheckExtraBytes(e,t,r){if((t[0]&192)!==128){e.lastNeed=0;return"�"}if(e.lastNeed>1&&t.length>1){if((t[1]&192)!==128){e.lastNeed=1;return"�"}if(e.lastNeed>2&&t.length>2){if((t[2]&192)!==128){e.lastNeed=2;return"�"}}}}function utf8FillLast(e){var t=this.lastTotal-this.lastNeed;var r=utf8CheckExtraBytes(this,e,t);if(r!==undefined)return r;if(this.lastNeed<=e.length){e.copy(this.lastChar,t,0,this.lastNeed);return this.lastChar.toString(this.encoding,0,this.lastTotal)}e.copy(this.lastChar,t,0,e.length);this.lastNeed-=e.length}function utf8Text(e,t){var r=utf8CheckIncomplete(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=r;var n=e.length-(r-this.lastNeed);e.copy(this.lastChar,0,n);return e.toString("utf8",t,n)}function utf8End(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed)return t+"�";return t}function utf16Text(e,t){if((e.length-t)%2===0){var r=e.toString("utf16le",t);if(r){var n=r.charCodeAt(r.length-1);if(n>=55296&&n<=56319){this.lastNeed=2;this.lastTotal=4;this.lastChar[0]=e[e.length-2];this.lastChar[1]=e[e.length-1];return r.slice(0,-1)}}return r}this.lastNeed=1;this.lastTotal=2;this.lastChar[0]=e[e.length-1];return e.toString("utf16le",t,e.length-1)}function utf16End(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,r)}return t}function base64Text(e,t){var r=(e.length-t)%3;if(r===0)return e.toString("base64",t);this.lastNeed=3-r;this.lastTotal=3;if(r===1){this.lastChar[0]=e[e.length-1]}else{this.lastChar[0]=e[e.length-2];this.lastChar[1]=e[e.length-1]}return e.toString("base64",t,e.length-r)}function base64End(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed)return t+this.lastChar.toString("base64",0,3-this.lastNeed);return t}function simpleWrite(e){return e.toString(this.encoding)}function simpleEnd(e){return e&&e.length?this.write(e):""}},989:function(e){e.exports=deprecate;function deprecate(e,t){if(config("noDeprecation")){return e}var r=false;function deprecated(){if(!r){if(config("throwDeprecation")){throw new Error(t)}else if(config("traceDeprecation")){console.trace(t)}else{console.warn(t)}r=true}return e.apply(this,arguments)}return deprecated}function config(e){try{if(!global.localStorage)return false}catch(e){return false}var t=global.localStorage[e];if(null==t)return false;return String(t).toLowerCase()==="true"}},738:function(e){e.exports=extend;var t=Object.prototype.hasOwnProperty;function extend(){var e={};for(var r=0;re._pos){var n=r.substr(e._pos);if(e._charset==="x-user-defined"){var i=Buffer.alloc(n.length);for(var a=0;ae._pos){e.push(Buffer.from(new Uint8Array(s.result.slice(e._pos))));e._pos=s.result.byteLength}};s.onload=function(){e.push(null)};s.readAsArrayBuffer(r);break}if(e._xhr.readyState===o.DONE&&e._mode!=="ms-stream"){e.push(null)}}},558:function(e){"use strict";const t={};function createErrorType(e,r,n){if(!n){n=Error}function getMessage(e,t,n){if(typeof r==="string"){return r}else{return r(e,t,n)}}class NodeError extends n{constructor(e,t,r){super(getMessage(e,t,r))}}NodeError.prototype.name=n.name;NodeError.prototype.code=e;t[e]=NodeError}function oneOf(e,t){if(Array.isArray(e)){const r=e.length;e=e.map((e=>String(e)));if(r>2){return`one of ${t} ${e.slice(0,r-1).join(", ")}, or `+e[r-1]}else if(r===2){return`one of ${t} ${e[0]} or ${e[1]}`}else{return`of ${t} ${e[0]}`}}else{return`of ${t} ${String(e)}`}}function startsWith(e,t,r){return e.substr(!r||r<0?0:+r,t.length)===t}function endsWith(e,t,r){if(r===undefined||r>e.length){r=e.length}return e.substring(r-t.length,r)===t}function includes(e,t,r){if(typeof r!=="number"){r=0}if(r+t.length>e.length){return false}else{return e.indexOf(t,r)!==-1}}createErrorType("ERR_INVALID_OPT_VALUE",(function(e,t){return'The value "'+t+'" is invalid for option "'+e+'"'}),TypeError);createErrorType("ERR_INVALID_ARG_TYPE",(function(e,t,r){let n;if(typeof t==="string"&&startsWith(t,"not ")){n="must not be";t=t.replace(/^not /,"")}else{n="must be"}let i;if(endsWith(e," argument")){i=`The ${e} ${n} ${oneOf(t,"type")}`}else{const r=includes(e,".")?"property":"argument";i=`The "${e}" ${r} ${n} ${oneOf(t,"type")}`}i+=`. Received type ${typeof r}`;return i}),TypeError);createErrorType("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF");createErrorType("ERR_METHOD_NOT_IMPLEMENTED",(function(e){return"The "+e+" method is not implemented"}));createErrorType("ERR_STREAM_PREMATURE_CLOSE","Premature close");createErrorType("ERR_STREAM_DESTROYED",(function(e){return"Cannot call "+e+" after a stream was destroyed"}));createErrorType("ERR_MULTIPLE_CALLBACK","Callback called multiple times");createErrorType("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable");createErrorType("ERR_STREAM_WRITE_AFTER_END","write after end");createErrorType("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError);createErrorType("ERR_UNKNOWN_ENCODING",(function(e){return"Unknown encoding: "+e}),TypeError);createErrorType("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event");e.exports.q=t},309:function(e,t,r){"use strict";var n=Object.keys||function(e){var t=[];for(var r in e){t.push(r)}return t};e.exports=Duplex;var i=r(903);var a=r(551);r(526)(Duplex,i);{var o=n(a.prototype);for(var s=0;s0){if(typeof t!=="string"&&!a.objectMode&&Object.getPrototypeOf(t)!==s.prototype){t=_uint8ArrayToBuffer(t)}if(n){if(a.endEmitted)S(e,new v);else addChunk(e,a,t,true)}else if(a.ended){S(e,new g)}else if(a.destroyed){return false}else{a.reading=false;if(a.decoder&&!r){t=a.decoder.write(t);if(a.objectMode||t.length!==0)addChunk(e,a,t,false);else maybeReadMore(e,a)}else{addChunk(e,a,t,false)}}}else if(!n){a.reading=false;maybeReadMore(e,a)}}return!a.ended&&(a.length=T){e=T}else{e--;e|=e>>>1;e|=e>>>2;e|=e>>>4;e|=e>>>8;e|=e>>>16;e++}return e}function howMuchToRead(e,t){if(e<=0||t.length===0&&t.ended)return 0;if(t.objectMode)return 1;if(e!==e){if(t.flowing&&t.length)return t.buffer.head.data.length;else return t.length}if(e>t.highWaterMark)t.highWaterMark=computeNewHighWaterMark(e);if(e<=t.length)return e;if(!t.ended){t.needReadable=true;return 0}return t.length}Readable.prototype.read=function(e){u("read",e);e=parseInt(e,10);var t=this._readableState;var r=e;if(e!==0)t.emittedReadable=false;if(e===0&&t.needReadable&&((t.highWaterMark!==0?t.length>=t.highWaterMark:t.length>0)||t.ended)){u("read: emitReadable",t.length,t.ended);if(t.length===0&&t.ended)endReadable(this);else emitReadable(this);return null}e=howMuchToRead(e,t);if(e===0&&t.ended){if(t.length===0)endReadable(this);return null}var n=t.needReadable;u("need readable",n);if(t.length===0||t.length-e0)i=fromList(e,t);else i=null;if(i===null){t.needReadable=t.length<=t.highWaterMark;e=0}else{t.length-=e;t.awaitDrain=0}if(t.length===0){if(!t.ended)t.needReadable=true;if(r!==e&&t.ended)endReadable(this)}if(i!==null)this.emit("data",i);return i};function onEofChunk(e,t){u("onEofChunk");if(t.ended)return;if(t.decoder){var r=t.decoder.end();if(r&&r.length){t.buffer.push(r);t.length+=t.objectMode?1:r.length}}t.ended=true;if(t.sync){emitReadable(e)}else{t.needReadable=false;if(!t.emittedReadable){t.emittedReadable=true;emitReadable_(e)}}}function emitReadable(e){var t=e._readableState;u("emitReadable",t.needReadable,t.emittedReadable);t.needReadable=false;if(!t.emittedReadable){u("emitReadable",t.flowing);t.emittedReadable=true;process.nextTick(emitReadable_,e)}}function emitReadable_(e){var t=e._readableState;u("emitReadable_",t.destroyed,t.length,t.ended);if(!t.destroyed&&(t.length||t.ended)){e.emit("readable");t.emittedReadable=false}t.needReadable=!t.flowing&&!t.ended&&t.length<=t.highWaterMark;flow(e)}function maybeReadMore(e,t){if(!t.readingMore){t.readingMore=true;process.nextTick(maybeReadMore_,e,t)}}function maybeReadMore_(e,t){while(!t.reading&&!t.ended&&(t.length1&&indexOf(n.pipes,e)!==-1)&&!f){u("false write response, pause",n.awaitDrain);n.awaitDrain++}r.pause()}}function onerror(t){u("onerror",t);unpipe();e.removeListener("error",onerror);if(a(e,"error")===0)S(e,t)}prependListener(e,"error",onerror);function onclose(){e.removeListener("finish",onfinish);unpipe()}e.once("close",onclose);function onfinish(){u("onfinish");e.removeListener("close",onclose);unpipe()}e.once("finish",onfinish);function unpipe(){u("unpipe");r.unpipe(e)}e.emit("pipe",r);if(!n.flowing){u("pipe resume");r.resume()}return e};function pipeOnDrain(e){return function pipeOnDrainFunctionResult(){var t=e._readableState;u("pipeOnDrain",t.awaitDrain);if(t.awaitDrain)t.awaitDrain--;if(t.awaitDrain===0&&a(e,"data")){t.flowing=true;flow(e)}}}Readable.prototype.unpipe=function(e){var t=this._readableState;var r={hasUnpiped:false};if(t.pipesCount===0)return this;if(t.pipesCount===1){if(e&&e!==t.pipes)return this;if(!e)e=t.pipes;t.pipes=null;t.pipesCount=0;t.flowing=false;if(e)e.emit("unpipe",this,r);return this}if(!e){var n=t.pipes;var i=t.pipesCount;t.pipes=null;t.pipesCount=0;t.flowing=false;for(var a=0;a0;if(n.flowing!==false)this.resume()}else if(e==="readable"){if(!n.endEmitted&&!n.readableListening){n.readableListening=n.needReadable=true;n.flowing=false;n.emittedReadable=false;u("on readable",n.length,n.reading);if(n.length){emitReadable(this)}else if(!n.reading){process.nextTick(nReadingNextTick,this)}}}return r};Readable.prototype.addListener=Readable.prototype.on;Readable.prototype.removeListener=function(e,t){var r=o.prototype.removeListener.call(this,e,t);if(e==="readable"){process.nextTick(updateReadableListening,this)}return r};Readable.prototype.removeAllListeners=function(e){var t=o.prototype.removeAllListeners.apply(this,arguments);if(e==="readable"||e===undefined){process.nextTick(updateReadableListening,this)}return t};function updateReadableListening(e){var t=e._readableState;t.readableListening=e.listenerCount("readable")>0;if(t.resumeScheduled&&!t.paused){t.flowing=true}else if(e.listenerCount("data")>0){e.resume()}}function nReadingNextTick(e){u("readable nexttick read 0");e.read(0)}Readable.prototype.resume=function(){var e=this._readableState;if(!e.flowing){u("resume");e.flowing=!e.readableListening;resume(this,e)}e.paused=false;return this};function resume(e,t){if(!t.resumeScheduled){t.resumeScheduled=true;process.nextTick(resume_,e,t)}}function resume_(e,t){u("resume",t.reading);if(!t.reading){e.read(0)}t.resumeScheduled=false;e.emit("resume");flow(e);if(t.flowing&&!t.reading)e.read(0)}Readable.prototype.pause=function(){u("call pause flowing=%j",this._readableState.flowing);if(this._readableState.flowing!==false){u("pause");this._readableState.flowing=false;this.emit("pause")}this._readableState.paused=true;return this};function flow(e){var t=e._readableState;u("flow",t.flowing);while(t.flowing&&e.read()!==null){}}Readable.prototype.wrap=function(e){var t=this;var r=this._readableState;var n=false;e.on("end",(function(){u("wrapped end");if(r.decoder&&!r.ended){var e=r.decoder.end();if(e&&e.length)t.push(e)}t.push(null)}));e.on("data",(function(i){u("wrapped data");if(r.decoder)i=r.decoder.write(i);if(r.objectMode&&(i===null||i===undefined))return;else if(!r.objectMode&&(!i||!i.length))return;var a=t.push(i);if(!a){n=true;e.pause()}}));for(var i in e){if(this[i]===undefined&&typeof e[i]==="function"){this[i]=function methodWrap(t){return function methodWrapReturnFunction(){return e[t].apply(e,arguments)}}(i)}}for(var a=0;a=t.length){if(t.decoder)r=t.buffer.join("");else if(t.buffer.length===1)r=t.buffer.first();else r=t.buffer.concat(t.length);t.buffer.clear()}else{r=t.buffer.consume(e,t.decoder)}return r}function endReadable(e){var t=e._readableState;u("endReadable",t.endEmitted);if(!t.endEmitted){t.ended=true;process.nextTick(endReadableNT,t,e)}}function endReadableNT(e,t){u("endReadableNT",e.endEmitted,e.length);if(!e.endEmitted&&e.length===0){e.endEmitted=true;t.readable=false;t.emit("end");if(e.autoDestroy){var r=t._writableState;if(!r||r.autoDestroy&&r.finished){t.destroy()}}}}if(typeof Symbol==="function"){Readable.from=function(e,t){if(R===undefined){R=r(722)}return R(Readable,e,t)}}function indexOf(e,t){for(var r=0,n=e.length;r-1))throw new v(e);this._writableState.defaultEncoding=e;return this};Object.defineProperty(Writable.prototype,"writableBuffer",{enumerable:false,get:function get(){return this._writableState&&this._writableState.getBuffer()}});function decodeChunk(e,t,r){if(!e.objectMode&&e.decodeStrings!==false&&typeof t==="string"){t=o.from(t,r)}return t}Object.defineProperty(Writable.prototype,"writableHighWaterMark",{enumerable:false,get:function get(){return this._writableState.highWaterMark}});function writeOrBuffer(e,t,r,n,i,a){if(!r){var o=decodeChunk(t,n,i);if(n!==o){r=true;i="buffer";n=o}}var s=t.objectMode?1:n.length;t.length+=s;var f=t.length0)this.tail.next=t;else this.head=t;this.tail=t;++this.length}},{key:"unshift",value:function unshift(e){var t={data:e,next:this.head};if(this.length===0)this.tail=t;this.head=t;++this.length}},{key:"shift",value:function shift(){if(this.length===0)return;var e=this.head.data;if(this.length===1)this.head=this.tail=null;else this.head=this.head.next;--this.length;return e}},{key:"clear",value:function clear(){this.head=this.tail=null;this.length=0}},{key:"join",value:function join(e){if(this.length===0)return"";var t=this.head;var r=""+t.data;while(t=t.next){r+=e+t.data}return r}},{key:"concat",value:function concat(e){if(this.length===0)return i.alloc(0);var t=i.allocUnsafe(e>>>0);var r=this.head;var n=0;while(r){copyBuffer(r.data,t,n);n+=r.data.length;r=r.next}return t}},{key:"consume",value:function consume(e,t){var r;if(ei.length?i.length:e;if(a===i.length)n+=i;else n+=i.slice(0,e);e-=a;if(e===0){if(a===i.length){++r;if(t.next)this.head=t.next;else this.head=this.tail=null}else{this.head=t;t.data=i.slice(a)}break}++r}this.length-=r;return n}},{key:"_getBuffer",value:function _getBuffer(e){var t=i.allocUnsafe(e);var r=this.head;var n=1;r.data.copy(t);e-=r.data.length;while(r=r.next){var a=r.data;var o=e>a.length?a.length:e;a.copy(t,t.length-e,0,o);e-=o;if(e===0){if(o===a.length){++n;if(r.next)this.head=r.next;else this.head=this.tail=null}else{this.head=r;r.data=a.slice(o)}break}++n}this.length-=n;return t}},{key:s,value:function value(e,t){return o(this,_objectSpread({},t,{depth:0,customInspect:false}))}}]);return BufferList}()},556:function(e){"use strict";function destroy(e,t){var r=this;var n=this._readableState&&this._readableState.destroyed;var i=this._writableState&&this._writableState.destroyed;if(n||i){if(t){t(e)}else if(e){if(!this._writableState){process.nextTick(emitErrorNT,this,e)}else if(!this._writableState.errorEmitted){this._writableState.errorEmitted=true;process.nextTick(emitErrorNT,this,e)}}return this}if(this._readableState){this._readableState.destroyed=true}if(this._writableState){this._writableState.destroyed=true}this._destroy(e||null,(function(e){if(!t&&e){if(!r._writableState){process.nextTick(emitErrorAndCloseNT,r,e)}else if(!r._writableState.errorEmitted){r._writableState.errorEmitted=true;process.nextTick(emitErrorAndCloseNT,r,e)}else{process.nextTick(emitCloseNT,r)}}else if(t){process.nextTick(emitCloseNT,r);t(e)}else{process.nextTick(emitCloseNT,r)}}));return this}function emitErrorAndCloseNT(e,t){emitErrorNT(e,t);emitCloseNT(e)}function emitCloseNT(e){if(e._writableState&&!e._writableState.emitClose)return;if(e._readableState&&!e._readableState.emitClose)return;e.emit("close")}function undestroy(){if(this._readableState){this._readableState.destroyed=false;this._readableState.reading=false;this._readableState.ended=false;this._readableState.endEmitted=false}if(this._writableState){this._writableState.destroyed=false;this._writableState.ended=false;this._writableState.ending=false;this._writableState.finalCalled=false;this._writableState.prefinished=false;this._writableState.finished=false;this._writableState.errorEmitted=false}}function emitErrorNT(e,t){e.emit("error",t)}function errorOrDestroy(e,t){var r=e._readableState;var n=e._writableState;if(r&&r.autoDestroy||n&&n.autoDestroy)e.destroy(t);else e.emit("error",t)}e.exports={destroy:destroy,undestroy:undestroy,errorOrDestroy:errorOrDestroy}},745:function(e,t,r){"use strict";var n=r(558).q.ERR_STREAM_PREMATURE_CLOSE;function once(e){var t=false;return function(){if(t)return;t=true;for(var r=arguments.length,n=new Array(r),i=0;i0;return destroyer(e,a,s,(function(e){if(!i)i=e;if(e)o.forEach(call);if(a)return;o.forEach(call);n(i)}))}));return t.reduce(pipe)}e.exports=pipeline},416:function(e,t,r){"use strict";var n=r(558).q.ERR_INVALID_OPT_VALUE;function highWaterMarkFrom(e,t,r){return e.highWaterMark!=null?e.highWaterMark:t?e[r]:null}function getHighWaterMark(e,t,r,i){var a=highWaterMarkFrom(t,i,r);if(a!=null){if(!(isFinite(a)&&Math.floor(a)===a)||a<0){var o=i?r:"highWaterMark";throw new n(o,a)}return Math.floor(a)}return e.objectMode?16:16*1024}e.exports={getHighWaterMark:getHighWaterMark}},982:function(e,t,r){e.exports=r(781)},121:function(e,t,r){var n=r(781);if(process.env.READABLE_STREAM==="disable"&&n){e.exports=n.Readable;Object.assign(e.exports,n);e.exports.Stream=n}else{t=e.exports=r(903);t.Stream=n||t;t.Readable=t;t.Writable=r(551);t.Duplex=r(309);t.Transform=r(767);t.PassThrough=r(268);t.finished=r(745);t.pipeline=r(921)}},961:function(e,t,r){"use strict";var n=r(118).Buffer;var i=n.isEncoding||function(e){e=""+e;switch(e&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return true;default:return false}};function _normalizeEncoding(e){if(!e)return"utf8";var t;while(true){switch(e){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return e;default:if(t)return;e=(""+e).toLowerCase();t=true}}}function normalizeEncoding(e){var t=_normalizeEncoding(e);if(typeof t!=="string"&&(n.isEncoding===i||!i(e)))throw new Error("Unknown encoding: "+e);return t||e}t.s=StringDecoder;function StringDecoder(e){this.encoding=normalizeEncoding(e);var t;switch(this.encoding){case"utf16le":this.text=utf16Text;this.end=utf16End;t=4;break;case"utf8":this.fillLast=utf8FillLast;t=4;break;case"base64":this.text=base64Text;this.end=base64End;t=3;break;default:this.write=simpleWrite;this.end=simpleEnd;return}this.lastNeed=0;this.lastTotal=0;this.lastChar=n.allocUnsafe(t)}StringDecoder.prototype.write=function(e){if(e.length===0)return"";var t;var r;if(this.lastNeed){t=this.fillLast(e);if(t===undefined)return"";r=this.lastNeed;this.lastNeed=0}else{r=0}if(r>5===6)return 2;else if(e>>4===14)return 3;else if(e>>3===30)return 4;return e>>6===2?-1:-2}function utf8CheckIncomplete(e,t,r){var n=t.length-1;if(n=0){if(i>0)e.lastNeed=i-1;return i}if(--n=0){if(i>0)e.lastNeed=i-2;return i}if(--n=0){if(i>0){if(i===2)i=0;else e.lastNeed=i-3}return i}return 0}function utf8CheckExtraBytes(e,t,r){if((t[0]&192)!==128){e.lastNeed=0;return"�"}if(e.lastNeed>1&&t.length>1){if((t[1]&192)!==128){e.lastNeed=1;return"�"}if(e.lastNeed>2&&t.length>2){if((t[2]&192)!==128){e.lastNeed=2;return"�"}}}}function utf8FillLast(e){var t=this.lastTotal-this.lastNeed;var r=utf8CheckExtraBytes(this,e,t);if(r!==undefined)return r;if(this.lastNeed<=e.length){e.copy(this.lastChar,t,0,this.lastNeed);return this.lastChar.toString(this.encoding,0,this.lastTotal)}e.copy(this.lastChar,t,0,e.length);this.lastNeed-=e.length}function utf8Text(e,t){var r=utf8CheckIncomplete(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=r;var n=e.length-(r-this.lastNeed);e.copy(this.lastChar,0,n);return e.toString("utf8",t,n)}function utf8End(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed)return t+"�";return t}function utf16Text(e,t){if((e.length-t)%2===0){var r=e.toString("utf16le",t);if(r){var n=r.charCodeAt(r.length-1);if(n>=55296&&n<=56319){this.lastNeed=2;this.lastTotal=4;this.lastChar[0]=e[e.length-2];this.lastChar[1]=e[e.length-1];return r.slice(0,-1)}}return r}this.lastNeed=1;this.lastTotal=2;this.lastChar[0]=e[e.length-1];return e.toString("utf16le",t,e.length-1)}function utf16End(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,r)}return t}function base64Text(e,t){var r=(e.length-t)%3;if(r===0)return e.toString("base64",t);this.lastNeed=3-r;this.lastTotal=3;if(r===1){this.lastChar[0]=e[e.length-1]}else{this.lastChar[0]=e[e.length-2];this.lastChar[1]=e[e.length-1]}return e.toString("base64",t,e.length-r)}function base64End(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed)return t+this.lastChar.toString("base64",0,3-this.lastNeed);return t}function simpleWrite(e){return e.toString(this.encoding)}function simpleEnd(e){return e&&e.length?this.write(e):""}},989:function(e){e.exports=deprecate;function deprecate(e,t){if(config("noDeprecation")){return e}var r=false;function deprecated(){if(!r){if(config("throwDeprecation")){throw new Error(t)}else if(config("traceDeprecation")){console.trace(t)}else{console.warn(t)}r=true}return e.apply(this,arguments)}return deprecated}function config(e){try{if(!global.localStorage)return false}catch(e){return false}var t=global.localStorage[e];if(null==t)return false;return String(t).toLowerCase()==="true"}},738:function(e){e.exports=extend;var t=Object.prototype.hasOwnProperty;function extend(){var e={};for(var r=0;r void } @@ -31,10 +32,19 @@ class MultiReporter implements Reporter { timestamp: number, id: SpanId, parentId?: SpanId, - attrs?: Object + attrs?: Object, + startTime?: number ) { this.reporters.forEach((reporter) => - reporter.report(spanName, duration, timestamp, id, parentId, attrs) + reporter.report( + spanName, + duration, + timestamp, + id, + parentId, + attrs, + startTime + ) ) } } diff --git a/packages/next/trace/report/to-json.ts b/packages/next/trace/report/to-json.ts index 0007f420ea01..54c850e94792 100644 --- a/packages/next/trace/report/to-json.ts +++ b/packages/next/trace/report/to-json.ts @@ -19,6 +19,7 @@ type Event = { duration: number localEndpoint?: typeof localEndpoint tags?: Object + startTime?: number } // Batch events as zipkin allows for multiple events to be sent in one go @@ -121,7 +122,8 @@ const reportToLocalHost = ( timestamp: number, id: number, parentId?: number, - attrs?: Object + attrs?: Object, + startTime?: number ) => { const distDir = traceGlobals.get('distDir') const phase = traceGlobals.get('phase') @@ -161,6 +163,7 @@ const reportToLocalHost = ( timestamp, duration, tags: attrs, + startTime, }) } diff --git a/packages/next/trace/trace.ts b/packages/next/trace/trace.ts index e07b9f237b30..4ca1414198b7 100644 --- a/packages/next/trace/trace.ts +++ b/packages/next/trace/trace.ts @@ -22,6 +22,7 @@ export class Span { duration: number | null attrs: { [key: string]: any } status: SpanStatus + now: number _start: bigint @@ -43,6 +44,12 @@ export class Span { this.status = SpanStatus.Started this.id = getId() this._start = startTime || process.hrtime.bigint() + // hrtime cannot be used to reconstruct tracing span's actual start time + // since it does not have relation to clock time: + // `These times are relative to an arbitrary time in the past, and not related to the time of day and therefore not subject to clock drift` + // https://nodejs.org/api/process.html#processhrtimetime + // Capturing current datetime as additional metadata for external reconstruction. + this.now = Date.now() } // Durations are reported as microseconds. This gives 1000x the precision @@ -63,7 +70,8 @@ export class Span { Number(timestamp), this.id, this.parentId, - this.attrs + this.attrs, + this.now ) } diff --git a/scripts/trace-dd.mjs b/scripts/trace-dd.mjs new file mode 100644 index 000000000000..dc077cc6e1ff --- /dev/null +++ b/scripts/trace-dd.mjs @@ -0,0 +1,177 @@ +import { createReadStream } from 'fs' +import { createInterface } from 'readline' +import path from 'path' +import Tracer from 'dd-trace' +import flat from 'flat' + +const cleanFilename = (filename) => { + if (filename.includes('&absolutePagePath=')) { + filename = + 'page ' + + decodeURIComponent( + filename.replace(/.+&absolutePagePath=/, '').slice(0, -1) + ) + } + filename = filename.replace(/.+!(?!$)/, '') + return filename +} + +const getPackageName = (filename) => { + const match = /.+[\\/]node_modules[\\/]((?:@[^\\/]+[\\/])?[^\\/]+)/.exec( + cleanFilename(filename) + ) + return match && match[1] +} + +/** + * Create, reports spans recursively with its inner child spans. + */ +const reportSpanRecursively = (tracer, trace, parentSpan) => { + // build-* span contains tags with path to the modules, trying to clean up if possible + const isBuildModule = trace.name.startsWith('build-module-') + if (isBuildModule) { + trace.packageName = getPackageName(trace.tags.name) + // replace name to cleaned up pkg name + trace.tags.name = trace.packageName + if (trace.children) { + const queue = [...trace.children] + trace.children = [] + for (const e of queue) { + if (e.name.startsWith('build-module-')) { + const pkgName = getPackageName(e.tags.name) + if (!trace.packageName || pkgName !== trace.packageName) { + trace.children.push(e) + } else { + if (e.children) queue.push(...e.children) + } + } + } + } + } + + /** + * interface TraceEvent { + * traceId: string; + * parentId: number; + * name: string; + * id: number; + * startTime: number; + * timestamp: number; + * duration: number; + * tags: Record + * } + */ + let span = tracer.startSpan(trace.name, { + startTime: trace.startTime, + childOf: parentSpan, + tags: Object.keys(trace?.tags).length > 0 ? trace?.tags : undefined, + }) + + // Spans should be reported in chronological order + trace.children?.sort((a, b) => a.startTime - b.startTime) + trace.children?.forEach((childTrace) => + reportSpanRecursively(tracer, childTrace, span) + ) + + span.finish(trace.startTime + trace.duration / 1000) + return span +} + +/** + * Read generated trace from file system, augment & sent it to the remote tracer. + */ +const collectTraces = async (filePath, metadata) => { + const tracer = Tracer.init({ + tags: metadata, + // Setting external env variable `DD_TRACE_DEBUG=true` will emit this log + logLevel: 'error', + // TODO: this is due to generated trace have excessive numbers of spans + // for build-module-*, using default flush causes overflow to the agent. + flushInterval: 20, + flushMinSpans: 10, + }) + + const readLineInterface = createInterface({ + input: createReadStream(filePath), + crlfDelay: Infinity, + }) + + const traces = new Map() + const rootTraces = [] + + // Input trace file contains newline-seperated sets of traces, where each line is valid JSON + // type of Array. Read it line-by-line to manually reconstruct trace trees. + // + // We have to read through end of the trace - + // Trace events in the input file can appear out of order, so we need to remodel the shape of the span tree before reporting + for await (const line of readLineInterface) { + JSON.parse(line).forEach((trace) => traces.set(trace.id, trace)) + } + + // Link inner, child spans to the parents to reconstruct span with correct relations + for (const event of traces.values()) { + if (event.parentId) { + event.parent = traces.get(event.parentId) + if (event.parent) { + if (!event.parent.children) event.parent.children = [] + event.parent.children.push(event) + } + } + + if (!event.parent) { + rootTraces.push(event) + } + } + + for (const trace of rootTraces) { + reportSpanRecursively(tracer, trace) + } +} + +/** + * Naively validate, collect necessary args. + */ +const validateArgs = async () => { + const { DD_ENV, DD_SERVICE } = process.env + + if (!DD_ENV || !DD_SERVICE) { + throw new Error( + `Could not find proper enviroment variables. Ensure to set DD_ENV / DD_SERVICE` + ) + } + + // Collect necessary default metadata. Script should pass cli args as in order of + // - trace file to read + // - which command ran to generated trace (`build`, `dev`, ...) + // - short sha for the commit + // - path to next.config.js (optional) + const [, , traceFilePath, command, commit, configFilePath] = process.argv + const config = configFilePath + ? (await import(path.resolve(process.cwd(), configFilePath))).default + : {} + + if (!traceFilePath || !command || !commit) { + throw new Error( + `Cannot collect traces without necessary metadata. +Try to run script with below args: + +node trace-dd.mjs tracefilepath command commit [configfilepath]` + ) + } + + const metadata = { + command, + commit, + // TODO: it is unclear, but some of nested object seems not supported + nextjs_config: flat.flatten(config), + } + + return [traceFilePath, metadata] +} + +validateArgs() + .then(([traceFilePath, metadata]) => collectTraces(traceFilePath, metadata)) + .catch((e) => { + console.error(`Failed to collect traces`) + console.error(e) + }) diff --git a/yarn.lock b/yarn.lock index 54bb510a44c7..aa72d1b57018 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2779,6 +2779,47 @@ version "1.4.0" resolved "https://registry.yarnpkg.com/@csstools/convert-colors/-/convert-colors-1.4.0.tgz#ad495dc41b12e75d588c6db8b9834f08fa131eb7" +"@datadog/native-appsec@^0.8.1": + version "0.8.1" + resolved "https://registry.yarnpkg.com/@datadog/native-appsec/-/native-appsec-0.8.1.tgz#50cb6ef2e75ea13cd9e837e64971deff3673c638" + integrity sha512-0jewxGPoRxFd/UYY5+9uisTsTfctwRZy19fU5wo+psejhlxflDnupSDamtnr0nF72s4dbX1z1uAwGWGkuxnV3Q== + dependencies: + detect-libc "^1.0.3" + minimist "^1.2.5" + tar "^6.1.11" + +"@datadog/native-metrics@^1.1.0": + version "1.1.0" + resolved "https://registry.yarnpkg.com/@datadog/native-metrics/-/native-metrics-1.1.0.tgz#ef860a4cbea81b6e1559b280f5f1f3cd2cc22585" + integrity sha512-OSrhoo8U/JB/FltvAp54cgMHCBWEriF/D/ZboBH4Pn7UY/Zu8dkzB6eAWQFJIxQlHjYrAEuNgZPBkaHhS3e0KQ== + dependencies: + nan "^2.14.2" + node-gyp-build "^3.9.0" + +"@datadog/pprof@^0.3.0": + version "0.3.0" + resolved "https://registry.yarnpkg.com/@datadog/pprof/-/pprof-0.3.0.tgz#aa6f4611844e2521633f34b1649778ceec0493bb" + integrity sha512-RskYpLD2mWdvUk2OU9p3gynx8QxHtfPdRPWs3vqlM+PMf+wstibcYMW7auNY4s3gVA1mT7HiBjW7j0m37rOHOQ== + dependencies: + delay "^5.0.0" + findit2 "^2.2.3" + nan "^2.14.0" + node-gyp-build "^3.9.0" + p-limit "^3.0.0" + pify "^5.0.0" + protobufjs "~6.11.0" + rimraf "^3.0.2" + semver "^7.3.5" + source-map "^0.7.3" + split "^1.0.1" + +"@datadog/sketches-js@^1.0.4": + version "1.0.4" + resolved "https://registry.yarnpkg.com/@datadog/sketches-js/-/sketches-js-1.0.4.tgz#6213c26e3459fed80b075d80ffff551979fb0e6a" + integrity sha512-9S5fdz448dLfGw4jSH1A4GZpkLWBufdsJu4PeevEjDvkauEmE175xBiBLfYHQEdKe7lEVNB4IRtUZqY16QRVUw== + dependencies: + protobufjs "^6.10.2" + "@emotion/is-prop-valid@^0.8.8": version "0.8.8" resolved "https://registry.yarnpkg.com/@emotion/is-prop-valid/-/is-prop-valid-0.8.8.tgz#db28b1c4368a259b60a97311d6a952d4fd01ac1a" @@ -5075,6 +5116,11 @@ version "4.0.0" resolved "https://registry.yarnpkg.com/@types/long/-/long-4.0.0.tgz#719551d2352d301ac8b81db732acb6bdc28dbdef" +"@types/long@^4.0.1": + version "4.0.1" + resolved "https://registry.yarnpkg.com/@types/long/-/long-4.0.1.tgz#459c65fa1867dafe6a8f322c4c51695663cc55e9" + integrity sha512-5tXH6Bx/kNGd3MgffdmP4dy2Z+G4eaXw0SE81Tq3BNadtnMR5/ySMzX4SLEzHJzSmPNn4HIdpQsBvXMUykr58w== + "@types/lru-cache@4.1.1": version "4.1.1" resolved "https://registry.yarnpkg.com/@types/lru-cache/-/lru-cache-4.1.1.tgz#b2d87a5e3df8d4b18ca426c5105cd701c2306d40" @@ -5134,6 +5180,11 @@ resolved "https://registry.yarnpkg.com/@types/node/-/node-10.12.18.tgz#1d3ca764718915584fcd9f6344621b7672665c67" integrity sha512-fh+pAqt4xRzPfqA6eh3Z2y6fyZavRIumvjhaCL753+TVkGKGhpPeyrJG2JftD0T9q4GF00KjefsQ+PQNDdWQaQ== +"@types/node@>=12", "@types/node@>=13.7.0": + version "17.0.21" + resolved "https://registry.yarnpkg.com/@types/node/-/node-17.0.21.tgz#864b987c0c68d07b4345845c3e63b75edd143644" + integrity sha512-DBZCJbhII3r90XbQxI8Y9IjjiiOGlZ0Hr32omXIZvwwZ7p4DMMXGrKXVyPfuoBOri9XNtL0UK69jYIBIsRX3QQ== + "@types/node@^10.1.0": version "10.17.13" resolved "https://registry.yarnpkg.com/@types/node/-/node-10.17.13.tgz#ccebcdb990bd6139cd16e84c39dc2fb1023ca90c" @@ -6184,6 +6235,11 @@ anymatch@^3.0.3, anymatch@~3.1.1: normalize-path "^3.0.0" picomatch "^2.0.4" +append-field@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/append-field/-/append-field-1.0.0.tgz#1e3440e915f0b1203d23748e78edd7b9b5b43e56" + integrity sha1-HjRA6RXwsSA9I3SOeO3XubW0PlY= + aproba@^1.0.3, aproba@^1.1.1: version "1.2.0" resolved "https://registry.yarnpkg.com/aproba/-/aproba-1.2.0.tgz#6802e6264efd18c790a1b0d517f0f2627bf2c94a" @@ -7050,6 +7106,14 @@ builtins@^1.0.3: version "1.0.3" resolved "https://registry.yarnpkg.com/builtins/-/builtins-1.0.3.tgz#cb94faeb61c8696451db36534e1422f94f0aee88" +busboy@^0.2.11: + version "0.2.14" + resolved "https://registry.yarnpkg.com/busboy/-/busboy-0.2.14.tgz#6c2a622efcf47c57bbbe1e2a9c37ad36c7925453" + integrity sha1-bCpiLvz0fFe7vh4qnDetNseSVFM= + dependencies: + dicer "0.2.5" + readable-stream "1.1.x" + byline@^5.0.0: version "5.0.0" resolved "https://registry.yarnpkg.com/byline/-/byline-5.0.0.tgz#741c5216468eadc457b03410118ad77de8c1ddb1" @@ -7870,7 +7934,7 @@ concat-map@0.0.1: version "0.0.1" resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" -concat-stream@^1.4.7, concat-stream@^1.5.0: +concat-stream@^1.4.7, concat-stream@^1.5.0, concat-stream@^1.5.2: version "1.6.2" resolved "https://registry.yarnpkg.com/concat-stream/-/concat-stream-1.6.2.tgz#904bdf194cd3122fc675c77fc4ac3d4ff0fd1a34" integrity sha512-27HBghJxjiZtIk3Ycvn/4kbJk/1uZuJFfuPEns6LaEvpvG1f0hTea8lilrouyo9mVc2GWdcEZ8OLoGmSADlrCw== @@ -8353,6 +8417,11 @@ crypto-random-string@^2.0.0: resolved "https://registry.yarnpkg.com/crypto-random-string/-/crypto-random-string-2.0.0.tgz#ef2a7a966ec11083388369baa02ebead229b30d5" integrity sha512-v1plID3y9r/lPhviJ1wrXpLeyUIGAZ2SHNYTEapm7/8A9nLPoyvVp3RK/EPFqn5kEznyWgYZNsRtYYIWbuG8KA== +crypto-randomuuid@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/crypto-randomuuid/-/crypto-randomuuid-1.0.0.tgz#acf583e5e085e867ae23e107ff70279024f9e9e7" + integrity sha512-/RC5F4l1SCqD/jazwUF6+t34Cd8zTSAGZ7rvvZu1whZUhD2a5MOGKjSGowoGcpj/cbVZk1ZODIooJEQQq3nNAA== + css-blank-pseudo@^0.1.4: version "0.1.4" resolved "https://registry.yarnpkg.com/css-blank-pseudo/-/css-blank-pseudo-0.1.4.tgz#dfdefd3254bf8a82027993674ccf35483bfcb3c5" @@ -8667,6 +8736,35 @@ dateformat@^3.0.0: version "3.0.3" resolved "https://registry.yarnpkg.com/dateformat/-/dateformat-3.0.3.tgz#a6e37499a4d9a9cf85ef5872044d62901c9889ae" +dd-trace@2.3.0: + version "2.3.0" + resolved "https://registry.yarnpkg.com/dd-trace/-/dd-trace-2.3.0.tgz#9ad0cf181d4a2112bd16079f940c8049a148710a" + integrity sha512-CdpmDBRY+THfT2a0/lqxMzcuaNhQpI50nu7tlNp8XTjQuo/GLQDwQBEUZ83hDL4BS+sRPg0Fm3oppqmiAJrPyg== + dependencies: + "@datadog/native-appsec" "^0.8.1" + "@datadog/native-metrics" "^1.1.0" + "@datadog/pprof" "^0.3.0" + "@datadog/sketches-js" "^1.0.4" + "@types/node" ">=12" + crypto-randomuuid "^1.0.0" + diagnostics_channel "^1.1.0" + form-data "^3.0.0" + import-in-the-middle "^1.2.1" + koalas "^1.0.2" + limiter "^1.1.4" + lodash.kebabcase "^4.1.1" + lodash.pick "^4.4.0" + lodash.sortby "^4.7.0" + lodash.uniq "^4.5.0" + methods "^1.1.2" + module-details-from-path "^1.0.3" + multer "^1.4.2" + opentracing ">=0.12.1" + path-to-regexp "^0.1.2" + performance-now "^2.1.0" + retry "^0.10.1" + semver "^5.5.0" + debug@2, debug@2.6.9, debug@^2.2.0, debug@^2.3.3, debug@^2.6.6, debug@^2.6.9: version "2.6.9" resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.9.tgz#5d128515df134ff327e90a4c93f4e077a536341f" @@ -8835,6 +8933,11 @@ delay@4.3.0: resolved "https://registry.yarnpkg.com/delay/-/delay-4.3.0.tgz#efeebfb8f545579cb396b3a722443ec96d14c50e" integrity sha512-Lwaf3zVFDMBop1yDuFZ19F9WyGcZcGacsbdlZtWjQmM50tOcMntm1njF/Nb/Vjij3KaSvCF+sEYGKrrjObu2NA== +delay@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/delay/-/delay-5.0.0.tgz#137045ef1b96e5071060dd5be60bf9334436bd1d" + integrity sha512-ReEBKkIfe4ya47wlPYf/gu5ib6yUG0/Aez0JQZQz94kiWtRQvZIQbTiehsnwHvLSWJnQdhVeqYue7Id1dKr0qw== + delayed-stream@~1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/delayed-stream/-/delayed-stream-1.0.0.tgz#df3ae199acadfb7d440aaae0b29e2272b24ec619" @@ -8905,6 +9008,19 @@ dezalgo@^1.0.0: asap "^2.0.0" wrappy "1" +diagnostics_channel@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/diagnostics_channel/-/diagnostics_channel-1.1.0.tgz#bd66c49124ce3bac697dff57466464487f57cea5" + integrity sha512-OE1ngLDjSBPG6Tx0YATELzYzy3RKHC+7veQ8gLa8yS7AAgw65mFbVdcsu3501abqOZCEZqZyAIemB0zXlqDSuw== + +dicer@0.2.5: + version "0.2.5" + resolved "https://registry.yarnpkg.com/dicer/-/dicer-0.2.5.tgz#5996c086bb33218c812c090bddc09cd12facb70f" + integrity sha1-WZbAhrszIYyBLAkL3cCc0S+stw8= + dependencies: + readable-stream "1.1.x" + streamsearch "0.1.2" + diff-sequences@^26.0.0: version "26.0.0" resolved "https://registry.yarnpkg.com/diff-sequences/-/diff-sequences-26.0.0.tgz#0760059a5c287637b842bd7085311db7060e88a6" @@ -10401,6 +10517,11 @@ find-up@^3.0.0: dependencies: locate-path "^3.0.0" +findit2@^2.2.3: + version "2.2.3" + resolved "https://registry.yarnpkg.com/findit2/-/findit2-2.2.3.tgz#58a466697df8a6205cdfdbf395536b8bd777a5f6" + integrity sha1-WKRmaX34piBc39vzlVNri9d3pfY= + findup-sync@^5.0.0: version "5.0.0" resolved "https://registry.yarnpkg.com/findup-sync/-/findup-sync-5.0.0.tgz#54380ad965a7edca00cc8f63113559aadc541bd2" @@ -10455,6 +10576,11 @@ flat-cache@^3.0.4: flatted "^3.1.0" rimraf "^3.0.2" +flat@5.0.2: + version "5.0.2" + resolved "https://registry.yarnpkg.com/flat/-/flat-5.0.2.tgz#8ca6fe332069ffa9d324c327198c598259ceb241" + integrity sha512-b6suED+5/3rTpUBdG1gupIl8MPFCAMA0QXwmljLhvCUKcUvdE4gWky9zpuGCcXHOsz4J9wPGNWq6OKpmIzz3hQ== + flatted@^3.1.0: version "3.1.1" resolved "https://registry.yarnpkg.com/flatted/-/flatted-3.1.1.tgz#c4b489e80096d9df1dfc97c79871aea7c617c469" @@ -11843,6 +11969,13 @@ import-from@^3.0.0: dependencies: resolve-from "^5.0.0" +import-in-the-middle@^1.2.1: + version "1.2.1" + resolved "https://registry.yarnpkg.com/import-in-the-middle/-/import-in-the-middle-1.2.1.tgz#30d4e98be7329eee0d284943dd0df092cc422b3c" + integrity sha512-KdYqCJbJWBOU9740nr9lrmCDhW7htxY1dHmbP4iUEeCaxupj2fKFhyHixsly2WmxMbRIsxzSWSJMfGNEU7el+w== + dependencies: + module-details-from-path "^1.0.3" + import-lazy@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/import-lazy/-/import-lazy-2.1.0.tgz#05698e3d45c88e8d7e9d92cb0584e77f096f3e43" @@ -13474,6 +13607,11 @@ klona@^2.0.4: resolved "https://registry.yarnpkg.com/klona/-/klona-2.0.4.tgz#7bb1e3affb0cb8624547ef7e8f6708ea2e39dfc0" integrity sha512-ZRbnvdg/NxqzC7L9Uyqzf4psi1OM4Cuc+sJAkQPjO6XkQIJTNbfK2Rsmbw8fx1p2mkZdp2FZYo2+LwXYY/uwIA== +koalas@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/koalas/-/koalas-1.0.2.tgz#318433f074235db78fae5661a02a8ca53ee295cd" + integrity sha1-MYQz8HQjXbePrlZhoCqMpT7ilc0= + ky-universal@0.6.0: version "0.6.0" resolved "https://registry.yarnpkg.com/ky-universal/-/ky-universal-0.6.0.tgz#a91c265c80c38f750e65bbc6d72df16f5b58691f" @@ -13615,6 +13753,11 @@ limit-spawn@0.0.3: version "0.0.3" resolved "https://registry.yarnpkg.com/limit-spawn/-/limit-spawn-0.0.3.tgz#cc09c24467a0f0a1ed10a5196dba597cad3f65dc" +limiter@^1.1.4: + version "1.1.5" + resolved "https://registry.yarnpkg.com/limiter/-/limiter-1.1.5.tgz#8f92a25b3b16c6131293a0cc834b4a838a2aa7c2" + integrity sha512-FWWMIEOxz3GwUI4Ts/IvgVy6LPvoMPgjMdQ185nN6psJyBJ4yOpzqm695/h5umdLJg2vW3GR5iG11MAkR2AzJA== + lines-and-columns@^1.1.6: version "1.1.6" resolved "https://registry.yarnpkg.com/lines-and-columns/-/lines-and-columns-1.1.6.tgz#1c00c743b433cd0a4e80758f7b64a57440d9ff00" @@ -13866,6 +14009,11 @@ lodash.isstring@^4.0.1: version "4.0.1" resolved "https://registry.yarnpkg.com/lodash.isstring/-/lodash.isstring-4.0.1.tgz#d527dfb5456eca7cc9bb95d5daeaf88ba54a5451" +lodash.kebabcase@^4.1.1: + version "4.1.1" + resolved "https://registry.yarnpkg.com/lodash.kebabcase/-/lodash.kebabcase-4.1.1.tgz#8489b1cb0d29ff88195cceca448ff6d6cc295c36" + integrity sha1-hImxyw0p/4gZXM7KRI/21swpXDY= + lodash.map@^4.4.0: version "4.6.0" resolved "https://registry.yarnpkg.com/lodash.map/-/lodash.map-4.6.0.tgz#771ec7839e3473d9c4cde28b19394c3562f4f6d3" @@ -13882,7 +14030,7 @@ lodash.once@^4.0.0: version "4.1.1" resolved "https://registry.yarnpkg.com/lodash.once/-/lodash.once-4.1.1.tgz#0dd3971213c7c56df880977d504c88fb471a97ac" -lodash.pick@^4.2.1: +lodash.pick@^4.2.1, lodash.pick@^4.4.0: version "4.4.0" resolved "https://registry.yarnpkg.com/lodash.pick/-/lodash.pick-4.4.0.tgz#52f05610fff9ded422611441ed1fc123a03001b3" @@ -14411,7 +14559,7 @@ merge2@^1.2.3, merge2@^1.3.0, merge2@^1.4.1: resolved "https://registry.yarnpkg.com/merge2/-/merge2-1.4.1.tgz#4368892f885e907455a6fd7dc55c0c9d404990ae" integrity sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg== -methods@^1.1.1, methods@~1.1.2: +methods@^1.1.1, methods@^1.1.2, methods@~1.1.2: version "1.1.2" resolved "https://registry.yarnpkg.com/methods/-/methods-1.1.2.tgz#5529a4d67654134edcc5266656835b0f851afcee" @@ -14811,7 +14959,7 @@ mkdirp-infer-owner@^2.0.0: infer-owner "^1.0.4" mkdirp "^1.0.3" -mkdirp@^0.5.0, mkdirp@^0.5.1, mkdirp@^0.5.3, mkdirp@~0.5.1: +mkdirp@^0.5.0, mkdirp@^0.5.1, mkdirp@^0.5.3, mkdirp@^0.5.4, mkdirp@~0.5.1: version "0.5.5" resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.5.tgz#d91cefd62d1436ca0f41620e251288d420099def" dependencies: @@ -14826,6 +14974,11 @@ modify-values@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/modify-values/-/modify-values-1.0.1.tgz#b3939fa605546474e3e3e3c63d64bd43b4ee6022" +module-details-from-path@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/module-details-from-path/-/module-details-from-path-1.0.3.tgz#114c949673e2a8a35e9d35788527aa37b679da2b" + integrity sha1-EUyUlnPiqKNenTV4hSeqN7Z52is= + moment@^2.24.0: version "2.24.0" resolved "https://registry.yarnpkg.com/moment/-/moment-2.24.0.tgz#0d055d53f5052aa653c9f6eb68bb5d12bf5c2b5b" @@ -14861,6 +15014,20 @@ ms@2.1.2, ms@^2.0.0, ms@^2.1.1: version "2.1.2" resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.2.tgz#d09d1f357b443f493382a8eb3ccd183872ae6009" +multer@^1.4.2: + version "1.4.4" + resolved "https://registry.yarnpkg.com/multer/-/multer-1.4.4.tgz#e2bc6cac0df57a8832b858d7418ccaa8ebaf7d8c" + integrity sha512-2wY2+xD4udX612aMqMcB8Ws2Voq6NIUPEtD1be6m411T4uDH/VtL9i//xvcyFlTVfRdaBsk7hV5tgrGQqhuBiw== + dependencies: + append-field "^1.0.0" + busboy "^0.2.11" + concat-stream "^1.5.2" + mkdirp "^0.5.4" + object-assign "^4.1.1" + on-finished "^2.3.0" + type-is "^1.6.4" + xtend "^4.0.0" + multimatch@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/multimatch/-/multimatch-2.1.0.tgz#9c7906a22fb4c02919e2f5f75161b4cdbd4b2a2b" @@ -14893,6 +15060,11 @@ nan@^2.12.1, nan@^2.13.2: version "2.14.0" resolved "https://registry.yarnpkg.com/nan/-/nan-2.14.0.tgz#7818f722027b2459a86f0295d434d1fc2336c52c" +nan@^2.14.0, nan@^2.14.2: + version "2.15.0" + resolved "https://registry.yarnpkg.com/nan/-/nan-2.15.0.tgz#3f34a473ff18e15c1b5626b62903b5ad6e665fee" + integrity sha512-8ZtvEnA2c5aYCZYd1cvgdnU6cqwixRoYg70xPLWUws5ORTa/lnw+u4amixRS/Ac5U5mQVgp9pnlSUnbNWFaWZQ== + nanoid@3.1.30, nanoid@^3.1.30: version "3.1.30" resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-3.1.30.tgz#63f93cc548d2a113dc5dfbc63bfa09e2b9b64362" @@ -15045,6 +15217,11 @@ node-fetch@^1.0.1: encoding "^0.1.11" is-stream "^1.0.1" +node-gyp-build@^3.9.0: + version "3.9.0" + resolved "https://registry.yarnpkg.com/node-gyp-build/-/node-gyp-build-3.9.0.tgz#53a350187dd4d5276750da21605d1cb681d09e25" + integrity sha512-zLcTg6P4AbcHPq465ZMFNXx7XpKKJh+7kkN699NiQWisR2uWYOWNWqRHAmbnmKiL4e9aLSlmy5U7rEMUXV59+A== + node-gyp-build@^4.2.2: version "4.2.3" resolved "https://registry.yarnpkg.com/node-gyp-build/-/node-gyp-build-4.2.3.tgz#ce6277f853835f718829efb47db20f3e4d9c4739" @@ -15613,6 +15790,13 @@ object.values@^1.1.5: define-properties "^1.1.3" es-abstract "^1.19.1" +on-finished@^2.3.0: + version "2.4.1" + resolved "https://registry.yarnpkg.com/on-finished/-/on-finished-2.4.1.tgz#58c8c44116e54845ad57f14ab10b03533184ac3f" + integrity sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg== + dependencies: + ee-first "1.1.1" + on-finished@~2.3.0: version "2.3.0" resolved "https://registry.yarnpkg.com/on-finished/-/on-finished-2.3.0.tgz#20f1336481b083cd75337992a16971aa2d906947" @@ -15653,6 +15837,11 @@ opener@^1.5.2: resolved "https://registry.yarnpkg.com/opener/-/opener-1.5.2.tgz#5d37e1f35077b9dcac4301372271afdeb2a13598" integrity sha512-ur5UIdyw5Y7yEj9wLzhqXiy6GZ3Mwx0yGI+5sMn2r0N0v3cKJvUmFH5yPP+WXh9e0xfyzyJX95D8l088DNFj7A== +opentracing@>=0.12.1: + version "0.14.7" + resolved "https://registry.yarnpkg.com/opentracing/-/opentracing-0.14.7.tgz#25d472bd0296dc0b64d7b94cbc995219031428f5" + integrity sha512-vz9iS7MJ5+Bp1URw8Khvdyw1H/hGvzHWlKQ7eRrQojSCDL1/SrWfrY9QebLw97n2deyRtzHRC3MkQfVNUCo91Q== + opn@5.4.0: version "5.4.0" resolved "https://registry.yarnpkg.com/opn/-/opn-5.4.0.tgz#cb545e7aab78562beb11aa3bfabc7042e1761035" @@ -15794,7 +15983,7 @@ p-finally@^2.0.0: version "2.0.1" resolved "https://registry.yarnpkg.com/p-finally/-/p-finally-2.0.1.tgz#bd6fcaa9c559a096b680806f4d657b3f0f240561" -p-limit@3.1.0, p-limit@^3.1.0: +p-limit@3.1.0, p-limit@^3.0.0, p-limit@^3.1.0: version "3.1.0" resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-3.1.0.tgz#e1daccbe78d0d1388ca18c64fea38e3e57e3706b" integrity sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ== @@ -16221,7 +16410,7 @@ path-to-regexp@*, path-to-regexp@6.1.0: version "6.1.0" resolved "https://registry.yarnpkg.com/path-to-regexp/-/path-to-regexp-6.1.0.tgz#0b18f88b7a0ce0bfae6a25990c909ab86f512427" -path-to-regexp@0.1.7: +path-to-regexp@0.1.7, path-to-regexp@^0.1.2: version "0.1.7" resolved "https://registry.yarnpkg.com/path-to-regexp/-/path-to-regexp-0.1.7.tgz#df604178005f522f15eb4490e7247a1bfaa67f8c" @@ -17306,6 +17495,25 @@ proto-list@~1.2.1: version "1.2.4" resolved "https://registry.yarnpkg.com/proto-list/-/proto-list-1.2.4.tgz#212d5bfe1318306a420f6402b8e26ff39647a849" +protobufjs@^6.10.2, protobufjs@~6.11.0: + version "6.11.2" + resolved "https://registry.yarnpkg.com/protobufjs/-/protobufjs-6.11.2.tgz#de39fabd4ed32beaa08e9bb1e30d08544c1edf8b" + integrity sha512-4BQJoPooKJl2G9j3XftkIXjoC9C0Av2NOrWmbLWT1vH32GcSUHjM0Arra6UfTsVyfMAuFzaLucXn1sadxJydAw== + dependencies: + "@protobufjs/aspromise" "^1.1.2" + "@protobufjs/base64" "^1.1.2" + "@protobufjs/codegen" "^2.0.4" + "@protobufjs/eventemitter" "^1.1.0" + "@protobufjs/fetch" "^1.1.0" + "@protobufjs/float" "^1.0.2" + "@protobufjs/inquire" "^1.1.0" + "@protobufjs/path" "^1.1.2" + "@protobufjs/pool" "^1.1.0" + "@protobufjs/utf8" "^1.1.0" + "@types/long" "^4.0.1" + "@types/node" ">=13.7.0" + long "^4.0.0" + protobufjs@^6.8.6: version "6.8.8" resolved "https://registry.yarnpkg.com/protobufjs/-/protobufjs-6.8.8.tgz#c8b4f1282fd7a90e6f5b109ed11c84af82908e7c" @@ -17777,6 +17985,16 @@ read@1, read@~1.0.1: string_decoder "~1.1.1" util-deprecate "~1.0.1" +readable-stream@1.1.x: + version "1.1.14" + resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-1.1.14.tgz#7cf4c54ef648e3813084c636dd2079e166c081d9" + integrity sha1-fPTFTvZI44EwhMY23SB54WbAgdk= + dependencies: + core-util-is "~1.0.0" + inherits "~2.0.1" + isarray "0.0.1" + string_decoder "~0.10.x" + readable-stream@3, readable-stream@^3.0.0, readable-stream@^3.0.2, readable-stream@^3.1.1, readable-stream@^3.4.0, readable-stream@^3.5.0, readable-stream@^3.6.0: version "3.6.0" resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-3.6.0.tgz#337bbda3adc0706bd3e024426a286d4b4b2c9198" @@ -18361,7 +18579,7 @@ retext-profanities@~6.1.0: pluralize "^8.0.0" quotation "^1.0.0" -retry@0.10.1, retry@^0.10.0: +retry@0.10.1, retry@^0.10.0, retry@^0.10.1: version "0.10.1" resolved "https://registry.yarnpkg.com/retry/-/retry-0.10.1.tgz#e76388d217992c252750241d3d3956fed98d8ff4" @@ -19141,7 +19359,7 @@ split@0.2: dependencies: through "2" -split@^1.0.0: +split@^1.0.0, split@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/split/-/split-1.0.1.tgz#605bd9be303aa59fb35f9229fbea0ddec9ea07d9" dependencies: @@ -19284,6 +19502,11 @@ stream-shift@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/stream-shift/-/stream-shift-1.0.1.tgz#d7088281559ab2778424279b0877da3c392d5a3d" +streamsearch@0.1.2: + version "0.1.2" + resolved "https://registry.yarnpkg.com/streamsearch/-/streamsearch-0.1.2.tgz#808b9d0e56fc273d809ba57338e929919a1a9f1a" + integrity sha1-gIudDlb8Jz2Am6VzOOkpkZoanxo= + string-argv@0.3.1: version "0.3.1" resolved "https://registry.yarnpkg.com/string-argv/-/string-argv-0.3.1.tgz#95e2fbec0427ae19184935f816d74aaa4c5c19da" @@ -19805,6 +20028,18 @@ tar@^6.1.0: mkdirp "^1.0.3" yallist "^4.0.0" +tar@^6.1.11: + version "6.1.11" + resolved "https://registry.yarnpkg.com/tar/-/tar-6.1.11.tgz#6760a38f003afa1b2ffd0ffe9e9abbd0eab3d621" + integrity sha512-an/KZQzQUkZCkuoAA64hM92X0Urb6VpRhAFllDzz44U2mcD5scmT3zBc4VgVpkugF580+DQn8eAFSyoQt0tznA== + dependencies: + chownr "^2.0.0" + fs-minipass "^2.0.0" + minipass "^3.0.0" + minizlib "^2.1.1" + mkdirp "^1.0.3" + yallist "^4.0.0" + taskr@1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/taskr/-/taskr-1.1.0.tgz#4f29d0ace26f4deae9a478eabf9aa0432e884438" @@ -20405,7 +20640,7 @@ type-fest@^0.8.1: version "0.8.1" resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.8.1.tgz#09e249ebde851d3b1e48d27c105444667f17b83d" -type-is@~1.6.17, type-is@~1.6.18: +type-is@^1.6.4, type-is@~1.6.17, type-is@~1.6.18: version "1.6.18" resolved "https://registry.yarnpkg.com/type-is/-/type-is-1.6.18.tgz#4e552cd05df09467dcbc4ef739de89f2cf37c131" dependencies: